@rainmanhhh/pi-web 0.15.7 → 0.15.8

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 (91) hide show
  1. package/dist/server.mjs +1 -1
  2. package/dist/static/assets/{CodeMirrorEditor-BsodzoJM.js → CodeMirrorEditor-D38J6Jjv.js} +1 -1
  3. package/dist/static/assets/{abnfDiagram-VCTEODGH-Dr8_sp_I.js → abnfDiagram-VCTEODGH-DrRmGlcv.js} +1 -1
  4. package/dist/static/assets/architecture-7GRP2DOG-Bkagt9Ld.js +1 -0
  5. package/dist/static/assets/{architectureDiagram-5GKGNRK7-PrmURMnY.js → architectureDiagram-5GKGNRK7-BGMOEsiF.js} +1 -1
  6. package/dist/static/assets/{blockDiagram-I7D4REHJ-PBCnqhDB.js → blockDiagram-I7D4REHJ-CWk0U9-3.js} +1 -1
  7. package/dist/static/assets/{c4Diagram-7LVT6UL2-BChXC8TK.js → c4Diagram-7LVT6UL2-CyZBdhZf.js} +1 -1
  8. package/dist/static/assets/channel-CTDKUTTx.js +1 -0
  9. package/dist/static/assets/{chunk-4HAMMTFA-COC9meJx.js → chunk-4HAMMTFA-BQOYrrd_.js} +1 -1
  10. package/dist/static/assets/{chunk-75Z2AOVW-CORN0UqO.js → chunk-75Z2AOVW-CQ7qk5L7.js} +1 -1
  11. package/dist/static/assets/{chunk-DU6HZSFF-BwNAWU8T.js → chunk-DU6HZSFF-gQEPAv4K.js} +1 -1
  12. package/dist/static/assets/{chunk-F27PBJKO-pYLTgJTx.js → chunk-F27PBJKO-DiThgtj8.js} +1 -1
  13. package/dist/static/assets/{chunk-GMAD6QVW-Cqw9-89m.js → chunk-GMAD6QVW-DJeYdweU.js} +1 -1
  14. package/dist/static/assets/{chunk-GVQU2GXP-DG5Q-_ME.js → chunk-GVQU2GXP-D2J0qVk0.js} +1 -1
  15. package/dist/static/assets/{chunk-IMKFNOWR-CmyNNtcd.js → chunk-IMKFNOWR-BiYzs3e3.js} +1 -1
  16. package/dist/static/assets/{chunk-L3NEJ4N5-32coNd0b.js → chunk-L3NEJ4N5-CNaJuPV1.js} +1 -1
  17. package/dist/static/assets/{chunk-OSK3NFVY-C0yyTerx.js → chunk-OSK3NFVY-DFPLKK-i.js} +1 -1
  18. package/dist/static/assets/{chunk-P2QGCYS3-D2TnZGjh.js → chunk-P2QGCYS3-Cy9r93Cy.js} +1 -1
  19. package/dist/static/assets/{chunk-POPQ4Y6H-BHvArJPA.js → chunk-POPQ4Y6H-CCqAzjOp.js} +1 -1
  20. package/dist/static/assets/{chunk-PWAF6VOD-BoiIT3Yi.js → chunk-PWAF6VOD-CDTIgnEH.js} +1 -1
  21. package/dist/static/assets/{chunk-SHT3W25Y-BuVhP2xo.js → chunk-SHT3W25Y-lDSkYmgW.js} +1 -1
  22. package/dist/static/assets/{chunk-SVP7TREG-DKsGRdGN.js → chunk-SVP7TREG-DctD6R45.js} +1 -1
  23. package/dist/static/assets/{chunk-TICWLB2K-CP6ghlU8.js → chunk-TICWLB2K-hD3FwC0H.js} +1 -1
  24. package/dist/static/assets/classDiagram-ZZMXUADV-QGo_38-v.js +1 -0
  25. package/dist/static/assets/classDiagram-v2-VYDZK3BY-QGo_38-v.js +1 -0
  26. package/dist/static/assets/{cynefin-OW5HDTMX-CsMB1drO.js → cynefin-OW5HDTMX-BhiqxY__.js} +1 -1
  27. package/dist/static/assets/{cynefinDiagram-5FMLGOSQ-ByhYbYYN.js → cynefinDiagram-5FMLGOSQ-kwt6XPcm.js} +1 -1
  28. package/dist/static/assets/{dagre-GXQ25YYZ-CwnLbVWf.js → dagre-GXQ25YYZ-7nNlXM6K.js} +1 -1
  29. package/dist/static/assets/{diagram-S7CK7UJ4-Cj8b_clp.js → diagram-S7CK7UJ4-CUZzCrWd.js} +1 -1
  30. package/dist/static/assets/{diagram-UQ7AKVKN-DKPcr17v.js → diagram-UQ7AKVKN-DOUvNuqI.js} +1 -1
  31. package/dist/static/assets/{diagram-VSXAHHWV-B-VXUjrH.js → diagram-VSXAHHWV-lwPLYeaz.js} +1 -1
  32. package/dist/static/assets/{diagram-VX7I27RA-BDVfPKqv.js → diagram-VX7I27RA-36zw6Tnc.js} +1 -1
  33. package/dist/static/assets/{diagram-Z3DM3KII-YyugQwHQ.js → diagram-Z3DM3KII-BkTUauyX.js} +1 -1
  34. package/dist/static/assets/{ebnfDiagram-PWID7BFC-D633oQwi.js → ebnfDiagram-PWID7BFC-Dr7tFCsQ.js} +1 -1
  35. package/dist/static/assets/{erDiagram-RLTQ6QDP-BXLNCxJI.js → erDiagram-RLTQ6QDP-B1GniP27.js} +1 -1
  36. package/dist/static/assets/eventmodeling-NTZA5JFV-BYfAcU59.js +1 -0
  37. package/dist/static/assets/flowDiagram-HODETNUW-C79p9nm9.js +1 -0
  38. package/dist/static/assets/{ganttDiagram-EL5Y4UJY-D3_AZ0YW.js → ganttDiagram-EL5Y4UJY-Dur5WpYB.js} +1 -1
  39. package/dist/static/assets/{gitGraph-4MIJSDKK-De3-LT3R.js → gitGraph-4MIJSDKK-B5g39W-t.js} +1 -1
  40. package/dist/static/assets/{gitGraphDiagram-WWUBYQGX-DoxDhA_b.js → gitGraphDiagram-WWUBYQGX-BC-sRFCY.js} +1 -1
  41. package/dist/static/assets/{highlighted-body-KPVGNVTW-DdZUyfi_.js → highlighted-body-KPVGNVTW-DDwKoMwN.js} +1 -1
  42. package/dist/static/assets/{index-DDPR0x8b.js → index-m7AkDa4m.js} +7 -7
  43. package/dist/static/assets/{info-A6RAGUB7-F656px0n.js → info-A6RAGUB7-B_qz66nq.js} +1 -1
  44. package/dist/static/assets/{infoDiagram-27XIBGKW-CUfVAtwu.js → infoDiagram-27XIBGKW-C8qDr3co.js} +1 -1
  45. package/dist/static/assets/{ishikawaDiagram-5VMMS53U-CeEmZeNH.js → ishikawaDiagram-5VMMS53U-B3vmXbwS.js} +1 -1
  46. package/dist/static/assets/{journeyDiagram-3NMN7TZE-BmBimMSP.js → journeyDiagram-3NMN7TZE-VoND5E_X.js} +1 -1
  47. package/dist/static/assets/{kanban-definition-UXKFOSKX-DeuR1HZC.js → kanban-definition-UXKFOSKX-B6tBc5ZB.js} +1 -1
  48. package/dist/static/assets/{line-D7aArS-j.js → line-CR6yL_Gt.js} +1 -1
  49. package/dist/static/assets/mermaid-HWGCJPDP-L9BkEiJW.js +1 -0
  50. package/dist/static/assets/{mermaid-parser.core-CAc4Uy3T.js → mermaid-parser.core-CYOVMGaT.js} +3 -3
  51. package/dist/static/assets/{mermaid.core-Ta81F5Ju.js → mermaid.core-B9Pni-_1.js} +4 -4
  52. package/dist/static/assets/{mindmap-definition-YA3MSWOX-CJoFtMQy.js → mindmap-definition-YA3MSWOX-B1IJlXqS.js} +1 -1
  53. package/dist/static/assets/{packet-AYTQ26CC-jXgJ_WXC.js → packet-AYTQ26CC-CaK0ChyQ.js} +1 -1
  54. package/dist/static/assets/{pegDiagram-XKGWAZYB-C5yux6xw.js → pegDiagram-XKGWAZYB-uGj89D_V.js} +1 -1
  55. package/dist/static/assets/{pie-WAS4IAKB-BCJq82h-.js → pie-WAS4IAKB-BqdQNVFt.js} +1 -1
  56. package/dist/static/assets/{pieDiagram-E7YTZNPT-BxZVUc-I.js → pieDiagram-E7YTZNPT-SnDQqKzG.js} +1 -1
  57. package/dist/static/assets/{quadrantDiagram-AXDQQJYC-DErYBv-F.js → quadrantDiagram-AXDQQJYC-xhShqyaw.js} +1 -1
  58. package/dist/static/assets/{radar-RG4KPBEZ-BF5-8So9.js → radar-RG4KPBEZ-D8cfQwWI.js} +1 -1
  59. package/dist/static/assets/{railroad-74A4TZTK-BDjogURW.js → railroad-74A4TZTK-yv2r4B0O.js} +1 -1
  60. package/dist/static/assets/railroad-abnf-HS5TGJTU-BZuj4_cg.js +1 -0
  61. package/dist/static/assets/railroad-ebnf-LZEXJU2U-CQN-DSnP.js +1 -0
  62. package/dist/static/assets/railroad-peg-WCYAUIDC-B6yWvyMy.js +1 -0
  63. package/dist/static/assets/{railroadDiagram-O6MQD6OU-BgzauuHk.js → railroadDiagram-O6MQD6OU-DRrUyHCd.js} +1 -1
  64. package/dist/static/assets/{requirementDiagram-BXWQKSXE-E2ez9Njw.js → requirementDiagram-BXWQKSXE-BHXyAaBK.js} +1 -1
  65. package/dist/static/assets/{sankeyDiagram-P5KCCOFB-DWIEoETG.js → sankeyDiagram-P5KCCOFB-XtrJImNS.js} +1 -1
  66. package/dist/static/assets/{sequenceDiagram-WJ2MYXX4-DrwtML7L.js → sequenceDiagram-WJ2MYXX4-CrGq2RpL.js} +1 -1
  67. package/dist/static/assets/{stateDiagram-D77RDMKH-BlSBZvPQ.js → stateDiagram-D77RDMKH-CLSWV-sz.js} +1 -1
  68. package/dist/static/assets/stateDiagram-v2-MP3YSRHH-DqzmxpJE.js +1 -0
  69. package/dist/static/assets/{swimlanes-42K2YHIH-BjYWL7FA.js → swimlanes-42K2YHIH-DA5cTpLJ.js} +1 -1
  70. package/dist/static/assets/swimlanesDiagram-VR7AAH4N-B8Ne5Hjz.js +8 -0
  71. package/dist/static/assets/{timeline-definition-24CTP7MA-36x5-q4s.js → timeline-definition-24CTP7MA-C1tjneIk.js} +1 -1
  72. package/dist/static/assets/{treeView-Q6P3EWNA-DA_S_dXb.js → treeView-Q6P3EWNA-BCHANGsb.js} +1 -1
  73. package/dist/static/assets/{treemap-WGGIJYW6-C0fGvYQn.js → treemap-WGGIJYW6-b_xSQR9L.js} +1 -1
  74. package/dist/static/assets/{vennDiagram-4TSXK5OY-5qW7nCEM.js → vennDiagram-4TSXK5OY-DMLqiY4p.js} +1 -1
  75. package/dist/static/assets/{wardley-WFR3VGLG-Xb0bOGpc.js → wardley-WFR3VGLG-D232bcul.js} +1 -1
  76. package/dist/static/assets/{wardleyDiagram-VM6X3IG4-CTj9hbq8.js → wardleyDiagram-VM6X3IG4-BPuUZZS2.js} +1 -1
  77. package/dist/static/assets/{xychartDiagram-S5SC5T6Z-BAFQXJA0.js → xychartDiagram-S5SC5T6Z-DhSyoBzY.js} +1 -1
  78. package/dist/static/index.html +1 -1
  79. package/package.json +1 -1
  80. package/dist/static/assets/architecture-7GRP2DOG-CJuZDbHH.js +0 -1
  81. package/dist/static/assets/channel-BKweKDiS.js +0 -1
  82. package/dist/static/assets/classDiagram-ZZMXUADV-C7gWdn5i.js +0 -1
  83. package/dist/static/assets/classDiagram-v2-VYDZK3BY-C7gWdn5i.js +0 -1
  84. package/dist/static/assets/eventmodeling-NTZA5JFV-kwlsA-Qn.js +0 -1
  85. package/dist/static/assets/flowDiagram-HODETNUW-CRAGJfeg.js +0 -1
  86. package/dist/static/assets/mermaid-HWGCJPDP-BrB2pBlI.js +0 -1
  87. package/dist/static/assets/railroad-abnf-HS5TGJTU-DyB87-6L.js +0 -1
  88. package/dist/static/assets/railroad-ebnf-LZEXJU2U-CUrg2S9M.js +0 -1
  89. package/dist/static/assets/railroad-peg-WCYAUIDC-BYNTQnjo.js +0 -1
  90. package/dist/static/assets/stateDiagram-v2-MP3YSRHH-DeJ_f-yy.js +0 -1
  91. package/dist/static/assets/swimlanesDiagram-VR7AAH4N-kcBdWrJY.js +0 -8
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-KPVGNVTW-DdZUyfi_.js","assets/rolldown-runtime-hePW80VL.js","assets/mermaid.core-Ta81F5Ju.js","assets/chunk-75Z2AOVW-CORN0UqO.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-B6xuSHsQ.js","assets/chunk-DU6HZSFF-BwNAWU8T.js","assets/dist-v5Q1xZ2K.js","assets/chunk-PWAF6VOD-BoiIT3Yi.js","assets/chunk-GMAD6QVW-Cqw9-89m.js","assets/chunk-P2QGCYS3-D2TnZGjh.js","assets/chunk-4HAMMTFA-COC9meJx.js","assets/rough.esm-Dy-Kn_BL.js","assets/chunk-GVQU2GXP-DG5Q-_ME.js","assets/chunk-OSK3NFVY-C0yyTerx.js","assets/line-D7aArS-j.js","assets/path-fybaL0A-.js","assets/array-BifhSqXX.js","assets/graphlib-DS17s2tU.js","assets/chunk-L3NEJ4N5-32coNd0b.js","assets/CodeMirrorEditor-BsodzoJM.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-KPVGNVTW-DDwKoMwN.js","assets/rolldown-runtime-hePW80VL.js","assets/mermaid.core-B9Pni-_1.js","assets/chunk-75Z2AOVW-CQ7qk5L7.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-B6xuSHsQ.js","assets/chunk-DU6HZSFF-gQEPAv4K.js","assets/dist-v5Q1xZ2K.js","assets/chunk-PWAF6VOD-CDTIgnEH.js","assets/chunk-GMAD6QVW-DJeYdweU.js","assets/chunk-P2QGCYS3-Cy9r93Cy.js","assets/chunk-4HAMMTFA-BQOYrrd_.js","assets/rough.esm-Dy-Kn_BL.js","assets/chunk-GVQU2GXP-D2J0qVk0.js","assets/chunk-OSK3NFVY-DFPLKK-i.js","assets/line-CR6yL_Gt.js","assets/path-fybaL0A-.js","assets/array-BifhSqXX.js","assets/graphlib-DS17s2tU.js","assets/chunk-L3NEJ4N5-CNaJuPV1.js","assets/CodeMirrorEditor-D38J6Jjv.js"])))=>i.map(i=>d[i]);
2
2
  import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var r=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ee(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var F=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},I={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=I,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ee}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,F)}catch(e){F(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),i=n(((e,t)=>{t.exports=r()})),a=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),o=n(((e,t)=>{t.exports=a()})),s=n((e=>{var t=i();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.8`})),c=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=s()})),l=n((e=>{var t=o(),n=i(),r=c();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(a(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return f(i),e;if(o===r)return f(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=o;break}if(c===r){s=!0,r=i,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,r=i;break}if(c===r){s=!0,r=o,n=i;break}c=c.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var ee=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function ie(e){return{current:e}}function ae(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function L(e,t){re++,ne[re]=e.current,e.current=t}var R=ie(null),oe=ie(null),z=ie(null),se=ie(null);function ce(e,t){switch(L(z,t),L(oe,e),L(R,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?tf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=tf(t),e=nf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(R),L(R,e)}function le(){ae(R),ae(oe),ae(z)}function ue(e){e.memoizedState!==null&&L(se,e);var t=R.current,n=nf(t,e.type);t!==n&&(L(oe,e),L(R,n))}function de(e){oe.current===e&&(ae(R),ae(oe)),se.current===e&&(ae(se),fp._currentValue=te)}var fe,pe;function me(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``,pe=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+fe+e+pe}var he=!1;function ge(e,t){if(!e||he)return``;he=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
@@ -7,7 +7,7 @@ import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";(function(){let
7
7
  `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{he=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?me(n):``}function _e(e,t){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me(`Lazy`);case 13:return e.child!==t&&t!==null?me(`Suspense Fallback`):me(`Suspense`);case 19:return me(`SuspenseList`);case 0:case 15:return ge(e.type,!1);case 11:return ge(e.type.render,!1);case 1:return ge(e.type,!0);case 31:return me(`Activity`);default:return``}}function ve(e){try{var t=``,n=null;do t+=_e(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
8
  Error generating stack: `+e.message+`
9
9
  `+e.stack}}var ye=Object.prototype.hasOwnProperty,be=t.unstable_scheduleCallback,xe=t.unstable_cancelCallback,Se=t.unstable_shouldYield,Ce=t.unstable_requestPaint,we=t.unstable_now,Te=t.unstable_getCurrentPriorityLevel,Ee=t.unstable_ImmediatePriority,De=t.unstable_UserBlockingPriority,Oe=t.unstable_NormalPriority,ke=t.unstable_LowPriority,Ae=t.unstable_IdlePriority,je=t.log,Me=t.unstable_setDisableYieldValue,Ne=null,Pe=null;function Fe(e){if(typeof je==`function`&&Me(e),Pe&&typeof Pe.setStrictMode==`function`)try{Pe.setStrictMode(Ne,e)}catch{}}var Ie=Math.clz32?Math.clz32:ze,Le=Math.log,Re=Math.LN2;function ze(e){return e>>>=0,e===0?32:31-(Le(e)/Re|0)|0}var Be=256,Ve=262144,He=4194304;function Ue(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function We(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ue(n))):i=Ue(o):i=Ue(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ue(n))):i=Ue(o)):i=Ue(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ge(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ke(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qe(){var e=He;return He<<=1,!(He&62914560)&&(He=4194304),e}function Je(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ye(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Xe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ie(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ze(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ze(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ie(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Qe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ie(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function $e(e,t){var n=t&-t;return n=n&42?1:et(n),(n&(e.suspendedLanes|t))===0?n:0}function et(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function tt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function nt(){var e=I.p;return e===0?(e=window.event,e===void 0?32:Op(e.type)):e}function rt(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var it=Math.random().toString(36).slice(2),at=`__reactFiber$`+it,ot=`__reactProps$`+it,st=`__reactContainer$`+it,ct=`__reactEvents$`+it,lt=`__reactListeners$`+it,ut=`__reactHandles$`+it,dt=`__reactResources$`+it,ft=`__reactMarker$`+it;function pt(e){delete e[at],delete e[ot],delete e[ct],delete e[lt],delete e[ut]}function mt(e){var t=e[at];if(t)return t;for(var n=e.parentNode;n;){if(t=n[st]||n[at]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Tf(e);e!==null;){if(n=e[at])return n;e=Tf(e)}return t}e=n,n=e.parentNode}return null}function ht(e){if(e=e[at]||e[st]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function gt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function _t(e){var t=e[dt];return t||=e[dt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function vt(e){e[ft]=!0}var yt=new Set,bt={};function xt(e,t){St(e,t),St(e+`Capture`,t)}function St(e,t){for(bt[e]=t,e=0;e<t.length;e++)yt.add(t[e])}var Ct=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),wt={},Tt={};function Et(e){return ye.call(Tt,e)?!0:ye.call(wt,e)?!1:Ct.test(e)?Tt[e]=!0:(wt[e]=!0,!1)}function Dt(e,t,n){if(Et(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function Ot(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function kt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function At(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function jt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Mt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Nt(e){if(!e._valueTracker){var t=jt(e)?`checked`:`value`;e._valueTracker=Mt(e,t,``+e[t])}}function Pt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=jt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Ft(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var It=/[\n"\\]/g;function Lt(e){return e.replace(It,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Rt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+At(t)):e.value!==``+At(t)&&(e.value=``+At(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Bt(e,o,At(n)):Bt(e,o,At(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+At(s):e.removeAttribute(`name`)}function zt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Nt(e);return}n=n==null?``:``+At(n),t=t==null?n:``+At(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Nt(e)}function Bt(e,t,n){t===`number`&&Ft(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Vt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+At(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ht(e,t,n){if(t!=null&&(t=``+At(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+At(n)}function Ut(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(ee(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=At(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Nt(e)}function Wt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Gt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Kt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Gt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function qt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Kt(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&Kt(e,o,t[o])}function Jt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Yt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Xt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Zt(e){return Xt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Qt(){}var $t=null;function en(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tn=null,nn=null;function rn(e){var t=ht(e);if(t&&(e=t.stateNode)){var n=e[ot]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Rt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Lt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[ot]||null;if(!i)throw Error(a(90));Rt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Pt(r)}break a;case`textarea`:Ht(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Vt(e,!!n.multiple,t,!1)}}}var an=!1;function on(e,t,n){if(an)return e(t,n);an=!0;try{return e(t)}finally{if(an=!1,(tn!==null||nn!==null)&&(ju(),tn&&(t=tn,e=nn,nn=tn=null,rn(t),e)))for(t=0;t<e.length;t++)rn(e[t])}}function sn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ot]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var cn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),ln=!1;if(cn)try{var un={};Object.defineProperty(un,"passive",{get:function(){ln=!0}}),window.addEventListener(`test`,un,un),window.removeEventListener(`test`,un,un)}catch{ln=!1}var dn=null,fn=null,pn=null;function mn(){if(pn)return pn;var e,t=fn,n=t.length,r,i=`value`in dn?dn.value:dn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return pn=i.slice(e,1<r?1-r:void 0)}function hn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function gn(){return!0}function _n(){return!1}function vn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?gn:_n,this.isPropagationStopped=_n,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=gn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=gn)},persist:function(){},isPersistent:gn}),t}var yn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bn=vn(yn),xn=h({},yn,{view:0,detail:0}),Sn=vn(xn),Cn,wn,Tn,En=h({},xn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ln,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Tn&&(Tn&&e.type===`mousemove`?(Cn=e.screenX-Tn.screenX,wn=e.screenY-Tn.screenY):wn=Cn=0,Tn=e),Cn)},movementY:function(e){return`movementY`in e?e.movementY:wn}}),Dn=vn(En),On=vn(h({},En,{dataTransfer:0})),kn=vn(h({},xn,{relatedTarget:0})),An=vn(h({},yn,{animationName:0,elapsedTime:0,pseudoElement:0})),jn=vn(h({},yn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Mn=vn(h({},yn,{data:0})),Nn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Pn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Fn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function In(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fn[e])?!!t[e]:!1}function Ln(){return In}var Rn=vn(h({},xn,{key:function(e){if(e.key){var t=Nn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=hn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Pn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ln,charCode:function(e){return e.type===`keypress`?hn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?hn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),zn=vn(h({},En,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Bn=vn(h({},xn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ln})),Vn=vn(h({},yn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Hn=vn(h({},En,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Un=vn(h({},yn,{newState:0,oldState:0})),Wn=[9,13,27,32],Gn=cn&&`CompositionEvent`in window,Kn=null;cn&&`documentMode`in document&&(Kn=document.documentMode);var qn=cn&&`TextEvent`in window&&!Kn,Jn=cn&&(!Gn||Kn&&8<Kn&&11>=Kn),Yn=` `,Xn=!1;function Zn(e,t){switch(e){case`keyup`:return Wn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var $n=!1;function er(e,t){switch(e){case`compositionend`:return Qn(t);case`keypress`:return t.which===32?(Xn=!0,Yn):null;case`textInput`:return e=t.data,e===Yn&&Xn?null:e;default:return null}}function tr(e,t){if($n)return e===`compositionend`||!Gn&&Zn(e,t)?(e=mn(),pn=fn=dn=null,$n=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Jn&&t.locale!==`ko`?null:t.data;default:return null}}var nr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!nr[e.type]:t===`textarea`}function ir(e,t,n,r){tn?nn?nn.push(r):nn=[r]:tn=r,t=zd(t,`onChange`),0<t.length&&(n=new bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ar=null,or=null;function sr(e){jd(e,0)}function cr(e){if(Pt(gt(e)))return e}function lr(e,t){if(e===`change`)return t}var ur=!1;if(cn){var dr;if(cn){var fr=`oninput`in document;if(!fr){var pr=document.createElement(`div`);pr.setAttribute(`oninput`,`return;`),fr=typeof pr.oninput==`function`}dr=fr}else dr=!1;ur=dr&&(!document.documentMode||9<document.documentMode)}function mr(){ar&&(ar.detachEvent(`onpropertychange`,hr),or=ar=null)}function hr(e){if(e.propertyName===`value`&&cr(or)){var t=[];ir(t,or,e,en(e)),on(sr,t)}}function gr(e,t,n){e===`focusin`?(mr(),ar=t,or=n,ar.attachEvent(`onpropertychange`,hr)):e===`focusout`&&mr()}function _r(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return cr(or)}function vr(e,t){if(e===`click`)return cr(t)}function yr(e,t){if(e===`input`||e===`change`)return cr(t)}function br(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var xr=typeof Object.is==`function`?Object.is:br;function Sr(e,t){if(xr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ye.call(t,i)||!xr(e[i],t[i]))return!1}return!0}function Cr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wr(e,t){var n=Cr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Cr(n)}}function Tr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Er(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ft(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ft(e.document)}return t}function Dr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Or=cn&&`documentMode`in document&&11>=document.documentMode,kr=null,Ar=null,jr=null,Mr=!1;function Nr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mr||kr==null||kr!==Ft(r)||(r=kr,`selectionStart`in r&&Dr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),jr&&Sr(jr,r)||(jr=r,r=zd(Ar,`onSelect`),0<r.length&&(t=new bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=kr)))}function Pr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Fr={animationend:Pr(`Animation`,`AnimationEnd`),animationiteration:Pr(`Animation`,`AnimationIteration`),animationstart:Pr(`Animation`,`AnimationStart`),transitionrun:Pr(`Transition`,`TransitionRun`),transitionstart:Pr(`Transition`,`TransitionStart`),transitioncancel:Pr(`Transition`,`TransitionCancel`),transitionend:Pr(`Transition`,`TransitionEnd`)},Ir={},Lr={};cn&&(Lr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Fr.animationend.animation,delete Fr.animationiteration.animation,delete Fr.animationstart.animation),`TransitionEvent`in window||delete Fr.transitionend.transition);function Rr(e){if(Ir[e])return Ir[e];if(!Fr[e])return e;var t=Fr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Lr)return Ir[e]=t[n];return e}var zr=Rr(`animationend`),Br=Rr(`animationiteration`),Vr=Rr(`animationstart`),Hr=Rr(`transitionrun`),Ur=Rr(`transitionstart`),Wr=Rr(`transitioncancel`),Gr=Rr(`transitionend`),Kr=new Map,qr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);qr.push(`scrollEnd`);function Jr(e,t){Kr.set(e,t),xt(t,[e])}var Yr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Xr=[],Zr=0,Qr=0;function $r(){for(var e=Zr,t=Qr=Zr=0;t<e;){var n=Xr[t];Xr[t++]=null;var r=Xr[t];Xr[t++]=null;var i=Xr[t];Xr[t++]=null;var a=Xr[t];if(Xr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ri(n,i,a)}}function ei(e,t,n,r){Xr[Zr++]=e,Xr[Zr++]=t,Xr[Zr++]=n,Xr[Zr++]=r,Qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ti(e,t,n,r){return ei(e,t,n,r),ii(e)}function ni(e,t){return ei(e,null,null,t),ii(e)}function ri(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ie(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ii(e){if(50<Su)throw Su=0,Cu=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ai={};function oi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function si(e,t,n,r){return new oi(e,t,n,r)}function ci(e){return e=e.prototype,!(!e||!e.isReactComponent)}function li(e,t){var n=e.alternate;return n===null?(n=si(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ui(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function di(e,t,n,r,i,o){var s=0;if(r=e,typeof e==`function`)ci(e)&&(s=1);else if(typeof e==`string`)s=rp(e,n,R.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=si(31,n,t,i),e.elementType=k,e.lanes=o,e;case y:return fi(n.children,i,o,t);case b:s=8,i|=24;break;case x:return e=si(12,n,t,i|2),e.elementType=x,e.lanes=o,e;case T:return e=si(13,n,t,i),e.elementType=T,e.lanes=o,e;case E:return e=si(19,n,t,i),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=si(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function fi(e,t,n,r){return e=si(7,e,r,t),e.lanes=n,e}function pi(e,t,n){return e=si(6,e,null,t),e.lanes=n,e}function mi(e){var t=si(18,null,null,0);return t.stateNode=e,t}function hi(e,t,n){return t=si(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gi=new WeakMap;function _i(e,t){if(typeof e==`object`&&e){var n=gi.get(e);return n===void 0?(t={value:e,source:t,stack:ve(t)},gi.set(e,t),t):n}return{value:e,source:t,stack:ve(t)}}var vi=[],yi=0,bi=null,xi=0,Si=[],Ci=0,wi=null,Ti=1,Ei=``;function Di(e,t){vi[yi++]=xi,vi[yi++]=bi,bi=e,xi=t}function Oi(e,t,n){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,wi=e;var r=Ti;e=Ei;var i=32-Ie(r)-1;r&=~(1<<i),n+=1;var a=32-Ie(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ti=1<<32-Ie(t)+i|n<<i|r,Ei=a+e}else Ti=1<<a|n<<i|r,Ei=e}function ki(e){e.return!==null&&(Di(e,1),Oi(e,1,0))}function Ai(e){for(;e===bi;)bi=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null;for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ei=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null}function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,Ti=t.id,Ei=t.overflow,wi=e}var Mi=null,Ni=null,Pi=!1,Fi=null,Ii=!1,Li=Error(a(519));function Ri(e){throw Wi(_i(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Li}function zi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[at]=e,t[ot]=r,n){case`dialog`:Md(`cancel`,t),Md(`close`,t);break;case`iframe`:case`object`:case`embed`:Md(`load`,t);break;case`video`:case`audio`:for(n=0;n<kd.length;n++)Md(kd[n],t);break;case`source`:Md(`error`,t);break;case`img`:case`image`:case`link`:Md(`error`,t),Md(`load`,t);break;case`details`:Md(`toggle`,t);break;case`input`:Md(`invalid`,t),zt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Md(`invalid`,t);break;case`textarea`:Md(`invalid`,t),Ut(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Gd(t.textContent,n)?(r.popover!=null&&(Md(`beforetoggle`,t),Md(`toggle`,t)),r.onScroll!=null&&Md(`scroll`,t),r.onScrollEnd!=null&&Md(`scrollend`,t),r.onClick!=null&&(t.onclick=Qt),t=!0):t=!1,t||Ri(e,!0)}function Bi(e){for(Mi=e.return;Mi;)switch(Mi.tag){case 5:case 31:case 13:Ii=!1;return;case 27:case 3:Ii=!0;return;default:Mi=Mi.return}}function Vi(e){if(e!==Mi)return!1;if(!Pi)return Bi(e),Pi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||rf(e.type,e.memoizedProps)),n=!n),n&&Ni&&Ri(e),Bi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Ni=wf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Ni=wf(e)}else t===27?(t=Ni,ff(e.type)?(e=Cf,Cf=null,Ni=e):Ni=t):Ni=Mi?Sf(e.stateNode.nextSibling):null;return!0}function Hi(){Ni=Mi=null,Pi=!1}function Ui(){var e=Fi;return e!==null&&(cu===null?cu=e:cu.push.apply(cu,e),Fi=null),e}function Wi(e){Fi===null?Fi=[e]:Fi.push(e)}var Gi=ie(null),Ki=null,qi=null;function Ji(e,t,n){L(Gi,t._currentValue),t._currentValue=n}function Yi(e){e._currentValue=Gi.current,ae(Gi)}function Xi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Zi(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Xi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Xi(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function Qi(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;xr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===se.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[fp]:e.push(fp))}i=i.return}e!==null&&Zi(t,e,n,r),t.flags|=262144}function $i(e){for(e=e.firstContext;e!==null;){if(!xr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ea(e){Ki=e,qi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ta(e){return ra(Ki,e)}function na(e,t){return Ki===null&&ea(e),ra(e,t)}function ra(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},qi===null){if(e===null)throw Error(a(308));qi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qi=qi.next=t;return n}var ia=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},aa=t.unstable_scheduleCallback,oa=t.unstable_NormalPriority,sa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ca(){return{controller:new ia,data:new Map,refCount:0}}function la(e){e.refCount--,e.refCount===0&&aa(oa,function(){e.controller.abort()})}var ua=null,da=0,fa=0,pa=null;function ma(e,t){if(ua===null){var n=ua=[];da=0,fa=Cd(),pa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return da++,t.then(ha,ha),t}function ha(){if(--da===0&&ua!==null){pa!==null&&(pa.status=`fulfilled`);var e=ua;ua=null,fa=0,pa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ga(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var _a=F.S;F.S=function(e,t){du=we(),typeof t==`object`&&t&&typeof t.then==`function`&&ma(e,t),_a!==null&&_a(e,t)};var va=ie(null);function ya(){var e=va.current;return e===null?Kl.pooledCache:e}function ba(e,t){t===null?L(va,va.current):L(va,t.pool)}function xa(){var e=ya();return e===null?null:{parent:sa._currentValue,pool:e}}var Sa=Error(a(460)),Ca=Error(a(474)),wa=Error(a(542)),Ta={then:function(){}};function Ea(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Da(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Qt,Qt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e;default:if(typeof t.status==`string`)t.then(Qt,Qt);else{if(e=Kl,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e}throw ka=t,Sa}}function Oa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ka=e,Sa):e}}var ka=null;function Aa(){if(ka===null)throw Error(a(459));var e=ka;return ka=null,e}function ja(e){if(e===Sa||e===wa)throw Error(a(483))}var Ma=null,Na=0;function Pa(e){var t=Na;return Na+=1,Ma===null&&(Ma=[]),Da(Ma,e,t)}function Fa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ia(e,t){throw t.$$typeof===g?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function La(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=li(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=pi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===O&&Oa(a)===t.type)?(t=i(t,n.props),Fa(t,n),t.return=e,t):(t=di(n.type,n.key,n.props,null,e.mode,r),Fa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=hi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=fi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=di(t.type,t.key,t.props,null,e.mode,n),Fa(n,t),n.return=e,n;case v:return t=hi(t,e.mode,n),t.return=e,t;case O:return t=Oa(t),f(e,t,n)}if(ee(t)||M(t))return t=fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Pa(t),n);if(t.$$typeof===C)return f(e,na(e,t),n);Ia(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Oa(n),p(e,t,n,r)}if(ee(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Pa(n),r);if(n.$$typeof===C)return p(e,t,na(e,n),r);Ia(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Oa(r),m(e,t,n,r,i)}if(ee(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Pa(r),i);if(r.$$typeof===C)return m(e,t,n,na(t,r),i);Ia(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Pi&&Di(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Pi&&Di(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Pi&&Di(i,h),l}function g(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),Pi&&Di(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Pi&&Di(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),Pi&&Di(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Oa(l)===r.type){n(e,r.sibling),c=i(r,o.props),Fa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=fi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=di(o.type,o.key,o.props,null,e.mode,c),Fa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=hi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Oa(o),b(e,r,o,c)}if(ee(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Pa(o),c);if(o.$$typeof===C)return b(e,r,na(e,o),c);Ia(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Na=0;var i=b(e,t,n,r);return Ma=null,i}catch(t){if(t===Sa||t===wa)throw t;var a=si(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ra=La(!0),za=La(!1),Ba=!1;function Va(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ha(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ua(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Gl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ii(e),ri(e,null,n),t}return ei(e,r,t,n),ii(e)}function Ga(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qe(e,n)}}function Ka(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var qa=!1;function Ja(){if(qa){var e=pa;if(e!==null)throw e}}function Ya(e,t,n,r){qa=!1;var i=e.updateQueue;Ba=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Jl&f)===f:(r&f)===f){f!==0&&f===fa&&(qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ba=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),nu|=o,e.lanes=o,e.memoizedState=d}}function Xa(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Za(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Xa(n[e],t)}var Qa=ie(null),$a=ie(0);function eo(e,t){e=eu,L($a,e),L(Qa,t),eu=e|t.baseLanes}function to(){L($a,eu),L(Qa,Qa.current)}function no(){eu=$a.current,ae(Qa),ae($a)}var ro=ie(null),io=null;function ao(e){var t=e.alternate;L(uo,uo.current&1),L(ro,e),io===null&&(t===null||Qa.current!==null||t.memoizedState!==null)&&(io=e)}function oo(e){L(uo,uo.current),L(ro,e),io===null&&(io=e)}function so(e){e.tag===22?(L(uo,uo.current),L(ro,e),io===null&&(io=e)):co(e)}function co(){L(uo,uo.current),L(ro,ro.current)}function lo(e){ae(ro),io===e&&(io=null),ae(uo)}var uo=ie(0);function fo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||yf(n)||bf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var po=0,mo=null,ho=null,go=null,_o=!1,vo=!1,yo=!1,bo=0,xo=0,So=null,Co=0;function wo(){throw Error(a(321))}function To(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xr(e[n],t[n]))return!1;return!0}function Eo(e,t,n,r,i,a){return po=a,mo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?Us:Ws,yo=!1,a=n(r,i),yo=!1,vo&&(a=Oo(t,n,r,i)),Do(e),a}function Do(e){F.H=Hs;var t=ho!==null&&ho.next!==null;if(po=0,go=ho=mo=null,_o=!1,xo=0,So=null,t)throw Error(a(300));e===null||sc||(e=e.dependencies,e!==null&&$i(e)&&(sc=!0))}function Oo(e,t,n,r){mo=e;var i=0;do{if(vo&&(So=null),xo=0,vo=!1,25<=i)throw Error(a(301));if(i+=1,go=ho=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=Gs,o=t(n,r)}while(vo);return o}function ko(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?Io(t):t,e=e.useState()[0],(ho===null?null:ho.memoizedState)!==e&&(mo.flags|=1024),t}function Ao(){var e=bo!==0;return bo=0,e}function jo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Mo(e){if(_o){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_o=!1}po=0,go=ho=mo=null,vo=!1,xo=bo=0,So=null}function No(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return go===null?mo.memoizedState=go=e:go=go.next=e,go}function Po(){if(ho===null){var e=mo.alternate;e=e===null?null:e.memoizedState}else e=ho.next;var t=go===null?mo.memoizedState:go.next;if(t!==null)go=t,ho=e;else{if(e===null)throw mo.alternate===null?Error(a(467)):Error(a(310));ho=e,e={memoizedState:ho.memoizedState,baseState:ho.baseState,baseQueue:ho.baseQueue,queue:ho.queue,next:null},go===null?mo.memoizedState=go=e:go=go.next=e}return go}function Fo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Io(e){var t=xo;return xo+=1,So===null&&(So=[]),e=Da(So,e,t),t=mo,(go===null?t.memoizedState:go.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?Us:Ws),e}function Lo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Io(e);if(e.$$typeof===C)return ta(e)}throw Error(a(438,String(e)))}function Ro(e){var t=null,n=mo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=mo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Fo(),mo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function zo(e,t){return typeof t==`function`?t(e):t}function Bo(e){return Vo(Po(),ho,e)}function Vo(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(po&f)===f:(Jl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===fa&&(d=!0);else if((po&p)===p){u=u.next,p===fa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,mo.lanes|=p,nu|=p;f=u.action,yo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,mo.lanes|=f,nu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!xr(o,e.memoizedState)&&(sc=!0,d&&(n=pa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ho(e){var t=Po(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);xr(o,t.memoizedState)||(sc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Uo(e,t,n){var r=mo,i=Po(),o=Pi;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!xr((ho||i).memoizedState,n);if(s&&(i.memoizedState=n,sc=!0),i=i.queue,ms(Ko.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||go!==null&&go.memoizedState.tag&1){if(r.flags|=2048,ls(9,{destroy:void 0},Go.bind(null,r,i,n,t),null),Kl===null)throw Error(a(349));o||po&127||Wo(r,t,n)}return n}function Wo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=mo.updateQueue,t===null?(t=Fo(),mo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Go(e,t,n,r){t.value=n,t.getSnapshot=r,qo(t)&&Jo(e)}function Ko(e,t,n){return n(function(){qo(t)&&Jo(e)})}function qo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xr(e,n)}catch{return!0}}function Jo(e){var t=ni(e,2);t!==null&&Eu(t,e,2)}function Yo(e){var t=No();if(typeof e==`function`){var n=e;if(e=n(),yo){Fe(!0);try{n()}finally{Fe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:e},t}function Xo(e,t,n,r){return e.baseState=n,Vo(e,ho,typeof r==`function`?r:zo)}function Zo(e,t,n,r,i){if(zs(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Qo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Qo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),$o(e,t,s)}catch(n){ts(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),$o(e,t,a)}catch(n){ts(e,t,n)}}function $o(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){es(e,t,n)},function(n){return ts(e,t,n)}):es(e,t,n)}function es(e,t,n){t.status=`fulfilled`,t.value=n,ns(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Qo(e,n)))}function ts(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ns(t),t=t.next;while(t!==r)}e.action=null}function ns(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function rs(e,t){return t}function is(e,t){if(Pi){var n=Kl.formState;if(n!==null){a:{var r=mo;if(Pi){if(Ni){b:{for(var i=Ni,a=Ii;i.nodeType!==8;){if(!a){i=null;break b}if(i=Sf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ni=Sf(i.nextSibling),r=i.data===`F!`;break a}}Ri(r)}r=!1}r&&(t=n[0])}}return n=No(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:t},n.queue=r,n=Is.bind(null,mo,r),r.dispatch=n,r=Yo(!1),a=Rs.bind(null,mo,!1,r.queue),r=No(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Zo.bind(null,mo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function as(e){return os(Po(),ho,e)}function os(e,t,n){if(t=Vo(e,t,rs)[0],e=Bo(zo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Io(t)}catch(e){throw e===Sa?wa:e}else r=t;t=Po();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(mo.flags|=2048,ls(9,{destroy:void 0},ss.bind(null,i,n),null)),[r,a,e]}function ss(e,t){e.action=t}function cs(e){var t=Po(),n=ho;if(n!==null)return os(t,n,e);Po(),t=t.memoizedState,n=Po();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ls(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=mo.updateQueue,t===null&&(t=Fo(),mo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function us(){return Po().memoizedState}function ds(e,t,n,r){var i=No();mo.flags|=e,i.memoizedState=ls(1|t,{destroy:void 0},n,r===void 0?null:r)}function fs(e,t,n,r){var i=Po();r=r===void 0?null:r;var a=i.memoizedState.inst;ho!==null&&r!==null&&To(r,ho.memoizedState.deps)?i.memoizedState=ls(t,a,n,r):(mo.flags|=e,i.memoizedState=ls(1|t,a,n,r))}function ps(e,t){ds(8390656,8,e,t)}function ms(e,t){fs(2048,8,e,t)}function hs(e){mo.flags|=4;var t=mo.updateQueue;if(t===null)t=Fo(),mo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function gs(e){var t=Po().memoizedState;return hs({ref:t,nextImpl:e}),function(){if(Gl&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function _s(e,t){return fs(4,2,e,t)}function vs(e,t){return fs(4,4,e,t)}function ys(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function bs(e,t,n){n=n==null?null:n.concat([e]),fs(4,4,ys.bind(null,t,e),n)}function xs(){}function Ss(e,t){var n=Po();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&To(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Cs(e,t){var n=Po();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&To(t,r[1]))return r[0];if(r=e(),yo){Fe(!0);try{e()}finally{Fe(!1)}}return n.memoizedState=[r,t],r}function ws(e,t,n){return n===void 0||po&1073741824&&!(Jl&261930)?e.memoizedState=t:(e.memoizedState=n,e=Tu(),mo.lanes|=e,nu|=e,n)}function Ts(e,t,n,r){return xr(n,t)?n:Qa.current===null?!(po&42)||po&1073741824&&!(Jl&261930)?(sc=!0,e.memoizedState=n):(e=Tu(),mo.lanes|=e,nu|=e,t):(e=ws(e,n,r),xr(e,t)||(sc=!0),e)}function Es(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};F.T=s,Rs(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ls(e,t,ga(c,r),wu(e)):Ls(e,t,r,wu(e))}catch(n){Ls(e,t,{then:function(){},status:`rejected`,reason:n},wu())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function Ds(){}function Os(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=ks(e).queue;Es(e,i,t,te,n===null?Ds:function(){return As(e),n(r)})}function ks(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function As(e){var t=ks(e);t.next===null&&(t=e.alternate.memoizedState),Ls(e,t.next.queue,{},wu())}function js(){return ta(fp)}function Ms(){return Po().memoizedState}function Ns(){return Po().memoizedState}function Ps(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=wu();e=Ua(n);var r=Wa(t,e,n);r!==null&&(Eu(r,t,n),Ga(r,t,n)),t={cache:ca()},e.payload=t;return}t=t.return}}function Fs(e,t,n){var r=wu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},zs(e)?Bs(t,n):(n=ti(e,t,n,r),n!==null&&(Eu(n,e,r),Vs(n,t,r)))}function Is(e,t,n){Ls(e,t,n,wu())}function Ls(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(zs(e))Bs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,xr(s,o))return ei(e,t,i,0),Kl===null&&$r(),!1}catch{}if(n=ti(e,t,i,r),n!==null)return Eu(n,e,r),Vs(n,t,r),!0}return!1}function Rs(e,t,n,r){if(r={lane:2,revertLane:Cd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},zs(e)){if(t)throw Error(a(479))}else t=ti(e,n,r,2),t!==null&&Eu(t,e,2)}function zs(e){var t=e.alternate;return e===mo||t!==null&&t===mo}function Bs(e,t){vo=_o=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Vs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qe(e,n)}}var Hs={readContext:ta,use:Lo,useCallback:wo,useContext:wo,useEffect:wo,useImperativeHandle:wo,useLayoutEffect:wo,useInsertionEffect:wo,useMemo:wo,useReducer:wo,useRef:wo,useState:wo,useDebugValue:wo,useDeferredValue:wo,useTransition:wo,useSyncExternalStore:wo,useId:wo,useHostTransitionStatus:wo,useFormState:wo,useActionState:wo,useOptimistic:wo,useMemoCache:wo,useCacheRefresh:wo};Hs.useEffectEvent=wo;var Us={readContext:ta,use:Lo,useCallback:function(e,t){return No().memoizedState=[e,t===void 0?null:t],e},useContext:ta,useEffect:ps,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ds(4194308,4,ys.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ds(4194308,4,e,t)},useInsertionEffect:function(e,t){ds(4,2,e,t)},useMemo:function(e,t){var n=No();t=t===void 0?null:t;var r=e();if(yo){Fe(!0);try{e()}finally{Fe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=No();if(n!==void 0){var i=n(t);if(yo){Fe(!0);try{n(t)}finally{Fe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Fs.bind(null,mo,e),[r.memoizedState,e]},useRef:function(e){var t=No();return e={current:e},t.memoizedState=e},useState:function(e){e=Yo(e);var t=e.queue,n=Is.bind(null,mo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:xs,useDeferredValue:function(e,t){return ws(No(),e,t)},useTransition:function(){var e=Yo(!1);return e=Es.bind(null,mo,e.queue,!0,!1),No().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=mo,i=No();if(Pi){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Kl===null)throw Error(a(349));Jl&127||Wo(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,ps(Ko.bind(null,r,o,e),[e]),r.flags|=2048,ls(9,{destroy:void 0},Go.bind(null,r,o,n,t),null),n},useId:function(){var e=No(),t=Kl.identifierPrefix;if(Pi){var n=Ei,r=Ti;n=(r&~(1<<32-Ie(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=bo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Co++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:js,useFormState:is,useActionState:is,useOptimistic:function(e){var t=No();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Rs.bind(null,mo,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ro,useCacheRefresh:function(){return No().memoizedState=Ps.bind(null,mo)},useEffectEvent:function(e){var t=No(),n={impl:e};return t.memoizedState=n,function(){if(Gl&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Ws={readContext:ta,use:Lo,useCallback:Ss,useContext:ta,useEffect:ms,useImperativeHandle:bs,useInsertionEffect:_s,useLayoutEffect:vs,useMemo:Cs,useReducer:Bo,useRef:us,useState:function(){return Bo(zo)},useDebugValue:xs,useDeferredValue:function(e,t){return Ts(Po(),ho.memoizedState,e,t)},useTransition:function(){var e=Bo(zo)[0],t=Po().memoizedState;return[typeof e==`boolean`?e:Io(e),t]},useSyncExternalStore:Uo,useId:Ms,useHostTransitionStatus:js,useFormState:as,useActionState:as,useOptimistic:function(e,t){return Xo(Po(),ho,e,t)},useMemoCache:Ro,useCacheRefresh:Ns};Ws.useEffectEvent=gs;var Gs={readContext:ta,use:Lo,useCallback:Ss,useContext:ta,useEffect:ms,useImperativeHandle:bs,useInsertionEffect:_s,useLayoutEffect:vs,useMemo:Cs,useReducer:Ho,useRef:us,useState:function(){return Ho(zo)},useDebugValue:xs,useDeferredValue:function(e,t){var n=Po();return ho===null?ws(n,e,t):Ts(n,ho.memoizedState,e,t)},useTransition:function(){var e=Ho(zo)[0],t=Po().memoizedState;return[typeof e==`boolean`?e:Io(e),t]},useSyncExternalStore:Uo,useId:Ms,useHostTransitionStatus:js,useFormState:cs,useActionState:cs,useOptimistic:function(e,t){var n=Po();return ho===null?(n.baseState=e,[e,n.queue.dispatch]):Xo(n,ho,e,t)},useMemoCache:Ro,useCacheRefresh:Ns};Gs.useEffectEvent=gs;function Ks(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var qs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=wu(),i=Ua(r);i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(Eu(t,e,r),Ga(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=wu(),i=Ua(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(Eu(t,e,r),Ga(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=wu(),r=Ua(n);r.tag=2,t!=null&&(r.callback=t),t=Wa(e,r,n),t!==null&&(Eu(t,e,n),Ga(t,e,n))}};function Js(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Sr(n,r)||!Sr(i,a):!0}function Ys(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&qs.enqueueReplaceState(t,t.state,null)}function Xs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Zs(e){Yr(e)}function Qs(e){console.error(e)}function $s(e){Yr(e)}function ec(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function tc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function nc(e,t,n){return n=Ua(n),n.tag=3,n.payload={element:null},n.callback=function(){ec(e,t)},n}function rc(e){return e=Ua(e),e.tag=3,e}function ic(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){tc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){tc(t,n,r),typeof i!=`function`&&(mu===null?mu=new Set([this]):mu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function ac(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Qi(t,n,i,!0),n=ro.current,n!==null){switch(n.tag){case 31:case 13:return io===null?Ru():n.alternate===null&&tu===0&&(tu=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),rd(e,r,i)),!1;case 22:return n.flags|=65536,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),rd(e,r,i)),!1}throw Error(a(435,n.tag))}return rd(e,r,i),Ru(),!1}if(Pi)return t=ro.current,t===null?(r!==Li&&(t=Error(a(423),{cause:r}),Wi(_i(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=_i(r,n),i=nc(e.stateNode,r,i),Ka(e,i),tu!==4&&(tu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Li&&(e=Error(a(422),{cause:r}),Wi(_i(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=_i(o,n),su===null?su=[o]:su.push(o),tu!==4&&(tu=2),t===null)return!0;r=_i(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=nc(n.stateNode,r,e),Ka(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(mu===null||!mu.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=rc(i),ic(i,e,n,r),Ka(n,i),!1}n=n.return}while(n!==null);return!1}var oc=Error(a(461)),sc=!1;function cc(e,t,n,r){t.child=e===null?za(t,null,n,r):Ra(t,e.child,n,r)}function lc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ea(t),r=Eo(e,t,n,o,a,i),s=Ao(),e!==null&&!sc?(jo(e,t,i),Nc(e,t,i)):(Pi&&s&&ki(t),t.flags|=1,cc(e,t,r,i),t.child)}function uc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ci(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,dc(e,t,a,r,i)):(e=di(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Pc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Sr:n,n(o,r)&&e.ref===t.ref)return Nc(e,t,i)}return t.flags|=1,e=li(a,r),e.ref=t.ref,e.return=t,t.child=e}function dc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Sr(a,r)&&e.ref===t.ref){if(sc=!1,t.pendingProps=r=a,Pc(e,i))e.flags&131072&&(sc=!0);else return t.lanes=e.lanes,Nc(e,t,i)}}return yc(e,t,n,r,i)}function fc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return mc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ba(t,a===null?null:a.cachePool),a===null?to():eo(t,a),so(t);else return r=t.lanes=536870912,mc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ba(t,null),to(),co(t)):(ba(t,a.cachePool),eo(t,a),co(t),t.memoizedState=null);return cc(e,t,i,n),t.child}function pc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function mc(e,t,n,r,i){var a=ya();return a=a===null?null:{parent:sa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ba(t,null),to(),so(t),e!==null&&Qi(e,t,r,!0),t.childLanes=i,null}function hc(e,t){return t=Oc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function gc(e,t,n){return Ra(t,e.child,null,n),e=hc(t,t.pendingProps),e.flags|=2,lo(t),t.memoizedState=null,e}function _c(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(Pi){if(r.mode===`hidden`)return e=hc(t,r),t.lanes=536870912,pc(null,e);if(oo(t),(e=Ni)?(e=vf(e,Ii),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Ri(t);return t.lanes=536870912,null}return hc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(oo(t),i){if(t.flags&256)t.flags&=-257,t=gc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558))}else if(sc||Qi(e,t,n,!1),i=(n&e.childLanes)!==0,sc||i){if(r=Kl,r!==null&&(s=$e(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ni(e,s),Eu(r,e,s),oc;Ru(),t=gc(e,t,n)}else e=o.treeContext,Ni=Sf(s.nextSibling),Mi=t,Pi=!0,Fi=null,Ii=!1,e!==null&&ji(t,e),t=hc(t,r),t.flags|=4096;return t}return e=li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function vc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function yc(e,t,n,r,i){return ea(t),n=Eo(e,t,n,r,void 0,i),r=Ao(),e!==null&&!sc?(jo(e,t,i),Nc(e,t,i)):(Pi&&r&&ki(t),t.flags|=1,cc(e,t,n,i),t.child)}function bc(e,t,n,r,i,a){return ea(t),t.updateQueue=null,n=Oo(t,r,n,i),Do(e),r=Ao(),e!==null&&!sc?(jo(e,t,a),Nc(e,t,a)):(Pi&&r&&ki(t),t.flags|=1,cc(e,t,n,a),t.child)}function xc(e,t,n,r,i){if(ea(t),t.stateNode===null){var a=ai,o=n.contextType;typeof o==`object`&&o&&(a=ta(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=qs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Va(t),o=n.contextType,a.context=typeof o==`object`&&o?ta(o):ai,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ks(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&qs.enqueueReplaceState(a,a.state,null),Ya(t,r,a,i),Ja(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Xs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ai,typeof u==`object`&&u&&(o=ta(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ys(t,a,r,o),Ba=!1;var f=t.memoizedState;a.state=f,Ya(t,r,a,i),Ja(),l=t.memoizedState,s||f!==l||Ba?(typeof d==`function`&&(Ks(t,n,d,r),l=t.memoizedState),(c=Ba||Js(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ha(e,t),o=t.memoizedProps,u=Xs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ai,typeof l==`object`&&l&&(c=ta(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ys(t,a,r,c),Ba=!1,f=t.memoizedState,a.state=f,Ya(t,r,a,i),Ja();var p=t.memoizedState;o!==d||f!==p||Ba||e!==null&&e.dependencies!==null&&$i(e.dependencies)?(typeof s==`function`&&(Ks(t,n,s,r),p=t.memoizedState),(u=Ba||Js(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&$i(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,vc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ra(t,e.child,null,i),t.child=Ra(t,null,n,i)):cc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Nc(e,t,i),e}function Sc(e,t,n,r){return Hi(),t.flags|=256,cc(e,t,n,r),t.child}var Cc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function wc(e){return{baseLanes:e,cachePool:xa()}}function Tc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=au),e}function Ec(e,t,n){var r=t.pendingProps,i=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(uo.current&2)),s&&(i=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Pi){if(i?ao(t):co(t),(e=Ni)?(e=vf(e,Ii),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Ri(t);return bf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(co(t),i=t.mode,c=Oc({mode:`hidden`,children:c},i),r=fi(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=wc(n),r.childLanes=Tc(e,s,n),t.memoizedState=Cc,pc(null,r)):(ao(t),Dc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(ao(t),t.flags&=-257,t=kc(e,t,n)):t.memoizedState===null?(co(t),c=r.fallback,i=t.mode,r=Oc({mode:`visible`,children:r.children},i),c=fi(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ra(t,e.child,null,n),r=t.child,r.memoizedState=wc(n),r.childLanes=Tc(e,s,n),t.memoizedState=Cc,t=pc(null,r)):(co(t),t.child=e.child,t.flags|=128,t=null);else if(ao(t),bf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(a(419)),r.stack=``,r.digest=s,Wi({value:r,source:null,stack:null}),t=kc(e,t,n)}else if(sc||Qi(e,t,n,!1),s=(n&e.childLanes)!==0,sc||s){if(s=Kl,s!==null&&(r=$e(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ni(e,r),Eu(s,e,r),oc;yf(c)||Ru(),t=kc(e,t,n)}else yf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ni=Sf(c.nextSibling),Mi=t,Pi=!0,Fi=null,Ii=!1,e!==null&&ji(t,e),t=Dc(t,r.children),t.flags|=4096);return t}return i?(co(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=li(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=fi(c,i,n,null),c.flags|=2):c=li(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,pc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=wc(n):(i=c.cachePool,i===null?i=xa():(l=sa._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=Tc(e,s,n),t.memoizedState=Cc,pc(e.child,r)):(ao(t),n=e.child,e=n.sibling,n=li(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Dc(e,t){return t=Oc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Oc(e,t){return e=si(22,e,null,t),e.lanes=0,e}function kc(e,t,n){return Ra(t,e.child,null,n),e=Dc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ac(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xi(e.return,t,n)}function jc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Mc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=uo.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,L(uo,o),cc(e,t,r,n),r=Pi?xi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ac(e,n,t);else if(e.tag===19)Ac(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&fo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),jc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&fo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}jc(t,!0,n,null,a,r);break;case`together`:jc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Nc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),nu|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Qi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Pc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&$i(e)))}function Fc(e,t,n){switch(t.tag){case 3:ce(t,t.stateNode.containerInfo),Ji(t,sa,e.memoizedState.cache),Hi();break;case 27:case 5:ue(t);break;case 4:ce(t,t.stateNode.containerInfo);break;case 10:Ji(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,oo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ao(t),e=Nc(e,t,n),e===null?null:e.sibling):Ec(e,t,n):(ao(t),t.flags|=128,null);ao(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Mc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),L(uo,uo.current),r)break;return null;case 22:return t.lanes=0,fc(e,t,n,t.pendingProps);case 24:Ji(t,sa,e.memoizedState.cache)}return Nc(e,t,n)}function Ic(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)sc=!0;else{if(!Pc(e,n)&&!(t.flags&128))return sc=!1,Fc(e,t,n);sc=!!(e.flags&131072)}}else sc=!1,Pi&&t.flags&1048576&&Oi(t,xi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Oa(t.elementType),t.type=e,typeof e==`function`)ci(e)?(r=Xs(e,r),t.tag=1,t=xc(null,t,e,r,n)):(t.tag=0,t=yc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===w){t.tag=11,t=lc(null,t,e,r,n);break a}if(i===D){t.tag=14,t=uc(null,t,e,r,n);break a}}throw t=P(e)||e,Error(a(306,t,``))}}return t;case 0:return yc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Xs(r,t.pendingProps),xc(e,t,r,i,n);case 3:a:{if(ce(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,Ha(e,t),Ya(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ji(t,sa,r),r!==o.cache&&Zi(t,[sa],n,!0),Ja(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Sc(e,t,r,n);break a}if(r!==i){i=_i(Error(a(424)),t),Wi(i),t=Sc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ni=Sf(e.firstChild),Mi=t,Pi=!0,Fi=null,Ii=!0,n=za(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Hi(),r===i){t=Nc(e,t,n);break a}cc(e,t,r,n)}t=t.child}return t;case 26:return vc(e,t),e===null?(n=Uf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Pi||(n=t.type,e=t.pendingProps,r=ef(z.current).createElement(n),r[at]=t,r[ot]=e,Jd(r,n,e),vt(r),t.stateNode=r):t.memoizedState=Uf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ue(t),e===null&&Pi&&(r=t.stateNode=Ef(t.type,t.pendingProps,z.current),Mi=t,Ii=!0,i=Ni,ff(t.type)?(Cf=i,Ni=Sf(r.firstChild)):Ni=i),cc(e,t,t.pendingProps.children,n),vc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Pi&&((i=r=Ni)&&(r=gf(r,t.type,t.pendingProps,Ii),r===null?i=!1:(t.stateNode=r,Mi=t,Ni=Sf(r.firstChild),Ii=!1,i=!0)),i||Ri(t)),ue(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,rf(i,o)?r=null:s!==null&&rf(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=Eo(e,t,ko,null,null,n),fp._currentValue=i),vc(e,t),cc(e,t,r,n),t.child;case 6:return e===null&&Pi&&((e=n=Ni)&&(n=_f(n,t.pendingProps,Ii),n===null?e=!1:(t.stateNode=n,Mi=t,Ni=null,e=!0)),e||Ri(t)),null;case 13:return Ec(e,t,n);case 4:return ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ra(t,null,r,n):cc(e,t,r,n),t.child;case 11:return lc(e,t,t.type,t.pendingProps,n);case 7:return cc(e,t,t.pendingProps,n),t.child;case 8:return cc(e,t,t.pendingProps.children,n),t.child;case 12:return cc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ji(t,t.type,r.value),cc(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,ea(t),i=ta(i),r=r(i),t.flags|=1,cc(e,t,r,n),t.child;case 14:return uc(e,t,t.type,t.pendingProps,n);case 15:return dc(e,t,t.type,t.pendingProps,n);case 19:return Mc(e,t,n);case 31:return _c(e,t,n);case 22:return fc(e,t,n,t.pendingProps);case 24:return ea(t),r=ta(sa),e===null?(i=ya(),i===null&&(i=Kl,o=ca(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},Va(t),Ji(t,sa,i)):((e.lanes&n)!==0&&(Ha(e,t),Ya(t,null,null,n),Ja()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,Ji(t,sa,r),r!==i.cache&&Zi(t,[sa],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Ji(t,sa,r))),cc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Lc(e){e.flags|=4}function Rc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Fu())e.flags|=8192;else throw ka=Ta,Ca}}else e.flags&=-16777217}function zc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ip(t)){if(Fu())e.flags|=8192;else throw ka=Ta,Ca}}function Bc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:qe(),e.lanes|=t,ou|=t)}function Vc(e,t){if(!Pi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Hc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Uc(e,t,n){var r=t.pendingProps;switch(Ai(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Hc(t),null;case 1:return Hc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Yi(sa),le(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Vi(t)?Lc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ui())),Hc(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(Lc(t),o===null?(Hc(t),Rc(t,i,null,r,n)):(Hc(t),zc(t,o))):o?o===e.memoizedState?(Hc(t),t.flags&=-16777217):(Lc(t),Hc(t),zc(t,o)):(e=e.memoizedProps,e!==r&&Lc(t),Hc(t),Rc(t,i,e,r,n)),null;case 27:if(de(t),n=z.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Hc(t),null}e=R.current,Vi(t)?zi(t,e):(e=Ef(i,r,n),t.stateNode=e,Lc(t))}return Hc(t),null;case 5:if(de(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Hc(t),null}if(o=R.current,Vi(t))zi(t,o);else{var s=ef(z.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[at]=t,o[ot]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Jd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Lc(t)}}return Hc(t),Rc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=z.current,Vi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Mi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[at]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Gd(e.nodeValue,n)),e||Ri(t,!0)}else e=ef(e).createTextNode(r),e[at]=t,t.stateNode=e}return Hc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Vi(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[at]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Hc(t),e=!1}else n=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(lo(t),t):(lo(t),null);if(t.flags&128)throw Error(a(558))}return Hc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Vi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[at]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Hc(t),i=!1}else i=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(lo(t),t):(lo(t),null)}return lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Bc(t,t.updateQueue),Hc(t),null);case 4:return le(),e===null&&Fd(t.stateNode.containerInfo),Hc(t),null;case 10:return Yi(t.type),Hc(t),null;case 19:if(ae(uo),r=t.memoizedState,r===null)return Hc(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)Vc(r,!1);else{if(tu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=fo(e),o!==null){for(t.flags|=128,Vc(r,!1),e=o.updateQueue,t.updateQueue=e,Bc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ui(n,e),n=n.sibling;return L(uo,uo.current&1|2),Pi&&Di(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&we()>fu&&(t.flags|=128,i=!0,Vc(r,!1),t.lanes=4194304)}}else{if(!i){if(e=fo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Bc(t,e),Vc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Pi)return Hc(t),null}else 2*we()-r.renderingStartTime>fu&&n!==536870912&&(t.flags|=128,i=!0,Vc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Hc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=we(),e.sibling=null,n=uo.current,L(uo,i?n&1|2:n&1),Pi&&Di(t,r.treeForkCount),e);case 22:case 23:return lo(t),no(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Hc(t),t.subtreeFlags&6&&(t.flags|=8192)):Hc(t),n=t.updateQueue,n!==null&&Bc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ae(va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Yi(sa),Hc(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Wc(e,t){switch(Ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(sa),le(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if(lo(t),t.alternate===null)throw Error(a(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae(uo),null;case 4:return le(),null;case 10:return Yi(t.type),null;case 22:case 23:return lo(t),no(),e!==null&&ae(va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yi(sa),null;case 25:return null;default:return null}}function Gc(e,t){switch(Ai(t),t.tag){case 3:Yi(sa),le();break;case 26:case 27:case 5:de(t);break;case 4:le();break;case 31:t.memoizedState!==null&&lo(t);break;case 13:lo(t);break;case 19:ae(uo);break;case 10:Yi(t.type);break;case 22:case 23:lo(t),no(),e!==null&&ae(va);break;case 24:Yi(sa)}}function Kc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){nd(t,t.return,e)}}function qc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){nd(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){nd(t,t.return,e)}}function Jc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Za(t,n)}catch(t){nd(e,e.return,t)}}}function Yc(e,t,n){n.props=Xs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){nd(e,t,n)}}function Xc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){nd(e,t,n)}}function Zc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){nd(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){nd(e,t,n)}else n.current=null}}function Qc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){nd(e,e.return,t)}}function $c(e,t,n){try{var r=e.stateNode;Yd(r,e.type,n,t),r[ot]=t}catch(t){nd(e,e.return,t)}}function el(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ff(e.type)||e.tag===4}function tl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||el(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ff(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function nl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qt));else if(r!==4&&(r===27&&ff(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(nl(e,t,n),e=e.sibling;e!==null;)nl(e,t,n),e=e.sibling}function rl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&ff(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(rl(e,t,n),e=e.sibling;e!==null;)rl(e,t,n),e=e.sibling}function il(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Jd(t,r,n),t[at]=e,t[ot]=n}catch(t){nd(e,e.return,t)}}var al=!1,ol=!1,sl=!1,cl=typeof WeakSet==`function`?WeakSet:Set,ll=null;function ul(e,t){if(e=e.containerInfo,Qd=xp,e=Er(e),Dr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for($d={focusedElem:e,selectionRange:n},xp=!1,ll=t;ll!==null;)if(t=ll,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ll=e;else for(;ll!==null;){switch(t=ll,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Xs(n.type,i);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){nd(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)hf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:hf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,ll=e;break}ll=t.return}}function dl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:El(e,n),r&4&&Kc(5,n);break;case 1:if(El(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){nd(n,n.return,e)}else{var i=Xs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){nd(n,n.return,e)}}}r&64&&Jc(n),r&512&&Xc(n,n.return);break;case 3:if(El(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Za(e,t)}catch(e){nd(n,n.return,e)}}break;case 27:t===null&&r&4&&il(n);case 26:case 5:El(e,n),t===null&&r&4&&Qc(n),r&512&&Xc(n,n.return);break;case 12:El(e,n);break;case 31:El(e,n),r&4&&_l(e,n);break;case 13:El(e,n),r&4&&vl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=od.bind(null,n),xf(e,n))));break;case 22:if(r=n.memoizedState!==null||al,!r){t=t!==null&&t.memoizedState!==null||ol,i=al;var a=ol;al=r,(ol=t)&&!a?Ol(e,n,!!(n.subtreeFlags&8772)):El(e,n),al=i,ol=a}break;case 30:break;default:El(e,n)}}function fl(e){var t=e.alternate;t!==null&&(e.alternate=null,fl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&pt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var pl=null,ml=!1;function hl(e,t,n){for(n=n.child;n!==null;)gl(e,t,n),n=n.sibling}function gl(e,t,n){if(Pe&&typeof Pe.onCommitFiberUnmount==`function`)try{Pe.onCommitFiberUnmount(Ne,n)}catch{}switch(n.tag){case 26:ol||Zc(n,t),hl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ol||Zc(n,t);var r=pl,i=ml;ff(n.type)&&(pl=n.stateNode,ml=!1),hl(e,t,n),Df(n.stateNode),pl=r,ml=i;break;case 5:ol||Zc(n,t);case 6:if(r=pl,i=ml,pl=null,hl(e,t,n),pl=r,ml=i,pl!==null){if(ml)try{(pl.nodeType===9?pl.body:pl.nodeName===`HTML`?pl.ownerDocument.body:pl).removeChild(n.stateNode)}catch(e){nd(n,t,e)}else try{pl.removeChild(n.stateNode)}catch(e){nd(n,t,e)}}break;case 18:pl!==null&&(ml?(e=pl,pf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),qp(e)):pf(pl,n.stateNode));break;case 4:r=pl,i=ml,pl=n.stateNode.containerInfo,ml=!0,hl(e,t,n),pl=r,ml=i;break;case 0:case 11:case 14:case 15:qc(2,n,t),ol||qc(4,n,t),hl(e,t,n);break;case 1:ol||(Zc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Yc(n,t,r)),hl(e,t,n);break;case 21:hl(e,t,n);break;case 22:ol=(r=ol)||n.memoizedState!==null,hl(e,t,n),ol=r;break;default:hl(e,t,n)}}function _l(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{qp(e)}catch(e){nd(t,t.return,e)}}}function vl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{qp(e)}catch(e){nd(t,t.return,e)}}function yl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cl),t;default:throw Error(a(435,e.tag))}}function bl(e,t){var n=yl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=sd.bind(null,e,t);t.then(r,r)}})}function xl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(ff(c.type)){pl=c.stateNode,ml=!1;break a}break;case 5:pl=c.stateNode,ml=!1;break a;case 3:case 4:pl=c.stateNode.containerInfo,ml=!0;break a}c=c.return}if(pl===null)throw Error(a(160));gl(o,s,i),pl=null,ml=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Cl(t,e),t=t.sibling}var Sl=null;function Cl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:xl(t,e),wl(e),r&4&&(qc(3,e,e.return),Kc(3,e),qc(5,e,e.return));break;case 1:xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),r&64&&al&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=Sl;if(xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:o=i.getElementsByTagName(`title`)[0],(!o||o[ft]||o[at]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector(`head > title`))),Jd(o,r,n),o[at]=e,vt(o),r=o;break a;case`link`:var s=tp(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=i.createElement(r),Jd(o,r,n),i.head.appendChild(o);break;case`meta`:if(s=tp(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=i.createElement(r),Jd(o,r,n),i.head.appendChild(o);break;default:throw Error(a(468,r))}o[at]=e,vt(o),r=o}e.stateNode=r}else np(i,e.type,e.stateNode)}else e.stateNode=Xf(i,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&$c(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?np(i,e.type,e.stateNode):Xf(i,r,e.memoizedProps))}break;case 27:xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),n!==null&&r&4&&$c(e,e.memoizedProps,n.memoizedProps);break;case 5:if(xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),e.flags&32){i=e.stateNode;try{Wt(i,``)}catch(t){nd(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,$c(e,i,n===null?i:n.memoizedProps)),r&1024&&(sl=!0);break;case 6:if(xl(t,e),wl(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){nd(e,e.return,t)}}break;case 3:if(ep=null,i=Sl,Sl=Af(t.containerInfo),xl(t,e),Sl=i,wl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{qp(t.containerInfo)}catch(t){nd(e,e.return,t)}sl&&(sl=!1,Tl(e));break;case 4:r=Sl,Sl=Af(e.stateNode.containerInfo),xl(t,e),wl(e),Sl=r;break;case 12:xl(t,e),wl(e);break;case 31:xl(t,e),wl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 13:xl(t,e),wl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(uu=we()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=al,d=ol;if(al=u||i,ol=d||l,xl(t,e),ol=d,al=u,wl(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||al||ol||Dl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,i)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){nd(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){nd(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?mf(m,!0):mf(l.stateNode,!1)}catch(e){nd(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,bl(e,n))));break;case 19:xl(t,e),wl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 30:break;case 21:break;default:xl(t,e),wl(e)}}function wl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(el(r)){n=r;break}r=r.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var i=n.stateNode;rl(e,tl(e),i);break;case 5:var o=n.stateNode;n.flags&32&&(Wt(o,``),n.flags&=-33),rl(e,tl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;nl(e,tl(e),s);break;default:throw Error(a(161))}}catch(t){nd(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Tl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Tl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function El(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)dl(e,t.alternate,t),t=t.sibling}function Dl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:qc(4,t,t.return),Dl(t);break;case 1:Zc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Yc(t,t.return,n),Dl(t);break;case 27:Df(t.stateNode);case 26:case 5:Zc(t,t.return),Dl(t);break;case 22:t.memoizedState===null&&Dl(t);break;case 30:Dl(t);break;default:Dl(t)}e=e.sibling}}function Ol(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Ol(i,a,n),Kc(4,a);break;case 1:if(Ol(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){nd(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Xa(c[i],s)}catch(e){nd(r,r.return,e)}}n&&o&64&&Jc(a),Xc(a,a.return);break;case 27:il(a);case 26:case 5:Ol(i,a,n),n&&r===null&&o&4&&Qc(a),Xc(a,a.return);break;case 12:Ol(i,a,n);break;case 31:Ol(i,a,n),n&&o&4&&_l(i,a);break;case 13:Ol(i,a,n),n&&o&4&&vl(i,a);break;case 22:a.memoizedState===null&&Ol(i,a,n),Xc(a,a.return);break;case 30:break;default:Ol(i,a,n)}t=t.sibling}}function kl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&la(n))}function Al(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e))}function jl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ml(e,t,n,r),t=t.sibling}function Ml(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:jl(e,t,n,r),i&2048&&Kc(9,t);break;case 1:jl(e,t,n,r);break;case 3:jl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e)));break;case 12:if(i&2048){jl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){nd(t,t.return,e)}}else jl(e,t,n,r);break;case 31:jl(e,t,n,r);break;case 13:jl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?jl(e,t,n,r):(a._visibility|=2,Nl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?jl(e,t,n,r):Pl(e,t),i&2048&&kl(o,t);break;case 24:jl(e,t,n,r),i&2048&&Al(t.alternate,t);break;default:jl(e,t,n,r)}}function Nl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Nl(a,o,s,c,i),Kc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Nl(a,o,s,c,i)):u._visibility&2?Nl(a,o,s,c,i):Pl(a,o),i&&l&2048&&kl(o.alternate,o);break;case 24:Nl(a,o,s,c,i),i&&l&2048&&Al(o.alternate,o);break;default:Nl(a,o,s,c,i)}t=t.sibling}}function Pl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Pl(n,r),i&2048&&kl(r.alternate,r);break;case 24:Pl(n,r),i&2048&&Al(r.alternate,r);break;default:Pl(n,r)}t=t.sibling}}var Fl=8192;function Il(e,t,n){if(e.subtreeFlags&Fl)for(e=e.child;e!==null;)Ll(e,t,n),e=e.sibling}function Ll(e,t,n){switch(e.tag){case 26:Il(e,t,n),e.flags&Fl&&e.memoizedState!==null&&ap(n,Sl,e.memoizedState,e.memoizedProps);break;case 5:Il(e,t,n);break;case 3:case 4:var r=Sl;Sl=Af(e.stateNode.containerInfo),Il(e,t,n),Sl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Fl,Fl=16777216,Il(e,t,n),Fl=r):Il(e,t,n));break;default:Il(e,t,n)}}function Rl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function zl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ll=r,Hl(r,e)}Rl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bl(e),e=e.sibling}function Bl(e){switch(e.tag){case 0:case 11:case 15:zl(e),e.flags&2048&&qc(9,e,e.return);break;case 3:zl(e);break;case 12:zl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Vl(e)):zl(e);break;default:zl(e)}}function Vl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ll=r,Hl(r,e)}Rl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:qc(8,t,t.return),Vl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Vl(t));break;default:Vl(t)}e=e.sibling}}function Hl(e,t){for(;ll!==null;){var n=ll;switch(n.tag){case 0:case 11:case 15:qc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:la(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ll=r;else a:for(n=e;ll!==null;){r=ll;var i=r.sibling,a=r.return;if(fl(r),r===n){ll=null;break a}if(i!==null){i.return=a,ll=i;break a}ll=a}}}var Ul={getCacheForType:function(e){var t=ta(sa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ta(sa).controller.signal}},Wl=typeof WeakMap==`function`?WeakMap:Map,Gl=0,Kl=null,ql=null,Jl=0,Yl=0,Xl=null,Zl=!1,Ql=!1,$l=!1,eu=0,tu=0,nu=0,ru=0,iu=0,au=0,ou=0,su=null,cu=null,lu=!1,uu=0,du=0,fu=1/0,pu=null,mu=null,hu=0,gu=null,_u=null,vu=0,yu=0,bu=null,xu=null,Su=0,Cu=null;function wu(){return Gl&2&&Jl!==0?Jl&-Jl:F.T===null?nt():Cd()}function Tu(){if(au===0){if(!(Jl&536870912)||Pi){var e=Ve;Ve<<=1,!(Ve&3932160)&&(Ve=262144),au=e}else au=536870912}return e=ro.current,e!==null&&(e.flags|=32),au}function Eu(e,t,n){(e===Kl&&(Yl===2||Yl===9)||e.cancelPendingCommit!==null)&&(Nu(e,0),Au(e,Jl,au,!1)),Ye(e,n),(!(Gl&2)||e!==Kl)&&(e===Kl&&(!(Gl&2)&&(ru|=n),tu===4&&Au(e,Jl,au,!1)),hd(e))}function Du(e,t,n){if(Gl&6)throw Error(a(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ge(e,t),i=r?Vu(e,t):zu(e,t,!0),o=r;do{if(i===0){Ql&&!r&&Au(e,t,0,!1);break}if(n=e.current.alternate,o&&!ku(n)){i=zu(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=su;var l=c.current.memoizedState.isDehydrated;if(l&&(Nu(c,s).flags|=256),s=zu(c,s,!1),s!==2){if($l&&!l){c.errorRecoveryDisabledLanes|=o,ru|=o,i=4;break a}o=cu,cu=i,o!==null&&(cu===null?cu=o:cu.push.apply(cu,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){Nu(e,0),Au(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:Au(r,t,au,!Zl);break a;case 2:cu=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=uu+300-we(),10<i)){if(Au(r,t,au,!Zl),We(r,0,!0)!==0)break a;vu=t,r.timeoutHandle=sf(Ou.bind(null,r,n,cu,pu,lu,t,au,ru,ou,Zl,o,`Throttled`,-0,0),i);break a}Ou(r,n,cu,pu,lu,t,au,ru,ou,Zl,o,null,-0,0)}break}while(1);hd(e)}function Ou(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qt},Ll(t,a,d);var m=(a&62914560)===a?uu-we():(a&4194048)===a?du-we():0;if(m=sp(d,m),m!==null){vu=a,e.cancelPendingCommit=m(Ju.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Au(e,a,o,!l);return}}Ju(e,t,a,n,r,i,o,s,c)}function ku(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!xr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Au(e,t,n,r){t&=~iu,t&=~ru,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ie(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ze(e,n,t)}function ju(){return Gl&6?!0:(gd(0,!1),!1)}function Mu(){if(ql!==null){if(Yl===0)var e=ql.return;else e=ql,qi=Ki=null,Mo(e),Ma=null,Na=0,e=ql;for(;e!==null;)Gc(e.alternate,e),e=e.return;ql=null}}function Nu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,cf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),vu=0,Mu(),Kl=e,ql=n=li(e.current,null),Jl=t,Yl=0,Xl=null,Zl=!1,Ql=Ge(e,t),$l=!1,ou=au=iu=ru=nu=tu=0,cu=su=null,lu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ie(r),a=1<<i;t|=e[i],r&=~a}return eu=t,$r(),n}function Pu(e,t){mo=null,F.H=Hs,t===Sa||t===wa?(t=Aa(),Yl=3):t===Ca?(t=Aa(),Yl=4):Yl=t===oc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Xl=t,ql===null&&(tu=1,ec(e,_i(t,e.current)))}function Fu(){var e=ro.current;return e===null?!0:(Jl&4194048)===Jl?io===null:(Jl&62914560)===Jl||Jl&536870912?e===io:!1}function Iu(){var e=F.H;return F.H=Hs,e===null?Hs:e}function Lu(){var e=F.A;return F.A=Ul,e}function Ru(){tu=4,Zl||(Jl&4194048)!==Jl&&ro.current!==null||(Ql=!0),!(nu&134217727)&&!(ru&134217727)||Kl===null||Au(Kl,Jl,au,!1)}function zu(e,t,n){var r=Gl;Gl|=2;var i=Iu(),a=Lu();(Kl!==e||Jl!==t)&&(pu=null,Nu(e,t)),t=!1;var o=tu;a:do try{if(Yl!==0&&ql!==null){var s=ql,c=Xl;switch(Yl){case 8:Mu(),o=6;break a;case 3:case 2:case 9:case 6:ro.current===null&&(t=!0);var l=Yl;if(Yl=0,Xl=null,Gu(e,s,c,l),n&&Ql){o=0;break a}break;default:l=Yl,Yl=0,Xl=null,Gu(e,s,c,l)}}Bu(),o=tu;break}catch(t){Pu(e,t)}while(1);return t&&e.shellSuspendCounter++,qi=Ki=null,Gl=r,F.H=i,F.A=a,ql===null&&(Kl=null,Jl=0,$r()),o}function Bu(){for(;ql!==null;)Uu(ql)}function Vu(e,t){var n=Gl;Gl|=2;var r=Iu(),i=Lu();Kl!==e||Jl!==t?(pu=null,fu=we()+500,Nu(e,t)):Ql=Ge(e,t);a:do try{if(Yl!==0&&ql!==null){t=ql;var o=Xl;b:switch(Yl){case 1:Yl=0,Xl=null,Gu(e,t,o,1);break;case 2:case 9:if(Ea(o)){Yl=0,Xl=null,Wu(t);break}t=function(){Yl!==2&&Yl!==9||Kl!==e||(Yl=7),hd(e)},o.then(t,t);break a;case 3:Yl=7;break a;case 4:Yl=5;break a;case 7:Ea(o)?(Yl=0,Xl=null,Wu(t)):(Yl=0,Xl=null,Gu(e,t,o,7));break;case 5:var s=null;switch(ql.tag){case 26:s=ql.memoizedState;case 5:case 27:var c=ql;if(s?ip(s):c.stateNode.complete){Yl=0,Xl=null;var l=c.sibling;if(l!==null)ql=l;else{var u=c.return;u===null?ql=null:(ql=u,Ku(u))}break b}}Yl=0,Xl=null,Gu(e,t,o,5);break;case 6:Yl=0,Xl=null,Gu(e,t,o,6);break;case 8:Mu(),tu=6;break a;default:throw Error(a(462))}}Hu();break}catch(t){Pu(e,t)}while(1);return qi=Ki=null,F.H=r,F.A=i,Gl=n,ql===null?(Kl=null,Jl=0,$r(),tu):0}function Hu(){for(;ql!==null&&!Se();)Uu(ql)}function Uu(e){var t=Ic(e.alternate,e,eu);e.memoizedProps=e.pendingProps,t===null?Ku(e):ql=t}function Wu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=bc(n,t,t.pendingProps,t.type,void 0,Jl);break;case 11:t=bc(n,t,t.pendingProps,t.type.render,t.ref,Jl);break;case 5:Mo(t);default:Gc(n,t),t=ql=ui(t,eu),t=Ic(n,t,eu)}e.memoizedProps=e.pendingProps,t===null?Ku(e):ql=t}function Gu(e,t,n,r){qi=Ki=null,Mo(t),Ma=null,Na=0;var i=t.return;try{if(ac(e,i,t,n,Jl)){tu=1,ec(e,_i(n,e.current)),ql=null;return}}catch(t){if(i!==null)throw ql=i,t;tu=1,ec(e,_i(n,e.current)),ql=null;return}t.flags&32768?(Pi||r===1?e=!0:Ql||Jl&536870912?e=!1:(Zl=e=!0,(r===2||r===9||r===3||r===6)&&(r=ro.current,r!==null&&r.tag===13&&(r.flags|=16384))),qu(t,e)):Ku(t)}function Ku(e){var t=e;do{if(t.flags&32768){qu(t,Zl);return}e=t.return;var n=Uc(t.alternate,t,eu);if(n!==null){ql=n;return}if(t=t.sibling,t!==null){ql=t;return}ql=t=e}while(t!==null);tu===0&&(tu=5)}function qu(e,t){do{var n=Wc(e.alternate,e);if(n!==null){n.flags&=32767,ql=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ql=e;return}ql=e=n}while(e!==null);tu=6,ql=null}function Ju(e,t,n,r,i,o,s,c,l){e.cancelPendingCommit=null;do $u();while(hu!==0);if(Gl&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(o=t.lanes|t.childLanes,o|=Qr,Xe(e,n,o,s,c,l),e===Kl&&(ql=Kl=null,Jl=0),_u=t,gu=e,vu=n,yu=o,bu=i,xu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,cd(Oe,function(){return ed(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=F.T,F.T=null,i=I.p,I.p=2,s=Gl,Gl|=4;try{ul(e,t,n)}finally{Gl=s,I.p=i,F.T=r}}hu=1,Yu(),Xu(),Zu()}}function Yu(){if(hu===1){hu=0;var e=gu,t=_u,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Gl;Gl|=4;try{Cl(t,e);var a=$d,o=Er(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Tr(s.ownerDocument.documentElement,s)){if(c!==null&&Dr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=wr(s,h),v=wr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}xp=!!Qd,$d=Qd=null}finally{Gl=i,I.p=r,F.T=n}}e.current=t,hu=2}}function Xu(){if(hu===2){hu=0;var e=gu,t=_u,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Gl;Gl|=4;try{dl(e,t.alternate,t)}finally{Gl=i,I.p=r,F.T=n}}hu=3}}function Zu(){if(hu===4||hu===3){hu=0,Ce();var e=gu,t=_u,n=vu,r=xu;t.subtreeFlags&10256||t.flags&10256?hu=5:(hu=0,_u=gu=null,Qu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(mu=null),tt(n),t=t.stateNode,Pe&&typeof Pe.onCommitFiberRoot==`function`)try{Pe.onCommitFiberRoot(Ne,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=F.T,i=I.p,I.p=2,F.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{F.T=t,I.p=i}}vu&3&&$u(),hd(e),i=e.pendingLanes,n&261930&&i&42?e===Cu?Su++:(Su=0,Cu=e):Su=0,gd(0,!1)}}function Qu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,la(t)))}function $u(){return Yu(),Xu(),Zu(),ed()}function ed(){if(hu!==5)return!1;var e=gu,t=yu;yu=0;var n=tt(vu),r=F.T,i=I.p;try{I.p=32>n?32:n,F.T=null,n=bu,bu=null;var o=gu,s=vu;if(hu=0,_u=gu=null,vu=0,Gl&6)throw Error(a(331));var c=Gl;if(Gl|=4,Bl(o.current),Ml(o,o.current,s,n),Gl=c,gd(0,!1),Pe&&typeof Pe.onPostCommitFiberRoot==`function`)try{Pe.onPostCommitFiberRoot(Ne,o)}catch{}return!0}finally{I.p=i,F.T=r,Qu(e,t)}}function td(e,t,n){t=_i(n,t),t=nc(e.stateNode,t,2),e=Wa(e,t,2),e!==null&&(Ye(e,2),hd(e))}function nd(e,t,n){if(e.tag===3)td(e,e,n);else for(;t!==null;){if(t.tag===3){td(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(mu===null||!mu.has(r))){e=_i(n,e),n=rc(2),r=Wa(t,n,2),r!==null&&(ic(n,r,t,e),Ye(r,2),hd(r));break}}t=t.return}}function rd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Wl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||($l=!0,i.add(n),e=id.bind(null,e,t,n),t.then(e,e))}function id(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Kl===e&&(Jl&n)===n&&(tu===4||tu===3&&(Jl&62914560)===Jl&&300>we()-uu?!(Gl&2)&&Nu(e,0):iu|=n,ou===Jl&&(ou=0)),hd(e)}function ad(e,t){t===0&&(t=qe()),e=ni(e,t),e!==null&&(Ye(e,t),hd(e))}function od(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ad(e,n)}function sd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),ad(e,n)}function cd(e,t){return be(e,t)}var ld=null,ud=null,dd=!1,fd=!1,pd=!1,md=0;function hd(e){e!==ud&&e.next===null&&(ud===null?ld=ud=e:ud=ud.next=e),fd=!0,dd||(dd=!0,Sd())}function gd(e,t){if(!pd&&fd){pd=!0;do for(var n=!1,r=ld;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ie(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,xd(r,a))}else a=Jl,a=We(r,r===Kl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ge(r,a)||(n=!0,xd(r,a))}r=r.next}while(n);pd=!1}}function _d(){vd()}function vd(){fd=dd=!1;var e=0;md!==0&&of()&&(e=md);for(var t=we(),n=null,r=ld;r!==null;){var i=r.next,a=yd(r,t);a===0?(r.next=null,n===null?ld=i:n.next=i,i===null&&(ud=n)):(n=r,(e!==0||a&3)&&(fd=!0)),r=i}hu!==0&&hu!==5||gd(e,!1),md!==0&&(md=0)}function yd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ie(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ke(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Kl,n=Jl,n=We(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Yl===2||Yl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&xe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ge(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&xe(r),tt(n)){case 2:case 8:n=De;break;case 32:n=Oe;break;case 268435456:n=Ae;break;default:n=Oe}return r=bd.bind(null,e),n=be(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&xe(r),e.callbackPriority=2,e.callbackNode=null,2}function bd(e,t){if(hu!==0&&hu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if($u()&&e.callbackNode!==n)return null;var r=Jl;return r=We(e,e===Kl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Du(e,r,t),yd(e,we()),e.callbackNode!=null&&e.callbackNode===n?bd.bind(null,e):null)}function xd(e,t){if($u())return null;Du(e,t,!0)}function Sd(){uf(function(){Gl&6?be(Ee,_d):vd()})}function Cd(){if(md===0){var e=fa;e===0&&(e=Be,Be<<=1,!(Be&261888)&&(Be=256)),md=e}return md}function wd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Zt(``+e)}function Td(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Ed(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=wd((i[ot]||null).action),o=r.submitter;o&&(t=(t=o[ot]||null)?wd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(md!==0){var e=o?Td(i,o):new FormData(i);Os(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Td(i,o):new FormData(i),Os(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Dd=0;Dd<qr.length;Dd++){var Od=qr[Dd];Jr(Od.toLowerCase(),`on`+(Od[0].toUpperCase()+Od.slice(1)))}Jr(zr,`onAnimationEnd`),Jr(Br,`onAnimationIteration`),Jr(Vr,`onAnimationStart`),Jr(`dblclick`,`onDoubleClick`),Jr(`focusin`,`onFocus`),Jr(`focusout`,`onBlur`),Jr(Hr,`onTransitionRun`),Jr(Ur,`onTransitionStart`),Jr(Wr,`onTransitionCancel`),Jr(Gr,`onTransitionEnd`),St(`onMouseEnter`,[`mouseout`,`mouseover`]),St(`onMouseLeave`,[`mouseout`,`mouseover`]),St(`onPointerEnter`,[`pointerout`,`pointerover`]),St(`onPointerLeave`,[`pointerout`,`pointerover`]),xt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),xt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),xt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),xt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),xt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),xt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var kd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Ad=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(kd));function jd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}}}}function Md(e,t){var n=t[ct];n===void 0&&(n=t[ct]=new Set);var r=e+`__bubble`;n.has(r)||(Id(t,e,2,!1),n.add(r))}function Nd(e,t,n){var r=0;t&&(r|=4),Id(n,e,r,t)}var Pd=`_reactListening`+Math.random().toString(36).slice(2);function Fd(e){if(!e[Pd]){e[Pd]=!0,yt.forEach(function(t){t!==`selectionchange`&&(Ad.has(t)||Nd(t,!1,e),Nd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pd]||(t[Pd]=!0,Nd(`selectionchange`,!1,t))}}function Id(e,t,n,r){switch(Op(t)){case 2:var i=Sp;break;case 8:i=Cp;break;default:i=wp}n=i.bind(null,t,n,e),i=void 0,!ln||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Ld(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=mt(s),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=a=o;continue a}s=s.parentNode}}r=r.return}on(function(){var r=a,i=en(n),o=[];a:{var s=Kr.get(e);if(s!==void 0){var c=bn,u=e;switch(e){case`keypress`:if(hn(n)===0)break a;case`keydown`:case`keyup`:c=Rn;break;case`focusin`:u=`focus`,c=kn;break;case`focusout`:u=`blur`,c=kn;break;case`beforeblur`:case`afterblur`:c=kn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=Dn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=On;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Bn;break;case zr:case Br:case Vr:c=An;break;case Gr:c=Vn;break;case`scroll`:case`scrollend`:c=Sn;break;case`wheel`:c=Hn;break;case`copy`:case`cut`:case`paste`:c=jn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=zn;break;case`toggle`:case`beforetoggle`:c=Un}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=sn(m,p),g!=null&&d.push(Rd(m,g,h))),f)break;m=m.return}0<d.length&&(s=new c(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==$t&&(u=n.relatedTarget||n.fromElement)&&(mt(u)||u[st]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(u=n.relatedTarget||n.toElement,c=r,u=u?mt(u):null,u!==null&&(f=l(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(c=null,u=r),c!==u)){if(d=Dn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=zn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?s:gt(c),h=u==null?s:gt(u),s=new d(g,m+`leave`,c,n,i),s.target=f,s.relatedTarget=h,g=null,mt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,c&&u)b:{for(d=Bd,p=c,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;c!==null&&Vd(o,s,c,d,!1),u!==null&&f!==null&&Vd(o,f,u,d,!0)}}a:{if(s=r?gt(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var v=lr;else if(rr(s)){if(ur)v=yr;else{v=_r;var y=gr}}else c=s.nodeName,!c||c.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&Jt(r.elementType)&&(v=lr):v=vr;if(v&&=v(e,r)){ir(o,v,n,i);break a}y&&y(e,s,r),e===`focusout`&&r&&s.type===`number`&&r.memoizedProps.value!=null&&Bt(s,`number`,s.value)}switch(y=r?gt(r):window,e){case`focusin`:(rr(y)||y.contentEditable===`true`)&&(kr=y,Ar=r,jr=null);break;case`focusout`:jr=Ar=kr=null;break;case`mousedown`:Mr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Mr=!1,Nr(o,n,i);break;case`selectionchange`:if(Or)break;case`keydown`:case`keyup`:Nr(o,n,i)}var b;if(Gn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else $n?Zn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Jn&&n.locale!==`ko`&&($n||x!==`onCompositionStart`?x===`onCompositionEnd`&&$n&&(b=mn()):(dn=i,fn=`value`in dn?dn.value:dn.textContent,$n=!0)),y=zd(r,x),0<y.length&&(x=new Mn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=Qn(n),b!==null&&(x.data=b)))),(b=qn?er(e,n):tr(e,n))&&(x=zd(r,`onBeforeInput`),0<x.length&&(y=new Mn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),Ed(o,e,r,n,i)}jd(o,t)})}function Rd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function zd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=sn(e,n),i!=null&&r.unshift(Rd(e,i,a)),i=sn(e,t),i!=null&&r.push(Rd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Bd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Vd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=sn(n,a),l!=null&&o.unshift(Rd(n,l,c))):i||(l=sn(n,a),l!=null&&o.push(Rd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Hd=/\r\n?/g,Ud=/\u0000|\uFFFD/g;function Wd(e){return(typeof e==`string`?e:``+e).replace(Hd,`
10
- `).replace(Ud,``)}function Gd(e,t){return t=Wd(t),Wd(e)===t}function Kd(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Wt(e,``+r);break;case`className`:Ot(e,`class`,r);break;case`tabIndex`:Ot(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ot(e,n,r);break;case`style`:qt(e,r,o);break;case`data`:if(t!==`object`){Ot(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Zt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Kd(e,t,`name`,i.name,i,null),Kd(e,t,`formEncType`,i.formEncType,i,null),Kd(e,t,`formMethod`,i.formMethod,i,null),Kd(e,t,`formTarget`,i.formTarget,i,null)):(Kd(e,t,`encType`,i.encType,i,null),Kd(e,t,`method`,i.method,i,null),Kd(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Zt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Qt);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Zt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Md(`beforetoggle`,e),Md(`toggle`,e),Dt(e,`popover`,r);break;case`xlinkActuate`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Dt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Yt.get(n)||n,Dt(e,n,r))}}function qd(e,t,n,r,i,o){switch(n){case`style`:qt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Wt(e,``+r);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Qt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[ot]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Dt(e,n,r)}}}function Jd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Md(`error`,e),Md(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Kd(e,t,o,s,n,null)}}i&&Kd(e,t,`srcSet`,n.srcSet,n,null),r&&Kd(e,t,`src`,n.src,n,null);return;case`input`:Md(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:Kd(e,t,r,d,n,null)}}zt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Md(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Kd(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Vt(e,!!r,n,!0):Vt(e,!!r,t,!1);return;case`textarea`:for(s in Md(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:Kd(e,t,s,c,n,null)}Ut(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Kd(e,t,l,r,n,null)}return;case`dialog`:Md(`beforetoggle`,e),Md(`toggle`,e),Md(`cancel`,e),Md(`close`,e);break;case`iframe`:case`object`:Md(`load`,e);break;case`video`:case`audio`:for(r=0;r<kd.length;r++)Md(kd[r],e);break;case`image`:Md(`error`,e),Md(`load`,e);break;case`details`:Md(`toggle`,e);break;case`embed`:case`source`:case`link`:Md(`error`,e),Md(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Kd(e,t,u,r,n,null)}return;default:if(Jt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&qd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Kd(e,t,c,r,n,null))}function Yd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Kd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&Kd(e,t,p,m,r,f)}}Rt(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Kd(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Kd(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Vt(e,!!n,n?[]:``,!1):Vt(e,!!n,t,!0)):Vt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Kd(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&Kd(e,t,s,i,r,o)}Ht(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Kd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Kd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Kd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:Kd(e,t,u,p,r,m)}return;default:if(Jt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&qd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||qd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Kd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Kd(e,t,f,p,r,m)}function Xd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Zd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Xd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Xd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Qd=null,$d=null;function ef(e){return e.nodeType===9?e:e.ownerDocument}function tf(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function nf(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function rf(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var af=null;function of(){var e=window.event;return e&&e.type===`popstate`?e!==af&&(af=e,!0):(af=null,!1)}var sf=typeof setTimeout==`function`?setTimeout:void 0,cf=typeof clearTimeout==`function`?clearTimeout:void 0,lf=typeof Promise==`function`?Promise:void 0,uf=typeof queueMicrotask==`function`?queueMicrotask:lf===void 0?sf:function(e){return lf.resolve(null).then(e).catch(df)};function df(e){setTimeout(function(){throw e})}function ff(e){return e===`head`}function pf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),qp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Df(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Df(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ft]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Df(e.ownerDocument.body)}n=i}while(n);qp(t)}function mf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function hf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:hf(n),pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function gf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[ft])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=Sf(e.nextSibling),e===null)break}return null}function _f(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Sf(e.nextSibling),e===null))return null;return e}function vf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=Sf(e.nextSibling),e===null))return null;return e}function yf(e){return e.data===`$?`||e.data===`$~`}function bf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function xf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function Sf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var Cf=null;function wf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return Sf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Tf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Ef(e,t,n){switch(t=ef(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Df(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);pt(e)}var Of=new Map,kf=new Set;function Af(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var jf=I.d;I.d={f:Mf,r:Nf,D:If,C:Lf,L:Rf,m:zf,X:Vf,S:Bf,M:Hf};function Mf(){var e=jf.f(),t=ju();return e||t}function Nf(e){var t=ht(e);t!==null&&t.tag===5&&t.type===`form`?As(t):jf.r(e)}var Pf=typeof document>`u`?null:document;function Ff(e,t,n){var r=Pf;if(r&&typeof t==`string`&&t){var i=Lt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),kf.has(i)||(kf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Jd(t,`link`,e),vt(t),r.head.appendChild(t)))}}function If(e){jf.D(e),Ff(`dns-prefetch`,e,null)}function Lf(e,t){jf.C(e,t),Ff(`preconnect`,e,t)}function Rf(e,t,n){jf.L(e,t,n);var r=Pf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Lt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Lt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Lt(n.imageSizes)+`"]`)):i+=`[href="`+Lt(e)+`"]`;var a=i;switch(t){case`style`:a=Wf(e);break;case`script`:a=Jf(e)}Of.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Of.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Gf(a))||t===`script`&&r.querySelector(Yf(a))||(t=r.createElement(`link`),Jd(t,`link`,e),vt(t),r.head.appendChild(t)))}}function zf(e,t){jf.m(e,t);var n=Pf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Lt(r)+`"][href="`+Lt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Jf(e)}if(!Of.has(a)&&(e=h({rel:`modulepreload`,href:e},t),Of.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Yf(a)))return}r=n.createElement(`link`),Jd(r,`link`,e),vt(r),n.head.appendChild(r)}}}function Bf(e,t,n){jf.S(e,t,n);var r=Pf;if(r&&e){var i=_t(r).hoistableStyles,a=Wf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Gf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Of.get(a))&&Qf(e,n);var c=o=r.createElement(`link`);vt(c),Jd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Vf(e,t){jf.X(e,t);var n=Pf;if(n&&e){var r=_t(n).hoistableScripts,i=Jf(e),a=r.get(i);a||(a=n.querySelector(Yf(i)),a||(e=h({src:e,async:!0},t),(t=Of.get(i))&&$f(e,t),a=n.createElement(`script`),vt(a),Jd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hf(e,t){jf.M(e,t);var n=Pf;if(n&&e){var r=_t(n).hoistableScripts,i=Jf(e),a=r.get(i);a||(a=n.querySelector(Yf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=Of.get(i))&&$f(e,t),a=n.createElement(`script`),vt(a),Jd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Uf(e,t,n,r){var i=(i=z.current)?Af(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Wf(n.href),n=_t(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Wf(n.href);var o=_t(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Gf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Of.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Of.set(e,n),o||qf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Jf(n),n=_t(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Wf(e){return`href="`+Lt(e)+`"`}function Gf(e){return`link[rel="stylesheet"][`+e+`]`}function Kf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function qf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Jd(t,`link`,n),vt(t),e.head.appendChild(t))}function Jf(e){return`[src="`+Lt(e)+`"]`}function Yf(e){return`script[async]`+e}function Xf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Lt(n.href)+`"]`);if(r)return t.instance=r,vt(r),r;var i=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),vt(r),Jd(r,`style`,i),Zf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Wf(n.href);var o=e.querySelector(Gf(i));if(o)return t.state.loading|=4,t.instance=o,vt(o),o;r=Kf(n),(i=Of.get(i))&&Qf(r,i),o=(e.ownerDocument||e).createElement(`link`),vt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Jd(o,`link`,r),t.state.loading|=4,Zf(o,n.precedence,e),t.instance=o;case`script`:return o=Jf(n.src),(i=e.querySelector(Yf(o)))?(t.instance=i,vt(i),i):(r=n,(i=Of.get(o))&&(r=h({},n),$f(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),vt(i),Jd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Zf(r,n.precedence,e));return t.instance}function Zf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function $f(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var ep=null;function tp(e,t,n){if(ep===null){var r=new Map,i=ep=new Map;i.set(n,r)}else i=ep,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ft]||a[at]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function np(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function rp(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function ip(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ap(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Wf(r.href),a=t.querySelector(Gf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=cp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,vt(a);return}a=t.ownerDocument||t,r=Kf(r),(i=Of.get(i))&&Qf(r,i),a=a.createElement(`link`),vt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Jd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=cp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var op=0;function sp(e,t){return e.stylesheets&&e.count===0&&up(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&up(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&op===0&&(op=62500*Zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&up(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>op?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function cp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)up(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var lp=null;function up(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,lp=new Map,t.forEach(dp,e),lp=null,cp.call(e))}function dp(e,t){if(!(t.state.loading&4)){var n=lp.get(e);if(n)var r=n.get(null);else{n=new Map,lp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=cp.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var fp={$$typeof:C,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function pp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Je(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Je(0),this.hiddenUpdates=Je(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function mp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new pp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=si(3,null,null,t),e.current=a,a.stateNode=e,t=ca(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Va(a),e}function hp(e){return e?(e=ai,e):ai}function gp(e,t,n,r,i,a){i=hp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ua(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Wa(e,r,t),n!==null&&(Eu(n,e,t),Ga(n,e,t))}function _p(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vp(e,t){_p(e,t),(e=e.alternate)&&_p(e,t)}function yp(e){if(e.tag===13||e.tag===31){var t=ni(e,67108864);t!==null&&Eu(t,e,67108864),vp(e,67108864)}}function bp(e){if(e.tag===13||e.tag===31){var t=wu();t=et(t);var n=ni(e,t);n!==null&&Eu(n,e,t),vp(e,t)}}var xp=!0;function Sp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,wp(e,t,n,r)}finally{I.p=a,F.T=i}}function Cp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,wp(e,t,n,r)}finally{I.p=a,F.T=i}}function wp(e,t,n,r){if(xp){var i=Tp(r);if(i===null)Ld(e,t,r,Ep,n),Lp(e,r);else if(zp(i,e,t,n,r))r.stopPropagation();else if(Lp(e,r),t&4&&-1<Ip.indexOf(e)){for(;i!==null;){var a=ht(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ue(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ie(o);s.entanglements[1]|=c,o&=~c}hd(a),!(Gl&6)&&(fu=we()+500,gd(0,!1))}}break;case 31:case 13:s=ni(a,2),s!==null&&Eu(s,a,2),ju(),vp(a,2)}if(a=Tp(r),a===null&&Ld(e,t,r,Ep,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ld(e,t,r,null,n)}}function Tp(e){return e=en(e),Dp(e)}var Ep=null;function Dp(e){if(Ep=null,e=mt(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ep=e,null}function Op(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Te()){case Ee:return 2;case De:return 8;case Oe:case ke:return 32;case Ae:return 268435456;default:return 32}default:return 32}}var kp=!1,Ap=null,jp=null,Mp=null,Np=new Map,Pp=new Map,Fp=[],Ip=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Lp(e,t){switch(e){case`focusin`:case`focusout`:Ap=null;break;case`dragenter`:case`dragleave`:jp=null;break;case`mouseover`:case`mouseout`:Mp=null;break;case`pointerover`:case`pointerout`:Np.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Pp.delete(t.pointerId)}}function Rp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ht(t),t!==null&&yp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function zp(e,t,n,r,i){switch(t){case`focusin`:return Ap=Rp(Ap,e,t,n,r,i),!0;case`dragenter`:return jp=Rp(jp,e,t,n,r,i),!0;case`mouseover`:return Mp=Rp(Mp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Np.set(a,Rp(Np.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Pp.set(a,Rp(Pp.get(a)||null,e,t,n,r,i)),!0}return!1}function Bp(e){var t=mt(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,rt(e.priority,function(){bp(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,rt(e.priority,function(){bp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Vp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);$t=r,n.target.dispatchEvent(r),$t=null}else return t=ht(n),t!==null&&yp(t),e.blockedOn=n,!1;t.shift()}return!0}function Hp(e,t,n){Vp(e)&&n.delete(t)}function Up(){kp=!1,Ap!==null&&Vp(Ap)&&(Ap=null),jp!==null&&Vp(jp)&&(jp=null),Mp!==null&&Vp(Mp)&&(Mp=null),Np.forEach(Hp),Pp.forEach(Hp)}function Wp(e,n){e.blockedOn===n&&(e.blockedOn=null,kp||(kp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Up)))}var Gp=null;function Kp(e){Gp!==e&&(Gp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Gp===e&&(Gp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Dp(r||n)===null)continue;break}var a=ht(n);a!==null&&(e.splice(t,3),t-=3,Os(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function qp(e){function t(t){return Wp(t,e)}Ap!==null&&Wp(Ap,e),jp!==null&&Wp(jp,e),Mp!==null&&Wp(Mp,e),Np.forEach(t),Pp.forEach(t);for(var n=0;n<Fp.length;n++){var r=Fp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Fp.length&&(n=Fp[0],n.blockedOn===null);)Bp(n),n.blockedOn===null&&Fp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ot]||null;if(typeof a==`function`)o||Kp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ot]||null)s=o.formAction;else if(Dp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Kp(n)}}}function Jp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Yp(e){this._internalRoot=e}Xp.prototype.render=Yp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;gp(n,wu(),e,t,null,null)},Xp.prototype.unmount=Yp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gp(e.current,2,null,e,null,null),ju(),t[st]=null}};function Xp(e){this._internalRoot=e}Xp.prototype.unstable_scheduleHydration=function(e){if(e){var t=nt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Fp.length&&t!==0&&t<Fp[n].priority;n++);Fp.splice(n,0,e),n===0&&Bp(e)}};var Zp=n.version;if(Zp!==`19.2.8`)throw Error(a(527,Zp,`19.2.8`));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var Qp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var $p=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$p.isDisabled&&$p.supportsFiber)try{Ne=$p.inject(Qp),Pe=$p}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(a(299));var n=!1,r=``,i=Zs,o=Qs,c=$s;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=mp(e,1,!1,null,null,n,r,null,i,o,c,Jp),e[st]=t.current,Fd(e),new Yp(t)}})),u=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=l()})),d=t(i(),1),f=u(),p={xs:10,sm:11,base:12,lg:13,xl:14,"2xl":15,"3xl":16,"4xl":18,"5xl":20};function m(e,t={}){return e.replace(/\{([\w.-]+)\}/g,(e,n)=>{let r=t[n];return r===void 0?e:String(r)})}function h(e,t,n,r={}){let i=n[e]?.[t]??n.en?.[t];return i===void 0?t:m(i,r)}function g(e,t,n=new Date){let r=(e instanceof Date?e:new Date(e)).getTime()-n.getTime(),i=Math.abs(r),[a,o]=i<6e4?[`second`,1e3]:i<36e5?[`minute`,6e4]:i<864e5?[`hour`,36e5]:[`day`,864e5],s=Math.round(r/o);return new Intl.RelativeTimeFormat(t,{numeric:`always`}).format(s,a)}var _={id:`en`,label:`English`,messages:{"common.ok":`OK`,"common.language":`Language`,"common.models":`Models`,"common.skills":`Skills`,"common.plugins":`Plugins`,"sidebar.hide":`Collapse sidebar`,"sidebar.show":`Expand sidebar`,"theme.light":`Switch to light mode`,"preferences.defaultThinkingLevel":`Default thinking level`,"preferences.thinkingLevelHint":"Global default for new sessions (settings.json `defaultThinkingLevel`). Not set = field removed, falls back to pi default.","preferences.thinkingLevelNotSet":`Not set (use model default)`,"preferences.compaction":`Auto compaction`,"preferences.compactionHint":"Automatically compact long sessions (settings.json `compaction`). When not configured the pi defaults are shown; any edit writes the full object.","preferences.compactionEnabled":`Enabled`,"preferences.compactionReserveTokens":`Reserve tokens`,"preferences.compactionReserveTokensHint":`Tokens reserved for model output, keeping reply space after compaction`,"preferences.compactionKeepRecentTokens":`Keep recent tokens`,"preferences.compactionKeepRecentTokensHint":`Tokens kept after compaction, counted backwards from the most recent messages`,"preferences.retry":`API retry`,"preferences.retryHint":"Retry settings for provider API calls (settings.json `retry`). When not configured the pi defaults are shown; any edit writes the full object. Provider sub-fields left empty are not written.","preferences.retryEnabled":`Enabled`,"preferences.retryEnabledHint":`Enable retries for failed API calls`,"preferences.retryMaxRetries":`Max retries`,"preferences.retryBaseDelayMs":`Base delay (ms)`,"preferences.retryBaseDelayMsHint":`Initial delay before the first retry, in milliseconds`,"preferences.retryProviderTimeoutMs":`Provider timeout (ms)`,"preferences.retryProviderMaxRetries":`Provider max retries`,"preferences.retryProviderMaxRetryDelayMs":`Provider max delay (ms)`,"preferences.defaultProjectTrust":`Default project trust`,"preferences.projectTrustHint":"Default trust for new projects (settings.json `defaultProjectTrust`). Not set = field removed (falls back to ask).","preferences.projectTrustNotSet":`Not set (ask)`,"preferences.projectTrustAsk":`Ask`,"preferences.projectTrustAlways":`Always trust`,"preferences.projectTrustNever":`Never trust`,"preferences.notifyEvents":`Notifications`,"preferences.notifyEventsHint":`Browser notifications when the tab is not active. Permission is requested on first interaction.`,"notify.permission.request":`Enable notifications`,"notify.permission.requestHint":`Click to enable browser notifications — you'll be alerted when a task finishes even if this tab is in the background`,"notify.permission.granted":`Notifications on`,"notify.permission.grantedHint":`Browser notifications are enabled — you'll be alerted when a task finishes even if this tab is in the background`,"notify.permission.bannerHintBefore":`Click the`,"notify.permission.bannerHintAfter":`button in the top-left toolbar to enable notifications — you'll be alerted when a task completes, errors, or asks a question. Fine-tune in Config Center → Session → Notifications`,"notify.permission.denied":`Notifications blocked`,"notify.permission.deniedHint":`Notifications are blocked by the browser. Click the icon next to the address bar → Site settings, switch notifications to Allow, then try again`,"preferences.notifyWhileActive":`Notify while page active`,"preferences.notifyTaskComplete":`Task complete`,"preferences.notifyErrors":`Errors`,"preferences.notifyQuestions":`Questions`,"preferences.subagentsDefaultModel":`Subagent default model`,"preferences.subagentsDefaultThinking":`Subagent default thinking level`,"preferences.subagentsHint":"Defaults for subagents (settings.json `subagents`). defaultThinking not set = sub-field removed (falls back to pi default).","preferences.subagentsModelPlaceholder":`provider/model-id`,"theme.dark":`Switch to dark mode`,"theme.toggleTheme":`Switch theme`,"theme.darkMode":`Dark`,"theme.lightMode":`Light`,"theme.fontSize":`Font size`,"theme.scrollStep":`Hover scroll step`,"scrollStep.hint":`Pixels scrolled per hover tick on the edge scroll arrows (shared by the panel scroll arrows and the minimap).`,"scrollStep.range":`per hover tick (1-1000)`,"scrollStep.unit":`px`,"theme.autoReloadSeconds":`Auto-reload chat messages interval`,"autoReload.off":`Off (0) — do not auto-reload`,"autoReload.range":`seconds (0 — 3600)`,"autoReload.unit":`s`,"autoReload.hint":`Interval in seconds for re-reading the session file; 0 = off. Keep 0 for single-client use (messages arrive via SSE in real time); set it above 0 for multi-client collaboration (several browsers on the same session) so each client refreshes periodically and picks up chat messages generated by the others.`,"longBlock.hint":`“Blocks” are thinking and tool calls. Bodies beyond the threshold collapse to a head/tail digest; click to expand the full text.`,"recentBlocks.hint":`Streaming blocks and the just-completed block are not counted (the newest completed block always stays expanded). This is how many additional recent completed blocks stay expanded.`,"autoReload.reset":`Reset to default ({n} s)`,"chat.reloadFromDisk":`Reload session from disk`,"chat.reloadFromDiskHint":`Use when multiple clients read/write the same session jsonl at the same time. You can set automatic timed reloading under Config Center → Session.`,"scrollStep.reset":`Reset to default ({n} px)`,"theme.longBlockCollapse":`Long block collapse`,"theme.recentBlocksExpanded":`Recent completed blocks kept expanded`,"layout.sidebarWidth":`Left panel width`,"layout.widgetPanelWidth":`Right panel width`,"layout.widthRange":`px ({min}–{max})`,"layout.widthReset":`Reset to default ({value} px)`,"longBlock.range":`chars (20-10000)`,"longBlock.chars":`chars`,"longBlock.blocks":`blocks`,"longBlock.reset":`Reset to default ({n} chars)`,"recentBlocks.reset":`Reset to default ({n})`,"recentBlocks.range":`0-20, excludes the newest completed block`,"longBlock.expandHint":`… {n} chars folded · click to expand`,"longBlock.collapse":`Click to collapse`,"history.full":`Full history`,"history.unsaved":`Full history is available after the session is saved`,"title.generating":`Generating...`,"title.updated":`Title updated`,"title.failed":`Generation failed`,"title.generate":`Generate title`,"title.unsaved":`Title generation is available after the session is saved`,"title.noMessages":`Send a message before naming this session`,"title.generateSession":`Generate a session title`,"system.prompt":`System prompt`,"system.empty":`System prompt is empty (tools are disabled)`,"system.load":`Send a message to load the system prompt`,"session.info":`Session info`,"session.reload":`Reload session (re-read config and resources)`,"session.name":`Name`,"session.file":`File`,"session.inMemory":`In-memory`,"session.id":`ID`,"session.user":`User`,"session.assistant":`Assistant`,"session.toolCalls":`Tool Calls`,"session.toolResults":`Tool Results`,"session.total":`Total`,"session.input":`Input`,"session.output":`Output`,"session.cacheRead":`Cache Read`,"session.cacheWrite":`Cache Write`,"session.inputHint":`Prompt tokens NOT served from cache: system prompt, history and tool definitions sent to the model, minus the cached portion`,"session.outputHint":`Tokens generated by the model (answers and thinking)`,"session.cacheReadHint":`Tokens served from prompt cache: unchanged context re-read from the previous request at a discounted rate`,"session.cacheWriteHint":`Tokens written to cache for the first time (billed on write, Anthropic-style)`,"session.totalHint":`input + output + cacheRead + cacheWrite`,"session.cacheReadRate":`Cache hit rate: cache-read tokens as a share of all input prompt tokens (input + cacheRead + cacheWrite), the official formula cacheRead / (input + cacheRead + cacheWrite)`,"session.cost":`Cost`,"session.context":`Context`,"session.copy":`Copy {value}`,"session.copied":`Copied`,"session.title":`Session info`,"session.load":`Send a message or run /session to load session info`,"session.infoSection":`Session Info`,"session.messages":`Messages`,"session.tokens":`Tokens`,"session.copyFile":`Copy file path`,"session.copyId":`Copy session ID`,"workspace.opening":`Opening workspace...`,"workspace.unable":`Unable to open workspace`,"workspace.selectSession":`Select a session from the sidebar`,"workspace.selectWorkspace":`Please select a workspace`,"workspace.stepProject":`Select a project directory from the sidebar`,"workspace.stepModels":`Add models via the Models button at the bottom`,"tabs.chat":`Chat`,"tabs.widgets":`Widgets`,"config.title":`Settings`,"config.section.session":`Session`,"config.section.appearance":`Appearance`,"config.section.advanced":`Advanced`,"config.section.startScreen":`Start screen`,"config.section.git":`Git`,"config.section.updates":`Updates`,"config.section.modelThinking":`Thinking Levels`,"config.section.requiresCwd":`Select a project directory from the sidebar first to browse plugins / skills`,"updates.check":`Check for updates`,"updates.checking":`Checking…`,"updates.checkedAt":`Last checked`,"updates.upToDate":`Up to date`,"updates.updateAvailable":`Update available`,"updates.unavailable":`Check failed`,"updates.noPluginUpdates":`All plugins are up to date`,"updates.banner":`Update available: {items}`,"updates.view":`View`,"updates.copied":`Copied`,"updates.copyCommand":`Copy command`,"updates.restartNote":`Also upgrades the bundled pi SDK; restart pi-web to load it.`,"updates.enableChecking":`Enable update checks`,"updates.disabled":`Update checks disabled`,"updates.ignoreVersion":`Ignore this version`,"updates.ignored":`Ignored {version}`,"updates.ignoredPlugin":`Ignored`,"updates.unignore":`Unignore`,"preferences.pi.unset":`pi default`,"preferences.pi.enableAnalytics":`Enable analytics`,"preferences.pi.enableAnalyticsHint":"Send anonymous usage analytics (settings.json `enableAnalytics`)","preferences.pi.enableInstallTelemetry":`Enable install telemetry`,"preferences.pi.enableInstallTelemetryHint":"Send anonymous install telemetry (settings.json `enableInstallTelemetry`)","preferences.pi.httpProxy":`HTTP proxy`,"preferences.pi.httpProxyHint":"Proxy URL for HTTP requests (settings.json `httpProxy`). Empty input cannot clear an already-set value.","preferences.pi.trackingId":`Analytics tracking ID`,"preferences.pi.trackingIdHint":"Custom analytics tracking ID (settings.json `trackingId`). Empty input cannot clear an already-set value.","preferences.pi.httpIdleTimeoutMs":`HTTP idle timeout (ms)`,"preferences.pi.httpIdleTimeoutMsHint":"HTTP idle timeout in ms (settings.json `httpIdleTimeoutMs`). Empty input cannot clear an already-set value.","preferences.pi.websocketConnectTimeoutMs":`WebSocket connect timeout (ms)`,"preferences.pi.websocketConnectTimeoutMsHint":"WebSocket connect timeout in ms (settings.json `websocketConnectTimeoutMs`). Empty input cannot clear an already-set value.","preferences.pi.branchSummary":`Branch summary`,"preferences.pi.branchSummaryHint":"Branch summary auto-compaction (settings.json `branchSummary`)","preferences.pi.reserveTokens":`Reserve tokens`,"preferences.pi.skipPrompt":`Skip prompt`,"preferences.pi.images":`Image handling`,"preferences.pi.imagesHint":"How the pi engine handles images (settings.json `images`)","preferences.pi.autoResize":`Auto-resize`,"preferences.pi.autoResizeHint":"Downscale images returned by tools such as `read` to save tokens.","preferences.pi.blockImages":`Block images`,"preferences.pi.blockImagesHint":`Strip all image content from messages before they reach the model.`,"config.files.hint":`Edit pi's config files (JSON) directly. Validated before save; backed up automatically (last 10 kept).`,"config.widgets.empty":`No widget configurations yet. Widgets appear here automatically when an extension pops one up.`,"config.widgets.x":`x`,"config.widgets.y":`y`,"config.widgets.width":`w`,"config.widgets.height":`h`,"config.widgets.bind":`Bind message`,"config.widgets.bindTitle":`Bind custom message`,"config.widgets.bindHint":`Bind a quick message to widget "{key}"`,"config.widgets.editTitle":`Edit quick message`,"config.widgets.editHint":`Edit the label, content, and send mode.`,"config.widgets.label":`Label`,"config.widgets.labelPlaceholder":`Button text (e.g. Reload)`,"config.widgets.message":`Message`,"config.widgets.messagePlaceholder":`A slash command or any text (e.g. /reload)`,"config.widgets.messageTooltip":`Type / to see built-in, global plugin and Skill commands. Project-level plugin commands won't appear in suggestions but can still be entered and saved manually.`,"config.widgets.sendImmediately":`Send immediately`,"config.widgets.sendMode":`Send mode`,"config.widgets.fillToChatInput":`Fill into chat input`,"config.widgets.sendImmediatelyTooltip":`Send immediately: `,"config.widgets.fillToChatInputTooltip":`Fill into chat input: `,"config.widgets.nameConflict":`Name "{label}" already exists, please use another`,"config.startScreen.nameConflict":`Name "{label}" already exists, please use another`,"config.startScreen.hint":`Quick actions shown on the new-session start screen (below the Pi logo); clicking sends the message immediately or fills it into the chat input, depending on each entry's send mode.`,"config.startScreen.bind":`Bind message`,"config.startScreen.bindTitle":`Bind quick message`,"config.startScreen.bindHint":`Bind a quick message to the start screen.`,"config.startScreen.empty":`No quick messages yet; the start screen will show no quick actions.`,"config.startScreen.unbindTitle":`Unbind message`,"config.startScreen.unbindConfirm":`Unbind "{label}"?`,"config.startScreen.unbind":`Unbind`,"config.widgets.confirm":`Confirm`,"config.widgets.unbindTitle":`Unbind message`,"config.widgets.unbindConfirm":`Unbind "{label}"?`,"config.widgets.unbind":`Unbind`,"config.startScreen.editTitle":`Edit quick message`,"config.startScreen.editHint":`Edit the label, content, and send mode.`,"config.startScreen.reset":`Reset`,"config.startScreen.resetHint":`Restore the built-in default quick messages; keep your own bound messages (ones with the same label as a default are replaced by the default).`,"config.files.save":`Save`,"config.files.saving":`Saving...`,"config.files.saved":`Saved`,"config.files.missing":`Not created yet`,"config.files.placeholder":`Select a config file from the list on the left`,"layout.resizeSidebar":`Resize sidebar`,"layout.resizeWidgetPanel":`Resize widgets panel`,"layout.resizeHint":`Drag to resize. Double-click or press Enter to reset.`,"sidebar.newWorkspace":`New workspace`,"sidebar.searchSessions":`Search sessions`,"sidebar.searchSessionsPlaceholder":`Search sessions…`,"sidebar.justNow":`just now`,"sidebar.minutesAgo":`{count}m ago`,"sidebar.hoursAgo":`{count}h ago`,"sidebar.daysAgo":`{count}d ago`,"sidebar.searchSessionsNoResults":`No matching sessions`,"sidebar.newSessionTitle":`New session in {path}`,"sidebar.refresh":`Refresh`,"directoryPicker.selectDirectory":`Select directory`,"directoryPicker.goToParent":`Go to parent directory`,"directoryPicker.directoryPath":`Directory path`,"directoryPicker.goToDirectory":`Go to directory`,"directoryPicker.go":`Go`,"directoryPicker.loadingDirectories":`Loading directories…`,"directoryPicker.noSubdirectories":`No subdirectories`,"directoryPicker.openBeforeSelecting":`Open this path before selecting it`,"directoryPicker.selectCurrentDirectory":`Select current directory`,"directoryPicker.selectThisFolder":`Select this folder`,"directoryPicker.noDrives":`No drives found`,"directoryPicker.search":`Filter folders`,"directoryPicker.noMatches":`No folders match your filter`,"sidebar.checking":`Checking…`,"sidebar.open":`Open`,"sidebar.cancel":`Cancel`,"sidebar.openRepoRoot":`Worktree switch unavailable`,"sidebar.openRepoRootTitle":`Worktree switching is unavailable here — switch the current working directory to the Git repository root first (from the sidebar).`,"sidebar.gitRepoRootOnly":`Git repo root only`,"sidebar.gitRepoRootOnlyTitle":`Worktrees are available in Git repository roots.`,"sidebar.worktrees":`Worktrees...`,"sidebar.checkingWorktrees":`Checking worktrees for this directory.`,"sidebar.filterWorktrees":`Filter worktrees…`,"sidebar.noMatchingWorktrees":`No matching worktrees`,"sidebar.switchWorktree":`Switch worktree`,"sidebar.switchWorktreeTitle":`Switch worktree: {path}`,"sidebar.main":`main`,"sidebar.forceRemoveCheckout":`Uncommitted changes. Force remove checkout?`,"sidebar.force":`Force`,"sidebar.createWorktreeTitle":`Create a worktree checkout for a branch`,"sidebar.newWorktree":`New worktree…`,"sidebar.branchName":`branch name`,"sidebar.creating":`Creating…`,"sidebar.create":`Create`,"sidebar.uploadFilesTitle":`Upload files to project root`,"sidebar.uploadFiles":`Upload files`,"sidebar.refreshExplorer":`Refresh explorer`,"sidebar.changedFiles":`{count} changed files`,"sidebar.loading":`Loading...`,"sidebar.sessionDeleted":`Session deleted — pick another session`,"sidebar.noSessions":`No sessions found`,"sidebar.workspace":`Workspace`,"sidebar.newActivity":`New activity`,"sidebar.newSessionActivity":`New session activity`,"sidebar.interactionBadge":`Session waiting for interaction`,"sidebar.deleteSession":`Delete {title}?`,"sidebar.deleteWorkspace":`Delete workspace ({count} sessions)?`,"sidebar.deleteWorkspaceTitle":`Delete this workspace and all its sessions`,"sidebar.copyPath":`Copy full path`,"sidebar.rename":`Rename`,"sidebar.delete":`Delete`,"sidebar.deleteWithShiftClick":`Delete (Shift+click to delete without confirmation)`,"sidebar.expandForks":`Expand forks`,"sidebar.collapseForks":`Collapse forks`,"sidebar.disconnect":`Disconnect`,"sidebar.messagesCount":`{count} msgs`,"sidebar.worktreePath":`Worktree: {path}`,"sidebar.removeWorktreeTitle":`Remove worktree checkout {path}; the branch is kept`,"files.modified":`Modified`,"files.added":`Added`,"files.deleted":`Deleted`,"files.renamed":`Renamed`,"files.untracked":`Untracked`,"files.conflict":`Conflict`,"files.newlyUploaded":`Newly uploaded`,"files.containsChangedFiles":`Contains changed files`,"files.insertPath":`Insert path into chat`,"files.mention":`mention`,"files.download":`Download file`,"files.dismissError":`Dismiss error`,"files.addUploadedFile":`Add uploaded file to chat`,"files.addAllUploadedFiles":`Add all uploaded files to chat`,"files.openInSystemApp":`Open with system app`,"files.chooseOtherApp":`Choose another app…`,"files.openLaunched":`Launched with the system app`,"files.fileTooLargeForPreview":`File too large for preview (>{limit})`,"files.docTooLargeForPreview":`DOCX too large for preview (>{limit})`,"files.dismissUploadResults":`Dismiss upload results`,"files.loading":`Loading files...`,"files.noFiles":`No files found`,"loading.inProgress":`Working…`,"loading.more":`{count} more…`,"errors.title":`Error`,"errors.titleCount":`Errors ({count})`,"errors.close":`Close`,"errors.clearAll":`Clear all`,"files.notFound":`Not found`,"files.accessDenied":`Access denied`,"files.empty":`Empty`,"files.uploadFailed":`{count} failed`,"files.explorer":`Explorer`,"files.changedCount":`{count} files`,"files.stagedPrefix":`Staged: `,"files.unstagedPrefix":`Unstaged: `,"files.noStagedChanges":`No staged files`,"files.noUnstagedChanges":`No unstaged changes`,"files.commitMessagePlaceholder":`Commit message`,"files.commit":`Commit`,"files.push":`Push to remote (with tags)`,"files.pushing":`Pushing...`,"files.pushSuccess":`Push succeeded`,"files.pushFailed":`Push failed`,"files.pushUpToDate":`Already up to date — nothing to push`,"files.pull":`Pull from remote`,"files.pulling":`Pulling...`,"files.pullSuccess":`Pull succeeded`,"files.pullFailed":`Pull failed`,"files.pullUpToDate":`Already up to date — nothing to pull`,"files.pullNonFastForward":`Pull rejected — local and remote have diverged. Use git pull --rebase or --merge in terminal.`,"files.committing":`Committing…`,"files.commitMessageRequired":`Enter a commit message first`,"files.commitTitle":`Commit changes`,"files.confirmStageAllCommit":`{count} changed files are not staged. Stage them all and commit?`,"files.stageAllAndCommit":`Stage & commit`,"files.stageFile":`Stage file`,"files.unstageFile":`Unstage file`,"files.changeStats":`{count} changed files, {additions} lines added, {deletions} lines deleted`,"git.autoFetchInterval":`Auto fetch interval (seconds)`,"git.autoFetchIntervalHint":`How often the server fetches remotes for active session workspaces (shared by all clients). 0 disables the timer — one fetch runs when a session connects.`,"git.groupTitle":`Smart Commit Message Generation`,"git.commitModel.followCurrent":`Follow current session model`,"git.commitModel.followCurrentHint":`When on, the commit generation follows the current chat's main model. When off, the fixed model below is used (recommended for a cheap dedicated model).`,"git.commitModel.followCurrentOn":`On: follow current session`,"git.commitModel.followCurrentOff":`Off: use fixed model`,"git.commitModel.fixedModel":`Fixed model`,"git.commitModel.fixedModelHint":`Model used when "follow current session" is off (choose a cheap fixed model; note it may have only ~50k context).`,"git.commitModel.selectPlaceholder":`Select a model`,"git.commitModel.noModels":`No models available`,"git.commitModel.notConfiguredHint":`No fixed model selected. Pick a model before using AI generate.`,"git.ai.generate":`Smart generate`,"git.ai.generating":`Generating…`,"git.ai.notConfiguredTitle":`Model not configured`,"git.ai.notConfiguredDesc":`No model is set for Smart generate. Go to Config Center → Git to set one.`,"git.ai.goToConfig":`Go to settings`,"git.ai.noSession":`Follow-current mode requires an active session`,"git.ai.noSessionModel":`Current session has no model. Select a model in chat first`,"git.commitModel.maxTokens":`Max output tokens`,"git.commitModel.maxTokensHint":`Max output tokens for one generation (64–4096, default 512). Reasoning is minimized: disabled when the model supports it, otherwise reduced to the lowest level.`,"git.commitModel.autoGenerateOnEmpty":`Auto-generate when commit box is empty`,"git.commitModel.autoGenerateOnEmptyHint":`When on, clicking Commit with an empty box auto-generates a message first, then commits. Only when a model is configured; otherwise empty stays disabled. On by default.`,"git.ai.invalidModel":`Configured model is invalid. Reselect it in Config Center.`,"git.ai.autoGenerateOn":`On: auto-generate when empty`,"git.ai.usingCurrentModel":`Using current chat model`,"git.ai.usingModel":`Using {model}`,"git.ai.generateAndCommit":`Smart generate & commit`,"git.ai.autoGenerateOff":`Off`,"git.commitSectionTitle":`Commit`,"git.commitConfirmStageAll":`Confirm “stage all” on commit`,"git.commitConfirmStageAllHint":`When on, committing with only unstaged changes shows a “Stage all & commit” confirmation. When off, it stages all and commits directly. On by default.`,"git.commitConfirmStageAllOn":`On: confirm before staging all`,"git.commitConfirmStageAllOff":`Off: stage all directly`,"modelThinking.desc":`Remember the last thinking level per model or provider. When switching models, the selector restores the remembered level; if the model's available levels don't include it, it falls back to auto (use default). All 7 levels supported: off / minimal / low / medium / high / xhigh / max.`,"modelThinking.byModel":`By model`,"modelThinking.byProvider":`By provider`,"modelThinking.byProviderHint":`Provider fallback: models without a per-model entry use this value.`,"modelThinking.emptyModel":`No per-model memory yet. Selecting a thinking level after switching models will remember it automatically; you can also add one here.`,"modelThinking.emptyProvider":`No per-provider memory yet.`,"modelThinking.selectModelPlaceholder":`Select a model`,"modelThinking.selectProviderPlaceholder":`Select a provider`,"modelThinking.providerInputPlaceholder":`or type a provider name`,"modelThinking.footerHint":`Stored in a standalone file pi-web/model-thinking.json, not the main config. UI-only — pi's set_thinking_level is not intercepted.`,"common.add":`Add`,"common.delete":`Delete`,"files.conflictSummary":`{count} file{countSuffix} already exist: {files}`,"files.cannotReplace":`Cannot replace: {files}`,"files.replace":`Replace`,"files.skipExisting":`Skip existing`,"files.cancel":`Cancel`,"files.checking":`Checking files`,"files.uploading":`Uploading, {progress}%`,"files.search":`Search files`,"files.searchPlaceholder":`Search files...`,"chat.loadingSession":`Loading session...`,"chat.noSessionSelected":`Create or select a session in the left panel`,"chat.loadingWindow":`Loading messages...`,"chat.runningTool":`Running tool...`,"chat.runningNamedTool":`Running {name}...`,"chat.runningTools":`Running {names}...`,"chat.runningToolsMore":`Running {names} (+{count})...`,"chat.waitingModel":`Waiting for model...`,"chat.turnDuration":`took {duration}`,"chat.aiQuestion":`AI question`,"chat.runningCommand":`Running command...`,"chat.totalElapsed":`total {total}`,"chat.thinking":`Thinking...`,"chat.message":`message`,"chat.messages":`messages`,"chat.toolCall":`tool call`,"chat.toolCalls":`tool calls`,"chat.collapseProcess":`Collapse process details`,"chat.expandProcess":`Expand process details`,"chat.loadEarlier":`Scroll up to load earlier messages ({count} hidden)`,"chat.searchMessages":`Search messages`,"chat.clearSearch":`Clear search query`,"chat.scrollToLatest":`Scroll to latest message`,"chat.expandMessage":`Expand full content`,"chat.searchPlaceholder":`Search chat messages…`,"chat.searchNoResults":`No results`,"chat.searchResults":`{count} results`,"chat.extensionRequest":`extension request`,"chat.cancel":`Cancel`,"chat.confirm":`Confirm`,"chat.submit":`Submit`,"chat.extensionInput":`Extension terminal input`,"chat.extensionSelect":`Select an option`,"chat.extensionConfirm":`Confirm`,"chat.extensionEditor":`Edit`,"chat.extensionPanel":`Extension panel`,"chat.close":`Close`,"chat.notifyErrorTitle":`Error`,"chat.notifyWarningTitle":`Warning`,"chat.queued":`Queued · {count}`,"chat.recall":`Recall to input`,"chat.recallTitle":`Remove all queued messages and put them back into the input box for editing (also triggered by pressing Enter while the input is empty)`,"chat.retrying":`Retrying ({attempt}/{max})…`,"chat.loadingCommands":`Loading commands...`,"chat.slashCommands":`Slash commands · {label}`,"chat.tabEnter":`Tab / Enter`,"chat.noCommands":`No extension, prompt, or skill commands found`,"chat.match":`1 match`,"chat.matches":`{count} matches`,"chat.command":`1 command`,"chat.commands":`{count} commands`,"chat.loadingFiles":`Loading files...`,"chat.files":`Files · {label}{hint}`,"chat.searching":`Searching…`,"chat.noMatchingFiles":`No matching files`,"chat.searchingAll":` · searching all files…`,"chat.indexTruncated":` · index truncated`,"chat.steerPlaceholder":`Steer now / queue follow-up...`,"chat.recallPlaceholder":`Press Enter to recall queued messages, or type a new message…`,"chat.agentPlaceholder":`Agent is running…`,"chat.messagePlaceholder":`Message… Type / for commands, @ for files, ! for shell`,"chat.questionNotificationTitle":`Pi — Question Asked`,"chat.taskCompleteNotificationTitle":`Pi — Task Complete`,"chat.taskErrorNotificationTitle":`Pi — Error`,"chat.sessionCompletedNotificationBody":`Session {name} completed`,"chat.questionNotificationDenied":`Notifications denied: allow them in the browser's site settings to get question alerts while the tab is hidden.`,"chat.steer":`Steer`,"chat.followUp":`Follow-up`,"chat.queueImageBlocked":`Image attachments cannot be queued while the agent is running`,"chat.steerTooltip":`Send this message immediately after the current call finishes`,"chat.followUpTooltip":`Queue this message after the agent finishes`,"chat.send":`Send`,"chat.attachImage":`Attach image`,"chat.filterModels":`Filter models…`,"chat.noMatchingModels":`No matching models`,"chat.moreControls":`More controls`,"chat.collapseControls":`Collapse controls`,"chat.shell":`Shell`,"chat.outputLocal":`output stays local`,"chat.outputModel":`output sent to model`,"chat.noTools":`No tools, read-only`,"chat.builtInTools":`{count} built-in tools`,"chat.allBuiltInTools":`All built-in tools`,"chat.changeReasoning":`Change reasoning level: {level}`,"chat.changeReasoningLabel":`Change reasoning level`,"chat.changeToolPreset":`Change tool preset`,"chat.stopCompaction":`Stop compaction`,"chat.compactContext":`Compact context`,"chat.compacting":`Compacting…`,"chat.compact":`Compact`,"chat.stopAgent":`Stop agent`,"chat.stop":`Stop`,"chat.disableSound":`Disable completion sound`,"chat.enableSound":`Enable completion sound`,"chat.thinkingUseDefault":`Use pi default`,"chat.thinkingOff":`Reasoning off`,"chat.thinkingMinimal":`Minimal reasoning`,"chat.thinkingLow":`Low reasoning`,"chat.thinkingMedium":`Medium reasoning`,"chat.thinkingHigh":`High reasoning`,"chat.thinkingXhigh":`Extra-high reasoning`,"chat.thinkingMax":`Max reasoning`,"chat.thinkingMapTitle":`Higher thinking levels not configured`,"chat.thinkingMapBody":`pi supports up to high thinking by default. To enable {level} level reasoning, configure the "Thinking Level Map" for this model in Config → Models.`,"chat.thinkingMapGo":`Go to settings`,"chat.builtIn":`Built-in`,"chat.extensions":`Extensions`,"chat.prompts":`Prompts`,"chat.skills":`Skills`,"chat.dormant":`dormant`,"chat.commandCompact":`Compress context, optionally with instructions`,"chat.commandReload":`Reload extensions, skills, prompts, and tools`,"chat.commandName":`Set the session display name`,"chat.commandSession":`Show session message, token, and cost stats`,"chat.commandCopy":`Copy the last assistant message`,"chat.compacted":`Compacted`,"chat.tokensSaved":`{saved} saved`,"i18n.close":`Close`,"i18n.resizeList":`Resize {name} list`,"widgets.title":`Widgets`,"widgets.reopen":`Reopen widget`,"widgets.expandedToChat":`Widget [{key}] expanded to the chat view`,"widgets.collapse":`Collapse`,"widgets.open":`Open widgets`,"i18n.copy":`Copy`,"i18n.copied":`Copied`,"i18n.cancel":`Cancel`,"i18n.save":`Save`,"i18n.saving":`Saving…`,"i18n.saved":`Saved`,"i18n.saveChanges":`Save changes`,"i18n.noThinking":`No thinking content`,"i18n.remove":`Remove`,"i18n.removing":`Removing…`,"i18n.delete":`Delete`,"i18n.loading":`Loading...`,"i18n.searchPlaceholder":`Search…`,"i18n.noMatch":`No matches`,"i18n.search":`Search`,"i18n.refresh":`Refresh`,"i18n.update":`Update`,"i18n.updating":`Updating...`,"i18n.check":`Check`,"i18n.checking":`Checking...`,"i18n.install":`Install`,"i18n.installing":`Installing...`,"i18n.noResults":`No results`,"i18n.searchProviders":`Search providers…`,"i18n.noProviders":`No providers match`,"i18n.newModel":`new model`,"i18n.addProvider":`Add provider`,"i18n.selectProviderModel":`Select a provider or model`,"i18n.visibleInPrompt":`Visible in model prompt — click to disable`,"i18n.hiddenFromPrompt":`Hidden from model prompt — click to enable`,"i18n.dormant":`Dormant`,"i18n.hiddenButInvocable":`Hidden from model, still manually invocable`,"i18n.skillSearchPlaceholder":`e.g. react, testing, deploy`,"i18n.searching":`Searching…`,"i18n.noSkills":`No skills found`,"i18n.checkUpdates":`Check updates`,"i18n.updates":`updates`,"i18n.noResolvedResources":`No resolved resources`,"i18n.enablePackage":`Enable package`,"i18n.disablePackage":`Disable package`,"i18n.filtered":`filtered`,"i18n.openSessionToReload":`Open a session to reload`,"i18n.notFound":`Not found`,"i18n.noPlugins":`No plugins configured`,"trust.resourcesNotLoaded":`Restricted mode`,"trust.trustProject":`Trust project`,"trust.trusting":`Trusting...`,"trust.cancel":`Cancel`,"trust.dialogTitle":`Trust this project?`,"trust.dialogBody":`Project resources can run local code. Trust only projects whose contents you know.`,"trust.skillsNotLoaded":`Project skills are not loaded because this project is not trusted.`,"trust.pluginsNotLoaded":`Project plugins are not loaded because this project is not trusted.`,"trust.projectScopeUnavailable":`Project installs are unavailable while project resources are not loaded.`,"i18n.creatingSession":`Creating new session…`,"i18n.creating":`Creating…`,"i18n.subscription":`Subscription`,"i18n.subscriptions":`Subscriptions`,"i18n.customEndpoint":`Custom endpoint format`,"i18n.noChanges":`No changes`,"i18n.branches":`Branches`,"i18n.noActiveSession":`No active session`,"i18n.noActiveSessionToCompact":`No active session to compact`,"i18n.noActiveSessionToReload":`No active session to reload`,"i18n.noActiveSessionToName":`No active session to name`,"i18n.noAssistantMessageToCopy":`No assistant message to copy`,"i18n.commandCompleted":`Command completed`,"i18n.commandFailed":`Command failed`,"i18n.extensionCommandFailed":`Extension command failed`,"i18n.compactedContext":`Compacted context`,"i18n.reloadedSessionResources":`Reloaded session resources`,"i18n.usageName":`Usage: /name <name>`,"i18n.sessionRenamedTo":`Session renamed to {name}`,"i18n.copiedLastAssistantMessage":`Copied last assistant message`,"i18n.failedToRecallQueuedMessages":`Failed to recall queued messages`,"i18n.noBranches":`This session has no branches`,"i18n.source":`Source`,"i18n.preview":`Preview`,"i18n.diff":`Diff`,"i18n.downloadFile":`Download file`,"i18n.liveSync":`Live sync active`,"i18n.notWatching":`Not watching`,"i18n.fileViewMode":`File view mode`,"i18n.editMode":`Edit mode`,"i18n.viewMode":`View mode`,"i18n.compareHead":`Compare working tree with HEAD`,"i18n.mentionSelectedLines":`Mention selected lines`,"i18n.disableWrap":`Disable word wrap`,"i18n.enableWrap":`Enable word wrap`,"i18n.editFile":`Edit file`,"i18n.saveFile":`Save`,"i18n.saveFileShortcut":`Save (Ctrl/Cmd+S)`,"i18n.cancelEdit":`Cancel`,"i18n.saveFailed":`Save failed: {error}`,"i18n.unsavedChanges":`Unsaved changes`,"i18n.htmlPreview":`HTML preview`,"i18n.previewFile":`Preview {file}`,"i18n.invalidMermaid":`Invalid Mermaid diagram`,"i18n.renderingMermaid":`Rendering Mermaid diagram`,"i18n.previewAfterStreaming":`Preview available after streaming`,"i18n.showMermaidSource":`Show Mermaid source`,"i18n.previewMermaid":`Preview Mermaid diagram`,"i18n.openMermaidViewer":`Open diagram viewer`,"i18n.mermaidViewer":`Mermaid diagram viewer`,"i18n.mermaidDiagram":`Mermaid diagram`,"i18n.zoomOut":`Zoom out`,"i18n.zoomIn":`Zoom in`,"i18n.fitToWidth":`Fit to width`,"models.discoveryFetching":`Importing models…`,"models.deleteProviderConfirm":`Delete provider "{name}"? This writes to models.json immediately — all its settings (including the API key) will be removed and cannot be recovered.`,"models.removeModelConfirm":`Remove model "{model}"? This writes to models.json immediately and cannot be recovered.`,"models.discoveryTitle":`Import models`,"models.discoveryFetch":`Import models…`,"models.discoveryFilterPlaceholder":`Filter {count} models…`,"models.discoveryFilter":`Filter upstream models`,"models.discoverySelectShown":`Select shown`,"models.discoveryNoMatches":`No matching models.`,"models.discoveryAdded":`added`,"models.discoveryShowing":`Showing first {shown} of {total}`,"models.discoveryFetched":`{count} models fetched`,"models.discoveryAddSelected":`Add selected`,"models.setDefault":`Set as default`,"models.defaultModel":`Default model`,"models.defaultModelUnavailable":`Default model {model} is unavailable (deleted or hidden). Please select a model.`,"models.syncEndpoint":`Sync from endpoint`,"models.lastSyncedAt":`Last synced {time}`,"models.neverSynced":`Never synced`,"models.discoveryFetchTooltip":`Imports from the local cache first: {path}. If absent, syncs from the endpoint once and writes the cache there.`,"models.syncingModels":`Syncing…`,"models.syncedModels":`Synced {count} models`,"models.syncEndpointTooltip":`Fetch the latest model list from {endpoint} and cache it locally; the cached list replaces the built-in one.`,"models.syncEndpointTooltipGeneric":`Fetch the latest model list from this provider's models endpoint and cache it locally; the cached list replaces the built-in one.`,"models.refreshFromCache":`Refresh from synced cache`,"models.refreshing":`Refreshing…`,"models.refreshFromCacheTooltip":`Re-read pi-web/provider/{provider}/models.json and update only the fields that differ from the current effective definition (manual fields like headers are kept).`,"models.refreshNoDiff":`Synced cache matches the effective definition — nothing to update.`,"models.refreshDone":`Override updated from synced cache.`,"models.refreshTimeout":`Refresh timed out — try again later.`,"models.builtinProviders":`Built-in providers`,"models.customProviders":`Custom providers`,"models.syncSaveFailed":`Save draft before sync failed — sync aborted.`,"models.visibleInChat":`Visible in chat`,"models.visibleModels":`Visible models`,"models.visibleModelsCount":`{visible} / {total} visible`,"models.selectAll":`Select all`,"models.invertSelection":`Invert`,"models.searchModels":`Search models…`,"models.noVisibleModels":`No models.`,"models.filterAll":`All`,"models.filterVisible":`Visible`,"models.filterHidden":`Hidden`,"models.invertDisabledTooltip":`All models are already visible; inverting changes nothing`,"models.openOverride":`Edit override`,"models.overrideHint":`Values shown are the effective definition (built-in merged with saved overrides). Only fields you change are saved as overrides; everything else keeps inheriting the built-in definition.`,"models.overrideOrphanedHint":`This model no longer exists upstream. The local override is still saved — you can remove it here. Saving will also clean up its visibility entry.`,"models.removeOverride":`Remove override`,"models.providerNameCollision":`Provider "{provider}" conflicts with built-in "{builtin}" (case-insensitive); model visibility cannot be applied. Rename or remove the provider.`,"models.providerNameCollisionShort":`Name conflicts with built-in provider`,"models.builtinVisibilityBlocked":`Model visibility is disabled: custom provider "{custom}" conflicts with "{builtin}" (case-insensitive). Rename or remove the custom provider.`,"models.discoveryAddSelectedCount":`Add selected ({count})`,"models.dataSourceLabel":`Data source:`,"models.catalogSourceEndpoint":`Models endpoint`,"models.catalogSourceDev":`models.dev catalog`,"models.catalogSourceEndpointTooltip":`Source: Provider's /models endpoint`,"models.catalogSourceDevTooltip":`Source: models.dev built-in catalog (https://models.dev)`,"models.catalogEndpointNotFound":`Model ID not found in the models endpoint response`,"models.catalogOverwriteTitle":`Overwrite existing fields?`,"models.catalogOverwriteBody":`{{count}} field(s) already have values that overwriting would change: {{fields}}. Cancel to fill empty fields only.`,"models.catalogOverwriteConfirm":`Overwrite & fill`,"models.catalogOverwriteCancel":`Fill empty only`,"models.catalogFilling":`Filling details…`,"models.catalogFill":`Fill model details`,"models.catalogFilled":`{count} fields filled`,"models.catalogNoEmptyFields":`No empty fields to fill`,"models.catalogNoExactMatch":`No exact models.dev match`,"models.catalogPriceProvider":`Price matched Provider {provider}`,"models.catalogPriceBaseUrl":`Price matched Base URL to {provider}`,"models.catalogPriceConsensus":`Price agreed by {support}/{total} records`,"models.catalogPriceUnreliable":`No reliable price found`,"models.catalogUndo":`Undo`,"models.baseUrl":`Base URL`,"models.apiKey":`API Key`,"models.api":`API Format`,"models.modelId":`ID *`,"models.name":`Name`,"models.apiOverride":`API override`,"models.reasoningThinking":`Reasoning / thinking`,"models.imageInput":`Image input`,"models.imageInputHint":`Checking writes input: ["text", "image"]; unchecking removes input (falls back to ["text"]).`,"models.nameHint":`Leaving empty removes the name field (falls back to the model id).`,"models.apiOverrideHint":`Leaving empty or picking default removes the api field (falls back to the provider's default api).`,"models.reasoningHint":`Unchecking removes the reasoning field (falls back to off).`,"models.compatBoolTrueHint":`Unchecked does not mean false: pi treats a missing field as true. Unchecking writes explicit false so it can actually be turned off.`,"models.compatBoolHint":`Checking writes true; unchecking removes the field (falls back to auto-detect / false default).`,"models.compatSelectHint":`Picking default/none removes the field (falls back to auto-detect).`,"models.thinkingLevelMapHint":`Per level: Default = removes that mapping (falls back to the model's default level); Disabled = writes null; Custom = writes a custom level string.`,"models.compatSection":`Compatibility`,"models.compatInheritHint":`Fields not set on the model show values inherited from this provider (marked · from provider); the inherited value is what actually takes effect until overridden here.`,"models.inheritedFromProvider":`· from provider`,"models.thinkingFormatDeepseekHint":`Selecting "deepseek" also writes requiresReasoningContentOnAssistantMessages: true; any other value removes it.`,"models.samplingParams":`Sampling params`,"models.headers":`Headers`,"models.modelOverrides":`Model overrides`,"models.supportsDeveloperRole":`Developer role`,"models.supportsLongCacheRetention":`Long cache retention`,"models.supportsUsageInStreaming":`Usage in streaming`,"models.supportsFinishReason":`Finish reason in stream`,"models.supportsEagerToolInputStreaming":`Eager tool input streaming`,"models.supportsCacheControlOnTools":`Cache control on tools`,"models.supportsTemperature":`Temperature param`,"models.requiresToolResultName":`Tool result name required`,"models.requiresAssistantAfterToolResult":`Assistant after tool result`,"models.requiresThinkingAsText":`Thinking as text`,"models.requiresReasoningContentOnAssistantMessages":`Reasoning content on assistant`,"models.zaiToolStream":`z.ai tool stream`,"models.supportsThinkingTokenBudget":`Thinking token budget`,"models.supportsOpenAIGrammarTools":`OpenAI grammar tools`,"models.sendSessionAffinityHeaders":`Session affinity headers`,"models.supportsToolSearch":`Tool search`,"models.supportsExplicitPromptCacheMode":`Explicit prompt cache`,"models.forceAdaptiveThinking":`Adaptive thinking`,"models.allowEmptySignature":`Empty thinking signature`,"models.supportsStrictTools":`Strict tool schemas`,"models.supportsStore":`Store param`,"models.supportsReasoningEffort":`Reasoning effort`,"models.supportsStrictMode":`Strict mode`,"models.supportsToolReferences":`Tool references`,"models.maxTokensField":`Max tokens field`,"models.sessionAffinityFormat":`Session affinity format`,"models.deferredToolsMode":`Deferred tools mode`,"models.cacheControlFormat":`Cache control format`,"models.thinkingFormat":`Thinking format`,"models.chatTemplateKwargs":`Chat template kwargs`,"models.chatTemplateArgs":`Chat template args`,"models.openRouterRouting":`OpenRouter routing`,"models.vercelGatewayRouting":`Vercel gateway routing`,"models.thinkingLevelMap":`Thinking level map`,"models.contextWindow":`Context window (tokens)`,"models.maxOutputTokens":`Max output tokens`,"models.costPerMillion":`Cost (per million tokens)`,"models.apiKeyPlaceholder":`ENV_VAR_NAME, !shell-command, or literal key`,"models.apiKeyHint":`Prefix with ! to run a shell command, or use an env var name`,"models.apiKeyStored":`API key is stored. Enter a new key below to replace it, or disconnect to remove it.`,"models.apiKeyPrompt":`Enter your {provider} API key to enable {count} model{s}.`,"models.apiKeyReplacePlaceholder":`Enter new key to replace…`,"models.oauthAlreadyConnected":`Already connected. You can re-login or disconnect.`,"models.oauthConnectPrompt":`Connect your {provider} account.`,"models.enterValue":`Enter value…`,"models.displayNamePlaceholder":`Display name`,"models.connectionLost":`Connection lost`,"models.networkError":`Network error`,"i18n.testingModel":`Testing model connection...`,"i18n.connected":`Connected`,"i18n.failed":`Failed`,"i18n.test":`Test`,"i18n.testConnection":`Test model connection`,"i18n.provider":`Provider`,"i18n.providers":`Providers`,"i18n.model":`Model`,"i18n.providerName":`Provider name`,"i18n.rename":`Rename`,"i18n.default":`Default`,"i18n.disabled":`Disabled`,"plugins.statusLoaded":`Loaded and active`,"plugins.statusInstalled":`Installed, not yet loaded`,"plugins.statusDisabled":`Disabled`,"plugins.statusMissing":`Configured but package not found`,"plugins.extensionFilters":`Extension filters`,"plugins.filterRules":`Filter rules`,"plugins.managePlugins":`Plugins`,"plugins.extensionFiltersHint":`Filters for auto-discovered extensions in ~/.pi/agent/extensions/ and .pi/extensions/. Only patterns starting with !, +, or - take effect; plain paths do nothing.`,"plugins.noExtensionFilters":`No filters configured`,"plugins.addFilter":`Add filter`,"plugins.filterPatternLabel":`Pattern`,"plugins.filterPlaceholder":`!pattern · +path · -path`,"plugins.filterInvalid":`Pattern must start with !, +, or -; plain paths have no effect in the extensions field.`,"plugins.filterPrefixExclude":`Exclude matching extensions`,"plugins.filterPrefixForceInclude":`Force-include exact path`,"plugins.filterPrefixForceExclude":`Force-exclude exact path`,"plugins.filterEffect":`Effect`,"plugins.removeFilter":`Remove filter`,"plugins.npmSourcePlaceholder":`npm:@scope/package`,"plugins.packageInstalled":`Package installed.`,"plugins.packageUpdated":`Package updated.`,"plugins.packageRemoved":`Package removed.`,"plugins.packageDisabled":`Package disabled.`,"plugins.packageEnabled":`Package enabled.`,"plugins.extensionFilterAdded":`Extension filter added.`,"plugins.extensionFilterRemoved":`Extension filter removed.`,"plugins.sessionReloaded":`Session reloaded.`,"i18n.noResources":`No resources`,"i18n.unknown":`Unknown`,"i18n.installedVersion":`installed {version}`,"i18n.configuredVersion":`configured {version}`,"i18n.extensions":`Extensions`,"i18n.prompts":`Prompts`,"i18n.themes":`Themes`,"i18n.resourceCount":`{count} {label}`,"i18n.extensionShort":`ext`,"i18n.versionShort":`ver`,"i18n.skillShort":`skills`,"i18n.promptShort":`prompts`,"i18n.themeShort":`themes`,"i18n.custom":`Custom`,"i18n.clearAll":`clear all`,"i18n.connectedSuccessfully":`Connected successfully.`,"i18n.notConnected":`not connected`,"i18n.configured":`configured`,"i18n.notConfigured":`not configured`,"i18n.openingBrowser":`Opening browser…`,"i18n.submit":`Submit`,"i18n.login":`Login`,"i18n.relogin":`Re-login`,"i18n.disconnect":`Disconnect`,"i18n.networkError":`Network error`,"i18n.continuing":`Continuing…`,"i18n.skills":`Skills`,"i18n.plugins":`Plugins`,"i18n.addSkill":`Add skill`,"i18n.addPlugin":`Add plugin`,"i18n.recommendedPlugins":`Recommended`,"i18n.selectSkill":`Select a skill`,"i18n.selectPackage":`Select a package`,"i18n.configBindings":`Bound config files`,"i18n.addBinding":`Add`,"i18n.configFileNote":`Note (optional)`,"i18n.bindConfigFile":`Bind config file`,"i18n.selectFile":`Select a file`,"i18n.noConfigBindings":`No config files bound`,"i18n.noFiles":`No files`,"i18n.allFiles":`All files`,"i18n.filterByType":`Filter by type`,"i18n.removeBinding":`Remove binding`,"i18n.confirm":`Confirm`,"i18n.updateAvailable":`Update available`,"i18n.upToDate":`Up to date`,"i18n.automaticChecksUnavailable":`Automatic checks unavailable`,"i18n.checkFailed":`Check failed`,"i18n.installed":`Installed`,"i18n.status":`Status`,"i18n.version":`Version`,"i18n.package":`Package`,"i18n.resources":`Resources`,"i18n.installedPath":`Installed path`,"i18n.readme":`README`,"i18n.readmeDetails":`Details`,"i18n.unsafeLinkBlocked":`Blocked unsafe link (only same-directory or sub-directory relative links are allowed): {href}`,"i18n.resolvedResources":`Resolved Resources`,"i18n.reloadSession":`Reload session`,"i18n.reloading":`Reloading...`,"i18n.packageRemoved":`Package removed.`,"i18n.packageInstalled":`Package installed.`,"i18n.packageUpdated":`Package updated.`,"i18n.packageDisabled":`Package disabled.`,"i18n.packageEnabled":`Package enabled.`,"i18n.sessionReloaded":`Session reloaded.`,"i18n.thinking":`Thinking`,"i18n.loadingThinking":`Loading thinking...`,"i18n.copyMessage":`Copy message`,"i18n.editFromHere":`Edit from here`,"i18n.editFromHereTitle":`Edit from here — branches within this session`,"i18n.newSession":`New session`,"i18n.newSessionTitle":`New session — creates an independent copy from here`,"i18n.estimatedTokens":`Estimated token count while streaming`,"i18n.noOutput":`(no output)`,"i18n.noSummary":`(no summary)`,"i18n.conversationCompacted":`Conversation compacted`,"i18n.compactionDescription":`The conversation history before this point was compacted into the following summary:`,"i18n.fileContext":`File context: {details}`,"i18n.readFiles":`Read files`,"i18n.modifiedFiles":`Modified files`,"i18n.hiddenExtensionMessage":`hidden extension message`,"i18n.noMessage":`(no message)`,"i18n.showExtensionMessage":`Show extension message`,"i18n.collapse":`Collapse`,"i18n.expand":`Expand`,"i18n.hideDetails":`Hide details`,"i18n.showDetails":`Show details`,"i18n.thinkingUnavailable":`Thinking content unavailable`,"i18n.thinkingEncrypted":`Thinking content is encrypted (provider-encrypted for context continuity, plaintext not available)`,"i18n.before":`Before`,"i18n.after":`After`}},v={id:`zh-CN`,label:`简体中文`,messages:{"common.ok":`确定`,"common.language":`语言`,"common.models":`模型`,"common.skills":`技能`,"common.plugins":`插件`,"sidebar.hide":`收起侧边栏`,"sidebar.show":`展开侧边栏`,"theme.light":`切换到浅色模式`,"preferences.defaultThinkingLevel":`默认思考级别`,"preferences.thinkingLevelHint":"新会话的全局默认思考级别(settings.json `defaultThinkingLevel`)。未设置=删除该字段(回落 pi 默认)。","preferences.thinkingLevelNotSet":`未设置(跟随模型默认)`,"preferences.compaction":`自动压缩`,"preferences.compactionHint":"自动压缩长会话(settings.json `compaction`)。未配置时按 pi 默认值展示,改动即写入完整对象。","preferences.compactionEnabled":`启用`,"preferences.compactionReserveTokens":`输出预留词元数`,"preferences.compactionReserveTokensHint":`为模型输出预留的词元数,压缩时保留这部分空间供回复使用`,"preferences.compactionKeepRecentTokens":`压缩后保留词元数`,"preferences.compactionKeepRecentTokensHint":`压缩后保留的词元数,从最近聊天记录开始逆向往前计算`,"preferences.retry":`API 重试`,"preferences.retryHint":"供应商 API 调用的重试设置(settings.json `retry`)。未配置时按 pi 默认值展示,改动即写入完整对象;provider 子字段留空则不写入。","preferences.retryEnabled":`启用重试`,"preferences.retryEnabledHint":`是否对失败的 API 调用启用重试`,"preferences.retryMaxRetries":`最大重试次数`,"preferences.retryBaseDelayMs":`基础延迟(毫秒)`,"preferences.retryBaseDelayMsHint":`首次重试前的初始延迟,单位毫秒`,"preferences.retryProviderTimeoutMs":`供应商超时(毫秒)`,"preferences.retryProviderMaxRetries":`供应商最大重试次数`,"preferences.retryProviderMaxRetryDelayMs":`供应商最大延迟(毫秒)`,"preferences.defaultProjectTrust":`新项目默认信任`,"preferences.projectTrustHint":"新项目的默认信任策略(settings.json `defaultProjectTrust`)。未设置=删除该字段(回落「询问」)。","preferences.projectTrustNotSet":`未设置(询问)`,"preferences.projectTrustAsk":`询问`,"preferences.projectTrustAlways":`总是信任`,"preferences.projectTrustNever":`从不信任`,"preferences.notifyEvents":`通知`,"preferences.notifyEventsHint":`标签页非激活时发浏览器通知。权限在首次交互时请求。`,"notify.permission.request":`开启通知`,"notify.permission.requestHint":`点击开启浏览器通知:任务完成时即使不在本页也会提醒`,"notify.permission.granted":`通知已开启`,"notify.permission.grantedHint":`已开启浏览器通知:任务完成时即使不在本页也会提醒`,"notify.permission.bannerHintBefore":`点击左上工具栏的`,"notify.permission.bannerHintAfter":`按钮开启通知权限,任务完成、出错或提问时都能收到浏览器通知,详细设置可在 配置中心 → 会话 → 通知 栏目中调整`,"notify.permission.denied":`通知被阻止`,"notify.permission.deniedHint":`浏览器阻止了通知。请点击地址栏左侧图标 → 站点设置,将通知改为允许后重试`,"preferences.notifyWhileActive":`页面激活时也通知`,"preferences.notifyTaskComplete":`任务完成`,"preferences.notifyErrors":`运行出错`,"preferences.notifyQuestions":`提问`,"preferences.subagentsDefaultModel":`子代理默认模型`,"preferences.subagentsDefaultThinking":`子代理默认思考级别`,"preferences.subagentsHint":"子代理默认配置(settings.json `subagents`)。defaultThinking 未设置=删除该子字段(回落 pi 默认)。","preferences.subagentsModelPlaceholder":`供应商/模型-id`,"theme.dark":`切换到深色模式`,"theme.toggleTheme":`切换主题`,"theme.darkMode":`深色`,"theme.lightMode":`浅色`,"theme.fontSize":`字体大小`,"theme.scrollStep":`悬停滚动步长`,"scrollStep.hint":`悬停滚动方向箭头时,内容每次滚动的像素数(面板滚动箭头与消息地图共用此步长)。`,"scrollStep.range":`每次悬停滚动像素(1-1000)`,"scrollStep.unit":`px`,"theme.autoReloadSeconds":`自动重载聊天消息间隔`,"autoReload.off":`关闭(0)— 不自动刷新`,"autoReload.range":`秒(0 — 3600)`,"autoReload.unit":`秒`,"autoReload.hint":`自动重新读取会话文件的间隔秒数;0 = 关闭。单客户端场景(消息经 SSE 实时推送)保持 0 即可;多客户端协作(多个浏览器同时操作同一会话)时设为大于 0,各客户端定时刷新以读取其他客户端生成的新聊天消息。`,"longBlock.hint":`“块”指思维链(thinking)和工具调用(tool call)。正文超过阈值时折叠为头尾摘要,点击可展开查看全文。`,"recentBlocks.hint":`流式渲染过程中和刚刚完成的块不计入数量(最新完成的块始终展开)。本值表示除此之外,额外保持展开的最近已完成块数。`,"autoReload.reset":`恢复默认({n} 秒)`,"chat.reloadFromDisk":`从磁盘重新加载会话`,"chat.reloadFromDiskHint":`当多个客户端同时读写同一个会话 jsonl 时使用。可在 配置中心 → 会话 页面设置自动定时重载。`,"scrollStep.reset":`恢复默认({n} px)`,"theme.longBlockCollapse":`长块折叠阈值`,"theme.recentBlocksExpanded":`最近完成块保持展开数`,"layout.sidebarWidth":`左侧面板宽度`,"layout.widgetPanelWidth":`右侧面板宽度`,"layout.widthRange":`px({min}–{max})`,"layout.widthReset":`恢复默认({value} px)`,"longBlock.range":`字符数(20-10000)`,"longBlock.chars":`字符`,"longBlock.blocks":`个`,"longBlock.reset":`恢复默认({n} 字符)`,"recentBlocks.reset":`恢复默认({n} 个)`,"recentBlocks.range":`0-20,不含最新完成的块`,"longBlock.expandHint":`… 中间 {n} 字符已折叠 · 点击展开`,"longBlock.collapse":`点击收起`,"history.full":`完整历史`,"history.unsaved":`会话保存后才能查看完整历史`,"title.generating":`正在生成...`,"title.updated":`标题已更新`,"title.failed":`生成失败`,"title.generate":`生成标题`,"title.unsaved":`会话保存后才能生成标题`,"title.noMessages":`请先发送消息,再为会话命名`,"title.generateSession":`生成会话标题`,"system.prompt":`系统提示词`,"system.empty":`系统提示词为空(工具已禁用)`,"system.load":`发送消息以加载系统提示词`,"session.info":`会话信息`,"session.reload":`重载会话(重读配置与资源)`,"session.name":`名称`,"session.file":`文件`,"session.inMemory":`内存中`,"session.id":`ID`,"session.user":`用户`,"session.assistant":`助手`,"session.toolCalls":`工具调用`,"session.toolResults":`工具结果`,"session.total":`总计`,"session.input":`输入`,"session.output":`输出`,"session.cacheRead":`缓存读取`,"session.cacheWrite":`缓存写入`,"session.inputHint":`未命中缓存的输入 token 数:系统提示、会话历史、工具定义等发送给模型的上下文,减去命中缓存的部分`,"session.outputHint":`模型生成回复的 token 数(回答与思考)`,"session.cacheReadHint":`命中 prompt 缓存的 token 数:与上一请求未变的上下文直接从缓存读取,按折扣价计费`,"session.cacheWriteHint":`首次写入缓存的 token 数(Anthropic 风格按写入计费)`,"session.totalHint":`输入 + 输出 + 缓存读取 + 缓存写入`,"session.cacheReadRate":`缓存命中率:命中缓存的 token(缓存读取)占全部输入 prompt(输入 + 缓存读取 + 缓存写入)的比例,即官方口径 cacheRead ÷ (input + cacheRead + cacheWrite)`,"session.cost":`费用`,"session.context":`上下文`,"session.copy":`复制{value}`,"session.copied":`已复制`,"session.title":`会话信息`,"session.load":`发送消息或运行 /session 以加载会话信息`,"session.infoSection":`会话信息`,"session.messages":`消息`,"session.tokens":`Token`,"session.copyFile":`复制文件路径`,"session.copyId":`复制会话 ID`,"workspace.opening":`正在打开工作区...`,"workspace.unable":`无法打开工作区`,"workspace.selectSession":`从侧边栏选择一个会话`,"workspace.selectWorkspace":`请选择工作区`,"workspace.stepProject":`从侧边栏选择项目目录`,"workspace.stepModels":`点击底部的“模型”按钮添加模型`,"tabs.chat":`聊天`,"tabs.widgets":`小组件`,"config.title":`配置`,"config.section.session":`会话`,"config.section.appearance":`外观`,"config.section.advanced":`高级`,"config.section.startScreen":`开始屏幕`,"config.section.git":`Git`,"config.section.updates":`更新`,"config.section.modelThinking":`思考级别`,"config.section.requiresCwd":`请先从侧边栏选择项目目录,再浏览插件 / 技能`,"updates.check":`检查更新`,"updates.checking":`检查中…`,"updates.checkedAt":`上次检查`,"updates.upToDate":`已是最新`,"updates.updateAvailable":`有新版本`,"updates.unavailable":`检查失败`,"updates.noPluginUpdates":`全部插件已是最新`,"updates.banner":`有可用更新:{items}`,"updates.view":`查看`,"updates.copied":`已复制`,"updates.copyCommand":`复制命令`,"updates.restartNote":`更新后将同时升级内置 pi SDK,重启服务生效。`,"updates.enableChecking":`启用更新检测`,"updates.disabled":`更新检测已关闭`,"updates.ignoreVersion":`忽略此版本`,"updates.ignored":`已忽略 {version}`,"updates.ignoredPlugin":`已忽略`,"updates.unignore":`取消忽略`,"preferences.pi.unset":`pi 默认`,"preferences.pi.enableAnalytics":`启用分析`,"preferences.pi.enableAnalyticsHint":"发送匿名使用分析(settings.json `enableAnalytics`)","preferences.pi.enableInstallTelemetry":`启用安装遥测`,"preferences.pi.enableInstallTelemetryHint":"发送匿名安装遥测(settings.json `enableInstallTelemetry`)","preferences.pi.httpProxy":`HTTP 代理`,"preferences.pi.httpProxyHint":"HTTP 请求的代理地址(settings.json `httpProxy`)。留空无法清除已设置的值。","preferences.pi.trackingId":`分析跟踪 ID`,"preferences.pi.trackingIdHint":"自定义分析跟踪 ID(settings.json `trackingId`)。留空无法清除已设置的值。","preferences.pi.httpIdleTimeoutMs":`HTTP 空闲超时(毫秒)`,"preferences.pi.httpIdleTimeoutMsHint":"HTTP 空闲超时毫秒数(settings.json `httpIdleTimeoutMs`)。留空无法清除已设置的值。","preferences.pi.websocketConnectTimeoutMs":`WebSocket 连接超时(毫秒)`,"preferences.pi.websocketConnectTimeoutMsHint":"WebSocket 连接超时毫秒数(settings.json `websocketConnectTimeoutMs`)。留空无法清除已设置的值。","preferences.pi.branchSummary":`分支摘要`,"preferences.pi.branchSummaryHint":"分支摘要自动压缩(settings.json `branchSummary`)","preferences.pi.reserveTokens":`预留 token`,"preferences.pi.skipPrompt":`跳过提示`,"preferences.pi.images":`图片处理`,"preferences.pi.imagesHint":"pi 引擎如何处理图片(settings.json `images`)","preferences.pi.autoResize":`自动缩放`,"preferences.pi.autoResizeHint":"压缩 `read` 等工具返回的图片以节省 token。","preferences.pi.blockImages":`阻止图片`,"preferences.pi.blockImagesHint":`在消息发送给模型前移除所有图片内容。`,"config.files.hint":`直接编辑 pi 的配置文件(JSON)。保存前校验,写前自动备份(保留最近 10 份)。`,"config.widgets.empty":`暂无小组件配置。插件弹出小组件时会自动在此创建条目。`,"config.widgets.x":`x`,"config.widgets.y":`y`,"config.widgets.width":`宽`,"config.widgets.height":`高`,"config.widgets.bind":`绑定消息`,"config.widgets.bindTitle":`绑定自定义消息`,"config.widgets.bindHint":`为小组件「{key}」绑定一条快捷消息`,"config.widgets.editTitle":`编辑快捷消息`,"config.widgets.editHint":`修改标题、内容与发送方式。`,"config.widgets.label":`描述`,"config.widgets.labelPlaceholder":`按钮显示的文字(如:重载)`,"config.widgets.message":`消息内容`,"config.widgets.messagePlaceholder":`斜杠命令或任意文本(如 /reload)`,"config.widgets.messageTooltip":`以 / 开头时仅提示内置、全局插件与 Skill 命令;项目级插件命令不会出现在列表中,但可手动输入后保存`,"config.widgets.sendImmediately":`立即发送`,"config.widgets.sendMode":`发送方式`,"config.widgets.fillToChatInput":`填充到聊天框`,"config.widgets.sendImmediatelyTooltip":`立即发送:`,"config.widgets.fillToChatInputTooltip":`填充到聊天框:`,"config.widgets.nameConflict":`名称「{label}」已存在,请换一个名称`,"config.startScreen.nameConflict":`名称「{label}」已存在,请换一个名称`,"config.widgets.confirm":`确认`,"config.widgets.unbindTitle":`解绑消息`,"config.widgets.unbindConfirm":`确定解绑「{label}」?`,"config.widgets.unbind":`解绑`,"config.startScreen.hint":`新会话开始屏幕(Pi Logo 下方)展示的快捷入口;点击后按各条绑定的发送方式立即发送或填充到聊天输入框。`,"config.startScreen.bind":`绑定消息`,"config.startScreen.bindTitle":`绑定快捷消息`,"config.startScreen.bindHint":`为开始屏幕绑定一条快捷消息。`,"config.startScreen.editTitle":`编辑快捷消息`,"config.startScreen.editHint":`修改标题、内容与发送方式。`,"config.startScreen.empty":`暂无快捷消息,开始屏幕不会显示快捷入口。`,"config.startScreen.unbindTitle":`解绑消息`,"config.startScreen.unbindConfirm":`确定解绑「{label}」?`,"config.startScreen.unbind":`解绑`,"config.startScreen.reset":`重置`,"config.startScreen.resetHint":`恢复内置默认快捷消息;保留你自绑定的消息(与默认同名的会被默认项覆盖)。`,"config.files.save":`保存`,"config.files.saving":`保存中...`,"config.files.saved":`已保存`,"config.files.missing":`尚未创建`,"config.files.placeholder":`从左侧选择要编辑的配置文件`,"layout.resizeSidebar":`调整侧边栏宽度`,"layout.resizeWidgetPanel":`调整小组件面板宽度`,"layout.resizeHint":`拖动调整宽度。双击或按 Enter 恢复默认值。`,"sidebar.newWorkspace":`新增工作区`,"sidebar.searchSessions":`搜索会话`,"sidebar.searchSessionsPlaceholder":`搜索会话…`,"sidebar.justNow":`刚刚`,"sidebar.minutesAgo":`{count} 分钟前`,"sidebar.hoursAgo":`{count} 小时前`,"sidebar.daysAgo":`{count} 天前`,"sidebar.searchSessionsNoResults":`无匹配会话`,"sidebar.newSessionTitle":`在 {path} 中新建会话`,"sidebar.refresh":`刷新`,"directoryPicker.selectDirectory":`选择目录`,"directoryPicker.goToParent":`转到上级目录`,"directoryPicker.directoryPath":`目录路径`,"directoryPicker.goToDirectory":`转到目录`,"directoryPicker.go":`转到`,"directoryPicker.loadingDirectories":`正在加载目录…`,"directoryPicker.noSubdirectories":`没有子目录`,"directoryPicker.openBeforeSelecting":`选择前请先打开此路径`,"directoryPicker.selectCurrentDirectory":`选择当前目录`,"directoryPicker.selectThisFolder":`选择此文件夹`,"directoryPicker.noDrives":`未找到盘符`,"directoryPicker.search":`筛选文件夹`,"directoryPicker.noMatches":`没有匹配的文件夹`,"sidebar.checking":`检查中…`,"sidebar.open":`打开`,"sidebar.cancel":`取消`,"sidebar.openRepoRoot":`worktree 切换不可用`,"sidebar.openRepoRootTitle":`worktree 切换功能当前不可用:请先在侧栏将当前工作目录切换到 Git 仓库根目录。`,"sidebar.gitRepoRootOnly":`仅 Git 仓库根目录`,"sidebar.gitRepoRootOnlyTitle":`只能在 Git 仓库根目录使用 worktree。`,"sidebar.worktrees":`Worktrees...`,"sidebar.checkingWorktrees":`正在检查此目录的 worktree。`,"sidebar.filterWorktrees":`筛选 worktree…`,"sidebar.noMatchingWorktrees":`没有匹配的 worktree`,"sidebar.switchWorktree":`切换 worktree`,"sidebar.switchWorktreeTitle":`切换 worktree:{path}`,"sidebar.main":`主分支`,"sidebar.forceRemoveCheckout":`存在未提交的更改。强制移除 checkout?`,"sidebar.force":`强制移除`,"sidebar.createWorktreeTitle":`为分支创建 worktree checkout`,"sidebar.newWorktree":`新建 worktree…`,"sidebar.branchName":`分支名称`,"sidebar.creating":`创建中…`,"sidebar.create":`创建`,"sidebar.uploadFilesTitle":`将文件上传到项目根目录`,"sidebar.uploadFiles":`上传文件`,"sidebar.refreshExplorer":`刷新文件浏览器`,"sidebar.changedFiles":`{count} 个变更文件`,"sidebar.loading":`加载中...`,"sidebar.sessionDeleted":`会话已删除,请选择其他会话`,"sidebar.noSessions":`未找到会话`,"sidebar.workspace":`工作区`,"sidebar.newActivity":`有新活动`,"sidebar.newSessionActivity":`会话有新活动`,"sidebar.interactionBadge":`会话等待交互响应`,"sidebar.deleteSession":`删除 {title}?`,"sidebar.deleteWorkspace":`删除工作区({count} 个会话)?`,"sidebar.deleteWorkspaceTitle":`删除此工作区及其所有会话`,"sidebar.copyPath":`复制完整路径`,"sidebar.rename":`重命名`,"sidebar.delete":`删除`,"sidebar.deleteWithShiftClick":`删除(按住 Shift 点击可跳过确认)`,"sidebar.expandForks":`展开分叉`,"sidebar.collapseForks":`折叠分叉`,"sidebar.disconnect":`断开`,"sidebar.messagesCount":`{count} 条消息`,"sidebar.worktreePath":`Worktree:{path}`,"sidebar.removeWorktreeTitle":`移除 worktree checkout {path};保留分支`,"files.modified":`已修改`,"files.added":`已添加`,"files.deleted":`已删除`,"files.renamed":`已重命名`,"files.untracked":`未跟踪`,"files.conflict":`冲突`,"files.newlyUploaded":`刚上传`,"files.containsChangedFiles":`包含已更改文件`,"files.insertPath":`将路径插入聊天`,"files.mention":`提及`,"files.download":`下载文件`,"files.dismissError":`关闭错误`,"files.addUploadedFile":`将上传的文件添加到聊天`,"files.addAllUploadedFiles":`将所有上传的文件添加到聊天`,"files.openInSystemApp":`用系统应用打开`,"files.chooseOtherApp":`选择其他应用…`,"files.openLaunched":`已调用系统应用打开(如无窗口弹出,请检查文件关联)`,"files.fileTooLargeForPreview":`文件太大,无法预览(>{limit})`,"files.docTooLargeForPreview":`DOCX 太大,无法预览(>{limit})`,"files.dismissUploadResults":`关闭上传结果`,"files.loading":`正在加载文件...`,"files.noFiles":`未找到文件`,"loading.inProgress":`处理中…`,"loading.more":`还有 {count} 项…`,"errors.title":`错误`,"errors.titleCount":`错误({count})`,"errors.close":`关闭`,"errors.clearAll":`全部清除`,"files.notFound":`(暂无文件)`,"files.accessDenied":`访问被拒绝`,"files.empty":`(空)`,"files.uploadFailed":`{count} 个失败`,"files.explorer":`文件浏览器`,"files.changedCount":`{count} 个文件`,"files.stagedPrefix":`已暂存:`,"files.unstagedPrefix":`未暂存:`,"files.noStagedChanges":`暂无已暂存文件`,"files.noUnstagedChanges":`暂无变更文件`,"files.commitMessagePlaceholder":`提交信息`,"files.commit":`提交`,"files.push":`推送到远端(含 tag)`,"files.pushing":`推送中...`,"files.pushSuccess":`推送成功`,"files.pushFailed":`推送失败`,"files.pushUpToDate":`已与远端同步,无需推送`,"files.pull":`从远端拉取`,"files.pulling":`拉取中...`,"files.pullSuccess":`拉取成功`,"files.pullFailed":`拉取失败`,"files.pullUpToDate":`已与远端同步,无需拉取`,"files.pullNonFastForward":`拉取被拒绝——本地与远端已分叉。请在终端使用 git pull --rebase 或 --merge 处理。`,"files.committing":`提交中…`,"files.commitMessageRequired":`请先填写 commit message`,"files.commitTitle":`提交更改`,"files.confirmStageAllCommit":`是否暂存全部 {count} 个改动文件并提交?`,"files.stageAllAndCommit":`暂存并提交`,"files.stageFile":`暂存文件`,"files.unstageFile":`取消暂存`,"files.changeStats":`{count} 个变更文件,新增 {additions} 行,删除 {deletions} 行`,"git.autoFetchInterval":`自动 fetch 间隔(秒)`,"git.autoFetchIntervalHint":`服务端定时为活动会话的工作区执行 git fetch(所有客户端共享结果)。0 表示关闭定时——仅在连接会话时触发一次。`,"git.groupTitle":`智能提交信息生成`,"git.commitModel.followCurrent":`跟随当前会话模型`,"git.commitModel.followCurrentHint":`开启后,生成提交信息时动态使用当前聊天的主模型;关闭则使用下方固定的模型(推荐使用免费小模型)。`,"git.commitModel.followCurrentOn":`已开启:跟随当前会话`,"git.commitModel.followCurrentOff":`已关闭:使用固定模型`,"git.commitModel.fixedModel":`固定模型`,"git.commitModel.fixedModelHint":`关闭“跟随当前会话”时使用的模型(建议选择固定的免费小模型,注意其上下文可能仅 5 万)。`,"git.commitModel.selectPlaceholder":`选择模型`,"git.commitModel.noModels":`暂无可用模型`,"git.commitModel.notConfiguredHint":`尚未选择固定模型,请先选择一个模型后再使用智能生成。`,"git.ai.generate":`智能生成`,"git.ai.generating":`生成中…`,"git.ai.notConfiguredTitle":`未配置模型`,"git.ai.notConfiguredDesc":`尚未为智能生成指定模型,请前往配置中心 → Git 指定模型后再试。`,"git.ai.goToConfig":`前往配置`,"git.ai.noSession":`跟随模式需要先选择一个会话`,"git.ai.noSessionModel":`当前会话无可用模型,请先在聊天中选择模型`,"git.commitModel.maxTokens":`最大输出长度`,"git.commitModel.maxTokensHint":`单次智能生成允许的最大输出 token 数(64–4096,默认 512)。已尽量降低推理开销:支持关闭的模型会关闭推理,不支持的会降至最低档位。`,"git.commitModel.autoGenerateOnEmpty":`空输入框时提交自动先智能生成`,"git.commitModel.autoGenerateOnEmptyHint":`开启后,点击提交时若输入框为空,会先自动调用智能生成填入信息再提交;仅在已指定模型时生效,未指定模型时空输入框仍禁用提交。默认开启。`,"git.ai.invalidModel":`已配置的模型格式无效,请前往配置中心重新选择`,"git.ai.autoGenerateOn":`已开启:空输入框自动生成`,"git.ai.usingCurrentModel":`使用聊天主模型`,"git.ai.usingModel":`使用 {model}`,"git.ai.generateAndCommit":`智能生成信息并提交`,"git.ai.autoGenerateOff":`已关闭`,"git.commitSectionTitle":`提交`,"git.commitConfirmStageAll":`提交时需确认“暂存全部”`,"git.commitConfirmStageAllHint":`开启后,未暂存时点击提交会先弹出“暂存全部并提交”确认框;关闭则直接暂存全部并提交。默认开启。`,"git.commitConfirmStageAllOn":`已开启:提交前确认`,"git.commitConfirmStageAllOff":`已关闭:直接暂存全部`,"modelThinking.desc":`为每个模型或 Provider 记忆上次选择的思考级别。切换模型时自动选中记忆的档位;若该模型的可用档位不含记忆值则回退到 auto(跟随默认)。支持全部 7 档:off / minimal / low / medium / high / xhigh / max。`,"modelThinking.byModel":`按模型`,"modelThinking.byProvider":`按 Provider`,"modelThinking.byProviderHint":`Provider 级别为回退:同 Provider 下未单独记忆的模型会使用此值。`,"modelThinking.emptyModel":`暂无按模型的记忆。切换模型后用下方思考级别下拉选择,自动记忆;也可在此添加。`,"modelThinking.emptyProvider":`暂无按 Provider 的记忆。`,"modelThinking.selectModelPlaceholder":`选择模型`,"modelThinking.selectProviderPlaceholder":`选择 Provider`,"modelThinking.providerInputPlaceholder":`或输入 Provider 名称`,"modelThinking.footerHint":`配置保存到独立文件 pi-web/model-thinking.json,不影响主配置;仅作用于 UI 下拉,不拦截 pi 的 thinking 调用。`,"common.add":`添加`,"common.delete":`删除`,"files.conflictSummary":`已有 {count} 个文件:{files}`,"files.cannotReplace":`无法替换:{files}`,"files.replace":`替换`,"files.skipExisting":`跳过已有文件`,"files.cancel":`取消`,"files.checking":`正在检查文件`,"files.uploading":`正在上传,{progress}%`,"files.search":`搜索文件`,"files.searchPlaceholder":`搜索文件...`,"chat.loadingSession":`正在加载会话...`,"chat.noSessionSelected":`请在左侧面板新增/选择任意会话`,"chat.loadingWindow":`正在加载消息...`,"chat.runningTool":`正在运行工具...`,"chat.runningNamedTool":`正在运行 {name}...`,"chat.runningTools":`正在运行 {names}...`,"chat.runningToolsMore":`正在运行 {names}(另有 {count} 个)...`,"chat.waitingModel":`正在等待模型...`,"chat.turnDuration":`耗时 {duration}`,"chat.aiQuestion":`AI 提问`,"chat.runningCommand":`正在运行命令...`,"chat.totalElapsed":`总计 {total}`,"chat.thinking":`正在思考...`,"chat.message":`条消息`,"chat.messages":`条消息`,"chat.toolCall":`次工具调用`,"chat.toolCalls":`次工具调用`,"chat.collapseProcess":`收起处理详情`,"chat.expandProcess":`展开处理详情`,"chat.loadEarlier":`向上滚动以加载更早的消息(隐藏 {count} 条)`,"chat.searchMessages":`搜索消息`,"chat.clearSearch":`清空搜索关键字`,"chat.scrollToLatest":`滚动到最新消息`,"chat.expandMessage":`展开完整内容`,"chat.searchPlaceholder":`搜索聊天消息…`,"chat.searchNoResults":`没有结果`,"chat.searchResults":`{count} 个结果`,"chat.extensionRequest":`扩展请求`,"chat.cancel":`取消`,"chat.confirm":`确认`,"chat.submit":`提交`,"chat.extensionInput":`扩展终端输入`,"chat.extensionSelect":`请选择`,"chat.extensionConfirm":`确认`,"chat.extensionEditor":`编辑`,"chat.extensionPanel":`扩展面板`,"chat.close":`关闭`,"chat.notifyErrorTitle":`错误`,"chat.notifyWarningTitle":`警告`,"chat.queued":`已排队 · {count}`,"chat.recall":`移回输入框`,"chat.recallTitle":`移除所有排队消息并放回输入框编辑(输入框为空时按回车也可触发)`,"chat.retrying":`正在重试({attempt}/{max})…`,"chat.loadingCommands":`正在加载命令...`,"chat.slashCommands":`斜杠命令 · {label}`,"chat.tabEnter":`Tab / Enter`,"chat.noCommands":`未找到扩展、提示词或技能命令`,"chat.match":`1 个匹配项`,"chat.matches":`{count} 个匹配项`,"chat.command":`1 个命令`,"chat.commands":`{count} 个命令`,"chat.loadingFiles":`正在加载文件...`,"chat.files":`文件 · {label}{hint}`,"chat.searching":`搜索中…`,"chat.noMatchingFiles":`未找到匹配的文件`,"chat.searchingAll":` · 正在搜索所有文件…`,"chat.indexTruncated":` · 索引不完整`,"chat.steerPlaceholder":`立即引导 / 排队后续消息...`,"chat.recallPlaceholder":`回车撤回排队消息到输入框编辑,或输入新消息…`,"chat.agentPlaceholder":`Agent 运行中…`,"chat.messagePlaceholder":`消息…输入 / 使用命令,@ 引用文件,! 执行命令`,"chat.questionNotificationTitle":`Pi — 提问`,"chat.taskCompleteNotificationTitle":`Pi — 任务完成`,"chat.taskErrorNotificationTitle":`Pi — 出错`,"chat.sessionCompletedNotificationBody":`会话 {name} 已完成`,"chat.questionNotificationDenied":`通知被拒绝:在浏览器站点设置中允许后,切走页面时才会收到提问提醒。`,"chat.steer":`引导`,"chat.followUp":`后续消息`,"chat.queueImageBlocked":`运行中无法排队发送带图片的附件`,"chat.steerTooltip":`在当前调用结束后立即发送这条消息`,"chat.followUpTooltip":`在智能体结束后排队发送这条消息`,"chat.send":`发送`,"chat.attachImage":`附加图片`,"chat.filterModels":`筛选模型…`,"chat.noMatchingModels":`没有匹配的模型`,"chat.moreControls":`更多控件`,"chat.collapseControls":`收起控件`,"chat.shell":`Shell`,"chat.outputLocal":`输出保留在本地`,"chat.outputModel":`输出发送给模型`,"chat.noTools":`不使用工具,仅只读`,"chat.builtInTools":`{count} 个内置工具`,"chat.allBuiltInTools":`全部内置工具`,"chat.changeReasoning":`更改推理级别:{level}`,"chat.changeReasoningLabel":`更改推理级别`,"chat.changeToolPreset":`更改工具预设`,"chat.stopCompaction":`停止压缩`,"chat.compactContext":`压缩上下文`,"chat.compacting":`正在压缩…`,"chat.compact":`压缩`,"chat.stopAgent":`停止 Agent`,"chat.stop":`停止`,"chat.disableSound":`关闭完成提示音`,"chat.enableSound":`开启完成提示音`,"chat.thinkingUseDefault":`使用 pi 默认设置`,"chat.thinkingOff":`关闭推理`,"chat.thinkingMinimal":`最低限度推理`,"chat.thinkingLow":`低强度推理`,"chat.thinkingMedium":`中等强度推理`,"chat.thinkingHigh":`高强度推理`,"chat.thinkingXhigh":`超高强度推理`,"chat.thinkingMax":`最高强度推理`,"chat.thinkingMapTitle":`高级思考级别未配置`,"chat.thinkingMapBody":`pi 默认只支持 high 级别。若要开启 {level} 级别推理,请在 配置 → 模型 页面为该模型配置「推理级别映射」。`,"chat.thinkingMapGo":`立即前往`,"chat.builtIn":`内置`,"chat.extensions":`扩展`,"chat.prompts":`提示词`,"chat.skills":`技能`,"chat.dormant":`休眠`,"chat.commandCompact":`压缩上下文,可选附加说明`,"chat.commandReload":`重新加载扩展、技能、提示词和工具`,"chat.commandName":`设置会话显示名称`,"chat.commandSession":`显示会话消息、Token 和费用统计`,"chat.commandCopy":`复制最后一条助手消息`,"chat.compacted":`已压缩`,"chat.tokensSaved":`节省 {saved}`,"i18n.close":`关闭`,"i18n.resizeList":`调整 {name} 列表大小`,"widgets.title":`小组件`,"widgets.reopen":`重新弹出`,"widgets.expandedToChat":`小组件[{key}]已展开到聊天页面`,"widgets.collapse":`收起`,"widgets.open":`展开小组件`,"i18n.copy":`复制`,"i18n.copied":`已复制`,"i18n.cancel":`取消`,"i18n.save":`保存`,"i18n.saving":`保存中…`,"i18n.saved":`已保存`,"i18n.saveChanges":`保存更改`,"i18n.noThinking":`无思考内容`,"i18n.remove":`移除`,"i18n.removing":`移除中…`,"i18n.delete":`删除`,"i18n.loading":`加载中...`,"i18n.searchPlaceholder":`搜索…`,"i18n.noMatch":`无匹配`,"i18n.search":`搜索`,"i18n.refresh":`刷新`,"i18n.update":`更新`,"i18n.updating":`更新中...`,"i18n.check":`检查`,"i18n.checking":`检查中...`,"i18n.install":`安装`,"i18n.installing":`安装中...`,"i18n.noResults":`没有结果`,"i18n.searchProviders":`搜索 Provider…`,"i18n.noProviders":`没有匹配的 Provider`,"i18n.newModel":`新模型`,"i18n.addProvider":`添加 Provider`,"i18n.selectProviderModel":`选择 Provider 或模型`,"i18n.visibleInPrompt":`在模型提示词中可见,点击以禁用`,"i18n.hiddenFromPrompt":`在模型提示词中隐藏,点击以启用`,"i18n.dormant":`休眠`,"i18n.hiddenButInvocable":`对模型隐藏,仍可手动调用`,"i18n.skillSearchPlaceholder":`例如 react、testing、deploy`,"i18n.searching":`搜索中…`,"i18n.noSkills":`未找到技能`,"i18n.checkUpdates":`检查更新`,"i18n.updates":`项更新`,"i18n.noResolvedResources":`没有已解析资源`,"i18n.enablePackage":`启用包`,"i18n.disablePackage":`禁用包`,"i18n.filtered":`已筛选`,"i18n.openSessionToReload":`打开会话后才能重新加载`,"i18n.notFound":`未找到`,"i18n.noPlugins":`未配置插件`,"trust.resourcesNotLoaded":`受限模式`,"trust.trustProject":`信任项目`,"trust.trusting":`正在信任...`,"trust.cancel":`取消`,"trust.dialogTitle":`信任此项目?`,"trust.dialogBody":`项目资源可以运行本地代码。请仅信任你了解其内容的项目。`,"trust.skillsNotLoaded":`此项目尚未受信任,项目技能未加载。`,"trust.pluginsNotLoaded":`此项目尚未受信任,项目插件未加载。`,"trust.projectScopeUnavailable":`项目资源未加载时,无法安装到项目范围。`,"i18n.creatingSession":`正在创建新会话…`,"i18n.creating":`创建中…`,"i18n.subscription":`订阅`,"i18n.subscriptions":`订阅服务`,"i18n.customEndpoint":`自定义端点格式`,"i18n.noChanges":`没有更改`,"i18n.branches":`分支`,"i18n.noActiveSession":`没有活动会话`,"i18n.noActiveSessionToCompact":`没有活动会话可压缩`,"i18n.noActiveSessionToReload":`没有活动会话可重新加载`,"i18n.noActiveSessionToName":`没有活动会话可命名`,"i18n.noAssistantMessageToCopy":`没有可复制的助手消息`,"i18n.commandCompleted":`命令已完成`,"i18n.commandFailed":`命令失败`,"i18n.extensionCommandFailed":`扩展命令失败`,"i18n.compactedContext":`上下文已压缩`,"i18n.reloadedSessionResources":`会话资源已重新加载`,"i18n.usageName":`用法:/name <名称>`,"i18n.sessionRenamedTo":`会话已重命名为 {name}`,"i18n.copiedLastAssistantMessage":`已复制最后一条助手消息`,"i18n.failedToRecallQueuedMessages":`恢复排队消息失败`,"i18n.noBranches":`此会话没有分支`,"i18n.source":`源代码`,"i18n.preview":`预览`,"i18n.diff":`Diff`,"i18n.downloadFile":`下载文件`,"i18n.liveSync":`实时同步已启用`,"i18n.notWatching":`未监视`,"i18n.fileViewMode":`文件视图模式`,"i18n.editMode":`编辑模式`,"i18n.viewMode":`查看模式`,"i18n.compareHead":`比较工作区与 HEAD`,"i18n.mentionSelectedLines":`提及所选行`,"i18n.disableWrap":`禁用自动换行`,"i18n.enableWrap":`启用自动换行`,"i18n.editFile":`编辑文件`,"i18n.saveFile":`保存`,"i18n.saveFileShortcut":`保存(Ctrl/Cmd+S)`,"i18n.cancelEdit":`取消`,"i18n.saveFailed":`保存失败:{error}`,"i18n.unsavedChanges":`有未保存的修改`,"i18n.htmlPreview":`HTML 预览`,"i18n.previewFile":`预览 {file}`,"i18n.invalidMermaid":`Mermaid 图表无效`,"i18n.renderingMermaid":`正在渲染 Mermaid 图表`,"i18n.previewAfterStreaming":`流式输出完成后可预览`,"i18n.showMermaidSource":`显示 Mermaid 源码`,"i18n.previewMermaid":`预览 Mermaid 图表`,"i18n.openMermaidViewer":`打开图表查看器`,"i18n.mermaidViewer":`Mermaid 图表查看器`,"i18n.mermaidDiagram":`Mermaid 图表`,"i18n.zoomOut":`缩小`,"i18n.zoomIn":`放大`,"i18n.fitToWidth":`适应宽度`,"models.discoveryFetching":`正在导入模型…`,"models.deleteProviderConfirm":`确定删除 provider「{name}」?该操作会立即写入 models.json,其全部配置(含 API key)将被移除且无法恢复。`,"models.removeModelConfirm":`确定移除模型「{model}」?该操作会立即写入 models.json 且无法恢复。`,"models.discoveryTitle":`导入模型`,"models.discoveryFetch":`导入模型…`,"models.discoveryFilterPlaceholder":`筛选 {count} 个模型…`,"models.discoveryFilter":`筛选上游模型`,"models.discoverySelectShown":`选择当前结果`,"models.discoveryNoMatches":`没有匹配的模型。`,"models.discoveryAdded":`已添加`,"models.discoveryShowing":`显示前 {shown} 个,共 {total} 个`,"models.discoveryFetched":`已获取 {count} 个模型`,"models.discoveryAddSelected":`添加所选模型`,"models.setDefault":`设为默认`,"models.defaultModel":`默认模型`,"models.defaultModelUnavailable":`默认模型 {model} 不可用(已删除或已隐藏),请选择模型。`,"models.syncEndpoint":`从端点同步`,"models.lastSyncedAt":`上次同步:{time}`,"models.neverSynced":`未同步过`,"models.discoveryFetchTooltip":`优先从本地缓存导入:{path};无缓存时自动执行一次从端点同步并写入该缓存。`,"models.syncingModels":`同步中…`,"models.syncedModels":`已同步 {count} 个模型`,"models.syncEndpointTooltip":`从 {endpoint} 拉取最新模型列表并缓存到本地;有缓存时优先于内置列表使用。`,"models.syncEndpointTooltipGeneric":`从该供应商的 models 端点拉取最新模型列表并缓存到本地;有缓存时优先于内置列表使用。`,"models.refreshFromCache":`从同步缓存刷新`,"models.refreshing":`刷新中…`,"models.refreshFromCacheTooltip":`重新读取 pi-web/provider/{provider}/models.json,只更新与当前生效定义不同的字段(headers 等手动字段保留)。`,"models.refreshNoDiff":`同步缓存与当前生效定义一致,无需更新。`,"models.refreshDone":`已从同步缓存更新覆写字段。`,"models.refreshTimeout":`刷新超时,请稍后重试。`,"models.builtinProviders":`内置 Provider`,"models.customProviders":`自定义 Provider`,"models.syncSaveFailed":`同步前保存草稿失败,已中止同步。`,"models.visibleInChat":`聊天可见`,"models.visibleModels":`可见模型`,"models.visibleModelsCount":`可见 {visible} / 共 {total}`,"models.selectAll":`全选`,"models.invertSelection":`反选`,"models.searchModels":`搜索模型…`,"models.noVisibleModels":`无模型。`,"models.filterAll":`全部`,"models.filterVisible":`可见`,"models.filterHidden":`隐藏`,"models.invertDisabledTooltip":`所有模型均已可见,反选不会改变任何状态`,"models.openOverride":`编辑覆写`,"models.overrideHint":`当前显示为合并后的有效值(内置定义 + 已保存的覆写)。只有你修改过的字段会作为覆写保存,其余字段继续继承内置定义。`,"models.overrideOrphanedHint":`该模型已从上游删除,覆写仍保留在本地。可在此删除覆写,保存后会一并清理可见性配置。`,"models.removeOverride":`移除覆写`,"models.providerNameCollision":`Provider "{provider}" 与内置 "{builtin}"(大小写不敏感)冲突,模型可见性无法生效,请重命名或删除该 provider。`,"models.providerNameCollisionShort":`与内置 provider 撞名`,"models.builtinVisibilityBlocked":`模型可见性已禁用:自定义 provider "{custom}" 与 "{builtin}"(大小写不敏感)冲突,请重命名或删除该自定义 provider。`,"models.discoveryAddSelectedCount":`添加所选模型({count})`,"models.dataSourceLabel":`数据来源:`,"models.catalogSourceEndpoint":`模型端点`,"models.catalogSourceDev":`models.dev 目录`,"models.catalogSourceEndpointTooltip":`数据来源:Provider 的 /models 端点`,"models.catalogSourceDevTooltip":`数据来源:models.dev 内置目录(https://models.dev)`,"models.catalogEndpointNotFound":`模型端点返回中未找到该模型 ID`,"models.catalogOverwriteTitle":`覆盖已有字段?`,"models.catalogOverwriteBody":`以下 {{count}} 个字段已有值,覆盖填入将修改它们:{{fields}}。取消则仅填充空字段。`,"models.catalogOverwriteConfirm":`覆盖并填入`,"models.catalogOverwriteCancel":`仅填空字段`,"models.catalogFilling":`正在填入模型信息…`,"models.catalogFill":`填入模型信息`,"models.catalogFilled":`已填入 {count} 个字段`,"models.catalogNoEmptyFields":`没有需要填入的空字段`,"models.catalogNoExactMatch":`models.dev 中没有精确匹配`,"models.catalogPriceProvider":`价格已匹配 Provider {provider}`,"models.catalogPriceBaseUrl":`价格已按 Base URL 匹配 {provider}`,"models.catalogPriceConsensus":`价格得到 {support}/{total} 条记录支持`,"models.catalogPriceUnreliable":`未找到可靠价格`,"models.catalogUndo":`撤销`,"models.baseUrl":`Base URL`,"models.apiKey":`API 密钥`,"models.api":`API 格式`,"models.modelId":`ID *`,"models.name":`名称`,"models.apiOverride":`API 覆盖`,"models.reasoningThinking":`推理 / 思考`,"models.imageInput":`图片输入`,"models.imageInputHint":`勾选时写入 input: ["text", "image"];取消勾选则移除 input(回落默认 ["text"])。`,"models.nameHint":`留空删除 name 字段(回落使用模型 id)。`,"models.apiOverrideHint":`留空或选默认删除 api 字段(回落使用 provider 默认 api)。`,"models.reasoningHint":`取消勾选删除 reasoning 字段(回落关闭)。`,"models.compatBoolTrueHint":`未勾选不等于 false:pi 将缺失字段视为 true。取消勾选会写入显式 false,才能真正关闭。`,"models.compatBoolHint":`勾选写入 true;取消勾选删除该字段(回落 auto-detect / false 默认)。`,"models.compatSelectHint":`选「默认/none」删除该字段(回落 auto-detect)。`,"models.thinkingLevelMapHint":`每个级别三种状态:Default=删除该级别映射(回落模型默认级别);Disabled=写入 null 禁用;Custom=写入自定义级别字符串。`,"models.compatSection":`兼容性`,"models.compatInheritHint":`模型自身未设置的项显示从 provider 继承的生效值(标注「· 来自 provider」);在模型级设置后将覆盖继承值。`,"models.inheritedFromProvider":`· 来自 provider`,"models.thinkingFormatDeepseekHint":`选中 deepseek 时会额外写入 requiresReasoningContentOnAssistantMessages: true;选中其他值则移除。`,"models.samplingParams":`采样参数`,"models.headers":`请求头`,"models.modelOverrides":`模型覆盖`,"models.supportsDeveloperRole":`支持 developer role`,"models.supportsLongCacheRetention":`支持长缓存保留`,"models.supportsUsageInStreaming":`流式返回 token 用量`,"models.supportsFinishReason":`流式返回 finish_reason`,"models.supportsEagerToolInputStreaming":`工具输入流式预读`,"models.supportsCacheControlOnTools":`工具定义缓存控制`,"models.supportsTemperature":`支持 temperature 参数`,"models.requiresToolResultName":`工具结果需带 name`,"models.requiresAssistantAfterToolResult":`工具结果后需 assistant 消息`,"models.requiresThinkingAsText":`思考块转为文本`,"models.requiresReasoningContentOnAssistantMessages":`assistant 消息需 reasoning_content`,"models.zaiToolStream":`z.ai tool stream`,"models.supportsThinkingTokenBudget":`支持思考 token 预算`,"models.supportsOpenAIGrammarTools":`支持 OpenAI 语法工具`,"models.sendSessionAffinityHeaders":`发送会话亲和请求头`,"models.supportsToolSearch":`支持工具搜索`,"models.supportsExplicitPromptCacheMode":`显式提示缓存模式`,"models.forceAdaptiveThinking":`强制自适应思考`,"models.allowEmptySignature":`允许空思考签名`,"models.supportsStrictTools":`严格工具 schema`,"models.supportsStore":`支持 store 参数`,"models.supportsReasoningEffort":`支持 reasoning_effort`,"models.supportsStrictMode":`严格模式`,"models.supportsToolReferences":`支持工具引用`,"models.maxTokensField":`最大 token 字段`,"models.sessionAffinityFormat":`会话亲和格式`,"models.deferredToolsMode":`延迟工具模式`,"models.cacheControlFormat":`缓存控制格式`,"models.thinkingFormat":`思考格式`,"models.chatTemplateKwargs":`聊天模板 kwargs`,"models.chatTemplateArgs":`聊天模板 args`,"models.openRouterRouting":`OpenRouter 路由`,"models.vercelGatewayRouting":`Vercel 网关路由`,"models.thinkingLevelMap":`思考级别映射`,"models.contextWindow":`上下文窗口(tokens)`,"models.maxOutputTokens":`最大输出 tokens`,"models.costPerMillion":`成本(每百万 tokens)`,"models.apiKeyPlaceholder":`ENV_VAR_NAME、!shell-command 或字面密钥`,"models.apiKeyHint":`以 ! 开头执行 shell 命令,或使用环境变量名`,"models.apiKeyStored":`已保存 API 密钥。在下方输入新密钥即可替换,或断开连接以移除。`,"models.apiKeyPrompt":`输入 {provider} 的 API 密钥以启用 {count} 个模型。`,"models.apiKeyReplacePlaceholder":`输入新密钥以替换…`,"models.oauthAlreadyConnected":`已连接。可重新登录或断开连接。`,"models.oauthConnectPrompt":`连接你的 {provider} 账户。`,"models.enterValue":`输入值…`,"models.displayNamePlaceholder":`显示名称`,"models.connectionLost":`连接已断开`,"models.networkError":`网络错误`,"i18n.testingModel":`正在测试模型连接...`,"i18n.connected":`已连接`,"i18n.failed":`失败`,"i18n.test":`测试`,"i18n.testConnection":`测试模型连接`,"i18n.provider":`Provider`,"i18n.providers":`提供商`,"i18n.model":`模型`,"i18n.providerName":`Provider 名称`,"i18n.rename":`重命名`,"i18n.default":`默认`,"i18n.disabled":`已禁用`,"plugins.statusLoaded":`已加载并生效`,"plugins.statusInstalled":`已安装,尚未加载`,"plugins.statusDisabled":`已禁用`,"plugins.statusMissing":`已配置但包未找到`,"plugins.extensionFilters":`扩展过滤`,"plugins.filterRules":`过滤规则`,"plugins.managePlugins":`插件管理`,"plugins.extensionFiltersHint":`对 ~/.pi/agent/extensions/ 与 .pi/extensions/ 自动发现目录内扩展的过滤规则。仅以 !、+、- 开头的规则生效;纯路径填写无效。`,"plugins.noExtensionFilters":`未配置过滤规则`,"plugins.addFilter":`添加过滤`,"plugins.filterPatternLabel":`规则`,"plugins.filterPlaceholder":`!pattern · +path · -path`,"plugins.filterInvalid":`规则必须以 !、+ 或 - 开头;纯路径在 extensions 字段中无效。`,"plugins.filterPrefixExclude":`排除匹配的扩展`,"plugins.filterPrefixForceInclude":`强制包含精确路径`,"plugins.filterPrefixForceExclude":`强制排除精确路径`,"plugins.filterEffect":`效果`,"plugins.removeFilter":`移除过滤`,"plugins.npmSourcePlaceholder":`npm:@scope/package`,"plugins.packageInstalled":`包已安装。`,"plugins.packageUpdated":`包已更新。`,"plugins.packageRemoved":`包已移除。`,"plugins.packageDisabled":`包已禁用。`,"plugins.packageEnabled":`包已启用。`,"plugins.extensionFilterAdded":`扩展过滤已添加。`,"plugins.extensionFilterRemoved":`扩展过滤已移除。`,"plugins.sessionReloaded":`会话已重载。`,"i18n.noResources":`没有资源`,"i18n.unknown":`未知`,"i18n.installedVersion":`已安装 {version}`,"i18n.configuredVersion":`已配置 {version}`,"i18n.extensions":`扩展`,"i18n.prompts":`提示词`,"i18n.themes":`主题`,"i18n.resourceCount":`{count}{label}`,"i18n.extensionShort":`扩展`,"i18n.versionShort":`版本`,"i18n.skillShort":`技能`,"i18n.promptShort":`提示词`,"i18n.themeShort":`主题`,"i18n.custom":`自定义`,"i18n.clearAll":`清除全部`,"i18n.connectedSuccessfully":`连接成功。`,"i18n.notConnected":`未连接`,"i18n.configured":`已配置`,"i18n.notConfigured":`未配置`,"i18n.openingBrowser":`正在打开浏览器…`,"i18n.submit":`提交`,"i18n.login":`登录`,"i18n.relogin":`重新登录`,"i18n.disconnect":`断开连接`,"i18n.networkError":`网络错误`,"i18n.continuing":`继续中…`,"i18n.skills":`技能`,"i18n.plugins":`插件`,"i18n.addSkill":`添加技能`,"i18n.addPlugin":`添加插件`,"i18n.recommendedPlugins":`推荐插件`,"i18n.selectSkill":`选择技能`,"i18n.selectPackage":`选择包`,"i18n.configBindings":`绑定的配置文件`,"i18n.addBinding":`添加`,"i18n.configFileNote":`备注(可选)`,"i18n.bindConfigFile":`绑定配置文件`,"i18n.selectFile":`选择文件`,"i18n.noConfigBindings":`尚未绑定配置文件`,"i18n.noFiles":`没有文件`,"i18n.allFiles":`全部文件`,"i18n.filterByType":`按类型筛选`,"i18n.removeBinding":`删除绑定`,"i18n.confirm":`确认`,"i18n.updateAvailable":`有可用更新`,"i18n.upToDate":`已是最新`,"i18n.automaticChecksUnavailable":`自动检查不可用`,"i18n.checkFailed":`检查失败`,"i18n.installed":`已安装`,"i18n.status":`状态`,"i18n.version":`版本`,"i18n.package":`包`,"i18n.resources":`资源`,"i18n.installedPath":`安装路径`,"i18n.readme":`README`,"i18n.readmeDetails":`详情`,"i18n.unsafeLinkBlocked":`已阻止不安全链接(仅允许同目录或子目录的相对链接):{href}`,"i18n.resolvedResources":`已解析资源`,"i18n.reloadSession":`重新加载会话`,"i18n.reloading":`重新加载中...`,"i18n.packageRemoved":`包已移除。`,"i18n.packageInstalled":`包已安装。`,"i18n.packageUpdated":`包已更新。`,"i18n.packageDisabled":`包已禁用。`,"i18n.packageEnabled":`包已启用。`,"i18n.sessionReloaded":`会话已重新加载。`,"i18n.thinking":`思考`,"i18n.loadingThinking":`正在加载思考内容...`,"i18n.copyMessage":`复制消息`,"i18n.editFromHere":`从此处编辑`,"i18n.editFromHereTitle":`从此处编辑,此会话内创建分支`,"i18n.newSession":`新会话`,"i18n.newSessionTitle":`新会话,从此处创建独立副本`,"i18n.estimatedTokens":`流式输出期间的估算 Token 数`,"i18n.noOutput":`(无输出)`,"i18n.noSummary":`(无摘要)`,"i18n.conversationCompacted":`会话已压缩`,"i18n.compactionDescription":`此处之前的会话历史已压缩为以下摘要:`,"i18n.fileContext":`文件上下文:{details}`,"i18n.readFiles":`读取的文件`,"i18n.modifiedFiles":`修改的文件`,"i18n.hiddenExtensionMessage":`隐藏的扩展消息`,"i18n.noMessage":`(无消息)`,"i18n.showExtensionMessage":`显示扩展消息`,"i18n.collapse":`收起`,"i18n.expand":`展开`,"i18n.hideDetails":`隐藏详情`,"i18n.showDetails":`显示详情`,"i18n.thinkingUnavailable":`思考内容不可用`,"i18n.thinkingEncrypted":`思考内容已加密(提供方加密,仅用于上下文连续,无法显示明文)`,"i18n.before":`之前`,"i18n.after":`之后`}},y=new Map;function b(e){if(!e.id.trim())throw Error(`Locale id must not be empty`);if(y.has(e.id))throw Error(`Locale already registered: ${e.id}`);y.set(e.id,e)}function x(e){return y.get(e)}function S(){return[...y.keys()]}function C(e){for(let t of e){let e=t.toLowerCase();if(e===`en`||e.startsWith(`en-`))return`en`;if(e===`zh`||e.startsWith(`zh-`))return`zh-CN`}return`en`}b(_),b(v);var w=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),T=n(((e,t)=>{t.exports=w()})),E=T(),D=`pi-locale`,O=`en`,k=(0,d.createContext)(null);function A(){return Object.fromEntries(S().flatMap(e=>{let t=x(e);return t?[[e,t.messages]]:[]}))}function j(){try{let e=window.localStorage.getItem(D);if(e===`en`||e===`zh-CN`)return e}catch{}return null}function M({children:e,initialLocale:t=null}){let[n,r]=(0,d.useState)(()=>typeof window>`u`?t??O:j()??t??C(window.navigator.languages.length?window.navigator.languages:[window.navigator.language])),i=(0,d.useMemo)(()=>S().map(e=>x(e)).filter(e=>!!e),[]),a=(0,d.useMemo)(()=>A(),[]),o=(0,d.useCallback)(e=>{if(x(e)){r(e),document.documentElement.lang=e;try{window.localStorage.setItem(D,e)}catch{}fetch(`/api/preferences`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({firstPaint:{locale:e}})}).catch(e=>console.error(`[pi-web] save locale:`,e))}},[]),s=(0,d.useCallback)((e,t)=>h(n,e,a,t),[n,a]),c=(0,d.useMemo)(()=>({locale:n,setLocale:o,t:s,supportedLocales:i}),[n,o,s,i]);return(0,E.jsx)(k.Provider,{value:c,children:e})}function N(){let e=(0,d.useContext)(k);if(!e)throw Error(`useI18n must be used inside I18nProvider`);return e}function P(e){return{value:(0,d.useSyncExternalStore)(t=>e.subscribe(t),()=>e.get(),()=>e.get()),error:e.getError()}}var ee=`(max-width: 640px)`;function F(e){if(typeof window>`u`||!window.matchMedia)return()=>{};let t=window.matchMedia(ee);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function I(){return typeof window>`u`||!window.matchMedia?!1:window.matchMedia(ee).matches}function te(){return!1}function ne(){return(0,d.useSyncExternalStore)(F,I,te)}var re=null;function ie(e){re=e}function ae(e){let{onNewSession:t,activeCwd:n}=e;(0,d.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){if(!re)return;let t=e.target?.tagName;if(t===`TEXTAREA`||t===`INPUT`)return;e.preventDefault(),re();return}if(e.key===`n`&&e.ctrlKey&&e.altKey){if(!n||!t)return;e.preventDefault(),t(n)}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n,t])}function L(){let[e,t]=(0,d.useState)(()=>typeof Notification>`u`?`unsupported`:Notification.permission);return(0,d.useEffect)(()=>{if(typeof Notification>`u`)return;let e=!1,n,r=()=>{e||t(Notification.permission)};return typeof navigator.permissions?.query==`function`&&navigator.permissions.query({name:`notifications`}).then(t=>{e||(n=t,r(),t.addEventListener(`change`,r))}).catch(()=>{}),()=>{e=!0,n?.removeEventListener(`change`,r)}},[]),e}var R=1200,oe=320,z=420;function se(e,t,n){return Math.round(Math.max(t,Math.min(Math.max(t,n),Number.isFinite(e)?e:t)))}function ce(e){let{viewportWidth:t,rightPanelOpen:n,rightPanelWidth:r}=e;if(t<=640)return 480;let i=t<960,a=i?oe:z,o=!i&&n?r:0;return Math.min(480,t-a-o)}function le(e){let{viewportWidth:t,sidebarOpen:n,sidebarWidth:r}=e;if(t<960)return R;let i=n?r:0;return Math.min(R,t-z-i)}function ue(e){try{let t=window.localStorage.getItem(e);if(t===null)return null;let n=Number.parseInt(t,10);return Number.isFinite(n)?n:null}catch{return null}}function de(e,t){try{window.localStorage.setItem(e,String(t))}catch{}}function fe(e){let{ariaLabel:t,cssVariable:n,defaultWidth:r,getDefaultWidth:i,getMaxWidth:a,growthDirection:o,maxWidth:s,minWidth:c,storageKey:l,widthRef:u}=e,f=(0,d.useRef)(null),p=(0,d.useRef)(null),m=(0,d.useRef)(!1),[h,g]=(0,d.useState)(r),[_,v]=(0,d.useState)(!1),y=(0,d.useCallback)(()=>Math.min(s,Math.max(c,a())),[a,s,c]),b=(0,d.useCallback)(e=>se(e,c,y()),[y,c]),x=(0,d.useCallback)(e=>{u.current=e,f.current?.style.setProperty(n,`${e}px`)},[n,u]),S=(0,d.useCallback)((e,t={})=>{let{forcePersist:n=!1,persist:r=!0}=t,i=b(e),a=i!==u.current;return x(i),g(i),r&&(a||n)&&de(l,i),i},[x,b,l,u]),C=(0,d.useCallback)(e=>{document.body.style.cursor=e.previousCursor,document.body.style.userSelect=e.previousUserSelect},[]),w=(0,d.useCallback)(e=>{let t=p.current;if(!(!t||t.pointerId!==e)){p.current=null,C(t),v(!1),S(u.current,{forcePersist:!0});try{t.target.hasPointerCapture(e)&&t.target.releasePointerCapture(e)}catch{}}},[S,C,u]),T=(0,d.useCallback)(e=>{if(e.pointerType===`mouse`&&e.button!==0)return;e.preventDefault(),e.stopPropagation();let t=p.current;t&&w(t.pointerId);let n=e.currentTarget;n.focus({preventScroll:!0}),n.setPointerCapture(e.pointerId),p.current={pointerId:e.pointerId,startX:e.clientX,startWidth:u.current,target:n,previousCursor:document.body.style.cursor,previousUserSelect:document.body.style.userSelect},document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,v(!0)},[w,u]),E=(0,d.useCallback)(e=>{let t=p.current;if(!t||t.pointerId!==e.pointerId)return;if(e.pointerType===`mouse`&&e.buttons===0){w(e.pointerId);return}e.preventDefault();let n=o===`right`?1:-1,r=b(t.startWidth+(e.clientX-t.startX)*n);x(r),e.currentTarget.setAttribute(`aria-valuenow`,String(r)),e.currentTarget.setAttribute(`aria-valuetext`,`${r} px`)},[x,b,w,o]),D=(0,d.useCallback)(e=>{w(e.pointerId)},[w]),O=(0,d.useCallback)(e=>{w(e.pointerId)},[w]),k=(0,d.useCallback)(e=>{w(e.pointerId)},[w]),A=(0,d.useCallback)(()=>{let e=i?.()??r;S(e,{forcePersist:!0})},[S,r,i]),j=(0,d.useCallback)(()=>{S(u.current)},[S,u]),M=(0,d.useCallback)(e=>{let t=e.shiftKey?32:12,n=o===`right`?`ArrowRight`:`ArrowLeft`,r=o===`right`?`ArrowLeft`:`ArrowRight`;e.key===n?(e.preventDefault(),S(u.current+t,{forcePersist:!0})):e.key===r?(e.preventDefault(),S(u.current-t,{forcePersist:!0})):e.key===`Home`?(e.preventDefault(),S(c,{forcePersist:!0})):e.key===`End`?(e.preventDefault(),S(y(),{forcePersist:!0})):e.key===`Enter`&&(e.preventDefault(),A())},[S,y,o,c,A,u]);return(0,d.useEffect)(()=>{if(m.current)return;m.current=!0;let e=ue(l),t=e??i?.()??r,n=S(t,{persist:!1});e!==null&&e!==n&&de(l,n)},[S,r,i,l]),(0,d.useEffect)(()=>{if(!m.current)return;S(u.current);let e=()=>{S(u.current)};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[S,u]),(0,d.useEffect)(()=>{if(!_)return;let e=()=>{let e=p.current;e&&w(e.pointerId)},t=()=>{document.visibilityState!==`visible`&&e()};return window.addEventListener(`blur`,e),document.addEventListener(`visibilitychange`,t),()=>{window.removeEventListener(`blur`,e),document.removeEventListener(`visibilitychange`,t)}},[w,_]),(0,d.useEffect)(()=>()=>{let e=p.current;e&&(p.current=null,C(e))},[C]),{isResizing:_,panelRef:f,reclampWidth:j,resetWidth:A,setWidth:e=>S(e,{forcePersist:!0}),separatorProps:{"aria-label":t,"aria-orientation":`vertical`,"aria-valuemax":y(),"aria-valuemin":c,"aria-valuenow":h,"aria-valuetext":`${h} px`,onDoubleClick:A,onKeyDown:M,onLostPointerCapture:k,onPointerCancel:O,onPointerDown:T,onPointerMove:E,onPointerUp:D,role:`separator`,tabIndex:0},width:h}}function pe(){let e=(0,d.useRef)(null),t=(0,d.useCallback)(()=>{e.current!==null&&(clearTimeout(e.current),e.current=null)},[]),n=(0,d.useCallback)((n,r)=>{t(),e.current=setTimeout(()=>{e.current=null,n()},r)},[t]);return(0,d.useEffect)(()=>()=>t(),[t]),(0,d.useMemo)(()=>({schedule:n,cancel:t}),[n,t])}function me(e){let{fetcher:t,ttlMs:n=6e4}=e,r=null,i=null,a=0,o=null,s=new Set,c=()=>{for(let e of[...s])try{e()}catch{}},l=async e=>{try{let o=await t(e);return r=o,i=null,a=Date.now()+n,o}catch(e){throw i=e instanceof Error?e.message:String(e),e}finally{o=null}},u=e=>(o||=l(e).then(e=>(c(),e)),o),d=(e,t)=>new Promise((n,r)=>{if(e.aborted){r(new DOMException(`Aborted`,`AbortError`));return}let i=()=>r(new DOMException(`Aborted`,`AbortError`));e.addEventListener(`abort`,i,{once:!0}),t.then(n,r).finally(()=>e.removeEventListener(`abort`,i))});return{get:()=>r,getError:()=>i,load:e=>{if(r!==null&&Date.now()<a)return Promise.resolve(r);let t=u(!1);return e?d(e,t):t},refresh:e=>{a=0;let t=u(!0);return e?d(e,t):t},subscribe:e=>(s.add(e),()=>s.delete(e)),clear:()=>{r=null,i=null,a=0}}}async function he(e,t){let n=await fetch(e,t);if(!n.ok)throw Error(`HTTP ${n.status}`);return await n.json()}function ge(){return`/api/sessions`}var _e=me({fetcher:()=>he(`/api/models`)}),ve=me({fetcher:()=>he(ge(),{cache:`no-store`})}),ye=me({fetcher:()=>he(`/api/preferences`)}),be=me({fetcher:()=>he(`/api/models-config`)}),xe=me({fetcher:()=>he(`/api/plugins/global`)}),Se=null;function Ce(e){Se=e}var we=me({fetcher:e=>{let t=Se?`?cwd=${encodeURIComponent(Se)}`:``;return he(`/api/updates${t}${t?`&`:`?`}refresh=${e?`1`:`0`}`)}}),Te=me({fetcher:e=>he(`/api/skills/global`,e?{cache:`no-store`}:void 0)}),Ee=me({fetcher:e=>he(`/api/commands/global`,e?{cache:`no-store`}:void 0)}),De=me({fetcher:()=>he(`/api/model-thinking`)}),Oe=me({fetcher:async()=>{let[e,t]=await Promise.all([he(`/api/auth/providers`),he(`/api/auth/all-providers`)]);return{oauth:e.providers,apiKey:t.providers}}}),ke=`pi-web`;function Ae(e,t){let n=je(e),r=je(t),i=Math.max(n.length,r.length);for(let e=0;e<i;e++){let t=n[e]??0,i=r[e]??0;if(t>i)return 1;if(t<i)return-1}return 0}function je(e){return e.replace(/^v/i,``).split(/[-+]/)[0].split(`.`).map(e=>{let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t})}function Me({current:e,latest:t},n){return t!==null&&t!==n&&Ae(t,e)>0}function Ne(e){return e.enabled!==!1}function Pe(e,t){return t[e]===`*`}function Fe(e){if(!Ne(e))return 0;let t=e.ignored??{};return+!!Me(e.piWeb,t[`pi-web`])+e.plugins.filter(e=>!Pe(e.source,t)).length}function Ie(e,t){if(!Ne(e))return[];let n=e.ignored??{},r=[];Me(e.piWeb,n[`pi-web`])&&r.push(`pi-web`);let i=e.plugins.filter(e=>!Pe(e.source,n)).length;return i>0&&r.push(`${i} ${t}`),r}var Le=(0,d.createContext)(null);function Re({value:e,children:t}){return(0,E.jsx)(Le.Provider,{value:e,children:t})}function ze(){let e=(0,d.useContext)(Le);if(!e)throw Error(`useSettings must be used within SettingsProvider`);return e}var Be=class extends Error{constructor(e,t,n){super(e),this.name=`ApiError`,this.status=t,this.body=n}},Ve=20,He=[],Ue=1,We=new Set;function Ge(){for(let e of We)e()}function Ke(e,t){if(e instanceof Be)console.error(`[pi-web] ${t??`api error`}`,e),He=[...He,{id:Ue++,kind:`api`,status:e.status,message:e.message,body:e.body,context:t,at:Date.now()}];else{let n=e instanceof Error?e.message:String(e);console.error(`[pi-web] ${t??`error`}`,e),He=[...He,{id:Ue++,kind:`generic`,message:n,context:t,at:Date.now()}]}He.length>Ve&&(He=He.slice(He.length-Ve)),Ge()}function qe(e){return We.add(e),()=>{We.delete(e)}}function Je(){return He}function Ye(){He=He.slice(0,-1),Ge()}function Xe(){He=[],Ge()}var Ze=e=>window.history.replaceState(null,``,e);function Qe({initialNavigation:e,onProjectSwitch:t,onSessionSelected:n,onTopPanelReset:r}){let[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(null),[c,l]=(0,d.useState)(()=>e.requestedCwd?`validating`:`idle`),[u,f]=(0,d.useState)(null),[p,m]=(0,d.useState)(0),[h,g]=(0,d.useState)(0),[_,v]=(0,d.useState)(0),[y,b]=(0,d.useState)(0),[x,S]=(0,d.useState)(()=>!e.sessionId),[C,w]=(0,d.useState)(null),T=(0,d.useRef)(null),E=(0,d.useRef)(!1),D=(0,d.useRef)(!1),[O,k]=(0,d.useState)(null),[A,j]=(0,d.useState)(!1),[M,N]=(0,d.useState)(!1),[P,ee]=(0,d.useState)(null);(0,d.useEffect)(()=>{let t=e.requestedCwd;if(!t)return;let n=new AbortController;return l(`validating`),f(null),fetch(`/api/cwd/validate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:t}),signal:n.signal}).then(async e=>{let t=await e.json().catch(()=>({}));if(!e.ok||!t.cwd)throw Error(t.error??`HTTP ${e.status}`);E.current=!0,s(t.cwd),l(`ready`)}).catch(e=>{n.signal.aborted||(f(e instanceof Error?e.message:String(e)),l(`error`))}),()=>n.abort()},[e]);let F=o??(i===null&&C?C:null),I=i!==null||F!==null,te=i?.cwd??F;(0,d.useEffect)(()=>{if(k(null),j(!1),ee(null),!te)return;let e=new AbortController,t=new URLSearchParams(window.location.search).get(`piE2eTrustCwd`);return fetch(`/api/project-trust?cwd=${encodeURIComponent(te)}${t?`&piE2eTrustCwd=${encodeURIComponent(t)}`:``}`,{signal:e.signal}).then(async e=>{let t=await e.json();if(!e.ok||t.error)throw Error(t.error??`HTTP ${e.status}`);k(t)}).catch(e=>{e instanceof DOMException&&e.name===`AbortError`||console.error(`Failed to load project trust:`,e)}),()=>e.abort()},[te]);let ne=(0,d.useCallback)(e=>{ve.load().then(t=>{let n=t.sessions.find(t=>t.id===e);n&&a(t=>t&&t.id===e&&!t.projectRoot?n:t)}).catch(e=>console.error(`[pi-web] hydrate session:`,e))},[]),re=(0,d.useCallback)((e,t=!1)=>{!t&&D.current||(s(null),a(e),g(e=>e+1),S(!0),t&&(E.current=!0),t||Ze(`?session=${encodeURIComponent(e.id)}`),n?.(t))},[n]),ie=(0,d.useCallback)(async(e,t)=>{await fetch(`/api/cwd/validate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:t})}).catch(e=>Ke(e,`validate cwd`)),a(null),s(t),g(e=>e+1),r?.(),n?.(!1),Ze(`/`)},[n,r]),ae=(0,d.useCallback)(e=>{s(null),a(e),m(e=>e+1),ne(e.id),Ze(`?session=${encodeURIComponent(e.id)}`)},[ne]),L=(0,d.useCallback)(()=>{m(e=>e+1),v(e=>e+1)},[]),R=(0,d.useCallback)((e,t)=>{a(n=>n&&n.id===e?{...n,name:t}:n),m(e=>e+1)},[]),oe=(0,d.useCallback)(()=>{v(e=>e+1)},[]),z=(0,d.useCallback)(()=>{S(!0)},[]);return{selectedSession:i,setSelectedSession:a,newSessionCwd:o,effectiveNewSessionCwd:F,showChat:I,projectTrustCwd:te,refreshKey:p,setRefreshKey:m,explorerRefreshKey:_,setExplorerRefreshKey:v,modelsRefreshKey:y,setModelsRefreshKey:b,sessionKey:h,activeCwd:C,initialCwdStatus:c,initialCwdError:u,initialSessionRestored:x,projectTrust:O,projectTrustDialogOpen:A,setProjectTrustDialogOpen:j,projectTrustBusy:M,projectTrustError:P,setProjectTrustError:ee,extensionDialogActiveRef:D,handleSelectSession:re,handleNewSession:ie,handleSessionCreated:ae,handleAgentEnd:L,handleSessionRenamed:R,handleSessionForked:(0,d.useCallback)(e=>{m(e=>e+1),g(e=>e+1),s(null),a(t=>({...t??{path:``,cwd:``,created:``,modified:``,messageCount:0,firstMessage:``},id:e})),ne(e),Ze(`?session=${encodeURIComponent(e)}`)},[ne]),handleSessionDeleted:(0,d.useCallback)(e=>{if(m(e=>e+1),i?.id===e){let e=i.cwd;a(null),s(e??null),g(e=>e+1),r?.(),Ze(`/`)}},[i,r]),handleSessionUnseen:(0,d.useCallback)(e=>{i?.id===e&&(a(null),g(e=>e+1),r?.(),Ze(`/`))},[i,r]),handleCwdChange:(0,d.useCallback)((e,n)=>{if(w(e),!e)return;let r=n??e,o=T.current??(i?i.projectRoot??i.cwd:null);if(!o){T.current=r;return}if(T.current=r,E.current){E.current=!1;return}o!==r&&(i?i.projectRoot??i.cwd:null)!==r&&(a(null),s(t=>t&&t!==e?null:t),g(e=>e+1),t?.())},[i,t]),handleTrustProject:(0,d.useCallback)(async()=>{if(!(!te||M)){N(!0),ee(null);try{let e=await fetch(`/api/project-trust`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:te})}),t=await e.json();if(!e.ok||t.error)throw Error(t.error??`HTTP ${e.status}`);k(t),j(!1),b(e=>e+1),g(e=>e+1)}catch(e){ee(e instanceof Error?e.message:String(e))}finally{N(!1)}}},[M,te]),handleExplorerRefresh:oe,handleInitialRestoreDone:z}}var $e=(0,d.createContext)(null);function et({value:e,children:t}){return(0,E.jsx)($e.Provider,{value:e,children:t})}function tt(){let e=(0,d.useContext)($e);if(!e)throw Error(`useTopPanel must be used within TopPanelProvider`);return e}var nt=`pi-web-auto-reload-seconds`,rt=3600;function it(e){let t=e.trim();if(t===``)return null;let n=Number(t);return!Number.isInteger(n)||n<0||n>3600?null:n}function at(){if(typeof window>`u`)return 0;let e=window.localStorage.getItem(nt);if(e===null)return 0;let t=it(e);return t===null?0:t}var ot=1e3,st=`pi-web-scroll-step-px`;function ct(e){let t=e.trim();if(t===``)return null;let n=Number(t);return!Number.isFinite(n)||!Number.isInteger(n)||n<1||n>1e3?null:n}function lt(){if(typeof window>`u`)return 200;try{return ct(window.localStorage.getItem(`pi-web-scroll-step-px`)??``)??200}catch{return 200}}var ut=1e4,dt=`pi-web-long-block-collapse-chars`;function ft(e){let t=e.trim();if(t===``)return null;let n=Number(t);return!Number.isFinite(n)||!Number.isInteger(n)||n<20||n>1e4?null:n}function pt(){if(typeof window>`u`)return 200;try{return ft(window.localStorage.getItem(`pi-web-long-block-collapse-chars`)??``)??200}catch{return 200}}var mt=`pi-web-long-block-recent-expanded`;function ht(e){let t=e.trim();if(t===``)return null;let n=Number(t);return!Number.isFinite(n)||!Number.isInteger(n)||n<0||n>20?null:n}function gt(){if(typeof window>`u`)return 0;try{return ht(window.localStorage.getItem(`pi-web-long-block-recent-expanded`)??``)??0}catch{return 0}}function _t(e,t,n,r){return e===`toolCall`?`tool:${n}`:`thinking:${t}:${r}`}var vt=`pi-web-notify-events`,yt={taskComplete:!0,errors:!0,questions:!0,notifyWhileActive:!1};function bt(){if(typeof window>`u`)return yt;try{let e=window.localStorage.getItem(vt);if(!e)return yt;let t=JSON.parse(e);return{taskComplete:t.taskComplete??yt.taskComplete,errors:t.errors??yt.errors,questions:t.questions??yt.questions,notifyWhileActive:t.notifyWhileActive??yt.notifyWhileActive}}catch{return yt}}function xt(e){window.localStorage.setItem(vt,JSON.stringify(e))}function St(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(typeof n!=`string`||n===``||typeof r!=`object`||!r)continue;let{x:e,y:i,width:a,height:o,collapsed:s}=r;typeof e!=`number`||!Number.isFinite(e)||typeof i!=`number`||!Number.isFinite(i)||typeof a!=`number`||!Number.isFinite(a)||a<=0||typeof o!=`number`||!Number.isFinite(o)||o<=0||(t[n]={x:e,y:i,width:a,height:o,collapsed:typeof s==`boolean`?s:void 0})}return t}var Ct=[{label:{en:`Explore project`,"zh-CN":`阅读项目`},message:{en:`Explore the current project and summarize the overall directory structure and responsibilities of core modules.`,"zh-CN":`阅读当前项目,总结整体目录结构与核心模块的职责。`}},{label:{en:`Review workspace changes`,"zh-CN":`审查工作区改动`},message:{en:`Review all changes in the current workspace, point out potential issues and improvements.`,"zh-CN":`审查当前工作区的所有改动,指出潜在问题与改进点。`}},{label:{en:`Find and fix bugs`,"zh-CN":`寻找并修复bug`},message:{en:`Inspect the current codebase, find and fix existing bugs.`,"zh-CN":`检查当前代码,寻找并修复其中存在的 bug。`}}];function wt(e,t){return typeof e==`string`?e:t===`zh-CN`?e[`zh-CN`]??e.zh??e.en??``:e.en??e[`zh-CN`]??e.zh??``}function Tt(e){let t=e.trim();return{en:t,"zh-CN":t}}function Et(e,t,n){let r=t.trim();if(typeof e==`string`){let t=e.trim();return n===`zh-CN`?{en:t,"zh-CN":r}:{en:r,"zh-CN":t}}let i=typeof e.en==`string`?e.en:``,a=e[`zh-CN`]??e.zh??i;return n===`zh-CN`?{en:i,"zh-CN":r}:{en:r,"zh-CN":a}}function Dt(e,t){let n=wt(e,`en`),r=wt(e,`zh-CN`),i=wt(t,`en`),a=wt(t,`zh-CN`);return n===i||r===a}var Ot={阅读项目:{en:`Explore project`,"zh-CN":`阅读项目`},review工作区改动:{en:`Review workspace changes`,"zh-CN":`review工作区改动`},寻找并修复bug:{en:`Find and fix bugs`,"zh-CN":`寻找并修复bug`},"阅读当前项目,总结整体目录结构与核心模块的职责。":{en:`Explore the current project and summarize the overall directory structure and responsibilities of core modules.`,"zh-CN":`阅读当前项目,总结整体目录结构与核心模块的职责。`},"review 当前工作区的所有改动,指出潜在问题与改进点。":{en:`Review all changes in the current workspace, point out potential issues and improvements.`,"zh-CN":`review 当前工作区的所有改动,指出潜在问题与改进点。`},"检查当前代码,寻找并修复其中存在的 bug。":{en:`Inspect the current codebase, find and fix existing bugs.`,"zh-CN":`检查当前代码,寻找并修复其中存在的 bug。`}};function kt(e){if(typeof e==`string`){let t=e.trim();return t===``?null:Ot[t]??Tt(t)}if(typeof e==`object`&&e){let t=e,n=t.en,r=t[`zh-CN`]??t.zh,i=typeof n==`string`?n.trim():``,a=typeof r==`string`?r.trim():``;return i===``&&a===``?null:{en:i===``?a:i,"zh-CN":a===``?i:a}}return null}function At(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){if(typeof n!=`object`||!n)continue;let{label:e,message:r,allowAppend:i}=n,a=kt(e),o=kt(r);if(!a||!o)continue;let s={label:a,message:o};i===!0&&(s.allowAppend=!0),t.push(s)}return t}function jt(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(typeof n!=`string`||n===``)continue;let e=At(r);e&&e.length>0&&(t[n]=e)}return t}var Mt=`pluginConfigBindings`;function Nt(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(Mt);if(!e)return{};let t=JSON.parse(e);if(t&&typeof t==`object`)return t}catch{}return{}}function Pt(){return`/api/preferences`}function Ft(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}var It=new Map,Lt=2e3;function Rt(e){let t=JSON.stringify(e),n=Date.now(),r=It.get(t);r!==void 0&&n-r<Lt||(It.set(t,n),fetch(Pt(),{method:`PUT`,headers:{"Content-Type":`application/json`},body:t}).catch(e=>console.error(`[pi-web] save preferences:`,e)).finally(()=>{ye.refresh().catch(e=>console.error(`[pi-web] refresh preferences:`,e))}))}var zt={defaultModel:``,defaultThinking:``},Bt=`pi-web-font-scale`,Vt=1,Ht=19.2;function Ut({isDark:e,toggleTheme:t}){let[n,r]=(0,d.useState)(()=>{if(typeof window>`u`)return Vt;let e=window.localStorage.getItem(Bt),t=e===null?NaN:Number(e);return Number.isFinite(t)&&t>=.85&&t<=1.3?t:Vt}),[i,a]=(0,d.useState)(()=>lt()),[o,s]=(0,d.useState)(()=>at()),[c,l]=(0,d.useState)(()=>pt()),[u,f]=(0,d.useState)(()=>gt()),[p,m]=(0,d.useState)(()=>bt());(0,d.useEffect)(()=>{xt(p),Rt({preferences:{notifyEvents:p}})},[p]);let[h,g]=(0,d.useState)(()=>St(ye.get()?.preferences?.widgets)??{}),_=(0,d.useRef)(!1),[v,y]=(0,d.useState)(()=>jt(ye.get()?.preferences?.widgetMessages)??{}),[b,x]=(0,d.useState)(()=>Ft(ye.get()?.preferences?.workspaces));(0,d.useEffect)(()=>{let e=!1;return ye.load().then(()=>{if(e)return;_.current=!0;let t=ye.get()?.preferences;g(St(t?.widgets)??{}),y(jt(t?.widgetMessages)??{}),x(Ft(t?.workspaces))}).catch(()=>{_.current=!0}),()=>{e=!0}},[]);let S=(0,d.useCallback)((e,t)=>{g(n=>{let r=n[e];return r&&r.x===t.x&&r.y===t.y&&r.width===t.width&&r.height===t.height&&r.collapsed===t.collapsed?n:{...n,[e]:t}})},[]);(0,d.useEffect)(()=>{_.current&&Rt({preferences:{widgets:h}})},[h]);let C=(0,d.useCallback)((e,t)=>{if((v[e]??[]).some(e=>Dt(e.label,t.label))){let e=typeof t.label==`string`?t.label:t.label?.en??t.label[`zh-CN`]??JSON.stringify(t.label);throw Error(`Name conflict: "${e}"`)}y(n=>({...n,[e]:[...n[e]??[],t]}))},[v,y]),w=(0,d.useCallback)((e,t)=>{y(n=>{let r=n[e];if(!r||t<0||t>=r.length)return n;let i={...n},a=r.filter((e,n)=>n!==t);return a.length===0?delete i[e]:i[e]=a,i})},[y]),T=(0,d.useCallback)((e,t,n)=>{if((v[e]??[]).some((e,r)=>r!==t&&Dt(e.label,n.label))){let e=typeof n.label==`string`?n.label:n.label?.en??n.label[`zh-CN`]??JSON.stringify(n.label);throw Error(`Name conflict: "${e}"`)}y(r=>{let i=r[e];if(!i||t<0||t>=i.length)return r;let a={...r},o=[...i];return o[t]=n,a[e]=o,a})},[v,y]);(0,d.useEffect)(()=>{_.current&&Rt({preferences:{widgetMessages:v}})},[v]);let E=(0,d.useCallback)(e=>{x(e),Rt({preferences:{workspaces:e}})},[x]),[D,O]=(0,d.useState)(()=>At(ye.get()?.preferences?.startScreenMessages)??Ct),k=(0,d.useCallback)(e=>{if(D.some(t=>Dt(t.label,e.label))){let t=typeof e.label==`string`?e.label:e.label?.en??e.label[`zh-CN`]??JSON.stringify(e.label);throw Error(`Name conflict: "${t}"`)}O(t=>[...t,e])},[D]),A=(0,d.useCallback)(e=>{O(t=>e<0||e>=t.length?t:t.filter((t,n)=>n!==e))},[]),j=(0,d.useCallback)((e,t)=>{if(D.some((n,r)=>r!==e&&Dt(n.label,t.label))){let e=typeof t.label==`string`?t.label:t.label?.en??t.label[`zh-CN`]??JSON.stringify(t.label);throw Error(`Name conflict: "${e}"`)}O(n=>{if(e<0||e>=n.length)return n;let r=[...n];return r[e]=t,r})},[D]),M=(0,d.useCallback)(()=>{O(e=>{let t=e.filter(e=>!Ct.some(t=>Dt(t.label,e.label)));return[...Ct,...t]})},[]);(0,d.useEffect)(()=>ye.subscribe(()=>O(At(ye.get()?.preferences?.startScreenMessages)??Ct)),[]),(0,d.useEffect)(()=>{Rt({preferences:{startScreenMessages:D}})},[D]);let[N,P]=(0,d.useState)(()=>Nt()),ee=(0,d.useCallback)((e,t)=>{P(n=>{let r=n[e]??[];return r.some(e=>e.path===t.path)?n:{...n,[e]:[...r,t]}})},[]),F=(0,d.useCallback)((e,t)=>{P(n=>{let r=n[e];if(!r)return n;let i=r.filter(e=>e.path!==t),a={...n};return i.length===0?delete a[e]:a[e]=i,a})},[]);(0,d.useEffect)(()=>{try{window.localStorage.setItem(Mt,JSON.stringify(N))}catch{}Rt({preferences:{pluginConfigBindings:N}})},[N]);let[I,te]=(0,d.useState)(()=>ye.get()?.defaultThinkingLevel??``);(0,d.useEffect)(()=>ye.subscribe(()=>te(ye.get()?.defaultThinkingLevel??``)),[]),(0,d.useEffect)(()=>{I&&Rt({firstPaint:{defaultThinkingLevel:I}})},[I]);let ne=(0,d.useSyncExternalStore)(ye.subscribe,()=>ye.get()?.compaction??null),re=(0,d.useMemo)(()=>JSON.stringify(ne),[ne]);(0,d.useEffect)(()=>{re&&Rt({firstPaint:{compaction:ye.get()?.compaction??null}})},[re]);let ie=(0,d.useSyncExternalStore)(ye.subscribe,()=>ye.get()?.retry??null),ae=(0,d.useMemo)(()=>JSON.stringify(ie),[ie]);(0,d.useEffect)(()=>{ae&&Rt({firstPaint:{retry:ye.get()?.retry??null}})},[ae]);let[L,R]=(0,d.useState)(()=>ye.get()?.defaultProjectTrust??``);(0,d.useEffect)(()=>ye.subscribe(()=>R(ye.get()?.defaultProjectTrust??``)),[]),(0,d.useEffect)(()=>{L&&Rt({firstPaint:{defaultProjectTrust:L}})},[L]);let oe=(0,d.useSyncExternalStore)(ye.subscribe,()=>ye.get()?.subagents??zt),z=(0,d.useMemo)(()=>({defaultModel:oe.defaultModel??``,defaultThinking:oe.defaultThinking??``}),[oe]);return(0,d.useEffect)(()=>{!z.defaultModel&&!z.defaultThinking||Rt({firstPaint:{subagents:{defaultModel:z.defaultModel||void 0,defaultThinking:z.defaultThinking||void 0}}})},[z]),(0,d.useEffect)(()=>{try{window.localStorage.setItem(nt,String(o))}catch{}Rt({preferences:{autoReloadSeconds:o}})},[o]),(0,d.useEffect)(()=>{try{window.localStorage.setItem(st,String(i))}catch{}Rt({preferences:{minimapScrollStepPx:i}})},[i]),(0,d.useEffect)(()=>{try{window.localStorage.setItem(dt,String(c))}catch{}Rt({preferences:{longBlockCollapseChars:c}})},[c]),(0,d.useEffect)(()=>{try{window.localStorage.setItem(mt,String(u))}catch{}Rt({preferences:{recentBlocksExpanded:u}})},[u]),(0,d.useEffect)(()=>{document.documentElement.style.fontSize=`${n*Ht}px`;try{window.localStorage.setItem(Bt,String(n))}catch{}Rt({firstPaint:{fontScale:n}})},[n]),(0,d.useEffect)(()=>{ye.load().catch(e=>console.error(`[pi-web] load preferences:`,e))},[]),{settingsValue:(0,d.useMemo)(()=>({isDark:e,toggleTheme:t,fontScale:n,setFontScale:r,scrollStepPx:i,setScrollStepPx:a,autoReloadSeconds:o,setAutoReloadSeconds:s,longBlockCollapseChars:c,setLongBlockCollapseChars:l,recentBlocksExpanded:u,setRecentBlocksExpanded:f,notifyEvents:p,setNotifyEvents:m,widgetGeometries:h,setWidgetGeometry:S,widgetMessages:v,addWidgetMessage:C,removeWidgetMessage:w,updateWidgetMessage:T,startScreenMessages:D,addStartScreenMessage:k,removeStartScreenMessage:A,updateStartScreenMessage:j,resetStartScreenMessages:M,pluginConfigBindings:N,addPluginConfigBinding:ee,removePluginConfigBinding:F}),[e,t,n,i,o,c,u,p,h,S,v,C,w,T,D,k,A,j,M,N,ee,F]),defaultThinkingLevel:I,setDefaultThinkingLevel:te,compaction:ne,retry:ie,defaultProjectTrust:L,setDefaultProjectTrust:R,subagents:z,savedWorkspaces:b,handleSavedWorkspacesChange:E,widgetGeometries:h,setWidgetGeometry:S,widgetMessages:v,addWidgetMessage:C,removeWidgetMessage:w,updateWidgetMessage:T,fontScale:n,setFontScale:r}}function Wt(e){if(!Number.isFinite(e))return``;let t=Math.round(e),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}var Gt=new Map,Kt=new Map,qt=3e4,Jt=75e3,Yt=1e3,Xt=15e3,Zt=1,Qt=3,$t=null,en=0,tn=0,nn=Yt;function rn(e){return e.ch===`agent`?`agent:${e.sessionId??``}`:e.ch===`watch`?`watch:${e.filePath??``}`:e.ch}function an(){return`${location.protocol===`https:`?`wss://`:`ws://`}${location.host}/api/ws`}function on(e,t){e.send(JSON.stringify({type:`sub`,...t}))}function sn(){$t&&$t.close();let e=++tn,t;try{t=new WebSocket(an())}catch{cn(e);return}$t=t,t.onopen=()=>{nn=Yt,en=Date.now();for(let e of Kt.values())try{on(t,e)}catch{break}},t.onmessage=n=>{if(e!==tn||$t!==t||(en=Date.now(),typeof n.data!=`string`))return;let r;try{r=JSON.parse(n.data)}catch{return}if(r.ch)for(let e of Gt.get(r.ch)??[])e(r.data)},t.onclose=()=>{e===tn&&$t===t&&($t=null,cn(e))},t.onerror=()=>{}}function cn(e){setTimeout(()=>{e!==tn||$t||sn()},nn),nn=Math.min(nn*2,Xt)}function ln(){if(!$t||$t.readyState!==Zt||Date.now()-en<=Jt)return;tn+=1;let e=$t;$t=null;try{e.close()}catch{}sn()}typeof window<`u`&&(setInterval(ln,qt),window.addEventListener(`online`,()=>{!$t||$t.readyState===Qt?sn():ln()}),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&(!$t||$t.readyState===Qt?sn():ln())}));function un(e){if(e&&$t?.readyState===Zt)try{$t.send(JSON.stringify({type:`unseen`,sessionId:e}))}catch{}}function dn(e,t){let n=rn(e),r=Gt.get(n);r||(r=new Set,Gt.set(n,r)),r.add(t);let i=!Kt.has(n);if(Kt.set(n,e),$t?.readyState===Zt&&i)try{on($t,e)}catch{}else $t||sn();return()=>{let e=Gt.get(n);if(e?.delete(t),e&&e.size===0&&(Gt.delete(n),Kt.delete(n),$t?.readyState===Zt))try{$t.send(JSON.stringify({type:`unsub`,ch:n}))}catch{}}}var fn={runningSessionIds:[],runningPhases:{},runningPhaseSince:{},runningBusySince:{}},pn=null,mn={current:!1},hn=new Set;function gn(){pn=null;for(let e of hn)e()}function _n(){return pn||={runningSessionIds:new Set(fn.runningSessionIds),runningPhases:fn.runningPhases,runningPhaseSince:fn.runningPhaseSince,runningBusySince:fn.runningBusySince,setRunningSessionIds:vn,runningPollAuthoritativeRef:mn},pn}function vn(e){mn.current||(fn={...fn,runningSessionIds:[...e]},gn())}function yn(e){return hn.add(e),xn(),()=>hn.delete(e)}var bn=null;function xn(){bn||=dn({ch:`running`},e=>{if(e.type!==`running`)return;let t=e;fn={runningSessionIds:t.runningSessionIds??[],runningPhases:t.phases??{},runningPhaseSince:t.phaseSince??{},runningBusySince:t.busySince??{}},mn.current=!0,gn()})}function Sn(){return(0,d.useSyncExternalStore)(yn,_n)}function Cn(e,t){let[n,r]=(0,d.useState)(null);return(0,d.useEffect)(()=>{if(!e||t===void 0){r(null);return}let n=()=>{document.hidden||r(Wt((Date.now()-t)/1e3))};n();let i=setInterval(n,1e3),a=()=>{document.hidden||n()};return document.addEventListener(`visibilitychange`,a),()=>{clearInterval(i),document.removeEventListener(`visibilitychange`,a)}},[e,t]),n}var wn=new Map,Tn=5e3;function En({title:e,body:t,tag:n,notifyWhileActive:r=!1}){if(!(typeof Notification>`u`)&&!(document.hasFocus()&&document.visibilityState===`visible`&&!r)){if(Notification.permission!==`granted`){console.warn(`[notify] skip: permission=${Notification.permission}`);return}try{let r;if(n){let e=Date.now(),t=wn.get(n);if(t!==void 0&&e-t<Tn)return;wn.set(n,e),r=`${n}-${e}`}new Notification(e,t?{body:t,tag:r}:{tag:r}),console.info(`[notify] dispatched: ${e}`)}catch(e){console.warn(`[notify] construction failed:`,e)}}}function Dn(){typeof Notification>`u`||Notification.requestPermission()}function On(){if(typeof Notification>`u`||Notification.permission!=="default")return;let e=()=>{Dn(),window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,e)};window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,e)}var kn=3e3,An=6e4;function jn(e,t){return e?e.error?e.path.split(/[\\/]/).pop()||t:e.name||e.firstMessage.slice(0,50)||t.slice(0,12):t.slice(0,12)}function Mn(e,t){return e.filter(e=>!t.has(e))}function Nn(e,t,n,r){switch(e.type){case`prompt_error`:case`extension_error`:{if(!n.errors)return null;let t=e.errorMessage??r(`i18n.commandFailed`);return{title:r(`chat.taskErrorNotificationTitle`),body:t,tag:`agent-error-${e.sessionId}`}}case`extension_ui_request`:{if(!n.questions)return null;let t=e.method;if(t!==`select`&&t!==`confirm`&&t!==`input`&&t!==`editor`)return null;let i=e.title??r(`chat.questionNotificationTitle`);return{title:r(`chat.questionNotificationTitle`),body:i,tag:`question-${e.id??e.sessionId}`}}default:return null}}function Pn(){let{t:e}=N(),{notifyEvents:t}=ze(),[n,r]=(0,d.useState)([]),i=(0,d.useRef)([]);(0,d.useEffect)(()=>{i.current=n});let a=(0,d.useRef)(t);(0,d.useEffect)(()=>{a.current=t});let o=(0,d.useRef)(e);(0,d.useEffect)(()=>{o.current=e});let{runningSessionIds:s}=Sn(),c=(0,d.useRef)(!1),l=(0,d.useRef)([]),u=(0,d.useRef)(new Map);(0,d.useEffect)(()=>{if(!a.current.taskComplete)return;let e=c.current?l.current:null;if(l.current=[...s],c.current=!0,!e)return;let t=Mn(e,s);if(t.length===0)return;let n=Date.now();for(let e of t){let t=u.current.get(e);t!==void 0&&n-t<kn||(i.current.some(t=>t.id===e)||p.current(),console.info(`[notify] completion via running-snapshot (${e})`),En({title:o.current(`chat.taskCompleteNotificationTitle`),body:o.current(`chat.sessionCompletedNotificationBody`,{name:jn(i.current.find(t=>t.id===e),e)}),tag:`session-complete-${e}`,notifyWhileActive:a.current.notifyWhileActive}))}},[s]);let f=(0,d.useCallback)(async()=>{try{let e=await fetch(`/api/sessions`,{cache:`no-store`});if(!e.ok)return;let t=await e.json();t.sessions&&r(t.sessions)}catch{}},[]),p=(0,d.useRef)(f);return(0,d.useEffect)(()=>{p.current=f}),(0,d.useEffect)(()=>{f();let e=setInterval(()=>void f(),An);return()=>clearInterval(e)},[f]),(0,d.useEffect)(()=>dn({ch:`global`},e=>{let t=e;if(!t.sessionId)return;let n=t.sessionId;(t.type===`prompt_error`||t.type===`extension_error`)&&u.current.set(n,Date.now()),i.current.some(e=>e.id===n)||p.current();let r=Nn(t,jn(i.current.find(e=>e.id===n),n),a.current,o.current);r&&(console.info(`[agent-events] notifying: ${r.title}`),En({...r,notifyWhileActive:a.current.notifyWhileActive}))}),[]),null}var Fn=`var(--text-dim)`;function In({size:e=14,open:t=!1}){return t?(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M1 4.5A1 1 0 0 1 2 3.5H5.5L7 5h7.5v1H1V4.5Z`,fill:Fn}),(0,E.jsx)(`path`,{d:`M1 6h14.5L14 13H2L1 6Z`,stroke:Fn,strokeWidth:`1`,fill:Fn,fillOpacity:`0.12`})]}):(0,E.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,fill:`none`,children:(0,E.jsx)(`path`,{d:`M1 4.5A1 1 0 0 1 2 3.5H5.5L7 5H14a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V4.5Z`,stroke:Fn,strokeWidth:`1`,fill:Fn,fillOpacity:`0.1`})})}function Ln({size:e=14}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M3 2h7l3 3v9H3V2Z`,stroke:Fn,strokeWidth:`1`,fill:Fn,fillOpacity:`0.08`}),(0,E.jsx)(`path`,{d:`M10 2v3h3`,stroke:Fn,strokeWidth:`1`,fill:`none`,strokeLinejoin:`round`})]})}function Rn({label:e,size:t=14}){let n=t/14;return(0,E.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 14 14`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M2.5 1h6l3 3v9h-9V1Z`,stroke:Fn,strokeWidth:`0.9`,fill:Fn,fillOpacity:`0.07`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M8.5 1v3h3`,stroke:Fn,strokeWidth:`0.9`,fill:`none`,strokeLinejoin:`round`}),(0,E.jsx)(`text`,{x:`7`,y:`9.5`,textAnchor:`middle`,fontSize:3.4*n,fontFamily:`var(--font-mono), monospace`,fontWeight:`600`,fill:Fn,letterSpacing:`0`,children:e})]})}function zn({size:e=14}){return(0,E.jsx)(Rn,{label:`TS`,size:e})}function Bn({size:e=14}){return(0,E.jsx)(Rn,{label:`TSX`,size:e})}function Vn({size:e=14}){return(0,E.jsx)(Rn,{label:`JS`,size:e})}function Hn({size:e=14}){return(0,E.jsx)(Rn,{label:`JSX`,size:e})}function Un({size:e=14}){return(0,E.jsx)(Rn,{label:`PY`,size:e})}function Wn({size:e=14}){return(0,E.jsx)(Rn,{label:`{}`,size:e})}function Gn({size:e=14}){return(0,E.jsx)(Rn,{label:`CSS`,size:e})}function Kn({size:e=14}){return(0,E.jsx)(Rn,{label:`SC`,size:e})}function qn({size:e=14}){return(0,E.jsx)(Rn,{label:`HTM`,size:e})}function Jn({size:e=14}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 14 14`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M2.5 1h6l3 3v9h-9V1Z`,stroke:Fn,strokeWidth:`0.9`,fill:Fn,fillOpacity:`0.07`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M8.5 1v3h3`,stroke:Fn,strokeWidth:`0.9`,fill:`none`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M3.5 9.5V7l1.5 1.5L6.5 7v2.5`,stroke:Fn,strokeWidth:`0.9`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}),(0,E.jsx)(`path`,{d:`M8 7v2.5M7 9l1 1.5 1-1.5`,stroke:Fn,strokeWidth:`0.9`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`})]})}function Yn({size:e=14}){return(0,E.jsx)(Rn,{label:`YML`,size:e})}function Xn({size:e=14}){return(0,E.jsx)(Rn,{label:`TOM`,size:e})}function Zn({size:e=14}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 14 14`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M2.5 1h6l3 3v9h-9V1Z`,stroke:Fn,strokeWidth:`0.9`,fill:Fn,fillOpacity:`0.07`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M8.5 1v3h3`,stroke:Fn,strokeWidth:`0.9`,fill:`none`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M4 7.5l2 1.5-2 1.5`,stroke:Fn,strokeWidth:`0.95`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}),(0,E.jsx)(`path`,{d:`M7.5 10.5h2.5`,stroke:Fn,strokeWidth:`0.95`,strokeLinecap:`round`})]})}function Qn({size:e=14}){return(0,E.jsx)(Rn,{label:`RS`,size:e})}function $n({size:e=14}){return(0,E.jsx)(Rn,{label:`GO`,size:e})}function er({size:e=14}){return(0,E.jsx)(Rn,{label:`SQL`,size:e})}function tr({size:e=14}){return(0,E.jsx)(Rn,{label:`GQL`,size:e})}function nr({size:e=14}){return(0,E.jsx)(Rn,{label:`TF`,size:e})}function rr({size:e=14}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 14 14`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M2.5 1h6l3 3v9h-9V1Z`,stroke:Fn,strokeWidth:`0.9`,fill:Fn,fillOpacity:`0.07`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M8.5 1v3h3`,stroke:Fn,strokeWidth:`0.9`,fill:`none`,strokeLinejoin:`round`}),(0,E.jsx)(`rect`,{x:`3.5`,y:`6.5`,width:`2`,height:`1.5`,rx:`0.3`,stroke:Fn,strokeWidth:`0.8`}),(0,E.jsx)(`rect`,{x:`6`,y:`6.5`,width:`2`,height:`1.5`,rx:`0.3`,stroke:Fn,strokeWidth:`0.8`}),(0,E.jsx)(`rect`,{x:`3.5`,y:`8.5`,width:`2`,height:`1.5`,rx:`0.3`,stroke:Fn,strokeWidth:`0.8`})]})}function ir({size:e=14}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 14 14`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M2.5 1h6l3 3v9h-9V1Z`,stroke:Fn,strokeWidth:`0.9`,fill:Fn,fillOpacity:`0.07`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M8.5 1v3h3`,stroke:Fn,strokeWidth:`0.9`,fill:`none`,strokeLinejoin:`round`}),(0,E.jsx)(`circle`,{cx:`5.5`,cy:`8.5`,r:`1.5`,stroke:Fn,strokeWidth:`0.9`}),(0,E.jsx)(`path`,{d:`M7 8.5h2.5M8.5 8.5v1.5`,stroke:Fn,strokeWidth:`0.9`,strokeLinecap:`round`})]})}function ar({size:e=14}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 14 14`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M2.5 1h6l3 3v9h-9V1Z`,stroke:Fn,strokeWidth:`0.9`,fill:Fn,fillOpacity:`0.07`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M8.5 1v3h3`,stroke:Fn,strokeWidth:`0.9`,fill:`none`,strokeLinejoin:`round`}),(0,E.jsx)(`circle`,{cx:`5`,cy:`6.5`,r:`1`,stroke:Fn,strokeWidth:`0.85`}),(0,E.jsx)(`circle`,{cx:`9`,cy:`6.5`,r:`1`,stroke:Fn,strokeWidth:`0.85`}),(0,E.jsx)(`circle`,{cx:`5`,cy:`10`,r:`1`,stroke:Fn,strokeWidth:`0.85`}),(0,E.jsx)(`path`,{d:`M5 7.5V9`,stroke:Fn,strokeWidth:`0.85`,strokeLinecap:`round`}),(0,E.jsx)(`path`,{d:`M9 7.5v.5a2 2 0 0 1-2 2H6`,stroke:Fn,strokeWidth:`0.85`,strokeLinecap:`round`,fill:`none`})]})}function or({size:e=14}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 14 14`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M2.5 1h6l3 3v9h-9V1Z`,stroke:Fn,strokeWidth:`0.9`,fill:Fn,fillOpacity:`0.07`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M8.5 1v3h3`,stroke:Fn,strokeWidth:`0.9`,fill:`none`,strokeLinejoin:`round`}),(0,E.jsx)(`rect`,{x:`4.5`,y:`8.5`,width:`5`,height:`3`,rx:`0.6`,stroke:Fn,strokeWidth:`0.9`}),(0,E.jsx)(`path`,{d:`M5.5 8.5V7.5a1.5 1.5 0 0 1 3 0v1`,stroke:Fn,strokeWidth:`0.9`,strokeLinecap:`round`,fill:`none`})]})}function sr({size:e=14}){return(0,E.jsx)(Rn,{label:`DOC`,size:e})}function cr({size:e=14}){return(0,E.jsx)(Rn,{label:`PDF`,size:e})}function lr({size:e=14}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 14 14`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M2.5 1h6l3 3v9h-9V1Z`,stroke:Fn,strokeWidth:`0.9`,fill:Fn,fillOpacity:`0.07`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M8.5 1v3h3`,stroke:Fn,strokeWidth:`0.9`,fill:`none`,strokeLinejoin:`round`}),(0,E.jsx)(`circle`,{cx:`7`,cy:`8.5`,r:`1.3`,stroke:Fn,strokeWidth:`0.9`}),(0,E.jsx)(`path`,{d:`M7 6.5v.7M7 10.3v.7M5 8.5h.7M8.3 8.5H9M5.5 6.9l.5.5M8.5 9.6l-.5-.5M5.5 10.1l.5-.5M8.5 7.4l-.5.5`,stroke:Fn,strokeWidth:`0.8`,strokeLinecap:`round`})]})}function ur(e,t=14){let n=e.toLowerCase(),r=n.split(`.`).pop()??``;if(n===`dockerfile`||n.startsWith(`dockerfile.`))return(0,E.jsx)(rr,{size:t});if(n===`.env`||n.startsWith(`.env.`))return(0,E.jsx)(ir,{size:t});if(n===`.gitignore`||n===`.gitattributes`||n===`.gitmodules`)return(0,E.jsx)(ar,{size:t});if(n===`package-lock.json`||n===`yarn.lock`||n===`bun.lock`||n===`pnpm-lock.yaml`||n===`cargo.lock`)return(0,E.jsx)(or,{size:t});if(n.endsWith(`.config.ts`)||n.endsWith(`.config.js`)||n.endsWith(`.config.mjs`)||n.endsWith(`.config.cjs`)||[`.eslintrc`,`.eslintrc.js`,`.eslintrc.json`,`.eslintrc.yml`,`eslint.config.mjs`,`eslint.config.js`].includes(n))return(0,E.jsx)(lr,{size:t});switch(r){case`ts`:return(0,E.jsx)(zn,{size:t});case`tsx`:return(0,E.jsx)(Bn,{size:t});case`js`:case`mjs`:case`cjs`:return(0,E.jsx)(Vn,{size:t});case`jsx`:return(0,E.jsx)(Hn,{size:t});case`py`:return(0,E.jsx)(Un,{size:t});case`json`:case`jsonl`:return(0,E.jsx)(Wn,{size:t});case`css`:case`less`:return(0,E.jsx)(Gn,{size:t});case`scss`:return(0,E.jsx)(Kn,{size:t});case`html`:case`htm`:return(0,E.jsx)(qn,{size:t});case`md`:case`mdx`:return(0,E.jsx)(Jn,{size:t});case`yaml`:case`yml`:return(0,E.jsx)(Yn,{size:t});case`toml`:return(0,E.jsx)(Xn,{size:t});case`sh`:case`bash`:case`zsh`:case`fish`:return(0,E.jsx)(Zn,{size:t});case`rs`:return(0,E.jsx)(Qn,{size:t});case`go`:return(0,E.jsx)($n,{size:t});case`sql`:return(0,E.jsx)(er,{size:t});case`graphql`:case`gql`:return(0,E.jsx)(tr,{size:t});case`tf`:case`hcl`:return(0,E.jsx)(nr,{size:t});case`docx`:return(0,E.jsx)(sr,{size:t});case`pdf`:return(0,E.jsx)(cr,{size:t});case`lock`:return(0,E.jsx)(or,{size:t});default:return(0,E.jsx)(Ln,{size:t})}}var dr={up:{top:0,left:0,right:0},down:{bottom:0,left:0,right:0},left:{left:0,top:0,bottom:0},right:{right:0,top:0,bottom:0}},fr={up:{left:`50%`,transform:`translateX(-50%)`},down:{left:`50%`,transform:`translateX(-50%)`},left:{top:`50%`,transform:`translateY(-50%)`},right:{top:`50%`,transform:`translateY(-50%)`}},pr={up:`linear-gradient(to bottom, var(--bg), transparent)`,down:`linear-gradient(to top, var(--bg), transparent)`,left:`linear-gradient(to right, var(--bg), transparent)`,right:`linear-gradient(to left, var(--bg), transparent)`},mr={up:{borderLeft:`6px solid transparent`,borderRight:`6px solid transparent`,borderBottom:`7px solid var(--text-muted)`},down:{borderLeft:`6px solid transparent`,borderRight:`6px solid transparent`,borderTop:`7px solid var(--text-muted)`},left:{borderTop:`6px solid transparent`,borderBottom:`6px solid transparent`,borderRight:`7px solid var(--text-muted)`},right:{borderTop:`6px solid transparent`,borderBottom:`6px solid transparent`,borderLeft:`7px solid var(--text-muted)`}};function hr({direction:e,visible:t,onHover:n,hoverInterval:r=200,onClick:i,length:a=`100%`,thickness:o=30,style:s,label:c,testId:l}){let u=(0,d.useRef)(n);(0,d.useEffect)(()=>{u.current=n});let f=(0,d.useRef)(null),p=(0,d.useCallback)(()=>{f.current!==null&&(clearInterval(f.current),f.current=null)},[]),m=(0,d.useCallback)(()=>{p(),u.current?.(),u.current&&(f.current=window.setInterval(()=>u.current?.(),r))},[r,p]);if((0,d.useEffect)(()=>p,[p]),!t)return null;let h=e===`up`||e===`down`,g={position:`absolute`,pointerEvents:`none`,zIndex:49,height:o,...h?{left:0,right:0}:{width:o,top:0,bottom:0},...dr[e],background:pr[e]},_={position:`absolute`,zIndex:50,cursor:`pointer`,background:`transparent`,border:`none`,padding:0,display:`flex`,alignItems:`center`,justifyContent:`center`,...dr[e],...h?{width:a,height:o}:{height:a,width:o},...fr[e],...s};return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`span`,{style:g,"aria-hidden":`true`}),(0,E.jsx)(`button`,{type:`button`,"data-testid":l??`scroll-direction-hint-${e}`,"aria-label":c??`Scroll ${e}`,title:c??`Scroll ${e}`,style:_,onMouseEnter:m,onMouseLeave:p,onClick:i,children:(0,E.jsx)(`span`,{"aria-hidden":`true`,style:{width:0,height:0,pointerEvents:`none`,...mr[e]}})})]})}var gr=2;function _r({tabs:e,activeTabId:t,onSelectTab:n,onCloseTab:r,leftExtra:i,rightExtra:a,scrollStepPx:o=200}){let{t:s}=N(),[c,l]=(0,d.useState)(null),u=(0,d.useRef)(null),[f,m]=(0,d.useState)({scrollWidth:0,clientWidth:0,scrollLeft:0}),h=(0,d.useCallback)(()=>{if(document.hidden)return;let e=u.current;e&&m({scrollWidth:e.scrollWidth,clientWidth:e.clientWidth,scrollLeft:e.scrollLeft})},[]);(0,d.useLayoutEffect)(()=>{h();let e=u.current;if(!e)return;let t=new ResizeObserver(h);return t.observe(e),()=>t.disconnect()},[h,e]);let{scrollWidth:g,clientWidth:_,scrollLeft:v}=f,y=g-_>20,b=y&&v>gr,x=y&&v+_<g-gr,S=e=>{let t=u.current;if(!t)return;let n=Math.max(0,t.scrollWidth-t.clientWidth);t.scrollTo({left:Math.max(0,Math.min(n,t.scrollLeft+e*o)),behavior:`smooth`})},C=e=>{let t=u.current;t&&t.scrollTo({left:e===`left`?0:Math.max(0,t.scrollWidth-t.clientWidth),behavior:`smooth`})};return(0,E.jsxs)(`div`,{"data-testid":`tab-bar`,style:{display:`flex`,alignItems:`flex-end`,background:`var(--bg-panel)`,flexShrink:0,height:`calc(36px + env(safe-area-inset-top))`,paddingTop:`env(safe-area-inset-top)`},children:[i&&(0,E.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,height:36,flexShrink:0},children:i}),(0,E.jsxs)(`div`,{style:{position:`relative`,flex:1,minWidth:0,height:36},children:[(0,E.jsx)(`div`,{ref:u,"data-testid":`tab-scroll`,role:`tablist`,onScroll:h,style:{display:`flex`,alignItems:`flex-end`,overflowX:`auto`,overflowY:`hidden`,height:36},children:e.map(e=>{let i=e.id===t;return(0,E.jsxs)(`div`,{"data-tab-id":e.id,"data-active":i,role:`tab`,"aria-selected":i,onClick:()=>n(e.id),onMouseDown:e=>{e.button===1&&e.preventDefault()},onAuxClick:t=>{t.button===1&&e.closable!==!1&&(t.preventDefault(),t.stopPropagation(),r(e.id))},style:{display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,gap:6,height:36,paddingLeft:30,paddingRight:30,borderRight:`1px solid var(--border)`,background:i?`var(--bg)`:`var(--bg-panel)`,cursor:`pointer`,fontSize:`var(--text-base)`,color:i?`var(--text)`:`var(--text-muted)`,whiteSpace:`nowrap`,maxWidth:180,minWidth:80,flexShrink:0,userSelect:`none`,transition:`background 0.1s, color 0.1s`},children:[(0,E.jsx)(`span`,{style:{flexShrink:0,opacity:i?1:.7,display:`flex`,alignItems:`center`},children:e.icon??(e.filePath?ur(e.label,13):null)}),(0,E.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,fontWeight:i?500:400},title:e.filePath,children:e.label}),e.badge!=null&&e.badge>0&&(0,E.jsx)(`span`,{style:{flexShrink:0,marginLeft:5,minWidth:16,height:16,padding:`0 5px`,borderRadius:5,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid var(--accent)`,background:`color-mix(in srgb, var(--accent) 12%, transparent)`,color:`var(--accent)`,fontSize:`var(--text-2xs)`,fontWeight:600,lineHeight:1},children:e.badge>99?`99+`:e.badge}),e.closable!==!1&&(0,E.jsx)(`button`,{onClick:t=>{t.stopPropagation(),r(e.id)},onMouseEnter:()=>l(e.id),onMouseLeave:()=>l(null),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,position:`absolute`,right:6,top:`50%`,transform:`translateY(-50%)`,width:24,height:24,background:c===e.id?`var(--bg-hover)`:`transparent`,border:`none`,borderRadius:4,color:c===e.id?`var(--text)`:`var(--text-dim)`,cursor:`pointer`,padding:0,flexShrink:0,transition:`background 0.1s, color 0.1s`},title:s(`i18n.close`),"aria-label":`${s(`i18n.close`)} ${e.label}`,children:(0,E.jsxs)(`svg`,{width:p.sm,height:p.sm,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`line`,{x1:`2`,y1:`2`,x2:`8`,y2:`8`}),(0,E.jsx)(`line`,{x1:`8`,y1:`2`,x2:`2`,y2:`8`})]})})]},e.id)})}),b&&(0,E.jsx)(hr,{direction:`left`,visible:!0,testId:`tab-scroll-left`,thickness:18,onHover:()=>S(-1),onClick:()=>C(`left`)}),x&&(0,E.jsx)(hr,{direction:`right`,visible:!0,testId:`tab-scroll-right`,thickness:18,onHover:()=>S(1),onClick:()=>C(`right`)})]}),a&&(0,E.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,height:36,flexShrink:0,paddingRight:`env(safe-area-inset-right)`},children:a})]})}function vr(e){return null}function yr({activeId:e,children:t}){let n=d.Children.toArray(t).filter(e=>(0,d.isValidElement)(e)&&e.type===vr);return(0,E.jsx)(E.Fragment,{children:n.map(t=>{let n=t.props.activeWhen!==!1&&t.props.id===e;return!t.props.keepAlive&&!n?null:(0,E.jsx)(`div`,{"data-testid":t.props.testId,style:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`,overflow:t.props.scroll??`auto`,zIndex:t.props.zIndex,contentVisibility:n?`visible`:`hidden`,pointerEvents:n?void 0:`none`},children:t.props.children},t.props.id)})})}function br({tabs:e,activeTabId:t,onSelectTab:n,onCloseTab:r,leftExtra:i,rightExtra:a,scrollStepPx:o,tabBarRef:s,overlay:c,children:l}){return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{ref:s,style:{flexShrink:0,background:`var(--bg-panel)`},children:[(0,E.jsx)(_r,{tabs:e,activeTabId:t,leftExtra:i,rightExtra:a,onSelectTab:n,onCloseTab:r,scrollStepPx:o}),(0,E.jsx)(`div`,{style:{height:1,background:`var(--border)`,flexShrink:0}})]}),(0,E.jsx)(`div`,{style:{flex:1,overflow:`hidden`,position:`relative`,display:`flex`},children:(0,E.jsxs)(`div`,{style:{flex:1,overflow:`hidden`,position:`relative`,minWidth:0,minHeight:0,display:`flex`,flexDirection:`column`},children:[(0,E.jsx)(yr,{activeId:t,children:l}),c]})})]})}var xr=new Set;function Sr(e){return xr.add(e),()=>{xr.delete(e)}}function Cr(){return typeof document>`u`?`light`:document.documentElement.classList.contains(`dark`)?`dark`:`light`}function wr(){return`light`}function Tr(){let e=(0,d.useSyncExternalStore)(Sr,Cr,wr);return{theme:e,toggleTheme:(0,d.useCallback)(e=>{let t=Cr()===`dark`?`light`:`dark`;t===`dark`?document.documentElement.classList.add(`dark`):document.documentElement.classList.remove(`dark`);try{localStorage.setItem(`pi-theme`,t)}catch{}fetch(`/api/preferences`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({firstPaint:{theme:t}})}).catch(e=>console.error(`[pi-web] save theme:`,e)),xr.forEach(e=>e())},[]),isDark:e===`dark`}}function Er(e,t,n){let[r,i]=(0,d.useState)(()=>{try{let t=localStorage.getItem(e);if(t!==null){let e=JSON.parse(t);return n?n(e):e}}catch{}return typeof t==`function`?t():t});return(0,d.useEffect)(()=>{try{localStorage.setItem(e,JSON.stringify(r))}catch{}},[e,r]),[r,i]}var Dr=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Or=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),kr=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Ar=e=>{let t=kr(e);return t.charAt(0).toUpperCase()+t.slice(1)},jr={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Mr=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Nr=(0,d.createContext)({}),Pr=()=>(0,d.useContext)(Nr),Fr=(0,d.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:f=!1,color:p=`currentColor`,className:m=``}=Pr()??{},h=r??f?Number(n??u)*24/Number(t??l):n??u;return(0,d.createElement)(`svg`,{ref:c,...jr,width:t??l??jr.width,height:t??l??jr.height,stroke:e??p,strokeWidth:h,className:Dr(`lucide`,m,i),...!a&&!Mr(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,d.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Ir=(e,t)=>{let n=(0,d.forwardRef)(({className:n,...r},i)=>(0,d.createElement)(Fr,{ref:i,iconNode:t,className:Dr(`lucide-${Or(Ar(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Ar(e),n},Lr=Ir(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Rr=Ir(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),zr=Ir(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Br=Ir(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Vr=Ir(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),Hr=Ir(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),Ur=Ir(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Wr=Ir(`corner-up-left`,[[`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`,key:`1nkjon`}],[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}]]),Gr=Ir(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Kr=Ir(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),qr=Ir(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]),Jr=Ir(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Yr=Ir(`fold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3-3-3 3`,key:`e37ymu`}],[`path`,{d:`m15 5-3 3-3-3`,key:`19d6lf`}]]),Xr=Ir(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Zr=Ir(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Qr=Ir(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),$r=Ir(`hard-drive-upload`,[[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M12 2v8`,key:`1q4o3n`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M10 18h.01`,key:`h775k`}]]),ei=Ir(`hourglass`,[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]),ti=Ir(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),ni=Ir(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),ri=Ir(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),ii=Ir(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),ai=Ir(`list-end`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M16 12H3`,key:`1a2rj7`}],[`path`,{d:`M9 19H3`,key:`s61nz1`}],[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M21 5v12a2 2 0 0 1-2 2h-6`,key:`hey24a`}]]),oi=Ir(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),si=Ir(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),ci=Ir(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),li=Ir(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),ui=Ir(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),di=Ir(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),fi=Ir(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),pi=Ir(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),mi=Ir(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),hi=Ir(`rotate-ccw-clock`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),gi=Ir(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),_i=Ir(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),vi=Ir(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),yi=Ir(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),bi=Ir(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),xi=Ir(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Si=Ir(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Ci=Ir(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),wi=Ir(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Ti=Ir(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Ei=Ir(`trash`,[[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Di=Ir(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Oi=Ir(`unplug`,[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]),ki=Ir(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),Ai=Ir(`volume-x`,[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]),ji=Ir(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Mi=Ir(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ni=Ir(`zap`,[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]);function Pi(){let e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}var Fi=class extends Error{constructor(e){super(e),this.name=`CancellationError`}};function Ii(e,t){let n=Pi(),r=new AbortController,i=!1,a=e=>{i||(i=!0,r.abort(),n.reject(e))},o=setTimeout(()=>a(new Fi(`timed out after ${t}ms`)),t),s=e(r.signal).then(e=>(i=!0,clearTimeout(o),e),e=>{if(clearTimeout(o),!i)throw i=!0,e});return{promise:Promise.race([s,n.promise]),cancel:()=>a(new Fi(`cancelled`))}}function Li(){let e=(0,d.useRef)(new Map);return(0,d.useEffect)(()=>()=>{for(let t of e.current.values())t.cancel()},[]),(0,d.useMemo)(()=>({start:(t,n,r)=>{let i=r?.joinKey??null,a=e.current.get(i);if(a){if(r?.joinKey!==void 0)return{promise:a.promise,cancel:a.cancel};a.cancel()}let o=Ii(t,n);return e.current.set(i,o),o.promise.then(()=>{e.current.get(i)===o&&e.current.delete(i)},()=>{e.current.get(i)===o&&e.current.delete(i)}),o},cancel:()=>{for(let t of e.current.values())t.cancel()}}),[])}function Ri(e){if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(e);try{let t=document.createElement(`textarea`);return t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),document.body.removeChild(t),Promise.resolve()}catch{return Promise.reject()}}var zi=3e4;function Bi({command:e,note:t}){let{t:n}=N(),[r,i]=(0,d.useState)(!1),a=async()=>{try{await Ri(e),i(!0),setTimeout(()=>i(!1),1500)}catch{}};return(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,background:`var(--bg-input)`,border:`1px solid var(--border)`,borderRadius:6,padding:`6px 8px`},children:[(0,E.jsx)(`code`,{style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,color:`var(--text)`},children:e}),(0,E.jsx)(`button`,{onClick:()=>void a(),style:Vi(),children:n(r?`updates.copied`:`updates.copyCommand`)})]}),(0,E.jsx)(`span`,{style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`},children:t})]})}function Vi(e){return{padding:`6px 12px`,background:`none`,border:`1px solid var(--border)`,borderRadius:6,color:`var(--text-muted)`,cursor:e?`not-allowed`:`pointer`,fontSize:`var(--text-base)`}}function Hi({title:e,subtitle:t,right:n,children:r}){return(0,E.jsxs)(`div`,{style:{border:`1px solid var(--border)`,borderRadius:10,background:`var(--bg-panel)`},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:16,padding:`10px 14px`},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2,minWidth:0},children:[(0,E.jsx)(`span`,{style:{fontSize:`var(--text-lg)`,color:`var(--text)`,fontWeight:500},children:e}),(0,E.jsx)(`span`,{style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`,fontFamily:`var(--font-mono)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t})]}),(0,E.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flexShrink:0},children:n})]}),r?(0,E.jsx)(`div`,{style:{borderTop:`1px solid var(--border)`,padding:`8px 14px 10px`},children:r}):null]})}function Ui({cwd:e}){let{t}=N(),{value:n}=P(we),[r,i]=(0,d.useState)(null),[a,o]=(0,d.useState)(!1),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(null),f=Li(),p=(0,d.useRef)(null),m=r??n?.enabled!==!1,h=n?.ignored??{},g=(e,t)=>t!==null&&Ae(t,e)>0,_=(e,t)=>{o(!0);let n=f.start(e,zi);p.current=n.promise,n.promise.catch(e=>{e instanceof Fi||(t?.(),u(e instanceof Error?e.message:String(e)))}).finally(()=>{p.current===n.promise&&o(!1)})},v=()=>{u(null),_(async e=>{await we.refresh(e)})},y=(e,t)=>{u(null),t?.optimisticEnabled!==void 0&&i(t.optimisticEnabled),_(async t=>{let n=await fetch(`/api/updates-config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e),signal:t}),r=await n.json();if(!n.ok||r.error)throw Error(r.error??`HTTP ${n.status}`);await we.refresh(t)},()=>{t?.optimisticEnabled!==void 0&&i(null)})},b=e=>void y({enabled:e},{optimisticEnabled:e}),x=(e,t)=>void y({ignored:{[e]:t}}),S=async(t,n)=>{if(e){c(t),u(null);try{let r=await fetch(`/api/plugins`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`update`,source:t,scope:n===`project`?`project`:`global`,cwd:e})}),i=await r.json();if(!r.ok||i.error)throw Error(i.error??`HTTP ${r.status}`);await we.refresh(),xe.load().catch(e=>console.error(`[pi-web] load home plugins:`,e))}catch(e){u(e instanceof Error?e.message:String(e))}finally{c(null)}}},C=n?g(n.piWeb.current,n.piWeb.latest):!1,w=h[ke]===n?.piWeb.latest;return(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12,padding:16},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,cursor:`pointer`,fontSize:`var(--text-base)`,color:`var(--text-muted)`},children:[(0,E.jsx)(`input`,{type:`checkbox`,"data-testid":`updates-enabled-toggle`,checked:m,onChange:e=>b(e.target.checked)}),(0,E.jsx)(`span`,{children:t(`updates.enableChecking`)})]}),(0,E.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:6,fontSize:`var(--text-base)`,color:`var(--text-dim)`,flex:1},children:[m?n?`${t(`updates.checkedAt`)} ${new Date(n.checkedAt).toLocaleTimeString()}`:t(`updates.checking`):t(`updates.disabled`),l?` · ${l}`:``]}),(0,E.jsxs)(`button`,{onClick:v,disabled:a||!m,style:Vi(a||!m),children:[a&&(0,E.jsx)(oi,{size:14,className:`animate-spin`,"aria-hidden":`true`}),t(a?`updates.checking`:`updates.check`)]})]}),(0,E.jsx)(Hi,{title:`pi-web`,subtitle:n?`${n.piWeb.current}${C?` → ${n.piWeb.latest}`:``}`:`…`,right:n?m?C?w?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`span`,{style:{color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:t(`updates.ignored`,{version:n.piWeb.latest??``})}),(0,E.jsx)(`button`,{onClick:()=>x(ke,null),style:Vi(),children:t(`updates.unignore`)})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`span`,{style:{color:`var(--status-success)`,fontWeight:500},children:t(`updates.updateAvailable`)}),(0,E.jsx)(`button`,{onClick:()=>x(ke,n.piWeb.latest),style:Vi(),children:t(`updates.ignoreVersion`)})]}):n.piWeb.latest===null?(0,E.jsx)(`span`,{style:{color:`var(--text-dim)`},children:t(`updates.unavailable`)}):(0,E.jsx)(`span`,{style:{color:`var(--text-dim)`},children:t(`updates.upToDate`)}):(0,E.jsx)(`span`,{style:{color:`var(--text-dim)`},children:t(`updates.disabled`)}):null,children:n&&C&&n.piWeb.latest!==null&&(0,E.jsx)(Bi,{command:`npm install -g @rainmanhhh/pi-web@${n.piWeb.latest}`,note:t(`updates.restartNote`)})}),(0,E.jsx)(`div`,{style:{fontSize:`var(--text-lg)`,color:`var(--text)`,fontWeight:500,marginTop:4},children:t(`common.plugins`)}),!m||(n?.plugins.length??0)===0?(0,E.jsx)(`span`,{style:{color:`var(--text-dim)`,fontSize:`var(--text-base)`},children:t(`updates.noPluginUpdates`)}):n?.plugins.map(e=>{let n=h[e.source]===`*`;return(0,E.jsx)(Hi,{title:e.displayName,subtitle:e.latest?`${e.current} → ${e.latest}`:e.source,right:n?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`span`,{style:{color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:t(`updates.ignoredPlugin`)}),(0,E.jsx)(`button`,{onClick:()=>x(e.source,null),style:Vi(),children:t(`updates.unignore`)})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`button`,{onClick:()=>void S(e.source,e.scope),disabled:s!==null,style:Vi(s!==null),children:[s===e.source&&(0,E.jsx)(oi,{size:14,className:`animate-spin`,"aria-hidden":`true`}),s===e.source?t(`i18n.updating`):t(`i18n.update`)]}),(0,E.jsx)(`button`,{onClick:()=>x(e.source,`*`),disabled:s!==null,style:Vi(s!==null),children:t(`updates.ignoreVersion`)})]})},`${e.scope}:${e.source}`)})]})}function Wi(e,t){let n=(0,d.useRef)(t);(n.current.length!==t.length||n.current.some((e,n)=>e!==t[n]))&&e(),n.current=t}var Gi=t(c(),1);function Ki({children:e}){return(0,E.jsx)(E.Fragment,{children:e})}function qi({label:e,wrapperStyle:t,children:n}){let r=(0,d.useRef)(null),i=(0,d.useRef)(null),[a,o]=(0,d.useState)(!1),[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)({top:0,left:0,placement:`bottom`});if((0,d.useLayoutEffect)(()=>{if(!e||!a||!s)return;let t=r.current?.getBoundingClientRect(),n=i.current;if(!t||!n)return;let o=n.offsetWidth,c=n.offsetHeight;if(!o)return;let l=t.left+t.width/2,d=o/2,f=window.innerWidth,p=window.innerHeight,m=Math.max(d+8,Math.min(l,f-d-8)),h=t.bottom+6+c<=p-8,g=t.top-6-c>=8,_=h||!g?`bottom`:`top`;u({top:_===`bottom`?t.bottom+6:t.top-6,left:m,placement:_})},[e,a,s]),!e)return(0,E.jsx)(E.Fragment,{children:n});let f=()=>{let e=r.current?.getBoundingClientRect();e&&u({top:e.bottom+6,left:e.left+e.width/2,placement:`bottom`})},p=()=>{f(),c(!0),o(!0)},m=()=>o(!1),h=s&&typeof document<`u`?(0,Gi.createPortal)((0,E.jsx)(`div`,{ref:i,role:`tooltip`,"data-slot":`tooltip-content`,style:{position:`fixed`,top:l.top,left:l.left,transform:l.placement===`top`?`translate(-50%, -100%)`:`translateX(-50%)`,zIndex:9999,width:`max-content`,maxWidth:`min(20rem, calc(100vw - 16px))`,whiteSpace:`pre-line`,overflowWrap:`break-word`,background:`var(--bg-panel)`,color:`var(--text)`,border:`1px solid var(--border)`,borderRadius:`var(--radius-md, 6px)`,padding:`4px 8px`,fontSize:`var(--text-sm)`,lineHeight:1.5,boxShadow:`0 4px 16px -2px var(--shadow-strong)`,pointerEvents:`none`,display:a?`block`:`none`},children:e}),document.body):null;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`span`,{ref:r,"data-slot":`tooltip-trigger`,title:``,onPointerEnter:p,onPointerLeave:m,onMouseEnter:p,onMouseLeave:m,onFocus:p,onBlur:m,onPointerMove:e=>e.stopPropagation(),style:{display:`inline-flex`,...t},children:n}),h]})}var Ji={boxSizing:`border-box`,background:`var(--bg-input, var(--bg))`,color:`var(--text)`,border:`1px solid var(--border)`,borderRadius:4,padding:`4px 8px`,fontSize:`var(--text-base)`,fontFamily:`var(--font-mono)`},Yi={display:`flex`,alignItems:`center`,justifyContent:`center`,width:22,height:22,padding:0,background:`none`,border:`1px solid var(--border)`,borderRadius:5,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-sm)`,lineHeight:1,flexShrink:0};function Xi({value:e,onChange:t,parse:n}){let[r,i]=(0,d.useState)(String(e));return Wi(()=>{i(String(e))},[e]),{draft:r,commit:e=>{i(e);let r=n(e);r!==null&&t(r)}}}function Zi({tooltip:e=!1,offText:t,...n}){let{t:r,labelKey:i,unitText:a,rangeText:o,resetText:s,defaultValue:c,min:l,max:u}=n,{draft:d,commit:f}=Xi(n),p=t!=null&&n.value===c?t:o,m=(0,E.jsx)(`input`,{type:`number`,min:l,max:u,step:1,value:d,onChange:e=>f(e.target.value),"aria-label":r(i),...e?{}:{title:p},style:{flex:1,minWidth:0,...Ji}}),h=(0,E.jsx)(`button`,{type:`button`,onClick:()=>n.onChange(c),"aria-label":s,...e?{}:{title:s},style:Yi,children:`↺`});return(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`},children:[e?(0,E.jsx)(qi,{label:p,wrapperStyle:{flex:1,display:`flex`},children:m}):m,(0,E.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`,whiteSpace:`nowrap`},children:a}),e?(0,E.jsx)(qi,{label:s,children:h}):h]})}function Qi({unitSuffix:e,offText:t,tooltip:n=!0,...r}){let{t:i,labelKey:a,rangeText:o,resetText:s,value:c,defaultValue:l,min:u,max:d}=r,{draft:f,commit:p}=Xi(r);return(0,E.jsxs)(`div`,{role:`menu`,"aria-label":i(a),style:{background:`var(--bg-panel)`,borderLeft:`1px solid var(--border)`,borderRight:`1px solid var(--border)`,borderBottom:`1px solid var(--border)`,padding:`10px 12px 12px`},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`var(--text-base)`,color:`var(--text-muted)`,marginBottom:8},children:[(0,E.jsx)(`span`,{children:i(a)}),(0,E.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,E.jsxs)(`span`,{style:{fontFamily:`var(--font-mono)`,color:`var(--text)`,fontWeight:600},children:[c,e]}),(()=>{let e=(0,E.jsx)(`button`,{type:`button`,onClick:()=>r.onChange(l),"aria-label":s,...n?{}:{title:s},style:Yi,children:`↺`});return n?(0,E.jsx)(qi,{label:s,children:e}):e})()]})]}),(0,E.jsx)(`input`,{type:`number`,min:u,max:d,step:1,value:f,onChange:e=>p(e.target.value),"aria-label":i(a),style:{width:`100%`,...Ji}}),(0,E.jsx)(`div`,{style:{fontSize:`var(--text-xs)`,color:`var(--text-dim)`,marginTop:4,textAlign:`center`},children:t!=null&&c===l?t:o})]})}function $i({value:e,onChange:t,t:n,embedded:r}){let i={value:e,onChange:t,parse:ct,min:1,max:ot,defaultValue:200,t:n,labelKey:`theme.scrollStep`,unitText:n(`scrollStep.unit`),rangeText:n(`scrollStep.range`),resetText:n(`scrollStep.reset`,{n:200})};return r?(0,E.jsx)(Zi,{...i,tooltip:!0}):(0,E.jsx)(Qi,{...i,unitSuffix:`px`})}function ea({label:e,hint:t,children:n}){return(0,E.jsxs)(ta,{children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,minWidth:0},children:[(0,E.jsx)(`span`,{style:{fontSize:`var(--text-lg)`,color:`var(--text)`,fontWeight:500,whiteSpace:`nowrap`},children:e}),t&&(0,E.jsx)(qi,{label:t,children:(0,E.jsx)(`span`,{role:`img`,"aria-label":t,style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`,cursor:`help`,lineHeight:1,flexShrink:0},children:`ⓘ`})})]}),(0,E.jsx)(`div`,{style:{flex:1,minWidth:0,maxWidth:320},children:n})]})}function ta({children:e}){return(0,E.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:16,padding:`10px 14px`,border:`1px solid var(--border)`,borderRadius:10,background:`var(--bg-panel)`},children:e})}function na({sidebarWidth:e,onSidebarWidthChange:t,widgetPanelWidth:n,onWidgetPanelWidthChange:r}){let{t:i}=N(),{isDark:a,toggleTheme:o,fontScale:s,setFontScale:c,scrollStepPx:l,setScrollStepPx:u,longBlockCollapseChars:d,setLongBlockCollapseChars:f,recentBlocksExpanded:p,setRecentBlocksExpanded:m}=ze();return(0,E.jsxs)(`div`,{style:{height:`100%`,overflowY:`auto`,padding:`18px 20px 40px`,display:`flex`,flexDirection:`column`,gap:8,maxWidth:640},children:[(0,E.jsx)(ea,{label:i(`theme.toggleTheme`),children:(0,E.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,width:`100%`},children:[{value:!0,key:`dark`,labelKey:`theme.darkMode`},{value:!1,key:`light`,labelKey:`theme.lightMode`}].map(({value:e,key:t,labelKey:n})=>(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,fontSize:`var(--text-base)`,color:`var(--text)`,cursor:`pointer`,whiteSpace:`nowrap`},children:[(0,E.jsx)(`input`,{type:`radio`,name:`theme-mode`,checked:a===e,onChange:e=>{let t=e.currentTarget.getBoundingClientRect();o({x:t.left+t.width/2,y:t.top+t.height/2})},style:{accentColor:`var(--accent)`,cursor:`pointer`,margin:0}}),i(n)]},t))})}),(0,E.jsx)(ea,{label:i(`theme.fontSize`),children:(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,width:`100%`},children:[(0,E.jsx)(`input`,{type:`range`,min:.85,max:1.3,step:.05,value:s,onChange:e=>c(Number(e.target.value)),"aria-label":i(`theme.fontSize`),style:{flex:1,accentColor:`var(--accent)`,cursor:`pointer`}}),(0,E.jsxs)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`var(--text-base)`,color:`var(--text)`,fontWeight:600,minWidth:44,textAlign:`right`},children:[Math.round(s*100),`%`]})]})}),(0,E.jsx)(ea,{label:i(`theme.scrollStep`),hint:i(`scrollStep.hint`),children:(0,E.jsx)($i,{value:l,onChange:u,t:i,embedded:!0})}),(0,E.jsx)(ea,{label:i(`theme.longBlockCollapse`),hint:i(`longBlock.hint`),children:(0,E.jsx)(aa,{value:d,onChange:f,t:i})}),(0,E.jsx)(ea,{label:i(`theme.recentBlocksExpanded`),hint:i(`recentBlocks.hint`),children:(0,E.jsx)(ia,{value:p,onChange:m,t:i})}),(0,E.jsx)(ea,{label:i(`layout.sidebarWidth`),hint:i(`layout.widthRange`,{min:180,max:480}),children:(0,E.jsx)(ra,{value:e,onChange:t,min:180,max:480,resetTo:280,label:i(`layout.sidebarWidth`),t:i})}),(0,E.jsx)(ea,{label:i(`layout.widgetPanelWidth`),hint:i(`layout.widthRange`,{min:200,max:560}),children:(0,E.jsx)(ra,{value:n,onChange:r,min:200,max:560,resetTo:280,label:i(`layout.widgetPanelWidth`),t:i})}),` `]})}function ra({value:e,onChange:t,min:n,max:r,resetTo:i,label:a,t:o}){return(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[(0,E.jsx)(`input`,{type:`number`,value:e,min:n,max:r,onChange:e=>{let i=Number.parseInt(e.target.value,10);Number.isFinite(i)&&t(Math.min(r,Math.max(n,i)))},onBlur:()=>t(e),"aria-label":a,style:{width:80,padding:`5px 8px`,border:`1px solid var(--border)`,borderRadius:7,background:`var(--bg)`,color:`var(--text)`,fontSize:`var(--text-lg)`,fontVariantNumeric:`tabular-nums`,outline:`none`}}),(0,E.jsx)(`span`,{style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`},children:`px`}),(0,E.jsx)(qi,{label:o(`layout.widthReset`,{value:i}),children:(0,E.jsx)(`button`,{type:`button`,onClick:()=>t(i),"aria-label":o(`layout.widthReset`,{value:i}),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:26,height:26,padding:0,background:`none`,border:`none`,borderRadius:5,color:`var(--text-dim)`,cursor:`pointer`},children:(0,E.jsxs)(`svg`,{width:p.base,height:p.base,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,E.jsx)(`path`,{d:`M3 3v5h5`})]})})})]})}function ia({value:e,onChange:t,t:n}){return(0,E.jsx)(Zi,{tooltip:!0,value:e,onChange:t,parse:ht,min:0,max:20,defaultValue:0,t:n,labelKey:`theme.recentBlocksExpanded`,unitText:n(`longBlock.blocks`),rangeText:n(`recentBlocks.range`),resetText:n(`recentBlocks.reset`,{n:0})})}function aa({value:e,onChange:t,t:n}){return(0,E.jsx)(Zi,{tooltip:!0,value:e,onChange:t,parse:ft,min:20,max:ut,defaultValue:200,t:n,labelKey:`theme.longBlockCollapse`,unitText:n(`longBlock.chars`),rangeText:n(`longBlock.range`),resetText:n(`longBlock.reset`,{n:200})})}var oa=[`auto`,`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],sa=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`];function ca(e,t){if(!t||t.length===0)return e;let n=new Set(t);if(n.has(e))return e;let r=sa.indexOf(e);for(let e=r+1;e<sa.length;e++)if(n.has(sa[e]))return sa[e];for(let e=r-1;e>=0;e--)if(n.has(sa[e]))return sa[e];return e}var la={auto:`chat.thinkingUseDefault`,off:`chat.thinkingOff`,minimal:`chat.thinkingMinimal`,low:`chat.thinkingLow`,medium:`chat.thinkingMedium`,high:`chat.thinkingHigh`,xhigh:`chat.thinkingXhigh`,max:`chat.thinkingMax`},ua={off:`var(--text-dim)`,minimal:`var(--text-muted)`,low:`#60a5fa`,medium:`#a78bfa`,high:`#f472b6`,xhigh:`#fb923c`,max:`#ef4444`};function da({value:e,onChange:t,t:n,embedded:r}){let i={value:e,onChange:t,parse:it,min:0,max:rt,defaultValue:0,t:n,labelKey:`theme.autoReloadSeconds`,unitText:n(`autoReload.unit`),rangeText:n(`autoReload.range`),resetText:n(`autoReload.reset`,{n:0})};return r?(0,E.jsx)(Zi,{...i,tooltip:!0,offText:n(`autoReload.off`)}):(0,E.jsx)(Qi,{...i,unitSuffix:`s`,offText:n(`autoReload.off`)})}var fa=Object.defineProperty,pa=(e,t)=>fa(e,`name`,{value:t,configurable:!0});function ma(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}pa(ma,`setRef`);function ha(...e){return t=>{let n=!1,r=e.map(e=>{let r=ma(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():ma(e[t],null)}}}}pa(ha,`composeRefs`);function ga(...e){return d.useCallback(ha(...e),e)}pa(ga,`useComposedRefs`);var _a=Object.defineProperty,va=(e,t)=>_a(e,`name`,{value:t,configurable:!0});function ya(e){let t=d.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Oa(r)&&typeof Ma==`function`&&(r=Ma(r._payload)),d.Children.forEach(r,e=>{if(Ea(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Oa(n)&&typeof Ma==`function`&&(n=Ma(n._payload)),a=Ca(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=d.cloneElement(a,void 0,s):!o&&d.Children.count(r)===1&&d.isValidElement(r)&&(a=r);let c=a?Ta(a):void 0,l=ga(n,c);if(!a){if(r||r===0)throw Error(o?ja(e):Aa(e));return r}let u=wa(i,a.props??{});return a.type!==d.Fragment&&(u.ref=n?l:c),d.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}va(ya,`createSlot`);var ba=ya(`Slot`),xa=Symbol.for(`radix.slottable`);function Sa(e){let t=va(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=xa,t}va(Sa,`createSlottable`);var Ca=va((e,t)=>{if(`child`in e.props){let t=e.props.child;return d.isValidElement(t)?d.cloneElement(t,void 0,e.props.children(t.props.children)):null}return d.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function wa(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}va(wa,`mergeProps`);function Ta(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}va(Ta,`getElementRef`);function Ea(e){return d.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===xa}va(Ea,`isSlottable`);var Da=Symbol.for(`react.lazy`);function Oa(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Da&&`_payload`in e&&ka(e._payload)}va(Oa,`isLazyComponent`);function ka(e){return typeof e==`object`&&!!e&&`then`in e}va(ka,`isPromiseLike`);var Aa=va(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),ja=va(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Ma=d.use,Na=Object.defineProperty,Pa=(e,t)=>Na(e,`name`,{value:t,configurable:!0}),Fa=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=ya(`Primitive.${t}`),r=d.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,E.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ia(e,t){e&&Gi.flushSync(()=>e.dispatchEvent(t))}Pa(Ia,`dispatchDiscreteCustomEvent`);var La=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Ra=Object.defineProperty,za=(e,t)=>Ra(e,`name`,{value:t,configurable:!0});function Ba(e,t){let n=d.createContext(t);n.displayName=e+`Context`;let r=za(e=>{let{children:t,...r}=e,i=d.useMemo(()=>r,Object.values(r));return(0,E.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=d.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return za(i,`useContext`),[r,i]}za(Ba,`createContext`);function Va(e,t=[]){let n=[];function r(t,r){let i=d.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=za(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=d.useMemo(()=>o,Object.values(o));return(0,E.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=d.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return za(s,`useContext`),[o,s]}za(r,`createContext`);let i=za(()=>{let t=n.map(e=>d.createContext(e));return za(function(n){let r=n?.[e]||t;return d.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Ha(i,...t)]}za(Va,`createContextScope`);function Ha(...e){let t=e[0];if(e.length===1)return t;let n=za(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return za(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}za(Ha,`composeContextScopes`);var Ua=Object.defineProperty,Wa=(e,t)=>Ua(e,`name`,{value:t,configurable:!0});function Ga(e){let t=e+`CollectionProvider`,[n,r]=Va(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Wa(e=>{let{scope:t,children:n}=e,r=d.useRef(null),a=d.useRef(new Map).current;return(0,E.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=ya(s),l=d.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=ga(t,a(s,n).collectionRef);return(0,E.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=ya(u),m=d.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=d.useRef(null),s=ga(t,o),c=a(u,n);return d.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,E.jsx)(p,{[f]:``,ref:s,children:r})});m.displayName=u;function h(t){let n=a(e+`CollectionConsumer`,t);return d.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Wa(h,`useCollection`),[{Provider:o,Slot:l,ItemSlot:m},h,r]}Wa(Ga,`createCollection`);var Ka=new WeakMap,qa=class e extends Map{static{Wa(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Ka.set(this,!0)}set(e,t){return Ka.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Xa(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Ja(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Ja(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Ja(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Ja(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Ya(e,t);return n===-1?void 0:e[n]}Wa(Ja,`at`);function Ya(e,t){let n=e.length,r=Xa(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Wa(Ya,`toSafeIndex`);function Xa(e){return e!==e||e===0?0:Math.trunc(e)}Wa(Xa,`toSafeInteger`);function Za(e){let t=e+`CollectionProvider`,[n,r]=Va(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new qa,setItemMap:Wa(()=>void 0,`setItemMap`)}),o=Wa(({state:e,...t})=>e?(0,E.jsx)(c,{...t,state:e}):(0,E.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=Wa(e=>{let t=g();return(0,E.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=Wa(e=>{let{scope:t,children:n,state:r}=e,a=d.useRef(null),[o,s]=d.useState(null),c=ga(a,s),[l,u]=r;return d.useEffect(()=>{if(!o)return;let e=to(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,E.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=ya(l),f=d.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=ga(t,a(l,n).collectionRef);return(0,E.jsx)(u,{ref:i,children:r})});f.displayName=l;let p=e+`CollectionItemSlot`,m=ya(p),h=d.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=d.useRef(null),[s,c]=d.useState(null),l=ga(t,o,c),{setItemMap:u}=a(p,n),f=d.useRef(i);Qa(f.current,i)||(f.current=i);let h=f.current;return d.useEffect(()=>{let e=h;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(eo):(t.set(s,{...e,element:s}),t.toSorted(eo)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new qa(e)))}},[s,h,u]),(0,E.jsx)(m,{"data-radix-collection-item":``,ref:l,children:r})});h.displayName=p;function g(){return d.useState(new qa)}Wa(g,`useInitCollection`);function _(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return Wa(_,`useCollection`),[{Provider:o,Slot:f,ItemSlot:h},{createCollectionScope:r,useCollection:_,useInitCollection:g}]}Wa(Za,`createCollection`);function Qa(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Wa(Qa,`shallowEqual`);function $a(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Wa($a,`isElementPreceding`);function eo(e,t){return!e[1].element||!t[1].element?0:$a(e[1].element,t[1].element)?-1:1}Wa(eo,`sortByDocumentPosition`);function to(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Wa(to,`getChildListObserver`);var no=Object.defineProperty,ro=(e,t)=>no(e,`name`,{value:t,configurable:!0}),io=!!(typeof window<`u`&&window.document&&window.document.createElement);function ao(e,t,{checkForDefaultPrevented:n=!0}={}){return ro(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}ro(ao,`composeEventHandlers`);function oo(e){if(!io)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}ro(oo,`getOwnerWindow`);function so(e){if(!io)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}ro(so,`getOwnerDocument`);function co(e,t=!1){let{activeElement:n}=so(e);if(!n?.nodeName)return null;if(lo(n)&&n.contentDocument)return co(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=so(n).getElementById(e);if(t)return t}}return n}ro(co,`getActiveElement`);function lo(e){return e.tagName===`IFRAME`}ro(lo,`isFrame`);var uo=globalThis?.document?d.useLayoutEffect:()=>{},fo=Object.defineProperty,po=(e,t)=>fo(e,`name`,{value:t,configurable:!0}),mo=d.useEffectEvent,ho=d.useInsertionEffect;function go(e){if(typeof mo==`function`)return mo(e);let t=d.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof ho==`function`?ho(()=>{t.current=e}):uo(()=>{t.current=e}),d.useMemo(()=>((...e)=>t.current?.(...e)),[])}po(go,`useEffectEvent`);var _o=Object.defineProperty,vo=(e,t)=>_o(e,`name`,{value:t,configurable:!0}),yo=d.useInsertionEffect||uo;function bo({prop:e,defaultProp:t,onChange:n=vo(()=>{},`onChange`),caller:r}){let[i,a,o]=xo({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,d.useCallback(t=>{if(s){let n=So(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}vo(bo,`useControllableState`);function xo({defaultProp:e,onChange:t}){let[n,r]=d.useState(e),i=d.useRef(n),a=d.useRef(t);return yo(()=>{a.current=t},[t]),d.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}vo(xo,`useUncontrolledState`);function So(e){return typeof e==`function`}vo(So,`isFunction`);var Co=Symbol(`RADIX:SYNC_STATE`);function wo(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=go(o),u=[{...n,state:a}];r&&u.push(r);let[f,p]=d.useReducer((t,n)=>{if(n.type===Co)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),m=f.state,h=d.useRef(m);d.useEffect(()=>{h.current!==m&&(h.current=m,c||l(m))},[m,h,c]);let g=d.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return d.useEffect(()=>{c&&!Object.is(i,f.state)&&p({type:Co,state:i})},[i,f.state,c]),[g,p]}vo(wo,`useControllableStateReducer`);var To=Object.defineProperty,Eo=(e,t)=>To(e,`name`,{value:t,configurable:!0});function Do(e,t){return d.useReducer((e,n)=>t[e][n]??e,e)}Eo(Do,`useStateMachine`);var Oo=Eo(e=>{let{present:t,children:n}=e,r=ko(t),i=typeof n==`function`?n({present:r.isPresent}):d.Children.only(n),a=jo(r.ref,No(i));return typeof n==`function`||r.isPresent?d.cloneElement(i,{ref:a}):null},`Presence`);function ko(e){let[t,n]=d.useState(),r=d.useRef(null),i=d.useRef(e),a=d.useRef(`none`),o=d.useRef(void 0),[s,c]=Do(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return d.useEffect(()=>{s===`mounted`?(a.current=o.current??Mo(r.current),o.current=void 0):a.current=`none`},[s]),uo(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Mo(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),uo(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Eo(a=>{let o=Mo(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Eo(e=>{e.target===t&&(a.current=Mo(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:d.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Mo(t)}else r.current=null;n(e)},[])}}Eo(ko,`usePresence`);function Ao(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Eo(Ao,`setRef`);function jo(...e){let t=d.useRef(e);return t.current=e,d.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Ao(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Ao(n[e],null)}}},[])}Eo(jo,`useStableComposedRefs`);function Mo(e){return e?.animationName||`none`}Eo(Mo,`getAnimationName`);function No(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Eo(No,`getElementRef`);var Po=Object.defineProperty,Fo=(e,t)=>Po(e,`name`,{value:t,configurable:!0}),Io=d.useId||(()=>void 0),Lo=0;function Ro(e){let[t,n]=d.useState(Io());return uo(()=>{e||n(e=>e??String(Lo++))},[e]),e||(t?`radix-${t}`:``)}Fo(Ro,`useId`);var zo=Object.defineProperty,Bo=(e,t)=>zo(e,`name`,{value:t,configurable:!0}),Vo=`Collapsible`,[Ho,Uo]=Va(Vo),[Wo,Go]=Ho(Vo),Ko=d.forwardRef(Bo(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=bo({prop:r,defaultProp:i??!1,onChange:o,caller:Vo});return(0,E.jsx)(Wo,{scope:n,disabled:a,contentId:Ro(),open:c,onOpenToggle:d.useCallback(()=>l(e=>!e),[l]),children:(0,E.jsx)(Fa.div,{"data-state":Qo(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),qo=`CollapsibleTrigger`,Jo=d.forwardRef(Bo(function(e,t){let{__scopeCollapsible:n,...r}=e,i=Go(qo,n);return(0,E.jsx)(Fa.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Qo(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:ao(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),Yo=`CollapsibleContent`,Xo=d.forwardRef(Bo(function(e,t){let{forceMount:n,...r}=e,i=Go(Yo,e.__scopeCollapsible);return(0,E.jsx)(Oo,{present:n||i.open,children:({present:e})=>(0,E.jsx)(Zo,{...r,ref:t,present:e})})},`CollapsibleContent`)),Zo=d.forwardRef(Bo(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=Go(Yo,n),[s,c]=d.useState(r),l=d.useRef(null),u=ga(t,l),f=d.useRef(0),p=f.current,m=d.useRef(0),h=m.current,g=o.open||s,_=d.useRef(g),v=d.useRef(void 0);return d.useEffect(()=>{let e=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(e)},[]),uo(()=>{let e=l.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();f.current=t.height,m.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),c(r)}},[o.open,r]),(0,E.jsx)(Fa.div,{"data-state":Qo(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!g,...a,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:g&&i})},`CollapsibleContentImpl`));function Qo(e){return e?`open`:`closed`}Bo(Qo,`getState`);var $o=Ko,es=Object.defineProperty,ts=(e,t)=>es(e,`name`,{value:t,configurable:!0}),ns=d.createContext(void 0);function rs(e){let t=d.useContext(ns);return e||t||`ltr`}ts(rs,`useDirection`);var is=Object.defineProperty,as=(e,t)=>is(e,`name`,{value:t,configurable:!0});function os(e){let t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>((...e)=>t.current?.(...e)),[])}as(os,`useCallbackRef`);var ss=Object.defineProperty,cs=(e,t)=>ss(e,`name`,{value:t,configurable:!0}),ls=`dismissableLayer.update`,us=`dismissableLayer.pointerDownOutside`,ds=`dismissableLayer.focusOutside`,fs,ps=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ms=d.forwardRef(cs(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=d.useContext(ps),[f,p]=d.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=d.useState({}),g=ga(t,p),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=f?_.indexOf(f):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=d.useRef(!1),w=_s(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:d.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=vs(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},m),D=f?b===_.length-1:!1,O=os(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return d.useEffect(()=>{if(D)return m.addEventListener(`keydown`,O,{capture:!0}),()=>m.removeEventListener(`keydown`,O,{capture:!0})},[m,D,O]),d.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(fs=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),ys(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(f),u.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=fs))}},[f,m,n,u]),d.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),ys())},[f,u]),d.useEffect(()=>{let e=cs(()=>h({}),`handleUpdate`);return document.addEventListener(ls,e),()=>document.removeEventListener(ls,e)},[]),(0,E.jsx)(Fa.div,{...l,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:ao(e.onFocusCapture,T.onFocusCapture),onBlurCapture:ao(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ao(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function hs(){let e=d.useContext(ps),[t,n]=d.useState(null);return d.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}cs(hs,`useDismissableLayerSurface`);var gs=cs(()=>!0,`IS_TRUE`);function _s(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=gs}=t,s=os(e),c=d.useRef(!1),l=d.useRef(!1),u=d.useRef(new Map),f=d.useRef(()=>{});return d.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}cs(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}cs(t,`isOutsideInteractionIntercepted`);function d(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&f.current()},0)}cs(d,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}cs(p,`handleInteractionBubble`);let m=cs(a=>{if(a.target&&!c.current){let d=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||bs(us,s,p,{discrete:!0})};if(cs(d,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?d():(n.removeEventListener(`click`,f.current),f.current=d,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,d,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,d,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:cs(()=>c.current=!0,`onPointerDownCapture`)}}cs(_s,`usePointerDownOutside`);function vs(e,t=globalThis?.document){let n=os(e),r=d.useRef(!1);return d.useEffect(()=>{let e=cs(e=>{e.target&&!r.current&&bs(ds,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:cs(()=>r.current=!0,`onFocusCapture`),onBlurCapture:cs(()=>r.current=!1,`onBlurCapture`)}}cs(vs,`useFocusOutside`);function ys(){let e=new CustomEvent(ls);document.dispatchEvent(e)}cs(ys,`dispatchUpdate`);function bs(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ia(i,a):i.dispatchEvent(a)}cs(bs,`handleAndDispatchCustomEvent`);var xs=Object.defineProperty,Ss=(e,t)=>xs(e,`name`,{value:t,configurable:!0}),Cs=`focusScope.autoFocusOnMount`,ws=`focusScope.autoFocusOnUnmount`,Ts={bubbles:!1,cancelable:!0},Es=d.forwardRef(Ss(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=d.useState(null),l=os(i),u=os(a),f=d.useRef(null),p=ga(t,c),m=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?f.current=t:Ns(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Ns(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Ns(s)};Ss(e,`handleFocusIn`),Ss(t,`handleFocusOut`),Ss(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,m.paused]),d.useEffect(()=>{if(s){Ps.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Cs,Ts);s.addEventListener(Cs,l),s.dispatchEvent(t),t.defaultPrevented||(Ds(Ls(ks(s)),{select:!0}),document.activeElement===e&&Ns(s))}return()=>{s.removeEventListener(Cs,l),setTimeout(()=>{let t=new CustomEvent(ws,Ts);s.addEventListener(ws,u),s.dispatchEvent(t),t.defaultPrevented||Ns(e??document.body,{select:!0}),s.removeEventListener(ws,u),Ps.remove(m)},0)}}},[s,l,u,m]);let h=d.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Os(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Ns(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Ns(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,E.jsx)(Fa.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})},`FocusScope`));function Ds(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Ns(r,{select:t}),document.activeElement!==n)return}Ss(Ds,`focusFirst`);function Os(e){let t=ks(e);return[As(t,e),As(t.reverse(),e)]}Ss(Os,`getTabbableEdges`);function ks(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Ss(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Ss(ks,`getTabbableCandidates`);function As(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):js(r,{upTo:t})))return r}Ss(As,`findVisible`);function js(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Ss(js,`isHidden`);function Ms(e){return e instanceof HTMLInputElement&&`select`in e}Ss(Ms,`isSelectableInput`);function Ns(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ms(e)&&t&&e.select()}}Ss(Ns,`focus`);var Ps=Fs();function Fs(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Is(e,t),e.unshift(t)},remove(t){e=Is(e,t),e[0]?.resume()}}}Ss(Fs,`createFocusScopesStack`);function Is(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Ss(Is,`arrayRemove`);function Ls(e){return e.filter(e=>e.tagName!==`A`)}Ss(Ls,`removeLinks`);var Rs=Object.defineProperty,zs=d.forwardRef(((e,t)=>Rs(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=d.useState(!1);uo(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Gi.createPortal((0,E.jsx)(Fa.div,{...r,ref:t}),o):null},`Portal`)),Bs=Object.defineProperty,Vs=(e,t)=>Bs(e,`name`,{value:t,configurable:!0}),Hs=0,Us=null;function Ws(e){return Gs(),e.children}Vs(Ws,`FocusGuards`);function Gs(){d.useEffect(()=>{Us||={start:Ks(),end:Ks()};let{start:e,end:t}=Us;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Hs++,()=>{Hs===1&&(Us?.start.remove(),Us?.end.remove(),Us=null),Hs=Math.max(0,Hs-1)}},[])}Vs(Gs,`useFocusGuards`);function Ks(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Vs(Ks,`createFocusGuard`);var qs=function(){return qs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},qs.apply(this,arguments)};function Js(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ys(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Xs=`right-scroll-bar-position`,Zs=`width-before-scroll-bar`,Qs=`with-scroll-bars-hidden`,$s=`--removed-body-scroll-bar-size`;function ec(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function tc(e,t){var n=(0,d.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var nc=typeof window<`u`?d.useLayoutEffect:d.useEffect,rc=new WeakMap;function ic(e,t){var n=tc(t||null,function(t){return e.forEach(function(e){return ec(e,t)})});return nc(function(){var t=rc.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||ec(e,null)}),i.forEach(function(e){r.has(e)||ec(e,a)})}rc.set(n,e)},[e]),n}function ac(e){return e}function oc(e,t){t===void 0&&(t=ac);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function sc(e){e===void 0&&(e={});var t=oc(null);return t.options=qs({async:!0,ssr:!1},e),t}var cc=function(e){var t=e.sideCar,n=Js(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return d.createElement(r,qs({},n))};cc.isSideCarExport=!0;function lc(e,t){return e.useMedium(t),cc}var uc=sc(),dc=function(){},fc=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:dc,onWheelCapture:dc,onTouchMoveCapture:dc}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Js(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=ic([n,t]),w=qs(qs({},x),i);return d.createElement(d.Fragment,null,u&&d.createElement(S,{sideCar:uc,removeScrollBar:l,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?d.cloneElement(d.Children.only(s),qs(qs({},w),{ref:C})):d.createElement(y,qs({},w,{className:c,ref:C}),s))});fc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},fc.classNames={fullWidth:Zs,zeroRight:Xs};var pc=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function mc(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=pc();return t&&e.setAttribute(`nonce`,t),e}function hc(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function gc(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var _c=function(){var e=0,t=null;return{add:function(n){e==0&&(t=mc())&&(hc(t,n),gc(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},vc=function(){var e=_c();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},yc=function(){var e=vc();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},bc={left:0,top:0,right:0,gap:0},xc=function(e){return parseInt(e||``,10)||0},Sc=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[xc(n),xc(r),xc(i)]},Cc=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return bc;var t=Sc(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},wc=yc(),Tc=`data-scroll-locked`,Ec=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
10
+ `).replace(Ud,``)}function Gd(e,t){return t=Wd(t),Wd(e)===t}function Kd(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Wt(e,``+r);break;case`className`:Ot(e,`class`,r);break;case`tabIndex`:Ot(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ot(e,n,r);break;case`style`:qt(e,r,o);break;case`data`:if(t!==`object`){Ot(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Zt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Kd(e,t,`name`,i.name,i,null),Kd(e,t,`formEncType`,i.formEncType,i,null),Kd(e,t,`formMethod`,i.formMethod,i,null),Kd(e,t,`formTarget`,i.formTarget,i,null)):(Kd(e,t,`encType`,i.encType,i,null),Kd(e,t,`method`,i.method,i,null),Kd(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Zt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Qt);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Zt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Md(`beforetoggle`,e),Md(`toggle`,e),Dt(e,`popover`,r);break;case`xlinkActuate`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Dt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Yt.get(n)||n,Dt(e,n,r))}}function qd(e,t,n,r,i,o){switch(n){case`style`:qt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Wt(e,``+r);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Qt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[ot]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Dt(e,n,r)}}}function Jd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Md(`error`,e),Md(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Kd(e,t,o,s,n,null)}}i&&Kd(e,t,`srcSet`,n.srcSet,n,null),r&&Kd(e,t,`src`,n.src,n,null);return;case`input`:Md(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:Kd(e,t,r,d,n,null)}}zt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Md(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Kd(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Vt(e,!!r,n,!0):Vt(e,!!r,t,!1);return;case`textarea`:for(s in Md(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:Kd(e,t,s,c,n,null)}Ut(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Kd(e,t,l,r,n,null)}return;case`dialog`:Md(`beforetoggle`,e),Md(`toggle`,e),Md(`cancel`,e),Md(`close`,e);break;case`iframe`:case`object`:Md(`load`,e);break;case`video`:case`audio`:for(r=0;r<kd.length;r++)Md(kd[r],e);break;case`image`:Md(`error`,e),Md(`load`,e);break;case`details`:Md(`toggle`,e);break;case`embed`:case`source`:case`link`:Md(`error`,e),Md(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Kd(e,t,u,r,n,null)}return;default:if(Jt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&qd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Kd(e,t,c,r,n,null))}function Yd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Kd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&Kd(e,t,p,m,r,f)}}Rt(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Kd(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Kd(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Vt(e,!!n,n?[]:``,!1):Vt(e,!!n,t,!0)):Vt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Kd(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&Kd(e,t,s,i,r,o)}Ht(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Kd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Kd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Kd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:Kd(e,t,u,p,r,m)}return;default:if(Jt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&qd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||qd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Kd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Kd(e,t,f,p,r,m)}function Xd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Zd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Xd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Xd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Qd=null,$d=null;function ef(e){return e.nodeType===9?e:e.ownerDocument}function tf(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function nf(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function rf(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var af=null;function of(){var e=window.event;return e&&e.type===`popstate`?e!==af&&(af=e,!0):(af=null,!1)}var sf=typeof setTimeout==`function`?setTimeout:void 0,cf=typeof clearTimeout==`function`?clearTimeout:void 0,lf=typeof Promise==`function`?Promise:void 0,uf=typeof queueMicrotask==`function`?queueMicrotask:lf===void 0?sf:function(e){return lf.resolve(null).then(e).catch(df)};function df(e){setTimeout(function(){throw e})}function ff(e){return e===`head`}function pf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),qp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Df(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Df(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ft]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Df(e.ownerDocument.body)}n=i}while(n);qp(t)}function mf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function hf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:hf(n),pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function gf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[ft])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=Sf(e.nextSibling),e===null)break}return null}function _f(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Sf(e.nextSibling),e===null))return null;return e}function vf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=Sf(e.nextSibling),e===null))return null;return e}function yf(e){return e.data===`$?`||e.data===`$~`}function bf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function xf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function Sf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var Cf=null;function wf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return Sf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Tf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Ef(e,t,n){switch(t=ef(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Df(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);pt(e)}var Of=new Map,kf=new Set;function Af(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var jf=I.d;I.d={f:Mf,r:Nf,D:If,C:Lf,L:Rf,m:zf,X:Vf,S:Bf,M:Hf};function Mf(){var e=jf.f(),t=ju();return e||t}function Nf(e){var t=ht(e);t!==null&&t.tag===5&&t.type===`form`?As(t):jf.r(e)}var Pf=typeof document>`u`?null:document;function Ff(e,t,n){var r=Pf;if(r&&typeof t==`string`&&t){var i=Lt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),kf.has(i)||(kf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Jd(t,`link`,e),vt(t),r.head.appendChild(t)))}}function If(e){jf.D(e),Ff(`dns-prefetch`,e,null)}function Lf(e,t){jf.C(e,t),Ff(`preconnect`,e,t)}function Rf(e,t,n){jf.L(e,t,n);var r=Pf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Lt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Lt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Lt(n.imageSizes)+`"]`)):i+=`[href="`+Lt(e)+`"]`;var a=i;switch(t){case`style`:a=Wf(e);break;case`script`:a=Jf(e)}Of.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Of.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Gf(a))||t===`script`&&r.querySelector(Yf(a))||(t=r.createElement(`link`),Jd(t,`link`,e),vt(t),r.head.appendChild(t)))}}function zf(e,t){jf.m(e,t);var n=Pf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Lt(r)+`"][href="`+Lt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Jf(e)}if(!Of.has(a)&&(e=h({rel:`modulepreload`,href:e},t),Of.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Yf(a)))return}r=n.createElement(`link`),Jd(r,`link`,e),vt(r),n.head.appendChild(r)}}}function Bf(e,t,n){jf.S(e,t,n);var r=Pf;if(r&&e){var i=_t(r).hoistableStyles,a=Wf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Gf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Of.get(a))&&Qf(e,n);var c=o=r.createElement(`link`);vt(c),Jd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Vf(e,t){jf.X(e,t);var n=Pf;if(n&&e){var r=_t(n).hoistableScripts,i=Jf(e),a=r.get(i);a||(a=n.querySelector(Yf(i)),a||(e=h({src:e,async:!0},t),(t=Of.get(i))&&$f(e,t),a=n.createElement(`script`),vt(a),Jd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hf(e,t){jf.M(e,t);var n=Pf;if(n&&e){var r=_t(n).hoistableScripts,i=Jf(e),a=r.get(i);a||(a=n.querySelector(Yf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=Of.get(i))&&$f(e,t),a=n.createElement(`script`),vt(a),Jd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Uf(e,t,n,r){var i=(i=z.current)?Af(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Wf(n.href),n=_t(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Wf(n.href);var o=_t(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Gf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Of.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Of.set(e,n),o||qf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Jf(n),n=_t(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Wf(e){return`href="`+Lt(e)+`"`}function Gf(e){return`link[rel="stylesheet"][`+e+`]`}function Kf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function qf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Jd(t,`link`,n),vt(t),e.head.appendChild(t))}function Jf(e){return`[src="`+Lt(e)+`"]`}function Yf(e){return`script[async]`+e}function Xf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Lt(n.href)+`"]`);if(r)return t.instance=r,vt(r),r;var i=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),vt(r),Jd(r,`style`,i),Zf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Wf(n.href);var o=e.querySelector(Gf(i));if(o)return t.state.loading|=4,t.instance=o,vt(o),o;r=Kf(n),(i=Of.get(i))&&Qf(r,i),o=(e.ownerDocument||e).createElement(`link`),vt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Jd(o,`link`,r),t.state.loading|=4,Zf(o,n.precedence,e),t.instance=o;case`script`:return o=Jf(n.src),(i=e.querySelector(Yf(o)))?(t.instance=i,vt(i),i):(r=n,(i=Of.get(o))&&(r=h({},n),$f(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),vt(i),Jd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Zf(r,n.precedence,e));return t.instance}function Zf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function $f(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var ep=null;function tp(e,t,n){if(ep===null){var r=new Map,i=ep=new Map;i.set(n,r)}else i=ep,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ft]||a[at]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function np(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function rp(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function ip(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ap(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Wf(r.href),a=t.querySelector(Gf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=cp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,vt(a);return}a=t.ownerDocument||t,r=Kf(r),(i=Of.get(i))&&Qf(r,i),a=a.createElement(`link`),vt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Jd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=cp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var op=0;function sp(e,t){return e.stylesheets&&e.count===0&&up(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&up(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&op===0&&(op=62500*Zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&up(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>op?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function cp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)up(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var lp=null;function up(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,lp=new Map,t.forEach(dp,e),lp=null,cp.call(e))}function dp(e,t){if(!(t.state.loading&4)){var n=lp.get(e);if(n)var r=n.get(null);else{n=new Map,lp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=cp.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var fp={$$typeof:C,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function pp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Je(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Je(0),this.hiddenUpdates=Je(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function mp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new pp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=si(3,null,null,t),e.current=a,a.stateNode=e,t=ca(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Va(a),e}function hp(e){return e?(e=ai,e):ai}function gp(e,t,n,r,i,a){i=hp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ua(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Wa(e,r,t),n!==null&&(Eu(n,e,t),Ga(n,e,t))}function _p(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vp(e,t){_p(e,t),(e=e.alternate)&&_p(e,t)}function yp(e){if(e.tag===13||e.tag===31){var t=ni(e,67108864);t!==null&&Eu(t,e,67108864),vp(e,67108864)}}function bp(e){if(e.tag===13||e.tag===31){var t=wu();t=et(t);var n=ni(e,t);n!==null&&Eu(n,e,t),vp(e,t)}}var xp=!0;function Sp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,wp(e,t,n,r)}finally{I.p=a,F.T=i}}function Cp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,wp(e,t,n,r)}finally{I.p=a,F.T=i}}function wp(e,t,n,r){if(xp){var i=Tp(r);if(i===null)Ld(e,t,r,Ep,n),Lp(e,r);else if(zp(i,e,t,n,r))r.stopPropagation();else if(Lp(e,r),t&4&&-1<Ip.indexOf(e)){for(;i!==null;){var a=ht(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ue(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ie(o);s.entanglements[1]|=c,o&=~c}hd(a),!(Gl&6)&&(fu=we()+500,gd(0,!1))}}break;case 31:case 13:s=ni(a,2),s!==null&&Eu(s,a,2),ju(),vp(a,2)}if(a=Tp(r),a===null&&Ld(e,t,r,Ep,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ld(e,t,r,null,n)}}function Tp(e){return e=en(e),Dp(e)}var Ep=null;function Dp(e){if(Ep=null,e=mt(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ep=e,null}function Op(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Te()){case Ee:return 2;case De:return 8;case Oe:case ke:return 32;case Ae:return 268435456;default:return 32}default:return 32}}var kp=!1,Ap=null,jp=null,Mp=null,Np=new Map,Pp=new Map,Fp=[],Ip=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Lp(e,t){switch(e){case`focusin`:case`focusout`:Ap=null;break;case`dragenter`:case`dragleave`:jp=null;break;case`mouseover`:case`mouseout`:Mp=null;break;case`pointerover`:case`pointerout`:Np.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Pp.delete(t.pointerId)}}function Rp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ht(t),t!==null&&yp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function zp(e,t,n,r,i){switch(t){case`focusin`:return Ap=Rp(Ap,e,t,n,r,i),!0;case`dragenter`:return jp=Rp(jp,e,t,n,r,i),!0;case`mouseover`:return Mp=Rp(Mp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Np.set(a,Rp(Np.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Pp.set(a,Rp(Pp.get(a)||null,e,t,n,r,i)),!0}return!1}function Bp(e){var t=mt(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,rt(e.priority,function(){bp(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,rt(e.priority,function(){bp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Vp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);$t=r,n.target.dispatchEvent(r),$t=null}else return t=ht(n),t!==null&&yp(t),e.blockedOn=n,!1;t.shift()}return!0}function Hp(e,t,n){Vp(e)&&n.delete(t)}function Up(){kp=!1,Ap!==null&&Vp(Ap)&&(Ap=null),jp!==null&&Vp(jp)&&(jp=null),Mp!==null&&Vp(Mp)&&(Mp=null),Np.forEach(Hp),Pp.forEach(Hp)}function Wp(e,n){e.blockedOn===n&&(e.blockedOn=null,kp||(kp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Up)))}var Gp=null;function Kp(e){Gp!==e&&(Gp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Gp===e&&(Gp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Dp(r||n)===null)continue;break}var a=ht(n);a!==null&&(e.splice(t,3),t-=3,Os(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function qp(e){function t(t){return Wp(t,e)}Ap!==null&&Wp(Ap,e),jp!==null&&Wp(jp,e),Mp!==null&&Wp(Mp,e),Np.forEach(t),Pp.forEach(t);for(var n=0;n<Fp.length;n++){var r=Fp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Fp.length&&(n=Fp[0],n.blockedOn===null);)Bp(n),n.blockedOn===null&&Fp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ot]||null;if(typeof a==`function`)o||Kp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ot]||null)s=o.formAction;else if(Dp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Kp(n)}}}function Jp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Yp(e){this._internalRoot=e}Xp.prototype.render=Yp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;gp(n,wu(),e,t,null,null)},Xp.prototype.unmount=Yp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gp(e.current,2,null,e,null,null),ju(),t[st]=null}};function Xp(e){this._internalRoot=e}Xp.prototype.unstable_scheduleHydration=function(e){if(e){var t=nt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Fp.length&&t!==0&&t<Fp[n].priority;n++);Fp.splice(n,0,e),n===0&&Bp(e)}};var Zp=n.version;if(Zp!==`19.2.8`)throw Error(a(527,Zp,`19.2.8`));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var Qp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var $p=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$p.isDisabled&&$p.supportsFiber)try{Ne=$p.inject(Qp),Pe=$p}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(a(299));var n=!1,r=``,i=Zs,o=Qs,c=$s;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=mp(e,1,!1,null,null,n,r,null,i,o,c,Jp),e[st]=t.current,Fd(e),new Yp(t)}})),u=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=l()})),d=t(i(),1),f=u(),p={xs:10,sm:11,base:12,lg:13,xl:14,"2xl":15,"3xl":16,"4xl":18,"5xl":20};function m(e,t={}){return e.replace(/\{([\w.-]+)\}/g,(e,n)=>{let r=t[n];return r===void 0?e:String(r)})}function h(e,t,n,r={}){let i=n[e]?.[t]??n.en?.[t];return i===void 0?t:m(i,r)}function g(e,t,n=new Date){let r=(e instanceof Date?e:new Date(e)).getTime()-n.getTime(),i=Math.abs(r),[a,o]=i<6e4?[`second`,1e3]:i<36e5?[`minute`,6e4]:i<864e5?[`hour`,36e5]:[`day`,864e5],s=Math.round(r/o);return new Intl.RelativeTimeFormat(t,{numeric:`always`}).format(s,a)}var _={id:`en`,label:`English`,messages:{"common.ok":`OK`,"common.language":`Language`,"common.models":`Models`,"common.skills":`Skills`,"common.plugins":`Plugins`,"sidebar.hide":`Collapse sidebar`,"sidebar.show":`Expand sidebar`,"theme.light":`Switch to light mode`,"preferences.defaultThinkingLevel":`Default thinking level`,"preferences.thinkingLevelHint":"Global default for new sessions (settings.json `defaultThinkingLevel`). Not set = field removed, falls back to pi default.","preferences.thinkingLevelNotSet":`Not set (use model default)`,"preferences.compaction":`Auto compaction`,"preferences.compactionHint":"Automatically compact long sessions (settings.json `compaction`). When not configured the pi defaults are shown; any edit writes the full object.","preferences.compactionEnabled":`Enabled`,"preferences.compactionReserveTokens":`Reserve tokens`,"preferences.compactionReserveTokensHint":`Tokens reserved for model output, keeping reply space after compaction`,"preferences.compactionKeepRecentTokens":`Keep recent tokens`,"preferences.compactionKeepRecentTokensHint":`Tokens kept after compaction, counted backwards from the most recent messages`,"preferences.retry":`API retry`,"preferences.retryHint":"Retry settings for provider API calls (settings.json `retry`). When not configured the pi defaults are shown; any edit writes the full object. Provider sub-fields left empty are not written.","preferences.retryEnabled":`Enabled`,"preferences.retryEnabledHint":`Enable retries for failed API calls`,"preferences.retryMaxRetries":`Max retries`,"preferences.retryBaseDelayMs":`Base delay (ms)`,"preferences.retryBaseDelayMsHint":`Initial delay before the first retry, in milliseconds`,"preferences.retryProviderTimeoutMs":`Provider timeout (ms)`,"preferences.retryProviderMaxRetries":`Provider max retries`,"preferences.retryProviderMaxRetryDelayMs":`Provider max delay (ms)`,"preferences.defaultProjectTrust":`Default project trust`,"preferences.projectTrustHint":"Default trust for new projects (settings.json `defaultProjectTrust`). Not set = field removed (falls back to ask).","preferences.projectTrustNotSet":`Not set (ask)`,"preferences.projectTrustAsk":`Ask`,"preferences.projectTrustAlways":`Always trust`,"preferences.projectTrustNever":`Never trust`,"preferences.notifyEvents":`Notifications`,"preferences.notifyEventsHint":`Browser notifications when the tab is not active. Permission is requested on first interaction.`,"notify.permission.request":`Enable notifications`,"notify.permission.requestHint":`Click to enable browser notifications — you'll be alerted when a task finishes even if this tab is in the background`,"notify.permission.granted":`Notifications on`,"notify.permission.grantedHint":`Browser notifications are enabled — you'll be alerted when a task finishes even if this tab is in the background`,"notify.permission.bannerHintBefore":`Click the`,"notify.permission.bannerHintAfter":`button in the top-left toolbar to enable notifications — you'll be alerted when a task completes, errors, or asks a question. Fine-tune in Config Center → Session → Notifications`,"notify.permission.denied":`Notifications blocked`,"notify.permission.deniedHint":`Notifications are blocked by the browser. Click the icon next to the address bar → Site settings, switch notifications to Allow, then try again`,"preferences.notifyWhileActive":`Notify while page active`,"preferences.notifyTaskComplete":`Task complete`,"preferences.notifyErrors":`Errors`,"preferences.notifyQuestions":`Questions`,"preferences.subagentsDefaultModel":`Subagent default model`,"preferences.subagentsDefaultThinking":`Subagent default thinking level`,"preferences.subagentsHint":"Defaults for subagents (settings.json `subagents`). defaultThinking not set = sub-field removed (falls back to pi default).","preferences.subagentsModelPlaceholder":`provider/model-id`,"theme.dark":`Switch to dark mode`,"theme.toggleTheme":`Switch theme`,"theme.darkMode":`Dark`,"theme.lightMode":`Light`,"theme.fontSize":`Font size`,"theme.scrollStep":`Hover scroll step`,"scrollStep.hint":`Pixels scrolled per hover tick on the edge scroll arrows (shared by the panel scroll arrows and the minimap).`,"scrollStep.range":`per hover tick (1-1000)`,"scrollStep.unit":`px`,"theme.autoReloadSeconds":`Auto-reload chat messages interval`,"autoReload.off":`Off (0) — do not auto-reload`,"autoReload.range":`seconds (0 — 3600)`,"autoReload.unit":`s`,"autoReload.hint":`Interval in seconds for re-reading the session file; 0 = off. Keep 0 for single-client use (messages arrive via SSE in real time); set it above 0 for multi-client collaboration (several browsers on the same session) so each client refreshes periodically and picks up chat messages generated by the others.`,"longBlock.hint":`“Blocks” are thinking and tool calls. Bodies beyond the threshold collapse to a head/tail digest; click to expand the full text.`,"recentBlocks.hint":`Streaming blocks and the just-completed block are not counted (the newest completed block always stays expanded). This is how many additional recent completed blocks stay expanded.`,"autoReload.reset":`Reset to default ({n} s)`,"chat.reloadFromDisk":`Reload session from disk`,"chat.reloadFromDiskHint":`Use when multiple clients read/write the same session jsonl at the same time. You can set automatic timed reloading under Config Center → Session.`,"scrollStep.reset":`Reset to default ({n} px)`,"theme.longBlockCollapse":`Long block collapse`,"theme.recentBlocksExpanded":`Recent completed blocks kept expanded`,"layout.sidebarWidth":`Left panel width`,"layout.widgetPanelWidth":`Right panel width`,"layout.widthRange":`px ({min}–{max})`,"layout.widthReset":`Reset to default ({value} px)`,"longBlock.range":`chars (20-10000)`,"longBlock.chars":`chars`,"longBlock.blocks":`blocks`,"longBlock.reset":`Reset to default ({n} chars)`,"recentBlocks.reset":`Reset to default ({n})`,"recentBlocks.range":`0-20, excludes the newest completed block`,"longBlock.expandHint":`… {n} chars folded · click to expand`,"longBlock.collapse":`Click to collapse`,"history.full":`Full history`,"history.unsaved":`Full history is available after the session is saved`,"title.generating":`Generating...`,"title.updated":`Title updated`,"title.failed":`Generation failed`,"title.generate":`Generate title`,"title.unsaved":`Title generation is available after the session is saved`,"title.noMessages":`Send a message before naming this session`,"title.generateSession":`Generate a session title`,"system.prompt":`System prompt`,"system.empty":`System prompt is empty (tools are disabled)`,"system.load":`Send a message to load the system prompt`,"session.info":`Session info`,"session.reload":`Reload session (re-read config and resources)`,"session.name":`Name`,"session.file":`File`,"session.inMemory":`In-memory`,"session.id":`ID`,"session.user":`User`,"session.assistant":`Assistant`,"session.toolCalls":`Tool Calls`,"session.toolResults":`Tool Results`,"session.total":`Total`,"session.input":`Input`,"session.output":`Output`,"session.cacheRead":`Cache Read`,"session.cacheWrite":`Cache Write`,"session.inputHint":`Prompt tokens NOT served from cache: system prompt, history and tool definitions sent to the model, minus the cached portion`,"session.outputHint":`Tokens generated by the model (answers and thinking)`,"session.cacheReadHint":`Tokens served from prompt cache: unchanged context re-read from the previous request at a discounted rate`,"session.cacheWriteHint":`Tokens written to cache for the first time (billed on write, Anthropic-style)`,"session.totalHint":`input + output + cacheRead + cacheWrite`,"session.cacheReadRate":`Cache hit rate: cache-read tokens as a share of all input prompt tokens (input + cacheRead + cacheWrite), the official formula cacheRead / (input + cacheRead + cacheWrite)`,"session.cost":`Cost`,"session.context":`Context`,"session.copy":`Copy {value}`,"session.copied":`Copied`,"session.title":`Session info`,"session.load":`Send a message or run /session to load session info`,"session.infoSection":`Session Info`,"session.messages":`Messages`,"session.tokens":`Tokens`,"session.copyFile":`Copy file path`,"session.copyId":`Copy session ID`,"workspace.opening":`Opening workspace...`,"workspace.unable":`Unable to open workspace`,"workspace.selectSession":`Select a session from the sidebar`,"workspace.selectWorkspace":`Please select a workspace`,"workspace.stepProject":`Select a project directory from the sidebar`,"workspace.stepModels":`Add models via the Models button at the bottom`,"tabs.chat":`Chat`,"tabs.widgets":`Widgets`,"config.title":`Settings`,"config.section.session":`Session`,"config.section.appearance":`Appearance`,"config.section.advanced":`Advanced`,"config.section.startScreen":`Start screen`,"config.section.git":`Git`,"config.section.updates":`Updates`,"config.section.modelThinking":`Thinking Levels`,"config.section.requiresCwd":`Select a project directory from the sidebar first to browse plugins / skills`,"updates.check":`Check for updates`,"updates.checking":`Checking…`,"updates.checkedAt":`Last checked`,"updates.upToDate":`Up to date`,"updates.updateAvailable":`Update available`,"updates.unavailable":`Check failed`,"updates.noPluginUpdates":`All plugins are up to date`,"updates.banner":`Update available: {items}`,"updates.view":`View`,"updates.copied":`Copied`,"updates.copyCommand":`Copy command`,"updates.restartNote":`Also upgrades the bundled pi SDK; restart pi-web to load it.`,"updates.enableChecking":`Enable update checks`,"updates.disabled":`Update checks disabled`,"updates.ignoreVersion":`Ignore this version`,"updates.ignored":`Ignored {version}`,"updates.ignoredPlugin":`Ignored`,"updates.unignore":`Unignore`,"preferences.pi.unset":`pi default`,"preferences.pi.enableAnalytics":`Enable analytics`,"preferences.pi.enableAnalyticsHint":"Send anonymous usage analytics (settings.json `enableAnalytics`)","preferences.pi.enableInstallTelemetry":`Enable install telemetry`,"preferences.pi.enableInstallTelemetryHint":"Send anonymous install telemetry (settings.json `enableInstallTelemetry`)","preferences.pi.httpProxy":`HTTP proxy`,"preferences.pi.httpProxyHint":"Proxy URL for HTTP requests (settings.json `httpProxy`). Empty input cannot clear an already-set value.","preferences.pi.trackingId":`Analytics tracking ID`,"preferences.pi.trackingIdHint":"Custom analytics tracking ID (settings.json `trackingId`). Empty input cannot clear an already-set value.","preferences.pi.httpIdleTimeoutMs":`HTTP idle timeout (ms)`,"preferences.pi.httpIdleTimeoutMsHint":"HTTP idle timeout in ms (settings.json `httpIdleTimeoutMs`). Empty input cannot clear an already-set value.","preferences.pi.websocketConnectTimeoutMs":`WebSocket connect timeout (ms)`,"preferences.pi.websocketConnectTimeoutMsHint":"WebSocket connect timeout in ms (settings.json `websocketConnectTimeoutMs`). Empty input cannot clear an already-set value.","preferences.pi.branchSummary":`Branch summary`,"preferences.pi.branchSummaryHint":"Branch summary auto-compaction (settings.json `branchSummary`)","preferences.pi.reserveTokens":`Reserve tokens`,"preferences.pi.skipPrompt":`Skip prompt`,"preferences.pi.images":`Image handling`,"preferences.pi.imagesHint":"How the pi engine handles images (settings.json `images`)","preferences.pi.autoResize":`Auto-resize`,"preferences.pi.autoResizeHint":"Downscale images returned by tools such as `read` to save tokens.","preferences.pi.blockImages":`Block images`,"preferences.pi.blockImagesHint":`Strip all image content from messages before they reach the model.`,"config.files.hint":`Edit pi's config files (JSON) directly. Validated before save; backed up automatically (last 10 kept).`,"config.widgets.empty":`No widget configurations yet. Widgets appear here automatically when an extension pops one up.`,"config.widgets.x":`x`,"config.widgets.y":`y`,"config.widgets.width":`w`,"config.widgets.height":`h`,"config.widgets.bind":`Bind message`,"config.widgets.bindTitle":`Bind custom message`,"config.widgets.bindHint":`Bind a quick message to widget "{key}"`,"config.widgets.editTitle":`Edit quick message`,"config.widgets.editHint":`Edit the label, content, and send mode.`,"config.widgets.label":`Label`,"config.widgets.labelPlaceholder":`Button text (e.g. Reload)`,"config.widgets.message":`Message`,"config.widgets.messagePlaceholder":`A slash command or any text (e.g. /reload)`,"config.widgets.messageTooltip":`Type / to see built-in, global plugin and Skill commands. Project-level plugin commands won't appear in suggestions but can still be entered and saved manually.`,"config.widgets.sendImmediately":`Send immediately`,"config.widgets.sendMode":`Send mode`,"config.widgets.fillToChatInput":`Fill into chat input`,"config.widgets.sendImmediatelyTooltip":`Send immediately: `,"config.widgets.fillToChatInputTooltip":`Fill into chat input: `,"config.widgets.nameConflict":`Name "{label}" already exists, please use another`,"config.startScreen.nameConflict":`Name "{label}" already exists, please use another`,"config.startScreen.hint":`Quick actions shown on the new-session start screen (below the Pi logo); clicking sends the message immediately or fills it into the chat input, depending on each entry's send mode.`,"config.startScreen.bind":`Bind message`,"config.startScreen.bindTitle":`Bind quick message`,"config.startScreen.bindHint":`Bind a quick message to the start screen.`,"config.startScreen.empty":`No quick messages yet; the start screen will show no quick actions.`,"config.startScreen.unbindTitle":`Unbind message`,"config.startScreen.unbindConfirm":`Unbind "{label}"?`,"config.startScreen.unbind":`Unbind`,"config.widgets.confirm":`Confirm`,"config.widgets.unbindTitle":`Unbind message`,"config.widgets.unbindConfirm":`Unbind "{label}"?`,"config.widgets.unbind":`Unbind`,"config.startScreen.editTitle":`Edit quick message`,"config.startScreen.editHint":`Edit the label, content, and send mode.`,"config.startScreen.reset":`Reset`,"config.startScreen.resetHint":`Restore the built-in default quick messages; keep your own bound messages (ones with the same label as a default are replaced by the default).`,"config.files.save":`Save`,"config.files.saving":`Saving...`,"config.files.saved":`Saved`,"config.files.missing":`Not created yet`,"config.files.placeholder":`Select a config file from the list on the left`,"layout.resizeSidebar":`Resize sidebar`,"layout.resizeWidgetPanel":`Resize widgets panel`,"layout.resizeHint":`Drag to resize. Double-click or press Enter to reset.`,"sidebar.newWorkspace":`New workspace`,"sidebar.searchSessions":`Search sessions`,"sidebar.searchSessionsPlaceholder":`Search sessions…`,"sidebar.justNow":`just now`,"sidebar.minutesAgo":`{count}m ago`,"sidebar.hoursAgo":`{count}h ago`,"sidebar.daysAgo":`{count}d ago`,"sidebar.searchSessionsNoResults":`No matching sessions`,"sidebar.newSessionTitle":`New session in {path}`,"sidebar.refresh":`Refresh`,"directoryPicker.selectDirectory":`Select directory`,"directoryPicker.goToParent":`Go to parent directory`,"directoryPicker.directoryPath":`Directory path`,"directoryPicker.goToDirectory":`Go to directory`,"directoryPicker.go":`Go`,"directoryPicker.loadingDirectories":`Loading directories…`,"directoryPicker.noSubdirectories":`No subdirectories`,"directoryPicker.openBeforeSelecting":`Open this path before selecting it`,"directoryPicker.selectCurrentDirectory":`Select current directory`,"directoryPicker.selectThisFolder":`Select this folder`,"directoryPicker.noDrives":`No drives found`,"directoryPicker.search":`Filter folders`,"directoryPicker.noMatches":`No folders match your filter`,"sidebar.checking":`Checking…`,"sidebar.open":`Open`,"sidebar.cancel":`Cancel`,"sidebar.openRepoRoot":`Worktree switch unavailable`,"sidebar.openRepoRootTitle":`Worktree switching is unavailable here — switch the current working directory to the Git repository root first (from the sidebar).`,"sidebar.gitRepoRootOnly":`Git repo root only`,"sidebar.gitRepoRootOnlyTitle":`Worktrees are available in Git repository roots.`,"sidebar.worktrees":`Worktrees...`,"sidebar.checkingWorktrees":`Checking worktrees for this directory.`,"sidebar.filterWorktrees":`Filter worktrees…`,"sidebar.noMatchingWorktrees":`No matching worktrees`,"sidebar.switchWorktree":`Switch worktree`,"sidebar.switchWorktreeTitle":`Switch worktree: {path}`,"sidebar.main":`main`,"sidebar.forceRemoveCheckout":`Uncommitted changes. Force remove checkout?`,"sidebar.force":`Force`,"sidebar.createWorktreeTitle":`Create a worktree checkout for a branch`,"sidebar.newWorktree":`New worktree…`,"sidebar.branchName":`branch name`,"sidebar.creating":`Creating…`,"sidebar.create":`Create`,"sidebar.uploadFilesTitle":`Upload files to project root`,"sidebar.uploadFiles":`Upload files`,"sidebar.refreshExplorer":`Refresh explorer`,"sidebar.changedFiles":`{count} changed files`,"sidebar.loading":`Loading...`,"sidebar.sessionDeleted":`Session deleted — pick another session`,"sidebar.noSessions":`No sessions found`,"sidebar.workspace":`Workspace`,"sidebar.newActivity":`New activity`,"sidebar.newSessionActivity":`New session activity`,"sidebar.interactionBadge":`Session waiting for interaction`,"sidebar.deleteSession":`Delete {title}?`,"sidebar.deleteWorkspace":`Delete workspace ({count} sessions)?`,"sidebar.deleteWorkspaceTitle":`Delete this workspace and all its sessions`,"sidebar.copyPath":`Copy full path`,"sidebar.rename":`Rename`,"sidebar.delete":`Delete`,"sidebar.deleteWithShiftClick":`Delete (Shift+click to delete without confirmation)`,"sidebar.expandForks":`Expand forks`,"sidebar.collapseForks":`Collapse forks`,"sidebar.disconnect":`Disconnect`,"sidebar.messagesCount":`{count} msgs`,"sidebar.worktreePath":`Worktree: {path}`,"sidebar.removeWorktreeTitle":`Remove worktree checkout {path}; the branch is kept`,"files.modified":`Modified`,"files.added":`Added`,"files.deleted":`Deleted`,"files.renamed":`Renamed`,"files.untracked":`Untracked`,"files.conflict":`Conflict`,"files.newlyUploaded":`Newly uploaded`,"files.containsChangedFiles":`Contains changed files`,"files.insertPath":`Insert path into chat`,"files.mention":`mention`,"files.download":`Download file`,"files.dismissError":`Dismiss error`,"files.addUploadedFile":`Add uploaded file to chat`,"files.addAllUploadedFiles":`Add all uploaded files to chat`,"files.openInSystemApp":`Open with system app`,"files.chooseOtherApp":`Choose another app…`,"files.openLaunched":`Launched with the system app`,"files.fileTooLargeForPreview":`File too large for preview (>{limit})`,"files.docTooLargeForPreview":`DOCX too large for preview (>{limit})`,"files.dismissUploadResults":`Dismiss upload results`,"files.loading":`Loading files...`,"files.noFiles":`No files found`,"loading.inProgress":`Working…`,"loading.more":`{count} more…`,"errors.title":`Error`,"errors.titleCount":`Errors ({count})`,"errors.close":`Close`,"errors.clearAll":`Clear all`,"files.notFound":`Not found`,"files.accessDenied":`Access denied`,"files.empty":`Empty`,"files.uploadFailed":`{count} failed`,"files.explorer":`Explorer`,"files.changedCount":`{count} files`,"files.stagedPrefix":`Staged: `,"files.unstagedPrefix":`Unstaged: `,"files.noStagedChanges":`No staged files`,"files.noUnstagedChanges":`No unstaged changes`,"files.commitMessagePlaceholder":`Commit message`,"files.commit":`Commit`,"files.push":`Push to remote (with tags)`,"files.pushing":`Pushing...`,"files.pushSuccess":`Push succeeded`,"files.pushFailed":`Push failed`,"files.pushUpToDate":`Already up to date — nothing to push`,"files.pull":`Pull from remote`,"files.pulling":`Pulling...`,"files.pullSuccess":`Pull succeeded`,"files.pullFailed":`Pull failed`,"files.pullUpToDate":`Already up to date — nothing to pull`,"files.pullNonFastForward":`Pull rejected — local and remote have diverged. Use git pull --rebase or --merge in terminal.`,"files.committing":`Committing…`,"files.commitMessageRequired":`Enter a commit message first`,"files.commitTitle":`Commit changes`,"files.confirmStageAllCommit":`{count} changed files are not staged. Stage them all and commit?`,"files.stageAllAndCommit":`Stage & commit`,"files.stageFile":`Stage file`,"files.unstageFile":`Unstage file`,"files.changeStats":`{count} changed files, {additions} lines added, {deletions} lines deleted`,"git.autoFetchInterval":`Auto fetch interval (seconds)`,"git.autoFetchIntervalHint":`How often the server fetches remotes for active session workspaces (shared by all clients). 0 disables the timer — one fetch runs when a session connects.`,"git.groupTitle":`Smart Commit Message Generation`,"git.commitModel.followCurrent":`Follow current session model`,"git.commitModel.followCurrentHint":`When on, the commit generation follows the current chat's main model. When off, the fixed model below is used (recommended for a cheap dedicated model).`,"git.commitModel.followCurrentOn":`On: follow current session`,"git.commitModel.followCurrentOff":`Off: use fixed model`,"git.commitModel.fixedModel":`Fixed model`,"git.commitModel.fixedModelHint":`Model used when "follow current session" is off (choose a cheap fixed model; note it may have only ~50k context).`,"git.commitModel.selectPlaceholder":`Select a model`,"git.commitModel.noModels":`No models available`,"git.commitModel.notConfiguredHint":`No fixed model selected. Pick a model before using AI generate.`,"git.ai.generate":`Smart generate`,"git.ai.generating":`Generating…`,"git.ai.notConfiguredTitle":`Model not configured`,"git.ai.notConfiguredDesc":`No model is set for Smart generate. Go to Config Center → Git to set one.`,"git.ai.goToConfig":`Go to settings`,"git.ai.noSession":`Follow-current mode requires an active session`,"git.ai.noSessionModel":`Current session has no model. Select a model in chat first`,"git.commitModel.maxTokens":`Max output tokens`,"git.commitModel.maxTokensHint":`Max output tokens for one generation (64–4096, default 512). Reasoning is minimized: disabled when the model supports it, otherwise reduced to the lowest level.`,"git.commitModel.autoGenerateOnEmpty":`Auto-generate when commit box is empty`,"git.commitModel.autoGenerateOnEmptyHint":`When on, clicking Commit with an empty box auto-generates a message first, then commits. Only when a model is configured; otherwise empty stays disabled. On by default.`,"git.ai.invalidModel":`Configured model is invalid. Reselect it in Config Center.`,"git.ai.autoGenerateOn":`On: auto-generate when empty`,"git.ai.usingCurrentModel":`Using current chat model`,"git.ai.usingModel":`Using {model}`,"git.ai.generateAndCommit":`Smart generate & commit`,"git.ai.autoGenerateOff":`Off`,"git.commitSectionTitle":`Commit`,"git.commitConfirmStageAll":`Confirm “stage all” on commit`,"git.commitConfirmStageAllHint":`When on, committing with only unstaged changes shows a “Stage all & commit” confirmation. When off, it stages all and commits directly. On by default.`,"git.commitConfirmStageAllOn":`On: confirm before staging all`,"git.commitConfirmStageAllOff":`Off: stage all directly`,"modelThinking.desc":`Remember the last thinking level per model or provider. When switching models, the selector restores the remembered level; if the model's available levels don't include it, it falls back to auto (use default). All 7 levels supported: off / minimal / low / medium / high / xhigh / max.`,"modelThinking.byModel":`By model`,"modelThinking.byProvider":`By provider`,"modelThinking.byProviderHint":`Provider fallback: models without a per-model entry use this value.`,"modelThinking.emptyModel":`No per-model memory yet. Selecting a thinking level after switching models will remember it automatically; you can also add one here.`,"modelThinking.emptyProvider":`No per-provider memory yet.`,"modelThinking.selectModelPlaceholder":`Select a model`,"modelThinking.selectProviderPlaceholder":`Select a provider`,"modelThinking.providerInputPlaceholder":`or type a provider name`,"modelThinking.footerHint":`Stored in a standalone file pi-web/model-thinking.json, not the main config. UI-only — pi's set_thinking_level is not intercepted.`,"common.add":`Add`,"common.delete":`Delete`,"files.conflictSummary":`{count} file{countSuffix} already exist: {files}`,"files.cannotReplace":`Cannot replace: {files}`,"files.replace":`Replace`,"files.skipExisting":`Skip existing`,"files.cancel":`Cancel`,"files.checking":`Checking files`,"files.uploading":`Uploading, {progress}%`,"files.search":`Search files`,"files.searchPlaceholder":`Search files...`,"chat.loadingSession":`Loading session...`,"chat.noSessionSelected":`Create or select a session in the left panel`,"chat.loadingWindow":`Loading messages...`,"chat.runningTool":`Running tool...`,"chat.runningNamedTool":`Running {name}...`,"chat.runningTools":`Running {names}...`,"chat.runningToolsMore":`Running {names} (+{count})...`,"chat.waitingModel":`Waiting for model...`,"chat.turnDuration":`took {duration}`,"chat.aiQuestion":`AI question`,"chat.runningCommand":`Running command...`,"chat.totalElapsed":`total {total}`,"chat.thinking":`Thinking...`,"chat.message":`message`,"chat.messages":`messages`,"chat.toolCall":`tool call`,"chat.toolCalls":`tool calls`,"chat.collapseProcess":`Collapse process details`,"chat.expandProcess":`Expand process details`,"chat.loadEarlier":`Scroll up to load earlier messages ({count} hidden)`,"chat.searchMessages":`Search messages`,"chat.clearSearch":`Clear search query`,"chat.scrollToLatest":`Scroll to latest message`,"chat.expandMessage":`Expand full content`,"chat.searchPlaceholder":`Search chat messages…`,"chat.searchNoResults":`No results`,"chat.searchResults":`{count} results`,"chat.extensionRequest":`extension request`,"chat.cancel":`Cancel`,"chat.confirm":`Confirm`,"chat.submit":`Submit`,"chat.extensionInput":`Extension terminal input`,"chat.extensionSelect":`Select an option`,"chat.extensionConfirm":`Confirm`,"chat.extensionEditor":`Edit`,"chat.extensionPanel":`Extension panel`,"chat.close":`Close`,"chat.notifyErrorTitle":`Error`,"chat.notifyWarningTitle":`Warning`,"chat.queued":`Queued · {count}`,"chat.recall":`Recall to input`,"chat.recallTitle":`Remove all queued messages and put them back into the input box for editing (also triggered by pressing Enter while the input is empty)`,"chat.retrying":`Retrying ({attempt}/{max})…`,"chat.loadingCommands":`Loading commands...`,"chat.slashCommands":`Slash commands · {label}`,"chat.tabEnter":`Tab / Enter`,"chat.noCommands":`No extension, prompt, or skill commands found`,"chat.match":`1 match`,"chat.matches":`{count} matches`,"chat.command":`1 command`,"chat.commands":`{count} commands`,"chat.loadingFiles":`Loading files...`,"chat.files":`Files · {label}{hint}`,"chat.searching":`Searching…`,"chat.noMatchingFiles":`No matching files`,"chat.searchingAll":` · searching all files…`,"chat.indexTruncated":` · index truncated`,"chat.steerPlaceholder":`Steer now / queue follow-up...`,"chat.recallPlaceholder":`Press Enter to recall queued messages, or type a new message…`,"chat.agentPlaceholder":`Agent is running…`,"chat.messagePlaceholder":`Message… Type / for commands, @ for files, ! for shell`,"chat.questionNotificationTitle":`Pi — Question Asked`,"chat.taskCompleteNotificationTitle":`Pi — Task Complete`,"chat.taskErrorNotificationTitle":`Pi — Error`,"chat.sessionCompletedNotificationBody":`Session {name} completed`,"chat.questionNotificationDenied":`Notifications denied: allow them in the browser's site settings to get question alerts while the tab is hidden.`,"chat.steer":`Steer`,"chat.followUp":`Follow-up`,"chat.queueImageBlocked":`Image attachments cannot be queued while the agent is running`,"chat.steerTooltip":`Send this message immediately after the current call finishes`,"chat.followUpTooltip":`Queue this message after the agent finishes`,"chat.send":`Send`,"chat.attachImage":`Attach image`,"chat.filterModels":`Filter models…`,"chat.noMatchingModels":`No matching models`,"chat.moreControls":`More controls`,"chat.collapseControls":`Collapse controls`,"chat.shell":`Shell`,"chat.outputLocal":`output stays local`,"chat.outputModel":`output sent to model`,"chat.noTools":`No tools, read-only`,"chat.builtInTools":`{count} built-in tools`,"chat.allBuiltInTools":`All built-in tools`,"chat.changeReasoning":`Change reasoning level: {level}`,"chat.changeReasoningLabel":`Change reasoning level`,"chat.changeToolPreset":`Change tool preset`,"chat.stopCompaction":`Stop compaction`,"chat.compactContext":`Compact context`,"chat.compacting":`Compacting…`,"chat.compact":`Compact`,"chat.stopAgent":`Stop agent`,"chat.stop":`Stop`,"chat.disableSound":`Disable completion sound`,"chat.enableSound":`Enable completion sound`,"chat.thinkingUseDefault":`Use pi default`,"chat.thinkingOff":`Reasoning off`,"chat.thinkingMinimal":`Minimal reasoning`,"chat.thinkingLow":`Low reasoning`,"chat.thinkingMedium":`Medium reasoning`,"chat.thinkingHigh":`High reasoning`,"chat.thinkingXhigh":`Extra-high reasoning`,"chat.thinkingMax":`Max reasoning`,"chat.thinkingMapTitle":`Higher thinking levels not configured`,"chat.thinkingMapBody":`pi supports up to high thinking by default. To enable {level} level reasoning, configure the "Thinking Level Map" for this model in Config → Models.`,"chat.thinkingMapGo":`Go to settings`,"chat.builtIn":`Built-in`,"chat.extensions":`Extensions`,"chat.prompts":`Prompts`,"chat.skills":`Skills`,"chat.dormant":`dormant`,"chat.commandCompact":`Compress context, optionally with instructions`,"chat.commandReload":`Reload extensions, skills, prompts, and tools`,"chat.commandName":`Set the session display name`,"chat.commandSession":`Show session message, token, and cost stats`,"chat.commandCopy":`Copy the last assistant message`,"chat.compacted":`Compacted`,"chat.tokensSaved":`{saved} saved`,"i18n.close":`Close`,"i18n.resizeList":`Resize {name} list`,"widgets.title":`Widgets`,"widgets.reopen":`Reopen widget`,"widgets.expandedToChat":`Widget [{key}] expanded to the chat view`,"widgets.collapse":`Collapse`,"widgets.open":`Open widgets`,"i18n.copy":`Copy`,"i18n.copied":`Copied`,"i18n.cancel":`Cancel`,"i18n.save":`Save`,"i18n.saving":`Saving…`,"i18n.saved":`Saved`,"i18n.saveChanges":`Save changes`,"i18n.noThinking":`No thinking content`,"i18n.remove":`Remove`,"i18n.removing":`Removing…`,"i18n.delete":`Delete`,"i18n.loading":`Loading...`,"i18n.searchPlaceholder":`Search…`,"i18n.noMatch":`No matches`,"i18n.search":`Search`,"i18n.refresh":`Refresh`,"i18n.update":`Update`,"i18n.updating":`Updating...`,"i18n.check":`Check`,"i18n.checking":`Checking...`,"i18n.install":`Install`,"i18n.installing":`Installing...`,"i18n.noResults":`No results`,"i18n.searchProviders":`Search providers…`,"i18n.noProviders":`No providers match`,"i18n.newModel":`new model`,"i18n.addProvider":`Add provider`,"i18n.selectProviderModel":`Select a provider or model`,"i18n.visibleInPrompt":`Visible in model prompt — click to disable`,"i18n.hiddenFromPrompt":`Hidden from model prompt — click to enable`,"i18n.dormant":`Dormant`,"i18n.hiddenButInvocable":`Hidden from model, still manually invocable`,"i18n.skillSearchPlaceholder":`e.g. react, testing, deploy`,"i18n.searching":`Searching…`,"i18n.noSkills":`No skills found`,"i18n.checkUpdates":`Check updates`,"i18n.updates":`updates`,"i18n.noResolvedResources":`No resolved resources`,"i18n.enablePackage":`Enable package`,"i18n.disablePackage":`Disable package`,"i18n.filtered":`filtered`,"i18n.openSessionToReload":`Open a session to reload`,"i18n.notFound":`Not found`,"i18n.noPlugins":`No plugins configured`,"trust.resourcesNotLoaded":`Restricted mode`,"trust.trustProject":`Trust project`,"trust.trusting":`Trusting...`,"trust.cancel":`Cancel`,"trust.dialogTitle":`Trust this project?`,"trust.dialogBody":`Project resources can run local code. Trust only projects whose contents you know.`,"trust.skillsNotLoaded":`Project skills are not loaded because this project is not trusted.`,"trust.pluginsNotLoaded":`Project plugins are not loaded because this project is not trusted.`,"trust.projectScopeUnavailable":`Project installs are unavailable while project resources are not loaded.`,"i18n.creatingSession":`Creating new session…`,"i18n.creating":`Creating…`,"i18n.subscription":`Subscription`,"i18n.subscriptions":`Subscriptions`,"i18n.customEndpoint":`Custom endpoint format`,"i18n.noChanges":`No changes`,"i18n.branches":`Branches`,"i18n.noActiveSession":`No active session`,"i18n.noActiveSessionToCompact":`No active session to compact`,"i18n.noActiveSessionToReload":`No active session to reload`,"i18n.noActiveSessionToName":`No active session to name`,"i18n.noAssistantMessageToCopy":`No assistant message to copy`,"i18n.commandCompleted":`Command completed`,"i18n.commandFailed":`Command failed`,"i18n.extensionCommandFailed":`Extension command failed`,"i18n.compactedContext":`Compacted context`,"i18n.reloadedSessionResources":`Reloaded session resources`,"i18n.usageName":`Usage: /name <name>`,"i18n.sessionRenamedTo":`Session renamed to {name}`,"i18n.copiedLastAssistantMessage":`Copied last assistant message`,"i18n.failedToRecallQueuedMessages":`Failed to recall queued messages`,"i18n.noBranches":`This session has no branches`,"i18n.source":`Source`,"i18n.preview":`Preview`,"i18n.diff":`Diff`,"i18n.downloadFile":`Download file`,"i18n.liveSync":`Live sync active`,"i18n.notWatching":`Not watching`,"i18n.fileViewMode":`File view mode`,"i18n.editMode":`Edit mode`,"i18n.viewMode":`View mode`,"i18n.compareHead":`Compare working tree with HEAD`,"i18n.mentionSelectedLines":`Mention selected lines`,"i18n.disableWrap":`Disable word wrap`,"i18n.enableWrap":`Enable word wrap`,"i18n.editFile":`Edit file`,"i18n.saveFile":`Save`,"i18n.saveFileShortcut":`Save (Ctrl/Cmd+S)`,"i18n.cancelEdit":`Cancel`,"i18n.saveFailed":`Save failed: {error}`,"i18n.unsavedChanges":`Unsaved changes`,"i18n.htmlPreview":`HTML preview`,"i18n.previewFile":`Preview {file}`,"i18n.invalidMermaid":`Invalid Mermaid diagram`,"i18n.renderingMermaid":`Rendering Mermaid diagram`,"i18n.previewAfterStreaming":`Preview available after streaming`,"i18n.showMermaidSource":`Show Mermaid source`,"i18n.previewMermaid":`Preview Mermaid diagram`,"i18n.openMermaidViewer":`Open diagram viewer`,"i18n.mermaidViewer":`Mermaid diagram viewer`,"i18n.mermaidDiagram":`Mermaid diagram`,"i18n.zoomOut":`Zoom out`,"i18n.zoomIn":`Zoom in`,"i18n.fitToWidth":`Fit to width`,"models.discoveryFetching":`Importing models…`,"models.deleteProviderConfirm":`Delete provider "{name}"? This writes to models.json immediately — all its settings (including the API key) will be removed and cannot be recovered.`,"models.removeModelConfirm":`Remove model "{model}"? This writes to models.json immediately and cannot be recovered.`,"models.discoveryTitle":`Import models`,"models.discoveryFetch":`Import models…`,"models.discoveryFilterPlaceholder":`Filter {count} models…`,"models.discoveryFilter":`Filter upstream models`,"models.discoverySelectShown":`Select shown`,"models.discoveryNoMatches":`No matching models.`,"models.discoveryAdded":`added`,"models.discoveryShowing":`Showing first {shown} of {total}`,"models.discoveryFetched":`{count} models fetched`,"models.discoveryAddSelected":`Add selected`,"models.setDefault":`Set as default`,"models.defaultModel":`Default model`,"models.defaultModelUnavailable":`Default model {model} is unavailable (deleted or hidden). Please select a model.`,"models.syncEndpoint":`Sync from endpoint`,"models.lastSyncedAt":`Last synced {time}`,"models.neverSynced":`Never synced`,"models.discoveryFetchTooltip":`Imports from the local cache first: {path}. If absent, syncs from the endpoint once and writes the cache there.`,"models.syncingModels":`Syncing…`,"models.syncedModels":`Synced {count} models`,"models.syncEndpointTooltip":`Fetch the latest model list from {endpoint} and cache it locally; the cached list replaces the built-in one.`,"models.syncEndpointTooltipGeneric":`Fetch the latest model list from this provider's models endpoint and cache it locally; the cached list replaces the built-in one.`,"models.refreshFromCache":`Refresh from synced cache`,"models.refreshing":`Refreshing…`,"models.refreshFromCacheTooltip":`Re-read pi-web/provider/{provider}/models.json and update only the fields that differ from the current effective definition (manual fields like headers are kept).`,"models.refreshNoDiff":`Synced cache matches the effective definition — nothing to update.`,"models.refreshDone":`Override updated from synced cache.`,"models.refreshTimeout":`Refresh timed out — try again later.`,"models.builtinProviders":`Built-in providers`,"models.customProviders":`Custom providers`,"models.syncSaveFailed":`Save draft before sync failed — sync aborted.`,"models.visibleInChat":`Visible in chat`,"models.visibleModels":`Visible models`,"models.visibleModelsCount":`{visible} / {total} visible`,"models.selectAll":`Select all`,"models.invertSelection":`Invert`,"models.searchModels":`Search models…`,"models.noVisibleModels":`No models.`,"models.filterAll":`All`,"models.filterVisible":`Visible`,"models.filterHidden":`Hidden`,"models.invertDisabledTooltip":`All models are already visible; inverting changes nothing`,"models.openOverride":`Edit override`,"models.overrideHint":`Values shown are the effective definition (built-in merged with saved overrides). Only fields you change are saved as overrides; everything else keeps inheriting the built-in definition.`,"models.overrideOrphanedHint":`This model no longer exists upstream. The local override is still saved — you can remove it here. Saving will also clean up its visibility entry.`,"models.removeOverride":`Remove override`,"models.providerNameCollision":`Provider "{provider}" conflicts with built-in "{builtin}" (case-insensitive); model visibility cannot be applied. Rename or remove the provider.`,"models.providerNameCollisionShort":`Name conflicts with built-in provider`,"models.builtinVisibilityBlocked":`Model visibility is disabled: custom provider "{custom}" conflicts with "{builtin}" (case-insensitive). Rename or remove the custom provider.`,"models.discoveryAddSelectedCount":`Add selected ({count})`,"models.dataSourceLabel":`Data source:`,"models.catalogSourceEndpoint":`Models endpoint`,"models.catalogSourceDev":`models.dev catalog`,"models.catalogSourceEndpointTooltip":`Source: Provider's /models endpoint`,"models.catalogSourceDevTooltip":`Source: models.dev built-in catalog (https://models.dev)`,"models.catalogEndpointNotFound":`Model ID not found in the models endpoint response`,"models.catalogOverwriteTitle":`Overwrite existing fields?`,"models.catalogOverwriteBody":`{{count}} field(s) already have values that overwriting would change: {{fields}}. Cancel to fill empty fields only.`,"models.catalogOverwriteConfirm":`Overwrite & fill`,"models.catalogOverwriteCancel":`Fill empty only`,"models.catalogFilling":`Filling details…`,"models.catalogFill":`Fill model details`,"models.catalogFilled":`{count} fields filled`,"models.catalogNoEmptyFields":`No empty fields to fill`,"models.catalogNoExactMatch":`No exact models.dev match`,"models.catalogPriceProvider":`Price matched Provider {provider}`,"models.catalogPriceBaseUrl":`Price matched Base URL to {provider}`,"models.catalogPriceConsensus":`Price agreed by {support}/{total} records`,"models.catalogPriceUnreliable":`No reliable price found`,"models.catalogUndo":`Undo`,"models.baseUrl":`Base URL`,"models.apiKey":`API Key`,"models.api":`API Format`,"models.modelId":`ID *`,"models.name":`Name`,"models.apiOverride":`API override`,"models.reasoningThinking":`Reasoning / thinking`,"models.imageInput":`Image input`,"models.imageInputHint":`Checking writes input: ["text", "image"]; unchecking removes input (falls back to ["text"]).`,"models.nameHint":`Leaving empty removes the name field (falls back to the model id).`,"models.apiOverrideHint":`Leaving empty or picking default removes the api field (falls back to the provider's default api).`,"models.reasoningHint":`Unchecking removes the reasoning field (falls back to off).`,"models.compatBoolTrueHint":`Unchecked does not mean false: pi treats a missing field as true. Unchecking writes explicit false so it can actually be turned off.`,"models.compatBoolHint":`Checking writes true; unchecking removes the field (falls back to auto-detect / false default).`,"models.compatSelectHint":`Picking default/none removes the field (falls back to auto-detect).`,"models.thinkingLevelMapHint":`Per level: Default = removes that mapping (falls back to the model's default level); Disabled = writes null; Custom = writes a custom level string.`,"models.compatSection":`Compatibility`,"models.compatInheritHint":`Fields not set on the model show values inherited from this provider (marked · from provider); the inherited value is what actually takes effect until overridden here.`,"models.inheritedFromProvider":`· from provider`,"models.thinkingFormatDeepseekHint":`Selecting "deepseek" also writes requiresReasoningContentOnAssistantMessages: true; any other value removes it.`,"models.samplingParams":`Sampling params`,"models.headers":`Headers`,"models.modelOverrides":`Model overrides`,"models.supportsDeveloperRole":`Developer role`,"models.supportsLongCacheRetention":`Long cache retention`,"models.supportsUsageInStreaming":`Usage in streaming`,"models.supportsFinishReason":`Finish reason in stream`,"models.supportsEagerToolInputStreaming":`Eager tool input streaming`,"models.supportsCacheControlOnTools":`Cache control on tools`,"models.supportsTemperature":`Temperature param`,"models.requiresToolResultName":`Tool result name required`,"models.requiresAssistantAfterToolResult":`Assistant after tool result`,"models.requiresThinkingAsText":`Thinking as text`,"models.requiresReasoningContentOnAssistantMessages":`Reasoning content on assistant`,"models.zaiToolStream":`z.ai tool stream`,"models.supportsThinkingTokenBudget":`Thinking token budget`,"models.supportsOpenAIGrammarTools":`OpenAI grammar tools`,"models.sendSessionAffinityHeaders":`Session affinity headers`,"models.supportsToolSearch":`Tool search`,"models.supportsExplicitPromptCacheMode":`Explicit prompt cache`,"models.forceAdaptiveThinking":`Adaptive thinking`,"models.allowEmptySignature":`Empty thinking signature`,"models.supportsStrictTools":`Strict tool schemas`,"models.supportsStore":`Store param`,"models.supportsReasoningEffort":`Reasoning effort`,"models.supportsStrictMode":`Strict mode`,"models.supportsToolReferences":`Tool references`,"models.maxTokensField":`Max tokens field`,"models.sessionAffinityFormat":`Session affinity format`,"models.deferredToolsMode":`Deferred tools mode`,"models.cacheControlFormat":`Cache control format`,"models.thinkingFormat":`Thinking format`,"models.chatTemplateKwargs":`Chat template kwargs`,"models.chatTemplateArgs":`Chat template args`,"models.openRouterRouting":`OpenRouter routing`,"models.vercelGatewayRouting":`Vercel gateway routing`,"models.thinkingLevelMap":`Thinking level map`,"models.contextWindow":`Context window (tokens)`,"models.maxOutputTokens":`Max output tokens`,"models.costPerMillion":`Cost (per million tokens)`,"models.apiKeyPlaceholder":`ENV_VAR_NAME, !shell-command, or literal key`,"models.apiKeyHint":`Prefix with ! to run a shell command, or use an env var name`,"models.apiKeyStored":`API key is stored. Enter a new key below to replace it, or disconnect to remove it.`,"models.apiKeyPrompt":`Enter your {provider} API key to enable {count} model{s}.`,"models.apiKeyReplacePlaceholder":`Enter new key to replace…`,"models.oauthAlreadyConnected":`Already connected. You can re-login or disconnect.`,"models.oauthConnectPrompt":`Connect your {provider} account.`,"models.enterValue":`Enter value…`,"models.displayNamePlaceholder":`Display name`,"models.connectionLost":`Connection lost`,"models.networkError":`Network error`,"i18n.testingModel":`Testing model connection...`,"i18n.connected":`Connected`,"i18n.failed":`Failed`,"i18n.test":`Test`,"i18n.testConnection":`Test model connection`,"i18n.provider":`Provider`,"i18n.providers":`Providers`,"i18n.model":`Model`,"i18n.providerName":`Provider name`,"i18n.rename":`Rename`,"i18n.default":`Default`,"i18n.disabled":`Disabled`,"plugins.statusLoaded":`Loaded and active`,"plugins.statusInstalled":`Installed, not yet loaded`,"plugins.statusDisabled":`Disabled`,"plugins.statusMissing":`Configured but package not found`,"plugins.extensionFilters":`Extension filters`,"plugins.filterRules":`Filter rules`,"plugins.managePlugins":`Plugins`,"plugins.extensionFiltersHint":`Filters for auto-discovered extensions in ~/.pi/agent/extensions/ and .pi/extensions/. Only patterns starting with !, +, or - take effect; plain paths do nothing.`,"plugins.noExtensionFilters":`No filters configured`,"plugins.addFilter":`Add filter`,"plugins.filterPatternLabel":`Pattern`,"plugins.filterPlaceholder":`!pattern · +path · -path`,"plugins.filterInvalid":`Pattern must start with !, +, or -; plain paths have no effect in the extensions field.`,"plugins.filterPrefixExclude":`Exclude matching extensions`,"plugins.filterPrefixForceInclude":`Force-include exact path`,"plugins.filterPrefixForceExclude":`Force-exclude exact path`,"plugins.filterEffect":`Effect`,"plugins.removeFilter":`Remove filter`,"plugins.npmSourcePlaceholder":`npm:@scope/package`,"plugins.packageInstalled":`Package installed.`,"plugins.packageUpdated":`Package updated.`,"plugins.packageRemoved":`Package removed.`,"plugins.packageDisabled":`Package disabled.`,"plugins.packageEnabled":`Package enabled.`,"plugins.extensionFilterAdded":`Extension filter added.`,"plugins.extensionFilterRemoved":`Extension filter removed.`,"plugins.sessionReloaded":`Session reloaded.`,"i18n.noResources":`No resources`,"i18n.unknown":`Unknown`,"i18n.installedVersion":`installed {version}`,"i18n.configuredVersion":`configured {version}`,"i18n.extensions":`Extensions`,"i18n.prompts":`Prompts`,"i18n.themes":`Themes`,"i18n.resourceCount":`{count} {label}`,"i18n.extensionShort":`ext`,"i18n.versionShort":`ver`,"i18n.skillShort":`skills`,"i18n.promptShort":`prompts`,"i18n.themeShort":`themes`,"i18n.custom":`Custom`,"i18n.clearAll":`clear all`,"i18n.connectedSuccessfully":`Connected successfully.`,"i18n.notConnected":`not connected`,"i18n.configured":`configured`,"i18n.notConfigured":`not configured`,"i18n.openingBrowser":`Opening browser…`,"i18n.submit":`Submit`,"i18n.login":`Login`,"i18n.relogin":`Re-login`,"i18n.disconnect":`Disconnect`,"i18n.networkError":`Network error`,"i18n.continuing":`Continuing…`,"i18n.skills":`Skills`,"i18n.plugins":`Plugins`,"i18n.addSkill":`Add skill`,"i18n.addPlugin":`Add plugin`,"i18n.recommendedPlugins":`Recommended`,"i18n.selectSkill":`Select a skill`,"i18n.selectPackage":`Select a package`,"i18n.configBindings":`Bound config files`,"i18n.addBinding":`Add`,"i18n.configFileNote":`Note (optional)`,"i18n.bindConfigFile":`Bind config file`,"i18n.selectFile":`Select a file`,"i18n.noConfigBindings":`No config files bound`,"i18n.noFiles":`No files`,"i18n.allFiles":`All files`,"i18n.filterByType":`Filter by type`,"i18n.removeBinding":`Remove binding`,"i18n.confirm":`Confirm`,"i18n.updateAvailable":`Update available`,"i18n.upToDate":`Up to date`,"i18n.automaticChecksUnavailable":`Automatic checks unavailable`,"i18n.checkFailed":`Check failed`,"i18n.installed":`Installed`,"i18n.status":`Status`,"i18n.version":`Version`,"i18n.package":`Package`,"i18n.resources":`Resources`,"i18n.installedPath":`Installed path`,"i18n.readme":`README`,"i18n.readmeDetails":`Details`,"i18n.unsafeLinkBlocked":`Blocked unsafe link (only same-directory or sub-directory relative links are allowed): {href}`,"i18n.resolvedResources":`Resolved Resources`,"i18n.reloadSession":`Reload session`,"i18n.reloading":`Reloading...`,"i18n.packageRemoved":`Package removed.`,"i18n.packageInstalled":`Package installed.`,"i18n.packageUpdated":`Package updated.`,"i18n.packageDisabled":`Package disabled.`,"i18n.packageEnabled":`Package enabled.`,"i18n.sessionReloaded":`Session reloaded.`,"i18n.thinking":`Thinking`,"i18n.loadingThinking":`Loading thinking...`,"i18n.copyMessage":`Copy message`,"i18n.editFromHere":`Edit from here`,"i18n.editFromHereTitle":`Edit from here — branches within this session`,"i18n.newSession":`New session`,"i18n.newSessionTitle":`New session — creates an independent copy from here`,"i18n.estimatedTokens":`Estimated token count while streaming`,"i18n.noOutput":`(no output)`,"i18n.noSummary":`(no summary)`,"i18n.conversationCompacted":`Conversation compacted`,"i18n.compactionDescription":`The conversation history before this point was compacted into the following summary:`,"i18n.fileContext":`File context: {details}`,"i18n.readFiles":`Read files`,"i18n.modifiedFiles":`Modified files`,"i18n.hiddenExtensionMessage":`hidden extension message`,"i18n.noMessage":`(no message)`,"i18n.showExtensionMessage":`Show extension message`,"i18n.collapse":`Collapse`,"i18n.expand":`Expand`,"i18n.hideDetails":`Hide details`,"i18n.showDetails":`Show details`,"i18n.thinkingUnavailable":`Thinking content unavailable`,"i18n.thinkingEncrypted":`Thinking content is encrypted (provider-encrypted for context continuity, plaintext not available)`,"i18n.before":`Before`,"i18n.after":`After`}},v={id:`zh-CN`,label:`简体中文`,messages:{"common.ok":`确定`,"common.language":`语言`,"common.models":`模型`,"common.skills":`技能`,"common.plugins":`插件`,"sidebar.hide":`收起侧边栏`,"sidebar.show":`展开侧边栏`,"theme.light":`切换到浅色模式`,"preferences.defaultThinkingLevel":`默认思考级别`,"preferences.thinkingLevelHint":"新会话的全局默认思考级别(settings.json `defaultThinkingLevel`)。未设置=删除该字段(回落 pi 默认)。","preferences.thinkingLevelNotSet":`未设置(跟随模型默认)`,"preferences.compaction":`自动压缩`,"preferences.compactionHint":"自动压缩长会话(settings.json `compaction`)。未配置时按 pi 默认值展示,改动即写入完整对象。","preferences.compactionEnabled":`启用`,"preferences.compactionReserveTokens":`输出预留词元数`,"preferences.compactionReserveTokensHint":`为模型输出预留的词元数,压缩时保留这部分空间供回复使用`,"preferences.compactionKeepRecentTokens":`压缩后保留词元数`,"preferences.compactionKeepRecentTokensHint":`压缩后保留的词元数,从最近聊天记录开始逆向往前计算`,"preferences.retry":`API 重试`,"preferences.retryHint":"供应商 API 调用的重试设置(settings.json `retry`)。未配置时按 pi 默认值展示,改动即写入完整对象;provider 子字段留空则不写入。","preferences.retryEnabled":`启用重试`,"preferences.retryEnabledHint":`是否对失败的 API 调用启用重试`,"preferences.retryMaxRetries":`最大重试次数`,"preferences.retryBaseDelayMs":`基础延迟(毫秒)`,"preferences.retryBaseDelayMsHint":`首次重试前的初始延迟,单位毫秒`,"preferences.retryProviderTimeoutMs":`供应商超时(毫秒)`,"preferences.retryProviderMaxRetries":`供应商最大重试次数`,"preferences.retryProviderMaxRetryDelayMs":`供应商最大延迟(毫秒)`,"preferences.defaultProjectTrust":`新项目默认信任`,"preferences.projectTrustHint":"新项目的默认信任策略(settings.json `defaultProjectTrust`)。未设置=删除该字段(回落「询问」)。","preferences.projectTrustNotSet":`未设置(询问)`,"preferences.projectTrustAsk":`询问`,"preferences.projectTrustAlways":`总是信任`,"preferences.projectTrustNever":`从不信任`,"preferences.notifyEvents":`通知`,"preferences.notifyEventsHint":`标签页非激活时发浏览器通知。权限在首次交互时请求。`,"notify.permission.request":`开启通知`,"notify.permission.requestHint":`点击开启浏览器通知:任务完成时即使不在本页也会提醒`,"notify.permission.granted":`通知已开启`,"notify.permission.grantedHint":`已开启浏览器通知:任务完成时即使不在本页也会提醒`,"notify.permission.bannerHintBefore":`点击左上工具栏的`,"notify.permission.bannerHintAfter":`按钮开启通知权限,任务完成、出错或提问时都能收到浏览器通知,详细设置可在 配置中心 → 会话 → 通知 栏目中调整`,"notify.permission.denied":`通知被阻止`,"notify.permission.deniedHint":`浏览器阻止了通知。请点击地址栏左侧图标 → 站点设置,将通知改为允许后重试`,"preferences.notifyWhileActive":`页面激活时也通知`,"preferences.notifyTaskComplete":`任务完成`,"preferences.notifyErrors":`运行出错`,"preferences.notifyQuestions":`提问`,"preferences.subagentsDefaultModel":`子代理默认模型`,"preferences.subagentsDefaultThinking":`子代理默认思考级别`,"preferences.subagentsHint":"子代理默认配置(settings.json `subagents`)。defaultThinking 未设置=删除该子字段(回落 pi 默认)。","preferences.subagentsModelPlaceholder":`供应商/模型-id`,"theme.dark":`切换到深色模式`,"theme.toggleTheme":`切换主题`,"theme.darkMode":`深色`,"theme.lightMode":`浅色`,"theme.fontSize":`字体大小`,"theme.scrollStep":`悬停滚动步长`,"scrollStep.hint":`悬停滚动方向箭头时,内容每次滚动的像素数(面板滚动箭头与消息地图共用此步长)。`,"scrollStep.range":`每次悬停滚动像素(1-1000)`,"scrollStep.unit":`px`,"theme.autoReloadSeconds":`自动重载聊天消息间隔`,"autoReload.off":`关闭(0)— 不自动刷新`,"autoReload.range":`秒(0 — 3600)`,"autoReload.unit":`秒`,"autoReload.hint":`自动重新读取会话文件的间隔秒数;0 = 关闭。单客户端场景(消息经 SSE 实时推送)保持 0 即可;多客户端协作(多个浏览器同时操作同一会话)时设为大于 0,各客户端定时刷新以读取其他客户端生成的新聊天消息。`,"longBlock.hint":`“块”指思维链(thinking)和工具调用(tool call)。正文超过阈值时折叠为头尾摘要,点击可展开查看全文。`,"recentBlocks.hint":`流式渲染过程中和刚刚完成的块不计入数量(最新完成的块始终展开)。本值表示除此之外,额外保持展开的最近已完成块数。`,"autoReload.reset":`恢复默认({n} 秒)`,"chat.reloadFromDisk":`从磁盘重新加载会话`,"chat.reloadFromDiskHint":`当多个客户端同时读写同一个会话 jsonl 时使用。可在 配置中心 → 会话 页面设置自动定时重载。`,"scrollStep.reset":`恢复默认({n} px)`,"theme.longBlockCollapse":`长块折叠阈值`,"theme.recentBlocksExpanded":`最近完成块保持展开数`,"layout.sidebarWidth":`左侧面板宽度`,"layout.widgetPanelWidth":`右侧面板宽度`,"layout.widthRange":`px({min}–{max})`,"layout.widthReset":`恢复默认({value} px)`,"longBlock.range":`字符数(20-10000)`,"longBlock.chars":`字符`,"longBlock.blocks":`个`,"longBlock.reset":`恢复默认({n} 字符)`,"recentBlocks.reset":`恢复默认({n} 个)`,"recentBlocks.range":`0-20,不含最新完成的块`,"longBlock.expandHint":`… 中间 {n} 字符已折叠 · 点击展开`,"longBlock.collapse":`点击收起`,"history.full":`完整历史`,"history.unsaved":`会话保存后才能查看完整历史`,"title.generating":`正在生成...`,"title.updated":`标题已更新`,"title.failed":`生成失败`,"title.generate":`生成标题`,"title.unsaved":`会话保存后才能生成标题`,"title.noMessages":`请先发送消息,再为会话命名`,"title.generateSession":`生成会话标题`,"system.prompt":`系统提示词`,"system.empty":`系统提示词为空(工具已禁用)`,"system.load":`发送消息以加载系统提示词`,"session.info":`会话信息`,"session.reload":`重载会话(重读配置与资源)`,"session.name":`名称`,"session.file":`文件`,"session.inMemory":`内存中`,"session.id":`ID`,"session.user":`用户`,"session.assistant":`助手`,"session.toolCalls":`工具调用`,"session.toolResults":`工具结果`,"session.total":`总计`,"session.input":`输入`,"session.output":`输出`,"session.cacheRead":`缓存读取`,"session.cacheWrite":`缓存写入`,"session.inputHint":`未命中缓存的输入 token 数:系统提示、会话历史、工具定义等发送给模型的上下文,减去命中缓存的部分`,"session.outputHint":`模型生成回复的 token 数(回答与思考)`,"session.cacheReadHint":`命中 prompt 缓存的 token 数:与上一请求未变的上下文直接从缓存读取,按折扣价计费`,"session.cacheWriteHint":`首次写入缓存的 token 数(Anthropic 风格按写入计费)`,"session.totalHint":`输入 + 输出 + 缓存读取 + 缓存写入`,"session.cacheReadRate":`缓存命中率:命中缓存的 token(缓存读取)占全部输入 prompt(输入 + 缓存读取 + 缓存写入)的比例,即官方口径 cacheRead ÷ (input + cacheRead + cacheWrite)`,"session.cost":`费用`,"session.context":`上下文`,"session.copy":`复制{value}`,"session.copied":`已复制`,"session.title":`会话信息`,"session.load":`发送消息或运行 /session 以加载会话信息`,"session.infoSection":`会话信息`,"session.messages":`消息`,"session.tokens":`Token`,"session.copyFile":`复制文件路径`,"session.copyId":`复制会话 ID`,"workspace.opening":`正在打开工作区...`,"workspace.unable":`无法打开工作区`,"workspace.selectSession":`从侧边栏选择一个会话`,"workspace.selectWorkspace":`请选择工作区`,"workspace.stepProject":`从侧边栏选择项目目录`,"workspace.stepModels":`点击底部的“模型”按钮添加模型`,"tabs.chat":`聊天`,"tabs.widgets":`小组件`,"config.title":`配置`,"config.section.session":`会话`,"config.section.appearance":`外观`,"config.section.advanced":`高级`,"config.section.startScreen":`开始屏幕`,"config.section.git":`Git`,"config.section.updates":`更新`,"config.section.modelThinking":`思考级别`,"config.section.requiresCwd":`请先从侧边栏选择项目目录,再浏览插件 / 技能`,"updates.check":`检查更新`,"updates.checking":`检查中…`,"updates.checkedAt":`上次检查`,"updates.upToDate":`已是最新`,"updates.updateAvailable":`有新版本`,"updates.unavailable":`检查失败`,"updates.noPluginUpdates":`全部插件已是最新`,"updates.banner":`有可用更新:{items}`,"updates.view":`查看`,"updates.copied":`已复制`,"updates.copyCommand":`复制命令`,"updates.restartNote":`更新后将同时升级内置 pi SDK,重启服务生效。`,"updates.enableChecking":`启用更新检测`,"updates.disabled":`更新检测已关闭`,"updates.ignoreVersion":`忽略此版本`,"updates.ignored":`已忽略 {version}`,"updates.ignoredPlugin":`已忽略`,"updates.unignore":`取消忽略`,"preferences.pi.unset":`pi 默认`,"preferences.pi.enableAnalytics":`启用分析`,"preferences.pi.enableAnalyticsHint":"发送匿名使用分析(settings.json `enableAnalytics`)","preferences.pi.enableInstallTelemetry":`启用安装遥测`,"preferences.pi.enableInstallTelemetryHint":"发送匿名安装遥测(settings.json `enableInstallTelemetry`)","preferences.pi.httpProxy":`HTTP 代理`,"preferences.pi.httpProxyHint":"HTTP 请求的代理地址(settings.json `httpProxy`)。留空无法清除已设置的值。","preferences.pi.trackingId":`分析跟踪 ID`,"preferences.pi.trackingIdHint":"自定义分析跟踪 ID(settings.json `trackingId`)。留空无法清除已设置的值。","preferences.pi.httpIdleTimeoutMs":`HTTP 空闲超时(毫秒)`,"preferences.pi.httpIdleTimeoutMsHint":"HTTP 空闲超时毫秒数(settings.json `httpIdleTimeoutMs`)。留空无法清除已设置的值。","preferences.pi.websocketConnectTimeoutMs":`WebSocket 连接超时(毫秒)`,"preferences.pi.websocketConnectTimeoutMsHint":"WebSocket 连接超时毫秒数(settings.json `websocketConnectTimeoutMs`)。留空无法清除已设置的值。","preferences.pi.branchSummary":`分支摘要`,"preferences.pi.branchSummaryHint":"分支摘要自动压缩(settings.json `branchSummary`)","preferences.pi.reserveTokens":`预留 token`,"preferences.pi.skipPrompt":`跳过提示`,"preferences.pi.images":`图片处理`,"preferences.pi.imagesHint":"pi 引擎如何处理图片(settings.json `images`)","preferences.pi.autoResize":`自动缩放`,"preferences.pi.autoResizeHint":"压缩 `read` 等工具返回的图片以节省 token。","preferences.pi.blockImages":`阻止图片`,"preferences.pi.blockImagesHint":`在消息发送给模型前移除所有图片内容。`,"config.files.hint":`直接编辑 pi 的配置文件(JSON)。保存前校验,写前自动备份(保留最近 10 份)。`,"config.widgets.empty":`暂无小组件配置。插件弹出小组件时会自动在此创建条目。`,"config.widgets.x":`x`,"config.widgets.y":`y`,"config.widgets.width":`宽`,"config.widgets.height":`高`,"config.widgets.bind":`绑定消息`,"config.widgets.bindTitle":`绑定自定义消息`,"config.widgets.bindHint":`为小组件「{key}」绑定一条快捷消息`,"config.widgets.editTitle":`编辑快捷消息`,"config.widgets.editHint":`修改标题、内容与发送方式。`,"config.widgets.label":`描述`,"config.widgets.labelPlaceholder":`按钮显示的文字(如:重载)`,"config.widgets.message":`消息内容`,"config.widgets.messagePlaceholder":`斜杠命令或任意文本(如 /reload)`,"config.widgets.messageTooltip":`以 / 开头时仅提示内置、全局插件与 Skill 命令;项目级插件命令不会出现在列表中,但可手动输入后保存`,"config.widgets.sendImmediately":`立即发送`,"config.widgets.sendMode":`发送方式`,"config.widgets.fillToChatInput":`填充到聊天框`,"config.widgets.sendImmediatelyTooltip":`立即发送:`,"config.widgets.fillToChatInputTooltip":`填充到聊天框:`,"config.widgets.nameConflict":`名称「{label}」已存在,请换一个名称`,"config.startScreen.nameConflict":`名称「{label}」已存在,请换一个名称`,"config.widgets.confirm":`确认`,"config.widgets.unbindTitle":`解绑消息`,"config.widgets.unbindConfirm":`确定解绑「{label}」?`,"config.widgets.unbind":`解绑`,"config.startScreen.hint":`新会话开始屏幕(Pi Logo 下方)展示的快捷入口;点击后按各条绑定的发送方式立即发送或填充到聊天输入框。`,"config.startScreen.bind":`绑定消息`,"config.startScreen.bindTitle":`绑定快捷消息`,"config.startScreen.bindHint":`为开始屏幕绑定一条快捷消息。`,"config.startScreen.editTitle":`编辑快捷消息`,"config.startScreen.editHint":`修改标题、内容与发送方式。`,"config.startScreen.empty":`暂无快捷消息,开始屏幕不会显示快捷入口。`,"config.startScreen.unbindTitle":`解绑消息`,"config.startScreen.unbindConfirm":`确定解绑「{label}」?`,"config.startScreen.unbind":`解绑`,"config.startScreen.reset":`重置`,"config.startScreen.resetHint":`恢复内置默认快捷消息;保留你自绑定的消息(与默认同名的会被默认项覆盖)。`,"config.files.save":`保存`,"config.files.saving":`保存中...`,"config.files.saved":`已保存`,"config.files.missing":`尚未创建`,"config.files.placeholder":`从左侧选择要编辑的配置文件`,"layout.resizeSidebar":`调整侧边栏宽度`,"layout.resizeWidgetPanel":`调整小组件面板宽度`,"layout.resizeHint":`拖动调整宽度。双击或按 Enter 恢复默认值。`,"sidebar.newWorkspace":`新增工作区`,"sidebar.searchSessions":`搜索会话`,"sidebar.searchSessionsPlaceholder":`搜索会话…`,"sidebar.justNow":`刚刚`,"sidebar.minutesAgo":`{count} 分钟前`,"sidebar.hoursAgo":`{count} 小时前`,"sidebar.daysAgo":`{count} 天前`,"sidebar.searchSessionsNoResults":`无匹配会话`,"sidebar.newSessionTitle":`在 {path} 中新建会话`,"sidebar.refresh":`刷新`,"directoryPicker.selectDirectory":`选择目录`,"directoryPicker.goToParent":`转到上级目录`,"directoryPicker.directoryPath":`目录路径`,"directoryPicker.goToDirectory":`转到目录`,"directoryPicker.go":`转到`,"directoryPicker.loadingDirectories":`正在加载目录…`,"directoryPicker.noSubdirectories":`没有子目录`,"directoryPicker.openBeforeSelecting":`选择前请先打开此路径`,"directoryPicker.selectCurrentDirectory":`选择当前目录`,"directoryPicker.selectThisFolder":`选择此文件夹`,"directoryPicker.noDrives":`未找到盘符`,"directoryPicker.search":`筛选文件夹`,"directoryPicker.noMatches":`没有匹配的文件夹`,"sidebar.checking":`检查中…`,"sidebar.open":`打开`,"sidebar.cancel":`取消`,"sidebar.openRepoRoot":`worktree 切换不可用`,"sidebar.openRepoRootTitle":`worktree 切换功能当前不可用:请先在侧栏将当前工作目录切换到 Git 仓库根目录。`,"sidebar.gitRepoRootOnly":`仅 Git 仓库根目录`,"sidebar.gitRepoRootOnlyTitle":`只能在 Git 仓库根目录使用 worktree。`,"sidebar.worktrees":`Worktrees...`,"sidebar.checkingWorktrees":`正在检查此目录的 worktree。`,"sidebar.filterWorktrees":`筛选 worktree…`,"sidebar.noMatchingWorktrees":`没有匹配的 worktree`,"sidebar.switchWorktree":`切换 worktree`,"sidebar.switchWorktreeTitle":`切换 worktree:{path}`,"sidebar.main":`主分支`,"sidebar.forceRemoveCheckout":`存在未提交的更改。强制移除 checkout?`,"sidebar.force":`强制移除`,"sidebar.createWorktreeTitle":`为分支创建 worktree checkout`,"sidebar.newWorktree":`新建 worktree…`,"sidebar.branchName":`分支名称`,"sidebar.creating":`创建中…`,"sidebar.create":`创建`,"sidebar.uploadFilesTitle":`将文件上传到项目根目录`,"sidebar.uploadFiles":`上传文件`,"sidebar.refreshExplorer":`刷新文件浏览器`,"sidebar.changedFiles":`{count} 个变更文件`,"sidebar.loading":`加载中...`,"sidebar.sessionDeleted":`会话已删除,请选择其他会话`,"sidebar.noSessions":`未找到会话`,"sidebar.workspace":`工作区`,"sidebar.newActivity":`有新活动`,"sidebar.newSessionActivity":`会话有新活动`,"sidebar.interactionBadge":`会话等待交互响应`,"sidebar.deleteSession":`删除 {title}?`,"sidebar.deleteWorkspace":`删除工作区({count} 个会话)?`,"sidebar.deleteWorkspaceTitle":`删除此工作区及其所有会话`,"sidebar.copyPath":`复制完整路径`,"sidebar.rename":`重命名`,"sidebar.delete":`删除`,"sidebar.deleteWithShiftClick":`删除(按住 Shift 点击可跳过确认)`,"sidebar.expandForks":`展开分叉`,"sidebar.collapseForks":`折叠分叉`,"sidebar.disconnect":`断开`,"sidebar.messagesCount":`{count} 条消息`,"sidebar.worktreePath":`Worktree:{path}`,"sidebar.removeWorktreeTitle":`移除 worktree checkout {path};保留分支`,"files.modified":`已修改`,"files.added":`已添加`,"files.deleted":`已删除`,"files.renamed":`已重命名`,"files.untracked":`未跟踪`,"files.conflict":`冲突`,"files.newlyUploaded":`刚上传`,"files.containsChangedFiles":`包含已更改文件`,"files.insertPath":`将路径插入聊天`,"files.mention":`提及`,"files.download":`下载文件`,"files.dismissError":`关闭错误`,"files.addUploadedFile":`将上传的文件添加到聊天`,"files.addAllUploadedFiles":`将所有上传的文件添加到聊天`,"files.openInSystemApp":`用系统应用打开`,"files.chooseOtherApp":`选择其他应用…`,"files.openLaunched":`已调用系统应用打开(如无窗口弹出,请检查文件关联)`,"files.fileTooLargeForPreview":`文件太大,无法预览(>{limit})`,"files.docTooLargeForPreview":`DOCX 太大,无法预览(>{limit})`,"files.dismissUploadResults":`关闭上传结果`,"files.loading":`正在加载文件...`,"files.noFiles":`未找到文件`,"loading.inProgress":`处理中…`,"loading.more":`还有 {count} 项…`,"errors.title":`错误`,"errors.titleCount":`错误({count})`,"errors.close":`关闭`,"errors.clearAll":`全部清除`,"files.notFound":`(暂无文件)`,"files.accessDenied":`访问被拒绝`,"files.empty":`(空)`,"files.uploadFailed":`{count} 个失败`,"files.explorer":`文件浏览器`,"files.changedCount":`{count} 个文件`,"files.stagedPrefix":`已暂存:`,"files.unstagedPrefix":`未暂存:`,"files.noStagedChanges":`暂无已暂存文件`,"files.noUnstagedChanges":`暂无变更文件`,"files.commitMessagePlaceholder":`提交信息`,"files.commit":`提交`,"files.push":`推送到远端(含 tag)`,"files.pushing":`推送中...`,"files.pushSuccess":`推送成功`,"files.pushFailed":`推送失败`,"files.pushUpToDate":`已与远端同步,无需推送`,"files.pull":`从远端拉取`,"files.pulling":`拉取中...`,"files.pullSuccess":`拉取成功`,"files.pullFailed":`拉取失败`,"files.pullUpToDate":`已与远端同步,无需拉取`,"files.pullNonFastForward":`拉取被拒绝——本地与远端已分叉。请在终端使用 git pull --rebase 或 --merge 处理。`,"files.committing":`提交中…`,"files.commitMessageRequired":`请先填写 commit message`,"files.commitTitle":`提交更改`,"files.confirmStageAllCommit":`是否暂存全部 {count} 个改动文件并提交?`,"files.stageAllAndCommit":`暂存并提交`,"files.stageFile":`暂存文件`,"files.unstageFile":`取消暂存`,"files.changeStats":`{count} 个变更文件,新增 {additions} 行,删除 {deletions} 行`,"git.autoFetchInterval":`自动 fetch 间隔(秒)`,"git.autoFetchIntervalHint":`服务端定时为活动会话的工作区执行 git fetch(所有客户端共享结果)。0 表示关闭定时——仅在连接会话时触发一次。`,"git.groupTitle":`智能提交信息生成`,"git.commitModel.followCurrent":`跟随当前会话模型`,"git.commitModel.followCurrentHint":`开启后,生成提交信息时动态使用当前聊天的主模型;关闭则使用下方固定的模型(推荐使用免费小模型)。`,"git.commitModel.followCurrentOn":`已开启:跟随当前会话`,"git.commitModel.followCurrentOff":`已关闭:使用固定模型`,"git.commitModel.fixedModel":`固定模型`,"git.commitModel.fixedModelHint":`关闭“跟随当前会话”时使用的模型(建议选择固定的免费小模型,注意其上下文可能仅 5 万)。`,"git.commitModel.selectPlaceholder":`选择模型`,"git.commitModel.noModels":`暂无可用模型`,"git.commitModel.notConfiguredHint":`尚未选择固定模型,请先选择一个模型后再使用智能生成。`,"git.ai.generate":`智能生成`,"git.ai.generating":`生成中…`,"git.ai.notConfiguredTitle":`未配置模型`,"git.ai.notConfiguredDesc":`尚未为智能生成指定模型,请前往配置中心 → Git 指定模型后再试。`,"git.ai.goToConfig":`前往配置`,"git.ai.noSession":`跟随模式需要先选择一个会话`,"git.ai.noSessionModel":`当前会话无可用模型,请先在聊天中选择模型`,"git.commitModel.maxTokens":`最大输出长度`,"git.commitModel.maxTokensHint":`单次智能生成允许的最大输出 token 数(64–4096,默认 512)。已尽量降低推理开销:支持关闭的模型会关闭推理,不支持的会降至最低档位。`,"git.commitModel.autoGenerateOnEmpty":`空输入框时提交自动先智能生成`,"git.commitModel.autoGenerateOnEmptyHint":`开启后,点击提交时若输入框为空,会先自动调用智能生成填入信息再提交;仅在已指定模型时生效,未指定模型时空输入框仍禁用提交。默认开启。`,"git.ai.invalidModel":`已配置的模型格式无效,请前往配置中心重新选择`,"git.ai.autoGenerateOn":`已开启:空输入框自动生成`,"git.ai.usingCurrentModel":`使用聊天主模型`,"git.ai.usingModel":`使用 {model}`,"git.ai.generateAndCommit":`智能生成信息并提交`,"git.ai.autoGenerateOff":`已关闭`,"git.commitSectionTitle":`提交`,"git.commitConfirmStageAll":`提交时需确认“暂存全部”`,"git.commitConfirmStageAllHint":`开启后,未暂存时点击提交会先弹出“暂存全部并提交”确认框;关闭则直接暂存全部并提交。默认开启。`,"git.commitConfirmStageAllOn":`已开启:提交前确认`,"git.commitConfirmStageAllOff":`已关闭:直接暂存全部`,"modelThinking.desc":`为每个模型或 Provider 记忆上次选择的思考级别。切换模型时自动选中记忆的档位;若该模型的可用档位不含记忆值则回退到 auto(跟随默认)。支持全部 7 档:off / minimal / low / medium / high / xhigh / max。`,"modelThinking.byModel":`按模型`,"modelThinking.byProvider":`按 Provider`,"modelThinking.byProviderHint":`Provider 级别为回退:同 Provider 下未单独记忆的模型会使用此值。`,"modelThinking.emptyModel":`暂无按模型的记忆。切换模型后用下方思考级别下拉选择,自动记忆;也可在此添加。`,"modelThinking.emptyProvider":`暂无按 Provider 的记忆。`,"modelThinking.selectModelPlaceholder":`选择模型`,"modelThinking.selectProviderPlaceholder":`选择 Provider`,"modelThinking.providerInputPlaceholder":`或输入 Provider 名称`,"modelThinking.footerHint":`配置保存到独立文件 pi-web/model-thinking.json,不影响主配置;仅作用于 UI 下拉,不拦截 pi 的 thinking 调用。`,"common.add":`添加`,"common.delete":`删除`,"files.conflictSummary":`已有 {count} 个文件:{files}`,"files.cannotReplace":`无法替换:{files}`,"files.replace":`替换`,"files.skipExisting":`跳过已有文件`,"files.cancel":`取消`,"files.checking":`正在检查文件`,"files.uploading":`正在上传,{progress}%`,"files.search":`搜索文件`,"files.searchPlaceholder":`搜索文件...`,"chat.loadingSession":`正在加载会话...`,"chat.noSessionSelected":`请在左侧面板新增/选择任意会话`,"chat.loadingWindow":`正在加载消息...`,"chat.runningTool":`正在运行工具...`,"chat.runningNamedTool":`正在运行 {name}...`,"chat.runningTools":`正在运行 {names}...`,"chat.runningToolsMore":`正在运行 {names}(另有 {count} 个)...`,"chat.waitingModel":`正在等待模型...`,"chat.turnDuration":`耗时 {duration}`,"chat.aiQuestion":`AI 提问`,"chat.runningCommand":`正在运行命令...`,"chat.totalElapsed":`总计 {total}`,"chat.thinking":`正在思考...`,"chat.message":`条消息`,"chat.messages":`条消息`,"chat.toolCall":`次工具调用`,"chat.toolCalls":`次工具调用`,"chat.collapseProcess":`收起处理详情`,"chat.expandProcess":`展开处理详情`,"chat.loadEarlier":`向上滚动以加载更早的消息(隐藏 {count} 条)`,"chat.searchMessages":`搜索消息`,"chat.clearSearch":`清空搜索关键字`,"chat.scrollToLatest":`滚动到最新消息`,"chat.expandMessage":`展开完整内容`,"chat.searchPlaceholder":`搜索聊天消息…`,"chat.searchNoResults":`没有结果`,"chat.searchResults":`{count} 个结果`,"chat.extensionRequest":`扩展请求`,"chat.cancel":`取消`,"chat.confirm":`确认`,"chat.submit":`提交`,"chat.extensionInput":`扩展终端输入`,"chat.extensionSelect":`请选择`,"chat.extensionConfirm":`确认`,"chat.extensionEditor":`编辑`,"chat.extensionPanel":`扩展面板`,"chat.close":`关闭`,"chat.notifyErrorTitle":`错误`,"chat.notifyWarningTitle":`警告`,"chat.queued":`已排队 · {count}`,"chat.recall":`移回输入框`,"chat.recallTitle":`移除所有排队消息并放回输入框编辑(输入框为空时按回车也可触发)`,"chat.retrying":`正在重试({attempt}/{max})…`,"chat.loadingCommands":`正在加载命令...`,"chat.slashCommands":`斜杠命令 · {label}`,"chat.tabEnter":`Tab / Enter`,"chat.noCommands":`未找到扩展、提示词或技能命令`,"chat.match":`1 个匹配项`,"chat.matches":`{count} 个匹配项`,"chat.command":`1 个命令`,"chat.commands":`{count} 个命令`,"chat.loadingFiles":`正在加载文件...`,"chat.files":`文件 · {label}{hint}`,"chat.searching":`搜索中…`,"chat.noMatchingFiles":`未找到匹配的文件`,"chat.searchingAll":` · 正在搜索所有文件…`,"chat.indexTruncated":` · 索引不完整`,"chat.steerPlaceholder":`立即引导 / 排队后续消息...`,"chat.recallPlaceholder":`回车撤回排队消息到输入框编辑,或输入新消息…`,"chat.agentPlaceholder":`Agent 运行中…`,"chat.messagePlaceholder":`消息…输入 / 使用命令,@ 引用文件,! 执行命令`,"chat.questionNotificationTitle":`Pi — 提问`,"chat.taskCompleteNotificationTitle":`Pi — 任务完成`,"chat.taskErrorNotificationTitle":`Pi — 出错`,"chat.sessionCompletedNotificationBody":`会话 {name} 已完成`,"chat.questionNotificationDenied":`通知被拒绝:在浏览器站点设置中允许后,切走页面时才会收到提问提醒。`,"chat.steer":`引导`,"chat.followUp":`后续消息`,"chat.queueImageBlocked":`运行中无法排队发送带图片的附件`,"chat.steerTooltip":`在当前调用结束后立即发送这条消息`,"chat.followUpTooltip":`在智能体结束后排队发送这条消息`,"chat.send":`发送`,"chat.attachImage":`附加图片`,"chat.filterModels":`筛选模型…`,"chat.noMatchingModels":`没有匹配的模型`,"chat.moreControls":`更多控件`,"chat.collapseControls":`收起控件`,"chat.shell":`Shell`,"chat.outputLocal":`输出保留在本地`,"chat.outputModel":`输出发送给模型`,"chat.noTools":`不使用工具,仅只读`,"chat.builtInTools":`{count} 个内置工具`,"chat.allBuiltInTools":`全部内置工具`,"chat.changeReasoning":`更改推理级别:{level}`,"chat.changeReasoningLabel":`更改推理级别`,"chat.changeToolPreset":`更改工具预设`,"chat.stopCompaction":`停止压缩`,"chat.compactContext":`压缩上下文`,"chat.compacting":`正在压缩…`,"chat.compact":`压缩`,"chat.stopAgent":`停止 Agent`,"chat.stop":`停止`,"chat.disableSound":`关闭完成提示音`,"chat.enableSound":`开启完成提示音`,"chat.thinkingUseDefault":`使用 pi 默认设置`,"chat.thinkingOff":`关闭推理`,"chat.thinkingMinimal":`最低限度推理`,"chat.thinkingLow":`低强度推理`,"chat.thinkingMedium":`中等强度推理`,"chat.thinkingHigh":`高强度推理`,"chat.thinkingXhigh":`超高强度推理`,"chat.thinkingMax":`最高强度推理`,"chat.thinkingMapTitle":`高级思考级别未配置`,"chat.thinkingMapBody":`pi 默认只支持 high 级别。若要开启 {level} 级别推理,请在 配置 → 模型 页面为该模型配置「推理级别映射」。`,"chat.thinkingMapGo":`立即前往`,"chat.builtIn":`内置`,"chat.extensions":`扩展`,"chat.prompts":`提示词`,"chat.skills":`技能`,"chat.dormant":`休眠`,"chat.commandCompact":`压缩上下文,可选附加说明`,"chat.commandReload":`重新加载扩展、技能、提示词和工具`,"chat.commandName":`设置会话显示名称`,"chat.commandSession":`显示会话消息、Token 和费用统计`,"chat.commandCopy":`复制最后一条助手消息`,"chat.compacted":`已压缩`,"chat.tokensSaved":`节省 {saved}`,"i18n.close":`关闭`,"i18n.resizeList":`调整 {name} 列表大小`,"widgets.title":`小组件`,"widgets.reopen":`重新弹出`,"widgets.expandedToChat":`小组件[{key}]已展开到聊天页面`,"widgets.collapse":`收起`,"widgets.open":`展开小组件`,"i18n.copy":`复制`,"i18n.copied":`已复制`,"i18n.cancel":`取消`,"i18n.save":`保存`,"i18n.saving":`保存中…`,"i18n.saved":`已保存`,"i18n.saveChanges":`保存更改`,"i18n.noThinking":`无思考内容`,"i18n.remove":`移除`,"i18n.removing":`移除中…`,"i18n.delete":`删除`,"i18n.loading":`加载中...`,"i18n.searchPlaceholder":`搜索…`,"i18n.noMatch":`无匹配`,"i18n.search":`搜索`,"i18n.refresh":`刷新`,"i18n.update":`更新`,"i18n.updating":`更新中...`,"i18n.check":`检查`,"i18n.checking":`检查中...`,"i18n.install":`安装`,"i18n.installing":`安装中...`,"i18n.noResults":`没有结果`,"i18n.searchProviders":`搜索 Provider…`,"i18n.noProviders":`没有匹配的 Provider`,"i18n.newModel":`新模型`,"i18n.addProvider":`添加 Provider`,"i18n.selectProviderModel":`选择 Provider 或模型`,"i18n.visibleInPrompt":`在模型提示词中可见,点击以禁用`,"i18n.hiddenFromPrompt":`在模型提示词中隐藏,点击以启用`,"i18n.dormant":`休眠`,"i18n.hiddenButInvocable":`对模型隐藏,仍可手动调用`,"i18n.skillSearchPlaceholder":`例如 react、testing、deploy`,"i18n.searching":`搜索中…`,"i18n.noSkills":`未找到技能`,"i18n.checkUpdates":`检查更新`,"i18n.updates":`项更新`,"i18n.noResolvedResources":`没有已解析资源`,"i18n.enablePackage":`启用包`,"i18n.disablePackage":`禁用包`,"i18n.filtered":`已筛选`,"i18n.openSessionToReload":`打开会话后才能重新加载`,"i18n.notFound":`未找到`,"i18n.noPlugins":`未配置插件`,"trust.resourcesNotLoaded":`受限模式`,"trust.trustProject":`信任项目`,"trust.trusting":`正在信任...`,"trust.cancel":`取消`,"trust.dialogTitle":`信任此项目?`,"trust.dialogBody":`项目资源可以运行本地代码。请仅信任你了解其内容的项目。`,"trust.skillsNotLoaded":`此项目尚未受信任,项目技能未加载。`,"trust.pluginsNotLoaded":`此项目尚未受信任,项目插件未加载。`,"trust.projectScopeUnavailable":`项目资源未加载时,无法安装到项目范围。`,"i18n.creatingSession":`正在创建新会话…`,"i18n.creating":`创建中…`,"i18n.subscription":`订阅`,"i18n.subscriptions":`订阅服务`,"i18n.customEndpoint":`自定义端点格式`,"i18n.noChanges":`没有更改`,"i18n.branches":`分支`,"i18n.noActiveSession":`没有活动会话`,"i18n.noActiveSessionToCompact":`没有活动会话可压缩`,"i18n.noActiveSessionToReload":`没有活动会话可重新加载`,"i18n.noActiveSessionToName":`没有活动会话可命名`,"i18n.noAssistantMessageToCopy":`没有可复制的助手消息`,"i18n.commandCompleted":`命令已完成`,"i18n.commandFailed":`命令失败`,"i18n.extensionCommandFailed":`扩展命令失败`,"i18n.compactedContext":`上下文已压缩`,"i18n.reloadedSessionResources":`会话资源已重新加载`,"i18n.usageName":`用法:/name <名称>`,"i18n.sessionRenamedTo":`会话已重命名为 {name}`,"i18n.copiedLastAssistantMessage":`已复制最后一条助手消息`,"i18n.failedToRecallQueuedMessages":`恢复排队消息失败`,"i18n.noBranches":`此会话没有分支`,"i18n.source":`源代码`,"i18n.preview":`预览`,"i18n.diff":`Diff`,"i18n.downloadFile":`下载文件`,"i18n.liveSync":`实时同步已启用`,"i18n.notWatching":`未监视`,"i18n.fileViewMode":`文件视图模式`,"i18n.editMode":`编辑模式`,"i18n.viewMode":`查看模式`,"i18n.compareHead":`比较工作区与 HEAD`,"i18n.mentionSelectedLines":`提及所选行`,"i18n.disableWrap":`禁用自动换行`,"i18n.enableWrap":`启用自动换行`,"i18n.editFile":`编辑文件`,"i18n.saveFile":`保存`,"i18n.saveFileShortcut":`保存(Ctrl/Cmd+S)`,"i18n.cancelEdit":`取消`,"i18n.saveFailed":`保存失败:{error}`,"i18n.unsavedChanges":`有未保存的修改`,"i18n.htmlPreview":`HTML 预览`,"i18n.previewFile":`预览 {file}`,"i18n.invalidMermaid":`Mermaid 图表无效`,"i18n.renderingMermaid":`正在渲染 Mermaid 图表`,"i18n.previewAfterStreaming":`流式输出完成后可预览`,"i18n.showMermaidSource":`显示 Mermaid 源码`,"i18n.previewMermaid":`预览 Mermaid 图表`,"i18n.openMermaidViewer":`打开图表查看器`,"i18n.mermaidViewer":`Mermaid 图表查看器`,"i18n.mermaidDiagram":`Mermaid 图表`,"i18n.zoomOut":`缩小`,"i18n.zoomIn":`放大`,"i18n.fitToWidth":`适应宽度`,"models.discoveryFetching":`正在导入模型…`,"models.deleteProviderConfirm":`确定删除 provider「{name}」?该操作会立即写入 models.json,其全部配置(含 API key)将被移除且无法恢复。`,"models.removeModelConfirm":`确定移除模型「{model}」?该操作会立即写入 models.json 且无法恢复。`,"models.discoveryTitle":`导入模型`,"models.discoveryFetch":`导入模型…`,"models.discoveryFilterPlaceholder":`筛选 {count} 个模型…`,"models.discoveryFilter":`筛选上游模型`,"models.discoverySelectShown":`选择当前结果`,"models.discoveryNoMatches":`没有匹配的模型。`,"models.discoveryAdded":`已添加`,"models.discoveryShowing":`显示前 {shown} 个,共 {total} 个`,"models.discoveryFetched":`已获取 {count} 个模型`,"models.discoveryAddSelected":`添加所选模型`,"models.setDefault":`设为默认`,"models.defaultModel":`默认模型`,"models.defaultModelUnavailable":`默认模型 {model} 不可用(已删除或已隐藏),请选择模型。`,"models.syncEndpoint":`从端点同步`,"models.lastSyncedAt":`上次同步:{time}`,"models.neverSynced":`未同步过`,"models.discoveryFetchTooltip":`优先从本地缓存导入:{path};无缓存时自动执行一次从端点同步并写入该缓存。`,"models.syncingModels":`同步中…`,"models.syncedModels":`已同步 {count} 个模型`,"models.syncEndpointTooltip":`从 {endpoint} 拉取最新模型列表并缓存到本地;有缓存时优先于内置列表使用。`,"models.syncEndpointTooltipGeneric":`从该供应商的 models 端点拉取最新模型列表并缓存到本地;有缓存时优先于内置列表使用。`,"models.refreshFromCache":`从同步缓存刷新`,"models.refreshing":`刷新中…`,"models.refreshFromCacheTooltip":`重新读取 pi-web/provider/{provider}/models.json,只更新与当前生效定义不同的字段(headers 等手动字段保留)。`,"models.refreshNoDiff":`同步缓存与当前生效定义一致,无需更新。`,"models.refreshDone":`已从同步缓存更新覆写字段。`,"models.refreshTimeout":`刷新超时,请稍后重试。`,"models.builtinProviders":`内置 Provider`,"models.customProviders":`自定义 Provider`,"models.syncSaveFailed":`同步前保存草稿失败,已中止同步。`,"models.visibleInChat":`聊天可见`,"models.visibleModels":`可见模型`,"models.visibleModelsCount":`可见 {visible} / 共 {total}`,"models.selectAll":`全选`,"models.invertSelection":`反选`,"models.searchModels":`搜索模型…`,"models.noVisibleModels":`无模型。`,"models.filterAll":`全部`,"models.filterVisible":`可见`,"models.filterHidden":`隐藏`,"models.invertDisabledTooltip":`所有模型均已可见,反选不会改变任何状态`,"models.openOverride":`编辑覆写`,"models.overrideHint":`当前显示为合并后的有效值(内置定义 + 已保存的覆写)。只有你修改过的字段会作为覆写保存,其余字段继续继承内置定义。`,"models.overrideOrphanedHint":`该模型已从上游删除,覆写仍保留在本地。可在此删除覆写,保存后会一并清理可见性配置。`,"models.removeOverride":`移除覆写`,"models.providerNameCollision":`Provider "{provider}" 与内置 "{builtin}"(大小写不敏感)冲突,模型可见性无法生效,请重命名或删除该 provider。`,"models.providerNameCollisionShort":`与内置 provider 撞名`,"models.builtinVisibilityBlocked":`模型可见性已禁用:自定义 provider "{custom}" 与 "{builtin}"(大小写不敏感)冲突,请重命名或删除该自定义 provider。`,"models.discoveryAddSelectedCount":`添加所选模型({count})`,"models.dataSourceLabel":`数据来源:`,"models.catalogSourceEndpoint":`模型端点`,"models.catalogSourceDev":`models.dev 目录`,"models.catalogSourceEndpointTooltip":`数据来源:Provider 的 /models 端点`,"models.catalogSourceDevTooltip":`数据来源:models.dev 内置目录(https://models.dev)`,"models.catalogEndpointNotFound":`模型端点返回中未找到该模型 ID`,"models.catalogOverwriteTitle":`覆盖已有字段?`,"models.catalogOverwriteBody":`以下 {{count}} 个字段已有值,覆盖填入将修改它们:{{fields}}。取消则仅填充空字段。`,"models.catalogOverwriteConfirm":`覆盖并填入`,"models.catalogOverwriteCancel":`仅填空字段`,"models.catalogFilling":`正在填入模型信息…`,"models.catalogFill":`填入模型信息`,"models.catalogFilled":`已填入 {count} 个字段`,"models.catalogNoEmptyFields":`没有需要填入的空字段`,"models.catalogNoExactMatch":`models.dev 中没有精确匹配`,"models.catalogPriceProvider":`价格已匹配 Provider {provider}`,"models.catalogPriceBaseUrl":`价格已按 Base URL 匹配 {provider}`,"models.catalogPriceConsensus":`价格得到 {support}/{total} 条记录支持`,"models.catalogPriceUnreliable":`未找到可靠价格`,"models.catalogUndo":`撤销`,"models.baseUrl":`Base URL`,"models.apiKey":`API 密钥`,"models.api":`API 格式`,"models.modelId":`ID *`,"models.name":`名称`,"models.apiOverride":`API 覆盖`,"models.reasoningThinking":`推理 / 思考`,"models.imageInput":`图片输入`,"models.imageInputHint":`勾选时写入 input: ["text", "image"];取消勾选则移除 input(回落默认 ["text"])。`,"models.nameHint":`留空删除 name 字段(回落使用模型 id)。`,"models.apiOverrideHint":`留空或选默认删除 api 字段(回落使用 provider 默认 api)。`,"models.reasoningHint":`取消勾选删除 reasoning 字段(回落关闭)。`,"models.compatBoolTrueHint":`未勾选不等于 false:pi 将缺失字段视为 true。取消勾选会写入显式 false,才能真正关闭。`,"models.compatBoolHint":`勾选写入 true;取消勾选删除该字段(回落 auto-detect / false 默认)。`,"models.compatSelectHint":`选「默认/none」删除该字段(回落 auto-detect)。`,"models.thinkingLevelMapHint":`每个级别三种状态:Default=删除该级别映射(回落模型默认级别);Disabled=写入 null 禁用;Custom=写入自定义级别字符串。`,"models.compatSection":`兼容性`,"models.compatInheritHint":`模型自身未设置的项显示从 provider 继承的生效值(标注「· 来自 provider」);在模型级设置后将覆盖继承值。`,"models.inheritedFromProvider":`· 来自 provider`,"models.thinkingFormatDeepseekHint":`选中 deepseek 时会额外写入 requiresReasoningContentOnAssistantMessages: true;选中其他值则移除。`,"models.samplingParams":`采样参数`,"models.headers":`请求头`,"models.modelOverrides":`模型覆盖`,"models.supportsDeveloperRole":`支持 developer role`,"models.supportsLongCacheRetention":`支持长缓存保留`,"models.supportsUsageInStreaming":`流式返回 token 用量`,"models.supportsFinishReason":`流式返回 finish_reason`,"models.supportsEagerToolInputStreaming":`工具输入流式预读`,"models.supportsCacheControlOnTools":`工具定义缓存控制`,"models.supportsTemperature":`支持 temperature 参数`,"models.requiresToolResultName":`工具结果需带 name`,"models.requiresAssistantAfterToolResult":`工具结果后需 assistant 消息`,"models.requiresThinkingAsText":`思考块转为文本`,"models.requiresReasoningContentOnAssistantMessages":`assistant 消息需 reasoning_content`,"models.zaiToolStream":`z.ai tool stream`,"models.supportsThinkingTokenBudget":`支持思考 token 预算`,"models.supportsOpenAIGrammarTools":`支持 OpenAI 语法工具`,"models.sendSessionAffinityHeaders":`发送会话亲和请求头`,"models.supportsToolSearch":`支持工具搜索`,"models.supportsExplicitPromptCacheMode":`显式提示缓存模式`,"models.forceAdaptiveThinking":`强制自适应思考`,"models.allowEmptySignature":`允许空思考签名`,"models.supportsStrictTools":`严格工具 schema`,"models.supportsStore":`支持 store 参数`,"models.supportsReasoningEffort":`支持 reasoning_effort`,"models.supportsStrictMode":`严格模式`,"models.supportsToolReferences":`支持工具引用`,"models.maxTokensField":`最大 token 字段`,"models.sessionAffinityFormat":`会话亲和格式`,"models.deferredToolsMode":`延迟工具模式`,"models.cacheControlFormat":`缓存控制格式`,"models.thinkingFormat":`思考格式`,"models.chatTemplateKwargs":`聊天模板 kwargs`,"models.chatTemplateArgs":`聊天模板 args`,"models.openRouterRouting":`OpenRouter 路由`,"models.vercelGatewayRouting":`Vercel 网关路由`,"models.thinkingLevelMap":`思考级别映射`,"models.contextWindow":`上下文窗口(tokens)`,"models.maxOutputTokens":`最大输出 tokens`,"models.costPerMillion":`成本(每百万 tokens)`,"models.apiKeyPlaceholder":`ENV_VAR_NAME、!shell-command 或字面密钥`,"models.apiKeyHint":`以 ! 开头执行 shell 命令,或使用环境变量名`,"models.apiKeyStored":`已保存 API 密钥。在下方输入新密钥即可替换,或断开连接以移除。`,"models.apiKeyPrompt":`输入 {provider} 的 API 密钥以启用 {count} 个模型。`,"models.apiKeyReplacePlaceholder":`输入新密钥以替换…`,"models.oauthAlreadyConnected":`已连接。可重新登录或断开连接。`,"models.oauthConnectPrompt":`连接你的 {provider} 账户。`,"models.enterValue":`输入值…`,"models.displayNamePlaceholder":`显示名称`,"models.connectionLost":`连接已断开`,"models.networkError":`网络错误`,"i18n.testingModel":`正在测试模型连接...`,"i18n.connected":`已连接`,"i18n.failed":`失败`,"i18n.test":`测试`,"i18n.testConnection":`测试模型连接`,"i18n.provider":`Provider`,"i18n.providers":`提供商`,"i18n.model":`模型`,"i18n.providerName":`Provider 名称`,"i18n.rename":`重命名`,"i18n.default":`默认`,"i18n.disabled":`已禁用`,"plugins.statusLoaded":`已加载并生效`,"plugins.statusInstalled":`已安装,尚未加载`,"plugins.statusDisabled":`已禁用`,"plugins.statusMissing":`已配置但包未找到`,"plugins.extensionFilters":`扩展过滤`,"plugins.filterRules":`过滤规则`,"plugins.managePlugins":`插件管理`,"plugins.extensionFiltersHint":`对 ~/.pi/agent/extensions/ 与 .pi/extensions/ 自动发现目录内扩展的过滤规则。仅以 !、+、- 开头的规则生效;纯路径填写无效。`,"plugins.noExtensionFilters":`未配置过滤规则`,"plugins.addFilter":`添加过滤`,"plugins.filterPatternLabel":`规则`,"plugins.filterPlaceholder":`!pattern · +path · -path`,"plugins.filterInvalid":`规则必须以 !、+ 或 - 开头;纯路径在 extensions 字段中无效。`,"plugins.filterPrefixExclude":`排除匹配的扩展`,"plugins.filterPrefixForceInclude":`强制包含精确路径`,"plugins.filterPrefixForceExclude":`强制排除精确路径`,"plugins.filterEffect":`效果`,"plugins.removeFilter":`移除过滤`,"plugins.npmSourcePlaceholder":`npm:@scope/package`,"plugins.packageInstalled":`包已安装。`,"plugins.packageUpdated":`包已更新。`,"plugins.packageRemoved":`包已移除。`,"plugins.packageDisabled":`包已禁用。`,"plugins.packageEnabled":`包已启用。`,"plugins.extensionFilterAdded":`扩展过滤已添加。`,"plugins.extensionFilterRemoved":`扩展过滤已移除。`,"plugins.sessionReloaded":`会话已重载。`,"i18n.noResources":`没有资源`,"i18n.unknown":`未知`,"i18n.installedVersion":`已安装 {version}`,"i18n.configuredVersion":`已配置 {version}`,"i18n.extensions":`扩展`,"i18n.prompts":`提示词`,"i18n.themes":`主题`,"i18n.resourceCount":`{count}{label}`,"i18n.extensionShort":`扩展`,"i18n.versionShort":`版本`,"i18n.skillShort":`技能`,"i18n.promptShort":`提示词`,"i18n.themeShort":`主题`,"i18n.custom":`自定义`,"i18n.clearAll":`清除全部`,"i18n.connectedSuccessfully":`连接成功。`,"i18n.notConnected":`未连接`,"i18n.configured":`已配置`,"i18n.notConfigured":`未配置`,"i18n.openingBrowser":`正在打开浏览器…`,"i18n.submit":`提交`,"i18n.login":`登录`,"i18n.relogin":`重新登录`,"i18n.disconnect":`断开连接`,"i18n.networkError":`网络错误`,"i18n.continuing":`继续中…`,"i18n.skills":`技能`,"i18n.plugins":`插件`,"i18n.addSkill":`添加技能`,"i18n.addPlugin":`添加插件`,"i18n.recommendedPlugins":`推荐插件`,"i18n.selectSkill":`选择技能`,"i18n.selectPackage":`选择包`,"i18n.configBindings":`绑定的配置文件`,"i18n.addBinding":`添加`,"i18n.configFileNote":`备注(可选)`,"i18n.bindConfigFile":`绑定配置文件`,"i18n.selectFile":`选择文件`,"i18n.noConfigBindings":`尚未绑定配置文件`,"i18n.noFiles":`没有文件`,"i18n.allFiles":`全部文件`,"i18n.filterByType":`按类型筛选`,"i18n.removeBinding":`删除绑定`,"i18n.confirm":`确认`,"i18n.updateAvailable":`有可用更新`,"i18n.upToDate":`已是最新`,"i18n.automaticChecksUnavailable":`自动检查不可用`,"i18n.checkFailed":`检查失败`,"i18n.installed":`已安装`,"i18n.status":`状态`,"i18n.version":`版本`,"i18n.package":`包`,"i18n.resources":`资源`,"i18n.installedPath":`安装路径`,"i18n.readme":`README`,"i18n.readmeDetails":`详情`,"i18n.unsafeLinkBlocked":`已阻止不安全链接(仅允许同目录或子目录的相对链接):{href}`,"i18n.resolvedResources":`已解析资源`,"i18n.reloadSession":`重新加载会话`,"i18n.reloading":`重新加载中...`,"i18n.packageRemoved":`包已移除。`,"i18n.packageInstalled":`包已安装。`,"i18n.packageUpdated":`包已更新。`,"i18n.packageDisabled":`包已禁用。`,"i18n.packageEnabled":`包已启用。`,"i18n.sessionReloaded":`会话已重新加载。`,"i18n.thinking":`思考`,"i18n.loadingThinking":`正在加载思考内容...`,"i18n.copyMessage":`复制消息`,"i18n.editFromHere":`从此处编辑`,"i18n.editFromHereTitle":`从此处编辑,此会话内创建分支`,"i18n.newSession":`新会话`,"i18n.newSessionTitle":`新会话,从此处创建独立副本`,"i18n.estimatedTokens":`流式输出期间的估算 Token 数`,"i18n.noOutput":`(无输出)`,"i18n.noSummary":`(无摘要)`,"i18n.conversationCompacted":`会话已压缩`,"i18n.compactionDescription":`此处之前的会话历史已压缩为以下摘要:`,"i18n.fileContext":`文件上下文:{details}`,"i18n.readFiles":`读取的文件`,"i18n.modifiedFiles":`修改的文件`,"i18n.hiddenExtensionMessage":`隐藏的扩展消息`,"i18n.noMessage":`(无消息)`,"i18n.showExtensionMessage":`显示扩展消息`,"i18n.collapse":`收起`,"i18n.expand":`展开`,"i18n.hideDetails":`隐藏详情`,"i18n.showDetails":`显示详情`,"i18n.thinkingUnavailable":`思考内容不可用`,"i18n.thinkingEncrypted":`思考内容已加密(提供方加密,仅用于上下文连续,无法显示明文)`,"i18n.before":`之前`,"i18n.after":`之后`}},y=new Map;function b(e){if(!e.id.trim())throw Error(`Locale id must not be empty`);if(y.has(e.id))throw Error(`Locale already registered: ${e.id}`);y.set(e.id,e)}function x(e){return y.get(e)}function S(){return[...y.keys()]}function C(e){for(let t of e){let e=t.toLowerCase();if(e===`en`||e.startsWith(`en-`))return`en`;if(e===`zh`||e.startsWith(`zh-`))return`zh-CN`}return`en`}b(_),b(v);var w=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),T=n(((e,t)=>{t.exports=w()})),E=T(),D=`pi-locale`,O=`en`,k=(0,d.createContext)(null);function A(){return Object.fromEntries(S().flatMap(e=>{let t=x(e);return t?[[e,t.messages]]:[]}))}function j(){try{let e=window.localStorage.getItem(D);if(e===`en`||e===`zh-CN`)return e}catch{}return null}function M({children:e,initialLocale:t=null}){let[n,r]=(0,d.useState)(()=>typeof window>`u`?t??O:j()??t??C(window.navigator.languages.length?window.navigator.languages:[window.navigator.language])),i=(0,d.useMemo)(()=>S().map(e=>x(e)).filter(e=>!!e),[]),a=(0,d.useMemo)(()=>A(),[]),o=(0,d.useCallback)(e=>{if(x(e)){r(e),document.documentElement.lang=e;try{window.localStorage.setItem(D,e)}catch{}fetch(`/api/preferences`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({firstPaint:{locale:e}})}).catch(e=>console.error(`[pi-web] save locale:`,e))}},[]),s=(0,d.useCallback)((e,t)=>h(n,e,a,t),[n,a]),c=(0,d.useMemo)(()=>({locale:n,setLocale:o,t:s,supportedLocales:i}),[n,o,s,i]);return(0,E.jsx)(k.Provider,{value:c,children:e})}function N(){let e=(0,d.useContext)(k);if(!e)throw Error(`useI18n must be used inside I18nProvider`);return e}function P(e){return{value:(0,d.useSyncExternalStore)(t=>e.subscribe(t),()=>e.get(),()=>e.get()),error:e.getError()}}var ee=`(max-width: 640px)`;function F(e){if(typeof window>`u`||!window.matchMedia)return()=>{};let t=window.matchMedia(ee);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function I(){return typeof window>`u`||!window.matchMedia?!1:window.matchMedia(ee).matches}function te(){return!1}function ne(){return(0,d.useSyncExternalStore)(F,I,te)}var re=null;function ie(e){re=e}function ae(e){let{onNewSession:t,activeCwd:n}=e;(0,d.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){if(!re)return;let t=e.target?.tagName;if(t===`TEXTAREA`||t===`INPUT`)return;e.preventDefault(),re();return}if(e.key===`n`&&e.ctrlKey&&e.altKey){if(!n||!t)return;e.preventDefault(),t(n)}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n,t])}function L(){let[e,t]=(0,d.useState)(()=>typeof Notification>`u`?`unsupported`:Notification.permission);return(0,d.useEffect)(()=>{if(typeof Notification>`u`)return;let e=!1,n,r=()=>{e||t(Notification.permission)};return typeof navigator.permissions?.query==`function`&&navigator.permissions.query({name:`notifications`}).then(t=>{e||(n=t,r(),t.addEventListener(`change`,r))}).catch(()=>{}),()=>{e=!0,n?.removeEventListener(`change`,r)}},[]),e}var R=1200,oe=320,z=420;function se(e,t,n){return Math.round(Math.max(t,Math.min(Math.max(t,n),Number.isFinite(e)?e:t)))}function ce(e){let{viewportWidth:t,rightPanelOpen:n,rightPanelWidth:r}=e;if(t<=640)return 480;let i=t<960,a=i?oe:z,o=!i&&n?r:0;return Math.min(480,t-a-o)}function le(e){let{viewportWidth:t,sidebarOpen:n,sidebarWidth:r}=e;if(t<960)return R;let i=n?r:0;return Math.min(R,t-z-i)}function ue(e){try{let t=window.localStorage.getItem(e);if(t===null)return null;let n=Number.parseInt(t,10);return Number.isFinite(n)?n:null}catch{return null}}function de(e,t){try{window.localStorage.setItem(e,String(t))}catch{}}function fe(e){let{ariaLabel:t,cssVariable:n,defaultWidth:r,getDefaultWidth:i,getMaxWidth:a,growthDirection:o,maxWidth:s,minWidth:c,storageKey:l,widthRef:u}=e,f=(0,d.useRef)(null),p=(0,d.useRef)(null),m=(0,d.useRef)(!1),[h,g]=(0,d.useState)(r),[_,v]=(0,d.useState)(!1),y=(0,d.useCallback)(()=>Math.min(s,Math.max(c,a())),[a,s,c]),b=(0,d.useCallback)(e=>se(e,c,y()),[y,c]),x=(0,d.useCallback)(e=>{u.current=e,f.current?.style.setProperty(n,`${e}px`)},[n,u]),S=(0,d.useCallback)((e,t={})=>{let{forcePersist:n=!1,persist:r=!0}=t,i=b(e),a=i!==u.current;return x(i),g(i),r&&(a||n)&&de(l,i),i},[x,b,l,u]),C=(0,d.useCallback)(e=>{document.body.style.cursor=e.previousCursor,document.body.style.userSelect=e.previousUserSelect},[]),w=(0,d.useCallback)(e=>{let t=p.current;if(!(!t||t.pointerId!==e)){p.current=null,C(t),v(!1),S(u.current,{forcePersist:!0});try{t.target.hasPointerCapture(e)&&t.target.releasePointerCapture(e)}catch{}}},[S,C,u]),T=(0,d.useCallback)(e=>{if(e.pointerType===`mouse`&&e.button!==0)return;e.preventDefault(),e.stopPropagation();let t=p.current;t&&w(t.pointerId);let n=e.currentTarget;n.focus({preventScroll:!0}),n.setPointerCapture(e.pointerId),p.current={pointerId:e.pointerId,startX:e.clientX,startWidth:u.current,target:n,previousCursor:document.body.style.cursor,previousUserSelect:document.body.style.userSelect},document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`,v(!0)},[w,u]),E=(0,d.useCallback)(e=>{let t=p.current;if(!t||t.pointerId!==e.pointerId)return;if(e.pointerType===`mouse`&&e.buttons===0){w(e.pointerId);return}e.preventDefault();let n=o===`right`?1:-1,r=b(t.startWidth+(e.clientX-t.startX)*n);x(r),e.currentTarget.setAttribute(`aria-valuenow`,String(r)),e.currentTarget.setAttribute(`aria-valuetext`,`${r} px`)},[x,b,w,o]),D=(0,d.useCallback)(e=>{w(e.pointerId)},[w]),O=(0,d.useCallback)(e=>{w(e.pointerId)},[w]),k=(0,d.useCallback)(e=>{w(e.pointerId)},[w]),A=(0,d.useCallback)(()=>{let e=i?.()??r;S(e,{forcePersist:!0})},[S,r,i]),j=(0,d.useCallback)(()=>{S(u.current)},[S,u]),M=(0,d.useCallback)(e=>{let t=e.shiftKey?32:12,n=o===`right`?`ArrowRight`:`ArrowLeft`,r=o===`right`?`ArrowLeft`:`ArrowRight`;e.key===n?(e.preventDefault(),S(u.current+t,{forcePersist:!0})):e.key===r?(e.preventDefault(),S(u.current-t,{forcePersist:!0})):e.key===`Home`?(e.preventDefault(),S(c,{forcePersist:!0})):e.key===`End`?(e.preventDefault(),S(y(),{forcePersist:!0})):e.key===`Enter`&&(e.preventDefault(),A())},[S,y,o,c,A,u]);return(0,d.useEffect)(()=>{if(m.current)return;m.current=!0;let e=ue(l),t=e??i?.()??r,n=S(t,{persist:!1});e!==null&&e!==n&&de(l,n)},[S,r,i,l]),(0,d.useEffect)(()=>{if(!m.current)return;S(u.current);let e=()=>{S(u.current)};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[S,u]),(0,d.useEffect)(()=>{if(!_)return;let e=()=>{let e=p.current;e&&w(e.pointerId)},t=()=>{document.visibilityState!==`visible`&&e()};return window.addEventListener(`blur`,e),document.addEventListener(`visibilitychange`,t),()=>{window.removeEventListener(`blur`,e),document.removeEventListener(`visibilitychange`,t)}},[w,_]),(0,d.useEffect)(()=>()=>{let e=p.current;e&&(p.current=null,C(e))},[C]),{isResizing:_,panelRef:f,reclampWidth:j,resetWidth:A,setWidth:e=>S(e,{forcePersist:!0}),separatorProps:{"aria-label":t,"aria-orientation":`vertical`,"aria-valuemax":y(),"aria-valuemin":c,"aria-valuenow":h,"aria-valuetext":`${h} px`,onDoubleClick:A,onKeyDown:M,onLostPointerCapture:k,onPointerCancel:O,onPointerDown:T,onPointerMove:E,onPointerUp:D,role:`separator`,tabIndex:0},width:h}}function pe(){let e=(0,d.useRef)(null),t=(0,d.useCallback)(()=>{e.current!==null&&(clearTimeout(e.current),e.current=null)},[]),n=(0,d.useCallback)((n,r)=>{t(),e.current=setTimeout(()=>{e.current=null,n()},r)},[t]);return(0,d.useEffect)(()=>()=>t(),[t]),(0,d.useMemo)(()=>({schedule:n,cancel:t}),[n,t])}function me(e){let{fetcher:t,ttlMs:n=6e4}=e,r=null,i=null,a=0,o=null,s=new Set,c=()=>{for(let e of[...s])try{e()}catch{}},l=async e=>{try{let o=await t(e);return r=o,i=null,a=Date.now()+n,o}catch(e){throw i=e instanceof Error?e.message:String(e),e}finally{o=null}},u=e=>(o||=l(e).then(e=>(c(),e)),o),d=(e,t)=>new Promise((n,r)=>{if(e.aborted){r(new DOMException(`Aborted`,`AbortError`));return}let i=()=>r(new DOMException(`Aborted`,`AbortError`));e.addEventListener(`abort`,i,{once:!0}),t.then(n,r).finally(()=>e.removeEventListener(`abort`,i))});return{get:()=>r,getError:()=>i,load:e=>{if(r!==null&&Date.now()<a)return Promise.resolve(r);let t=u(!1);return e?d(e,t):t},refresh:e=>{a=0;let t=u(!0);return e?d(e,t):t},subscribe:e=>(s.add(e),()=>s.delete(e)),clear:()=>{r=null,i=null,a=0}}}async function he(e,t){let n=await fetch(e,t);if(!n.ok)throw Error(`HTTP ${n.status}`);return await n.json()}function ge(){return`/api/sessions`}var _e=me({fetcher:()=>he(`/api/models`)}),ve=me({fetcher:()=>he(ge(),{cache:`no-store`})}),ye=me({fetcher:()=>he(`/api/preferences`)}),be=me({fetcher:()=>he(`/api/models-config`)}),xe=me({fetcher:()=>he(`/api/plugins/global`)}),Se=null;function Ce(e){Se=e}var we=me({fetcher:e=>{let t=Se?`?cwd=${encodeURIComponent(Se)}`:``;return he(`/api/updates${t}${t?`&`:`?`}refresh=${e?`1`:`0`}`)}}),Te=me({fetcher:e=>he(`/api/skills/global`,e?{cache:`no-store`}:void 0)}),Ee=me({fetcher:e=>he(`/api/commands/global`,e?{cache:`no-store`}:void 0)}),De=me({fetcher:()=>he(`/api/model-thinking`)}),Oe=me({fetcher:async()=>{let[e,t]=await Promise.all([he(`/api/auth/providers`),he(`/api/auth/all-providers`)]);return{oauth:e.providers,apiKey:t.providers}}}),ke=`pi-web`;function Ae(e,t){let n=je(e),r=je(t),i=Math.max(n.length,r.length);for(let e=0;e<i;e++){let t=n[e]??0,i=r[e]??0;if(t>i)return 1;if(t<i)return-1}return 0}function je(e){return e.replace(/^v/i,``).split(/[-+]/)[0].split(`.`).map(e=>{let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t})}function Me({current:e,latest:t},n){return t!==null&&t!==n&&Ae(t,e)>0}function Ne(e){return e.enabled!==!1}function Pe(e,t){return t[e]===`*`}function Fe(e){if(!Ne(e))return 0;let t=e.ignored??{};return+!!Me(e.piWeb,t[`pi-web`])+e.plugins.filter(e=>!Pe(e.source,t)).length}function Ie(e,t){if(!Ne(e))return[];let n=e.ignored??{},r=[];Me(e.piWeb,n[`pi-web`])&&r.push(`pi-web`);let i=e.plugins.filter(e=>!Pe(e.source,n)).length;return i>0&&r.push(`${i} ${t}`),r}var Le=(0,d.createContext)(null);function Re({value:e,children:t}){return(0,E.jsx)(Le.Provider,{value:e,children:t})}function ze(){let e=(0,d.useContext)(Le);if(!e)throw Error(`useSettings must be used within SettingsProvider`);return e}var Be=class extends Error{constructor(e,t,n){super(e),this.name=`ApiError`,this.status=t,this.body=n}},Ve=20,He=[],Ue=1,We=new Set;function Ge(){for(let e of We)e()}function Ke(e,t){if(e instanceof Be)console.error(`[pi-web] ${t??`api error`}`,e),He=[...He,{id:Ue++,kind:`api`,status:e.status,message:e.message,body:e.body,context:t,at:Date.now()}];else{let n=e instanceof Error?e.message:String(e);console.error(`[pi-web] ${t??`error`}`,e),He=[...He,{id:Ue++,kind:`generic`,message:n,context:t,at:Date.now()}]}He.length>Ve&&(He=He.slice(He.length-Ve)),Ge()}function qe(e){return We.add(e),()=>{We.delete(e)}}function Je(){return He}function Ye(){He=He.slice(0,-1),Ge()}function Xe(){He=[],Ge()}var Ze=e=>window.history.replaceState(null,``,e);function Qe({initialNavigation:e,onProjectSwitch:t,onSessionSelected:n,onTopPanelReset:r}){let[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(null),[c,l]=(0,d.useState)(()=>e.requestedCwd?`validating`:`idle`),[u,f]=(0,d.useState)(null),[p,m]=(0,d.useState)(0),[h,g]=(0,d.useState)(0),[_,v]=(0,d.useState)(0),[y,b]=(0,d.useState)(0),[x,S]=(0,d.useState)(()=>!e.sessionId),[C,w]=(0,d.useState)(null),T=(0,d.useRef)(null),E=(0,d.useRef)(!1),D=(0,d.useRef)(!1),[O,k]=(0,d.useState)(null),[A,j]=(0,d.useState)(!1),[M,N]=(0,d.useState)(!1),[P,ee]=(0,d.useState)(null);(0,d.useEffect)(()=>{let t=e.requestedCwd;if(!t)return;let n=new AbortController;return l(`validating`),f(null),fetch(`/api/cwd/validate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:t}),signal:n.signal}).then(async e=>{let t=await e.json().catch(()=>({}));if(!e.ok||!t.cwd)throw Error(t.error??`HTTP ${e.status}`);E.current=!0,s(t.cwd),l(`ready`)}).catch(e=>{n.signal.aborted||(f(e instanceof Error?e.message:String(e)),l(`error`))}),()=>n.abort()},[e]);let F=o??(i===null&&C?C:null),I=i!==null||F!==null,te=i?.cwd??F;(0,d.useEffect)(()=>{if(k(null),j(!1),ee(null),!te)return;let e=new AbortController,t=new URLSearchParams(window.location.search).get(`piE2eTrustCwd`);return fetch(`/api/project-trust?cwd=${encodeURIComponent(te)}${t?`&piE2eTrustCwd=${encodeURIComponent(t)}`:``}`,{signal:e.signal}).then(async e=>{let t=await e.json();if(!e.ok||t.error)throw Error(t.error??`HTTP ${e.status}`);k(t)}).catch(e=>{e instanceof DOMException&&e.name===`AbortError`||console.error(`Failed to load project trust:`,e)}),()=>e.abort()},[te]);let ne=(0,d.useCallback)(e=>{ve.load().then(t=>{let n=t.sessions.find(t=>t.id===e);n&&a(t=>t&&t.id===e&&!t.projectRoot?n:t)}).catch(e=>console.error(`[pi-web] hydrate session:`,e))},[]),re=(0,d.useCallback)((e,t=!1)=>{!t&&D.current||(s(null),a(e),g(e=>e+1),S(!0),t&&(E.current=!0),t||Ze(`?session=${encodeURIComponent(e.id)}`),n?.(t))},[n]),ie=(0,d.useCallback)(async(e,t)=>{await fetch(`/api/cwd/validate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:t})}).catch(e=>Ke(e,`validate cwd`)),a(null),s(t),g(e=>e+1),r?.(),n?.(!1),Ze(`/`)},[n,r]),ae=(0,d.useCallback)(e=>{s(null),a(e),m(e=>e+1),ne(e.id),Ze(`?session=${encodeURIComponent(e.id)}`)},[ne]),L=(0,d.useCallback)(()=>{m(e=>e+1),v(e=>e+1)},[]),R=(0,d.useCallback)((e,t)=>{a(n=>n&&n.id===e?{...n,name:t}:n),m(e=>e+1)},[]),oe=(0,d.useCallback)(()=>{v(e=>e+1)},[]),z=(0,d.useCallback)(()=>{S(!0)},[]);return{selectedSession:i,setSelectedSession:a,newSessionCwd:o,effectiveNewSessionCwd:F,showChat:I,projectTrustCwd:te,refreshKey:p,setRefreshKey:m,explorerRefreshKey:_,setExplorerRefreshKey:v,modelsRefreshKey:y,setModelsRefreshKey:b,sessionKey:h,activeCwd:C,initialCwdStatus:c,initialCwdError:u,initialSessionRestored:x,projectTrust:O,projectTrustDialogOpen:A,setProjectTrustDialogOpen:j,projectTrustBusy:M,projectTrustError:P,setProjectTrustError:ee,extensionDialogActiveRef:D,handleSelectSession:re,handleNewSession:ie,handleSessionCreated:ae,handleAgentEnd:L,handleSessionRenamed:R,handleSessionForked:(0,d.useCallback)(e=>{m(e=>e+1),g(e=>e+1),s(null),a(t=>({...t??{path:``,cwd:``,created:``,modified:``,messageCount:0,firstMessage:``},id:e})),ne(e),Ze(`?session=${encodeURIComponent(e)}`)},[ne]),handleSessionDeleted:(0,d.useCallback)(e=>{if(m(e=>e+1),i?.id===e){let e=i.cwd;a(null),s(e??null),g(e=>e+1),r?.(),Ze(`/`)}},[i,r]),handleSessionUnseen:(0,d.useCallback)(e=>{i?.id===e&&(a(null),g(e=>e+1),r?.(),Ze(`/`))},[i,r]),handleCwdChange:(0,d.useCallback)((e,n)=>{if(w(e),!e)return;let r=n??e,o=T.current??(i?i.projectRoot??i.cwd:null);if(!o){T.current=r;return}if(T.current=r,E.current){E.current=!1;return}o!==r&&(i?i.projectRoot??i.cwd:null)!==r&&(a(null),s(t=>t&&t!==e?null:t),g(e=>e+1),t?.())},[i,t]),handleTrustProject:(0,d.useCallback)(async()=>{if(!(!te||M)){N(!0),ee(null);try{let e=await fetch(`/api/project-trust`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:te})}),t=await e.json();if(!e.ok||t.error)throw Error(t.error??`HTTP ${e.status}`);k(t),j(!1),b(e=>e+1),g(e=>e+1)}catch(e){ee(e instanceof Error?e.message:String(e))}finally{N(!1)}}},[M,te]),handleExplorerRefresh:oe,handleInitialRestoreDone:z}}var $e=(0,d.createContext)(null);function et({value:e,children:t}){return(0,E.jsx)($e.Provider,{value:e,children:t})}function tt(){let e=(0,d.useContext)($e);if(!e)throw Error(`useTopPanel must be used within TopPanelProvider`);return e}var nt=`pi-web-auto-reload-seconds`,rt=3600;function it(e){let t=e.trim();if(t===``)return null;let n=Number(t);return!Number.isInteger(n)||n<0||n>3600?null:n}function at(){if(typeof window>`u`)return 0;let e=window.localStorage.getItem(nt);if(e===null)return 0;let t=it(e);return t===null?0:t}var ot=1e3,st=`pi-web-scroll-step-px`;function ct(e){let t=e.trim();if(t===``)return null;let n=Number(t);return!Number.isFinite(n)||!Number.isInteger(n)||n<1||n>1e3?null:n}function lt(){if(typeof window>`u`)return 200;try{return ct(window.localStorage.getItem(`pi-web-scroll-step-px`)??``)??200}catch{return 200}}var ut=1e4,dt=`pi-web-long-block-collapse-chars`;function ft(e){let t=e.trim();if(t===``)return null;let n=Number(t);return!Number.isFinite(n)||!Number.isInteger(n)||n<20||n>1e4?null:n}function pt(){if(typeof window>`u`)return 200;try{return ft(window.localStorage.getItem(`pi-web-long-block-collapse-chars`)??``)??200}catch{return 200}}var mt=`pi-web-long-block-recent-expanded`;function ht(e){let t=e.trim();if(t===``)return null;let n=Number(t);return!Number.isFinite(n)||!Number.isInteger(n)||n<0||n>20?null:n}function gt(){if(typeof window>`u`)return 0;try{return ht(window.localStorage.getItem(`pi-web-long-block-recent-expanded`)??``)??0}catch{return 0}}function _t(e,t,n,r){return e===`toolCall`?`tool:${n}`:`thinking:${t}:${r}`}var vt=`pi-web-notify-events`,yt={taskComplete:!0,errors:!0,questions:!0,notifyWhileActive:!1};function bt(){if(typeof window>`u`)return yt;try{let e=window.localStorage.getItem(vt);if(!e)return yt;let t=JSON.parse(e);return{taskComplete:t.taskComplete??yt.taskComplete,errors:t.errors??yt.errors,questions:t.questions??yt.questions,notifyWhileActive:t.notifyWhileActive??yt.notifyWhileActive}}catch{return yt}}function xt(e){window.localStorage.setItem(vt,JSON.stringify(e))}function St(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(typeof n!=`string`||n===``||typeof r!=`object`||!r)continue;let{x:e,y:i,width:a,height:o,collapsed:s}=r;typeof e!=`number`||!Number.isFinite(e)||typeof i!=`number`||!Number.isFinite(i)||typeof a!=`number`||!Number.isFinite(a)||a<=0||typeof o!=`number`||!Number.isFinite(o)||o<=0||(t[n]={x:e,y:i,width:a,height:o,collapsed:typeof s==`boolean`?s:void 0})}return t}var Ct=[{label:{en:`Explore project`,"zh-CN":`阅读项目`},message:{en:`Explore the current project and summarize the overall directory structure and responsibilities of core modules.`,"zh-CN":`阅读当前项目,总结整体目录结构与核心模块的职责。`}},{label:{en:`Review workspace changes`,"zh-CN":`审查工作区改动`},message:{en:`Review all changes in the current workspace, point out potential issues and improvements.`,"zh-CN":`审查当前工作区的所有改动,指出潜在问题与改进点。`}},{label:{en:`Find and fix bugs`,"zh-CN":`寻找并修复bug`},message:{en:`Inspect the current codebase, find and fix existing bugs.`,"zh-CN":`检查当前代码,寻找并修复其中存在的 bug。`}}];function wt(e,t){return typeof e==`string`?e:t===`zh-CN`?e[`zh-CN`]??e.zh??e.en??``:e.en??e[`zh-CN`]??e.zh??``}function Tt(e){let t=e.trim();return{en:t,"zh-CN":t}}function Et(e,t,n){let r=t.trim();if(typeof e==`string`){let t=e.trim();return n===`zh-CN`?{en:t,"zh-CN":r}:{en:r,"zh-CN":t}}let i=typeof e.en==`string`?e.en:``,a=e[`zh-CN`]??e.zh??i;return n===`zh-CN`?{en:i,"zh-CN":r}:{en:r,"zh-CN":a}}function Dt(e,t){let n=wt(e,`en`),r=wt(e,`zh-CN`),i=wt(t,`en`),a=wt(t,`zh-CN`);return n===i||r===a}var Ot={阅读项目:{en:`Explore project`,"zh-CN":`阅读项目`},review工作区改动:{en:`Review workspace changes`,"zh-CN":`review工作区改动`},寻找并修复bug:{en:`Find and fix bugs`,"zh-CN":`寻找并修复bug`},"阅读当前项目,总结整体目录结构与核心模块的职责。":{en:`Explore the current project and summarize the overall directory structure and responsibilities of core modules.`,"zh-CN":`阅读当前项目,总结整体目录结构与核心模块的职责。`},"review 当前工作区的所有改动,指出潜在问题与改进点。":{en:`Review all changes in the current workspace, point out potential issues and improvements.`,"zh-CN":`review 当前工作区的所有改动,指出潜在问题与改进点。`},"检查当前代码,寻找并修复其中存在的 bug。":{en:`Inspect the current codebase, find and fix existing bugs.`,"zh-CN":`检查当前代码,寻找并修复其中存在的 bug。`}};function kt(e){if(typeof e==`string`){let t=e.trim();return t===``?null:Ot[t]??Tt(t)}if(typeof e==`object`&&e){let t=e,n=t.en,r=t[`zh-CN`]??t.zh,i=typeof n==`string`?n.trim():``,a=typeof r==`string`?r.trim():``;return i===``&&a===``?null:{en:i===``?a:i,"zh-CN":a===``?i:a}}return null}function At(e){if(!Array.isArray(e))return null;let t=[];for(let n of e){if(typeof n!=`object`||!n)continue;let{label:e,message:r,allowAppend:i}=n,a=kt(e),o=kt(r);if(!a||!o)continue;let s={label:a,message:o};i===!0&&(s.allowAppend=!0),t.push(s)}return t}function jt(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let t={};for(let[n,r]of Object.entries(e)){if(typeof n!=`string`||n===``)continue;let e=At(r);e&&e.length>0&&(t[n]=e)}return t}var Mt=`pluginConfigBindings`;function Nt(){if(typeof window>`u`)return{};try{let e=window.localStorage.getItem(Mt);if(!e)return{};let t=JSON.parse(e);if(t&&typeof t==`object`)return t}catch{}return{}}function Pt(){return`/api/preferences`}function Ft(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}var It=new Map,Lt=2e3;function Rt(e){let t=JSON.stringify(e),n=Date.now(),r=It.get(t);r!==void 0&&n-r<Lt||(It.set(t,n),fetch(Pt(),{method:`PUT`,headers:{"Content-Type":`application/json`},body:t}).catch(e=>console.error(`[pi-web] save preferences:`,e)).finally(()=>{ye.refresh().catch(e=>console.error(`[pi-web] refresh preferences:`,e))}))}var zt={defaultModel:``,defaultThinking:``},Bt=`pi-web-font-scale`,Vt=1,Ht=19.2;function Ut({isDark:e,toggleTheme:t}){let[n,r]=(0,d.useState)(()=>{if(typeof window>`u`)return Vt;let e=window.localStorage.getItem(Bt),t=e===null?NaN:Number(e);return Number.isFinite(t)&&t>=.85&&t<=1.3?t:Vt}),[i,a]=(0,d.useState)(()=>lt()),[o,s]=(0,d.useState)(()=>at()),[c,l]=(0,d.useState)(()=>pt()),[u,f]=(0,d.useState)(()=>gt()),[p,m]=(0,d.useState)(()=>bt());(0,d.useEffect)(()=>{xt(p),Rt({preferences:{notifyEvents:p}})},[p]);let[h,g]=(0,d.useState)(()=>St(ye.get()?.preferences?.widgets)??{}),_=(0,d.useRef)(!1),[v,y]=(0,d.useState)(()=>jt(ye.get()?.preferences?.widgetMessages)??{}),[b,x]=(0,d.useState)(()=>Ft(ye.get()?.preferences?.workspaces));(0,d.useEffect)(()=>{let e=!1;return ye.load().then(()=>{if(e)return;_.current=!0;let t=ye.get()?.preferences;g(St(t?.widgets)??{}),y(jt(t?.widgetMessages)??{}),x(Ft(t?.workspaces))}).catch(()=>{_.current=!0}),()=>{e=!0}},[]);let S=(0,d.useCallback)((e,t)=>{g(n=>{let r=n[e];return r&&r.x===t.x&&r.y===t.y&&r.width===t.width&&r.height===t.height&&r.collapsed===t.collapsed?n:{...n,[e]:t}})},[]);(0,d.useEffect)(()=>{_.current&&Rt({preferences:{widgets:h}})},[h]);let C=(0,d.useCallback)((e,t)=>{if((v[e]??[]).some(e=>Dt(e.label,t.label))){let e=typeof t.label==`string`?t.label:t.label?.en??t.label[`zh-CN`]??JSON.stringify(t.label);throw Error(`Name conflict: "${e}"`)}y(n=>({...n,[e]:[...n[e]??[],t]}))},[v,y]),w=(0,d.useCallback)((e,t)=>{y(n=>{let r=n[e];if(!r||t<0||t>=r.length)return n;let i={...n},a=r.filter((e,n)=>n!==t);return a.length===0?delete i[e]:i[e]=a,i})},[y]),T=(0,d.useCallback)((e,t,n)=>{if((v[e]??[]).some((e,r)=>r!==t&&Dt(e.label,n.label))){let e=typeof n.label==`string`?n.label:n.label?.en??n.label[`zh-CN`]??JSON.stringify(n.label);throw Error(`Name conflict: "${e}"`)}y(r=>{let i=r[e];if(!i||t<0||t>=i.length)return r;let a={...r},o=[...i];return o[t]=n,a[e]=o,a})},[v,y]);(0,d.useEffect)(()=>{_.current&&Rt({preferences:{widgetMessages:v}})},[v]);let E=(0,d.useCallback)(e=>{x(e),Rt({preferences:{workspaces:e}})},[x]),[D,O]=(0,d.useState)(()=>At(ye.get()?.preferences?.startScreenMessages)??Ct),k=(0,d.useCallback)(e=>{if(D.some(t=>Dt(t.label,e.label))){let t=typeof e.label==`string`?e.label:e.label?.en??e.label[`zh-CN`]??JSON.stringify(e.label);throw Error(`Name conflict: "${t}"`)}O(t=>[...t,e])},[D]),A=(0,d.useCallback)(e=>{O(t=>e<0||e>=t.length?t:t.filter((t,n)=>n!==e))},[]),j=(0,d.useCallback)((e,t)=>{if(D.some((n,r)=>r!==e&&Dt(n.label,t.label))){let e=typeof t.label==`string`?t.label:t.label?.en??t.label[`zh-CN`]??JSON.stringify(t.label);throw Error(`Name conflict: "${e}"`)}O(n=>{if(e<0||e>=n.length)return n;let r=[...n];return r[e]=t,r})},[D]),M=(0,d.useCallback)(()=>{O(e=>{let t=e.filter(e=>!Ct.some(t=>Dt(t.label,e.label)));return[...Ct,...t]})},[]);(0,d.useEffect)(()=>ye.subscribe(()=>O(At(ye.get()?.preferences?.startScreenMessages)??Ct)),[]),(0,d.useEffect)(()=>{Rt({preferences:{startScreenMessages:D}})},[D]);let[N,P]=(0,d.useState)(()=>Nt()),ee=(0,d.useCallback)((e,t)=>{P(n=>{let r=n[e]??[];return r.some(e=>e.path===t.path)?n:{...n,[e]:[...r,t]}})},[]),F=(0,d.useCallback)((e,t)=>{P(n=>{let r=n[e];if(!r)return n;let i=r.filter(e=>e.path!==t),a={...n};return i.length===0?delete a[e]:a[e]=i,a})},[]);(0,d.useEffect)(()=>{try{window.localStorage.setItem(Mt,JSON.stringify(N))}catch{}Rt({preferences:{pluginConfigBindings:N}})},[N]);let[I,te]=(0,d.useState)(()=>ye.get()?.defaultThinkingLevel??``);(0,d.useEffect)(()=>ye.subscribe(()=>te(ye.get()?.defaultThinkingLevel??``)),[]),(0,d.useEffect)(()=>{I&&Rt({firstPaint:{defaultThinkingLevel:I}})},[I]);let ne=(0,d.useSyncExternalStore)(ye.subscribe,()=>ye.get()?.compaction??null),re=(0,d.useMemo)(()=>JSON.stringify(ne),[ne]);(0,d.useEffect)(()=>{re&&Rt({firstPaint:{compaction:ye.get()?.compaction??null}})},[re]);let ie=(0,d.useSyncExternalStore)(ye.subscribe,()=>ye.get()?.retry??null),ae=(0,d.useMemo)(()=>JSON.stringify(ie),[ie]);(0,d.useEffect)(()=>{ae&&Rt({firstPaint:{retry:ye.get()?.retry??null}})},[ae]);let[L,R]=(0,d.useState)(()=>ye.get()?.defaultProjectTrust??``);(0,d.useEffect)(()=>ye.subscribe(()=>R(ye.get()?.defaultProjectTrust??``)),[]),(0,d.useEffect)(()=>{L&&Rt({firstPaint:{defaultProjectTrust:L}})},[L]);let oe=(0,d.useSyncExternalStore)(ye.subscribe,()=>ye.get()?.subagents??zt),z=(0,d.useMemo)(()=>({defaultModel:oe.defaultModel??``,defaultThinking:oe.defaultThinking??``}),[oe]);return(0,d.useEffect)(()=>{!z.defaultModel&&!z.defaultThinking||Rt({firstPaint:{subagents:{defaultModel:z.defaultModel||void 0,defaultThinking:z.defaultThinking||void 0}}})},[z]),(0,d.useEffect)(()=>{try{window.localStorage.setItem(nt,String(o))}catch{}Rt({preferences:{autoReloadSeconds:o}})},[o]),(0,d.useEffect)(()=>{try{window.localStorage.setItem(st,String(i))}catch{}Rt({preferences:{minimapScrollStepPx:i}})},[i]),(0,d.useEffect)(()=>{try{window.localStorage.setItem(dt,String(c))}catch{}Rt({preferences:{longBlockCollapseChars:c}})},[c]),(0,d.useEffect)(()=>{try{window.localStorage.setItem(mt,String(u))}catch{}Rt({preferences:{recentBlocksExpanded:u}})},[u]),(0,d.useEffect)(()=>{document.documentElement.style.fontSize=`${n*Ht}px`;try{window.localStorage.setItem(Bt,String(n))}catch{}Rt({firstPaint:{fontScale:n}})},[n]),(0,d.useEffect)(()=>{ye.load().catch(e=>console.error(`[pi-web] load preferences:`,e))},[]),{settingsValue:(0,d.useMemo)(()=>({isDark:e,toggleTheme:t,fontScale:n,setFontScale:r,scrollStepPx:i,setScrollStepPx:a,autoReloadSeconds:o,setAutoReloadSeconds:s,longBlockCollapseChars:c,setLongBlockCollapseChars:l,recentBlocksExpanded:u,setRecentBlocksExpanded:f,notifyEvents:p,setNotifyEvents:m,widgetGeometries:h,setWidgetGeometry:S,widgetMessages:v,addWidgetMessage:C,removeWidgetMessage:w,updateWidgetMessage:T,startScreenMessages:D,addStartScreenMessage:k,removeStartScreenMessage:A,updateStartScreenMessage:j,resetStartScreenMessages:M,pluginConfigBindings:N,addPluginConfigBinding:ee,removePluginConfigBinding:F}),[e,t,n,i,o,c,u,p,h,S,v,C,w,T,D,k,A,j,M,N,ee,F]),defaultThinkingLevel:I,setDefaultThinkingLevel:te,compaction:ne,retry:ie,defaultProjectTrust:L,setDefaultProjectTrust:R,subagents:z,savedWorkspaces:b,handleSavedWorkspacesChange:E,widgetGeometries:h,setWidgetGeometry:S,widgetMessages:v,addWidgetMessage:C,removeWidgetMessage:w,updateWidgetMessage:T,fontScale:n,setFontScale:r}}function Wt(e){if(!Number.isFinite(e))return``;let t=Math.round(e),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}var Gt=new Map,Kt=new Map,qt=3e4,Jt=75e3,Yt=1e3,Xt=15e3,Zt=1,Qt=3,$t=null,en=0,tn=0,nn=Yt;function rn(e){return e.ch===`agent`?`agent:${e.sessionId??``}`:e.ch===`watch`?`watch:${e.filePath??``}`:e.ch}function an(){return`${location.protocol===`https:`?`wss://`:`ws://`}${location.host}/api/ws`}function on(e,t){e.send(JSON.stringify({type:`sub`,...t}))}function sn(){$t&&$t.close();let e=++tn,t;try{t=new WebSocket(an())}catch{cn(e);return}$t=t,t.onopen=()=>{nn=Yt,en=Date.now();for(let e of Kt.values())try{on(t,e)}catch{break}},t.onmessage=n=>{if(e!==tn||$t!==t||(en=Date.now(),typeof n.data!=`string`))return;let r;try{r=JSON.parse(n.data)}catch{return}if(r.ch)for(let e of Gt.get(r.ch)??[])e(r.data)},t.onclose=()=>{e===tn&&$t===t&&($t=null,cn(e))},t.onerror=()=>{}}function cn(e){setTimeout(()=>{e!==tn||$t||sn()},nn),nn=Math.min(nn*2,Xt)}function ln(){if(!$t||$t.readyState!==Zt||Date.now()-en<=Jt)return;tn+=1;let e=$t;$t=null;try{e.close()}catch{}sn()}typeof window<`u`&&(setInterval(ln,qt),window.addEventListener(`online`,()=>{!$t||$t.readyState===Qt?sn():ln()}),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&(!$t||$t.readyState===Qt?sn():ln())}));function un(e){if(e&&$t?.readyState===Zt)try{$t.send(JSON.stringify({type:`unseen`,sessionId:e}))}catch{}}function dn(e,t){let n=rn(e),r=Gt.get(n);r||(r=new Set,Gt.set(n,r)),r.add(t);let i=!Kt.has(n);if(Kt.set(n,e),$t?.readyState===Zt&&i)try{on($t,e)}catch{}else $t||sn();return()=>{let e=Gt.get(n);if(e?.delete(t),e&&e.size===0&&(Gt.delete(n),Kt.delete(n),$t?.readyState===Zt))try{$t.send(JSON.stringify({type:`unsub`,ch:n}))}catch{}}}var fn={runningSessionIds:[],runningPhases:{},runningPhaseSince:{},runningBusySince:{}},pn=null,mn={current:!1},hn=new Set;function gn(){pn=null;for(let e of hn)e()}function _n(){return pn||={runningSessionIds:new Set(fn.runningSessionIds),runningPhases:fn.runningPhases,runningPhaseSince:fn.runningPhaseSince,runningBusySince:fn.runningBusySince,setRunningSessionIds:vn,runningPollAuthoritativeRef:mn},pn}function vn(e){mn.current||(fn={...fn,runningSessionIds:[...e]},gn())}function yn(e){return hn.add(e),xn(),()=>hn.delete(e)}var bn=null;function xn(){bn||=dn({ch:`running`},e=>{if(e.type!==`running`)return;let t=e;fn={runningSessionIds:t.runningSessionIds??[],runningPhases:t.phases??{},runningPhaseSince:t.phaseSince??{},runningBusySince:t.busySince??{}},mn.current=!0,gn()})}function Sn(){return(0,d.useSyncExternalStore)(yn,_n)}function Cn(e,t){let[n,r]=(0,d.useState)(null);return(0,d.useEffect)(()=>{if(!e||t===void 0){r(null);return}let n=()=>{document.hidden||r(Wt((Date.now()-t)/1e3))};n();let i=setInterval(n,1e3),a=()=>{document.hidden||n()};return document.addEventListener(`visibilitychange`,a),()=>{clearInterval(i),document.removeEventListener(`visibilitychange`,a)}},[e,t]),n}var wn=new Map,Tn=5e3;function En({title:e,body:t,tag:n,notifyWhileActive:r=!1}){if(!(typeof Notification>`u`)&&!(document.hasFocus()&&document.visibilityState===`visible`&&!r)){if(Notification.permission!==`granted`){console.warn(`[notify] skip: permission=${Notification.permission}`);return}try{let r;if(n){let e=Date.now(),t=wn.get(n);if(t!==void 0&&e-t<Tn)return;wn.set(n,e),r=`${n}-${e}`}new Notification(e,t?{body:t,tag:r}:{tag:r}),console.info(`[notify] dispatched: ${e}`)}catch(e){console.warn(`[notify] construction failed:`,e)}}}function Dn(){typeof Notification>`u`||Notification.requestPermission()}function On(){if(typeof Notification>`u`||Notification.permission!=="default")return;let e=()=>{Dn(),window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,e)};window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,e)}var kn=3e3,An=6e4;function jn(e,t){return e?e.error?e.path.split(/[\\/]/).pop()||t:e.name||e.firstMessage.slice(0,50)||t.slice(0,12):t.slice(0,12)}function Mn(e,t){return e.filter(e=>!t.has(e))}function Nn(e,t,n,r){switch(e.type){case`prompt_error`:case`extension_error`:{if(!n.errors)return null;let t=e.errorMessage??r(`i18n.commandFailed`);return{title:r(`chat.taskErrorNotificationTitle`),body:t,tag:`agent-error-${e.sessionId}`}}case`extension_ui_request`:{if(!n.questions)return null;let t=e.method;if(t!==`select`&&t!==`confirm`&&t!==`input`&&t!==`editor`)return null;let i=e.title??r(`chat.questionNotificationTitle`);return{title:r(`chat.questionNotificationTitle`),body:i,tag:`question-${e.id??e.sessionId}`}}default:return null}}function Pn(){let{t:e}=N(),{notifyEvents:t}=ze(),[n,r]=(0,d.useState)([]),i=(0,d.useRef)([]);(0,d.useEffect)(()=>{i.current=n});let a=(0,d.useRef)(t);(0,d.useEffect)(()=>{a.current=t});let o=(0,d.useRef)(e);(0,d.useEffect)(()=>{o.current=e});let{runningSessionIds:s}=Sn(),c=(0,d.useRef)(!1),l=(0,d.useRef)([]),u=(0,d.useRef)(new Map);(0,d.useEffect)(()=>{if(!a.current.taskComplete)return;let e=c.current?l.current:null;if(l.current=[...s],c.current=!0,!e)return;let t=Mn(e,s);if(t.length===0)return;let n=Date.now();for(let e of t){let t=u.current.get(e);t!==void 0&&n-t<kn||(i.current.some(t=>t.id===e)||p.current(),console.info(`[notify] completion via running-snapshot (${e})`),En({title:o.current(`chat.taskCompleteNotificationTitle`),body:o.current(`chat.sessionCompletedNotificationBody`,{name:jn(i.current.find(t=>t.id===e),e)}),tag:`session-complete-${e}`,notifyWhileActive:a.current.notifyWhileActive}))}},[s]);let f=(0,d.useCallback)(async()=>{try{let e=await fetch(`/api/sessions`,{cache:`no-store`});if(!e.ok)return;let t=await e.json();t.sessions&&r(t.sessions)}catch{}},[]),p=(0,d.useRef)(f);return(0,d.useEffect)(()=>{p.current=f}),(0,d.useEffect)(()=>{f();let e=setInterval(()=>void f(),An);return()=>clearInterval(e)},[f]),(0,d.useEffect)(()=>dn({ch:`global`},e=>{let t=e;if(!t.sessionId)return;let n=t.sessionId;(t.type===`prompt_error`||t.type===`extension_error`)&&u.current.set(n,Date.now()),i.current.some(e=>e.id===n)||p.current();let r=Nn(t,jn(i.current.find(e=>e.id===n),n),a.current,o.current);r&&(console.info(`[agent-events] notifying: ${r.title}`),En({...r,notifyWhileActive:a.current.notifyWhileActive}))}),[]),null}var Fn=`var(--text-dim)`;function In({size:e=14,open:t=!1}){return t?(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M1 4.5A1 1 0 0 1 2 3.5H5.5L7 5h7.5v1H1V4.5Z`,fill:Fn}),(0,E.jsx)(`path`,{d:`M1 6h14.5L14 13H2L1 6Z`,stroke:Fn,strokeWidth:`1`,fill:Fn,fillOpacity:`0.12`})]}):(0,E.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,fill:`none`,children:(0,E.jsx)(`path`,{d:`M1 4.5A1 1 0 0 1 2 3.5H5.5L7 5H14a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V4.5Z`,stroke:Fn,strokeWidth:`1`,fill:Fn,fillOpacity:`0.1`})})}function Ln({size:e=14}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M3 2h7l3 3v9H3V2Z`,stroke:Fn,strokeWidth:`1`,fill:Fn,fillOpacity:`0.08`}),(0,E.jsx)(`path`,{d:`M10 2v3h3`,stroke:Fn,strokeWidth:`1`,fill:`none`,strokeLinejoin:`round`})]})}function Rn({label:e,size:t=14}){let n=t/14;return(0,E.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 14 14`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M2.5 1h6l3 3v9h-9V1Z`,stroke:Fn,strokeWidth:`0.9`,fill:Fn,fillOpacity:`0.07`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M8.5 1v3h3`,stroke:Fn,strokeWidth:`0.9`,fill:`none`,strokeLinejoin:`round`}),(0,E.jsx)(`text`,{x:`7`,y:`9.5`,textAnchor:`middle`,fontSize:3.4*n,fontFamily:`var(--font-mono), monospace`,fontWeight:`600`,fill:Fn,letterSpacing:`0`,children:e})]})}function zn({size:e=14}){return(0,E.jsx)(Rn,{label:`TS`,size:e})}function Bn({size:e=14}){return(0,E.jsx)(Rn,{label:`TSX`,size:e})}function Vn({size:e=14}){return(0,E.jsx)(Rn,{label:`JS`,size:e})}function Hn({size:e=14}){return(0,E.jsx)(Rn,{label:`JSX`,size:e})}function Un({size:e=14}){return(0,E.jsx)(Rn,{label:`PY`,size:e})}function Wn({size:e=14}){return(0,E.jsx)(Rn,{label:`{}`,size:e})}function Gn({size:e=14}){return(0,E.jsx)(Rn,{label:`CSS`,size:e})}function Kn({size:e=14}){return(0,E.jsx)(Rn,{label:`SC`,size:e})}function qn({size:e=14}){return(0,E.jsx)(Rn,{label:`HTM`,size:e})}function Jn({size:e=14}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 14 14`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M2.5 1h6l3 3v9h-9V1Z`,stroke:Fn,strokeWidth:`0.9`,fill:Fn,fillOpacity:`0.07`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M8.5 1v3h3`,stroke:Fn,strokeWidth:`0.9`,fill:`none`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M3.5 9.5V7l1.5 1.5L6.5 7v2.5`,stroke:Fn,strokeWidth:`0.9`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}),(0,E.jsx)(`path`,{d:`M8 7v2.5M7 9l1 1.5 1-1.5`,stroke:Fn,strokeWidth:`0.9`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`})]})}function Yn({size:e=14}){return(0,E.jsx)(Rn,{label:`YML`,size:e})}function Xn({size:e=14}){return(0,E.jsx)(Rn,{label:`TOM`,size:e})}function Zn({size:e=14}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 14 14`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M2.5 1h6l3 3v9h-9V1Z`,stroke:Fn,strokeWidth:`0.9`,fill:Fn,fillOpacity:`0.07`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M8.5 1v3h3`,stroke:Fn,strokeWidth:`0.9`,fill:`none`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M4 7.5l2 1.5-2 1.5`,stroke:Fn,strokeWidth:`0.95`,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}),(0,E.jsx)(`path`,{d:`M7.5 10.5h2.5`,stroke:Fn,strokeWidth:`0.95`,strokeLinecap:`round`})]})}function Qn({size:e=14}){return(0,E.jsx)(Rn,{label:`RS`,size:e})}function $n({size:e=14}){return(0,E.jsx)(Rn,{label:`GO`,size:e})}function er({size:e=14}){return(0,E.jsx)(Rn,{label:`SQL`,size:e})}function tr({size:e=14}){return(0,E.jsx)(Rn,{label:`GQL`,size:e})}function nr({size:e=14}){return(0,E.jsx)(Rn,{label:`TF`,size:e})}function rr({size:e=14}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 14 14`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M2.5 1h6l3 3v9h-9V1Z`,stroke:Fn,strokeWidth:`0.9`,fill:Fn,fillOpacity:`0.07`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M8.5 1v3h3`,stroke:Fn,strokeWidth:`0.9`,fill:`none`,strokeLinejoin:`round`}),(0,E.jsx)(`rect`,{x:`3.5`,y:`6.5`,width:`2`,height:`1.5`,rx:`0.3`,stroke:Fn,strokeWidth:`0.8`}),(0,E.jsx)(`rect`,{x:`6`,y:`6.5`,width:`2`,height:`1.5`,rx:`0.3`,stroke:Fn,strokeWidth:`0.8`}),(0,E.jsx)(`rect`,{x:`3.5`,y:`8.5`,width:`2`,height:`1.5`,rx:`0.3`,stroke:Fn,strokeWidth:`0.8`})]})}function ir({size:e=14}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 14 14`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M2.5 1h6l3 3v9h-9V1Z`,stroke:Fn,strokeWidth:`0.9`,fill:Fn,fillOpacity:`0.07`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M8.5 1v3h3`,stroke:Fn,strokeWidth:`0.9`,fill:`none`,strokeLinejoin:`round`}),(0,E.jsx)(`circle`,{cx:`5.5`,cy:`8.5`,r:`1.5`,stroke:Fn,strokeWidth:`0.9`}),(0,E.jsx)(`path`,{d:`M7 8.5h2.5M8.5 8.5v1.5`,stroke:Fn,strokeWidth:`0.9`,strokeLinecap:`round`})]})}function ar({size:e=14}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 14 14`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M2.5 1h6l3 3v9h-9V1Z`,stroke:Fn,strokeWidth:`0.9`,fill:Fn,fillOpacity:`0.07`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M8.5 1v3h3`,stroke:Fn,strokeWidth:`0.9`,fill:`none`,strokeLinejoin:`round`}),(0,E.jsx)(`circle`,{cx:`5`,cy:`6.5`,r:`1`,stroke:Fn,strokeWidth:`0.85`}),(0,E.jsx)(`circle`,{cx:`9`,cy:`6.5`,r:`1`,stroke:Fn,strokeWidth:`0.85`}),(0,E.jsx)(`circle`,{cx:`5`,cy:`10`,r:`1`,stroke:Fn,strokeWidth:`0.85`}),(0,E.jsx)(`path`,{d:`M5 7.5V9`,stroke:Fn,strokeWidth:`0.85`,strokeLinecap:`round`}),(0,E.jsx)(`path`,{d:`M9 7.5v.5a2 2 0 0 1-2 2H6`,stroke:Fn,strokeWidth:`0.85`,strokeLinecap:`round`,fill:`none`})]})}function or({size:e=14}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 14 14`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M2.5 1h6l3 3v9h-9V1Z`,stroke:Fn,strokeWidth:`0.9`,fill:Fn,fillOpacity:`0.07`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M8.5 1v3h3`,stroke:Fn,strokeWidth:`0.9`,fill:`none`,strokeLinejoin:`round`}),(0,E.jsx)(`rect`,{x:`4.5`,y:`8.5`,width:`5`,height:`3`,rx:`0.6`,stroke:Fn,strokeWidth:`0.9`}),(0,E.jsx)(`path`,{d:`M5.5 8.5V7.5a1.5 1.5 0 0 1 3 0v1`,stroke:Fn,strokeWidth:`0.9`,strokeLinecap:`round`,fill:`none`})]})}function sr({size:e=14}){return(0,E.jsx)(Rn,{label:`DOC`,size:e})}function cr({size:e=14}){return(0,E.jsx)(Rn,{label:`PDF`,size:e})}function lr({size:e=14}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 14 14`,fill:`none`,children:[(0,E.jsx)(`path`,{d:`M2.5 1h6l3 3v9h-9V1Z`,stroke:Fn,strokeWidth:`0.9`,fill:Fn,fillOpacity:`0.07`,strokeLinejoin:`round`}),(0,E.jsx)(`path`,{d:`M8.5 1v3h3`,stroke:Fn,strokeWidth:`0.9`,fill:`none`,strokeLinejoin:`round`}),(0,E.jsx)(`circle`,{cx:`7`,cy:`8.5`,r:`1.3`,stroke:Fn,strokeWidth:`0.9`}),(0,E.jsx)(`path`,{d:`M7 6.5v.7M7 10.3v.7M5 8.5h.7M8.3 8.5H9M5.5 6.9l.5.5M8.5 9.6l-.5-.5M5.5 10.1l.5-.5M8.5 7.4l-.5.5`,stroke:Fn,strokeWidth:`0.8`,strokeLinecap:`round`})]})}function ur(e,t=14){let n=e.toLowerCase(),r=n.split(`.`).pop()??``;if(n===`dockerfile`||n.startsWith(`dockerfile.`))return(0,E.jsx)(rr,{size:t});if(n===`.env`||n.startsWith(`.env.`))return(0,E.jsx)(ir,{size:t});if(n===`.gitignore`||n===`.gitattributes`||n===`.gitmodules`)return(0,E.jsx)(ar,{size:t});if(n===`package-lock.json`||n===`yarn.lock`||n===`bun.lock`||n===`pnpm-lock.yaml`||n===`cargo.lock`)return(0,E.jsx)(or,{size:t});if(n.endsWith(`.config.ts`)||n.endsWith(`.config.js`)||n.endsWith(`.config.mjs`)||n.endsWith(`.config.cjs`)||[`.eslintrc`,`.eslintrc.js`,`.eslintrc.json`,`.eslintrc.yml`,`eslint.config.mjs`,`eslint.config.js`].includes(n))return(0,E.jsx)(lr,{size:t});switch(r){case`ts`:return(0,E.jsx)(zn,{size:t});case`tsx`:return(0,E.jsx)(Bn,{size:t});case`js`:case`mjs`:case`cjs`:return(0,E.jsx)(Vn,{size:t});case`jsx`:return(0,E.jsx)(Hn,{size:t});case`py`:return(0,E.jsx)(Un,{size:t});case`json`:case`jsonl`:return(0,E.jsx)(Wn,{size:t});case`css`:case`less`:return(0,E.jsx)(Gn,{size:t});case`scss`:return(0,E.jsx)(Kn,{size:t});case`html`:case`htm`:return(0,E.jsx)(qn,{size:t});case`md`:case`mdx`:return(0,E.jsx)(Jn,{size:t});case`yaml`:case`yml`:return(0,E.jsx)(Yn,{size:t});case`toml`:return(0,E.jsx)(Xn,{size:t});case`sh`:case`bash`:case`zsh`:case`fish`:return(0,E.jsx)(Zn,{size:t});case`rs`:return(0,E.jsx)(Qn,{size:t});case`go`:return(0,E.jsx)($n,{size:t});case`sql`:return(0,E.jsx)(er,{size:t});case`graphql`:case`gql`:return(0,E.jsx)(tr,{size:t});case`tf`:case`hcl`:return(0,E.jsx)(nr,{size:t});case`docx`:return(0,E.jsx)(sr,{size:t});case`pdf`:return(0,E.jsx)(cr,{size:t});case`lock`:return(0,E.jsx)(or,{size:t});default:return(0,E.jsx)(Ln,{size:t})}}var dr={up:{top:0,left:0,right:0},down:{bottom:0,left:0,right:0},left:{left:0,top:0,bottom:0},right:{right:0,top:0,bottom:0}},fr={up:{left:`50%`,transform:`translateX(-50%)`},down:{left:`50%`,transform:`translateX(-50%)`},left:{top:`50%`,transform:`translateY(-50%)`},right:{top:`50%`,transform:`translateY(-50%)`}},pr={up:`linear-gradient(to bottom, var(--bg), transparent)`,down:`linear-gradient(to top, var(--bg), transparent)`,left:`linear-gradient(to right, var(--bg), transparent)`,right:`linear-gradient(to left, var(--bg), transparent)`},mr={up:{borderLeft:`6px solid transparent`,borderRight:`6px solid transparent`,borderBottom:`7px solid var(--text-muted)`},down:{borderLeft:`6px solid transparent`,borderRight:`6px solid transparent`,borderTop:`7px solid var(--text-muted)`},left:{borderTop:`6px solid transparent`,borderBottom:`6px solid transparent`,borderRight:`7px solid var(--text-muted)`},right:{borderTop:`6px solid transparent`,borderBottom:`6px solid transparent`,borderLeft:`7px solid var(--text-muted)`}};function hr({direction:e,visible:t,onHover:n,hoverInterval:r=200,onClick:i,length:a=`100%`,thickness:o=30,style:s,label:c,testId:l}){let u=(0,d.useRef)(n);(0,d.useEffect)(()=>{u.current=n});let f=(0,d.useRef)(null),p=(0,d.useCallback)(()=>{f.current!==null&&(clearInterval(f.current),f.current=null)},[]),m=(0,d.useCallback)(()=>{p(),u.current?.(),u.current&&(f.current=window.setInterval(()=>u.current?.(),r))},[r,p]);if((0,d.useEffect)(()=>p,[p]),!t)return null;let h=e===`up`||e===`down`,g={position:`absolute`,pointerEvents:`none`,zIndex:49,height:o,...h?{left:0,right:0}:{width:o,top:0,bottom:0},...dr[e],background:pr[e]},_={position:`absolute`,zIndex:50,cursor:`pointer`,background:`transparent`,border:`none`,padding:0,display:`flex`,alignItems:`center`,justifyContent:`center`,...dr[e],...h?{width:a,height:o}:{height:a,width:o},...fr[e],...s};return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`span`,{style:g,"aria-hidden":`true`}),(0,E.jsx)(`button`,{type:`button`,"data-testid":l??`scroll-direction-hint-${e}`,"aria-label":c??`Scroll ${e}`,title:c??`Scroll ${e}`,style:_,onMouseEnter:m,onMouseLeave:p,onClick:i,children:(0,E.jsx)(`span`,{"aria-hidden":`true`,style:{width:0,height:0,pointerEvents:`none`,...mr[e]}})})]})}var gr=2;function _r({tabs:e,activeTabId:t,onSelectTab:n,onCloseTab:r,leftExtra:i,rightExtra:a,scrollStepPx:o=200}){let{t:s}=N(),[c,l]=(0,d.useState)(null),u=(0,d.useRef)(null),[f,m]=(0,d.useState)({scrollWidth:0,clientWidth:0,scrollLeft:0}),h=(0,d.useCallback)(()=>{if(document.hidden)return;let e=u.current;e&&m({scrollWidth:e.scrollWidth,clientWidth:e.clientWidth,scrollLeft:e.scrollLeft})},[]);(0,d.useLayoutEffect)(()=>{h();let e=u.current;if(!e)return;let t=new ResizeObserver(h);return t.observe(e),()=>t.disconnect()},[h,e]);let{scrollWidth:g,clientWidth:_,scrollLeft:v}=f,y=g-_>20,b=y&&v>gr,x=y&&v+_<g-gr,S=e=>{let t=u.current;if(!t)return;let n=Math.max(0,t.scrollWidth-t.clientWidth);t.scrollTo({left:Math.max(0,Math.min(n,t.scrollLeft+e*o)),behavior:`smooth`})},C=e=>{let t=u.current;t&&t.scrollTo({left:e===`left`?0:Math.max(0,t.scrollWidth-t.clientWidth),behavior:`smooth`})};return(0,E.jsxs)(`div`,{"data-testid":`tab-bar`,style:{display:`flex`,alignItems:`flex-end`,background:`var(--bg-panel)`,flexShrink:0,height:`calc(36px + env(safe-area-inset-top))`,paddingTop:`env(safe-area-inset-top)`},children:[i&&(0,E.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,height:36,flexShrink:0},children:i}),(0,E.jsxs)(`div`,{style:{position:`relative`,flex:1,minWidth:0,height:36},children:[(0,E.jsx)(`div`,{ref:u,"data-testid":`tab-scroll`,role:`tablist`,onScroll:h,style:{display:`flex`,alignItems:`flex-end`,overflowX:`auto`,overflowY:`hidden`,height:36},children:e.map(e=>{let i=e.id===t;return(0,E.jsxs)(`div`,{"data-tab-id":e.id,"data-active":i,role:`tab`,"aria-selected":i,onClick:()=>n(e.id),onMouseDown:e=>{e.button===1&&e.preventDefault()},onAuxClick:t=>{t.button===1&&e.closable!==!1&&(t.preventDefault(),t.stopPropagation(),r(e.id))},style:{display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,gap:6,height:36,paddingLeft:30,paddingRight:30,borderRight:`1px solid var(--border)`,background:i?`var(--bg)`:`var(--bg-panel)`,cursor:`pointer`,fontSize:`var(--text-base)`,color:i?`var(--text)`:`var(--text-muted)`,whiteSpace:`nowrap`,maxWidth:180,minWidth:80,flexShrink:0,userSelect:`none`,transition:`background 0.1s, color 0.1s`},children:[(0,E.jsx)(`span`,{style:{flexShrink:0,opacity:i?1:.7,display:`flex`,alignItems:`center`},children:e.icon??(e.filePath?ur(e.label,13):null)}),(0,E.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,fontWeight:i?500:400},title:e.filePath,children:e.label}),e.badge!=null&&e.badge>0&&(0,E.jsx)(`span`,{style:{flexShrink:0,marginLeft:5,minWidth:16,height:16,padding:`0 5px`,borderRadius:5,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid var(--accent)`,background:`color-mix(in srgb, var(--accent) 12%, transparent)`,color:`var(--accent)`,fontSize:`var(--text-2xs)`,fontWeight:600,lineHeight:1},children:e.badge>99?`99+`:e.badge}),e.closable!==!1&&(0,E.jsx)(`button`,{onClick:t=>{t.stopPropagation(),r(e.id)},onMouseEnter:()=>l(e.id),onMouseLeave:()=>l(null),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,position:`absolute`,right:6,top:`50%`,transform:`translateY(-50%)`,width:24,height:24,background:c===e.id?`var(--bg-hover)`:`transparent`,border:`none`,borderRadius:4,color:c===e.id?`var(--text)`:`var(--text-dim)`,cursor:`pointer`,padding:0,flexShrink:0,transition:`background 0.1s, color 0.1s`},title:s(`i18n.close`),"aria-label":`${s(`i18n.close`)} ${e.label}`,children:(0,E.jsxs)(`svg`,{width:p.sm,height:p.sm,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`line`,{x1:`2`,y1:`2`,x2:`8`,y2:`8`}),(0,E.jsx)(`line`,{x1:`8`,y1:`2`,x2:`2`,y2:`8`})]})})]},e.id)})}),b&&(0,E.jsx)(hr,{direction:`left`,visible:!0,testId:`tab-scroll-left`,thickness:18,onHover:()=>S(-1),onClick:()=>C(`left`)}),x&&(0,E.jsx)(hr,{direction:`right`,visible:!0,testId:`tab-scroll-right`,thickness:18,onHover:()=>S(1),onClick:()=>C(`right`)})]}),a&&(0,E.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,height:36,flexShrink:0,paddingRight:`env(safe-area-inset-right)`},children:a})]})}function vr(e){return null}function yr({activeId:e,children:t}){let n=d.Children.toArray(t).filter(e=>(0,d.isValidElement)(e)&&e.type===vr);return(0,E.jsx)(E.Fragment,{children:n.map(t=>{let n=t.props.activeWhen!==!1&&t.props.id===e;return!t.props.keepAlive&&!n?null:(0,E.jsx)(`div`,{"data-testid":t.props.testId,style:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`,overflow:t.props.scroll??`auto`,zIndex:t.props.zIndex,contentVisibility:n?`visible`:`hidden`,pointerEvents:n?void 0:`none`},children:t.props.children},t.props.id)})})}function br({tabs:e,activeTabId:t,onSelectTab:n,onCloseTab:r,leftExtra:i,rightExtra:a,scrollStepPx:o,tabBarRef:s,overlay:c,children:l}){return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{ref:s,style:{flexShrink:0,background:`var(--bg-panel)`},children:[(0,E.jsx)(_r,{tabs:e,activeTabId:t,leftExtra:i,rightExtra:a,onSelectTab:n,onCloseTab:r,scrollStepPx:o}),(0,E.jsx)(`div`,{style:{height:1,background:`var(--border)`,flexShrink:0}})]}),(0,E.jsx)(`div`,{style:{flex:1,overflow:`hidden`,position:`relative`,display:`flex`},children:(0,E.jsxs)(`div`,{style:{flex:1,overflow:`hidden`,position:`relative`,minWidth:0,minHeight:0,display:`flex`,flexDirection:`column`},children:[(0,E.jsx)(yr,{activeId:t,children:l}),c]})})]})}var xr=new Set;function Sr(e){return xr.add(e),()=>{xr.delete(e)}}function Cr(){return typeof document>`u`?`light`:document.documentElement.classList.contains(`dark`)?`dark`:`light`}function wr(){return`light`}function Tr(){let e=(0,d.useSyncExternalStore)(Sr,Cr,wr);return{theme:e,toggleTheme:(0,d.useCallback)(e=>{let t=Cr()===`dark`?`light`:`dark`;t===`dark`?document.documentElement.classList.add(`dark`):document.documentElement.classList.remove(`dark`);try{localStorage.setItem(`pi-theme`,t)}catch{}fetch(`/api/preferences`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({firstPaint:{theme:t}})}).catch(e=>console.error(`[pi-web] save theme:`,e)),xr.forEach(e=>e())},[]),isDark:e===`dark`}}function Er(e,t,n){let[r,i]=(0,d.useState)(()=>{try{let t=localStorage.getItem(e);if(t!==null){let e=JSON.parse(t);return n?n(e):e}}catch{}return typeof t==`function`?t():t});return(0,d.useEffect)(()=>{try{localStorage.setItem(e,JSON.stringify(r))}catch{}},[e,r]),[r,i]}var Dr=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Or=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),kr=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Ar=e=>{let t=kr(e);return t.charAt(0).toUpperCase()+t.slice(1)},jr={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Mr=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Nr=(0,d.createContext)({}),Pr=()=>(0,d.useContext)(Nr),Fr=(0,d.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:f=!1,color:p=`currentColor`,className:m=``}=Pr()??{},h=r??f?Number(n??u)*24/Number(t??l):n??u;return(0,d.createElement)(`svg`,{ref:c,...jr,width:t??l??jr.width,height:t??l??jr.height,stroke:e??p,strokeWidth:h,className:Dr(`lucide`,m,i),...!a&&!Mr(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,d.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Ir=(e,t)=>{let n=(0,d.forwardRef)(({className:n,...r},i)=>(0,d.createElement)(Fr,{ref:i,iconNode:t,className:Dr(`lucide-${Or(Ar(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Ar(e),n},Lr=Ir(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Rr=Ir(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),zr=Ir(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Br=Ir(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Vr=Ir(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),Hr=Ir(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),Ur=Ir(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Wr=Ir(`corner-up-left`,[[`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`,key:`1nkjon`}],[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}]]),Gr=Ir(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Kr=Ir(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),qr=Ir(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]),Jr=Ir(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Yr=Ir(`fold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3-3-3 3`,key:`e37ymu`}],[`path`,{d:`m15 5-3 3-3-3`,key:`19d6lf`}]]),Xr=Ir(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Zr=Ir(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Qr=Ir(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),$r=Ir(`hard-drive-upload`,[[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M12 2v8`,key:`1q4o3n`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`M10 18h.01`,key:`h775k`}]]),ei=Ir(`hourglass`,[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]),ti=Ir(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),ni=Ir(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),ri=Ir(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),ii=Ir(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),ai=Ir(`list-end`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M16 12H3`,key:`1a2rj7`}],[`path`,{d:`M9 19H3`,key:`s61nz1`}],[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M21 5v12a2 2 0 0 1-2 2h-6`,key:`hey24a`}]]),oi=Ir(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),si=Ir(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),ci=Ir(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),li=Ir(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),ui=Ir(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),di=Ir(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),fi=Ir(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),pi=Ir(`puzzle`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),mi=Ir(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),hi=Ir(`rotate-ccw-clock`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),gi=Ir(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),_i=Ir(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),vi=Ir(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),yi=Ir(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),bi=Ir(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),xi=Ir(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),Si=Ir(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Ci=Ir(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),wi=Ir(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Ti=Ir(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Ei=Ir(`trash`,[[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Di=Ir(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Oi=Ir(`unplug`,[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]),ki=Ir(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),Ai=Ir(`volume-x`,[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]),ji=Ir(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Mi=Ir(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ni=Ir(`zap`,[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]);function Pi(){let e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}var Fi=class extends Error{constructor(e){super(e),this.name=`CancellationError`}};function Ii(e,t){let n=Pi(),r=new AbortController,i=!1,a=e=>{i||(i=!0,r.abort(),n.reject(e))},o=setTimeout(()=>a(new Fi(`timed out after ${t}ms`)),t),s=e(r.signal).then(e=>(i=!0,clearTimeout(o),e),e=>{if(clearTimeout(o),!i)throw i=!0,e});return{promise:Promise.race([s,n.promise]),cancel:()=>a(new Fi(`cancelled`))}}function Li(){let e=(0,d.useRef)(new Map);return(0,d.useEffect)(()=>()=>{for(let t of e.current.values())t.cancel()},[]),(0,d.useMemo)(()=>({start:(t,n,r)=>{let i=r?.joinKey??null,a=e.current.get(i);if(a){if(r?.joinKey!==void 0)return{promise:a.promise,cancel:a.cancel};a.cancel()}let o=Ii(t,n);return e.current.set(i,o),o.promise.then(()=>{e.current.get(i)===o&&e.current.delete(i)},()=>{e.current.get(i)===o&&e.current.delete(i)}),o},cancel:()=>{for(let t of e.current.values())t.cancel()}}),[])}function Ri(e){if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(e);try{let t=document.createElement(`textarea`);return t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),document.body.removeChild(t),Promise.resolve()}catch{return Promise.reject()}}var zi=3e4;function Bi({command:e,note:t}){let{t:n}=N(),[r,i]=(0,d.useState)(!1),a=async()=>{try{await Ri(e),i(!0),setTimeout(()=>i(!1),1500)}catch{}};return(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,background:`var(--bg-input)`,border:`1px solid var(--border)`,borderRadius:6,padding:`6px 8px`},children:[(0,E.jsx)(`code`,{style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,color:`var(--text)`},children:e}),(0,E.jsx)(`button`,{onClick:()=>void a(),style:Vi(),children:n(r?`updates.copied`:`updates.copyCommand`)})]}),(0,E.jsx)(`span`,{style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`},children:t})]})}function Vi(e){return{padding:`6px 12px`,background:`none`,border:`1px solid var(--border)`,borderRadius:6,color:`var(--text-muted)`,cursor:e?`not-allowed`:`pointer`,fontSize:`var(--text-base)`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,gap:6,whiteSpace:`nowrap`,flexShrink:0}}function Hi({title:e,subtitle:t,right:n,children:r}){return(0,E.jsxs)(`div`,{style:{border:`1px solid var(--border)`,borderRadius:10,background:`var(--bg-panel)`},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:16,padding:`10px 14px`},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2,minWidth:0},children:[(0,E.jsx)(`span`,{style:{fontSize:`var(--text-lg)`,color:`var(--text)`,fontWeight:500},children:e}),(0,E.jsx)(`span`,{style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`,fontFamily:`var(--font-mono)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t})]}),(0,E.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flexShrink:0},children:n})]}),r?(0,E.jsx)(`div`,{style:{borderTop:`1px solid var(--border)`,padding:`8px 14px 10px`},children:r}):null]})}function Ui({cwd:e}){let{t}=N(),{value:n}=P(we),[r,i]=(0,d.useState)(null),[a,o]=(0,d.useState)(!1),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(null),f=Li(),p=(0,d.useRef)(null),m=r??n?.enabled!==!1,h=n?.ignored??{},g=(e,t)=>t!==null&&Ae(t,e)>0,_=(e,t)=>{o(!0);let n=f.start(e,zi);p.current=n.promise,n.promise.catch(e=>{e instanceof Fi||(t?.(),u(e instanceof Error?e.message:String(e)))}).finally(()=>{p.current===n.promise&&o(!1)})},v=()=>{u(null),_(async e=>{await we.refresh(e)})},y=(e,t)=>{u(null),t?.optimisticEnabled!==void 0&&i(t.optimisticEnabled),_(async t=>{let n=await fetch(`/api/updates-config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e),signal:t}),r=await n.json();if(!n.ok||r.error)throw Error(r.error??`HTTP ${n.status}`);await we.refresh(t)},()=>{t?.optimisticEnabled!==void 0&&i(null)})},b=e=>void y({enabled:e},{optimisticEnabled:e}),x=(e,t)=>void y({ignored:{[e]:t}}),S=async(t,n)=>{if(e){c(t),u(null);try{let r=await fetch(`/api/plugins`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`update`,source:t,scope:n===`project`?`project`:`global`,cwd:e})}),i=await r.json();if(!r.ok||i.error)throw Error(i.error??`HTTP ${r.status}`);await we.refresh(),xe.load().catch(e=>console.error(`[pi-web] load home plugins:`,e))}catch(e){u(e instanceof Error?e.message:String(e))}finally{c(null)}}},C=n?g(n.piWeb.current,n.piWeb.latest):!1,w=h[ke]===n?.piWeb.latest;return(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12,padding:16},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:8,cursor:`pointer`,fontSize:`var(--text-base)`,color:`var(--text-muted)`},children:[(0,E.jsx)(`input`,{type:`checkbox`,"data-testid":`updates-enabled-toggle`,checked:m,onChange:e=>b(e.target.checked)}),(0,E.jsx)(`span`,{children:t(`updates.enableChecking`)})]}),(0,E.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:6,fontSize:`var(--text-base)`,color:`var(--text-dim)`,flex:1},children:[m?n?`${t(`updates.checkedAt`)} ${new Date(n.checkedAt).toLocaleTimeString()}`:t(`updates.checking`):t(`updates.disabled`),l?` · ${l}`:``]}),(0,E.jsxs)(`button`,{onClick:v,disabled:a||!m,style:Vi(a||!m),children:[a&&(0,E.jsx)(oi,{size:14,className:`animate-spin`,"aria-hidden":`true`}),t(a?`updates.checking`:`updates.check`)]})]}),(0,E.jsx)(Hi,{title:`pi-web`,subtitle:n?`${n.piWeb.current}${C?` → ${n.piWeb.latest}`:``}`:`…`,right:n?m?C?w?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`span`,{style:{color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:t(`updates.ignored`,{version:n.piWeb.latest??``})}),(0,E.jsx)(`button`,{onClick:()=>x(ke,null),style:Vi(),children:t(`updates.unignore`)})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`span`,{style:{color:`var(--status-success)`,fontWeight:500},children:t(`updates.updateAvailable`)}),(0,E.jsx)(`button`,{onClick:()=>x(ke,n.piWeb.latest),style:Vi(),children:t(`updates.ignoreVersion`)})]}):n.piWeb.latest===null?(0,E.jsx)(`span`,{style:{color:`var(--text-dim)`},children:t(`updates.unavailable`)}):(0,E.jsx)(`span`,{style:{color:`var(--text-dim)`},children:t(`updates.upToDate`)}):(0,E.jsx)(`span`,{style:{color:`var(--text-dim)`},children:t(`updates.disabled`)}):null,children:n&&C&&n.piWeb.latest!==null&&(0,E.jsx)(Bi,{command:`npm install -g @rainmanhhh/pi-web@${n.piWeb.latest}`,note:t(`updates.restartNote`)})}),(0,E.jsx)(`div`,{style:{fontSize:`var(--text-lg)`,color:`var(--text)`,fontWeight:500,marginTop:4},children:t(`common.plugins`)}),!m||(n?.plugins.length??0)===0?(0,E.jsx)(`span`,{style:{color:`var(--text-dim)`,fontSize:`var(--text-base)`},children:t(`updates.noPluginUpdates`)}):n?.plugins.map(e=>{let n=h[e.source]===`*`;return(0,E.jsx)(Hi,{title:e.displayName,subtitle:e.latest?`${e.current} → ${e.latest}`:e.source,right:n?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`span`,{style:{color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:t(`updates.ignoredPlugin`)}),(0,E.jsx)(`button`,{onClick:()=>x(e.source,null),style:Vi(),children:t(`updates.unignore`)})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`button`,{onClick:()=>void S(e.source,e.scope),disabled:s!==null,style:Vi(s!==null),children:[s===e.source&&(0,E.jsx)(oi,{size:14,className:`animate-spin`,"aria-hidden":`true`}),s===e.source?t(`i18n.updating`):t(`i18n.update`)]}),(0,E.jsx)(`button`,{onClick:()=>x(e.source,`*`),disabled:s!==null,style:Vi(s!==null),children:t(`updates.ignoreVersion`)})]})},`${e.scope}:${e.source}`)})]})}function Wi(e,t){let n=(0,d.useRef)(t);(n.current.length!==t.length||n.current.some((e,n)=>e!==t[n]))&&e(),n.current=t}var Gi=t(c(),1);function Ki({children:e}){return(0,E.jsx)(E.Fragment,{children:e})}function qi({label:e,wrapperStyle:t,children:n}){let r=(0,d.useRef)(null),i=(0,d.useRef)(null),[a,o]=(0,d.useState)(!1),[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)({top:0,left:0,placement:`bottom`});if((0,d.useLayoutEffect)(()=>{if(!e||!a||!s)return;let t=r.current?.getBoundingClientRect(),n=i.current;if(!t||!n)return;let o=n.offsetWidth,c=n.offsetHeight;if(!o)return;let l=t.left+t.width/2,d=o/2,f=window.innerWidth,p=window.innerHeight,m=Math.max(d+8,Math.min(l,f-d-8)),h=t.bottom+6+c<=p-8,g=t.top-6-c>=8,_=h||!g?`bottom`:`top`;u({top:_===`bottom`?t.bottom+6:t.top-6,left:m,placement:_})},[e,a,s]),!e)return(0,E.jsx)(E.Fragment,{children:n});let f=()=>{let e=r.current?.getBoundingClientRect();e&&u({top:e.bottom+6,left:e.left+e.width/2,placement:`bottom`})},p=()=>{f(),c(!0),o(!0)},m=()=>o(!1),h=s&&typeof document<`u`?(0,Gi.createPortal)((0,E.jsx)(`div`,{ref:i,role:`tooltip`,"data-slot":`tooltip-content`,style:{position:`fixed`,top:l.top,left:l.left,transform:l.placement===`top`?`translate(-50%, -100%)`:`translateX(-50%)`,zIndex:9999,width:`max-content`,maxWidth:`min(20rem, calc(100vw - 16px))`,whiteSpace:`pre-line`,overflowWrap:`break-word`,background:`var(--bg-panel)`,color:`var(--text)`,border:`1px solid var(--border)`,borderRadius:`var(--radius-md, 6px)`,padding:`4px 8px`,fontSize:`var(--text-sm)`,lineHeight:1.5,boxShadow:`0 4px 16px -2px var(--shadow-strong)`,pointerEvents:`none`,display:a?`block`:`none`},children:e}),document.body):null;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`span`,{ref:r,"data-slot":`tooltip-trigger`,title:``,onPointerEnter:p,onPointerLeave:m,onMouseEnter:p,onMouseLeave:m,onFocus:p,onBlur:m,onPointerMove:e=>e.stopPropagation(),style:{display:`inline-flex`,...t},children:n}),h]})}var Ji={boxSizing:`border-box`,background:`var(--bg-input, var(--bg))`,color:`var(--text)`,border:`1px solid var(--border)`,borderRadius:4,padding:`4px 8px`,fontSize:`var(--text-base)`,fontFamily:`var(--font-mono)`},Yi={display:`flex`,alignItems:`center`,justifyContent:`center`,width:22,height:22,padding:0,background:`none`,border:`1px solid var(--border)`,borderRadius:5,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-sm)`,lineHeight:1,flexShrink:0};function Xi({value:e,onChange:t,parse:n}){let[r,i]=(0,d.useState)(String(e));return Wi(()=>{i(String(e))},[e]),{draft:r,commit:e=>{i(e);let r=n(e);r!==null&&t(r)}}}function Zi({tooltip:e=!1,offText:t,...n}){let{t:r,labelKey:i,unitText:a,rangeText:o,resetText:s,defaultValue:c,min:l,max:u}=n,{draft:d,commit:f}=Xi(n),p=t!=null&&n.value===c?t:o,m=(0,E.jsx)(`input`,{type:`number`,min:l,max:u,step:1,value:d,onChange:e=>f(e.target.value),"aria-label":r(i),...e?{}:{title:p},style:{flex:1,minWidth:0,...Ji}}),h=(0,E.jsx)(`button`,{type:`button`,onClick:()=>n.onChange(c),"aria-label":s,...e?{}:{title:s},style:Yi,children:`↺`});return(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`},children:[e?(0,E.jsx)(qi,{label:p,wrapperStyle:{flex:1,display:`flex`},children:m}):m,(0,E.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`,whiteSpace:`nowrap`},children:a}),e?(0,E.jsx)(qi,{label:s,children:h}):h]})}function Qi({unitSuffix:e,offText:t,tooltip:n=!0,...r}){let{t:i,labelKey:a,rangeText:o,resetText:s,value:c,defaultValue:l,min:u,max:d}=r,{draft:f,commit:p}=Xi(r);return(0,E.jsxs)(`div`,{role:`menu`,"aria-label":i(a),style:{background:`var(--bg-panel)`,borderLeft:`1px solid var(--border)`,borderRight:`1px solid var(--border)`,borderBottom:`1px solid var(--border)`,padding:`10px 12px 12px`},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`var(--text-base)`,color:`var(--text-muted)`,marginBottom:8},children:[(0,E.jsx)(`span`,{children:i(a)}),(0,E.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,E.jsxs)(`span`,{style:{fontFamily:`var(--font-mono)`,color:`var(--text)`,fontWeight:600},children:[c,e]}),(()=>{let e=(0,E.jsx)(`button`,{type:`button`,onClick:()=>r.onChange(l),"aria-label":s,...n?{}:{title:s},style:Yi,children:`↺`});return n?(0,E.jsx)(qi,{label:s,children:e}):e})()]})]}),(0,E.jsx)(`input`,{type:`number`,min:u,max:d,step:1,value:f,onChange:e=>p(e.target.value),"aria-label":i(a),style:{width:`100%`,...Ji}}),(0,E.jsx)(`div`,{style:{fontSize:`var(--text-xs)`,color:`var(--text-dim)`,marginTop:4,textAlign:`center`},children:t!=null&&c===l?t:o})]})}function $i({value:e,onChange:t,t:n,embedded:r}){let i={value:e,onChange:t,parse:ct,min:1,max:ot,defaultValue:200,t:n,labelKey:`theme.scrollStep`,unitText:n(`scrollStep.unit`),rangeText:n(`scrollStep.range`),resetText:n(`scrollStep.reset`,{n:200})};return r?(0,E.jsx)(Zi,{...i,tooltip:!0}):(0,E.jsx)(Qi,{...i,unitSuffix:`px`})}function ea({label:e,hint:t,children:n}){return(0,E.jsxs)(ta,{children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,minWidth:0},children:[(0,E.jsx)(`span`,{style:{fontSize:`var(--text-lg)`,color:`var(--text)`,fontWeight:500,whiteSpace:`nowrap`},children:e}),t&&(0,E.jsx)(qi,{label:t,children:(0,E.jsx)(`span`,{role:`img`,"aria-label":t,style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`,cursor:`help`,lineHeight:1,flexShrink:0},children:`ⓘ`})})]}),(0,E.jsx)(`div`,{style:{flex:1,minWidth:0,maxWidth:320},children:n})]})}function ta({children:e}){return(0,E.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:16,padding:`10px 14px`,border:`1px solid var(--border)`,borderRadius:10,background:`var(--bg-panel)`},children:e})}function na({sidebarWidth:e,onSidebarWidthChange:t,widgetPanelWidth:n,onWidgetPanelWidthChange:r}){let{t:i}=N(),{isDark:a,toggleTheme:o,fontScale:s,setFontScale:c,scrollStepPx:l,setScrollStepPx:u,longBlockCollapseChars:d,setLongBlockCollapseChars:f,recentBlocksExpanded:p,setRecentBlocksExpanded:m}=ze();return(0,E.jsxs)(`div`,{style:{height:`100%`,overflowY:`auto`,padding:`18px 20px 40px`,display:`flex`,flexDirection:`column`,gap:8,maxWidth:640},children:[(0,E.jsx)(ea,{label:i(`theme.toggleTheme`),children:(0,E.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,width:`100%`},children:[{value:!0,key:`dark`,labelKey:`theme.darkMode`},{value:!1,key:`light`,labelKey:`theme.lightMode`}].map(({value:e,key:t,labelKey:n})=>(0,E.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,gap:6,fontSize:`var(--text-base)`,color:`var(--text)`,cursor:`pointer`,whiteSpace:`nowrap`},children:[(0,E.jsx)(`input`,{type:`radio`,name:`theme-mode`,checked:a===e,onChange:e=>{let t=e.currentTarget.getBoundingClientRect();o({x:t.left+t.width/2,y:t.top+t.height/2})},style:{accentColor:`var(--accent)`,cursor:`pointer`,margin:0}}),i(n)]},t))})}),(0,E.jsx)(ea,{label:i(`theme.fontSize`),children:(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,width:`100%`},children:[(0,E.jsx)(`input`,{type:`range`,min:.85,max:1.3,step:.05,value:s,onChange:e=>c(Number(e.target.value)),"aria-label":i(`theme.fontSize`),style:{flex:1,accentColor:`var(--accent)`,cursor:`pointer`}}),(0,E.jsxs)(`span`,{style:{fontFamily:`var(--font-mono)`,fontSize:`var(--text-base)`,color:`var(--text)`,fontWeight:600,minWidth:44,textAlign:`right`},children:[Math.round(s*100),`%`]})]})}),(0,E.jsx)(ea,{label:i(`theme.scrollStep`),hint:i(`scrollStep.hint`),children:(0,E.jsx)($i,{value:l,onChange:u,t:i,embedded:!0})}),(0,E.jsx)(ea,{label:i(`theme.longBlockCollapse`),hint:i(`longBlock.hint`),children:(0,E.jsx)(aa,{value:d,onChange:f,t:i})}),(0,E.jsx)(ea,{label:i(`theme.recentBlocksExpanded`),hint:i(`recentBlocks.hint`),children:(0,E.jsx)(ia,{value:p,onChange:m,t:i})}),(0,E.jsx)(ea,{label:i(`layout.sidebarWidth`),hint:i(`layout.widthRange`,{min:180,max:480}),children:(0,E.jsx)(ra,{value:e,onChange:t,min:180,max:480,resetTo:280,label:i(`layout.sidebarWidth`),t:i})}),(0,E.jsx)(ea,{label:i(`layout.widgetPanelWidth`),hint:i(`layout.widthRange`,{min:200,max:560}),children:(0,E.jsx)(ra,{value:n,onChange:r,min:200,max:560,resetTo:280,label:i(`layout.widgetPanelWidth`),t:i})}),` `]})}function ra({value:e,onChange:t,min:n,max:r,resetTo:i,label:a,t:o}){return(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[(0,E.jsx)(`input`,{type:`number`,value:e,min:n,max:r,onChange:e=>{let i=Number.parseInt(e.target.value,10);Number.isFinite(i)&&t(Math.min(r,Math.max(n,i)))},onBlur:()=>t(e),"aria-label":a,style:{width:80,padding:`5px 8px`,border:`1px solid var(--border)`,borderRadius:7,background:`var(--bg)`,color:`var(--text)`,fontSize:`var(--text-lg)`,fontVariantNumeric:`tabular-nums`,outline:`none`}}),(0,E.jsx)(`span`,{style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`},children:`px`}),(0,E.jsx)(qi,{label:o(`layout.widthReset`,{value:i}),children:(0,E.jsx)(`button`,{type:`button`,onClick:()=>t(i),"aria-label":o(`layout.widthReset`,{value:i}),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:26,height:26,padding:0,background:`none`,border:`none`,borderRadius:5,color:`var(--text-dim)`,cursor:`pointer`},children:(0,E.jsxs)(`svg`,{width:p.base,height:p.base,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,E.jsx)(`path`,{d:`M3 3v5h5`})]})})})]})}function ia({value:e,onChange:t,t:n}){return(0,E.jsx)(Zi,{tooltip:!0,value:e,onChange:t,parse:ht,min:0,max:20,defaultValue:0,t:n,labelKey:`theme.recentBlocksExpanded`,unitText:n(`longBlock.blocks`),rangeText:n(`recentBlocks.range`),resetText:n(`recentBlocks.reset`,{n:0})})}function aa({value:e,onChange:t,t:n}){return(0,E.jsx)(Zi,{tooltip:!0,value:e,onChange:t,parse:ft,min:20,max:ut,defaultValue:200,t:n,labelKey:`theme.longBlockCollapse`,unitText:n(`longBlock.chars`),rangeText:n(`longBlock.range`),resetText:n(`longBlock.reset`,{n:200})})}var oa=[`auto`,`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],sa=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`];function ca(e,t){if(!t||t.length===0)return e;let n=new Set(t);if(n.has(e))return e;let r=sa.indexOf(e);for(let e=r+1;e<sa.length;e++)if(n.has(sa[e]))return sa[e];for(let e=r-1;e>=0;e--)if(n.has(sa[e]))return sa[e];return e}var la={auto:`chat.thinkingUseDefault`,off:`chat.thinkingOff`,minimal:`chat.thinkingMinimal`,low:`chat.thinkingLow`,medium:`chat.thinkingMedium`,high:`chat.thinkingHigh`,xhigh:`chat.thinkingXhigh`,max:`chat.thinkingMax`},ua={off:`var(--text-dim)`,minimal:`var(--text-muted)`,low:`#60a5fa`,medium:`#a78bfa`,high:`#f472b6`,xhigh:`#fb923c`,max:`#ef4444`};function da({value:e,onChange:t,t:n,embedded:r}){let i={value:e,onChange:t,parse:it,min:0,max:rt,defaultValue:0,t:n,labelKey:`theme.autoReloadSeconds`,unitText:n(`autoReload.unit`),rangeText:n(`autoReload.range`),resetText:n(`autoReload.reset`,{n:0})};return r?(0,E.jsx)(Zi,{...i,tooltip:!0,offText:n(`autoReload.off`)}):(0,E.jsx)(Qi,{...i,unitSuffix:`s`,offText:n(`autoReload.off`)})}var fa=Object.defineProperty,pa=(e,t)=>fa(e,`name`,{value:t,configurable:!0});function ma(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}pa(ma,`setRef`);function ha(...e){return t=>{let n=!1,r=e.map(e=>{let r=ma(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():ma(e[t],null)}}}}pa(ha,`composeRefs`);function ga(...e){return d.useCallback(ha(...e),e)}pa(ga,`useComposedRefs`);var _a=Object.defineProperty,va=(e,t)=>_a(e,`name`,{value:t,configurable:!0});function ya(e){let t=d.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Oa(r)&&typeof Ma==`function`&&(r=Ma(r._payload)),d.Children.forEach(r,e=>{if(Ea(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Oa(n)&&typeof Ma==`function`&&(n=Ma(n._payload)),a=Ca(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=d.cloneElement(a,void 0,s):!o&&d.Children.count(r)===1&&d.isValidElement(r)&&(a=r);let c=a?Ta(a):void 0,l=ga(n,c);if(!a){if(r||r===0)throw Error(o?ja(e):Aa(e));return r}let u=wa(i,a.props??{});return a.type!==d.Fragment&&(u.ref=n?l:c),d.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}va(ya,`createSlot`);var ba=ya(`Slot`),xa=Symbol.for(`radix.slottable`);function Sa(e){let t=va(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=xa,t}va(Sa,`createSlottable`);var Ca=va((e,t)=>{if(`child`in e.props){let t=e.props.child;return d.isValidElement(t)?d.cloneElement(t,void 0,e.props.children(t.props.children)):null}return d.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function wa(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}va(wa,`mergeProps`);function Ta(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}va(Ta,`getElementRef`);function Ea(e){return d.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===xa}va(Ea,`isSlottable`);var Da=Symbol.for(`react.lazy`);function Oa(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Da&&`_payload`in e&&ka(e._payload)}va(Oa,`isLazyComponent`);function ka(e){return typeof e==`object`&&!!e&&`then`in e}va(ka,`isPromiseLike`);var Aa=va(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),ja=va(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Ma=d.use,Na=Object.defineProperty,Pa=(e,t)=>Na(e,`name`,{value:t,configurable:!0}),Fa=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=ya(`Primitive.${t}`),r=d.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,E.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ia(e,t){e&&Gi.flushSync(()=>e.dispatchEvent(t))}Pa(Ia,`dispatchDiscreteCustomEvent`);var La=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Ra=Object.defineProperty,za=(e,t)=>Ra(e,`name`,{value:t,configurable:!0});function Ba(e,t){let n=d.createContext(t);n.displayName=e+`Context`;let r=za(e=>{let{children:t,...r}=e,i=d.useMemo(()=>r,Object.values(r));return(0,E.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=d.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return za(i,`useContext`),[r,i]}za(Ba,`createContext`);function Va(e,t=[]){let n=[];function r(t,r){let i=d.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=za(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=d.useMemo(()=>o,Object.values(o));return(0,E.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=d.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return za(s,`useContext`),[o,s]}za(r,`createContext`);let i=za(()=>{let t=n.map(e=>d.createContext(e));return za(function(n){let r=n?.[e]||t;return d.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Ha(i,...t)]}za(Va,`createContextScope`);function Ha(...e){let t=e[0];if(e.length===1)return t;let n=za(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return za(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}za(Ha,`composeContextScopes`);var Ua=Object.defineProperty,Wa=(e,t)=>Ua(e,`name`,{value:t,configurable:!0});function Ga(e){let t=e+`CollectionProvider`,[n,r]=Va(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Wa(e=>{let{scope:t,children:n}=e,r=d.useRef(null),a=d.useRef(new Map).current;return(0,E.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=ya(s),l=d.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=ga(t,a(s,n).collectionRef);return(0,E.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=ya(u),m=d.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=d.useRef(null),s=ga(t,o),c=a(u,n);return d.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,E.jsx)(p,{[f]:``,ref:s,children:r})});m.displayName=u;function h(t){let n=a(e+`CollectionConsumer`,t);return d.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Wa(h,`useCollection`),[{Provider:o,Slot:l,ItemSlot:m},h,r]}Wa(Ga,`createCollection`);var Ka=new WeakMap,qa=class e extends Map{static{Wa(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Ka.set(this,!0)}set(e,t){return Ka.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Xa(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Ja(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Ja(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Ja(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Ja(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Ya(e,t);return n===-1?void 0:e[n]}Wa(Ja,`at`);function Ya(e,t){let n=e.length,r=Xa(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Wa(Ya,`toSafeIndex`);function Xa(e){return e!==e||e===0?0:Math.trunc(e)}Wa(Xa,`toSafeInteger`);function Za(e){let t=e+`CollectionProvider`,[n,r]=Va(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new qa,setItemMap:Wa(()=>void 0,`setItemMap`)}),o=Wa(({state:e,...t})=>e?(0,E.jsx)(c,{...t,state:e}):(0,E.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=Wa(e=>{let t=g();return(0,E.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=Wa(e=>{let{scope:t,children:n,state:r}=e,a=d.useRef(null),[o,s]=d.useState(null),c=ga(a,s),[l,u]=r;return d.useEffect(()=>{if(!o)return;let e=to(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,E.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=ya(l),f=d.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=ga(t,a(l,n).collectionRef);return(0,E.jsx)(u,{ref:i,children:r})});f.displayName=l;let p=e+`CollectionItemSlot`,m=ya(p),h=d.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=d.useRef(null),[s,c]=d.useState(null),l=ga(t,o,c),{setItemMap:u}=a(p,n),f=d.useRef(i);Qa(f.current,i)||(f.current=i);let h=f.current;return d.useEffect(()=>{let e=h;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(eo):(t.set(s,{...e,element:s}),t.toSorted(eo)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new qa(e)))}},[s,h,u]),(0,E.jsx)(m,{"data-radix-collection-item":``,ref:l,children:r})});h.displayName=p;function g(){return d.useState(new qa)}Wa(g,`useInitCollection`);function _(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return Wa(_,`useCollection`),[{Provider:o,Slot:f,ItemSlot:h},{createCollectionScope:r,useCollection:_,useInitCollection:g}]}Wa(Za,`createCollection`);function Qa(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Wa(Qa,`shallowEqual`);function $a(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Wa($a,`isElementPreceding`);function eo(e,t){return!e[1].element||!t[1].element?0:$a(e[1].element,t[1].element)?-1:1}Wa(eo,`sortByDocumentPosition`);function to(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Wa(to,`getChildListObserver`);var no=Object.defineProperty,ro=(e,t)=>no(e,`name`,{value:t,configurable:!0}),io=!!(typeof window<`u`&&window.document&&window.document.createElement);function ao(e,t,{checkForDefaultPrevented:n=!0}={}){return ro(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}ro(ao,`composeEventHandlers`);function oo(e){if(!io)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}ro(oo,`getOwnerWindow`);function so(e){if(!io)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}ro(so,`getOwnerDocument`);function co(e,t=!1){let{activeElement:n}=so(e);if(!n?.nodeName)return null;if(lo(n)&&n.contentDocument)return co(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=so(n).getElementById(e);if(t)return t}}return n}ro(co,`getActiveElement`);function lo(e){return e.tagName===`IFRAME`}ro(lo,`isFrame`);var uo=globalThis?.document?d.useLayoutEffect:()=>{},fo=Object.defineProperty,po=(e,t)=>fo(e,`name`,{value:t,configurable:!0}),mo=d.useEffectEvent,ho=d.useInsertionEffect;function go(e){if(typeof mo==`function`)return mo(e);let t=d.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof ho==`function`?ho(()=>{t.current=e}):uo(()=>{t.current=e}),d.useMemo(()=>((...e)=>t.current?.(...e)),[])}po(go,`useEffectEvent`);var _o=Object.defineProperty,vo=(e,t)=>_o(e,`name`,{value:t,configurable:!0}),yo=d.useInsertionEffect||uo;function bo({prop:e,defaultProp:t,onChange:n=vo(()=>{},`onChange`),caller:r}){let[i,a,o]=xo({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,d.useCallback(t=>{if(s){let n=So(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}vo(bo,`useControllableState`);function xo({defaultProp:e,onChange:t}){let[n,r]=d.useState(e),i=d.useRef(n),a=d.useRef(t);return yo(()=>{a.current=t},[t]),d.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}vo(xo,`useUncontrolledState`);function So(e){return typeof e==`function`}vo(So,`isFunction`);var Co=Symbol(`RADIX:SYNC_STATE`);function wo(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=go(o),u=[{...n,state:a}];r&&u.push(r);let[f,p]=d.useReducer((t,n)=>{if(n.type===Co)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),m=f.state,h=d.useRef(m);d.useEffect(()=>{h.current!==m&&(h.current=m,c||l(m))},[m,h,c]);let g=d.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return d.useEffect(()=>{c&&!Object.is(i,f.state)&&p({type:Co,state:i})},[i,f.state,c]),[g,p]}vo(wo,`useControllableStateReducer`);var To=Object.defineProperty,Eo=(e,t)=>To(e,`name`,{value:t,configurable:!0});function Do(e,t){return d.useReducer((e,n)=>t[e][n]??e,e)}Eo(Do,`useStateMachine`);var Oo=Eo(e=>{let{present:t,children:n}=e,r=ko(t),i=typeof n==`function`?n({present:r.isPresent}):d.Children.only(n),a=jo(r.ref,No(i));return typeof n==`function`||r.isPresent?d.cloneElement(i,{ref:a}):null},`Presence`);function ko(e){let[t,n]=d.useState(),r=d.useRef(null),i=d.useRef(e),a=d.useRef(`none`),o=d.useRef(void 0),[s,c]=Do(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return d.useEffect(()=>{s===`mounted`?(a.current=o.current??Mo(r.current),o.current=void 0):a.current=`none`},[s]),uo(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Mo(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),uo(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Eo(a=>{let o=Mo(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Eo(e=>{e.target===t&&(a.current=Mo(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:d.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Mo(t)}else r.current=null;n(e)},[])}}Eo(ko,`usePresence`);function Ao(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Eo(Ao,`setRef`);function jo(...e){let t=d.useRef(e);return t.current=e,d.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Ao(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Ao(n[e],null)}}},[])}Eo(jo,`useStableComposedRefs`);function Mo(e){return e?.animationName||`none`}Eo(Mo,`getAnimationName`);function No(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Eo(No,`getElementRef`);var Po=Object.defineProperty,Fo=(e,t)=>Po(e,`name`,{value:t,configurable:!0}),Io=d.useId||(()=>void 0),Lo=0;function Ro(e){let[t,n]=d.useState(Io());return uo(()=>{e||n(e=>e??String(Lo++))},[e]),e||(t?`radix-${t}`:``)}Fo(Ro,`useId`);var zo=Object.defineProperty,Bo=(e,t)=>zo(e,`name`,{value:t,configurable:!0}),Vo=`Collapsible`,[Ho,Uo]=Va(Vo),[Wo,Go]=Ho(Vo),Ko=d.forwardRef(Bo(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=bo({prop:r,defaultProp:i??!1,onChange:o,caller:Vo});return(0,E.jsx)(Wo,{scope:n,disabled:a,contentId:Ro(),open:c,onOpenToggle:d.useCallback(()=>l(e=>!e),[l]),children:(0,E.jsx)(Fa.div,{"data-state":Qo(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),qo=`CollapsibleTrigger`,Jo=d.forwardRef(Bo(function(e,t){let{__scopeCollapsible:n,...r}=e,i=Go(qo,n);return(0,E.jsx)(Fa.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Qo(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:ao(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),Yo=`CollapsibleContent`,Xo=d.forwardRef(Bo(function(e,t){let{forceMount:n,...r}=e,i=Go(Yo,e.__scopeCollapsible);return(0,E.jsx)(Oo,{present:n||i.open,children:({present:e})=>(0,E.jsx)(Zo,{...r,ref:t,present:e})})},`CollapsibleContent`)),Zo=d.forwardRef(Bo(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=Go(Yo,n),[s,c]=d.useState(r),l=d.useRef(null),u=ga(t,l),f=d.useRef(0),p=f.current,m=d.useRef(0),h=m.current,g=o.open||s,_=d.useRef(g),v=d.useRef(void 0);return d.useEffect(()=>{let e=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(e)},[]),uo(()=>{let e=l.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();f.current=t.height,m.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),c(r)}},[o.open,r]),(0,E.jsx)(Fa.div,{"data-state":Qo(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!g,...a,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:g&&i})},`CollapsibleContentImpl`));function Qo(e){return e?`open`:`closed`}Bo(Qo,`getState`);var $o=Ko,es=Object.defineProperty,ts=(e,t)=>es(e,`name`,{value:t,configurable:!0}),ns=d.createContext(void 0);function rs(e){let t=d.useContext(ns);return e||t||`ltr`}ts(rs,`useDirection`);var is=Object.defineProperty,as=(e,t)=>is(e,`name`,{value:t,configurable:!0});function os(e){let t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>((...e)=>t.current?.(...e)),[])}as(os,`useCallbackRef`);var ss=Object.defineProperty,cs=(e,t)=>ss(e,`name`,{value:t,configurable:!0}),ls=`dismissableLayer.update`,us=`dismissableLayer.pointerDownOutside`,ds=`dismissableLayer.focusOutside`,fs,ps=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ms=d.forwardRef(cs(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=d.useContext(ps),[f,p]=d.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=d.useState({}),g=ga(t,p),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=f?_.indexOf(f):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=d.useRef(!1),w=_s(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:d.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=vs(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},m),D=f?b===_.length-1:!1,O=os(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return d.useEffect(()=>{if(D)return m.addEventListener(`keydown`,O,{capture:!0}),()=>m.removeEventListener(`keydown`,O,{capture:!0})},[m,D,O]),d.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(fs=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),ys(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(f),u.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=fs))}},[f,m,n,u]),d.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),ys())},[f,u]),d.useEffect(()=>{let e=cs(()=>h({}),`handleUpdate`);return document.addEventListener(ls,e),()=>document.removeEventListener(ls,e)},[]),(0,E.jsx)(Fa.div,{...l,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:ao(e.onFocusCapture,T.onFocusCapture),onBlurCapture:ao(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ao(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function hs(){let e=d.useContext(ps),[t,n]=d.useState(null);return d.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}cs(hs,`useDismissableLayerSurface`);var gs=cs(()=>!0,`IS_TRUE`);function _s(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=gs}=t,s=os(e),c=d.useRef(!1),l=d.useRef(!1),u=d.useRef(new Map),f=d.useRef(()=>{});return d.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}cs(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}cs(t,`isOutsideInteractionIntercepted`);function d(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&f.current()},0)}cs(d,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}cs(p,`handleInteractionBubble`);let m=cs(a=>{if(a.target&&!c.current){let d=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||bs(us,s,p,{discrete:!0})};if(cs(d,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?d():(n.removeEventListener(`click`,f.current),f.current=d,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,d,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,d,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:cs(()=>c.current=!0,`onPointerDownCapture`)}}cs(_s,`usePointerDownOutside`);function vs(e,t=globalThis?.document){let n=os(e),r=d.useRef(!1);return d.useEffect(()=>{let e=cs(e=>{e.target&&!r.current&&bs(ds,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:cs(()=>r.current=!0,`onFocusCapture`),onBlurCapture:cs(()=>r.current=!1,`onBlurCapture`)}}cs(vs,`useFocusOutside`);function ys(){let e=new CustomEvent(ls);document.dispatchEvent(e)}cs(ys,`dispatchUpdate`);function bs(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ia(i,a):i.dispatchEvent(a)}cs(bs,`handleAndDispatchCustomEvent`);var xs=Object.defineProperty,Ss=(e,t)=>xs(e,`name`,{value:t,configurable:!0}),Cs=`focusScope.autoFocusOnMount`,ws=`focusScope.autoFocusOnUnmount`,Ts={bubbles:!1,cancelable:!0},Es=d.forwardRef(Ss(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=d.useState(null),l=os(i),u=os(a),f=d.useRef(null),p=ga(t,c),m=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?f.current=t:Ns(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Ns(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Ns(s)};Ss(e,`handleFocusIn`),Ss(t,`handleFocusOut`),Ss(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,m.paused]),d.useEffect(()=>{if(s){Ps.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Cs,Ts);s.addEventListener(Cs,l),s.dispatchEvent(t),t.defaultPrevented||(Ds(Ls(ks(s)),{select:!0}),document.activeElement===e&&Ns(s))}return()=>{s.removeEventListener(Cs,l),setTimeout(()=>{let t=new CustomEvent(ws,Ts);s.addEventListener(ws,u),s.dispatchEvent(t),t.defaultPrevented||Ns(e??document.body,{select:!0}),s.removeEventListener(ws,u),Ps.remove(m)},0)}}},[s,l,u,m]);let h=d.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Os(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Ns(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Ns(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,E.jsx)(Fa.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})},`FocusScope`));function Ds(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Ns(r,{select:t}),document.activeElement!==n)return}Ss(Ds,`focusFirst`);function Os(e){let t=ks(e);return[As(t,e),As(t.reverse(),e)]}Ss(Os,`getTabbableEdges`);function ks(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Ss(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Ss(ks,`getTabbableCandidates`);function As(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):js(r,{upTo:t})))return r}Ss(As,`findVisible`);function js(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Ss(js,`isHidden`);function Ms(e){return e instanceof HTMLInputElement&&`select`in e}Ss(Ms,`isSelectableInput`);function Ns(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ms(e)&&t&&e.select()}}Ss(Ns,`focus`);var Ps=Fs();function Fs(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Is(e,t),e.unshift(t)},remove(t){e=Is(e,t),e[0]?.resume()}}}Ss(Fs,`createFocusScopesStack`);function Is(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Ss(Is,`arrayRemove`);function Ls(e){return e.filter(e=>e.tagName!==`A`)}Ss(Ls,`removeLinks`);var Rs=Object.defineProperty,zs=d.forwardRef(((e,t)=>Rs(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=d.useState(!1);uo(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Gi.createPortal((0,E.jsx)(Fa.div,{...r,ref:t}),o):null},`Portal`)),Bs=Object.defineProperty,Vs=(e,t)=>Bs(e,`name`,{value:t,configurable:!0}),Hs=0,Us=null;function Ws(e){return Gs(),e.children}Vs(Ws,`FocusGuards`);function Gs(){d.useEffect(()=>{Us||={start:Ks(),end:Ks()};let{start:e,end:t}=Us;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Hs++,()=>{Hs===1&&(Us?.start.remove(),Us?.end.remove(),Us=null),Hs=Math.max(0,Hs-1)}},[])}Vs(Gs,`useFocusGuards`);function Ks(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Vs(Ks,`createFocusGuard`);var qs=function(){return qs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},qs.apply(this,arguments)};function Js(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ys(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Xs=`right-scroll-bar-position`,Zs=`width-before-scroll-bar`,Qs=`with-scroll-bars-hidden`,$s=`--removed-body-scroll-bar-size`;function ec(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function tc(e,t){var n=(0,d.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var nc=typeof window<`u`?d.useLayoutEffect:d.useEffect,rc=new WeakMap;function ic(e,t){var n=tc(t||null,function(t){return e.forEach(function(e){return ec(e,t)})});return nc(function(){var t=rc.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||ec(e,null)}),i.forEach(function(e){r.has(e)||ec(e,a)})}rc.set(n,e)},[e]),n}function ac(e){return e}function oc(e,t){t===void 0&&(t=ac);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function sc(e){e===void 0&&(e={});var t=oc(null);return t.options=qs({async:!0,ssr:!1},e),t}var cc=function(e){var t=e.sideCar,n=Js(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return d.createElement(r,qs({},n))};cc.isSideCarExport=!0;function lc(e,t){return e.useMedium(t),cc}var uc=sc(),dc=function(){},fc=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:dc,onWheelCapture:dc,onTouchMoveCapture:dc}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Js(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=ic([n,t]),w=qs(qs({},x),i);return d.createElement(d.Fragment,null,u&&d.createElement(S,{sideCar:uc,removeScrollBar:l,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?d.cloneElement(d.Children.only(s),qs(qs({},w),{ref:C})):d.createElement(y,qs({},w,{className:c,ref:C}),s))});fc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},fc.classNames={fullWidth:Zs,zeroRight:Xs};var pc=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function mc(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=pc();return t&&e.setAttribute(`nonce`,t),e}function hc(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function gc(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var _c=function(){var e=0,t=null;return{add:function(n){e==0&&(t=mc())&&(hc(t,n),gc(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},vc=function(){var e=_c();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},yc=function(){var e=vc();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},bc={left:0,top:0,right:0,gap:0},xc=function(e){return parseInt(e||``,10)||0},Sc=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[xc(n),xc(r),xc(i)]},Cc=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return bc;var t=Sc(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},wc=yc(),Tc=`data-scroll-locked`,Ec=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
11
11
  .${Qs} {
12
12
  overflow: hidden ${r};
13
13
  padding-right: ${s}px ${r};
@@ -437,7 +437,7 @@ ${e}</tr>
437
437
  `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${W1(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=G1(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+W1(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=G1(e);if(i===null)return W1(n);e=i;let a=`<img src="${e}" alt="${W1(n)}"`;return t&&(a+=` title="${W1(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:W1(e.text)}},t0=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},n0=class e{options;renderer;textRenderer;constructor(e){this.options=e||j$,this.options.renderer=this.options.renderer||new e0,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new t0}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},r0=class{options;block;constructor(e){this.options=e||j$}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?$1.lex:$1.lexInline}provideParser(e=this.block){return e?n0.parse:n0.parseInline}},i0=new class{defaults=A$();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=n0;Renderer=e0;TextRenderer=t0;Lexer=$1;Tokenizer=Q1;Hooks=r0;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new e0(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Q1(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new r0;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=r0.passThroughHooks.has(n)?e=>{if(this.defaults.async&&r0.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return $1.lex(e,t??this.defaults)}parser(e,t){return n0.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?$1.lex:$1.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?n0.parse:n0.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?$1.lex:$1.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?n0.parse:n0.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
438
438
  Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+W1(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function a0(e,t){return i0.parse(e,t)}a0.options=a0.setOptions=function(e){return i0.setOptions(e),a0.defaults=i0.defaults,M$(a0.defaults),a0},a0.getDefaults=A$,a0.defaults=j$,a0.use=function(...e){return i0.use(...e),a0.defaults=i0.defaults,M$(a0.defaults),a0},a0.walkTokens=function(e,t){return i0.walkTokens(e,t)},a0.parseInline=i0.parseInline,a0.Parser=n0,a0.parser=n0.parse,a0.Renderer=e0,a0.TextRenderer=t0,a0.Lexer=$1,a0.lexer=$1.lex,a0.Tokenizer=Q1,a0.Hooks=r0,a0.parse=a0,a0.options,a0.setOptions,a0.use,a0.walkTokens,a0.parseInline,n0.parse,$1.lex;var o0=`modulepreload`,s0=function(e){return`/`+e},c0={},l0=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=s0(t,n),t=s(t),t in c0)return;c0[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:o0,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},u0=300,d0=`300px`,f0=500;function p0(e={}){let{immediate:t=!1,debounceDelay:n=u0,rootMargin:r=d0,idleTimeout:i=f0}=e,[a,o]=(0,d.useState)(!1),s=(0,d.useRef)(null),c=(0,d.useRef)(null),l=(0,d.useRef)(null),u=(0,d.useMemo)(()=>e=>{let t=Date.now();return window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)},[]),f=(0,d.useMemo)(()=>typeof window<`u`&&window.requestIdleCallback?(e,t)=>window.requestIdleCallback(e,t):u,[u]),p=(0,d.useMemo)(()=>typeof window<`u`&&window.cancelIdleCallback?e=>window.cancelIdleCallback(e):e=>{clearTimeout(e)},[]);return(0,d.useEffect)(()=>{if(t){o(!0);return}let e=s.current;if(!e)return;c.current&&=(clearTimeout(c.current),null),l.current&&=(p(l.current),null);let a=()=>{c.current&&=(clearTimeout(c.current),null),l.current&&=(p(l.current),null)},u=e=>{l.current=f(t=>{t.timeRemaining()>0||t.didTimeout?(o(!0),e.disconnect()):l.current=f(()=>{o(!0),e.disconnect()},{timeout:i/2})},{timeout:i})},d=e=>{a(),c.current=window.setTimeout(()=>{var t;let n=e.takeRecords();(n.length===0||(t=n.at(-1)?.isIntersecting)!=null&&t)&&u(e)},n)},m=(e,t)=>{e.isIntersecting?d(t):a()},h=new IntersectionObserver(e=>{for(let t of e)m(t,h)},{rootMargin:r,threshold:0});return h.observe(e),()=>{c.current&&clearTimeout(c.current),l.current&&p(l.current),h.disconnect()}},[t,n,r,i,p,f]),{shouldRender:a,containerRef:s}}var m0=320,h0=4,g0=()=>typeof performance>`u`?Date.now():performance.now();function _0(e){let t=e?.now??g0,n=e?.maxBacklogMs??m0,r=0,i=0;return{now:t,beginPass(e){i=Math.min(Math.max(r,e),e+n)},mark(){return i},rewind(e){i=e},take(e,t,r){if(e<=0)return{baseDelay:0,step:Math.max(0,t)};let a=Math.max(0,t),o=a===0?0:Math.min(a,h0),s=Math.max(i,r),c=r+n,l=s+Math.max(0,e-1)*a,u=a;if(l>c&&e>1){if(s<c){let t=c-s;u=Math.max(o,t/(e-1))}else u=o}let d=Math.max(0,Math.round(s-r));return i=s+e*u,{baseDelay:d,step:u}},commitPass(){r=i}}}var v0=/\s/,y0=/^\s+$/,b0=new Set([`pre`,`svg`,`math`,`annotation`]),x0=new Set([`img`,`hr`]),S0=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`element`,C0=e=>e.some(e=>S0(e)&&b0.has(e.tagName)),w0=e=>{for(let t=e.length-1;t>=0;t--){let n=e[t];if(S0(n)&&n.tagName===`li`)return n}},T0=(e,t,n,r)=>{e.properties??={},e.properties[`data-sd-animate-marker`]=!0;let i=typeof e.properties.style==`string`?`${e.properties.style};`:``;e.properties.style=`${i}--sd-marker-duration:${t}ms;--sd-marker-delay:${Math.round(n)}ms;--sd-marker-easing:${r}`},E0=new Set([`ul`,`ol`,`li`]),D0=e=>{for(let t of e.children)if(S0(t)){if(t.tagName===`input`)return t;if(E0.has(t.tagName))continue;let e=D0(t);if(e)return e}},O0=(e,t,n,r)=>{e.properties??={},e.properties[`data-sd-animate`]=!0;let i=typeof e.properties.style==`string`?`${e.properties.style};`:``;e.properties.style=`${i}--sd-animation:sd-${t.animation};--sd-duration:${n}ms;--sd-easing:${t.easing};--sd-delay:${Math.round(r)}ms`},k0=(e,t,n,r)=>{let i=D0(e);i&&O0(i,t,n,r)},A0=(e,t,n,r,i,a)=>{if(C0(t))return;let o=r.prevContentLength,s=i.count;i.count+=1;let c=o>0&&s<o,l=c?0:a.baseDelay+i.newIndex++*a.step;O0(e,n,c?0:n.duration,l)},j0=e=>{var t;for(let n=e.length-1;n>=0;--n){let r=e[n];if(S0(r)){if((t=r.properties)!=null&&t[`data-sd-animated`])break;r.properties={...r.properties,"data-sd-animated":!0}}}},M0=e=>{let t=[],n=``,r=!1;for(let i of e){let e=v0.test(i);if(e!==r&&n){if(e){n+=i,r=!0;continue}t.push(n),n=``}n+=i,r=e}return n&&t.push(n),t},N0=e=>{let t=[],n=``;for(let r of e)v0.test(r)?t.length>0&&!y0.test(t.at(-1))?t[t.length-1]+=r:n+=r:(n&&=(t.push(n),``),t.push(r));return n&&(t.length>0?t[t.length-1]+=n:t.push(n)),t},P0=(e,t,n,r,i,a)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return a&&(o+=`;--sd-delay:${Math.round(a)}ms`),{type:`element`,tagName:`span`,properties:{"data-sd-animate":!0,style:o},children:[{type:`text`,value:e}]}},F0=(e,t)=>!(e>0&&t<e),I0=e=>S0(e)&&x0.has(e.tagName),L0=(e,t,n)=>{let r=0,i=0;return GO(e,e=>e.type===`text`||I0(e),(e,a)=>{if(C0(a))return WO;if(I0(e)){F0(n,i)&&(r+=1),i+=1;return}let o=e.value;if(!o.trim()){i+=o.length;return}let s=t.sep===`char`?N0(o):M0(o);for(let e of s){let t=i;i+=e.length,!y0.test(e)&&F0(n,t)&&(r+=1)}}),r},R0=(e,t,n,r,i,a)=>{var o;let s=t.at(-1);if(!(s&&`children`in s))return;if(C0(t))return WO;let c=s,l=c.children.indexOf(e);if(l===-1)return;let u=e.value;if(!u.trim()){i.count+=u.length;return}let d=n.sep===`char`?N0(u):M0(u),f=r.prevContentLength,p=!1,m=w0(t),h=!!(m&&!((o=m.properties)!=null&&o[`data-sd-animate-marker`])),g=!1,_=d.map(e=>{let t=i.count;if(i.count+=e.length,y0.test(e))return{type:`text`,value:e};let r=f>0&&t<f,o=r?0:a.baseDelay+i.newIndex++*a.step;if(p=!0,m&&h&&!g){let e=r?0:n.duration;T0(m,e,o,n.easing),k0(m,n,e,o),g=!0}return P0(e,n.animation,n.duration,n.easing,r,o)});return p&&j0(t),c.children.splice(l,1,..._),l+_.length},z0=0;function B0(e){let t={animation:e?.animation??`fadeIn`,duration:e?.duration??150,easing:e?.easing??`ease`,sep:e?.sep??`word`,stagger:e?.stagger??40,timeline:e?.timeline},n={committedCharCount:0,prevContentLength:0,lastRenderCharCount:0,pendingMark:null},r=z0++,i=()=>e=>{let r={count:0,newIndex:0};n.prevContentLength=n.committedCharCount;let i=t.timeline,a=i?.now()??g0();i&&(n.pendingMark===null?n.pendingMark=i.mark():i.rewind(n.pendingMark));let o=i?i.take(L0(e,t,n.prevContentLength),t.stagger,a):{baseDelay:0,step:t.stagger};GO(e,e=>e.type===`text`||I0(e),(e,i)=>{if(e.type===`text`)return R0(e,i,t,n,r,o);A0(e,i,t,n,r,o)}),n.lastRenderCharCount=r.count,n.prevContentLength=0};return Object.defineProperty(i,"name",{value:`rehypeAnimate$${r}`}),{name:`animate`,type:`animate`,rehypePlugin:i,setPrevContentLength(e){n.committedCharCount=e,n.prevContentLength=e},getLastRenderCharCount(){return n.lastRenderCharCount},commit(){n.committedCharCount=n.lastRenderCharCount,n.pendingMark=null}}}B0();var V0=(0,d.createContext)(!1),H0=()=>(0,d.useContext)(V0),U0=(...e)=>oh(Np(e)),W0=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(t=>t.startsWith(n)?t:`${e}:${t}`).join(` `)},G0=e=>e?(...t)=>W0(e,oh(Np(t))):U0,K0=(e,t,n)=>{let r=typeof t==`string`&&n.startsWith(`text/csv`)?``:``,i=typeof t==`string`?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},q0=(0,d.createContext)(U0),J0=()=>(0,d.useContext)(q0),Y0=8,X0=e=>{if(e!==void 0&&e!==0&&e!==1/0){if(typeof e==`number`)return Number.isFinite(e)&&e>0?`${e}px`:void 0;if(e!==`0`&&e!==`none`&&e!==`Infinity`)return e}},Z0=(e,t,n)=>{let r=(0,d.useRef)(null),i=(0,d.useRef)(!0),a=(0,d.useRef)(!1);return(0,d.useEffect)(()=>{let e=r.current;if(!(e&&t))return;let n=()=>{let t=e.scrollHeight-e.scrollTop-e.clientHeight<Y0;i.current=t};return e.addEventListener(`scroll`,n,{passive:!0}),()=>e.removeEventListener(`scroll`,n)},[t]),(0,d.useEffect)(()=>{e&&!a.current&&(i.current=!0),e||(i.current=!0),a.current=e},[e]),(0,d.useEffect)(()=>{let n=r.current;n&&t&&e&&i.current&&n.scrollTo({top:n.scrollHeight,behavior:`instant`})},[e,t,n]),r},Q0=U0(`block`),$0=U0(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-6`,`before:mr-4`,`before:text-[13px]`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),e2=e=>{let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e>0){let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();r&&i&&(t[r]=i)}}return t},t2=(0,d.memo)(({children:e,result:t,language:n,className:r,maxHeight:i,startLine:a,lineNumbers:o=!0,...s})=>{let c=J0(),{isAnimating:l}=(0,d.useContext)(R3),u=X0(i),f=Z0(l,!!u,t),p=(0,d.useMemo)(()=>c($0),[c]),m=(0,d.useMemo)(()=>c(Q0),[c]),h=(0,d.useMemo)(()=>{let e={};return t.bg&&(e[`--sdm-bg`]=t.bg),t.fg&&(e[`--sdm-fg`]=t.fg),t.rootStyle&&Object.assign(e,e2(t.rootStyle)),e},[t.bg,t.fg,t.rootStyle]);return(0,E.jsx)(`div`,{className:c(r,u?`overflow-y-auto`:null,`overflow-x-auto rounded-md border border-border bg-background p-4 text-sm`),"data-language":n,"data-streamdown":`code-block-body`,ref:f,style:u?{maxHeight:u}:void 0,...s,children:(0,E.jsx)(`pre`,{className:c(r,`bg-[var(--sdm-bg,inherit)]`,`dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit))]`),style:h,children:(0,E.jsx)(`code`,{className:o?c(`[counter-increment:line_0] [counter-reset:line]`):void 0,style:o&&a&&a>1?{counterReset:`line ${a-1}`}:void 0,children:t.tokens.map((e,t)=>(0,E.jsx)(`span`,{className:o?p:m,children:e.length===0||e.length===1&&e[0].content===``?`
439
439
  `:e.map((e,t)=>{let n={},r=!!e.bgColor;if(e.color&&(n[`--sdm-c`]=e.color),e.bgColor&&(n[`--sdm-tbg`]=e.bgColor),e.htmlStyle)for(let[t,i]of Object.entries(e.htmlStyle))t===`color`?n[`--sdm-c`]=i:t===`background-color`?(n[`--sdm-tbg`]=i,r=!0):n[t]=i;return(0,E.jsx)(`span`,{className:c(`text-[var(--sdm-c,inherit)]`,`dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]`,r&&`bg-[var(--sdm-tbg)]`,r&&`dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]`),style:n,...e.htmlAttrs,children:e.content},t)})},t))})})})}),n2=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let a=J0();return(0,E.jsx)(`div`,{className:a(`my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":`code-block`,style:{contentVisibility:`auto`,containIntrinsicSize:`auto 200px`,...n},...i})},r2=(0,d.createContext)({code:``}),i2=()=>(0,d.useContext)(r2),a2=({language:e})=>{let t=J0();return(0,E.jsx)(`div`,{className:t(`flex h-8 items-center text-muted-foreground text-xs`),"data-language":e,"data-streamdown":`code-block-header`,children:(0,E.jsx)(`span`,{className:t(`ml-1 font-mono lowercase`),children:e})})},o2=e=>{let t=e.length;for(;t>0&&e[t-1]===`
440
- `;)t--;return e.slice(0,t)},s2=(0,d.lazy)(()=>l0(()=>import(`./highlighted-body-KPVGNVTW-DdZUyfi_.js`).then(e=>({default:e.HighlightedCodeBlockBody})),__vite__mapDeps([0,1]))),c2=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...s})=>{let c=J0(),{codeBlockMaxHeight:l}=(0,d.useContext)(R3),u=(0,d.useMemo)(()=>o2(e),[e]),f=(0,d.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:u.split(`
440
+ `;)t--;return e.slice(0,t)},s2=(0,d.lazy)(()=>l0(()=>import(`./highlighted-body-KPVGNVTW-DDwKoMwN.js`).then(e=>({default:e.HighlightedCodeBlockBody})),__vite__mapDeps([0,1]))),c2=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...s})=>{let c=J0(),{codeBlockMaxHeight:l}=(0,d.useContext)(R3),u=(0,d.useMemo)(()=>o2(e),[e]),f=(0,d.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:u.split(`
441
441
  `).map(e=>[{content:e,color:`inherit`,bgColor:`transparent`,htmlStyle:{},offset:0}])}),[u]);return(0,E.jsx)(r2.Provider,{value:{code:e},children:(0,E.jsxs)(n2,{dir:`ltr`,isIncomplete:i,language:t,children:[(0,E.jsx)(a2,{language:t}),r?(0,E.jsx)(`div`,{className:c(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,E.jsx)(`div`,{className:c(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`code-block-actions`,children:r})}):null,(0,E.jsx)(d.Suspense,{fallback:(0,E.jsx)(t2,{className:n,language:t,lineNumbers:o,maxHeight:l,result:f,startLine:a,...s}),children:(0,E.jsx)(s2,{className:n,code:u,language:t,lineNumbers:o,maxHeight:l,raw:f,startLine:a,...s})})]})})},l2={CheckIcon:e=>(0,E.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,E.jsx)(`path`,{clipRule:`evenodd`,d:`M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z`,fill:`currentColor`,fillRule:`evenodd`})}),CopyIcon:e=>(0,E.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,E.jsx)(`path`,{clipRule:`evenodd`,d:`M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),DownloadIcon:e=>(0,E.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,E.jsx)(`path`,{clipRule:`evenodd`,d:`M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),ExternalLinkIcon:e=>(0,E.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,E.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z`,fill:`currentColor`,fillRule:`evenodd`})}),Loader2Icon:e=>(0,E.jsxs)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:[(0,E.jsx)(`path`,{d:`M8 0V4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,E.jsx)(`path`,{d:`M8 16V12`,opacity:`0.5`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,E.jsx)(`path`,{d:`M3.29773 1.52783L5.64887 4.7639`,opacity:`0.9`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,E.jsx)(`path`,{d:`M12.7023 1.52783L10.3511 4.7639`,opacity:`0.1`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,E.jsx)(`path`,{d:`M12.7023 14.472L10.3511 11.236`,opacity:`0.4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,E.jsx)(`path`,{d:`M3.29773 14.472L5.64887 11.236`,opacity:`0.6`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,E.jsx)(`path`,{d:`M15.6085 5.52783L11.8043 6.7639`,opacity:`0.2`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,E.jsx)(`path`,{d:`M0.391602 10.472L4.19583 9.23598`,opacity:`0.7`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,E.jsx)(`path`,{d:`M15.6085 10.4722L11.8043 9.2361`,opacity:`0.3`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,E.jsx)(`path`,{d:`M0.391602 5.52783L4.19583 6.7639`,opacity:`0.8`,stroke:`currentColor`,strokeWidth:`1.5`})]}),Maximize2Icon:e=>(0,E.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,E.jsx)(`path`,{clipRule:`evenodd`,d:`M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z`,fill:`currentColor`,fillRule:`evenodd`})}),RotateCcwIcon:e=>(0,E.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,E.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z`,fill:`currentColor`,fillRule:`evenodd`})}),XIcon:e=>(0,E.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,E.jsx)(`path`,{clipRule:`evenodd`,d:`M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomInIcon:e=>(0,E.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,E.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomOutIcon:e=>(0,E.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,E.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})})},u2=(0,d.createContext)(l2),d2=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>e[n]===t[n])},f2=({icons:e,children:t})=>{let n=(0,d.useRef)(e),r=(0,d.useRef)(e?{...l2,...e}:l2);d2(n.current,e)||(n.current=e,r.current=e?{...l2,...e}:l2);let i=r.current;return(0,E.jsx)(u2.Provider,{value:i,children:t})},p2=()=>(0,d.useContext)(u2),m2={copyCode:`Copy Code`,downloadFile:`Download file`,downloadDiagram:`Download diagram`,downloadDiagramAsSvg:`Download diagram as SVG`,downloadDiagramAsPng:`Download diagram as PNG`,downloadDiagramAsMmd:`Download diagram as MMD`,viewFullscreen:`View fullscreen`,exitFullscreen:`Exit fullscreen`,mermaidFormatSvg:`SVG`,mermaidFormatPng:`PNG`,mermaidFormatMmd:`MMD`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,resetView:`Reset zoom and pan`,copyTable:`Copy table`,copyTableAsMarkdown:`Copy table as Markdown`,copyTableAsCsv:`Copy table as CSV`,copyTableAsTsv:`Copy table as TSV`,downloadTable:`Download table`,downloadTableAsCsv:`Download table as CSV`,downloadTableAsMarkdown:`Download table as Markdown`,tableFormatMarkdown:`Markdown`,tableFormatCsv:`CSV`,tableFormatTsv:`TSV`,imageNotAvailable:`Image not available`,downloadImage:`Download image`,openExternalLink:`Open external link?`,externalLinkWarning:`You're about to visit an external website.`,close:`Close`,copyLink:`Copy link`,copied:`Copied`,openLink:`Open link`},h2=(0,d.createContext)(m2),g2=()=>(0,d.useContext)(h2),_2=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let s=J0(),[c,l]=(0,d.useState)(!1),u=(0,d.useRef)(0),{code:f}=i2(),{isAnimating:p}=(0,d.useContext)(R3),m=g2(),h=a??f,g=async()=>{var r;if(typeof window>`u`||!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)){t?.(Error(`Clipboard API not available`));return}try{c||(await navigator.clipboard.writeText(h),l(!0),e?.(),u.current=window.setTimeout(()=>l(!1),n))}catch(e){t?.(e)}};(0,d.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let _=p2(),v=c?_.CheckIcon:_.CopyIcon;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`button`,{"aria-label":m.copyCode,className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-copy-button`,disabled:p,onClick:g,title:m.copyCode,type:`button`,...o,children:r??(0,E.jsx)(v,{"aria-hidden":`true`,size:14})}),c&&(0,E.jsx)(`output`,{"aria-live":`polite`,className:`sr-only`,children:m.copied})]})},v2=(e,t,n)=>{if(typeof e==`boolean`)return n;let r=e[t];if(typeof r!=`object`)return n;let i=r.download;return typeof i==`object`&&i.filename||n},y2={"1c":`1c`,"1c-query":`1cq`,abap:`abap`,"actionscript-3":`as`,ada:`ada`,adoc:`adoc`,"angular-html":`html`,"angular-ts":`ts`,apache:`conf`,apex:`cls`,apl:`apl`,applescript:`applescript`,ara:`ara`,asciidoc:`adoc`,asm:`asm`,astro:`astro`,awk:`awk`,ballerina:`bal`,bash:`sh`,bat:`bat`,batch:`bat`,be:`be`,beancount:`beancount`,berry:`berry`,bibtex:`bib`,bicep:`bicep`,blade:`blade.php`,bsl:`bsl`,c:`c`,"c#":`cs`,"c++":`cpp`,cadence:`cdc`,cairo:`cairo`,cdc:`cdc`,clarity:`clar`,clj:`clj`,clojure:`clj`,"closure-templates":`soy`,cmake:`cmake`,cmd:`cmd`,cobol:`cob`,codeowners:`CODEOWNERS`,codeql:`ql`,coffee:`coffee`,coffeescript:`coffee`,"common-lisp":`lisp`,console:`sh`,coq:`v`,cpp:`cpp`,cql:`cql`,crystal:`cr`,cs:`cs`,csharp:`cs`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cql`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,docker:`dockerfile`,dockerfile:`dockerfile`,dotenv:`env`,"dream-maker":`dm`,edge:`edge`,elisp:`el`,elixir:`ex`,elm:`elm`,"emacs-lisp":`el`,erb:`erb`,erl:`erl`,erlang:`erl`,f:`f`,"f#":`fs`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`f90`,f95:`f95`,fennel:`fnl`,fish:`fish`,fluent:`ftl`,for:`for`,"fortran-fixed-form":`f`,"fortran-free-form":`f90`,fs:`fs`,fsharp:`fs`,fsl:`fsl`,ftl:`ftl`,gdresource:`tres`,gdscript:`gd`,gdshader:`gdshader`,genie:`gs`,gherkin:`feature`,"git-commit":`gitcommit`,"git-rebase":`gitrebase`,gjs:`js`,gleam:`gleam`,"glimmer-js":`js`,"glimmer-ts":`ts`,glsl:`glsl`,gnuplot:`plt`,go:`go`,gql:`gql`,graphql:`graphql`,groovy:`groovy`,gts:`gts`,hack:`hack`,haml:`haml`,handlebars:`hbs`,haskell:`hs`,haxe:`hx`,hbs:`hbs`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,hs:`hs`,html:`html`,"html-derivative":`html`,http:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,jade:`jade`,java:`java`,javascript:`js`,jinja:`jinja`,jison:`jison`,jl:`jl`,js:`js`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,julia:`jl`,kotlin:`kt`,kql:`kql`,kt:`kt`,kts:`kts`,kusto:`kql`,latex:`tex`,lean:`lean`,lean4:`lean`,less:`less`,liquid:`liquid`,lisp:`lisp`,lit:`lit`,llvm:`ll`,log:`log`,logo:`logo`,lua:`lua`,luau:`luau`,make:`mak`,makefile:`mak`,markdown:`md`,marko:`marko`,matlab:`m`,md:`md`,mdc:`mdc`,mdx:`mdx`,mediawiki:`wiki`,mermaid:`mmd`,mips:`s`,mipsasm:`s`,mmd:`mmd`,mojo:`mojo`,move:`move`,nar:`nar`,narrat:`narrat`,nextflow:`nf`,nf:`nf`,nginx:`conf`,nim:`nim`,nix:`nix`,nu:`nu`,nushell:`nu`,objc:`m`,"objective-c":`m`,"objective-cpp":`mm`,ocaml:`ml`,pascal:`pas`,perl:`pl`,perl6:`p6`,php:`php`,plsql:`pls`,po:`po`,polar:`polar`,postcss:`pcss`,pot:`pot`,potx:`potx`,powerquery:`pq`,powershell:`ps1`,prisma:`prisma`,prolog:`pl`,properties:`properties`,proto:`proto`,protobuf:`proto`,ps:`ps`,ps1:`ps1`,pug:`pug`,puppet:`pp`,purescript:`purs`,py:`py`,python:`py`,ql:`ql`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,racket:`rkt`,raku:`raku`,razor:`cshtml`,rb:`rb`,reg:`reg`,regex:`regex`,regexp:`regexp`,rel:`rel`,riscv:`s`,rs:`rs`,rst:`rst`,ruby:`rb`,rust:`rs`,sas:`sas`,sass:`sass`,scala:`scala`,scheme:`scm`,scss:`scss`,sdbl:`sdbl`,sh:`sh`,shader:`shader`,shaderlab:`shader`,shell:`sh`,shellscript:`sh`,shellsession:`sh`,smalltalk:`st`,solidity:`sol`,soy:`soy`,sparql:`rq`,spl:`spl`,splunk:`spl`,sql:`sql`,"ssh-config":`config`,stata:`do`,styl:`styl`,stylus:`styl`,svelte:`svelte`,swift:`swift`,"system-verilog":`sv`,systemd:`service`,talon:`talon`,talonscript:`talon`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,terraform:`tf`,tex:`tex`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`ts`,"ts-tags":`ts`,tsp:`tsp`,tsv:`tsv`,tsx:`tsx`,turtle:`ttl`,twig:`twig`,typ:`typ`,typescript:`ts`,typespec:`tsp`,typst:`typ`,v:`v`,vala:`vala`,vb:`vb`,verilog:`v`,vhdl:`vhdl`,vim:`vim`,viml:`vim`,vimscript:`vim`,vue:`vue`,"vue-html":`html`,"vue-vine":`vine`,vy:`vy`,vyper:`vy`,wasm:`wasm`,wenyan:`wy`,wgsl:`wgsl`,wiki:`wiki`,wikitext:`wiki`,wit:`wit`,wl:`wl`,wolfram:`wl`,xml:`xml`,xsl:`xsl`,yaml:`yaml`,yml:`yml`,zenscript:`zs`,zig:`zig`,zsh:`zsh`,文言:`wy`},b2=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let s=J0(),{code:c}=i2(),{isAnimating:l,controls:u}=(0,d.useContext)(R3),f=g2(),p=p2(),m=a??c,h=n&&n in y2?y2[n]:`txt`,g=`${v2(u,`code`,`file`)}.${h}`;return(0,E.jsx)(`button`,{"aria-label":f.downloadFile,className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-download-button`,disabled:l,onClick:()=>{try{K0(g,m,`text/plain`),e?.()}catch(e){t?.(e)}},title:f.downloadFile,type:`button`,...o,children:r??(0,E.jsx)(p.DownloadIcon,{size:14})})},x2=()=>{let{Loader2Icon:e}=p2(),t=J0();return(0,E.jsxs)(`div`,{className:t(`w-full divide-y divide-border overflow-hidden rounded-xl border border-border`),children:[(0,E.jsx)(`div`,{className:t(`h-[46px] w-full bg-muted/80`)}),(0,E.jsx)(`div`,{className:t(`flex w-full items-center justify-center p-4`),children:(0,E.jsx)(e,{className:t(`size-4 animate-spin`)})})]})},S2=/\.[^/.]+$/,C2=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,showControls:o=!0,showDownloadControl:s=!0,...c})=>{let{DownloadIcon:l}=p2(),u=J0(),f=(0,d.useRef)(null),[p,m]=(0,d.useState)(!1),[h,g]=(0,d.useState)(!1),_=g2(),v=c.width!=null||c.height!=null,y=(p||v)&&!h&&o&&s,b=h&&!v;(0,d.useEffect)(()=>{let e=f.current;if(e!=null&&e.complete){let t=e.naturalWidth>0;m(t),g(!t)}},[]);let x=(0,d.useCallback)(e=>{m(!0),g(!1),i?.(e)},[i]),S=(0,d.useCallback)(e=>{m(!1),g(!0),a?.(e)},[a]),C=async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split(`/`).pop()||``,i=t.split(`.`).pop(),a=t.includes(`.`)&&i!==void 0&&i.length<=4,o=``;if(a)o=t;else{let n=e.type,i=`png`;n.includes(`jpeg`)||n.includes(`jpg`)?i=`jpg`:n.includes(`png`)?i=`png`:n.includes(`svg`)?i=`svg`:n.includes(`gif`)?i=`gif`:n.includes(`webp`)&&(i=`webp`),o=`${(r||t||`image`).replace(S2,``)}.${i}`}K0(o,e,e.type)}catch{window.open(n,`_blank`)}};return n?(0,E.jsxs)(`div`,{className:u(`group relative my-4 inline-block`),"data-streamdown":`image-wrapper`,children:[(0,E.jsx)(`img`,{alt:r,className:u(`max-w-full rounded-lg`,b&&`hidden`,t),"data-streamdown":`image`,onError:S,onLoad:x,ref:f,src:n,...c}),b&&(0,E.jsx)(`span`,{className:u(`text-muted-foreground text-xs italic`),"data-streamdown":`image-fallback`,children:_.imageNotAvailable}),o&&(0,E.jsx)(`div`,{className:u(`pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block`),"data-streamdown":`image-overlay`}),y&&(0,E.jsx)(`button`,{className:u(`absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background`,`opacity-0 group-hover:opacity-100`),onClick:C,title:_.downloadImage,type:`button`,children:(0,E.jsx)(l,{size:14})})]}):null},w2=0,T2=()=>{w2+=1,w2===1&&(document.body.style.overflow=`hidden`)},E2=()=>{w2=Math.max(0,w2-1),w2===0&&(document.body.style.overflow=``)},D2=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:o,XIcon:s}=p2(),c=J0(),[l,u]=(0,d.useState)(!1),f=g2(),p=(0,d.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),u(!0),setTimeout(()=>u(!1),2e3)}catch{}},[e]),m=(0,d.useCallback)(()=>{r(),n()},[r,n]);if((0,d.useEffect)(()=>{if(t){T2();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),E2()}}},[t,n]),!t||typeof document>`u`)return null;let h=(0,E.jsx)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm`),"data-streamdown":`link-safety-modal`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`button`,tabIndex:0,children:(0,E.jsxs)(`div`,{className:c(`relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,E.jsx)(`button`,{className:c(`absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:n,title:f.close,type:`button`,children:(0,E.jsx)(s,{size:16})}),(0,E.jsxs)(`div`,{className:c(`flex flex-col gap-2`),children:[(0,E.jsxs)(`div`,{className:c(`flex items-center gap-2 font-semibold text-lg`),children:[(0,E.jsx)(o,{size:20}),(0,E.jsx)(`span`,{children:f.openExternalLink})]}),(0,E.jsx)(`p`,{className:c(`text-muted-foreground text-sm`),children:f.externalLinkWarning})]}),(0,E.jsx)(`div`,{className:c(`break-all rounded-md bg-muted p-3 font-mono text-sm`,e.length>100&&`max-h-32 overflow-y-auto`),children:e}),(0,E.jsxs)(`div`,{className:c(`flex gap-2`),children:[(0,E.jsx)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted`),onClick:p,type:`button`,children:l?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(i,{size:14}),(0,E.jsx)(`span`,{children:f.copied})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(a,{size:14}),(0,E.jsx)(`span`,{children:f.copyLink})]})}),(0,E.jsxs)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90`),onClick:m,type:`button`,children:[(0,E.jsx)(o,{size:14}),(0,E.jsx)(`span`,{children:f.openLink})]})]})]})});return(0,Gi.createPortal)(h,document.body)},O2=(0,d.createContext)(null),k2=()=>(0,d.useContext)(O2),A2=()=>k2()?.code??null,j2=()=>k2()?.mermaid??null,M2=e=>{var t;let n=k2();return n!=null&&n.renderers&&e&&(t=n.renderers.find(t=>Array.isArray(t.language)?t.language.includes(e):t.language===e))!=null?t:null},N2=e=>{if(typeof DOMParser>`u`||typeof XMLSerializer>`u`)return e;let t=new DOMParser().parseFromString(e,`text/html`).querySelector(`svg`);return t?new XMLSerializer().serializeToString(t):e},P2=(e,t)=>new Promise((t,n)=>{let r=`data:image/svg+xml;base64,`+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`),r=i.width*5,a=i.height*5;e.width=r,e.height=a;let o=e.getContext(`2d`);if(!o){n(Error(`Failed to create 2D canvas context for PNG export`));return}o.drawImage(i,0,0,r,a),e.toBlob(e=>{if(!e){n(Error(`Failed to create PNG blob`));return}t(e)},`image/png`)},i.onerror=()=>n(Error(`Failed to load SVG image`)),i.src=r}),F2=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let o=J0(),[s,c]=(0,d.useState)(!1),l=(0,d.useRef)(null),{isAnimating:u,controls:f}=(0,d.useContext)(R3),p=p2(),m=j2(),h=g2(),g=v2(f,`mermaid`,`diagram`),_=async t=>{try{if(t===`mmd`){K0(`${g}.mmd`,e,`text/plain`),c(!1),r?.(t);return}if(!m){a?.(Error(`Mermaid plugin not available`));return}let n=m.getMermaid(i),o=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),s=`mermaid-${Math.abs(o)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(s,e);if(!l){a?.(Error(`SVG not found. Please wait for the diagram to render.`));return}let u=N2(l);if(t===`svg`){K0(`${g}.svg`,u,`image/svg+xml`),c(!1),r?.(t);return}if(t===`png`){let e=await P2(u);K0(`${g}.png`,e,`image/png`),r?.(t),c(!1);return}}catch(e){a?.(e)}};return(0,d.useEffect)(()=>{let e=e=>{let t=e.composedPath();l.current&&!t.includes(l.current)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,E.jsxs)(`div`,{className:o(`relative`),ref:l,children:[(0,E.jsx)(`button`,{"aria-label":h.downloadDiagram,className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),disabled:u,onClick:()=>c(!s),title:h.downloadDiagram,type:`button`,children:t??(0,E.jsx)(p.DownloadIcon,{"aria-hidden":`true`,size:14})}),s?(0,E.jsxs)(`div`,{className:o(`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,E.jsx)(`button`,{"aria-label":h.downloadDiagramAsSvg,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>_(`svg`),title:h.downloadDiagramAsSvg,type:`button`,children:h.mermaidFormatSvg}),(0,E.jsx)(`button`,{"aria-label":h.downloadDiagramAsPng,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>_(`png`),title:h.downloadDiagramAsPng,type:`button`,children:h.mermaidFormatPng}),(0,E.jsx)(`button`,{"aria-label":h.downloadDiagramAsMmd,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>_(`mmd`),title:h.downloadDiagramAsMmd,type:`button`,children:h.mermaidFormatMmd})]}):null]})},I2=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:o,XIcon:s}=p2(),c=J0(),[l,u]=(0,d.useState)(!1),{isAnimating:f,controls:p}=(0,d.useContext)(R3),m=g2(),h=(()=>{if(typeof p==`boolean`)return p;let e=p.mermaid;return e===!1?!1:e===!0||e===void 0||e.panZoom!==!1})(),g=(()=>{if(typeof p==`boolean`)return p;let e=p.mermaid;return e===!1?!1:e===!0||e===void 0||e.download!==!1})(),_=(()=>{if(typeof p==`boolean`)return p;let e=p.mermaid;return e===!1?!1:e===!0||e===void 0||e.copy!==!1})(),v=()=>{u(!l)};return(0,d.useEffect)(()=>{if(l){T2();let e=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),E2()}}},[l]),(0,d.useEffect)(()=>{l?n?.():r&&r()},[l,n,r]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`button`,{className:c(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),disabled:f,onClick:v,title:m.viewFullscreen,type:`button`,...a,"aria-label":m.viewFullscreen,children:(0,E.jsx)(o,{"aria-hidden":`true`,size:14})}),l?(0,Gi.createPortal)((0,E.jsxs)(`div`,{"aria-label":m.viewFullscreen,"aria-modal":`true`,className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm`),"data-streamdown":`mermaid-fullscreen`,onClick:v,onKeyDown:e=>{e.key===`Escape`&&v()},role:`dialog`,children:[(0,E.jsxs)(`div`,{className:c(`absolute top-4 right-4 z-10 flex items-center gap-1`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[g?(0,E.jsx)(F2,{chart:e,config:t}):null,_?(0,E.jsx)(_2,{code:e}):null,(0,E.jsx)(`button`,{"aria-label":m.exitFullscreen,className:c(`rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:v,title:m.exitFullscreen,type:`button`,children:(0,E.jsx)(s,{"aria-hidden":`true`,size:20})})]}),(0,E.jsx)(`div`,{className:c(`flex size-full items-center justify-center p-4`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:(0,E.jsx)(H3,{chart:e,className:c(`size-full [&_svg]:h-auto [&_svg]:w-auto`),config:t,fullscreen:!0,showControls:h})})]}),document.body):null]})};function L2(e){if(e.nodeType===Node.TEXT_NODE)return e.textContent??``;if(e.nodeType!==Node.ELEMENT_NODE)return``;let t=e;return t.tagName===`BR`?`
442
442
  `:Array.from(t.childNodes).map(L2).join(``)}var R2=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(L2(e).trim());let i=e.querySelectorAll(`tbody tr`);for(let e of i){let t=[],r=e.querySelectorAll(`td`);for(let e of r)t.push(L2(e).trim());n.push(t)}return{headers:t,rows:n}},z2=e=>{if(typeof e!=`object`)return`,`;let t=e.table;return typeof t==`object`?t.csvSeparator??`,`:`,`},B2=(e,t=`,`)=>{let n;n=t===`auto`?Intl.NumberFormat().format(1.1).includes(`,`)?`;`:`,`:t;let{headers:r,rows:i}=e,a=e=>{let t=!1;for(let r of e)if(r===n||r===`"`||r===`
443
443
  `||r===`\r`){t=!0;break}return t?`"${e.replace(/"/g,`""`)}"`:e},o=r.length>0?i.length+1:i.length,s=Array(o),c=0;r.length>0&&(s[c]=r.map(a).join(n),c+=1);for(let e of i)s[c]=e.map(a).join(n),c+=1;return s.join(`
@@ -447,7 +447,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
447
447
  `)},H2=e=>{let t=!1;for(let n of e)if(n===`\\`||n===`|`||n===`
448
448
  `){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===`\\`?n.push(`\\\\`):t===`|`?n.push(`\\|`):t===`
449
449
  `?n.push(`<br>`):n.push(t);return n.join(``)},U2=e=>{let{headers:t,rows:n}=e;if(t.length===0)return``;let r=Array(n.length+2),i=0,a=t.map(e=>H2(e));r[i]=`| ${a.join(` | `)} |`,i+=1;let o=Array(t.length);for(let e=0;e<t.length;e+=1)o[e]=`---`;r[i]=`| ${o.join(` | `)} |`,i+=1;for(let e of n)if(e.length<t.length){let n=Array(t.length);for(let r=0;r<t.length;r+=1)n[r]=r<e.length?H2(e[r]):``;r[i]=`| ${n.join(` | `)} |`,i+=1}else{let t=e.map(e=>H2(e));r[i]=`| ${t.join(` | `)} |`,i+=1}return r.join(`
450
- `)},W2=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=J0(),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(!1),u=(0,d.useRef)(null),f=(0,d.useRef)(0),{isAnimating:p,controls:m}=(0,d.useContext)(R3),h=g2(),g=z2(m),_=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=R2(t),o=``;o=e===`csv`?B2(a,g):e===`tsv`?V2(a):U2(a);let c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),f.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,d.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(f.current)}},[]);let v=p2(),y=c?v.CheckIcon:v.CopyIcon;return(0,E.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,E.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:p,onClick:()=>s(!o),title:h.copyTable,type:`button`,children:e??(0,E.jsx)(y,{height:14,width:14})}),o?(0,E.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,E.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>_(`md`),title:h.copyTableAsMarkdown,type:`button`,children:h.tableFormatMarkdown}),(0,E.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>_(`csv`),title:h.copyTableAsCsv,type:`button`,children:h.tableFormatCsv}),(0,E.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>_(`tsv`),title:h.copyTableAsTsv,type:`button`,children:h.tableFormatTsv})]}):null]})},G2=({children:e,className:t,onDownload:n,onError:r})=>{let i=J0(),[a,o]=(0,d.useState)(!1),s=(0,d.useRef)(null),{isAnimating:c,controls:l}=(0,d.useContext)(R3),u=g2(),f=p2(),p=z2(l),m=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=R2(t),a=e===`csv`?B2(i,p):U2(i),c=e===`csv`?`csv`:`md`;K0(`${v2(l,`table`,`table`)}.${c}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,d.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,E.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,E.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:u.downloadTable,type:`button`,children:e??(0,E.jsx)(f.DownloadIcon,{size:14})}),a?(0,E.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,E.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`csv`),title:u.downloadTableAsCsv,type:`button`,children:u.tableFormatCsv}),(0,E.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`markdown`),title:u.downloadTableAsMarkdown,type:`button`,children:u.tableFormatMarkdown})]}):null]})},K2=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=p2(),o=J0(),[s,c]=(0,d.useState)(!1),{isAnimating:l}=(0,d.useContext)(R3),u=g2(),f=()=>{c(!0)},p=()=>{c(!1)};return(0,d.useEffect)(()=>{if(s){T2();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),E2()}}},[s]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:f,title:u.viewFullscreen,type:`button`,children:(0,E.jsx)(i,{size:14})}),s?(0,Gi.createPortal)((0,E.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:p,onKeyDown:e=>{e.key===`Escape`&&p()},role:`dialog`,children:(0,E.jsxs)(`div`,{className:o(`flex h-full flex-col`),"data-streamdown":`table-wrapper`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,E.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,E.jsx)(W2,{}):null,r?(0,E.jsx)(G2,{}):null,(0,E.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:p,title:u.exitFullscreen,type:`button`,children:(0,E.jsx)(a,{size:20})})]}),(0,E.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,E.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},q2=({children:e,className:t,maxHeight:n,showControls:r,showCopy:i=!0,showDownload:a=!0,showFullscreen:o=!0,...s})=>{let c=J0(),{isAnimating:l}=(0,d.useContext)(R3),u=X0(n),f=Z0(l,!!u,e),p=r&&i,m=r&&a,h=r&&o,g=p||m||h;return(0,E.jsxs)(`div`,{className:c(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[g?(0,E.jsxs)(`div`,{className:c(`flex items-center justify-end gap-1`),children:[p?(0,E.jsx)(W2,{}):null,m?(0,E.jsx)(G2,{}):null,h?(0,E.jsx)(K2,{showCopy:p,showDownload:m,children:e}):null]}):null,(0,E.jsx)(`div`,{className:c(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),ref:f,style:u?{maxHeight:u}:void 0,children:(0,E.jsx)(`table`,{className:c(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...s,children:e})})]})},J2=/startLine=(\d+)/,Y2=/\bnoLineNumbers\b/,X2=(0,d.lazy)(()=>l0(()=>import(`./mermaid-HWGCJPDP-BrB2pBlI.js`).then(e=>({default:e.Mermaid})),[])),Z2=/language-([^\s]+)/,Q2=`node`;function $2(e,t){let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;let r=e,i=t;for(let e of n)if(e!==Q2&&!Object.is(r[e],i[e]))return!1;return!0}function e4(e,t){return e?.properties?.metastring===t?.properties?.metastring}var t4=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,n4=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},r4=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},i4=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},a4=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.image;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},o4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`ol`,{className:i(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e})},(e,t)=>$2(e,t));o4.displayName=`MarkdownOl`;var s4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`li`,{className:i(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e})},(e,t)=>$2(e,t));s4.displayName=`MarkdownLi`;var c4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`ul`,{className:i(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e})},(e,t)=>$2(e,t));c4.displayName=`MarkdownUl`;var l4=(0,d.memo)(({className:e,node:t,...n})=>{let r=J0();return(0,E.jsx)(`hr`,{className:r(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n})},(e,t)=>$2(e,t));l4.displayName=`MarkdownHr`;var u4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`span`,{className:i(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e})},(e,t)=>$2(e,t));u4.displayName=`MarkdownStrong`;var d4=(0,d.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=J0(),{linkSafety:o}=(0,d.useContext)(R3),[s,c]=(0,d.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,d.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),f=(0,d.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),p=(0,d.useCallback)(()=>{c(!1)},[]),m={url:n??``,isOpen:s,onClose:p,onConfirm:f};return o!=null&&o.enabled&&n?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(m):(0,E.jsx)(D2,{...m})]}):(0,E.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>$2(e,t));d4.displayName=`MarkdownA`;var f4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`h1`,{className:i(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e})},(e,t)=>$2(e,t));f4.displayName=`MarkdownH1`;var p4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`h2`,{className:i(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e})},(e,t)=>$2(e,t));p4.displayName=`MarkdownH2`;var m4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`h3`,{className:i(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e})},(e,t)=>$2(e,t));m4.displayName=`MarkdownH3`;var h4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`h4`,{className:i(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e})},(e,t)=>$2(e,t));h4.displayName=`MarkdownH4`;var g4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`h5`,{className:i(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e})},(e,t)=>$2(e,t));g4.displayName=`MarkdownH5`;var _4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`h6`,{className:i(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e})},(e,t)=>$2(e,t));_4.displayName=`MarkdownH6`;var v4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i,tableMaxHeight:a}=(0,d.useContext)(R3),o=t4(i,`table`),s=n4(i,`copy`),c=n4(i,`download`),l=n4(i,`fullscreen`);return(0,E.jsx)(q2,{className:t,maxHeight:a,showControls:o,showCopy:s,showDownload:c,showFullscreen:l,...r,children:e})},(e,t)=>$2(e,t));v4.displayName=`MarkdownTable`;var y4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`thead`,{className:i(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e})},(e,t)=>$2(e,t));y4.displayName=`MarkdownThead`;var b4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`tbody`,{className:i(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e})},(e,t)=>$2(e,t));b4.displayName=`MarkdownTbody`;var x4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`tr`,{className:i(`border-border`,t),"data-streamdown":`table-row`,...r,children:e})},(e,t)=>$2(e,t));x4.displayName=`MarkdownTr`;var S4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`th`,{className:i(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e})},(e,t)=>$2(e,t));S4.displayName=`MarkdownTh`;var C4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`td`,{className:i(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e})},(e,t)=>$2(e,t));C4.displayName=`MarkdownTd`;var w4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`blockquote`,{className:i(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e})},(e,t)=>$2(e,t));w4.displayName=`MarkdownBlockquote`;var T4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`sup`,{className:i(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e})},(e,t)=>$2(e,t));T4.displayName=`MarkdownSup`;var E4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`sub`,{className:i(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e})},(e,t)=>$2(e,t));E4.displayName=`MarkdownSub`;var D4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,d.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,d.isValidElement)(e)){if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,d.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,d.isValidElement)(e))return e;if(e.type===o4){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,E.jsx)(`section`,{className:t,...r,children:i}):null}return(0,E.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>$2(e,t));D4.displayName=`MarkdownSection`;var O4=(0,d.memo)(({node:e,className:t,children:n,...r})=>{let i=J0(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,d.useContext)(R3),l=j2(),u=H0(),f=(t?.match(Z2))?.at(1)??``,p=M2(f);if(a)return(0,E.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let m=e?.properties?.metastring,h=m?.match(J2),g=h?Number.parseInt(h[1],10):void 0,_=g!==void 0&&g>=1?g:void 0,v=!(m&&Y2.test(m))&&c!==!1,y=``;if((0,d.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?y=n.props.children:typeof n==`string`&&(y=n),p){let e=p.component;return(0,E.jsx)(d.Suspense,{fallback:(0,E.jsx)(x2,{}),children:(0,E.jsx)(e,{code:y,isIncomplete:u,language:f,meta:m})})}if(f===`mermaid`&&l){let e=t4(s,`mermaid`),n=i4(s,`download`),r=i4(s,`copy`),a=i4(s,`fullscreen`),c=i4(s,`panZoom`),l=e&&(n||r||a);return(0,E.jsx)(d.Suspense,{fallback:(0,E.jsx)(x2,{}),children:(0,E.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,E.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,E.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,E.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,E.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,E.jsx)(F2,{chart:y,config:o?.config}):null,r?(0,E.jsx)(_2,{code:y}):null,a?(0,E.jsx)(I2,{chart:y,config:o?.config}):null]})}):null,(0,E.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,E.jsx)(X2,{chart:y,config:o?.config,showControls:c})})]})})}let b=t4(s,`code`),x=r4(s,`download`),S=r4(s,`copy`),{"data-block":C,...w}=r;return(0,E.jsx)(c2,{className:t,code:y,isIncomplete:u,language:f,lineNumbers:v,startLine:_,...w,children:b?(0,E.jsxs)(E.Fragment,{children:[x?(0,E.jsx)(b2,{code:y,language:f}):null,S?(0,E.jsx)(_2,{}):null]}):null})},(e,t)=>$2(e,t)&&e4(e.node,t.node));O4.displayName=`MarkdownCode`;var k4=(0,d.memo)(({node:e,className:t,...n})=>{let{controls:r}=(0,d.useContext)(R3),i=t4(r,`image`),a=i&&a4(r,`download`);return(0,E.jsx)(C2,{className:t,node:e,showControls:i,showDownloadControl:a,...n})},(e,t)=>$2(e,t));k4.displayName=`MarkdownImg`;var A4=(0,d.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,d.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,E.jsx)(E.Fragment,{children:e})}return(0,E.jsx)(`p`,{...n,children:e})},(e,t)=>$2(e,t));A4.displayName=`MarkdownParagraph`;var j4={ol:o4,li:s4,ul:c4,hr:l4,strong:u4,a:d4,h1:f4,h2:p4,h3:m4,h4,h5:g4,h6:_4,table:v4,thead:y4,tbody:b4,tr:x4,th:S4,td:C4,blockquote:w4,code:O4,img:k4,pre:({children:e})=>(0,d.isValidElement)(e)?(0,d.cloneElement)(e,{"data-block":`true`}):e,sup:T4,sub:E4,p:A4,section:D4},M4=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,N4=/\p{L}/u;function P4(e){let t=e.replace(/(```|~~~)[\s\S]*?\1/g,``).replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``),n,r=0,i=0;for(let e of t){if(M4.test(e)){n??=`rtl`,i+=1;continue}N4.test(e)&&(n??=`ltr`,r+=1)}return i>r?`rtl`:r>i?`ltr`:n??`ltr`}var F4=/^[ \t]{0,3}(`{3,}|~{3,})/,I4=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,L4=e=>{let t=e.split(`
450
+ `)},W2=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=J0(),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(!1),u=(0,d.useRef)(null),f=(0,d.useRef)(0),{isAnimating:p,controls:m}=(0,d.useContext)(R3),h=g2(),g=z2(m),_=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=R2(t),o=``;o=e===`csv`?B2(a,g):e===`tsv`?V2(a):U2(a);let c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),f.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,d.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(f.current)}},[]);let v=p2(),y=c?v.CheckIcon:v.CopyIcon;return(0,E.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,E.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:p,onClick:()=>s(!o),title:h.copyTable,type:`button`,children:e??(0,E.jsx)(y,{height:14,width:14})}),o?(0,E.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,E.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>_(`md`),title:h.copyTableAsMarkdown,type:`button`,children:h.tableFormatMarkdown}),(0,E.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>_(`csv`),title:h.copyTableAsCsv,type:`button`,children:h.tableFormatCsv}),(0,E.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>_(`tsv`),title:h.copyTableAsTsv,type:`button`,children:h.tableFormatTsv})]}):null]})},G2=({children:e,className:t,onDownload:n,onError:r})=>{let i=J0(),[a,o]=(0,d.useState)(!1),s=(0,d.useRef)(null),{isAnimating:c,controls:l}=(0,d.useContext)(R3),u=g2(),f=p2(),p=z2(l),m=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=R2(t),a=e===`csv`?B2(i,p):U2(i),c=e===`csv`?`csv`:`md`;K0(`${v2(l,`table`,`table`)}.${c}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,d.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,E.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,E.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:u.downloadTable,type:`button`,children:e??(0,E.jsx)(f.DownloadIcon,{size:14})}),a?(0,E.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,E.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`csv`),title:u.downloadTableAsCsv,type:`button`,children:u.tableFormatCsv}),(0,E.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`markdown`),title:u.downloadTableAsMarkdown,type:`button`,children:u.tableFormatMarkdown})]}):null]})},K2=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=p2(),o=J0(),[s,c]=(0,d.useState)(!1),{isAnimating:l}=(0,d.useContext)(R3),u=g2(),f=()=>{c(!0)},p=()=>{c(!1)};return(0,d.useEffect)(()=>{if(s){T2();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),E2()}}},[s]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:f,title:u.viewFullscreen,type:`button`,children:(0,E.jsx)(i,{size:14})}),s?(0,Gi.createPortal)((0,E.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:p,onKeyDown:e=>{e.key===`Escape`&&p()},role:`dialog`,children:(0,E.jsxs)(`div`,{className:o(`flex h-full flex-col`),"data-streamdown":`table-wrapper`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,E.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,E.jsx)(W2,{}):null,r?(0,E.jsx)(G2,{}):null,(0,E.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:p,title:u.exitFullscreen,type:`button`,children:(0,E.jsx)(a,{size:20})})]}),(0,E.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,E.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},q2=({children:e,className:t,maxHeight:n,showControls:r,showCopy:i=!0,showDownload:a=!0,showFullscreen:o=!0,...s})=>{let c=J0(),{isAnimating:l}=(0,d.useContext)(R3),u=X0(n),f=Z0(l,!!u,e),p=r&&i,m=r&&a,h=r&&o,g=p||m||h;return(0,E.jsxs)(`div`,{className:c(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[g?(0,E.jsxs)(`div`,{className:c(`flex items-center justify-end gap-1`),children:[p?(0,E.jsx)(W2,{}):null,m?(0,E.jsx)(G2,{}):null,h?(0,E.jsx)(K2,{showCopy:p,showDownload:m,children:e}):null]}):null,(0,E.jsx)(`div`,{className:c(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),ref:f,style:u?{maxHeight:u}:void 0,children:(0,E.jsx)(`table`,{className:c(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...s,children:e})})]})},J2=/startLine=(\d+)/,Y2=/\bnoLineNumbers\b/,X2=(0,d.lazy)(()=>l0(()=>import(`./mermaid-HWGCJPDP-L9BkEiJW.js`).then(e=>({default:e.Mermaid})),[])),Z2=/language-([^\s]+)/,Q2=`node`;function $2(e,t){let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;let r=e,i=t;for(let e of n)if(e!==Q2&&!Object.is(r[e],i[e]))return!1;return!0}function e4(e,t){return e?.properties?.metastring===t?.properties?.metastring}var t4=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,n4=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},r4=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},i4=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},a4=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.image;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},o4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`ol`,{className:i(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e})},(e,t)=>$2(e,t));o4.displayName=`MarkdownOl`;var s4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`li`,{className:i(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e})},(e,t)=>$2(e,t));s4.displayName=`MarkdownLi`;var c4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`ul`,{className:i(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e})},(e,t)=>$2(e,t));c4.displayName=`MarkdownUl`;var l4=(0,d.memo)(({className:e,node:t,...n})=>{let r=J0();return(0,E.jsx)(`hr`,{className:r(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n})},(e,t)=>$2(e,t));l4.displayName=`MarkdownHr`;var u4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`span`,{className:i(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e})},(e,t)=>$2(e,t));u4.displayName=`MarkdownStrong`;var d4=(0,d.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=J0(),{linkSafety:o}=(0,d.useContext)(R3),[s,c]=(0,d.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,d.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),f=(0,d.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),p=(0,d.useCallback)(()=>{c(!1)},[]),m={url:n??``,isOpen:s,onClose:p,onConfirm:f};return o!=null&&o.enabled&&n?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(m):(0,E.jsx)(D2,{...m})]}):(0,E.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>$2(e,t));d4.displayName=`MarkdownA`;var f4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`h1`,{className:i(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e})},(e,t)=>$2(e,t));f4.displayName=`MarkdownH1`;var p4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`h2`,{className:i(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e})},(e,t)=>$2(e,t));p4.displayName=`MarkdownH2`;var m4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`h3`,{className:i(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e})},(e,t)=>$2(e,t));m4.displayName=`MarkdownH3`;var h4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`h4`,{className:i(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e})},(e,t)=>$2(e,t));h4.displayName=`MarkdownH4`;var g4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`h5`,{className:i(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e})},(e,t)=>$2(e,t));g4.displayName=`MarkdownH5`;var _4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`h6`,{className:i(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e})},(e,t)=>$2(e,t));_4.displayName=`MarkdownH6`;var v4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i,tableMaxHeight:a}=(0,d.useContext)(R3),o=t4(i,`table`),s=n4(i,`copy`),c=n4(i,`download`),l=n4(i,`fullscreen`);return(0,E.jsx)(q2,{className:t,maxHeight:a,showControls:o,showCopy:s,showDownload:c,showFullscreen:l,...r,children:e})},(e,t)=>$2(e,t));v4.displayName=`MarkdownTable`;var y4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`thead`,{className:i(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e})},(e,t)=>$2(e,t));y4.displayName=`MarkdownThead`;var b4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`tbody`,{className:i(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e})},(e,t)=>$2(e,t));b4.displayName=`MarkdownTbody`;var x4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`tr`,{className:i(`border-border`,t),"data-streamdown":`table-row`,...r,children:e})},(e,t)=>$2(e,t));x4.displayName=`MarkdownTr`;var S4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`th`,{className:i(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e})},(e,t)=>$2(e,t));S4.displayName=`MarkdownTh`;var C4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`td`,{className:i(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e})},(e,t)=>$2(e,t));C4.displayName=`MarkdownTd`;var w4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`blockquote`,{className:i(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e})},(e,t)=>$2(e,t));w4.displayName=`MarkdownBlockquote`;var T4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`sup`,{className:i(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e})},(e,t)=>$2(e,t));T4.displayName=`MarkdownSup`;var E4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{let i=J0();return(0,E.jsx)(`sub`,{className:i(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e})},(e,t)=>$2(e,t));E4.displayName=`MarkdownSub`;var D4=(0,d.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,d.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,d.isValidElement)(e)){if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,d.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,d.isValidElement)(e))return e;if(e.type===o4){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,E.jsx)(`section`,{className:t,...r,children:i}):null}return(0,E.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>$2(e,t));D4.displayName=`MarkdownSection`;var O4=(0,d.memo)(({node:e,className:t,children:n,...r})=>{let i=J0(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,d.useContext)(R3),l=j2(),u=H0(),f=(t?.match(Z2))?.at(1)??``,p=M2(f);if(a)return(0,E.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let m=e?.properties?.metastring,h=m?.match(J2),g=h?Number.parseInt(h[1],10):void 0,_=g!==void 0&&g>=1?g:void 0,v=!(m&&Y2.test(m))&&c!==!1,y=``;if((0,d.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?y=n.props.children:typeof n==`string`&&(y=n),p){let e=p.component;return(0,E.jsx)(d.Suspense,{fallback:(0,E.jsx)(x2,{}),children:(0,E.jsx)(e,{code:y,isIncomplete:u,language:f,meta:m})})}if(f===`mermaid`&&l){let e=t4(s,`mermaid`),n=i4(s,`download`),r=i4(s,`copy`),a=i4(s,`fullscreen`),c=i4(s,`panZoom`),l=e&&(n||r||a);return(0,E.jsx)(d.Suspense,{fallback:(0,E.jsx)(x2,{}),children:(0,E.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,E.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,E.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,E.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,E.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,E.jsx)(F2,{chart:y,config:o?.config}):null,r?(0,E.jsx)(_2,{code:y}):null,a?(0,E.jsx)(I2,{chart:y,config:o?.config}):null]})}):null,(0,E.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,E.jsx)(X2,{chart:y,config:o?.config,showControls:c})})]})})}let b=t4(s,`code`),x=r4(s,`download`),S=r4(s,`copy`),{"data-block":C,...w}=r;return(0,E.jsx)(c2,{className:t,code:y,isIncomplete:u,language:f,lineNumbers:v,startLine:_,...w,children:b?(0,E.jsxs)(E.Fragment,{children:[x?(0,E.jsx)(b2,{code:y,language:f}):null,S?(0,E.jsx)(_2,{}):null]}):null})},(e,t)=>$2(e,t)&&e4(e.node,t.node));O4.displayName=`MarkdownCode`;var k4=(0,d.memo)(({node:e,className:t,...n})=>{let{controls:r}=(0,d.useContext)(R3),i=t4(r,`image`),a=i&&a4(r,`download`);return(0,E.jsx)(C2,{className:t,node:e,showControls:i,showDownloadControl:a,...n})},(e,t)=>$2(e,t));k4.displayName=`MarkdownImg`;var A4=(0,d.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,d.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,E.jsx)(E.Fragment,{children:e})}return(0,E.jsx)(`p`,{...n,children:e})},(e,t)=>$2(e,t));A4.displayName=`MarkdownParagraph`;var j4={ol:o4,li:s4,ul:c4,hr:l4,strong:u4,a:d4,h1:f4,h2:p4,h3:m4,h4,h5:g4,h6:_4,table:v4,thead:y4,tbody:b4,tr:x4,th:S4,td:C4,blockquote:w4,code:O4,img:k4,pre:({children:e})=>(0,d.isValidElement)(e)?(0,d.cloneElement)(e,{"data-block":`true`}):e,sup:T4,sub:E4,p:A4,section:D4},M4=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,N4=/\p{L}/u;function P4(e){let t=e.replace(/(```|~~~)[\s\S]*?\1/g,``).replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``),n,r=0,i=0;for(let e of t){if(M4.test(e)){n??=`rtl`,i+=1;continue}N4.test(e)&&(n??=`ltr`,r+=1)}return i>r?`rtl`:r>i?`ltr`:n??`ltr`}var F4=/^[ \t]{0,3}(`{3,}|~{3,})/,I4=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,L4=e=>{let t=e.split(`
451
451
  `),n=null,r=0;for(let e of t){let t=F4.exec(e);if(n===null){if(t){let e=t[1];n=e[0],r=e.length}}else if(t){let e=t[1],i=e[0],a=e.length;i===n&&a>=r&&(n=null,r=0)}}return n!==null},R4=e=>{let t=e.split(`
452
452
  `);for(let e of t){let t=e.trim();if(t.length>0&&t.includes(`|`)&&I4.test(t))return!0}return!1},z4=()=>e=>{qO(e,`html`,(e,t,n)=>{!n||typeof t!=`number`||(n.children[t]={type:`text`,value:e.value})})},B4=[],V4={allowDangerousHtml:!0},H4=new WeakMap,U4=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let t=`default`;return this.keyCache.set(e,t),t}let a=e=>{if(!e||e.length===0)return``;let t=``;for(let n=0;n<e.length;n+=1){let r=e[n];if(n>0&&(t+=`,`),Array.isArray(r)){let[e,n]=r;if(typeof e==`function`){let n=H4.get(e);n||(n=e.name,H4.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=H4.get(r);e||(e=r.name,H4.set(r,e)),t+=e}else t+=String(r)}return t},o=a(n),s=`${a(r)}::${o}::${i?JSON.stringify(i):``}`;return this.keyCache.set(e,s),s}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},W4=e=>{let t=G4(e),n=e.children||``;return Q4(t.runSync(t.parse(n),n),e)},G4=e=>{let t=U4.get(e);if(t)return t;let n=q4(e);return U4.set(e,n),n},K4=e=>e.some(e=>Array.isArray(e)?e[0]===TV:e===TV),q4=e=>{let t=e.rehypePlugins||B4,n=e.remarkPlugins||B4,r=K4(t)?n:[...n,z4],i=e.remarkRehypeOptions?{...V4,...e.remarkRehypeOptions}:V4;return Dk().use(zD).use(r).use(ek,i).use(t)},J4=e=>e,Y4=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:`text`,value:r}},X4=(e,t)=>{for(let n in Ww)if(Object.hasOwn(Ww,n)&&Object.hasOwn(e.properties,n)){let r=e.properties[n],i=Ww[n];(i===null||i.includes(e.tagName))&&(e.properties[n]=t(String(r||``),n,e)??void 0)}},Z4=(e,t,n,r,i,a)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&a&&typeof t==`number`&&(o=!a(e,t,n)),o},Q4=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:o,urlTransform:s}=t;if(n||r||i||a||s){let t=s||J4;qO(e,(e,s,c)=>{if(e.type===`raw`&&c&&typeof s==`number`)return Y4(c,s,a,e.value),s;if(e.type===`element`&&(X4(e,t),Z4(e,s,c,r,i,n)&&c&&typeof s==`number`))return o&&e.children?c.children.splice(s,1,...e.children):c.children.splice(s,1),s})}return Sw(e,{Fragment:E.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:E.jsx,jsxs:E.jsxs,passKeys:!0,passNode:!0})},$4=/\[\^[\w-]{1,200}\](?!:)/,e3=/\[\^[\w-]{1,200}\]:/,t3=/<([A-Za-z][\w:-]*)[\s>/]/,n3=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),r3=new Map,i3=new Map,a3=e=>{let t=e.toLowerCase(),n=r3.get(t);if(n)return n;let r=RegExp(`<${t}(?=[\\s>/])[^>]*>`,`gi`);return r3.set(t,r),r},o3=e=>{let t=e.toLowerCase(),n=i3.get(t);if(n)return n;let r=RegExp(`</${t}(?=[\\s>])[^>]*>`,`gi`);return i3.set(t,r),r},s3=(e,t)=>{if(n3.has(t.toLowerCase()))return 0;let n=e.match(a3(t));if(!n)return 0;let r=0;for(let e of n)e.trimEnd().endsWith(`/>`)||(r+=1);return r},c3=(e,t)=>{let n=e.match(o3(t));return n?n.length:0},l3=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]===`$`&&e[n+1]===`$`&&(t+=1,n+=1);return t},u3=e=>{let t=$4.test(e),n=e3.test(e);if(t||n)return[e];let r=$1.lex(e,{gfm:!0}),i=[],a=[],o=!1;for(let e of r){let t=e.raw,n=i.length;if(a.length>0){i[n-1]+=t;let e=a.at(-1),r=s3(t,e),o=c3(t,e);for(let t=0;t<r;t+=1)a.push(e);for(let t=0;t<o;t+=1)a.length>0&&a.at(-1)===e&&a.pop();continue}if(e.type===`html`&&e.block){let e=t.match(t3);if(e){let n=e[1];s3(t,n)>c3(t,n)&&a.push(n)}}if(n>0&&!o){let e=i[n-1];if(l3(e)%2==1){i[n-1]=e+t;continue}}i.push(t),e.type!==`space`&&(o=e.type===`code`)}return i},d3=/^\n*/,f3=/\n*$/,p3=/\n\n/g,m3=(e,t,n)=>t.includes(`
453
453
  `)?`${e}${t.replace(p3,`
@@ -477,7 +477,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
477
477
  `);n.forEach(function(t,i){var o=r&&d.length+a,s={type:`text`,value:`${t}
478
478
  `};if(i===0){var c=g(u.slice(f+1,p).concat(T6({children:[s],className:e.properties.className})),o);d.push(c)}else if(i===n.length-1){var l=u[p+1]&&u[p+1].children&&u[p+1].children[0],m={type:`text`,value:`${t}`};if(l){var h=T6({children:[m],className:e.properties.className});u.splice(p+1,0,h)}else{var _=g([m],o,e.properties.className);d.push(_)}}else{var v=g([s],o,e.properties.className);d.push(v)}}),f=p}p++};p<u.length;)_();if(f!==u.length-1){var v=u.slice(f+1,u.length);if(v&&v.length){var y=g(v,r&&d.length+a);d.push(y)}}return t?d:(l=[]).concat.apply(l,d)}function O6(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map(function(e,t){return p6({node:e,stylesheet:n,useInlineStyles:r,key:`code-segment-${t}`})})}function k6(e){return e&&e.highlightAuto!==void 0}function A6(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if(k6(t)){var a=m6(t,n);return n===`text`?{value:i,language:`text`}:a?t.highlight(n,r):t.highlightAuto(r)}try{return n&&n!==`text`?{value:t.highlight(r,n)}:{value:i}}catch{return{value:i}}}function j6(e,t){return function(n){var r=n.language,i=n.children,a=n.style,o=a===void 0?t:a,s=n.customStyle,c=s===void 0?{}:s,l=n.codeTagProps,u=l===void 0?{className:r?`language-${r}`:void 0,style:_6(_6({},o[`code[class*="language-"]`]),o[`code[class*="language-${r}"]`])}:l,f=n.useInlineStyles,p=f===void 0||f,m=n.showLineNumbers,h=m!==void 0&&m,g=n.showInlineLineNumbers,_=g===void 0||g,v=n.startingLineNumber,y=v===void 0?1:v,b=n.lineNumberContainerStyle,x=n.lineNumberStyle,S=x===void 0?{}:x,C=n.wrapLines,w=n.wrapLongLines,T=w!==void 0&&w,E=n.lineProps,D=E===void 0?{}:E,O=n.renderer,k=n.PreTag,A=k===void 0?`pre`:k,j=n.CodeTag,M=j===void 0?`code`:j,N=n.code,P=N===void 0?(Array.isArray(i)?i[0]:i)||``:N,ee=n.astGenerator,F=q3(n,h6);ee||=e;var I=h?d.createElement(x6,{containerStyle:b,codeStyle:u.style||{},numberStyle:S,startingLineNumber:y,codeString:P}):null,te=o.hljs||o[`pre[class*="language-"]`]||{backgroundColor:`#fff`},ne=k6(ee)?`hljs`:`prismjs`,re=p?Object.assign({},F,{style:Object.assign({},te,c)}):Object.assign({},F,{className:F.className?`${ne} ${F.className}`:ne,style:Object.assign({},c)});if(u.style=_6(T?{whiteSpace:`pre-wrap`}:{whiteSpace:`pre`},u.style),!ee)return d.createElement(A,re,I,d.createElement(M,u,P));(C===void 0&&O||T)&&(C=!0),O||=O6;var ie=[{type:`text`,value:P}],ae=A6({astGenerator:ee,language:r,code:P,defaultCodeValue:ie});ae.language===null&&(ae.value=ie);var L=y+(P.match(/\n/g)?.length??0),R=D6(ae,C,D,h,_,y,L,S,T);return d.createElement(A,re,d.createElement(M,u,!_&&I,O({rows:R,stylesheet:o,useInlineStyles:p})))}}var M6=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),N6={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function P6(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function F6(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function I6(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function L6(e){return I6(e)||P6(e)}var R6=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function z6(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?L6:u===`decimal`?P6:F6;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&M6.includes(y)&&(_=y,v=Zw(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&Zw(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1)){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):L6(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(B6(e))h(7,S),C=`�`;else if(e in N6)h(6,S),C=N6[e];else{let t=``;V6(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,R6[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function B6(e){return e>=55296&&e<=57343||e>1114111}function V6(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var H6=0,U6={},W6={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++H6}),e.__id},clone:function e(t,n){n||={};var r,i;switch(W6.util.type(t)){case`Object`:if(i=W6.util.objId(t),n[i])return n[i];for(var a in r={},n[i]=r,t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case`Array`:return i=W6.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}}},languages:{plain:U6,plaintext:U6,text:U6,txt:U6,extend:function(e,t){var n=W6.util.clone(W6.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r||=W6.languages;var i=r[e],a={};for(var o in i)if(i.hasOwnProperty(o)){if(o==t)for(var s in n)n.hasOwnProperty(s)&&(a[s]=n[s]);n.hasOwnProperty(o)||(a[o]=i[o])}var c=r[e];return r[e]=a,W6.languages.DFS(W6.languages,function(t,n){n===c&&t!=e&&(this[t]=a)}),a},DFS:function e(t,n,r,i){i||={};var a=W6.util.objId;for(var o in t)if(t.hasOwnProperty(o)){n.call(t,o,t[o],r||o);var s=t[o],c=W6.util.type(s);c===`Object`&&!i[a(s)]?(i[a(s)]=!0,e(s,n,null,i)):c===`Array`&&!i[a(s)]&&(i[a(s)]=!0,e(s,n,o,i))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(W6.hooks.run(`before-tokenize`,r),!r.grammar)throw Error(`The language "`+r.language+`" has no grammar.`);return r.tokens=W6.tokenize(r.code,r.grammar),W6.hooks.run(`after-tokenize`,r),G6.stringify(W6.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new J6;return Y6(i,i.head,e),q6(e,i,t,i.head,0),Z6(i)},hooks:{all:{},add:function(e,t){var n=W6.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=W6.hooks.all[e];if(!(!n||!n.length))for(var r=0,i;i=n[r++];)i(t)}},Token:G6};function G6(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}function K6(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function q6(e,t,n,r,i,a){for(var o in n)if(!(!n.hasOwnProperty(o)||!n[o])){var s=n[o];s=Array.isArray(s)?s:[s];for(var c=0;c<s.length;++c){if(a&&a.cause==o+`,`+c)return;var l=s[c],u=l.inside,d=!!l.lookbehind,f=!!l.greedy,p=l.alias;if(f&&!l.pattern.global){var m=l.pattern.toString().match(/[imsuy]*$/)[0];l.pattern=RegExp(l.pattern.source,m+`g`)}for(var h=l.pattern||l,g=r.next,_=i;g!==t.tail&&!(a&&_>=a.reach);_+=g.value.length,g=g.next){var v=g.value;if(t.length>e.length)return;if(!(v instanceof G6)){var y=1,b;if(f){if(b=K6(h,_,e,d),!b||b.index>=e.length)break;var x=b.index,S=b.index+b[0].length,C=_;for(C+=g.value.length;x>=C;)g=g.next,C+=g.value.length;if(C-=g.value.length,_=C,g.value instanceof G6)continue;for(var w=g;w!==t.tail&&(C<S||typeof w.value==`string`);w=w.next)y++,C+=w.value.length;y--,v=e.slice(_,C),b.index-=_}else if(b=K6(h,0,v,d),!b)continue;var x=b.index,T=b[0],E=v.slice(0,x),D=v.slice(x+T.length),O=_+v.length;a&&O>a.reach&&(a.reach=O);var k=g.prev;E&&(k=Y6(t,k,E),_+=E.length),X6(t,k,y);var A=new G6(o,u?W6.tokenize(T,u):T,p,T);if(g=Y6(t,k,A),D&&Y6(t,g,D),y>1){var j={cause:o+`,`+c,reach:O};q6(e,t,n,g.prev,_,j),a&&j.reach>a.reach&&(a.reach=j.reach)}}}}}}function J6(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function Y6(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function X6(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function Z6(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}var Q6=W6;function $6(){}$6.prototype=Q6;var e8=new $6;e8.highlight=t8,e8.register=n8,e8.alias=r8,e8.registered=i8,e8.listLanguages=a8,e8.util.encode=s8,e8.Token.stringify=o8;function t8(e,t){if(typeof e!=`string`)throw TypeError("Expected `string` for `value`, got `"+e+"`");let n,r;if(t&&typeof t==`object`)n=t;else{if(r=t,typeof r!=`string`)throw TypeError("Expected `string` for `name`, got `"+r+"`");if(Object.hasOwn(e8.languages,r))n=e8.languages[r];else throw Error("Unknown language: `"+r+"` is not registered")}return{type:`root`,children:Q6.highlight.call(e8,e,n,r)}}function n8(e){if(typeof e!=`function`||!e.displayName)throw Error("Expected `function` for `syntax`, got `"+e+"`");Object.hasOwn(e8.languages,e.displayName)||e(e8)}function r8(e,t){let n=e8.languages,r={};typeof e==`string`?t&&(r[e]=t):r=e;let i;for(i in r)if(Object.hasOwn(r,i)){let e=r[i],t=typeof e==`string`?[e]:e,a=-1;for(;++a<t.length;)n[t[a]]=n[i]}}function i8(e){if(typeof e!=`string`)throw TypeError("Expected `string` for `aliasOrLanguage`, got `"+e+"`");return Object.hasOwn(e8.languages,e)}function a8(){let e=e8.languages,t=[],n;for(n in e)Object.hasOwn(e,n)&&typeof e[n]==`object`&&t.push(n);return t}function o8(e,t){if(typeof e==`string`)return{type:`text`,value:e};if(Array.isArray(e)){let n=[],r=-1;for(;++r<e.length;)e[r]!==null&&e[r]!==void 0&&e[r]!==``&&n.push(o8(e[r],t));return n}let n={attributes:{},classes:[`token`,e.type],content:o8(e.content,t),language:t,tag:`span`,type:e.type};return e.alias&&n.classes.push(...typeof e.alias==`string`?[e.alias]:e.alias),e8.hooks.run(`wrap`,n),nA(n.tag+`.`+n.classes.join(`.`),c8(n.attributes),n.content)}function s8(e){return e}function c8(e){let t;for(t in e)Object.hasOwn(e,t)&&(e[t]=z6(e[t]));return e}var l8=j6(e8,{});l8.registerLanguage=function(e,t){return e8.register(t)},l8.alias=function(e,t){return e8.alias(e,t)},u8.displayName=`markup`,u8.aliases=[`atom`,`html`,`mathml`,`rss`,`ssml`,`svg`,`xml`];function u8(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside[`attr-value`].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside[`internal-subset`].inside=e.languages.markup,e.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.value.replace(/&amp;/,`&`))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r[`language-`+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i[`language-`+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var a={};a[t]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return t}),`i`),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore(`markup`,`cdata`,a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+t+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,`language-`+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend(`markup`,{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}d8.displayName=`css`,d8.aliases=[];function d8(e){(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(e)}f8.displayName=`clike`,f8.aliases=[];function f8(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}p8.displayName=`javascript`,p8.aliases=[`js`];function p8(e){e.register(f8),e.languages.javascript=e.languages.extend(`clike`,{"class-name":[e.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),e.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),e.languages.markup&&(e.languages.markup.tag.addInlined(`script`,`javascript`),e.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),e.languages.js=e.languages.javascript}m8.displayName=`sql`,m8.aliases=[];function m8(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}h8.displayName=`c`,h8.aliases=[];function h8(e){e.register(f8),e.languages.c=e.languages.extend(`clike`,{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore(`c`,`string`,{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:`property`,inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:`function`}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:`keyword`},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore(`c`,`function`,{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}g8.displayName=`cpp`,g8.aliases=[];function g8(e){e.register(h8),(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=`\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b`.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend(`c`,{"class-name":[{pattern:RegExp(`(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore(`cpp`,`string`,{module:{pattern:RegExp(`(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\\r\\n|[\\s\\S])|[^"\\\\\\r\\n])*"|<[^<>\\r\\n]*>|`+`<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>`.replace(/<mod-name>/g,function(){return n})+`)`),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:`string`,greedy:!0}}),e.languages.insertBefore(`cpp`,`keyword`,{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:e.languages.cpp}}}}),e.languages.insertBefore(`cpp`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}}),e.languages.insertBefore(`cpp`,`class-name`,{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend(`cpp`,{})}}),e.languages.insertBefore(`inside`,`double-colon`,{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp[`base-clause`])})(e)}_8.displayName=`bash`,_8.aliases=[`sh`,`shell`];function _8(e){(function(e){var t=`\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b`,n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:`punctuation`,inside:null},r={bash:n,environment:{pattern:RegExp(`\\$`+t),alias:`constant`},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp(`(\\{)`+t),lookbehind:!0,alias:`constant`}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:`important`},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:`function`},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:`function`}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:`variable`,lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp(`(^|[\\s;|&]|[<>]\\()`+t),lookbehind:!0,alias:`constant`}},alias:`variable`,lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:`variable`,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp(`\\$?`+t),alias:`constant`},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:`class-name`},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:`important`},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:`important`}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=[`comment`,`function-name`,`for-or-select`,`assign-left`,`parameter`,`string`,`environment`,`function`,`keyword`,`builtin`,`boolean`,`file-descriptor`,`operator`,`punctuation`,`number`],a=r.variable[1].inside,o=0;o<i.length;o++)a[i[o]]=e.languages.bash[i[o]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash})(e)}v8.displayName=`yaml`,v8.aliases=[`yml`];function v8(e){(function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r=`(?:`+n.source+`(?:[ ]+`+t.source+`)?|`+t.source+`(?:[ ]+`+n.source+`)?)`,i=`(?:[^\\s\\x00-\\x08\\x0e-\\x1f!"#%&'*,\\-:>?@[\\]\`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-]<PLAIN>)(?:[ \\t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*`.replace(/<PLAIN>/g,function(){return`[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]`}),a=`"(?:[^"\\\\\\r\\n]|\\\\.)*"|'(?:[^'\\\\\\r\\n]|\\\\.)*'`;function o(e,t){t=(t||``).replace(/m/g,``)+`m`;var n=`([:\\-,[{]\\s*(?:\\s<<prop>>[ \\t]+)?)(?:<<value>>)(?=[ \\t]*(?:$|,|\\]|\\}|(?:[\\r\\n]\\s*)?#))`.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return e});return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(`([\\-:]\\s*(?:\\s<<prop>>[ \\t]+)?[|>])[ \\t]*(?:((?:\\r?\\n|\\r)[ \\t]+)\\S[^\\r\\n]*(?:\\2[^\\r\\n]+)*)`.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:`string`},comment:/#.*/,key:{pattern:RegExp(`((?:^|[:\\-,[{\\r\\n?])[ \\t]*(?:<<prop>>[ \\t]+)?)<<key>>(?=\\s*:\\s)`.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return`(?:`+i+`|`+a+`)`})),lookbehind:!0,greedy:!0,alias:`atrule`},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:`important`},datetime:{pattern:o(`\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \\t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \\t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?`),lookbehind:!0,alias:`number`},boolean:{pattern:o(`false|true`,`i`),lookbehind:!0,alias:`important`},null:{pattern:o(`null|~`,`i`),lookbehind:!0,alias:`important`},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(`[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)`,`i`),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml})(e)}y8.displayName=`markdown`,y8.aliases=[`md`];function y8(e){e.register(u8),(function(e){function t(e){return e=e.replace(/<inner>/g,function(){return`(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))`}),RegExp(`((?:^|[^\\\\])(?:\\\\{2})*)(?:`+e+`)`)}var n="(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+",r=`\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))`.replace(/__/g,function(){return n}),i=`\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)`;e.languages.markdown=e.languages.extend(`markup`,{}),e.languages.insertBefore(`markdown`,`prolog`,{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:[`yaml`,`language-yaml`],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:`punctuation`},table:{pattern:RegExp(`^`+r+i+`(?:`+r+`)*`,`m`),inside:{"table-data-rows":{pattern:RegExp(`^(`+r+i+`)(?:`+r+`)*$`),lookbehind:!0,inside:{"table-data":{pattern:RegExp(n),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp(`^(`+r+`)`+i+`$`),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp(`^`+r+`$`),inside:{"table-header":{pattern:RegExp(n),alias:`important`,inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:`keyword`},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:`important`,inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:`important`,inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:`punctuation`},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:`punctuation`},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:`url`},bold:{pattern:t(`\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:t(`\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:t(`(~~?)(?:(?!~)<inner>)+\\2`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:[`code`,`keyword`]},url:{pattern:t(`!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])`),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),[`url`,`bold`,`italic`,`strike`].forEach(function(t){[`url`,`bold`,`italic`,`strike`,`code-snippet`].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add(`after-tokenize`,function(e){if(e.language!==`markdown`&&e.language!==`md`)return;function t(e){if(!(!e||typeof e==`string`))for(var n=0,r=e.length;n<r;n++){var i=e[n];if(i.type!==`code`){t(i.content);continue}var a=i.content[1],o=i.content[3];if(a&&o&&a.type===`code-language`&&o.type===`code-block`&&typeof a.content==`string`){var s=a.content.replace(/\b#/g,`sharp`).replace(/\b\+\+/g,`pp`);s=(/[a-z][\w-]*/i.exec(s)||[``])[0].toLowerCase();var c=`language-`+s;o.alias?typeof o.alias==`string`?o.alias=[o.alias,c]:o.alias.push(c):o.alias=[c]}}}t(e.tokens)}),e.hooks.add(`wrap`,function(t){if(t.type===`code-block`){for(var n=``,r=0,i=t.classes.length;r<i;r++){var a=t.classes[r],o=/language-(.+)/.exec(a);if(o){n=o[1];break}}var s=e.languages[n];if(s)t.content=e.highlight(t.content.value,s,n);else if(n&&n!==`none`&&e.plugins.autoloader){var c=`md-`+new Date().valueOf()+`-`+Math.floor(Math.random()*0x2386f26fc10000);t.attributes.id=c,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(c);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))})}}}),RegExp(e.languages.markup.tag.pattern.source,`gi`),String.fromCodePoint||String.fromCharCode,e.languages.md=e.languages.markdown})(e)}b8.displayName=`csharp`,b8.aliases=[`cs`,`dotnet`];function b8(e){e.register(f8),(function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,function(e,n){return`(?:`+t[+n]+`)`})}function n(e,n,r){return RegExp(t(e,n),r||``)}function r(e,t){for(var n=0;n<t;n++)e=e.replace(/<<self>>/g,function(){return`(?:`+e+`)`});return e.replace(/<<self>>/g,`[^\\s\\S]`)}var i={type:`bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void`,typeDeclaration:`class enum interface record struct`,contextual:`add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)`,other:`abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield`};function a(e){return`\\b(?:`+e.trim().replace(/ /g,`|`)+`)\\b`}var o=a(i.typeDeclaration),s=RegExp(a(i.type+` `+i.typeDeclaration+` `+i.contextual+` `+i.other)),c=a(i.typeDeclaration+` `+i.contextual+` `+i.other),l=a(i.type+` `+i.typeDeclaration+` `+i.other),u=r(`<(?:[^<>;=+\\-*/%&|^]|<<self>>)*>`,2),d=r(`\\((?:[^()]|<<self>>)*\\)`,2),f=`@?\\b[A-Za-z_]\\w*\\b`,p=t(`<<0>>(?:\\s*<<1>>)?`,[f,u]),m=t(`(?!<<0>>)<<1>>(?:\\s*\\.\\s*<<1>>)*`,[c,p]),h=`\\[\\s*(?:,\\s*)*\\]`,g=t(`<<0>>(?:\\s*(?:\\?\\s*)?<<1>>)*(?:\\s*\\?)?`,[m,h]),_=t(`(?:<<0>>|<<1>>)(?:\\s*(?:\\?\\s*)?<<2>>)*(?:\\s*\\?)?`,[t(`\\(<<0>>+(?:,<<0>>+)+\\)`,[t(`[^,()<>[\\];=+\\-*/%&|^]|<<0>>|<<1>>|<<2>>`,[u,d,h])]),m,h]),v={keyword:s,punctuation:/[<>()?,.:[\]]/},y=`'(?:[^\\r\\n'\\\\]|\\\\.|\\\\[Uux][\\da-fA-F]{1,8})'`,b=`"(?:\\\\.|[^\\\\"\\r\\n])*"`,x=`@"(?:""|\\\\[\\s\\S]|[^\\\\"])*"(?!")`;e.languages.csharp=e.languages.extend(`clike`,{string:[{pattern:n(`(^|[^$\\\\])<<0>>`,[x]),lookbehind:!0,greedy:!0},{pattern:n(`(^|[^@$\\\\])<<0>>`,[b]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:n(`(\\busing\\s+static\\s+)<<0>>(?=\\s*;)`,[m]),lookbehind:!0,inside:v},{pattern:n(`(\\busing\\s+<<0>>\\s*=\\s*)<<1>>(?=\\s*;)`,[f,_]),lookbehind:!0,inside:v},{pattern:n(`(\\busing\\s+)<<0>>(?=\\s*=)`,[f]),lookbehind:!0},{pattern:n(`(\\b<<0>>\\s+)<<1>>`,[o,p]),lookbehind:!0,inside:v},{pattern:n(`(\\bcatch\\s*\\(\\s*)<<0>>`,[m]),lookbehind:!0,inside:v},{pattern:n(`(\\bwhere\\s+)<<0>>`,[f]),lookbehind:!0},{pattern:n(`(\\b(?:is(?:\\s+not)?|as)\\s+)<<0>>`,[g]),lookbehind:!0,inside:v},{pattern:n(`\\b<<0>>(?=\\s+(?!<<1>>|with\\s*\\{)<<2>>(?:\\s*[=,;:{)\\]]|\\s+(?:in|when)\\b))`,[_,l,f]),inside:v}],keyword:s,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore(`csharp`,`number`,{range:{pattern:/\.\./,alias:`operator`}}),e.languages.insertBefore(`csharp`,`punctuation`,{"named-parameter":{pattern:n(`([(,]\\s*)<<0>>(?=\\s*:)`,[f]),lookbehind:!0,alias:`punctuation`}}),e.languages.insertBefore(`csharp`,`class-name`,{namespace:{pattern:n(`(\\b(?:namespace|using)\\s+)<<0>>(?:\\s*\\.\\s*<<0>>)*(?=\\s*[;{])`,[f]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(`(\\b(?:default|sizeof|typeof)\\s*\\(\\s*(?!\\s))(?:[^()\\s]|\\s(?!\\s)|<<0>>)*(?=\\s*\\))`,[d]),lookbehind:!0,alias:`class-name`,inside:v},"return-type":{pattern:n(`<<0>>(?=\\s+(?:<<1>>\\s*(?:=>|[({]|\\.\\s*this\\s*\\[)|this\\s*\\[))`,[_,m]),inside:v,alias:`class-name`},"constructor-invocation":{pattern:n(`(\\bnew\\s+)<<0>>(?=\\s*[[({])`,[_]),lookbehind:!0,inside:v,alias:`class-name`},"generic-method":{pattern:n(`<<0>>\\s*<<1>>(?=\\s*\\()`,[f,u]),inside:{function:n(`^<<0>>`,[f]),generic:{pattern:RegExp(u),alias:`class-name`,inside:v}}},"type-list":{pattern:n(`\\b((?:<<0>>\\s+<<1>>|record\\s+<<1>>\\s*<<5>>|where\\s+<<2>>)\\s*:\\s*)(?:<<3>>|<<4>>|<<1>>\\s*<<5>>|<<6>>)(?:\\s*,\\s*(?:<<3>>|<<4>>|<<6>>))*(?=\\s*(?:where|[{;]|=>|$))`,[o,p,f,_,s.source,d,`\\bnew\\s*\\(\\s*\\)`]),lookbehind:!0,inside:{"record-arguments":{pattern:n(`(^(?!new\\s*\\()<<0>>\\s*)<<1>>`,[p,d]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:s,"class-name":{pattern:RegExp(_),greedy:!0,inside:v},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:`property`,inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:`keyword`}}}});var S=b+`|`+y,C=t(`\\/(?![*/])|\\/\\/[^\\r\\n]*[\\r\\n]|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|<<0>>`,[S]),w=r(t(`[^"'/()]|<<0>>|\\(<<self>>*\\)`,[C]),2),T=`\\b(?:assembly|event|field|method|module|param|property|return|type)\\b`,E=t(`<<0>>(?:\\s*\\(<<1>>*\\))?`,[m,w]);e.languages.insertBefore(`csharp`,`class-name`,{attribute:{pattern:n(`((?:^|[^\\s\\w>)?])\\s*\\[\\s*)(?:<<0>>\\s*:\\s*)?<<1>>(?:\\s*,\\s*<<1>>)*(?=\\s*\\])`,[T,E]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(`^<<0>>(?=\\s*:)`,[T]),alias:`keyword`},"attribute-arguments":{pattern:n(`\\(<<0>>*\\)`,[w]),inside:e.languages.csharp},"class-name":{pattern:RegExp(m),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var D=`:[^}\\r\\n]+`,O=r(t(`[^"'/()]|<<0>>|\\(<<self>>*\\)`,[C]),2),k=t(`\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}`,[O,D]),A=r(t(`[^"'/()]|\\/(?!\\*)|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|<<0>>|\\(<<self>>*\\)`,[S]),2),j=t(`\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}`,[A,D]);function M(t,r){return{interpolation:{pattern:n(`((?:^|[^{])(?:\\{\\{)*)<<0>>`,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(`(^\\{(?:(?![}:])<<0>>)*)<<1>>(?=\\}$)`,[r,D]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:`language-csharp`,inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore(`csharp`,`string`,{"interpolation-string":[{pattern:n(`(^|[^\\\\])(?:\\$@|@\\$)"(?:""|\\\\[\\s\\S]|\\{\\{|<<0>>|[^\\\\{"])*"`,[k]),lookbehind:!0,greedy:!0,inside:M(k,O)},{pattern:n(`(^|[^@\\\\])\\$"(?:\\\\.|\\{\\{|<<0>>|[^\\\\"{])*"`,[j]),lookbehind:!0,greedy:!0,inside:M(j,A)}],char:{pattern:RegExp(y),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp})(e)}x8.displayName=`diff`,x8.aliases=[];function x8(e){(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":`-`,"deleted-arrow":`<`,"inserted-sign":`+`,"inserted-arrow":`>`,unchanged:` `,diff:`!`};Object.keys(t).forEach(function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),n===`diff`&&i.push(`bold`),e.languages.diff[n]={pattern:RegExp(`^(?:[`+r+`].*(?:\r
479
479
  ?|
480
- |(?![\\s\\S])))+`,`m`),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})})(e)}S8.displayName=`docker`,S8.aliases=[`dockerfile`];function S8(e){(function(e){var t=`(?:[ \\t]+(?![ \\t])(?:<SP_BS>)?|<SP_BS>)`.replace(/<SP_BS>/g,function(){return`\\\\[\\r\\n](?:\\s|\\\\[\\r\\n]|#.*(?!.))*(?![\\s#]|\\\\[\\r\\n])`}),n=`"(?:[^"\\\\\\r\\n]|\\\\(?:\\r\\n|[\\s\\S]))*"|'(?:[^'\\\\\\r\\n]|\\\\(?:\\r\\n|[\\s\\S]))*'`,r=`--[\\w-]+=(?:<STR>|(?!["'])(?:[^\\s\\\\]|\\\\.)+)`.replace(/<STR>/g,function(){return n}),i={pattern:RegExp(n),greedy:!0},a={pattern:/(^[ \t]*)#.*/m,lookbehind:!0,greedy:!0};function o(e,n){return e=e.replace(/<OPT>/g,function(){return r}).replace(/<SP>/g,function(){return t}),RegExp(e,n)}e.languages.docker={instruction:{pattern:/(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,lookbehind:!0,greedy:!0,inside:{options:{pattern:o(`(^(?:ONBUILD<SP>)?\\w+<SP>)<OPT>(?:<SP><OPT>)*`,`i`),lookbehind:!0,greedy:!0,inside:{property:{pattern:/(^|\s)--[\w-]+/,lookbehind:!0},string:[i,{pattern:/(=)(?!["'])(?:[^\s\\]|\\.)+/,lookbehind:!0}],operator:/\\$/m,punctuation:/=/}},keyword:[{pattern:o(`(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\\b`,`i`),lookbehind:!0,greedy:!0},{pattern:o(`(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \\t\\\\]+<SP>)AS`,`i`),lookbehind:!0,greedy:!0},{pattern:o(`(^ONBUILD<SP>)\\w+`,`i`),lookbehind:!0,greedy:!0},{pattern:/^\w+/,greedy:!0}],comment:a,string:i,variable:/\$(?:\w+|\{[^{}"'\\]*\})/,operator:/\\$/m}},comment:a},e.languages.dockerfile=e.languages.docker})(e)}C8.displayName=`go`,C8.aliases=[];function C8(e){e.register(f8),e.languages.go=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore(`go`,`string`,{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go[`class-name`]}w8.displayName=`scss`,w8.aliases=[];function w8(e){e.register(d8),e.languages.scss=e.languages.extend(`css`,{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:`important`},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore(`scss`,`atrule`,{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore(`scss`,`important`,{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore(`scss`,`function`,{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:`keyword`},placeholder:{pattern:/%[-\w]+/,alias:`selector`},statement:{pattern:/\B!(?:default|optional)\b/i,alias:`keyword`},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}T8.displayName=`json`,T8.aliases=[`webmanifest`];function T8(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`}},e.languages.webmanifest=e.languages.json}E8.displayName=`java`,E8.aliases=[];function E8(e){e.register(f8),(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=`(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*`,r={pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b`),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)`),lookbehind:!0,inside:r.inside},{pattern:RegExp(`(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)`+n+`[A-Z]\\w*\\b`),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore(`java`,`string`,{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:`string`},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore(`java`,`class-name`,{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:`punctuation`},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(`(\\bimport\\s+)`+n+`(?:[A-Z]\\w*|\\*)(?=\\s*;)`),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(`(\\bimport\\s+static\\s+)`+n+`(?:\\w+|\\*)(?=\\s*;)`),lookbehind:!0,alias:`static`,inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(`(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}D8.displayName=`typescript`,D8.aliases=[`ts`];function D8(e){e.register(p8),(function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript})(e)}O8.displayName=`python`,O8.aliases=[`py`];function O8(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:`punctuation`},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:`string`},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:[`annotation`,`punctuation`],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python[`string-interpolation`].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}k8.displayName=`jsx`,k8.aliases=[];function k8(e){e.register(p8),e.register(u8),(function(e){var t=e.util.clone(e.languages.javascript),n=`(?:\\s|\\/\\/.*(?!.)|\\/\\*(?:[^*]|\\*(?!\\/))\\*\\/)`,r=`(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})`,i=`(?:\\{<S>*\\.{3}(?:[^{}]|<BRACES>)*\\})`;function a(e,t){return e=e.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(e,t)}i=a(i).source,e.languages.jsx=e.languages.extend(`markup`,t),e.languages.jsx.tag.pattern=a(`<\\/?(?:[\\w.:-]+(?:<S>+(?:[\\w.:$-]+(?:=(?:"(?:\\\\[\\s\\S]|[^\\\\"])*"|'(?:\\\\[\\s\\S]|[^\\\\'])*'|[^\\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\\/?)?>`),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside[`attr-value`].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside[`class-name`]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore(`inside`,`attr-name`,{spread:{pattern:a(`<SPREAD>`),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore(`inside`,`special-attr`,{script:{pattern:a(`=<BRACES>`),alias:`language-javascript`,inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:`punctuation`},rest:e.languages.jsx}}},e.languages.jsx.tag);var o=function(e){return e?typeof e==`string`?e:typeof e.content==`string`?e.content:e.content.map(o).join(``):``},s=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r],a=!1;if(typeof i!=`string`&&(i.type===`tag`&&i.content[0]&&i.content[0].type===`tag`?i.content[0].content[0].content===`</`?n.length>0&&n[n.length-1].tagName===o(i.content[0].content[1])&&n.pop():i.content[i.content.length-1].content===`/>`||n.push({tagName:o(i.content[0].content[1]),openedBraces:0}):n.length>0&&i.type===`punctuation`&&i.content===`{`?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&i.type===`punctuation`&&i.content===`}`?n[n.length-1].openedBraces--:a=!0),(a||typeof i==`string`)&&n.length>0&&n[n.length-1].openedBraces===0){var c=o(i);r<t.length-1&&(typeof t[r+1]==`string`||t[r+1].type===`plain-text`)&&(c+=o(t[r+1]),t.splice(r+1,1)),r>0&&(typeof t[r-1]==`string`||t[r-1].type===`plain-text`)&&(c=o(t[r-1])+c,t.splice(r-1,1),r--),t[r]=new e.Token(`plain-text`,c,null,c)}i.content&&typeof i.content!=`string`&&s(i.content)}};e.hooks.add(`after-tokenize`,function(e){(e.language===`jsx`||e.language===`tsx`)&&s(e.tokens)})})(e)}A8.displayName=`tsx`,A8.aliases=[];function A8(e){e.register(k8),e.register(D8),(function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend(`jsx`,t),delete e.languages.tsx.parameter,delete e.languages.tsx[`literal-property`];var n=e.languages.tsx.tag;n.pattern=RegExp(`(^|[^\\w$]|(?=<\\/))(?:`+n.pattern.source+`)`,n.pattern.flags),n.lookbehind=!0})(e)}j8.displayName=`rust`,j8.aliases=[];function j8(e){(function(e){for(var t=`\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\/`,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return`[^\\s\\S]`}),e.languages.rust={comment:[{pattern:RegExp(`(^|[^\\\\])`+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:`attr-name`,inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:`punctuation`},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:`symbol`},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:`punctuation`},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:`function`},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:`class-name`},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:`namespace`},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:`namespace`,inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:`property`},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust[`closure-params`].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(e)}var M8={'code[class*="language-"]':{color:`#393A34`,fontFamily:`"Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace`,direction:`ltr`,textAlign:`left`,whiteSpace:`pre`,wordSpacing:`normal`,wordBreak:`normal`,fontSize:`.9em`,lineHeight:`1.2em`,MozTabSize:`4`,OTabSize:`4`,tabSize:`4`,WebkitHyphens:`none`,MozHyphens:`none`,msHyphens:`none`,hyphens:`none`},'pre[class*="language-"]':{color:`#393A34`,fontFamily:`"Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace`,direction:`ltr`,textAlign:`left`,whiteSpace:`pre`,wordSpacing:`normal`,wordBreak:`normal`,fontSize:`.9em`,lineHeight:`1.2em`,MozTabSize:`4`,OTabSize:`4`,tabSize:`4`,WebkitHyphens:`none`,MozHyphens:`none`,msHyphens:`none`,hyphens:`none`,padding:`1em`,margin:`.5em 0`,overflow:`auto`,border:`1px solid #dddddd`,backgroundColor:`white`},'pre > code[class*="language-"]':{fontSize:`1em`},'pre[class*="language-"]::-moz-selection':{background:`#C1DEF1`},'pre[class*="language-"] ::-moz-selection':{background:`#C1DEF1`},'code[class*="language-"]::-moz-selection':{background:`#C1DEF1`},'code[class*="language-"] ::-moz-selection':{background:`#C1DEF1`},'pre[class*="language-"]::selection':{background:`#C1DEF1`},'pre[class*="language-"] ::selection':{background:`#C1DEF1`},'code[class*="language-"]::selection':{background:`#C1DEF1`},'code[class*="language-"] ::selection':{background:`#C1DEF1`},':not(pre) > code[class*="language-"]':{padding:`.2em`,paddingTop:`1px`,paddingBottom:`1px`,background:`#f8f8f8`,border:`1px solid #dddddd`},comment:{color:`#008000`,fontStyle:`italic`},prolog:{color:`#008000`,fontStyle:`italic`},doctype:{color:`#008000`,fontStyle:`italic`},cdata:{color:`#008000`,fontStyle:`italic`},namespace:{Opacity:`.7`},string:{color:`#A31515`},punctuation:{color:`#393A34`},operator:{color:`#393A34`},url:{color:`#36acaa`},symbol:{color:`#36acaa`},number:{color:`#36acaa`},boolean:{color:`#36acaa`},variable:{color:`#36acaa`},constant:{color:`#36acaa`},inserted:{color:`#36acaa`},atrule:{color:`#0000ff`},keyword:{color:`#0000ff`},"attr-value":{color:`#0000ff`},".language-autohotkey .token.selector":{color:`#0000ff`},".language-json .token.boolean":{color:`#0000ff`},".language-json .token.number":{color:`#0000ff`},'code[class*="language-css"]':{color:`#0000ff`},function:{color:`#393A34`},deleted:{color:`#9a050f`},".language-autohotkey .token.tag":{color:`#9a050f`},selector:{color:`#800000`},".language-autohotkey .token.keyword":{color:`#00009f`},important:{color:`#e90`,fontWeight:`bold`},bold:{fontWeight:`bold`},italic:{fontStyle:`italic`},"class-name":{color:`#2B91AF`},".language-json .token.property":{color:`#2B91AF`},tag:{color:`#800000`},"attr-name":{color:`#ff0000`},property:{color:`#ff0000`},regex:{color:`#ff0000`},entity:{color:`#ff0000`},"directive.tag.tag":{background:`#ffff00`,color:`#393A34`},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:`#a5a5a5`},".line-numbers .line-numbers-rows > span:before":{color:`#2B91AF`},".line-highlight.line-highlight":{background:`linear-gradient(to right, rgba(193, 222, 241, 0.2) 70%, rgba(221, 222, 241, 0))`}},N8={'pre[class*="language-"]':{color:`#d4d4d4`,fontSize:`13px`,textShadow:`none`,fontFamily:`Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace`,direction:`ltr`,textAlign:`left`,whiteSpace:`pre`,wordSpacing:`normal`,wordBreak:`normal`,lineHeight:`1.5`,MozTabSize:`4`,OTabSize:`4`,tabSize:`4`,WebkitHyphens:`none`,MozHyphens:`none`,msHyphens:`none`,hyphens:`none`,padding:`1em`,margin:`.5em 0`,overflow:`auto`,background:`#1e1e1e`},'code[class*="language-"]':{color:`#d4d4d4`,fontSize:`13px`,textShadow:`none`,fontFamily:`Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace`,direction:`ltr`,textAlign:`left`,whiteSpace:`pre`,wordSpacing:`normal`,wordBreak:`normal`,lineHeight:`1.5`,MozTabSize:`4`,OTabSize:`4`,tabSize:`4`,WebkitHyphens:`none`,MozHyphens:`none`,msHyphens:`none`,hyphens:`none`},'pre[class*="language-"]::selection':{textShadow:`none`,background:`#264F78`},'code[class*="language-"]::selection':{textShadow:`none`,background:`#264F78`},'pre[class*="language-"] *::selection':{textShadow:`none`,background:`#264F78`},'code[class*="language-"] *::selection':{textShadow:`none`,background:`#264F78`},':not(pre) > code[class*="language-"]':{padding:`.1em .3em`,borderRadius:`.3em`,color:`#db4c69`,background:`#1e1e1e`},".namespace":{Opacity:`.7`},"doctype.doctype-tag":{color:`#569CD6`},"doctype.name":{color:`#9cdcfe`},comment:{color:`#6a9955`},prolog:{color:`#6a9955`},punctuation:{color:`#d4d4d4`},".language-html .language-css .token.punctuation":{color:`#d4d4d4`},".language-html .language-javascript .token.punctuation":{color:`#d4d4d4`},property:{color:`#9cdcfe`},tag:{color:`#569cd6`},boolean:{color:`#569cd6`},number:{color:`#b5cea8`},constant:{color:`#9cdcfe`},symbol:{color:`#b5cea8`},inserted:{color:`#b5cea8`},unit:{color:`#b5cea8`},selector:{color:`#d7ba7d`},"attr-name":{color:`#9cdcfe`},string:{color:`#ce9178`},char:{color:`#ce9178`},builtin:{color:`#ce9178`},deleted:{color:`#ce9178`},".language-css .token.string.url":{textDecoration:`underline`},operator:{color:`#d4d4d4`},entity:{color:`#569cd6`},"operator.arrow":{color:`#569CD6`},atrule:{color:`#ce9178`},"atrule.rule":{color:`#c586c0`},"atrule.url":{color:`#9cdcfe`},"atrule.url.function":{color:`#dcdcaa`},"atrule.url.punctuation":{color:`#d4d4d4`},keyword:{color:`#569CD6`},"keyword.module":{color:`#c586c0`},"keyword.control-flow":{color:`#c586c0`},function:{color:`#dcdcaa`},"function.maybe-class-name":{color:`#dcdcaa`},regex:{color:`#d16969`},important:{color:`#569cd6`},italic:{fontStyle:`italic`},"class-name":{color:`#4ec9b0`},"maybe-class-name":{color:`#4ec9b0`},console:{color:`#9cdcfe`},parameter:{color:`#9cdcfe`},interpolation:{color:`#9cdcfe`},"punctuation.interpolation-punctuation":{color:`#569cd6`},variable:{color:`#9cdcfe`},"imports.maybe-class-name":{color:`#9cdcfe`},"exports.maybe-class-name":{color:`#9cdcfe`},escape:{color:`#d7ba7d`},"tag.punctuation":{color:`#808080`},cdata:{color:`#808080`},"attr-value":{color:`#ce9178`},"attr-value.punctuation":{color:`#ce9178`},"attr-value.punctuation.attr-equals":{color:`#d4d4d4`},namespace:{color:`#4ec9b0`},'pre[class*="language-javascript"]':{color:`#9cdcfe`},'code[class*="language-javascript"]':{color:`#9cdcfe`},'pre[class*="language-jsx"]':{color:`#9cdcfe`},'code[class*="language-jsx"]':{color:`#9cdcfe`},'pre[class*="language-typescript"]':{color:`#9cdcfe`},'code[class*="language-typescript"]':{color:`#9cdcfe`},'pre[class*="language-tsx"]':{color:`#9cdcfe`},'code[class*="language-tsx"]':{color:`#9cdcfe`},'pre[class*="language-css"]':{color:`#ce9178`},'code[class*="language-css"]':{color:`#ce9178`},'pre[class*="language-html"]':{color:`#d4d4d4`},'code[class*="language-html"]':{color:`#d4d4d4`},".language-regex .token.anchor":{color:`#dcdcaa`},".language-html .token.punctuation":{color:`#808080`},'pre[class*="language-"] > code[class*="language-"]':{position:`relative`,zIndex:`1`},".line-highlight.line-highlight":{background:`#f7ebc6`,boxShadow:`inset 5px 0 0 #f7d87c`,zIndex:`0`}},P8={bash:_8,c:h8,cpp:g8,csharp:b8,css:d8,diff:x8,docker:S8,go:C8,java:E8,javascript:p8,json:T8,jsx:k8,markdown:y8,markup:u8,python:O8,rust:j8,scss:w8,sql:m8,tsx:A8,typescript:D8,yaml:v8};for(let[e,t]of Object.entries(P8))l8.registerLanguage(e,t);var F8=.25,I8=.5,L8=3;function R8({code:e,isStreaming:t,defaultPreview:n=!1}){let{isDark:r}=Tr(),{t:i}=N(),[a,o]=(0,d.useState)(n),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(!1),f=`${r?`dark`:`light`}\n${e}`,p=a&&!t;(0,d.useEffect)(()=>{if(!p)return;let t=!1;return c({key:f,status:`loading`}),(async()=>{let{default:n}=await l0(async()=>{let{default:e}=await import(`./mermaid.core-Ta81F5Ju.js`);return{default:e}},__vite__mapDeps([2,3,4,5,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));if(n.initialize({startOnLoad:!1,securityLevel:`strict`,suppressErrorRendering:!0,theme:r?`dark`:`default`}),!await n.parse(e,{suppressErrors:!0}))throw Error(`Invalid Mermaid diagram`);let i=typeof crypto<`u`&&`randomUUID`in crypto?`mermaid-${crypto.randomUUID()}`:`mermaid-${Date.now()}-${Math.random().toString(36).slice(2)}`,a=await n.render(i,e);t||c({key:f,status:`ready`,svg:a.svg})})().catch(()=>{t||c({key:f,status:`error`})}),()=>{t=!0}},[e,f,r,p]);let m=(0,E.jsx)(`button`,{type:`button`,onClick:()=>o(e=>!e),disabled:t,title:i(t?`i18n.previewAfterStreaming`:p?`i18n.showMermaidSource`:`i18n.previewMermaid`),className:[`markdown-code-action`,p?`is-active`:``].filter(Boolean).join(` `),children:i(p?`i18n.source`:`i18n.preview`)});if(!p)return(0,E.jsx)(H8,{code:e,lang:`mermaid`,headerAction:m});let h=s?.key===f&&s.status===`error`?(0,E.jsx)(`div`,{className:`mermaid-block mermaid-block-error`,children:i(`i18n.invalidMermaid`)}):s?.key!==f||s.status!==`ready`?(0,E.jsx)(`div`,{className:`mermaid-block mermaid-block-loading`,"aria-label":i(`i18n.renderingMermaid`)}):(0,E.jsxs)(E.Fragment,{children:[!l&&(0,E.jsx)(`button`,{type:`button`,className:`mermaid-block mermaid-preview-button`,title:i(`i18n.openMermaidViewer`),"aria-label":i(`i18n.openMermaidViewer`),onClick:()=>u(!0),dangerouslySetInnerHTML:{__html:s.svg}}),l&&(0,E.jsx)(z8,{svg:s.svg,onClose:()=>u(!1)})]});return(0,E.jsxs)(`div`,{className:`markdown-code-block`,children:[(0,E.jsxs)(`div`,{className:`markdown-code-header`,children:[(0,E.jsx)(`span`,{className:`markdown-code-lang`,children:`mermaid`}),m]}),h]})}function z8({svg:e,onClose:t}){let{t:n}=N(),r=(0,d.useRef)(null),[i,a]=(0,d.useState)(1);return(0,d.useEffect)(()=>{let e=r.current;if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,e.showModal(),()=>{document.body.style.overflow=t,e.open&&e.close()}},[]),(0,E.jsx)(`dialog`,{ref:r,className:`mermaid-zoom-dialog`,"aria-label":n(`i18n.mermaidViewer`),onCancel:e=>{e.preventDefault(),t()},onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),t())},children:(0,E.jsxs)(`div`,{className:`mermaid-zoom-layout`,children:[(0,E.jsxs)(`div`,{className:`mermaid-zoom-toolbar`,children:[(0,E.jsx)(`span`,{className:`mermaid-zoom-title`,children:n(`i18n.mermaidDiagram`)}),(0,E.jsxs)(`div`,{className:`mermaid-zoom-actions`,children:[(0,E.jsxs)(`div`,{className:`mermaid-zoom-stepper`,children:[(0,E.jsx)(`button`,{type:`button`,onClick:()=>a(e=>Math.max(I8,e-F8)),disabled:i<=I8,title:n(`i18n.zoomOut`),"aria-label":n(`i18n.zoomOut`),children:(0,E.jsx)(`svg`,{width:p.lg,height:p.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,E.jsx)(`path`,{d:`M5 12h14`})})}),(0,E.jsxs)(`span`,{className:`mermaid-zoom-value`,children:[Math.round(i*100),`%`]}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>a(e=>Math.min(L8,e+F8)),disabled:i>=L8,title:n(`i18n.zoomIn`),"aria-label":n(`i18n.zoomIn`),children:(0,E.jsx)(`svg`,{width:p.lg,height:p.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,E.jsx)(`path`,{d:`M12 5v14M5 12h14`})})})]}),(0,E.jsx)(`button`,{type:`button`,className:`mermaid-zoom-icon-button`,onClick:()=>a(1),title:n(`i18n.fitToWidth`),"aria-label":n(`i18n.fitToWidth`),children:(0,E.jsx)(`svg`,{width:p.lg,height:p.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,E.jsx)(`path`,{d:`M8 3H3v5M16 3h5v5M8 21H3v-5M16 21h5v-5`})})}),(0,E.jsx)(`button`,{type:`button`,className:`mermaid-zoom-icon-button`,onClick:t,title:n(`i18n.close`),"aria-label":n(`i18n.close`),children:(0,E.jsx)(`svg`,{width:p.lg,height:p.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,E.jsx)(`path`,{d:`M6 6l12 12M18 6 6 18`})})})]})]}),(0,E.jsx)(`div`,{className:`mermaid-zoom-viewport`,onClick:e=>{e.target===e.currentTarget&&t()},children:(0,E.jsx)(`div`,{className:`mermaid-zoom-canvas`,style:{width:`${i*100}%`},dangerouslySetInnerHTML:{__html:e}})})]})})}var B8=5e3,V8=800;function H8({code:e,lang:t,headerAction:n,isStreaming:r}){let{isDark:i}=Tr(),{t:a}=N(),[o,s]=(0,d.useState)(!1),c=()=>{Ri(e).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},l=e.length>B8||r===!0&&e.length>V8;return(0,E.jsxs)(`div`,{className:`markdown-code-block`,children:[(0,E.jsxs)(`div`,{className:`markdown-code-header`,children:[(0,E.jsx)(`span`,{className:`markdown-code-lang`,children:t||`text`}),(0,E.jsxs)(`div`,{className:`markdown-code-actions`,children:[n,(0,E.jsx)(`button`,{onClick:c,className:`markdown-code-action`,children:a(o?`i18n.copied`:`i18n.copy`)})]})]}),l?(0,E.jsx)(`pre`,{className:`markdown-code-plain`,style:{margin:0,padding:`11px 13px`,fontSize:`var(--text-md)`,lineHeight:1.62,borderRadius:0,background:`color-mix(in srgb, var(--bg) 92%, var(--bg-panel))`,overflow:`auto`},children:(0,E.jsx)(`code`,{style:{fontFamily:`var(--font-mono)`},children:e})}):(0,E.jsx)(l8,{language:t||`text`,style:i?N8:M8,showLineNumbers:!0,lineNumberStyle:{color:`var(--text-dim)`,fontStyle:`normal`},customStyle:{margin:0,padding:`11px 13px`,fontSize:`var(--text-md)`,lineHeight:1.62,borderRadius:0,background:`color-mix(in srgb, var(--bg) 92%, var(--bg-panel))`},codeTagProps:{style:{fontFamily:`var(--font-mono)`}},children:e})]})}function U8({children:e,className:t,isStreaming:n,cwd:r,onOpenFile:i}){let{t:a}=N(),[o,s]=(0,d.useState)(!1),c=!o&&e.length>1e5,l=(0,d.useMemo)(()=>c?G3(e):e,[c,e]),u=(0,d.useMemo)(()=>iG(l),[l]),f=(0,d.useMemo)(()=>({code({className:e,children:t,...r}){let i=e?.replace(`language-`,``).toLowerCase()??``,a=String(t);return e?.includes(`language-`)||a.includes(`
480
+ |(?![\\s\\S])))+`,`m`),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})})(e)}S8.displayName=`docker`,S8.aliases=[`dockerfile`];function S8(e){(function(e){var t=`(?:[ \\t]+(?![ \\t])(?:<SP_BS>)?|<SP_BS>)`.replace(/<SP_BS>/g,function(){return`\\\\[\\r\\n](?:\\s|\\\\[\\r\\n]|#.*(?!.))*(?![\\s#]|\\\\[\\r\\n])`}),n=`"(?:[^"\\\\\\r\\n]|\\\\(?:\\r\\n|[\\s\\S]))*"|'(?:[^'\\\\\\r\\n]|\\\\(?:\\r\\n|[\\s\\S]))*'`,r=`--[\\w-]+=(?:<STR>|(?!["'])(?:[^\\s\\\\]|\\\\.)+)`.replace(/<STR>/g,function(){return n}),i={pattern:RegExp(n),greedy:!0},a={pattern:/(^[ \t]*)#.*/m,lookbehind:!0,greedy:!0};function o(e,n){return e=e.replace(/<OPT>/g,function(){return r}).replace(/<SP>/g,function(){return t}),RegExp(e,n)}e.languages.docker={instruction:{pattern:/(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,lookbehind:!0,greedy:!0,inside:{options:{pattern:o(`(^(?:ONBUILD<SP>)?\\w+<SP>)<OPT>(?:<SP><OPT>)*`,`i`),lookbehind:!0,greedy:!0,inside:{property:{pattern:/(^|\s)--[\w-]+/,lookbehind:!0},string:[i,{pattern:/(=)(?!["'])(?:[^\s\\]|\\.)+/,lookbehind:!0}],operator:/\\$/m,punctuation:/=/}},keyword:[{pattern:o(`(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\\b`,`i`),lookbehind:!0,greedy:!0},{pattern:o(`(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \\t\\\\]+<SP>)AS`,`i`),lookbehind:!0,greedy:!0},{pattern:o(`(^ONBUILD<SP>)\\w+`,`i`),lookbehind:!0,greedy:!0},{pattern:/^\w+/,greedy:!0}],comment:a,string:i,variable:/\$(?:\w+|\{[^{}"'\\]*\})/,operator:/\\$/m}},comment:a},e.languages.dockerfile=e.languages.docker})(e)}C8.displayName=`go`,C8.aliases=[];function C8(e){e.register(f8),e.languages.go=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore(`go`,`string`,{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go[`class-name`]}w8.displayName=`scss`,w8.aliases=[];function w8(e){e.register(d8),e.languages.scss=e.languages.extend(`css`,{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:`important`},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore(`scss`,`atrule`,{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore(`scss`,`important`,{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore(`scss`,`function`,{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:`keyword`},placeholder:{pattern:/%[-\w]+/,alias:`selector`},statement:{pattern:/\B!(?:default|optional)\b/i,alias:`keyword`},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}T8.displayName=`json`,T8.aliases=[`webmanifest`];function T8(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`}},e.languages.webmanifest=e.languages.json}E8.displayName=`java`,E8.aliases=[];function E8(e){e.register(f8),(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=`(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*`,r={pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b`),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)`),lookbehind:!0,inside:r.inside},{pattern:RegExp(`(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)`+n+`[A-Z]\\w*\\b`),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore(`java`,`string`,{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:`string`},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore(`java`,`class-name`,{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:`punctuation`},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(`(\\bimport\\s+)`+n+`(?:[A-Z]\\w*|\\*)(?=\\s*;)`),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(`(\\bimport\\s+static\\s+)`+n+`(?:\\w+|\\*)(?=\\s*;)`),lookbehind:!0,alias:`static`,inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(`(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}D8.displayName=`typescript`,D8.aliases=[`ts`];function D8(e){e.register(p8),(function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript})(e)}O8.displayName=`python`,O8.aliases=[`py`];function O8(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:`punctuation`},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:`string`},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:[`annotation`,`punctuation`],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python[`string-interpolation`].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}k8.displayName=`jsx`,k8.aliases=[];function k8(e){e.register(p8),e.register(u8),(function(e){var t=e.util.clone(e.languages.javascript),n=`(?:\\s|\\/\\/.*(?!.)|\\/\\*(?:[^*]|\\*(?!\\/))\\*\\/)`,r=`(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})`,i=`(?:\\{<S>*\\.{3}(?:[^{}]|<BRACES>)*\\})`;function a(e,t){return e=e.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(e,t)}i=a(i).source,e.languages.jsx=e.languages.extend(`markup`,t),e.languages.jsx.tag.pattern=a(`<\\/?(?:[\\w.:-]+(?:<S>+(?:[\\w.:$-]+(?:=(?:"(?:\\\\[\\s\\S]|[^\\\\"])*"|'(?:\\\\[\\s\\S]|[^\\\\'])*'|[^\\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\\/?)?>`),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside[`attr-value`].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside[`class-name`]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore(`inside`,`attr-name`,{spread:{pattern:a(`<SPREAD>`),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore(`inside`,`special-attr`,{script:{pattern:a(`=<BRACES>`),alias:`language-javascript`,inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:`punctuation`},rest:e.languages.jsx}}},e.languages.jsx.tag);var o=function(e){return e?typeof e==`string`?e:typeof e.content==`string`?e.content:e.content.map(o).join(``):``},s=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r],a=!1;if(typeof i!=`string`&&(i.type===`tag`&&i.content[0]&&i.content[0].type===`tag`?i.content[0].content[0].content===`</`?n.length>0&&n[n.length-1].tagName===o(i.content[0].content[1])&&n.pop():i.content[i.content.length-1].content===`/>`||n.push({tagName:o(i.content[0].content[1]),openedBraces:0}):n.length>0&&i.type===`punctuation`&&i.content===`{`?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&i.type===`punctuation`&&i.content===`}`?n[n.length-1].openedBraces--:a=!0),(a||typeof i==`string`)&&n.length>0&&n[n.length-1].openedBraces===0){var c=o(i);r<t.length-1&&(typeof t[r+1]==`string`||t[r+1].type===`plain-text`)&&(c+=o(t[r+1]),t.splice(r+1,1)),r>0&&(typeof t[r-1]==`string`||t[r-1].type===`plain-text`)&&(c=o(t[r-1])+c,t.splice(r-1,1),r--),t[r]=new e.Token(`plain-text`,c,null,c)}i.content&&typeof i.content!=`string`&&s(i.content)}};e.hooks.add(`after-tokenize`,function(e){(e.language===`jsx`||e.language===`tsx`)&&s(e.tokens)})})(e)}A8.displayName=`tsx`,A8.aliases=[];function A8(e){e.register(k8),e.register(D8),(function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend(`jsx`,t),delete e.languages.tsx.parameter,delete e.languages.tsx[`literal-property`];var n=e.languages.tsx.tag;n.pattern=RegExp(`(^|[^\\w$]|(?=<\\/))(?:`+n.pattern.source+`)`,n.pattern.flags),n.lookbehind=!0})(e)}j8.displayName=`rust`,j8.aliases=[];function j8(e){(function(e){for(var t=`\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\/`,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return`[^\\s\\S]`}),e.languages.rust={comment:[{pattern:RegExp(`(^|[^\\\\])`+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:`attr-name`,inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:`punctuation`},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:`symbol`},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:`punctuation`},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:`function`},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:`class-name`},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:`namespace`},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:`namespace`,inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:`property`},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust[`closure-params`].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(e)}var M8={'code[class*="language-"]':{color:`#393A34`,fontFamily:`"Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace`,direction:`ltr`,textAlign:`left`,whiteSpace:`pre`,wordSpacing:`normal`,wordBreak:`normal`,fontSize:`.9em`,lineHeight:`1.2em`,MozTabSize:`4`,OTabSize:`4`,tabSize:`4`,WebkitHyphens:`none`,MozHyphens:`none`,msHyphens:`none`,hyphens:`none`},'pre[class*="language-"]':{color:`#393A34`,fontFamily:`"Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace`,direction:`ltr`,textAlign:`left`,whiteSpace:`pre`,wordSpacing:`normal`,wordBreak:`normal`,fontSize:`.9em`,lineHeight:`1.2em`,MozTabSize:`4`,OTabSize:`4`,tabSize:`4`,WebkitHyphens:`none`,MozHyphens:`none`,msHyphens:`none`,hyphens:`none`,padding:`1em`,margin:`.5em 0`,overflow:`auto`,border:`1px solid #dddddd`,backgroundColor:`white`},'pre > code[class*="language-"]':{fontSize:`1em`},'pre[class*="language-"]::-moz-selection':{background:`#C1DEF1`},'pre[class*="language-"] ::-moz-selection':{background:`#C1DEF1`},'code[class*="language-"]::-moz-selection':{background:`#C1DEF1`},'code[class*="language-"] ::-moz-selection':{background:`#C1DEF1`},'pre[class*="language-"]::selection':{background:`#C1DEF1`},'pre[class*="language-"] ::selection':{background:`#C1DEF1`},'code[class*="language-"]::selection':{background:`#C1DEF1`},'code[class*="language-"] ::selection':{background:`#C1DEF1`},':not(pre) > code[class*="language-"]':{padding:`.2em`,paddingTop:`1px`,paddingBottom:`1px`,background:`#f8f8f8`,border:`1px solid #dddddd`},comment:{color:`#008000`,fontStyle:`italic`},prolog:{color:`#008000`,fontStyle:`italic`},doctype:{color:`#008000`,fontStyle:`italic`},cdata:{color:`#008000`,fontStyle:`italic`},namespace:{Opacity:`.7`},string:{color:`#A31515`},punctuation:{color:`#393A34`},operator:{color:`#393A34`},url:{color:`#36acaa`},symbol:{color:`#36acaa`},number:{color:`#36acaa`},boolean:{color:`#36acaa`},variable:{color:`#36acaa`},constant:{color:`#36acaa`},inserted:{color:`#36acaa`},atrule:{color:`#0000ff`},keyword:{color:`#0000ff`},"attr-value":{color:`#0000ff`},".language-autohotkey .token.selector":{color:`#0000ff`},".language-json .token.boolean":{color:`#0000ff`},".language-json .token.number":{color:`#0000ff`},'code[class*="language-css"]':{color:`#0000ff`},function:{color:`#393A34`},deleted:{color:`#9a050f`},".language-autohotkey .token.tag":{color:`#9a050f`},selector:{color:`#800000`},".language-autohotkey .token.keyword":{color:`#00009f`},important:{color:`#e90`,fontWeight:`bold`},bold:{fontWeight:`bold`},italic:{fontStyle:`italic`},"class-name":{color:`#2B91AF`},".language-json .token.property":{color:`#2B91AF`},tag:{color:`#800000`},"attr-name":{color:`#ff0000`},property:{color:`#ff0000`},regex:{color:`#ff0000`},entity:{color:`#ff0000`},"directive.tag.tag":{background:`#ffff00`,color:`#393A34`},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:`#a5a5a5`},".line-numbers .line-numbers-rows > span:before":{color:`#2B91AF`},".line-highlight.line-highlight":{background:`linear-gradient(to right, rgba(193, 222, 241, 0.2) 70%, rgba(221, 222, 241, 0))`}},N8={'pre[class*="language-"]':{color:`#d4d4d4`,fontSize:`13px`,textShadow:`none`,fontFamily:`Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace`,direction:`ltr`,textAlign:`left`,whiteSpace:`pre`,wordSpacing:`normal`,wordBreak:`normal`,lineHeight:`1.5`,MozTabSize:`4`,OTabSize:`4`,tabSize:`4`,WebkitHyphens:`none`,MozHyphens:`none`,msHyphens:`none`,hyphens:`none`,padding:`1em`,margin:`.5em 0`,overflow:`auto`,background:`#1e1e1e`},'code[class*="language-"]':{color:`#d4d4d4`,fontSize:`13px`,textShadow:`none`,fontFamily:`Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace`,direction:`ltr`,textAlign:`left`,whiteSpace:`pre`,wordSpacing:`normal`,wordBreak:`normal`,lineHeight:`1.5`,MozTabSize:`4`,OTabSize:`4`,tabSize:`4`,WebkitHyphens:`none`,MozHyphens:`none`,msHyphens:`none`,hyphens:`none`},'pre[class*="language-"]::selection':{textShadow:`none`,background:`#264F78`},'code[class*="language-"]::selection':{textShadow:`none`,background:`#264F78`},'pre[class*="language-"] *::selection':{textShadow:`none`,background:`#264F78`},'code[class*="language-"] *::selection':{textShadow:`none`,background:`#264F78`},':not(pre) > code[class*="language-"]':{padding:`.1em .3em`,borderRadius:`.3em`,color:`#db4c69`,background:`#1e1e1e`},".namespace":{Opacity:`.7`},"doctype.doctype-tag":{color:`#569CD6`},"doctype.name":{color:`#9cdcfe`},comment:{color:`#6a9955`},prolog:{color:`#6a9955`},punctuation:{color:`#d4d4d4`},".language-html .language-css .token.punctuation":{color:`#d4d4d4`},".language-html .language-javascript .token.punctuation":{color:`#d4d4d4`},property:{color:`#9cdcfe`},tag:{color:`#569cd6`},boolean:{color:`#569cd6`},number:{color:`#b5cea8`},constant:{color:`#9cdcfe`},symbol:{color:`#b5cea8`},inserted:{color:`#b5cea8`},unit:{color:`#b5cea8`},selector:{color:`#d7ba7d`},"attr-name":{color:`#9cdcfe`},string:{color:`#ce9178`},char:{color:`#ce9178`},builtin:{color:`#ce9178`},deleted:{color:`#ce9178`},".language-css .token.string.url":{textDecoration:`underline`},operator:{color:`#d4d4d4`},entity:{color:`#569cd6`},"operator.arrow":{color:`#569CD6`},atrule:{color:`#ce9178`},"atrule.rule":{color:`#c586c0`},"atrule.url":{color:`#9cdcfe`},"atrule.url.function":{color:`#dcdcaa`},"atrule.url.punctuation":{color:`#d4d4d4`},keyword:{color:`#569CD6`},"keyword.module":{color:`#c586c0`},"keyword.control-flow":{color:`#c586c0`},function:{color:`#dcdcaa`},"function.maybe-class-name":{color:`#dcdcaa`},regex:{color:`#d16969`},important:{color:`#569cd6`},italic:{fontStyle:`italic`},"class-name":{color:`#4ec9b0`},"maybe-class-name":{color:`#4ec9b0`},console:{color:`#9cdcfe`},parameter:{color:`#9cdcfe`},interpolation:{color:`#9cdcfe`},"punctuation.interpolation-punctuation":{color:`#569cd6`},variable:{color:`#9cdcfe`},"imports.maybe-class-name":{color:`#9cdcfe`},"exports.maybe-class-name":{color:`#9cdcfe`},escape:{color:`#d7ba7d`},"tag.punctuation":{color:`#808080`},cdata:{color:`#808080`},"attr-value":{color:`#ce9178`},"attr-value.punctuation":{color:`#ce9178`},"attr-value.punctuation.attr-equals":{color:`#d4d4d4`},namespace:{color:`#4ec9b0`},'pre[class*="language-javascript"]':{color:`#9cdcfe`},'code[class*="language-javascript"]':{color:`#9cdcfe`},'pre[class*="language-jsx"]':{color:`#9cdcfe`},'code[class*="language-jsx"]':{color:`#9cdcfe`},'pre[class*="language-typescript"]':{color:`#9cdcfe`},'code[class*="language-typescript"]':{color:`#9cdcfe`},'pre[class*="language-tsx"]':{color:`#9cdcfe`},'code[class*="language-tsx"]':{color:`#9cdcfe`},'pre[class*="language-css"]':{color:`#ce9178`},'code[class*="language-css"]':{color:`#ce9178`},'pre[class*="language-html"]':{color:`#d4d4d4`},'code[class*="language-html"]':{color:`#d4d4d4`},".language-regex .token.anchor":{color:`#dcdcaa`},".language-html .token.punctuation":{color:`#808080`},'pre[class*="language-"] > code[class*="language-"]':{position:`relative`,zIndex:`1`},".line-highlight.line-highlight":{background:`#f7ebc6`,boxShadow:`inset 5px 0 0 #f7d87c`,zIndex:`0`}},P8={bash:_8,c:h8,cpp:g8,csharp:b8,css:d8,diff:x8,docker:S8,go:C8,java:E8,javascript:p8,json:T8,jsx:k8,markdown:y8,markup:u8,python:O8,rust:j8,scss:w8,sql:m8,tsx:A8,typescript:D8,yaml:v8};for(let[e,t]of Object.entries(P8))l8.registerLanguage(e,t);var F8=.25,I8=.5,L8=3;function R8({code:e,isStreaming:t,defaultPreview:n=!1}){let{isDark:r}=Tr(),{t:i}=N(),[a,o]=(0,d.useState)(n),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(!1),f=`${r?`dark`:`light`}\n${e}`,p=a&&!t;(0,d.useEffect)(()=>{if(!p)return;let t=!1;return c({key:f,status:`loading`}),(async()=>{let{default:n}=await l0(async()=>{let{default:e}=await import(`./mermaid.core-B9Pni-_1.js`);return{default:e}},__vite__mapDeps([2,3,4,5,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));if(n.initialize({startOnLoad:!1,securityLevel:`strict`,suppressErrorRendering:!0,theme:r?`dark`:`default`}),!await n.parse(e,{suppressErrors:!0}))throw Error(`Invalid Mermaid diagram`);let i=typeof crypto<`u`&&`randomUUID`in crypto?`mermaid-${crypto.randomUUID()}`:`mermaid-${Date.now()}-${Math.random().toString(36).slice(2)}`,a=await n.render(i,e);t||c({key:f,status:`ready`,svg:a.svg})})().catch(()=>{t||c({key:f,status:`error`})}),()=>{t=!0}},[e,f,r,p]);let m=(0,E.jsx)(`button`,{type:`button`,onClick:()=>o(e=>!e),disabled:t,title:i(t?`i18n.previewAfterStreaming`:p?`i18n.showMermaidSource`:`i18n.previewMermaid`),className:[`markdown-code-action`,p?`is-active`:``].filter(Boolean).join(` `),children:i(p?`i18n.source`:`i18n.preview`)});if(!p)return(0,E.jsx)(H8,{code:e,lang:`mermaid`,headerAction:m});let h=s?.key===f&&s.status===`error`?(0,E.jsx)(`div`,{className:`mermaid-block mermaid-block-error`,children:i(`i18n.invalidMermaid`)}):s?.key!==f||s.status!==`ready`?(0,E.jsx)(`div`,{className:`mermaid-block mermaid-block-loading`,"aria-label":i(`i18n.renderingMermaid`)}):(0,E.jsxs)(E.Fragment,{children:[!l&&(0,E.jsx)(`button`,{type:`button`,className:`mermaid-block mermaid-preview-button`,title:i(`i18n.openMermaidViewer`),"aria-label":i(`i18n.openMermaidViewer`),onClick:()=>u(!0),dangerouslySetInnerHTML:{__html:s.svg}}),l&&(0,E.jsx)(z8,{svg:s.svg,onClose:()=>u(!1)})]});return(0,E.jsxs)(`div`,{className:`markdown-code-block`,children:[(0,E.jsxs)(`div`,{className:`markdown-code-header`,children:[(0,E.jsx)(`span`,{className:`markdown-code-lang`,children:`mermaid`}),m]}),h]})}function z8({svg:e,onClose:t}){let{t:n}=N(),r=(0,d.useRef)(null),[i,a]=(0,d.useState)(1);return(0,d.useEffect)(()=>{let e=r.current;if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,e.showModal(),()=>{document.body.style.overflow=t,e.open&&e.close()}},[]),(0,E.jsx)(`dialog`,{ref:r,className:`mermaid-zoom-dialog`,"aria-label":n(`i18n.mermaidViewer`),onCancel:e=>{e.preventDefault(),t()},onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),t())},children:(0,E.jsxs)(`div`,{className:`mermaid-zoom-layout`,children:[(0,E.jsxs)(`div`,{className:`mermaid-zoom-toolbar`,children:[(0,E.jsx)(`span`,{className:`mermaid-zoom-title`,children:n(`i18n.mermaidDiagram`)}),(0,E.jsxs)(`div`,{className:`mermaid-zoom-actions`,children:[(0,E.jsxs)(`div`,{className:`mermaid-zoom-stepper`,children:[(0,E.jsx)(`button`,{type:`button`,onClick:()=>a(e=>Math.max(I8,e-F8)),disabled:i<=I8,title:n(`i18n.zoomOut`),"aria-label":n(`i18n.zoomOut`),children:(0,E.jsx)(`svg`,{width:p.lg,height:p.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,E.jsx)(`path`,{d:`M5 12h14`})})}),(0,E.jsxs)(`span`,{className:`mermaid-zoom-value`,children:[Math.round(i*100),`%`]}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>a(e=>Math.min(L8,e+F8)),disabled:i>=L8,title:n(`i18n.zoomIn`),"aria-label":n(`i18n.zoomIn`),children:(0,E.jsx)(`svg`,{width:p.lg,height:p.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,E.jsx)(`path`,{d:`M12 5v14M5 12h14`})})})]}),(0,E.jsx)(`button`,{type:`button`,className:`mermaid-zoom-icon-button`,onClick:()=>a(1),title:n(`i18n.fitToWidth`),"aria-label":n(`i18n.fitToWidth`),children:(0,E.jsx)(`svg`,{width:p.lg,height:p.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,E.jsx)(`path`,{d:`M8 3H3v5M16 3h5v5M8 21H3v-5M16 21h5v-5`})})}),(0,E.jsx)(`button`,{type:`button`,className:`mermaid-zoom-icon-button`,onClick:t,title:n(`i18n.close`),"aria-label":n(`i18n.close`),children:(0,E.jsx)(`svg`,{width:p.lg,height:p.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,E.jsx)(`path`,{d:`M6 6l12 12M18 6 6 18`})})})]})]}),(0,E.jsx)(`div`,{className:`mermaid-zoom-viewport`,onClick:e=>{e.target===e.currentTarget&&t()},children:(0,E.jsx)(`div`,{className:`mermaid-zoom-canvas`,style:{width:`${i*100}%`},dangerouslySetInnerHTML:{__html:e}})})]})})}var B8=5e3,V8=800;function H8({code:e,lang:t,headerAction:n,isStreaming:r}){let{isDark:i}=Tr(),{t:a}=N(),[o,s]=(0,d.useState)(!1),c=()=>{Ri(e).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},l=e.length>B8||r===!0&&e.length>V8;return(0,E.jsxs)(`div`,{className:`markdown-code-block`,children:[(0,E.jsxs)(`div`,{className:`markdown-code-header`,children:[(0,E.jsx)(`span`,{className:`markdown-code-lang`,children:t||`text`}),(0,E.jsxs)(`div`,{className:`markdown-code-actions`,children:[n,(0,E.jsx)(`button`,{onClick:c,className:`markdown-code-action`,children:a(o?`i18n.copied`:`i18n.copy`)})]})]}),l?(0,E.jsx)(`pre`,{className:`markdown-code-plain`,style:{margin:0,padding:`11px 13px`,fontSize:`var(--text-md)`,lineHeight:1.62,borderRadius:0,background:`color-mix(in srgb, var(--bg) 92%, var(--bg-panel))`,overflow:`auto`},children:(0,E.jsx)(`code`,{style:{fontFamily:`var(--font-mono)`},children:e})}):(0,E.jsx)(l8,{language:t||`text`,style:i?N8:M8,showLineNumbers:!0,lineNumberStyle:{color:`var(--text-dim)`,fontStyle:`normal`},customStyle:{margin:0,padding:`11px 13px`,fontSize:`var(--text-md)`,lineHeight:1.62,borderRadius:0,background:`color-mix(in srgb, var(--bg) 92%, var(--bg-panel))`},codeTagProps:{style:{fontFamily:`var(--font-mono)`}},children:e})]})}function U8({children:e,className:t,isStreaming:n,cwd:r,onOpenFile:i}){let{t:a}=N(),[o,s]=(0,d.useState)(!1),c=!o&&e.length>1e5,l=(0,d.useMemo)(()=>c?G3(e):e,[c,e]),u=(0,d.useMemo)(()=>iG(l),[l]),f=(0,d.useMemo)(()=>({code({className:e,children:t,...r}){let i=e?.replace(`language-`,``).toLowerCase()??``,a=String(t);return e?.includes(`language-`)||a.includes(`
481
481
  `)?i===`mermaid`?(0,E.jsx)(R8,{code:a.replace(/\n$/,``),isStreaming:n}):(0,E.jsx)(H8,{code:a.replace(/\n$/,``),lang:i,isStreaming:n}):(0,E.jsx)(`code`,{className:`markdown-inline-code`,...r,children:t})},pre({children:e}){return(0,E.jsx)(E.Fragment,{children:e})},a({href:e,children:t,...n}){delete n.node;let a=i?RG(e,r):null,o=i;if(!a||!o)return(0,E.jsx)(`a`,{href:e,...n,target:`_blank`,rel:`noopener noreferrer`,children:t});let s=e=>{if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=e.currentTarget.getAttribute(`target`);t&&t!==`_self`||(e.preventDefault(),o(a))};return(0,E.jsx)(`a`,{href:e,...n,onClick:s,children:t})},img({src:e,alt:t,...n}){delete n.node;let i=typeof e==`string`?RG(e,r):null,a=i?`/api/files/${mG(i)}?type=read`:e;return(0,E.jsx)(`img`,{src:a,alt:t??``,loading:`lazy`,...n})},table({children:e}){return(0,E.jsx)(`div`,{className:`markdown-table-wrap`,children:(0,E.jsx)(`table`,{children:e})})},blockquote({children:e}){return(0,E.jsx)(`blockquote`,{children:e})}}),[r,n,i]);return(0,E.jsxs)(`div`,{className:[`markdown-body`,t].filter(Boolean).join(` `),style:{whiteSpace:`pre-wrap`},children:[(0,E.jsx)(B3,{remarkPlugins:cG??void 0,rehypePlugins:uG??void 0,components:f,children:u}),c&&(0,E.jsxs)(`button`,{type:`button`,"aria-label":a(`chat.expandMessage`),title:a(`chat.expandMessage`),onClick:()=>s(!0),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:6,width:`100%`,marginTop:6,padding:`5px 0`,border:`none`,borderTop:`1px solid var(--border)`,background:`var(--bg-subtle)`,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-base)`},children:[(0,E.jsx)(`span`,{"aria-hidden":`true`,children:`…`}),(0,E.jsx)(`svg`,{width:p.base,height:p.base,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,E.jsx)(`path`,{d:`m6 9 6 6 6-6`})})]})]})}var{min:W8,max:G8,abs:K8,floor:q8}=Math,J8=(e,t,n)=>W8(n,G8(t,e)),Y8=e=>[...e].sort((e,t)=>e-t),X8=setTimeout,Z8=clearTimeout,Q8=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)},$8=()=>{let e;return[new Promise(t=>{e=t}),e]},e5=e=>{let t;return()=>(e&&=(t=e(),void 0),t)},t5=typeof window<`u`,n5=e=>e.documentElement,r5=e=>e.ownerDocument,i5=e=>e.defaultView,a5=e5(()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>0),o5=e5(()=>`scrollBehavior`in n5(document).style),s5=e=>G8(e.t(),e.o()),c5=({i:e,l:t,u:n,h:r,v:i,S:a,t:o,$:s,m:c,p:l},u=0)=>{let d=!!l,f=!!u,p=1,m=0,h=0,g=0,_=0,v=0,y=0,b=0,x=0,S=null,C=[0,f?G8(u-1,0):-1],w=0,T=!1,E=new Set,D=()=>g-h,O=()=>D()+v+_,k=(e,t)=>{let i=n(e)-v;return t?o()-i-r(e):i},A=e=>{e&&(a5()&&b!==0||S&&x===1?v+=e:_+=e)};return{_:()=>{E.clear()},I:()=>p,i:(t=200)=>{if(!T||f)return C;let n,r;if(y)[n,r]=C;else{let i=G8(0,O()),a=i+m;d||(t=G8(0,t),b!==1&&(i-=t),b!==2&&(a+=t)),[n,r]=C=e(G8(0,i),G8(0,a)),S&&(n=W8(n,S[0]),r=G8(r,S[1]))}return[G8(n,0),W8(r,s()-1)]},k:e=>t(e-h),R:a,u:k,h:r,C:s,T:()=>g,M:()=>b!==0,o:()=>m,O:()=>h,t:o,L:()=>(y=_,_=0,[y,x===2]),H:(e,t)=>{let n=[e,t];return E.add(n),()=>{E.delete(n)}},W:(n,s)=>{let u,C,j=0;switch(n){case 1:{if(s===g&&x===0)break;let e=y;y=0;let t=s-g,n=K8(t);e&&n<K8(e)+1||x!==0||(b=t<0?2:1),f&&=!1,g=s,j=4;let r=D();r>=-m&&r<=o()&&(j+=1,C=n>m);break}case 2:j=8,b!==0&&(u=!0,j+=1),b=0,x=0,S=null;break;case 3:{let e=s.filter(([e,t])=>!a(e,t));if(!e.length)break;A(e.reduce((e,[t,n])=>{let i;if(x===2)i=!0;else if(S&&x===1)i=t<S[0];else{let e=D(),n=k(t),a=r(t);i=b!==1&&x===0?n+a<=e:n<e&&n+a<e+m}return i&&(e+=n-r(t)),e},0));for(let[t,n]of e){let e=r(t),a=i(t,n);d&&(w+=a?n:n-e)}d&&m&&w>m&&(A(l(t(O()))),d=!1),j=3,C=!0;break}case 4:m!==s&&(m||(T=C=!0),m=s,j=3);break;case 5:s[1]?(A(c(s[0],!0)),x=2,j=1):(c(s[0]),j=1);break;case 6:h=s;break;case 7:x=1;break;case 8:S=e(s,s+m),j=1}j&&(p=1+(2147483647&p),u&&v&&(_+=v,v=0),E.forEach(([e,t])=>{j&e&&t(C)}))}}},l5=(e,t,n,r=0,i=t-1)=>{let a=r;for(;r<=i;){let t=q8((r+i)/2);e(t)<=n?(a=t,r=t+1):i=t-1}return J8(a,0,t-1)},u5=(e,t,n)=>{let r=n?`unshift`:`push`;for(let n=0;n<t;n++)e[r](-1);return e},d5=(e,t,n)=>{let r=n&&n[1]||t||40,i=-1,a=0,o=n&&n[0],s=o?u5(o.slice(0,W8(e,o.length)),G8(0,e-o.length)):u5([],e),c=u5([],e+1),l=e=>{let t=s[e];return t===-1?r:t},u=t=>{if(!e)return 0;if(i>=t)return c[t];i<0&&(c[0]=0,i=0);let n=i,r=c[n];for(;n<t;)r+=l(n),c[++n]=r;return i=t,r};return{i:(t,n)=>{let r,i;return a=W8(a,e-1),u(a)<=t?(i=l5(u,e,n,a),r=l5(u,e,t,a,i)):(r=l5(u,e,t,void 0,a),i=l5(u,e,n,r)),a=r,[r,i]},l:t=>l5(u,e,t),u,h:l,v:(e,t)=>{let n=s[e]===-1;return s[e]=t,i=W8(e,i),n},S:(e,t=-1)=>s[e]===t,t:()=>u(e),$:()=>e,m:(t,n)=>{let a=t-e;return i=n?-1:W8(t-1,i),e=t,a>0?(u5(c,a),u5(s,a,n),r*a):(c.splice(a),(n?s.splice(0,-a):s.splice(a)).reduce((e,t)=>e-(t===-1?r:t),0))},p:t?void 0:e=>{let t=0,n=[];s.forEach((r,i)=>{r!==-1&&(r&&n.push(r),i<e&&t++)}),i=-1;let a=Y8(n),o=a.length,c=o/2|0,l=o%2==0?(a[c-1]+a[c])/2:a[c],u=r;return((r=l)-u)*G8(e-t,0)},B:()=>[s.slice(),r]}},f5=e=>{let t;return{X(n){(t||=new(i5(r5(n))).ResizeObserver(e)).observe(n)},Y(e){t.unobserve(e)},q(){t&&t.disconnect()}}},p5=(e,t)=>t?-e:e,m5=(e,t,n,r,i,a)=>{let o,s=0,c=!1,l=!1,u=!1,d=!1,f=Date.now,p=()=>{if(c||l)return c=!1,void m();u=!1,e.W(2)},m=()=>{Z8(o),o=X8(p,150)},h=()=>{s=f(),u&&(d=!0),a&&e.W(6,a()),e.W(1,r()),m()},g=t=>{if(c||!e.M()||t.ctrlKey)return;let r=f()-s;150>r&&50<r&&(n?t.deltaX:t.deltaY)&&(c=!0)},_=()=>{l=!0,u=d=!1},v=()=>{l=!1,a5()&&(u=!0)};return t.addEventListener(`scroll`,h),t.addEventListener(`wheel`,g,{passive:!0}),t.addEventListener(`touchstart`,_,{passive:!0}),t.addEventListener(`touchend`,v,{passive:!0}),{q:()=>{t.removeEventListener(`scroll`,h),t.removeEventListener(`wheel`,g),t.removeEventListener(`touchstart`,_),t.removeEventListener(`touchend`,v),Z8(o)},A:()=>{let[t,n]=e.L();t&&(i(t,n,d),d=!1,n&&e.o()>e.t()&&e.W(1,r()))}}},h5=(e,t,n)=>{let r;return[async(i,a)=>{if(!await t())return;let o,s,c;r&&r();let l=a&&o5(),u=r=()=>{o=!0,Z8(s),c&&c()},d=()=>{if(!o){if(e.o()&&(Z8(s),s=X8(u,150)),l){for(let[t,n]=e.i(0);t<=n;t++)if(e.R(t))return;u()}e.W(7),n(i(),l)}},f=()=>{if(o)return;let t;c=e.H(2,()=>{t||(t=!0,Q8(()=>{t=!1,d()}))}),d()};l?(e.W(8,i()),Q8(f)):f()},()=>{r&&r()}]},g5=(e,t)=>{let n,r,i=$8(),a=!1,o=t?`scrollLeft`:`scrollTop`,s=t?`overflowX`:`overflowY`,[c,l]=h5(e,()=>i[0],(e,r)=>{e=p5(e,a),r?n.scrollTo({[t?`left`:`top`]:e,behavior:`smooth`}):n[o]=e}),u=t?`width`:`height`,d=new WeakMap,f=f5(t=>{let r=[];for(let{target:i,contentRect:a}of t)if(i.offsetParent){if(i===n)e.W(4,a[u]);else{let e=d.get(i);e!=null&&r.push([e,a[u]])}}r.length&&e.W(3,r)});return{D(c,u=c.parentElement){f.X(n=u),t&&(a=getComputedStyle(u).direction===`rtl`),r=m5(e,u,t,()=>p5(u[o],a),(t,n,r)=>{if(r){let e=u.style,t=e[s];e[s]=`hidden`,X8(()=>{e[s]=t})}u[o]=p5(e.T()+t,a),n&&l()}),i[1](!0)},_(){f.q(),r&&r.q(),i[1](!1),i=$8()},N:(e,t)=>(d.set(e,t),f.X(e),()=>{d.delete(e),f.Y(e)}),P:()=>a,V:c,J(){r&&r.A()},j:e.O,G:()=>0}},_5=(e,t)=>{e.V(()=>t)},v5=(e,t,n,{align:r,smooth:i,offset:a=0}={})=>{if(n=J8(n,0,t.C()-1),r===`nearest`){let e=t.u(n),i=t.T();if(e<i)r=`start`;else{if(!(e+t.h(n)>i+t.o()))return;r=`end`}}e.V(()=>a+e.j()+t.u(n)+(r===`end`?t.h(n)-(t.o()-e.G()):r===`center`?(t.h(n)-(t.o()-e.G()))/2:0),i)},y5=t5?d.useLayoutEffect:d.useEffect,b5=`current`,x5=(e,t)=>{if(Array.isArray(e))for(let n of e)x5(n,t);else e==null||typeof e==`boolean`||t.push(e)},S5=(e,t)=>e.key??`_`+t,C5=e=>{let t=(0,d.useRef)(null);return t.current||=e()},w5=e=>{let t=(0,d.useRef)(e);return y5(()=>{t[b5]=e},[e]),t},T5=(0,d.memo)(({ee:e,te:t,oe:n,ne:r,re:i,ie:a,se:o,le:s})=>{let c=(0,d.useRef)(null);y5(()=>t(c[b5],n),[n]);let l=(0,d.useMemo)(()=>{let e={contain:`layout style`,position:i&&s?void 0:`absolute`,[o?`height`:`width`]:`100%`,[o?`top`:`left`]:0,[o?`left`:`top`]:r,visibility:!i||s?void 0:`hidden`};return o&&(e.display=`inline-flex`),e},[r,i,s,o]);return(0,E.jsx)(a,typeof a==`string`?{ref:c,style:l,children:e}:{ref:c,style:l,index:n,children:e})}),E5=(e,t)=>(0,d.useMemo)(()=>{if(typeof e==`function`)return[n=>e(t[n],n),t.length];let n=(e=>{let t=[];return x5(e,t),t})(e);return[e=>n[e],n.length]},[e,t]),D5=(0,d.forwardRef)(({children:e,data:t,bufferSize:n,itemSize:r,shift:i,horizontal:a,keepMounted:o,cache:s,startMargin:c=0,ssrCount:l,as:u=`div`,item:f=`div`,scrollRef:p,onScroll:m,onScrollEnd:h},g)=>{let[_,v]=E5(e,t),y=(0,d.useRef)(null),b=(0,d.useRef)(!!l),x=w5(m),S=w5(h),[C,w,T,D]=C5(()=>{let e=!!a,t=d5(v,r,s),n=c5(t,l);return[n,t,g5(n,e),e]});v!==C.C()&&C.W(5,[v,i]),c!==C.O()&&C.W(6,c);let[O,k]=(0,d.useReducer)(C.I,void 0,C.I),A=C.M(),j=C.t(),M=T.P(),N=[],P=e=>{let t=_(e);return(0,E.jsx)(T5,{te:T.N,oe:e,ne:C.u(e,M),re:C.R(e),ie:f,ee:t,se:D,le:b[b5]},S5(t,e))};if(y5(()=>{b[b5]=!1,C.H(1,e=>{e?(0,Gi.flushSync)(k):k()}),C.H(4,()=>{x.current&&x.current(C.T())}),C.H(8,()=>{S.current&&S.current()});let e=y[b5];return p?Q8(()=>{p.current&&T.D(e,p[b5])}):T.D(e),()=>{C._(),T._()}},[]),y5(()=>{T.J()},[O]),(0,d.useImperativeHandle)(g,()=>({get cache(){return w.B()},get scrollOffset(){return C.T()},get scrollSize(){return s5(C)},get viewportSize(){return C.o()},findItemIndex:C.k,getItemOffset:C.u,getItemSize:C.h,scrollToIndex:(e,t)=>v5(T,C,e,t),scrollTo:e=>_5(T,e),scrollBy:e=>((e,t,n)=>{_5(e,n+t.T())})(T,C,e)}),[]),o){let e=new Set(o);for(let[t,r]=C.i(n);t<=r;t++)e.add(t);Y8([...e]).forEach(e=>{N.push(P(e))})}else for(let[e,t]=C.i(n);e<=t;e++)N.push(P(e));return(0,E.jsx)(u,{ref:y,style:{contain:`size style`,overflowAnchor:`none`,flex:`none`,position:`relative`,width:D?j:`100%`,height:D?`100%`:j,pointerEvents:A?`none`:void 0},children:N})}),O5=100,k5=new Map;function A5(e,t,n){let r=`${e}:${t}:${n}`,i=k5.get(r);if(i)return k5.delete(r),k5.set(r,i),i;let a=fetch(`/api/sessions/${encodeURIComponent(e)}/entries/${encodeURIComponent(t)}/thinking?blockIndex=${n}`).then(async e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();if(typeof t.thinking!=`string`)throw Error(`Invalid thinking response`);return t.thinking}).catch(e=>{throw k5.delete(r),e});if(k5.set(r,a),k5.size>O5){let e=k5.keys().next().value;e&&k5.delete(e)}return a}function j5(e){if(!e)return null;let t=new Date(e),n=new Date,r=t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate(),i=t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`});return r?i:`${t.toLocaleDateString([],{month:`short`,day:`numeric`,year:t.getFullYear()===n.getFullYear()?void 0:`numeric`})} ${i}`}function M5(e,t,n){if(t===n||e.role!==`assistant`)return!0;for(let r of e.content??[])if(r.type===`toolCall`&&t?.get(r.toolCallId)!==n?.get(r.toolCallId))return!1;return!0}var N5=(0,d.memo)(function({message:e,isStreaming:t,toolResults:n,modelNames:r,cwd:i,onOpenFile:a,entryId:o,onFork:s,forking:c,onNavigate:l,prevAssistantEntryId:u,onEditContent:d,showTimestamp:f,turnStartTimestamp:p,sessionId:m,streamingBashOutput:h,longBlockCollapseChars:g,recentExpandedBlockKeys:_,modelLabelVisible:v,turnNumber:y}){return e.role===`user`?(0,E.jsx)(P5,{message:e,entryId:o,onFork:s,forking:c,onNavigate:l,prevAssistantEntryId:u,onEditContent:d,turnNumber:y}):e.role===`assistant`?(0,E.jsx)(F5,{message:e,isStreaming:t,toolResults:n,modelNames:r,cwd:i,onOpenFile:a,showTimestamp:f,turnStartTimestamp:p,sessionId:m,entryId:o,longBlockCollapseChars:g,recentExpandedBlockKeys:_,modelLabelVisible:v,turnNumber:y}):e.role===`toolResult`?null:e.role===`custom`?e.customType===`compaction`?(0,E.jsx)($5,{message:e}):(0,E.jsx)(n7,{message:e,cwd:i,onOpenFile:a}):e.role===`bashExecution`?(0,E.jsx)(d7,{message:e,sessionId:m,streamingOutput:h,longBlockCollapseChars:g}):null},(e,t)=>e.message===t.message&&e.isStreaming===t.isStreaming&&M5(e.message,e.toolResults,t.toolResults)&&e.modelNames===t.modelNames&&e.cwd===t.cwd&&e.onOpenFile===t.onOpenFile&&e.entryId===t.entryId&&e.onFork===t.onFork&&e.forking===t.forking&&e.onNavigate===t.onNavigate&&e.prevAssistantEntryId===t.prevAssistantEntryId&&e.onEditContent===t.onEditContent&&e.showTimestamp===t.showTimestamp&&e.sessionId===t.sessionId&&e.streamingBashOutput===t.streamingBashOutput&&e.modelLabelVisible===t.modelLabelVisible&&e.longBlockCollapseChars===t.longBlockCollapseChars&&e.recentExpandedBlockKeys===t.recentExpandedBlockKeys);function P5({message:e,entryId:t,onFork:n,forking:r,onNavigate:i,prevAssistantEntryId:a,onEditContent:o,turnNumber:s}){let{t:c}=N(),[l,u]=(0,d.useState)(!1),[f,m]=(0,d.useState)(!1),h=typeof e.content==`string`?e.content:e.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
482
482
  `),g=typeof e.content==`string`?[]:e.content.filter(e=>e.type===`image`),_=j5(e.timestamp),v=!!t&&!!n,y=!!a&&!!i;return(0,E.jsxs)(`div`,{style:{marginBottom:16,display:`flex`,flexDirection:`column`,alignItems:`flex-end`},onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,maxWidth:`85%`},children:[s!==void 0&&(0,E.jsx)(iZ,{number:s}),(0,E.jsxs)(`div`,{style:{flex:1,minWidth:0,position:`relative`,background:`var(--user-bg)`,border:`1px solid color-mix(in srgb, var(--accent) 20%, transparent)`,borderRadius:12,padding:`8px 12px`,fontSize:`var(--text-2xl)`,fontFamily:`var(--font-mono)`,lineHeight:1.6,color:`var(--text)`,wordBreak:`break-word`},children:[g.length>0&&(0,E.jsx)(`div`,{style:{display:`flex`,gap:6,flexWrap:`wrap`,marginBottom:h?8:0},children:g.map((e,t)=>{let n=a7(e);return(0,E.jsx)(`img`,{src:n,alt:``,style:{maxWidth:240,maxHeight:240,borderRadius:6,objectFit:`contain`,display:`block`,border:`1px solid color-mix(in srgb, var(--accent) 15%, transparent)`}},t)})}),h&&(0,E.jsx)(`div`,{"data-testid":`user-message`,style:{whiteSpace:`pre-wrap`,wordBreak:`break-word`},children:h})]})]}),(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`flex-end`,gap:6,marginTop:3},children:[(0,E.jsx)(`div`,{style:{display:`flex`,gap:3,opacity:+!!l,pointerEvents:l?`auto`:`none`,transition:`opacity 0.12s`},children:(0,E.jsxs)(`button`,{onClick:()=>{Ri(h).then(()=>{m(!0),setTimeout(()=>m(!1),1500)})},title:c(`i18n.copyMessage`),style:{display:`flex`,alignItems:`center`,gap:4,padding:`3px 8px`,height:22,background:`none`,border:`none`,borderRadius:5,color:f?`var(--accent)`:`var(--text-dim)`,cursor:`pointer`,fontSize:`var(--text-sm)`,fontWeight:400,whiteSpace:`nowrap`,transition:`color 0.12s`,"--hover-color":`var(--accent)`},className:f?void 0:`hover-shift`,children:[f?(0,E.jsx)(`svg`,{width:p.sm,height:p.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,E.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}):(0,E.jsxs)(`svg`,{width:p.sm,height:p.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,E.jsx)(`rect`,{x:`9`,y:`9`,width:p.lg,height:p.lg,rx:`2`,ry:`2`}),(0,E.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]}),c(f?`i18n.copied`:`i18n.copy`)]})}),(v||y)&&(0,E.jsxs)(`div`,{style:{display:`flex`,gap:3,opacity:l||r?1:0,pointerEvents:l||r?`auto`:`none`,transition:`opacity 0.12s`},children:[y&&(0,E.jsxs)(`button`,{onClick:()=>{i(a),o?.(h)},title:c(`i18n.editFromHereTitle`),style:{display:`flex`,alignItems:`center`,gap:4,padding:`3px 8px`,height:22,background:`none`,border:`none`,borderRadius:5,color:`var(--text-dim)`,cursor:`pointer`,fontSize:`var(--text-sm)`,fontWeight:400,whiteSpace:`nowrap`,transition:`color 0.12s`,"--hover-color":`var(--accent)`},className:`hover-shift`,children:[(0,E.jsxs)(`svg`,{width:p.sm,height:p.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,E.jsx)(`polyline`,{points:`15 10 20 15 15 20`}),(0,E.jsx)(`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`})]}),c(`i18n.editFromHere`)]}),v&&(0,E.jsxs)(`button`,{onClick:()=>{n(t)},disabled:r,title:c(r?`i18n.creatingSession`:`i18n.newSessionTitle`),style:{display:`flex`,alignItems:`center`,gap:4,padding:`3px 8px`,height:22,background:`none`,border:`none`,borderRadius:5,color:r?`var(--accent)`:`var(--text-dim)`,cursor:r?`not-allowed`:`pointer`,fontSize:`var(--text-sm)`,fontWeight:400,whiteSpace:`nowrap`,transition:`color 0.12s`,"--hover-color":`var(--accent)`},className:r?void 0:`hover-shift`,children:[(0,E.jsxs)(`svg`,{width:p.sm,height:p.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,E.jsx)(`line`,{x1:`6`,y1:`3`,x2:`6`,y2:`15`}),(0,E.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,E.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,E.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),c(r?`i18n.creating`:`i18n.newSession`)]})]}),_&&(0,E.jsx)(`span`,{style:{fontSize:`var(--text-xs)`,color:`var(--text-dim)`},children:_})]})]})}function F5({message:e,isStreaming:t,toolResults:n,modelNames:r,cwd:i,onOpenFile:a,showTimestamp:o,turnStartTimestamp:s,sessionId:c,entryId:l,longBlockCollapseChars:u,recentExpandedBlockKeys:f,modelLabelVisible:m=!0,turnNumber:h}){let{t:g}=N(),_=o?j5(e.timestamp):null,v=(e.content??[]).map((e,t)=>({block:e,originalIndex:t})).filter(({block:e})=>!OY(e,{isStreaming:t})),y=v.map(({block:e})=>e),b=AY(e,{isStreaming:t}),[x,S]=(0,d.useState)(!1),[C,w]=(0,d.useState)(!1),T=(0,d.useRef)(null),[D,O]=(0,d.useState)(null),k=(0,d.useRef)(v);(0,d.useEffect)(()=>{k.current=v});let A=(0,d.useRef)(new Map),[j,M]=(0,d.useState)(new Map),P=(0,d.useMemo)(()=>{if(!e.timestamp||!s)return;let t=Math.round((e.timestamp-s)/1e3);return t>0?t:void 0},[e.timestamp,s]),ee=(0,d.useMemo)(()=>{let t=new Map;if(!n||!e.timestamp)return t;for(let[r,i]of n)if(i.timestamp&&e.timestamp){let n=Math.round((i.timestamp-e.timestamp)/1e3);n>0&&t.set(r,n)}return t},[n,e.timestamp]),F=y.filter(e=>e.type===`text`).map(e=>e.text).join(`
483
483
  `);return(0,d.useEffect)(()=>{if(!t)return;let e=setInterval(()=>{if(document.hidden)return;let e=k.current,t=e.map(({block:e})=>e),n=Date.now();e.forEach(({originalIndex:e})=>{A.current.has(e)||A.current.set(e,n)}),M(t=>{let r=!1,i=new Map(t);for(let t=0;t<e.length-1;t++){let a=e[t].originalIndex,o=e[t+1].originalIndex;if(!i.has(a)&&A.current.has(a)){let e=A.current.get(a),t=A.current.get(o)??n;i.set(a,Math.round((t-e)/1e3)),r=!0}}return r?i:t});let r=e[e.length-1];if(r&&r.block.type===`toolCall`){let e=A.current.get(r.originalIndex);e!==void 0&&M(t=>{let i=Math.round((n-e)/1e3);if(t.get(r.originalIndex)===i)return t;let a=new Map(t);return a.set(r.originalIndex,i),a})}let i=0;for(let e of t)e.type===`text`?i+=e.text?.length??0:e.type===`thinking`?i+=e.thinking?.length??0:e.type===`toolCall`&&(i+=JSON.stringify(e.input??{}).length);if(i===0)return;T.current===null&&(T.current=n);let a=(n-T.current)/1e3;a>.5&&O(i/4/a)},300);return()=>{clearInterval(e),T.current=null,O(null)}},[t,M,O,k,A,T]),y.length===0&&!t&&!b?null:(0,E.jsxs)(`div`,{style:{marginBottom:16},onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),children:[m&&(0,E.jsxs)(`div`,{style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`,marginBottom:4,display:`flex`,alignItems:`center`,gap:6},children:[h!==void 0&&(0,E.jsx)(iZ,{number:h}),e.provider&&(0,E.jsx)(`span`,{children:r?.[`${e.provider}/${e.model}`]??r?.[e.model]??e.model}),t&&(()=>{let e=0;for(let t of y)t.type===`text`?e+=t.text?.length??0:t.type===`thinking`?e+=t.thinking?.length??0:t.type===`toolCall`&&(e+=JSON.stringify(t.input??{}).length);let t=Math.round(e/4);return(0,E.jsx)(E.Fragment,{children:t>0&&(0,E.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4,color:`var(--text)`},title:g(`i18n.estimatedTokens`),children:[(0,E.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:2,fontSize:`var(--text-sm)`,fontWeight:400},children:[(0,E.jsxs)(`svg`,{width:p.xs,height:p.xs,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,E.jsx)(`line`,{x1:`5`,y1:`1.5`,x2:`5`,y2:`8.5`}),(0,E.jsx)(`polyline`,{points:`2 6 5 8.5 8 6`})]}),t]}),D!==null&&(0,E.jsxs)(`span`,{style:{marginLeft:6,padding:`1px 6px`,borderRadius:4,background:D>=50?`#53b3cb`:D>=30?`#9bc53d`:D>=15?`#f9c22e`:`#e01a4f`,color:`#fff`,fontSize:`var(--text-sm)`,fontWeight:400},children:[D.toFixed(1),` t/s`]})]})})})()]}),(0,E.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:v.map(({block:e,originalIndex:r})=>(0,E.jsx)(z5,{block:e,toolResults:n,isStreaming:t,streamingDuration:j.get(r),toolCallDurations:ee,cwd:i,onOpenFile:a,sessionId:c,entryId:l,blockIndex:r,longBlockCollapseChars:u,recentExpandedBlockKeys:f},`${l??`stream`}-${r}`))}),b&&(0,E.jsxs)(`div`,{role:`alert`,style:{marginTop:y.length>0?8:0,padding:`7px 10px`,border:`1px solid color-mix(in srgb, var(--status-error) 30%, transparent)`,borderRadius:6,background:`color-mix(in srgb, var(--status-error) 7%, transparent)`,color:`var(--status-error)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-base)`,lineHeight:1.5,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:[`Error: `,b]}),(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginTop:4},children:[e.usage&&!t&&(0,E.jsx)(`div`,{style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`},children:u7(e.usage)}),F&&!t&&(0,E.jsxs)(`button`,{onClick:()=>{Ri(F).then(()=>{w(!0),setTimeout(()=>w(!1),1500)})},title:g(`i18n.copyMessage`),style:{display:`flex`,alignItems:`center`,gap:4,padding:`3px 8px`,height:22,background:`none`,border:`none`,borderRadius:5,color:C?`var(--accent)`:`var(--text-dim)`,cursor:`pointer`,fontSize:`var(--text-sm)`,fontWeight:400,whiteSpace:`nowrap`,opacity:+!!x,pointerEvents:x?`auto`:`none`,transition:`opacity 0.12s, color 0.12s`,"--hover-color":`var(--accent)`},className:C?void 0:`hover-shift`,children:[C?(0,E.jsx)(`svg`,{width:p.sm,height:p.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,E.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}):(0,E.jsxs)(`svg`,{width:p.sm,height:p.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,E.jsx)(`rect`,{x:`9`,y:`9`,width:p.lg,height:p.lg,rx:`2`,ry:`2`}),(0,E.jsx)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})]}),g(C?`i18n.copied`:`i18n.copy`)]}),_&&!t&&(0,E.jsxs)(`span`,{style:{fontSize:`var(--text-xs)`,color:`var(--text-dim)`,marginLeft:`auto`,fontVariantNumeric:`tabular-nums`},children:[_,P!==void 0&&(0,E.jsxs)(`span`,{children:[` `,`(`,g(`chat.turnDuration`,{duration:Wt(P)}),`)`]})]})]})]})}var I5=24;function L5({text:e}){let t=(0,d.useMemo)(()=>e.split(/\r?\n/),[e]);return typeof ResizeObserver>`u`||t.length<50&&e.length<5e3?(0,E.jsx)(`div`,{style:{whiteSpace:`pre-wrap`,overflowWrap:`break-word`},children:e}):(0,E.jsx)(D5,{data:t,itemSize:I5,children:e=>(0,E.jsx)(`div`,{style:{minHeight:I5,lineHeight:`${I5}px`,whiteSpace:`pre-wrap`,overflowWrap:`break-word`},children:e})})}function R5({text:e,threshold:t,t:n,renderFull:r,isStreaming:i=!1,defaultExpanded:a=!1}){let[o,s]=(0,d.useState)(a),c=e.length;if(!(!i&&c>t))return r?(0,E.jsx)(E.Fragment,{children:r()}):i&&e.length>0?(0,E.jsx)(L5,{text:e}):(0,E.jsx)(E.Fragment,{children:e});let l=Math.max(1,Math.floor(t/2)),u=c-l*2,f=(0,E.jsx)(`button`,{type:`button`,"data-long-block-toggle":``,onClick:()=>s(e=>!e),"aria-expanded":o,style:{display:`block`,width:`100%`,margin:`6px 0`,padding:`3px 8px`,border:`1px dashed var(--border)`,borderRadius:6,background:`none`,color:`var(--text-dim)`,fontSize:`var(--text-sm)`,cursor:`pointer`,textAlign:`center`},children:o?n(`longBlock.collapse`):n(`longBlock.expandHint`,{n:u})});return o?(0,E.jsxs)(E.Fragment,{children:[r?r():(0,E.jsx)(L5,{text:e}),f]}):(0,E.jsxs)(E.Fragment,{children:[e.slice(0,l),f,e.slice(c-l)]})}function z5({block:e,toolResults:t,isStreaming:n,streamingDuration:r,toolCallDurations:i,cwd:a,onOpenFile:o,sessionId:s,entryId:c,blockIndex:l,longBlockCollapseChars:u,recentExpandedBlockKeys:d}){let f=!n&&c!==void 0&&(e.type===`thinking`||e.type===`toolCall`)&&d?.has(_t(e.type,c,e.type===`toolCall`?e.toolCallId:void 0,e.type===`thinking`?l:void 0))===!0;if(e.type===`text`)return(0,E.jsx)(B5,{block:e,isStreaming:n,cwd:a,onOpenFile:o});if(e.type===`thinking`)return(0,E.jsx)(V5,{block:e,sessionId:s,entryId:c,blockIndex:l,isStreaming:n,keepExpanded:f,longBlockCollapseChars:u});if(e.type===`toolCall`){let a=e,o=t?.get(a.toolCallId),s=i?.get(a.toolCallId)??r;return(0,E.jsx)(U5,{block:a,result:o,duration:s,isStreaming:n,keepExpanded:f,longBlockCollapseChars:u})}return null}function B5({block:e,isStreaming:t,cwd:n,onOpenFile:r}){return(0,E.jsx)(U8,{isStreaming:t,cwd:n,onOpenFile:r,children:e.text})}function V5({block:e,sessionId:t,entryId:n,blockIndex:r,isStreaming:i=!1,keepExpanded:a=!1,longBlockCollapseChars:o=200}){let{t:s}=N(),[c,l]=(0,d.useState)(null),[u,f]=(0,d.useState)(!1),[m,h]=(0,d.useState)(null),g=(0,d.useRef)(!1),_=(0,d.useRef)(null);(0,d.useEffect)(()=>{e.deferred&&!g.current&&(g.current=!0,v())},[]);let v=async()=>{if(!(!e.deferred||c!==null)){if(!t||!n){h(s(`i18n.thinkingUnavailable`));return}f(!0),h(null);try{l(await A5(t,n,r))}catch(e){h(e instanceof Error?e.message:String(e))}finally{f(!1)}}},y=e.deferred?c:e.thinking,b=OZ(_,i,[y]);return(0,E.jsxs)(`div`,{style:{border:`1px solid var(--border)`,borderRadius:6,overflow:`hidden`,fontSize:`var(--text-base)`},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,padding:`6px 10px`,color:`var(--status-warning)`,fontSize:`var(--text-base)`,cursor:`default`},children:[(0,E.jsx)(ri,{size:p.base,fill:`currentColor`,style:{flexShrink:0,color:`var(--bulb-warning)`}}),(0,E.jsx)(`span`,{children:s(`i18n.thinking`)})]}),(0,E.jsx)(`div`,{ref:_,onScroll:b,style:{padding:`4px 10px 8px 28px`,borderTop:`1px solid var(--border)`,fontSize:`var(--text-lg)`,lineHeight:1.6,color:`var(--text-muted)`,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`,fontFamily:`var(--font-mono)`,maxHeight:400,overflowY:`auto`,contentVisibility:`auto`,containIntrinsicBlockSize:400},children:u?(0,E.jsxs)(`span`,{style:{color:`var(--text-dim)`},children:[s(`i18n.loading`),`...`]}):m?(0,E.jsx)(`span`,{style:{color:`var(--status-error)`},children:m}):y?(0,E.jsx)(R5,{text:y,threshold:o,t:s,isStreaming:i,defaultExpanded:a}):DY(e)?(0,E.jsx)(`span`,{style:{color:`var(--text-dim)`,fontStyle:`italic`},children:s(`i18n.thinkingEncrypted`)}):(0,E.jsx)(`span`,{style:{color:`var(--text-dim)`},children:s(`i18n.noThinking`)})})]})}function H5({block:e,result:t,duration:n}){let{t:r}=N(),i=e.input??{},a=typeof i.question==`string`?i.question:null,o=Array.isArray(i.options)?i.options:[],s=t?t.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
@@ -492,7 +492,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
492
492
  `:null]},t))})]})})}function z7({widget:e,saved:t,messages:n,defaultOffset:r,onCloseWidget:i,setWidgetGeometry:a,onSend:o,fillChatInput:s,portalTarget:c}){let{t:l}=N(),[u,f]=(0,d.useState)(!1),[m,h]=(0,d.useState)(null),g=(0,d.useRef)(null),_=(0,d.useCallback)(t=>{if(u)return;let n=()=>i(e.key,e.lines.join(`
493
493
  `));if(window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches){n();return}let r=document.querySelector(`[data-tab-id="widgets"]`)??document.querySelector(`[data-testid="tab-bar"]`);if(!r){n();return}let a=t.currentTarget.getBoundingClientRect(),o=r.getBoundingClientRect(),s=`M ${a.left+a.width/2} ${a.top+a.height/2} L ${o.left+o.width/2} ${o.top+o.height/2}`;f(!0),h(s),window.setTimeout(n,280)},[u,i,e.key,e.lines]);return(0,d.useLayoutEffect)(()=>{if(!m||!g.current)return;let e=g.current;e.style.setProperty(`offset-path`,`path('${m}')`),e.style.setProperty(`offset-rotate`,`0deg`),e.animate([{offsetDistance:`0%`,r:28},{offsetDistance:`100%`,r:2}],{duration:240,easing:`cubic-bezier(0.22, 1, 0.36, 1)`,fill:`forwards`})},[m]),(0,d.useEffect)(()=>{t===void 0?a(e.key,{x:r.dx,y:r.dy,width:560,height:Math.round(window.innerHeight*.6)}):t.collapsed&&i(e.key,e.lines.join(`
494
494
  `))},[e.key]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(JX,{testId:`widget-dialog`,title:e.key,align:`center`,portalTarget:c,style:{opacity:+!u,transition:`opacity 200ms ease`},headerExtra:(0,E.jsx)(qi,{label:l(`widgets.collapse`),children:(0,E.jsx)(`button`,{type:`button`,"aria-label":l(`widgets.collapse`),onClick:_,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:26,height:26,borderRadius:6,border:`none`,background:`transparent`,color:`var(--text-muted)`,cursor:`pointer`},className:`hover-shift`,children:(0,E.jsx)(si,{size:p.xl})})}),position:t?{x:t.x,y:t.y}:void 0,size:t?{width:t.width,height:t.height}:void 0,initialOffset:r,onDragStop:(n,r)=>a(e.key,{x:n,y:r,width:t?.width??560,height:t?.height??Math.round(window.innerHeight*.6)}),onResizeStop:(t,n,r,i)=>a(e.key,{x:r,y:i,width:t,height:n}),children:(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10},children:[(0,E.jsx)(`pre`,{style:{margin:0,color:`var(--text-muted)`,fontSize:`var(--text-base)`,lineHeight:1.5,whiteSpace:`pre-wrap`,wordBreak:`break-word`,fontFamily:`var(--font-mono)`},children:e.lines.join(`
495
- `)}),n.length>0&&(0,E.jsx)(`div`,{"data-testid":`widget-bound-messages`,style:{display:`flex`,flexWrap:`wrap`,gap:6,paddingTop:8,borderTop:`1px solid var(--border)`,flexShrink:0},children:n.map((t,n)=>(0,E.jsx)(hY,{msg:t,onSend:o,onFillInput:s,testId:`widget-send-${e.key}-${n}`},n))})]})}),m&&(0,E.jsx)(`div`,{"data-testid":`widget-collapse-trail`,style:{position:`fixed`,inset:0,zIndex:70,pointerEvents:`none`},children:(0,E.jsx)(`svg`,{width:`100%`,height:`100%`,style:{position:`absolute`,inset:0},children:(0,E.jsx)(`circle`,{ref:g,r:28,fill:`var(--accent)`,fillOpacity:.7})})})]})}var B7=262144,V7=10485760,H7={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,svg:`image/svg+xml`,bmp:`image/bmp`,ico:`image/x-icon`,avif:`image/avif`},U7={mp3:`audio/mpeg`,wav:`audio/wav`,ogg:`audio/ogg`,oga:`audio/ogg`,opus:`audio/ogg`,m4a:`audio/mp4`,aac:`audio/aac`,flac:`audio/flac`,weba:`audio/webm`,webm:`audio/webm`};function W7(e){return e.replace(/\\/g,`/`).split(`/`).pop()??``}function G7(e){return W7(e).toLowerCase().split(`.`).pop()??``}function K7(e){return H7[G7(e)]??null}function q7(e){return U7[G7(e)]??null}function J7(e){let t=G7(e);return t===`pdf`||t===`docx`?t:null}function Y7(e){return K7(e)!==null}function X7(e){return q7(e)!==null}function Z7(e){return J7(e)!==null}async function Q7(e,t){let n=e.split(/[\\/]/).filter(Boolean),r=n.pop();if(!r)throw Error(`Invalid file path`);let i=n.join(`/`)||`/`,a=new FormData;a.append(`files`,new File([t],r,{type:`text/plain`}));let o=await fetch(`/api/files/${mG(i)}?type=upload&conflict=overwrite`,{method:`POST`,body:a});if(!o.ok){let e=`Save failed (${o.status})`;try{let t=await o.json();t?.error&&(e=t.error)}catch{}throw Error(e)}}var $7=(0,d.lazy)(()=>l0(()=>import(`./CodeMirrorEditor-BsodzoJM.js`),__vite__mapDeps([20,1]))),e9={source:`Source`,preview:`Preview`,diff:`Diff`},t9={fontFamily:`var(--font-mono)`,fontSize:`var(--text-lg)`,lineHeight:1.6},n9={width:48,minWidth:48,padding:`0 10px`,textAlign:`right`,color:`var(--text-dim)`,background:`var(--bg-panel)`,borderRight:`1px solid var(--border)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,fontStyle:`normal`,fontVariantNumeric:`tabular-nums`,lineHeight:`20.8px`,userSelect:`none`,flexShrink:0,verticalAlign:`top`};function r9(){return(0,E.jsxs)(`svg`,{width:p.xl,height:p.xl,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,E.jsx)(`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`})]})}function i9(e){return(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(`.file-source-line[data-line-number]`)??null}function a9(e,t){if(!t||t.isCollapsed||t.rangeCount===0)return null;let n=t.getRangeAt(0);if(!e.contains(n.startContainer)||!e.contains(n.endContainer))return null;let r=i9(n.startContainer),i=i9(n.endContainer);if(!r||!i||!e.contains(r)||!e.contains(i))return null;let a=Number(r.dataset.lineNumber),o=Number(i.dataset.lineNumber);if(!Number.isInteger(a)||!Number.isInteger(o))return null;if(a<o){let e=r.querySelector(`.file-source-line-content`);if(e?.contains(n.startContainer)){let t=document.createRange();if(t.selectNodeContents(e),t.setStart(n.startContainer,n.startOffset),t.toString().length===0){let e=r.nextElementSibling;e instanceof HTMLElement&&e.matches(`.file-source-line[data-line-number]`)&&(r=e,a=Number(r.dataset.lineNumber))}}let t=i.querySelector(`.file-source-line-content`);if(t?.contains(n.endContainer)){let e=document.createRange();if(e.selectNodeContents(t),e.setEnd(n.endContainer,n.endOffset),e.toString().length===0){let e=i.previousElementSibling;e instanceof HTMLElement&&e.matches(`.file-source-line[data-line-number]`)&&(i=e,o=Number(i.dataset.lineNumber))}}}return a>o?null:{startLine:a,endLine:o}}function o9({rows:e,stylesheet:t,useInlineStyles:n,wrapLines:r}){return e.map((e,i)=>{let a=e.children??[],o=a[0]?.properties?.className,s=Array.isArray(o)&&o.includes(`react-syntax-highlighter-line-number`),c=s?a[0]:null,l=s?a.slice(1):a;return(0,E.jsxs)(`span`,{className:`file-source-line`,"data-line-number":i+1,style:{display:`flex`,minWidth:`100%`},children:[c&&p6({node:c,stylesheet:t,useInlineStyles:n,key:`source-line-number-${i}`}),(0,E.jsx)(`span`,{className:`file-source-line-content`,style:{flex:`1 1 auto`,minWidth:0,overflowWrap:r?`anywhere`:`normal`,whiteSpace:r?`pre-wrap`:`pre`},children:l.map((e,r)=>p6({node:e,stylesheet:t,useInlineStyles:n,key:`source-token-${i}-${r}`}))})]},`source-line-${i}`)})}function s9(e,t,n,r={}){let i=mG(e),a=new URLSearchParams({type:t});n&&a.set(`sessionId`,n);for(let[e,t]of Object.entries(r))t!==void 0&&a.set(e,String(t));return`/api/files/${i}?${a.toString()}`}function c9({filePath:e,sourceSessionId:t}){let{t:n}=N();return(0,E.jsx)(qi,{label:n(`i18n.downloadFile`),children:(0,E.jsx)(`a`,{href:s9(e,`download`,t),download:hG(e),"aria-label":n(`i18n.downloadFile`),className:`file-viewer-icon-button`,children:(0,E.jsxs)(`svg`,{width:p.xl,height:p.xl,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,E.jsx)(`polyline`,{points:`7 10 12 15 17 10`}),(0,E.jsx)(`line`,{x1:`12`,y1:`15`,x2:`12`,y2:`3`})]})})})}function l9(e,t,n){let[r,i]=(0,d.useState)(!1),a=(0,d.useRef)(n);(0,d.useEffect)(()=>{a.current=n});let o=(0,d.useRef)(null);return(0,d.useEffect)(()=>(i(!1),o.current?.(),o.current=dn({ch:`watch`,filePath:e},e=>{e.event===`connected`?i(!0):e.event===`error`?i(!1):a.current(e)}),()=>{o.current?.(),o.current=null}),[e]),{watching:r,closeWatch:(0,d.useCallback)(()=>{o.current?.(),o.current=null,i(!1)},[])}}function u9({filePath:e,cwd:t,extLabel:n,watching:r,sourceSessionId:i,ellipsis:a,children:o}){let{t:s}=N();return(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:`4px 16px`,borderBottom:`1px solid var(--border)`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`,background:`var(--bg)`,flexShrink:0},children:[(0,E.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`,...a?{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`}:{}},title:e,children:_G(e,t)}),(0,E.jsx)(`span`,{style:{marginLeft:`auto`},children:n}),o,(0,E.jsxs)(`span`,{title:s(r?`i18n.liveSync`:`i18n.notWatching`),style:{display:`flex`,alignItems:`center`,gap:4,color:r?`var(--status-success)`:`var(--text-dim)`},children:[(0,E.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:r?`var(--status-success)`:`var(--border)`,display:`inline-block`,boxShadow:r?`0 0 4px var(--status-success)`:`none`}}),r?`live`:`static`]}),(0,E.jsx)(c9,{filePath:e,sourceSessionId:i})]})}function d9(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function f9(e){let t=kZ(e);return t?t.flatMap(e=>e.rows.flatMap(e=>{if(e.type===`hunk`)return[];if(e.left.type===`context`&&e.right.type===`context`)return[{type:`unchanged`,text:e.right.text,oldLineNo:e.left.lineNo,newLineNo:e.right.lineNo}];let t=[];return e.left.type===`removed`&&t.push({type:`removed`,text:e.left.text,oldLineNo:e.left.lineNo,newLineNo:null}),e.right.type===`added`&&t.push({type:`added`,text:e.right.text,oldLineNo:null,newLineNo:e.right.lineNo}),t})):[]}function p9({patch:e}){let{t}=N(),n=f9(e);if(!n.some(e=>e.type!==`unchanged`))return(0,E.jsx)(`div`,{style:{padding:`12px 16px`,fontSize:`var(--text-base)`,color:`var(--text-dim)`,fontFamily:`var(--font-mono)`},children:t(`i18n.noChanges`)});let r=new Set(n.flatMap((e,t)=>e.type===`unchanged`?[]:[t])),i=new Set;for(let e of r)for(let t=Math.max(0,e-3);t<=Math.min(n.length-1,e+3);t++)i.add(t);let a=[],o=0;for(;o<n.length;)if(i.has(o)){let e=[];for(;o<n.length&&i.has(o);)e.push(n[o]),o++;a.push({hidden:!1,lines:e})}else{let e=0;for(;o<n.length&&!i.has(o);)e++,o++;a.push({hidden:!0,count:e})}return(0,E.jsx)(`div`,{className:`file-diff-view`,style:{width:`max-content`,minWidth:`100%`,...t9},children:a.map((e,t)=>{if(e.hidden)return(0,E.jsxs)(`div`,{style:{padding:`2px 16px`,color:`var(--text-dim)`,background:`var(--bg-panel)`,fontSize:`var(--text-sm)`,borderTop:`1px solid var(--border)`,borderBottom:`1px solid var(--border)`},children:[`... `,e.count,` unchanged lines ...`]},t);let n=e.lines.map((e,t)=>{let n=e.type===`added`?`color-mix(in srgb, var(--status-success) 12%, transparent)`:e.type===`removed`?`color-mix(in srgb, var(--status-error) 14%, transparent)`:`transparent`,r=e.type===`added`?`+`:e.type===`removed`?`-`:` `,i=e.type===`added`?`var(--status-success)`:e.type===`removed`?`var(--status-error)`:`var(--text-dim)`;return(0,E.jsxs)(`div`,{className:`file-diff-line`,style:{display:`flex`,minWidth:`100%`,background:n,borderLeft:e.type===`added`?`3px solid var(--status-success)`:e.type===`removed`?`3px solid var(--status-error)`:`3px solid transparent`},children:[(0,E.jsx)(`span`,{style:n9,children:e.type===`removed`?e.oldLineNo:e.newLineNo}),(0,E.jsx)(`span`,{style:{minWidth:16,padding:`0 6px`,color:i,userSelect:`none`,flexShrink:0,fontWeight:600},children:r}),(0,E.jsx)(`span`,{className:`file-diff-line-content`,style:{flexShrink:0,padding:`0 8px 0 0`,whiteSpace:`pre`,color:`var(--text)`},children:e.text||`\xA0`})]},t)});return(0,E.jsx)(`div`,{children:n},t)})})}function m9({filePath:e,cwd:t,sourceSessionId:n}){let[r,i]=(0,d.useState)(0),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(null),f=hG(e).toLowerCase().split(`.`).pop()??``;Wi(()=>{i(0),o(null),c(null),u(null)},[e,n]);let{watching:p}=l9(e,n,e=>{typeof e.size==`number`&&o(e.size),i(e=>e+1)}),m=s9(e,`read`,n,r?{v:r}:void 0),h=a==null?null:d9(a);return(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`},children:[(0,E.jsxs)(u9,{filePath:e,cwd:t,extLabel:f||`image`,watching:p,sourceSessionId:n,children:[s&&(0,E.jsxs)(`span`,{children:[s.w,` × `,s.h]}),h&&(0,E.jsx)(`span`,{children:h})]}),(0,E.jsx)(`div`,{style:{flex:1,overflow:`auto`,backgroundColor:`var(--bg-panel)`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:16,backgroundImage:`linear-gradient(45deg, var(--bg) 25%, transparent 25%), linear-gradient(-45deg, var(--bg) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--bg) 75%), linear-gradient(-45deg, transparent 75%, var(--bg) 75%)`,backgroundSize:`16px 16px`,backgroundPosition:`0 0, 0 8px, 8px -8px, -8px 0px`},children:l?(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:4},children:[(0,E.jsx)(`div`,{style:{color:`var(--status-error)`,fontSize:`var(--text-lg)`},children:l}),(0,E.jsx)(_9,{filePath:e,sourceSessionId:n,cwd:t})]}):(0,E.jsx)(`img`,{src:m,alt:e,onLoad:e=>{let t=e.currentTarget;c({w:t.naturalWidth,h:t.naturalHeight})},onError:()=>u(`Failed to load image`),style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,boxShadow:`0 2px 8px var(--shadow-color)`}})})]})}function h9({filePath:e,cwd:t,sourceSessionId:n}){let[r,i]=(0,d.useState)(0),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(null),f=hG(e).toLowerCase().split(`.`).pop()??``;Wi(()=>{i(0),o(null),c(null),u(null)},[e,n]);let{watching:p}=l9(e,n,e=>{typeof e.size==`number`&&o(e.size),c(null),u(null),i(e=>e+1)}),m=s9(e,`read`,n,r?{v:r}:void 0);return(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`},children:[(0,E.jsxs)(u9,{filePath:e,cwd:t,extLabel:f||`audio`,watching:p,sourceSessionId:n,children:[s!=null&&(0,E.jsx)(`span`,{children:Wt(s)}),a!=null&&(0,E.jsx)(`span`,{children:d9(a)})]}),(0,E.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:24,background:`var(--bg-panel)`},children:(0,E.jsxs)(`div`,{style:{width:`min(680px, 100%)`},children:[l&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`div`,{style:{color:`var(--status-error)`,fontSize:`var(--text-lg)`,marginBottom:12,textAlign:`center`},children:l}),(0,E.jsx)(_9,{filePath:e,sourceSessionId:n,cwd:t})]}),(0,E.jsx)(`audio`,{controls:!0,preload:`metadata`,src:m,onLoadedMetadata:e=>c(e.currentTarget.duration),onError:()=>u(`Failed to load audio`),style:{width:`100%`}},m)]})})]})}function g9({filePath:e,cwd:t,sourceSessionId:n}){let{t:r}=N(),[i,a]=(0,d.useState)(0),[o,s]=(0,d.useState)(null),[c,l]=(0,d.useState)(null),u=G7(e),f=u===`pdf`,p=f?s9(e,`read`,n,i?{v:i}:void 0):s9(e,`preview`,n,i?{v:i}:void 0);(0,d.useEffect)(()=>{a(0),s(null),l(null),fetch(s9(e,`meta`,n)).then(e=>e.json()).then(e=>{e.error&&l(e.error),typeof e.size==`number`&&(s(e.size),!f&&e.size>10485760&&l(r(`files.docTooLargeForPreview`,{limit:d9(V7)})))}).catch(e=>l(String(e)))},[e,f,n,r]);let{watching:m}=l9(e,n,e=>{if(typeof e.size==`number`&&(s(e.size),!f&&e.size>10485760)){l(r(`files.docTooLargeForPreview`,{limit:d9(V7)}));return}l(null),a(e=>e+1)});return(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`},children:[(0,E.jsx)(u9,{filePath:e,cwd:t,extLabel:u===`docx`?`docx preview`:`pdf`,watching:m,sourceSessionId:n,ellipsis:!0,children:o!=null&&(0,E.jsx)(`span`,{children:d9(o)})}),(0,E.jsx)(`div`,{style:{flex:1,minHeight:0,background:`var(--bg-panel)`},children:c?(0,E.jsxs)(`div`,{style:{height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:24,color:`var(--status-error)`,fontSize:`var(--text-lg)`,textAlign:`center`},children:[(0,E.jsx)(`div`,{children:c}),(0,E.jsx)(_9,{filePath:e,sourceSessionId:n,cwd:t})]}):(0,E.jsx)(`iframe`,{src:p,sandbox:f?void 0:`allow-same-origin`,title:r(`i18n.previewFile`,{file:hG(e)}),style:{width:`100%`,height:`100%`,border:`none`,background:f?`var(--bg)`:`#eef1f5`}},p)})]})}function _9({filePath:e,sourceSessionId:t,cwd:n}){let{t:r}=N(),[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(null),c=typeof n==`string`&&/^[a-zA-Z]:[\\/]/.test(n)||typeof n==`string`&&n.startsWith(`\\\\`),l=(0,d.useCallback)(async n=>{a(!0),s(null);try{let i=await fetch(s9(e,`open`,t,n?{chooseApp:1}:void 0),{method:`POST`}),a=await i.json().catch(()=>null);i.ok?s({ok:!0,text:r(`files.openLaunched`)}):s({ok:!1,text:a?.error??`HTTP ${i.status}`})}catch(e){s({ok:!1,text:String(e)})}finally{a(!1)}},[e,t,r]);return(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:10,marginTop:16},children:[o&&(0,E.jsx)(`div`,{style:{color:o.ok?`var(--text-muted)`:`var(--status-error)`,fontSize:`var(--text-sm)`,maxWidth:460,textAlign:`center`,lineHeight:1.5},children:o.text}),(0,E.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,E.jsx)(`button`,{type:`button`,disabled:i,onClick:()=>l(!1),className:`file-viewer-mode-button file-open-action-button`,children:r(`files.openInSystemApp`)}),c&&(0,E.jsx)(`button`,{type:`button`,disabled:i,onClick:()=>l(!0),className:`file-viewer-mode-button file-open-action-button`,children:r(`files.chooseOtherApp`)})]})]})}function v9({filePath:e,cwd:t,sourceSessionId:n,onOpenFile:r,onMentionLines:i,onSaved:a,gitRefreshKey:o,initialDisplayMode:s}){return Y7(e)?(0,E.jsx)(m9,{filePath:e,cwd:t,sourceSessionId:n}):X7(e)?(0,E.jsx)(h9,{filePath:e,cwd:t,sourceSessionId:n}):Z7(e)?(0,E.jsx)(g9,{filePath:e,cwd:t,sourceSessionId:n}):(0,E.jsx)(Lee,{filePath:e,cwd:t,sourceSessionId:n,onOpenFile:r,onMentionLines:i,onSaved:a,gitRefreshKey:o,initialDisplayMode:s})}function Iee({filePath:e,cwd:t,metadata:n,watching:r,isDeletedDiff:i,displayModes:a,effectiveDisplayMode:o,setDisplayMode:s,wrapLines:c,setWrapLines:l,editMode:u,dirty:d,handleSave:f,saveState:m,highlightReady:h,selectedLineRange:g,handleMentionSelectedLines:_,fileContent:v,sourceSessionId:y,t:b,saveError:x,enterEdit:S,cancelEdit:C}){return(0,E.jsxs)(`div`,{className:`file-viewer-toolbar`,style:{display:`flex`,alignItems:`center`,gap:8,padding:`5px 12px`,borderBottom:`1px solid var(--border)`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`,background:`var(--bg)`,flexShrink:0},children:[(0,E.jsx)(qi,{label:e,children:(0,E.jsx)(`span`,{className:`file-viewer-path`,style:{fontFamily:`var(--font-mono)`},children:_G(e,t)})}),(0,E.jsx)(qi,{label:n,children:(0,E.jsx)(`span`,{className:`file-viewer-meta`,children:n})}),!i&&(0,E.jsx)(qi,{label:b(r?`i18n.liveSync`:`i18n.notWatching`),children:(0,E.jsx)(`span`,{"aria-label":b(r?`i18n.liveSync`:`i18n.notWatching`),className:`file-viewer-live-indicator`,style:{background:r?`var(--status-success)`:`var(--border)`,boxShadow:r?`0 0 4px var(--status-success)`:`none`}})}),(0,E.jsxs)(`div`,{className:`file-viewer-controls`,children:[a.length>1&&(0,E.jsx)(`div`,{className:`file-viewer-mode-switch`,"aria-label":b(`i18n.fileViewMode`),children:a.map(e=>{let t=o===e;return(0,E.jsx)(qi,{label:e===`diff`?b(`i18n.compareHead`):void 0,children:(0,E.jsx)(`button`,{type:`button`,onClick:()=>s(e),"aria-pressed":t,className:`file-viewer-mode-button`,style:{background:t?`var(--bg-selected)`:`transparent`,color:t?`var(--text)`:`var(--text-muted)`},children:e9[e]})},e)})}),(0,E.jsxs)(`div`,{className:`file-viewer-actions`,children:[o===`source`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(qi,{label:b(`i18n.mentionSelectedLines`),children:(0,E.jsx)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:_,"aria-label":b(`i18n.mentionSelectedLines`),disabled:!g,className:`file-viewer-icon-button`,children:(0,E.jsx)(r9,{})})}),(0,E.jsx)(qi,{label:b(c?`i18n.disableWrap`:`i18n.enableWrap`),children:(0,E.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),"aria-label":b(c?`i18n.disableWrap`:`i18n.enableWrap`),"aria-pressed":c,className:`file-viewer-icon-button`,style:{background:c?`var(--bg-selected)`:`transparent`,color:c?`var(--text)`:`var(--text-muted)`},children:(0,E.jsxs)(`svg`,{width:p.xl,height:p.xl,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,E.jsx)(`path`,{d:`M4 7V4h16v3`}),(0,E.jsx)(`path`,{d:`M9 20h6`}),(0,E.jsx)(`path`,{d:`M12 4v16`})]})})})]}),o===`source`&&h&&!u&&(0,E.jsx)(`a`,{href:s9(e,`download`,y),download:hG(e),"aria-label":b(`i18n.downloadFile`),className:`file-viewer-icon-button`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,textDecoration:`none`},children:(0,E.jsxs)(`svg`,{width:p.xl,height:p.xl,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,E.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,E.jsx)(`polyline`,{points:`7 10 12 15 17 10`}),(0,E.jsx)(`line`,{x1:`12`,y1:`15`,x2:`12`,y2:`3`})]})}),!i&&o===`source`&&(0,E.jsx)(`div`,{className:`file-viewer-edit-controls`,style:{display:`flex`,alignItems:`center`,gap:8,marginLeft:8},children:u?(0,E.jsxs)(E.Fragment,{children:[d&&(0,E.jsx)(qi,{label:b(`i18n.unsavedChanges`),children:(0,E.jsx)(`span`,{"aria-label":b(`i18n.unsavedChanges`),style:{color:`var(--status-warning)`,fontWeight:700},children:`●`})}),(0,E.jsx)(qi,{label:b(`i18n.saveFileShortcut`),children:(0,E.jsx)(`button`,{type:`button`,onClick:f,disabled:!d||m===`saving`,"aria-label":b(`i18n.saveFile`),className:`file-viewer-icon-button`,style:{background:d?`var(--accent)`:`transparent`,color:d?`var(--bg)`:`var(--text-muted)`},children:m===`saving`?(0,E.jsx)(oi,{size:p.lg,className:`animate-spin`}):(0,E.jsx)(_i,{size:p.lg})})}),(0,E.jsx)(qi,{label:b(`i18n.cancelEdit`),children:(0,E.jsx)(`button`,{type:`button`,onClick:C,"aria-label":b(`i18n.cancelEdit`),className:`file-viewer-icon-button`,children:(0,E.jsx)(Mi,{size:p.lg})})}),m===`error`&&x&&(0,E.jsx)(`span`,{style:{color:`var(--status-error)`,fontSize:`var(--text-sm)`},children:b(`i18n.saveFailed`,{error:x})}),m===`saved`&&!d&&(0,E.jsx)(`span`,{style:{color:`var(--status-success)`,fontSize:`var(--text-sm)`},children:b(`i18n.saved`)})]}):(0,E.jsx)(qi,{label:b(`i18n.editFile`),children:(0,E.jsx)(`button`,{type:`button`,onClick:S,"aria-label":b(`i18n.editFile`),className:`file-viewer-icon-button`,children:(0,E.jsx)(ui,{size:p.lg})})})}),!i&&(0,E.jsx)(c9,{filePath:e,sourceSessionId:y})]})]})]})}function Lee({filePath:e,cwd:t,sourceSessionId:n,onOpenFile:r,onMentionLines:i,onSaved:a,gitRefreshKey:o,initialDisplayMode:s}){let{isDark:c}=Tr(),{t:l}=N(),[u,f]=(0,d.useState)(null),[m,h]=(0,d.useState)(null),[g,_]=(0,d.useState)(!1),[v,y]=(0,d.useState)(!0),[b,x]=(0,d.useState)(null),[S,C]=(0,d.useState)(null),[w,T]=(0,d.useState)(`source`),[D,O]=(0,d.useState)(!1),[k,A]=(0,d.useState)(!1),j=(0,d.useRef)(0),M=(0,d.useRef)(null),[P,ee]=(0,d.useState)(null),[F,I]=(0,d.useState)(!1),[te,ne]=(0,d.useState)(``),[re,ie]=(0,d.useState)(!1),[ae,L]=(0,d.useState)(`idle`),[R,oe]=(0,d.useState)(null),z=(0,d.useRef)(!1);z.current=F;let se=(0,d.useCallback)(e=>fetch(s9(e,`read`,n)).then(async e=>{let t=await e.json();return t.error?(x(t.error),C(e.status),null):(x(null),C(null),f(t),t)}).catch(e=>(x(String(e)),null)),[n]),ce=(0,d.useCallback)(async e=>{let n=++j.current;if(_(!0),!t){h(null),_(!1);return}try{let r=new URLSearchParams({cwd:t,path:e}),i=await fetch(`/api/git/diff?${r.toString()}`),a=await i.json();if(n!==j.current)return;h(i.ok&&a.supported&&typeof a.patch==`string`?a:null)}catch{n===j.current&&h(null)}finally{n===j.current&&_(!1)}},[t]);(0,d.useEffect)(()=>{y(!0),x(null),C(null),f(null),h(null),T(s===`diff`?`diff`:`source`),A(!1),I(!1),ne(``),ie(!1),L(`idle`),oe(null),se(e).finally(()=>y(!1))},[e,se]);let{watching:le,closeWatch:ue}=l9(e,n,()=>{z.current||(se(e),ce(e))});(0,d.useEffect)(()=>{ce(e)},[ce,e,o]),(0,d.useEffect)(()=>{u?.language===`markdown`&&s!==`diff`&&T(`preview`)},[u?.language,s]);let de=m?.supported===!0&&typeof m.patch==`string`,fe=de&&m.status===`deleted`;(0,d.useEffect)(()=>{fe&&ue()},[fe,ue]);let pe=(0,d.useMemo)(()=>u?.language===`markdown`?iG(u.content):``,[u]);(0,d.useEffect)(()=>{let e=()=>{let e=M.current;ee(i&&w===`source`&&e?a9(e,window.getSelection()):null)};if(e(),!(!i||w!==`source`))return document.addEventListener(`selectionchange`,e),()=>document.removeEventListener(`selectionchange`,e)},[u?.content,w,i]);let me=(0,d.useCallback)(n=>{!i||!n||i(_G(e,t),n.startLine,n.endLine)},[t,e,i]),he=(0,d.useCallback)(()=>{me(P)},[me,P]);(0,d.useEffect)(()=>{if(!i||w!==`source`)return;let e=e=>{if(e.repeat||e.key.toLowerCase()!==`i`||!e.metaKey&&!e.ctrlKey||e.altKey||e.shiftKey)return;let t=e.target;if(t instanceof Element&&t.closest(`input, textarea, [contenteditable='true']`))return;let n=M.current,r=n?a9(n,window.getSelection()):null;r&&(e.preventDefault(),me(r))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[w,me,i]);let ge=(0,d.useCallback)(()=>{ne(u?.content??``),ie(!1),L(`idle`),oe(null),I(!0)},[u?.content]),_e=(0,d.useCallback)(()=>{I(!1),ie(!1),L(`idle`),oe(null),se(e)},[e,se]),ve=(0,d.useCallback)(e=>{ne(e),ie(e!==(u?.content??``))},[u?.content]),ye=(0,d.useCallback)(async()=>{if(re){L(`saving`),oe(null);try{await Q7(e,te),f(e=>e&&{...e,content:te}),ie(!1),L(`saved`),a?.(e)}catch(e){L(`error`),oe(e instanceof Error?e.message:String(e))}}},[re,te,e,a]),be=u?.content??``;if((0,d.useEffect)(()=>{O(!1)},[be]),(0,d.useEffect)(()=>{if((fe?`diff`:w)!==`source`||D)return;let e=setTimeout(()=>O(!0),0);return()=>clearTimeout(e)},[fe,w,D]),v||w===`diff`&&g)return(0,E.jsxs)(`div`,{style:{height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12,color:`var(--text-muted)`,fontSize:`var(--text-lg)`},children:[(0,E.jsx)(oi,{size:p.lg,className:`animate-spin`,"aria-hidden":`true`}),l(`i18n.loading`)]});if(b&&!fe)return(0,E.jsxs)(`div`,{style:{height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:24,color:`var(--status-error)`,fontSize:`var(--text-lg)`,textAlign:`center`},children:[(0,E.jsx)(`div`,{children:S===413?l(`files.fileTooLargeForPreview`,{limit:d9(B7)}):b}),S===413&&(0,E.jsx)(_9,{filePath:e,sourceSessionId:n,cwd:t})]});if(!u&&!fe)return null;let xe=u?.language??`text`,Se=xe===`html`,Ce=xe===`markdown`,we=Se||Ce,Te=gG(e),Ee=be.split(`
495
+ `)}),n.length>0&&(0,E.jsx)(`div`,{"data-testid":`widget-bound-messages`,style:{display:`flex`,flexWrap:`wrap`,gap:6,paddingTop:8,borderTop:`1px solid var(--border)`,flexShrink:0},children:n.map((t,n)=>(0,E.jsx)(hY,{msg:t,onSend:o,onFillInput:s,testId:`widget-send-${e.key}-${n}`},n))})]})}),m&&(0,E.jsx)(`div`,{"data-testid":`widget-collapse-trail`,style:{position:`fixed`,inset:0,zIndex:70,pointerEvents:`none`},children:(0,E.jsx)(`svg`,{width:`100%`,height:`100%`,style:{position:`absolute`,inset:0},children:(0,E.jsx)(`circle`,{ref:g,r:28,fill:`var(--accent)`,fillOpacity:.7})})})]})}var B7=262144,V7=10485760,H7={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,svg:`image/svg+xml`,bmp:`image/bmp`,ico:`image/x-icon`,avif:`image/avif`},U7={mp3:`audio/mpeg`,wav:`audio/wav`,ogg:`audio/ogg`,oga:`audio/ogg`,opus:`audio/ogg`,m4a:`audio/mp4`,aac:`audio/aac`,flac:`audio/flac`,weba:`audio/webm`,webm:`audio/webm`};function W7(e){return e.replace(/\\/g,`/`).split(`/`).pop()??``}function G7(e){return W7(e).toLowerCase().split(`.`).pop()??``}function K7(e){return H7[G7(e)]??null}function q7(e){return U7[G7(e)]??null}function J7(e){let t=G7(e);return t===`pdf`||t===`docx`?t:null}function Y7(e){return K7(e)!==null}function X7(e){return q7(e)!==null}function Z7(e){return J7(e)!==null}async function Q7(e,t){let n=e.split(/[\\/]/).filter(Boolean),r=n.pop();if(!r)throw Error(`Invalid file path`);let i=n.join(`/`)||`/`,a=new FormData;a.append(`files`,new File([t],r,{type:`text/plain`}));let o=await fetch(`/api/files/${mG(i)}?type=upload&conflict=overwrite`,{method:`POST`,body:a});if(!o.ok){let e=`Save failed (${o.status})`;try{let t=await o.json();t?.error&&(e=t.error)}catch{}throw Error(e)}}var $7=(0,d.lazy)(()=>l0(()=>import(`./CodeMirrorEditor-D38J6Jjv.js`),__vite__mapDeps([20,1]))),e9={source:`Source`,preview:`Preview`,diff:`Diff`},t9={fontFamily:`var(--font-mono)`,fontSize:`var(--text-lg)`,lineHeight:1.6},n9={width:48,minWidth:48,padding:`0 10px`,textAlign:`right`,color:`var(--text-dim)`,background:`var(--bg-panel)`,borderRight:`1px solid var(--border)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,fontStyle:`normal`,fontVariantNumeric:`tabular-nums`,lineHeight:`20.8px`,userSelect:`none`,flexShrink:0,verticalAlign:`top`};function r9(){return(0,E.jsxs)(`svg`,{width:p.xl,height:p.xl,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,E.jsx)(`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`})]})}function i9(e){return(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(`.file-source-line[data-line-number]`)??null}function a9(e,t){if(!t||t.isCollapsed||t.rangeCount===0)return null;let n=t.getRangeAt(0);if(!e.contains(n.startContainer)||!e.contains(n.endContainer))return null;let r=i9(n.startContainer),i=i9(n.endContainer);if(!r||!i||!e.contains(r)||!e.contains(i))return null;let a=Number(r.dataset.lineNumber),o=Number(i.dataset.lineNumber);if(!Number.isInteger(a)||!Number.isInteger(o))return null;if(a<o){let e=r.querySelector(`.file-source-line-content`);if(e?.contains(n.startContainer)){let t=document.createRange();if(t.selectNodeContents(e),t.setStart(n.startContainer,n.startOffset),t.toString().length===0){let e=r.nextElementSibling;e instanceof HTMLElement&&e.matches(`.file-source-line[data-line-number]`)&&(r=e,a=Number(r.dataset.lineNumber))}}let t=i.querySelector(`.file-source-line-content`);if(t?.contains(n.endContainer)){let e=document.createRange();if(e.selectNodeContents(t),e.setEnd(n.endContainer,n.endOffset),e.toString().length===0){let e=i.previousElementSibling;e instanceof HTMLElement&&e.matches(`.file-source-line[data-line-number]`)&&(i=e,o=Number(i.dataset.lineNumber))}}}return a>o?null:{startLine:a,endLine:o}}function o9({rows:e,stylesheet:t,useInlineStyles:n,wrapLines:r}){return e.map((e,i)=>{let a=e.children??[],o=a[0]?.properties?.className,s=Array.isArray(o)&&o.includes(`react-syntax-highlighter-line-number`),c=s?a[0]:null,l=s?a.slice(1):a;return(0,E.jsxs)(`span`,{className:`file-source-line`,"data-line-number":i+1,style:{display:`flex`,minWidth:`100%`},children:[c&&p6({node:c,stylesheet:t,useInlineStyles:n,key:`source-line-number-${i}`}),(0,E.jsx)(`span`,{className:`file-source-line-content`,style:{flex:`1 1 auto`,minWidth:0,overflowWrap:r?`anywhere`:`normal`,whiteSpace:r?`pre-wrap`:`pre`},children:l.map((e,r)=>p6({node:e,stylesheet:t,useInlineStyles:n,key:`source-token-${i}-${r}`}))})]},`source-line-${i}`)})}function s9(e,t,n,r={}){let i=mG(e),a=new URLSearchParams({type:t});n&&a.set(`sessionId`,n);for(let[e,t]of Object.entries(r))t!==void 0&&a.set(e,String(t));return`/api/files/${i}?${a.toString()}`}function c9({filePath:e,sourceSessionId:t}){let{t:n}=N();return(0,E.jsx)(qi,{label:n(`i18n.downloadFile`),children:(0,E.jsx)(`a`,{href:s9(e,`download`,t),download:hG(e),"aria-label":n(`i18n.downloadFile`),className:`file-viewer-icon-button`,children:(0,E.jsxs)(`svg`,{width:p.xl,height:p.xl,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,E.jsx)(`polyline`,{points:`7 10 12 15 17 10`}),(0,E.jsx)(`line`,{x1:`12`,y1:`15`,x2:`12`,y2:`3`})]})})})}function l9(e,t,n){let[r,i]=(0,d.useState)(!1),a=(0,d.useRef)(n);(0,d.useEffect)(()=>{a.current=n});let o=(0,d.useRef)(null);return(0,d.useEffect)(()=>(i(!1),o.current?.(),o.current=dn({ch:`watch`,filePath:e},e=>{e.event===`connected`?i(!0):e.event===`error`?i(!1):a.current(e)}),()=>{o.current?.(),o.current=null}),[e]),{watching:r,closeWatch:(0,d.useCallback)(()=>{o.current?.(),o.current=null,i(!1)},[])}}function u9({filePath:e,cwd:t,extLabel:n,watching:r,sourceSessionId:i,ellipsis:a,children:o}){let{t:s}=N();return(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:`4px 16px`,borderBottom:`1px solid var(--border)`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`,background:`var(--bg)`,flexShrink:0},children:[(0,E.jsx)(`span`,{style:{fontFamily:`var(--font-mono)`,...a?{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`}:{}},title:e,children:_G(e,t)}),(0,E.jsx)(`span`,{style:{marginLeft:`auto`},children:n}),o,(0,E.jsxs)(`span`,{title:s(r?`i18n.liveSync`:`i18n.notWatching`),style:{display:`flex`,alignItems:`center`,gap:4,color:r?`var(--status-success)`:`var(--text-dim)`},children:[(0,E.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:r?`var(--status-success)`:`var(--border)`,display:`inline-block`,boxShadow:r?`0 0 4px var(--status-success)`:`none`}}),r?`live`:`static`]}),(0,E.jsx)(c9,{filePath:e,sourceSessionId:i})]})}function d9(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function f9(e){let t=kZ(e);return t?t.flatMap(e=>e.rows.flatMap(e=>{if(e.type===`hunk`)return[];if(e.left.type===`context`&&e.right.type===`context`)return[{type:`unchanged`,text:e.right.text,oldLineNo:e.left.lineNo,newLineNo:e.right.lineNo}];let t=[];return e.left.type===`removed`&&t.push({type:`removed`,text:e.left.text,oldLineNo:e.left.lineNo,newLineNo:null}),e.right.type===`added`&&t.push({type:`added`,text:e.right.text,oldLineNo:null,newLineNo:e.right.lineNo}),t})):[]}function p9({patch:e}){let{t}=N(),n=f9(e);if(!n.some(e=>e.type!==`unchanged`))return(0,E.jsx)(`div`,{style:{padding:`12px 16px`,fontSize:`var(--text-base)`,color:`var(--text-dim)`,fontFamily:`var(--font-mono)`},children:t(`i18n.noChanges`)});let r=new Set(n.flatMap((e,t)=>e.type===`unchanged`?[]:[t])),i=new Set;for(let e of r)for(let t=Math.max(0,e-3);t<=Math.min(n.length-1,e+3);t++)i.add(t);let a=[],o=0;for(;o<n.length;)if(i.has(o)){let e=[];for(;o<n.length&&i.has(o);)e.push(n[o]),o++;a.push({hidden:!1,lines:e})}else{let e=0;for(;o<n.length&&!i.has(o);)e++,o++;a.push({hidden:!0,count:e})}return(0,E.jsx)(`div`,{className:`file-diff-view`,style:{width:`max-content`,minWidth:`100%`,...t9},children:a.map((e,t)=>{if(e.hidden)return(0,E.jsxs)(`div`,{style:{padding:`2px 16px`,color:`var(--text-dim)`,background:`var(--bg-panel)`,fontSize:`var(--text-sm)`,borderTop:`1px solid var(--border)`,borderBottom:`1px solid var(--border)`},children:[`... `,e.count,` unchanged lines ...`]},t);let n=e.lines.map((e,t)=>{let n=e.type===`added`?`color-mix(in srgb, var(--status-success) 12%, transparent)`:e.type===`removed`?`color-mix(in srgb, var(--status-error) 14%, transparent)`:`transparent`,r=e.type===`added`?`+`:e.type===`removed`?`-`:` `,i=e.type===`added`?`var(--status-success)`:e.type===`removed`?`var(--status-error)`:`var(--text-dim)`;return(0,E.jsxs)(`div`,{className:`file-diff-line`,style:{display:`flex`,minWidth:`100%`,background:n,borderLeft:e.type===`added`?`3px solid var(--status-success)`:e.type===`removed`?`3px solid var(--status-error)`:`3px solid transparent`},children:[(0,E.jsx)(`span`,{style:n9,children:e.type===`removed`?e.oldLineNo:e.newLineNo}),(0,E.jsx)(`span`,{style:{minWidth:16,padding:`0 6px`,color:i,userSelect:`none`,flexShrink:0,fontWeight:600},children:r}),(0,E.jsx)(`span`,{className:`file-diff-line-content`,style:{flexShrink:0,padding:`0 8px 0 0`,whiteSpace:`pre`,color:`var(--text)`},children:e.text||`\xA0`})]},t)});return(0,E.jsx)(`div`,{children:n},t)})})}function m9({filePath:e,cwd:t,sourceSessionId:n}){let[r,i]=(0,d.useState)(0),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(null),f=hG(e).toLowerCase().split(`.`).pop()??``;Wi(()=>{i(0),o(null),c(null),u(null)},[e,n]);let{watching:p}=l9(e,n,e=>{typeof e.size==`number`&&o(e.size),i(e=>e+1)}),m=s9(e,`read`,n,r?{v:r}:void 0),h=a==null?null:d9(a);return(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`},children:[(0,E.jsxs)(u9,{filePath:e,cwd:t,extLabel:f||`image`,watching:p,sourceSessionId:n,children:[s&&(0,E.jsxs)(`span`,{children:[s.w,` × `,s.h]}),h&&(0,E.jsx)(`span`,{children:h})]}),(0,E.jsx)(`div`,{style:{flex:1,overflow:`auto`,backgroundColor:`var(--bg-panel)`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:16,backgroundImage:`linear-gradient(45deg, var(--bg) 25%, transparent 25%), linear-gradient(-45deg, var(--bg) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--bg) 75%), linear-gradient(-45deg, transparent 75%, var(--bg) 75%)`,backgroundSize:`16px 16px`,backgroundPosition:`0 0, 0 8px, 8px -8px, -8px 0px`},children:l?(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:4},children:[(0,E.jsx)(`div`,{style:{color:`var(--status-error)`,fontSize:`var(--text-lg)`},children:l}),(0,E.jsx)(_9,{filePath:e,sourceSessionId:n,cwd:t})]}):(0,E.jsx)(`img`,{src:m,alt:e,onLoad:e=>{let t=e.currentTarget;c({w:t.naturalWidth,h:t.naturalHeight})},onError:()=>u(`Failed to load image`),style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,boxShadow:`0 2px 8px var(--shadow-color)`}})})]})}function h9({filePath:e,cwd:t,sourceSessionId:n}){let[r,i]=(0,d.useState)(0),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(null),f=hG(e).toLowerCase().split(`.`).pop()??``;Wi(()=>{i(0),o(null),c(null),u(null)},[e,n]);let{watching:p}=l9(e,n,e=>{typeof e.size==`number`&&o(e.size),c(null),u(null),i(e=>e+1)}),m=s9(e,`read`,n,r?{v:r}:void 0);return(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`},children:[(0,E.jsxs)(u9,{filePath:e,cwd:t,extLabel:f||`audio`,watching:p,sourceSessionId:n,children:[s!=null&&(0,E.jsx)(`span`,{children:Wt(s)}),a!=null&&(0,E.jsx)(`span`,{children:d9(a)})]}),(0,E.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:24,background:`var(--bg-panel)`},children:(0,E.jsxs)(`div`,{style:{width:`min(680px, 100%)`},children:[l&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`div`,{style:{color:`var(--status-error)`,fontSize:`var(--text-lg)`,marginBottom:12,textAlign:`center`},children:l}),(0,E.jsx)(_9,{filePath:e,sourceSessionId:n,cwd:t})]}),(0,E.jsx)(`audio`,{controls:!0,preload:`metadata`,src:m,onLoadedMetadata:e=>c(e.currentTarget.duration),onError:()=>u(`Failed to load audio`),style:{width:`100%`}},m)]})})]})}function g9({filePath:e,cwd:t,sourceSessionId:n}){let{t:r}=N(),[i,a]=(0,d.useState)(0),[o,s]=(0,d.useState)(null),[c,l]=(0,d.useState)(null),u=G7(e),f=u===`pdf`,p=f?s9(e,`read`,n,i?{v:i}:void 0):s9(e,`preview`,n,i?{v:i}:void 0);(0,d.useEffect)(()=>{a(0),s(null),l(null),fetch(s9(e,`meta`,n)).then(e=>e.json()).then(e=>{e.error&&l(e.error),typeof e.size==`number`&&(s(e.size),!f&&e.size>10485760&&l(r(`files.docTooLargeForPreview`,{limit:d9(V7)})))}).catch(e=>l(String(e)))},[e,f,n,r]);let{watching:m}=l9(e,n,e=>{if(typeof e.size==`number`&&(s(e.size),!f&&e.size>10485760)){l(r(`files.docTooLargeForPreview`,{limit:d9(V7)}));return}l(null),a(e=>e+1)});return(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`},children:[(0,E.jsx)(u9,{filePath:e,cwd:t,extLabel:u===`docx`?`docx preview`:`pdf`,watching:m,sourceSessionId:n,ellipsis:!0,children:o!=null&&(0,E.jsx)(`span`,{children:d9(o)})}),(0,E.jsx)(`div`,{style:{flex:1,minHeight:0,background:`var(--bg-panel)`},children:c?(0,E.jsxs)(`div`,{style:{height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:24,color:`var(--status-error)`,fontSize:`var(--text-lg)`,textAlign:`center`},children:[(0,E.jsx)(`div`,{children:c}),(0,E.jsx)(_9,{filePath:e,sourceSessionId:n,cwd:t})]}):(0,E.jsx)(`iframe`,{src:p,sandbox:f?void 0:`allow-same-origin`,title:r(`i18n.previewFile`,{file:hG(e)}),style:{width:`100%`,height:`100%`,border:`none`,background:f?`var(--bg)`:`#eef1f5`}},p)})]})}function _9({filePath:e,sourceSessionId:t,cwd:n}){let{t:r}=N(),[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(null),c=typeof n==`string`&&/^[a-zA-Z]:[\\/]/.test(n)||typeof n==`string`&&n.startsWith(`\\\\`),l=(0,d.useCallback)(async n=>{a(!0),s(null);try{let i=await fetch(s9(e,`open`,t,n?{chooseApp:1}:void 0),{method:`POST`}),a=await i.json().catch(()=>null);i.ok?s({ok:!0,text:r(`files.openLaunched`)}):s({ok:!1,text:a?.error??`HTTP ${i.status}`})}catch(e){s({ok:!1,text:String(e)})}finally{a(!1)}},[e,t,r]);return(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:10,marginTop:16},children:[o&&(0,E.jsx)(`div`,{style:{color:o.ok?`var(--text-muted)`:`var(--status-error)`,fontSize:`var(--text-sm)`,maxWidth:460,textAlign:`center`,lineHeight:1.5},children:o.text}),(0,E.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,E.jsx)(`button`,{type:`button`,disabled:i,onClick:()=>l(!1),className:`file-viewer-mode-button file-open-action-button`,children:r(`files.openInSystemApp`)}),c&&(0,E.jsx)(`button`,{type:`button`,disabled:i,onClick:()=>l(!0),className:`file-viewer-mode-button file-open-action-button`,children:r(`files.chooseOtherApp`)})]})]})}function v9({filePath:e,cwd:t,sourceSessionId:n,onOpenFile:r,onMentionLines:i,onSaved:a,gitRefreshKey:o,initialDisplayMode:s}){return Y7(e)?(0,E.jsx)(m9,{filePath:e,cwd:t,sourceSessionId:n}):X7(e)?(0,E.jsx)(h9,{filePath:e,cwd:t,sourceSessionId:n}):Z7(e)?(0,E.jsx)(g9,{filePath:e,cwd:t,sourceSessionId:n}):(0,E.jsx)(Lee,{filePath:e,cwd:t,sourceSessionId:n,onOpenFile:r,onMentionLines:i,onSaved:a,gitRefreshKey:o,initialDisplayMode:s})}function Iee({filePath:e,cwd:t,metadata:n,watching:r,isDeletedDiff:i,displayModes:a,effectiveDisplayMode:o,setDisplayMode:s,wrapLines:c,setWrapLines:l,editMode:u,dirty:d,handleSave:f,saveState:m,highlightReady:h,selectedLineRange:g,handleMentionSelectedLines:_,fileContent:v,sourceSessionId:y,t:b,saveError:x,enterEdit:S,cancelEdit:C}){return(0,E.jsxs)(`div`,{className:`file-viewer-toolbar`,style:{display:`flex`,alignItems:`center`,gap:8,padding:`5px 12px`,borderBottom:`1px solid var(--border)`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`,background:`var(--bg)`,flexShrink:0},children:[(0,E.jsx)(qi,{label:e,children:(0,E.jsx)(`span`,{className:`file-viewer-path`,style:{fontFamily:`var(--font-mono)`},children:_G(e,t)})}),(0,E.jsx)(qi,{label:n,children:(0,E.jsx)(`span`,{className:`file-viewer-meta`,children:n})}),!i&&(0,E.jsx)(qi,{label:b(r?`i18n.liveSync`:`i18n.notWatching`),children:(0,E.jsx)(`span`,{"aria-label":b(r?`i18n.liveSync`:`i18n.notWatching`),className:`file-viewer-live-indicator`,style:{background:r?`var(--status-success)`:`var(--border)`,boxShadow:r?`0 0 4px var(--status-success)`:`none`}})}),(0,E.jsxs)(`div`,{className:`file-viewer-controls`,children:[a.length>1&&(0,E.jsx)(`div`,{className:`file-viewer-mode-switch`,"aria-label":b(`i18n.fileViewMode`),children:a.map(e=>{let t=o===e;return(0,E.jsx)(qi,{label:e===`diff`?b(`i18n.compareHead`):void 0,children:(0,E.jsx)(`button`,{type:`button`,onClick:()=>s(e),"aria-pressed":t,className:`file-viewer-mode-button`,style:{background:t?`var(--bg-selected)`:`transparent`,color:t?`var(--text)`:`var(--text-muted)`},children:e9[e]})},e)})}),(0,E.jsxs)(`div`,{className:`file-viewer-actions`,children:[o===`source`&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(qi,{label:b(`i18n.mentionSelectedLines`),children:(0,E.jsx)(`button`,{type:`button`,onMouseDown:e=>e.preventDefault(),onClick:_,"aria-label":b(`i18n.mentionSelectedLines`),disabled:!g,className:`file-viewer-icon-button`,children:(0,E.jsx)(r9,{})})}),(0,E.jsx)(qi,{label:b(c?`i18n.disableWrap`:`i18n.enableWrap`),children:(0,E.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),"aria-label":b(c?`i18n.disableWrap`:`i18n.enableWrap`),"aria-pressed":c,className:`file-viewer-icon-button`,style:{background:c?`var(--bg-selected)`:`transparent`,color:c?`var(--text)`:`var(--text-muted)`},children:(0,E.jsxs)(`svg`,{width:p.xl,height:p.xl,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,E.jsx)(`path`,{d:`M4 7V4h16v3`}),(0,E.jsx)(`path`,{d:`M9 20h6`}),(0,E.jsx)(`path`,{d:`M12 4v16`})]})})})]}),o===`source`&&h&&!u&&(0,E.jsx)(`a`,{href:s9(e,`download`,y),download:hG(e),"aria-label":b(`i18n.downloadFile`),className:`file-viewer-icon-button`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,textDecoration:`none`},children:(0,E.jsxs)(`svg`,{width:p.xl,height:p.xl,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,E.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,E.jsx)(`polyline`,{points:`7 10 12 15 17 10`}),(0,E.jsx)(`line`,{x1:`12`,y1:`15`,x2:`12`,y2:`3`})]})}),!i&&o===`source`&&(0,E.jsx)(`div`,{className:`file-viewer-edit-controls`,style:{display:`flex`,alignItems:`center`,gap:8,marginLeft:8},children:u?(0,E.jsxs)(E.Fragment,{children:[d&&(0,E.jsx)(qi,{label:b(`i18n.unsavedChanges`),children:(0,E.jsx)(`span`,{"aria-label":b(`i18n.unsavedChanges`),style:{color:`var(--status-warning)`,fontWeight:700},children:`●`})}),(0,E.jsx)(qi,{label:b(`i18n.saveFileShortcut`),children:(0,E.jsx)(`button`,{type:`button`,onClick:f,disabled:!d||m===`saving`,"aria-label":b(`i18n.saveFile`),className:`file-viewer-icon-button`,style:{background:d?`var(--accent)`:`transparent`,color:d?`var(--bg)`:`var(--text-muted)`},children:m===`saving`?(0,E.jsx)(oi,{size:p.lg,className:`animate-spin`}):(0,E.jsx)(_i,{size:p.lg})})}),(0,E.jsx)(qi,{label:b(`i18n.cancelEdit`),children:(0,E.jsx)(`button`,{type:`button`,onClick:C,"aria-label":b(`i18n.cancelEdit`),className:`file-viewer-icon-button`,children:(0,E.jsx)(Mi,{size:p.lg})})}),m===`error`&&x&&(0,E.jsx)(`span`,{style:{color:`var(--status-error)`,fontSize:`var(--text-sm)`},children:b(`i18n.saveFailed`,{error:x})}),m===`saved`&&!d&&(0,E.jsx)(`span`,{style:{color:`var(--status-success)`,fontSize:`var(--text-sm)`},children:b(`i18n.saved`)})]}):(0,E.jsx)(qi,{label:b(`i18n.editFile`),children:(0,E.jsx)(`button`,{type:`button`,onClick:S,"aria-label":b(`i18n.editFile`),className:`file-viewer-icon-button`,children:(0,E.jsx)(ui,{size:p.lg})})})}),!i&&(0,E.jsx)(c9,{filePath:e,sourceSessionId:y})]})]})]})}function Lee({filePath:e,cwd:t,sourceSessionId:n,onOpenFile:r,onMentionLines:i,onSaved:a,gitRefreshKey:o,initialDisplayMode:s}){let{isDark:c}=Tr(),{t:l}=N(),[u,f]=(0,d.useState)(null),[m,h]=(0,d.useState)(null),[g,_]=(0,d.useState)(!1),[v,y]=(0,d.useState)(!0),[b,x]=(0,d.useState)(null),[S,C]=(0,d.useState)(null),[w,T]=(0,d.useState)(`source`),[D,O]=(0,d.useState)(!1),[k,A]=(0,d.useState)(!1),j=(0,d.useRef)(0),M=(0,d.useRef)(null),[P,ee]=(0,d.useState)(null),[F,I]=(0,d.useState)(!1),[te,ne]=(0,d.useState)(``),[re,ie]=(0,d.useState)(!1),[ae,L]=(0,d.useState)(`idle`),[R,oe]=(0,d.useState)(null),z=(0,d.useRef)(!1);z.current=F;let se=(0,d.useCallback)(e=>fetch(s9(e,`read`,n)).then(async e=>{let t=await e.json();return t.error?(x(t.error),C(e.status),null):(x(null),C(null),f(t),t)}).catch(e=>(x(String(e)),null)),[n]),ce=(0,d.useCallback)(async e=>{let n=++j.current;if(_(!0),!t){h(null),_(!1);return}try{let r=new URLSearchParams({cwd:t,path:e}),i=await fetch(`/api/git/diff?${r.toString()}`),a=await i.json();if(n!==j.current)return;h(i.ok&&a.supported&&typeof a.patch==`string`?a:null)}catch{n===j.current&&h(null)}finally{n===j.current&&_(!1)}},[t]);(0,d.useEffect)(()=>{y(!0),x(null),C(null),f(null),h(null),T(s===`diff`?`diff`:`source`),A(!1),I(!1),ne(``),ie(!1),L(`idle`),oe(null),se(e).finally(()=>y(!1))},[e,se]);let{watching:le,closeWatch:ue}=l9(e,n,()=>{z.current||(se(e),ce(e))});(0,d.useEffect)(()=>{ce(e)},[ce,e,o]),(0,d.useEffect)(()=>{u?.language===`markdown`&&s!==`diff`&&T(`preview`)},[u?.language,s]);let de=m?.supported===!0&&typeof m.patch==`string`,fe=de&&m.status===`deleted`;(0,d.useEffect)(()=>{fe&&ue()},[fe,ue]);let pe=(0,d.useMemo)(()=>u?.language===`markdown`?iG(u.content):``,[u]);(0,d.useEffect)(()=>{let e=()=>{let e=M.current;ee(i&&w===`source`&&e?a9(e,window.getSelection()):null)};if(e(),!(!i||w!==`source`))return document.addEventListener(`selectionchange`,e),()=>document.removeEventListener(`selectionchange`,e)},[u?.content,w,i]);let me=(0,d.useCallback)(n=>{!i||!n||i(_G(e,t),n.startLine,n.endLine)},[t,e,i]),he=(0,d.useCallback)(()=>{me(P)},[me,P]);(0,d.useEffect)(()=>{if(!i||w!==`source`)return;let e=e=>{if(e.repeat||e.key.toLowerCase()!==`i`||!e.metaKey&&!e.ctrlKey||e.altKey||e.shiftKey)return;let t=e.target;if(t instanceof Element&&t.closest(`input, textarea, [contenteditable='true']`))return;let n=M.current,r=n?a9(n,window.getSelection()):null;r&&(e.preventDefault(),me(r))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[w,me,i]);let ge=(0,d.useCallback)(()=>{ne(u?.content??``),ie(!1),L(`idle`),oe(null),I(!0)},[u?.content]),_e=(0,d.useCallback)(()=>{I(!1),ie(!1),L(`idle`),oe(null),se(e)},[e,se]),ve=(0,d.useCallback)(e=>{ne(e),ie(e!==(u?.content??``))},[u?.content]),ye=(0,d.useCallback)(async()=>{if(re){L(`saving`),oe(null);try{await Q7(e,te),f(e=>e&&{...e,content:te}),ie(!1),L(`saved`),a?.(e)}catch(e){L(`error`),oe(e instanceof Error?e.message:String(e))}}},[re,te,e,a]),be=u?.content??``;if((0,d.useEffect)(()=>{O(!1)},[be]),(0,d.useEffect)(()=>{if((fe?`diff`:w)!==`source`||D)return;let e=setTimeout(()=>O(!0),0);return()=>clearTimeout(e)},[fe,w,D]),v||w===`diff`&&g)return(0,E.jsxs)(`div`,{style:{height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12,color:`var(--text-muted)`,fontSize:`var(--text-lg)`},children:[(0,E.jsx)(oi,{size:p.lg,className:`animate-spin`,"aria-hidden":`true`}),l(`i18n.loading`)]});if(b&&!fe)return(0,E.jsxs)(`div`,{style:{height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:24,color:`var(--status-error)`,fontSize:`var(--text-lg)`,textAlign:`center`},children:[(0,E.jsx)(`div`,{children:S===413?l(`files.fileTooLargeForPreview`,{limit:d9(B7)}):b}),S===413&&(0,E.jsx)(_9,{filePath:e,sourceSessionId:n,cwd:t})]});if(!u&&!fe)return null;let xe=u?.language??`text`,Se=xe===`html`,Ce=xe===`markdown`,we=Se||Ce,Te=gG(e),Ee=be.split(`
496
496
  `),De=fe?`diff`:w,Oe=fe?[`diff`]:[`source`,...we?[`preview`]:[],`diff`],ke=fe?l(`files.deleted`):`${xe} · ${Ee.length} lines · ${d9(u.size)}`;return(0,E.jsxs)(`div`,{className:`file-viewer-shell`,style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`},children:[(0,E.jsx)(Iee,{filePath:e,cwd:t,metadata:ke,watching:le,isDeletedDiff:fe,displayModes:Oe,effectiveDisplayMode:De,setDisplayMode:T,wrapLines:k,setWrapLines:A,editMode:F,dirty:re,handleSave:ye,saveState:ae,saveError:R,enterEdit:ge,cancelEdit:_e,highlightReady:D,selectedLineRange:P,handleMentionSelectedLines:he,fileContent:be,sourceSessionId:n,t:l}),(0,E.jsxs)(`div`,{ref:M,className:`file-viewer-content`,style:{flex:1,overflow:`auto`,paddingRight:4,background:`var(--bg)`},children:[De===`source`&&(0,E.jsx)(`div`,{className:`file-viewer-source`,style:{display:`block`,height:`100%`,overflow:`auto`,background:`var(--bg)`},children:F?(0,E.jsx)(d.Suspense,{fallback:(0,E.jsx)(`div`,{style:{height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`var(--text-muted)`},children:(0,E.jsx)(oi,{size:p.lg,className:`animate-spin`,"aria-hidden":`true`})}),children:(0,E.jsx)($7,{initialValue:te,language:xe,isDark:c,onChange:ve,onSave:ye},e)}):D?(0,E.jsx)(l8,{className:k?`file-source-view is-wrapped`:`file-source-view`,language:xe===`text`?`plaintext`:xe,style:c?N8:M8,showLineNumbers:!0,lineNumberStyle:{...n9},customStyle:{margin:0,padding:0,border:0,background:`var(--bg)`,...t9,width:k?`100%`:`max-content`,minWidth:`100%`,minHeight:`100%`,overflow:`visible`},codeTagProps:{style:{fontFamily:`var(--font-mono)`,overflowWrap:k?`anywhere`:`normal`}},renderer:e=>(0,E.jsx)(o9,{...e,wrapLines:k}),wrapLongLines:k,children:be}):(0,E.jsx)(`pre`,{className:k?`file-source-view is-wrapped`:`file-source-view`,style:{margin:0,padding:0,border:0,background:`var(--bg)`,...t9,fontFamily:`var(--font-mono)`,whiteSpace:k?`pre-wrap`:`pre`,overflowWrap:k?`anywhere`:`normal`,width:k?`100%`:`max-content`,minWidth:`100%`,minHeight:`100%`,overflow:`visible`},children:be})}),De===`diff`&&de?(0,E.jsx)(p9,{patch:m.patch}):De===`diff`?(0,E.jsx)(`div`,{style:{height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`var(--text-muted)`,fontSize:`var(--text-lg)`},children:l(`i18n.noChanges`)}):Se&&De===`preview`?(0,E.jsx)(`iframe`,{srcDoc:be,sandbox:`allow-scripts`,style:{width:`100%`,height:`100%`,border:`none`,background:`var(--bg)`},title:l(`i18n.htmlPreview`)}):Ce&&De===`preview`?(0,E.jsx)(`div`,{className:`markdown-body markdown-file-preview`,style:{padding:`24px 32px`},children:(0,E.jsx)(Vk,{remarkPlugins:lG,rehypePlugins:dG,components:{code({className:e,children:t,...n}){let r=e?.replace(`language-`,``).toLowerCase()??``,i=String(t);return e?.includes(`language-`)||i.includes(`
497
497
  `)?r===`mermaid`?(0,E.jsx)(R8,{code:i.replace(/\n$/,``),defaultPreview:!0}):(0,E.jsx)(H8,{code:i.replace(/\n$/,``),lang:r}):(0,E.jsx)(`code`,{className:e,...n,children:t})},pre({children:e}){return(0,E.jsx)(E.Fragment,{children:e})},a({href:e,children:t,...n}){return delete n.node,(0,E.jsx)(BG,{href:e,markdownDir:Te,onOpenFile:r,...n,children:t})},img({src:e,alt:r,...i}){delete i.node;let a=typeof e==`string`?RG(e,Te,t??Te):null,o=a?s9(a,`read`,n):e;return(0,E.jsx)(`img`,{src:o,alt:r??``,loading:`lazy`,...i})}},children:pe})}):null]})]})}function Ree({cwd:e,busy:t,error:n,onCancel:r,onConfirm:i}){let{t:a}=N();return(0,E.jsx)(jS,{open:!0,onOpenChange:e=>{!e&&!t&&r()},children:(0,E.jsxs)(FS,{className:`w-[440px] gap-0 overflow-hidden rounded-lg p-0`,style:{zIndex:1100,maxWidth:`100%`},showCloseButton:!1,onPointerDownOutside:e=>{t&&e.preventDefault()},onEscapeKeyDown:e=>{t&&e.preventDefault()},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,gap:12,padding:`18px 18px 14px`},children:[(0,E.jsxs)(`svg`,{width:p[`5xl`],height:p[`5xl`],viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--status-warning)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flexShrink:0,marginTop:1},children:[(0,E.jsx)(`path`,{d:`M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z`}),(0,E.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),(0,E.jsxs)(`div`,{style:{minWidth:0},children:[(0,E.jsx)(IS,{style:{fontSize:`var(--text-2xl)`,fontWeight:700,color:`var(--text)`,lineHeight:1.4},children:a(`trust.dialogTitle`)}),(0,E.jsx)(LS,{style:{marginTop:7,fontSize:`var(--text-base)`,lineHeight:1.6,color:`var(--text-muted)`},children:a(`trust.dialogBody`)}),(0,E.jsx)(`code`,{style:{display:`block`,marginTop:10,padding:`8px 10px`,border:`1px solid var(--border)`,borderRadius:5,background:`var(--bg)`,color:`var(--text)`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,overflowWrap:`anywhere`},children:e}),n&&(0,E.jsx)(`div`,{role:`alert`,style:{marginTop:10,color:`var(--status-error)`,fontSize:`var(--text-base)`,lineHeight:1.5},children:n})]})]}),(0,E.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,padding:`10px 18px`,borderTop:`1px solid var(--border)`},children:[(0,E.jsx)(AS,{type:`button`,variant:`outline`,onClick:r,disabled:t,className:`h-8 px-3 text-xs`,children:a(`trust.cancel`)}),(0,E.jsx)(AS,{type:`button`,onClick:i,disabled:t,className:`h-8 px-3 text-xs`,style:{cursor:t?`wait`:`pointer`},children:a(t?`trust.trusting`:`trust.trustProject`)})]})]})})}function zee({onCancel:e,onSelect:t,busy:n=!1,error:r}){let{t:i}=N(),[a,o]=(0,d.useState)(!0),[s,c]=(0,d.useState)(``),[l,u]=(0,d.useState)(null),[f,m]=(0,d.useState)(``),[h,g]=(0,d.useState)([]),[_,v]=(0,d.useState)(null),[y,b]=(0,d.useState)(``),[x,S]=(0,d.useState)(null),[C,w]=(0,d.useState)(!0),T=(0,d.useRef)(null),D=(0,d.useCallback)(async e=>{w(!0),S(null);try{let t=await bG(e),n=t.path??e??`/`;c(n),u(t.parentPath??null),m(n),g(t.directories??[]),v(t.drives??null),b(``)}catch(e){S(e instanceof Error?e.message:String(e))}finally{w(!1)}},[]);(0,d.useEffect)(()=>{D()},[D]);let O=e=>{e.preventDefault();let t=f.trim();t&&D(t)},k=f.trim()!==s,A=!!s&&!k&&!n,j=!!l||wG(s),M=y.trim().toLowerCase(),P=e=>!M||e.toLowerCase().includes(M),ee=_===null?[]:_.filter(e=>P(e.name)||P(e.path)),F=h.filter(e=>P(e.name));return(0,E.jsx)(jS,{open:a,onOpenChange:t=>{!t&&!n&&(o(!1),e())},children:(0,E.jsxs)(FS,{className:`directory-picker-light flex w-[520px] max-w-[calc(100vw-16px)] flex-col gap-0 overflow-hidden p-0`,style:{height:`min(620px, calc(100dvh - 16px))`},showCloseButton:!1,onPointerDownOutside:e=>{n&&e.preventDefault()},onEscapeKeyDown:e=>{n&&e.preventDefault()},onOpenAutoFocus:e=>{e.preventDefault(),T.current?.focus()},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,flexShrink:0,padding:`12px 18px`,borderBottom:`1px solid var(--border)`},children:[(0,E.jsx)(IS,{style:{fontWeight:700,fontSize:`var(--text-2xl)`,color:`var(--text)`},children:i(`directoryPicker.selectDirectory`)}),(0,E.jsx)(NS,{asChild:!0,children:(0,E.jsx)(`button`,{type:`button`,disabled:n,title:i(`i18n.close`),"aria-label":i(`i18n.close`),style:{padding:`2px 6px`,border:0,background:`none`,color:`var(--text-muted)`,fontSize:`var(--text-5xl)`,lineHeight:1,cursor:n?`default`:`pointer`,opacity:n?.5:1},children:`×`})})]}),(0,E.jsxs)(`form`,{onSubmit:O,style:{display:`flex`,alignItems:`center`,gap:8,flexShrink:0,padding:`10px 14px`,borderBottom:`1px solid var(--border)`},children:[(0,E.jsx)(`button`,{className:`directory-picker-back`,type:`button`,onClick:()=>void D(l??void 0),disabled:C||!j,title:i(`directoryPicker.goToParent`),"aria-label":i(`directoryPicker.goToParent`),style:{width:36,height:36,padding:0,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,border:`1px solid var(--border)`,borderRadius:6,background:`#ffffff`,color:`var(--text-muted)`,cursor:j?`pointer`:`default`,opacity:j?1:.45},children:(0,E.jsx)(`svg`,{width:p[`3xl`],height:p[`3xl`],viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,E.jsx)(`path`,{d:`m18 15-6-6-6 6`})})}),(0,E.jsx)(`label`,{htmlFor:`directory-path`,style:{position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0},children:i(`directoryPicker.directoryPath`)}),(0,E.jsx)(yG,{className:`directory-picker-path h-9 flex-1 font-mono text-xs`,id:`directory-path`,type:`text`,ref:T,value:f,placeholder:`/path/to/project or ~/project`,autoComplete:`off`,spellCheck:!1,style:xG,onChange:e=>{m(e.target.value),S(null)}}),(0,E.jsx)(`button`,{className:`directory-picker-action`,type:`submit`,disabled:C||!f.trim(),title:i(`directoryPicker.goToDirectory`),style:{minWidth:58,height:36,padding:`0 12px`,border:`1px solid var(--border)`,borderRadius:6,background:`#ffffff`,color:`var(--text-muted)`,cursor:C||!f.trim()?`default`:`pointer`,opacity:C||!f.trim()?.6:1},children:i(`directoryPicker.go`)})]}),(0,E.jsxs)(`div`,{className:`directory-picker-list`,style:{flex:1,minHeight:0,overflow:`auto`,padding:`8px 10px`},children:[C?(0,E.jsx)(`div`,{style:{padding:8,color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:i(`directoryPicker.loadingDirectories`)}):_===null?F.length>0?F.map(e=>(0,E.jsxs)(`button`,{className:`directory-picker-entry`,type:`button`,onClick:()=>void D(e.path),title:e.path,style:{width:`100%`,minHeight:30,display:`flex`,alignItems:`center`,gap:7,padding:`5px 8px`,border:0,borderRadius:5,background:`none`,color:`var(--text-muted)`,cursor:`pointer`,textAlign:`left`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`},children:[(0,E.jsx)(SG,{}),(0,E.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.name})]},e.path)):(0,E.jsx)(`div`,{style:{padding:8,color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:i(M?`directoryPicker.noMatches`:`directoryPicker.noSubdirectories`)}):ee.length>0?ee.map(e=>(0,E.jsxs)(`button`,{className:`directory-picker-entry`,type:`button`,onClick:()=>void D(e.path),title:e.path,style:{width:`100%`,minHeight:34,display:`flex`,alignItems:`center`,gap:7,padding:`6px 8px`,border:0,borderRadius:5,background:`none`,color:`var(--text-muted)`,cursor:`pointer`,textAlign:`left`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`},children:[(0,E.jsx)(CG,{}),(0,E.jsx)(`span`,{children:e.name})]},e.path)):(0,E.jsx)(`div`,{style:{padding:8,color:`var(--text-dim)`,fontSize:`var(--text-sm)`},children:i(M?`directoryPicker.noMatches`:`directoryPicker.noDrives`)}),(x||r)&&(0,E.jsx)(`div`,{style:{padding:`8px`,color:`var(--status-error)`,fontSize:`var(--text-sm)`},children:x??r})]}),(0,E.jsxs)(`div`,{className:`directory-picker-footer`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:10,flexShrink:0,padding:`10px 18px`,borderTop:`1px solid var(--border)`},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,flex:1,minWidth:0},children:[(0,E.jsxs)(`svg`,{width:p.lg,height:p.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{color:`var(--text-dim)`,flexShrink:0},children:[(0,E.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,E.jsx)(`path`,{d:`m21 21-4.3-4.3`})]}),(0,E.jsx)(yG,{className:`directory-picker-search h-8 flex-1`,type:`text`,value:y,placeholder:i(`directoryPicker.search`),"aria-label":i(`directoryPicker.search`),autoComplete:`off`,spellCheck:!1,style:xG,onChange:e=>b(e.target.value)})]}),(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,flexShrink:0},children:[(0,E.jsx)(`button`,{className:`directory-picker-action`,type:`button`,onClick:e,disabled:n,style:{padding:`6px 14px`,border:`1px solid var(--border)`,borderRadius:6,background:`none`,color:`var(--text-muted)`,cursor:n?`default`:`pointer`,fontSize:`var(--text-lg)`},children:i(`i18n.cancel`)}),(0,E.jsx)(`button`,{className:`directory-picker-action`,type:`button`,onClick:()=>t(s),disabled:!A,title:i(k?`directoryPicker.openBeforeSelecting`:`directoryPicker.selectCurrentDirectory`),style:{padding:`6px 16px`,border:0,borderRadius:6,background:`var(--accent)`,color:`var(--on-accent)`,fontSize:`var(--text-lg)`,fontWeight:600,opacity:A?1:.6,cursor:A?`pointer`:`default`},children:i(n?`i18n.checking`:`directoryPicker.selectThisFolder`)})]})]})]})})}function y9({visible:e=!0,gap:t=4,items:n}){return e?(0,E.jsx)(`div`,{style:{display:`flex`,gap:t,flexShrink:0},children:n.map(e=>(0,E.jsx)(qi,{label:e.title,children:(0,E.jsx)(`button`,{type:`button`,onClick:e.onClick,disabled:e.disabled,"data-testid":e.testId,"aria-label":e.title,"aria-pressed":e.ariaPressed,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:32,height:32,padding:0,background:e.background??`transparent`,border:`1px solid ${e.borderColor??`var(--border)`}`,borderRadius:7,color:e.color??`var(--text-muted)`,cursor:e.disabled?`default`:`pointer`,flexShrink:0,opacity:e.disabled?.6:1,transition:`background 0.12s, color 0.12s, border-color 0.12s`,"--hover-bg":e.danger?`color-mix(in srgb, var(--status-error) 8%, transparent)`:`var(--bg-selected)`,"--hover-color":e.danger?`var(--status-error)`:`var(--accent)`,"--hover-border":e.danger?`color-mix(in srgb, var(--status-error) 35%, transparent)`:`color-mix(in srgb, var(--accent) 35%, transparent)`},className:e.skipHover?void 0:`hover-shift`,children:e.icon})},e.key))}):null}var b9=2;function Bee({scrollStepPx:e=200,wrapperStyle:t,children:n,testId:r,hintTestId:i}){let a=(0,d.useRef)(null),[o,s]=(0,d.useState)({scrollHeight:0,clientHeight:0,scrollTop:0}),c=(0,d.useCallback)(()=>{if(document.hidden)return;let e=a.current;e&&s({scrollHeight:e.scrollHeight,clientHeight:e.clientHeight,scrollTop:e.scrollTop})},[]);(0,d.useLayoutEffect)(()=>{c();let e=a.current;if(!e)return;let t=new ResizeObserver(c);return t.observe(e),()=>t.disconnect()},[c]);let{scrollHeight:l,clientHeight:u,scrollTop:f}=o,p=l-u>20,m=f<=b9,h=f+u>=l-b9,g=t=>{let n=a.current;if(!n)return;let r=Math.max(0,n.scrollHeight-n.clientHeight);n.scrollTo({top:Math.max(0,Math.min(r,n.scrollTop+t*e)),behavior:`smooth`})},_=e=>{let t=a.current;t&&t.scrollTo({top:e===`top`?0:Math.max(0,t.scrollHeight-t.clientHeight),behavior:`smooth`})};return(0,E.jsxs)(`div`,{style:{position:`relative`,...t},children:[(0,E.jsx)(`div`,{ref:a,"data-testid":r,onScroll:c,style:{position:`absolute`,inset:0,overflowY:`auto`,overflowX:`hidden`,padding:0},children:n}),p&&!m&&(0,E.jsx)(hr,{direction:`up`,visible:!0,testId:i?`${i}-scroll-up`:void 0,onHover:()=>g(-1),onClick:()=>_(`top`)}),p&&!h&&(0,E.jsx)(hr,{direction:`down`,visible:!0,testId:i?`${i}-scroll-down`:void 0,onHover:()=>g(1),onClick:()=>_(`bottom`)})]})}function Vee({...e}){return(0,E.jsx)($o,{"data-slot":`collapsible`,...e})}function Hee({...e}){return(0,E.jsx)(Jo,{"data-slot":`collapsible-trigger`,...e})}function Uee({...e}){return(0,E.jsx)(Xo,{"data-slot":`collapsible-content`,...e})}function Wee({title:e,titleTooltip:t,open:n,onToggle:r,collapsible:i=!0,actions:a,expandedFlex:o=`1 1 0`,style:s,children:c}){return(0,E.jsxs)(Vee,{open:n,onOpenChange:r,style:{borderTop:`1px solid var(--border)`,display:`flex`,flexDirection:`column`,flex:n?o:`0 0 auto`,minHeight:0,overflow:`hidden`,...s},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flexShrink:0,background:`var(--bg-panel)`},children:[(0,E.jsx)(qi,{label:t??e,children:(0,E.jsx)(Hee,{asChild:!0,children:(0,E.jsxs)(`button`,{type:`button`,disabled:!i,style:{display:`flex`,alignItems:`center`,gap:6,flex:`0 0 auto`,height:36,padding:`0 12px`,background:`none`,border:`none`,color:`var(--text-muted)`,cursor:i?`pointer`:`default`,fontSize:`var(--text-base)`,fontWeight:600,letterSpacing:`0.05em`,textTransform:`none`,textAlign:`left`},children:[i&&(0,E.jsx)(`svg`,{width:p.xs,height:p.xs,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{transform:n?`rotate(90deg)`:`none`,transition:`transform 0.15s`,flexShrink:0},children:(0,E.jsx)(`polyline`,{points:`3 2 7 5 3 8`})}),(0,E.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e})]})})}),a&&(0,E.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,marginLeft:`auto`,minWidth:0,gap:6,flexShrink:1,paddingRight:4},children:a})]}),(0,E.jsx)(Uee,{style:{display:`flex`,flexDirection:`column`,minHeight:0,flex:1},children:c})]})}function x9({title:e,titleTooltip:t,open:n,onToggle:r,collapsible:i=!0,actions:a,headerExtra:o,expandedFlex:s=`1 1 0`,scrollStepPx:c=200,testId:l,hintTestId:u,rootTestId:d,scrollStyle:f,style:p,children:m}){return(0,E.jsx)(`div`,{"data-testid":d,style:{display:`flex`,flexDirection:`column`,border:`1px solid var(--border)`,borderRadius:0,background:`var(--bg-panel)`,overflow:`hidden`,...p},children:(0,E.jsxs)(Wee,{title:e,titleTooltip:t,open:n,onToggle:r,collapsible:i,actions:a,expandedFlex:s,style:{borderTop:`none`},children:[o,(0,E.jsx)(Bee,{scrollStepPx:c,wrapperStyle:{flex:1,minHeight:0,...f},testId:l,hintTestId:u,children:m})]})})}function Gee(e){return e.error?e.path.split(/[\\/]/).pop()||e.id:e.name||e.firstMessage.slice(0,50)||e.id.slice(0,12)}var S9=(e,t)=>e.replace(/\\/g,`/`)===t.replace(/\\/g,`/`),C9=e=>e.replace(/\\/g,`/`).replace(/\/+$/,``).replace(/^[a-zA-Z]:/,e=>e.toLowerCase()),w9=`pi-web:unread-session-ids`;function Kee(){if(typeof window>`u`)return new Set;try{let e=window.localStorage.getItem(w9);if(!e)return new Set;let t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(e=>typeof e==`string`)):new Set}catch{return new Set}}function T9(e){if(!(typeof window>`u`))try{e.size===0?window.localStorage.removeItem(w9):window.localStorage.setItem(w9,JSON.stringify([...e]))}catch{}}function qee(){let[e,t]=(0,d.useState)(()=>Kee());return(0,d.useEffect)(()=>{T9(e)},[e]),{unreadSessionIds:e,setUnreadSessionIds:t}}function Jee(e){let{selectedCwd:t,selectedCwdProp:n,refreshKey:r,setSelectedCwd:i}=e,[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)(!1),[f,p]=(0,d.useState)(``),[m,h]=(0,d.useState)(null),[g,_]=(0,d.useState)(!1),[v,y]=(0,d.useState)(null),[b,x]=(0,d.useState)(null),[S,C]=(0,d.useState)(``),w=(0,d.useRef)(null),T=(0,d.useRef)(null),E=(0,d.useRef)(null);(0,d.useEffect)(()=>{n&&n!==E.current&&(E.current=n,i(n))},[n,i]);let D=(0,d.useCallback)(()=>{c(!1),u(!1),p(``),h(null),y(null),C(``)},[]),[O,k]=(0,d.useState)(0);(0,d.useLayoutEffect)(()=>{if(!t){o(null),x(null);return}let e=!1;return x(t),fetch(`/api/worktrees?cwd=${encodeURIComponent(t)}`).then(e=>e.json()).then(n=>{if(!e){if(x(null),n.error||!n.projectRoot){o(null);return}o({forCwd:t,projectRoot:n.projectRoot,isGit:n.isGit??!1,isTopLevel:n.isTopLevel??!1,worktrees:n.worktrees??[]})}}).catch(()=>{e||(x(null),o(null))}),()=>{e=!0}},[t,O,r]);let A=(0,d.useCallback)(async()=>{let e=f.trim();if(!(!e||g||!a)){_(!0),h(null);try{let t=await fetch(`/api/worktrees`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:a.projectRoot,branch:e})}),n=await t.json().catch(()=>({}));if(!t.ok||n.error||!n.path){h(n.error??`HTTP ${t.status}`);return}D(),o(t=>t&&{...t,forCwd:n.path,worktrees:[...t.worktrees,{path:n.path,branch:e,isMain:!1}]}),i(n.path),k(e=>e+1)}catch(e){h(e instanceof Error?e.message:String(e))}finally{_(!1)}}},[D,f,g,a,i]),j=(0,d.useCallback)(async(e,n)=>{if(!(!a||g)){_(!0),h(null);try{let r=await fetch(`/api/worktrees`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:a.projectRoot,path:e,force:n})}),o=await r.json().catch(()=>({}));if(!r.ok){if(o.dirty&&!n){y(e);return}h(o.error??`HTTP ${r.status}`);return}D(),t&&e&&S9(t,e)&&i(a.projectRoot),k(e=>e+1)}catch(e){h(e instanceof Error?e.message:String(e))}finally{_(!1)}}},[D,a,g,t,i]);return(0,d.useEffect)(()=>{let e=e=>{w.current&&!w.current.contains(e.target)&&D()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[D]),{worktreeState:a,worktreeLoadingCwd:b,wtDropdownOpen:s,setWtDropdownOpen:c,wtNewOpen:l,setWtNewOpen:u,wtNewBranch:f,setWtNewBranch:p,wtError:m,setWtError:h,wtBusy:g,wtConfirmRemove:v,setWtConfirmRemove:y,wtFilter:S,setWtFilter:C,wtDropdownRef:w,wtNewInputRef:T,closeWorktrees:D,handleCreateWorktree:A,handleRemoveWorktree:j}}function Yee({wt:e,selectedCwd:t,homeDir:n,setSelectedCwd:r}){let{t:i}=N(),{worktreeState:a,wtFilter:o,setWtFilter:s,wtDropdownOpen:c,setWtDropdownOpen:l,wtDropdownRef:u,closeWorktrees:d,handleRemoveWorktree:f,wtConfirmRemove:m,setWtConfirmRemove:h,wtBusy:g,wtNewOpen:_,setWtNewOpen:v,wtNewBranch:y,setWtNewBranch:b,wtNewInputRef:x,handleCreateWorktree:S,wtError:C,setWtError:w}=e;if(!a)return null;let T=a.worktrees.find(e=>S9(e.path,t))??a.worktrees.find(e=>e.isMain),D=a.worktrees.length>=8,O=D&&o.trim()?a.worktrees.filter(e=>(e.branch??D9(e.path,n)).toLowerCase().includes(o.trim().toLowerCase())):a.worktrees;return(0,E.jsxs)(`div`,{ref:u,"data-testid":`worktree-switcher`,style:{position:`relative`,marginTop:6},children:[(0,E.jsxs)(`button`,{"data-testid":`worktree-switcher-trigger`,onClick:()=>l(e=>!e),title:T?i(`sidebar.switchWorktreeTitle`,{path:T.path}):i(`sidebar.switchWorktree`),style:{width:`100%`,height:29,boxSizing:`border-box`,display:`flex`,alignItems:`center`,gap:6,padding:`0 10px`,background:`var(--bg-input)`,border:`1px solid var(--border)`,borderRadius:7,cursor:`pointer`,fontSize:`var(--text-sm)`,lineHeight:1.35,color:`var(--text-muted)`,textAlign:`left`},children:[(0,E.jsxs)(`svg`,{width:p.sm,height:p.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0,color:T&&!T.isMain?`var(--accent)`:`var(--text-dim)`},children:[(0,E.jsx)(`line`,{x1:`6`,y1:`3`,x2:`6`,y2:`15`}),(0,E.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,E.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,E.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),(0,E.jsx)(O9,{text:T?T.branch??D9(T.path,n):`…`,style:{flex:1,fontFamily:`var(--font-mono)`,color:`var(--text)`}}),T?.isMain&&(0,E.jsx)(`span`,{style:{flexShrink:0,color:`var(--text-dim)`,fontSize:`var(--text-xs)`},children:i(`sidebar.main`)}),a.worktrees.length>1&&(0,E.jsx)(`span`,{style:{flexShrink:0,color:`var(--text-dim)`,fontSize:`var(--text-xs)`},children:a.worktrees.length}),(0,E.jsx)(`svg`,{width:`9`,height:`9`,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:(0,E.jsx)(`polyline`,{points:`2 3.5 5 6.5 8 3.5`})})]}),(0,E.jsxs)($ee,{open:c,style:{position:`absolute`,top:`calc(100% + 4px)`,left:0,right:0,zIndex:100,background:`var(--bg)`,border:`1px solid var(--border)`,borderRadius:8,boxShadow:`0 6px 20px var(--shadow-color)`,overflow:`hidden`},children:[D&&(0,E.jsx)(`div`,{style:{padding:`6px 8px`,borderBottom:`1px solid var(--border)`},children:(0,E.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(s(``),d())},placeholder:i(`sidebar.filterWorktrees`),autoFocus:!0,style:{width:`100%`,fontSize:`var(--text-sm)`,fontFamily:`var(--font-mono)`,padding:`5px 8px`,border:`1px solid var(--border)`,borderRadius:5,outline:`none`,background:`var(--bg)`,color:`var(--text)`,boxSizing:`border-box`}})}),(0,E.jsxs)(`div`,{style:{maxHeight:`min(40vh, 300px)`,overflowY:`auto`},children:[O.map(e=>{let o=S9(e.path,t)||e.isMain&&!a.worktrees.some(e=>S9(e.path,t));return m===e.path?(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,padding:`7px 10px`,borderBottom:`1px solid var(--border)`,background:`color-mix(in srgb, var(--status-error) 6%, transparent)`},children:[(0,E.jsx)(`span`,{style:{flex:1,fontSize:`var(--text-sm)`,color:`var(--text)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:i(`sidebar.forceRemoveCheckout`)}),(0,E.jsx)(`button`,{"data-testid":`worktree-force-remove`,onClick:()=>void f(e.path,!0),disabled:g,style:{padding:`3px 9px`,background:`var(--status-error)`,border:`none`,borderRadius:5,color:`var(--on-error)`,fontSize:`var(--text-sm)`,fontWeight:600,cursor:`pointer`,flexShrink:0},children:i(`sidebar.force`)}),(0,E.jsx)(`button`,{onClick:()=>h(null),style:{padding:`3px 9px`,background:`var(--bg-hover)`,border:`1px solid var(--border)`,borderRadius:5,color:`var(--text-muted)`,fontSize:`var(--text-sm)`,cursor:`pointer`,flexShrink:0},children:i(`sidebar.cancel`)})]},e.path):(0,E.jsxs)(`div`,{className:`wt-row`,"data-testid":`worktree-row`,style:{display:`flex`,alignItems:`center`,borderBottom:`1px solid var(--border)`},children:[(0,E.jsxs)(`button`,{"data-testid":`worktree-item`,onClick:()=>{r(e.path),d()},title:e.path,style:{flex:1,minWidth:0,display:`flex`,alignItems:`center`,gap:7,padding:`8px 10px`,background:`var(--bg)`,border:`none`,color:o?`var(--text)`:`var(--text-muted)`,cursor:`pointer`,textAlign:`left`,fontSize:`var(--text-sm)`,fontFamily:`var(--font-mono)`},children:[o?(0,E.jsx)(`svg`,{width:p.xs,height:p.xs,viewBox:`0 0 10 10`,fill:`none`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:(0,E.jsx)(`polyline`,{points:`1.5 5 4 7.5 8.5 2.5`})}):(0,E.jsx)(`span`,{style:{width:10,flexShrink:0}}),(0,E.jsx)(O9,{text:e.branch??D9(e.path,n),style:{flex:1}}),e.isMain&&(0,E.jsx)(`span`,{style:{flexShrink:0,color:`var(--text-dim)`,fontSize:`var(--text-xs)`},children:i(`sidebar.main`)})]}),!e.isMain&&(0,E.jsx)(`button`,{"data-testid":`worktree-remove`,onClick:()=>void f(e.path,!1),disabled:g,title:i(`sidebar.removeWorktreeTitle`,{path:e.path}),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:34,height:28,padding:0,marginRight:4,background:`none`,border:`none`,color:`var(--text-dim)`,cursor:`pointer`,borderRadius:5,flexShrink:0,transition:`color 0.12s, background 0.12s`,"--hover-color":`var(--status-error)`,"--hover-bg":`color-mix(in srgb, var(--status-error) 8%, transparent)`},className:`hover-shift`,children:(0,E.jsxs)(`svg`,{width:p.base,height:p.base,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,E.jsx)(`polyline`,{points:`3 6 5 6 21 6`}),(0,E.jsx)(`path`,{d:`M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6`}),(0,E.jsx)(`path`,{d:`M10 11v6M14 11v6`}),(0,E.jsx)(`path`,{d:`M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2`})]})})]},e.path)}),D&&O.length===0&&o.trim()&&(0,E.jsx)(`div`,{style:{padding:`8px 10px`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`},children:i(`sidebar.noMatchingWorktrees`)})]}),_?(0,E.jsxs)(`div`,{style:{padding:`6px 8px`},children:[(0,E.jsx)(`input`,{ref:x,"data-testid":`worktree-new-branch-input`,value:y,onChange:e=>{b(e.target.value),w(null)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),S()),e.key===`Escape`&&(v(!1),b(``),w(null))},placeholder:i(`sidebar.branchName`),style:{width:`100%`,fontSize:`var(--text-sm)`,fontFamily:`var(--font-mono)`,padding:`5px 8px`,border:`1px solid var(--accent)`,borderRadius:5,outline:`none`,background:`var(--bg)`,color:`var(--text)`,boxSizing:`border-box`}}),(0,E.jsxs)(`div`,{style:{display:`flex`,gap:5,marginTop:5},children:[(0,E.jsx)(`button`,{"data-testid":`worktree-create`,onClick:()=>void S(),disabled:g||!y.trim(),style:{flex:1,padding:`4px 0`,background:`var(--accent)`,border:`none`,borderRadius:5,color:`var(--on-accent)`,fontSize:`var(--text-sm)`,fontWeight:600,cursor:g||!y.trim()?`not-allowed`:`pointer`,opacity:g||!y.trim()?.65:1},children:i(g?`sidebar.creating`:`sidebar.create`)}),(0,E.jsx)(`button`,{onClick:()=>{v(!1),b(``),w(null)},style:{flex:1,padding:`4px 0`,background:`var(--bg-hover)`,border:`1px solid var(--border)`,borderRadius:5,color:`var(--text-muted)`,fontSize:`var(--text-sm)`,cursor:`pointer`},children:i(`sidebar.cancel`)})]})]}):(0,E.jsxs)(`button`,{"data-testid":`worktree-new`,onClick:e=>{e.stopPropagation(),v(!0),w(null),setTimeout(()=>x.current?.focus(),0)},title:i(`sidebar.createWorktreeTitle`),style:{display:`flex`,alignItems:`center`,gap:7,width:`100%`,padding:`8px 10px`,background:`none`,border:`none`,color:`var(--text-muted)`,cursor:`pointer`,textAlign:`left`,fontSize:`var(--text-sm)`},children:[(0,E.jsxs)(`svg`,{width:p.xs,height:p.xs,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.1`,strokeLinecap:`round`,style:{flexShrink:0},children:[(0,E.jsx)(`line`,{x1:`5`,y1:`1`,x2:`5`,y2:`9`}),(0,E.jsx)(`line`,{x1:`1`,y1:`5`,x2:`9`,y2:`5`})]}),(0,E.jsx)(`span`,{children:i(`sidebar.newWorktree`)})]}),C&&(0,E.jsx)(`div`,{style:{padding:`5px 10px 8px`,color:`var(--status-error)`,fontSize:`var(--text-sm)`,lineHeight:1.35,overflowWrap:`anywhere`},children:C})]})]})}function E9(e,t){let n=new Date(e),r=new Date().getTime()-n.getTime(),i=Math.floor(r/6e4),a=Math.floor(r/36e5),o=Math.floor(r/864e5);return i<1?t(`sidebar.justNow`):i<60?t(`sidebar.minutesAgo`,{count:i}):a<24?t(`sidebar.hoursAgo`,{count:a}):o<7?t(`sidebar.daysAgo`,{count:o}):n.toLocaleDateString()}function Xee(e){let t=new Map;for(let n of e){let e=n.projectRoot??n.cwd;if(!e)continue;let r=t.get(e);(!r||n.modified>r)&&t.set(e,n.modified)}return[...t.entries()].sort((e,t)=>t[1].localeCompare(e[1])).map(([e])=>e)}function D9(e,t){return t&&e.startsWith(t)?`~${e.slice(t.length)}`:e}function Zee(e){let t=e.split(/[\\/]+/).filter(Boolean);return t.length?t[t.length-1]:e}function O9({text:e,style:t}){return(0,E.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,display:`block`,minWidth:0,lineHeight:1.35,direction:`rtl`,textAlign:`left`,...t},children:(0,E.jsx)(`span`,{style:{unicodeBidi:`plaintext`},children:e})})}function k9({session:e}){return(0,E.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4,color:`var(--danger)`,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},title:`${e.path}: ${e.error}`,children:[(0,E.jsxs)(`svg`,{width:p.xs,height:p.xs,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flexShrink:0},children:[(0,E.jsx)(`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}),(0,E.jsx)(`path`,{d:`M12 9v4`}),(0,E.jsx)(`path`,{d:`M12 17h.01`})]}),e.error]})}var A9=140,Qee=2e3;function $ee({open:e,children:t,style:n}){let[r,i]=(0,d.useState)(e),[a,o]=(0,d.useState)(e);return(0,d.useEffect)(()=>{let t,n;return e?(i(!0),o(!1),t=window.requestAnimationFrame(()=>{t=window.requestAnimationFrame(()=>o(!0))})):(o(!1),n=setTimeout(()=>i(!1),A9)),()=>{t!==void 0&&window.cancelAnimationFrame(t),n&&clearTimeout(n)}},[e]),r?(0,E.jsx)(`div`,{style:{...n,opacity:+!!a,transform:a?`translateY(0) scale(1)`:`translateY(-8px) scale(0.96)`,transformOrigin:`top center`,transition:`opacity ${A9}ms ease, transform ${A9}ms ease`,pointerEvents:e?`auto`:`none`},children:t}):null}function ete(e){let t=new Map;for(let n of e)t.set(n.id,{session:n,children:[]});let n=new Map;for(let t of e)t.parentSessionId&&n.set(t.id,t.parentSessionId);function r(e){let r=n.get(e),i=new Set;for(;r;){if(i.has(r))return null;if(i.add(r),t.has(r))return r;r=n.get(r)}return null}let i=[];for(let e of t.values()){let n=r(e.session.id);n?t.get(n).children.push(e):i.push(e)}let a=e=>{e.sort((e,t)=>t.session.modified.localeCompare(e.session.modified)),e.forEach(e=>a(e.children))};return a(i),i}function tte({selectedSessionId:e,selectedSession:t,onSelectSession:n,onNewSession:r,initialSessionId:i,skipInitialProjectSelection:a,onInitialRestoreDone:o,refreshKey:s,onSessionDeleted:c,onUnseenSession:l,selectedCwd:u,onCwdChange:f,savedWorkspaces:m,onSavedWorkspacesChange:h,onOpenFile:g}){let{t:_}=N(),[v,y]=(0,d.useState)([]),[b,x]=(0,d.useState)(!0),[S,C]=(0,d.useState)(null),[w,T]=(0,d.useState)(null),[D,O]=(0,d.useState)(``),[k,A]=(0,d.useState)(!1),[j,M]=(0,d.useState)(``),[P,ee]=(0,d.useState)(null),[F,I]=(0,d.useState)(!1),te=Jee({selectedCwd:w,selectedCwdProp:u,refreshKey:s,setSelectedCwd:T}),{worktreeState:ne,worktreeLoadingCwd:re}=te,[ie,ae]=(0,d.useState)(!1),[L,R]=(0,d.useState)(``),oe=(0,d.useRef)(null);(0,d.useEffect)(()=>{ie&&oe.current?.focus()},[ie]);let[z,se]=(0,d.useState)(!1),[ce,le]=(0,d.useState)(()=>new Set),ue=(0,d.useCallback)(e=>{le(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),de=(0,d.useCallback)(e=>{le(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n}),un(e),l?.(e)},[l]),{unreadSessionIds:fe,setUnreadSessionIds:pe}=qee(),me=fJ(),{runningSessionIds:he,runningPhases:ge,runningPhaseSince:_e,runningBusySince:ye,setRunningSessionIds:be,runningPollAuthoritativeRef:xe}=Sn(),Se=(0,d.useRef)(new Set),Ce=(0,d.useRef)(null),we=(0,d.useRef)(0),Te=(0,d.useCallback)(async(e=!1,t=!1)=>{try{e&&x(!0);let n=t?await ve.refresh():await ve.load();y(n.sessions),xe.current||be(new Set(n.runningSessionIds??[]));let r=new Set(n.sessions.map(e=>e.id));pe(e=>{if(e.size===0)return e;let t=new Set([...e].filter(e=>r.has(e)));return t.size===e.size?e:t}),C(null),e||(se(!0),Ce.current&&clearTimeout(Ce.current),Ce.current=setTimeout(()=>se(!1),2e3))}catch(e){C(String(e))}finally{e&&x(!1)}},[pe,be,xe]),Ee=(0,d.useRef)(!1);(0,d.useEffect)(()=>{let e=!Ee.current;Ee.current=!0,Te(e,e)},[Te,s]),(0,d.useEffect)(()=>{T9(fe)},[fe]),(0,d.useEffect)(()=>{let t=[...Se.current].filter(t=>!he.has(t)&&t!==e),n=[...he];if((t.length>0||n.length>0)&&pe(e=>{let r=new Set(e);return n.forEach(e=>r.delete(e)),t.forEach(e=>r.add(e)),r}),t.length>0&&Te(!1),[...he].filter(e=>!v.some(t=>t.id===e)).length>0){let e=Date.now();e-we.current>=Qee&&(we.current=e,Te(!1,!0))}Se.current=he},[he,e,v,Te,pe]),(0,d.useEffect)(()=>{e&&(lJ(e),pe(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n}))},[e,pe]),(0,d.useEffect)(()=>{fetch(`/api/home`).then(e=>e.json()).then(e=>{e.home&&O(e.home)}).catch(e=>console.error(`[pi-web] load home dir:`,e))},[]);let De=(0,d.useRef)(!1),Oe=(0,d.useCallback)(e=>e?ne&&ne.forCwd&&S9(ne.forCwd,e)||ne?.worktrees.some(t=>S9(t.path,e))?ne.projectRoot:v.find(t=>t.cwd&&S9(t.cwd,e))?.projectRoot??e:null,[ne,v]),ke=(0,d.useRef)(null);(0,d.useEffect)(()=>{ke.current!==w&&(ke.current=w,f?.(w,Oe(w)))},[w,f,Oe]),(0,d.useEffect)(()=>{if(!(v.length===0||a)&&w===null){if(i&&!De.current){De.current=!0;let e=v.find(e=>e.id===i);if(e){T(e.cwd),ue(e.id),n(e,!0);return}o?.()}let e=Xee(v);e.length>0&&T(e[0])}},[v,w,i,a,n,o,ue]);let Ae=(0,d.useCallback)(async e=>{let t=(e??j).trim();if(!(!t||F)){I(!0),ee(null);try{let e=await fetch(`/api/cwd/validate`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:t})}),n=await e.json().catch(()=>({}));if(!e.ok||n.error){ee(n.error??`HTTP ${e.status}`);return}let r=n.cwd??t;if(T(r),A(!1),M(``),h){let e=m??[];e.some(e=>C9(e)===C9(r))||h([...e,r])}}catch(e){ee(e instanceof Error?e.message:String(e))}finally{I(!1)}}},[j,F,m,h]),je=(0,d.useCallback)(async e=>{try{if((await fetch(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`HEAD`})).status===404){C(_(`sidebar.sessionDeleted`)),Te(!1,!0);return}}catch{}e.cwd&&T(e.cwd),ue(e.id),n(e)},[n,_,Te,ue]),Me=(0,d.useCallback)(e=>{let t=e??w;if(!t)return;let n=typeof crypto.randomUUID==`function`?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`;r?.(n,t)},[w,r]),[Ne,Pe]=(0,d.useState)({}),[Fe,Ie]=(0,d.useState)(null),[Le,Re]=(0,d.useState)(null),[ze,Be]=(0,d.useState)(!1),Ve=Oe(w),He=v,Ue=!!(ne?.isGit&&ne.isTopLevel&&w&&Ve===ne.projectRoot),We=(w&&ne&&Ve===ne.projectRoot&&!Ue?ne.isGit?{label:_(`sidebar.openRepoRoot`),title:_(`sidebar.openRepoRootTitle`)}:{label:_(`sidebar.gitRepoRootOnly`),title:_(`sidebar.gitRepoRootOnlyTitle`)}:null)??(w&&re===w&&!Ue?{label:_(`sidebar.worktrees`),title:_(`sidebar.checkingWorktrees`)}:null),Ge=(0,d.useCallback)(async e=>{Re(null),Be(!0);try{await Promise.all(e.sessions.map(e=>fetch(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`DELETE`}).then(t=>{t.ok||console.error(`[sidebar] failed to delete ${e.id}:`,t.status)}).catch(t=>console.error(`[sidebar] failed to delete ${e.id}:`,t))));for(let t of e.sessions)c?.(t.id);let t=m??[];h&&t.some(t=>C9(t)===C9(e.root))&&h(t.filter(t=>C9(t)!==C9(e.root))),Te(!1,!0)}finally{Be(!1)}},[c,Te,m,h]),Ke=(0,d.useMemo)(()=>{let e=t&&!He.some(e=>e.id===t.id)?[{...t,projectRoot:t.projectRoot??Oe(t.cwd)??void 0},...He]:He,n=new Map,r=new Map;for(let t of e){let e=t.projectRoot??t.cwd??`unknown`,i=e===`unknown`?e:C9(e);n.has(i)||(n.set(i,[]),r.set(i,e)),n.get(i).push(t)}let i=[...n.entries()].map(([e,t])=>({root:r.get(e)??e,sessions:t})).sort((e,t)=>{let n=e=>Math.max(...e.map(e=>{let t=new Date(e.modified).getTime();return Number.isNaN(t)?0:t}));return n(t.sessions)-n(e.sessions)}),a=[];if(w){let e=Oe(w);e&&!n.has(C9(e))&&a.push({root:e,sessions:[]})}let o=new Set([...n.keys()]);for(let e of a)o.add(C9(e.root));let s=[];for(let e of m??[]){let t=C9(e);o.has(t)||(o.add(t),s.push({root:e,sessions:[]}))}return[...a,...i,...s]},[He,w,Oe,t,m]),qe=L.trim().toLowerCase(),Je=(0,d.useMemo)(()=>qe?Ke.map(e=>({...e,sessions:e.sessions.filter(e=>Gee(e).toLowerCase().includes(qe))})).filter(e=>e.sessions.length>0):Ke,[Ke,qe]);return(0,E.jsxs)(`div`,{"data-testid":`session-sidebar`,style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`hidden`},children:[k&&(0,E.jsx)(zee,{busy:F,error:P,onCancel:()=>{A(!1),ee(null)},onSelect:e=>void Ae(e)}),(0,E.jsxs)(x9,{title:_(`sidebar.workspace`),open:!0,onToggle:()=>{},collapsible:!1,testId:`workspace-scroll`,hintTestId:`workspace`,scrollStyle:{flex:`1 1 auto`,minHeight:80,background:`var(--bg)`},style:{flex:1,minHeight:0},actions:(0,E.jsx)(y9,{items:[{key:`search`,testId:`workspace-search-toggle`,onClick:()=>{ie&&R(``),ae(e=>!e)},title:_(`sidebar.searchSessions`),ariaPressed:ie,color:ie?`var(--accent)`:`var(--text-muted)`,background:ie?`var(--bg-selected)`:void 0,icon:(0,E.jsx)(vi,{size:p.lg})},{key:`new-workspace`,testId:`new-workspace`,onClick:()=>A(!0),title:_(`sidebar.newWorkspace`),color:`var(--text-muted)`,icon:(0,E.jsx)(Xr,{size:p.xl})},{key:`refresh`,testId:`session-refresh`,onClick:()=>Te(!1,!0),title:_(`sidebar.refresh`),skipHover:z,color:z?`var(--status-success)`:`var(--text-muted)`,background:z?`color-mix(in srgb, var(--status-success) 18%, transparent)`:void 0,icon:z?(0,E.jsx)(Rr,{size:p.xl,color:`var(--status-success)`,strokeWidth:2.5}):(0,E.jsx)(mi,{size:p.xl})}]}),headerExtra:(0,E.jsxs)(E.Fragment,{children:[ie&&(0,E.jsxs)(`div`,{"data-testid":`workspace-search`,style:{display:`flex`,alignItems:`center`,gap:4,width:`100%`,minWidth:0,padding:`4px 8px`,background:`var(--bg)`,borderBottom:`1px solid var(--border)`,boxSizing:`border-box`},children:[(0,E.jsx)(vi,{size:p.lg,color:`var(--text-muted)`,style:{flexShrink:0}}),(0,E.jsx)(`input`,{ref:oe,value:L,onChange:e=>R(e.target.value),placeholder:_(`sidebar.searchSessionsPlaceholder`),"aria-label":_(`sidebar.searchSessions`),style:{flex:1,minWidth:0,background:`transparent`,border:`none`,outline:`none`,color:`var(--text)`,fontSize:`var(--text-sm)`}}),L&&(0,E.jsx)(`button`,{type:`button`,onClick:()=>{R(``),oe.current?.focus()},"aria-label":_(`chat.clearSearch`),style:{border:`none`,background:`transparent`,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-sm)`,flexShrink:0,padding:0},children:`✕`})]}),Ue&&(0,E.jsx)(Yee,{wt:te,selectedCwd:w,homeDir:D,setSelectedCwd:T}),We&&(0,E.jsxs)(`button`,{type:`button`,"aria-disabled":`true`,tabIndex:-1,title:We.title,style:{width:`100%`,height:29,boxSizing:`border-box`,marginTop:6,display:`flex`,alignItems:`center`,gap:6,padding:`0 10px`,border:`1px solid var(--border)`,borderRadius:7,background:`var(--bg-hover)`,color:`var(--text-dim)`,fontSize:`var(--text-sm)`,lineHeight:1.35,whiteSpace:`nowrap`,textAlign:`left`,cursor:`default`,opacity:.82},children:[(0,E.jsxs)(`svg`,{width:p.sm,height:p.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:[(0,E.jsx)(`line`,{x1:`6`,y1:`3`,x2:`6`,y2:`15`}),(0,E.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,E.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,E.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),(0,E.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`},children:We.label})]})]}),children:[b&&(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`16px 14px`,color:`var(--text-muted)`,fontSize:`var(--text-base)`},children:[(0,E.jsx)(`div`,{style:{width:14,height:14,border:`2px solid var(--border)`,borderTopColor:`var(--text-dim)`,borderRadius:`50%`,animation:`spin 0.8s linear infinite`,flexShrink:0}}),_(`sidebar.loading`)]}),S&&(0,E.jsx)(`div`,{style:{padding:`12px 14px`,color:`var(--status-error)`,fontSize:`var(--text-base)`},children:S}),!b&&!S&&qe&&Je.length===0&&(0,E.jsx)(`div`,{style:{padding:`16px 14px`,color:`var(--text-muted)`,fontSize:`var(--text-base)`},children:_(`sidebar.searchSessionsNoResults`)}),Je.map(t=>{let n=t.sessions.some(t=>t.id===e)||t.root===Ve;return(0,E.jsxs)(`div`,{children:[(0,E.jsx)(nte,{group:t,groupSelected:n,hoveredGroup:Fe,confirmDeleteGroup:Le,deletingGroup:ze,runningSessionIds:he,interactionBadges:me,collapsed:!!Ne[t.root],setHoveredGroup:Ie,setGroupCollapsed:Pe,setConfirmDeleteGroup:Re,handleDeleteGroup:Ge,handleNewSession:Me,copyText:Ri}),(qe||!Ne[t.root])&&(t.sessions.length===0?(0,E.jsx)(`div`,{style:{padding:`10px 14px`,color:`var(--text-muted)`,fontSize:`var(--text-sm)`},children:_(`sidebar.noSessions`)}):ete(t.sessions).map(t=>(0,E.jsx)(j9,{node:t,selectedSessionId:e,runningSessionIds:he,runningPhases:ge,runningPhaseSince:_e,runningBusySince:ye,unreadSessionIds:fe,seenSessionIds:ce,interactionBadges:me,onSelectSession:je,onRenamed:()=>Te(!1,!0),onSessionDeleted:e=>{c?.(e),Te(!1,!0)},onUnseen:de,depth:0},t.session.id)))]},t.root)})]})]})}function nte({group:e,groupSelected:t,hoveredGroup:n,confirmDeleteGroup:r,deletingGroup:i,runningSessionIds:a,interactionBadges:o,collapsed:s,setHoveredGroup:c,setGroupCollapsed:l,setConfirmDeleteGroup:u,handleDeleteGroup:d,handleNewSession:f,copyText:m}){let{t:h}=N(),g=e.sessions.some(e=>a.has(e.id)),_=e.sessions.some(e=>o.has(e.id));return(0,E.jsx)(`div`,{"data-testid":`workspace-group-header`,onMouseEnter:()=>c(e.root),onMouseLeave:()=>c(null),style:{display:`flex`,alignItems:`center`,gap:4,height:40,padding:`0 2px`,boxSizing:`border-box`,fontSize:`var(--text-base)`,fontFamily:`var(--font-mono)`,color:`var(--text)`,fontWeight:600,textTransform:`none`,letterSpacing:.6,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,cursor:r===e.root?`default`:`pointer`,background:r===e.root?`color-mix(in srgb, var(--status-error) 6%, transparent)`:n===e.root?`var(--bg-hover)`:`var(--bg)`},onClick:r===e.root?void 0:()=>{l(t=>({...t,[e.root]:!t[e.root]}))},children:r===e.root?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`span`,{style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:h(`sidebar.deleteWorkspace`,{count:e.sessions.length})}),(0,E.jsxs)(`div`,{style:{display:`flex`,gap:5,flexShrink:0},children:[(0,E.jsx)(`button`,{onClick:t=>{t.stopPropagation(),d(e)},disabled:i,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:4,height:22,padding:`0 9px`,background:`var(--status-error)`,border:`none`,borderRadius:5,color:`var(--on-error)`,cursor:i?`default`:`pointer`,opacity:i?.6:1,fontSize:`var(--text-sm)`,fontWeight:600,whiteSpace:`nowrap`},children:h(`sidebar.delete`)}),(0,E.jsx)(`button`,{onClick:e=>{e.stopPropagation(),u(null)},disabled:i,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:22,padding:`0 9px`,background:`var(--bg)`,border:`1px solid var(--border)`,borderRadius:5,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-sm)`,fontWeight:500,whiteSpace:`nowrap`},children:h(`sidebar.cancel`)})]})]}):(0,E.jsx)(E.Fragment,{children:(0,E.jsxs)(`div`,{style:{display:`inline-flex`,alignItems:`center`,gap:6,flex:1,minWidth:0,height:38,boxSizing:`border-box`,padding:`0 8px`,border:`none`,borderRadius:0,background:_&&s?`linear-gradient(180deg, transparent calc(100% - 25px), color-mix(in srgb, var(--border) 25%, transparent) 100%)`:g&&s?`linear-gradient(90deg, transparent 13%, color-mix(in srgb, var(--accent) 18%, transparent) 25%, transparent 37%, transparent 63%, color-mix(in srgb, var(--shine-highlight) 50%, transparent) 75%, transparent 87%), linear-gradient(180deg, transparent calc(100% - 25px), color-mix(in srgb, var(--border) 25%, transparent) 100%)`:`linear-gradient(180deg, transparent calc(100% - 25px), color-mix(in srgb, var(--border) 25%, transparent) 100%)`,backgroundSize:g&&s&&!_?`200% 100%, auto`:void 0,animation:_&&s?`interaction-bg-blink 1s ease-in-out infinite`:g&&s?`pi-status-shine 1.5s linear infinite`:void 0,boxShadow:`0 2px 8px var(--shadow-color)`,margin:`0 -2px`},children:[(0,E.jsxs)(`span`,{style:{position:`relative`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:30,height:22,flexShrink:0},children:[(0,E.jsx)(`svg`,{width:`30`,height:`22`,viewBox:`0 0 24 24`,fill:t?`color-mix(in srgb, var(--accent) 18%, transparent)`:`var(--bg)`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:t?`var(--accent)`:`var(--text-muted)`,opacity:.95},children:(0,E.jsx)(`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`})}),(0,E.jsx)(`span`,{style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -38%)`,color:`var(--text-muted)`,fontSize:`var(--text-xs)`,fontWeight:400,lineHeight:1,textAlign:`center`,fontVariantNumeric:`tabular-nums`,userSelect:`none`},children:e.sessions.length})]}),(0,E.jsx)(qi,{label:e.root,wrapperStyle:{flex:1,minWidth:0,overflow:`hidden`},children:(0,E.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,maxWidth:`100%`,lineHeight:`20px`},children:Zee(e.root)})}),n===e.root&&(0,E.jsx)(y9,{items:[{key:`new-session`,onClick:t=>{t.stopPropagation(),f(e.root)},title:h(`sidebar.newSessionTitle`,{path:e.root}),icon:(0,E.jsx)(fi,{size:p.base})},{key:`copy-path`,onClick:t=>{t.stopPropagation(),m(e.root)},title:h(`sidebar.copyPath`),icon:(0,E.jsx)(Ur,{size:p.base})},{key:`delete-workspace`,onClick:t=>{t.stopPropagation(),u(e.root)},title:h(`sidebar.deleteWorkspaceTitle`),danger:!0,icon:(0,E.jsx)(Ei,{size:p.base})}]})]})})})}function j9({node:e,selectedSessionId:t,runningSessionIds:n,runningPhases:r,runningPhaseSince:i,runningBusySince:a,unreadSessionIds:o,seenSessionIds:s,interactionBadges:c,onSelectSession:l,onRenamed:u,onSessionDeleted:f,onUnseen:p,depth:m}){let[h,g]=(0,d.useState)(!1),_=e.children.length>0;return(0,E.jsxs)(`div`,{style:{paddingBottom:1,backgroundImage:`linear-gradient(90deg, transparent, var(--border), transparent)`,backgroundPosition:`0 100%`,backgroundSize:`100% 1px`,backgroundRepeat:`no-repeat`},children:[(0,E.jsxs)(`div`,{style:{position:`relative`},children:[m>0&&(0,E.jsx)(`div`,{style:{position:`absolute`,left:m*12+6,top:0,bottom:0,width:1,background:`var(--border)`,pointerEvents:`none`}}),(0,E.jsx)(ite,{session:e.session,isSelected:e.session.id===t,isRunning:n.has(e.session.id),phase:r[e.session.id],phaseSince:i[e.session.id],busySince:a[e.session.id],isUnread:o.has(e.session.id),isSeen:s.has(e.session.id),hasInteractionBadge:c.has(e.session.id),onClick:()=>l(e.session),onRenamed:u,onDeleted:e=>f?.(e),onUnseen:p,depth:m,hasChildren:_,collapsed:h,onToggleCollapse:()=>g(e=>!e)})]}),_&&!h&&(0,E.jsx)(`div`,{children:e.children.map(e=>(0,E.jsx)(j9,{node:e,selectedSessionId:t,runningSessionIds:n,runningPhases:r,runningPhaseSince:i,runningBusySince:a,unreadSessionIds:o,seenSessionIds:s,interactionBadges:c,onSelectSession:l,onRenamed:u,onSessionDeleted:f,onUnseen:p,depth:m+1},e.session.id))})]})}function rte(){let{t:e}=N();return(0,E.jsx)(`span`,{title:e(`sidebar.newActivity`),"aria-label":e(`sidebar.newSessionActivity`),style:{width:14,height:14,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,color:`var(--accent)`},children:(0,E.jsxs)(`svg`,{width:p.xl,height:p.xl,viewBox:`0 0 14 14`,fill:`none`,"aria-hidden":`true`,style:{display:`block`},children:[(0,E.jsx)(`circle`,{cx:`7`,cy:`7`,r:`2.5`,fill:`currentColor`}),(0,E.jsx)(`circle`,{cx:`7`,cy:`7`,r:`3`,stroke:`currentColor`,strokeWidth:`1.4`,opacity:`0.32`,style:{transformOrigin:`center`,animation:`session-ring-pulse 1.6s ease-in-out infinite`}})]})})}function ite({session:e,isSelected:t,isRunning:n,phase:r,phaseSince:i,busySince:a,isUnread:o,isSeen:s=!0,hasInteractionBadge:c=!1,onClick:l,onRenamed:u,onDeleted:f,onUnseen:m,depth:h=0,hasChildren:g=!1,collapsed:_=!1,onToggleCollapse:v}){let{t:y}=N(),b=Cn(!!(n&&r),i),x=Cn(!!n,a),[S,C]=(0,d.useState)(!1),[w,T]=(0,d.useState)(!1),[D,O]=(0,d.useState)(``),[k,A]=(0,d.useState)(!1),[j,M]=(0,d.useState)(!1),P=(0,d.useRef)(null),ee=e.error?e.path.split(/[\\/]/).pop()||e.id:e.name||e.firstMessage.slice(0,50)||e.id.slice(0,12),F=(0,d.useCallback)(t=>{t.stopPropagation(),O(e.name??``),T(!0),setTimeout(()=>P.current?.select(),0)},[e.name]),I=(0,d.useCallback)(async()=>{let t=D.trim();if(T(!1),t!==(e.name??``))try{await fetch(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:t})}),u?.()}catch{}},[D,e.id,e.name,u]),te=(0,d.useCallback)(async()=>{A(!1),M(!0);try{await fetch(`/api/sessions/${encodeURIComponent(e.id)}`,{method:`DELETE`}),f?.(e.id)}catch{M(!1)}},[e.id,f]),ne=(0,d.useCallback)(e=>{e.stopPropagation(),e.shiftKey?te():A(!0)},[te]),re=(0,d.useCallback)(e=>{e.stopPropagation(),te()},[te]),ie=(0,d.useCallback)(e=>{e.stopPropagation(),A(!1)},[]);return(0,E.jsx)(`div`,{"data-testid":`session-item`,"data-session-id":e.id,onClick:k||w?void 0:l,title:c?y(`sidebar.interactionBadge`):void 0,onMouseEnter:()=>C(!0),onMouseLeave:()=>{C(!1)},style:{height:54,animation:c?`interaction-bg-blink 1s ease-in-out infinite`:void 0,display:`flex`,alignItems:`center`,paddingLeft:h>0?h*12+14:14,paddingRight:8,cursor:k||w?`default`:`pointer`,backgroundColor:k?`color-mix(in srgb, var(--status-error) 6%, transparent)`:S?`var(--bg-hover)`:`transparent`,transition:`background 0.1s`,opacity:j?.5:1,gap:6,overflow:`hidden`},className:t&&!k?`row-selected-gradient`:void 0,children:k?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,E.jsx)(`div`,{style:{fontSize:`var(--text-base)`,color:`var(--text)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:ee}),(0,E.jsxs)(`div`,{style:{marginTop:2,display:`flex`,alignItems:`center`,gap:8,color:`var(--text-dim)`,fontSize:`var(--text-sm)`,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[e.error?(0,E.jsx)(k9,{session:e}):(0,E.jsx)(`span`,{title:e.modified,children:E9(e.modified,y)}),(0,E.jsx)(`span`,{children:y(`sidebar.messagesCount`,{count:e.messageCount})})]})]}),(0,E.jsxs)(`div`,{style:{display:`flex`,gap:5,flexShrink:0},children:[(0,E.jsxs)(`button`,{onClick:re,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:4,height:30,padding:`0 11px`,background:`var(--status-error)`,border:`none`,borderRadius:6,color:`var(--on-error)`,cursor:`pointer`,fontSize:`var(--text-base)`,fontWeight:600,whiteSpace:`nowrap`},children:[(0,E.jsx)(Ei,{size:p.base}),y(`sidebar.delete`)]}),(0,E.jsx)(`button`,{onClick:ie,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,height:30,padding:`0 11px`,background:`var(--bg)`,border:`1px solid var(--border)`,borderRadius:6,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-base)`,fontWeight:500,whiteSpace:`nowrap`},children:y(`sidebar.cancel`)})]})]}):w?(0,E.jsx)(`input`,{ref:P,"data-testid":`session-rename-input`,value:D,onChange:e=>O(e.target.value),onBlur:I,onKeyDown:e=>{e.key===`Enter`&&I(),e.key===`Escape`&&T(!1)},autoFocus:!0,style:{flex:1,fontSize:`var(--text-base)`,padding:`5px 8px`,border:`1px solid var(--accent)`,borderRadius:5,outline:`none`,background:`var(--bg)`,color:`var(--text)`,height:30}}):(0,E.jsxs)(E.Fragment,{children:[h>0&&(0,E.jsxs)(`svg`,{width:p.xs,height:p.xs,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--text-dim)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:[(0,E.jsx)(`line`,{x1:`6`,y1:`3`,x2:`6`,y2:`15`}),(0,E.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,E.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,E.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),(0,E.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,E.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:5,minWidth:0,fontSize:`var(--text-base)`,fontWeight:t?600:400,lineHeight:1.4,color:s?`var(--text)`:`var(--text-dim)`},title:ee,children:(0,E.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,minWidth:0},children:ee})}),(0,E.jsxs)(`div`,{style:{marginTop:2,display:`flex`,alignItems:`center`,gap:8,color:`var(--text-dim)`,fontSize:`var(--text-sm)`,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[e.error?(0,E.jsx)(k9,{session:e}):n?(0,E.jsx)(mY,{phase:r??{kind:`running_command`},elapsed:b,totalElapsed:x}):o?(0,E.jsx)(rte,{}):(0,E.jsx)(`span`,{title:e.modified,children:E9(e.modified,y)}),!e.error&&n?null:(0,E.jsx)(`span`,{children:y(`sidebar.messagesCount`,{count:e.messageCount})}),e.worktreeBranch&&(0,E.jsxs)(`span`,{title:`Worktree: ${e.cwd}`,style:{display:`flex`,alignItems:`center`,gap:3,color:`var(--accent)`,minWidth:0,overflow:`hidden`},children:[(0,E.jsxs)(`svg`,{width:`9`,height:`9`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},children:[(0,E.jsx)(`line`,{x1:`6`,y1:`3`,x2:`6`,y2:`15`}),(0,E.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,E.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,E.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),(0,E.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.worktreeBranch})]})]})]}),g&&(0,E.jsx)(qi,{label:_?`Expand forks`:`Collapse forks`,children:(0,E.jsx)(`button`,{onClick:e=>{e.stopPropagation(),v?.()},style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:20,height:20,padding:0,flexShrink:0,background:`none`,border:`none`,color:`var(--text-dim)`,cursor:`pointer`,transform:_?`rotate(-90deg)`:`none`,transition:`transform 0.15s`},children:(0,E.jsx)(`svg`,{width:p.xs,height:p.xs,viewBox:`0 0 10 10`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,E.jsx)(`polyline`,{points:`2 3.5 5 6.5 8 3.5`})})})}),(0,E.jsx)(y9,{visible:S,items:[...s&&m?[{key:`unseen`,onClick:t=>{t.stopPropagation(),m(e.id)},title:y(`sidebar.disconnect`)||`断开`,icon:(0,E.jsx)(Oi,{size:p.base})}]:[],{key:`copy-path`,onClick:t=>{t.stopPropagation(),Ri(e.path)},title:y(`sidebar.copyPath`),icon:(0,E.jsx)(Ur,{size:p.base})},{key:`rename`,testId:`session-rename`,onClick:F,title:y(`sidebar.rename`),icon:(0,E.jsx)(ui,{size:p.xl})},{key:`delete`,testId:`session-delete`,onClick:ne,title:y(`sidebar.deleteWithShiftClick`),danger:!0,icon:(0,E.jsx)(Ei,{size:p.xl})}]})]})})}function ate(){let{t:e}=N(),t=(0,d.useSyncExternalStore)(qe,Je,Je);if(t.length===0)return null;let n=t[t.length-1],r=t.length;return(0,E.jsx)(_l,{open:!0,onOpenChange:()=>{},children:(0,E.jsxs)(xl,{children:[(0,E.jsx)(Cl,{style:{position:`fixed`,inset:0,zIndex:1200,background:`rgba(0, 0, 0, 0.45)`}}),(0,E.jsxs)(Dl,{role:`alertdialog`,"aria-modal":`true`,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),style:{position:`fixed`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,zIndex:1200,maxWidth:480,width:`calc(100% - 48px)`,background:`var(--bg)`,border:`1px solid var(--border)`,borderRadius:10,padding:`16px 20px`,boxShadow:`0 8px 32px rgba(0, 0, 0, 0.35)`},children:[(0,E.jsxs)(Ml,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10,fontSize:`var(--text-base)`,fontWeight:600,color:`var(--text)`},children:[(0,E.jsx)(`span`,{style:{color:`var(--status-error)`},children:`⚠`}),(0,E.jsx)(`span`,{children:r>1?e(`errors.titleCount`,{count:r}):e(`errors.title`)})]}),(0,E.jsx)(Pl,{asChild:!0,children:(0,E.jsx)(`div`,{children:n.kind===`api`?(0,E.jsxs)(`div`,{children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:6},children:[(0,E.jsxs)(`span`,{style:{fontSize:`var(--text-xs)`,padding:`1px 8px`,borderRadius:999,background:`color-mix(in srgb, var(--status-error) 14%, transparent)`,color:`var(--status-error)`,fontWeight:600,whiteSpace:`nowrap`},children:[`HTTP `,n.status||`ERR`]}),n.context&&(0,E.jsx)(`span`,{style:{fontSize:`var(--text-xs)`,color:`var(--text-dim)`},children:n.context})]}),(0,E.jsx)(`div`,{style:{fontSize:`var(--text-sm)`,color:`var(--text)`,wordBreak:`break-word`},children:n.message})]}):(0,E.jsxs)(`div`,{children:[n.context&&(0,E.jsx)(`div`,{style:{fontSize:`var(--text-xs)`,color:`var(--text-dim)`,marginBottom:6},children:n.context}),(0,E.jsx)(`div`,{style:{fontSize:`var(--text-sm)`,color:`var(--text)`,wordBreak:`break-word`},children:n.message})]})})}),(0,E.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:16},children:[r>1&&(0,E.jsx)(`button`,{type:`button`,onClick:Xe,style:{border:`1px solid var(--border)`,background:`none`,color:`var(--text-muted)`,borderRadius:6,padding:`4px 12px`,fontSize:`var(--text-sm)`,cursor:`pointer`},children:e(`errors.clearAll`)}),(0,E.jsx)(`button`,{type:`button`,onClick:Ye,style:{border:`none`,background:`var(--accent)`,color:`#fff`,borderRadius:6,padding:`4px 14px`,fontSize:`var(--text-sm)`,cursor:`pointer`},children:e(`errors.close`)})]})]})]})})}var M9=[],ote=1,N9=new Set;function P9(){for(let e of N9)e()}function ste(e){return N9.add(e),()=>{N9.delete(e)}}function F9(){return M9}function cte(e){let t={id:ote++,label:e??``};M9=[...M9,t],P9();let n=!1;return()=>{n||(n=!0,M9=M9.filter(e=>e.id!==t.id),P9())}}var I9=new WeakMap;function lte(e){if(!e.isConnected)return()=>{};let t=I9.get(e);if(!t){let n=document.createElement(`div`);n.style.cssText=`position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb, var(--bg) 50%, transparent);z-index:5;`,n.innerHTML=`<div style="width:16px;height:16px;border:2px solid var(--border);border-top-color:var(--text-dim);border-radius:50%;animation:spin 0.8s linear infinite;"></div>`;let r=null;getComputedStyle(e).position===`static`&&(r=e.style.position,e.style.position=`relative`),e.appendChild(n),t={count:0,el:n,prevPosition:r},I9.set(e,t)}t.count++;let n=!1;return()=>{n||(n=!0,t.count--,t.count<=0&&(t.el.remove(),t.prevPosition!==null&&(t.prevPosition?e.style.position=t.prevPosition:e.style.removeProperty(`position`)),I9.delete(e)))}}async function ute(e){try{return await e.json()}catch{return null}}async function L9(e,t,n){let r=n?.loading??`fullscreen`,i=r===`fullscreen`?cte(n?.label):r instanceof HTMLElement?lte(r):null;try{let n;try{n=await fetch(e,t)}catch(e){throw new Be(e instanceof Error?e.message:`Network error`,0)}if(!n.ok){let e=await ute(n);throw new Be(e&&typeof e==`object`&&`error`in e&&typeof e.error==`string`?e.error:`HTTP ${n.status}`,n.status,e)}let r=await n.text();return r?JSON.parse(r):void 0}catch(e){throw e instanceof Be?e:new Be(e instanceof Error?e.message:String(e),0)}finally{i?.()}}var dte=3;function fte(){let{t:e}=N(),t=(0,d.useSyncExternalStore)(ste,F9,F9);if(t.length===0)return null;let n=t.slice(0,dte),r=t.length-n.length;return(0,E.jsx)(`div`,{"aria-busy":`true`,style:{position:`fixed`,inset:0,zIndex:1150,background:`color-mix(in srgb, var(--bg) 40%, transparent)`,display:`flex`,alignItems:`center`,justifyContent:`center`,pointerEvents:`none`},children:(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10,minWidth:220,maxWidth:`60vw`,padding:`14px 18px`,background:`var(--bg)`,border:`1px solid var(--border)`,borderRadius:`var(--radius)`,boxShadow:`0 8px 32px rgba(0,0,0,0.25)`},children:[n.map(t=>(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,fontSize:`var(--text-sm)`,color:`var(--text)`},children:[(0,E.jsx)(`div`,{style:{width:14,height:14,flexShrink:0,border:`2px solid var(--border)`,borderTopColor:`var(--accent)`,borderRadius:`50%`,animation:`spin 0.8s linear infinite`}}),(0,E.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t.label||e(`loading.inProgress`)})]},t.id)),r>0&&(0,E.jsx)(`div`,{style:{fontSize:`var(--text-sm)`,color:`var(--text-dim)`},children:e(`loading.more`,{count:r})})]})})}var R9={},pte=6e4;function z9(e,t){return e===`Not found`?t(`files.notFound`):e===`Access denied`?t(`files.accessDenied`):e}async function B9(e,t){return((await L9(`/api/files/${mG(e)}?type=list`,void 0,t)).entries??[]).map(t=>({name:t.name,fullPath:vG(e,t.name),isDir:t.isDir,size:t.size,children:t.isDir?[]:void 0,loaded:!t.isDir}))}async function V9(e,t){return L9(`/api/git/status?${new URLSearchParams({cwd:e}).toString()}`,void 0,t)}var H9={modified:`files.modified`,added:`files.added`,deleted:`files.deleted`,renamed:`files.renamed`,untracked:`files.untracked`,conflict:`files.conflict`},U9={modified:`var(--status-warning)`,added:`var(--status-success)`,deleted:`var(--status-error)`,renamed:`var(--accent)`,untracked:`var(--status-success)`,conflict:`var(--status-error)`};function W9({status:e,t}){return(0,E.jsx)(`span`,{title:t(H9[e.status]),"aria-label":t(H9[e.status]),style:{width:14,height:14,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,color:U9[e.status],fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,fontWeight:600},children:e.code})}function mte(e,t,n,r){return new Promise((i,a)=>{let o=new FormData;t.forEach(e=>o.append(`files`,e,e.name));let s=new XMLHttpRequest;s.open(`POST`,`/api/files/${mG(e)}?type=upload&conflict=${n}`),s.upload.onprogress=e=>{e.lengthComputable&&e.total>0&&r(Math.round(e.loaded/e.total*100))},s.onerror=()=>a(Error(`Network error while uploading files`)),s.onabort=()=>a(Error(`Upload cancelled`)),s.onload=()=>{let e={};try{e=JSON.parse(s.responseText)}catch{s.responseText&&(e.error=s.responseText)}i({status:s.status,data:e})},s.send(o)})}function G9({size:e=11}){return(0,E.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,E.jsx)(`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`})]})}function K9({onClick:e,title:t}){return(0,E.jsx)(qi,{label:t,children:(0,E.jsx)(`button`,{type:`button`,onClick:e,"aria-label":t,style:{width:24,height:24,padding:0,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,border:`none`,borderRadius:4,background:`none`,color:`var(--text-dim)`,cursor:`pointer`,"--hover-color":`var(--text-muted)`,"--hover-bg":`var(--bg-hover)`},className:`hover-shift`,children:(0,E.jsxs)(`svg`,{width:p.lg,height:p.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`path`,{d:`m6 6 12 12`}),(0,E.jsx)(`path`,{d:`m18 6-12 12`})]})})})}function q9({node:e,depth:t,cwd:n,onOpenFile:r,onAtMention:i,expandedPaths:a,onToggleExpanded:o,refreshToken:s,highlightedPaths:c,gitStatusByPath:l,changedDirectoryPaths:u,t:f}){let m=a.has(e.fullPath),h=c.has(e.fullPath),g=pG(e.fullPath),_=l.get(g),v=e.isDir&&(_!==void 0||u.has(g)),[y,b]=(0,d.useState)(e.children??[]),[x,S]=(0,d.useState)(e.loaded??!1),[C,w]=(0,d.useState)(!1),T=(0,d.useCallback)(async(t=!1)=>{if(!(x&&!t))try{let t=await B9(e.fullPath,{loading:`silent`});b(t),S(!0)}catch{}},[x,e.fullPath]);(0,d.useEffect)(()=>{m&&x&&T(!0)},[s]);let D=(0,d.useCallback)(()=>{if(e.isDir){let t=!m;o(e.fullPath,t),t&&!x&&T()}else r(e.fullPath,e.name)},[e.isDir,e.fullPath,e.name,x,m,T,r,o]);return(0,E.jsxs)(`div`,{children:[(0,E.jsxs)(`div`,{onClick:D,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),style:{position:`relative`,display:`flex`,alignItems:`center`,gap:4,paddingLeft:8+t*14,paddingRight:8,height:24,cursor:`pointer`,background:C?`var(--bg-hover)`:`transparent`,borderRadius:4,userSelect:`none`},children:[e.isDir&&(0,E.jsx)(`svg`,{width:p.xs,height:p.xs,viewBox:`0 0 10 10`,fill:`none`,stroke:`var(--text-dim)`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0,transform:m?`rotate(90deg)`:`none`,transition:`transform 0.1s`},children:(0,E.jsx)(`polyline`,{points:`3 2 7 5 3 8`})}),!e.isDir&&(0,E.jsx)(`span`,{style:{width:10,flexShrink:0}}),(0,E.jsx)(`span`,{style:{flexShrink:0,display:`flex`,alignItems:`center`},children:e.isDir?(0,E.jsx)(In,{size:p.xl,open:m}):ur(e.name,14)}),(0,E.jsx)(`span`,{style:{fontSize:`var(--text-base)`,color:`var(--text)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flex:1},title:e.fullPath,children:e.name}),h&&(0,E.jsx)(`span`,{title:f(`files.newlyUploaded`),"aria-label":f(`files.newlyUploaded`),style:{width:14,height:14,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,E.jsx)(`span`,{style:{width:6,height:6,borderRadius:`50%`,background:`var(--accent)`}})}),!C&&!e.isDir&&_&&(0,E.jsx)(W9,{status:_,t:f}),!C&&v&&(0,E.jsx)(`span`,{title:f(`files.containsChangedFiles`),"aria-label":f(`files.containsChangedFiles`),style:{width:14,height:14,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,E.jsx)(`span`,{style:{width:6,height:6,borderRadius:`50%`,background:`var(--status-warning)`}})}),i&&C&&(0,E.jsxs)(`button`,{onClick:t=>{t.stopPropagation(),i(_G(e.fullPath,n),e.isDir)},title:f(`files.insertPath`),style:{position:`absolute`,right:e.isDir?4:28,top:`50%`,transform:`translateY(-50%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:4,padding:`0 8px`,height:20,background:`var(--bg-panel)`,border:`1px solid var(--border)`,borderRadius:4,color:`var(--accent)`,cursor:`pointer`,fontSize:`var(--text-sm)`,fontWeight:600,whiteSpace:`nowrap`},children:[(0,E.jsx)(G9,{}),f(`files.mention`)]}),C&&!e.isDir&&(0,E.jsx)(`a`,{href:`/api/files/${mG(e.fullPath)}?type=download`,download:!0,onClick:e=>e.stopPropagation(),title:f(`files.download`),style:{position:`absolute`,right:4,top:`50%`,transform:`translateY(-50%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:4,padding:`0 5px`,height:20,background:`var(--bg-panel)`,border:`1px solid var(--border)`,borderRadius:4,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-sm)`,fontWeight:600,whiteSpace:`nowrap`,textDecoration:`none`},children:(0,E.jsxs)(`svg`,{width:p.sm,height:p.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,E.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,E.jsx)(`polyline`,{points:`7 10 12 15 17 10`}),(0,E.jsx)(`line`,{x1:`12`,y1:`15`,x2:`12`,y2:`3`})]})})]}),e.isDir&&m&&(0,E.jsxs)(`div`,{children:[y.map(e=>(0,E.jsx)(q9,{node:e,depth:t+1,cwd:n,onOpenFile:r,onAtMention:i,expandedPaths:a,onToggleExpanded:o,refreshToken:s,highlightedPaths:c,gitStatusByPath:l,changedDirectoryPaths:u,t:f},e.fullPath)),y.length===0&&x&&(0,E.jsx)(`div`,{style:{paddingLeft:8+(t+1)*14,fontSize:`var(--text-sm)`,color:`var(--text-dim)`,height:22,display:`flex`,alignItems:`center`},children:f(`files.empty`)})]})]})}function J9({status:e,cwd:t,onOpenFile:n,onStageToggle:r,unstage:i,t:a}){let[o,s]=(0,d.useState)(!1),c=hG(e.filePath),l=_G(e.filePath,t);return(0,E.jsxs)(`div`,{"data-testid":`git-change-row`,onClick:()=>n(e.filePath,c,{modeHint:`diff`}),onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),title:e.filePath,style:{display:`flex`,alignItems:`center`,gap:6,paddingLeft:10,paddingRight:8,height:24,cursor:`pointer`,background:o?`var(--bg-hover)`:`transparent`,borderRadius:4,userSelect:`none`},children:[r!==void 0&&(0,E.jsx)(`button`,{type:`button`,"data-testid":`git-stage-toggle`,onClick:t=>{t.stopPropagation(),r(e)},"aria-label":a(i?`files.unstageFile`:`files.stageFile`),style:{width:16,height:16,padding:0,marginLeft:-4,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,border:`none`,borderRadius:4,background:`none`,color:`var(--text-dim)`,cursor:`pointer`,opacity:+!!o,"--hover-color":`var(--text-muted)`,"--hover-bg":`var(--bg-hover)`},className:`hover-shift`,children:(0,E.jsx)(`svg`,{width:p.sm,height:p.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.4`,strokeLinecap:`round`,"aria-hidden":`true`,children:i?(0,E.jsx)(`path`,{d:`M6 12h12`}):(0,E.jsx)(`path`,{d:`M12 5v14M5 12h14`})})}),(0,E.jsx)(W9,{status:e,t:a}),(0,E.jsx)(`span`,{style:{flexShrink:0,display:`flex`,alignItems:`center`,opacity:.85},children:ur(c,13)}),(0,E.jsx)(`span`,{style:{fontSize:`var(--text-base)`,color:`var(--text)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,flex:1},children:l}),e.lineStats&&(e.lineStats.additions>0||e.lineStats.deletions>0)&&(0,E.jsxs)(`span`,{style:{flexShrink:0,display:`flex`,alignItems:`center`,gap:5,fontFamily:`var(--font-mono)`,fontSize:`var(--text-xs)`,fontVariantNumeric:`tabular-nums`},children:[e.lineStats.additions>0&&(0,E.jsxs)(`span`,{style:{color:`var(--status-success)`},children:[`+`,e.lineStats.additions]}),e.lineStats.deletions>0&&(0,E.jsxs)(`span`,{style:{color:`var(--status-error)`},children:[`-`,e.lineStats.deletions]})]})]})}function hte({message:e,onMessageChange:t,commitBusy:n,canCommit:r,onCommit:i,pushBusy:a,canPush:o,onPush:s,pullBusy:c,canPull:l,onPull:u,aiBusy:f,canAiGenerate:m,onAiGenerate:h,autoGenerateOnEmpty:g,hasModelForAuto:_,aiModelHint:v,t:y}){let b=(0,d.useRef)(null),x=e.trim()===``,S=x&&g&&_&&m&&!f,C=n||!S&&x||!r;return(0,d.useLayoutEffect)(()=>{let e=b.current;e&&(e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,120)}px`)},[e]),(0,E.jsx)(`div`,{style:{display:`flex`,padding:`4px 2px 6px`},children:(0,E.jsxs)(`div`,{style:{position:`relative`,display:`flex`,flexDirection:`column`,flex:1,minWidth:0,backgroundColor:`var(--bg)`,backgroundImage:n||f||a||c?`linear-gradient(90deg, transparent 13%, color-mix(in srgb, var(--accent) 18%, transparent) 25%, transparent 37%, transparent 63%, color-mix(in srgb, var(--shine-highlight) 50%, transparent) 75%, transparent 87%)`:void 0,backgroundSize:n||f||a||c?`200% 100%`:void 0,animation:n||f||a||c?`pi-status-shine 1.5s linear infinite`:void 0,borderRadius:6,border:`1px solid var(--border)`},children:[(0,E.jsx)(`textarea`,{ref:b,"data-testid":`git-commit-message`,value:e,disabled:n||f||a||c,placeholder:f?v?`${y(`git.ai.generating`)}(${v})`:y(`git.ai.generating`):y(`files.commitMessagePlaceholder`),onChange:e=>t(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),C||i())},rows:1,style:{flex:`0 1 auto`,minWidth:0,resize:`none`,boxSizing:`content-box`,overflowY:`auto`,maxHeight:120,fontSize:`var(--text-base)`,lineHeight:1.4,padding:`4px 6px`,color:n||f||a||c?`var(--text-dim)`:`var(--text)`,background:`transparent`,border:`none`,borderRadius:6,outline:`none`}}),(0,E.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:4,padding:`2px 6px 4px`},children:[(0,E.jsx)(qi,{label:(()=>{let e=y(f?`git.ai.generating`:`git.ai.generate`);return v?`${e}(${v})`:e})(),children:(0,E.jsx)(`button`,{onClick:h,disabled:f||!m||n||a||c,"aria-label":y(`git.ai.generate`),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:36,height:30,padding:0,flexShrink:0,background:`none`,border:`1px solid transparent`,borderRadius:6,color:f||!m||n||a||c?`var(--text-dim)`:`var(--accent)`,cursor:f||!m||n||a||c?`default`:`pointer`},children:f?(0,E.jsx)(oi,{size:p.lg,style:{animation:`spin 0.8s linear infinite`}}):(0,E.jsx)(Si,{size:p.lg})})}),(0,E.jsx)(qi,{label:n?y(`files.committing`):C&&x&&!S?y(`files.commitMessageRequired`):S?`${y(`git.ai.generateAndCommit`)} (Ctrl+Enter)`:`${y(`files.commit`)} (Ctrl+Enter)`,children:(0,E.jsx)(`button`,{"data-testid":`git-commit`,onClick:i,disabled:C||c,"aria-label":y(`files.commit`),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:36,height:30,padding:0,flexShrink:0,background:`none`,border:`1px solid transparent`,borderRadius:6,color:C||c?`var(--text-dim)`:`var(--accent)`,cursor:C||c?`default`:`pointer`},children:n?(0,E.jsx)(oi,{size:p[`2xl`],style:{animation:`spin 0.8s linear infinite`}}):(0,E.jsx)(Qr,{size:p[`2xl`]})})}),(0,E.jsx)(qi,{label:y(a?`files.pushing`:o?`files.push`:`files.pushUpToDate`),children:(0,E.jsx)(`button`,{"data-testid":`git-push`,onClick:s,disabled:a||n||c||!o,"aria-label":y(`files.push`),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:36,height:30,padding:0,flexShrink:0,background:`none`,border:`1px solid transparent`,borderRadius:6,color:a||n||c||!o?`var(--text-dim)`:`var(--accent)`,cursor:a||n||c||!o?`default`:`pointer`},children:a?(0,E.jsx)(oi,{size:p.lg,style:{animation:`spin 0.8s linear infinite`}}):(0,E.jsx)(Hr,{size:p[`2xl`]})})}),(0,E.jsx)(qi,{label:y(c?`files.pulling`:l?`files.pull`:`files.pullUpToDate`),children:(0,E.jsx)(`button`,{"data-testid":`git-pull`,onClick:u,disabled:c||n||a||!l,"aria-label":y(`files.pull`),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:36,height:30,padding:0,flexShrink:0,background:`none`,border:`1px solid transparent`,borderRadius:6,color:c||n||a||!l?`var(--text-dim)`:`var(--accent)`,cursor:c||n||a||!l?`default`:`pointer`},children:c?(0,E.jsx)(oi,{size:p.lg,style:{animation:`spin 0.8s linear infinite`}}):(0,E.jsx)(Vr,{size:p[`2xl`]})})})]})]})})}function Y9({prefix:e,count:t,additions:n,deletions:r,t:i}){return(0,E.jsxs)(`div`,{"aria-label":i(`files.changeStats`,{count:t,additions:n,deletions:r}),style:{display:`flex`,alignItems:`center`,gap:6,height:24,padding:`0 10px`,fontSize:`var(--text-base)`},children:[e&&(0,E.jsx)(`span`,{style:{color:`var(--text-dim)`},children:e}),(0,E.jsx)(`span`,{style:{color:`var(--text-dim)`},children:i(`files.changedCount`,{count:t})}),(0,E.jsxs)(`span`,{style:{color:U9.added,fontFamily:`var(--font-mono)`},children:[`+`,n]}),(0,E.jsxs)(`span`,{style:{color:U9.deleted,fontFamily:`var(--font-mono)`},children:[`-`,r]})]})}function X9({message:e,onDismiss:t}){let{t:n}=N();return(0,E.jsxs)(`div`,{role:`alert`,style:{display:`flex`,alignItems:`center`,gap:6,marginTop:4,padding:`6px 8px`,fontSize:`var(--text-sm)`,lineHeight:1.35,color:`var(--status-error)`,background:`var(--bg)`,border:`1px solid var(--status-error)`,borderRadius:6},children:[(0,E.jsx)(`span`,{style:{minWidth:0,flex:1,overflowWrap:`anywhere`,maxHeight:140,overflowY:`auto`,whiteSpace:`pre-wrap`},children:e}),(0,E.jsx)(K9,{onClick:t,title:n(`files.dismissError`)})]})}function gte({children:e}){return(0,E.jsx)(`div`,{style:{padding:`0 4px 2px`},children:e})}var _te=(0,d.forwardRef)(function({children:e},t){return(0,E.jsx)(`div`,{ref:t,style:{padding:`2px 4px`},children:e})}),vte=(0,d.forwardRef)(function({cwd:e,onOpenFile:t,refreshKey:n,searchQuery:r,onAtMention:i,onAtMentions:a,onUploadBusyChange:o,changesCollapsed:s,onChangesCountChange:c,sessionId:l,onOpenConfig:u},f){let{t:m}=N(),[h,g]=(0,d.useState)([]),[_,v]=(0,d.useState)(!0),[y,b]=(0,d.useState)(null),x=(0,d.useRef)(null),[S,C]=(0,d.useState)(new Set),[w,T]=(0,d.useState)(0),D=(r??``).trim().toLowerCase(),O=(0,d.useMemo)(()=>{if(!D)return h;function e(t){if(t.name.toLowerCase().includes(D))return t;if(t.isDir&&t.children){let n=t.children.map(e).filter(e=>e!==null);if(n.length>0)return{...t,children:n}}return null}return h.map(e).filter(e=>e!==null)},[h,D]),[k,A]=(0,d.useState)(new Set),[j,M]=(0,d.useState)([]),[P,ee]=(0,d.useState)({additions:0,deletions:0}),[F,I]=(0,d.useState)([]),[te,ne]=(0,d.useState)({additions:0,deletions:0}),re=(0,d.useMemo)(()=>D?F.filter(t=>_G(t.filePath,e).toLowerCase().includes(D)):F,[F,D,e]),ie=(0,d.useMemo)(()=>D?j.filter(t=>_G(t.filePath,e).toLowerCase().includes(D)):j,[j,D,e]),[ae,L]=(0,d.useState)({branch:null,upstream:null,ahead:0,behind:0,hasUpstream:!1}),[R,oe]=(0,d.useState)(null),[z,se]=(0,d.useState)(``),[ce,le]=(0,d.useState)(!1),[ue,de]=(0,d.useState)(null),[fe,pe]=(0,d.useState)(!1),[me,he]=(0,d.useState)(!1),[ge,ve]=(0,d.useState)(null),be=Li(),xe=(0,d.useRef)(0),[Se,Ce]=(0,d.useState)(!1),[we,Te]=(0,d.useState)(!1),Ee=(0,d.useSyncExternalStore)(ye.subscribe,()=>ye.get()?.preferences??R9,()=>R9),De=(0,d.useSyncExternalStore)(_e.subscribe,()=>_e.get()),Oe=Ee.commitMessageAutoGenerateOnEmpty!==!1,ke=Ee.commitStageAllConfirm!==!1,Ae=Ee.commitMessageUseCurrentModel===!0?!!(l||De?.defaultModel||(De?.modelList?.length??0)>0):!!(typeof Ee.commitMessageModel==`string`&&Ee.commitMessageModel),[je,Me]=(0,d.useState)(!1),[Ne,Pe]=(0,d.useState)(null),Fe=(0,d.useRef)(null),[Ie,Le]=(0,d.useState)(!1),[Re,ze]=(0,d.useState)(null),[Be,Ve]=(0,d.useState)(`idle`),[He,Ue]=(0,d.useState)(0),[We,Ge]=(0,d.useState)(null),[qe,Je]=(0,d.useState)(null),[Ye,Xe]=(0,d.useState)(null),Ze=(0,d.useRef)(null),Qe=(0,d.useRef)(null),$e=`${n??0}:${w}`,et=Be!==`idle`,tt=(0,d.useMemo)(()=>new Map(j.map(e=>[pG(e.filePath),e])),[j]),nt=(0,d.useMemo)(()=>{let t=new Set,n=pG(e).replace(/\/$/,``);for(let e of j){let r=gG(pG(e.filePath));for(;(r===n||r.startsWith(`${n}/`))&&(t.add(r),r!==n);){let e=gG(r);if(e===r)break;r=e}}return t},[e,j]),rt=(0,d.useCallback)((e,t)=>{C(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},[]),it=(0,d.useCallback)(t=>{let n=t.uploaded??[],r=t.skipped??[],i=t.errors??[];Je({uploaded:n,skipped:r,errors:i}),n.length>0&&(A(new Set(n.map(t=>vG(e,t)))),T(e=>e+1))},[e]),at=(0,d.useCallback)(async(t,n)=>{Xe(null),Ge(null),Ue(0),Ve(`uploading`);try{let{status:r,data:i}=await mte(e,t,n,Ue);if(r===409&&i.conflicts?.length){Xe({files:t,conflicts:i.conflicts,nonReplaceable:i.nonReplaceable??[]});return}if(r<200||r>=300)throw Error(i.error??`Upload failed (HTTP ${r})`);Ue(100),it(i)}catch(e){Ge(e instanceof Error?e.message:String(e))}finally{Ve(`idle`)}},[it,e]),ot=(0,d.useCallback)(async t=>{if(!(t.length===0||et)){Je(null),A(new Set),Xe(null),Ge(null),Ue(0),Ve(`checking`);try{let n=await L9(`/api/files/${mG(e)}?type=upload-check`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({fileNames:t.map(e=>e.name)})},{loading:`silent`});if(n.conflicts?.length){Xe({files:t,conflicts:n.conflicts,nonReplaceable:n.nonReplaceable??[]});return}await at(t,`error`)}catch(e){Ge(e instanceof Error?e.message:String(e))}finally{Ve(`idle`)}}},[e,at,et]),st=(0,d.useCallback)(e=>{let t=Array.from(e.target.files??[]);e.target.value=``,ot(t)},[ot]);(0,d.useImperativeHandle)(f,()=>({openUploadPicker(){et||Qe.current?.click()}}),[et]);let ct=(0,d.useCallback)(async()=>{Me(!0);try{let t=await L9(`/api/git/push`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:e})},{loading:`silent`});console.info(`[git-push] ok:`,t.output||`(empty output)`),Pe({ok:!0,output:t.output??``})}catch(e){let t=e instanceof Error?e.message:String(e);console.info(`[git-push] failed:`,t),Pe({ok:!1,output:t})}finally{Me(!1),T(e=>e+1)}},[e]),lt=(0,d.useCallback)(async()=>{Le(!0);try{let t=await L9(`/api/git/pull`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:e})},{loading:`silent`});console.info(`[git-pull] ok:`,t.output||`(empty output)`),ze({ok:!0,output:t.output??``})}catch(e){let t=e instanceof Error?e.message:String(e);console.info(`[git-pull] failed:`,t),ze({ok:!1,output:t})}finally{Le(!1),T(e=>e+1)}},[e]),ut=(()=>{let e=Ee.gitAutoFetchIntervalSec;return typeof e==`number`&&Number.isFinite(e)&&e>0?e:0})();(0,d.useEffect)(()=>{if(ut<=0||!e)return;let t=()=>{document.hidden||L9(`/api/git/autofetch-status?cwd=${encodeURIComponent(e)}`,{},{loading:`silent`}).then(e=>{e.cached!==!1&&L(t=>({...t,ahead:e.ahead??t.ahead,behind:e.behind??t.behind}))}).catch(()=>{})};t();let n=setInterval(t,ut*1e3),r=()=>{document.hidden||t()};return document.addEventListener(`visibilitychange`,r),()=>{clearInterval(n),document.removeEventListener(`visibilitychange`,r)}},[e,ut]),(0,d.useEffect)(()=>{if(Fe.current&&clearTimeout(Fe.current),Ne)return Fe.current=setTimeout(()=>Pe(null),1e4),()=>{Fe.current&&clearTimeout(Fe.current)}},[Ne]);let dt=(0,d.useRef)(null);(0,d.useEffect)(()=>{if(dt.current&&clearTimeout(dt.current),Re)return dt.current=setTimeout(()=>ze(null),1e4),()=>{dt.current&&clearTimeout(dt.current)}},[Re]),(0,d.useEffect)(()=>{o?.(et)},[o,et]),(0,d.useEffect)(()=>()=>o?.(!1),[o]),(0,d.useEffect)(()=>{let t=Ze.current!==e;Ze.current=e,t&&(C(new Set),A(new Set),Je(null),Xe(null),Ge(null)),b(null),v(t);let n=!1;return B9(e,{loading:`silent`}).then(e=>{n||g(e)}).catch(e=>{n||(b(e instanceof Error?e.message:String(e)),Ke(e,`file explorer`))}).finally(()=>{n||v(!1)}),()=>{n=!0}},[e,n,w]),(0,d.useEffect)(()=>{let t=!1;return V9(e,{loading:`silent`}).then(e=>{if(!t){let t=e.isGitRepository;M(t?e.files:[]),ee(t?{additions:e.additions,deletions:e.deletions}:{additions:0,deletions:0}),I(t?e.stagedFiles:[]),ne(t?{additions:e.stagedAdditions,deletions:e.stagedDeletions}:{additions:0,deletions:0}),L(t?{branch:e.branch??null,upstream:e.upstream??null,ahead:e.ahead??0,behind:e.behind??0,hasUpstream:e.hasUpstream??!1}:{branch:null,upstream:null,ahead:0,behind:0,hasUpstream:!1})}}).catch(()=>{t||(M([]),ee({additions:0,deletions:0}),I([]),ne({additions:0,deletions:0}),L({branch:null,upstream:null,ahead:0,behind:0,hasUpstream:!1}))}),()=>{t=!0}},[e,n,w]);let ft=(0,d.useCallback)(async(t,n)=>{oe(null);try{let r=await fetch(`/api/git/stage`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:e,filePath:t.filePath,action:n?`unstage`:`stage`})}),i=await r.json().catch(()=>({}));if(!r.ok)throw Error(i.error??`Git ${n?`unstage`:`stage`} failed (HTTP ${r.status})`);T(e=>e+1)}catch(e){oe(e instanceof Error?e.message:String(e))}},[e]);(0,d.useEffect)(()=>{c?.(j.length+F.length)},[j,F,c]);let pt=(0,d.useCallback)(async(t,n)=>{let r=n??z;le(!0),de(null);try{let n=await fetch(`/api/git/commit`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:e,message:r,stageAll:t})}),i=await n.json().catch(()=>({}));if(!n.ok)throw Error(i.error??`Commit failed (HTTP ${n.status})`);se(``),de(null),pe(!1),T(e=>e+1)}catch(e){de(e instanceof Error?e.message:String(e))}finally{le(!1)}},[e,z]),mt=(0,d.useCallback)(async()=>{if(me||ce||je||we)return null;let t=++xe.current,n=ye.get()?.preferences??{};if(Object.keys(n).length===0)try{await ye.refresh(),n=ye.get()?.preferences??{}}catch{}let r=n.commitMessageUseCurrentModel===!0,i=typeof n.commitMessageModel==`string`?n.commitMessageModel:``,a=``,o=``;if(r){if(l)try{let e=await L9(`/api/agent/${encodeURIComponent(l)}`),t=e.state?.model??e.model??null;if(t){let e=t;a=e.provider??``,o=e.id??e.modelId??``}if(!a||!o)try{let e=await L9(`/api/sessions/${encodeURIComponent(l)}/state`);e.model&&(a=e.model.provider,o=e.model.id)}catch{}}catch{}if(!a||!o)try{let e=_e.get();if(!e?.defaultModel)try{await _e.refresh(),e=_e.get()}catch{}if(e?.defaultModel?.provider){let t=e.defaultModel;a=t.provider??``,o=t.modelId??t.id??``}if((!a||!o)&&e?.modelList?.[0]){let t=e.modelList[0];a=t.provider??``,o=t.modelId??t.id??``}}catch{}if(!a||!o)return ve(m(`git.ai.noSessionModel`)),null}else{if(!i)return Ce(!0),null;let e=i.indexOf(`/`);if(e===-1||(a=i.slice(0,e),o=i.slice(e+1),!a||!o))return ve(m(`git.ai.invalidModel`)),null}let s=n.commitMessageMaxTokens,c=typeof s==`number`&&Number.isFinite(s)?Math.min(4096,Math.max(64,Math.round(s))):512;he(!0),ve(null);try{let n=await be.start(t=>fetch(`/api/git/generate-commit`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({cwd:e,provider:a,modelId:o,maxTokens:c}),signal:t}),pte,{joinKey:`generate`}).promise;if(t!==xe.current)return null;let r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.error??`Generate failed (HTTP ${n.status})`);if(!r.message)throw Error(`Empty response`);return se(r.message),r.message}catch(e){return t!==xe.current||e instanceof Fi&&e.message===`cancelled`||ve(e instanceof Error?e.message:String(e)),null}finally{t===xe.current&&he(!1)}},[me,ce,je,we,e,l,m,be]),ht=(0,d.useCallback)(async()=>{let t=await V9(e),n=t.isGitRepository;M(n?t.files:[]),ee(n?{additions:t.additions,deletions:t.deletions}:{additions:0,deletions:0}),I(n?t.stagedFiles:[]),ne(n?{additions:t.stagedAdditions,deletions:t.stagedDeletions}:{additions:0,deletions:0}),L(n?{branch:t.branch??null,upstream:t.upstream??null,ahead:t.ahead??0,behind:t.behind??0,hasUpstream:t.hasUpstream??!1}:{branch:null,upstream:null,ahead:0,behind:0,hasUpstream:!1});let r=z.trim()===``,i=n?t.stagedFiles??[]:[],a=n?t.files??[]:[],o=i.length+a.length>0;if(r&&Oe&&Ae&&o&&!me&&!ce&&!je&&!we){Te(!0);try{let e=await mt();if(!e)return;i.length>0?await pt(!1,e):ke?pe(!0):await pt(!0,e)}finally{Te(!1)}return}i.length>0?pt(!1):ke?pe(!0):pt(!0)},[e,z,Oe,Ae,ke,me,ce,je,we,mt,pt]),gt=et||Ye!==null||We!==null||qe!==null,_t=(0,d.useCallback)(()=>{!qe||qe.uploaded.length===0||a?.(qe.uploaded.map(t=>_G(vG(e,t),e)))},[e,a,qe]);return(0,E.jsxs)(`div`,{style:{minHeight:`100%`},children:[(0,E.jsx)(`input`,{ref:Qe,type:`file`,multiple:!0,hidden:!0,onChange:st}),gt&&(0,E.jsxs)(`div`,{style:{padding:`6px 8px`,borderBottom:`1px solid var(--border)`},children:[et&&(0,E.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-label":Be===`checking`?m(`files.checking`):m(`files.uploading`,{progress:He}),children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:8,minHeight:14,color:`var(--text-muted)`},children:[Be===`checking`?(0,E.jsx)(`svg`,{width:p.lg,height:p.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,style:{animation:`spin 0.8s linear infinite`},"aria-hidden":`true`,children:(0,E.jsx)(`path`,{d:`M21 12a9 9 0 1 1-5.7-8.4`})}):(0,E.jsxs)(`svg`,{width:p.lg,height:p.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`path`,{d:`M12 16V4`}),(0,E.jsx)(`path`,{d:`m7 9 5-5 5 5`}),(0,E.jsx)(`path`,{d:`M5 20h14`})]}),Be===`uploading`&&(0,E.jsxs)(`span`,{style:{fontSize:`var(--text-xs)`},children:[He,`%`]})]}),Be===`uploading`&&(0,E.jsx)(`div`,{style:{height:3,marginTop:4,overflow:`hidden`,borderRadius:2,background:`var(--border)`},children:(0,E.jsx)(`div`,{style:{width:`${He}%`,height:`100%`,background:`var(--text-muted)`,transition:`width 120ms ease`}})})]}),Ye&&(0,E.jsxs)(`div`,{role:`alert`,style:{padding:7,border:`1px solid color-mix(in srgb, #f59e0b 55%, var(--border))`,borderRadius:4,background:`color-mix(in srgb, #f59e0b 9%, var(--bg-panel))`},children:[(0,E.jsx)(`div`,{style:{fontSize:`var(--text-sm)`,color:`var(--text)`,lineHeight:1.35,overflowWrap:`anywhere`},children:m(`files.conflictSummary`,{count:Ye.conflicts.length,countSuffix:Ye.conflicts.length===1?``:`s`,files:Ye.conflicts.join(`, `)})}),Ye.nonReplaceable.length>0&&(0,E.jsx)(`div`,{style:{marginTop:3,fontSize:`var(--text-xs)`,color:`#f59e0b`,lineHeight:1.35,overflowWrap:`anywhere`},children:m(`files.cannotReplace`,{files:Ye.nonReplaceable.join(`, `)})}),(0,E.jsxs)(`div`,{style:{display:`flex`,gap:5,marginTop:7},children:[(0,E.jsx)(`button`,{type:`button`,onClick:()=>void at(Ye.files,`overwrite`),style:{height:22,padding:`0 7px`,border:`1px solid var(--status-error)`,borderRadius:4,background:`transparent`,color:`var(--status-error)`,cursor:`pointer`,fontSize:`var(--text-xs)`},children:m(`files.replace`)}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>void at(Ye.files,`skip`),style:{height:22,padding:`0 7px`,border:`1px solid var(--border)`,borderRadius:4,background:`var(--bg-panel)`,color:`var(--text)`,cursor:`pointer`,fontSize:`var(--text-xs)`},children:m(`files.skipExisting`)}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>Xe(null),style:{height:22,padding:`0 7px`,border:`none`,borderRadius:4,background:`transparent`,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-xs)`},children:m(`files.cancel`)})]})]}),We&&(0,E.jsxs)(`div`,{role:`alert`,style:{display:`flex`,alignItems:`flex-start`,gap:6,fontSize:`var(--text-sm)`,lineHeight:1.35,color:`var(--status-error)`},children:[(0,E.jsx)(`span`,{style:{minWidth:0,flex:1,overflowWrap:`anywhere`},children:We}),(0,E.jsx)(K9,{onClick:()=>Ge(null),title:m(`files.dismissError`)})]}),qe&&(0,E.jsxs)(`div`,{"aria-live":`polite`,children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,minHeight:22,fontSize:`var(--text-sm)`},children:[(0,E.jsxs)(`div`,{style:{minWidth:0,flex:1,display:`flex`,alignItems:`center`,gap:8},children:[qe.uploaded.length>0&&(0,E.jsxs)(`span`,{title:`${qe.uploaded.length} uploaded`,"aria-label":`${qe.uploaded.length} uploaded`,style:{display:`flex`,alignItems:`center`,gap:3,color:`var(--status-success)`},children:[(0,E.jsx)(`svg`,{width:p.lg,height:p.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,E.jsx)(`path`,{d:`m5 12 4 4L19 6`})}),(0,E.jsx)(`span`,{children:qe.uploaded.length})]}),qe.skipped.length>0&&(0,E.jsxs)(`span`,{title:`${qe.skipped.length} skipped`,"aria-label":`${qe.skipped.length} skipped`,style:{display:`flex`,alignItems:`center`,gap:3,color:`var(--text-dim)`},children:[(0,E.jsxs)(`svg`,{width:p.lg,height:p.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,E.jsx)(`path`,{d:`M8 12h8`})]}),(0,E.jsx)(`span`,{children:qe.skipped.length})]}),qe.errors.length>0&&(0,E.jsxs)(`span`,{title:m(`files.uploadFailed`,{count:qe.errors.length}),"aria-label":m(`files.uploadFailed`,{count:qe.errors.length}),style:{display:`flex`,alignItems:`center`,gap:3,color:`var(--status-error)`},children:[(0,E.jsxs)(`svg`,{width:p.lg,height:p.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`path`,{d:`M12 3 2.5 20h19L12 3Z`}),(0,E.jsx)(`path`,{d:`M12 9v4`}),(0,E.jsx)(`path`,{d:`M12 17h.01`})]}),(0,E.jsx)(`span`,{children:qe.errors.length})]})]}),qe.uploaded.length>0&&a&&(0,E.jsxs)(`button`,{type:`button`,onClick:_t,title:qe.uploaded.length===1?m(`files.addUploadedFile`):m(`files.addAllUploadedFiles`),"aria-label":qe.uploaded.length===1?m(`files.addUploadedFile`):m(`files.addAllUploadedFiles`),style:{height:22,padding:`0 7px`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:4,flexShrink:0,border:`1px solid var(--border)`,borderRadius:4,background:`var(--bg-panel)`,color:`var(--accent)`,cursor:`pointer`,fontSize:`var(--text-sm)`,fontWeight:600,whiteSpace:`nowrap`},children:[(0,E.jsx)(G9,{}),m(`files.mention`)]}),(0,E.jsx)(K9,{onClick:()=>Je(null),title:m(`files.dismissUploadResults`)})]}),qe.errors.map(e=>(0,E.jsxs)(`div`,{title:e.error,style:{display:`flex`,alignItems:`center`,gap:4,marginTop:3,minWidth:0,fontSize:`var(--text-xs)`,color:`var(--status-error)`},children:[(0,E.jsxs)(`svg`,{width:p.sm,height:p.sm,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{flexShrink:0},"aria-hidden":`true`,children:[(0,E.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,E.jsx)(`path`,{d:`M12 8v5`}),(0,E.jsx)(`path`,{d:`M12 17h.01`})]}),(0,E.jsx)(`span`,{style:{minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.name})]},e.name))]})]}),!s&&(0,E.jsxs)(gte,{children:[(0,E.jsx)(hte,{message:z,onMessageChange:se,commitBusy:ce||we,canCommit:F.length+j.length>0,onCommit:ht,pushBusy:je,canPush:ae.hasUpstream?ae.ahead>0:!!ae.branch&&ae.branch!==`HEAD`,onPush:ct,pullBusy:Ie,canPull:ae.hasUpstream&&ae.behind>0,onPull:lt,aiBusy:me,canAiGenerate:F.length+j.length>0,onAiGenerate:()=>{se(``),mt()},autoGenerateOnEmpty:Oe,hasModelForAuto:Ae,aiModelHint:(()=>{if(Ee.commitMessageUseCurrentModel===!0)return m(`git.ai.usingCurrentModel`);let e=typeof Ee.commitMessageModel==`string`?Ee.commitMessageModel:``;return e?m(`git.ai.usingModel`,{model:e}):``})(),t:m}),Ne&&(0,E.jsxs)(`div`,{role:`status`,"aria-live":`polite`,style:{marginTop:4,padding:`6px 8px`,borderRadius:6,border:`1px solid ${Ne.ok?`var(--status-success)`:`var(--status-error)`}`,background:`var(--bg)`,fontSize:`var(--text-sm)`,lineHeight:1.5},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,marginBottom:4},children:[(0,E.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:Ne.ok?`var(--status-success)`:`var(--status-error)`,flexShrink:0}}),(0,E.jsx)(`span`,{style:{color:`var(--text-muted)`,flex:1,minWidth:0},children:m(Ne.ok?`files.pushSuccess`:`files.pushFailed`)}),(0,E.jsx)(`button`,{onClick:()=>Pe(null),"aria-label":m(`files.dismissError`),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:16,height:16,padding:0,background:`none`,border:`none`,borderRadius:4,color:`var(--text-dim)`,cursor:`pointer`,flexShrink:0},children:(0,E.jsx)(Mi,{size:p.base})})]}),Ne.output&&(0,E.jsx)(`pre`,{style:{margin:0,maxHeight:140,overflow:`auto`,whiteSpace:`pre-wrap`,wordBreak:`break-all`,color:Ne.ok?`var(--text-muted)`:`var(--status-error)`,fontFamily:`var(--font-mono)`},children:Ne.output})]}),Re&&(0,E.jsxs)(`div`,{role:`status`,"aria-live":`polite`,style:{marginTop:4,padding:`6px 8px`,borderRadius:6,border:`1px solid ${Re.ok?`var(--status-success)`:`var(--status-error)`}`,background:`var(--bg)`,fontSize:`var(--text-sm)`,lineHeight:1.5},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,marginBottom:4},children:[(0,E.jsx)(`span`,{style:{width:7,height:7,borderRadius:`50%`,background:Re.ok?`var(--status-success)`:`var(--status-error)`,flexShrink:0}}),(0,E.jsx)(`span`,{style:{color:`var(--text-muted)`,flex:1,minWidth:0},children:m(Re.ok?`files.pullSuccess`:`files.pullFailed`)}),(0,E.jsx)(`button`,{onClick:()=>ze(null),"aria-label":m(`files.dismissError`),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:16,height:16,padding:0,background:`none`,border:`none`,borderRadius:4,color:`var(--text-dim)`,cursor:`pointer`,flexShrink:0},children:(0,E.jsx)(Mi,{size:p.base})})]}),Re.output&&(0,E.jsx)(`pre`,{style:{margin:0,maxHeight:140,overflow:`auto`,whiteSpace:`pre-wrap`,wordBreak:`break-all`,color:Re.ok?`var(--text-muted)`:`var(--status-error)`,fontFamily:`var(--font-mono)`},children:Re.output})]}),ue&&(0,E.jsx)(X9,{message:ue,onDismiss:()=>de(null)}),R&&(0,E.jsx)(X9,{message:z9(R,m),onDismiss:()=>oe(null)}),ge&&(0,E.jsx)(X9,{message:ge,onDismiss:()=>ve(null)}),(0,E.jsx)(Y9,{prefix:m(`files.stagedPrefix`),count:re.length,additions:te.additions,deletions:te.deletions,t:m}),re.length>0?re.map(n=>(0,E.jsx)(J9,{status:n,cwd:e,onOpenFile:t,onStageToggle:e=>void ft(e,!0),unstage:!0,t:m},`staged-${n.filePath}`)):(0,E.jsx)(`div`,{style:{padding:`8px 10px`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`,textAlign:`center`},children:m(`files.noStagedChanges`)}),(0,E.jsx)(`div`,{style:{height:6}}),(0,E.jsx)(Y9,{prefix:m(`files.unstagedPrefix`),count:ie.length,additions:P.additions,deletions:P.deletions,t:m}),ie.length>0?ie.map(n=>(0,E.jsx)(J9,{status:n,cwd:e,onOpenFile:t,onStageToggle:e=>void ft(e,!1),t:m},n.filePath)):(0,E.jsx)(`div`,{style:{padding:`8px 10px`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`,textAlign:`center`},children:m(`files.noUnstagedChanges`)})]}),s&&(0,E.jsxs)(_te,{ref:x,children:[y?(0,E.jsx)(`div`,{style:{padding:`8px 12px`,fontSize:`var(--text-sm)`,color:`var(--status-error)`},children:z9(y,m)}):(D?O:h).map(n=>(0,E.jsx)(q9,{node:n,depth:0,cwd:e,onOpenFile:t,onAtMention:i,expandedPaths:S,onToggleExpanded:rt,refreshToken:$e,highlightedPaths:k,gitStatusByPath:tt,changedDirectoryPaths:nt,t:m},n.fullPath)),!_&&!y&&h.length===0&&(0,E.jsx)(`div`,{style:{padding:`8px 12px`,fontSize:`var(--text-sm)`,color:`var(--text-dim)`},children:m(`files.noFiles`)})]}),(0,E.jsx)(YS,{open:Se,title:m(`git.ai.notConfiguredTitle`),description:m(`git.ai.notConfiguredDesc`),confirmText:m(`git.ai.goToConfig`),cancelText:m(`sidebar.cancel`),onCancel:()=>Ce(!1),onConfirm:()=>{Ce(!1),u?.(`git`)},icon:(0,E.jsx)(Si,{size:p[`5xl`],style:{color:`var(--accent)`}})}),(0,E.jsx)(YS,{open:fe,title:m(`files.commitTitle`),description:(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`div`,{children:m(`files.confirmStageAllCommit`,{count:j.length})}),z.trim()!==``&&(0,E.jsx)(`div`,{style:{marginTop:8,padding:`6px 10px`,background:`var(--bg)`,border:`1px solid var(--border)`,borderRadius:6,fontFamily:`var(--font-mono)`,fontSize:`var(--text-sm)`,color:`var(--text-muted)`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,maxHeight:120,overflowY:`auto`,textAlign:`left`},children:z.trim()})]}),confirmText:m(`files.stageAllAndCommit`),cancelText:m(`sidebar.cancel`),onCancel:()=>pe(!1),onConfirm:()=>{pe(!1),pt(!0)},icon:(0,E.jsxs)(`svg`,{width:p[`5xl`],height:p[`5xl`],viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--status-warning)`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{flexShrink:0,marginTop:1},children:[(0,E.jsx)(`path`,{d:`M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z`}),(0,E.jsx)(`path`,{d:`m9 12 2 2 4-4`})]})})]})});function yte({cwd:e,onOpenFile:t,explorerRefreshKey:n,onExplorerRefresh:r,onAtMention:i,onAtMentions:a,sessionId:o,onOpenConfig:s}){let{t:c}=N(),[l,u]=(0,d.useState)(0),[f,m]=(0,d.useState)(!1),[h,g]=(0,d.useState)(0),[_,v]=(0,d.useState)(!0),[y,b]=(0,d.useState)(!1),x=(0,d.useRef)(null),S=(0,d.useRef)(null),[C,w]=(0,d.useState)(!1),[T,D]=(0,d.useState)(``),O=(0,d.useRef)(null);return(0,d.useEffect)(()=>{C&&O.current?.focus()},[C]),Wi(()=>{n!==void 0&&u(e=>e+1)},[n]),e?(0,E.jsx)(x9,{title:c(`files.explorer`),open:!0,onToggle:()=>{},collapsible:!1,testId:`explorer-scroll`,hintTestId:`explorer`,style:{flex:1,minHeight:0},scrollStyle:{background:`var(--bg)`},actions:(0,E.jsx)(y9,{items:[{key:`git`,testId:`explorer-changes-toggle`,onClick:()=>v(e=>!e),title:c(`sidebar.changedFiles`,{count:h}),ariaPressed:!_,color:h>0?`var(--accent)`:`var(--text-muted)`,background:_?void 0:`var(--bg-selected)`,borderColor:_?void 0:`var(--accent)`,icon:(0,E.jsx)(Zr,{size:p.lg})},{key:`search`,testId:`explorer-search-toggle`,onClick:()=>{C&&D(``),w(e=>!e)},title:c(`files.search`),ariaPressed:C,color:C?`var(--accent)`:`var(--text-muted)`,background:C?`var(--bg-selected)`:void 0,icon:(0,E.jsx)(vi,{size:p.lg})},{key:`upload`,onClick:()=>S.current?.openUploadPicker(),disabled:f,title:c(`sidebar.uploadFilesTitle`),color:`var(--text-muted)`,icon:(0,E.jsx)(fi,{size:p.base})},{key:`refresh`,onClick:()=>{r?r():u(e=>e+1),b(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>b(!1),2e3)},title:c(`sidebar.refreshExplorer`),skipHover:y,color:y?`var(--status-success)`:`var(--text-muted)`,background:y?`color-mix(in srgb, var(--status-success) 18%, transparent)`:void 0,icon:y?(0,E.jsx)(Rr,{size:p.lg,color:`var(--status-success)`,strokeWidth:2.5}):(0,E.jsx)(mi,{size:p.lg})}]}),headerExtra:C?(0,E.jsxs)(`div`,{"data-testid":`explorer-search`,style:{display:`flex`,alignItems:`center`,gap:4,width:`100%`,minWidth:0,padding:`4px 8px`,background:`var(--bg)`,borderBottom:`1px solid var(--border)`,boxSizing:`border-box`},children:[(0,E.jsx)(vi,{size:p.lg,color:`var(--text-muted)`,style:{flexShrink:0}}),(0,E.jsx)(`input`,{ref:O,"data-testid":`explorer-search-input`,value:T,onChange:e=>D(e.target.value),placeholder:c(`files.searchPlaceholder`),"aria-label":c(`files.search`),style:{flex:1,minWidth:0,background:`transparent`,border:`none`,outline:`none`,color:`var(--text)`,fontSize:`var(--text-sm)`}}),T&&(0,E.jsx)(`button`,{type:`button`,onClick:()=>{D(``),O.current?.focus()},"aria-label":c(`chat.clearSearch`),style:{border:`none`,background:`transparent`,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-sm)`,display:`flex`,alignItems:`center`,justifyContent:`center`,width:16,height:16,padding:0,flexShrink:0},children:(0,E.jsx)(Mi,{size:p.base})})]}):void 0,children:(0,E.jsx)(vte,{ref:S,cwd:e,onOpenFile:t??(()=>{}),refreshKey:l,searchQuery:T,onAtMention:i,onAtMentions:a,onUploadBusyChange:m,changesCollapsed:_,onChangesCountChange:g,sessionId:o,onOpenConfig:s})}):null}function bte({geometries:e,messages:t,onAddMessage:n,onRemoveMessage:r,onUpdateMessage:i,widgets:a,closedKeys:o,onReopen:s}){let{t:c}=N(),[l,u]=(0,d.useState)(null),[f,p]=(0,d.useState)(null),m=(0,d.useRef)(null);(0,d.useEffect)(()=>()=>{m.current&&clearTimeout(m.current)},[]);let h=e=>a.find(t=>t.key===e)?.lines[0],g=(e,t,n)=>{s(e),p({key:e,x:t,y:n}),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>p(null),2500)},_=[...new Set([...Object.keys(e),...o.keys()])].map(t=>[t,e[t]]);return(0,E.jsxs)(`div`,{style:{height:`100%`,display:`flex`,flexDirection:`column`,background:`var(--bg)`},children:[_.length===0?(0,E.jsx)(`div`,{style:{padding:`32px 16px`,textAlign:`center`,color:`var(--text-dim)`,fontSize:`var(--text-lg)`,lineHeight:1.6},children:c(`config.widgets.empty`)}):(0,E.jsx)(`div`,{style:{flex:1,minHeight:0,overflowY:`auto`,padding:10,display:`flex`,flexDirection:`row`,flexWrap:`wrap`,alignContent:`flex-start`,gap:6},children:_.map(([e,a])=>{let s=t[e]??[],d=o.has(e),f=h(e);return(0,E.jsxs)(`div`,{"data-testid":`widget-config-item-${e}`,style:{flex:`1 1 200px`,boxSizing:`border-box`,padding:`8px 10px`,borderRadius:5,background:`var(--bg-panel)`,border:`1px solid var(--border)`},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:7,flexWrap:`wrap`},children:[(0,E.jsxs)(`div`,{style:{minWidth:0,flex:`1 1 120px`},children:[(0,E.jsx)(`div`,{style:{fontSize:`var(--text-base)`,fontWeight:600,fontFamily:`var(--font-mono)`,color:`var(--text)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e}),a&&(0,E.jsxs)(`div`,{style:{marginTop:2,fontSize:`var(--text-sm)`,fontFamily:`var(--font-mono)`,color:`var(--text-dim)`},children:[c(`config.widgets.x`),`: `,a.x,` `,c(`config.widgets.y`),`: `,a.y,` ·`,` `,c(`config.widgets.width`),`: `,a.width,` `,c(`config.widgets.height`),`:`,` `,a.height]})]}),(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,flexShrink:0},children:[d&&(0,E.jsxs)(`button`,{type:`button`,"data-testid":`widget-expand-${e}`,"aria-label":c(`widgets.reopen`),title:c(`widgets.reopen`),onClick:t=>g(e,t.clientX,t.clientY),style:{display:`flex`,alignItems:`center`,gap:4,padding:`4px 8px`,borderRadius:5,border:`1px solid var(--border)`,background:`var(--bg)`,color:`var(--text-muted)`,fontSize:`var(--text-sm)`,cursor:`pointer`},className:`hover-shift`,children:[(0,E.jsx)(qr,{size:13,"aria-hidden":!0}),c(`widgets.reopen`)]}),(0,E.jsxs)(`button`,{type:`button`,"data-testid":`widget-bind-${e}`,onClick:()=>u(e),style:{display:`flex`,alignItems:`center`,gap:4,padding:`4px 8px`,borderRadius:5,border:`1px solid var(--border)`,background:`var(--bg)`,color:`var(--text-muted)`,fontSize:`var(--text-sm)`,cursor:`pointer`},children:[(0,E.jsx)(ii,{size:13,"aria-hidden":!0}),c(`config.widgets.bind`)]})]})]}),f&&(0,E.jsx)(`div`,{style:{marginTop:4,fontSize:`var(--text-sm)`,color:`var(--text-muted)`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:f}),(0,E.jsx)(JK,{messages:s,onAdd:t=>n(e,t),onRemove:t=>r(e,t),onUpdate:(t,n)=>i(e,t,n),bindOpen:l===e,onBindOpenChange:e=>{e||u(null)},ns:`widgets`,bindTestIdPrefix:`widget-bind`,editTestIdPrefix:`widget-edit`,chipTestIdPrefix:`widget-bound-${e}`,bindHintArgs:{key:e}})]},e)})}),f&&(0,E.jsx)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":`widget-expanded-toast`,style:{position:`fixed`,left:Math.min(f.x,window.innerWidth-180),top:f.y+12,transform:`translateX(-50%)`,zIndex:2e3,padding:`8px 12px`,borderRadius:7,border:`1px solid var(--status-success)`,background:`var(--bg)`,color:`var(--text)`,fontSize:`var(--text-base)`,boxShadow:`0 4px 16px var(--shadow-strong)`,whiteSpace:`nowrap`},children:c(`widgets.expandedToChat`,{key:f.key})})]})}var xte=e=>window.history.replaceState(null,``,e),Z9=36,Ste=176,Cte=224,Q9=86,$9=116;function wte(){let[e,t]=(0,d.useState)(!1);(0,d.useEffect)(()=>{t(!0)},[]);let[n]=(0,d.useState)(()=>Pq(new URLSearchParams(window.location.search))),{isDark:r,toggleTheme:i}=Tr(),{locale:a,setLocale:o,t:s,supportedLocales:c}=N(),l=ne();wq();let{settingsValue:u,defaultThinkingLevel:f,setDefaultThinkingLevel:m,compaction:h,retry:g,defaultProjectTrust:_,setDefaultProjectTrust:v,subagents:y,savedWorkspaces:b,handleSavedWorkspacesChange:x,widgetGeometries:S,setWidgetGeometry:C,widgetMessages:w,addWidgetMessage:T,removeWidgetMessage:D,updateWidgetMessage:O,fontScale:k,setFontScale:A}=Ut({isDark:r,toggleTheme:i}),[j,M]=(0,d.useState)(null),{selectedSession:ee,effectiveNewSessionCwd:F,showChat:I,projectTrustCwd:te,refreshKey:re,sessionKey:ie,explorerRefreshKey:R,setExplorerRefreshKey:oe,modelsRefreshKey:z,setModelsRefreshKey:se,activeCwd:ue,initialCwdStatus:de,initialCwdError:me,initialSessionRestored:he,projectTrust:ge,projectTrustDialogOpen:_e,setProjectTrustDialogOpen:ve,projectTrustBusy:ye,projectTrustError:be,setProjectTrustError:xe,extensionDialogActiveRef:Se,handleSelectSession:Te,handleNewSession:Ee,handleSessionCreated:De,handleAgentEnd:Oe,handleSessionRenamed:ke,handleSessionForked:Ae,handleSessionDeleted:je,handleSessionUnseen:Me,handleCwdChange:Ne,handleTrustProject:Pe,handleExplorerRefresh:Le,handleInitialRestoreDone:ze}=Qe({initialNavigation:n,onProjectSwitch:()=>{M(null),Be(e=>e.filter(e=>e.kind!==`file`)),Ve(null),xte(`/`)},onSessionSelected:e=>{l&&!e&&lt(!1)},onTopPanelReset:()=>M(null)}),{setSavedTabs:Be,setActiveSavedId:Ve,configTabOpen:He,configSection:Ue,setConfigSection:We,configTabActive:Ge,activeFileTab:Ke,fileTabs:qe,modelConfigFocus:Je,handleOpenFile:Ye,openConfigTab:Xe,handleOpenModelConfig:Ze,closeConfigTab:$e,handleCloseMainTab:tt}=bq({onSessionSelected:()=>{Pt(!1),l&&lt(!1)},onRefreshModels:()=>se(e=>e+1)}),{value:nt}=P(we),rt=(0,d.useMemo)(()=>nt?Fe(nt):0,[nt]),it=(0,d.useMemo)(()=>nt?Ie(nt,s(`common.plugins`)):[],[nt,s]),[at,ot]=(0,d.useState)(!1),st=(0,d.useCallback)(e=>{Ye(e,hG(e),{sourceSessionId:ee?.id??null})},[Ye,ee?.id]),[ct,lt]=(0,d.useState)(!0),[ut,dt]=(0,d.useState)(!1),ft=(0,d.useRef)(280),pt=(0,d.useRef)(280),mt=(0,d.useCallback)(()=>typeof window>`u`?480:ce({viewportWidth:window.innerWidth,rightPanelOpen:!1,rightPanelWidth:0}),[]),ht=fe({ariaLabel:s(`layout.resizeSidebar`),cssVariable:`--sidebar-width`,defaultWidth:280,getMaxWidth:mt,growthDirection:`right`,maxWidth:480,minWidth:180,storageKey:`pi-sidebar-width`,widthRef:ft}),gt=ht.reclampWidth,_t=fe({ariaLabel:s(`layout.resizeWidgetPanel`),cssVariable:`--widget-panel-width`,defaultWidth:280,getMaxWidth:()=>typeof window>`u`?560:le({viewportWidth:window.innerWidth,sidebarOpen:ct,sidebarWidth:ht.width}),growthDirection:`left`,maxWidth:560,minWidth:200,storageKey:`pi-widget-panel-width`,widthRef:pt});(0,d.useEffect)(()=>{l&&lt(!1)},[l,lt]),(0,d.useEffect)(()=>{dt(!0)},[]),(0,d.useEffect)(()=>{gt()},[gt]);let vt=(0,d.useRef)(void 0);(0,d.useEffect)(()=>{ue!==vt.current&&(vt.current=ue,Ce(ue),we.load().catch(e=>console.error(`[pi-web] load updates:`,e)))},[ue]);let yt=(0,d.useRef)(null),bt=(0,d.useRef)(null),xt=(0,d.useRef)(null),St=(0,d.useRef)(null),Ct=(0,d.useRef)(null),wt=pe(),Tt=(0,d.useCallback)(()=>{wt.schedule(()=>{M(null)},150)},[wt]),Et=wt.cancel,[Dt,Ot]=(0,d.useState)(null),kt=(0,d.useCallback)(e=>{l&&lt(!1),M(t=>t===e?null:e)},[l]),At=(0,d.useCallback)(()=>{l&&M(null),lt(e=>!e)},[l]);(0,d.useEffect)(()=>{if(!j)return;let e=()=>{if(document.hidden)return;let e=bt.current?.getBoundingClientRect();if(e){if(j===`language`&&!l&&St.current){let t=St.current.getBoundingClientRect(),n=xt.current?.getBoundingClientRect(),r=n?.top??t.top,i=n?.bottom??t.bottom,a=Math.min(Ste,n?.width??e.width),o=Math.min(t.left-1,Math.max(n?.left??e.left,(n?.right??e.right)-a)),s=i+4;Ot({top:s+Q9>window.innerHeight-4?r-Q9:s,left:o,width:a});return}if(j===`fontSize`&&!l&&Ct.current){let t=Ct.current.getBoundingClientRect(),n=xt.current?.getBoundingClientRect(),r=n?.top??t.top,i=n?.bottom??t.bottom,a=Math.min(Cte,n?.width??e.width),o=Math.min(t.left-1,Math.max(n?.left??e.left,(n?.right??e.right)-a)),s=i+4;Ot({top:s+$9>window.innerHeight-4?r-$9:s,left:o,width:a});return}Ot({top:e.bottom,left:e.left,width:e.width})}};e();let t=new ResizeObserver(e);return bt.current&&t.observe(bt.current),St.current&&t.observe(St.current),Ct.current&&t.observe(Ct.current),()=>t.disconnect()},[j,l]);let{widgetPanelOpen:jt,setWidgetPanelOpen:Mt,widgetsTabActive:Nt,setWidgetsTabActive:Pt,extensionWidgets:Ft,closedWidgets:It,handleCloseWidget:Lt,handleReopenWidget:zt,handleExtensionWidgetsChange:Bt,rightSidebarOpen:Vt,setRightSidebarOpen:Ht,closedWidgetCount:Wt}=xq({widgetGeometries:S,setWidgetGeometry:C}),Gt=l?jt:Vt,Kt=(0,d.useCallback)((e,t)=>{yt.current?.insertText(jq(e,t))},[]),qt=(0,d.useCallback)(e=>{let t=Nq(e);t&&yt.current?.insertText(t)},[]),Jt=(0,d.useCallback)((e,t,n)=>{yt.current?.insertText(Mq(e,t,n))},[]),Yt=n.sessionId;ae({onNewSession:e=>Ee(`kb-${Date.now()}`,e),activeCwd:ue});let Xt=he&&!I,Zt=[{id:dq,label:s(`tabs.chat`),closable:!1,icon:(0,E.jsx)(`svg`,{width:p.lg,height:p.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,E.jsx)(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`})})},{id:pq,label:s(`tabs.widgets`),badge:Wt,closable:!1,icon:(0,E.jsxs)(`svg`,{width:p.lg,height:p.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`rect`,{x:`3`,y:`3`,width:`7`,height:`7`,rx:`1`}),(0,E.jsx)(`rect`,{x:`14`,y:`3`,width:`7`,height:`7`,rx:`1`}),(0,E.jsx)(`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`}),(0,E.jsx)(`rect`,{x:`14`,y:`14`,width:`7`,height:`7`,rx:`1`})]})},...He?[{id:fq,label:s(`config.title`),closable:!0,icon:(0,E.jsx)(bi,{width:p.lg,height:p.lg,"aria-hidden":`true`})}]:[],...qe],Qt=ue?hG(ue)||ue:null,$t=Qt?`Pi Web · ${Qt}`:`Pi Web`;(0,d.useEffect)(()=>{document.title=$t},[$t]),(0,d.useEffect)(()=>{let e=()=>{document.title=$t};return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[$t]);let en=L(),tn=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`div`,{ref:xt,style:{padding:`2px 8px`,flexShrink:0,display:`flex`,justifyContent:`space-between`,gap:4},children:[{label:s(`config.title`),onClick:()=>{M(null),Xe()},disabled:!1,badge:rt,icon:(0,E.jsx)(bi,{width:p[`3xl`],height:p[`3xl`],"aria-hidden":`true`})},...en===`granted`||en==="default"||en===`denied`?[{label:s(en===`granted`?`notify.permission.grantedHint`:en===`denied`?`notify.permission.deniedHint`:`notify.permission.requestHint`),ariaLabel:s(en===`granted`?`notify.permission.granted`:en===`denied`?`notify.permission.denied`:`notify.permission.request`),onClick:en===`granted`?()=>{}:()=>Dn(),disabled:!1,testId:`notify-permission`,color:en===`granted`?`var(--status-success)`:en===`denied`?`var(--status-error)`:`var(--accent)`,icon:(0,E.jsx)(`svg`,{width:p[`3xl`],height:p[`3xl`],viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:en===`denied`?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`path`,{d:`M8.7 3A6 6 0 0 1 18 8a21.3 21.3 0 0 0 .6 5`}),(0,E.jsx)(`path`,{d:`M17 17H3s3-2 3-9a4.67 4.67 0 0 1 .3-1.7`}),(0,E.jsx)(`path`,{d:`M10.3 21a1.94 1.94 0 0 0 3.4 0`}),(0,E.jsx)(`path`,{d:`m2 2 20 20`})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`path`,{d:`M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9`}),(0,E.jsx)(`path`,{d:`M10.3 21a1.94 1.94 0 0 0 3.4 0`})]})})}]:[],{label:s(r?`theme.light`:`theme.dark`),onClick:()=>i(),disabled:!1,ariaPressed:r,icon:r?(0,E.jsxs)(`svg`,{width:p[`3xl`],height:p[`3xl`],viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,E.jsx)(`circle`,{cx:`12`,cy:`12`,r:`5`}),(0,E.jsx)(`line`,{x1:`12`,y1:`1`,x2:`12`,y2:`3`}),(0,E.jsx)(`line`,{x1:`12`,y1:`21`,x2:`12`,y2:`23`}),(0,E.jsx)(`line`,{x1:`4.22`,y1:`4.22`,x2:`5.64`,y2:`5.64`}),(0,E.jsx)(`line`,{x1:`18.36`,y1:`18.36`,x2:`19.78`,y2:`19.78`}),(0,E.jsx)(`line`,{x1:`1`,y1:`12`,x2:`3`,y2:`12`}),(0,E.jsx)(`line`,{x1:`21`,y1:`12`,x2:`23`,y2:`12`}),(0,E.jsx)(`line`,{x1:`4.22`,y1:`19.78`,x2:`5.64`,y2:`18.36`}),(0,E.jsx)(`line`,{x1:`18.36`,y1:`5.64`,x2:`19.78`,y2:`4.22`})]}):(0,E.jsx)(`svg`,{width:p[`3xl`],height:p[`3xl`],viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,E.jsx)(`path`,{d:`M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z`})})},{label:s(`common.language`),onClick:()=>{l&&lt(!1),Et(),M(`language`)},onMouseEnter:()=>{Et(),j!==`language`&&M(`language`)},onMouseLeave:Tt,disabled:!1,ref:St,ariaExpanded:j===`language`,noTooltip:!0,icon:(0,E.jsxs)(`svg`,{width:p[`3xl`],height:p[`3xl`],viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,E.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,E.jsx)(`line`,{x1:`2`,y1:`12`,x2:`22`,y2:`12`}),(0,E.jsx)(`path`,{d:`M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z`})]})},{label:s(`theme.fontSize`),onClick:()=>{l&&lt(!1),Et(),M(`fontSize`)},onMouseEnter:()=>{Et(),j!==`fontSize`&&M(`fontSize`)},onMouseLeave:Tt,disabled:!1,ref:Ct,ariaExpanded:j===`fontSize`,noTooltip:!0,icon:(0,E.jsxs)(`svg`,{width:p[`3xl`],height:p[`3xl`],viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,E.jsx)(`polyline`,{points:`4 7 4 4 20 4 20 7`}),(0,E.jsx)(`line`,{x1:`9`,y1:`20`,x2:`15`,y2:`20`}),(0,E.jsx)(`line`,{x1:`12`,y1:`4`,x2:`12`,y2:`20`})]})}].map(({label:e,onClick:t,onMouseEnter:n,onMouseLeave:r,disabled:i,icon:a,ref:o,ariaPressed:s,ariaExpanded:c,noTooltip:l,badge:u,color:d,ariaLabel:f,testId:p})=>{let m=(0,E.jsxs)(`button`,{ref:o,onClick:t,disabled:i,"data-testid":p,"aria-label":f??e,"aria-pressed":s,"aria-haspopup":c===void 0?void 0:`menu`,"aria-expanded":c,style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,height:32,padding:0,background:`none`,border:`none`,borderRadius:9,...d?{color:d}:{color:`var(--text-muted)`},cursor:i?`default`:`pointer`,opacity:i?.35:1,transition:`background 0.12s, color 0.12s`,"--hover-color":`var(--text)`},onMouseEnter:n,onMouseLeave:r,className:`hover-shift`,children:[a,u!==void 0&&u>0?(0,E.jsx)(`span`,{"data-testid":`settings-update-badge`,style:{position:`absolute`,top:3,right:3,minWidth:15,height:15,padding:`0 4px`,borderRadius:8,background:`var(--status-error)`,color:`#fff`,fontSize:10,fontWeight:600,lineHeight:`15px`,textAlign:`center`},children:u}):null]});return l?(0,E.jsx)(`div`,{style:{flex:1,minWidth:0,display:`flex`},children:m},e):(0,E.jsx)(qi,{label:e,wrapperStyle:{flex:1,minWidth:0,display:`flex`},children:m},e)})}),rt>0&&!at&&(0,E.jsxs)(`div`,{role:`status`,"data-testid":`update-banner`,style:{display:`flex`,alignItems:`center`,gap:8,padding:`6px 12px`,borderBottom:`1px solid var(--border)`,background:`color-mix(in srgb, var(--status-warning) 10%, var(--bg-panel))`,fontSize:`var(--text-sm)`,color:`var(--text)`,flexShrink:0},children:[(0,E.jsx)(`span`,{style:{flex:1,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:s(`updates.banner`,{items:it.join(`, `)})}),(0,E.jsx)(`button`,{type:`button`,"data-testid":`update-banner-view`,onClick:()=>{Xe(),We(`updates`)},style:{padding:`3px 10px`,border:`1px solid var(--border)`,borderRadius:6,background:`none`,color:`var(--text-muted)`,cursor:`pointer`,fontSize:`var(--text-sm)`,flexShrink:0},children:s(`updates.view`)}),(0,E.jsx)(`button`,{type:`button`,"aria-label":s(`i18n.close`),onClick:()=>ot(!0),style:{padding:`2px 6px`,border:`none`,background:`none`,color:`var(--text-dim)`,cursor:`pointer`,fontSize:`var(--text-sm)`,flexShrink:0},children:`✕`})]}),(0,E.jsx)(tte,{selectedSessionId:ee?.id??null,selectedSession:ee,onSelectSession:Te,onNewSession:Ee,initialSessionId:Yt,skipInitialProjectSelection:n.requestedCwd!==null,onInitialRestoreDone:ze,refreshKey:re,onSessionDeleted:je,onUnseenSession:Me,selectedCwd:ee?.cwd??F,onCwdChange:Ne,savedWorkspaces:b,onSavedWorkspacesChange:x,onOpenFile:Ye})]});if(!e)return(0,E.jsx)(Fq,{});let nn=(0,E.jsx)(qi,{label:s(ct?`sidebar.hide`:`sidebar.show`),children:(0,E.jsx)(`button`,{onClick:At,"aria-label":s(ct?`sidebar.hide`:`sidebar.show`),"aria-pressed":ct,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:Z9,height:Z9,padding:0,background:`none`,border:`none`,borderRight:`1px solid var(--border)`,color:ct?`var(--text)`:`var(--text-muted)`,cursor:`pointer`,flexShrink:0,transition:`color 0.12s`,"--hover-color":`var(--text)`},className:`hover-shift`,children:(0,E.jsxs)(`svg`,{width:p[`4xl`],height:p[`4xl`],viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,E.jsx)(`rect`,{x:`3`,y:`3`,width:p[`4xl`],height:p[`4xl`],rx:`2`}),(0,E.jsx)(`line`,{x1:`9`,y1:`3`,x2:`9`,y2:`21`})]})})}),rn=I&&ge?.requiresTrust&&!ge.trusted?(0,E.jsx)(qi,{label:s(`trust.resourcesNotLoaded`),wrapperStyle:{height:`100%`},children:(0,E.jsxs)(`button`,{type:`button`,onClick:()=>{xe(null),ve(!0)},"aria-label":s(`trust.resourcesNotLoaded`),style:{display:`flex`,alignItems:`center`,gap:6,height:`100%`,padding:l?`0 10px`:`0 12px`,background:`none`,border:`none`,borderLeft:`1px solid var(--border)`,color:`var(--status-warning)`,cursor:`pointer`,flexShrink:0,fontSize:`var(--text-sm)`,whiteSpace:`nowrap`},children:[(0,E.jsxs)(`svg`,{width:p.lg,height:p.lg,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,E.jsx)(`path`,{d:`M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z`}),(0,E.jsx)(`path`,{d:`M12 8v4`}),(0,E.jsx)(`path`,{d:`M12 16h.01`})]}),!l&&(0,E.jsx)(`span`,{children:s(`trust.resourcesNotLoaded`)})]})}):null,an=(0,E.jsx)(qi,{label:s(Gt?`sidebar.hide`:`sidebar.show`),children:(0,E.jsx)(`button`,{onClick:()=>{l?Mt(e=>!e):Ht(e=>!e)},"aria-controls":`widget-panel`,"aria-expanded":Gt,"aria-label":s(Gt?`sidebar.hide`:`sidebar.show`),"data-testid":`widget-panel-toggle`,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:36,height:36,padding:0,background:`none`,border:`none`,borderLeft:`1px solid var(--border)`,color:jt?`var(--text)`:`var(--text-muted)`,cursor:`pointer`,flexShrink:0,transition:`color 0.12s`,"--hover-color":`var(--text)`},className:`hover-shift`,children:(0,E.jsxs)(`svg`,{width:p[`4xl`],height:p[`4xl`],viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,E.jsx)(`rect`,{x:`3`,y:`3`,width:p[`4xl`],height:p[`4xl`],rx:`2`}),(0,E.jsx)(`line`,{x1:`15`,y1:`3`,x2:`15`,y2:`21`})]})})});return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(Re,{value:u,children:(0,E.jsx)(et,{value:{activeTopPanel:j,toggleTopPanel:kt,closeTopPanel:()=>M(null)},children:(0,E.jsx)(E.Fragment,{children:(0,E.jsxs)(Ki,{delayDuration:0,children:[(0,E.jsx)(`style`,{children:`
498
498
  @media (max-width: 640px) {
@@ -505,4 +505,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
505
505
  box-shadow: none;
506
506
  }
507
507
  }
508
- `}),(0,E.jsx)(Pn,{}),(0,E.jsxs)(`div`,{style:{display:`flex`,width:`100%`,height:`var(--app-viewport-height, 100dvh)`,paddingLeft:`env(safe-area-inset-left)`,paddingRight:`env(safe-area-inset-right)`,overflow:`hidden`,background:`var(--bg)`},children:[(0,E.jsx)(`div`,{className:`sidebar-overlay-backdrop${ut?``:` sidebar-mobile-pending`}`,onClick:()=>lt(!1),style:{position:`fixed`,inset:0,zIndex:199,background:`var(--overlay)`,opacity:+!!ct,pointerEvents:ct?`auto`:`none`,transition:`opacity 0.25s ease`}}),(0,E.jsx)(`div`,{ref:ht.panelRef,id:`session-sidebar`,className:`sidebar-container${ct?` sidebar-open`:` sidebar-closed`}${ut?``:` sidebar-mobile-pending`}${ht.isResizing?` sidebar-resizing`:``}`,"data-testid":`sidebar`,style:{"--sidebar-width":`${ht.width}px`,background:`var(--bg-panel)`,borderRight:`1px solid var(--border)`,display:`flex`,flexDirection:`column`,flexShrink:0,paddingTop:`env(safe-area-inset-top)`,paddingBottom:`env(safe-area-inset-bottom)`,zIndex:200},children:tn}),ct&&(0,E.jsx)(qi,{label:`${s(`layout.resizeSidebar`)}: ${s(`layout.resizeHint`)}`,wrapperStyle:{display:`flex`,flex:`0 0 0`,width:0},children:(0,E.jsx)(`div`,{...ht.separatorProps,"aria-controls":`session-sidebar`,className:`panel-resize-handle sidebar-resize-handle${ht.isResizing?` is-resizing`:``}`,"data-resize-handle":`sidebar`})}),(0,E.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`,minWidth:0},children:[j&&Dt&&(0,E.jsxs)(`div`,{onMouseEnter:Et,onMouseLeave:Tt,style:{position:`fixed`,top:Dt.top,left:Dt.left,width:Dt.width,maxHeight:`calc(100dvh - ${Dt.top}px)`,overflowY:`auto`,zIndex:1500},children:[j===`language`&&(0,E.jsx)(`div`,{role:`menu`,"aria-label":s(`common.language`),style:{background:`var(--bg-panel)`,border:`1px solid var(--border)`,overflow:`hidden`,padding:4},children:c.map(e=>(0,E.jsx)(`button`,{type:`button`,onClick:()=>{o(e.id),M(null)},role:`menuitemradio`,"aria-checked":a===e.id,style:{display:`flex`,alignItems:`center`,width:`100%`,height:34,padding:`0 10px`,border:`none`,borderRadius:4,background:a===e.id?`var(--bg-selected)`:`transparent`,color:`var(--text)`,cursor:`pointer`,textAlign:`left`,fontSize:`var(--text-base)`,transition:`background 0.1s`},className:a===e.id?void 0:`hover-shift`,children:(0,E.jsx)(`span`,{children:e.label})},e.id))}),j===`fontSize`&&(0,E.jsxs)(`div`,{role:`menu`,"aria-label":s(`theme.fontSize`),style:{background:`var(--bg-panel)`,border:`1px solid var(--border)`,padding:`10px 12px 12px`},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`var(--text-base)`,color:`var(--text-muted)`,marginBottom:8},children:[(0,E.jsx)(`span`,{children:s(`theme.fontSize`)}),(0,E.jsxs)(`span`,{style:{fontFamily:`var(--font-mono)`,color:`var(--text)`,fontWeight:600},children:[Math.round(k*100),`%`]})]}),(0,E.jsx)(`input`,{type:`range`,min:.85,max:1.3,step:.05,value:k,onChange:e=>A(Number(e.target.value)),"aria-label":s(`theme.fontSize`),style:{width:`100%`,accentColor:`var(--accent)`,cursor:`pointer`}}),(0,E.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,fontSize:`var(--text-xs)`,color:`var(--text-dim)`,marginTop:4},children:[(0,E.jsx)(`span`,{children:`85%`}),(0,E.jsx)(`span`,{children:`130%`})]})]})]}),(0,E.jsxs)(br,{tabs:Zt,activeTabId:Ge?fq:Nt?pq:Ke?mq(Ke.filePath):dq,leftExtra:nn,rightExtra:an,onSelectTab:e=>{if(e===`widgets`){Pt(!0),Ve(null);return}Pt(!1),Ve(e===`chat`?null:e)},onCloseTab:tt,tabBarRef:bt,overlay:(0,E.jsxs)(E.Fragment,{children:[de===`validating`&&(0,E.jsxs)(`div`,{role:`status`,style:{height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:8,padding:24,color:`var(--text-muted)`,textAlign:`center`},children:[(0,E.jsx)(`div`,{style:{fontSize:`var(--text-xl)`,color:`var(--text)`},children:s(`workspace.opening`)}),(0,E.jsx)(`div`,{style:{maxWidth:`min(720px, 100%)`,overflowWrap:`anywhere`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-base)`},children:n.requestedCwd})]}),de===`error`&&(0,E.jsxs)(`div`,{role:`alert`,style:{height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:8,padding:24,color:`var(--text-muted)`,textAlign:`center`},children:[(0,E.jsx)(`div`,{style:{fontSize:`var(--text-xl)`,color:`var(--status-error)`},children:s(`workspace.unable`)}),(0,E.jsx)(`div`,{style:{maxWidth:`min(720px, 100%)`,overflowWrap:`anywhere`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-base)`},children:n.requestedCwd}),(0,E.jsx)(`div`,{style:{maxWidth:720,fontSize:`var(--text-base)`},children:me})]}),Xt&&(ue?(0,E.jsx)(`div`,{style:{height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`var(--text-muted)`,fontSize:`var(--text-2xl)`},children:s(`workspace.selectSession`)}):(0,E.jsxs)(`div`,{style:{height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12,userSelect:`none`},children:[(0,E.jsx)(`div`,{style:{fontSize:`var(--text-6xl)`,fontWeight:700,fontStyle:`italic`,color:`var(--accent)`},children:`Pi Web`}),(0,E.jsx)(`div`,{style:{fontSize:`var(--text-base)`,color:`var(--text-muted)`},children:s(`workspace.selectWorkspace`)})]}))]}),children:[(0,E.jsx)(vr,{id:fq,testId:`config-tab-pane`,children:(0,E.jsx)(lq,{section:Ue,onSectionChange:We,cwd:te,sessionId:ee?.id??null,onClose:$e,onOpenFile:Ye,sidebarWidth:ht.width,onSidebarWidthChange:ht.setWidth,widgetPanelWidth:_t.width,onWidgetPanelWidthChange:_t.setWidth,modelConfigFocus:Je,defaultThinkingLevel:f,onDefaultThinkingLevelChange:m,compaction:h,onCompactionChange:e=>Rt({firstPaint:{compaction:e}}),retry:g,onRetryChange:e=>Rt({firstPaint:{retry:e}}),defaultProjectTrust:_,onDefaultProjectTrustChange:v,subagents:y,onSubagentsChange:e=>Rt({firstPaint:{subagents:{defaultModel:e.defaultModel||void 0,defaultThinking:e.defaultThinking||void 0}}})})}),(0,E.jsx)(vr,{id:Ke?mq(Ke.filePath):`file:`,testId:`file-tab-pane`,children:Ke&&(0,E.jsx)(v9,{filePath:Ke.filePath,cwd:ue??void 0,sourceSessionId:Ke.sourceSessionId,gitRefreshKey:R,initialDisplayMode:Ke.initialDisplayMode,onMentionLines:Jt,onSaved:()=>oe(e=>e+1),onOpenFile:e=>Ye(e,hG(e),{sourceSessionId:Ke.sourceSessionId})})}),(0,E.jsx)(vr,{id:dq,keepAlive:!0,testId:`chat-tab-pane`,scroll:`hidden`,activeWhen:I,children:(0,E.jsx)(`div`,{style:{flex:1,minHeight:0,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:(0,E.jsx)(N7,{session:ee,newSessionCwd:F,onAgentEnd:Oe,onSessionCreated:De,onSessionForked:Ae,modelsRefreshKey:z,onOpenModelConfig:Ze,chatInputRef:yt,onOpenFile:st,onSessionRenamed:ke,windowTitleBase:Qt,toolbarExtra:rn,closedWidgetKeys:It,onCloseWidget:Lt,onExtensionWidgetsChange:Bt,onExtensionDialogChange:e=>{Se.current=e}},ie)})}),(0,E.jsx)(vr,{id:pq,keepAlive:!0,testId:`widgets-tab-pane`,zIndex:1,activeWhen:I,children:(0,E.jsx)(bte,{geometries:S,messages:w,onAddMessage:T,onRemoveMessage:D,onUpdateMessage:O,widgets:Ft,closedKeys:It,onReopen:zt})})]})]}),Gt&&(0,E.jsx)(qi,{label:`${s(`layout.resizeWidgetPanel`)}: ${s(`layout.resizeHint`)}`,wrapperStyle:{display:`flex`,flex:`0 0 0`,width:0},children:(0,E.jsx)(`div`,{..._t.separatorProps,"aria-controls":`widget-panel`,className:`panel-resize-handle widget-panel-resize-handle${_t.isResizing?` is-resizing`:``}`,"data-resize-handle":`widget-panel`})}),!l&&!Vt?null:(0,E.jsx)(`div`,{ref:_t.panelRef,"aria-controls":`widget-panel`,style:l?{position:`fixed`,inset:0,zIndex:250,display:`flex`,flexDirection:`column`}:{"--widget-panel-width":`${_t.width}px`,width:`var(--widget-panel-width)`,display:`flex`,flexDirection:`column`,minWidth:0,overflow:`hidden`,borderLeft:`1px solid var(--border)`,background:`var(--bg)`},children:(0,E.jsx)(yte,{cwd:ee?.cwd??F,onOpenFile:Ye,explorerRefreshKey:R,onExplorerRefresh:Le,onAtMention:Kt,onAtMentions:qt,sessionId:ee?.id??null,onOpenConfig:e=>Xe(e)})})]}),_e&&te&&(0,E.jsx)(Ree,{cwd:te,busy:ye,error:be,onCancel:()=>{ye||ve(!1)},onConfirm:()=>void Pe()})]})})})}),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(ate,{}),(0,E.jsx)(fte,{})]})]})}var Tte=class extends d.Component{constructor(...e){super(...e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){Ke(e,`render error`)}render(){return this.state.hasError?(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12,height:`100vh`,color:`var(--text)`,fontSize:`var(--text-base)`},children:[(0,E.jsx)(`span`,{children:`⚠️`}),(0,E.jsx)(`span`,{children:`Something went wrong while rendering.`}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>{this.setState({hasError:!1})},style:{border:`1px solid var(--border)`,background:`none`,color:`var(--text)`,borderRadius:6,padding:`4px 14px`,cursor:`pointer`},children:`Try again`})]}):this.props.children}};function Ete(){return(0,d.useEffect)(()=>{if(!(`serviceWorker`in navigator))return;let e=()=>{navigator.serviceWorker.register(`/sw.js?v=0.15.7`,{scope:`/`,updateViaCache:`none`}).catch(e=>{console.error(`Failed to register the Pi Web service worker:`,e)})};if(document.readyState===`complete`){e();return}return window.addEventListener(`load`,e,{once:!0}),()=>window.removeEventListener(`load`,e)},[]),null}var Dte=`piE2eFixtureDir`;function Ote(){return typeof window>`u`?null:new URL(window.location.href).searchParams.get(`piE2eFixtureDir`)}function kte(){if(typeof document>`u`)return;let e=Ote();e&&(document.cookie=`${Dte}=${encodeURIComponent(e)}; path=/; SameSite=Lax`)}async function Ate(){kte(),Rq(!0),Vq();let e=zq(`boot`),t=null;try{let n=await ye.load();e(`preferences catalog loaded`,`locale=${n.firstPaint?.locale}`);let r=n.firstPaint?.locale;(r===`en`||r===`zh-CN`)&&(t=r,document.documentElement.lang=r===`zh-CN`?`zh-CN`:`en`);let i=n.theme;if(i===`dark`?document.documentElement.classList.add(`dark`):document.documentElement.classList.remove(`dark`),i)try{localStorage.setItem(`pi-theme`,i)}catch{}}catch{}e(`root render`),window.addEventListener(`unhandledrejection`,e=>{Ke(e.reason,`unhandled promise rejection`)}),window.addEventListener(`error`,e=>{let t=(e.error instanceof Error?e.error.message:``)||e.message||``;t.includes(`ResizeObserver loop`)||t.startsWith(`Script error`)||Ke(e.error??e.message,`uncaught error`)}),(0,f.createRoot)(document.getElementById(`root`)).render((0,E.jsx)(d.StrictMode,{children:(0,E.jsx)(Tte,{children:(0,E.jsxs)(M,{initialLocale:t,children:[(0,E.jsx)(wte,{}),(0,E.jsx)(Ete,{})]})})}))}Ate();export{l0 as a,t2 as i,R3 as n,T as o,H3 as r,i as s,A2 as t};
508
+ `}),(0,E.jsx)(Pn,{}),(0,E.jsxs)(`div`,{style:{display:`flex`,width:`100%`,height:`var(--app-viewport-height, 100dvh)`,paddingLeft:`env(safe-area-inset-left)`,paddingRight:`env(safe-area-inset-right)`,overflow:`hidden`,background:`var(--bg)`},children:[(0,E.jsx)(`div`,{className:`sidebar-overlay-backdrop${ut?``:` sidebar-mobile-pending`}`,onClick:()=>lt(!1),style:{position:`fixed`,inset:0,zIndex:199,background:`var(--overlay)`,opacity:+!!ct,pointerEvents:ct?`auto`:`none`,transition:`opacity 0.25s ease`}}),(0,E.jsx)(`div`,{ref:ht.panelRef,id:`session-sidebar`,className:`sidebar-container${ct?` sidebar-open`:` sidebar-closed`}${ut?``:` sidebar-mobile-pending`}${ht.isResizing?` sidebar-resizing`:``}`,"data-testid":`sidebar`,style:{"--sidebar-width":`${ht.width}px`,background:`var(--bg-panel)`,borderRight:`1px solid var(--border)`,display:`flex`,flexDirection:`column`,flexShrink:0,paddingTop:`env(safe-area-inset-top)`,paddingBottom:`env(safe-area-inset-bottom)`,zIndex:200},children:tn}),ct&&(0,E.jsx)(qi,{label:`${s(`layout.resizeSidebar`)}: ${s(`layout.resizeHint`)}`,wrapperStyle:{display:`flex`,flex:`0 0 0`,width:0},children:(0,E.jsx)(`div`,{...ht.separatorProps,"aria-controls":`session-sidebar`,className:`panel-resize-handle sidebar-resize-handle${ht.isResizing?` is-resizing`:``}`,"data-resize-handle":`sidebar`})}),(0,E.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,overflow:`hidden`,minWidth:0},children:[j&&Dt&&(0,E.jsxs)(`div`,{onMouseEnter:Et,onMouseLeave:Tt,style:{position:`fixed`,top:Dt.top,left:Dt.left,width:Dt.width,maxHeight:`calc(100dvh - ${Dt.top}px)`,overflowY:`auto`,zIndex:1500},children:[j===`language`&&(0,E.jsx)(`div`,{role:`menu`,"aria-label":s(`common.language`),style:{background:`var(--bg-panel)`,border:`1px solid var(--border)`,overflow:`hidden`,padding:4},children:c.map(e=>(0,E.jsx)(`button`,{type:`button`,onClick:()=>{o(e.id),M(null)},role:`menuitemradio`,"aria-checked":a===e.id,style:{display:`flex`,alignItems:`center`,width:`100%`,height:34,padding:`0 10px`,border:`none`,borderRadius:4,background:a===e.id?`var(--bg-selected)`:`transparent`,color:`var(--text)`,cursor:`pointer`,textAlign:`left`,fontSize:`var(--text-base)`,transition:`background 0.1s`},className:a===e.id?void 0:`hover-shift`,children:(0,E.jsx)(`span`,{children:e.label})},e.id))}),j===`fontSize`&&(0,E.jsxs)(`div`,{role:`menu`,"aria-label":s(`theme.fontSize`),style:{background:`var(--bg-panel)`,border:`1px solid var(--border)`,padding:`10px 12px 12px`},children:[(0,E.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,fontSize:`var(--text-base)`,color:`var(--text-muted)`,marginBottom:8},children:[(0,E.jsx)(`span`,{children:s(`theme.fontSize`)}),(0,E.jsxs)(`span`,{style:{fontFamily:`var(--font-mono)`,color:`var(--text)`,fontWeight:600},children:[Math.round(k*100),`%`]})]}),(0,E.jsx)(`input`,{type:`range`,min:.85,max:1.3,step:.05,value:k,onChange:e=>A(Number(e.target.value)),"aria-label":s(`theme.fontSize`),style:{width:`100%`,accentColor:`var(--accent)`,cursor:`pointer`}}),(0,E.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,fontSize:`var(--text-xs)`,color:`var(--text-dim)`,marginTop:4},children:[(0,E.jsx)(`span`,{children:`85%`}),(0,E.jsx)(`span`,{children:`130%`})]})]})]}),(0,E.jsxs)(br,{tabs:Zt,activeTabId:Ge?fq:Nt?pq:Ke?mq(Ke.filePath):dq,leftExtra:nn,rightExtra:an,onSelectTab:e=>{if(e===`widgets`){Pt(!0),Ve(null);return}Pt(!1),Ve(e===`chat`?null:e)},onCloseTab:tt,tabBarRef:bt,overlay:(0,E.jsxs)(E.Fragment,{children:[de===`validating`&&(0,E.jsxs)(`div`,{role:`status`,style:{height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:8,padding:24,color:`var(--text-muted)`,textAlign:`center`},children:[(0,E.jsx)(`div`,{style:{fontSize:`var(--text-xl)`,color:`var(--text)`},children:s(`workspace.opening`)}),(0,E.jsx)(`div`,{style:{maxWidth:`min(720px, 100%)`,overflowWrap:`anywhere`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-base)`},children:n.requestedCwd})]}),de===`error`&&(0,E.jsxs)(`div`,{role:`alert`,style:{height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:8,padding:24,color:`var(--text-muted)`,textAlign:`center`},children:[(0,E.jsx)(`div`,{style:{fontSize:`var(--text-xl)`,color:`var(--status-error)`},children:s(`workspace.unable`)}),(0,E.jsx)(`div`,{style:{maxWidth:`min(720px, 100%)`,overflowWrap:`anywhere`,fontFamily:`var(--font-mono)`,fontSize:`var(--text-base)`},children:n.requestedCwd}),(0,E.jsx)(`div`,{style:{maxWidth:720,fontSize:`var(--text-base)`},children:me})]}),Xt&&(ue?(0,E.jsx)(`div`,{style:{height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`var(--text-muted)`,fontSize:`var(--text-2xl)`},children:s(`workspace.selectSession`)}):(0,E.jsxs)(`div`,{style:{height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12,userSelect:`none`},children:[(0,E.jsx)(`div`,{style:{fontSize:`var(--text-6xl)`,fontWeight:700,fontStyle:`italic`,color:`var(--accent)`},children:`Pi Web`}),(0,E.jsx)(`div`,{style:{fontSize:`var(--text-base)`,color:`var(--text-muted)`},children:s(`workspace.selectWorkspace`)})]}))]}),children:[(0,E.jsx)(vr,{id:fq,testId:`config-tab-pane`,children:(0,E.jsx)(lq,{section:Ue,onSectionChange:We,cwd:te,sessionId:ee?.id??null,onClose:$e,onOpenFile:Ye,sidebarWidth:ht.width,onSidebarWidthChange:ht.setWidth,widgetPanelWidth:_t.width,onWidgetPanelWidthChange:_t.setWidth,modelConfigFocus:Je,defaultThinkingLevel:f,onDefaultThinkingLevelChange:m,compaction:h,onCompactionChange:e=>Rt({firstPaint:{compaction:e}}),retry:g,onRetryChange:e=>Rt({firstPaint:{retry:e}}),defaultProjectTrust:_,onDefaultProjectTrustChange:v,subagents:y,onSubagentsChange:e=>Rt({firstPaint:{subagents:{defaultModel:e.defaultModel||void 0,defaultThinking:e.defaultThinking||void 0}}})})}),(0,E.jsx)(vr,{id:Ke?mq(Ke.filePath):`file:`,testId:`file-tab-pane`,children:Ke&&(0,E.jsx)(v9,{filePath:Ke.filePath,cwd:ue??void 0,sourceSessionId:Ke.sourceSessionId,gitRefreshKey:R,initialDisplayMode:Ke.initialDisplayMode,onMentionLines:Jt,onSaved:()=>oe(e=>e+1),onOpenFile:e=>Ye(e,hG(e),{sourceSessionId:Ke.sourceSessionId})})}),(0,E.jsx)(vr,{id:dq,keepAlive:!0,testId:`chat-tab-pane`,scroll:`hidden`,activeWhen:I,children:(0,E.jsx)(`div`,{style:{flex:1,minHeight:0,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:(0,E.jsx)(N7,{session:ee,newSessionCwd:F,onAgentEnd:Oe,onSessionCreated:De,onSessionForked:Ae,modelsRefreshKey:z,onOpenModelConfig:Ze,chatInputRef:yt,onOpenFile:st,onSessionRenamed:ke,windowTitleBase:Qt,toolbarExtra:rn,closedWidgetKeys:It,onCloseWidget:Lt,onExtensionWidgetsChange:Bt,onExtensionDialogChange:e=>{Se.current=e}},ie)})}),(0,E.jsx)(vr,{id:pq,keepAlive:!0,testId:`widgets-tab-pane`,zIndex:1,activeWhen:I,children:(0,E.jsx)(bte,{geometries:S,messages:w,onAddMessage:T,onRemoveMessage:D,onUpdateMessage:O,widgets:Ft,closedKeys:It,onReopen:zt})})]})]}),Gt&&(0,E.jsx)(qi,{label:`${s(`layout.resizeWidgetPanel`)}: ${s(`layout.resizeHint`)}`,wrapperStyle:{display:`flex`,flex:`0 0 0`,width:0},children:(0,E.jsx)(`div`,{..._t.separatorProps,"aria-controls":`widget-panel`,className:`panel-resize-handle widget-panel-resize-handle${_t.isResizing?` is-resizing`:``}`,"data-resize-handle":`widget-panel`})}),!l&&!Vt?null:(0,E.jsx)(`div`,{ref:_t.panelRef,"aria-controls":`widget-panel`,style:l?{position:`fixed`,inset:0,zIndex:250,display:`flex`,flexDirection:`column`}:{"--widget-panel-width":`${_t.width}px`,width:`var(--widget-panel-width)`,display:`flex`,flexDirection:`column`,minWidth:0,overflow:`hidden`,borderLeft:`1px solid var(--border)`,background:`var(--bg)`},children:(0,E.jsx)(yte,{cwd:ee?.cwd??F,onOpenFile:Ye,explorerRefreshKey:R,onExplorerRefresh:Le,onAtMention:Kt,onAtMentions:qt,sessionId:ee?.id??null,onOpenConfig:e=>Xe(e)})})]}),_e&&te&&(0,E.jsx)(Ree,{cwd:te,busy:ye,error:be,onCancel:()=>{ye||ve(!1)},onConfirm:()=>void Pe()})]})})})}),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(ate,{}),(0,E.jsx)(fte,{})]})]})}var Tte=class extends d.Component{constructor(...e){super(...e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){Ke(e,`render error`)}render(){return this.state.hasError?(0,E.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12,height:`100vh`,color:`var(--text)`,fontSize:`var(--text-base)`},children:[(0,E.jsx)(`span`,{children:`⚠️`}),(0,E.jsx)(`span`,{children:`Something went wrong while rendering.`}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>{this.setState({hasError:!1})},style:{border:`1px solid var(--border)`,background:`none`,color:`var(--text)`,borderRadius:6,padding:`4px 14px`,cursor:`pointer`},children:`Try again`})]}):this.props.children}};function Ete(){return(0,d.useEffect)(()=>{if(!(`serviceWorker`in navigator))return;let e=()=>{navigator.serviceWorker.register(`/sw.js?v=0.15.8`,{scope:`/`,updateViaCache:`none`}).catch(e=>{console.error(`Failed to register the Pi Web service worker:`,e)})};if(document.readyState===`complete`){e();return}return window.addEventListener(`load`,e,{once:!0}),()=>window.removeEventListener(`load`,e)},[]),null}var Dte=`piE2eFixtureDir`;function Ote(){return typeof window>`u`?null:new URL(window.location.href).searchParams.get(`piE2eFixtureDir`)}function kte(){if(typeof document>`u`)return;let e=Ote();e&&(document.cookie=`${Dte}=${encodeURIComponent(e)}; path=/; SameSite=Lax`)}async function Ate(){kte(),Rq(!0),Vq();let e=zq(`boot`),t=null;try{let n=await ye.load();e(`preferences catalog loaded`,`locale=${n.firstPaint?.locale}`);let r=n.firstPaint?.locale;(r===`en`||r===`zh-CN`)&&(t=r,document.documentElement.lang=r===`zh-CN`?`zh-CN`:`en`);let i=n.theme;if(i===`dark`?document.documentElement.classList.add(`dark`):document.documentElement.classList.remove(`dark`),i)try{localStorage.setItem(`pi-theme`,i)}catch{}}catch{}e(`root render`),window.addEventListener(`unhandledrejection`,e=>{Ke(e.reason,`unhandled promise rejection`)}),window.addEventListener(`error`,e=>{let t=(e.error instanceof Error?e.error.message:``)||e.message||``;t.includes(`ResizeObserver loop`)||t.startsWith(`Script error`)||Ke(e.error??e.message,`uncaught error`)}),(0,f.createRoot)(document.getElementById(`root`)).render((0,E.jsx)(d.StrictMode,{children:(0,E.jsx)(Tte,{children:(0,E.jsxs)(M,{initialLocale:t,children:[(0,E.jsx)(wte,{}),(0,E.jsx)(Ete,{})]})})}))}Ate();export{l0 as a,t2 as i,R3 as n,T as o,H3 as r,i as s,A2 as t};