pi-webapp 0.1.57 → 0.1.58-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/bin/launcher-diagnostics.mjs +179 -0
  2. package/bin/launcher-logs.mjs +145 -0
  3. package/bin/pi-webapp.mjs +183 -39
  4. package/dist/extension.js +71 -71
  5. package/dist/hosted-recovery.js +2 -2
  6. package/dist/hosted-worker.js +2 -2
  7. package/docs/desktop.md +16 -5
  8. package/package.json +3 -2
  9. package/web/dist/.vite/manifest.json +80 -64
  10. package/web/dist/assets/{MarkdownText-Ca6_qCyr.js → MarkdownText-BmWua1fx.js} +11 -11
  11. package/web/dist/assets/WorkspacePanel.module-q1UBTZQr.js +2 -0
  12. package/web/dist/assets/app-Bl_vjH4f.js +53 -0
  13. package/web/dist/assets/app.css +1 -1
  14. package/web/dist/assets/app.js +4 -4
  15. package/web/dist/assets/{code-editor-B5kVAtku.js → code-editor-bWuZTiS2.js} +4 -4
  16. package/web/dist/assets/{icons-D8yiYkWB.js → code-file-types-BZAEsqNG.js} +3 -3
  17. package/web/dist/assets/{dist-CWWynAS-.js → dist-B8Mp_VTU.js} +2 -2
  18. package/web/dist/assets/{dist-o-4nubru.js → dist-BD_2QeWa.js} +2 -2
  19. package/web/dist/assets/{dist-Im2q9dJ0.js → dist-C2WSXtwq.js} +2 -2
  20. package/web/dist/assets/{dist-BRYLL4VU.js → dist-C7kRRV1b.js} +2 -2
  21. package/web/dist/assets/{dist-CaNhruaD.js → dist-CCfANS3F.js} +2 -2
  22. package/web/dist/assets/{dist-BFhI7cEI.js → dist-CP5SBgQB.js} +2 -2
  23. package/web/dist/assets/{dist-DAlictfL.js → dist-CmPE8_f_.js} +2 -2
  24. package/web/dist/assets/{dist-CszBAiM6.js → dist-D-nx7RRS.js} +2 -2
  25. package/web/dist/assets/{dist-BYJ4SXpR.js → dist-DFTCmV51.js} +2 -2
  26. package/web/dist/assets/{dist-CsFhAvz7.js → dist-Dr0qO3Zr.js} +2 -2
  27. package/web/dist/assets/{dist-CqXTRhJp.js → dist-Nlb4zANG.js} +2 -2
  28. package/web/dist/assets/{graphql-Cz1_wnUp.js → graphql-B5jxVvgN.js} +2 -2
  29. package/web/dist/assets/{http-CTlzQwRP.js → http-C6M1fy61.js} +2 -2
  30. package/web/dist/assets/{php-BHNgHgMp.js → php-B61pLHqK.js} +2 -2
  31. package/web/dist/assets/{plugin-D1z0mcl1.js → plugin-CE1WaS8V.js} +4 -4
  32. package/web/dist/assets/plugin-CsVaeNQM.js +6 -0
  33. package/web/dist/assets/plugin-Cyidq4oP.js +2 -0
  34. package/web/dist/assets/plugin-Gwwlx9MU.js +4 -0
  35. package/web/dist/assets/plugin.css +1 -1
  36. package/web/dist/assets/plugin2.css +1 -1
  37. package/web/dist/assets/plugin3.css +1 -0
  38. package/web/dist/assets/{rst-BdGjFUxD.js → rst-950N-2sy.js} +2 -2
  39. package/web/dist/assets/{ruby-D7-ny0V-.js → ruby-Qm2HAXfx.js} +2 -2
  40. package/web/dist/assets/{svelte-DoD3sicb.js → svelte-CoZSSs0h.js} +2 -2
  41. package/web/dist/assets/{vue-BYLUelN7.js → vue-as6FrWIW.js} +2 -2
  42. package/web/dist/assets/WorkspacePanel.module-V6gI-nG1.js +0 -2
  43. package/web/dist/assets/app-CIlV3hYO.js +0 -49
  44. package/web/dist/assets/plugin-CZx51rmJ.js +0 -6
  45. package/web/dist/assets/plugin-CvqNiFRV.js +0 -4
@@ -1,49 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownText-Ca6_qCyr.js","assets/rolldown-runtime-CgmABjMJ.js","assets/react-CLFE7TFE.js","assets/clsx-DQAHfk8w.js","assets/icons-D8yiYkWB.js","assets/app.js","assets/MarkdownText.css","assets/plugin-CZx51rmJ.js","assets/WorkspacePanel.module-V6gI-nG1.js","assets/WorkspacePanel.css","assets/plugin-D1z0mcl1.js","assets/plugin2.css","assets/plugin-CvqNiFRV.js","assets/plugin.css"])))=>i.map(i=>d[i]);
2
- (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`1baec048-013a-4bbd-8463-25078a1fc9a8`,e._sentryDebugIdIdentifier=`sentry-dbid-1baec048-013a-4bbd-8463-25078a1fc9a8`)}catch{}})();import{n as e,r as t,t as n}from"./rolldown-runtime-CgmABjMJ.js";import{t as r}from"./react-CLFE7TFE.js";import{C as i,E as a,F as o,S as s,T as c,_ as l,a as u,b as d,c as f,d as p,f as m,g as h,i as g,m as _,n as v,o as y,r as b,s as x,u as S,v as C,w,x as T,y as E}from"./icons-D8yiYkWB.js";import{a as D,d as O,i as k,n as A,o as ee,r as j,s as M,t as N,u as P}from"./app.js";import{n as te,t as F}from"./clsx-DQAHfk8w.js";import{a as I,c as L,i as ne,l as R,o as re,s as ie,t as z,u as ae}from"./WorkspacePanel.module-V6gI-nG1.js";var oe=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&&ee(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&&ee(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 ee(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,ee(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}}}})),se=n(((e,t)=>{t.exports=oe()})),ce=n((e=>{var t=se(),n=r(),i=o();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 c(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function l(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 u(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 d(e){if(c(e)!==e)throw Error(a(188))}function f(e){var t=e.alternate;if(!t){if(t=c(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 d(i),e;if(o===r)return d(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.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 p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function m(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function h(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function g(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function _(e){var t=[null,null],n=h(e);return n===null||v(t,e,n.child,{foundSelf:!1}),t}function v(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&v(e,t,n.child,r))return!0;n=n.sibling}return!1}function y(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(a(559))}}var b=null,x=null;function S(e,t,n){return e===n||e===t&&(b=e,!0)}function C(e,t,n){return e===n?(x=e,!1):e===t&&(x!==null&&(b=e),!0)}function w(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function T(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var E=Object.assign,D=Symbol.for(`react.element`),O=Symbol.for(`react.transitional.element`),k=Symbol.for(`react.portal`),A=Symbol.for(`react.fragment`),ee=Symbol.for(`react.strict_mode`),j=Symbol.for(`react.profiler`),M=Symbol.for(`react.consumer`),N=Symbol.for(`react.context`),P=Symbol.for(`react.forward_ref`),te=Symbol.for(`react.suspense`),F=Symbol.for(`react.suspense_list`),I=Symbol.for(`react.memo`),L=Symbol.for(`react.lazy`),ne=Symbol.for(`react.activity`),R=Symbol.for(`react.legacy_hidden`),re=Symbol.for(`react.memo_cache_sentinel`),ie=Symbol.for(`react.view_transition`),z=Symbol.for(`react.recoverable`),ae=Symbol.iterator;function oe(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var ce=Symbol.for(`react.client.reference`);function le(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case A:return`Fragment`;case j:return`Profiler`;case ee:return`StrictMode`;case te:return`Suspense`;case F:return`SuspenseList`;case ne:return`Activity`;case ie:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case k:return`Portal`;case N:return e.displayName||`Context`;case M:return(e._context.displayName||`Context`)+`.Consumer`;case P:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case I:return t=e.displayName||null,t===null?le(e.type)||`Memo`:t;case L:t=e._payload,e=e._init;try{return le(e(t))}catch{}}return null}var B=Array.isArray,V=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],fe=-1;function pe(e){return{current:e}}function me(e){0>fe||(e.current=de[fe],de[fe]=null,fe--)}function he(e,t){fe++,de[fe]=e.current,e.current=t}var ge=pe(null),_e=pe(null),ve=pe(null),U=pe(null);function W(e,t){switch(he(ve,t),he(_e,e),he(ge,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?mp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=mp(t),e=hp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}me(ge),he(ge,e)}function ye(){me(ge),me(_e),me(ve)}function be(e){var t=e.memoizedState;t!==null&&(lh._currentValue=t.memoizedState,he(U,e)),t=ge.current;var n=hp(t,e.type);t!==n&&(he(_e,e),he(ge,n))}function xe(e){_e.current===e&&(me(ge),me(_e)),U.current===e&&(me(U),lh._currentValue=ue)}var Se,Ce;function we(e){if(Se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||``,Ce=-1<e.stack.indexOf(`
3
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
- `+Se+e+Ce}var Te=!1;function Ee(e,t){if(!e||Te)return``;Te=!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}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}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(`
5
- `),l=s.split(`
6
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
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{Te=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?we(n):``}function De(e,t){switch(e.tag){case 26:case 27:case 5:return we(e.type);case 16:return we(`Lazy`);case 13:return e.child!==t&&t!==null?we(`Suspense Fallback`):we(`Suspense`);case 19:return we(`SuspenseList`);case 0:case 15:return Ee(e.type,!1);case 11:return Ee(e.type.render,!1);case 1:return Ee(e.type,!0);case 31:return we(`Activity`);case 30:return we(`ViewTransition`);default:return``}}function Oe(e){try{var t=``,n=null;do t+=De(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
- Error generating stack: `+e.message+`
9
- `+e.stack}}var ke=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,je=t.unstable_cancelCallback,Me=t.unstable_shouldYield,Ne=t.unstable_requestPaint,Pe=t.unstable_now,Fe=t.unstable_getCurrentPriorityLevel,Ie=t.unstable_ImmediatePriority,Le=t.unstable_UserBlockingPriority,Re=t.unstable_NormalPriority,ze=t.unstable_LowPriority,Be=t.unstable_IdlePriority,Ve=t.log,He=t.unstable_setDisableYieldValue,Ue=null,We=null;function Ge(e){if(typeof Ve==`function`&&He(e),We&&typeof We.setStrictMode==`function`)try{We.setStrictMode(Ue,e)}catch{}}var Ke=Math.clz32?Math.clz32:Ye,qe=Math.log,Je=Math.LN2;function Ye(e){return e>>>=0,e===0?32:31-(qe(e)/Je|0)|0}var Xe=256,Ze=262144,Qe=4194304;function $e(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&-e;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 et(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=$e(n))):i=$e(o):i=$e(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=$e(n))):i=$e(o)):i=$e(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 tt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function nt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ke(n),i=1<<r;t|=e[r],n&=~i}return t}function rt(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 it(){var e=Qe;return Qe<<=1,!(Qe&62914560)&&(Qe=4194304),e}function at(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ot(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function st(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-Ke(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&&ct(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ct(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ke(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function lt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ke(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ut(e,t){var n=t&-t;return n=n&42?1:dt(n),(n&(e.suspendedLanes|t))===0?n:0}function dt(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 ft(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function pt(){var e=H.p;return e===0?(e=window.event,e===void 0?32:Th(e.type)):e}function mt(e,t){var n=H.p;try{return H.p=e,t()}finally{H.p=n}}var ht=Math.random().toString(36).slice(2),gt=`__reactFiber$`+ht,_t=`__reactProps$`+ht,vt=`__reactContainer$`+ht,yt=`__reactEvents$`+ht,bt=`__reactListeners$`+ht,xt=`__reactHandles$`+ht,St=`__reactResources$`+ht,Ct=`__reactMarker$`+ht,wt=`__reactLoad$`+ht;function Tt(e){delete e[gt],delete e[_t],delete e[bt],delete e[xt]}function Et(e){var t;if(t=e[gt])return t;for(var n=e.parentNode;n;){if(t=n[vt]||n[gt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=hm(e);e!==null;){if(n=e[gt])return n;e=hm(e)}return t}e=n,n=e.parentNode}return null}function Dt(e){if(e=e[gt]||e[vt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ot(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function kt(e){var t=e[St];return t||=e[St]={hoistableStyles:new Map,hoistableScripts:new Map},t}function At(e){e[Ct]=!0}function jt(e){e[wt]=void 0}var Mt=new Set,Nt={};function Pt(e,t){Ft(e,t),Ft(e+`Capture`,t)}function Ft(e,t){for(Nt[e]=t,e=0;e<t.length;e++)Mt.add(t[e])}var It=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]*$`),Lt={},Rt={};function zt(e){return ke.call(Rt,e)?!0:ke.call(Lt,e)?!1:It.test(e)?Rt[e]=!0:(Lt[e]=!0,!1)}var Bt=!1;function Vt(){var e=Bt;return Bt=!1,e}function Ht(e,t,n){if(zt(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 Ut(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 Wt(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 Gt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Kt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function qt(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 Jt(e){if(!e._valueTracker){var t=Kt(e)?`checked`:`value`;e._valueTracker=qt(e,t,``+e[t])}}function Yt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Kt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Xt=/[\n"\\]/g;function Zt(e){return e.replace(Xt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Qt(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=``+Gt(t)):e.value!==``+Gt(t)&&(e.value=``+Gt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):en(e,Gt(n)):o===`number`&&e.value==t?en(e,Gt(e.value)):en(e,Gt(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=``+Gt(s):e.removeAttribute(`name`)}function $t(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)){Jt(e);return}n=n==null?``:``+Gt(n),t=t==null?n:``+Gt(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),Jt(e)}function en(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function tn(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=``+Gt(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 nn(e,t,n){t!=null&&(t=``+Gt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Gt(n)}function rn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(B(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=Gt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Jt(e)}function an(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var on=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 sn(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||on.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function cn(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]=``,Bt=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(sn(e,i,r),Bt=!0)}else for(var o in t)t.hasOwnProperty(o)&&sn(e,o,t[o])}function ln(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 un=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`],[`maskType`,`mask-type`],[`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`]]),dn=/^[\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 fn(e){return dn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function pn(){}var mn=null;function hn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gn=null,_n=null;function vn(e){var t=Dt(e);if(t&&(e=t.stateNode)){var n=e[_t]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Qt(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="`+Zt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[_t]||null;if(!i)throw Error(a(90));Qt(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&&Yt(r)}break a;case`textarea`:nn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&tn(e,!!n.multiple,t,!1)}}}var yn=!1;function bn(e,t,n){if(yn)return e(t,n);yn=!0;try{return e(t)}finally{if(yn=!1,(gn!==null||_n!==null)&&(Bd(),gn&&(t=gn,e=_n,_n=gn=null,vn(t),e)))for(t=0;t<e.length;t++)vn(e[t])}}function xn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[_t]||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 Sn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Cn=!1;if(Sn)try{var wn={};Object.defineProperty(wn,"passive",{get:function(){Cn=!0}}),window.addEventListener(`test`,wn,wn),window.removeEventListener(`test`,wn,wn)}catch{Cn=!1}var Tn=null,En=null,Dn=null;function On(){if(Dn)return Dn;var e,t=En,n=t.length,r,i=`value`in Tn?Tn.value:Tn.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 Dn=i.slice(e,1<r?1-r:void 0)}function kn(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 An(){return!0}function jn(){return!1}function Mn(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)?An:jn,this.isPropagationStopped=jn,this}return E(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=An)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=An)},persist:function(){},isPersistent:An}),t}var Nn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pn=Mn(Nn),Fn=E({},Nn,{view:0,detail:0}),In=Mn(Fn),Ln,Rn,zn,Bn=E({},Fn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zn,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!==zn&&(zn&&e.type===`mousemove`?(Ln=e.screenX-zn.screenX,Rn=e.screenY-zn.screenY):Rn=Ln=0,zn=e),Ln)},movementY:function(e){return`movementY`in e?e.movementY:Rn}}),Vn=Mn(Bn),Hn=Mn(E({},Bn,{dataTransfer:0})),Un=Mn(E({},Fn,{relatedTarget:0})),Wn=Mn(E({},Nn,{animationName:0,elapsedTime:0,pseudoElement:0})),Gn=Mn(E({},Nn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Kn=Mn(E({},Nn,{data:0})),qn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Jn={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`},Yn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Xn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yn[e])?!!t[e]:!1}function Zn(){return Xn}var Qn=Mn(E({},Fn,{key:function(e){if(e.key){var t=qn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=kn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zn,charCode:function(e){return e.type===`keypress`?kn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?kn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),$n=Mn(E({},Bn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),er=Mn(E({},Nn,{submitter:0})),tr=Mn(E({},Fn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zn})),nr=Mn(E({},Nn,{propertyName:0,elapsedTime:0,pseudoElement:0})),rr=Mn(E({},Bn,{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})),ir=Mn(E({},Nn,{newState:0,oldState:0,source:0})),ar=[9,13,27,32],or=Sn&&`CompositionEvent`in window,sr=null;Sn&&`documentMode`in document&&(sr=document.documentMode);var cr=Sn&&`TextEvent`in window&&!sr,lr=Sn&&(!or||sr&&8<sr&&11>=sr),ur=` `,dr=!1;function fr(e,t){switch(e){case`keyup`:return ar.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function pr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var mr=!1;function hr(e,t){switch(e){case`compositionend`:return pr(t);case`keypress`:return t.which===32?(dr=!0,ur):null;case`textInput`:return e=t.data,e===ur&&dr?null:e;default:return null}}function gr(e,t){if(mr)return e===`compositionend`||!or&&fr(e,t)?(e=On(),Dn=En=Tn=null,mr=!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 lr&&t.locale!==`ko`?null:t.data;default:return null}}var _r={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 vr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!_r[e.type]:t===`textarea`}function yr(e,t,n,r){gn?_n?_n.push(r):_n=[r]:gn=r,t=Zf(t,`onChange`),0<t.length&&(n=new Pn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var br=null,xr=null;function Sr(e){Uf(e,0)}function Cr(e){if(Yt(Ot(e)))return e}function wr(e,t){if(e===`change`)return t}var Tr=!1;if(Sn){var Er;if(Sn){var Dr=`oninput`in document;if(!Dr){var Or=document.createElement(`div`);Or.setAttribute(`oninput`,`return;`),Dr=typeof Or.oninput==`function`}Er=Dr}else Er=!1;Tr=Er&&(!document.documentMode||9<document.documentMode)}function kr(){br&&(br.detachEvent(`onpropertychange`,Ar),xr=br=null)}function Ar(e){if(e.propertyName===`value`&&Cr(xr)){var t=[];yr(t,xr,e,hn(e)),bn(Sr,t)}}function jr(e,t,n){e===`focusin`?(kr(),br=t,xr=n,br.attachEvent(`onpropertychange`,Ar)):e===`focusout`&&kr()}function Mr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Cr(xr)}function Nr(e,t){if(e===`click`)return Cr(t)}function Pr(e,t){if(e===`input`||e===`change`)return Cr(t)}function Fr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ir=typeof Object.is==`function`?Object.is:Fr;function Lr(e,t){if(Ir(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(!ke.call(t,i)||!Ir(e[i],t[i]))return!1}return!0}function G(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Rr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zr(e,t){var n=Rr(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=Rr(n)}}function Br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=G(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=G(e.document)}return t}function Hr(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 Ur=Sn&&`documentMode`in document&&11>=document.documentMode,Wr=null,Gr=null,Kr=null,qr=!1;function Jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qr||Wr==null||Wr!==G(r)||(r=Wr,`selectionStart`in r&&Hr(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}),Kr&&Lr(Kr,r)||(Kr=r,r=Zf(Gr,`onSelect`),0<r.length&&(t=new Pn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Wr)))}function Yr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Xr={animationend:Yr(`Animation`,`AnimationEnd`),animationiteration:Yr(`Animation`,`AnimationIteration`),animationstart:Yr(`Animation`,`AnimationStart`),transitionrun:Yr(`Transition`,`TransitionRun`),transitionstart:Yr(`Transition`,`TransitionStart`),transitioncancel:Yr(`Transition`,`TransitionCancel`),transitionend:Yr(`Transition`,`TransitionEnd`)},Zr={},Qr={};Sn&&(Qr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Xr.animationend.animation,delete Xr.animationiteration.animation,delete Xr.animationstart.animation),`TransitionEvent`in window||delete Xr.transitionend.transition);function $r(e){if(Zr[e])return Zr[e];if(!Xr[e])return e;var t=Xr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Qr)return Zr[e]=t[n];return e}var ei=$r(`animationend`),ti=$r(`animationiteration`),ni=$r(`animationstart`),ri=$r(`transitionrun`),ii=$r(`transitionstart`),ai=$r(`transitioncancel`),oi=$r(`transitionend`),si=new Map,ci=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);ci.push(`scrollEnd`);function li(e,t){si.set(e,t),Pt(t,[e])}var ui=0;function di(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=xd.identifierPrefix;var n=ui++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function fi(e){if(e==null||typeof e==`string`)return e;var t=null,n=kd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function pi(e,t){return e=fi(e),t=fi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var mi=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)},hi=[],gi=0,_i=0;function vi(){for(var e=gi,t=_i=gi=0;t<e;){var n=hi[t];hi[t++]=null;var r=hi[t];hi[t++]=null;var i=hi[t];hi[t++]=null;var a=hi[t];if(hi[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&&Si(n,i,a)}}function yi(e,t,n,r){hi[gi++]=e,hi[gi++]=t,hi[gi++]=n,hi[gi++]=r,_i|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function bi(e,t,n,r){return yi(e,t,n,r),Ci(e)}function xi(e,t){return yi(e,null,null,t),Ci(e)}function Si(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-Ke(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ci(e){if(50<Ad)throw Ad=0,jd=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var wi={};function Ti(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 Ei(e,t,n,r){return new Ti(e,t,n,r)}function Di(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Oi(e,t){var n=e.alternate;return n===null?(n=Ei(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&1206910976,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 ki(e,t){e.flags&=1206910978;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 Ai(e,t,n,r,i,o){var s=0;if(r=e,typeof r==`function`)Di(r)&&(s=1);else if(typeof r==`string`)s=Ym(e,n,ge.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ne:return e=Ei(31,n,t,i),e.elementType=ne,e.lanes=o,e;case A:return ji(n.children,i,o,t);case ee:s=8,i|=24;break;case j:return e=Ei(12,n,t,i|2),e.elementType=j,e.lanes=o,e;case te:return e=Ei(13,n,t,i),e.elementType=te,e.lanes=o,e;case F:return e=Ei(19,n,t,i),e.elementType=F,e.lanes=o,e;case R:case ie:return e=i|32,e=Ei(30,n,t,e),e.elementType=ie,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case N:s=10;break a;case M:s=9;break a;case P:s=11;break a;case I:s=14;break a;case L:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=Ei(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function ji(e,t,n,r){return e=Ei(7,e,r,t),e.lanes=n,e}function Mi(e,t,n){return e=Ei(6,e,null,t),e.lanes=n,e}function Ni(e){var t=Ei(18,null,null,0);return t.stateNode=e,t}function Pi(e,t,n){return t=Ei(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fi=new WeakMap;function Ii(e,t){if(typeof e==`object`&&e){var n=Fi.get(e);return n===void 0?(t={value:e,source:t,stack:Oe(t)},Fi.set(e,t),t):n}return{value:e,source:t,stack:Oe(t)}}var Li=[],Ri=0,zi=null,Bi=0,Vi=[],Hi=0,Ui=null,Wi=1,Gi=``;function Ki(e,t){Li[Ri++]=Bi,Li[Ri++]=zi,zi=e,Bi=t}function qi(e,t,n){Vi[Hi++]=Wi,Vi[Hi++]=Gi,Vi[Hi++]=Ui,Ui=e;var r=Wi;e=Gi;var i=32-Ke(r)-1;r&=~(1<<i),n+=1;var a=32-Ke(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Wi=1<<32-Ke(t)+i|n<<i|r,Gi=a+e}else Wi=1<<a|n<<i|r,Gi=e}function Ji(e){e.return!==null&&(Ki(e,1),qi(e,1,0))}function Yi(e){for(;e===zi;)zi=Li[--Ri],Li[Ri]=null,Bi=Li[--Ri],Li[Ri]=null;for(;e===Ui;)Ui=Vi[--Hi],Vi[Hi]=null,Gi=Vi[--Hi],Vi[Hi]=null,Wi=Vi[--Hi],Vi[Hi]=null}function Xi(e,t){Vi[Hi++]=Wi,Vi[Hi++]=Gi,Vi[Hi++]=Ui,Wi=t.id,Gi=t.overflow,Ui=e}var Zi=null,Qi=null,$i=!1,ea=null,ta=!1,na=Error(a(519));function ra(e){throw la(Ii(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),na}function ia(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[gt]=e,t[_t]=r,n){case`dialog`:Wf(`cancel`,t),Wf(`close`,t);break;case`iframe`:case`object`:case`embed`:Wf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Vf.length;n++)Wf(Vf[n],t);break;case`source`:Wf(`error`,t);break;case`img`:case`image`:case`link`:Wf(`error`,t),Wf(`load`,t);break;case`details`:Wf(`toggle`,t);break;case`input`:Wf(`invalid`,t),$t(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Wf(`invalid`,t);break;case`textarea`:Wf(`invalid`,t),rn(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||rp(t.textContent,n)?(r.popover!=null&&(Wf(`beforetoggle`,t),Wf(`toggle`,t)),r.onScroll!=null&&Wf(`scroll`,t),r.onScrollEnd!=null&&Wf(`scrollend`,t),r.onClick!=null&&(t.onclick=pn),t=!0):t=!1,t||ra(e,!0)}function aa(e){for(Zi=e.return;Zi;)switch(Zi.tag){case 5:case 31:case 13:ta=!1;return;case 27:case 3:ta=!0;return;default:Zi=Zi.return}}function oa(e){if(e!==Zi)return!1;if(!$i)return aa(e),$i=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||_p(e.type,e.memoizedProps)),n=!n),n&&Qi&&ra(e),aa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Qi=mm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Qi=mm(e)}else t===27?(t=Qi,Ep(e.type)?(e=pm,pm=null,Qi=e):Qi=t):Qi=Zi?fm(e.stateNode.nextSibling):null;return!0}function sa(){Qi=Zi=null,$i=!1}function ca(){var e=ea;return e!==null&&(pd===null?pd=e:pd.push.apply(pd,e),ea=null),e}function la(e){ea===null?ea=[e]:ea.push(e)}var ua=pe(null),da=null,fa=null;function pa(e,t,n){he(ua,t._currentValue),t._currentValue=n}function ma(e){e._currentValue=ua.current,me(ua)}function ha(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 ga(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),ha(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),ha(s,n,e),s=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),ha(i.return,n,e),s=i.child,s=s===null?null:s.sibling):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 _a(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;Ir(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===U.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[lh]:e.push(lh))}i=i.return}return e!==null&&ga(t,e,n,r),t.flags|=262144,e!==null}function va(e){for(e=e.firstContext;e!==null;){if(!Ir(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ya(e){da=e,fa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ba(e){return Sa(da,e)}function xa(e,t){return da===null&&ya(e),Sa(e,t)}function Sa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},fa===null){if(e===null)throw Error(a(308));fa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else fa=fa.next=t;return n}var Ca=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()})}},wa=t.unstable_scheduleCallback,Ta=t.unstable_NormalPriority,Ea={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Da(){return{controller:new Ca,data:new Map,refCount:0}}function Oa(e){e.refCount--,e.refCount===0&&wa(Ta,function(){e.controller.abort()})}function ka(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Aa=null;function ja(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ma=null,Na=0,Pa=0,Fa=null;function Ia(e,t){if(Ma===null){var n=Ma=[];Na=0,Pa=If(),Fa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Na++,t.then(La,La),t}function La(){if(--Na===0&&(Aa=null,Ma!==null)){Fa!==null&&(Fa.status=`fulfilled`);var e=Ma;Ma=null,Pa=0,Fa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ra(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 za=V.S;V.S=function(e,t){if(gd=Pe(),typeof t==`object`&&t&&typeof t.then==`function`&&Ia(e,t),Aa!==null)for(var n=Sf;n!==null;)ka(n,Aa),n=n.next;if(n=e.types,n!==null){for(var r=Sf;r!==null;)ka(r,n),r=r.next;if(Pa!==0){r=Aa,r===null&&(r=Aa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}za!==null&&za(e,t)};var Ba=pe(null);function Va(){var e=Ba.current;return e===null?Qu.pooledCache:e}function Ha(e,t){t===null?he(Ba,Ba.current):he(Ba,t.pool)}function Ua(){var e=Va();return e===null?null:{parent:Ea._currentValue,pool:e}}var Wa=Error(a(460)),Ga=Error(a(474)),Ka=Error(a(542)),qa={then:function(){}};function Ja(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ya(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(pn,pn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,$a(e),e===void 0&&!(`reason`in t)?Error(a(600)):e;default:if(typeof t.status==`string`)t.then(pn,pn);else{if(e=Qu,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,$a(e),e}throw Za=t,Wa}}function Xa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Za=e,Wa):e}}var Za=null;function Qa(){if(Za===null)throw Error(a(459));var e=Za;return Za=null,e}function $a(e){if(e===Wa||e===Ka)throw Error(a(483))}var eo=null,to=0;function no(e){var t=to;return to+=1,eo===null&&(eo=[]),Ya(eo,e,t)}function ro(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function io(e,t){throw t.$$typeof===D?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ao(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=Oi(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|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Mi(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===A?(e=d(e,t,n.props.children,r,n.key),ro(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===L&&Xa(a)===t.type)?(t=i(t,n.props),ro(t,n),t.return=e,t):(t=Ai(n.type,n.key,n.props,null,e.mode,r),ro(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=Pi(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=ji(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=Mi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case O:return n=Ai(t.type,t.key,t.props,null,e.mode,n),ro(n,t),n.return=e,n;case k:return t=Pi(t,e.mode,n),t.return=e,t;case L:return t=Xa(t),f(e,t,n)}if(B(t)||oe(t))return t=ji(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,no(t),n);if(t.$$typeof===N)return f(e,xa(e,t),n);io(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 O:return n.key===i?l(e,t,n,r):null;case k:return n.key===i?u(e,t,n,r):null;case L:return n=Xa(n),p(e,t,n,r)}if(B(n)||oe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,no(n),r);if(n.$$typeof===N)return p(e,t,xa(e,n),r);io(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 O:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case k:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case L:return r=Xa(r),m(e,t,n,r,i)}if(B(r)||oe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,no(r),i);if(r.$$typeof===N)return m(e,t,n,xa(t,r),i);io(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),$i&&Ki(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 $i&&Ki(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(_.key===null?h:_.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)}),$i&&Ki(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),$i&&Ki(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 $i&&Ki(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(_.key===null?g:_.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)}),$i&&Ki(i,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===A&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case O:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===A){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),ro(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===L&&Xa(l)===r.type){n(e,r.sibling),c=i(r,o.props),ro(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===A?(c=ji(o.props.children,e.mode,c,o.key),ro(c,o),c.return=e,e=c):(c=Ai(o.type,o.key,o.props,null,e.mode,c),ro(c,o),c.return=e,e=c)}return s(e);case k: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=Pi(o,e.mode,c),c.return=e,e=c}return s(e);case L:return o=Xa(o),_(e,r,o,c)}if(B(o))return h(e,r,o,c);if(oe(o)){if(l=oe(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,no(o),c);if(o.$$typeof===N)return _(e,r,xa(e,o),c);io(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=Mi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{to=0;var i=_(e,t,n,r);return eo=null,i}catch(t){if(t===Wa||t===Ka)throw t;var a=Ei(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var oo=ao(!0),so=ao(!1),co=!1;function lo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uo(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 fo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function po(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Zu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ci(e),Si(e,null,n),t}return yi(e,r,t,n),Ci(e)}function mo(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,lt(e,n)}}function ho(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}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var go=!1;function _o(){if(go){var e=Fa;if(e!==null)throw e}}function vo(e,t,n,r){go=!1;var i=e.updateQueue;co=!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?(Y&f)===f:(r&f)===f){f!==0&&f===Pa&&(go=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=E({},d,f);break a;case 2:co=!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),sd|=o,e.lanes=o,e.memoizedState=d}}function yo(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function bo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)yo(n[e],t)}var xo=pe(null),So=pe(0);function Co(e,t){e=ad,he(So,e),he(xo,t),ad=e|t.baseLanes}function wo(){he(So,ad),he(xo,xo.current)}function To(){ad=So.current,me(xo),me(So)}var Eo=pe(null),Do=null;function Oo(e){var t=e.alternate;he(No,No.current&1),he(Eo,e),Do===null&&(t===null||xo.current!==null||t.memoizedState!==null)&&(Do=e)}function ko(e){he(No,No.current),he(Eo,e),Do===null&&(Do=e)}function Ao(e){e.tag===22?(he(No,No.current),he(Eo,e),Do===null&&(Do=e)):jo()}function jo(){he(No,No.current),he(Eo,Eo.current)}function Mo(e){me(Eo),Do===e&&(Do=null),me(No)}var No=pe(0);function Po(e,t){he(Eo,Eo.current),he(No,t)}function Fo(e){me(No),me(Eo),Do===e&&(Do=null)}function Io(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||lm(n)||um(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 Lo=0,Ro=null,K=null,zo=null,Bo=!1,Vo=!1,Ho=!1,Uo=0,Wo=0,Go=null,Ko=0;function qo(){throw Error(a(321))}function Jo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ir(e[n],t[n]))return!1;return!0}function Yo(e,t,n,r,i,a){return Lo=a,Ro=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,V.H=e===null||e.memoizedState===null?dc:fc,Ho=!1,a=n(r,i),Ho=!1,Vo&&(a=Zo(t,n,r,i)),Xo(e),a}function Xo(e){V.H=uc;var t=K!==null&&K.next!==null;if(Lo=0,zo=K=Ro=null,Bo=!1,Wo=0,Go=null,t)throw Error(a(300));e===null||kc||(e=e.dependencies,e!==null&&va(e)&&(kc=!0))}function Zo(e,t,n,r){Ro=e;var i=0;do{if(Vo&&(Go=null),Wo=0,Vo=!1,25<=i)throw Error(a(301));if(i+=1,zo=K=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}V.H=pc,o=t(n,r)}while(Vo);return o}function Qo(){var e=V.H,t=e.useState()[0];return t=typeof t.then==`function`?as(t):t,e=e.useState()[0],(K===null?null:K.memoizedState)!==e&&(Ro.flags|=1024),t}function $o(){var e=Uo!==0;return Uo=0,e}function es(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ts(e){if(Bo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Bo=!1}Lo=0,zo=K=Ro=null,Vo=!1,Wo=Uo=0,Go=null}function ns(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zo===null?Ro.memoizedState=zo=e:zo=zo.next=e,zo}function rs(){if(K===null){var e=Ro.alternate;e=e===null?null:e.memoizedState}else e=K.next;var t=zo===null?Ro.memoizedState:zo.next;if(t!==null)zo=t,K=e;else{if(e===null)throw Ro.alternate===null?Error(a(467)):Error(a(310));K=e,e={memoizedState:K.memoizedState,baseState:K.baseState,baseQueue:K.baseQueue,queue:K.queue,next:null},zo===null?Ro.memoizedState=zo=e:zo=zo.next=e}return zo}function is(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function as(e){var t=Wo;return Wo+=1,Go===null&&(Go=[]),e=Ya(Go,e,t),t=Ro,(zo===null?t.memoizedState:zo.next)===null&&(t=t.alternate,V.H=t===null||t.memoizedState===null?dc:fc),e}function os(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return as(e);if(e.$$typeof===z)return;if(e.$$typeof===N)return ba(e)}throw Error(a(438,String(e)))}function ss(e){var t=null,n=Ro.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Ro.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=is(),Ro.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]=re;return t.index++,n}function cs(e,t){return typeof t==`function`?t(e):t}function ls(e){return us(rs(),K,e)}function us(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?(Lo&f)===f:(Y&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===Pa&&(d=!0);else if((Lo&p)===p){u=u.next,p===Pa&&(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,Ro.lanes|=p,sd|=p;f=u.action,Ho&&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,Ro.lanes|=f,sd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Ir(o,e.memoizedState)&&(kc=!0,d&&(n=Fa,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 ds(e){var t=rs(),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);Ir(o,t.memoizedState)||(kc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function fs(e,t,n){var r=Ro,i=rs(),o=$i;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!Ir((K||i).memoizedState,n);if(s&&(i.memoizedState=n,kc=!0),i=i.queue,Ls(hs.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||s||zo!==null&&!!(zo.memoizedState.tag&1),Ms(e?9:8,{destroy:void 0},ms.bind(null,r,i,n,t),null),e){if(r.flags|=2048,Qu===null)throw Error(a(349));o||Lo&127||ps(r,t,n)}return n}function ps(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ro.updateQueue,t===null?(t=is(),Ro.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ms(e,t,n,r){t.value=n,t.getSnapshot=r,gs(t)&&_s(e)}function hs(e,t,n){return n(function(){gs(t)&&_s(e)})}function gs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ir(e,n)}catch{return!0}}function _s(e){var t=xi(e,2);t!==null&&Fd(t,e,2)}function vs(e){var t=ns();if(typeof e==`function`){var n=e;if(e=n(),Ho){Ge(!0);try{n()}finally{Ge(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:e},t}function ys(e,t,n,r){return e.baseState=n,us(e,K,typeof r==`function`?r:cs)}function bs(e,t,n,r,i){if(sc(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)}};V.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,xs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function xs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=V.T,o={};o.types=a===null?null:a.types,V.T=o;try{var s=n(i,r),c=V.S;c!==null&&c(o,s),Ss(e,t,s)}catch(n){ws(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),V.T=a}}else try{a=n(i,r),Ss(e,t,a)}catch(n){ws(e,t,n)}}function Ss(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Cs(e,t,n)},function(n){return ws(e,t,n)}):Cs(e,t,n)}function Cs(e,t,n){t.status=`fulfilled`,t.value=n,Ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,xs(e,n)))}function ws(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ts(t),t=t.next;while(t!==r)}e.action=null}function Ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Es(e,t){return t}function Ds(e,t){if($i){var n=Qu.formState;if(n!==null){a:{var r=Ro;if($i){if(Qi){b:{for(var i=Qi,a=ta;i.nodeType!==8;)if(!a||(i=fm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Qi=fm(i.nextSibling),r=i.data===`F!`;break a}}ra(r)}r=!1}r&&(t=n[0])}}return n=ns(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Es,lastRenderedState:t},n.queue=r,n=q.bind(null,Ro,r),r.dispatch=n,r=vs(!1),a=oc.bind(null,Ro,!1,r.queue),r=ns(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=bs.bind(null,Ro,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Os(e){return ks(rs(),K,e)}function ks(e,t,n){if(t=us(e,t,Es)[0],e=ls(cs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=as(t)}catch(e){throw e===Wa?Ka:e}else r=t;t=rs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Ro.flags|=2048,Ms(9,{destroy:void 0},As.bind(null,i,n),null)),[r,a,e]}function As(e,t){e.action=t}function js(e){var t=rs(),n=K;if(n!==null)return ks(t,n,e);rs(),t=t.memoizedState,n=rs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ms(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Ro.updateQueue,t===null&&(t=is(),Ro.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 Ns(){return rs().memoizedState}function Ps(e,t,n,r){var i=ns();Ro.flags|=e,i.memoizedState=Ms(1|t,{destroy:void 0},n,r===void 0?null:r)}function Fs(e,t,n,r){var i=rs();r=r===void 0?null:r;var a=i.memoizedState.inst;K!==null&&r!==null&&Jo(r,K.memoizedState.deps)?i.memoizedState=Ms(t,a,n,r):(Ro.flags|=e,i.memoizedState=Ms(1|t,a,n,r))}function Is(e,t){Ps(8390656,8,e,t)}function Ls(e,t){Fs(2048,8,e,t)}function Rs(e){Ro.flags|=4;var t=Ro.updateQueue;if(t===null)t=is(),Ro.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function zs(e){var t=rs().memoizedState;return Rs({ref:t,nextImpl:e}),function(){if(Zu&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function Bs(e,t){return Fs(4,2,e,t)}function Vs(e,t){return Fs(4,4,e,t)}function Hs(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 Us(e,t,n){n=n==null?null:n.concat([e]),Fs(4,4,Hs.bind(null,t,e),n)}function Ws(){}function Gs(e,t){var n=rs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Jo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ks(e,t){var n=rs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Jo(t,r[1]))return r[0];if(r=e(),Ho){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r}function qs(e,t,n){return n===void 0||Lo&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=Nd(),Ro.lanes|=e,sd|=e,n)}function Js(e,t,n,r){return Ir(n,t)?n:xo.current===null?!(Lo&106)||Lo&1073741824&&!(Y&261930)?(kc=!0,e.memoizedState=n):(e=Nd(),Ro.lanes|=e,sd|=e,t):(e=qs(e,n,r),Ir(e,t)||(kc=!0),e)}function Ys(e,t,n,r,i){var a=H.p;H.p=a!==0&&8>a?a:8;var o=V.T,s={};s.types=o===null?null:o.types,V.T=s,oc(e,!1,t,n);try{var c=i(),l=V.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ac(e,t,Ra(c,r),Md(e)):ac(e,t,r,Md(e))}catch(n){ac(e,t,{then:function(){},status:`rejected`,reason:n},Md())}finally{H.p=a,o!==null&&s.types!==null&&(o.types=s.types),V.T=o}}function Xs(){}function Zs(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=Qs(e).queue;Ys(e,i,t,ue,n===null?Xs:function(){return $s(e),n(r)})}function Qs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function $s(e){var t=Qs(e);t.next===null&&(t=e.alternate.memoizedState),ac(e,t.next.queue,{},Md())}function ec(){return ba(lh)}function tc(){return rs().memoizedState}function nc(){return rs().memoizedState}function rc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Md();e=fo(n);var r=po(t,e,n);r!==null&&(Fd(r,t,n),mo(r,t,n)),t={cache:Da()},e.payload=t;return}t=t.return}}function ic(e,t,n){var r=Md();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},sc(e)?cc(t,n):(n=bi(e,t,n,r),n!==null&&(Fd(n,e,r),lc(n,t,r)))}function q(e,t,n){ac(e,t,n,Md())}function ac(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(sc(e))cc(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,Ir(s,o))return yi(e,t,i,0),Qu===null&&vi(),!1}catch{}if(n=bi(e,t,i,r),n!==null)return Fd(n,e,r),lc(n,t,r),!0}return!1}function oc(e,t,n,r){if(r={lane:2,revertLane:If(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},sc(e)){if(t)throw Error(a(479))}else t=bi(e,n,r,2),t!==null&&Fd(t,e,2)}function sc(e){var t=e.alternate;return e===Ro||t!==null&&t===Ro}function cc(e,t){Vo=Bo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lt(e,n)}}var uc={readContext:ba,use:os,useCallback:qo,useContext:qo,useEffect:qo,useImperativeHandle:qo,useLayoutEffect:qo,useInsertionEffect:qo,useMemo:qo,useReducer:qo,useRef:qo,useState:qo,useDebugValue:qo,useDeferredValue:qo,useTransition:qo,useSyncExternalStore:qo,useId:qo,useHostTransitionStatus:qo,useFormState:qo,useActionState:qo,useOptimistic:qo,useMemoCache:qo,useCacheRefresh:qo,useEffectEvent:qo},dc={readContext:ba,use:os,useCallback:function(e,t){return ns().memoizedState=[e,t===void 0?null:t],e},useContext:ba,useEffect:Is,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ps(4194308,4,Hs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ps(4194308,4,e,t)},useInsertionEffect:function(e,t){Ps(4,2,e,t)},useMemo:function(e,t){var n=ns();t=t===void 0?null:t;var r=e();if(Ho){Ge(!0);try{e()}finally{Ge(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ns();if(n!==void 0){var i=n(t);if(Ho){Ge(!0);try{n(t)}finally{Ge(!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=ic.bind(null,Ro,e),[r.memoizedState,e]},useRef:function(e){var t=ns();return e={current:e},t.memoizedState=e},useState:function(e){e=vs(e);var t=e.queue,n=q.bind(null,Ro,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ws,useDeferredValue:function(e,t){return qs(ns(),e,t)},useTransition:function(){var e=vs(!1);return e=Ys.bind(null,Ro,e.queue,!0,!1),ns().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Ro,i=ns();if($i){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Qu===null)throw Error(a(349));Y&127||ps(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Is(hs.bind(null,r,o,e),[e]),r.flags|=2048,Ms(9,{destroy:void 0},ms.bind(null,r,o,n,t),null),n},useId:function(){var e=ns(),t=Qu.identifierPrefix;if($i){var n=Gi,r=Wi;n=(r&~(1<<32-Ke(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Uo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Ko++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ec,useFormState:Ds,useActionState:Ds,useOptimistic:function(e){var t=ns();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=oc.bind(null,Ro,!0,n),n.dispatch=t,[e,t]},useMemoCache:ss,useCacheRefresh:function(){return ns().memoizedState=rc.bind(null,Ro)},useEffectEvent:function(e){var t=ns(),n={impl:e};return t.memoizedState=n,function(){if(Zu&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},fc={readContext:ba,use:os,useCallback:Gs,useContext:ba,useEffect:Ls,useImperativeHandle:Us,useInsertionEffect:Bs,useLayoutEffect:Vs,useMemo:Ks,useReducer:ls,useRef:Ns,useState:function(){return ls(cs)},useDebugValue:Ws,useDeferredValue:function(e,t){return Js(rs(),K.memoizedState,e,t)},useTransition:function(){var e=ls(cs)[0],t=rs().memoizedState;return[typeof e==`boolean`?e:as(e),t]},useSyncExternalStore:fs,useId:tc,useHostTransitionStatus:ec,useFormState:Os,useActionState:Os,useOptimistic:function(e,t){return ys(rs(),K,e,t)},useMemoCache:ss,useCacheRefresh:nc,useEffectEvent:zs},pc={readContext:ba,use:os,useCallback:Gs,useContext:ba,useEffect:Ls,useImperativeHandle:Us,useInsertionEffect:Bs,useLayoutEffect:Vs,useMemo:Ks,useReducer:ds,useRef:Ns,useState:function(){return ds(cs)},useDebugValue:Ws,useDeferredValue:function(e,t){var n=rs();return K===null?qs(n,e,t):Js(n,K.memoizedState,e,t)},useTransition:function(){var e=ds(cs)[0],t=rs().memoizedState;return[typeof e==`boolean`?e:as(e),t]},useSyncExternalStore:fs,useId:tc,useHostTransitionStatus:ec,useFormState:js,useActionState:js,useOptimistic:function(e,t){var n=rs();return K===null?(n.baseState=e,[e,n.queue.dispatch]):ys(n,K,e,t)},useMemoCache:ss,useCacheRefresh:nc,useEffectEvent:zs};function mc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:E({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var hc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Md(),i=fo(r);i.payload=t,n!=null&&(i.callback=n),t=po(e,i,r),t!==null&&(Fd(t,e,r),mo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Md(),i=fo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=po(e,i,r),t!==null&&(Fd(t,e,r),mo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Md(),r=fo(n);r.tag=2,t!=null&&(r.callback=t),t=po(e,r,n),t!==null&&(Fd(t,e,n),mo(t,e,n))}};function gc(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?!Lr(n,r)||!Lr(i,a):!0}function _c(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&&hc.enqueueReplaceState(t,t.state,null)}function vc(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=E({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function yc(e){mi(e)}function bc(e){console.error(e)}function xc(e){mi(e)}function Sc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Cc(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 wc(e,t,n){return n=fo(n),n.tag=3,n.payload={element:null},n.callback=function(){Sc(e,t)},n}function Tc(e){return e=fo(e),e.tag=3,e}function Ec(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(){Cc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Cc(t,n,r),typeof i!=`function`&&(yd===null?yd=new Set([this]):yd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Dc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&_a(t,n,i,!0),n=Eo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Do===null?qd():n.alternate===null&&od===0&&(od=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===qa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),gf(e,r,i)),!1;case 22:return n.flags|=65536,r===qa?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)),gf(e,r,i)),!1}throw Error(a(435,n.tag))}return gf(e,r,i),qd(),!1}if($i)return t=Eo.current,t===null?(r!==na&&(t=Error(a(423),{cause:r}),la(Ii(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Ii(r,n),i=wc(e.stateNode,r,i),ho(e,i),od!==4&&(od=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==na&&(e=Error(a(422),{cause:r}),la(Ii(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=Ii(o,n),fd===null?fd=[o]:fd.push(o),od!==4&&(od=2),t===null)return!0;r=Ii(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=wc(n.stateNode,r,e),ho(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`&&(yd===null||!yd.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Tc(i),Ec(i,e,n,r),ho(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Oc=Error(a(461)),kc=!1;function Ac(e,t,n,r){t.child=e===null?so(t,null,n,r):oo(t,e.child,n,r)}function jc(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 ya(t),r=Yo(e,t,n,o,a,i),s=$o(),e!==null&&!kc?(es(e,t,i),il(e,t,i)):($i&&s&&Ji(t),t.flags|=1,Ac(e,t,r,i),t.child)}function J(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Di(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Mc(e,t,a,r,i)):(e=Ai(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!al(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Lr:n,n(o,r)&&e.ref===t.ref)return il(e,t,i)}return t.flags|=1,e=Oi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Mc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Lr(a,r)&&e.ref===t.ref){if(kc=!1,t.pendingProps=r=a,al(e,i))e.flags&131072&&(kc=!0);else return t.lanes=e.lanes,il(e,t,i)}}return Bc(e,t,n,r,i)}function Nc(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 Fc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ha(t,a===null?null:a.cachePool),a===null?wo():Co(t,a),Ao(t);else return r=t.lanes=536870912,Fc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ha(t,null),wo(),jo()):(Ha(t,a.cachePool),Co(t,a),jo(),t.memoizedState=null);return Ac(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 Fc(e,t,n,r,i){var a=Va();return a=a===null?null:{parent:Ea._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ha(t,null),wo(),Ao(t),e!==null&&_a(e,t,r,!0),t.childLanes=i,null}function Ic(e,t){return t=Yc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Lc(e,t,n){return oo(t,e.child,null,n),e=Ic(t,t.pendingProps),e.flags|=2,Mo(t),t.memoizedState=null,e}function Rc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if($i){if(r.mode===`hidden`)return e=Ic(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Pc(null,e);if(ko(t),(e=Qi)?(e=cm(e,ta),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ui===null?null:{id:Wi,overflow:Gi},retryLane:536870912,hydrationErrors:null},n=Ni(e),n.return=t,t.child=n,Zi=t,Qi=null)):e=null,e===null)throw ra(t);return t.lanes=536870912,null}return Ic(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ko(t),i){if(t.flags&256)t.flags&=-257,t=Lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558))}else if(kc||_a(e,t,n,!1),i=(n&e.childLanes)!==0,kc||i){if(xo.current===null){if(r=Qu,r!==null&&(s=ut(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,xi(e,s),Fd(r,e,s),Oc;qd()}t=Lc(e,t,n)}else e=o.treeContext,Qi=fm(s.nextSibling),Zi=t,$i=!0,ea=null,ta=!1,e!==null&&Xi(t,e),t=Ic(t,r),t.flags|=134221824;return t}return e=Oi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function zc(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 Bc(e,t,n,r,i){return ya(t),n=Yo(e,t,n,r,void 0,i),r=$o(),e!==null&&!kc?(es(e,t,i),il(e,t,i)):($i&&r&&Ji(t),t.flags|=1,Ac(e,t,n,i),t.child)}function Vc(e,t,n,r,i,a){return ya(t),t.updateQueue=null,n=Zo(t,r,n,i),Xo(e),r=$o(),e!==null&&!kc?(es(e,t,a),il(e,t,a)):($i&&r&&Ji(t),t.flags|=1,Ac(e,t,n,a),t.child)}function Hc(e,t,n,r,i){if(ya(t),t.stateNode===null){var a=wi,o=n.contextType;typeof o==`object`&&o&&(a=ba(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=hc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},lo(t),o=n.contextType,a.context=typeof o==`object`&&o?ba(o):wi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(mc(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&&hc.enqueueReplaceState(a,a.state,null),vo(t,r,a,i),_o(),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=vc(n,s);a.props=c;var l=a.context,u=n.contextType;o=wi,typeof u==`object`&&u&&(o=ba(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)&&_c(t,a,r,o),co=!1;var f=t.memoizedState;a.state=f,vo(t,r,a,i),_o(),l=t.memoizedState,s||f!==l||co?(typeof d==`function`&&(mc(t,n,d,r),l=t.memoizedState),(c=co||gc(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,uo(e,t),o=t.memoizedProps,u=vc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=wi,typeof l==`object`&&l&&(c=ba(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)&&_c(t,a,r,c),co=!1,f=t.memoizedState,a.state=f,vo(t,r,a,i),_o();var p=t.memoizedState;o!==d||f!==p||co||e!==null&&e.dependencies!==null&&va(e.dependencies)?(typeof s==`function`&&(mc(t,n,s,r),p=t.memoizedState),(u=co||gc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&va(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,zc(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=oo(t,e.child,null,i),t.child=oo(t,null,n,i)):Ac(e,t,n,i),t.memoizedState=a.state,e=t.child):e=il(e,t,i),e}function Uc(e,t,n,r){return sa(),t.flags|=256,Ac(e,t,n,r),t.child}var Wc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gc(e){return{baseLanes:e,cachePool:Ua()}}function Kc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ud),e}function qc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(No.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if($i){if(i?Oo(t):jo(),(e=Qi)?(e=cm(e,ta),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ui===null?null:{id:Wi,overflow:Gi},retryLane:536870912,hydrationErrors:null},n=Ni(e),n.return=t,t.child=n,Zi=t,Qi=null)):e=null,e===null)throw ra(t);return t.lanes=um(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(jo(),i=t.mode,a=Yc({mode:`hidden`,children:a},i),r=ji(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Gc(n),r.childLanes=Kc(e,o,n),t.memoizedState=Wc,Pc(null,r)):(Oo(t),Jc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Zc(e,t,a,o,r,c,s,n)}return i?(jo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Oi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=ji(i,a,n,null),i.flags|=2):i=Oi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Pc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Gc(n):(a=i.cachePool,a===null?a=Ua():(s=Ea._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Kc(e,o,n),t.memoizedState=Wc,Pc(e.child,r)):(Oo(t),n=e.child,e=n.sibling,n=Oi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Jc(e,t){return t=Yc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Yc(e,t){return e=Ei(22,e,null,t),e.lanes=0,e}function Xc(e,t,n){return oo(t,e.child,null,n),e=Jc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Zc(e,t,n,r,i,o,s,c){if(n)return t.flags&256?(Oo(t),t.flags&=-257,Xc(e,t,c)):t.memoizedState===null?(jo(),o=i.fallback,s=t.mode,i=Yc({mode:`visible`,children:i.children},s),o=ji(o,s,c,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,oo(t,e.child,null,c),i=t.child,i.memoizedState=Gc(c),i.childLanes=Kc(e,r,c),t.memoizedState=Wc,Pc(null,i)):(jo(),t.child=e.child,t.flags|=128,null);if(Oo(t),um(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(a(419)),i.stack=``,i.digest=r,la({value:i,source:null,stack:null})),Xc(e,t,c)}if(kc||_a(e,t,c,!1),r=(c&e.childLanes)!==0,kc||r){if(xo.current!==null)return Xc(e,t,c);if(r=Qu,r!==null&&(i=ut(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,xi(e,i),Fd(r,e,i),Oc;return lm(o)||qd(),Xc(e,t,c)}return lm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Qi=fm(o.nextSibling),Zi=t,$i=!0,ea=null,ta=!1,e!==null&&Xi(t,e),t=Jc(t,i.children),t.flags|=134221824,t)}function Qc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ha(e.return,t,n)}function $c(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Io(n)===null&&(t=e),e=e.sibling}return t}function el(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 tl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function nl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=No.current;if(t.flags&128)return Po(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Po(t,o),i===`backwards`&&e!==null?(tl(e),Ac(e,t,r,n),tl(e)):Ac(e,t,r,n),r=$i?Bi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qc(e,n,t);else if(e.tag===19)Qc(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`backwards`:n=$c(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,tl(t)),el(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}el(t,!0,n,null,a,r);break;case`together`:el(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=$c(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),el(t,!1,i,n,a,r)}return t.child}function rl(e,t,n){var r=t.pendingProps;return pa(t,t.type,r.value),Ac(e,t,r.children,n),t.child}function il(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),sd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(_a(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=Oi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Oi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function al(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&va(e)))}function ol(e,t,n){switch(t.tag){case 3:W(t,t.stateNode.containerInfo),pa(t,Ea,e.memoizedState.cache),sa();break;case 27:case 5:be(t);break;case 4:W(t,t.stateNode.containerInfo);break;case 10:pa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ko(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Oo(t),t.flags|=128,null;r=_a(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?qc(e,t,n):(Oo(t),e=il(e,t,n),e===null?null:e.sibling)}Oo(t);break;case 19:if(t.flags&128)return nl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(_a(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return nl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Po(t,No.current),r)break;return null;case 22:return t.lanes=0,Nc(e,t,n,t.pendingProps);case 24:pa(t,Ea,e.memoizedState.cache)}return il(e,t,n)}function sl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)kc=!0;else{if(!al(e,n)&&!(t.flags&128))return kc=!1,ol(e,t,n);kc=!!(e.flags&131072)}}else kc=!1,$i&&t.flags&1048576&&qi(t,Bi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Xa(t.elementType),t.type=e,typeof e==`function`)Di(e)?(r=vc(e,r),t.tag=1,t=Hc(null,t,e,r,n)):(t.tag=0,t=Bc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===P){t.tag=11,t=jc(null,t,e,r,n);break a}if(i===I){t.tag=14,t=J(null,t,e,r,n);break a}if(i===N){t.tag=10,t.type=e,t=rl(null,t,n);break a}}throw t=le(e)||e,Error(a(306,t,``))}}return t;case 0:return Bc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=vc(r,t.pendingProps),Hc(e,t,r,i,n);case 3:a:{if(W(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,uo(e,t),vo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,pa(t,Ea,r),r!==o.cache&&ga(t,[Ea],n,!0),_o(),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=Uc(e,t,r,n);break a}if(r!==i){i=Ii(Error(a(424)),t),la(i),t=Uc(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(Qi=fm(e.firstChild),Zi=t,$i=!0,ea=null,ta=!0,n=so(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(sa(),r===i){t=il(e,t,n);break a}Ac(e,t,r,n)}t=t.child}return t;case 26:return zc(e,t),e===null?(n=Im(t.type,null,t.pendingProps,null))?t.memoizedState=n:$i||(t.stateNode=gp(t.type,t.pendingProps,ve.current,t)):t.memoizedState=Im(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return be(t),e===null&&$i&&(r=t.stateNode=vm(t.type,t.pendingProps,ve.current),Zi=t,ta=!0,i=Qi,Ep(t.type)?(pm=i,Qi=fm(r.firstChild)):Qi=i),Ac(e,t,t.pendingProps.children,n),zc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&$i&&((i=r=Qi)&&(r=sm(r,t.type,t.pendingProps,ta),r===null?i=!1:(t.stateNode=r,Zi=t,Qi=fm(r.firstChild),ta=!1,i=!0)),i||ra(t)),be(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,_p(i,o)?r=null:s!==null&&_p(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=Yo(e,t,Qo,null,null,n),lh._currentValue=i),zc(e,t),Ac(e,t,r,n),t.child;case 6:return e===null&&$i&&((e=n=Qi)&&(n=X(n,t.pendingProps,ta),n===null?e=!1:(t.stateNode=n,Zi=t,Qi=null,e=!0)),e||ra(t)),null;case 13:return qc(e,t,n);case 4:return W(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=oo(t,null,r,n):Ac(e,t,r,n),t.child;case 11:return jc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,zc(e,t),Ac(e,t,r,n),t.child;case 8:return Ac(e,t,t.pendingProps.children,n),t.child;case 12:return Ac(e,t,t.pendingProps.children,n),t.child;case 10:return rl(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,ya(t),i=ba(i),r=r(i),t.flags|=1,Ac(e,t,r,n),t.child;case 14:return J(e,t,t.type,t.pendingProps,n);case 15:return Mc(e,t,t.type,t.pendingProps,n);case 19:return nl(e,t,n);case 31:return Rc(e,t,n);case 22:return Nc(e,t,n,t.pendingProps);case 24:return ya(t),r=ba(Ea),e===null?(i=Va(),i===null&&(i=Qu,o=Da(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},lo(t),pa(t,Ea,i)):((e.lanes&n)!==0&&(uo(e,t),vo(t,null,null,n),_o()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,pa(t,Ea,r),r!==i.cache&&ga(t,[Ea],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),pa(t,Ea,r))),Ac(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:$i&&Ji(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:zc(e,t),Ac(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function cl(e){e.flags|=4}function ll(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Xm(t,r):Xm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Wd())e.flags|=8192;else throw Za=qa,Ga}}else e.flags&=-16777217}function ul(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Zm(t)){if(Wd())e.flags|=8192;else throw Za=qa,Ga}}function dl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:it(),e.lanes|=t,dd|=t)}function fl(e,t){if(!$i)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function pl(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&1206910976,r|=i.flags&1206910976,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 ml(e,t,n){var r=t.pendingProps;switch(Yi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pl(t),null;case 1:return pl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ma(Ea),ye(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(oa(t)?cl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ca())),pl(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(cl(t),o===null?(pl(t),ll(t,i,null,r,n)):(pl(t),ul(t,o))):o?o===e.memoizedState?(pl(t),t.flags&=-16777217):(cl(t),pl(t),ul(t,o)):(e=e.memoizedProps,e!==r&&cl(t),pl(t),ll(t,i,e,r,n)),null;case 27:if(xe(t),n=ve.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return pl(t),t.subtreeFlags&=-33554433,null}e=ge.current,oa(t)?ia(t,e):(e=vm(i,r,n),t.stateNode=e,cl(t))}return pl(t),t.subtreeFlags&=-33554433,null;case 5:if(xe(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return pl(t),t.subtreeFlags&=-33554433,null}if(o=ge.current,oa(t))ia(t,o);else{var s=pp(ve.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[gt]=t,o[_t]=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(op(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&&cl(t)}}return pl(t),t.subtreeFlags&=-33554433,ll(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=ve.current,oa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Zi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[gt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||rp(e.nodeValue,n)),e||ra(t,!0)}else e=pp(e).createTextNode(r),e[gt]=t,t.stateNode=e}return pl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=oa(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[gt]=t}else sa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pl(t),e=!1}else n=ca(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Mo(t),t):(Mo(t),null);if(t.flags&128)throw Error(a(558))}return pl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=oa(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[gt]=t}else sa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pl(t),i=!1}else i=ca(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Mo(t),t):(Mo(t),null)}return Mo(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),dl(t,t.updateQueue),pl(t),null);case 4:return ye(),e===null&&qf(t.stateNode.containerInfo),t.flags|=67108864,pl(t),null;case 10:return ma(t.type),pl(t),null;case 19:if(Fo(t),r=t.memoizedState,r===null)return pl(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)fl(r,!1);else{if(od!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Io(e),o!==null){for(t.flags|=128,fl(r,!1),e=o.updateQueue,t.updateQueue=e,dl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ki(n,e),n=n.sibling;return Po(t,No.current&1|2),$i&&Ki(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Pe()>_d&&(t.flags|=128,i=!0,fl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Io(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,dl(t,e),fl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!$i)return pl(t),null}else 2*Pe()-r.renderingStartTime>_d&&n!==536870912&&(t.flags|=128,i=!0,fl(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)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Pe(),e.sibling=null,o=No.current,o=i?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||$i?Po(t,o):(n=o,he(Eo,t),he(No,n),Do===null&&(Do=t)),$i&&Ki(t,r.treeForkCount),e}return pl(t),null;case 22:case 23:return Mo(t),To(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(pl(t),t.subtreeFlags&6&&(t.flags|=8192)):pl(t),n=t.updateQueue,n!==null&&dl(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&&me(Ba),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ma(Ea),pl(t),null;case 25:return null;case 30:return t.flags|=33554432,pl(t),null}throw Error(a(156,t.tag))}function hl(e,t){switch(Yi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ma(Ea),ye(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xe(t),null;case 31:if(t.memoizedState!==null){if(Mo(t),t.alternate===null)throw Error(a(340));sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Mo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ye(),null;case 10:return ma(t.type),null;case 22:case 23:return Mo(t),To(),e!==null&&me(Ba),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ma(Ea),null;case 25:return null;default:return null}}function gl(e,t){switch(Yi(t),t.tag){case 3:ma(Ea),ye();break;case 26:case 27:case 5:xe(t);break;case 4:ye();break;case 31:t.memoizedState!==null&&Mo(t);break;case 13:Mo(t);break;case 19:Fo(t);break;case 10:ma(t.type);break;case 22:case 23:Mo(t),To(),e!==null&&me(Ba);break;case 24:ma(Ea)}}function _l(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){hf(t,t.return,e)}}function vl(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){hf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){hf(t,t.return,e)}}function yl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{bo(t,n)}catch(t){hf(e,e.return,t)}}}function bl(e,t,n){n.props=vc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){hf(e,t,n)}}function xl(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:var i=e.stateNode,a=di(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Rp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new zp(e);m(e.child,!1,nm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){hf(e,t,n)}}function Sl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){hf(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){hf(e,t,n)}else n.current=null}}function Cl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)im(e.stateNode,t[n])}function wl(e){for(var t=e.return;t!==null&&(Dl(t)&&im(e.stateNode,t.stateNode),!El(t));)t=t.return}function Tl(e){for(var t=e.return;t!==null&&(Dl(t)&&am(e.stateNode,t.stateNode),!El(t));)t=t.return}function El(e){return e.tag===5||e.tag===3||e.tag===27}function Dl(e){return e&&e.tag===7&&e.stateNode!==null}function Ol(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){hf(e,e.return,t)}}function kl(e,t,n){try{var r=e.stateNode;cp(r,e.type,n,t),r[_t]=t}catch(t){hf(e,e.return,t)}}function Al(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ep(e.type)||e.tag===4}function jl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Al(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&&Ep(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 Ml(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=pn)),Cl(e,r),Bt=!0;else if(i!==4&&(i===27&&(Cl(e,r),r=null,Ep(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ml(e,t,n,r),e=e.sibling;e!==null;)Ml(e,t,n,r),e=e.sibling}function Nl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Cl(e,r),Bt=!0;else if(i!==4&&(i===27&&(Cl(e,r),r=null,Ep(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Nl(e,t,n,r),e=e.sibling;e!==null;)Nl(e,t,n,r),e=e.sibling}function Pl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);op(t,r,n),t[gt]=e,t[_t]=n}catch(t){hf(e,e.return,t)}}var Fl=!1,Il=null;function Ll(e){(e.tag===30||e.subtreeFlags&33554432)&&(Fl=!0)}var Rl=null;function zl(){var e=Rl;return Rl=null,e}var Bl=0;function Vl(e,t,n,r,i){return Bl=0,Hl(e.child,t,n,r,i)}function Hl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Mp(o);r.push(s),s.view&&(a=!0)}else a||Mp(o).view&&(a=!0);Fl=!0,kp(o,Bl===0?t:t+`_`+Bl,n),Bl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Hl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Ul(e,t){for(;e!==null;)e.tag===5?Ap(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Ul(e.child,t),e=e.sibling}function Wl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Wl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(a(544));var n=t.name;t=pi(t.default,t.share),t!==`none`&&(Vl(e,n,t,null,!1)||Ul(e.child,!1))}e=e.sibling}}function Gl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=di(r,n),a=pi(r.default,n.paired?r.share:r.enter);a===`none`?Wl(e):Vl(e,i,a,null,!1)?(Wl(e),n.paired||t||Pd(e,r.onEnter)):Ul(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Gl(e,t),e=e.sibling;else Wl(e)}function Kl(e){if(Il!==null&&Il.size!==0){var t=Il;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=pi(n.default,n.share);if(a!==`none`&&(Vl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Pd(e,n.onShare)):Ul(e.child,!1)),t.delete(r),t.size===0)break}}}Kl(e)}e=e.sibling}}}function ql(e){if(e.tag===30){var t=e.memoizedProps,n=di(t,e.stateNode),r=Il===null?void 0:Il.get(n),i=pi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Vl(e,n,i,null,!1)?r===void 0?Pd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Il.delete(n),Pd(e,t.onShare)):Ul(e.child,!1)),Il!==null&&Kl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ql(e),e=e.sibling;else Il!==null&&Kl(e)}function Jl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=di(t,e.stateNode);t=pi(t.default,t.update),e.flags&=-5,t!==`none`&&Vl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Jl(e);e=e.sibling}}function Yl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Ul(e.child,!1))}Yl(e)}e=e.sibling}}function Xl(e){if(e.tag===30)e.stateNode.paired=null,Ul(e.child,!1),Yl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e),e=e.sibling;else Yl(e)}function Zl(e){for(e=e.child;e!==null;)e.tag===30?Ul(e.child,!1):e.subtreeFlags&33554432&&Zl(e),e=e.sibling}function Ql(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Bl<a.length){var l=a[Bl],u=Mp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&kp(c,Bl===0?n:n+`_`+Bl,i),s&&e.flags&4||(Rl===null&&(Rl=[]),Rl.push(c,Bl===0?r:r+`_`+Bl,t.memoizedProps)),Bl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Ql(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function $l(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=di(n,r),a=pi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Np)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Bl=0,i=Ql(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Pd(e,n.onUpdate))}else e.subtreeFlags&33554432&&$l(e,t);e=e.sibling}}var eu=!1,tu=!1,nu=!1,ru=!1,iu=typeof WeakSet==`function`?WeakSet:Set,au=null,ou=!1,su=!1,cu=!1,lu=!1;function uu(e,t,n){if(e=e.containerInfo,dp=vh,e=Vr(e),Hr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(fp={focusedElem:e,selectionRange:r},vh=!1,n=(n&335544064)===n,au=t,t=n?9270:1024;au!==null;){if(e=au,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Ll(e),du(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&ql(r),du(n);continue}if(r!==null&&r.memoizedState!==null){n&&Ll(e),du(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,au=r):(n&&Jl(e),du(n))}}Il=null}function du(e){for(;au!==null;){var t=au,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=vc(t.type,i);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){hf(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)om(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:om(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=di(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=pi(i.default,i.update),i!==`none`&&Vl(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(a(163))}if(r=t.sibling,r!==null){r.return=t.return,au=r;break}au=t.return}}function fu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Mu(e,n),r&4&&_l(5,n);break;case 1:if(Mu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){hf(n,n.return,e)}else{var i=vc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){hf(n,n.return,e)}}}r&64&&yl(n),r&512&&xl(n,n.return);break;case 3:if(Mu(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{bo(e,t)}catch(e){hf(n,n.return,e)}}break;case 27:t===null&&r&4&&Pl(n);case 26:case 5:Mu(e,n),t===null&&r&4&&Ol(n),r&512&&xl(n,n.return);break;case 12:Mu(e,n);break;case 31:Mu(e,n),r&4&&xu(e,n);break;case 13:Mu(e,n),r&4&&Su(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=yf.bind(null,n),dm(e,n))));break;case 22:if(r=n.memoizedState!==null||eu,!r){var a=t!==null&&t.memoizedState!==null||tu;t=eu,i=tu,eu=r,(tu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Pu(e,n,r)):Mu(e,n),eu=t,tu=i}break;case 30:Mu(e,n),r&512&&xl(n,n.return);break;case 7:r&512&&xl(n,n.return);default:Mu(e,n)}}function pu(e,t){for(e=e.child;e!==null;)mu(e,t),e=e.sibling}function mu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){hf(e,e.return,t)}hu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Bt=!0}catch(t){hf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Op(s,!0):Op(e.stateNode,!1)}catch(t){hf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&pu(e,t);break;default:pu(e,t)}}function hu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:mu(n,r);break a;case 22:n.memoizedState===null&&hu(n,r);break a;default:hu(n,r)}}e=e.sibling}}function gu(e){var t=e.alternate;t!==null&&(e.alternate=null,gu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tt(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 _u=null,vu=!1;function yu(e,t,n){for(n=n.child;n!==null;)bu(e,t,n),n=n.sibling}function bu(e,t,n){if(We&&typeof We.onCommitFiberUnmount==`function`)try{We.onCommitFiberUnmount(Ue,n)}catch{}switch(n.tag){case 26:tu||Sl(n,t),yu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!tu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:tu||Sl(n,t),Tl(n);var r=_u,i=vu;Ep(n.type)&&(_u=n.stateNode,vu=!1),yu(e,t,n),ym(n.stateNode,n.type,n.memoizedProps),_u=r,vu=i;break;case 5:tu||Sl(n,t),Tl(n);case 6:if(n.tag===6&&Tl(n),r=_u,i=vu,_u=null,yu(e,t,n),_u=r,vu=i,_u!==null){if(vu)try{(_u.nodeType===9?_u.body:_u.nodeName===`HTML`?_u.ownerDocument.body:_u).removeChild(n.stateNode),Bt=!0}catch(e){hf(n,t,e)}else try{_u.removeChild(n.stateNode),Bt=!0}catch(e){hf(n,t,e)}}break;case 18:_u!==null&&(vu?(e=_u,Dp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Wh(e)):Dp(_u,n.stateNode));break;case 4:r=_u,i=vu,_u=n.stateNode.containerInfo,vu=!0,yu(e,t,n),_u=r,vu=i;break;case 0:case 11:case 14:case 15:vl(2,n,t),tu||vl(4,n,t),yu(e,t,n);break;case 1:tu||(Sl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&bl(n,t,r)),yu(e,t,n);break;case 21:yu(e,t,n);break;case 22:tu=(r=tu)||n.memoizedState!==null,yu(e,t,n),tu=r;break;case 30:Sl(n,t),yu(e,t,n);break;case 7:tu||Sl(n,t),yu(e,t,n);break;default:yu(e,t,n)}}function xu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wh(e)}catch(e){hf(t,t.return,e)}}}function Su(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wh(e)}catch(e){hf(t,t.return,e)}}function Cu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new iu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new iu),t;default:throw Error(a(435,e.tag))}}function wu(e,t){var n=Cu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=bf.bind(null,e,t);t.then(r,r)}})}function Tu(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var o=r[i],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Ep(l.type)){_u=l.stateNode,vu=!1;break a}break;case 5:_u=l.stateNode,vu=!1;break a;case 3:case 4:_u=l.stateNode.containerInfo,vu=!0;break a}l=l.return}if(_u===null)throw Error(a(160));bu(s,c,o),_u=null,vu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Du(t,e,n),t=t.sibling}var Eu=null;function Du(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Tu(t,e,n),Ou(e),i&4&&(vl(3,e,e.return),_l(3,e),vl(5,e,e.return));break;case 1:Tu(t,e,n),Ou(e),i&512&&(tu||r===null||Sl(r,r.return)),i&64&&eu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Eu,Tu(t,e,n),Ou(e),i&512&&(tu||r===null||Sl(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(eu)e.stateNode=gp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=o.ownerDocument||o;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[Ct]||r[gt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),op(r,t,n),r[gt]=e,At(r),t=r;break a;case`link`:if(o=qm(`link`,`href`,i).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=i.createElement(t),op(r,t,n),i.head.appendChild(r);break;case`meta`:if(o=qm(`meta`,`content`,i).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=i.createElement(t),op(r,t,n),i.head.appendChild(r);break;default:throw Error(a(468,t))}r[gt]=e,At(r),t=r}e.stateNode=t}}else eu||Jm(o,e.type,e.stateNode)}else e.stateNode=Hm(o,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&kl(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||tu||t.parentNode.removeChild(t)):i.count--,n===null?eu||Jm(o,e.type,e.stateNode):Hm(o,n,e.memoizedProps))}break;case 27:Tu(t,e,n),Ou(e),i&512&&(tu||r===null||Sl(r,r.return)),r!==null&&i&4&&kl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=nu,nu=!1,Tu(t,e,n),nu=o,Ou(e),i&512&&(tu||r===null||Sl(r,r.return)),e.flags&32){t=e.stateNode;try{an(t,``),Bt=!0}catch(t){hf(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,kl(e,t,r===null?t:r.memoizedProps)),i&1024&&(ru=!0);break;case 6:if(Tu(t,e,n),Ou(e),i&4){if(e.stateNode===null)throw Error(a(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Bt=!0}catch(t){hf(e,e.return,t)}}break;case 3:if(Bt=!1,Km=null,o=Eu,Eu=Cm(t.containerInfo),Tu(t,e,n),Eu=o,Ou(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Wh(t.containerInfo)}catch(t){hf(e,e.return,t)}ru&&(ru=!1,ku(e)),Bt=!1;break;case 4:i=nu,nu=eu,r=Vt(),o=Eu,Eu=Cm(e.stateNode.containerInfo),Tu(t,e,n),Ou(e),Eu=o,Bt&&su&&(cu=!0),Bt=r,nu=i;break;case 12:Tu(t,e,n),Ou(e);break;case 31:Tu(t,e,n),Ou(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,wu(e,t)));break;case 13:Tu(t,e,n),Ou(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(hd=Pe()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,wu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=eu,l=tu,u=nu;eu=c||o,nu=u||o,tu=l||s,Tu(t,e,n),tu=l,nu=u,eu=c,Ou(e),i&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||eu||tu||(t=s||tu,n=eu,r=tu,eu=o||eu,tu=t,Nu(e,2),eu=n,tu=r),!o&&nu||pu(e,o)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,wu(e,n))));break;case 19:Tu(t,e,n),Ou(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,wu(e,t)));break;case 30:i&512&&(tu||r===null||Sl(r,r.return)),i=Vt(),o=su,s=(n&335544064)===n,c=e.memoizedProps,su=s&&pi(c.default,c.update)!==`none`,Tu(t,e,n),Ou(e),s&&r!==null&&Bt&&(e.flags|=4),su=o,Bt=i;break;case 21:break;case 7:i&512&&(tu||r===null||Sl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Tu(t,e,n),Ou(e)}}function Ou(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Al(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Dl(i)){var o=i.stateNode;r===null?r=[o]:r.push(o)}if(El(i))break;i=i.return}var s=r;if(n==null)throw Error(a(160));switch(n.tag){case 27:var c=n.stateNode;Nl(e,jl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(an(l,``),n.flags&=-33),Nl(e,jl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ml(e,jl(e),u,s);break;default:throw Error(a(161))}}catch(t){hf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ku(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ku(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,vh=!0,t.reset(),vh=!1),e=e.sibling}}function Au(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ju(t,e),t=t.sibling;else $l(t,!1)}function ju(e,t){var n=e.alternate;if(n===null)Gl(e,!1);else switch(e.tag){case 3:if(lu=ou=!1,zl(),Au(t,e),!ou&&!cu){if(e=Rl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ap(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),lu=!0}Rl=null;break;case 5:Au(t,e);break;case 4:r=ou,ou=!1,Au(t,e),ou&&(cu=!0),ou=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Au(t,e):Gl(e,!1));break;case 30:r=ou,i=zl(),ou=!1,Au(t,e),ou&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=di(a,o),o=di(n.memoizedProps,o);var s=pi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Bl=0,t=Ql(e,n,t,o,s,a,!0),Bl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Pd(e,e.memoizedProps.onUpdate),Rl=i):i!==null&&(i.push.apply(i,Rl),Rl=i),ou=e.flags&32?!0:r;break;default:Au(t,e)}}function Mu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)fu(e,t.alternate,t),t=t.sibling}function Nu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:vl(4,n,n.return),Nu(n,r);break;case 1:Sl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&bl(n,n.return,i),Nu(n,r);break;case 27:r&2&&ym(n.stateNode,n.type,n.memoizedProps);case 5:Sl(n,n.return),n.tag!==5&&n.tag!==27||Tl(n),Nu(n,r);break;case 6:Tl(n);break;case 26:Sl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||tu||i.parentNode.removeChild(i),Nu(n,r);break;case 22:n.memoizedState===null&&Nu(n,r);break;case 30:Sl(n,n.return),Nu(n,r);break;case 7:Sl(n,n.return);default:Nu(n,r)}e=e.sibling}}function Pu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Pu(i,a,n),_l(4,a);break;case 1:if(Pu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){hf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)yo(l[i],c)}catch(e){hf(r,r.return,e)}}s&&o&64&&yl(a),xl(a,a.return);break;case 27:n&2&&Pl(a);case 5:a.tag!==5&&a.tag!==27||wl(a),Pu(i,a,n),s&&r===null&&o&4&&Ol(a),xl(a,a.return);break;case 6:wl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||eu||Jm(Cm(c.ownerDocument),a.type,c),Pu(i,a,n),s&&r===null&&o&4&&Ol(a),xl(a,a.return);break;case 12:Pu(i,a,n);break;case 31:Pu(i,a,n),s&&o&4&&xu(i,a);break;case 13:Pu(i,a,n),s&&o&4&&Su(i,a);break;case 22:a.memoizedState===null&&Pu(i,a,n),xl(a,a.return);break;case 30:Pu(i,a,n),xl(a,a.return);break;case 7:xl(a,a.return);default:Pu(i,a,n)}t=t.sibling}}function Fu(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&&Oa(n))}function Iu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Oa(e))}function Lu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Ru(e,t,n,r),t=t.sibling;else i&&Zl(t)}function Ru(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Xl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Lu(e,t,n,r),a&2048&&_l(9,t);break;case 1:Lu(e,t,n,r);break;case 3:Lu(e,t,n,r),i&&lu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Oa(a)));break;case 12:if(a&2048){Lu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){hf(t,t.return,e)}}else Lu(e,t,n,r);break;case 31:Lu(e,t,n,r);break;case 13:Lu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Xl(t),o._visibility&2?Lu(e,t,n,r):(o._visibility|=2,zu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Xl(s),o._visibility&2?Lu(e,t,n,r):Bu(e,t)),a&2048&&Fu(s,t);break;case 24:Lu(e,t,n,r),a&2048&&Iu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Ul(a.child,!0),Ul(t.child,!0))),Lu(e,t,n,r);break;default:Lu(e,t,n,r)}}function zu(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:zu(a,o,s,c,i),_l(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,zu(a,o,s,c,i)):u._visibility&2?zu(a,o,s,c,i):Bu(a,o),i&&l&2048&&Fu(o.alternate,o);break;case 24:zu(a,o,s,c,i),i&&l&2048&&Iu(o.alternate,o);break;default:zu(a,o,s,c,i)}t=t.sibling}}function Bu(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:Bu(n,r),i&2048&&Fu(r.alternate,r);break;case 24:Bu(n,r),i&2048&&Iu(r.alternate,r);break;default:Bu(n,r)}t=t.sibling}}var Vu=8192;function Hu(e,t,n){if(e.subtreeFlags&Vu)for(e=e.child;e!==null;)Uu(e,t,n),e=e.sibling}function Uu(e,t,n){switch(e.tag){case 26:Hu(e,t,n),e.flags&Vu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&$m(n,e)):eh(n,Eu,e.memoizedState,e.memoizedProps));break;case 5:Hu(e,t,n),e.flags&Vu&&(e=e.stateNode,(t&335544128)===t&&$m(n,e));break;case 3:case 4:var r=Eu;Eu=Cm(e.stateNode.containerInfo),Hu(e,t,n),Eu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Vu,Vu=16777216,Hu(e,t,n),Vu=r):Hu(e,t,n));break;case 30:if((e.flags&Vu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Il===null&&(Il=new Map),Il.set(r,i)}Hu(e,t,n);break;default:Hu(e,t,n)}}function Wu(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 Gu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];au=r,Ju(r,e)}Wu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ku(e),e=e.sibling}function Ku(e){switch(e.tag){case 0:case 11:case 15:Gu(e),e.flags&2048&&vl(9,e,e.return);break;case 3:Gu(e);break;case 12:Gu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,qu(e)):Gu(e);break;default:Gu(e)}}function qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];au=r,Ju(r,e)}Wu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:vl(8,t,t.return),qu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,qu(t));break;default:qu(t)}e=e.sibling}}function Ju(e,t){for(;au!==null;){var n=au;switch(n.tag){case 0:case 11:case 15:vl(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:Oa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,au=r;else a:for(n=e;au!==null;){r=au;var i=r.sibling,a=r.return;if(gu(r),r===n){au=null;break a}if(i!==null){i.return=a,au=i;break a}au=a}}}var Yu={getCacheForType:function(e){var t=ba(Ea),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ba(Ea).controller.signal}},Xu=typeof WeakMap==`function`?WeakMap:Map,Zu=0,Qu=null,$u=null,Y=0,ed=0,td=null,nd=!1,rd=!1,id=!1,ad=0,od=0,sd=0,cd=0,ld=0,ud=0,dd=0,fd=null,pd=null,md=!1,hd=0,gd=0,_d=1/0,vd=null,yd=null,bd=0,xd=null,Sd=null,Cd=0,wd=0,Td=null,Ed=null,Dd=null,Od=null,kd=null,Ad=0,jd=null;function Md(){return Zu&2&&Y!==0?Y&-Y:V.T===null?pt():If()}function Nd(){if(ud===0){if(!(Y&536870912)||$i){var e=Ze;Ze<<=1,!(Ze&3932160)&&(Ze=262144),ud=e}else ud=536870912}return e=Eo.current,e!==null&&(e.flags|=32),ud}function Pd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Rp(di(e.memoizedProps,n))),Od===null&&(Od=[]),Od.push(t.bind(null,r))}}function Fd(e,t,n){(e===Qu&&(ed===2||ed===9)||e.cancelPendingCommit!==null)&&(Hd(e,0),zd(e,Y,ud,!1)),ot(e,n),Zu&2&&e===Qu||(e===Qu&&(!(Zu&2)&&(cd|=n),od===4&&zd(e,Y,ud,!1)),Of(e))}function Id(e,t,n){if(Zu&6)throw Error(a(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||tt(e,t),i=r?Xd(e,t):Jd(e,t,!0),o=r;do{if(i===0){rd&&!r&&zd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Rd(n))i=Jd(e,t,!1),o=!1;else{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=fd;var l=c.current.memoizedState.isDehydrated;if(l&&(Hd(c,s).flags|=256),s=Jd(c,s,!1),s!==2&&s!==6){if(id&&!l){c.errorRecoveryDisabledLanes|=o,cd|=o,i=4;break a}o=pd,pd=i,o!==null&&(pd===null?pd=o:pd.push.apply(pd,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){Hd(e,0),zd(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&&(t&62914560)!==t)break;case 6:zd(r,t,ud,!nd);break a;case 2:pd=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=hd+300-Pe(),10<i)){if(zd(r,t,ud,!nd),et(r,0,!0)!==0)break a;Cd=t,r.timeoutHandle=bp(Ld.bind(null,r,n,pd,vd,md,t,ud,cd,dd,nd,o,`Throttled`,-0,0),i);break a}Ld(r,n,pd,vd,md,t,ud,cd,dd,nd,o,null,-0,0)}break}}while(1);Of(e)}function Ld(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pn},Il=null,Uu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=ih.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?hd-Pe():(a&4194048)===a?gd-Pe():0,m=nh(d,m),m!==null)?(Cd=a,e.cancelPendingCommit=m(rf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),zd(e,a,o,!l)):rf(e,t,a,n,r,i,o,s,c,l,u,d)}function Rd(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(!Ir(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 zd(e,t,n,r){t=nt(e,t),t&=~ld,t&=~cd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ke(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ct(e,n,t)}function Bd(){return Zu&6?!0:(kf(0,!1),!1)}function Vd(){if($u!==null){if(ed===0)var e=$u.return;else e=$u,fa=da=null,ts(e),eo=null,to=0,e=$u;for(;e!==null;)gl(e.alternate,e),e=e.return;$u=null}}function Hd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,xp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Cd=0,Vd(),Qu=e,$u=n=Oi(e.current,null),Y=t,ed=0,td=null,nd=!1,rd=tt(e,t),id=!1,dd=ud=ld=cd=sd=od=0,pd=fd=null,md=!1,ad=nt(e,t),vi(),n}function Ud(e,t){Ro=null,V.H=uc,t===Wa||t===Ka?(t=Qa(),ed=3):t===Ga?(t=Qa(),ed=4):ed=t===Oc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,td=t,$u===null&&(od=1,Sc(e,Ii(t,e.current)))}function Wd(){var e=Eo.current;return e===null?!0:(Y&4194048)===Y?Do===null:(Y&62914560)===Y||Y&536870912?e===Do:!1}function Gd(){var e=V.H;return V.H=uc,e===null?uc:e}function Kd(){var e=V.A;return V.A=Yu,e}function qd(){od=4,nd||(Y&4194048)!==Y&&Eo.current!==null||(rd=!0),!(sd&134217727)&&!(cd&134217727)||Qu===null||zd(Qu,Y,ud,!1)}function Jd(e,t,n){var r=Zu;Zu|=2;var i=Gd(),a=Kd();(Qu!==e||Y!==t)&&(vd=null,Hd(e,t)),t=!1;var o=od;a:do try{if(ed!==0&&$u!==null){var s=$u,c=td;switch(ed){case 8:Vd(),o=6;break a;case 3:case 2:case 9:case 6:Eo.current===null&&(t=!0);var l=ed;if(ed=0,td=null,ef(e,s,c,l),n&&rd){o=0;break a}break;default:l=ed,ed=0,td=null,ef(e,s,c,l)}}Yd(),o=od;break}catch(t){Ud(e,t)}while(1);return t&&e.shellSuspendCounter++,fa=da=null,Zu=r,V.H=i,V.A=a,$u===null&&(Qu=null,Y=0,vi()),o}function Yd(){for(;$u!==null;)Qd($u)}function Xd(e,t){var n=Zu;Zu|=2;var r=Gd(),i=Kd();Qu!==e||Y!==t?(vd=null,_d=Pe()+500,Hd(e,t)):rd=tt(e,t);a:do try{if(ed!==0&&$u!==null){t=$u;var o=td;b:switch(ed){case 1:ed=0,td=null,ef(e,t,o,1);break;case 2:case 9:if(Ja(o)){ed=0,td=null,$d(t);break}t=function(){ed!==2&&ed!==9||Qu!==e||(ed=7),Of(e)},o.then(t,t);break a;case 3:ed=7;break a;case 4:ed=5;break a;case 7:Ja(o)?(ed=0,td=null,$d(t)):(ed=0,td=null,ef(e,t,o,7));break;case 5:var s=null;switch($u.tag){case 26:s=$u.memoizedState;case 5:case 27:var c=$u;if(s?Zm(s):c.stateNode.complete){ed=0,td=null;var l=c.sibling;if(l!==null)$u=l;else{var u=c.return;u===null?$u=null:($u=u,tf(u))}break b}}ed=0,td=null,ef(e,t,o,5);break;case 6:ed=0,td=null,ef(e,t,o,6);break;case 8:Vd(),od=6;break a;default:throw Error(a(462))}}Zd();break}catch(t){Ud(e,t)}while(1);return fa=da=null,V.H=r,V.A=i,Zu=n,$u===null?(Qu=null,Y=0,vi(),od):0}function Zd(){for(;$u!==null&&!Me();)Qd($u)}function Qd(e){var t=sl(e.alternate,e,ad);e.memoizedProps=e.pendingProps,t===null?tf(e):$u=t}function $d(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Vc(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=Vc(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:ts(t);var r=t;r===Zi&&($i?(aa(r),r.tag===5&&r.stateNode!=null&&(Qi=r.stateNode)):(aa(r),$i=!0));default:gl(n,t),t=$u=ki(t,ad),t=sl(n,t,ad)}e.memoizedProps=e.pendingProps,t===null?tf(e):$u=t}function ef(e,t,n,r){fa=da=null,ts(t),eo=null,to=0;var i=t.return;try{if(Dc(e,i,t,n,Y)){od=1,Sc(e,Ii(n,e.current)),$u=null;return}}catch(t){if(i!==null)throw $u=i,t;od=1,Sc(e,Ii(n,e.current)),$u=null;return}t.flags&32768?($i||r===1?e=!0:rd||Y&536870912?e=!1:(nd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Eo.current,r!==null&&r.tag===13&&(r.flags|=16384))),nf(t,e)):tf(t)}function tf(e){var t=e;do{if(t.flags&32768){nf(t,nd);return}e=t.return;var n=ml(t.alternate,t,ad);if(n!==null){$u=n;return}if(t=t.sibling,t!==null){$u=t;return}$u=t=e}while(t!==null);od===0&&(od=5)}function nf(e,t){do{var n=hl(e.alternate,e);if(n!==null){n.flags&=32767,$u=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){$u=e;return}$u=e=n}while(e!==null);od=6,$u=null}function rf(e,t,n,r,i,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do ff();while(bd!==0);if(Zu&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));e===Qu&&($u=Qu=null,Y=0),Sd=t,xd=e,Cd=n,Td=i,Ed=r,af(e,t,n,s,c,l,f)}}function af(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(wd=s,s|=_i,st(e,n,s,r,i,a),Od=null,(n&335544064)===n?(kd=ja(e),r=10262):(kd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,xf(Re,function(){return pf(),null})):(e.callbackNode=null,e.callbackPriority=0),Fl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=V.T,V.T=null,i=H.p,H.p=2,a=Zu,Zu|=4;try{uu(e,t,n)}finally{Zu=a,H.p=i,V.T=r}}bd=1,Fl?Dd=Ip(o,e.containerInfo,kd,cf,lf,sf,uf,pf,of,null,null):(cf(),lf(),uf())}function of(e){if(bd!==0){var t=xd.onRecoverableError;t(e,{componentStack:null})}}function sf(){bd===3&&(bd=0,ju(Sd,xd),bd=4)}function cf(){if(bd===1){bd=0;var e=xd,t=Sd,n=Cd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=V.T,V.T=null;var i=H.p;H.p=2;var a=Zu;Zu|=4;try{su=cu=!1,Du(t,e,n),n=fp;var o=Vr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Br(s.ownerDocument.documentElement,s)){if(c!==null&&Hr(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 _=zr(s,h),v=zr(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}}vh=!!dp,fp=dp=null}finally{Zu=a,H.p=i,V.T=r}}e.current=t,bd=2}}function lf(){if(bd===2){bd=0;var e=xd,t=Sd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=V.T,V.T=null;var r=H.p;H.p=2;var i=Zu;Zu|=4;try{fu(e,t.alternate,t)}finally{Zu=i,H.p=r,V.T=n}}bd=3}}function uf(){if(bd===4||bd===3){bd=0;var e=Dd;Dd=null,Ne();var t=xd,n=Sd,r=Cd,i=Ed,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?bd=5:(bd=0,Sd=xd=null,df(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(yd=null),ft(r),n=n.stateNode,We&&typeof We.onCommitFiberRoot==`function`)try{We.onCommitFiberRoot(Ue,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=V.T,a=H.p,H.p=2,V.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{V.T=n,H.p=a}}if(i=Od,o=kd,kd=null,i!==null&&(Od=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Cd&3&&ff(),Of(t),a=t.pendingLanes,r&261930&&a&42?t===jd?Ad++:(Ad=0,jd=t):(Ad=0,jd=null),kf(0,!1)}}function df(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Oa(t)))}function ff(){return Dd!==null&&(Dd.skipTransition(),Dd=null),cf(),lf(),uf(),pf()}function pf(){if(bd!==5)return!1;var e=xd,t=wd;wd=0;var n=ft(Cd),r=V.T,i=H.p;try{H.p=32>n?32:n,V.T=null,n=Td,Td=null;var o=xd,s=Cd;if(bd=0,Sd=xd=null,Cd=0,Zu&6)throw Error(a(331));var c=Zu;if(Zu|=4,Ku(o.current),Ru(o,o.current,s,n),Zu=c,kf(0,!1),We&&typeof We.onPostCommitFiberRoot==`function`)try{We.onPostCommitFiberRoot(Ue,o)}catch{}return!0}finally{H.p=i,V.T=r,df(e,t)}}function mf(e,t,n){t=Ii(n,t),t=wc(e.stateNode,t,2),e=po(e,t,2),e!==null&&(ot(e,2),Of(e))}function hf(e,t,n){if(e.tag===3)mf(e,e,n);else for(;t!==null;){if(t.tag===3){mf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(yd===null||!yd.has(r))){e=Ii(n,e),n=Tc(2),r=po(t,n,2),r!==null&&(Ec(n,r,t,e),ot(r,2),Of(r));break}}t=t.return}}function gf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Xu;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)||(id=!0,i.add(n),e=_f.bind(null,e,t,n),t.then(e,e))}function _f(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Qu===e&&(Y&n)===n&&(od===4||od===3&&(Y&62914560)===Y&&300>Pe()-hd?Zu&2?ld|=n:Hd(e,0):ld|=n,dd===Y&&(dd=0)),Of(e)}function vf(e,t){t===0&&(t=it()),e=xi(e,t),e!==null&&(ot(e,t),Of(e))}function yf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),vf(e,n)}function bf(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),vf(e,n)}function xf(e,t){return Ae(e,t)}var Sf=null,Cf=null,wf=!1,Tf=!1,Ef=!1,Df=0;function Of(e){e!==Cf&&e.next===null&&(Cf===null?Sf=Cf=e:Cf=Cf.next=e),Tf=!0,wf||(wf=!0,Ff())}function kf(e,t){if(!Ef&&Tf){Ef=!0;do for(var n=!1,r=Sf;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-Ke(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Pf(r,a))}else a=Y,a=et(r,r===Qu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||tt(r,a)||(n=!0,Pf(r,a))}r=r.next}while(n);Ef=!1}}function Af(){jf()}function jf(){Tf=wf=!1;var e=0;Df!==0&&yp()&&(e=Df);for(var t=Pe(),n=null,r=Sf;r!==null;){var i=r.next,a=Mf(r,t);a===0?(r.next=null,n===null?Sf=i:n.next=i,i===null&&(Cf=n)):(n=r,(e!==0||a&3)&&(Tf=!0)),r=i}bd!==0&&bd!==5||kf(e,!1),Df!==0&&(Df=0)}function Mf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ke(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=rt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Qu,n=Y,n=et(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ed===2||ed===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&je(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||tt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&je(r),ft(n)){case 2:case 8:n=Le;break;case 32:n=Re;break;case 268435456:n=Be;break;default:n=Re}return r=Nf.bind(null,e),n=Ae(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&je(r),e.callbackPriority=2,e.callbackNode=null,2}function Nf(e,t){if(bd!==0&&bd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ff()&&e.callbackNode!==n)return null;var r=Y;return r=et(e,e===Qu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Id(e,r,t),Mf(e,Pe()),e.callbackNode!=null&&e.callbackNode===n?Nf.bind(null,e):null)}function Pf(e,t){if(ff())return null;Id(e,t,!0)}function Ff(){wp(function(){Zu&6?Ae(Ie,Af):jf()})}function If(){if(Df===0){var e=Pa;e===0&&(e=Xe,Xe<<=1,!(Xe&261888)&&(Xe=256)),Df=e}return Df}function Lf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:fn(e)}function Rf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Lf((i[_t]||null).action),o=r.submitter;o&&(t=(t=o[_t]||null)?Lf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Pn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Df!==0){var e=new FormData(i,o);Zs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Zs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var zf=0;zf<ci.length;zf++){var Bf=ci[zf];li(Bf.toLowerCase(),`on`+(Bf[0].toUpperCase()+Bf.slice(1)))}li(ei,`onAnimationEnd`),li(ti,`onAnimationIteration`),li(ni,`onAnimationStart`),li(`dblclick`,`onDoubleClick`),li(`focusin`,`onFocus`),li(`focusout`,`onBlur`),li(ri,`onTransitionRun`),li(ii,`onTransitionStart`),li(ai,`onTransitionCancel`),li(oi,`onTransitionEnd`),Ft(`onMouseEnter`,[`mouseout`,`mouseover`]),Ft(`onMouseLeave`,[`mouseout`,`mouseover`]),Ft(`onPointerEnter`,[`pointerout`,`pointerover`]),Ft(`onPointerLeave`,[`pointerout`,`pointerover`]),Pt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Pt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Pt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Pt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Pt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Pt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Vf=`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(` `),Hf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Vf));function Uf(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){mi(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){mi(e)}i.currentTarget=null,a=c}}}}function Wf(e,t){var n=t[yt];n===void 0&&(n=t[yt]=new Set);var r=e+`__bubble`;n.has(r)||(Jf(t,e,2,!1),n.add(r))}function Gf(e,t,n){var r=0;t&&(r|=4),Jf(n,e,r,t)}var Kf=`_reactListening`+Math.random().toString(36).slice(2);function qf(e){if(!e[Kf]){e[Kf]=!0,Mt.forEach(function(t){t!==`selectionchange`&&(Hf.has(t)||Gf(t,!1,e),Gf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Kf]||(t[Kf]=!0,Gf(`selectionchange`,!1,t))}}function Jf(e,t,n,r){switch(Th(t)){case 2:var i=yh;break;case 8:i=bh;break;default:i=xh}n=i.bind(null,t,n,e),i=void 0,!Cn||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 Yf(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 l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=Et(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}s=s.parentNode}}r=r.return}bn(function(){var r=a,i=hn(n),o=[];a:{var s=si.get(e);if(s!==void 0){var l=Pn,u=e;switch(e){case`keypress`:if(kn(n)===0)break a;case`keydown`:case`keyup`:l=Qn;break;case`focusin`:u=`focus`,l=Un;break;case`focusout`:u=`blur`,l=Un;break;case`beforeblur`:case`afterblur`:l=Un;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`:l=Vn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Hn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=tr;break;case ei:case ti:case ni:l=Wn;break;case oi:l=nr;break;case`scroll`:case`scrollend`:l=In;break;case`wheel`:l=rr;break;case`copy`:case`cut`:case`paste`:l=Gn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=$n;break;case`submit`:l=er;break;case`toggle`:case`beforetoggle`:l=ir}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=xn(m,p),g!=null&&d.push(Xf(m,g,h))),f)break;m=m.return}0<d.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,s=e===`mouseout`||e===`pointerout`,l&&n!==mn&&(u=n.relatedTarget||n.fromElement)&&(Et(u)||u[vt]))break a;(s||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,s?(l=n.relatedTarget||n.toElement,s=r,l=l?Et(l):null,l!==null&&(f=c(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(s=null,l=r),s!==l&&(d=Vn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=$n,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=s==null?u:Ot(s),h=l==null?u:Ot(l),u=new d(g,m+`leave`,s,n,i),u.target=f,u.relatedTarget=h,g=null,Et(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=s&&l?T(s,l,Qf):null,s!==null&&$f(o,u,s,d,!1),l!==null&&f!==null&&$f(o,f,l,d,!0)))}a:{if(s=r?Ot(r):window,l=s.nodeName&&s.nodeName.toLowerCase(),l===`select`||l===`input`&&s.type===`file`)var _=wr;else if(vr(s)){if(Tr)_=Pr;else{_=Mr;var v=jr}}else l=s.nodeName,!l||l.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&ln(r.elementType)&&(_=wr):_=Nr;if(_&&=_(e,r)){yr(o,_,n,i);break a}v&&v(e,s,r)}switch(v=r?Ot(r):window,e){case`focusin`:(vr(v)||v.contentEditable===`true`)&&(Wr=v,Gr=r,Kr=null);break;case`focusout`:Kr=Gr=Wr=null;break;case`mousedown`:qr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:qr=!1,Jr(o,n,i);break;case`selectionchange`:if(Ur)break;case`keydown`:case`keyup`:Jr(o,n,i)}var y;if(or)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else mr?fr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(lr&&n.locale!==`ko`&&(mr||b!==`onCompositionStart`?b===`onCompositionEnd`&&mr&&(y=On()):(Tn=i,En=`value`in Tn?Tn.value:Tn.textContent,mr=!0)),v=Zf(r,b),0<v.length&&(b=new Kn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=pr(n),y!==null&&(b.data=y)))),(y=cr?hr(e,n):gr(e,n))&&(b=Zf(r,`onBeforeInput`),0<b.length&&(v=new Kn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Rf(o,e,r,n,i)}Uf(o,t)})}function Xf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zf(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=xn(e,n),i!=null&&r.unshift(Xf(e,i,a)),i=xn(e,t),i!=null&&r.push(Xf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Qf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $f(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=xn(n,a),l!=null&&o.unshift(Xf(n,l,c))):i||(l=xn(n,a),l!=null&&o.push(Xf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ep=/\r\n?/g,tp=/\u0000|\uFFFD/g;function np(e){return(typeof e==`string`?e:``+e).replace(ep,`
10
- `).replace(tp,``)}function rp(e,t){return t=np(t),np(e)===t}function ip(e,t,n,r,i,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||an(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&an(e,``+r);else return;break;case`className`:Ut(e,`class`,r);break;case`tabIndex`:Ut(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ut(e,n,r);break;case`style`:cn(e,r,o);return;case`data`:if(t!==`object`){Ut(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=fn(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`&&ip(e,t,`name`,i.name,i,null),ip(e,t,`formEncType`,i.formEncType,i,null),ip(e,t,`formMethod`,i.formMethod,i,null),ip(e,t,`formTarget`,i.formTarget,i,null)):(ip(e,t,`encType`,i.encType,i,null),ip(e,t,`method`,i.method,i,null),ip(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=fn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=pn);return;case`onScroll`:r!=null&&Wf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Wf(`scrollend`,e);return;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));o?.__html!==n&&(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=fn(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`credentialless`: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`:Wf(`beforetoggle`,e),Wf(`toggle`,e),Ht(e,`popover`,r);break;case`xlinkActuate`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Wt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ht(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=un.get(n)||n,Ht(e,n,r);else return}Bt=!0}function ap(e,t,n,r,i,o){switch(n){case`style`:cn(e,r,o);return;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));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)an(e,r);else if(typeof r==`number`||typeof r==`bigint`)an(e,``+r);else return;break;case`onScroll`:r!=null&&Wf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Wf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=pn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Nt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),o=n.slice(2,i?n.length-7:void 0),t=e[_t]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,i);break a}Bt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ht(e,n,r)}return}Bt=!0}function op(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Wf(`error`,e),Wf(`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:ip(e,t,o,s,n,null)}}i&&ip(e,t,`srcSet`,n.srcSet,n,null),r&&ip(e,t,`src`,n.src,n,null);return;case`input`:Wf(`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:ip(e,t,r,d,n,null)}}$t(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Wf(`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:ip(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&tn(e,!!r,n,!0):tn(e,!!r,t,!1);return;case`textarea`:for(s in Wf(`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:ip(e,t,s,c,n,null)}rn(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:ip(e,t,l,r,n,null)}return;case`dialog`:Wf(`beforetoggle`,e),Wf(`toggle`,e),Wf(`cancel`,e),Wf(`close`,e);break;case`iframe`:case`object`:Wf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Vf.length;r++)Wf(Vf[r],e);break;case`image`:Wf(`error`,e),Wf(`load`,e);break;case`details`:Wf(`toggle`,e);break;case`embed`:case`source`:case`link`:Wf(`error`,e),Wf(`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:ip(e,t,u,r,n,null)}return;default:if(ln(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&ap(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ip(e,t,c,r,n,null))}var sp={};function cp(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)||ip(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`:m!==f&&(Bt=!0),o=m;break;case`name`:m!==f&&(Bt=!0),i=m;break;case`checked`:m!==f&&(Bt=!0),u=m;break;case`defaultChecked`:m!==f&&(Bt=!0),d=m;break;case`value`:m!==f&&(Bt=!0),s=m;break;case`defaultValue`:m!==f&&(Bt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&ip(e,t,p,m,r,f)}}Qt(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)||ip(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`:o!==l&&(Bt=!0),p=o;break;case`defaultValue`:o!==l&&(Bt=!0),c=o;break;case`multiple`:o!==l&&(Bt=!0),s=o;default:o!==l&&ip(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?tn(e,!!n,n?[]:``,!1):tn(e,!!n,t,!0)):tn(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:ip(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`:i!==o&&(Bt=!0),p=i;break;case`defaultValue`:i!==o&&(Bt=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&ip(e,t,s,i,r,o)}nn(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:ip(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`:p!==m&&(Bt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ip(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)&&ip(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:ip(e,t,u,p,r,m)}return;default:if(ln(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&ap(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||ap(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ip(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||ip(e,t,f,p,r,m)}function lp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function up(){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&&lp(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&&lp(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 dp=null,fp=null;function pp(e){return e.nodeType===9?e:e.ownerDocument}function mp(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 hp(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 gp(e,t,n,r){return n=pp(n).createElement(e),n[gt]=r,n[_t]=t,op(n,e,t),At(n),n}function _p(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 vp=null;function yp(){var e=window.event;return e&&e.type===`popstate`?e!==vp&&(vp=e,!0):(vp=null,!1)}var bp=typeof setTimeout==`function`?setTimeout:void 0,xp=typeof clearTimeout==`function`?clearTimeout:void 0,Sp=typeof Promise==`function`?Promise:void 0,Cp=typeof requestAnimationFrame==`function`?requestAnimationFrame:bp,wp=typeof queueMicrotask==`function`?queueMicrotask:Sp===void 0?bp:function(e){return Sp.resolve(null).then(e).catch(Tp)};function Tp(e){setTimeout(function(){throw e})}function Ep(e){return e===`head`}function Dp(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),Wh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)bm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,bm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&bm(e.ownerDocument.body)}n=i}while(n);Wh(t)}function Op(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 kp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ap(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function jp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Mp(e){return jp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Np(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return jp(t,n,e)}function Pp(e){return e.documentElement.clientHeight}function Fp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Ip(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Pp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Qm(f),u>th){s.length=o;break}f=new Promise(Fp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Lp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Lp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:E({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Lp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Lp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Rp(e){return{name:e,group:new Lp(`group`,e),imagePair:new Lp(`image-pair`,e),old:new Lp(`old`,e),new:new Lp(`new`,e)}}function zp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}zp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Wp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Hp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Bp,e,s,r)}this._eventListeners=a}};function Bp(e,t,n,r){return y(e).addEventListener(t,n,r),!1}zp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Wp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Hp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Vp,e,n,i),r.splice(t,1),a!==null&&a()}};function Vp(e,t,n,r){return y(e).removeEventListener(t,n,r),!1}function Hp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Up(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Wp(e,t,n,r){if(e.length===0)return-1;r=Up(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Up(a.optionsOrUseCapture)===r)return i}return-1}zp.prototype.dispatchEvent=function(e){var t=h(this._fragmentFiber);if(t===null)return!0;t=y(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Hp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Hp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},zp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Gp,e,void 0,void 0)};function Gp(e,t){return e.tag!==6&&(e=y(e),gm(e,t))}zp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Kp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Gp(t[n],e);n--);};function Kp(e,t){return t.push(e),!1}zp.prototype.blur=function(){var e=h(this._fragmentFiber);e!==null&&(e=y(e),e=pp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,qp,e,void 0,void 0))};function qp(e,t){return e.tag!==6&&(e=y(e),e===t||e.contains(t)?(t.blur(),!0):!1)}zp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Jp,e,void 0,void 0)};function Jp(e,t){return e.tag===6||(e=y(e),t.observe(e)),!1}zp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Yp,e,void 0,void 0);for(var n=t=0;n<Xp.length;n++){var r=Xp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Xp[t++]=r}Xp.length=t}};function Yp(e,t){return e.tag===6||(e=y(e),t.unobserve(e)),!1}var Xp=[],Zp=!1;function Qp(e,t,n){Xp.push({fragmentInstance:e,observer:t,instance:n}),Zp||(Zp=!0,_m(function(){Zp=!1;var e=Xp;Xp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}zp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,$p,e,void 0,void 0),e};function $p(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=y(e),t.push.apply(t,e.getClientRects());return!1}zp.prototype.getRootNode=function(e){var t=h(this._fragmentFiber);return t===null?this:y(t).getRootNode(e)},zp.prototype.compareDocumentPosition=function(e){var t=h(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Kp,n,void 0,void 0);var r=y(t);if(n.length===0){if(n=r,g(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=_(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=y(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=y(n[0]),i=y(n[n.length-1]);var a=g(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||em(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function em(e,t,n,r,i){var a=Et(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=h(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=T(n,a,w),t===null?t=!1:(m(t,!0,S,a,n),a=b,b=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=T(r,a,w),t===null?t=!1:(m(t,!0,C,a,r),a=b,x=b=null,t=a!==null)),t):!1}function tm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}zp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(a(566));var t=[];m(this._fragmentFiber.child,!1,Kp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=_(this._fragmentFiber);if(r=n?r[1]||r[0]||h(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=y(r),tm(e,n);return}if(r=y(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=y(i),tm(i,n)):y(i).scrollIntoView(e),r+=n?-1:1}};function nm(e,t){return e=y(e),rm(e,t),!1}function rm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function im(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Hp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Xp.length;i++){var a=Xp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Xp[r++]=a)}Xp.length=r,n.observe(e)}),rm(e,t))}function am(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Hp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Qp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function om(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`:om(n),Tt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sm(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[Ct])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=fm(e.nextSibling),e===null)break}return null}function X(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=fm(e.nextSibling),e===null))return null;return e}function cm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=fm(e.nextSibling),e===null))return null;return e}function lm(e){return e.data===`$?`||e.data===`$~`}function um(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function dm(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 fm(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 pm=null;function mm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return fm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function hm(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 gm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function _m(e){Cp(function(){Cp(function(t){return e(t)})})}function vm(e,t,n){switch(t=pp(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 ym(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ip(e,t,r,null,sp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===pn&&(e.onclick=null),Tt(e)}function bm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tt(e)}var xm=new Map,Sm=new Set;function Cm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var wm=H.d;H.d={f:Tm,r:Em,D:km,C:Am,L:jm,m:Mm,X:Pm,S:Nm,M:Fm};function Tm(){var e=wm.f(),t=Bd();return e||t}function Em(e){var t=Dt(e);t!==null&&t.tag===5&&t.type===`form`?$s(t):wm.r(e)}var Dm=typeof document>`u`?null:document;function Om(e,t,n){var r=Dm;if(r&&typeof t==`string`&&t){var i=Zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Sm.has(i)||(Sm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),op(t,`link`,e),At(t),r.head.appendChild(t)))}}function km(e){wm.D(e),Om(`dns-prefetch`,e,null)}function Am(e,t){wm.C(e,t),Om(`preconnect`,e,t)}function jm(e,t,n){wm.L(e,t,n);var r=Dm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Zt(n.imageSizes)+`"]`)):i+=`[href="`+Zt(e)+`"]`;var a=i;switch(t){case`style`:a=Lm(e);break;case`script`:a=Bm(e)}if(!(xm.has(a)||(e=E({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),xm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Z(a))||t===`script`&&r.querySelector(Vm(a))))){var o=r.createElement(`link`);op(o,`link`,e),t===`style`&&(o[wt]=!0,o.onload=o.onerror=function(){jt(o)}),At(o),r.head.appendChild(o)}}}function Mm(e,t){wm.m(e,t);var n=Dm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Zt(r)+`"][href="`+Zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Bm(e)}if(!xm.has(a)&&(e=E({rel:`modulepreload`,href:e},t),xm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Vm(a)))return}r=n.createElement(`link`),op(r,`link`,e),At(r),n.head.appendChild(r)}}}function Nm(e,t,n){wm.S(e,t,n);var r=Dm;if(r&&e){var i=kt(r).hoistableStyles,a=Lm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Z(a)))s.loading=5;else{e=E({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=xm.get(a))&&Wm(e,n);var c=o=r.createElement(`link`);At(c),op(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,Um(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Pm(e,t){wm.X(e,t);var n=Dm;if(n&&e){var r=kt(n).hoistableScripts,i=Bm(e),a=r.get(i);a||(a=n.querySelector(Vm(i)),a||(e=E({src:e,async:!0},t),(t=xm.get(i))&&Gm(e,t),a=n.createElement(`script`),At(a),op(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Fm(e,t){wm.M(e,t);var n=Dm;if(n&&e){var r=kt(n).hoistableScripts,i=Bm(e),a=r.get(i);a||(a=n.querySelector(Vm(i)),a||(e=E({src:e,async:!0,type:`module`},t),(t=xm.get(i))&&Gm(e,t),a=n.createElement(`script`),At(a),op(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Im(e,t,n,r){var i=(i=ve.current)?Cm(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`?(n=Lm(n.href),t=kt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,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=Lm(n.href);var o=kt(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(Z(e)))?o._p||(s.instance=o,s.state.loading=5):(o=xm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},xm.set(e,o)),zm(i,e,o,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`?(n=Bm(n),t=kt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Lm(e){return`href="`+Zt(e)+`"`}function Z(e){return`link[rel="stylesheet"][`+e+`]`}function Rm(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function zm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[wt]){r.loading=1;return}}else t=e.createElement(`link`),t[wt]=!0,t.onload=t.onerror=jt.bind(null,t),op(t,`link`,n),At(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Bm(e){return`[src="`+Zt(e)+`"]`}function Vm(e){return`script[async]`+e}function Hm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Zt(n.href)+`"]`);if(r)return t.instance=r,At(r),r;var i=E({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),At(r),op(r,`style`,i),Um(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Lm(n.href);var o=e.querySelector(Z(i));if(o)return t.state.loading|=4,t.instance=o,At(o),o;r=Rm(n),(i=xm.get(i))&&Wm(r,i),o=(e.ownerDocument||e).createElement(`link`),At(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),op(o,`link`,r),t.state.loading|=4,Um(o,n.precedence,e),t.instance=o;case`script`:return o=Bm(n.src),(i=e.querySelector(Vm(o)))?(t.instance=i,At(i),i):(r=n,(i=xm.get(o))&&(r=E({},n),Gm(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),At(i),op(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,Um(r,n.precedence,e));return t.instance}function Um(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 Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Gm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Km=null;function qm(e,t,n){if(Km===null){var r=new Map,i=Km=new Map;i.set(n,r)}else i=Km,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[Ct]||a[gt]||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 Jm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Ym(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 Xm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Zm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Qm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function $m(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Qm(t),e.suspenseyImages.push(t)),e=ah.bind(e),t.decode().then(e,e))}function eh(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=Lm(r.href),a=t.querySelector(Z(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ih.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,At(a);return}a=t.ownerDocument||t,r=Rm(r),(i=xm.get(i))&&Wm(r,i),a=a.createElement(`link`),At(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),op(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=ih.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var th=0;function nh(e,t){return e.stylesheets&&e.count===0&&sh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&sh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&th===0&&(th=62500*up());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>th?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function rh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)sh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ih(){this.count--,rh(this)}function ah(){this.imgCount--,rh(this)}var oh=null;function sh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,oh=new Map,t.forEach(ch,e),oh=null,ih.call(e))}function ch(e,t){if(!(t.state.loading&4)){var n=oh.get(e);if(n)var r=n.get(null);else{n=new Map,oh.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=ih.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 lh={$$typeof:N,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function uh(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=at(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=at(0),this.hiddenUpdates=at(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function dh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new uh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ei(3,null,null,t),e.current=a,a.stateNode=e,t=Da(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},lo(a),e}function fh(e){return e?(e=wi,e):wi}function ph(e,t,n,r,i,a){i=fh(i),r.context===null?r.context=i:r.pendingContext=i,r=fo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=po(e,r,t),n!==null&&(Fd(n,e,t),mo(n,e,t))}function mh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hh(e,t){mh(e,t),(e=e.alternate)&&mh(e,t)}function gh(e){if(e.tag===13||e.tag===31){var t=xi(e,67108864);t!==null&&Fd(t,e,67108864),hh(e,67108864)}}function _h(e){if(e.tag===13||e.tag===31){var t=Md();t=dt(t);var n=xi(e,t);n!==null&&Fd(n,e,t),hh(e,t)}}var vh=!0;function yh(e,t,n,r){var i=V.T;V.T=null;var a=H.p;try{H.p=2,xh(e,t,n,r)}finally{H.p=a,V.T=i}}function bh(e,t,n,r){var i=V.T;V.T=null;var a=H.p;try{H.p=8,xh(e,t,n,r)}finally{H.p=a,V.T=i}}function xh(e,t,n,r){if(vh){var i=Sh(r);if(i===null)Yf(e,t,r,Ch,n),Ph(e,r);else if(Ih(i,e,t,n,r))r.stopPropagation();else if(Ph(e,r),t&4&&-1<Nh.indexOf(e)){for(;i!==null;){var a=Dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=$e(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ke(o);s.entanglements[1]|=c,o&=~c}Of(a),!(Zu&6)&&(_d=Pe()+500,kf(0,!1))}}break;case 31:case 13:s=xi(a,2),s!==null&&Fd(s,a,2),Bd(),hh(a,2)}if(a=Sh(r),a===null&&Yf(e,t,r,Ch,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Yf(e,t,r,null,n)}}function Sh(e){return e=hn(e),wh(e)}var Ch=null;function wh(e){if(Ch=null,e=Et(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=l(t),e!==null)return e;e=null}else if(n===31){if(e=u(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 Ch=e,null}function Th(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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Fe()){case Ie:return 2;case Le:return 8;case Re:case ze:return 32;case Be:return 268435456;default:return 32}default:return 32}}var Eh=!1,Dh=null,Oh=null,kh=null,Ah=new Map,jh=new Map,Mh=[],Nh=`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 Ph(e,t){switch(e){case`focusin`:case`focusout`:Dh=null;break;case`dragenter`:case`dragleave`:Oh=null;break;case`mouseover`:case`mouseout`:kh=null;break;case`pointerover`:case`pointerout`:Ah.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:jh.delete(t.pointerId)}}function Fh(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=Dt(t),t!==null&&gh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ih(e,t,n,r,i){switch(t){case`focusin`:return Dh=Fh(Dh,e,t,n,r,i),!0;case`dragenter`:return Oh=Fh(Oh,e,t,n,r,i),!0;case`mouseover`:return kh=Fh(kh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ah.set(a,Fh(Ah.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,jh.set(a,Fh(jh.get(a)||null,e,t,n,r,i)),!0}return!1}function Lh(e){var t=Et(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=l(n),t!==null){e.blockedOn=t,mt(e.priority,function(){_h(n)});return}}else if(t===31){if(t=u(n),t!==null){e.blockedOn=t,mt(e.priority,function(){_h(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 Rh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);mn=r,n.target.dispatchEvent(r),mn=null}else return t=Dt(n),t!==null&&gh(t),e.blockedOn=n,!1;t.shift()}return!0}function zh(e,t,n){Rh(e)&&n.delete(t)}function Bh(){Eh=!1,Dh!==null&&Rh(Dh)&&(Dh=null),Oh!==null&&Rh(Oh)&&(Oh=null),kh!==null&&Rh(kh)&&(kh=null),Ah.forEach(zh),jh.forEach(zh)}function Vh(e,n){e.blockedOn===n&&(e.blockedOn=null,Eh||(Eh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Bh)))}var Hh=null;function Uh(e){Hh!==e&&(Hh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Hh===e&&(Hh=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(wh(r||n)===null)continue;break}var a=Dt(n);a!==null&&(e.splice(t,3),t-=3,Zs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Wh(e){function t(t){return Vh(t,e)}Dh!==null&&Vh(Dh,e),Oh!==null&&Vh(Oh,e),kh!==null&&Vh(kh,e),Ah.forEach(t),jh.forEach(t);for(var n=0;n<Mh.length;n++){var r=Mh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Mh.length&&(n=Mh[0],n.blockedOn===null);)Lh(n),n.blockedOn===null&&Mh.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[_t]||null;if(typeof a==`function`)o||Uh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[_t]||null)s=o.formAction;else if(wh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Uh(n)}}}function Gh(){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 Kh(e){this._internalRoot=e}qh.prototype.render=Kh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;ph(n,Md(),e,t,null,null)},qh.prototype.unmount=Kh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ph(e.current,2,null,e,null,null),Bd(),t[vt]=null}};function qh(e){this._internalRoot=e}qh.prototype.unstable_scheduleHydration=function(e){if(e){var t=pt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mh.length&&t!==0&&t<Mh[n].priority;n++);Mh.splice(n,0,e),n===0&&Lh(e)}};var Jh=n.version;if(Jh!==`19.3.1`)throw Error(a(527,Jh,`19.3.1`));H.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=f(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Yh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:V,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Xh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xh.isDisabled&&Xh.supportsFiber)try{Ue=Xh.inject(Yh),We=Xh}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(a(299));var n=!1,r=``,i=yc,o=bc,c=xc;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=dh(e,1,!1,null,null,n,r,null,i,o,c,Gh),e[vt]=t.current,qf(e),new Kh(t)}})),le=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=ce()})),B=t(r(),1),V=le(),H=`pi-web-locale`,ue=new Set;function de(){return typeof navigator>`u`||(navigator.languages?.[0]??navigator.language??`zh`).toLowerCase().startsWith(`zh`)?`zh`:`en`}function fe(){try{let e=localStorage.getItem(H);if(e===`zh`||e===`en`)return e}catch{}return de()}var pe=fe();function me(e){pe!==e&&(pe=e,typeof document<`u`&&(document.documentElement.lang=e===`zh`?`zh-CN`:`en`),ue.forEach(e=>e()))}function he(){document.documentElement.lang=pe===`zh`?`zh-CN`:`en`,window.addEventListener(`storage`,e=>{e.key===H&&me(fe())})}function ge(e){try{localStorage.setItem(H,e)}catch{}me(e)}function _e(){return(0,B.useSyncExternalStore)(e=>(ue.add(e),()=>{ue.delete(e)}),()=>pe)}function ve(e,t,n){return e===`zh`?t:n}function U(e,t){return ve(pe,e,t)}var W=te(),ye=class extends B.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e,t){j(e,{stage:`react`,componentStack:t.componentStack??``})}render(){return this.state.failed?(0,W.jsxs)(`main`,{role:`alert`,children:[(0,W.jsx)(`p`,{children:U(`页面遇到错误,请刷新后重试。`,`The page encountered an error. Refresh to try again.`)}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>location.reload(),children:U(`刷新页面`,`Refresh page`)})]}):this.props.children}},be=1024,xe=.7;function Se(e,t){return e>=t+72?`focus`:e<=228?`collapse`:null}function Ce(e,t){return e>t?t+Math.min(24,(e-t)/3):e<300?300-Math.min(24,(300-e)/3):null}function we(e,t,n){return Math.min(n,Math.max(t,Math.round(e)))}function Te(e,t,n){let r=t===0?56:we(t,264,420),i=e-r-400,a=n===0||i<300?0:Math.min(i,we(n,300,e*xe));return{sidebar:r,center:Math.max(0,e-r-a),rightbar:a}}function Ee(e,t,n){let r=(0,B.useRef)(n);r.current=n,(0,B.useEffect)(()=>{let n=e.current;if(!t||!n)return;let i=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>[...n.querySelectorAll(`button, input, select, textarea, a[href], [tabindex]`)].filter(e=>e.tabIndex>=0&&!e.matches(`:disabled`)&&e.getClientRects().length>0);(n.querySelector(`[data-sidebar-toggle]`)??a()[0]??n).focus();let o=e=>{let t=document.querySelectorAll(`[aria-modal="true"]`);if(t[t.length-1]!==n)return;if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),r.current();return}if(e.key!==`Tab`)return;let i=a(),o=i[0]??n,s=i.at(-1)??n;e.shiftKey&&(document.activeElement===o||!ae(n,document.activeElement))?(e.preventDefault(),s.focus()):e.shiftKey||document.activeElement!==s&&ae(n,document.activeElement)||(e.preventDefault(),o.focus())},s=e=>{let t=document.querySelectorAll(`[aria-modal="true"]`);t[t.length-1]===n&&!ae(n,e.target)&&(a()[0]??n).focus()};return document.addEventListener(`keydown`,o),document.addEventListener(`focusin`,s),()=>{document.removeEventListener(`keydown`,o),document.removeEventListener(`focusin`,s),i?.isConnected&&i.getClientRects().length>0?i.focus():document.querySelector(`[data-sidebar-toggle]`)?.focus()}},[e,t])}function De({productTitle:e}){return(0,B.useEffect)(()=>(document.title=e,()=>{document.title=e}),[e]),null}var Oe={frame:`_frame_uzw7i_1`,sidebarCol:`_sidebarCol_uzw7i_27`,centerCol:`_centerCol_uzw7i_36`,drawerMask:`_drawerMask_uzw7i_52`,handle:`_handle_uzw7i_67`,snapHint:`_snapHint_uzw7i_87`,rightbarCol:`_rightbarCol_uzw7i_124`,overlayLayer:`_overlayLayer_uzw7i_132`};function ke(e){return(0,W.jsx)(`div`,{className:Oe.centerCol,children:e.children})}function Ae({usePanelInfo:e,renderSlot:t}){return t(`main`,{},{entryKey:e(e=>e.activePanelId)??`conversation`})}function je(e){return(0,W.jsx)(`div`,{className:Oe.rightbarCol,"data-rightbar-col":!0,children:e.children})}function Me(e){let[t,n]=(0,B.useState)(!1),r=(0,B.useRef)(0),i=(0,B.useRef)(0),a=(0,B.useRef)(null),o=(0,B.useRef)(null),s=(0,B.useRef)({onStart:e.onStart,onDrag:e.onDrag,onEnd:e.onEnd});s.current={onStart:e.onStart,onDrag:e.onDrag,onEnd:e.onEnd};let c=(0,B.useCallback)((e=!0)=>{let t=o.current;t!==null&&(o.current=null,a.current!==null&&(cancelAnimationFrame(a.current),a.current=null),t.element.hasPointerCapture(t.id)&&t.element.releasePointerCapture(t.id),n(!1),s.current.onEnd(i.current-r.current,e))},[]);(0,B.useEffect)(()=>c,[c]);let l=(0,B.useCallback)(e=>{e.button===0&&o.current===null&&(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),o.current={element:e.currentTarget,id:e.pointerId},r.current=e.clientX,i.current=e.clientX,s.current.onStart(),n(!0))},[]),u=(0,B.useCallback)(e=>{o.current?.id===e.pointerId&&(i.current=e.clientX,a.current??=requestAnimationFrame(()=>{a.current=null,s.current.onDrag(i.current-r.current)}))},[]),d=(0,B.useCallback)(e=>{o.current?.id===e.pointerId&&(i.current=e.clientX,s.current.onDrag(e.clientX-r.current),c(!1))},[c]),f=(0,B.useCallback)(e=>{o.current?.id===e.pointerId&&c()},[c]);return(0,W.jsx)(`div`,{className:Oe.handle,style:{left:e.left},"data-side":e.side,"data-dragging":t||void 0,onPointerDown:l,onPointerMove:u,onPointerUp:d,onPointerCancel:f,onLostPointerCapture:f})}function Ne({useStore:e,usePanelInfo:t,actions:n,renderSlot:r,t:i}){let a=e(e=>e.layoutInfo),o=(0,B.useRef)(null),s=a.viewportWidth;(0,B.useLayoutEffect)(()=>{let e=o.current;if(e===null)return;let t=null,r=!1,i=()=>{let t=e.getBoundingClientRect().width;t>0&&n.setViewportWidth(t)};i();let a=new ResizeObserver(()=>{r||(t??=requestAnimationFrame(()=>{t=null,i()}))});return a.observe(e),()=>{r=!0,a.disconnect(),t!==null&&cancelAnimationFrame(t)}},[n]);let c=s<be,l=a.rightbarFullscreen&&s>=767,u=l||(c?!a.narrowExpanded:a.sidebar===0),d=u?0:a.sidebar===0?280:a.sidebar,f=a.rightbar??s*.45,p=Te(s,!a.rightbarShown&&c?0:d,f),m=c&&!u,h=(0,B.useRef)(null);Ee(h,m,n.closeSidebar),(0,B.useEffect)(()=>{if(!m)return;let e=o.current?.querySelectorAll(`.${Oe.centerCol}, .${Oe.rightbarCol}`)??[];for(let t of e)t.setAttribute(`inert`,``);return()=>{for(let t of e)t.removeAttribute(`inert`)}},[m]);let g=Te(s,c?0:d,a.rightbarTrack?f:0),[_,v]=(0,B.useState)(null),[y,b]=(0,B.useState)(null),x=s-g.sidebar,S=l?s-56:a.rightbarFocus?x:_??p.rightbar,C=l&&a.rightbarTrack?S:a.rightbarFocus&&a.rightbarTrack?x:_!==null&&a.rightbarTrack?_:g.rightbar,w=m?Math.min(d,Math.max(0,s-48)):g.sidebar,T=(0,B.useRef)(g);T.current=g;let E=(0,B.useRef)(p.rightbar);E.current=p.rightbar;let D=(0,B.useRef)(0),O=(0,B.useRef)(0),[k,A]=(0,B.useState)(!1),ee=(0,B.useCallback)(()=>{A(!1)},[]),j=(0,B.useCallback)(()=>{D.current=T.current.sidebar,A(!0)},[]),M=(0,B.useCallback)(e=>{n.setSidebar(D.current+e)},[n]),N=Math.min(s*xe,s-g.sidebar-400),P=(0,B.useRef)(N),te=(0,B.useRef)(!1),F=(0,B.useCallback)(()=>{O.current=E.current,P.current=N,te.current=!1,v(null),b(null),A(!0)},[N]),I=(0,B.useCallback)(e=>{if(te.current)return;let t=O.current-e,r=Se(t,P.current);r?(te.current=!0,v(null),b(null),A(!1),r===`focus`?n.focusRightbar():n.collapseRightbar()):(n.setRightbar(t),v(Ce(t,P.current)),b(t>P.current?`focus`:t<300?`collapse`:null))},[n]),L=(0,B.useCallback)(()=>{v(null),b(null),A(!1)},[]),ne=i(`brand.localBuild`),re=(0,B.useMemo)(()=>r(`sidebar`,{collapsed:u,width:w}),[r,u,w]),ie=(0,B.useMemo)(()=>(0,W.jsx)(Ae,{usePanelInfo:t,renderSlot:r}),[t,r]),z=(0,B.useMemo)(()=>r(`shell.overlay`,{}),[r]);return(0,W.jsxs)(`div`,{ref:o,className:Oe.frame,style:{gridTemplateColumns:`${g.sidebar}px minmax(0, 1fr) ${C}px`},"data-sidebar-collapsed":u||void 0,"data-sidebar-drawer":m||void 0,"data-rightbar-collapsed":g.rightbar===0||void 0,"data-rightbar-fullscreen":a.rightbarFullscreen||void 0,"data-rightbar-focus":a.rightbarFocus||void 0,"data-rightbar-instant":a.rightbarInstant||void 0,"data-dragging":k||void 0,"data-rightbar-elastic":y??void 0,children:[(0,W.jsx)(De,{productTitle:ne}),m&&(0,W.jsx)(`button`,{type:`button`,className:Oe.drawerMask,tabIndex:-1,"aria-label":i(`sidebar.close`),onClick:n.closeSidebar}),(0,W.jsx)(`div`,{ref:h,className:Oe.sidebarCol,style:m?{width:w}:void 0,role:m?`dialog`:void 0,"aria-modal":m||void 0,"aria-label":m?i(`sidebar.label`):void 0,tabIndex:m?-1:void 0,children:(0,W.jsx)(R.Provider,{value:m?h:null,children:re})}),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ke,{children:ie}),(0,W.jsx)(je,{children:r(`rightbar`,{width:S,viewportWidth:s,canShow:p.rightbar>0})})]}),(0,W.jsx)(`div`,{className:Oe.overlayLayer,"data-shell-overlay":!0,children:z}),!u&&!c&&(0,W.jsx)(Me,{side:`sidebar`,left:g.sidebar,onStart:j,onDrag:M,onEnd:ee}),a.rightbarShown&&!a.rightbarFullscreen&&!a.rightbarFocus&&p.rightbar>0&&(0,W.jsx)(Me,{side:`rightbar`,left:s-S,onStart:F,onDrag:I,onEnd:L}),y&&(0,W.jsx)(`div`,{className:Oe.snapHint,role:`status`,style:{left:s-S},children:i(y===`focus`?`rightbar.drag.focus`:`rightbar.drag.collapse`)})]})}var Pe=`data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%20fill%3D%22none%22%3E%0A%20%20%3Ctitle%3Epi-webapp%3C%2Ftitle%3E%0A%20%20%3Cpath%20d%3D%22M5.2%209.1c0-1.5%201.2-2.7%202.7-2.7h16.2c1.5%200%202.7%201.2%202.7%202.7v1.1H5.2V9.1Z%22%20fill%3D%22%23172943%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M8.7%2010.2h3.8v12.6c0%202.5-1.8%204.3-4.3%204.3h-.5V10.2h1Z%22%20fill%3D%22%23172943%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M20.7%2010.2h3.8v12.3c0%201%20.6%201.6%201.6%201.6h1.2v3h-1.4c-3.3%200-5.2-1.9-5.2-4.6V10.2Z%22%20fill%3D%22%23172943%22%2F%3E%0A%3C%2Fsvg%3E%0A`;function Fe({size:e=24,className:t}){return(0,W.jsx)(`span`,{className:t,"aria-hidden":`true`,style:{display:`inline-block`,flexShrink:0,width:e,height:e,backgroundColor:`currentColor`,maskImage:`url("${Pe}")`,WebkitMaskImage:`url("${Pe}")`,maskSize:`contain`,WebkitMaskSize:`contain`,maskRepeat:`no-repeat`,WebkitMaskRepeat:`no-repeat`,maskPosition:`center`,WebkitMaskPosition:`center`}})}var Ie={bubble:`_bubble_1nw3t_1`,"tooltip-in":`_tooltip-in_1nw3t_1`};function Le({label:e,side:t=`right`,delayMs:n=0,disabled:r=!1,maxWidth:i,children:a}){let o=(0,B.useRef)(null),s=a.props.ref,c=(0,B.useCallback)(e=>{o.current=e,typeof s==`function`?s(e):s!=null&&(s.current=e)},[s]),[l,u]=(0,B.useState)(null),[d,f]=(0,B.useState)(t),p=(0,B.useRef)(null),m=l===null?null:typeof e==`function`?e():e,h=l===null?0:d===`right`?l.top+(l.bottom-l.top)/2:d===`top`?l.top-8:l.bottom+8;(0,B.useLayoutEffect)(()=>{if(l===null)return;let e=()=>{let e=p.current;if(e===null)return;e.style.left=`${l.x}px`;let n=e.getBoundingClientRect(),r=0;if(n.right>window.innerWidth-12&&(r=window.innerWidth-12-n.right),n.left+r<12&&(r=12-n.left),e.style.left=`${l.x+r}px`,t===`right`)return;let i=l.bottom+8+n.height<=window.innerHeight-12,a=l.top-8-n.height>=12;d===`bottom`&&!i&&a&&f(`top`),d===`top`&&!a&&i&&f(`bottom`)};return e(),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`resize`,e)}},[d,l,m,t]);let g=(0,B.useRef)(null),_=(0,B.useRef)({hover:!1,focus:!1}),v=(0,B.useCallback)(()=>{g.current!==null&&(clearTimeout(g.current),g.current=null)},[]);(0,B.useEffect)(()=>(r&&(v(),_.current={hover:!1,focus:!1},u(null)),v),[v,r]);let y=()=>{if(r)return;let e=o.current;if(e===null)return;let n=e.getBoundingClientRect();f(t),u({x:t===`right`?n.right+10:n.left+n.width/2,top:n.top,bottom:n.bottom})},b=()=>{v(),n<=0?y():g.current=setTimeout(()=>{g.current=null,y()},n)},x=()=>{v(),!_.current.hover&&!_.current.focus&&u(null)};return(0,W.jsxs)(W.Fragment,{children:[(0,B.cloneElement)(a,{ref:c,onMouseEnter:e=>{a.props.onMouseEnter?.(e),_.current.hover=!0,b()},onMouseLeave:e=>{a.props.onMouseLeave?.(e),_.current.hover=!1,v(),u(null)},onFocus:e=>{a.props.onFocus?.(e),_.current.focus=!0,v(),y()},onBlur:e=>{a.props.onBlur?.(e),_.current.focus=!1,x()}}),l!==null&&(0,W.jsx)(`span`,{ref:p,className:Ie.bubble,"data-side":d,style:{left:l.x,top:h,...i===void 0?{}:{maxWidth:i}},role:`tooltip`,children:m})]})}var Re={dot:`_dot_1cjbl_3`,matrix:`_matrix_1cjbl_4`,cell:`_cell_1cjbl_62`,"piw-state-dot-chase":`_piw-state-dot-chase_1cjbl_1`},ze=[[0,0],[4,0],[8,0],[8,4],[8,8],[4,8],[0,8],[0,4]];function Be({state:e,size:t=10,className:n}){return e===`ongoing`?(0,W.jsx)(`svg`,{className:F(Re.matrix,n),"data-state":`ongoing`,width:t,height:t,viewBox:`0 0 10 10`,shapeRendering:`crispEdges`,"aria-hidden":`true`,children:ze.map(([e,t],n)=>(0,W.jsx)(`rect`,{className:Re.cell,x:e,y:t,width:`2`,height:`2`,style:{animationDelay:`${(n-ze.length)*125}ms`}},`${e}-${t}`))}):(0,W.jsx)(`span`,{className:F(Re.dot,n),"data-state":e,style:{width:t,height:t},"aria-hidden":`true`})}var Ve=({size:e=16,className:t})=>(0,W.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,W.jsx)(`path`,{d:`M8.00003 0.3237C3.76075 0.3237 0.32373 3.76072 0.32373 8C0.32373 9.17603 0.589121 10.2922 1.0632 11.2901L1.35291 11.8989L2.5705 11.3205L2.28079 10.7117C1.89079 9.89074 1.67301 8.97167 1.67301 8C1.67301 4.50546 4.50549 1.67298 8.00003 1.67298C11.4946 1.67298 14.3271 4.50546 14.3271 8C14.3271 11.4945 11.4946 14.327 8.00003 14.327C7.28473 14.327 6.76077 14.277 6.29621 14.1487C5.83857 14.0224 5.40441 13.8109 4.88514 13.4488C4.12569 12.919 3.03778 12.7316 2.141 13.2978L2.12682 13.307L2.11264 13.3171L1.34886 13.854L1.79659 15.188L2.86122 14.4384C3.19068 14.2305 3.68325 14.2542 4.11326 14.5539C4.72789 14.9826 5.30042 15.2724 5.93762 15.4484C6.56803 15.6224 7.22776 15.6763 8.00003 15.6763C12.2393 15.6763 15.6763 12.2393 15.6763 8C15.6763 3.76072 12.2393 0.3237 8.00003 0.3237ZM7.32033 4.82535V7.32536H4.82538V8.67464H7.32033V11.1747H8.6696V8.67464H11.1747V7.32536H8.6696V4.82535H7.32033Z`,fill:`currentColor`})}),He=({size:e=16,className:t})=>(0,W.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,W.jsx)(`path`,{d:`M11.894845 6.647401C11.894845 3.725463 9.534486 1.356779 6.623219 1.35657C3.711786 1.35657 1.351635 3.725338 1.351635 6.647401C1.351843 9.569296 3.711911 11.938273 6.623219 11.938273C9.534361 11.938064 11.894637 9.569171 11.894845 6.647401ZM13.245462 6.647401C13.245254 10.317935 10.280401 13.293613 6.623219 13.293821C2.965871 13.293821 0.000204 10.31806 0 6.647401C0 2.976574 2.965746 0 6.623219 0C10.280526 0.000205 13.245462 2.9767 13.245462 6.647401Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M16.000417 15.041079L15.044449 16.000433L11.530434 12.473588L12.486298 11.514234L16.000417 15.041079Z`,fill:`currentColor`})]}),Ue=({size:e=14,className:t})=>(0,W.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,W.jsxs)(`g`,{clipPath:`url(#clip0_2580_121189)`,children:[(0,W.jsx)(`path`,{d:`M12.1192 4.91016C11.9392 4.52714 11.7007 4.1292 11.4483 3.78809C11.385 3.70258 11.3517 3.68409 11.2462 3.67383C10.7419 3.6248 10.2318 3.69454 9.72662 3.64551C9.29108 3.60318 8.93739 3.40341 8.67682 3.05176C8.38762 2.66127 8.19217 2.20926 7.90338 1.81934C7.83985 1.73359 7.80848 1.71542 7.70221 1.70508C7.24758 1.6609 6.7511 1.66104 6.29791 1.70508C6.19164 1.71542 6.16027 1.73359 6.09674 1.81934C5.80775 2.20954 5.61248 2.66131 5.3233 3.05176C5.06273 3.40341 4.70904 3.60318 4.2735 3.64551C3.76831 3.69454 3.25825 3.6248 2.75397 3.67383C2.6484 3.68409 2.61509 3.70258 2.55182 3.78809C2.30019 4.12814 2.06125 4.52646 1.88092 4.91016C1.83256 5.01309 1.83242 5.04912 1.88092 5.15235C2.07954 5.57482 2.37449 5.94529 2.5733 6.36817C2.76971 6.78606 2.76964 7.21293 2.5733 7.63086C2.37462 8.05374 2.07947 8.42453 1.88092 8.84668C1.83235 8.95004 1.83257 8.98695 1.88092 9.08985C2.06098 9.47285 2.2994 9.87079 2.55182 10.2119C2.61509 10.2974 2.6484 10.3159 2.75397 10.3262C3.25879 10.3753 3.76834 10.3055 4.2735 10.3545C4.70904 10.3968 5.06273 10.5966 5.3233 10.9482C5.6125 11.3387 5.80795 11.7907 6.09674 12.1807C6.16027 12.2664 6.19164 12.2846 6.29791 12.2949C6.7511 12.339 7.24758 12.3391 7.70221 12.2949C7.80848 12.2846 7.83985 12.2664 7.90338 12.1807C8.19237 11.7905 8.38764 11.3387 8.67682 10.9482C8.93739 10.5966 9.29108 10.3968 9.72662 10.3545C10.2318 10.3055 10.7419 10.3752 11.2462 10.3262C11.3517 10.3159 11.385 10.2974 11.4483 10.2119C11.7007 9.87079 11.9391 9.47285 12.1192 9.08985C12.1675 8.98695 12.1678 8.95004 12.1192 8.84668C11.9205 8.42428 11.6255 8.05377 11.4268 7.63086C11.2305 7.21293 11.2304 6.78606 11.4268 6.36817C11.6256 5.94531 11.9207 5.5746 12.1192 5.15235C12.1677 5.04912 12.1676 5.01309 12.1192 4.91016ZM13.2051 5.66309C13.0064 6.08573 12.7114 6.45579 12.5128 6.87793C12.4642 6.98123 12.4645 7.01829 12.5128 7.1211C12.7112 7.54328 13.0064 7.91405 13.2051 8.33692C13.4015 8.75487 13.4015 9.18169 13.2051 9.59961C12.9911 10.0551 12.7109 10.5221 12.4122 10.9258C12.1522 11.277 11.7974 11.4782 11.3624 11.5205C10.8573 11.5696 10.3477 11.4999 9.84283 11.5488C9.73621 11.5592 9.70429 11.5772 9.64069 11.6631C9.35229 12.0526 9.15705 12.5044 8.86823 12.8945C8.60854 13.2452 8.25275 13.447 7.81842 13.4893C7.28749 13.5409 6.71096 13.5407 6.1817 13.4893C5.74737 13.447 5.39158 13.2452 5.1319 12.8945C4.84312 12.5045 4.64808 12.0529 4.35944 11.6631C4.29583 11.5772 4.26392 11.5592 4.15729 11.5488C3.65283 11.5 3.14295 11.5696 2.63776 11.5205C2.20274 11.4782 1.84796 11.277 1.58795 10.9258C1.28834 10.5209 1.00864 10.0543 0.794982 9.59961C0.598644 9.18169 0.598598 8.75487 0.794982 8.33692C0.993688 7.91405 1.28889 7.54328 1.48737 7.1211C1.53567 7.01829 1.53593 6.98123 1.48737 6.87793C1.28887 6.45603 0.993667 6.08569 0.794982 5.66309C0.598535 5.24516 0.59869 4.81829 0.794982 4.40039C1.00898 3.94492 1.28922 3.47791 1.58795 3.07422C1.84796 2.723 2.20274 2.5218 2.63776 2.47949C3.14295 2.43038 3.65283 2.50003 4.15729 2.45117C4.26391 2.44081 4.29583 2.4228 4.35944 2.33692C4.64783 1.94742 4.84308 1.49557 5.1319 1.10547C5.39158 0.754835 5.74737 0.553005 6.1817 0.510744C6.71263 0.459147 7.28917 0.459309 7.81842 0.510744C8.25275 0.553005 8.60854 0.754835 8.86823 1.10547C9.157 1.49551 9.35204 1.94708 9.64069 2.33692C9.70429 2.4228 9.73621 2.44081 9.84283 2.45117C10.3477 2.50007 10.8573 2.43039 11.3624 2.47949C11.7974 2.5218 12.1522 2.723 12.4122 3.07422C12.7118 3.47909 12.9915 3.94567 13.2051 4.40039C13.4014 4.81829 13.4016 5.24516 13.2051 5.66309Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M7.9317 7C7.9317 6.48569 7.51438 6.06836 7.00006 6.06836C6.48575 6.06836 6.06842 6.48569 6.06842 7C6.06842 7.51432 6.48575 7.93164 7.00006 7.93164C7.51438 7.93164 7.9317 7.51432 7.9317 7ZM9.13092 7C9.13092 8.17706 8.17712 9.13086 7.00006 9.13086C5.823 9.13086 4.8692 8.17706 4.8692 7C4.8692 5.82294 5.823 4.86914 7.00006 4.86914C8.17712 4.86914 9.13092 5.82294 9.13092 7Z`,fill:`currentColor`})]}),(0,W.jsx)(`defs`,{children:(0,W.jsx)(`clipPath`,{id:`clip0_2580_121189`,children:(0,W.jsx)(`rect`,{width:14,height:14,fill:`currentColor`})})})]}),We=({size:e=16,className:t})=>(0,W.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,W.jsxs)(`g`,{clipPath:`url(#clip0_1450_63327)`,children:[(0,W.jsx)(`path`,{d:`M14.0861 5.51366C13.8717 5.0575 13.588 4.58542 13.2889 4.18108C13.208 4.07172 13.1596 4.04373 13.0243 4.03054C12.4277 3.97255 11.8245 4.05527 11.2269 3.9972C10.7224 3.94816 10.3133 3.71661 10.0115 3.30919C9.66986 2.84777 9.43973 2.31343 9.09824 1.85234C9.01771 1.74365 8.96805 1.71589 8.83354 1.70282C8.29432 1.65044 7.70402 1.65061 7.16656 1.70282C7.03205 1.71589 6.98239 1.74365 6.90186 1.85234C6.56067 2.31303 6.33025 2.84774 5.98855 3.30919C5.68681 3.71661 5.27774 3.94816 4.77317 3.9972C4.17564 4.05527 3.57239 3.97255 2.97585 4.03054C2.84046 4.04373 2.79208 4.07172 2.71115 4.18108C2.41212 4.58542 2.12835 5.0575 1.91403 5.51366C1.85299 5.64359 1.85286 5.7018 1.91403 5.8319C2.14865 6.33077 2.49748 6.76892 2.73237 7.26854C2.9594 7.7515 2.96041 8.24717 2.73338 8.73044C2.49837 9.23061 2.14891 9.66837 1.91403 10.1681C1.85291 10.2982 1.85299 10.3564 1.91403 10.4863C2.12856 10.9429 2.41185 11.4142 2.71115 11.8189C2.79208 11.9283 2.84046 11.9563 2.97585 11.9694C3.57239 12.0274 4.17564 11.9447 4.77317 12.0028C5.27774 12.0518 5.68681 12.2834 5.98855 12.6908C6.33024 13.1522 6.56037 13.6866 6.90186 14.1476C6.98239 14.2563 7.03205 14.2841 7.16656 14.2972C7.70402 14.3494 8.29432 14.3495 8.83354 14.2972C8.96805 14.2841 9.01771 14.2563 9.09824 14.1476C9.43944 13.687 9.66985 13.1522 10.0115 12.6908C10.3133 12.2834 10.7224 12.0518 11.2269 12.0028C11.8244 11.9447 12.4271 12.0275 13.0243 11.9694C13.1596 11.9563 13.208 11.9283 13.2889 11.8189C13.5891 11.4131 13.872 10.942 14.0861 10.4863C14.1471 10.3564 14.1472 10.2982 14.0861 10.1681C13.8513 9.66861 13.5017 9.23061 13.2667 8.73044C13.0397 8.24717 13.0407 7.7515 13.2677 7.26854C13.5026 6.7689 13.8513 6.33106 14.0861 5.8319C14.1472 5.7018 14.1471 5.64359 14.0861 5.51366ZM15.3035 6.40373C15.0685 6.90359 14.7188 7.34119 14.4841 7.84037C14.4231 7.97025 14.423 8.02855 14.4841 8.15861C14.7189 8.65833 15.0685 9.09611 15.3035 9.59626C15.5308 10.0801 15.5308 10.5744 15.3035 11.0582C15.052 11.5933 14.7225 12.1426 14.37 12.6191C14.0685 13.0265 13.6581 13.259 13.1536 13.3081C12.5566 13.366 11.9541 13.2835 11.3573 13.3414C11.2228 13.3545 11.1731 13.3823 11.0926 13.491C10.7511 13.9521 10.521 14.4864 10.1793 14.9478C9.87828 15.3542 9.46719 15.5869 8.96387 15.6358C8.34008 15.6964 7.66194 15.6966 7.03623 15.6358C6.53291 15.5869 6.12182 15.3542 5.82084 14.9478C5.47911 14.4863 5.24878 13.9517 4.90753 13.491C4.82701 13.3823 4.77734 13.3545 4.64284 13.3414C4.04647 13.2835 3.44373 13.366 2.84653 13.3081C2.34201 13.259 1.93164 13.0265 1.63013 12.6191C1.27867 12.144 0.948453 11.5941 0.696621 11.0582C0.469315 10.5744 0.469279 10.0801 0.696621 9.59626C0.931628 9.09613 1.2813 8.65807 1.51597 8.15861C1.57708 8.02855 1.57702 7.97025 1.51597 7.84037C1.28117 7.34095 0.931635 6.9036 0.696621 6.40373C0.469213 5.91992 0.469367 5.42562 0.696621 4.94183C0.948441 4.40587 1.27868 3.85598 1.63013 3.38092C1.93164 2.97349 2.34201 2.74095 2.84653 2.6919C3.44353 2.63397 4.04599 2.71649 4.64284 2.65856C4.77734 2.64549 4.82701 2.61774 4.90753 2.50904C5.24905 2.04792 5.47913 1.51362 5.82084 1.05219C6.12182 0.645806 6.53291 0.413119 7.03623 0.364178C7.66002 0.303556 8.33816 0.303369 8.96387 0.364178C9.46719 0.413119 9.87828 0.645806 10.1793 1.05219C10.521 1.51365 10.7513 2.04828 11.0926 2.50904C11.1731 2.61774 11.2228 2.64549 11.3573 2.65856C11.9541 2.71649 12.5566 2.63397 13.1536 2.6919C13.6581 2.74095 14.0685 2.97349 14.37 3.38092C14.7214 3.85598 15.0517 4.40587 15.3035 4.94183C15.5307 5.42562 15.5309 5.91992 15.3035 6.40373Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M9.13764 7.99999C9.13764 7.3715 8.62855 6.8624 8.00005 6.8624C7.37155 6.8624 6.86246 7.3715 6.86246 7.99999C6.86246 8.62849 7.37155 9.13759 8.00005 9.13759C8.62855 9.13759 9.13764 8.62849 9.13764 7.99999ZM10.4834 7.99999C10.4834 9.37126 9.37132 10.4833 8.00005 10.4833C6.62878 10.4833 5.51674 9.37126 5.51674 7.99999C5.51674 6.62873 6.62878 5.51669 8.00005 5.51669C9.37132 5.51669 10.4834 6.62873 10.4834 7.99999Z`,fill:`currentColor`})]}),(0,W.jsx)(`defs`,{children:(0,W.jsx)(`clipPath`,{id:`clip0_1450_63327`,children:(0,W.jsx)(`rect`,{width:16,height:16,fill:`currentColor`})})})]}),Ge=({size:e=16,className:t})=>(0,W.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9.67272 0.522841C10.8339 0.522841 11.76 0.522714 12.4963 0.602493C13.2453 0.683657 13.8789 0.854248 14.4264 1.25197C14.7504 1.48739 15.0355 1.77247 15.2709 2.0965C15.6686 2.64394 15.8392 3.27758 15.9204 4.02655C16.0002 4.7629 16 5.68895 16 6.85014V9.14986C16 10.3111 16.0002 11.2371 15.9204 11.9735C15.8392 12.7224 15.6686 13.3561 15.2709 13.9035C15.0355 14.2275 14.7504 14.5126 14.4264 14.748C13.8789 15.1458 13.2453 15.3163 12.4963 15.3975C11.76 15.4773 10.8339 15.4772 9.67272 15.4772H6.3273C5.16611 15.4772 4.24006 15.4773 3.50371 15.3975C2.75474 15.3163 2.1211 15.1458 1.57366 14.748C1.24963 14.5126 0.964549 14.2275 0.729131 13.9035C0.331407 13.3561 0.160817 12.7224 0.0796529 11.9735C-0.000126137 11.2371 1.25338e-09 10.3111 1.25338e-09 9.14986V6.85014C1.25329e-09 5.68895 -0.000126137 4.7629 0.0796529 4.02655C0.160817 3.27758 0.331407 2.64394 0.729131 2.0965C0.964549 1.77247 1.24963 1.48739 1.57366 1.25197C2.1211 0.854248 2.75474 0.683657 3.50371 0.602493C4.24006 0.522714 5.16611 0.522841 6.3273 0.522841H9.67272ZM5.54303 1.88715V14.1118C5.78636 14.1128 6.04709 14.1169 6.3273 14.1169H9.67272C10.8639 14.1169 11.7032 14.1164 12.3493 14.0465C12.9824 13.9779 13.3497 13.8494 13.6268 13.6482C13.8354 13.4966 14.0195 13.3125 14.1711 13.1039C14.3723 12.8268 14.5007 12.4595 14.5693 11.8264C14.6393 11.1803 14.6398 10.341 14.6398 9.14986V6.85014C14.6398 5.65896 14.6393 4.81967 14.5693 4.1736C14.5007 3.54048 14.3723 3.17318 14.1711 2.89609C14.0195 2.68747 13.8354 2.50337 13.6268 2.35179C13.3497 2.1506 12.9824 2.02212 12.3493 1.95353C11.7032 1.88358 10.8639 1.88307 9.67272 1.88307H6.3273C6.04709 1.88307 5.78636 1.8862 5.54303 1.88715ZM4.1828 1.91166C3.99125 1.9216 3.8148 1.93577 3.65076 1.95353C3.01764 2.02212 2.65034 2.1506 2.37325 2.35179C2.16463 2.50337 1.98052 2.68747 1.82895 2.89609C1.62776 3.17318 1.49928 3.54048 1.43069 4.1736C1.36074 4.81967 1.36023 5.65896 1.36023 6.85014V9.14986C1.36023 10.341 1.36074 11.1803 1.43069 11.8264C1.49928 12.4595 1.62776 12.8268 1.82895 13.1039C1.98052 13.3125 2.16463 13.4966 2.37325 13.6482C2.65034 13.8494 3.01764 13.9779 3.65076 14.0465C3.81478 14.0642 3.99127 14.0774 4.1828 14.0873V1.91166Z`,fill:`currentColor`})}),Ke=({size:e=16,className:t})=>(0,W.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,W.jsx)(`path`,{d:`M4.55146 8.00001C4.55146 8.63513 4.03659 9.15001 3.40146 9.15001C2.76634 9.15001 2.25146 8.63513 2.25146 8.00001C2.25146 7.36488 2.76634 6.85001 3.40146 6.85001C4.03659 6.85001 4.55146 7.36488 4.55146 8.00001Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M9.1476 8.00001C9.1476 8.63513 8.63273 9.15001 7.9976 9.15001C7.36248 9.15001 6.8476 8.63513 6.8476 8.00001C6.8476 7.36488 7.36248 6.85001 7.9976 6.85001C8.63273 6.85001 9.1476 7.36488 9.1476 8.00001Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M13.7486 8.00001C13.7486 8.63513 13.2338 9.15001 12.5986 9.15001C11.9635 9.15001 11.4486 8.63513 11.4486 8.00001C11.4486 7.36488 11.9635 6.85001 12.5986 6.85001C13.2338 6.85001 13.7486 7.36488 13.7486 8.00001Z`,fill:`currentColor`})]}),qe=({size:e=16,className:t})=>(0,W.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,W.jsx)(`path`,{d:`M8.64453 1.5V7.34961H14.5V8.65039H8.64453V14.5H7.34473V8.65039H1.5V7.34961H7.34473V1.5H8.64453Z`,fill:`currentColor`})}),Je=({size:e=16,className:t})=>(0,W.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,W.jsx)(`path`,{d:`M15.0498 3.92579L8.49512 12.3818C8.25774 12.6881 8.04517 12.9645 7.84668 13.1689C7.63957 13.3823 7.38732 13.5841 7.04492 13.6719C6.86373 13.7183 6.6757 13.7346 6.48926 13.7197C6.13666 13.6915 5.8528 13.5355 5.6123 13.3604C5.38201 13.1926 5.12573 12.9567 4.83984 12.6953L1.03125 9.21289L1.96875 8.1875L5.77734 11.6699C6.08684 11.9529 6.27773 12.1249 6.43066 12.2363C6.50183 12.2882 6.54699 12.3135 6.57324 12.3252C6.58525 12.3305 6.59269 12.3322 6.5957 12.333C6.59802 12.3336 6.59961 12.334 6.59961 12.334C6.63317 12.3367 6.66758 12.3335 6.7002 12.3252C6.7002 12.3252 6.70211 12.3251 6.7041 12.3242C6.70698 12.3229 6.71348 12.319 6.72461 12.3115C6.74849 12.2956 6.78843 12.2642 6.84961 12.2012C6.98138 12.0654 7.13957 11.8628 7.39648 11.5313L13.9502 3.07422L15.0498 3.92579Z`,fill:`currentColor`})}),Ye=({size:e=14,className:t})=>(0,W.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,W.jsx)(`path`,{d:`M11.8486 5.5L11.4238 5.92383L8.69727 8.65137C8.44157 8.90706 8.21562 9.13382 8.01172 9.29785C7.79912 9.46883 7.55595 9.61756 7.25 9.66602C7.08435 9.69222 6.91565 9.69222 6.75 9.66602C6.44405 9.61756 6.20088 9.46883 5.98828 9.29785C5.78438 9.13382 5.55843 8.90706 5.30273 8.65137L2.57617 5.92383L2.15137 5.5L3 4.65137L3.42383 5.07617L6.15137 7.80273C6.42595 8.07732 6.59876 8.24849 6.74023 8.3623C6.87291 8.46904 6.92272 8.47813 6.9375 8.48047C6.97895 8.48703 7.02105 8.48703 7.0625 8.48047C7.07728 8.47813 7.12709 8.46904 7.25977 8.3623C7.40124 8.24849 7.57405 8.07732 7.84863 7.80273L10.5762 5.07617L11 4.65137L11.8486 5.5Z`,fill:`currentColor`})}),Xe=({size:e=14,className:t})=>(0,W.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,W.jsx)(`path`,{d:`M5.5 2.15137L5.92383 2.57617L8.65137 5.30273C8.90706 5.55843 9.13382 5.78438 9.29785 5.98828C9.46883 6.20088 9.61756 6.44405 9.66602 6.75C9.69222 6.91565 9.69222 7.08435 9.66602 7.25C9.61756 7.55595 9.46883 7.79912 9.29785 8.01172C9.13382 8.21561 8.90706 8.44157 8.65137 8.69727L5.92383 11.4238L5.5 11.8486L4.65137 11L5.07617 10.5762L7.80273 7.84863C8.07732 7.57405 8.24849 7.40124 8.3623 7.25977C8.46904 7.12709 8.47813 7.07728 8.48047 7.0625C8.48703 7.02105 8.48703 6.97895 8.48047 6.9375C8.47813 6.92272 8.46904 6.87291 8.3623 6.74023C8.24848 6.59876 8.07732 6.42595 7.80273 6.15137L5.07617 3.42383L4.65137 3L5.5 2.15137Z`,fill:`currentColor`})}),Ze=({size:e=16,className:t})=>(0,W.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,W.jsx)(`path`,{d:`M14.1168 13.197L13.197 14.1167L1.8833 2.80303L2.80309 1.88324L14.1168 13.197Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M13.197 1.88326L14.1168 2.80305L2.80309 14.1168L1.8833 13.197L13.197 1.88326Z`,fill:`currentColor`})]}),Qe=({size:e=14,className:t})=>(0,W.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,W.jsx)(`path`,{d:`M10.6074 4.40278L8.00975 6.99973L10.6074 9.59739L9.59736 10.6074L6.9997 8.00978L4.40274 10.6074L3.3927 9.59739L5.98966 6.99973L3.3927 4.40278L4.40274 3.39273L6.9997 5.98969L9.59736 3.39273L10.6074 4.40278Z`,fill:`currentColor`})}),$e=({size:e=16,className:t})=>(0,W.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,W.jsx)(`path`,{d:`M6.14929 4.02032C7.11197 4.02032 7.87983 4.02016 8.49597 4.07598C9.12128 4.13269 9.65792 4.25188 10.1415 4.53106C10.7202 4.8653 11.2008 5.3459 11.535 5.92462C11.8142 6.40818 11.9334 6.94481 11.9901 7.57012C12.0459 8.18625 12.0458 8.95419 12.0458 9.9168C12.0458 10.8795 12.0459 11.6473 11.9901 12.2635C11.9334 12.8888 11.8142 13.4254 11.535 13.909C11.2008 14.4877 10.7202 14.9683 10.1415 15.3025C9.65792 15.5817 9.12128 15.7009 8.49597 15.7576C7.87984 15.8134 7.11196 15.8133 6.14929 15.8133C5.18667 15.8133 4.41874 15.8134 3.80261 15.7576C3.1773 15.7009 2.64067 15.5817 2.1571 15.3025C1.5784 14.9683 1.09778 14.4877 0.76355 13.909C0.484366 13.4254 0.365184 12.8888 0.308472 12.2635C0.252649 11.6473 0.252808 10.8795 0.252808 9.9168C0.252808 8.95418 0.252664 8.18625 0.308472 7.57012C0.365184 6.94481 0.484366 6.40818 0.76355 5.92462C1.09777 5.34589 1.57839 4.86529 2.1571 4.53106C2.64067 4.25188 3.1773 4.13269 3.80261 4.07598C4.41874 4.02017 5.18666 4.02032 6.14929 4.02032ZM6.14929 5.37774C5.16181 5.37774 4.46634 5.37761 3.92566 5.42657C3.39434 5.47472 3.07859 5.56574 2.83582 5.70587C2.4632 5.92106 2.15354 6.2307 1.93835 6.60333C1.79823 6.8461 1.70721 7.16185 1.65906 7.69317C1.6101 8.23385 1.61023 8.92933 1.61023 9.9168C1.61023 10.9043 1.61009 11.5998 1.65906 12.1404C1.70721 12.6717 1.79823 12.9875 1.93835 13.2303C2.15356 13.6029 2.46321 13.9126 2.83582 14.1277C3.07859 14.2679 3.39434 14.3589 3.92566 14.407C4.46634 14.456 5.16182 14.4559 6.14929 14.4559C7.13682 14.4559 7.83224 14.456 8.37292 14.407C8.90425 14.3589 9.21999 14.2679 9.46277 14.1277C9.83535 13.9126 10.145 13.6029 10.3602 13.2303C10.5004 12.9875 10.5914 12.6717 10.6395 12.1404C10.6885 11.5998 10.6884 10.9043 10.6884 9.9168C10.6884 8.92934 10.6885 8.23384 10.6395 7.69317C10.5914 7.16185 10.5004 6.8461 10.3602 6.60333C10.1451 6.23071 9.83536 5.92107 9.46277 5.70587C9.21999 5.56574 8.90424 5.47472 8.37292 5.42657C7.83224 5.3776 7.13682 5.37774 6.14929 5.37774ZM9.80164 0.367975C10.7638 0.367975 11.5314 0.36788 12.1473 0.423639C12.7726 0.480307 13.3093 0.598759 13.7928 0.877741C14.3717 1.21192 14.8521 1.69355 15.1864 2.27227C15.4655 2.75574 15.5857 3.29164 15.6425 3.9168C15.6983 4.53301 15.6971 5.3016 15.6971 6.26446V7.82989C15.6971 8.29264 15.6989 8.58993 15.6649 8.84844C15.4668 10.3525 14.401 11.5738 12.9833 11.9988V10.5467C13.6973 10.1903 14.2105 9.49662 14.3192 8.67169C14.3387 8.52347 14.3407 8.3358 14.3407 7.82989V6.26446C14.3407 5.27706 14.3398 4.58149 14.2909 4.04083C14.2428 3.50968 14.1526 3.19372 14.0126 2.95098C13.7974 2.57849 13.4876 2.26869 13.1151 2.05352C12.8724 1.91347 12.5564 1.82237 12.0253 1.77423C11.4847 1.72528 10.7888 1.7254 9.80164 1.7254H7.71472C6.7562 1.72558 5.92665 2.27697 5.52332 3.07891H4.07019C4.54221 1.51132 5.9932 0.368186 7.71472 0.367975H9.80164Z`,fill:`currentColor`})}),et=({size:e=16,className:t})=>(0,W.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,W.jsx)(`path`,{d:`M9.94076 1.34942C10.7047 0.90231 11.6503 0.902415 12.4143 1.34942C12.7061 1.52015 12.9688 1.79118 13.3104 2.13284C13.6521 2.47448 13.9231 2.73721 14.0939 3.02894C14.5408 3.79294 14.5409 4.73856 14.0939 5.50251C13.9231 5.79415 13.652 6.05704 13.3104 6.39861L6.65932 13.0497C6.28068 13.4284 6.00695 13.7108 5.66543 13.9097C5.32391 14.1085 4.94315 14.2074 4.42705 14.3498L3.24394 14.6761C2.77527 14.8054 2.34538 14.9262 2.00131 14.9684C1.65196 15.0112 1.17964 15.0013 0.810764 14.6325C0.441921 14.2637 0.432107 13.7913 0.47486 13.442C0.517035 13.0979 0.6379 12.668 0.767181 12.1993L1.09352 11.0162C1.23588 10.5001 1.33481 10.1193 1.5336 9.77784C1.7325 9.43632 2.0149 9.1626 2.39355 8.78395L9.04466 2.13284C9.38625 1.79126 9.64911 1.52016 9.94076 1.34942ZM15.5427 14.8398H7.55223L8.96707 13.425H15.5427V14.8398ZM3.39382 9.78422C2.965 10.213 2.84244 10.3436 2.75709 10.49C2.67183 10.6366 2.61862 10.8079 2.45733 11.3925L2.13099 12.5756C2.00183 13.0439 1.92194 13.3419 1.88863 13.5536C2.10041 13.5204 2.39872 13.4416 2.86764 13.3123L4.05075 12.9859C4.63544 12.8246 4.80669 12.7715 4.95323 12.6862C5.09968 12.6008 5.23022 12.4783 5.65905 12.0494L10.721 6.98644L8.45577 4.72121L3.39382 9.78422ZM11.7 2.57079C11.3774 2.38198 10.9777 2.38198 10.6551 2.57079C10.5602 2.62647 10.4487 2.72931 10.0449 3.13311L9.45604 3.72094L11.7213 5.98617L12.3102 5.39833C12.7139 4.99457 12.8168 4.88307 12.8725 4.78818C13.0613 4.46561 13.0612 4.06585 12.8725 3.74326C12.8169 3.64827 12.7146 3.53752 12.3102 3.13311C11.9057 2.72863 11.795 2.6264 11.7 2.57079Z`,fill:`currentColor`})}),tt=({size:e=14,className:t})=>(0,W.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,W.jsx)(`path`,{d:`M7.06431 5.93342C7.68763 5.93342 8.19307 6.43904 8.19322 7.06233C8.19322 7.68573 7.68772 8.19123 7.06431 8.19123C6.44099 8.19113 5.9354 7.68567 5.9354 7.06233C5.93555 6.43911 6.44108 5.93353 7.06431 5.93342Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8.6815 0.963693C10.1169 0.447019 11.6266 0.374829 12.5633 1.31135C13.5 2.24805 13.4277 3.75776 12.911 5.19319C12.7126 5.74431 12.4386 6.31796 12.0965 6.89729C12.4969 7.54638 12.8141 8.19018 13.036 8.80647C13.5527 10.2419 13.6251 11.7516 12.6883 12.6883C11.7516 13.625 10.242 13.5527 8.8065 13.036C8.19022 12.8141 7.54641 12.4969 6.89732 12.0965C6.31797 12.4386 5.74435 12.7125 5.19322 12.911C3.75777 13.4276 2.2481 13.5 1.31138 12.5633C0.374859 11.6266 0.447049 10.1168 0.963724 8.68147C1.17185 8.10338 1.46321 7.50063 1.82896 6.8924C1.52182 6.35711 1.27235 5.82825 1.08872 5.31819C0.572068 3.88278 0.499714 2.37306 1.43638 1.43635C2.37308 0.499655 3.8828 0.572044 5.31822 1.08869C5.82828 1.27232 6.35715 1.5218 6.89243 1.82893C7.50066 1.46318 8.10341 1.17181 8.6815 0.963693ZM11.3573 8.01154C10.9083 8.62253 10.3901 9.22873 9.80943 9.8094C9.22877 10.3901 8.62255 10.9083 8.01158 11.3572C8.4257 11.5841 8.8287 11.7688 9.21275 11.9071C10.5456 12.3868 11.4246 12.2547 11.8397 11.8397C12.2548 11.4246 12.3869 10.5456 11.9071 9.21272C11.7688 8.82866 11.5841 8.42568 11.3573 8.01154ZM2.56529 8.02912C2.37344 8.39322 2.21495 8.74796 2.09263 9.08772C1.61291 10.4204 1.74512 11.2995 2.16001 11.7147C2.57505 12.1297 3.45415 12.2618 4.78697 11.7821C5.11057 11.6656 5.44786 11.5164 5.7938 11.3367C5.249 10.9223 4.70922 10.4533 4.19029 9.9344C3.57578 9.31987 3.03169 8.67633 2.56529 8.02912ZM6.90708 3.2469C6.24065 3.70479 5.5646 4.26321 4.91392 4.91389C4.26325 5.56456 3.70482 6.24063 3.24693 6.90705C3.72674 7.63325 4.32777 8.37459 5.03892 9.08576C5.64943 9.69627 6.28183 10.2265 6.90806 10.6678C7.59368 10.2025 8.2908 9.63076 8.96079 8.96076C9.6308 8.29075 10.2025 7.59366 10.6678 6.90803C10.2265 6.2818 9.69631 5.6494 9.08579 5.03889C8.37462 4.32773 7.63328 3.72672 6.90708 3.2469ZM11.7147 2.15998C11.2996 1.74509 10.4204 1.61288 9.08775 2.0926C8.74835 2.21479 8.39382 2.37271 8.03013 2.56428C8.67728 3.03065 9.31995 3.5758 9.93443 4.19026C10.4534 4.7092 10.9223 5.24896 11.3368 5.79377C11.5164 5.44785 11.6656 5.11052 11.7821 4.78694C12.2618 3.45416 12.1297 2.57502 11.7147 2.15998ZM4.91197 2.2176C3.57922 1.73788 2.70004 1.86995 2.28501 2.28498C1.87001 2.70003 1.73791 3.5792 2.21763 4.91194C2.31709 5.18822 2.44112 5.47427 2.58677 5.7674C3.01931 5.1887 3.51474 4.6158 4.06529 4.06526C4.61584 3.5147 5.18872 3.01928 5.76743 2.58674C5.47431 2.4411 5.18824 2.31706 4.91197 2.2176Z`,fill:`currentColor`})]}),nt=({size:e=16,className:t})=>(0,W.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,W.jsx)(`path`,{d:`M14.4782 4.84067L14.2138 10.1152C14.1102 12.1872 14.067 13.0115 13.3866 13.9607C13.1044 14.3546 12.7498 14.6912 12.3424 14.9535C11.8239 15.2872 11.2415 15.4316 10.5585 15.4998C9.88727 15.5668 9.04946 15.5656 7.99998 15.5656C6.95051 15.5656 6.1127 15.5668 5.44142 15.4998C4.75851 15.4316 4.17602 15.2872 3.65753 14.9535C3.25012 14.6912 2.89559 14.3546 2.61332 13.9607C1.93296 13.0115 1.88979 12.1872 1.78619 10.1152L1.52179 4.84067L2.89006 4.77277L3.15343 10.0463C3.26221 12.2218 3.32452 12.6015 3.72646 13.1624C3.90825 13.4161 4.13686 13.6334 4.39927 13.8023C4.66204 13.9714 5.00263 14.0792 5.57825 14.1367C6.16562 14.1953 6.92298 14.1963 7.99998 14.1963C9.07699 14.1963 9.83434 14.1953 10.4217 14.1367C10.9973 14.0792 11.3379 13.9714 11.6007 13.8023C11.8631 13.6334 12.0917 13.4161 12.2735 13.1624C12.6755 12.6015 12.7378 12.2218 12.8465 10.0463L13.1099 4.77277L14.4782 4.84067ZM5.43011 6.22849H6.7994V11.3909H5.43011V6.22849ZM9.20056 6.22849H10.5699V11.3909H9.20056V6.22849ZM8.53597 0.434431C9.17976 0.434431 9.6522 0.426926 10.0966 0.571258C10.2357 0.616451 10.3717 0.672554 10.502 0.738948C10.9182 0.951107 11.2464 1.29099 11.7015 1.74612L12.4978 2.54136H15.3742V3.91169H0.625732V2.54136H3.50218L4.29845 1.74612C4.75358 1.29099 5.08174 0.951107 5.49801 0.738948C5.62831 0.672554 5.76425 0.616451 5.90334 0.571258C6.34776 0.426926 6.82021 0.434431 7.46399 0.434431H8.53597ZM7.46399 1.80476C6.73208 1.80476 6.51641 1.81187 6.32617 1.87369C6.25545 1.89667 6.18668 1.92533 6.12041 1.95907C5.96398 2.03878 5.82348 2.16253 5.44142 2.54136H10.5585C10.1765 2.16253 10.036 2.03878 9.87955 1.95907C9.81329 1.92533 9.74452 1.89667 9.6738 1.87369C9.48356 1.81187 9.26789 1.80476 8.53597 1.80476H7.46399Z`,fill:`currentColor`})}),rt=({size:e=16,className:t})=>(0,W.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,W.jsx)(`path`,{d:`M15.3695 11.411L15.1234 12.8866C14.8869 14.3042 13.6603 15.3436 12.223 15.3436H3.77673C2.33958 15.3434 1.1128 14.3042 0.876343 12.8866L0.630249 11.411L2.05408 11.1747L2.29919 12.6493C2.41973 13.3713 3.04475 13.9001 3.77673 13.9003H12.223C12.9551 13.9002 13.58 13.3713 13.7006 12.6493L13.9457 11.1747L15.3695 11.411ZM8.72205 8.994C8.77717 8.93934 8.83792 8.88106 8.90271 8.81627L12.4828 5.23424L13.5043 6.25572L9.92224 9.8358C9.6395 10.1185 9.38763 10.3732 9.15857 10.5575C8.91892 10.7503 8.63953 10.9224 8.2865 10.9784C8.09711 11.0083 7.90363 11.0083 7.71423 10.9784C7.36106 10.9224 7.0809 10.7503 6.84119 10.5575C6.61215 10.3732 6.36022 10.1185 6.07751 9.8358L2.49646 6.25572L3.51697 5.23424L7.09705 8.81627C7.16219 8.88142 7.22331 8.94006 7.27869 8.99498V1.3065H8.72205V8.994Z`,fill:`currentColor`})}),it=({size:e=16,className:t})=>(0,W.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.3368 1.53569L11.931 4.43172H14.8086V5.79673H11.7404L11.1962 9.67859H14.2839V11.0436H11.0056L10.4994 14.6529L9.14873 14.4643L9.62731 11.0436H5.75876L5.25252 14.6529L3.90186 14.4643L4.38043 11.0436H1.69141V9.67859H4.57104L5.11417 5.79673H2.21609V4.43172H5.30581L5.73724 1.34713L7.08995 1.53569L6.68414 4.43172H10.5527L10.9841 1.34713L12.3368 1.53569ZM5.94937 9.67859H9.81791L10.361 5.79673H6.49353L5.94937 9.67859Z`,fill:`currentColor`})}),at=({size:e=16,className:t})=>(0,W.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,children:(0,W.jsx)(`path`,{transform:`translate(1.292 1.3)`,d:`M10.3232 9.18164C11.2868 9.18164 12.0985 9.82833 12.3506 10.7109L13.415 10.7109L13.415 11.8711L12.3496 11.8711C12.0971 12.7532 11.2864 13.3994 10.3232 13.3994C9.36031 13.3992 8.55012 12.7531 8.29785 11.8711L0 11.8711L0 10.7109L8.29688 10.7109C8.54876 9.82845 9.35988 9.18186 10.3232 9.18164ZM10.3232 10.3418C9.7999 10.3421 9.37534 10.7667 9.375 11.29C9.375 11.8137 9.79969 12.239 10.3232 12.2393C10.847 12.2393 11.2725 11.8138 11.2725 11.29C11.2721 10.7666 10.8468 10.3418 10.3232 10.3418ZM12.4326 11.291C12.4326 11.3549 12.4284 11.418 12.4229 11.4805C12.4287 11.4181 12.4326 11.355 12.4326 11.291ZM8.21484 11.2832C8.21484 11.2856 8.21484 11.2886 8.21484 11.291L8.21484 11.29C8.21484 11.2878 8.21484 11.2855 8.21484 11.2832ZM3.08301 4.59082C4.04605 4.59095 4.85696 5.23717 5.10938 6.11914L13.415 6.11914L13.415 7.2793L5.11035 7.2793C4.85833 8.16202 4.04648 8.80846 3.08301 8.80859C2.11972 8.80843 1.30963 8.16179 1.05762 7.2793L0 7.2793L0 6.11914L1.05762 6.11914C1.30994 5.23728 2.12006 4.59098 3.08301 4.59082ZM3.08301 5.75098C2.55962 5.75117 2.13512 6.17587 2.13477 6.69922C2.13477 7.22287 2.5594 7.64824 3.08301 7.64844C3.60665 7.64828 4.03223 7.2229 4.03223 6.69922C4.03187 6.17585 3.60643 5.75113 3.08301 5.75098ZM5.19238 6.69922C5.19238 6.763 5.18816 6.82633 5.18262 6.88867C5.18846 6.82629 5.19238 6.76313 5.19238 6.69922C5.19236 6.63495 5.18853 6.57152 5.18262 6.50879C5.18826 6.57154 5.19236 6.635 5.19238 6.69922ZM0.982422 6.52344C0.977382 6.58136 0.97463 6.63999 0.974609 6.69922C0.974609 6.75775 0.977496 6.81579 0.982422 6.87305C0.977758 6.81579 0.974609 6.75767 0.974609 6.69922C0.974628 6.64 0.977618 6.58142 0.982422 6.52344ZM10.3232 0C11.2869 0 12.0986 0.646596 12.3506 1.5293L13.415 1.5293L13.415 2.68945L12.3496 2.68945C12.363 2.64266 12.3754 2.59488 12.3857 2.54688C12.1838 3.50118 11.3376 4.21777 10.3232 4.21777C9.36037 4.21756 8.55018 3.57139 8.29785 2.68945L0 2.68945L0 1.5293L8.29688 1.5293C8.5487 0.646717 9.35981 0.00021854 10.3232 0ZM10.3232 1.16016C9.79984 1.16042 9.37524 1.58499 9.375 2.1084C9.375 2.63201 9.79969 3.05735 10.3232 3.05762C10.847 3.05762 11.2725 2.63217 11.2725 2.1084C11.2722 1.58483 10.8469 1.16016 10.3232 1.16016ZM12.4229 2.29883C12.4287 2.23641 12.4326 2.17331 12.4326 2.10938C12.4326 2.17327 12.4284 2.23638 12.4229 2.29883ZM8.21484 2.10938L8.21484 2.1084L8.21484 2.10938ZM8.22266 1.93359C8.21785 1.98897 8.21506 2.04499 8.21484 2.10156C8.21503 2.04501 8.2181 1.98902 8.22266 1.93359ZM8.22266 11.1162C8.2179 11.1713 8.21507 11.227 8.21484 11.2832C8.21504 11.227 8.21814 11.1713 8.22266 11.1162Z`,fill:`currentColor`})}),ot=({size:e=16,className:t})=>(0,W.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,children:[(0,W.jsx)(`path`,{transform:`translate(9.52 2.52)`,d:`M3.55246 0L3.55246 2.44252L6 2.44252L6 3.55748L3.55246 3.55748L3.55246 6L2.43834 6L2.43834 3.55748L0 3.55748L0 2.44252L2.43834 2.44252L2.43834 0L3.55246 0Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{transform:`translate(0.3496 2.35)`,d:`M4.76367 0C5.36861 1.80598e-05 5.93113 0.310294 6.25488 0.821289L6.78027 1.64941C6.79685 1.67558 6.81791 1.69775 6.83887 1.71973C6.72186 2.15521 6.65702 2.61192 6.65137 3.08301C6.25601 2.96045 5.90909 2.70478 5.68164 2.3457L5.15723 1.5166C5.07183 1.38189 4.92318 1.3008 4.76367 1.30078L2.32422 1.30078C1.7589 1.30078 1.30078 1.7589 1.30078 2.32422L1.30078 10.1338C1.30078 10.6991 1.7589 11.1572 2.32422 11.1572L11.9766 11.1572C12.5419 11.1572 13 10.6991 13 10.1338L13 8.58398C13.4545 8.5135 13.8903 8.38748 14.3008 8.21289L14.3008 10.1338C14.3008 11.4171 13.2598 12.458 11.9766 12.458L2.32422 12.458C1.04093 12.458 0 11.4171 0 10.1338L0 2.32422C0 1.04093 1.04093 0 2.32422 0L4.76367 0Z`,fill:`currentColor`})]}),st=({size:e=16,className:t})=>(0,W.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,children:[(0,W.jsx)(`path`,{d:`M5.19629 1.57104C5.81144 1.5711 6.38623 1.8786 6.72754 2.39038L7.19922 3.09839C7.28454 3.22635 7.42824 3.30344 7.58203 3.30347H12.1699C13.5039 3.30348 14.5859 4.38548 14.5859 5.71948V6.62671C15.2694 7.02689 15.6605 7.85012 15.4385 8.68726L14.3848 12.658C14.1037 13.7164 13.1449 14.4527 12.0498 14.4529H2.91699C1.51651 14.4529 0.451662 13.2814 0.501954 11.9519V3.98706C0.501954 2.65305 1.58396 1.57104 2.91797 1.57104H5.19629ZM3.7793 7.75562C3.30994 7.75562 2.89883 8.07153 2.77832 8.52515L1.91602 11.7722C1.74167 12.4291 2.23734 13.073 2.91699 13.073H12.0498C12.5191 13.0728 12.9304 12.757 13.0508 12.3035L14.1045 8.33374C14.1819 8.04202 13.9619 7.756 13.6602 7.75562H3.7793ZM2.91797 2.9519C2.34625 2.9519 1.88281 3.41534 1.88281 3.98706V7.2937C2.33068 6.7269 3.02249 6.37476 3.7793 6.37476H13.2051V5.71948C13.2051 5.14777 12.7416 4.68434 12.1699 4.68433H7.58203C6.96675 4.6843 6.39209 4.37595 6.05078 3.86401L5.5791 3.15601C5.49379 3.02821 5.34995 2.95196 5.19629 2.9519H2.91797Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{opacity:`0.2`,d:`M13.6602 7.75525C13.9618 7.7556 14.1815 8.04179 14.1045 8.33337L13.0508 12.3031C12.9304 12.7567 12.5191 13.0725 12.0498 13.0726H2.91701C2.23744 13.0725 1.7417 12.4287 1.91603 11.7719L2.77834 8.52478C2.89898 8.07146 3.31018 7.75532 3.77931 7.75525H13.6602ZM5.1963 2.95154C5.34985 2.95159 5.49377 3.02803 5.57912 3.15564L6.0508 3.86365C6.39205 4.37553 6.96685 4.68385 7.58205 4.68396H12.1699C12.7416 4.68396 13.2049 5.14754 13.2051 5.71912V6.37439H3.77931C3.02267 6.37444 2.33067 6.72671 1.88283 7.29333V3.98669C1.88299 3.4152 2.34649 2.95168 2.91798 2.95154H5.1963Z`,fill:`currentColor`})]}),ct=({size:e=16,className:t})=>(0,W.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,children:(0,W.jsx)(`path`,{transform:`translate(1.5 2.429)`,d:`M5.05582 0.518756L4.50669 0.86654L5.05582 0.518756ZM13 9.4837L13.65 9.4837L13.65 3.53962L13 3.53962L12.35 3.53962L12.35 9.4837L13 9.4837ZM11.3264 1.86603L11.3264 1.21603L6.52313 1.21603L6.52313 1.86603L6.52313 2.51603L11.3264 2.51603L11.3264 1.86603ZM5.58054 1.34727L6.12968 0.999489L5.60495 0.170972L5.05582 0.518756L4.50669 0.86654L5.03141 1.69506L5.58054 1.34727ZM4.11323 1.23058e-13L4.11323 -0.65L1.67359 -0.65L1.67359 5.00699e-14L1.67359 0.65L4.11323 0.65L4.11323 1.23058e-13ZM0 1.67359L-0.65 1.67359L-0.65 9.4837L0 9.4837L0.65 9.4837L0.65 1.67359L0 1.67359ZM11.3264 11.1573L11.3264 10.5073L1.67359 10.5073L1.67359 11.1573L1.67359 11.8073L11.3264 11.8073L11.3264 11.1573ZM0 9.4837L-0.65 9.4837C-0.65 10.767 0.390308 11.8073 1.67359 11.8073L1.67359 11.1573L1.67359 10.5073C1.10828 10.5073 0.65 10.049 0.65 9.4837L0 9.4837ZM1.67359 5.00699e-14L1.67359 -0.65C0.390307 -0.65 -0.65 0.390309 -0.65 1.67359L0 1.67359L0.65 1.67359C0.65 1.10828 1.10828 0.65 1.67359 0.65L1.67359 5.00699e-14ZM5.05582 0.518756L5.60495 0.170972C5.28121 -0.340193 4.71829 -0.65 4.11323 -0.65L4.11323 1.23058e-13L4.11323 0.65C4.27282 0.65 4.4213 0.731715 4.50669 0.86654L5.05582 0.518756ZM6.52313 1.86603L6.52313 1.21603C6.36354 1.21603 6.21507 1.13431 6.12968 0.999489L5.58054 1.34727L5.03141 1.69506C5.35515 2.20622 5.91808 2.51603 6.52313 2.51603L6.52313 1.86603ZM13 3.53962L13.65 3.53962C13.65 2.25634 12.6097 1.21603 11.3264 1.21603L11.3264 1.86603L11.3264 2.51603C11.8917 2.51603 12.35 2.97431 12.35 3.53962L13 3.53962ZM13 9.4837L12.35 9.4837C12.35 10.049 11.8917 10.5073 11.3264 10.5073L11.3264 11.1573L11.3264 11.8073C12.6097 11.8073 13.65 10.767 13.65 9.4837L13 9.4837Z`,fill:`currentColor`})}),lt=({size:e=16,className:t})=>(0,W.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,W.jsx)(`path`,{d:`M11.3496 8C11.3496 6.14985 9.85015 4.65039 8 4.65039C6.14985 4.65039 4.65039 6.14985 4.65039 8C4.65039 9.85015 6.14985 11.3496 8 11.3496C9.85015 11.3496 11.3496 9.85015 11.3496 8ZM12.6504 8C12.6504 10.5681 10.5681 12.6504 8 12.6504C5.43188 12.6504 3.34961 10.5681 3.34961 8C3.34961 5.43188 5.43188 3.34961 8 3.34961C10.5681 3.34961 12.6504 5.43188 12.6504 8Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M8.65039 0.5V2.5H7.34961V0.5H8.65039Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M8.65039 13.5V15.5H7.34961V13.5H8.65039Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M3.15808 2.24035L4.57229 3.65456L3.6525 4.57435L2.23829 3.16014L3.15808 2.24035Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M12.3505 11.4327L13.7647 12.8469L12.8449 13.7667L11.4307 12.3525L12.3505 11.4327Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M2.24537 12.8469L3.65958 11.4327L4.57937 12.3525L3.16516 13.7667L2.24537 12.8469Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M11.4377 3.65455L12.852 2.24033L13.7718 3.16012L12.3575 4.57434L11.4377 3.65455Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M0.5 7.35461H2.5V8.6554H0.5L0.5 7.35461Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M13.5 7.35461H15.5V8.6554H13.5V7.35461Z`,fill:`currentColor`})]}),ut=({size:e=16,className:t})=>(0,W.jsx)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,W.jsx)(`path`,{d:`M13.2764 9.52324C12.5607 9.97754 11.7177 10.242 10.7812 10.242C8.11386 10.2419 5.95042 8.07997 5.9502 5.41289C5.9502 4.48128 6.21453 3.61071 6.67188 2.87285C4.30332 3.4658 2.54992 5.60845 2.5498 8.16093C2.5498 11.1712 4.99103 13.6102 8 13.6102C10.5383 13.6102 12.6709 11.8724 13.2764 9.52324ZM7.05078 5.41289C7.051 7.47224 8.72116 9.1423 10.7812 9.14238C11.9248 9.14238 12.887 8.63397 13.5781 7.8084C13.7266 7.63106 13.9701 7.56547 14.1875 7.64433C14.4049 7.72329 14.5497 7.9297 14.5498 8.16093C14.5498 11.7766 11.6161 14.7098 8 14.7098C4.38402 14.7098 1.4502 11.7792 1.4502 8.16093C1.45033 4.54322 4.3812 1.61015 8 1.61015C8.23027 1.61015 8.43585 1.75352 8.51562 1.96953C8.59536 2.18554 8.53241 2.42829 8.35742 2.57793C7.55573 3.26311 7.05078 4.27876 7.05078 5.41289Z`,fill:`currentColor`})}),dt=({size:e=16,className:t})=>(0,W.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,W.jsx)(`path`,{d:`M12.1665 13.5811V14.7803H3.66651V13.5811H12.1665Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M13.4453 7.02379C13.4453 6.04702 13.4452 5.3616 13.3887 4.83434C13.3333 4.31828 13.2302 4.02378 13.0723 3.80309C12.9446 3.62475 12.7877 3.46883 12.6094 3.34117C12.3887 3.18328 12.0942 3.08007 11.5781 3.02477C11.0508 2.96829 10.3655 2.96715 9.38867 2.96715H6.61035C5.63359 2.96715 4.94816 2.96827 4.4209 3.02477C3.90486 3.0801 3.61034 3.18321 3.38965 3.34117C3.21143 3.46878 3.05534 3.62487 2.92774 3.80309C2.76977 4.02377 2.66667 4.3183 2.61133 4.83434C2.55483 5.3616 2.55371 6.04702 2.55371 7.02379C2.55371 8.0006 2.55485 8.68596 2.61133 9.21324C2.66663 9.72936 2.76983 10.0238 2.92774 10.2445C3.0554 10.4228 3.21131 10.5797 3.38965 10.7074C3.61034 10.8654 3.90484 10.9685 4.4209 11.0238C4.94816 11.0803 5.63359 11.0804 6.61035 11.0804H9.38867C10.3654 11.0804 11.0508 11.0803 11.5781 11.0238C12.0941 10.9685 12.3887 10.8652 12.6094 10.7074C12.7877 10.5797 12.9446 10.4229 13.0723 10.2445C13.2301 10.0238 13.3334 9.72927 13.3887 9.21324C13.4452 8.68596 13.4453 8.00058 13.4453 7.02379ZM14.6455 7.02379C14.6455 7.97428 14.646 8.73509 14.5811 9.34117C14.5149 9.95828 14.3756 10.4858 14.0479 10.9437C13.8436 11.229 13.5938 11.4788 13.3086 11.683C12.8507 12.0108 12.3232 12.15 11.7061 12.2162C11.1 12.2811 10.3391 12.2806 9.38867 12.2806H6.61035C5.66018 12.2806 4.89991 12.2811 4.29395 12.2162C3.67684 12.15 3.14935 12.0108 2.69141 11.683C2.40613 11.4788 2.15639 11.229 1.95215 10.9437C1.62436 10.4858 1.4841 9.95828 1.41797 9.34117C1.35305 8.73511 1.35449 7.97424 1.35449 7.02379C1.35449 6.07366 1.35308 5.31333 1.41797 4.70738C1.4841 4.09028 1.62436 3.56279 1.95215 3.10485C2.15638 2.81956 2.40613 2.56982 2.69141 2.36559C3.14935 2.03779 3.67684 1.89753 4.29395 1.83141C4.8999 1.76652 5.66022 1.76793 6.61035 1.76793H9.38867C10.3391 1.76793 11.1 1.76649 11.7061 1.83141C12.3232 1.89753 12.8507 2.03779 13.3086 2.36559C13.5939 2.56982 13.8436 2.81957 14.0479 3.10485C14.3756 3.56279 14.5149 4.09028 14.5811 4.70738C14.646 5.31335 14.6455 6.07362 14.6455 7.02379Z`,fill:`currentColor`})]}),ft=({size:e=16,className:t})=>(0,W.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.0997 8.54554C12.2905 8.54989 12.3541 8.58056 12.4535 8.74614L12.8849 9.46387C12.9851 9.63071 13.0464 9.66013 13.2388 9.66447H14.1138C14.3417 9.66448 14.3512 9.66937 14.4686 9.86507L14.892 10.5717C14.9942 10.7422 14.9948 10.8247 14.892 10.9961L14.4756 11.6906C14.3741 11.8677 14.3694 11.9379 14.4756 12.115L14.892 12.8096C14.9942 12.9801 14.9947 13.0625 14.892 13.234L14.4686 13.9406C14.3643 14.1028 14.3063 14.1354 14.1138 14.1412H13.2388C13.0465 14.1456 12.985 14.1752 12.8849 14.3418L12.4535 15.0595C12.353 15.2195 12.2895 15.2558 12.0997 15.2601H11.2237C10.9962 15.2601 10.9871 15.2548 10.8699 15.0595L10.4384 14.3418C10.3383 14.175 10.2767 14.1456 10.0846 14.1412H9.2096C9.01854 14.1355 8.95761 14.1006 8.85477 13.9406L8.43139 13.234C8.32562 13.0576 8.33148 12.9862 8.43139 12.8096L8.84771 12.115C8.95165 11.9416 8.94659 11.863 8.84771 11.6906L8.43139 10.9961C8.32767 10.8232 8.33411 10.7437 8.43139 10.5717L8.85477 9.86507C8.95447 9.69891 9.01875 9.67017 9.2096 9.66447H10.0846C10.2741 9.66441 10.3414 9.62547 10.4384 9.46387L10.8699 8.74614C10.987 8.55106 10.9963 8.54554 11.2237 8.54554H12.0997ZM11.6612 10.232C11.3326 10.7798 10.8155 11.0948 10.1743 11.106C10.4443 11.61 10.4425 12.1976 10.1743 12.6987C10.803 12.7096 11.3391 13.0359 11.6612 13.5727C11.9855 13.0323 12.5131 12.7098 13.148 12.6987C12.879 12.196 12.8789 11.6086 13.148 11.106C12.5076 11.0948 11.9894 10.7794 11.6612 10.232Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7.51205 0.790627C9.19055 0.790649 10.7401 1.0691 11.892 1.54364C12.4664 1.78029 12.9719 2.07885 13.3436 2.4408C13.7171 2.80467 13.9916 3.27253 13.9918 3.82384V7.90442C13.6067 7.69532 13.1907 7.53597 12.7529 7.43366V5.66454C12.4928 5.82898 12.2028 5.97601 11.892 6.10405C10.74 6.57865 9.19071 6.85706 7.51205 6.85706C5.8337 6.85703 4.285 6.57852 3.13309 6.10405C2.82215 5.97593 2.53164 5.8291 2.27121 5.66454V7.4135C2.27134 7.75678 2.6066 8.27106 3.62502 8.73405C4.58641 9.17097 5.95762 9.45591 7.50499 9.45681C7.24582 9.83133 7.03684 10.2434 6.88706 10.6826C5.44388 10.6162 4.12516 10.3216 3.11192 9.86104C2.81708 9.72698 2.53185 9.56866 2.27121 9.38928V11.2542C2.27158 11.5974 2.60697 12.1109 3.62502 12.5737C4.41933 12.9347 5.4937 13.1898 6.71569 13.2693C6.80349 13.7128 6.9513 14.1345 7.14814 14.5273C5.60324 14.4862 4.18593 14.1889 3.11192 13.7007C2.01039 13.1998 1.03366 12.3814 1.03333 11.2542V3.82384C1.03352 3.27273 1.30721 2.80461 1.68049 2.4408C2.05211 2.07893 2.55887 1.78026 3.13309 1.54364C4.28492 1.06926 5.83393 0.790683 7.51205 0.790627ZM7.51205 2.02851C5.95492 2.02857 4.57354 2.29079 3.60486 2.68979C3.11958 2.88977 2.76667 3.11253 2.5454 3.32788C2.32671 3.54101 2.2714 3.7089 2.27121 3.82384C2.27121 3.93882 2.32624 4.10625 2.5454 4.3198C2.76667 4.53527 3.11927 4.75781 3.60486 4.9579C4.5736 5.35699 5.95467 5.61914 7.51205 5.61918C9.06942 5.61918 10.4505 5.35695 11.4192 4.9579C11.9051 4.75773 12.2584 4.53536 12.4797 4.3198C12.6988 4.10627 12.7529 3.93882 12.7529 3.82384C12.7527 3.70889 12.6984 3.54104 12.4797 3.32788C12.2584 3.11239 11.9049 2.88989 11.4192 2.68979C10.4505 2.29079 9.06925 2.02853 7.51205 2.02851Z`,fill:`currentColor`})]}),pt=({size:e=16,className:t})=>(0,W.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,W.jsx)(`ellipse`,{cx:`8`,cy:`3.6`,rx:`5.75`,ry:`2.4`,stroke:`currentColor`,strokeWidth:`1.25`}),(0,W.jsx)(`path`,{d:`M2.25 3.6V12.3A5.75 2.4 0 0 0 13.75 12.3V3.6`,stroke:`currentColor`,strokeWidth:`1.25`}),(0,W.jsx)(`path`,{d:`M2.25 7.95A5.75 2.4 0 0 0 13.75 7.95`,stroke:`currentColor`,strokeWidth:`1.25`})]}),mt=({size:e=16,className:t})=>(0,W.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,W.jsx)(`path`,{d:`M12.5113 15.4067C12.4395 15.6249 12.1308 15.6249 12.059 15.4067L11.643 14.1416C11.454 13.567 11.0033 13.1164 10.4288 12.9274L9.16369 12.5113C8.94544 12.4395 8.94544 12.1308 9.16369 12.059L10.4288 11.643C11.0033 11.454 11.454 11.0033 11.643 10.4288L12.059 9.16369C12.1308 8.94544 12.4395 8.94544 12.5113 9.16369L12.9274 10.4288C13.1164 11.0033 13.567 11.454 14.1416 11.643L15.4067 12.059C15.6249 12.1308 15.6249 12.4395 15.4067 12.5113L14.1416 12.9274C13.567 13.1164 13.1164 13.567 12.9274 14.1416L12.5113 15.4067Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M9.02246 0.546878C9.9822 0.546878 10.7564 0.545403 11.374 0.612307C12.0042 0.680586 12.5515 0.826244 13.0273 1.17188C13.3052 1.37376 13.5501 1.61868 13.752 1.89649C14.0975 2.37225 14.2432 2.91984 14.3115 3.54981C14.3784 4.16727 14.377 4.94206 14.377 5.90137V8.51367C13.9611 8.29533 13.5071 8.13985 13.0273 8.06055V5.90137C13.0273 4.9121 13.0259 4.22322 12.9688 3.69532C12.9129 3.18044 12.8098 2.89782 12.6592 2.69043C12.5406 2.52724 12.3966 2.38326 12.2334 2.26465C12.026 2.11404 11.7437 2.0109 11.2285 1.95508C10.7005 1.89789 10.0122 1.89649 9.02246 1.89649H6.55371C5.56395 1.89649 4.87569 1.89787 4.34766 1.95508C3.83242 2.01092 3.55022 2.11398 3.34278 2.26465C3.17953 2.38329 3.03564 2.52719 2.91699 2.69043C2.76642 2.89782 2.66325 3.18042 2.60742 3.69532C2.55027 4.22322 2.54883 4.9121 2.54883 5.90137V10.0986C2.54883 11.0878 2.55031 11.7768 2.60742 12.3047C2.66326 12.8196 2.76642 13.1032 2.91699 13.3105C3.03558 13.4736 3.17966 13.6178 3.34278 13.7363C3.5502 13.8869 3.83265 13.9901 4.34766 14.0459C4.87568 14.1031 5.56398 14.1035 6.55371 14.1035H8.08399C8.27443 14.6025 8.55077 15.0585 8.89551 15.4541H6.55371C5.59402 15.4541 4.81976 15.4546 4.20215 15.3877C3.57204 15.3194 3.02468 15.1738 2.54883 14.8281C2.27111 14.6263 2.02606 14.3813 1.82422 14.1035C1.47883 13.6278 1.33293 13.08 1.26465 12.4502C1.19783 11.8327 1.19922 11.0579 1.19922 10.0986V5.90137C1.19922 4.94206 1.1978 4.16727 1.26465 3.54981C1.33295 2.91984 1.47867 2.37225 1.82422 1.89649C2.02613 1.61864 2.27098 1.37379 2.54883 1.17188C3.02472 0.826181 3.57197 0.6806 4.20215 0.612307C4.81976 0.545393 5.594 0.546877 6.55371 0.546878H9.02246ZM9.19629 9.14649H4.5459V7.84571H9.19629V9.14649ZM11.0303 6.10645H4.5459V4.80567H11.0303V6.10645Z`,fill:`currentColor`})]}),ht=({size:e=14,className:t})=>(0,W.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,W.jsx)(`path`,{d:`M12.5757 7.00012C12.5757 3.92085 10.0794 1.42463 7.00012 1.42456C3.9208 1.42456 1.42456 3.9208 1.42456 7.00012C1.42463 10.0794 3.92085 12.5757 7.00012 12.5757C10.0793 12.5756 12.5756 10.0793 12.5757 7.00012ZM13.8002 7.00012C13.8001 10.7559 10.7559 13.8001 7.00012 13.8002C3.2443 13.8002 0.199291 10.7559 0.199219 7.00012C0.199219 3.24426 3.24426 0.199219 7.00012 0.199219C10.7559 0.199291 13.8002 3.2443 13.8002 7.00012Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M6.18042 8.68184C6.18043 8.09153 6.32893 7.34655 6.92127 6.8481C7.28566 6.54148 7.76104 6.27318 8.0022 6.10811C8.28964 5.91137 8.42234 5.76562 8.48328 5.58944C8.57774 5.31609 8.53121 5.00904 8.34912 4.76741C8.17409 4.53522 7.83879 4.32222 7.28186 4.32222C5.99668 4.32225 5.46969 5.11832 5.46949 5.78939H4.24414C4.24436 4.39942 5.36327 3.09691 7.28186 3.09688C8.17773 3.09688 8.89489 3.45606 9.32752 4.02999C9.75287 4.59438 9.86938 5.32775 9.64026 5.99019C9.44847 6.5444 9.04722 6.87743 8.69434 7.11898C8.29506 7.39226 8.02318 7.52192 7.70996 7.78548C7.51943 7.94582 7.40577 8.24899 7.40577 8.68184V8.75533H6.18042V8.68184Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M7.39455 9.44026V10.8109H6.16921V9.44026H7.39455Z`,fill:`currentColor`})]}),gt=({size:e=20,className:t})=>(0,W.jsxs)(`svg`,{width:e,height:e,className:t,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M15.8659 2.05975C17.2603 2.05995 18.3913 3.19096 18.3914 4.58527V5.4874C18.3914 6.02747 18.2192 6.52672 17.9303 6.93735C17.9336 6.96524 17.9388 6.99318 17.9388 7.02195V12.8884C17.9388 13.6345 17.9395 14.2379 17.8996 14.7254C17.8642 15.1593 17.7936 15.5499 17.6373 15.9141L17.5654 16.0685C17.278 16.6328 16.8405 17.1046 16.3038 17.434L16.0679 17.5661C15.66 17.7739 15.2196 17.8598 14.7237 17.9003C14.2362 17.9401 13.6327 17.9405 12.8867 17.9405H7.11122C6.36511 17.9405 5.76171 17.9401 5.27418 17.9003C4.84051 17.8649 4.44949 17.7952 4.08545 17.6391L3.93104 17.5661C3.36673 17.2785 2.89392 16.8414 2.56465 16.3044L2.43245 16.0685C2.22473 15.6608 2.13878 15.2211 2.09825 14.7254C2.05841 14.2379 2.05912 13.6345 2.05912 12.8884V7.02195C2.05912 6.99284 2.06422 6.96449 2.06758 6.93629C1.77931 6.52592 1.60858 6.02687 1.60858 5.4874V4.58527C1.60876 3.19084 2.73962 2.05975 4.1341 2.05975H15.8659ZM16.4984 7.92936C16.296 7.98169 16.0847 8.01288 15.8659 8.01291H4.1341C3.91478 8.01291 3.70246 7.98194 3.49955 7.92936V12.8884C3.49955 13.6582 3.50053 14.1927 3.53445 14.608C3.56769 15.0146 3.62923 15.244 3.71635 15.415L3.7925 15.5514C3.98339 15.8627 4.25749 16.1165 4.58464 16.2833L4.72529 16.3435C4.88095 16.3993 5.08638 16.4402 5.39158 16.4651C5.80685 16.4991 6.34138 16.5001 7.11122 16.5001H12.8867C13.6564 16.5001 14.1911 16.499 14.6063 16.4651C15.0128 16.432 15.2423 16.3703 15.4133 16.2833L15.5508 16.2061C15.8618 16.0152 16.116 15.7419 16.2827 15.415L16.3429 15.2732C16.3985 15.1177 16.4396 14.9128 16.4645 14.608C16.4985 14.1927 16.4984 13.6583 16.4984 12.8884V7.92936ZM4.1341 3.50019C3.53511 3.50019 3.0492 3.98631 3.04902 4.58527V5.4874C3.04902 6.08649 3.535 6.57248 4.1341 6.57248H15.8659C16.4648 6.57228 16.951 6.08638 16.951 5.4874V4.58527C16.9509 3.98644 16.4647 3.50038 15.8659 3.50019H4.1341Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M12.7962 12.5661V11.0832H7.20548V12.5661L12.7962 12.5661Z`,fill:`currentColor`})]}),_t=o(),vt={viewport:`_viewport_1agok_1`,toast:`_toast_1agok_14`,"toast-in":`_toast-in_1agok_1`,body:`_body_1agok_30`,message:`_message_1agok_31`,detail:`_detail_1agok_32`,action:`_action_1agok_35`,close:`_close_1agok_37`,"toast-in-up":`_toast-in-up_1agok_1`},yt=4e3,bt=8e3,xt=[],St=new Set,Ct=new Map,wt=0;function Tt(e){xt=e;for(let e of St)e()}function Et(e){let t=e.key??`toast-${++wt}`,n={key:t,tone:e.tone??`error`,message:e.message,detail:e.detail,detailLabel:e.detailLabel,action:e.action};return Tt([...xt.filter(e=>e.key!==t),n].slice(-4)),Dt(t),Ot(t),t}function Dt(e){clearTimeout(Ct.get(e)),Ct.delete(e)}function Ot(e){let t=xt.find(t=>t.key===e);t&&!t.action&&Ct.set(e,setTimeout(()=>kt(e),t.tone===`info`?yt:bt))}function kt(e){Dt(e),xt.some(t=>t.key===e)&&Tt(xt.filter(t=>t.key!==e))}function At(e,t,n,r){(0,B.useEffect)(()=>{t&&Et({key:e,message:t,detail:n&&n!==t?n:void 0,detailLabel:r})},[e,t,n,r])}var jt=e=>(St.add(e),()=>{St.delete(e)}),Mt=()=>xt;function Nt({closeLabel:e=`Dismiss`,detailLabel:t=`Details`}){let n=(0,B.useSyncExternalStore)(jt,Mt,Mt);return typeof document>`u`?null:(0,_t.createPortal)((0,W.jsx)(`div`,{className:vt.viewport,"data-toast-viewport":!0,children:n.map(n=>(0,W.jsxs)(`div`,{className:vt.toast,"data-tone":n.tone,role:n.tone===`error`?`alert`:`status`,onMouseEnter:()=>Dt(n.key),onMouseLeave:()=>Ot(n.key),children:[(0,W.jsxs)(`div`,{className:vt.body,children:[(0,W.jsx)(`p`,{className:vt.message,children:n.message}),n.detail&&(0,W.jsxs)(`details`,{className:vt.detail,children:[(0,W.jsx)(`summary`,{children:n.detailLabel??t}),(0,W.jsx)(`pre`,{children:n.detail})]}),n.action&&(0,W.jsx)(`button`,{type:`button`,className:vt.action,onClick:()=>{kt(n.key),n.action.onClick()},children:n.action.label})]}),(0,W.jsx)(`button`,{type:`button`,className:vt.close,"aria-label":e,onClick:()=>kt(n.key),children:`×`})]},n.key))}),document.body)}var Pt={root:`_root_1axg2_9`,collapsed:`_collapsed_1axg2_6`,quietBars:`_quietBars_1axg2_20`,fading:`_fading_1axg2_4`,wide:`_wide_1axg2_53`,"wide-in":`_wide-in_1axg2_1`,railIn:`_railIn_1axg2_64`,iconButton:`_iconButton_1axg2_66`,newSession:`_newSession_1axg2_67`,panelList:`_panelList_1axg2_68`,regionArea:`_regionArea_1axg2_69`,"rail-in":`_rail-in_1axg2_1`,footArea:`_footArea_1axg2_73`,"rail-fade-in":`_rail-fade-in_1axg2_1`,logoRow:`_logoRow_1axg2_91`,brand:`_brand_1axg2_115`,brandIdentity:`_brandIdentity_1axg2_130`,brandMark:`_brandMark_1axg2_138`,brandName:`_brandName_1axg2_145`,fallbackBrandName:`_fallbackBrandName_1axg2_157`,localBuildBrand:`_localBuildBrand_1axg2_163`,localBuildTitle:`_localBuildTitle_1axg2_174`,toggle:`_toggle_1axg2_208`,panelIcon:`_panelIcon_1axg2_208`,railMark:`_railMark_1axg2_216`,buildVersion:`_buildVersion_1axg2_232`,newSessionLabel:`_newSessionLabel_1axg2_290`,panelRow:`_panelRow_1axg2_308`,panelActive:`_panelActive_1axg2_330`,panelGlyph:`_panelGlyph_1axg2_341`,panelTitle:`_panelTitle_1axg2_348`,settingsArea:`_settingsArea_1axg2_396`,footerActions:`_footerActions_1axg2_397`},Ft=150,It=2e3;function Lt({id:e,label:t,wide:n,usePanelInfo:r,selectPanel:i,renderSlot:a}){let o=r(t=>t.activePanelId===e);return(0,W.jsx)(Le,{label:t,delayMs:500,disabled:n,children:(0,W.jsxs)(`button`,{type:`button`,className:F(Pt.panelRow,o&&Pt.panelActive),"aria-label":t,"aria-current":o?`page`:void 0,onClick:()=>{i(e)},children:[(0,W.jsx)(`span`,{className:Pt.panelGlyph,"aria-hidden":`true`,children:a(`sidebar.panellist`,{size:n?16:18,active:o},{only:e})}),n&&(0,W.jsx)(`span`,{className:F(Pt.panelTitle,Pt.wide),children:t})]})})}function Rt({collapsed:e,width:t,startSession:n,sessionBusy:r=!1,toggleSidebar:i,selectPanel:a,usePanels:o,usePanelInfo:s,t:c,renderSlot:l}){let u=o(e=>e),[d,f]=(0,B.useState)(e);(0,B.useEffect)(()=>{if(!e){f(!1);return}let t=window.setTimeout(()=>{f(!0)},Ft);return()=>{window.clearTimeout(t)}},[e]);let p=!e||!d,m=(0,B.useRef)(t);e||(m.current=t);let h=(0,B.useRef)(!e);e||(h.current=!0);let g=(0,B.useRef)(null),[_,v]=(0,B.useState)(!1),y=(0,B.useRef)(void 0),b=()=>{y.current===void 0&&(y.current=window.setTimeout(()=>{y.current=void 0,v(!1)},It))},x=()=>{window.clearTimeout(y.current),y.current=void 0};return(0,B.useEffect)(()=>{if(!_)return;let e=e=>{let t=g.current?.getBoundingClientRect();t!==void 0&&(e.clientX>=t.left&&e.clientX<t.right&&e.clientY>=t.top&&e.clientY<t.bottom?x():b())};return document.addEventListener(`pointermove`,e),()=>{document.removeEventListener(`pointermove`,e),x()}},[_]),(0,W.jsxs)(`div`,{ref:g,className:F(Pt.root,!p&&Pt.collapsed,!p&&h.current&&Pt.railIn,e&&p&&Pt.fading,!_&&Pt.quietBars),style:p?{width:e?m.current:t}:void 0,onPointerEnter:()=>{x(),v(!0)},onPointerLeave:()=>{b()},children:[(0,W.jsxs)(`div`,{className:Pt.logoRow,children:[p&&(0,W.jsx)(`button`,{type:`button`,className:F(Pt.brand,Pt.wide),"aria-label":c(`session.new.label`),disabled:r,onClick:()=>{n()},children:(0,W.jsxs)(`span`,{className:Pt.brandIdentity,"aria-hidden":`true`,children:[(0,W.jsx)(`span`,{className:Pt.brandMark,children:l(`sidebar.brand.mark`,{size:24},{fallback:(0,W.jsx)(Fe,{size:24})})}),(0,W.jsx)(`span`,{className:Pt.brandName,children:l(`sidebar.brand.name`,{},{fallback:(0,W.jsx)(`span`,{className:Pt.fallbackBrandName,children:c(`brand.localBuild`)})})})]})}),(0,W.jsx)(Le,{label:c(e?`toggle.open`:`toggle.collapse`),delayMs:500,children:(0,W.jsxs)(`button`,{type:`button`,className:F(Pt.iconButton,Pt.toggle),"aria-label":c(e?`toggle.open`:`toggle.collapse`),"aria-expanded":!e,"data-sidebar-toggle":!0,onClick:()=>{i()},children:[!p&&(0,W.jsx)(`span`,{className:Pt.railMark,"aria-hidden":`true`,children:l(`sidebar.brand.mark`,{size:24},{fallback:(0,W.jsx)(Fe,{size:24})})}),(0,W.jsx)(Ge,{className:Pt.panelIcon,size:p?16:18})]})})]}),(0,W.jsx)(Le,{label:c(`session.new.label`),delayMs:500,disabled:p,children:(0,W.jsxs)(`button`,{type:`button`,className:Pt.newSession,"aria-label":c(`session.new.label`),disabled:r,onClick:()=>{n()},children:[(0,W.jsx)(Ve,{size:p?14:18}),p&&(0,W.jsx)(`span`,{className:F(Pt.newSessionLabel,Pt.wide),children:c(`session.new`)})]})}),u.length>0&&(0,W.jsx)(`nav`,{className:Pt.panelList,"aria-label":c(`panels.label`),children:u.map(({id:e,label:t})=>(0,W.jsx)(Lt,{id:e,label:t,wide:p,usePanelInfo:s,selectPanel:a,renderSlot:l},e))}),(0,W.jsx)(`div`,{className:Pt.regionArea,children:l(`sidebar.workspaces`,{wide:p,expandSidebar:()=>{e&&i()}})}),(0,W.jsxs)(`div`,{className:Pt.footArea,children:[(0,W.jsx)(`div`,{className:Pt.footerActions,children:l(`sidebar.footer.action`,{wide:p})}),(0,W.jsx)(`div`,{className:Pt.settingsArea,children:l(`sidebar.settings`,{wide:p})})]})]})}function zt(e,t){let n=e.replaceAll(`\\`,`/`).replace(/\/+$/,``),r=t.replaceAll(`\\`,`/`);if(/^(?:\/|[a-z]:\/)/i.test(r)){let e=/^[a-z]:\//i.test(n),i=`${n}/`;if(!(e?r.toLowerCase().startsWith(i.toLowerCase()):r.startsWith(i)))return t;r=r.slice(i.length)}let i=[];for(let e of r.split(`/`))if(e&&e!==`.`){if(e===`..`){if(!i.length)return t;i.pop()}else i.push(e)}return i.join(`/`)||t}var Bt={root:`_root_xhk35_5`,stack:`_stack_xhk35_15`,headline:`_headline_xhk35_29`,titleGroup:`_titleGroup_xhk35_51`,previewBadge:`_previewBadge_xhk35_62`,logoFrame:`_logoFrame_xhk35_77`,logo:`_logo_xhk35_77`,"logo-breathe":`_logo-breathe_xhk35_1`,body:`_body_xhk35_98`,workspaceRow:`_workspaceRow_xhk35_114`,workspace:`_workspace_xhk35_114`,folder:`_folder_xhk35_155`,workspaceLabel:`_workspaceLabel_xhk35_160`,chevron:`_chevron_xhk35_167`,modalInput:`_modalInput_xhk35_175`,modalAction:`_modalAction_xhk35_198`,modalError:`_modalError_xhk35_202`};function Vt({t:e,renderSlot:t,children:n}){return(0,W.jsxs)(`div`,{className:Bt.root,children:[(0,W.jsxs)(`div`,{className:Bt.stack,children:[(0,W.jsxs)(`div`,{className:Bt.headline,children:[(0,W.jsx)(`span`,{className:Bt.logoFrame,children:t(`conversation.hero.brand.mark`,{size:34,className:Bt.logo},{fallback:(0,W.jsx)(Fe,{size:34,className:Bt.logo})})}),(0,W.jsxs)(`span`,{className:Bt.titleGroup,children:[(0,W.jsx)(`span`,{children:e(`hero.headline`)}),(0,W.jsx)(`span`,{className:Bt.previewBadge,children:e(`hero.preview`)})]})]}),(0,W.jsx)(`div`,{className:Bt.body})]}),n]})}var Ht={root:`_root_orhlf_1`,heroTools:`_heroTools_orhlf_44`,header:`_header_orhlf_51`,headerHidden:`_headerHidden_orhlf_61`,titleRow:`_titleRow_orhlf_65`,titleCluster:`_titleCluster_orhlf_72`,crumbs:`_crumbs_orhlf_80`,crumbSeg:`_crumbSeg_orhlf_89`,crumbSep:`_crumbSep_orhlf_96`,crumb:`_crumb_orhlf_80`,crumbSubagent:`_crumbSubagent_orhlf_118`,crumbCurrent:`_crumbCurrent_orhlf_127`,headerActions:`_headerActions_orhlf_133`,headerUtilities:`_headerUtilities_orhlf_140`,headerCorner:`_headerCorner_orhlf_156`,tabs:`_tabs_orhlf_170`,tab:`_tab_orhlf_40`,tabActive:`_tabActive_orhlf_208`,viewArea:`_viewArea_orhlf_216`,widthHandle:`_widthHandle_orhlf_235`,composerStack:`_composerStack_orhlf_303`,composerSeat:`_composerSeat_orhlf_314`,body:`_body_orhlf_224`,scrollBody:`_scrollBody_orhlf_350`,composerHero:`_composerHero_orhlf_451`,heroWorkspaceRow:`_heroWorkspaceRow_orhlf_464`},Ut={root:`_root_1d5y2_2`,hero:`_hero_1d5y2_20`,notice:`_notice_1d5y2_27`,card:`_card_1d5y2_39`,cardWorkspaceTrigger:`_cardWorkspaceTrigger_1d5y2_79`,accessory:`_accessory_1d5y2_107`,overlayAnchor:`_overlayAnchor_1d5y2_116`,scroll:`_scroll_1d5y2_125`,grow:`_grow_1d5y2_143`,pending:`_pending_1d5y2_148`,"input-pending":`_input-pending_1d5y2_1`,input:`_input_1d5y2_128`,placeholder:`_placeholder_1d5y2_202`,inputDisabled:`_inputDisabled_1d5y2_221`,row:`_row_1d5y2_248`,tools:`_tools_1d5y2_266`,modes:`_modes_1d5y2_267`,trailing:`_trailing_1d5y2_268`,add:`_add_1d5y2_297`,select:`_select_1d5y2_322`,primary:`_primary_1d5y2_355`,retry:`_retry_1d5y2_385`,suspended:`_suspended_1d5y2_397`},Wt={root:`_root_14jhb_1`,scroll:`_scroll_14jhb_9`,column:`_column_14jhb_37`,flowItem:`_flowItem_14jhb_48`,callRow:`_callRow_14jhb_72`,turnStatus:`_turnStatus_14jhb_81`,"piw-turn-status-shimmer":`_piw-turn-status-shimmer_14jhb_1`,turnStatusClock:`_turnStatusClock_14jhb_113`,hint:`_hint_14jhb_138`,openError:`_openError_14jhb_144`,older:`_older_14jhb_150`,toBottomSlot:`_toBottomSlot_14jhb_173`,toBottom:`_toBottom_14jhb_173`,modalAction:`_modalAction_14jhb_220`},Gt={userRow:`_userRow_1dwc7_4`,userStack:`_userStack_1dwc7_11`,bubble:`_bubble_1dwc7_23`,referenceSummary:`_referenceSummary_1dwc7_43`,contextRow:`_contextRow_1dwc7_48`,compactionRow:`_compactionRow_1dwc7_55`,compactionButton:`_compactionButton_1dwc7_59`,compactionLeading:`_compactionLeading_1dwc7_82`,compactionContextIcon:`_compactionContextIcon_1dwc7_99`,compactionDisclosureIcon:`_compactionDisclosureIcon_1dwc7_100`,compactionTitle:`_compactionTitle_1dwc7_121`,compactionSep:`_compactionSep_1dwc7_128`,compactionSummary:`_compactionSummary_1dwc7_137`,compactionBody:`_compactionBody_1dwc7_148`,retryRow:`_retryRow_1dwc7_156`,retrySummary:`_retrySummary_1dwc7_162`,retryText:`_retryText_1dwc7_199`,"retry-shimmer":`_retry-shimmer_1dwc7_1`,retryDetails:`_retryDetails_1dwc7_224`,retryDetailLabel:`_retryDetailLabel_1dwc7_234`,turnErrorRow:`_turnErrorRow_1dwc7_238`,turnErrorDot:`_turnErrorDot_1dwc7_248`,turnErrorCopy:`_turnErrorCopy_1dwc7_252`,turnErrorTitle:`_turnErrorTitle_1dwc7_257`,turnErrorMessage:`_turnErrorMessage_1dwc7_263`,turnErrorCode:`_turnErrorCode_1dwc7_267`,maxTokensTitle:`_maxTokensTitle_1dwc7_272`,attachmentRow:`_attachmentRow_1dwc7_296`,fileCard:`_fileCard_1dwc7_304`,fileIcon:`_fileIcon_1dwc7_318`,fileContent:`_fileContent_1dwc7_324`,fileName:`_fileName_1dwc7_331`,fileMeta:`_fileMeta_1dwc7_341`},Kt=()=>D(()=>import(`./MarkdownText-Ca6_qCyr.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6])),qt=(0,B.lazy)(()=>Kt().then(e=>({default:e.MarkdownText})));function Jt(){let e=_e();return(0,B.useMemo)(()=>({code:{copyLabel:U(`复制`,`Copy`),copiedLabel:U(`已复制`,`Copied`),toolbarLabels:{codeLabel:U(`代码块`,`Code block`),wrapLabel:U(`自动换行`,`Wrap`),unwrapLabel:U(`取消换行`,`Unwrap`)}},footnotes:U(`脚注`,`Footnotes`)}),[e])}function Yt({text:e,streaming:t,labels:n,pathImages:r}){return(0,W.jsx)(B.Suspense,{fallback:(0,W.jsx)(`div`,{className:`pi-markdown-pending`,children:e}),children:(0,W.jsx)(qt,{text:e,streaming:t,labels:n,pathImages:r})})}var Xt=(0,B.memo)(function({text:e,streaming:t=!1}){let n=Jt();return(0,W.jsx)(`div`,{className:`pi-markdown`,children:(0,W.jsx)(Yt,{text:e,streaming:t,labels:n})})}),Zt={root:`_root_rf6yg_9`,row:`_row_rf6yg_16`,leading:`_leading_rf6yg_29`,iconIdle:`_iconIdle_rf6yg_57`,chevronHover:`_chevronHover_rf6yg_63`,title:`_title_rf6yg_79`};function Qt({icon:e,title:t,open:n,onToggle:r,collapsedContent:i,children:a,rowClassName:o,leadingClassName:s,titleClassName:c,chevronClassName:l}){return(0,W.jsxs)(`div`,{className:Zt.root,"data-open":n||void 0,children:[(0,W.jsxs)(`div`,{className:`${Zt.row} ${o??``}`,"data-disclosure-row":!0,"data-expandable":!0,role:`button`,tabIndex:0,"aria-expanded":n,onClick:r,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},children:[(0,W.jsx)(`span`,{className:`${Zt.leading} ${s??``}`,children:n?(0,W.jsx)(Ye,{className:l}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:Zt.iconIdle,children:e}),(0,W.jsx)(Ye,{className:`${Zt.chevronHover} ${l??``}`})]})}),(0,W.jsx)(`span`,{className:`${Zt.title} ${c??``}`,children:t}),!n&&i]}),n&&a]})}var $t={root:`_root_b8edg_1`,row:`_row_b8edg_11`,"piw-reasoning-row-sweep":`_piw-reasoning-row-sweep_b8edg_1`,leading:`_leading_b8edg_37`,chevron:`_chevron_b8edg_41`,title:`_title_b8edg_45`,separator:`_separator_b8edg_49`,summary:`_summary_b8edg_61`,summaryText:`_summaryText_b8edg_71`,thinkBody:`_thinkBody_b8edg_91`};function en({text:e,running:t}){let[n,r]=(0,B.useState)(!1),i=e.trimEnd(),a=(t?i.slice(i.lastIndexOf(`
11
- `)+1):e.split(`
12
- `,1)[0]).replaceAll(`**`,``);return(0,W.jsx)(`div`,{className:$t.root,"data-variant":`think`,"data-state":t?`running`:`ok`,"data-expanded":n||void 0,children:(0,W.jsx)(Qt,{icon:(0,W.jsx)(tt,{size:14}),title:U(`思考`,`Thinking`),open:n,onToggle:()=>r(e=>!e),rowClassName:$t.row,leadingClassName:$t.leading,titleClassName:$t.title,chevronClassName:$t.chevron,collapsedContent:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:$t.separator,"aria-hidden":!0}),(0,W.jsx)(`span`,{className:$t.summary,"data-follow-end":t||void 0,children:(0,W.jsx)(`span`,{className:$t.summaryText,children:a})})]}),children:(0,W.jsx)(`div`,{className:$t.thinkBody,children:e})})})}function tn(e){let t=Math.max(0,Math.floor(e)),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60),a=t%60;return n>0?`${n}d ${r}h ${i}m ${a}s`:r>0?`${r}h ${i}m ${a}s`:i>0?`${i}m ${a}s`:`${a}s`}var nn={root:`_root_l3xvn_1`,icon:`_icon_l3xvn_12`,"agent-activity-breathe":`_agent-activity-breathe_l3xvn_1`,core:`_core_l3xvn_25`,"agent-activity-breathe-core":`_agent-activity-breathe-core_l3xvn_1`,ripple:`_ripple_l3xvn_29`,"agent-activity-ripple":`_agent-activity-ripple_l3xvn_1`,rippleLate:`_rippleLate_l3xvn_34`,orbit:`_orbit_l3xvn_36`,"agent-activity-orbit":`_agent-activity-orbit_l3xvn_1`,copy:`_copy_l3xvn_42`};function rn({state:e,elapsedSeconds:t}){return(0,W.jsxs)(`div`,{className:nn.root,"data-agent-activity":e,children:[(0,W.jsx)(`span`,{className:nn.icon,"aria-hidden":`true`,children:(0,W.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,children:[(0,W.jsx)(`circle`,{className:nn.orbit,cx:`10`,cy:`10`,r:`9`,strokeWidth:`1`,strokeDasharray:`3.5 2.5`,strokeLinecap:`round`}),(0,W.jsx)(`circle`,{className:nn.ripple,cx:`10`,cy:`10`,r:`7.5`,strokeWidth:`1.25`}),(0,W.jsx)(`circle`,{className:`${nn.ripple} ${nn.rippleLate}`,cx:`10`,cy:`10`,r:`7.5`,strokeWidth:`1.25`}),(0,W.jsx)(`circle`,{className:nn.core,cx:`10`,cy:`10`,r:`4`,fill:`currentColor`,stroke:`none`})]})}),(0,W.jsxs)(`span`,{className:`${Wt.turnStatus} ${nn.copy}`,children:[(0,W.jsx)(`span`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:e===`sending`?U(`正在发送`,`Sending`):U(`正在处理`,`Working`)}),(0,W.jsx)(`span`,{"data-agent-elapsed":t,"aria-hidden":`true`,children:` · ${tn(t)}`})]})]})}function an(e,t,n,r){return!!e&&n===`connected`&&!e.interactions?.length&&!t?.error&&(r||!e.idle)}function on(e,t,n,r){return!an(e,t,n,r)||t?.blocks.some(e=>e.kind===`toolCall`||e.text.trim())?null:r?`sending`:`working`}function sn(e,t,n=0){let r=(0,B.useRef)(new Map),[i,a]=(0,B.useState)(null);return(0,B.useEffect)(()=>{if(!e||!t){t&&r.current.delete(t),a(null);return}let i=r.current.get(t),o=i?.activityId===n?i.started:performance.now();i?.activityId!==n&&r.current.set(t,{activityId:n,started:o});let s=()=>a({sessionId:t,activityId:n,seconds:Math.max(0,Math.floor((performance.now()-o)/1e3))});s();let c=window.setInterval(s,1e3);return()=>window.clearInterval(c)},[e,t,n]),e&&i&&i.sessionId===t&&i.activityId===n?i.seconds:0}var cn=t(n(((e,t)=>{var n=[[{color:`0, 0, 0`,class:`ansi-black`},{color:`187, 0, 0`,class:`ansi-red`},{color:`0, 187, 0`,class:`ansi-green`},{color:`187, 187, 0`,class:`ansi-yellow`},{color:`0, 0, 187`,class:`ansi-blue`},{color:`187, 0, 187`,class:`ansi-magenta`},{color:`0, 187, 187`,class:`ansi-cyan`},{color:`255,255,255`,class:`ansi-white`}],[{color:`85, 85, 85`,class:`ansi-bright-black`},{color:`255, 85, 85`,class:`ansi-bright-red`},{color:`0, 255, 0`,class:`ansi-bright-green`},{color:`255, 255, 85`,class:`ansi-bright-yellow`},{color:`85, 85, 255`,class:`ansi-bright-blue`},{color:`255, 85, 255`,class:`ansi-bright-magenta`},{color:`85, 255, 255`,class:`ansi-bright-cyan`},{color:`255, 255, 255`,class:`ansi-bright-white`}]],r=/(https?:\/\/(?:[A-Za-z0-9#;/?:@=+$',_.!~*()[\]-]|&amp;|%[A-Fa-f0-9]{2})+)/gm;t.exports=class e{static escapeForHtml(t){return new e().escapeForHtml(t)}static linkify(t){return new e().linkify(t)}static ansiToHtml(t,n){return new e().ansiToHtml(t,n)}static ansiToJson(t,n){return new e().ansiToJson(t,n)}static ansiToText(t){return new e().ansiToText(t)}constructor(){this.fg=this.bg=this.fg_truecolor=this.bg_truecolor=null,this.bright=0,this.decorations=[]}setupPalette(){this.PALETTE_COLORS=[];for(let e=0;e<2;++e)for(let t=0;t<8;++t)this.PALETTE_COLORS.push(n[e][t].color);let e=[0,95,135,175,215,255],t=(t,n,r)=>e[t]+`, `+e[n]+`, `+e[r];for(let e=0;e<6;++e)for(let n=0;n<6;++n)for(let r=0;r<6;++r)this.PALETTE_COLORS.push(t(e,n,r));let r=8;for(let e=0;e<24;++e,r+=10)this.PALETTE_COLORS.push(r+`, `+r+`, `+r)}escapeForHtml(e){return e.replace(/[&<>\"]/gm,e=>e==`&`?`&amp;`:e==`"`?`&quot;`:e==`<`?`&lt;`:e==`>`?`&gt;`:``)}linkify(e){return e.replace(r,e=>`<a href="${e}">${e}</a>`)}ansiToHtml(e,t){return this.process(e,t,!0)}ansiToJson(e,t){return t||={},t.json=!0,t.clearLine=!1,this.process(e,t,!0)}ansiToText(e){return this.process(e,{},!1)}process(e,t,n){let r=this,i=e.split(/\033\[/),a=i.shift();t??={},t.clearLine=/\r/.test(e);let o=i.map(e=>this.processChunk(e,t,n));if(t&&t.json){let e=r.processChunkJson(``);return e.content=a,e.clearLine=t.clearLine,o.unshift(e),t.remove_empty&&(o=o.filter(e=>!e.isEmpty())),o}return o.unshift(a),o.join(``)}processChunkJson(e,t,r){t=t===void 0?{}:t;let i=t.use_classes=t.use_classes!==void 0&&t.use_classes,a=t.key=i?`class`:`color`,o={content:e,fg:null,bg:null,fg_truecolor:null,bg_truecolor:null,isInverted:!1,clearLine:t.clearLine,decoration:null,decorations:[],was_processed:!1,isEmpty:()=>!o.content},s=e.match(/^([!\x3c-\x3f]*)([\d;]*)([\x20-\x2c]*[\x40-\x7e])([\s\S]*)/m);if(!s)return o;o.content=s[4];let c=s[2].split(`;`);if(s[1]!==``||s[3]!==`m`||!r)return o;let l=this;for(;c.length>0;){let e=c.shift(),t=parseInt(e);if(isNaN(t)||t===0)l.fg=l.bg=null,l.decorations=[];else if(t===1)l.decorations.push(`bold`);else if(t===2)l.decorations.push(`dim`);else if(t===3)l.decorations.push(`italic`);else if(t===4)l.decorations.push(`underline`);else if(t===5)l.decorations.push(`blink`);else if(t===7)l.decorations.push(`reverse`);else if(t===8)l.decorations.push(`hidden`);else if(t===9)l.decorations.push(`strikethrough`);else if(t===21)l.removeDecoration(`bold`);else if(t===22)l.removeDecoration(`bold`),l.removeDecoration(`dim`);else if(t===23)l.removeDecoration(`italic`);else if(t===24)l.removeDecoration(`underline`);else if(t===25)l.removeDecoration(`blink`);else if(t===27)l.removeDecoration(`reverse`);else if(t===28)l.removeDecoration(`hidden`);else if(t===29)l.removeDecoration(`strikethrough`);else if(t===39)l.fg=null;else if(t===49)l.bg=null;else if(t>=30&&t<38)l.fg=n[0][t%10][a];else if(t>=90&&t<98)l.fg=n[1][t%10][a];else if(t>=40&&t<48)l.bg=n[0][t%10][a];else if(t>=100&&t<108)l.bg=n[1][t%10][a];else if(t===38||t===48){let e=t===38;if(c.length>=1){let t=c.shift();if(t===`5`&&c.length>=1){let t=parseInt(c.shift());if(t>=0&&t<=255){if(!i)this.PALETTE_COLORS||l.setupPalette(),e?l.fg=this.PALETTE_COLORS[t]:l.bg=this.PALETTE_COLORS[t];else{let r=t>=16?`ansi-palette-`+t:n[+(t>7)][t%8].class;e?l.fg=r:l.bg=r}}}else if(t===`2`&&c.length>=3){let t=parseInt(c.shift()),n=parseInt(c.shift()),r=parseInt(c.shift());if(t>=0&&t<=255&&n>=0&&n<=255&&r>=0&&r<=255){let a=t+`, `+n+`, `+r;i?e?(l.fg=`ansi-truecolor`,l.fg_truecolor=a):(l.bg=`ansi-truecolor`,l.bg_truecolor=a):e?l.fg=a:l.bg=a}}}}}return l.fg===null&&l.bg===null&&l.decorations.length===0||(o.fg=l.fg,o.bg=l.bg,o.fg_truecolor=l.fg_truecolor,o.bg_truecolor=l.bg_truecolor,o.decorations=l.decorations,o.decoration=l.decorations.slice(-1).pop()||null,o.was_processed=!0),o}processChunk(e,t,r){t||={};let i=this.processChunkJson(e,t,r),a=t.use_classes;if(i.decorations=i.decorations.filter(e=>{if(e===`reverse`){i.fg||=n[0][7][a?`class`:`color`],i.bg||=n[0][0][a?`class`:`color`];let e=i.fg;i.fg=i.bg,i.bg=e;let t=i.fg_truecolor;return i.fg_truecolor=i.bg_truecolor,i.bg_truecolor=t,i.isInverted=!0,!1}return!0}),t.json)return i;if(i.isEmpty())return``;if(!i.was_processed)return i.content;let o=[],s=[],c=[],l={},u=e=>{let t=[],n;for(n in e)e.hasOwnProperty(n)&&t.push(`data-`+n+`="`+this.escapeForHtml(e[n])+`"`);return t.length>0?` `+t.join(` `):``};return i.isInverted&&(l[`ansi-is-inverted`]=`true`),i.fg&&(a?(o.push(i.fg+`-fg`),i.fg_truecolor!==null&&(l[`ansi-truecolor-fg`]=i.fg_truecolor,i.fg_truecolor=null)):o.push(`color:rgb(`+i.fg+`)`)),i.bg&&(a?(o.push(i.bg+`-bg`),i.bg_truecolor!==null&&(l[`ansi-truecolor-bg`]=i.bg_truecolor,i.bg_truecolor=null)):o.push(`background-color:rgb(`+i.bg+`)`)),i.decorations.forEach(e=>{a?s.push(`ansi-`+e):e===`bold`?s.push(`font-weight:bold`):e===`dim`?s.push(`opacity:0.5`):e===`italic`?s.push(`font-style:italic`):e===`hidden`?s.push(`visibility:hidden`):e===`strikethrough`?c.push(`line-through`):c.push(e)}),c.length&&s.push(`text-decoration:`+c.join(` `)),a?`<span class="`+o.concat(s).join(` `)+`"`+u(l)+`>`+i.content+`</span>`:`<span style="`+o.concat(s).join(`;`)+`"`+u(l)+`>`+i.content+`</span>`}removeDecoration(e){let t=this.decorations.indexOf(e);t>=0&&this.decorations.splice(t,1)}}}))(),1),ln={"0,0,0":`var(--dsw-alias-label-primary)`,"255,255,255":`var(--dsw-alias-label-primary)`,"85,85,85":`var(--dsw-alias-label-tertiary)`,"187,0,0":`var(--dsw-alias-state-error-primary)`,"255,85,85":`var(--dsw-alias-state-error-secondary)`,"0,187,0":`var(--dsw-alias-state-success-primary)`,"0,255,0":`var(--dsw-alias-state-success-secondary)`,"187,187,0":`var(--dsw-alias-state-warn-primary)`,"255,255,85":`var(--dsw-alias-state-warn-secondary)`,"0,0,187":`var(--dsw-alias-state-business-primary)`,"85,85,255":`var(--dsw-static-blue-400)`},un={bold:{fontWeight:700},dim:{opacity:.7},italic:{fontStyle:`italic`},underline:{textDecoration:`underline`},strikethrough:{textDecoration:`line-through`},hidden:{visibility:`hidden`}},dn=/\u001b\][^\u0007\u001b]*(?:\u0007|\u001b\\)?/g,fn=/\u001b(?!\[)[\u0020-\u002f]*[\u0030-\u007e]?/g,pn=/[\u0000-\u0007\u000b-\u001a\u001c-\u001f\u007f]/g,mn=/\r|\u0008|\u001b\[[\u0030-\u003f]*[\u0020-\u002f]*K/,hn=/\u001b\[([\u0030-\u003f]*)[\u0020-\u002f]*m/g,gn=8,_n=/^[\p{Mn}\p{Me}\p{Cf}\u200b-\u200f\u2060]$/u,vn=RegExp(`\\p{Script=Han}|\\p{Script=Hiragana}|\\p{Script=Katakana}|\\p{Script=Hangul}|\\p{Emoji_Presentation}|[\\uff01-\\uff60\\u3000-\\u303e]`,`u`);function yn(e){let t=e.codePointAt(0);return t===void 0||t<4352?!1:vn.test(e)}var bn={fg:``,bg:``,attrs:[]},xn={22:[`1`,`2`],23:[`3`],24:[`4`],25:[`5`,`6`],27:[`7`],28:[`8`],29:[`9`]};function Sn(e,t){let n=t===``?[`0`]:t.split(`;`),r=e;for(let e=0;e<n.length;e++){let t=String(n[e]);if(t===``||t===`0`){r=bn;continue}if(t===`38`||t===`48`){let i=n[e+1]??``,a=i===`2`?4:i===`5`?2:0,o=n.slice(e,e+a+1).join(`;`);r=t===`38`?{...r,fg:o}:{...r,bg:o},e+=a;continue}let i=xn[t];if(i!==void 0){r={...r,attrs:r.attrs.filter(e=>!i.includes(e))};continue}let a=Number(t);t===`39`?r={...r,fg:``}:t===`49`?r={...r,bg:``}:a>=30&&a<=37||a>=90&&a<=97?r={...r,fg:t}:a>=40&&a<=47||a>=100&&a<=107?r={...r,bg:t}:r.attrs.includes(t)||(r={...r,attrs:[...r.attrs,t]})}return r}function Cn(e){let t=[...e.attrs];return e.fg!==``&&t.push(e.fg),e.bg!==``&&t.push(e.bg),t.length===0?``:`\u001b[${t.join(`;`)}m`}function wn(e,t){return e.fg===t.fg&&e.bg===t.bg&&e.attrs.length===t.attrs.length&&e.attrs.every((e,n)=>e===t.attrs[n])}function Tn(e,t){let n=/\u001b\[([\u0030-\u003f]*)[\u0020-\u002f]*([\u0040-\u007e])/g,r=[],i=0,a=t,o=0,s=(e,t)=>{let n=r[e];n?.spacer===!0&&e>0?r[e-1]={sgr:a,char:t}:n!==void 0&&yn(n.char)&&r[e+1]?.spacer===!0&&(r[e+1]={sgr:a,char:t}),r[e]={sgr:a,char:t}},c=e=>{for(let t of e)if(t===`\r`)i=0;else if(t===`\b`)i=Math.max(0,i-1);else if(t===` `){let e=i+gn-i%gn;for(;i<e;i++)r[i]??={sgr:a,char:` `}}else if(_n.test(t)){let e=i>0?r[i-1]:void 0;e!==void 0&&(r[i-1]={sgr:e.sgr,char:e.char+t})}else s(i,` `),r[i]={sgr:a,char:t},i++,yn(t)&&(r[i]={sgr:a,char:``,spacer:!0},i++)};for(let t of e.matchAll(n)){c(e.slice(o,t.index)),o=t.index+t[0].length;let n=String(t[1]),l=String(t[2]);if(l===`K`){let e=String(n.split(`;`)[0]);if(e===`1`)for(let e=0;e<=i;e++)s(e,` `);else r.length=e===`2`?0:i}else l===`m`&&(a=Sn(a,n))}c(e.slice(o));let l=``,u=t;for(let e=0;e<r.length;e++){let t=r[e]??{sgr:bn,char:` `};wn(t.sgr,u)||(wn(u,bn)||(l+=`\x1B[0m`),l+=Cn(t.sgr),u=t.sgr);let n=e>0&&yn(r[e-1]?.char??``);l+=t.spacer===!0&&!n?` `:t.char}return wn(u,a)||(wn(u,bn)||(l+=`\x1B[0m`),l+=Cn(a)),{text:l,sgr:a}}function En(e){let t=[],n=bn;for(let r of e.split(`
13
- `)){let e=r.replace(/\r+$/,``);if(mn.test(e)){let r=Tn(e,n);t.push(r.text),n=r.sgr}else{t.push(e);for(let t of e.matchAll(hn))n=Sn(n,String(t[1]))}}return t.join(`
14
- `)}function Dn(e){return En(e.replace(dn,``).replace(fn,``)).replace(pn,``)}function On(e){let t={},n=e.bg===null?void 0:`rgb(${e.bg})`;if(n!==void 0&&(t.backgroundColor=n),e.fg!==null){let r=`rgb(${e.fg})`;t.color=n===void 0?ln[e.fg.replace(/\s+/g,``)]??r:r}for(let n of e.decorations)Object.assign(t,un[n]);return Object.keys(t).length===0?void 0:t}function kn(e){let t=[],n=[t];for(let r of cn.default.ansiToJson(Dn(e),{json:!0,remove_empty:!0})){let e=On(r);for(let[i,a]of r.content.split(`
15
- `).entries())i>0&&(t=[],n.push(t)),a!==``&&t.push({text:a,style:e})}return n}function An(e,t,n){let r=e-t,i=Math.ceil(t/2);return{hidden:r,capped:r>0&&!n,headLines:i,tailLines:t-i}}async function jn(e){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}let t=typeof document.execCommand==`function`?document.execCommand.bind(document):void 0;if(t===void 0)return!1;let n=document.activeElement instanceof HTMLElement?document.activeElement:null,r=document.createElement(`textarea`);r.value=e,r.setAttribute(`readonly`,``),r.style.position=`fixed`,r.style.left=`-9999px`,document.body.appendChild(r),r.select();try{return t(`copy`)}catch{return!1}finally{r.remove(),n?.focus({preventScroll:!0})}}var Mn=1e3;function Nn(e){let[t,n]=(0,B.useState)(!1);return{copied:t,onCopy:(0,B.useCallback)(()=>{t||jn(e).then(e=>{e&&(n(!0),window.setTimeout(()=>{n(!1)},Mn))})},[t,e])}}var Pn={pill:`_pill_e3ygd_1`,interactive:`_interactive_e3ygd_15`,active:`_active_e3ygd_23`};function Fn({active:e=!1,className:t,children:n,onClick:r,...i}){return r?(0,W.jsx)(`button`,{type:`button`,className:F(Pn.pill,Pn.interactive,e&&Pn.active,t),onClick:r,...i,children:n}):(0,W.jsx)(`span`,{className:F(Pn.pill,e&&Pn.active,t),children:n})}var In={block:`_block_1gdtu_1`,header:`_header_1gdtu_32`,prompt:`_prompt_1gdtu_70`,promptLine:`_promptLine_1gdtu_78`,runState:`_runState_1gdtu_91`,runStateLabel:`_runStateLabel_1gdtu_99`,cwd:`_cwd_1gdtu_108`,command:`_command_1gdtu_116`,status:`_status_1gdtu_128`,copyButton:`_copyButton_1gdtu_136`,output:`_output_1gdtu_156`,line:`_line_1gdtu_180`,expand:`_expand_1gdtu_185`,empty:`_empty_1gdtu_201`};function Ln(e,t){let n=e.replace(/[/\\]+$/,``);if(t!==void 0&&n===t.replace(/[/\\]+$/,``))return`~`;let r=n.split(/[/\\]/).pop();return r===void 0||r===``?e:r}function Rn(e,t,n){if(t!==void 0)return n.signal(t);if(e!==void 0&&e!==0)return n.exitCode(e)}function zn(e,t,n,r){return e?{state:`ongoing`,label:r.running}:Rn(t,n,r)===void 0?{state:`done`,label:r.done}:{state:`error`,label:r.failed}}function Bn(e){return e.map((e,t)=>e.style===void 0?e.text:(0,W.jsx)(`span`,{style:e.style,children:e.text},t))}function Vn({command:e,cwd:t,home:n,output:r,exitCode:i,signal:a,running:o=!1,maxLines:s=16,className:c,labels:l}){let u=l,d=r??``,f=(0,B.useMemo)(()=>{let e=kn(d),t=e[e.length-1];return e.length>1&&t!==void 0&&t.every(e=>e.text===``)?e.slice(0,-1):e},[d]),[p,m]=(0,B.useState)(!1),{copied:h,onCopy:g}=Nn(d),_=(0,B.useCallback)(()=>{m(e=>!e)},[]),v=Rn(i,a,u),y=zn(o,i,a,u),b=(0,B.useMemo)(()=>(e.endsWith(`
16
- `)?e.slice(0,-1):e).split(`
17
- `),[e]),x=f.every(e=>e.every(e=>e.text.trim()===``)),{hidden:S,capped:C,headLines:w,tailLines:T}=An(f.length,s,p);return(0,W.jsxs)(`div`,{className:F(In.block,c),"data-terminal":``,"data-running":o?``:void 0,children:[(0,W.jsxs)(`div`,{className:In.header,children:[(0,W.jsxs)(`div`,{className:In.prompt,children:[(0,W.jsx)(`span`,{className:In.runStateLabel,children:y.label}),b.map((e,r)=>(0,W.jsxs)(`div`,{className:In.promptLine,children:[r===0&&(0,W.jsx)(Be,{state:y.state,className:In.runState}),(0,W.jsx)(`span`,{className:In.cwd,children:r>0||t===void 0?`$`:Ln(t,n)}),(0,W.jsx)(`span`,{className:In.command,children:e})]},r))]}),v!==void 0&&(0,W.jsx)(Fn,{className:In.status,children:v}),!o&&!x&&(0,W.jsx)(`button`,{type:`button`,className:In.copyButton,onClick:g,children:h?u.copied:u.copy})]}),!o&&(x?(0,W.jsx)(`div`,{className:In.empty,children:u.noOutput}):(0,W.jsxs)(`div`,{className:In.output,children:[(C?f.slice(0,w):f).map((e,t)=>(0,W.jsx)(`div`,{className:In.line,children:Bn(e)},t)),S>0&&(0,W.jsx)(`button`,{type:`button`,className:In.expand,"aria-expanded":p,"aria-label":p?u.collapseAria:u.expandAria(S),onClick:_,children:p?u.collapse:u.expand(S)}),C&&f.slice(f.length-T).map((e,t)=>(0,W.jsx)(`div`,{className:In.line,children:Bn(e)},t))]}))]})}var Hn={root:`_root_1xitv_9`,row:`_row_1xitv_14`,"piw-tool-row-sweep":`_piw-tool-row-sweep_1xitv_1`,leading:`_leading_1xitv_45`,title:`_title_1xitv_52`,sep:`_sep_1xitv_60`,chevron:`_chevron_1xitv_64`,summary:`_summary_1xitv_81`,summarySuffix:`_summarySuffix_1xitv_97`,diffStat:`_diffStat_1xitv_113`,fileLink:`_fileLink_1xitv_126`,errorSummary:`_errorSummary_1xitv_154`,bodyWrap:`_bodyWrap_1xitv_159`,inspectButton:`_inspectButton_1xitv_168`,bodyScroll:`_bodyScroll_1xitv_203`,ioCard:`_ioCard_1xitv_212`,ioSection:`_ioSection_1xitv_224`,ioLabel:`_ioLabel_1xitv_253`,ioDivider:`_ioDivider_1xitv_262`,ioText:`_ioText_1xitv_268`,codeBody:`_codeBody_1xitv_288`,terminalBody:`_terminalBody_1xitv_289`,diffBody:`_diffBody_1xitv_290`,readBody:`_readBody_1xitv_291`,imageBody:`_imageBody_1xitv_292`,searchBody:`_searchBody_1xitv_293`,webBody:`_webBody_1xitv_294`,searchRecovery:`_searchRecovery_1xitv_301`,imageLabel:`_imageLabel_1xitv_312`,imageMeta:`_imageMeta_1xitv_324`,visuallyHidden:`_visuallyHidden_1xitv_350`},Un={root:`_root_1ulqw_1`,chevron:`_chevron_1ulqw_21`,label:`_label_1ulqw_35`},Wn={root:`_root_xlier_4`,trigger:`_trigger_xlier_19`,label:`_label_xlier_39`},Gn={panel:`_panel_105wx_10`,title:`_title_105wx_35`,titleRule:`_titleRule_105wx_45`,titleValue:`_titleValue_105wx_50`,titleLabel:`_titleLabel_105wx_55`,details:`_details_105wx_68`,route:`_route_105wx_88`,reasoning:`_reasoning_105wx_92`},Kn={actions:`_actions_qoqwk_5`,timeStart:`_timeStart_qoqwk_15`,timeEnd:`_timeEnd_qoqwk_26`,action:`_action_qoqwk_5`,visuallyHidden:`_visuallyHidden_qoqwk_94`};function qn(e){try{let t=JSON.parse(e.text),n=t.command??t.file_path??t.path??t.url??t.query??t.pattern;if(typeof n==`string`)return n}catch{}return e.text}function Jn({block:e,result:t,running:n,onInspect:r,cwd:i}){let[a,o]=(0,B.useState)(!1),s=t?.blocks.map(e=>e.text).join(`
18
- `)??null,c=t?.isError?`error`:t?`ok`:n?`running`:`pending`,l=e.toolName===`bash`||e.toolName===`pwsh`,u={bash:`Bash`,pwsh:`PowerShell`,read:U(`读取`,`Read`),write:U(`写入`,`Write`),edit:U(`编辑`,`Edit`),grep:U(`搜索`,`Search`),glob:U(`搜索`,`Search`)}[e.toolName||``]||e.toolName||U(`工具调用`,`Tool call`),d=qn(e);return(0,W.jsx)(`div`,{className:Hn.root,"data-state":c,"data-tool":e.toolName,children:(0,W.jsx)(Qt,{icon:(0,W.jsx)(it,{size:14}),title:u,open:a,onToggle:()=>o(e=>!e),rowClassName:Hn.row,leadingClassName:Hn.leading,titleClassName:Hn.title,chevronClassName:Hn.chevron,collapsedContent:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:Hn.sep,"aria-hidden":!0}),(0,W.jsx)(`span`,{className:`${Hn.summary} ${c===`error`?Hn.errorSummary:``}`,children:c===`error`?s?.split(`
19
- `,1)[0]:d})]}),children:(0,W.jsxs)(`div`,{className:Hn.bodyWrap,children:[l?(0,W.jsx)(Vn,{command:d,cwd:i,output:s??void 0,running:s===null,exitCode:t?.isError?1:t?0:void 0,maxLines:1/0,className:Hn.terminalBody,labels:{signal:e=>U(`信号 ${e}`,`Signal ${e}`),exitCode:e=>U(`退出码 ${e}`,`Exit code ${e}`),running:U(`运行中`,`Running`),failed:U(`失败`,`Failed`),done:U(`已完成`,`Done`),copy:U(`复制`,`Copy`),copied:U(`已复制`,`Copied`),noOutput:U(`无输出`,`No output`),collapseAria:U(`收起输出`,`Collapse output`),collapse:U(`收起`,`Collapse`),expandAria:e=>U(`展开其余 ${e} 行输出`,`Expand remaining ${e} output lines`),expand:e=>U(`… 其余 ${e} 行`,`… ${e} more lines`)}}):(0,W.jsxs)(`div`,{className:Hn.ioCard,children:[(0,W.jsxs)(`div`,{className:Hn.ioSection,children:[(0,W.jsx)(`span`,{className:Hn.ioLabel,children:`IN`}),(0,W.jsx)(`span`,{className:Hn.ioText,children:e.text})]}),s!==null&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:Hn.ioDivider,"aria-hidden":!0}),(0,W.jsxs)(`div`,{className:Hn.ioSection,children:[(0,W.jsx)(`span`,{className:Hn.ioLabel,children:`OUT`}),(0,W.jsx)(`span`,{className:Hn.ioText,"data-error":t?.isError||void 0,children:s||U(`无文本输出`,`No text output`)})]})]})]}),r&&(0,W.jsx)(`button`,{className:Hn.inspectButton,type:`button`,onClick:r,children:U(`查看轨迹`,`View trajectory`)})]})})})}function Yn({toolCount:e,messageCount:t,open:n,onToggle:r}){let i=[e>0&&U(`${e} 次工具调用`,`${e} tool calls`),t>0&&U(`${t} 条消息`,`${t} messages`)].filter(Boolean);return(0,W.jsxs)(`button`,{type:`button`,className:Un.root,"data-open":n||void 0,"aria-expanded":n,onClick:r,children:[(0,W.jsx)(`span`,{className:Un.label,children:i.length?i.join(` · `):U(`已思考`,`Thought`)}),(0,W.jsx)(Ye,{className:Un.chevron})]})}function Xn(e){return`${e.toLocaleString()} tok`}function Zn({usage:e,model:t}){let[n,r]=(0,B.useState)(!1),i=(0,B.useRef)(null),a=(0,B.useRef)(null),[o,s]=(0,B.useState)(null);(0,B.useLayoutEffect)(()=>{if(!n)return;let e=()=>{let e=i.current?.getBoundingClientRect(),t=a.current?.getBoundingClientRect();e&&t&&s({top:Math.max(12,Math.min(window.innerHeight-t.height-12,e.top-t.height-8)),left:Math.max(12,Math.min(e.left,window.innerWidth-t.width-12))})};e();let t=e=>{!i.current?.contains(e.target)&&!a.current?.contains(e.target)&&r(!1)},o=e=>{e.key===`Escape`&&r(!1)};return document.addEventListener(`pointerdown`,t),document.addEventListener(`keydown`,o),document.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{document.removeEventListener(`pointerdown`,t),document.removeEventListener(`keydown`,o),document.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[n]);let c=e.input+e.cacheRead+e.cacheWrite,l=c>0?Math.round(e.cacheRead/c*100):null;return(0,W.jsxs)(`span`,{ref:i,className:Wn.root,children:[(0,W.jsxs)(`button`,{type:`button`,className:Wn.trigger,"aria-haspopup":`dialog`,"aria-expanded":n,onClick:()=>r(e=>!e),children:[(0,W.jsx)(pt,{}),(0,W.jsxs)(`span`,{className:Wn.label,children:[U(`用量`,`Usage`),` `,Xn(e.totalTokens)]})]}),n&&(0,_t.createPortal)((0,W.jsxs)(`div`,{ref:a,className:Gn.panel,role:`dialog`,"aria-label":U(`本轮用量`,`Turn usage`),style:o??{top:-1e3,left:-1e3},children:[(0,W.jsxs)(`div`,{className:Gn.title,children:[(0,W.jsxs)(`span`,{className:Gn.titleLabel,children:[(0,W.jsx)(pt,{}),U(`本轮用量`,`Turn usage`)]}),(0,W.jsx)(`span`,{className:Gn.titleValue,children:Xn(e.totalTokens)})]}),(0,W.jsx)(`div`,{className:Gn.titleRule,"aria-hidden":!0}),(0,W.jsxs)(`dl`,{className:Gn.details,children:[t&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{children:U(`提供方 / 模型`,`Provider / model`)}),(0,W.jsx)(`dd`,{className:Gn.route,children:t})]}),l!==null&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{children:U(`缓存命中`,`Cache hit`)}),(0,W.jsxs)(`dd`,{children:[l,`%`]})]}),(0,W.jsx)(`dt`,{children:U(`未缓存输入`,`Uncached input`)}),(0,W.jsx)(`dd`,{children:Xn(e.input)}),(0,W.jsx)(`dt`,{children:U(`缓存读取`,`Cache read`)}),(0,W.jsx)(`dd`,{children:Xn(e.cacheRead)}),(0,W.jsx)(`dt`,{children:U(`缓存写入`,`Cache write`)}),(0,W.jsx)(`dd`,{children:Xn(e.cacheWrite)}),(0,W.jsx)(`dt`,{children:U(`输出`,`Output`)}),(0,W.jsxs)(`dd`,{children:[Xn(e.output),e.reasoning!==void 0&&(0,W.jsx)(`span`,{className:Gn.reasoning,children:U(`(其中推理 ${Xn(e.reasoning)})`,` (including ${Xn(e.reasoning)} reasoning)`)})]})]})]}),document.body)]})}function Qn({text:e,timestamp:t,usage:n,model:r}){let{copied:i,onCopy:a}=Nn(e);return(0,W.jsxs)(`div`,{className:Kn.actions,children:[e&&(0,W.jsx)(`button`,{className:Kn.action,type:`button`,"aria-label":i?U(`已复制`,`Copied`):U(`复制回复`,`Copy reply`),onClick:a,children:(0,W.jsx)($e,{})}),n&&(0,W.jsx)(Zn,{usage:n,model:r}),t&&(0,W.jsx)(`time`,{className:Kn.timeEnd,dateTime:t,children:new Date(t).toLocaleTimeString(U(`zh-CN`,`en-US`),{hour:`2-digit`,minute:`2-digit`})})]})}var $n=class{port=null;pending=new Map;sequence=0;disposed=!1;connection=0;frame;identity;host;timeoutMs;constructor(e,t,n,r=1e4){this.frame=e,this.identity=t,this.host=n,this.timeoutMs=r}async connect(e,t){if(this.disposed||this.port)throw Error(`Frame already connected or disposed`);let n=new URL(e,location.href);if(![`http:`,`https:`].includes(n.protocol)||n.username||n.password)throw Error(`Invalid frame document URL`);n.searchParams.set(`parentOrigin`,location.origin);for(let e of[`pluginId`,`generation`,`mountId`])n.searchParams.set(e,String(this.identity[e]));let r=++this.connection;if(await new Promise((e,t)=>{let r=setTimeout(()=>i(Error(`Frame document timed out`)),this.timeoutMs),i=n=>{clearTimeout(r),this.frame.removeEventListener(`load`,o),this.frame.removeEventListener(`error`,a),this.cancelLoad=null,n?t(n):e()},a=()=>i(Error(`Frame document failed`)),o=()=>i();this.cancelLoad=()=>i(Error(`Frame disposed`)),this.frame.addEventListener(`load`,o,{once:!0}),this.frame.addEventListener(`error`,a,{once:!0}),this.frame.src=n.href}),this.disposed||r!==this.connection||!this.frame.contentWindow)throw Error(`Frame connection superseded`);let i=this.frame.contentWindow,a=new MessageChannel;this.port=a.port1,this.port.onmessage=e=>{!this.disposed&&this.frame.contentWindow===i&&r===this.connection&&this.receive(e.data)},this.port.onmessageerror=()=>this.dispose(),this.port.start(),i.postMessage({type:`pi:hosted:connect`,protocol:1,pluginId:this.identity.pluginId,generation:this.identity.generation,mountId:this.identity.mountId},n.origin,[a.port2]),this.frame.addEventListener(`load`,this.navigated),await this.call(`initialize`,t)}cancelLoad=null;navigated=()=>this.dispose();async receive(e){if(!e||typeof e!=`object`)return;let t=e;if(typeof t.id==`string`){if(t.type===`response`){let e=this.pending.get(t.id);if(!e)return;this.pending.delete(t.id),clearTimeout(e.timer),t.ok===!0?e.resolve(t.value):e.reject(Object.assign(Error(t.error?.message??`Frame RPC failed`),t.error))}else if(t.type===`request`&&typeof t.method==`string`)try{let e=await this.host(t.method,t.input);this.port?.postMessage({type:`response`,id:t.id,ok:!0,value:e})}catch(e){let n=e;this.port?.postMessage({type:`response`,id:t.id,ok:!1,error:{code:n.code??`host_error`,message:n.message??String(e),status:n.status,reason:n.reason}})}}}call(e,t){if(this.disposed||!this.port)return Promise.reject(Error(`Frame is not connected`));let n=`${this.identity.mountId}:${++this.sequence}`;return new Promise((r,i)=>{let a=setTimeout(()=>{this.pending.delete(n),i(Error(`Frame ${e} timed out; edits were not acknowledged`))},this.timeoutMs);this.pending.set(n,{resolve:r,reject:i,timer:a});try{this.port.postMessage({type:`request`,id:n,method:e,input:t})}catch(e){clearTimeout(a),this.pending.delete(n),i(e)}})}dispose(){if(!this.disposed){this.disposed=!0,++this.connection,this.cancelLoad?.(),this.frame.removeEventListener(`load`,this.navigated);for(let e of this.pending.values())clearTimeout(e.timer),e.reject(Error(`Frame disposed`));this.pending.clear(),this.port?.close(),this.port=null}}},er=new class{frames=new Set;incarnations=new Map;incarnation(e,t){return this.incarnations.get(`${e}/${t}`)??0}add(e){return this.frames.add(e),()=>this.frames.delete(e)}async retireWithin(e,t){let n=[...this.frames].filter(n=>n.identity.sessionId===e&&t.contains(n.adapter.frame));await Promise.all(n.map(async e=>{if(await e.ready,!e.retire)throw Error(`View cannot retire safely`);await e.retire()}))}async retireTools(e,t){let n=[...this.frames].filter(n=>n.identity.sessionId===e&&n.toolCallId&&t.includes(n.toolCallId));await Promise.all(n.map(async e=>{if(await e.ready,!e.retire)throw Error(`View cannot retire safely`);await e.retire()}));for(let t of n){let n=`${e}/${t.toolCallId}`;this.incarnations.set(n,(this.incarnations.get(n)??0)+1)}}async flush(e){let t=[...this.frames].filter(t=>t.identity.sessionId===e),n=(await Promise.allSettled(t.map(async e=>{await e.ready,await e.adapter.call(`flush`),await e.afterFlush?.()}))).find(e=>e.status===`rejected`);if(n?.status===`rejected`)throw n.reason;if(t.length!==[...this.frames].filter(t=>t.identity.sessionId===e).length||t.some(e=>!this.frames.has(e)))throw Error(`Plugin views changed during flush; retry without losing your prompt`)}};function tr(e){let t=[];for(let n of e){(n.role===`user`||t.length===0)&&t.push({id:n.id,index:t.length+1,messages:[],usage:null});let e=t[t.length-1];if(e.messages.push(n),n.usage){let t=e.usage;e.usage={input:(t?.input??0)+n.usage.input,output:(t?.output??0)+n.usage.output,cacheRead:(t?.cacheRead??0)+n.usage.cacheRead,cacheWrite:(t?.cacheWrite??0)+n.usage.cacheWrite,totalTokens:(t?.totalTokens??0)+n.usage.totalTokens,cost:(t?.cost??0)+n.usage.cost,...t?.reasoning!==void 0||n.usage.reasoning!==void 0?{reasoning:(t?.reasoning??0)+(n.usage.reasoning??0)}:{}}}}return t}function nr(e,t){let n=new Map;for(let r of e)r.role===`assistant`&&r.blocks.forEach((e,i)=>{if(e.kind!==`toolCall`||!t.includes(e.toolName??``))return;let a=e.toolCallId??`${r.id}-${i}`,o=n.get(a),s=r.id===`stream`;o&&!o.streaming&&s||n.set(a,{key:a,call:e,streaming:s})});return[...n.values()].map(({key:e,call:t})=>({key:e,call:t}))}function rr(e,t){let n=nr(e.messages,t)[0];return n?`tool:${n.key}`:`message:${e.id}`}function ir(e,t){return e===t||e.length===t.length&&e.every((e,n)=>e===t[n]||JSON.stringify(e)===JSON.stringify(t[n]))}function ar(e){let t=new Set(e.flatMap(e=>e.blocks.filter(e=>e.kind===`toolCall`&&e.toolCallId).map(e=>e.toolCallId)));return new Map(e.filter(e=>e.role===`tool`&&e.toolCallId&&t.has(e.toolCallId)).map(e=>[e.toolCallId,e]))}function or(e){let t=e?.blocks.filter(e=>e.kind===`text`).map(e=>e.text).join(`
20
- `)??``;return/"status"\s*:\s*"pending[_a-z]*"/u.test(t)}function sr(e,t,n){let r=e=>e.flatMap(e=>e.blocks.filter(e=>e.kind===`toolCall`&&n.includes(e.toolName??``)).map(e=>e.toolCallId)),i=new Set(r(t));return r(e).filter(e=>!i.has(e))}function cr(e,t,n){let r=(0,B.useRef)(t);r.current=t;let[i,a]=(0,B.useState)({sessionId:e,messages:t,retiring:[]}),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(0);if(i.sessionId!==e)a({sessionId:e,messages:t,retiring:[]});else if(!i.retiring.length&&!ir(i.messages,t)){let e=sr(i.messages,t,n).length?sr(i.messages,[],n):[];a(e.length?{...i,retiring:e}:{...i,messages:t})}let u=JSON.stringify(i.retiring);return(0,B.useEffect)(()=>{if(!e||!i.retiring.length)return;let t=!0;return er.retireTools(e,i.retiring).then(()=>{t&&(s(``),a(e=>({...e,messages:r.current,retiring:[]})))}).catch(e=>{t&&s(`Removed plugin view retained for recovery: ${String(e)}`)}),()=>{t=!1}},[e,u,c]),{messages:i.messages,error:o,retry:()=>l(e=>e+1)}}function lr({status:e,description:t}){let n=e===`completed`?U(`子代理已完成`,`Subagent completed`):e===`failed`?U(`子代理执行失败`,`Subagent failed`):e===`cancelled`?U(`子代理已取消`,`Subagent cancelled`):U(`子代理任务更新`,`Subagent task update`);return t?`${n}${U(`:`,`: `)}${t}`:n}var ur={root:`_root_10hwk_2`,ledger:`_ledger_10hwk_16`},dr={split:`_split_m0qel_1`,tablePane:`_tablePane_m0qel_15`,historyLoading:`_historyLoading_m0qel_25`,historyLoadingBar:`_historyLoadingBar_m0qel_34`,historyLoadingSpinner:`_historyLoadingSpinner_m0qel_48`,"history-loading-spin":`_history-loading-spin_m0qel_1`,table:`_table_m0qel_15`,historyLoadRow:`_historyLoadRow_m0qel_59`,historyLoadButton:`_historyLoadButton_m0qel_69`,visuallyHidden:`_visuallyHidden_m0qel_97`,eventColumn:`_eventColumn_m0qel_136`,contentColumn:`_contentColumn_m0qel_140`,eventHeader:`_eventHeader_m0qel_163`,virtualSpacer:`_virtualSpacer_m0qel_178`,turnRail:`_turnRail_m0qel_220`,requestBoundaryControl:`_requestBoundaryControl_m0qel_233`,requestBoundaryControlActive:`_requestBoundaryControlActive_m0qel_294`,event:`_event_m0qel_136`,selectionRail:`_selectionRail_m0qel_330`,turnLabel:`_turnLabel_m0qel_392`,turnLabelFull:`_turnLabelFull_m0qel_412`,turnLabelCompact:`_turnLabelCompact_m0qel_413`,turnLabelActive:`_turnLabelActive_m0qel_426`,eventInner:`_eventInner_m0qel_435`,kindSlot:`_kindSlot_m0qel_443`,content:`_content_m0qel_140`,kindTag:`_kindTag_m0qel_463`,kindTagIcon:`_kindTagIcon_m0qel_479`,kindTagLabel:`_kindTagLabel_m0qel_491`,message:`_message_m0qel_499`,user:`_user_m0qel_594`,systemNeutral:`_systemNeutral_m0qel_599`,contextGreen:`_contextGreen_m0qel_604`,compacted:`_compacted_m0qel_613`,compactedSummary:`_compactedSummary_m0qel_618`,promptDiffSections:`_promptDiffSections_m0qel_624`,promptDiffSection:`_promptDiffSection_m0qel_624`,promptDiffTitle:`_promptDiffTitle_m0qel_637`,promptDiff:`_promptDiff_m0qel_624`,promptDiffLinemeta:`_promptDiffLinemeta_m0qel_659`,promptDiffLinecontext:`_promptDiffLinecontext_m0qel_665`,promptDiffLineadded:`_promptDiffLineadded_m0qel_669`,promptDiffLineremoved:`_promptDiffLineremoved_m0qel_678`,assistantVioletBright:`_assistantVioletBright_m0qel_687`,toolAmber:`_toolAmber_m0qel_704`,subtoolAmber:`_subtoolAmber_m0qel_709`,contentText:`_contentText_m0qel_722`,toolCallOnly:`_toolCallOnly_m0qel_730`,collapsedTurnContent:`_collapsedTurnContent_m0qel_753`,collapsedTurnEllipsis:`_collapsedTurnEllipsis_m0qel_762`,collapsedTurnText:`_collapsedTurnText_m0qel_770`,resultPreview:`_resultPreview_m0qel_777`,resultRequest:`_resultRequest_m0qel_791`,inlineResultText:`_inlineResultText_m0qel_792`,toolCallNameTypeface:`_toolCallNameTypeface_m0qel_799`,toolCallPayload:`_toolCallPayload_m0qel_805`,inlineResult:`_inlineResult_m0qel_792`,noOutputText:`_noOutputText_m0qel_830`,arrow:`_arrow_m0qel_834`,error:`_error_m0qel_840`,overview:`_overview_m0qel_844`,details:`_details_m0qel_848`,errorPayload:`_errorPayload_m0qel_848`,resultBlockText:`_resultBlockText_m0qel_852`,jsonPayload:`_jsonPayload_m0qel_856`,jsonPreview:`_jsonPreview_m0qel_857`,detailsResizeHandle:`_detailsResizeHandle_m0qel_879`,detailsHeader:`_detailsHeader_m0qel_898`,detailsTitle:`_detailsTitle_m0qel_909`,requestDetailsDot:`_requestDetailsDot_m0qel_917`,requestDetailsName:`_requestDetailsName_m0qel_926`,detailsLocation:`_detailsLocation_m0qel_931`,close:`_close_m0qel_940`,detailTabs:`_detailTabs_m0qel_962`,detailTab:`_detailTab_m0qel_962`,detailTabActive:`_detailTabActive_m0qel_1000`,detailBody:`_detailBody_m0qel_1021`,detailBodySummary:`_detailBodySummary_m0qel_1030`,summaryScrollRegion:`_summaryScrollRegion_m0qel_1051`,markdownPayload:`_markdownPayload_m0qel_1062`,overviewParentLinks:`_overviewParentLinks_m0qel_1072`,overviewHierarchyNavLink:`_overviewHierarchyNavLink_m0qel_1077`,overviewHierarchyJumpIconTight:`_overviewHierarchyJumpIconTight_m0qel_1092`,requestTokenDetail:`_requestTokenDetail_m0qel_1116`,usagePanel:`_usagePanel_m0qel_1120`,usageGroup:`_usageGroup_m0qel_1124`,usageHeading:`_usageHeading_m0qel_1128`,timestampToggle:`_timestampToggle_m0qel_1153`,overviewSections:`_overviewSections_m0qel_1166`,overviewSection:`_overviewSection_m0qel_1166`,overviewHeading:`_overviewHeading_m0qel_1188`,overviewTitle:`_overviewTitle_m0qel_1203`,overviewTitleIcon:`_overviewTitleIcon_m0qel_1220`,overviewPreview:`_overviewPreview_m0qel_1238`,schemaTree:`_schemaTree_m0qel_1252`,markdownPreview:`_markdownPreview_m0qel_1268`,assistantContent:`_assistantContent_m0qel_1340`,payload:`_payload_m0qel_1341`,thinkingQuote:`_thinkingQuote_m0qel_1345`,thinkingQuoteOnlyPreview:`_thinkingQuoteOnlyPreview_m0qel_1353`,assistantContentRendered:`_assistantContentRendered_m0qel_1357`,thinkingToggle:`_thinkingToggle_m0qel_1361`,thinkingChevron:`_thinkingChevron_m0qel_1376`,assistantOutput:`_assistantOutput_m0qel_1403`,schema:`_schema_m0qel_1252`,schemaPreview:`_schemaPreview_m0qel_1429`,schemaIntro:`_schemaIntro_m0qel_1433`,schemaName:`_schemaName_m0qel_1441`,schemaDescription:`_schemaDescription_m0qel_1447`,schemaParameters:`_schemaParameters_m0qel_1454`,schemaParametersTitle:`_schemaParametersTitle_m0qel_1458`,payloadPreview:`_payloadPreview_m0qel_1483`,sourceBlocks:`_sourceBlocks_m0qel_1488`,sourceBlock:`_sourceBlock_m0qel_1488`,sourceBlockHeader:`_sourceBlockHeader_m0qel_1498`,sourceBlockJumpTarget:`_sourceBlockJumpTarget_m0qel_1499`,sourceBlockLabel:`_sourceBlockLabel_m0qel_1519`,sourceBlockJumpIcon:`_sourceBlockJumpIcon_m0qel_1524`,sourceBlockContent:`_sourceBlockContent_m0qel_1541`,messageImages:`_messageImages_m0qel_1551`,messageImagesPreview:`_messageImagesPreview_m0qel_1558`,assistantToolCalls:`_assistantToolCalls_m0qel_1563`,assistantToolCallsPreview:`_assistantToolCallsPreview_m0qel_1573`,assistantToolCallButton:`_assistantToolCallButton_m0qel_1582`,assistantToolCallIcon:`_assistantToolCallIcon_m0qel_1606`,assistantToolCallText:`_assistantToolCallText_m0qel_1617`,assistantToolCallName:`_assistantToolCallName_m0qel_1625`,assistantToolCallArgs:`_assistantToolCallArgs_m0qel_1632`,systemPrompt:`_systemPrompt_m0qel_1640`,toolCatalog:`_toolCatalog_m0qel_1644`,toolCatalogItem:`_toolCatalogItem_m0qel_1649`,toolCatalogSummary:`_toolCatalogSummary_m0qel_1653`,toolCatalogChevron:`_toolCatalogChevron_m0qel_1680`,toolCatalogIcon:`_toolCatalogIcon_m0qel_1681`,toolCatalogName:`_toolCatalogName_m0qel_1693`,toolCatalogDescription:`_toolCatalogDescription_m0qel_1698`,toolCatalogDefinition:`_toolCatalogDefinition_m0qel_1707`,toolCatalogFullDescription:`_toolCatalogFullDescription_m0qel_1712`,toolCatalogTree:`_toolCatalogTree_m0qel_1720`,resultBlocks:`_resultBlocks_m0qel_1725`,resultBlocksPreview:`_resultBlocksPreview_m0qel_1734`,noPayload:`_noPayload_m0qel_1750`},fr={root:`_root_wxaz8_1`,plot:`_plot_wxaz8_14`,labels:`_labels_wxaz8_22`,track:`_track_wxaz8_53`,earlierHistory:`_earlierHistory_wxaz8_64`,empty:`_empty_wxaz8_104`,lanes:`_lanes_wxaz8_118`,turnBoundaries:`_turnBoundaries_wxaz8_127`,turnBoundary:`_turnBoundary_wxaz8_144`,span:`_span_wxaz8_153`,selection:`_selection_wxaz8_253`,selectionEdges:`_selectionEdges_wxaz8_272`,hoverLine:`_hoverLine_wxaz8_283`},pr={timelineButton:`_timelineButton_1dmz1_1`,turnLabelButton:`_turnLabelButton_1dmz1_3`,empty:`_empty_1dmz1_5`};function mr(e,t,n){return Math.min(n,Math.max(t,e))}function hr({t:e,model:t,actualTime:n,selectedIndex:r,matchingIndexes:i,range:a,onRangeChange:o,onSelect:s}){let c=(0,B.useRef)(null),l=(0,B.useRef)(null),u=(0,B.useRef)(null),[d,f]=(0,B.useState)(null),[p,m]=(0,B.useState)(null),[h,g]=(0,B.useState)(null),[_,v]=(0,B.useState)(!1),y=Math.max(1,(t?.end??1)-(t?.start??0)),b=p&&t?mr(p.end-p.start,1,y):y,x=t?mr(p?.start??t.start,t.start,t.end-b):0,S=e=>{let t=e.currentTarget.getBoundingClientRect();return mr((e.clientX-t.left)/Math.max(1,t.width),0,1)},C=e=>{let t=e.target instanceof Element?e.target.closest(`[data-timeline-record-index]`):null,n=Number(t?.dataset.timelineRecordIndex);return t&&Number.isFinite(n)?n:null};if((0,B.useEffect)(()=>{m(null),o(null)},[n]),(0,B.useEffect)(()=>{t&&p&&(p.end<t.start||p.start>t.end)&&m(null)},[t,p]),(0,B.useEffect)(()=>{if(!t||!p||r===null)return;let e=t.spans.find(e=>e.index===r);if(!e||e.start>=x&&e.start<=x+b)return;let n=mr(e.start-b/2,t.start,t.end-b);m({start:n,end:n+b})},[t,r]),(0,B.useEffect)(()=>{let e=c.current;if(!e||!t)return;let r=e=>{e.preventDefault();let r=l.current?.getBoundingClientRect();if(!r)return;let i=mr((e.clientX-r.left)/Math.max(1,r.width),0,1),a=mr(b*Math.exp(e.deltaY*.0015),Math.min(n?20:4,y),y);if(a>=y*.999){m(null);return}let o=mr(x+i*(b-a),t.start,t.end-a);m({start:o,end:o+a})};return e.addEventListener(`wheel`,r,{passive:!1}),()=>e.removeEventListener(`wheel`,r)},[t,x,b,y,n]),!t)return(0,W.jsx)(`section`,{ref:c,className:fr.root,"aria-label":e(`会话时间线`,`Session timeline`),children:(0,W.jsxs)(`div`,{className:fr.plot,children:[(0,W.jsxs)(`div`,{className:fr.labels,"aria-hidden":`true`,children:[(0,W.jsx)(`span`,{children:e(`输入`,`Input`)}),(0,W.jsx)(`span`,{children:e(`模型`,`Model`)}),(0,W.jsx)(`span`,{children:e(`工具`,`Tool`)})]}),(0,W.jsx)(`div`,{className:fr.track,children:(0,W.jsx)(`span`,{className:fr.empty,children:e(`暂无轨迹`,`No trajectory yet`)})})]})});let w={"--trajectory-domain-left":`${-(x-t.start)/b*100}%`,"--trajectory-domain-width":`${y/b*100}%`},T=d??a,E=T?{"--trajectory-selection-left":`${(T.start-x)/b*100}%`,"--trajectory-selection-width":`${(T.end-T.start)/b*100}%`}:void 0;return(0,W.jsx)(`section`,{ref:c,className:fr.root,"aria-label":e(`会话时间线`,`Session timeline`),children:(0,W.jsxs)(`div`,{className:fr.plot,children:[(0,W.jsxs)(`div`,{className:fr.labels,"aria-hidden":`true`,children:[(0,W.jsx)(`span`,{children:e(`输入`,`Input`)}),(0,W.jsx)(`span`,{children:e(`模型`,`Model`)}),(0,W.jsx)(`span`,{children:e(`工具`,`Tool`)})]}),(0,W.jsxs)(`div`,{ref:l,className:fr.track,"data-panning":_||void 0,"aria-label":e(`时间线概览;拖动选择范围,滚轮缩放,右键拖动平移`,`Timeline overview; drag to select, scroll to zoom, right drag to pan`),tabIndex:0,onKeyDown:e=>{e.key===`Escape`&&(o(null),m(null))},onDoubleClick:()=>o(null),onContextMenu:e=>e.preventDefault(),onPointerDown:e=>{if(e.button!==0&&e.button!==2)return;let t=x+S(e)*b;u.current={pointerId:e.pointerId,clientX:e.clientX,time:t,index:C(e),pan:e.button===2,viewportStart:x},e.currentTarget.setPointerCapture(e.pointerId),e.button===2?v(!0):f({start:t,end:t})},onPointerMove:e=>{g(S(e));let n=u.current;if(n&&n.pointerId===e.pointerId){if(n.pan){if(!p)return;let r=e.currentTarget.getBoundingClientRect(),i=mr(n.viewportStart-(e.clientX-n.clientX)/Math.max(1,r.width)*b,t.start,t.end-b);m({start:i,end:i+b})}else{let t=x+S(e)*b;f({start:Math.min(n.time,t),end:Math.max(n.time,t)})}}},onPointerUp:e=>{let n=u.current;if(!n||n.pointerId!==e.pointerId)return;if(u.current=null,e.currentTarget.releasePointerCapture(e.pointerId),v(!1),f(null),n.pan){Math.abs(e.clientX-n.clientX)<3&&o(null);return}if(Math.abs(e.clientX-n.clientX)<3&&n.index!==null){o(null),s(n.index);return}let r=x+S(e)*b,i=Math.min(b,y/t.spans.length),a=(n.time+r)/2,c=Math.max(i,Math.abs(r-n.time)),l=mr(a-c/2,t.start,t.end-c);o({start:l,end:l+c})},onPointerCancel:()=>{u.current=null,f(null),v(!1)},onPointerLeave:()=>{u.current||g(null)},children:[h!==null&&!d&&(0,W.jsx)(`div`,{className:fr.hoverLine,style:{"--trajectory-hover-left":`${h*100}%`},"aria-hidden":`true`}),E&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:fr.selection,style:E,"aria-hidden":`true`}),(0,W.jsx)(`div`,{className:fr.selectionEdges,style:E,"aria-hidden":`true`})]}),(0,W.jsx)(`div`,{className:fr.turnBoundaries,style:w,"aria-hidden":`true`,children:t.boundaries.slice(1).map(e=>(0,W.jsx)(`span`,{className:fr.turnBoundary,style:{"--trajectory-turn-left":`${(e.time-t.start)/y*100}%`}},e.turn))}),(0,W.jsx)(`div`,{className:fr.lanes,style:w,children:t.spans.map(a=>{let o=(a.end-a.start)/y*100;return(0,W.jsx)(`button`,{type:`button`,className:`${fr.span} ${pr.timelineButton}`,"data-timeline-record-index":a.index,"data-timeline-span":a.lane===0?`user`:a.lane===2?`tool`:`message`,"data-equal-duration":n&&a.end===a.start||void 0,"data-current":r===a.index||void 0,"data-error":a.error||void 0,"data-selected":T?a.start<=T.end&&a.end>=T.start?`true`:`false`:void 0,"data-search-match":i?i.has(a.index)?`true`:`false`:void 0,"aria-label":e(`第 ${a.index} 条轨迹`,`Trajectory record ${a.index}`),title:e(`第 ${a.index} 条 · ${n?new Date(a.start).toLocaleTimeString():`事件顺序`}`,`Record ${a.index} · ${n?new Date(a.start).toLocaleTimeString():`event order`}`),style:{"--trajectory-span-left":`${(a.start-t.start)/y*100}%`,"--trajectory-span-width":`${o}%`,"--trajectory-span-gap":`min(${o*.08}%, 1px)`,"--trajectory-span-lane":a.lane},onClick:e=>{e.detail===0&&s(a.index)}},a.index)})})]})]})})}function gr(e,t){if(e.length===0)return null;let n=e.map(e=>Date.parse(e.timestamp)).find(Number.isFinite)??0,r=e.map((e,n)=>{let r=Date.parse(e.timestamp),i=t&&Number.isFinite(r)?r:n,a=e.endTimestamp?Date.parse(e.endTimestamp):NaN;return{index:e.index,start:i,end:t&&Number.isFinite(a)&&a>i?a:t?i:n+1,lane:e.kind===`user`?0:e.kind===`tool`?2:1,error:e.error===!0}}),i=e.flatMap((t,n)=>n===0||t.turn!==e[n-1].turn?[{turn:t.turn,time:r[n].start}]:[]),a=t?Math.min(n,...r.map(e=>e.start)):0,o=Math.max(...r.map(e=>e.end));return{start:a,end:t?o+Math.max(1,(o-a)/100):e.length,spans:r,boundaries:i}}function _r(e,t,n){return new Set(e.spans.filter(e=>e.start<=n&&e.end>=t).map(e=>e.index))}var vr={root:`_root_15786_1`,inner:`_inner_15786_12`,actions:`_actions_15786_22`,toggle:`_toggle_15786_29`,toggleIcon:`_toggleIcon_15786_59`,control:`_control_15786_69`,controlTrack:`_controlTrack_15786_107`,controlThumb:`_controlThumb_15786_118`,action:`_action_15786_22`,actionIcon:`_actionIcon_15786_163`,search:`_search_15786_168`,searchIcon:`_searchIcon_15786_192`,searchInput:`_searchInput_15786_196`};function yr(e){return e.replace(/\s+/g,` `).trim()}function br(e){try{return JSON.stringify(JSON.parse(e))}catch{return yr(e)}}function xr(e){let t=new Map(e.filter(e=>e.role===`tool`&&e.toolCallId).map(e=>[e.toolCallId,e])),n=0;return tr(e).flatMap(e=>{let r=[],i=new Set(e.messages.flatMap(e=>e.blocks.filter(e=>e.kind===`toolCall`&&e.toolCallId).map(e=>e.toolCallId)));for(let a of e.messages)if(!(a.role===`tool`&&a.toolCallId&&i.has(a.toolCallId))){if(a.role===`notice`&&a.subagentNotice)r.push({id:`${a.id}-notice`,kind:`message`,label:U(`子代理`,`Subagent`),preview:lr(a.subagentNotice),text:a.blocks.map(e=>e.text).join(`
21
-
22
- `)||U(`没有结果预览`,`No result preview`),timestamp:a.timestamp,error:a.subagentNotice.status===`failed`,turn:e.index,index:++n});else for(let[i,o]of a.blocks.entries()){let s=a.role===`user`?`user`:a.role===`tool`||o.kind===`toolCall`?`tool`:`message`,c=o.kind===`toolCall`&&o.toolCallId?t.get(o.toolCallId):void 0;r.push({id:`${a.id}-${i}`,...o.toolCallId||a.toolCallId?{callId:o.toolCallId??a.toolCallId}:{},kind:s,label:s===`tool`?U(`工具`,`Tool`):a.role===`user`?U(`用户`,`User`):U(`助手`,`Assistant`),...s===`tool`?{toolName:o.kind===`toolCall`?o.toolName||U(`工具`,`Tool`):a.toolName||U(`工具`,`Tool`)}:{},text:o.text,preview:o.kind===`toolCall`?br(o.text):yr(o.text),...c?{result:yr(c.blocks.map(e=>e.text).join(` `))}:{},timestamp:a.timestamp,...c?{endTimestamp:c.timestamp}:{},...a.usage&&i===a.blocks.length-1?{usage:a.usage}:{},...a.isError||c?.isError?{error:!0}:{},turn:e.index,index:++n})}}return r})}function Sr(e){return e===void 0?``:e.toLocaleString()}function Cr(e,t){return Math.round(Math.min(Math.max(e,320),Math.max(320,Math.min(720,t-280))))}function wr({messages:e,inspectCallId:t}){let n=_e(),r=(0,B.useMemo)(()=>xr(e),[e,n]),i=r.at(-1)?.turn??0,[a,o]=(0,B.useState)(``),[s,c]=(0,B.useState)(null),[l,u]=(0,B.useState)(new Set),[d,f]=(0,B.useState)(!1),[p,m]=(0,B.useState)(!1),[h,g]=(0,B.useState)(null),[_,v]=(0,B.useState)(null),y=(0,B.useRef)(null),b=(0,B.useRef)(null);(0,B.useEffect)(()=>{t&&c(r.find(e=>e.callId===t)?.id??null)},[t,r]);let x=r.find(e=>e.id===s)??null,S=a.trim().toLocaleLowerCase(),C=(0,B.useMemo)(()=>gr(r,p),[r,p]),w=C&&h?_r(C,h.start,h.end):null,T=S?new Set(r.filter(e=>`${e.label} ${e.toolName??``} ${e.preview} ${e.result??``}`.toLocaleLowerCase().includes(S)).map(e=>e.index)):null,E=r.filter(e=>!l.has(e.turn)&&(!d||e.kind!==`tool`)&&(!S||`${e.label} ${e.toolName??``} ${e.preview} ${e.result??``}`.toLocaleLowerCase().includes(S))),D=new Map;for(let e of E){let t=D.get(e.turn)??[];t.push(e),D.set(e.turn,t)}let O=new Map;for(let e of r)O.set(e.turn,(O.get(e.turn)??0)+1);let k=Array.from({length:i},(e,t)=>t+1).flatMap(e=>l.has(e)?[{type:`collapsed`,turn:e,count:O.get(e)??0}]:(D.get(e)??[]).map((e,t)=>({type:`record`,record:e,firstInTurn:t===0}))),A=e=>{c(e.id),b.current?.querySelector(`[data-record-index="${e.index}"]`)?.scrollIntoView({block:`center`,behavior:`smooth`})};return(0,W.jsxs)(`div`,{className:ur.root,"data-conversation-composer-overlay":!0,"aria-label":U(`会话轨迹`,`Session trajectory`),children:[(0,W.jsx)(`div`,{className:vr.root,role:`toolbar`,"aria-label":U(`轨迹工具栏`,`Trajectory toolbar`),children:(0,W.jsxs)(`div`,{className:vr.inner,children:[(0,W.jsxs)(`div`,{className:vr.actions,children:[(0,W.jsxs)(`button`,{type:`button`,className:vr.toggle,"aria-pressed":p,title:p?U(`按事件顺序排列`,`Arrange by event order`):U(`按记录时间排列`,`Arrange by recorded time`),onClick:()=>m(e=>!e),children:[(0,W.jsxs)(`svg`,{className:vr.toggleIcon,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,W.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5.25`}),(0,W.jsx)(`path`,{d:`M8 4.75V8l2.25 1.5`})]}),U(`时长`,`Duration`)]}),(0,W.jsxs)(`button`,{type:`button`,className:vr.action,"aria-pressed":i>0&&l.size===i,"aria-label":i>0&&l.size===i?U(`展开轮次`,`Expand turns`):U(`折叠轮次`,`Collapse turns`),onClick:()=>u(e=>e.size===i?new Set:new Set(Array.from({length:i},(e,t)=>t+1))),children:[(0,W.jsx)(`span`,{className:vr.actionIcon,"aria-hidden":`true`,children:l.size===i?`⊞`:`⊟`}),U(`轮次`,`Turns`)]}),(0,W.jsxs)(`button`,{type:`button`,className:vr.action,"aria-pressed":d,"aria-label":d?U(`展开调用`,`Expand calls`):U(`折叠调用`,`Collapse calls`),onClick:()=>f(e=>!e),children:[(0,W.jsx)(`span`,{className:vr.actionIcon,"aria-hidden":`true`,children:d?`⊞`:`⊟`}),U(`调用`,`Calls`)]})]}),(0,W.jsxs)(`label`,{className:vr.search,children:[(0,W.jsx)(He,{size:11,className:vr.searchIcon}),(0,W.jsx)(`input`,{type:`search`,className:vr.searchInput,"aria-label":U(`搜索轨迹`,`Search trajectory`),placeholder:U(`搜索`,`Search`),value:a,onChange:e=>o(e.target.value)})]})]})}),(0,W.jsx)(hr,{t:U,model:C,actualTime:p,selectedIndex:x?.index??null,matchingIndexes:T,range:h,onRangeChange:g,onSelect:e=>{let t=r.find(t=>t.index===e);t&&A(t)}}),(0,W.jsxs)(`div`,{className:ur.ledger,children:[(0,W.jsx)(`div`,{ref:b,className:dr.tablePane,children:(0,W.jsxs)(`table`,{className:dr.table,"data-scroll-ready":`true`,"aria-label":U(`轨迹记录`,`Trajectory records`),children:[(0,W.jsxs)(`colgroup`,{children:[(0,W.jsx)(`col`,{className:dr.eventColumn}),(0,W.jsx)(`col`,{className:dr.contentColumn})]}),(0,W.jsxs)(`tbody`,{children:[k.map(e=>e.type===`collapsed`?(0,W.jsxs)(`tr`,{tabIndex:0,"data-collapsed-summary":`turn`,"data-turn-start":`true`,"aria-label":U(`展开第 ${e.turn} 轮`,`Expand turn ${e.turn}`),onClick:()=>u(t=>{let n=new Set(t);return n.delete(e.turn),n}),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),u(t=>{let n=new Set(t);return n.delete(e.turn),n}))},children:[(0,W.jsx)(`td`,{className:dr.event,children:(0,W.jsx)(`span`,{className:dr.turnLabel,children:U(`第 ${e.turn} 轮`,`Turn ${e.turn}`)})}),(0,W.jsx)(`td`,{className:dr.content,children:(0,W.jsxs)(`span`,{className:dr.collapsedTurnContent,children:[(0,W.jsx)(`span`,{className:dr.collapsedTurnEllipsis,children:`…`}),(0,W.jsx)(`span`,{className:dr.collapsedTurnText,children:U(`${e.count} 条记录,点击展开`,`${e.count} records, click to expand`)})]})})]},`collapsed-${e.turn}`):(0,W.jsxs)(`tr`,{tabIndex:0,"data-record-index":e.record.index,"data-kind":e.record.kind,"data-turn-start":e.firstInTurn||void 0,"data-error":e.record.error||void 0,"data-selected":s===e.record.id||void 0,"data-timeline-focus":w?w.has(e.record.index)?`inside`:`outside`:void 0,"aria-selected":s===e.record.id,"aria-label":U(`第 ${e.record.turn} 轮,${e.record.label},${e.record.preview}`,`Turn ${e.record.turn}, ${e.record.label}, ${e.record.preview}`),onClick:()=>A(e.record),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),A(e.record))},children:[(0,W.jsxs)(`td`,{className:dr.event,children:[e.firstInTurn&&(0,W.jsx)(`button`,{type:`button`,className:pr.turnLabelButton,"aria-label":U(`折叠第 ${e.record.turn} 轮`,`Collapse turn ${e.record.turn}`),onClick:t=>{t.stopPropagation(),u(t=>new Set([...t,e.record.turn]))},children:(0,W.jsx)(`span`,{className:dr.turnLabel,children:U(`第 ${e.record.turn} 轮`,`Turn ${e.record.turn}`)})}),(0,W.jsx)(`div`,{className:dr.eventInner,children:(0,W.jsx)(`span`,{className:dr.kindSlot,children:(0,W.jsx)(`span`,{className:`${dr.kindTag} ${e.record.kind===`user`?dr.user:e.record.kind===`tool`?dr.toolAmber:dr.assistantVioletBright}`,children:(0,W.jsx)(`span`,{className:dr.kindTagLabel,children:e.record.label})})})}),s===e.record.id&&(0,W.jsx)(`span`,{className:dr.selectionRail,"aria-hidden":`true`})]}),(0,W.jsx)(`td`,{className:dr.content,children:(0,W.jsxs)(`span`,{className:e.record.result===void 0?dr.contentText:dr.resultPreview,title:e.record.result===void 0?e.record.preview:`${e.record.label} ${e.record.preview} → ${e.record.result}`,children:[(0,W.jsxs)(`span`,{className:e.record.result===void 0?void 0:dr.resultRequest,children:[e.record.kind===`tool`&&(0,W.jsx)(`span`,{className:dr.toolCallNameTypeface,children:e.record.toolName}),(0,W.jsx)(`span`,{className:e.record.kind===`tool`?dr.toolCallPayload:void 0,children:e.record.preview})]}),e.record.result!==void 0&&(0,W.jsxs)(`span`,{className:`${dr.inlineResult} ${e.record.error?dr.error:``}`,children:[(0,W.jsx)(`span`,{className:dr.arrow,children:`→`}),(0,W.jsx)(`span`,{className:dr.inlineResultText,children:e.record.result})]})]})})]},e.record.id)),k.length===0&&(0,W.jsx)(`tr`,{children:(0,W.jsx)(`td`,{colSpan:2,className:pr.empty,children:r.length===0?U(`暂无轨迹`,`No trajectory yet`):U(`没有匹配的记录`,`No matching records`)})})]})]})}),x&&(0,W.jsxs)(`aside`,{id:`trajectory-detail-panel`,className:dr.details,"aria-label":U(`轨迹详情`,`Trajectory details`),style:_===null?void 0:{width:_},children:[(0,W.jsx)(`div`,{className:dr.detailsResizeHandle,role:`separator`,"aria-label":U(`调整轨迹详情宽度`,`Resize trajectory details`),"aria-controls":`trajectory-detail-panel`,"aria-orientation":`vertical`,tabIndex:0,title:U(`拖动调整详情宽度,双击恢复`,`Drag to resize details; double click to reset`),onDoubleClick:()=>v(null),onPointerDown:e=>{if(e.button!==0)return;let t=e.currentTarget.parentElement,n=t?.parentElement?.getBoundingClientRect().width;t&&n&&(y.current={pointerId:e.pointerId,startX:e.clientX,startWidth:t.getBoundingClientRect().width,splitWidth:n},e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault())},onPointerMove:e=>{let t=y.current;t&&t.pointerId===e.pointerId&&v(Cr(t.startWidth+t.startX-e.clientX,t.splitWidth))},onPointerUp:e=>{y.current?.pointerId===e.pointerId&&(y.current=null,e.currentTarget.releasePointerCapture(e.pointerId))},onPointerCancel:()=>{y.current=null},onKeyDown:e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;let t=e.currentTarget.parentElement,n=t?.parentElement?.getBoundingClientRect().width;t&&n&&(v(Cr(t.getBoundingClientRect().width+(e.key===`ArrowLeft`?16:-16),n)),e.preventDefault())}}),(0,W.jsxs)(`div`,{className:dr.detailsHeader,children:[(0,W.jsxs)(`span`,{className:dr.detailsTitle,children:[x.kind===`tool`?(0,W.jsx)(`span`,{className:dr.requestDetailsDot}):(0,W.jsx)(pt,{size:14}),(0,W.jsx)(`span`,{className:dr.requestDetailsName,children:x.toolName??x.label}),(0,W.jsxs)(`span`,{className:dr.detailsLocation,children:[U(`第 ${x.turn} 轮`,`Turn ${x.turn}`),` · #`,x.index]})]}),(0,W.jsx)(`button`,{type:`button`,className:dr.close,"aria-label":U(`关闭详情`,`Close details`),onClick:()=>c(null),children:(0,W.jsx)(Ze,{})})]}),(0,W.jsxs)(`div`,{className:dr.detailBody,children:[(0,W.jsxs)(`dl`,{className:dr.overview,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:U(`时间`,`Time`)}),(0,W.jsx)(`dd`,{children:new Date(x.timestamp).toLocaleString(U(`zh-CN`,`en-US`))})]}),x.callId&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:U(`调用 ID`,`Call ID`)}),(0,W.jsx)(`dd`,{children:x.callId})]}),x.usage&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:U(`输入`,`Input`)}),(0,W.jsx)(`dd`,{children:Sr(x.usage.input)})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:U(`缓存读取`,`Cache read`)}),(0,W.jsx)(`dd`,{children:Sr(x.usage.cacheRead)})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:U(`缓存写入`,`Cache write`)}),(0,W.jsx)(`dd`,{children:Sr(x.usage.cacheWrite)})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`dt`,{children:U(`输出`,`Output`)}),(0,W.jsx)(`dd`,{children:Sr(x.usage.output)})]})]})]}),(0,W.jsx)(`div`,{className:dr.overviewHeading,children:U(`内容`,`Content`)}),x.kind===`tool`?(0,W.jsx)(`pre`,{className:dr.payload,children:x.text}):(0,W.jsx)(`div`,{className:dr.markdownPayload,children:(0,W.jsx)(Xt,{text:x.text})}),x.result!==void 0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:dr.overviewHeading,children:U(`结果`,`Result`)}),(0,W.jsx)(`pre`,{className:dr.payload,children:x.result})]})]})]})]})]})}var Tr={root:`_root_vpfjh_1`,trigger:`_trigger_vpfjh_9`,triggerLabel:`_triggerLabel_vpfjh_45`,triggerEffort:`_triggerEffort_vpfjh_56`,triggerIcon:`_triggerIcon_vpfjh_67`,chevron:`_chevron_vpfjh_88`,chevronOpen:`_chevronOpen_vpfjh_94`,menu:`_menu_vpfjh_101`,status:`_status_vpfjh_129`,empty:`_empty_vpfjh_130`,error:`_error_vpfjh_137`,warning:`_warning_vpfjh_138`,retry:`_retry_vpfjh_157`,groups:`_groups_vpfjh_121`,group:`_group_vpfjh_121`,groupTitle:`_groupTitle_vpfjh_177`,option:`_option_vpfjh_189`,selected:`_selected_vpfjh_214`,optionCopy:`_optionCopy_vpfjh_223`,modelName:`_modelName_vpfjh_230`,check:`_check_vpfjh_240`,cell:`_cell_vpfjh_250`,cellLabel:`_cellLabel_vpfjh_273`,cellValue:`_cellValue_vpfjh_278`,cellChevron:`_cellChevron_vpfjh_288`,compact:`_compact_vpfjh_294`};function Er({openSignal:e=0,compact:t=!1,current:n,models:r,disabled:i,onSelect:a,thinkingLevel:o,thinkingLevels:s,onSelectThinkingLevel:c}){let l={off:U(`关闭`,`Off`),minimal:U(`极低`,`Minimal`),low:U(`低`,`Low`),medium:U(`中`,`Medium`),high:U(`高`,`High`),xhigh:U(`极高`,`Extra high`)},[u,d]=(0,B.useState)(!1),f=(0,B.useRef)(e);(0,B.useEffect)(()=>{e!==f.current&&(f.current=e,i||d(!0))},[e,i]);let[p,m]=(0,B.useState)(`root`),[h,g]=(0,B.useState)(!1),[_,v]=(0,B.useState)({visibility:`hidden`,left:0,top:0}),y=(0,B.useId)(),b=(0,B.useRef)(null),x=(0,B.useRef)(null),S=(0,B.useRef)(null),C=(0,B.useMemo)(()=>{let e=new Map;for(let t of r)e.set(t.provider,[...e.get(t.provider)??[],t]);return[...e]},[r]),w=r.find(e=>`${e.provider}/${e.id}`===n)?.name||(n&&n!==`unknown/unknown`?n:U(`选择模型`,`Choose a model`)),T=s.length>1&&o?l[o]??o:null,E=(e=!1)=>{d(!1),m(`root`),e&&x.current?.focus()};(0,B.useEffect)(()=>{if(!u)return;let e=e=>{!b.current?.contains(e.target)&&!S.current?.contains(e.target)&&E()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[u]),(0,B.useLayoutEffect)(()=>{if(!u||!x.current||!S.current)return;let e=()=>{if(!x.current||!S.current)return;let e=x.current.getBoundingClientRect(),t=S.current.getBoundingClientRect(),n=Math.max(16,Math.min(e.right-t.width,innerWidth-t.width-16)),r=e.top-t.height-8>=16?e.top-t.height-8:Math.min(e.bottom+8,innerHeight-t.height-16);v({left:n,top:r})};return e(),window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[u,p,r.length]);let D=e=>{if(e.key===`Escape`){e.preventDefault(),p===`root`?E(!0):m(`root`);return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let t=[...S.current?.querySelectorAll(`button[role^="menuitem"]`)??[]].filter(e=>!e.disabled);t[(t.indexOf(document.activeElement)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()},O=async e=>{if(`${e.provider}/${e.id}`===n)E(!0);else{g(!0);try{await a(e.provider,e.id),E(!0)}catch{}finally{g(!1)}}},k=async e=>{if(e===o)E(!0);else{g(!0);try{await c(e),E(!0)}catch{}finally{g(!1)}}};return(0,W.jsxs)(`div`,{ref:b,className:Tr.root,onKeyDown:D,children:[(0,W.jsxs)(`button`,{ref:x,className:`${Tr.trigger} ${t?Tr.compact:``}`,"data-compact":t||void 0,type:`button`,"aria-label":U(`切换模型,当前 ${w}${T?`,推理强度${T}`:``}`,`Change model, current ${w}${T?`, reasoning effort ${T}`:``}`),"aria-haspopup":`menu`,"aria-expanded":u,"aria-controls":u?`${y}-menu`:void 0,title:T?`${w} · ${T}`:w,disabled:i||h,onClick:()=>u?E():d(!0),children:[(0,W.jsx)(ft,{className:Tr.triggerIcon,size:16}),!t&&(0,W.jsx)(`span`,{className:Tr.triggerLabel,children:w}),!t&&T&&(0,W.jsx)(`span`,{className:Tr.triggerEffort,children:T}),!t&&(0,W.jsx)(Ye,{className:`${Tr.chevron} ${u?Tr.chevronOpen:``}`})]}),u&&(0,_t.createPortal)((0,W.jsx)(L,{ref:S,id:`${y}-menu`,role:`menu`,"aria-label":U(`选择模型`,`Choose model`),className:Tr.menu,style:_,children:p===`root`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`button`,{type:`button`,role:`menuitem`,className:Tr.cell,onClick:()=>m(`model`),children:[(0,W.jsx)(`span`,{className:Tr.cellLabel,children:U(`模型`,`Model`)}),(0,W.jsx)(`span`,{className:Tr.cellValue,children:w}),(0,W.jsx)(Xe,{className:Tr.cellChevron})]}),T&&(0,W.jsxs)(`button`,{type:`button`,role:`menuitem`,className:Tr.cell,onClick:()=>m(`effort`),children:[(0,W.jsx)(`span`,{className:Tr.cellLabel,children:U(`推理强度`,`Reasoning effort`)}),(0,W.jsx)(`span`,{className:Tr.cellValue,children:T}),(0,W.jsx)(Xe,{className:Tr.cellChevron})]})]}):p===`model`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:Tr.groups,children:C.map(([e,t])=>(0,W.jsxs)(`section`,{className:Tr.group,role:`group`,"aria-label":e,children:[(0,W.jsx)(`div`,{className:Tr.groupTitle,children:e}),t?.map(e=>(0,W.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":`${e.provider}/${e.id}`===n,className:`${Tr.option} ${`${e.provider}/${e.id}`===n?Tr.selected:``}`,title:e.name||e.id,disabled:h,onClick:()=>{O(e)},children:[(0,W.jsx)(`span`,{className:Tr.optionCopy,children:(0,W.jsx)(`span`,{className:Tr.modelName,children:e.name||e.id})}),(0,W.jsx)(`span`,{className:Tr.check,children:`${e.provider}/${e.id}`===n&&(0,W.jsx)(Je,{})})]},e.id))]},e))}),r.length===0&&(0,W.jsx)(`div`,{className:Tr.empty,children:U(`暂无可用模型`,`No models available`)})]}):(0,W.jsx)(`div`,{className:Tr.groups,children:s.map(e=>(0,W.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e===o,className:`${Tr.option} ${e===o?Tr.selected:``}`,disabled:h,onClick:()=>{k(e)},children:[(0,W.jsx)(`span`,{className:Tr.optionCopy,children:(0,W.jsx)(`span`,{className:Tr.modelName,children:l[e]??e})}),(0,W.jsx)(`span`,{className:Tr.check,children:e===o&&(0,W.jsx)(Je,{})})]},e))})}),document.body)]})}var Dr={backdrop:`_backdrop_1x9ns_1`,mask:`_mask_1x9ns_13`,image:`_image_1x9ns_20`,close:`_close_1x9ns_30`};function Or({src:e,alt:t,labels:n,onClose:r}){let i=(0,B.useRef)(null),a=(0,B.useRef)(null);return(0,B.useEffect)(()=>{a.current=document.activeElement instanceof HTMLElement?document.activeElement:null,i.current?.focus();let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e),a.current?.focus()}},[r]),(0,_t.createPortal)((0,W.jsxs)(`div`,{className:Dr.backdrop,role:`dialog`,"aria-modal":`true`,"aria-label":n.dialog,children:[(0,W.jsx)(`div`,{className:Dr.mask,"aria-hidden":`true`,onMouseDown:r}),(0,W.jsx)(`img`,{className:Dr.image,src:e,alt:t}),(0,W.jsx)(`button`,{ref:i,type:`button`,className:Dr.close,"aria-label":n.close,onClick:r,children:(0,W.jsx)(Ze,{size:16})})]}),document.body)}function kr(e){if(e<1024)return`${e}B`;let t=e/1024;if(t<1024)return`${t<10?t.toFixed(1):Math.round(t)}KB`;let n=t/1024;if(n<1024)return`${n<10?n.toFixed(1):Math.round(n)}MB`;let r=n/1024;return`${r<10?r.toFixed(1):Math.round(r)}GB`}var Ar={card:`_card_p20fp_1`,failed:`_failed_p20fp_16`,icon:`_icon_p20fp_20`,spinner:`_spinner_p20fp_29`,"file-card-spin":`_file-card-spin_p20fp_1`,body:`_body_p20fp_43`,retry:`_retry_p20fp_51`,name:`_name_p20fp_61`,meta:`_meta_p20fp_71`,metaFailed:`_metaFailed_p20fp_80`,remove:`_remove_p20fp_84`,removeFailed:`_removeFailed_p20fp_126`,progressTrack:`_progressTrack_p20fp_132`,progressBar:`_progressBar_p20fp_143`,"file-card-progress":`_file-card-progress_p20fp_1`};function jr({name:e,bytes:t,status:n,error:r,onRemove:i,onRetry:a}){let o=ie(e).toUpperCase().slice(0,8),s=n===`uploading`?U(`上传中…`,`Uploading…`):n===`error`?r||U(`上传失败`,`Upload failed`):`${o} ${kr(t)}`;return(0,W.jsxs)(`div`,{className:`${Ar.card} ${n===`error`?Ar.failed:``}`,title:e,children:[(0,W.jsx)(`span`,{className:Ar.icon,"aria-hidden":`true`,children:n===`uploading`?(0,W.jsx)(`span`,{className:Ar.spinner}):(0,W.jsx)(re,{path:e,size:28})}),n===`error`?(0,W.jsxs)(`button`,{type:`button`,className:`${Ar.body} ${Ar.retry}`,onClick:a,"aria-label":U(`重试上传 ${e}`,`Retry upload ${e}`),children:[(0,W.jsx)(`span`,{className:Ar.name,children:e}),(0,W.jsx)(`span`,{className:`${Ar.meta} ${Ar.metaFailed}`,children:s})]}):(0,W.jsxs)(`span`,{className:Ar.body,"aria-label":U(`待发送文件 ${e}`,`Pending file ${e}`),children:[(0,W.jsx)(`span`,{className:Ar.name,children:e}),(0,W.jsx)(`span`,{className:Ar.meta,children:s})]}),(0,W.jsx)(`button`,{type:`button`,className:`${Ar.remove} ${n===`error`?Ar.removeFailed:``}`,"aria-label":U(`移除 ${e}`,`Remove ${e}`),onClick:i,children:(0,W.jsx)(Qe,{size:12})}),n===`uploading`&&(0,W.jsx)(`span`,{className:Ar.progressTrack,"aria-hidden":`true`,children:(0,W.jsx)(`span`,{className:Ar.progressBar})})]})}var Mr={rail:`_rail_1b0gl_1`,imageItem:`_imageItem_1b0gl_9`,thumbnail:`_thumbnail_1b0gl_15`,remove:`_remove_1b0gl_33`,retryImage:`_retryImage_1b0gl_58`};function Nr({file:e,status:t,error:n,onRemove:r,onRetry:i}){let[a,o]=(0,B.useState)(null),[s,c]=(0,B.useState)(!1),l=(0,B.useCallback)(()=>c(!1),[]),u=/^(image\/(png|jpeg|webp|gif))$/.test(e.type)||/\.(png|jpe?g|webp|gif)$/i.test(e.name);return(0,B.useEffect)(()=>{if(!u)return;let t=URL.createObjectURL(e);return o(t),()=>URL.revokeObjectURL(t)},[e,u]),u?(0,W.jsxs)(`div`,{className:Mr.imageItem,title:e.name,children:[(0,W.jsx)(`button`,{type:`button`,className:Mr.thumbnail,"aria-label":U(`预览 ${e.name}`,`Preview ${e.name}`),disabled:a===null,onClick:()=>c(!0),children:a&&(0,W.jsx)(`img`,{src:a,alt:e.name})}),(0,W.jsx)(`button`,{type:`button`,className:Mr.remove,"aria-label":U(`移除 ${e.name}`,`Remove ${e.name}`),onClick:r,children:(0,W.jsx)(Qe,{size:12})}),t===`uploading`&&(0,W.jsx)(`span`,{className:`pi-image-uploading`,role:`status`,children:U(`上传中`,`Uploading`)}),t===`error`&&(0,W.jsx)(`button`,{type:`button`,className:Mr.retryImage,"aria-label":U(`重试上传 ${e.name}`,`Retry upload ${e.name}`),title:n||U(`上传失败`,`Upload failed`),onClick:i,children:U(`重试`,`Retry`)}),s&&a&&(0,W.jsx)(Or,{src:a,alt:e.name,labels:{dialog:U(`图片预览`,`Image preview`),close:U(`关闭预览`,`Close preview`)},onClose:l})]}):(0,W.jsx)(jr,{name:e.name,bytes:e.size,status:t,error:n,onRemove:r,onRetry:i})}var Pr={gallery:`_gallery_33xub_1`,frame:`_frame_33xub_18`,loading:`_loading_33xub_51`,error:`_error_33xub_52`};function Fr(e,t){let n=e/t,r=Math.min(4,Math.max(.25,n)),i=r>=1?{width:240,height:240/r}:{width:240*r,height:240},a=Math.min(1,e/i.width,t/i.height);return{width:Math.max(1,Math.round(i.width*a)),height:Math.max(1,Math.round(i.height*a)),objectPosition:n<.25?`center top`:n>4?`left center`:`center`}}function Ir({name:e,messageId:t,index:n,file:r,tile:i,loadImage:a}){let[o,s]=(0,B.useState)(null),[c,l]=(0,B.useState)(!1),[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)(0),[m,h]=(0,B.useState)(null),g=(0,B.useRef)(a);g.current=a,(0,B.useEffect)(()=>{let e=!0,i=null;return s(null),l(!1),h(null),r?(i=URL.createObjectURL(r),s(i)):g.current(t,n).then(t=>{let n=URL.createObjectURL(t);e?(i=n,s(n)):URL.revokeObjectURL(n)}).catch(()=>{e&&l(!0)}),()=>{e=!1,i&&URL.revokeObjectURL(i)}},[r,t,n,f]);let _=!i&&m?Fr(m.width,m.height):null;return c?(0,W.jsx)(`button`,{type:`button`,className:Pr.error,"data-variant":i?`tile`:`single`,onClick:()=>p(e=>e+1),children:U(`图片加载失败,重试`,`Image failed to load. Retry`)}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{type:`button`,className:Pr.frame,"data-variant":i?`tile`:`single`,"aria-label":U(`预览 ${e}`,`Preview ${e}`),title:U(`查看原图`,`View original image`),disabled:!o,onClick:()=>d(!0),style:_?{width:_.width,height:_.height}:void 0,children:o?(0,W.jsx)(`img`,{src:o,alt:e,onLoad:e=>h({width:e.currentTarget.naturalWidth,height:e.currentTarget.naturalHeight}),onError:()=>l(!0),style:_?{objectPosition:_.objectPosition}:void 0}):(0,W.jsx)(`span`,{className:Pr.loading,children:U(`加载中`,`Loading`)})}),u&&o&&(0,W.jsx)(Or,{src:o,alt:e,labels:{dialog:U(`图片预览`,`Image preview`),close:U(`关闭预览`,`Close preview`)},onClose:()=>d(!1)})]})}function Lr(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function G(e,...t){throw Lr(e,...t)}function Rr(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function zr(){return typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0}var Br=zr();function Vr(){return Br&&`documentMode`in document?document.documentMode:null}var Hr=Vr();function Ur(e){return Br&&e.test(navigator.platform)}function Wr(e){return Br&&e.test(navigator.userAgent)}var Gr=Ur(/Mac|iPod|iPhone|iPad/),Kr=Wr(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function qr(){return!(!Br||!(`InputEvent`in window)||Hr)&&`getTargetRanges`in new window.InputEvent(`input`)}var Jr=qr();function Yr(){return Br&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}var Xr=Yr(),Zr=Wr(/Android/),Qr=Wr(/Version\/[\d.]+.*Safari/)&&!Zr,$r=Wr(/^(?=.*Chrome).*/i),ei=Br&&Zr&&$r,ti=Wr(/AppleWebKit\/[\d.]+/)&&Gr&&!$r;function ni(){return 2047}var ri=ni(),ii=Qr||Xr||ti?`\xA0`:`​`,ai=`
23
-
24
- `,oi=Kr?`\xA0`:ii,si={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},ci={directionless:1,unmergeable:2},li={center:2,end:6,justify:4,left:1,right:3,start:5};function ui(e){let t={};for(let n of Object.keys(e))t[e[n]]=n;return t}var di=ui(li),fi={normal:0,segmented:2,token:1},pi=ui(fi),mi=Symbol.for(`@lexical/ctrlOrOtherKey`),hi=`$config`;function gi(e){return()=>{}}function _i(e){return{type:e}}var vi=_i(`SELECTION_CHANGE_COMMAND`),yi=_i(`CLICK_COMMAND`),bi=_i(`BEFORE_INPUT_COMMAND`),xi=_i(`INPUT_COMMAND`),Si=_i(`COMPOSITION_START_COMMAND`),Ci=_i(`COMPOSITION_END_COMMAND`),wi=_i(`DELETE_CHARACTER_COMMAND`),Ti=_i(`INSERT_LINE_BREAK_COMMAND`),Ei=_i(`INSERT_PARAGRAPH_COMMAND`),Di=_i(`CONTROLLED_TEXT_INSERTION_COMMAND`),Oi=_i(`PASTE_COMMAND`),ki=_i(`REMOVE_TEXT_COMMAND`),Ai=_i(`DELETE_WORD_COMMAND`),ji=_i(`DELETE_LINE_COMMAND`),Mi=_i(`FORMAT_TEXT_COMMAND`),Ni=_i(`UNDO_COMMAND`),Pi=_i(`REDO_COMMAND`),Fi=_i(`KEYDOWN_COMMAND`),Ii=_i(`KEY_ARROW_RIGHT_COMMAND`),Li=_i(`MOVE_TO_END`),Ri=_i(`KEY_ARROW_LEFT_COMMAND`),zi=_i(`MOVE_TO_START`),Bi=_i(`KEY_ARROW_UP_COMMAND`),Vi=_i(`KEY_ARROW_DOWN_COMMAND`),Hi=_i(`KEY_ENTER_COMMAND`),Ui=_i(`KEY_SPACE_COMMAND`),Wi=_i(`KEY_BACKSPACE_COMMAND`),Gi=_i(`KEY_ESCAPE_COMMAND`),Ki=_i(`KEY_DELETE_COMMAND`),qi=_i(`KEY_TAB_COMMAND`),Ji=_i(`DROP_COMMAND`),Yi=_i(`DRAGSTART_COMMAND`),Xi=_i(`DRAGOVER_COMMAND`),Zi=_i(`DRAGEND_COMMAND`),Qi=_i(`COPY_COMMAND`),$i=_i(`CUT_COMMAND`),ea=_i(`SELECT_ALL_COMMAND`),ta=_i(`CLEAR_EDITOR_COMMAND`),na=_i(`CLEAR_HISTORY_COMMAND`),ra=_i(`CAN_REDO_COMMAND`),ia=_i(`CAN_UNDO_COMMAND`),aa=_i(`FOCUS_COMMAND`),oa=_i(`BLUR_COMMAND`),sa=_i(`KEY_MODIFIER_COMMAND`);function ca(e,t){return{...t,[mi]:e}}var la=ca(`metaKey`,{ctrlKey:!Gr,metaKey:Gr}),ua=ca(`altKey`,{altKey:Gr,ctrlKey:!Gr}),da=[[`altKey`,1],[`ctrlKey`,2],[`metaKey`,4],[`shiftKey`,8]];function fa(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}var pa=class{byKey=new Map;byCode=new Map;add(e){let{key:t,modifiers:n={}}=e;t.length>0||G(399);let r=t.toLowerCase();for(let i of function(e){let t=[0];for(let[n,r]of da){let i=e[n]||!1;i===`any`?t=t.concat(t.map(e=>e|r)):i&&(t=t.map(e=>e|r))}return t}(n))fa(this.byKey,`${i}:${r}`,e),t.length===1&&(/[0-9]/.test(t)?fa(this.byCode,`${i}:Digit${t}`,e):/[a-z]/.test(r)&&fa(this.byCode,`${i}:Key${r.toUpperCase()}`,e));return this}matches(e){let t=e.key;if(!t)return[];let n=function(e){let t=0;for(let[n,r]of da)e[n]&&(t|=r);return t}(e),r=this.byKey.get(`${n}:${t.toLowerCase()}`),i=r?r.slice():[];if(this.byCode.size>0&&!(t.length===1&&t.charCodeAt(0)<=127)){let t=this.byCode.get(`${n}:${e.code}`);t&&i.push(...t)}return i}match(e){return this.matches(e)[0]}};function ma(e){let t=new pa;for(let n of e)t.add(n);return t}function ha(e){let t=new Map;return{dispose(){for(let e of t.values())e.dispose();t.clear()},register(n,r){let i=t.get(n);i===void 0&&(i={dispose:e(n,r),holders:new Set},t.set(n,i));let a=()=>{let e=t.get(n);e&&e.holders.delete(a)&&e.holders.size===0&&(t.delete(n),e.dispose())};return i.holders.add(a),a}}}function ga(){let e;try{e=`0.53.0+prod.esm`}catch{}return e??`"<unknown>+source"`}var _a=ga(),va=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}},ya=null;function ba(e,t=1e3){return e instanceof xa?e.clone():e.size<t?new Map(e):new xa().init(new Map(e),void 0,e.size)}var xa=class e{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new e().init(this._old,this._nursery,this._size)}init(e,t,n){return this._old=e,this._nursery=t,this._size=n,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){let t=this._nursery&&this._nursery.get(e);return t===void 0?this._old&&this._old.get(e):t}get(e){let t=this.getWithTombstone(e);return t===ya?void 0:t}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let e=new Map(this._old);for(let[t,n]of this._nursery)n===ya?e.delete(t):e.set(t,n);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(e,t){let n=this.getWithTombstone(e);if(n===t)return this;let r=this.getNursery();return n!==ya&&n!==void 0||(this._size++,n===ya&&r.delete(e)),r.set(e,t),this}delete(e){let t=this.has(e);return t&&(this.getNursery().set(e,ya),this._size--),t}getOrInsert(e,t){let n=this.get(e);return n===void 0?(this.set(e,t),t):n}getOrInsertComputed(e,t){let n=this.get(e);if(n!==void 0)return n;let r=t(e);return this.set(e,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,t=this._old;if(e){if(t)for(let n of t){let t=n[0],r=e.get(t);r!==ya&&(r!==void 0&&(n[1]=r),yield n)}for(let n of e)n[1]===ya||t&&t.has(n[0])||(yield n)}else t&&(yield*t)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[t,n]of this.entries())e(n,t,this)}get[Symbol.toStringTag](){return`GenMap`}[Symbol.iterator](){return this.entries()}},Sa=!1;function Ca(e,t,...n){let r=Sa,i;try{Sa=e,i=t()}finally{Sa=r}var a;return(a=i)===null||typeof a!=`object`&&typeof a!=`function`||typeof a.then!=`function`||G(421),i}function wa(){return Sa}function Ta(e){let t=e.exportJSON(Sa),n=e.constructor;return t.type!==n.getType()&&G(130,n.name),q(e)&&!Array.isArray(t.children)&&G(59,n.name),t}function Ea(){return ed()._blockCursorElement}function Da(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-slot`)}var Oa=ti||Xr||Qr;function ka(){let e=Lu().createElement(`img`);e.setAttribute(`data-lexical-decorator-boundary`,`true`),e.alt=``;for(let[t,n]of[[`position`,`absolute`],[`width`,`0px`],[`height`,`0px`],[`border`,`0px`],[`margin`,`0px`],[`padding`,`0px`]])e.style.setProperty(t,n,`important`);return e}function Aa(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-decorator-boundary`)}var ja=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&G(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&G(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&G(359),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&n===0?`before`:`after`;let r=Ma(e,this.element);if(r===null)return`after`;let i=Array.prototype.indexOf.call(e.childNodes,r);if(i<0)return`after`;if(t===e)return n<=i?`before`:`after`;let a=Ma(e,t);if(a===null)return`after`;let o=Array.prototype.indexOf.call(e.childNodes,a);return o>=0&&o<=i?`before`:`after`}getInsertionAnchor(){return this.before}};function Ma(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}var Na=class e extends ja{withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()||this.getDecoratorBoundaryAnchor(`trailing`)}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;Da(t);)e=t,t=t.nextSibling;Aa(t)&&(e=t,t=t.nextSibling);let n=e?e.nextSibling:this.element.firstChild;return n!==null&&n===Ea()?n:e}getDecoratorBoundaryAnchor(e){let t;if(e===`leading`){let e=super.getFirstChildAnchor();for(t=e?e.nextSibling:this.element.firstChild;Da(t);)t=t.nextSibling}else t=this.before?this.before.previousSibling:this.element.lastChild,t!==null&&t===Ea()&&(t=t.previousSibling);return Aa(t)?t:null}setDecoratorBoundaryAnchor(e,t){let n=this.getDecoratorBoundaryAnchor(e);if(t!==(n!==null)){if(n!==null)this.element.removeChild(n);else if(e===`leading`){let e=this.getFirstChildAnchor();this.element.insertBefore(ka(),e?e.nextSibling:this.element.firstChild)}else this.element.insertBefore(ka(),this.before)}}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){let t=this.element,n=this.after===null?t.firstChild:this.after.nextSibling,r=e===`empty`&&Da(n)?null:e;if(t.__lexicalLastChildKind!==r){if(t.__lexicalLastChildKind=r,r===null)this.removeManagedLineBreak();else{let e=r===`decorator`&&Oa;this.insertManagedLineBreak(e)}}}removeManagedLineBreak(){let e=this.element,t=this.getManagedLineBreak();if(t){t.remove();for(let t of e.querySelectorAll(`:scope > [data-lexical-managed-linebreak]`))t.remove();e.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.element,n=this.getManagedLineBreak();if(n){let r=e?n.nextSibling:n;if(r&&r===t.querySelector(`:scope > br[data-lexical-managed-linebreak]`))return;this.removeManagedLineBreak()}let r=this.before||this.getDecoratorBoundaryAnchor(`trailing`),i=Lu().createElement(`br`);if(i.setAttribute(`data-lexical-managed-linebreak`,`true`),t.insertBefore(i,r),e){let e=Lu().createElement(`img`);e.setAttribute(`data-lexical-managed-linebreak`,`true`),e.style.setProperty(`display`,`inline`,`important`),e.style.setProperty(`border`,`0px`,`important`),e.style.setProperty(`margin`,`0px`,`important`),e.alt=``,t.insertBefore(e,i),t.__lexicalLineBreak=e}else t.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),t=this.getInsertionAnchor(),n=0;for(let r=this.element.firstChild;r!==null&&r!==e&&r!==t;r=r.nextSibling)n++;return n}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset(),n=Ea(),i=this.element.childNodes,a=Math.min(r,i.length),o=0;for(let e=t;e<a;e++)i[e]!==n&&o++;return[e,Math.min(o,e.getChildrenSize())]}let i=Pa(t,n);i.push(r);let a=Pa(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function Pa(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&G(225),n.reverse()}var Fa=!1,Ia=0;function La(){Ia=performance.now()}function Ra(e){return qu(e)&&e.hasAttribute(`data-lexical-managed-linebreak`)}function za(e,t,n){let r=Au(yu(n)),i=r&&Bu(r,n._rootElement),a=null,o=null;i!==null&&i.anchorNode===e&&(a=i.anchorOffset,o=i.focusOffset);let s=e.nodeValue;s!==null&&Ql(t,s,a,o,!1)}function Ba(e,t,n){if(X(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return Cl(t)&&n.isAttached()}function Va(e,t,n){for(let r=e;r&&!md(r);r=du(r)){let e=Il(r,t);if(e!==void 0){let t=Nl(e,n);if(t)return sc(t)||!qu(r)?void 0:[r,t]}}}function Ha(e,t,n,r){Fa=!0;let i=e._inputState.unprocessedBeforeInputData===null&&performance.now()-Ia>100;try{ep(e,()=>{let a=Z()||function(e){return e.read(`latest`,()=>{let e=Z();return e===null?null:e.clone()})}(e),o=new Map,s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n of t){let t=n.type,d=n.target,f=Va(d,e,s);if(!f)continue;let[p,m]=f;if(t===`characterData`)r?J(m)&&m.isAttached()&&m.markDirty():i&&J(m)&&Cl(d)&&Ba(a,d,m)&&za(d,m,e);else{l=!0;for(let t of n.addedNodes){let n=Il(t,e);if(t!==c&&t.parentNode===d&&(n?e.getElementByKey(n)!==t:!(e._slotsUsed&&qu(t)&&t.hasAttribute(`data-lexical-slot`)||md(t)))){if(Kr){let e=(qu(t)?t.innerText:null)||t.nodeValue;e&&(u+=e)}d.removeChild(t)}}for(let e of n.removedNodes){let t=c===e;if(t||Aa(e)||Ra(e)){let t=n.nextSibling,r=n.previousSibling;d.insertBefore(e,t&&t.parentNode!==d?r?r.parentNode===d?r.nextSibling:null:d.firstChild:t)}t||o.set(p,m)}}}for(let[t,n]of o)n.reconcileObservedMutation(t,e);let d=n.takeRecords();for(let t of d)for(let n of t.addedNodes)n.nodeName!==`BR`||Il(n,e)||Ra(n)||n.remove();n.takeRecords(),a!==null&&(l&&Ul(a),Kr&&cu(e)&&a.insertRawText(u))})}finally{Fa=!1}}function Ua(e,t,n){let r=e._observer;if(r!==null){let i=r.takeRecords();(!n||i.length>0)&&Ha(e,i,r,t)}}function Wa(e){(function(e){yu(e).addEventListener(`textInput`,La,!0)})(e),e._observer=new MutationObserver((t,n)=>{Ha(e,t,n)})}function Ga(e,t,n){let{isEqual:r}=e;return t===n||r!==void 0&&r(t,n)}function Ka(e,t){return Ga(e,t,e.defaultValue)}function qa(e){return typeof e==`object`&&!!e}function Ja(e,t){let n=$a(e,t).getter;return qa(n)&&n.getterTable!==void 0||G(405,t),Qa(n.getterTable)}function Ya(e,t){let n=$a(e,t).setter;return qa(n)&&n.setterTable!==void 0||G(406,t),Qa(n.setterTable)}function Xa(e,t,n){let{meta:r}=$a(e,t);for(let e=0;;)if(r.kind===`aliased`){if(e===n)return Qa(r.aliases);e++,r=r.inner.meta}else r.kind===`nullable`||r.kind===`optional`?r=r.inner.meta:r.kind===`array`?r=r.item.meta:G(407,t,String(n))}function Za(e,t){let n=$a(e,t),{setter:r}=n;qa(r)&&r.setterTable!==void 0||G(408,t);let i=String(n.defaultValue);return oo(r.setterTable,i)||G(409,t,i),r.setterTable[i]}function Qa(e){return Object.assign(Object.create(null),e)}function $a(e,t){let n=e.get(t);return n===void 0&&G(410,t),n}function eo(e,t,n,r,i){i!==void 0&&to.add(i);let a=n===void 0,o=a?e(void 0):n;return a&&io(o),Object.assign(e,{accepts:i,defaultValue:o,isEqual:r,meta:t})}var to=new WeakSet,no=new WeakSet;function ro(e){return typeof e==`object`&&e&&no.add(e),e}function io(e){if(typeof e==`object`&&e&&!Object.isFrozen(e)&&!no.has(e)){Object.freeze(e);for(let t of Object.values(e))io(t)}}function ao(e,t){let{accepts:n}=e;return n===void 0?function(e,t){let{accepts:n}=e;if(n!==void 0)return ao(e,t)?{parsed:e(t)}:void 0;let r=e(t);return Ka(e,r)&&t!==e.defaultValue?void 0:{parsed:r}}(e,t)!==void 0:n.call(e,t)}function oo(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function so(e=``){return eo(t=>typeof t==`string`?t:e,{kind:`string`},void 0,void 0,e=>typeof e==`string`)}var co=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function lo(e=0,t={}){let{integer:n,clamp:r}=t,i=n&&t.min!==void 0?Math.ceil(t.min):t.min,a=n&&t.max!==void 0?Math.floor(t.max):t.max,o=e=>typeof e==`string`&&co.test(e)?Number(e):e,s=e=>typeof e==`number`&&Number.isFinite(e)&&(!n||Number.isInteger(e)),c=e=>s(e)&&(i===void 0||e>=i)&&(a===void 0||e<=a);return eo(t=>{let n=o(t);return r&&s(n)?i!==void 0&&n<i?i:a!==void 0&&n>a?a:n:c(n)?n:e},{clamp:r,integer:n,kind:`number`,max:a,min:i},void 0,void 0,e=>r?s(o(e)):c(o(e)))}function uo(e,...t){let n=ro(t.length===0?e[0]:t[0]),r=new Set(e);return eo(e=>e!==void 0&&r.has(e)?e:n,{kind:`enum`,values:e},n,void 0,e=>r.has(e)&&(e!==void 0||n===void 0))}function fo(){return e=>function(e){return{meta:{fields:e,kind:`node`}}}(e)}function po(e,t){let n=e=>typeof e==`string`&&oo(t,e);return eo(r=>n(r)?t[r]:e(r),{aliases:t,inner:e,kind:`aliased`},e.defaultValue,e.isEqual,t=>n(t)||ao(e,t))}function mo(e,t){return go(0,e,{getter:{field:t.field,getterTable:t.getterTable,method:t.getter,when:t.when},setter:{field:t.field,method:t.setter,setterTable:t.setterTable}},!0===t.derived)}function ho(e,t){return go(0,e,{getter:t.getter,setter:t.setter},!0===t.derived)}function go(e,t,n,r=!1){return Object.assign(e=>t(e),{accepts:t.accepts,defaultValue:t.defaultValue,...r?{derived:!0}:{},getter:n.getter,isEqual:t.isEqual,meta:t.meta,setter:n.setter})}var _o=`latest`,vo=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;derived;schema;constructor(e,t){this.key=e,this.derived=!0===t.derived;let n=`meta`in(r=t.parse)&&typeof r.meta==`object`&&r.meta!==null&&`kind`in r.meta&&typeof r.meta.kind==`string`&&`defaultValue`in r?t.parse:void 0;var r;this.schema=n,this.parse=t.parse.bind(t),this.unparse=(t.unparse||ko).bind(t),this.isEqual=t.isEqual?t.isEqual.bind(t):n!==void 0&&n.isEqual!==void 0?(e,t)=>Ga(n,e,t):Object.is,this.defaultValue=n===void 0?this.parse(void 0):n.defaultValue,this.resetOnCopyNode=t.resetOnCopyNode||!1}};function yo(e,t){return new vo(e,t)}function bo(e,t,n=_o){let r=(n===`latest`?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function xo(e,t,n){let r;if(Pf(),typeof n==`function`){let i=e.getLatest(),a=bo(i,t);if(r=So(t,n(a)),t.isEqual(a,r))return i}else r=So(t,n);let i=e.getWritable();return Eo(i).updateFromKnown(t,r),i}function So(e,t){let{schema:n}=e;return n!==void 0&&n.meta.kind===`set`?e.parse(t):t}function Co(e){let t=new Map,n=new Set;for(let{ownNodeConfig:r}of Wd(typeof e==`function`?e:e.replace))if(r&&r.stateConfigs)for(let e of r.stateConfigs){let r;`stateConfig`in e?(r=e.stateConfig,e.flat&&n.add(r.key)):r=e,t.set(r.key,r)}return{flatKeys:n,sharedConfigMap:t}}var wo=new Set([`__proto__`,`constructor`,`prototype`]),To=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.knownState.set(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return Oo(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){if(wo.has(i))continue;let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;i&&n in i?(delete i[n],this.unknownState=Oo(i)):r.has(e)||this.size++,r.set(e,t)}updateFromUnknown(e,t){if(wo.has(e))return;let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function Eo(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new To(t,function(e){return e.__state?e.__state.sharedNodeState:fl(ed(),e.getType()).sharedNodeState}(t));return t.__state=n,n}function Do(e,t){let n=e.getWritable(),r=t.$;return(n.__state||r)&&Eo(e).updateFromJSON(r),n}function Oo(e){if(e)for(let t in e)return e}function ko(e){return e}function Ao(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function jo(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function Mo(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function No(e){return!uc(e)&&e.getTextContent!==ic.prototype.getTextContent}var Po=Symbol.for(`@lexical/CachedTextSize`);function Fo(e,t){return Zo.read(()=>{let n=0,r=e;for(let e=0;e<t&&r!==null;e++){let i=Xo.get(r);if(i===void 0&&G(345,r),q(i)){let a=Qo.get(r);if(a!==void 0&&q(a)&&a.__parent!==i.__parent)n+=i.getTextContentSize();else{let e=$o.get(r),t=e&&e.__lexicalTextContent;typeof t!=`string`&&G(346,i.getType()),n+=t.length}e<t-1&&!i.isInline()&&(n+=2)}else if(hs(i).size>0)n+=i.getTextContentSize();else{let e=i[Po];e===void 0&&G(347,i.getType(),r),n+=e}r=i.__next}return n},{editor:K})}function Io(e){q(e)||hs(e).size>0||e[Po]===void 0&&(e[Po]=J(e)?e.__text.length:e.getTextContentSize())}var Lo=4,Ro,K,zo,Bo=``,Vo=null,Ho=null,Uo=null;function Wo(){return{firstTextKey:Uo,format:Vo,style:Ho}}function Go(e){e.firstTextKey!==null&&(Vo=e.format,Ho=e.style,Uo=e.firstTextKey)}function Ko(e){if(Uo!==null)return;let t=e.__lexicalFirstTextKey;if(t===void 0&&G(348),t===null)return;let n=Qo.get(t);J(n)&&(Vo=n.getFormat(),Ho=n.getStyle(),Uo=t)}var qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts,ns,rs=!1,is=!1;function as(e,t){let n=Xo.get(e),r=Qo.has(e);if(t!==null){let n=As(e);n.parentNode===t&&t.removeChild(n)}if(!r){if(K._keyToDOMMap.delete(e),q(n)){let e=qd(n,Xo);os(e,0,e.length-1,null)}if(n!==void 0){for(let e of hs(n).values()){let t=_s(e);as(e,null),t!==null&&t.remove()}au(ts,zo,qo,n,`destroyed`)}}}function os(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&as(t,r)}}function ss(e,t){e.setProperty(`text-align`,t)}var cs=`40px`;function ls(e,t){let n=Ro.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}e.style.setProperty(`padding-inline-start`,t===0?``:`calc(${t} * var(--lexical-indent-base-value, ${cs}))`),ru(e,`class`),ru(e,`style`)}function us(e,t){let n=e.style;t===0?ss(n,``):t===1?ss(n,`left`):t===2?ss(n,`center`):t===3?ss(n,`right`):t===4?ss(n,`justify`):t===5?ss(n,`start`):t===6&&ss(n,`end`),ru(e,`style`)}function ds(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(uc(e))return null;let n=e.getParent();return n===null||Cu(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function fs(e){let t=Lu().createElement(`div`);return t.setAttribute(`data-lexical-slot`,e),t.style.display=`none`,t}function ps(e,t,n){t||e.contentEditable===`false`?hd(n,K):n.removeAttribute(`contenteditable`)}function ms(e,t,n){let r=Bo,i=Wo();Bo=``;let a=``,o=sc(e);for(let[r,i]of n){let n=fs(r);ps(t,o,n),t.appendChild(n),Bo=``;let s=Wo();ys(i,nd(e,n,K)),Go(s),gs(e,r,t,n),a+=Bo}return Go(i),Bo=r,a}function hs(e){return lh(e)&&e.__slots!==null?e.__slots:ch}function gs(e,t,n,r){let i=ns.$getSlotTargetElement(e,t,n,K);i!==null&&(r.parentElement!==i&&i.appendChild(r),r.style.display=``)}function _s(e){let t=$o.get(e);return t===void 0?null:t.parentElement}function vs(e,t,n){let r=hs(e),i=hs(t);for(let[e,t]of r)if(!i.has(e)){let e=_s(t);as(t,null),e!==null&&e.remove()}let a=Bo,o=Wo(),s=``,c=null,l=sc(t);for(let[e,a]of i){let i=r.get(e),o=i===void 0?null:_s(i);Bo=``;let u=Wo();if(o===null){o=fs(e);let r=null;for(let e of n.children)if(!e.hasAttribute(`data-lexical-slot`)){r=e;break}n.insertBefore(o,r),ys(a,nd(t,o,K))}else i===a?Ts(a,o):(i!==void 0&&as(i,o),ys(a,nd(t,o,K)));if(Go(u),ps(n,l,o),gs(t,e,n,o),s+=Bo,o.parentElement===n){let e=c===null?n.firstChild:c.nextSibling;e!==o&&n.insertBefore(o,e),c=o}}return Go(o),Bo=a,s}function ys(e,t){let n=Qo.get(e);if(n===void 0&&G(60),t!==null){let r=Xo.get(e);if(r!==void 0){let i=$o.get(e);if(i!==void 0){let a=uh(r)?r.__slotHost:null,o=uh(n)?n.__slotHost:null,s=r.__parent!==n.__parent||a!==o,c=o!==null&&i.parentElement!==t.element;if(s||c)return t.insertChild(i),Ts(e,t.element)}}}let r=ns.$createDOM(n,K);if(function(e,t,n){let r=n._keyToDOMMap;Fl(t,n,e),r.set(e,t)}(e,r,K),J(n)?r.setAttribute(`data-lexical-text`,`true`):sc(n)&&(r.setAttribute(`data-lexical-decorator`,`true`),pd(r,{captureSelection:!0})),q(n)){let e=Bo,t=n.__indent,i=n.__size;ds(r,n),t!==0&&ls(r,t);let a=hs(n),o=a.size>0?ms(n,r,a):``;if(i===0)r.__lexicalTextContent=o,r.__lexicalFirstTextKey=null,Bo+=o,a.size>0&&(r.__lexicalSlotTextLength=o.length);else{let t=i-1;if(bs(qd(n,Qo),n,0,t,nd(n,r,K)),o!==``){let t=r.__lexicalTextContent||``;r.__lexicalTextContent=o+t,Bo=e+o+t}a.size>0&&(r.__lexicalSlotTextLength=o.length)}if(No(n)){let t=n.getTextContent();r.__lexicalTextContent=t,Bo=e+t}let s=n.__format;s!==0&&us(r,s),n.isInline()||(Cs(0,n,r),Ss(n,r))}else{let t=n.getTextContent();if(sc(n)){let t=n.decorate(K,Ro);t!==null&&Es(e,t),r.contentEditable=`false`;let i=hs(n);i.size>0&&ms(n,r,i)}Bo+=t}return t!==null&&t.insertChild(r),ns.$decorateDOM(n,null,r,K),Io(n),au(ts,zo,qo,n,`created`),r}function bs(e,t,n,r,i){let a=Bo,o=Wo();Bo=``,Vo=null,Ho=null,Uo=null;let s=n;for(;s<=r;++s){let t=Wo();ys(e[s],i);let n=Qo.get(e[s]);n!==null&&J(n)?Vo===null&&(Vo=n.getFormat(),Ho=n.getStyle(),Uo=n.__key):q(n)&&s<r&&!n.isInline()&&(Bo+=ai),Go(t)}let c=K._keyToDOMMap.get(t.__key);c===void 0&&G(349,t.__key),c.__lexicalTextContent=Bo,c.__lexicalFirstTextKey=Uo,Bo=a+Bo,Go(o)}function xs(e){return sc(e)&&!e.isInline()}function Ss(e,t,n=nd(e,t,K)){n.setDecoratorBoundaryAnchor(`leading`,xs(e.getFirstChild())),n.setDecoratorBoundaryAnchor(`trailing`,xs(e.getLastChild()))}function Cs(e,t,n){let r=nd(t,n,K),i=function(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return uf(e)?`line-break`:sc(e)&&e.isInline()?`decorator`:null}return`empty`}return null}(t,Qo);r.setManagedLineBreak(i)}function ws(e,t,n){let r=t.__lexicalFirstTextKey;if(r!=null){let t=e.__key,i=r;for(;i!==null;){let e=Qo.get(i);if(e===void 0){i=null;break}if(e.__parent===t)break;i=e.__parent}if(i!==null&&!n.has(i)){let e=Qo.get(r);if(J(e))return Vo=e.getFormat(),void(Ho=e.getStyle())}}t.__lexicalFirstTextKey=Uo}function Ts(e,t){let n=Xo.get(e),r=Qo.get(e);n!==void 0&&r!==void 0||G(61);let i=rs||Yo.has(e)||Jo.has(e),a=uu(K,e);if(n===r&&!i){let e;if(q(n)){let t=a.__lexicalTextContent;typeof t!=`string`&&G(355,n.getType()),e=t,Ko(a)}else e=n.getTextContent();return Bo+=e,a}if(n!==r&&i&&au(ts,zo,qo,r,`updated`),ns.$updateDOM(r,n,a,K)){let n=ys(e,null);return t===null&&G(62),t.replaceChild(n,a),as(e,null),n}if(q(n)){q(r)||G(334,e);let t=r.__indent;(rs||t!==n.__indent)&&ls(a,t);let o=r.__format;(rs||o!==n.__format)&&us(a,o);let s=i&&(hs(r).size>0||hs(n).size>0)?vs(n,r,a):``;if(i){let e=Bo;if(function(e,t,n){var r;Vo=null,Ho=null,Uo=null,function(e,t,n){let r=Bo,i=e.__size,a=t.__size;Bo=``;let o=n.element,s=K._keyToDOMMap.get(t.__key);s===void 0&&G(351,t.__key);let c=a-i;if(!rs&&Math.abs(c)<=1&&i>=Lo&&e.__first===t.__first&&(c!==0||!K._cloneNotNeeded.has(e.__key))){let i=s.__lexicalTextContent,l=es.get(e.__key);if(!rs&&!No(t)&&typeof i==`string`&&l!==void 0){let a=function(e,t){let n=t.size;if(n===0||n>=e.__size)return null;let r=e.__last,i=null,a=0;for(;r!==null&&a<n;){if(!t.has(r))return null;i=r;let e=Qo.get(r);if(e===void 0)return null;r=e.__prev,a++}return a!==n||r!==null&&t.has(r)?null:i}(t,l);if(a!==null){let u=l.size;if(c===0){let e=Fo(a,u),n=a,c=0;for(;n!==null&&c<u;){let e=Qo.get(n);if(e===void 0)break;let t=Wo();Ts(n,o),J(e)&&Vo===null&&(Vo=e.getFormat(),Ho=e.getStyle(),Uo=e.__key),Go(t),n=e.__next,c++}let d=``;for(n=a,c=0;n!==null&&c<u;){let e=Qo.get(n);if(e===void 0)break;let t;if(q(e)){let r=K._keyToDOMMap.get(n),i=r&&r.__lexicalTextContent;typeof i!=`string`&&G(352,e.getType()),t=i}else t=e.getTextContent();d+=t,c<u-1&&q(e)&&!e.isInline()&&(d+=ai),n=e.__next,c++}let f=s.__lexicalSlotTextLength||0,p=f>0?i.slice(f):i,m=p.slice(0,p.length-e)+d;s.__lexicalTextContent=m,Bo=r+m,ws(t,s,l);return}if(function(e,t,n,r,i,a,o,s){if(s!==1&&s!==-1||o!==(s===1?2:1))return!1;let c=o-s,l=e.__last;for(let e=0;e<c-1;e++){if(l===null)return!1;let e=Xo.get(l);if(e===void 0)return!1;l=e.__prev}if(l===null)return!1;let u=Qo.get(a),d=Xo.get(l);if(u===void 0||d===void 0||u.__prev!==d.__prev)return!1;let f=[],p=a;for(let e=0;e<o;e++){if(p===null)return!1;f.push(p);let e=Qo.get(p);p=e?e.__next:null}let m=[];p=l;for(let e=0;e<c;e++){if(p===null)return!1;m.push(p);let e=Xo.get(p);p=e?e.__next:null}let h=new Set(m),g=new Set(f),_=[],v=0,y=0;for(;v<c&&y<o;)if(f[y]===m[v])_.push({key:f[y],kind:`reconcile`}),v++,y++;else if(g.has(m[v])){if(h.has(f[y]))return!1;_.push({key:f[y],kind:`create`,nextIndex:y}),y++}else _.push({key:m[v],kind:`destroy`}),v++;for(;v<c;)_.push({key:m[v++],kind:`destroy`});for(;y<o;)_.push({key:f[y],kind:`create`,nextIndex:y}),y++;let b=Fo(l,c);for(let e of _){let t=Wo();if(e.kind===`reconcile`)Ts(e.key,n.element);else if(e.kind===`destroy`)as(e.key,n.element);else{let t=null;for(let n=e.nextIndex+1;n<o;n++){let e=K._keyToDOMMap.get(f[n]);if(e!==void 0){t=e;break}}ys(e.key,n.withBefore(t??n.before))}if(e.kind!==`destroy`){let t=Qo.get(e.key);t&&J(t)&&Vo===null&&(Vo=t.getFormat(),Ho=t.getStyle(),Uo=t.__key)}Go(t)}let x=``;for(let e=0;e<o;e++){let t=Qo.get(f[e]);if(t===void 0)return!1;let n;if(q(t)){let r=K._keyToDOMMap.get(f[e]),i=r&&r.__lexicalTextContent;typeof i!=`string`&&G(350,t.getType()),n=i}else n=t.getTextContent();x+=n,e<o-1&&q(t)&&!t.isInline()&&(x+=ai)}let S=r.__lexicalSlotTextLength||0,C=S>0?i.slice(S):i;return r.__lexicalTextContent=C.slice(0,C.length-b)+x,!0}(e,0,n,s,i,a,u,c)){let e=s.__lexicalTextContent;typeof e!=`string`&&G(353),Bo=r+e,ws(t,s,l);return}}}if(c===0){let t=e.__first,n=0;for(;t!==null;){let e=Qo.get(t);if(e===void 0)break;let r=rs||Yo.has(t)||Jo.has(t),i=Wo();if(r)Ts(t,o);else{let n,r;if(q(e)){r=$o.get(t);let i=r&&r.__lexicalTextContent;typeof i!=`string`&&G(354,e.getType()),n=i}else n=e.getTextContent();Bo+=n,r!==void 0&&Ko(r)}J(e)?Vo===null&&(Vo=e.getFormat(),Ho=e.getStyle(),Uo=e.__key):q(e)&&n<a-1&&!e.isInline()&&(Bo+=ai),Go(i),t=e.__next,n++}s.__lexicalTextContent=Bo,s.__lexicalFirstTextKey=Uo,Bo=r+Bo;return}}if(i===1&&a===1){let r=e.__first,i=t.__first;if(r===i)Ts(r,o);else{let e=As(r),t=ys(i,null);try{e.parentNode===o?o.replaceChild(t,e):n.insertChild(t)}catch(n){if(typeof n==`object`&&n){let a=`${n.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${i}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw Error(a)}throw n}as(r,null)}let a=Qo.get(i);J(a)&&Vo===null&&(Vo=a.getFormat(),Ho=a.getStyle(),Uo=a.__key)}else{let r=qd(e,Xo),s=qd(t,Qo);if(r.length!==i&&G(227),s.length!==a&&G(228),i===0)a!==0&&bs(s,t,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&hs(t).size===0&&n.element.__lexicalLineBreak==null;os(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else(function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f],i=Wo();if(e===r)u=Ds(Ts(r,a.element)),d++,f++;else{if(l===void 0&&(l=Os(n,f)),c===void 0)c=Os(t,d);else if(!c.has(e)){d++,Go(i);continue}if(!l.has(e)){let t=As(e);t.parentNode===a.element&&(u=Ds(t)),as(e,a.element),d++,c.delete(e),Go(i);continue}if(c.has(r)){let e=uu(K,r);e!==u&&a.withBefore(u??a.before).insertChild(e),u=Ds(Ts(r,a.element)),d++,f++}else ys(r,a.withBefore(u??a.before)),f++}let o=Qo.get(r);o!==null&&J(o)?Vo===null&&(Vo=o.getFormat(),Ho=o.getStyle(),Uo=o.__key):q(o)&&f<=s&&!o.isInline()&&(Bo+=ai),Go(i)}let p=d>o,m=f>s;if(p&&!m){let t=n[s+1],r=t===void 0?null:K.getElementByKey(t);bs(n,e,f,s,a.withBefore(r??a.before))}else m&&!p&&os(t,d,o,a.element)})(t,r,s,i,a,n)}s.__lexicalTextContent=Bo,s.__lexicalFirstTextKey=Uo,Bo=r+Bo}(e,t,nd(t,n,K)),Cu(t)||(r=t,Vo==null||Vo===r.__textFormat||is||r.setTextFormat(Vo),function(e){Ho==null||Ho===e.__textStyle||is||e.setTextStyle(Ho)}(t))}(n,r,a),r.isInline()||(uc(r)||Cs(0,r,a),Ss(r,a)),s!==``){let t=a.__lexicalTextContent||``;a.__lexicalTextContent=s+t,Bo=e+s+t,a.__lexicalSlotTextLength=s.length}else(hs(r).size>0||hs(n).size>0)&&(a.__lexicalSlotTextLength=0);if(No(r)){let t=r.getTextContent();a.__lexicalTextContent=t,Bo=e+t}}else{let e=a.__lexicalTextContent;typeof e!=`string`&&G(356,n.getType()),Bo+=e,Ko(a)}if((rs||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(ds(a,r),uc(r)&&!rs))for(let e of r.getChildren())q(e)&&ds(uu(K,e.getKey()),e)}else{let t=r.getTextContent();if(sc(r)){let t=r.decorate(K,Ro);t!==null&&Es(e,t),i&&(hs(r).size>0||hs(n).size>0)&&vs(n,r,a)}Bo+=t}if(!is&&uc(r)){let e=r.getLatest();if(e.__cachedText!==Bo){let t=e.getWritable();t.__cachedText=Bo,r=t}}return ns.$decorateDOM(r,n,a,K),Io(r),a}function Es(e,t){let n=K._pendingDecorators,r=K._decorators;if(n===null){if(r[e]===t)return;n=Rl(K)}n[e]=t}function Ds(e){let t=e.nextSibling;return t!==null&&t===K._blockCursorElement&&(t=t.nextSibling),t}function Os(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function ks(e,t,n,r,i,a){Bo=``,Vo=null,Ho=null,Uo=null,rs=r===2,K=n,Ro=n._config,ns=n._config.dom||_f,zo=n._nodes,qo=K._listeners.mutation,Jo=i,Yo=a,Xo=e._nodeMap,Zo=e,Qo=t._nodeMap,is=t._readOnly,$o=ba(n._keyToDOMMap),es=function(){let e=new Map,t=t=>{for(let n of t){let t=Qo.get(n);if(t===void 0)continue;let r=t.__parent;if(r===null)continue;let i=e.get(r);i===void 0&&(i=new Set,e.set(r,i)),i.add(n)}};return t(Jo.keys()),t(Yo),e}();let o=new Map;return ts=o,Ts(`root`,null),K=void 0,zo=void 0,Jo=void 0,Yo=void 0,Xo=void 0,Zo=void 0,Qo=void 0,Ro=void 0,$o=void 0,es=void 0,ts=void 0,ns=_f,o}function As(e){let t=$o.get(e);return t===void 0&&G(75,e),t}function js(e,t,n){Pf();let r=e.__key,i=e.getParent();if(i===null)return void(dh(e)!==null&&G(367,r,String(dh(e))));let a=function(e){let t=Z();if(!X(t)||!q(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return _u(i,e)&&n.set(e.__key,0,`element`),_u(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(X(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(Vm(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(Vm(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else lm(a)&&t&&e.isSelected()&&e.selectPrevious();ih(e.getWritable(),t&&!o&&X(a)?a:null),n||Cu(i)||i.canBeEmpty()||!i.isEmpty()||js(i,t),t&&a&&uc(i)&&i.isEmpty()&&i.selectEnd()}var Ms=Symbol.for(`ephemeral`);function Ns(e){return e[Ms]||!1}var Ps={configurable:!0,enumerable:!1,value:void 0,writable:!0},Fs=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=Ld(this);return e===void 0&&G(64,this.name),e}static clone(e){G(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Jd(this.constructor);return Object.assign(t,{extends:n}),typeof e==`string`&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&=this.__state.getWritable(this).resetOnCopyNode()}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",Ps),Object.defineProperty(this,Po,Ps),Dl(this,e)}getType(){return this.__type}isInline(){G(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=Nl(e);if(t===null)break;e=t.__parent===null?dh(t):t.__parent}return!1}isSelected(e){let t=e||Z();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(J(this))return n;if(X(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(sc(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:Nl(e)}getParentOrThrow(){let e=this.getParent();return e===null&&G(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(Cu(t)||dh(e)!==null)return q(e)||e===this&&sc(e)||G(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&G(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:Nl(e)}getPreviousSiblings(){return sh(this.getPreviousSibling(),`previous`).reverse()}getNextSibling(){let e=this.getLatest().__next;return e===null?null:Nl(e)}getNextSiblings(){return sh(this.getNextSibling(),`next`)}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=ug(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?sg(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&G(279),!1)))}isParentOf(e){return _u(e,this)}getNodesBetween(e){let t=this.isBefore(e),n=[],r=this,i=!0,a=0;for(;r!==null&&((i||a===0)&&n.push(r),!r.is(e));){!i&&a>0&&a--;let e=i&&q(r)?t?r.getFirstChild():r.getLastChild():null;e!==null&&a++;let n=e||(t?r.getNextSibling():r.getPreviousSibling());i=n!==null,r=n||r.getParent()}return t?n:n.reverse()}isDirty(){let e=Rf()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Ns(this))return this;let e=Nl(this.__key);return e===null&&G(442,this.__key,this.__type),e}getWritable(){if(Ns(this))return this;Pf();let e=If(),t=Rf(),n=this.__key,r=t._cloneNotNeeded,i=r.get(n),a=e._selection;if(a!==null&&a.setCachedNodes(null),i!==void 0)return kl(i),i;let o=e._nodeMap,s=o.get(n);s===void 0&&G(442,n,this.__type);let c=cd(s);return r.set(n,c),o.set(n,c),kl(c),c}getTextContent(){return Th(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){G(70)}updateDOM(e,t,n){G(71)}getDOMSlot(e){return new ja(e)}exportDOM(e){return{element:td(e).$createDOM(this,e)}}exportJSON(e=!1){let t=function(e,t){let n=bd(yd(e.constructor)),{generated:r,isCompactDefault:i}=n,a=r===null?void 0:t?r.exportCompactJSON:r.exportJSON;return a===void 0?function(e,t,n){let r=n?{type:e.__type}:{};return q(e)&&(r.children=[]),function(e,t,n,r){for(let i=0;i<t.length;i++){let a=t[i];if(r&&a.derived)continue;let o;if(a.kind===`ownField`){let t=Md(e)[a.field];o=a.getterTable===void 0?t:oo(a.getterTable,t)?a.getterTable[t]:void 0}else o=a.getter.call(e);a.kind===`ownField`&&a.when!==void 0&&(!Nd(a,o)&&a.when.call(e)||(o=void 0)),r&&Nd(a,o)||(n[a.key]=o)}}(e,t,r,n),n||(r.type=e.__type,r.version=1),r}(e,n.getters,t):t?a(e,i):a(e)}(this,e),n=this.__state?this.__state.toJSON():void 0;return n!==void 0&&Object.assign(t,n),t}static importJSON(e){G(18,this.name)}updateFromJSON(e){return Id(Do(this,e),e)}static transform(){return null}remove(e){js(this,!0,e)}replace(e,t){Pf();let n=Z();n!==null&&(n=n.clone()),Eu(this,e);let r=this.getLatest(),i=this.__key,a=fh(r);a!==null&&G(400,i,r.getType(),a.getKey(),a.getType());let o=e.__key,s=e.getWritable(),c=this.getParentOrThrow().getWritable(),l=c.__size,u=s.getParent();ih(s,X(n)?n:null);let d=r.getPreviousSibling(),f=r.getNextSibling();js(r,!1,!0),nh(c,s,d&&d.getWritable(),f&&f.getWritable()),c.__size=u!==null&&u.is(c)?l-1:l;let p=0;if(t&&(q(this)&&q(s)||G(139),p=s.getChildrenSize(),s.splice(p,0,this.getChildren())),X(n)){Ul(n);for(let e of[n.anchor,n.focus])e.key===i&&(t&&e.type===`element`?e.set(s.__key,p+e.offset,`element`):nm(e,s))}return jl()===i&&Al(o),s}insertAfter(e,t=!0){return ah(this,`next`,e,t)}insertBefore(e,t=!0){return ah(this,`previous`,e,t)}isParentRequired(){return!1}createParentElementNode(){return nl()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){return oh(Uh(this,`previous`),e,t)}selectNext(e,t){return oh(Uh(this,`next`),e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}};function Is(e){return e instanceof Fs}function Ls(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;let n=new Set;return!(e&&Ao(n,e,t)||t&&Ao(n,t,e)||e&&jo(n,e,t)||t&&jo(n,t,e))}(c,l))}function Rs(e,t){let n=e.mergeWithSibling(t),r=Rf()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function zs(e){let t,n,r=e;if(!Ml(r)){if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&J(t)&&t.isSimpleText()&&!t.isUnmergeable()&&!Ml(t);){if(t.__text!==``){if(Ls(t,r)){r=Rs(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&J(n)&&n.isSimpleText()&&!n.isUnmergeable()&&!Ml(n);){if(n.__text!==``){if(Ls(r,n)){r=Rs(r,n);break}break}n.remove()}}else r.remove()}}function Bs(e){return Vs(e.anchor),Vs(e.focus),e}function Vs(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),J(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!q(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var Hs=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Us(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!Hs.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function Ws(e,t,n,r,i){let a=Us(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}var Gs=e=>{let t=Ja(e,`format`),n=Ya(e,`format`),r=Za(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Ws(t.indent,0,0,1/0),e.__textFormat=Us(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}};function Ks(e,t){e.__detail=t.__detail,e.__format=t.__format,e.__mode=t.__mode,e.__style=t.__style,e.__text=t.__text}var qs=e=>{let t=Ja(e,`mode`),n=Xa(e,`detail`,0),r=Xa(e,`format`,0),i=Ya(e,`mode`),a=Za(e,`mode`);return{exportJSON:function(e){return{detail:e.__detail,format:e.__format,mode:t[e.__mode],style:e.__style,text:e.__text,type:e.__type,version:1}},exportCompactJSON:function(e){let n={type:e.__type},r=e.__detail;r!==void 0&&r!==0&&(n.detail=r);let i=e.__format;i!==void 0&&i!==0&&(n.format=i);let a=t[e.__mode];a!==void 0&&a!==`normal`&&(n.mode=a);let o=e.__style;o!==void 0&&o!==``&&(n.style=o);let s=e.__text;return s!==void 0&&s!==``&&(n.text=s),n},updateFromJSON:function(e,t){let o=t.detail;e.__detail=typeof o==`string`&&o in n?n[o]:Us(o,0);let s=t.format;e.__format=typeof s==`string`&&s in r?r[s]:Us(s,0);let c=t.mode;e.__mode=typeof c==`string`&&c in i?i[c]:a;let l=t.style;e.__style=typeof l==`string`?l:``;let u=t.text;return e.__text=typeof u==`string`?u:``,e},afterCloneFrom:Ks}},Js=e=>{let t=Ja(e,`format`),n=Ya(e,`format`),r=Za(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=Ws(t.indent,0,0,1/0),e.__textFormat=Us(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},Ys=()=>({exportJSON:function(e){return{type:e.__type,version:1}},exportCompactJSON:function(e){return{type:e.__type}}}),Xs=e=>{let t=Ja(e,`mode`),n=Xa(e,`format`,0);return{exportJSON:function(e){return{detail:e.__detail,mode:t[e.__mode],text:e.__text,format:e.__format,style:e.__style,type:e.__type,version:1}},exportCompactJSON:function(e){let t={type:e.__type},n=e.__format;n!==void 0&&n!==0&&(t.format=n);let r=e.__style;return r!==void 0&&r!==``&&(t.style=r),t},updateFromJSON:function(e,t){let r=t.format;e.__format=typeof r==`string`&&r in n?n[r]:Us(r,0);let i=t.style;return e.__style=typeof i==`string`?i:``,e}}};function Zs(e){return!1}function Qs(){return{...di,0:``}}function $s(){return{...li,"":0}}var ec=Qs(),tc=$s(),nc=fo()({direction:mo(uo([null,`ltr`,`rtl`]),{field:`__dir`}),format:mo(uo([``,`left`,`start`,`center`,`right`,`end`,`justify`]),{field:`__format`,getter:`getFormatType`,getterTable:ec,setter:`setFormat`,setterTable:tc}),indent:mo(lo(0,{integer:!0,min:0}),{field:`__indent`}),textFormat:ho(lo(),{getter:{field:`__textFormat`,method:`getSerializedTextFormat`,when:`shouldSerializeTextStyles`},setter:{field:`__textFormat`}}),textStyle:ho(so(),{getter:{field:`__textStyle`,method:`getSerializedTextStyle`,when:`shouldSerializeTextStyles`},setter:{field:`__textStyle`}})});function rc(e){if(Cu(e)&&!Zs(Rf())){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}var ic=class extends Fs{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for(`ElementNode`),{$transform:rc,extends:Fs,generated:Gs,json:nc})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``,this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&G(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__style=e.__style,function(e,t){e.__dir=t.__dir,e.__format=t.__format,e.__indent=t.__indent,e.__textFormat=t.__textFormat,e.__textStyle=t.__textStyle}(this,e)}getFormat(){return this.getLatest().__format}getFormatType(){return di[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){return sh(this.getFirstChild(),`next`)}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&_h(this).length===0}isDirty(){let e=Rf()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[];for(let t of _h(this)){let n=vh(this,t);if(q(n))for(let t of n.getAllTextNodes())e.push(t)}let t=this.getFirstChild();for(;t!==null;){if(J(t)&&e.push(t),q(t))for(let n of t.getAllTextNodes())e.push(n);t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;q(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;q(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=e>=this.getChildrenSize(),n=t?this.getLastChild():this.getChildAtIndex(e);return q(n)&&(t?n.getLastDescendant():n.getFirstDescendant())||n}getFirstChild(){let e=this.getLatest().__first;return e===null?null:Nl(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&G(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:Nl(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&G(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=Th(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),q(i)&&r!==n-1&&!i.isInline()&&(e+=ai)}return e}getTextContentSize(){let e=function(e){let t=0;for(let n of gh(e).values()){let e=Nl(n);e!==null&&(t+=e.getTextContentSize())}return t}(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),q(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=li[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=si[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return El(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){Pf();let n=Z(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(J(e)||q(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(J(e)||q(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return X(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):jm(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){let t=this.getWritable();return t.__format=e!==``&&li[e]||0,t}setStyle(e){let t=this.getWritable();return t.__style=e||``,t}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){let t=this.getWritable();return t.__indent=e,t}splice(e,t,n){Ns(this)&&G(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||G(226,String(e),String(t),String(r));for(let e of n);let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0){if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}}t>0&&(s=function(e,t,n,r){let i=[],a=t;for(let e=0;e<n;e++){a===null&&G(100);let e=a.getNextSibling();i.push(a.getWritable()),a=e}return eh(e,r&&r.getWritable(),a&&a.getWritable()),e.__size-=i.length,i.map(e=>(th(e),e.__prev=null,e.__next=null,e.__parent=null,e.__key))}(i,l===null?this.getFirstChild():l.getNextSibling(),t,l));let d=n.length>0&&l!==null?l.getWritable():null;for(let e of n){d!==null&&e.is(d)&&(l=d.getPreviousSibling(),d=l&&l.getWritable()),c!==null&&e.is(c)&&(c=c.getNextSibling());let t=e.getWritable();t.__parent===a&&u--,rh(t);let n=e.__key;nh(i,t,d,c&&c.getWritable()),e.__key===a&&G(76),o.push(n),d=t}if(i.__size=u,s.length){let e=Z();if(X(e)){let t=new Set(s),n=new Set(o);for(let r of[e.anchor,e.focus])ac(r,t,n)&&Vm(r,r.getNode(),this,l,c);u!==0||this.canBeEmpty()||Cu(this)||this.remove()}}return i}getDOMSlot(e){return new Na(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(qu(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`,t.setAttribute(`data-lexical-indent`,String(e)));let n=this.getDirection();n&&(t.dir=n)}return{element:t}}shouldSerializeTextStyles(){if(Cu(this))return!1;for(let e=this.getFirstChild();e!==null;e=e.getNextSibling())if(J(e))return!1;return!0}getSerializedTextFormat(){let e=this.getTextFormat();return e!==0&&this.shouldSerializeTextStyles()?e:void 0}getSerializedTextStyle(){let e=this.getTextStyle();return e!==``&&this.shouldSerializeTextStyles()?e:void 0}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){t.read(`latest`,()=>{let n=nd(this,e,t),r=n.element;n.after&&n.after.parentNode!==r&&(n=n.withAfter(null)),n.before&&n.before.parentNode!==r&&(n=n.withBefore(null));let i=n.getManagedLineBreak();i&&n.insertManagedLineBreak(i.nodeName===`IMG`);let a=n.getFirstChild();for(let e of this.getChildrenKeys()){let i=t.getElementByKey(e);if(!i)continue;let o,s=a;for(;s&&!(o=Il(s,t))&&md(s);)s=s.nextSibling;s!==i&&r.insertBefore(i,o?s:a||n.getInsertionAnchor()),a=i.nextSibling}Ss(this,e,n)})}};function q(e){return e instanceof ic}function ac(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var oc=class extends Fs{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&G(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function sc(e){return e instanceof oc}function cc(e){let t=e.getLatest().__cachedText;return t===null||!Nf()&&Rf()._dirtyType!==0?null:t}var lc=class extends ic{__cachedText;$config(){return this.config(`root`,{extends:ic})}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){G(51)}getTextContent(){let e=cc(this);return e===null?super.getTextContent():e}getTextContentSize(){let e=cc(this);return e===null?super.getTextContentSize():e.length}remove(){G(52)}replace(e){G(53)}insertBefore(e){G(54)}insertAfter(e){G(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)q(e)||sc(e)||G(282);return super.splice(e,t,n)}static importJSON(e){return Vl().updateFromJSON(e)}collapseAtStart(){return!0}};function uc(e){return e instanceof lc}function dc(e){let t={};if(!e)return t;let n=``,r=``,i=null,a=!1,o=!1,s=!1,c=0,l=e.length,u=-1;for(let d=0;d<l;d++){let l=e[d];if(a)l===`*`&&e[d+1]===`/`&&(a=!1,d++);else if(o)u===-1&&(u=d),o=!1;else if(i===null){if(l!==`/`||e[d+1]!==`*`){if(l!==`"`&&l!==`'`){if(l!==`(`){if(l!==`)`){if(s||l!==`:`||c!==0){if(l===`;`&&c===0){u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1);let i=n.trim(),a=r.trim();i!==``&&a!==``&&(t[i]=a),n=``,r=``,s=!1;continue}u===-1&&(u=d)}else u!==-1&&(n+=e.slice(u,d),u=-1),s=!0}else u===-1&&(u=d),c=Math.max(0,c-1)}else u===-1&&(u=d),c++}else u===-1&&(u=d),i=l}else u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1),a=!0,d++}else u===-1&&(u=d),l===`\\`?o=!0:l===i&&(i=null)}u!==-1&&(s?r+=e.slice(u,l):n+=e.slice(u,l));let d=n.trim(),f=r.trim();return d!==``&&f!==``&&(t[d]=f),t}function fc(e,t,n){let r=n.trimEnd(),i=r.length-10;i>=0&&r.slice(i).toLowerCase()===`!important`?e.setProperty(t,r.slice(0,i).trim(),`important`):e.setProperty(t,n,``)}function pc(e,t,n=``){if(t===n)return;let r=dc(n),i=dc(t);for(let t in i)delete r[t],fc(e,t,i[t]);for(let t in r)e.removeProperty(t)}var mc=fo()({detail:mo(po(lo(),ci),{field:`__detail`}),format:mo(po(lo(),si),{field:`__format`}),mode:mo(uo([`normal`,`token`,`segmented`]),{field:`__mode`,getterTable:pi,setterTable:fi}),style:mo(so(),{field:`__style`}),text:mo(so(),{field:`__text`,getter:`getTextContent`,setter:`setTextContent`})});function hc(e,t){return 16&t?`code`:128&t?`mark`:32&t?`sub`:64&t?`sup`:null}function gc(e,t){return 1&t?`strong`:2&t?`em`:`span`}function _c(e,t,n,r,i){let a=r.classList,o=iu(i,`base`);o!==void 0&&a.add(...o),o=iu(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in si){let r=si[e];if(o=iu(i,e),o!==void 0){if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}ru(r,`class`)}function vc(e,t,n){let r=n.isComposing(),i=e+(r?ii:``),a=ed(),o=td(a).$getDOMSlot(n,t,a),s=o.getFirstChild();if(s===null||s.nodeType!==Node.TEXT_NODE)return void o.insertChild(Lu().createTextNode(i));let c=s,l=c.nodeValue;if(l!==i){if(r||Kr||$r){let[e,t,n]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(l,i);c.replaceData(e,t,n)}else c.nodeValue=i}}function yc(e,t,n,r,i,a){vc(i,e,t);let o=a.theme.text;o!==void 0&&_c(0,0,r,e,o)}function bc(e,t){let n=Lu().createElement(t);return n.appendChild(e),n}function xc(e){return e!=null&&!0===e.__isInlineFormattable}var Sc=class extends Fs{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}$config(){return this.config(`text`,{extends:Fs,generated:qs,importDOM:{"#text":()=>({conversion:Dc,priority:0}),b:()=>({conversion:wc,priority:0}),code:()=>({conversion:Ac,priority:0}),em:()=>({conversion:Ac,priority:0}),i:()=>({conversion:Ac,priority:0}),mark:()=>({conversion:Ac,priority:0}),s:()=>({conversion:Ac,priority:0}),span:()=>({conversion:Cc,priority:0}),strong:()=>({conversion:Ac,priority:0}),sub:()=>({conversion:Ac,priority:0}),sup:()=>({conversion:Ac,priority:0}),u:()=>({conversion:Ac,priority:0})},json:mc})}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return pi[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===jl()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=si[e];return(this.getFormat()&t)!==0}isSimpleText(){let e=this.getLatest();return e.__type===`text`&&e.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return El(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=hc(0,n),i=gc(0,n),a=r===null?i:r,o=Lu().createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=Lu().createElement(i),o.appendChild(s)),yc(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&pc(o.style,c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=hc(0,i),s=hc(0,a),c=gc(0,i),l=gc(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??G(48);let i=Lu().createElement(l);return yc(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??G(49)),vc(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&_c(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(pc(t.style,p,f),ru(t,`style`)),!1}exportDOM(e){let{element:t}=super.exportDOM(e);return qu(t)||G(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=bc(t,`b`)),this.hasFormat(`italic`)&&(t=bc(t,`i`)),this.hasFormat(`strikethrough`)&&(t=bc(t,`s`)),this.hasFormat(`underline`)&&(t=bc(t,`u`)),{element:t}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?si[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?ci[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=El(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=fi[e];if(this.getLatest().__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.getLatest().__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){Pf();let n=e,r=t,i=Z(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!X(i))return jm(o,n,o,r,`text`,`text`);{let e=jl();e!==i.anchor.key&&e!==i.focus.key||Al(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=Z();if(r&&X(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Pf();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=jl(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=Z();if(X(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=jc(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=Mo(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=jc(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=Mo(t,n);let a=n.__key;i===r&&Al(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,S=0;for(let e of y){if(!g&&!_)break;let t=S+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=S&&(g.set(e.getKey(),b-S,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&kl(t),n!==null&&kl(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),X(v)&&Bm(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||G(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;jl()===r&&Al(n);let o=Z();if(X(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&Hm(i,t,n,e,a),s!==null&&s.key===r&&Hm(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function Cc(e){return{forChild:Mc(e.style),node:null}}function wc(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:Mc(t.style,n?void 0:`bold`),node:null}}var Tc=new WeakMap;function Ec(e){if(!qu(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function Dc(e){let t=e;e.parentElement===null&&G(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=Tc.get(n))===void 0&&!Ec(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)Tc.set(r[e],i);return i}(t)!==null)return{node:qm(n)};if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=Oc(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=Oc(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:jc(n)}}function Oc(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,qu(n)){let e=n.style.display;if(e===``&&!Zu(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(Cl(n))return n;if(n.nodeName===`BR`)return null}}var kc={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function Ac(e){let t=kc[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:Mc(e.style,t),node:null}}function jc(e=``){return Tu(new Sc(e))}function J(e){return e instanceof Sc}function Mc(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign,l=e.textTransform;return e=>((J(e)||xc(e))&&(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),l!==`lowercase`&&l!==`uppercase`&&l!==`capitalize`||e.hasFormat(l)||e.toggleFormat(l),t&&!e.hasFormat(t)&&e.toggleFormat(t)),e)}function Nc(e,t){let{type:n,key:r,offset:i}=e,a=Du(e.key);return n===`text`?(J(a)||G(266,a.getType(),r),Wh(a,t,i)):(q(a)||G(267,a.getType(),r),Kc(a,e.offset,t))}function Pc(e,t){let{origin:n,direction:r}=t,i=r===`next`;Lh(t)?e.set(n.getKey(),t.offset,`text`):Rh(t)?J(n)?e.set(n.getKey(),Gh(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,`element`):(zh(t)&&q(n)||G(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function Fc(e){let t=Z(),n=X(t)?t:Mm();return Ic(n,e),Ul(n),n}function Ic(e,t){Pc(e.anchor,t.anchor),Pc(e.focus,t.focus)}function Lc(e){let{anchor:t,focus:n}=e,r=Nc(t,`next`),i=Nc(n,`next`),a=ig(r,i)<=0?`next`:`previous`;return ng($h(r,a),$h(i,a))}function Rc(e){let{direction:t,origin:n}=e,r=Uh(n,Nh(t)).getNodeAtCaret();return r?Uh(r,t):qh(n.getParentOrThrow(),t)}function zc(e,t=`root`){let n=[e];for(let r=zh(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(Rc(r));return n}function Bc(e){return!!e&&e.origin.isAttached()}function Vc(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=Gc(e,r),o=a.anchor.origin;for(;o!==null&&!Cu(o);)o=o.getParent();let s=q(o)?o.getFirstChild():null,c=zc(a.anchor,n),l=zc(a.focus.getFlipped(),n),u=new Set,d=[];for(let e of a.iterNodeCarets(n))if(zh(e))u.add(e.origin.getKey());else if(Rh(e)){let{origin:t}=e;q(t)&&!u.has(t.getKey())||d.push(t)}let f=new Set;for(let e of d){let t=e.getParent();t===null||u.has(t.getKey())||f.add(t),Ol(e)}for(let e of f)!e.canBeEmpty()&&!Cu(e)&&e.isEmpty()&&e.isAttached()&&e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=Rc(Uh(t,r)),o=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||o===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(o===`segmented`){let e=t.origin,n=jc(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=Wh(n,r,t.offset)}n.is(c[0].origin)&&(c[0]=t),n.is(l[0].origin)&&(l[0]=t.getFlipped())}}let p=Hc(c),m=Hc(l),h=function(e,t,n){let r=e&&e.getParentAtCaret(),i=t&&t.getParentAtCaret(),a=r&&i&&ug(r,i);if(!a||a.type!==`branch`)return null;let o=(e,t)=>{let r;for(let i=e;i&&!i.is(a.commonAncestor);i=i.getParent()){if(Cu(i))return;t&&!n.has(i.__key)||!Y(i)||(r=i)}return r},s=o(r,!1),c=s&&o(i,!0);return s&&c&&_h(c).length===0?[s,c]:null}(p,m,u);if(h){let[e,t]=h;qh(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}else if(m){let e=function(e){if(zh(e)){let t=e.origin;if(Y(t))return t}else{let t=e.getParentAtCaret();if(t&&Y(t))return t}return null}(m),t=e&&e.getParent(),n=e&&e.getParents().findLast(Su);if(e&&t&&!uc(t)&&e.isEmpty()&&u.has(e.getKey())&&_h(e).length===0&&(!n||u.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!uc(n)&&n.isEmpty();){let e=n.getParent();if(e&&uc(e)&&e.getChildrenSize()<=1&&n.canBeEmpty())break;let t=n;n=e,t.remove(!0)}}}Hl(o,s)!==null||o===null||o.isAttached()||Hl(Vl(),null);let g=Hc([p,m,...c,...l]);if(g)return tg($h(g,e.direction));G(269,JSON.stringify(c.map(e=>e.origin.__key)))}function Hc(e){let t=e.find(Bc);return t&&Uc(t)}function Uc(e){let t=function(e){let t=e;for(;zh(t);){let e=Yh(t);if(!zh(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(J(t.origin))return Lh(t)?t:Wh(t.origin,n,n);let r=t.getAdjacentCaret();return Rh(r)&&J(r.origin)?Wh(r.origin,n,Nh(n)):t}function Wc(e){return Lh(e)&&e.offset!==Gh(e.origin,e.direction)}function Gc(e,t){return e.direction===t?e:ng($h(e.focus,t),$h(e.anchor,t))}function Kc(e,t,n){let r=e.getChildrenSize(),i=(t>0?Math.min(Math.ceil(t),r):0)-+(n===`next`),a=i<0||i>=r?null:e.getChildAtIndex(i);return a===null?qh(e,n):Uh(a,n)}function qc(e){let{origin:t,offset:n,direction:r}=e;if(n===Gh(t,r))return e.getSiblingCaret();if(n===Gh(t,Nh(r)))return Rc(e.getSiblingCaret());let[i]=t.splitText(n);return J(i)||G(281),$h(Uh(i,`next`),r)}function Jc(e,t){for(let n of e)if(n!==null&&n.caret.origin.is(t))return n}function Yc(e,t=null){let{origin:n}=e.caret,[r,i]=e.getSliceIndices();if(r===i)return null;if(r===0&&i===n.getTextContentSize())return n;let a=n.getParent(),o=t&&a&&zm(t,a)?n.getIndexWithinParent():-1,s=t?[t.anchor,t.focus].map(e=>[e,e.key===n.__key&&e.type===`text`?e.offset-r:a!==null&&e.key===a.__key&&e.offset===o?0:null]):[],c=n.splitText(r,i),l=c[r===0?0:1];a&&t&&t!==Z()&&Bm(t,a,o,c.length-1);for(let[e,t]of s)t!==null&&e.set(l.__key,t,`text`);return l}function Xc(e,t){return!0}function Zc(e,{$copyElementNode:t=wu,$splitTextPointCaretNext:n=qc,rootMode:r=`shadowRoot`,$shouldSplit:i=Xc,removeEmptyDestination:a=!1}={}){if(Lh(e))return n(e);let o=e.getParentCaret(r);if(o){let{origin:n}=o;if(zh(e)){let e=Rc(o);if(a&&n.isEmpty())return n.remove(),e;if(!n.canBeEmpty()||!i(n,`first`))return e}let r=sh((s=e).getNodeAtCaret(),s.direction);(r.length>0||!a&&n.canBeEmpty()&&i(n,`last`))&&o.insert(t(n).splice(0,0,r))}var s;return o}function Qc(e,t,n){let r=$h(t,`next`);Lh(r)&&(r.offset===0?r=Uh(r.origin,`previous`).getFlipped():r.offset===r.origin.getTextContentSize()&&(r=Uh(r.origin,`next`))),r.origin.is(e)&&(Rh(r)||G(342,e.getKey(),e.getType()),r=Rc(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let e=r;e;e=Zc(e,n))r=e;return Lh(r)&&G(283),r.insert(e.isInline()?nl().append(e):e),$h(Uh(e.getLatest(),`next`),t.direction)}function $c(e,t){let n=Gc(X(t)?Lc(t):t,`next`),r=mh(n.anchor.origin),i=mh(e.getLatest());if(r===null?i!==null:!r.is(i))return!1;let a=Uc(qh(e,`next`)),o=$h(Uc(qh(e,`previous`)),`next`);return ig(n.anchor,a)<=0&&ig(n.focus,o)>=0}var el=class extends ic{$config(){return this.config(`paragraph`,{children:`inline`,extends:ic,generated:Js,importDOM:{p:()=>({conversion:tl,priority:0})}})}createDOM(e){let t=Lu().createElement(`p`),n=iu(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(qu(t)){this.isEmpty()&&t.append(Lu().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}exportJSON(e=!1){let t=super.exportJSON(e);if(t.textFormat===void 0||t.textStyle===void 0){let n=this.getChildren().find(J),r=n?n.getFormat():this.getTextFormat(),i=n?n.getStyle():this.getTextStyle();e&&r===0||(t.textFormat=r),e&&i===``||(t.textStyle=i)}return t}extractWithChild(e,t,n){if(!X(t)||this.getFormatType()===``&&this.getIndent()===0&&this.getStyle()===``)return!1;if($c(this,t)){let e=this.getTextContent();return e!==``&&t.getTextContent()===e}return!1}insertNewAfter(e,t){let n=nl();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.getChildren().every(e=>J(e)&&!/\S/.test(e.getTextContent()))){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function tl(e){let t=nl();if(fd(t,e),ud(e,t),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in li&&t.setFormat(n)}return dd(t,e),{node:t}}function nl(){return Tu(new el)}function rl(e){return e instanceof el}var il=fo()({detail:ho(lo(2),{getter:{field:`__detail`},setter:null}),mode:ho(uo([`normal`]),{getter:{field:`__mode`,getterTable:{0:`normal`}},setter:null}),text:ho(so(` `),{getter:{field:`__text`,method:`getTextContent`},setter:null})}),al=class extends Sc{$config(){return this.config(`tab`,{extends:Sc,generated:Xs,json:il})}constructor(e=void 0){super(` `,e),this.__detail=2}createDOM(e){let t=super.createDOM(e),n=iu(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}setTextContent(e){return super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||G(286),this}setDetail(e){return e!==2&&G(127),this}setMode(e){return e!==`normal`&&G(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function ol(){return Tu(new al)}function sl(e){return e instanceof al}var cl=null;function ll(e){cl=e}var ul=Symbol(`INTERNAL_SKIP_AFTER_CLONE_FROM`),dl=1;function fl(e,t){let n=pl(e,t);return n===void 0&&G(30,t),n}function pl(e,t){return e._nodes.get(t)}var ml=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function hl(e,t){let n=t===void 0?(()=>{let t=e.getRootNode();return wl(t)||Mu(t)?Gu(t):null})():t;if(!qu(n)||n.hasAttribute(`data-lexical-slot`))return!1;let r=Ll(n),i=n.nodeName;return Is(r)&&(i===`INPUT`||i===`TEXTAREA`||n.contentEditable===`true`&&bl(n)==null)}function gl(e){let t=e===null?null:Ku(e);return Ju(t)&&hl(t)}function _l(e,t,n){let r=e.getRootElement();if(!r)return!1;try{if(!t||!r.contains(t)||!r.contains(n))return!1}catch{return!1}return yl(t)===e&&e.read(`latest`,()=>!hl(t))}function vl(e){return e instanceof xf}function yl(e){let t=e;for(;t!=null;){let e=bl(t);if(vl(e))return e;t=du(t)}return null}function bl(e){return e?e.__lexicalEditor:null}function xl(e){return sl(e)||e.isToken()}function Sl(e){return xl(e)||e.isSegmented()}function Cl(e){return Ju(e)&&e.nodeType===3}function wl(e){return Ju(e)&&e.nodeType===9}function Tl(e){let t=e;for(;t!=null;){if(Cl(t))return t;t=t.firstChild}return null}function El(e,t,n){let r=si[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~si.superscript:t===`superscript`?i&=~si.subscript:t===`lowercase`?(i&=~si.uppercase,i&=~si.capitalize):t===`uppercase`?(i&=~si.lowercase,i&=~si.capitalize):t===`capitalize`&&(i&=~si.lowercase,i&=~si.uppercase),i}function Dl(e,t){let n=function(){let e=cl;return cl=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);Pf(),Ff();let r=Rf(),i=If(),a=``+dl++;i._nodeMap.set(a,e),q(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.set(a,e),r._dirtyType===0&&(r._dirtyType=1),e.__key=a}function Ol(e){rh(e.getParent()===null?e:e.getWritable())}function kl(e){Ff(),Ns(e)&&G(323,e.__key,e.__type);let t=e.__parent===null?uh(e)?e.__slotHost:null:e.__parent,n=If(),r=Rf(),i=n._nodeMap,a=r._dirtyElements;t!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent===null?uh(e)?e.__slotHost:null:e.__parent}}(t,i,a);let o=e.__key;r._dirtyType===0&&(r._dirtyType=1),q(e)?a.set(o,!0):r._dirtyLeaves.add(o)}function Al(e){Pf();let t=Rf(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=Nl(n);e!==null&&e.getWritable()}if(e!==null){let t=Nl(e);t!==null&&t.getWritable()}}}function jl(){return Nf()?null:Rf()._compositionKey}function Ml(e){return!Xr&&(Qr||ti)&&e.__text===``&&e.__key===Rf()._compositionKey}function Nl(e,t){let n=(t||If())._nodeMap.get(e);return n===void 0?null:n}function Pl(e,t){let n=Il(e,Rf());return n===void 0?null:Nl(n,t)}function Fl(e,t,n){e[`__lexicalKey_${t._key}`]=n}function Il(e,t){return e[`__lexicalKey_${t._key}`]}function Ll(e,t){let n=e;for(;n!=null;){let e=Pl(n,t);if(e!==null)return e;n=du(n)}return null}function Rl(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function zl(e){return e.read(()=>Vl().getTextContent())}function Bl(e,t){let n=sd(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=Nl(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:`history-merge`}:void 0)}function Vl(){return If()._nodeMap.get(`root`)}function Hl(e,t){if(!(Cu(e)&&e.isAttached()&&(uc(e)?e.getChildrenSize()===0:e.isEmpty())&&(uc(e)||t!==null&&Y(t))))return null;let n=nl();return e.append(n),n}function Ul(e){Pf();let t=If();e!==null&&(e.dirty=!0,e.setCachedNodes(null),X(e)&&Rf()._slotsUsed&&Dm(e)),t._selection=e}function Wl(e){Pf(),Ua(Rf(),e)}function Gl(e){let t=function(e,t){let n=e;for(;n!=null;){let e=Il(n,t);if(e!==void 0)return e;n=du(n)}return null}(e,Rf());return t===null?null:Nl(t)}function Kl(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function ql(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}var Jl=0;function Yl(){return Br?Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5):`s${(++Jl).toString(36)}`}function Xl(e){return Cl(e)?e.nodeValue:null}function Zl(e,t,n){let r=Au(yu(t));if(r===null)return;let i=Bu(r,t._rootElement),a=i.anchorNode,{anchorOffset:o,focusOffset:s}=i;if(a!==null){let t=Xl(a),r=Ll(a);if(t!==null&&J(r)){if((t===ii||t===oi)&&n){let e=n.length;t=n,o=e,s=e}t!==null&&Ql(r,t,o,s,e)}}}function Ql(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing(),s=!Xr&&(Qr||ti);if(a.isToken()&&o)return;let c=t;if((o||i)&&(!t.endsWith(ii)||s&&t===a.getTextContent()||(c=t.slice(0,-ii.length)),i&&!s)){let e=oi,t;for(;(t=c.indexOf(e))!==-1;)c=c.slice(0,t)+c.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let l=a.getTextContent();if(i||c!==l){let t=Z();if(c===``){if(o&&!i&&s)return void $l(a,``,t);if(Al(null),Qr||Xr||ti)a.remove();else{let e=Rf();$l(a,``,t),setTimeout(()=>{e.update(()=>{a.isAttached()&&a.getTextContent()===``&&a.remove()})},20)}return}let l=a.getParent(),u=Rm(),d=a.getTextContentSize(),f=jl(),p=a.getKey();if(a.isToken()&&!o||f!==null&&p===f&&!o||X(u)&&(l!==null&&!l.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!a.canInsertTextBefore()&&!o||u.focus.key===e.__key&&u.focus.offset===d&&!a.canInsertTextAfter()&&!o))return void a.markDirty();if(!X(t)||n===null||r===null)return void $l(a,c,t);if(t.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=jc(a.getTextContent());a.replace(e),a=e}$l(a,c,t)}}}function $l(e,t,n){if(e.setTextContent(t),X(n)){let t=e.getKey(),r=!1;for(let i of[`anchor`,`focus`]){let a=n[i];a.type===`text`&&a.key===t&&(a.offset=Gh(e,a.offset,`clamp`),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function eu(e){let t=e;for(;t!==null;){let e=t.getParent();if(e===null)return null;if(uc(e))return t;t=e}return null}function tu(e,t){let{anchor:n,focus:r}=e,i=n.key,a=n.offset,o=n.type,s=r.key,c=r.offset,l=r.type;if(Bs(e),!uc(t))return e;let u=eu(n.getNode());return q(u)&&u.isShadowRoot()&&u.is(eu(r.getNode()))&&(n.set(i,a,o),r.set(s,c,l)),e}function nu(e){let t=Vl();if(X(e)){let t=e.anchor,n=e.focus,r=t.getNode();if(uc(r))return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),tu(e,r),e;let i=r.getTopLevelElementOrThrow(),a=i.getParent();return a===null?(q(i)&&(t.set(i.getKey(),0,`element`),n.set(i.getKey(),i.getChildrenSize(),`element`),tu(e,i)),e):(t.set(a.getKey(),0,`element`),n.set(a.getKey(),a.getChildrenSize(),`element`),tu(e,a),e)}{let e=t.select(0,t.getChildrenSize());return Ul(tu(e,t)),e}}function ru(e,t){e.getAttribute(t)===``&&e.removeAttribute(t)}function iu(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=fg(i);return n[t]=e,e}return i}function au(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&G(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function ou(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function su(e,t){let n=e.offset;if(e.type===`element`)return ou(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?ou(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function cu(e){let t=yu(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function lu(e,t,...n){return Xf(e,t,n[0],e)}function uu(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&G(75,t),n}function du(e){let t=e.assignedSlot||e.parentElement;if(t!==null)return t;let n=e.parentNode;return Mu(n)?n.host:null}function fu(e){return wl(e)?e:qu(e)?e.ownerDocument:null}function pu(e,t){let n=parseFloat(e);return isFinite(n)?e.endsWith(`%`)?n*t/100:n:0}function mu(e,t,n,r){let i=t.clientWidth,a=t.scrollWidth-i;if(a<=0)return 0;let o=e.getComputedStyle(t);if(o.overflowX!==`auto`&&o.overflowX!==`scroll`)return 0;let s=t.getBoundingClientRect(),c=t.offsetWidth,l=c>0&&Math.abs(s.width-c)>1?s.width/c:1,u=o.direction===`rtl`,d=s.left+t.clientLeft*l,f=d+pu(o.scrollPaddingLeft,i)*l,p=d+(i-pu(o.scrollPaddingRight,i))*l,m=n,h=Math.max(r,n+1);h-m>p-f&&(u?m=h-1:h=m+1);let g=0;if(m<f?g=m-f:h>p&&(g=h-p),g===0)return 0;let _=t.scrollLeft,v=_+g/l,y=g>0?Math.ceil(v):Math.floor(v),b=u?Math.min(0,Math.max(-a,y)):Math.max(0,Math.min(a,y)),x=_*l;return Math.abs(b)<Math.abs(_)&&m+x>=f&&h+x<=p&&(b=0),b===_?0:(t.scrollLeft=b,(t.scrollLeft-_)*l)}function hu(e){Pf(),Rf()._updateTags.add(e)}function gu(e){Pf(),Rf()._deferred.push(e)}function _u(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function vu(e){let t=fu(e);return t?t.defaultView:null}function yu(e){let t=e._window;return t===null&&G(78),t}function bu(e){return q(e)&&e.isInline()||sc(e)&&e.isInline()}function xu(e){let t=e.getLatest();for(;t!==null;){if(dh(t)!==null&&q(t))return t;let e=t.getParentOrThrow();if(Cu(e))return e;t=e}return t}function Su(e){return q(e)&&e.isShadowRoot()}function Cu(e){return uc(e)||Su(e)}function wu(e,t=!1){let n=e.constructor.clone(e,ul);return Dl(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function Tu(e){let t=Rf(),n=e.getType(),r=pl(t,n);r===void 0&&G(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||G(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||G(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&G(203,e.constructor.name,n,r.name,r.getType()),t}return e}function Eu(e,t){!uc(e.getParent())||q(t)||sc(t)||G(99)}function Du(e){let t=Nl(e);return t===null&&G(63,e),t}function Ou(e){if(!e||e.isInline())return!1;if(sc(e))return!0;if(q(e)){if(e.isShadowRoot()){let t=e.getParent();return!(q(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function ku(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function Au(e){return Br?(e||window).getSelection():null}function ju(e){let t=vu(e);return t?t.getSelection():null}function Mu(e){return Yu(e)&&`host`in e}var Nu=[];function Pu(e){let t=e.getRootNode();if(t===e||!Mu(t))return Nu;let n=[t],r=t.host;for(;;){let e=r.getRootNode();if(e===r||!Mu(e))break;n.push(e),r=e.host}return n}function*Fu(e){let t=[e],n;for(;n=t.pop();){yield*n.querySelectorAll(`[data-lexical-editor="true"]`);let e=(wl(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),r;for(;r=e.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function Iu(e){return e===null?document:e.ownerDocument}function Lu(){let e=Vf();return Iu(e===null?null:e._rootElement)}function Ru(e,t){if(t===null||typeof e.getComposedRanges!=`function`)return null;let n=Pu(t);if(n.length===0)return null;let r=e.getComposedRanges;try{let t=r.call(e,{shadowRoots:n})[0];if(t!==void 0)return t}catch{}try{let t=r.apply(e,n)[0];if(t!==void 0)return t}catch{}return null}function zu(e,t){let n=Ru(e,t);if(n!==null){let e=Vu(n);if(e!==null)return e}return e.rangeCount>0?e.getRangeAt(0):null}function Bu(e,t){let n=Ru(e,t);return n===null?e:Hu(n,Uu(e))}function Vu(e){let t=e.startContainer.ownerDocument;if(t===null)return null;let n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch{return null}}function Hu(e,t){let{startContainer:n,startOffset:r,endContainer:i,endOffset:a}=e;return t===`backward`?{anchorNode:i,anchorOffset:a,direction:t,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:t,focusNode:i,focusOffset:a}}function Uu(e){return e.direction}function Wu(e){let t=e.getRootNode();return wl(t)||Mu(t)?t.activeElement:null}function Gu(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){let e=t.shadowRoot.activeElement;if(e===null)break;t=e}return t}function Ku(e){let t=e.target;if(t!==null&&qu(t)&&t.shadowRoot!==null&&typeof e.composedPath==`function`){let t=e.composedPath();if(t.length>0)return t[0]}return t}function qu(e){return Ju(e)&&e.nodeType===1}function Ju(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function Yu(e){return Ju(e)&&e.nodeType===11}var Xu=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function Zu(e){return!(!qu(e)||!e.style.display.startsWith(`inline`))||Xu.test(e.nodeName)}var Qu=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function $u(e){return(!qu(e)||!e.style.display.startsWith(`inline`))&&Qu.test(e.nodeName)}function Y(e){if(sc(e)&&!e.isInline())return!0;if(!q(e)||Cu(e))return!1;let t=e.getFirstChild(),n=t===null||uf(t)||J(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function ed(){return Rf()}function td(e=ed()){return e._config.dom||_f}function nd(e,t,n=ed()){let r=td(n).$getDOMSlot(e,t,n);return q(e)&&(rd(r)||G(344,e.getKey(),e.getType())),r}function rd(e){return e instanceof Na}function id(e,t,n=ed()){return Tl(nd(e,t,n).element)}var ad=new WeakMap,od=new Map;function sd(e){if(!e._readOnly&&e.isEmpty())return od;e._readOnly||G(192);let t=ad.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),ad.set(e,t)),t}function cd(e){let t=e.constructor.clone(e,ul);return t.afterCloneFrom(e),t}function ld(e){return(t=cd(e))[Ms]=!0,t;var t}function ud(e,t){let n=e.getAttribute(`data-lexical-indent`);if(n!==null){let e=parseInt(n,10);if(Number.isFinite(e)&&e>=0)return void t.setIndent(e)}let r=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(r/40);t.setIndent(i)}function dd(e,t){let n=t.getAttribute(`dir`);return n===`ltr`||n===`rtl`?e.setDirection(n):e}function fd(e,t){let n=t.style.textAlign;return n&&n in li?e.setFormat(n):e}function pd(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function md(e){return!0===e.__lexicalUnmanaged}function hd(e,t=ed()){let n=t.isEditable();e.contentEditable=n?`true`:`false`,n?e.__lexicalEditor=t:delete e.__lexicalEditor}function gd(e,t){let n=e;for(;n!=null;){if(!0===n.__lexicalCapturedSelection)return!0;if(qu(n)&&n.hasAttribute(`data-lexical-slot`)||Il(n,t)!==void 0)return!1;n=du(n)}return!1}function _d(e,t){return oo(e,t)&&e[t]!==Fs[t]}var vd=new WeakMap;function yd(e){let t=vd.get(e);return t===void 0?function(e){let t=e.prototype!=null&&hi in e.prototype?e.prototype[hi]():void 0,n=function(e){if(!(e===Fs||e.prototype instanceof Fs)){let t=`<unknown>`,n=`<unknown>`;try{t=e.getType()}catch{}try{xf.version&&(n=JSON.parse(xf.version))}catch{}G(290,e.name,t,n)}return e===oc||e===ic||e===Fs}(e),r=!n&&_d(e,`getType`)?e.getType:void 0,i=r&&!(xd in r)?r.call(e):void 0,a,o=i;if(t){if(i)a=t[i];else{for(let[e,n]of Object.entries(t))o=e,a=n;if(!a)for(let e of Object.getOwnPropertySymbols(t)){let n=t[e];if(n){a=n;break}}}}let s={compiled:void 0,composed:void 0,config:{declaresOwnConfig:oo(e.prototype,hi),klass:e,ownNodeConfig:a,ownNodeType:o},ownFieldsValidated:!1};vd.set(e,s);try{let t=function(e){let t=e.prototype,n=new Map,{fieldsBaseFirst:r}=Od(e);for(let[i,a]of r){let r=jd(e,i,a);if(r===null)continue;if(qa(r)){let t=r.field;if(t===`__proto__`&&G(430,e.name,i),r.setterTable!==void 0){let{setterTable:t}=r,{meta:n}=a;for(let r of n.kind===`enum`?n.values:[a.defaultValue])oo(t,String(r))||G(431,e.name,i,JSON.stringify(r))}n.set(i,{field:t,key:i,kind:`ownField`,schema:a,setterTable:r.setterTable});continue}let o=t[r];typeof o!=`function`&&G(432,e.name,i,r),n.set(i,{key:i,kind:`field`,schema:a,setter:o})}return n.size===0?Sd:[...n.values()]}(e),r=function(e){let t=e.prototype,n=new Map;for(let[r,i]of Od(e).fieldsDerivedFirst){let a=Ad(e,r,i);if(a===null)continue;if(qa(a)){let o=a.field;o===`__proto__`&&G(426,e.name,r);let s=a.when,c;if(s!==void 0){let n=t[s];typeof n!=`function`&&G(427,e.name,r,s),c=n}n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,field:o,getterTable:a.getterTable,isEqual:i.isEqual,key:r,kind:`ownField`,schema:i,when:c});continue}let o=t[a];typeof o!=`function`&&G(428,e.name,r,a),n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,getter:o,isEqual:i.isEqual,key:r,kind:`method`,schema:i})}return n.size===0?kd:[...n.values()]}(e),i=Od(e),c=function(e,t,n){let r,i=e;for(let{klass:t,ownNodeConfig:n}of Wd(e))n&&n.generated!==void 0&&(r===void 0?(r=n.generated,i=t):n.generated===r&&(i=t));return r===void 0?null:i===e||function(e,t){if(e.getters.length!==t.getters.length||e.setters.length!==t.setters.length)return!1;for(let n=0;n<e.getters.length;n++){let r=e.getters[n],i=t.getters[n];if(r.kind!==i.kind||r.key!==i.key||r.schema!==i.schema||r.derived!==i.derived||r.isEqual!==i.isEqual||!Object.is(r.defaultValue,i.defaultValue)||r.kind===`ownField`&&i.kind===`ownField`&&(r.field!==i.field||r.getterTable===void 0!=(i.getterTable===void 0)))return!1}for(let n=0;n<e.setters.length;n++){let r=e.setters[n],i=t.setters[n];if(r.kind!==i.kind||r.key!==i.key||r.schema!==i.schema||r.kind===`ownField`&&i.kind===`ownField`&&(r.field!==i.field||r.setterTable===void 0!=(i.setterTable===void 0)))return!1}return!0}(n,bd(yd(i)))?r:null}(e,0,{getters:r,setters:t});s.compiled={flatStates:i.flatStates,generated:c===null?null:c(i.fields),getters:r,isCompactDefault:Pd(r),setters:t},function(e,t,n,r){if(!t&&n){if(!_d(e,`getType`)){let t=e,r=function(){return this===t?n:Fs.getType.call(this)};r[xd]=!0,e.getType=r}if(_d(e,`clone`)||(e.clone=(t,n)=>{ll(t);let r=new e;return n!==ul&&r.afterCloneFrom(t),r}),_d(e,`importJSON`)||(e.importJSON=r&&r.$importJSON||function(e){return t=>{let n=Gd(e);return n.updateFromJSON===Fs.prototype.updateFromJSON?function(e,t){return Id(e.__state||t.$!==void 0?Do(e,t):e,t)}(n,t):n.updateFromJSON(t)}}(e)),!_d(e,`importDOM`)&&r){let{importDOM:t}=r;t&&(e.importDOM=()=>t)}let t=e.prototype;oo(t,`getTextContent`)&&!oo(t,`getTextContentSize`)&&(e.prototype.getTextContentSize=Fs.prototype.getTextContentSize)}}(e,n,o,a),function(e){for(let{klass:t,ownNodeConfig:n}of Wd(e)){let e=t.prototype;if(oo(e,`afterCloneFrom`))continue;let r=Ud(t);if(r.length===0)continue;let i=Object.getPrototypeOf(e),a=n&&n.generated!==void 0?bd(yd(t)).generated:null,o=a!==null&&a.afterCloneFrom||((e,t)=>{let n=e,i=t;for(let e=0;e<r.length;e++){let t=r[e];n[t]=i[t]}});e.afterCloneFrom=function(e){i.afterCloneFrom.call(this,e),o(this,e)},e.afterCloneFrom[Vd]=!0}}(e),function(e,t){t&&t.inline!==void 0&&oo(e.prototype,hi)&&!Object.prototype.hasOwnProperty.call(e.prototype,`isInline`)&&Object.defineProperty(e.prototype,"isInline",{configurable:!0,value:t.inline?Rd:zd,writable:!0})}(e,a)}catch(t){throw vd.delete(e),t}return s}(e):t}function bd(e){let{compiled:t}=e;return t===void 0&&G(422,e.config.klass.name),t}var xd=Symbol(`lexical.synthesizedGetType`),Sd=[];function Cd(e,t,n,r){let i=n.method===void 0?r:n.method,a=Od(e).declaredBy.get(t);if(a===void 0)return n;let o=e.prototype,s=a.prototype;return wd(o,s,i)&&wd(o,s,r)?n:i}function wd(e,t,n){return e[n]===t[n]}function Td(e){return`set${e.charAt(0).toUpperCase()}${e.slice(1)}`}function Ed(e){return`get${e.charAt(0).toUpperCase()}${e.slice(1)}`}var Dd={declaredBy:new Map,fields:new Map,fieldsBaseFirst:[],fieldsDerivedFirst:[],flatStates:[]};function Od(e){let t=yd(e);return t.composed===void 0&&(t.composed=function(e){let t=[],n=[],r=[];for(let{klass:i,ownNodeConfig:a}of Wd(e)){let e=a&&a.json;n.push(i),t.push(e&&e.meta.kind===`node`?Object.entries(e.meta.fields):[]);let o=[];if(a&&a.stateConfigs)for(let e of a.stateConfigs)`stateConfig`in e&&e.flat&&o.push(e.stateConfig);r.push(o)}let i=new Map;for(let e=0;e<t.length;e++)for(let[n,r]of t[e])i.has(n)||i.set(n,r);let a=new Map,o=new Map,s=new Map;for(let e=t.length-1;e>=0;e--){for(let[r,s]of t[e]){let t=i.get(r);t===void 0||a.has(r)||a.set(r,t),t===void 0||s!==t||o.has(r)||o.set(r,n[e])}for(let t of r[e])s.has(t.key)||s.set(t.key,t)}return i.size===0&&s.size===0?Dd:{declaredBy:o,fields:a,fieldsBaseFirst:[...a],fieldsDerivedFirst:[...i],flatStates:[...s.values()]}}(e)),t.composed}var kd=[];function Ad(e,t,n){let r=n.getter;if(r===null)return null;let i=r===void 0?Ed(t):r;return qa(i)?Cd(e,t,i,Ed(t)):i}function jd(e,t,n){let r=n.setter;if(r===null)return null;let i=r===void 0?Td(t):r;return qa(i)?Cd(e,t,i,Td(t)):i}function Md(e){return e}function Nd(e,t){let{defaultValue:n,isEqual:r}=e;return t===void 0||t===n||r!==void 0&&r(t,n)}function Pd(e){let t;return(n,r)=>{t===void 0&&(t=new Map(e.map(e=>[e.key,e])));let i=t.get(n);return i!==void 0&&Nd(i,r)}}function Fd(e){let{setterTable:t,schema:n}=e,{defaultValue:r}=n;return t===void 0?r:t[String(r)]}function Id(e,t){let{flatStates:n,generated:r,setters:i}=bd(yd(e.constructor)),a=function(e,t,n){let r=e;for(let e=0;e<n.length;e++){let i=n[e],a=t[i.key];if(a!==void 0){let e=i.parse(a);r=xo(r,i,()=>e)}}return r}(e,t,n);return r!==null&&r.updateFromJSON!==void 0?r.updateFromJSON(a,t):function(e,t,n){for(let r=0;r<n.length;r++){let i=n[r],a=i.schema(t[i.key]);i.kind===`ownField`?Md(e)[i.field]=i.setterTable===void 0?a:oo(i.setterTable,a)?i.setterTable[a]:Fd(i):i.setter.call(e,a)}return e}(a,t,i)}function Ld(e){return yd(e).config}function Rd(){return!0}function zd(){return!1}function Bd(e){let t=[];for(let n of[e.getter,e.setter])qa(n)&&n.field!==`__proto__`&&!t.includes(n.field)&&t.push(n.field);return t}var Vd=`__lexicalSynthesizedAfterCloneFrom`;function Hd(e){let{declaredBy:t,fieldsBaseFirst:n}=Od(e),r=[];for(let[i,a]of n)if(t.get(i)===e)for(let e of Bd(a))r.includes(e)||r.push(e);return r}function Ud(e){let t=Hd(e);if(t.length===0)return t;let n=new Set;for(let{klass:t}of Wd(e))if(t!==e)for(let e of Hd(t))n.add(e);return n.size===0?t:t.filter(e=>!n.has(e))}function*Wd(e){for(let t=e;t&&(t===Fs||Is(t.prototype));){let e=Ld(t),n=e.declaresOwnConfig;yield n?e:{...e,ownNodeConfig:void 0},t=n&&e.ownNodeConfig&&e.ownNodeConfig.extends||Jd(t)}}function Gd(e){let t=ed();Pf();let n=t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)),r=new n.klass;return n.replace===null?r:Tu(r)}var Kd=(e,t)=>{let n=e;for(;n!=null&&!uc(n);){if(t(n))return n;n=n.getParent()}return null};function qd(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t===null?Nl(r):t.get(r);e??G(174),n.push(r),r=e.__next}return n}function Jd(e){let t=Object.getPrototypeOf(e);if(typeof t==`function`&&t!==Function.prototype)return t;let n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}function Yd(e){return new $d(ba(e._nodeMap),null,e._slotsUsed)}function Xd(){return new $d(new Map([[`root`,new lc]]),null,!1)}function Zd(e){let t=e.constructor,n=Ta(e);if(q(e)){let t=n.children,r=e.getChildren();for(let e=0;e<r.length;e++)t.push(Zd(r[e]))}let r=_h(e);if(r.length>0){let i={};for(let n of r){let r=vh(e,n);r===null&&G(366,t.name,n),i[n]=Zd(r)}n.$slots=i}return n}function Qd(e){return e instanceof $d}var $d=class e{_nodeMap;_movedNodes;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._movedNodes=null,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size<=1&&this._selection===null}read(e,t){return Kf(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t,this._slotsUsed);return n._readOnly=!0,n._parsed=this._parsed,n}toJSON(e){return Ca(typeof e==`boolean`&&e,()=>Kf(null,this,()=>({root:Zd(Vl())})))}},ef=`history-push`,tf=`history-merge`,nf=`skip-dom-selection`,rf=`skip-selection-focus`,af=`composition-end`,of=class extends ic{$config(){return this.config(`artificial`,{extends:ic})}createDOM(e){return Lu().createElement(`div`)}},sf=class extends Fs{$config(){return this.config(`linebreak`,{extends:Fs,generated:Ys,importDOM:{br:e=>df(e)||ff(e)?null:{conversion:cf,priority:0}}})}getTextContent(){return`
25
- `}createDOM(){return Lu().createElement(`br`)}updateDOM(){return!1}isInline(){return!0}};function cf(e){return{node:lf()}}function lf(){return Tu(new sf)}function uf(e){return e instanceof sf}function df(e){let t=e.parentElement;if(t!==null&&$u(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&pf(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&pf(n))return!0}}return!1}function ff(e){let t=e.parentElement;if(t!==null&&$u(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&pf(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&pf(r))return!0}return!1}function pf(e){return Cl(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function mf(e){console.warn(e)}function hf(e,t,n,r,i){let a=e._keyToDOMMap;a.clear(),e._editorState=Xd(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),t!==null&&yp(e,t),e._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},composedSegmentedKey:null,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,lastPointerType:``,mouseDrag:null,postDeleteSelectionToRestore:null,savedInputMode:void 0,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null};let o=e._observer;o!==null&&(o.disconnect(),e._observer=null),t!==null&&(t.textContent=``,function(e,t){delete e[`__lexicalKey_${t._key}`]}(t,e)),n!==null&&(n.textContent=``,a.set(`root`,n),Fl(n,e,`root`))}function gf(e){let t=new Set,n=new Set;for(let{klass:r,ownNodeConfig:i}of Wd(e)){let e=r.transform;if(!n.has(e)){n.add(e);let i=r.transform();i&&t.add(i)}if(i){let e=i.$transform;e&&t.add(e)}}return t}var _f={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{let n=pl(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>q(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,r)=>null,$shouldExclude:(e,t,n)=>q(e)&&e.excludeFromCopy(`html`),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function vf(e){let t=e||{},n=Vf(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=Xd(),s=t.namespace||(i===null?Yl():i._config.namespace),c=t.editorState,l=[lc,Sc,sf,al,el,of,...t.nodes||[]],{onError:u,onWarn:d,html:f}=t,p=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=new Map;for(let e=0;e<l.length;e++){let n=l[e],r=null,i=null;if(n&&typeof n==`object`){let e=n;n=e.replace,r=e.with,i=e.withKlass||null}if(typeof n!=`function`||!n.prototype||!(n===Fs||n.prototype instanceof Fs)){let r=`<unknown>`;try{r=JSON.parse(_a)}catch{}G(365,String(e-l.length+(t.nodes?t.nodes.length:0)),typeof n==`function`?`${n.name}${typeof n.getType==`function`?` (type ${String(n.getType())})`:``}`:String(n),String(r))}Ld(n);let a=n.getType(),o=gf(n);m.set(a,{exportDOM:f&&f.export?f.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:i,sharedNodeState:Co(l[e]),transforms:o})}}let h=new xf(o,i,m,{disableEvents:a,dom:{..._f,...e&&e.dom},namespace:s,theme:r},u||console.error,d||mf,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(m,f?f.import:void 0),p,e);return c!==void 0&&(h._pendingEditorState=c,h._dirtyType=2),function(e){e.registerCommand(bi,kp,0),e.registerCommand(xi,jp,0),e.registerCommand(Si,Np,0),e.registerCommand(Ci,Pp,0),e.registerCommand(Fi,Gp,0)}(h),h}function yf(e,t){let n=e.get(t);e.delete(t),n&&n()}function bf(e,t,n){return e.set(t,n),yf.bind(null,e,t)}var xf=class{static version=_a;_headless;_recordNodeMoves;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_keyDownShortcuts;_inputState;_lastNotifiedSelection;_createEditorArgs;constructor(e,t,n,r,i,a,o,s,c){this._createEditorArgs=c,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new xa,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Map,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Yl(),this._onError=i,this._onWarn=a,this._htmlConversions=o,this._editable=s,this._headless=t!==null&&t._headless,this._recordNodeMoves=!1,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._keyDownShortcuts=null,this._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},composedSegmentedKey:null,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,lastPointerType:``,mouseDrag:null,postDeleteSelectionToRestore:null,savedInputMode:void 0,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null},this._lastNotifiedSelection=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return bf(this._listeners.update,e)}registerEditableListener(e){return bf(this._listeners.editable,e)}registerDecoratorListener(e){return bf(this._listeners.decorator,e)}registerTextContentListener(e){return bf(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return tp(bf(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){let r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&G(35);let r=this._commands;r.has(e)||r.set(e,[new va,new va,new va,new va,new va]);let i=r.get(e);i===void 0&&G(36,String(e));let a=function(e){return 7&e}(n),o=i[a];return a===n?o.addBack(t):o.addFront(t),()=>{o.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&G(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=sd(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return Bl(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...t){return lu(this,e,...t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=iu(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,hf(this,t,e,r,{preserveUpdateQueue:!0}),t!==null&&(this._config.disableEvents||function(e){let t=ap.get(e);if(t===void 0)return void Qp();let n=op.get(t);if(n===void 0)return void Qp();ap.delete(e);let r=bl(e);vl(r)?(function(e){if(e._parentEditor!==null){let t=ql(e),n=t[t.length-1]._key;Jp.get(n)===e&&Jp.delete(n)}else Jp.delete(e._key)}(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&G(198);let i=Kp(e);for(let e=0;e<i.length;e++)i[e]();e.__lexicalEventHandles=[]}(t),n!=null&&t.classList.remove(...n)),e!==null){let t=vu(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=2,Wa(this),this._updateTags.add(tf),qf(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;ap.set(e,n);let r=op.get(n);r===void 0&&(r={editors:new Set,hasShadowEditor:void 0},op.set(n,r)),r.editors.add(t),r.hasShadowEditor=void 0,e.__lexicalEditor=t;let i=Kp(e);i.push(sp.register(n));let a={blur:oa,click:mp,compositionend:Lp,compositionstart:Mp,copy:Qi,cut:$i,dragend:Zi,dragover:Xi,dragstart:Yi,drop:Ji,focus:aa,input:Ap,keydown:Rp,paste:Oi,pointerdown:bp,...Jr&&{beforeinput:Op},...Xr&&{keyup:zp,mousedown:_p}};for(let[n,r]of Object.entries(a))i.push(np(e,n,i=>{Zp(i)||(Xp(i),n===`blur`&&(yp(t,e),t._inputState.isShiftKeyDown=!1,t._inputState.isInsertLineBreak=!1),(t.isEditable()||n===`click`||n===`copy`)&&(typeof r==`function`?r(i,t):lu(t,r,i)))}));let o,s=()=>{t._inputState.mouseDrag=null},c=n=>{let i=t._inputState,a=i.mouseDrag;if(o&&o.defaultPrevented&&!n.buttons&&(i.isSelectionChangeFromMouseDown=!1),!a||n.pointerType!==`mouse`)return;let c=n.type===`pointerup`;if(n.type===`pointercancel`||!c&&n.buttons!==1)return s();i.mouseDrag=c?null:n,ep(t,()=>{let o=Au(yu(t));if(a.type!==`mousedown`){let r=c&&o&&X(Z())&&Im(Rm(),o,t,new Event(`selectionchange`));return r&&Ul(r),Sp(t,n,c&&o?Bu(o,e).focusNode:null)}let l=Pm(o,t);if(a.defaultPrevented||!a.shiftKey&&l&&!l.isCollapsed())s();else if(o&&i.isSelectionChangeFromMouseDown){qp(t,o,new Event(`selectionchange`),r),Sp(t,a,Bu(o,e).focusNode);let n=Z();X(n)&&n.isCollapsed()&&!n.is(Rm())&&pp(t,n)}})};i.push(rp(n,{pointercancel:c,pointermove:c,pointerup:c},!0),np(yu(t),`blur`,s),t.registerEditableListener(s),rp(e,{contextmenu:s,dragstart:s,keydown:e=>e.getModifierState&&e.getModifierState(e.key)||s(),mousedown:e=>{let n=t._inputState;n.mouseDrag=e.button!==0||e.detail!==1||e.defaultPrevented||n.lastPointerType!==`mouse`||!t.isEditable()||t.isComposing()||gd(Ku(e),t)?null:e}}),np(e,`pointerdown`,e=>{o=e,t._inputState.lastPointerType=e.pointerType},!0)),Xr&&i.push(function(e,t){let n=null,r={capture:!0,passive:!0};return tp(np(e,`touchstart`,e=>{let t=e.touches.length===1?e.touches[0]:null;n=t?{x:t.clientX,y:t.clientY}:null},r),np(e,`touchend`,e=>{let r=e.changedTouches[0];n!==null&&r&&e.touches.length===0&&Math.abs(r.clientX-n.x)<=hp&&Math.abs(r.clientY-n.y)<=hp&&t(e),n=null},r))}(e,n=>function(e,t,n){t._inputState.savedInputMode!==void 0&&(vp(e,t,n)||(Gu(n.ownerDocument)===n&&n.blur(),yp(t,n)))}(n,t,e)))}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(tf),qf(this);Jf(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){let n=e.isEmpty(),r=e;r._readOnly&&(r=Yd(e),r._selection=e._selection?e._selection.clone():null),Ua(this);let i=this._pendingEditorState,a=t===void 0?null:t.tag;i===null||i.isEmpty()||(a!=null&&this._updateTags.add(a),qf(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,ep(this,()=>{if(a&&this._updateTags.add(a),n&&(Rr(38),Vl().append(nl())),e._parsed)for(let[e,t]of r._nodeMap.entries())q(t)?this._dirtyElements.set(e,!0):this._dirtyLeaves.add(e)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(e,t,n){let r=Xd(),i=Cf,a=Tf,o=wf,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Map,t._dirtyType=0,Cf=r,Tf=!1,wf=t,ll(null);try{let i=t._nodes;Gf(e.root,i),n&&n(),r._readOnly=!0,r._parsed=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,Cf=i,Tf=a,wf=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(...e){let[t,n]=e.length===1?[`force-commit`,e[0]]:e;return t===`force-commit`&&(Af.has(this)||qf(this)),(t===`pending`?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):$f(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),ep(this,()=>{let r=Z(),i=Vl();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||Ul(r.clone()),hu(`focus`),gu(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=Au(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Jf(`editable`,this,!0,e),this._slotsUsed&&this.update(()=>zf()))}toJSON(){return{editorState:this._editorState.toJSON(wa())}}};function Sf(e,t,n,r,i,a){if(q(e)){let o=e.__first;for(;o!==null;){let e=r.get(o);if(e===void 0)break;let s=q(e);e.__parent!==t||s&&a.has(o)||((s||lh(e)&&e.__slots!==null)&&Sf(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o)),o=e.__next}}for(let o of lh(e)&&e.__slots!==null?e.__slots.values():[]){let e=r.get(o);e!==void 0&&uh(e)&&e.__slotHost===t&&((q(e)||lh(e)&&e.__slots!==null)&&Sf(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o))}}var Cf=null,wf=null,Tf=!1,Ef=!1,Df=!1,Of=new Set,kf=new Set,Af=new Set,jf=0,Mf={characterData:!0,childList:!0,subtree:!0};function Nf(){return Tf||Cf!==null&&Cf._readOnly}function Pf(){Tf&&G(13)}function Ff(){jf>99&&G(14)}function If(){return Cf===null&&G(195,Bf()),Cf}function Lf(e){If()!==null&&wf===null&&(wf=e),wf!==e&&Rr(378)}function Rf(){return wf===null&&G(337,Bf()),wf}function zf(){Rf()._dirtyType=2}function Bf(){let e=0,t=new Set,n=xf.version;if(typeof window<`u`)for(let r of Fu(document)){let i=bl(r);if(vl(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function Vf(){return wf}function Hf(e,t,n){let r=t.__type,i=fl(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function Uf(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function Wf(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function Gf(e,t){let n=e.type,r=t.get(n);r===void 0&&G(17,n);let i=r.klass;e.type!==i.getType()&&G(18,i.name);let a=i.importJSON(e),o=e.children;if(q(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=Gf(o[e],t);a.append(n)}let s=e.$slots;if(s){lh(a)||G(379,i.name);for(let e in s)Dh(a,e,Gf(s[e],t))}return a}function Kf(e,t,n){let r=Cf,i=Tf,a=wf;Cf=t,Tf=!0,wf=e;try{return n()}finally{Cf=r,Tf=i,wf=a}}function qf(e,t){e._pendingEditorState!==null&&wf!==e&&Ua(e,!1,!0);let n=Df;Df=!0;try{let n=function(e){if(kf.has(e))return!1;kf.add(e);try{for(let t=0;e._pendingEditorState!==null;t++){let n=e._pendingEditorState._selection,r=e._rootElement;if(!Yf(e,n))return!1;let i=(n===null||X(n))&&(e._headless||r===null||!r.isConnected);if(i||t===100)return e._lastNotifiedSelection=n===null?null:n.clone(),!i;$f(e,()=>e.dispatchCommand(vi),void 0,!0)}return!1}finally{kf.delete(e)}}(e);(function(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return void(!e._updating&&e._deferred.length>0&&Zf(e,e._deferred));let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=Cf,u=Tf,d=wf,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){wf=e,Cf=n,Tf=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=ks(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),Ef)throw t;hf(e,null,r,n),Wa(e),e._dirtyType=2,Ef=!0,qf(e,a),Ef=!1;return}finally{p.observe(r,Mf),e._updating=f,Cf=l,Tf=u,wf=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set),e._updateTags=new Set;let y=e._deferred;f||(e._deferred=[]),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=Rl(e)),delete r[a])}(e,n);let b=i?null:Au(yu(e));if(e._editable&&b!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){wf=e,Cf=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&ku(t,e,r),Gm(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(X(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(Wu(t))){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())Ou(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);t!==null&&Ou(t)&&(s=!0,c=e.getElementByKey(t.__key))}if(s){let n=nd(a,e.getElementByKey(a.__key),e).element;r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=Lu().createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=fg(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&ku(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,Mf),wf=d,Cf=l}}let x=Af.has(e);Af.add(e);try{m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a);let r=e._pendingDecorators;r!==null&&(e._decorators=r,e._pendingDecorators=null,Jf(`decorator`,e,!0,r)),function(e,t,n){let r=zl(t),i=zl(n);r!==i&&Jf(`textcontent`,e,!0,i)}(e,t||a,n),Jf(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v})}finally{x||Af.delete(e)}f||Zf(e,y),function(e){let t=e._updates;if(t.length===0)return void(e._cascadeCount=0);if(function(e){Of.has(e)||(Of.add(e),setTimeout(()=>{Of.delete(e),e._cascadeCount=0},0))}(e),e._cascadeCount++>99)return e._updates=[],e._cascadeCount=0,void e._onWarn(Lr(437,e._config.namespace));let n=t.shift();if(n){let[t,r]=n;$f(e,t,r)}}(e)})(e,t),n&&e._onWarn(Lr(436))}finally{Df=n}}function Jf(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e],i=Array.from(n);for(let[e,t]of i){t&&t();let i=e(...r),a=typeof i==`function`?i:void 0;n.has(e)?n.set(e,a):a&&a()}}finally{t._updating=i}}function Yf(e,t){let n=e._lastNotifiedSelection;return t===null?n!==null:!t.is(n)}function Xf(e,t,n,r){let i=ql(e),a;if(!Df)for(let e=0;e<i.length;e++)i[e]._updating||(i[e]._cascadeCount=0);if(t===vi){if(wf!==e||Tf){let i=!1;return ep(e,()=>{i=Xf(e,t,n,r)}),i}let i=If()._selection;e._lastNotifiedSelection=i===null?null:i.clone()}for(let e=4;e>=0;e--)for(let o=0;o<i.length;o++){let s=i[o];if(o>0&&s._updating){a=s;break}let c=s._commands.get(t);if(c!==void 0){let t=c[e];if(t.size>0){let e=!1;if(ep(s,()=>{for(let i of t)if(i(n,r))return void(e=!0)}),e)return e}}}return a&&a.update(()=>{Xf(a,t,n,r)}),!1}function Zf(e,t){if(e._deferred===t&&(e._deferred=[]),t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}function Qf(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&G(191),a._flushSync=!0),o&&e._deferred.push(o),Wf(e,i.tag)),a==null?$f(e,n,i):n()}}return r}function $f(e,t,n,r=!1){let i=e._updateTags,a,o=!1,s=!1;n!==void 0&&(a=n.onUpdate,Wf(e,n.tag),o=n.skipTransforms||!1,s=n.discrete||!1),a&&e._deferred.push(a);let c=e._editorState,l=e._pendingEditorState,u=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=Yd(l||c),u=!0),l._flushSync=s;let d=Cf,f=Tf,p=wf,m=e._updating,h=e._lastNotifiedSelection;Cf=l,Tf=!1,e._updating=!0,wf=e;let g=e._headless||e.getRootElement()===null;ll(null);try{u&&(g?c._selection!==null&&(l._selection=c._selection.clone()):l._selection=function(e,t){let n=e.getEditorState()._selection,r=Au(yu(e));return X(n)||n==null?Im(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),o=Qf(e,o),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(X(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(l,e),e._dirtyType!==0&&(o?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);J(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&zs(t)}}(l,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=jl(),o=new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);J(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&zs(r),r!==void 0&&Uf(r,a)&&Hf(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){jf++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&Uf(c,a)&&Hf(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,jf++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),Qf(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(q(t)&&Sf(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(lh(t)&&t.__slots!==null&&Sf(t,e,i,a,o,n),i.has(e)||n.delete(e),o.push(e))}let s=Rf(),c=s._cloneNotNeeded;for(let e of o)a.delete(e),c.delete(e);let l=s._compositionKey;l===null||a.has(l)||(s._compositionKey=null)}(c,l,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(l._flushSync=!0);let i=l._selection;if(X(i)){e._slotsUsed&&Dm(i);let t=l._nodeMap,n=i.anchor.key,r=i.focus.key;t.get(n)!==void 0&&t.get(r)!==void 0||G(19)}else lm(i)&&i._nodes.size===0&&(l._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=c;let n=c._selection;e._lastNotifiedSelection=n===null?null:n.clone(),e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),qf(e);return}finally{Cf=d,Tf=f,wf=p,e._updating=m,jf=0}r||(e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(l,e)?l._flushSync?(l._flushSync=!1,qf(e)):u&&ml(()=>{qf(e)}):(l._flushSync=!1,u&&(i.clear(),e._deferred=[],e._pendingEditorState=null,e._lastNotifiedSelection=h)))}function ep(e,t,n){wf===e&&n===void 0?Nf()?$f(e,t,n):t():$f(e,t,n)}function tp(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function np(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}function rp(e,t,n){return tp(...Object.entries(t).map(([t,r])=>np(e,t,r,n)))}var ip=30,ap=new WeakMap,op=new WeakMap,sp=ha(e=>(e.addEventListener(`selectionchange`,Yp),()=>e.removeEventListener(`selectionchange`,Yp)));function cp(e,t,n,r,i,a){let o=e.anchor,s=e.focus,c=o.getNode(),l=Rf(),u;if(a!==void 0)u=a;else{let e=Au(yu(l));u=e===null?null:Bu(e,l._rootElement)}let d=u===null?null:u.anchorNode,f=o.key,p=l.getElementByKey(f),m=n.length;return f!==s.key||!J(c)||(!i&&(!Jr||l._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||c.isDirty()&&m<2||Kl(n))&&o.offset!==s.offset&&!c.isComposing()||Sl(c)||c.isDirty()&&m>1||(i||!Jr)&&p!==null&&!c.isComposing()&&d!==id(c,p,l)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!c.isComposing()&&(c.getFormat()!==e.format||c.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=xl(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(J(t)||q(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,c)}function lp(e,t){return Cl(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function up(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=Bu(e,t._rootElement),s=t._inputState;if(s.isSelectionChangeFromDOMUpdate){s.isSelectionChangeFromDOMUpdate=!1;let e=s.selectionChangeFromDOMUpdatePoints;if(s.selectionChangeFromDOMUpdatePoints=null,lp(r,i)&&lp(a,o)&&!s.postDeleteSelectionToRestore&&(e===null||e.anchorNode===r&&e.anchorOffset===i&&e.focusNode===a&&e.focusOffset===o))return}ep(t,()=>{if(!n)return void Ul(null);if(!_l(t,r,a))return;let c=s.mouseDrag;!c||c.type===`mousedown`&&c.defaultPrevented||Sp(t,c,a);let l=xp.has(c),u=Z();if(s.postDeleteSelectionToRestore&&X(u)&&u.isCollapsed()){let e=u.anchor,t=s.postDeleteSelectionToRestore.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(u=s.postDeleteSelectionToRestore.clone(),Ul(u))}if(s.postDeleteSelectionToRestore=null,X(u)){let n=u.anchor;if(u.isCollapsed())e.type===`Range`&&r===a&&(u.dirty=!0),pp(t,u);else{let e=n.key,t=u.focus,r=t.key,a=u.getNodes(),s=a.length,c=u.isBackward(),[d,f]=l?[n.offset,t.offset]:[i,o],p=c?f:d,m=c?d:f,h=c?r:e,g=c?e:r,_=ri,v=!1;for(let e=0;e<s;e++){let t=a[e],n=t.getTextContentSize();if(J(t)&&n!==0&&!(e===0&&t.__key===h&&p===n||e===s-1&&t.__key===g&&m===0)&&(v=!0,_&=t.getFormat(),_===0))break}u.format=v?_:0}}(function(e,t,n=!1){(n||Yf(e,t))&&e.dispatchCommand(vi)})(t,u,u!==null&&(u.dirty&&!l||!X(u)))})}function dp(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function fp(e,t){dp(e,t.getFormat(),t.getStyle())}function pp(e,t){let n=t.anchor,r=n.getNode(),i=yu(e).event,a=i?i.timeStamp:performance.now(),{format:o,style:s,offset:c,key:l,timeStamp:u}=e._inputState.collapsedSelectionFormat;a<u+200&&n.offset===c&&n.key===l?dp(t,o,s):n.type===`text`?(J(r)||G(141),fp(t,r)):(e.isComposing()||Vl().getTextContent()!==``)&&(q(r)||G(259),r.isEmpty()?Lm(t,``):dp(t,t.format,``))}function mp(e,t){ep(t,()=>{let n=Z(),r=Au(yu(t)),i=Rm();if(r){if(X(n)){let e=n.anchor,t=e.getNode();e.type===`element`&&e.offset===0&&n.isCollapsed()&&!uc(t)&&Vl().getChildrenSize()===1&&t.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if(e.pointerType===`touch`||e.pointerType===`pen`||Xr&&t._inputState.lastPointerType!==`mouse`){let n=Bu(r,t._rootElement).anchorNode;(qu(n)||Cl(n))&&Ul(Im(i,r,t,e))}}if(Kr&&r!==null&&r.rangeCount===0){let n=t._rootElement;if(n!==null&&e.target===n){let a=e.clientY,o=n.childNodes.length;for(let e=0;e<n.childNodes.length;e++){let t=n.childNodes[e];if(qu(t)){let n=t.getBoundingClientRect();if(a<=(n.top+n.bottom)/2){o=e;break}}}r.setBaseAndExtent(n,o,n,o);let s=Im(i,r,t,e);s===null?r.removeAllRanges():Ul(s)}}lu(t,yi,e)})}var hp=10,gp=`input:not(:disabled),textarea:not(:disabled),select:not(:disabled),button:not(:disabled),a[href],area[href],label,summary,iframe,object,embed,audio[controls],video[controls],[tabindex],[contenteditable]:not([contenteditable="false"])`;function _p(e,t){let n=t.getRootElement();n!==null&&(vp(e,t,n)?(e.preventDefault(),Gu(n.ownerDocument)!==n&&(t._inputState.savedInputMode===void 0&&(t._inputState.savedInputMode=n.getAttribute(`inputmode`)),n.setAttribute(`inputmode`,`none`),n.focus({preventScroll:!0}))):yp(t,n))}function vp(e,t,n){if(t._inputState.lastPointerType===`mouse`)return!1;let r=Ku(e);if(!Ju(r))return!1;let i=!1;for(let e=r;e!==null;e=du(e)){if(e===n)return i;if(e.nodeType===1){let t=e;if(t.matches(gp))return!1;t.getAttribute(`data-lexical-decorator`)===`true`&&(i=!0)}}return!1}function yp(e,t){let n=e._inputState.savedInputMode;n!==void 0&&(e._inputState.savedInputMode=void 0,n===null?t.removeAttribute(`inputmode`):t.setAttribute(`inputmode`,n))}function bp(e,t){let n=Ku(e),r=e.pointerType;Ju(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&ep(t,()=>{gd(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}var xp=new WeakSet;function Sp(e,t,n=null){let r=Z(),i=r&&r.clone();(function(e,t,n){let r=Rm(),i=t.type===`mousedown`,a=i&&!t.shiftKey,o=n&&Ll(n);sc(o)&&(i?a&&o.isInline()&&o.selectPrevious():X(r)&&Ul(r.clone()));let s=Z(),c=s||(a?Mm():X(r)?r.clone():null),l=e.getRootElement(),u=l&&l.getRootNode();if(!X(c)||a&&!c.isCollapsed()||!wl(u)&&!Mu(u))return;let{anchor:d,focus:f}=c;if(!i&&X(r)){let{key:e,offset:t,type:n}=r.anchor;d.set(e,t,n,!0)}let{clientX:p,clientY:m}=t,h=u.elementFromPoint&&u.elementFromPoint(p,m),g=h&&Ll(h),_=(e,t)=>q(e)?t===`next`?e.getLastDescendant():e.getFirstDescendant():e,v=[null],y=q(g)&&!g.isInline()&&(uc(g)?Kd(f.getNode(),Am):g);for(let e of y?qh(y,`next`):[])v.push(Uh(e.origin,`previous`),e);let b=yu(e),x=b.document.createRange(),S=null;for(let t of v){let n=t?_(t.origin,t.direction):g;if(!sc(n)||!n.isInline()||n===S)continue;let r=e.getElementByKey(n.getKey());if(!r)continue;x.selectNodeContents(r);let i=x.getBoundingClientRect(),o=r.getBoundingClientRect(),{bottom:l,left:u,right:h,top:v}=i.height>o.height?i:o;if(t&&(m<v||m>l)){S=n;continue}let y=b.getComputedStyle(du(r)||r).direction===`rtl`,C=2*p>u+h!==y,w=C?`next`:`previous`,T=t&&t.getNodeAtCaret(),E=T&&e.getElementByKey(T.getKey()),D=E?E.getClientRects():[],O=D[C?0:D.length-1];if(!t||t.direction===w&&b.getComputedStyle(r).cssFloat===`none`&&(!T||uf(T)||O&&(C===y?2*O.right>u+h:2*O.left<u+h))){if(!n.is(_(su(f,C),w))){let e=Uh(n,w);Pc(f,e),a&&Pc(d,e)}s||Ul(c);return}}if(sc(o)&&!i){let t=b.document,n=t.caretPositionFromPoint&&t.caretPositionFromPoint(p,m,{shadowRoots:Mu(u)?[u]:[]}),r=n&&Sm(n.offsetNode,n.offset,null,e);if(r){let[{key:e,offset:t,type:n}]=r;f.set(e,t,n)}}})(e,t,n);let a=Z(),o=e._inputState.mouseDrag;o&&a&&!a.is(i)&&xp.add(o),t.type===`mousedown`&&X(a)&&Lm(a,X(i)?i.anchor.key:``)}function Cp(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function wp(e){let{lastKeyCode:t}=Rf()._inputState;if(e==null||e.length<=1||t==null)return;let n=t.length===1?t:t===`Enter`?`
26
- `:t===`Tab`?` `:null;if(!n)return;let r=Z();if(!X(r)||!r.isCollapsed())return;let i=r.anchor.getNode();if(!J(i))return;let{offset:a}=r.anchor;if(i.getTextContentSize()===a){let e=i.getNextSibling();if(n===`
27
- `){if(Xr)return;if(uf(e))e.selectEnd();else if(!e){let e=Kd(i,Am),t=e&&e.getNextSibling();q(t)&&t.selectStart()}}else n===` `?sl(e)&&e.selectEnd():J(e)&&e.getTextContent()[0]===n&&e.select(1,1)}else i.getTextContent()[a]===n&&i.select(a+1,a+1)}function Tp(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function Ep(e){Gr&&!Xr&&$r&&(Tp(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>Tp(e),0))}function Dp(e,t){let n=Ku(e);if(qu(n)&&gd(n,t))return!0;let r=t.getRootElement();if(r===null)return!1;let i=Gu(r.ownerDocument);return i!==null&&r.contains(i)&&(gd(i,t)||hl(r,i))}function Op(e,t){let n=e.inputType;n===`deleteCompositionText`||Kr&&cu(t)||n!==`insertCompositionText`&&ep(t,()=>{Dp(e,t)||lu(t,bi,e)},{event:e})}function kp(e){let t=e.inputType,n=Cp(e),r=Rf(),i=r._inputState,a=Z();if(t===`insertText`&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(Tp(i),e.preventDefault(),X(a)&&!a.isCollapsed()){let e=a.isBackward()?a.anchor:a.focus;a.anchor.set(e.key,e.offset,e.type),a.focus.set(e.key,e.offset,e.type)}return!0}if(t===`deleteContentBackward`){if(a===null){let e=Rm();if(!X(e))return!0;Ul(e.clone())}if(X(a)){let t=a.anchor.key===a.focus.key;if(function(e,t){return e.lastKeyCode===`MediaLast`&&t<e.lastKeyDownTimeStamp+ip}(i,e.timeStamp)&&r.isComposing()&&t){if(Al(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{ep(r,()=>{Al(null)})},ip),X(a)){let e=a.anchor.getNode();e.markDirty(),J(e)||G(142),fp(a,e)}}else{if(Al(null),Xr&&n!==null&&!n.collapsed&&(a.applyDOMRange(n),!a.isCollapsed()))return e.preventDefault(),a.removeText(),!0;e.preventDefault();let o=a.anchor.getNode(),s=o.getTextContent(),c=o.canInsertTextAfter(),l=a.anchor.offset===0&&a.focus.offset===s.length,u=ei&&t&&!l&&c;if(u&&a.isCollapsed()&&(u=!sc(su(a.anchor,!0))),!u){lu(r,wi,!0);let e=Z();ei&&X(e)&&e.isCollapsed()&&(i.postDeleteSelectionToRestore=e,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!X(a))return t!==`historyUndo`&&t!==`historyRedo`||(e.preventDefault(),lu(r,t===`historyUndo`?Ni:Pi)),!0;let o=e.data;i.unprocessedBeforeInputData!==null&&Zl(!1,r,i.unprocessedBeforeInputData);let s=!1;if((!a.dirty||i.unprocessedBeforeInputData!==null)&&a.isCollapsed()&&!uc(a.anchor.getNode())&&n!==null){let{key:e,offset:i,type:o}=a.anchor,c=r._slotsUsed&&wm(a.anchor);a.applyDOMRange(n);let l=t.endsWith(`Forward`);if(!1!==c&&(l||t.endsWith(`Backward`))){let n=em(e,i,o),{anchor:r,focus:u}=a,d=!Em(wm(r),c)||!Em(wm(u),c),f=!d&&c!==null&&(l?r.isBefore(n)||u.isBefore(n):n.isBefore(r)||n.isBefore(u));(d||f)&&(r.set(e,i,o),u.set(e,i,o),s=f&&t===`deleteContentForward`)}}i.unprocessedBeforeInputData=null;let c=a.anchor,l=a.focus,u=c.getNode(),d=l.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===`
28
- `)e.preventDefault(),lu(r,Ti,!1);else if(o===ai)e.preventDefault(),lu(r,Ei);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),a.insertRawText(t)}else o!=null&&cp(a,n,o,e.timeStamp,!0)?(e.preventDefault(),lu(r,Di,o),wp(o)):i.unprocessedBeforeInputData=o;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:lu(r,Di,e),wp((e.dataTransfer?e.dataTransfer.getData(`text/plain`):null)??e.data);break;case`insertFromComposition`:{i.compositionPhase=`idle`;let t=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;let n=r._compositionKey;Al(null),t||lu(r,Di,e),Fp(n);break}case`insertLineBreak`:Al(null),i.isInsertLineBreak=!1,lu(r,Ti,!1);break;case`insertParagraph`:Al(null),i.isInsertLineBreak?(i.isInsertLineBreak=!1,lu(r,Ti,!1)):lu(r,Ei);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:lu(r,Oi,e);break;case`deleteByComposition`:(function(e,t){return e!==t||q(e)||q(t)||!xl(e)||!xl(t)})(u,d)&&lu(r,ki,e);break;case`deleteByDrag`:hu(rf),lu(r,ki,e);break;case`deleteByCut`:lu(r,ki,e);break;case`deleteContent`:lu(r,wi,!1);break;case`deleteWordBackward`:lu(r,Ai,!0);break;case`deleteWordForward`:lu(r,Ai,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:lu(r,ji,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:lu(r,s?wi:ji,!1);break;case`formatStrikeThrough`:lu(r,Mi,`strikethrough`);break;case`formatBold`:lu(r,Mi,`bold`);break;case`formatItalic`:lu(r,Mi,`italic`);break;case`formatUnderline`:lu(r,Mi,`underline`);break;case`historyUndo`:lu(r,Ni);break;case`historyRedo`:lu(r,Pi)}return!0}function Ap(e,t){e.stopPropagation();let n=t._inputState;Tp(n),ep(t,()=>{Dp(e,t)||t.dispatchCommand(xi,e)},{event:e}),n.unprocessedBeforeInputData=null}function jp(e){let t=Rf(),n=t._inputState,r=Z(),i=e.data,a=Cp(e),o=!1,s=!1;if(i!=null&&X(r)){let c=Au(yu(t)),l=c===null?null:Bu(c,t._rootElement),u=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&!t.isComposing();u&&(n.hadOrphanedCompositionEvents=!0);let d=r.anchor.getNode(),f=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&t.isComposing()&&J(d)&&Sl(d);if(!u&&!f&&cp(r,a,i,e.timeStamp,!1,l)){if(o=!0,n.compositionPhase===`ending-firefox`){let e=Ip(t,i);if(n.compositionPhase=`idle`,e)return hu(af),Wl(),!0}let a=r.anchor.getNode();if(c===null||l===null)return!0;let u=r.isBackward(),d=u?r.anchor.offset:r.focus.offset,f=u?r.focus.offset:r.anchor.offset;Jr&&!r.isCollapsed()&&J(a)&&l.anchorNode!==null&&a.getTextContent().slice(0,d)+i+a.getTextContent().slice(d+f)===Xl(l.anchorNode)||(lu(t,Di,i),s=e.inputType===`insertText`);let p=i.length;Kr&&p>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(r.anchor.offset-=p,r._cachedNodes=null,r._cachedIsBackward=null),ei&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,Al(null))}}return o||(Zl(!1,t,i===null?void 0:i),n.compositionPhase===`ending-firefox`&&(Ip(t,i||void 0),hu(`composition-end`),n.compositionPhase=`idle`)),Wl(s),!0}function Mp(e,t){lu(t,Si,e)}function Np(e){let t=Rf(),n=t._inputState,r=Z();if(X(r)&&!t.isComposing()){n.compositionPhase=`composing`,n.hadOrphanedCompositionEvents=!1;let i=r.anchor,a=r.anchor.getNode();if(Al(i.key),hu(`composition-start`),e.timeStamp<n.lastKeyDownTimeStamp+ip||i.type===`element`||!r.isCollapsed()||!ei&&(a.getFormat()!==r.format||J(a)&&a.getStyle()!==r.style)||J(a)&&(Sl(a)||i.offset===0&&!a.canInsertTextBefore()||i.offset===a.getTextContentSize()&&!a.canInsertTextAfter())){Xr||!Qr&&!ti?lu(t,Di,oi):function(e){im(e,``,!0)}(r);let e=Z();X(e)&&Al(e.anchor.key)}}return!0}function Pp(e){let t=Rf();return t._inputState.compositionPhase=`idle`,Ip(t,e.data),hu(af),!0}function Fp(e){let t=Rf()._inputState,n=t.composedSegmentedKey;if(t.composedSegmentedKey=null,e===null||e!==n)return;let r=Nl(e);if(!J(r)||r.getType()===`text`||Sl(r)||!r.isAttached())return;let i=Z(),a=X(i)&&i.anchor.key===e?i.anchor.offset:null,o=jc(r.getTextContent());if(o.setFormat(r.getFormat()),o.setStyle(r.getStyle()),r.replace(o),a!==null){let e=Math.min(a,o.getTextContentSize());o.select(e,e)}}function Ip(e,t){let n=e._compositionKey;if(Al(null),n!==null&&t!=null){if(t===``){let t=Nl(n),r=e.getElementByKey(n),i=r!==null&&J(t)?id(t,r,e):null;if(i!==null&&i.nodeValue!==null&&J(t)){let n=Au(yu(e)),r=n&&Bu(n,e._rootElement),a=null,o=null;r!==null&&r.anchorNode===i&&(a=r.anchorOffset,o=r.focusOffset),Ql(t,i.nodeValue,a,o,!0)}return Fp(n),!1}if(t[t.length-1]===`
29
- `){let t=Z();if(X(t)||lm(t)){if(X(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}return lu(e,Hi,null),Fp(n),!1}}let r=Nl(n);if(r!==null&&J(r)&&Sl(r)){r.markDirty();let e=Z(),i=r.getTextContentSize(),a=X(e)&&e.anchor.key===n?e.anchor.offset:i;return r.select(a,a).insertText(t),!0}}return Zl(!0,e,t),Fp(n),!1}function Lp(e,t){let n=t._inputState;Kr?n.compositionPhase=`ending-firefox`:(e.data===``||Xr||!Qr&&!ti)&&lu(t,Ci,e)}function Rp(e,t){let n=t._inputState;Xr&&(n.isShiftKeyDown=e.key===`Shift`||n.isShiftKeyDown&&e.shiftKey&&e.key!==`CapsLock`),n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,e.key!==`Backspace`&&Tp(n),t.isComposing()||!Xr&&(Qr||ti)&&e.keyCode===229||lu(t,Fi,e)}function zp(e,t){e.shiftKey&&e.key!==`CapsLock`||(t._inputState.isShiftKeyDown=!1)}var Bp={altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:`any`},Vp={ctrlKey:!0},Hp={metaKey:!0},Up={shiftKey:`any`},Wp={altKey:`any`,shiftKey:`any`};function Gp(e){let t=Rf();if(e.key==null)return!0;let n=t._keyDownShortcuts;n===null&&(n=ma(function(){let e=(e,t,n)=>({key:e,modifiers:t,onMatch:(e,t)=>{lu(t,n,e)}}),t=(e,t,n,r)=>({key:e,modifiers:t,onMatch:(e,t)=>{e.preventDefault(),lu(t,n,r)}}),n=(e,t)=>({key:`Enter`,modifiers:e,onMatch:(e,n)=>{let r=n._inputState;r.isInsertLineBreak=t&&(!Xr||r.isShiftKeyDown),lu(n,Hi,e),e.defaultPrevented&&(r.isInsertLineBreak=!1)}}),r=(e,t)=>({key:e,modifiers:la,onMatch:(e,n)=>{let r=n._editorState._selection;r===null||X(r)||gl(e)||(e.preventDefault(),lu(n,t,e))}});return[e(`ArrowRight`,Up,Ii),e(`ArrowLeft`,Up,Ri),e(`ArrowUp`,Wp,Bi),e(`ArrowDown`,Wp,Vi),n({...Bp,shiftKey:!0},!0),n({...Bp,shiftKey:!1},!1),e(` `,Bp,Ui),{key:`Backspace`,modifiers:Up,onMatch:(e,t)=>{lu(t,Wi,e)&&Ep(t._inputState)}},e(`Escape`,Bp,Gi),e(`Delete`,{},Ki),t(`Backspace`,ua,Ai,!0),t(`Delete`,ua,Ai,!1),t(`b`,la,Mi,`bold`),t(`u`,la,Mi,`underline`),t(`i`,la,Mi,`italic`),e(`Tab`,Up,qi),t(`z`,la,Ni,void 0),t(`z`,{...la,shiftKey:!0},Pi,void 0),...Gr?[{key:`o`,modifiers:Vp,onMatch:(e,t)=>{e.preventDefault(),lu(t,Ti,!0)}},e(`ArrowLeft`,{metaKey:!0,...Up},zi),e(`ArrowRight`,{metaKey:!0,...Up},Li),t(`h`,Vp,wi,!0),t(`d`,Vp,wi,!1),t(`Backspace`,Hp,ji,!0),t(`Delete`,Hp,ji,!1),t(`k`,Vp,ji,!1)]:[e(`Home`,Up,zi),e(`End`,Up,Li),t(`y`,Vp,Pi,void 0)],{key:`a`,modifiers:la,onMatch:(e,t)=>{e.preventDefault(),lu(t,ea,e)&&Ep(t._inputState)}},r(`c`,Qi),r(`x`,$i)]}()),t._keyDownShortcuts=n);let r=n.match(e);return r&&r.onMatch(e,t),function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(sa,e),!0}function Kp(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}function qp(e,t,n,r){if(r!==void 0)for(let e of r.editors)e._inputState.isSelectionChangeFromMouseDown=!1;let i=Bu(t,e._rootElement).anchorNode;(qu(i)||Cl(i))&&Ul(Im(Rm(),t,e,n))}var Jp=new Map;function Yp(e){let t=e.target;if(qu(t)&&(t.nodeName===`INPUT`||t.nodeName===`TEXTAREA`))return;let n=ju(t);if(n===null)return;let r=fu(t),i=null,a=r===null?void 0:op.get(r);if(r!==null){if(a!==void 0){let e=a.editors,t=a.hasShadowEditor;if(t===void 0){t=!1;for(let n of e)if(n._rootElement!==null&&Mu(n._rootElement.getRootNode())){t=!0;break}a.hasShadowEditor=t}if(t){let t=null;for(let r of e){let e=r._rootElement;if(e===null)continue;let a=Bu(n,e).anchorNode;if(a!==null&&yl(a)===r){if(Mu(e.getRootNode())){i=r;break}t===null&&(t=r)}}i===null&&t!==null&&(i=t)}else{let e=n.anchorNode;e===null||qu(e)&&e.shadowRoot!==null||(i=yl(e))}}if(i===null){let e=Gu(r);i=e===null?null:yl(e)}}if(i===null)return;i._inputState.isSelectionChangeFromMouseDown&&ep(i,()=>qp(i,n,e,a));let o=ql(i),s=o[o.length-1],c=s._key,l=Jp.get(c),u=l||s;u!==i&&up(n,u,!1),up(n,i,!0),i===s?l&&Jp.delete(c):Jp.set(c,i)}function Xp(e){e._lexicalHandled=!0}function Zp(e){return!0===e._lexicalHandled}var Qp=gi(),$p=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:ig(Uc(Nc(this,`next`)),Uc(Nc(e,`next`)))<0}getNode(){let e=Nl(this.key);return e===null&&G(20),e}set(e,t,n,r){let i=this._selection,a=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,Nf()||(jl()===a&&Al(e),i!==null&&(i.setCachedNodes(null),X(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}};function em(e,t,n){return new $p(e,t,n)}function tm(e,t){let n=t.__key,r=e.offset,i=`element`;if(J(t)){i=`text`;let e=t.getTextContentSize();r>e&&(r=e)}else if(!q(t)){let e=t.getNextSibling();if(J(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function nm(e,t){if(q(t)){let n=t.getLastDescendant();q(n)||J(n)?tm(e,n):tm(e,t)}else tm(e,t)}function rm(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=jc();if(o.setFormat(n),o.setStyle(r),rl(a))a.splice(0,0,[o]);else if(a!==null){let e=Cu(i)?nl().append(o):o;a.insertBefore(e)}else if(Cu(i)){let e=i.getLastChild();q(e)&&!e.isInline()&&e.isEmpty()?e.append(o):i.append(nl().append(o))}else i.append(o);e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}function im(e,t,n){let r=e.format,i=e.style;if(!e.isCollapsed()){let a=(e.focus.isBefore(e.anchor)?e.focus:e.anchor).getNode();if(J(a)&&(r=a.getFormat(),i=a.getStyle()),e.removeText(),e.format=r,e.style=i,t===``&&!n)return;if(jl()===null)return e.anchor.type===`element`&&rm(e.anchor,e.focus,r,i),void am(e,t,r,i)}e.anchor.type===`element`&&rm(e.anchor,e.focus,r,i);let a=e.anchor.getNode();J(a)||G(398);let o=e.anchor.offset,s=a.getParentOrThrow(),c=a.getTextContentSize();if(Sl(a)||o===0&&(!a.canInsertTextBefore()||!s.canInsertTextBefore()&&!a.__prev)||o===c&&(!a.canInsertTextAfter()||!s.canInsertTextAfter()&&!a.__next)){if(a.isSegmented()&&o!==0&&o!==c){if(jl()!==null)a.setMode(`normal`).setFormat(r).setStyle(i),Rf()._inputState.composedSegmentedKey=a.getKey();else{let t=jc(a.getTextContent());t.setFormat(r),t.setStyle(i);let n=Z()===e;a.replace(t),e.setTextNodeRange(t,o,t,o),n&&Z()!==e&&Ul(e)}(t!==``||n)&&im(e,t,n);return}if(t===``&&!n)return;if(o===0||o===c){let c=o===0,l=c?`previous`:`next`,u=Uh(a,l).getNodeAtCaret(),d;J(u)&&(c?u.canInsertTextAfter():u.canInsertTextBefore())&&!Sl(u)?d=u:(d=jc().setFormat(r).setStyle(i),Uh((c?s.canInsertTextBefore():s.canInsertTextAfter())?a:s,l).insert(d));let f=c?void 0:0;d.select(f,f),im(e,t,n);return}let l=jc(t);l.setFormat(r),l.setStyle(i),a.replace(l),l.select();return}if(t===``&&!n)return;let l=s.isInline()&&o===0&&!a.__prev,u=s.isInline()&&o===c&&!a.__next,d=a.getFormat()!==r||a.getStyle()!==i;if(l||u||d){if(a.getTextContent()!==``||l||u)return void am(e,t,r,i);a.setFormat(r),a.setStyle(i)}a.spliceText(o,0,t,!0),a.isComposing()&&e.anchor.type===`text`&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}function am(e,t,n,r){let i=e.anchor.getNode();J(i)||G(398);let a=e.anchor.offset,o=jc(t).setFormat(n).setStyle(r),s=i.getParentOrThrow(),c=a===0,l=c||a===i.getTextContentSize();if(l&&s.isInline()&&!(c?i.__prev:i.__next))Uh(s,c?`previous`:`next`).insert(o);else{let e=l?i:i.splitText(a)[0];c?e.insertBefore(o,!1):e.insertAfter(o,!1)}i.getTextContent()===``&&i.isAttached()&&i.remove(),o.selectEnd(),o.isComposing()&&e.anchor.type===`text`&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}var om=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!lm(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes().filter(e=>dh(e)===null),n=t.length;if(n===0)return;let r=t[n-1],i;if(J(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let e of t){let t=Nl(e);t!==null&&n.push(t)}return Nf()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t=``;for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes().filter(e=>dh(e)===null);if((Z()||Rm())===this&&e[0]){let t=Uh(e[0],`next`);Fc(ng(t,t))}for(let t of e)t.remove();sm()}};function sm(){let e=Vl();if(e.getChildrenSize()===0&&hh(Z())===null){let t=nl();e.append(t),t.select()}}function X(e){return e instanceof cm}var cm=class e{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!X(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=0;for(let n of e)if(zh(n)){let{origin:e}=n;t.length===0?i.add(e):(a++,t.push(e))}else{let{origin:e}=n;q(e)&&a!==0?a--:t.push(e)}if(r&&t.push(r.caret.origin),Rh(e.focus)&&q(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=qh(e.focus.origin,`previous`);zh(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=Yh(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!q(e)||a>0||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=Uc(e.anchor),r=Uc(e.anchor.getFlipped()),i=e=>Lh(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(Gc(Lc(this),`next`));return Nf()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){return this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`),this}getTextContent(){if(this.isCollapsed())return``;let e=this.getNodes(),t=Lc(this).getTextSlices(),n=``,r=!0;for(let i=0;i<e.length;i++){let a=e[i];if(q(a)&&!a.isInline()){r||(n+=`
30
- `);let e=``;for(let t of _h(a)){let n=vh(a,t);n!==null&&(e+=n.getTextContent())}e===``?r=!a.isEmpty():(n+=e,r=!1)}else if(r=!1,J(a)){let e=Jc(t,a);n+=e?e.getTextContent():a.getTextContent()}else(sc(a)||uf(a))&&(n+=a.getTextContent())}return n}applyDOMRange(e){let t=Rf(),n=t.getEditorState()._selection,r=km(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(r===null)return;let[i,a,o]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),o&&(this.dirty=!0),Bs(this)}clone(){let t=this.anchor,n=this.focus;return new e(em(t.key,t.offset,t.type),em(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=El(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=si[e];return(this.format&t)!==0}insertRawText(e){this.insertNodes(qm(e))}insertText(e){im(this,e,!1)}removeText(){let e=Z()===this,t=this.anchor.key;Ic(this,Vc(Lc(this))),this.isCollapsed()&&Lm(this,t),e&&Z()!==this&&Ul(this)}formatText(e,t=null){fm(this,e,t)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();let t=this.anchor.getNode();if(this.anchor.type===`element`&&q(t)&&t.isShadowRoot()&&dh(t)!==null){let n=t.getFirstChild()??t.append(nl()).getFirstChild();if(n!==null&&!q(n)){let e=nl();n.insertBefore(e),n=e}if(n!==null){n.selectStart();let t=Z();return X(t)||G(369),t.insertNodes(e)}}if(this.anchor.type===`element`&&Cu(t)){let n=Qm(e),r=n.getLastDescendant();t.splice(this.anchor.offset,0,n.getChildren()),r!==null&&r.selectEnd();return}let n=this.isBackward()?this.focus:this.anchor,r=n.getNode(),i=Kd(r,Y),a=e[e.length-1];if(q(i)&&`__language`in i){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let[,t]=Ym(this);i.splice(t,0,e),a.selectEnd()}return}if(!e.some(e=>(q(e)||sc(e))&&!e.isInline())){q(i)||G(211,r.constructor.name,r.getType());let[t,n]=Ym(this,!0);(q(t)?t:i).splice(n,0,e),a.selectEnd();return}if(i===null){let t=Qm(e),n=t.getLastDescendant(),r=Nc(this.anchor,`next`);for(let e of t.getChildren())r=Qc(e,r);n!==null&&n.selectEnd();return}if(q(i)&&(dh(i)!==null||!i.isParentRequired()&&!Cu(i.getParentOrThrow()))){let[,t]=Ym(this),n=Jm(e);i.splice(t,0,n);let r=n[n.length-1];r===void 0?i.select(t,t):r.selectEnd();return}let o=Qm(e),s=o.getLastDescendant(),c=o.getChildren(),l=function(e){let t=function(e){let t=e.getNode();if(e.offset>0)return e.type===`element`&&q(t)?t.getChildAtIndex(e.offset-1):null;for(let e=t;e!==null&&!Y(e)&&!Cu(e);e=e.getParent()){let t=e.getPreviousSibling();if(t!==null)return t}return null}(e);return uf(t)&&uf(t.getPreviousSibling())}(n),u=q(i)&&i.isEmpty()?null:this.insertParagraph();u&&!i.isAttached()&&(r=this.anchor.getNode(),i=Kd(r,Y));let d=c[c.length-1],f=c[0];var p=f;l||!q(p)||!Y(p)||p.isEmpty()||!q(i)||i.isEmpty()&&!i.canMergeWhenEmpty()||(q(i)||G(211,r.constructor.name,r.getType()),i.append(...f.getChildren()),f=c[1]),f&&(i===null&&G(212,r.constructor.name,r.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||G(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(i,f));let m=Kd(s,Y),h=s.selectEnd();u&&(q(m)&&(u.canMergeWhenEmpty()||Y(d))?(m.append(...u.getChildren()),u.remove()):u.isEmpty()&&u.remove()),q(i)&&i.isEmpty()&&i.remove();let g=q(i)?i.getLastChild():null;uf(g)&&m!==i&&g.remove();let _=Uc(Nc(h.anchor,`next`));Pc(h.anchor,_),Pc(h.focus,_)}insertParagraph(){this.isCollapsed()||this.removeText();let e=this.anchor.getNode();if(this.anchor.type===`element`&&Cu(e)){let t=nl();return e.splice(this.anchor.offset,0,[t]),t.select(),t}let[,t]=Ym(this),n=Kd(this.anchor.getNode(),Y);if(n!==null&&dh(n)!==null)return null;q(n)||G(213);let r=n.getChildAtIndex(t),i=r?[r,...r.getNextSiblings()]:[],a=n.insertNewAfter(this,!1);return a?(a.append(...i),a.selectStart(),a):null}insertLineBreak(e){let t=lf();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=this.getNodes();if(this.isCollapsed())return[...e];let t=this.isBackward(),n=Lc(this).getTextSlices(),r=[];for(let t of e){let e=Jc(n,t),i=e?Yc(e,this):t;i!==null&&r.push(i)}if(e.length===1&&r.length===1&&J(r[0])){let e=r[0],[n,i]=t?[this.focus,this.anchor]:[this.anchor,this.focus];n.set(e.getKey(),0,`text`),i.set(e.getKey(),e.getTextContentSize(),`text`)}return r}modify(e,t,n){if($m(this,e,t,n))return;let r=e===`move`,i=Rf(),a=Au(yu(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();s===null||o===null||!q(c)||c.isInline()||c.canBeEmpty()||ku(o,i,s);let l=uu(i,this.focus.key),u=l;if(this.focus.type===`text`&&(u=J(c)?id(c,l,i):null),this.dirty){let e=uu(i,this.anchor.key),t=e;if(this.anchor.type===`text`){let n=this.anchor.getNode();t=J(n)?id(n,e,i):null}t&&u&&Um(a,t,this.anchor.offset,u,this.focus.offset)}if(n===`character`&&J(c)&&c.isUnmergeable()&&(t?this.focus.offset===0:this.focus.offset===c.getTextContentSize())){let e=Uh(c,t?`previous`:`next`).getNodeAtCaret();if(J(e)){if(!r){let n=e.getTextContentSize();t?this.focus.set(e.__key,n-1,`text`):this.focus.set(e.__key,1,`text`),this.dirty=!0;return}{let n=i.getElementByKey(e.getKey()),r=n?id(e,n,i):null;if(r){let e=t?r.length:0;Um(a,r,e,r,e)}}}}if(hm(a,e,t?`backward`:`forward`,n,s),a.rangeCount>0){let e=Ru(a,i._rootElement),n=e||a.getRangeAt(0),o=this.anchor.getNode(),s=uc(o)?o:xu(o);this.applyDOMRange(n),this.dirty=!0,r||(gm(this,t,s),(e?a.direction!==`backward`:a.anchorNode===n.startContainer&&a.anchorOffset===n.startOffset)||mm(this))}n===`lineboundary`&&$m(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&q(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if(q(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e)){let e=q(n)?n.getNextSibling():null;if(!(q(n)&&n.isEmpty()&&q(e)&&e.isShadowRoot()))return}let r=Nc(t,e?`previous`:`next`),i=eg(r);if(i.getTextSlices().every(e=>e===null||e.distance===0)){if(t.type===`element`){let e=r.getNodeAtCaret();if(q(e)&&Ou(e)){let t=e.getParent();e.remove();let n=Hl(t,e);n!==null&&n.selectStart();return}}let e={type:`initial`};for(let t of i.iterNodeCarets(`shadowRoot`))if(zh(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if(q(i.anchor.origin)&&i.anchor.origin.isEmpty()){let e=Uc(t);Ic(this,ng(e,e)),i.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(Rh(t)){if(q(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(i.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(sc(t.origin)){if(!t.origin.isIsolated()){if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&q(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let e=Nm();e.add(t.origin.getKey()),Ul(e)}else{let e=t.origin,n=e.getParent();e.remove();let r=Hl(n,e);r!==null&&r.selectStart()}}return}if(uf(t.origin))return void t.origin.remove();break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return _h(n).length>0?void 0:t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(Ic(this,ng(!t.origin.isEmpty()&&n.isEmpty()?Rc(Uh(n,t.direction)):i.anchor,t)),this.removeText())}for(let e=t.getNode();e!==null;){if(dh(e)!==null)return;if(q(e)&&e.isShadowRoot())break;e=e.getParent()}}let a=this.focus;if(_m(this,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&function(e,t){for(let n=t;n;n=n.getParent()){if(q(n)){if(n.collapseAtStart(e))return!0;if(Cu(n))break}if(n.getPreviousSibling())break}return!1}(this,t.getNode()))return}else{let r=a.type===`text`?a.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=a.offset,i=r.getTextContentSize();if(r.is(n)||e&&t!==i||!e&&t!==0)return void xm(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void xm(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,o=r.offset,s=e<o,c=s?e:o,l=s?o:e,u=l-1;c!==u&&!Kl(a=i.getTextContent().slice(c,l))&&!bm(a)&&(t?r.set(r.key,u,r.type):n.set(n.key,u,n.type))}var a})(this,e)}}t||pm(this),this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type===`element`&&this.anchor.offset===0&&sm()}deleteLine(e){um(this,e,`lineboundary`)}deleteWord(e){um(this,e,`word`)}isBackward(){let e=this._cachedIsBackward;if(e!==null)return e;let t=this.focus.isBefore(this.anchor);return Nf()||(this._cachedIsBackward=t),t}getStartEndPoints(){return[this.anchor,this.focus]}};function lm(e){return e instanceof om}function um(e,t,n){let r=e.isCollapsed(),{anchor:i,focus:a}=e,o=!1;if(r){if(n===`word`&&e.forwardDeletion(i,i.getNode(),t))return;o=_m(e,t,n),n===`lineboundary`&&function(e){for(let t of Lc(e).iterNodeCarets(`shadowRoot`))if(Rh(t)&&uf(t.origin))return void Pc(e.focus,Rc(t))}(e)}n!==`lineboundary`||e.isCollapsed()||Kd(i.getNode(),Y)===Kd(a.getNode(),Y)||a.set(i.key,i.offset,i.type),e.isCollapsed()?o||e.deleteCharacter(t):(r||pm(e),e.removeText())}function dm(e,t){if(lm(e)){for(let n of e.getNodes())xc(n)&&n.setFormat(t(n.getFormat()));return}let n=e.isCollapsed()?[]:e.getNodes(),r=n.length?Lc(e).getTextSlices():[],i,a,o,s=!1,c=0;for(let l of n)if(J(l)){i&&a&&(i.set(a.__key,0,`text`),i=void 0);let n=Jc(r,l);if(!s&&n&&n.distance===0){let t=e.isBackward()?e.focus:e.anchor;t.type===`text`&&t.key===l.__key&&(i=t)}if(s=!0,n&&n.distance===0)continue;let u=t(l.getFormat()),d=i?l.getTextContentSize():0,f=n&&!Sl(l)?Yc(n,e):l;f!==null&&(f.setFormat(u),o===void 0&&(o=u,a=f,i&&f.getTextContentSize()!==d&&(i.set(f.__key,0,`text`),i=void 0)),c=u)}else q(l)?l.setTextFormat(t(l.getTextFormat())):xc(l)&&l.setFormat(t(l.getFormat()));s?o!==void 0&&(e.format=o|c):(e.setFormat(t(e.format)),Al(null))}function fm(e,t,n=null){let r=n===null&&X(e)?El(e.format,t,null):n;dm(e,e=>El(e,t,r))}function pm(e){let t=Vl();!t.isEmpty()&&$c(t,e)&&(e.anchor.set(t.getKey(),0,`element`),e.focus.set(t.getKey(),t.getChildrenSize(),`element`))}function mm(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}function hm(e,t,n,r,i){let a=r===`character`?Bu(e,i):null,o=a&&a.focusNode,s=a?a.focusOffset:0;if(e.modify(t,n,r),a===null||!function(e,t,n){return e!==null&&e.nodeType===3&&(n===`backward`?t>0:n===`forward`&&t<e.length)}(o,s,n))return;let c=Bu(e,i);c.focusNode===o&&c.focusOffset===s&&e.modify(t,n,r)}function gm(e,t,n){let r=e.getNodes(),i=r.filter(e=>_u(e,n));if(i.length===0||i.length===r.length)return!1;let a=t?i[0]:i[i.length-1],o=q(a)?a:a.getParentOrThrow();return t?o.selectStart():o.selectEnd(),!0}function _m(e,t,n){if($m(e,`extend`,t,n))return!1;let r=Rf(),i=Au(yu(r));if(!i||typeof i.modify!=`function`)return!1;let a=r._blockCursorElement,o=r._rootElement,s=e.anchor,c=e.focus.getNode();o===null||a===null||!q(c)||c.isInline()||c.canBeEmpty()||ku(a,r,o);let l=e=>{let t=e.getNode(),n=r.getElementByKey(e.key);return n!==null&&e.type===`text`&&J(t)?id(t,n,r):n},u=s.getNode(),d=l(s);if(d===null)return!1;let f=s.offset,p=e.isCollapsed(),m=e.focus,h=p?d:l(m);if(h===null)return!1;let g=m.offset;if(Um(i,h,g,h,g),hm(i,`move`,t?`backward`:`forward`,n,o),i.rangeCount===0)return!1;let _=Ru(i,o)||i.getRangeAt(0),v=_.startContainer,y=_.startOffset;if(n===`lineboundary`&&Cl(v)&&yl(v)===r){let e=Gl(v);if(sc(e)&&e.isInline()&&!e.isIsolated()){let n=r.getElementByKey(e.getKey());n!==null&&n.contains(v)&&(v=n,y=t?0:n.childNodes.length)}}if(p&&n===`character`&&s.type===`text`&&J(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){let n=Uh(u,t?`previous`:`next`).getNodeAtCaret();if(J(n)){let r=t?n.getTextContentSize()-1:1;return e.focus.set(n.__key,r,`text`),e.dirty=!0,!1}}if(p&&n===`character`&&s.type===`text`){let n=t?0:u.getTextContentSize(),r=v===d?y:f===n?-1:n;if(r>=0)return r!==f&&(e.focus.set(s.key,r,`text`),e.dirty=!0),!1}let b=r._slotsUsed&&Ll(v),x=b?mh(u):null,S=b?mh(b):null;if(b&&!Em(S,x)&&vm(e.focus,u,x,S,`deletion`,()=>!t))return!0;let[C,w,T,E]=t?[v,y,d,f]:[d,f,v,y],D=uc(u)?u:xu(u);return e.applyDOMRange({collapsed:!1,endContainer:T,endOffset:E,startContainer:C,startOffset:w}),e.dirty=!0,!gm(e,t,D)&&t&&mm(e),!1}function vm(e,t,n,r,i,a){let o=r&&function(e,t){for(let n=fh(e);n!==null;){let e=mh(n);if(Em(e,t))return e!==null||n.isAttached()?n:null;n=e&&fh(e)}return null}(r,n);if(o===null&&n===null)return!1;let s=a(),c=o&&o.getParent(),l,u;if(o===null||c===null||t!==null&&(o.is(t)||o.isParentOf(t))){let t=o||n;if(!q(t))return t!==null&&function(e,t,n){q(t)?e.set(t.getKey(),n?t.getChildrenSize():0,`element`):e.set(t.getKey(),n?t.getTextContentSize():0,`text`)}(e,t,s),!0;l=t,u=s?t.getChildrenSize():0}else l=c,u=o.getIndexWithinParent()+ +(s===(i===`selection`));return i===`deletion`?function(e,t,n,r){for(;;){let i=t.getChildAtIndex(r?n:n-1);if(J(i))return void e.set(i.getKey(),r?0:i.getTextContentSize(),`text`);if(!q(i)||Cu(i))break;t=i,n=r?0:i.getChildrenSize()}e.set(t.getKey(),n,`element`)}(e,l,u,!s):e.set(l.getKey(),u,`element`),!0}function ym(){try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1}var bm=ym();function xm(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;e<a;e++){let r=e===a-1;if(s=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function Sm(e,t,n,r){let i,a=t,o=!1;if(qu(e)){let s=!1,c=e.childNodes,l=c.length,u=r._blockCursorElement;a===l&&l>0&&(s=!0,a=l-1),Il(e,r)!==void 0||gd(e,r)||(o=!0);let d=c[a],f=!1;if(d===u)d=c[a+1],f=!0;else if(u!==null){let n=u.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,u)&&a--}if(i=Gl(d),J(i))a=Gh(i,s?`next`:`previous`);else{let c=Gl(e);if(c===null)return null;if(q(c)){let o=r.getElementByKey(c.getKey());o===null&&G(214);let l=nd(c,o,r);[c,a]=l.resolveChildIndex(c,o,e,t),q(c)||G(215),s&&a>=c.getChildrenSize()&&(a=Math.max(0,c.getChildrenSize()-1));let u=c.getChildAtIndex(a);if(q(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=s?u.getLastDescendant():u.getFirstDescendant();e===null?c=u:(u=e,c=q(u)?u:u.getParentOrThrow()),a=0}J(u)?(i=u,c=null,a=Gh(u,s?`next`:`previous`)):u!==c&&s&&!f&&(q(c)||G(216),a=Math.min(c.getChildrenSize(),a+1))}else{let n=fh(c),i=n===null?c:n,o=i.getIndexWithinParent(),s=r.getElementByKey(c.getKey()),l=`after`;if(s!==null&&Gl(e)===c){let n=nd(c,s,r);n.element===s?t===0&&sc(c)&&(l=`before`):l=n.resolveLeafPosition(s,e,t)}a=l===`before`?o:o+1,c=i.getParentOrThrow()}if(q(c))return[em(c.__key,a,`element`),o]}}else i=Gl(e);return J(i)?[em(i.__key,Gh(i,a,`clamp`),`text`),o]:null}function Cm(e,t,n){let r=e.getNode();if(Ml(r))return;let i=e.offset===0;if(!i&&e.offset!==r.getTextContent().length)return;let a=i?`previous`:`next`,o=Uh(r,a).getNodeAtCaret();if(i===t||!q(o)||!o.isInline()||i&&n){if(i&&!t)J(o)&&!r.isUnmergeable()&&e.set(o.__key,o.getTextContent().length,`text`);else if(o===null&&(n||!i&&t)){let t=r.getParent();if(q(t)&&t.isInline()&&(i||!t.canInsertTextAfter()&&t.getTextContentSize()>1)){let n=Uh(t,a).getNodeAtCaret();J(n)&&e.set(n.__key,i?n.getTextContent().length:0,`text`)}}}else e.set(o.__key,i?o.getChildrenSize():0,`element`)}function wm(e){let t=Nl(e.key);return t===null?null:mh(t)}function Tm(e,t,n){let r=wm(e),i=wm(t);return!Em(r,i)&&vm(t,Nl(e.key),r,i,`selection`,n)}function Em(e,t){return e===null?t===null:e.is(t)}function Dm(e){let t=Tm(e.anchor,e.focus,()=>function(e,t){let n=function(e,t){let n=new Map;for(let t=null,r=e;r!==null;t=r,r=ag(r))n.set(r.getKey(),t);for(let e=null,r=t;r!==null;e=r,r=ag(r)){let t=n.get(r.getKey());if(t===void 0)continue;let i=r.getLatest();return t===null?e===null?{commonAncestor:i,type:`same`}:{b:e,commonAncestor:i,type:`ancestor`}:e===null?{a:t,commonAncestor:i,type:`descendant`}:{a:t,b:e,commonAncestor:i,type:`branch`}}return null}(e.origin,t.origin);if(n===null)return null;switch(n.type){case`same`:return og(e,t);case`ancestor`:return e.type===`child`&&dh(n.b)===null?-1:1;case`descendant`:return t.type===`child`&&dh(n.a)===null?1:-1;case`branch`:{let e=dh(n.a)&&n.a.getKey(),t=dh(n.b)&&n.b.getKey();if(e&&t){for(let r of gh(n.commonAncestor).values())if(r===e||r===t)return r===e?-1:1}return e?-1:t?1:n.a.isBefore(n.b)?-1:1}}}(Nc(e.anchor,`next`),Nc(e.focus,`next`))!==1);return t&&(e.dirty=!0),t}function Om(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;let r=0;for(let e=n&&n.previousSibling;e;e=e.previousSibling)r++;return r}function km(e,t,n,r,i,a){if(e===null||n===null||!_l(i,e,n))return null;let o=Sm(e,t,X(a)?a.anchor:null,i);if(o===null)return null;let s=Sm(n,r,X(a)?a.focus:null,i);if(s===null)return null;let[c,l]=o,[u,d]=s;if(c.type===`element`&&u.type===`element`){let t=Gl(e),r=Gl(n);if(sc(t)&&sc(r))return null}let f=i._slotsUsed&&Tm(c,u,()=>function(e,t,n,r){if(e===n)return r>=t;let i=e.compareDocumentPosition(n);return i&Node.DOCUMENT_POSITION_CONTAINED_BY?Om(e,n)>=t:i&Node.DOCUMENT_POSITION_CONTAINS?r>Om(n,e):(i&Node.DOCUMENT_POSITION_FOLLOWING)!==0}(e,t,n,r));return function(e,t){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);Cm(e,n,r),Cm(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}(c,u),[c,u,l||d||f]}function Am(e){return q(e)&&!e.isInline()}function jm(e,t,n,r,i,a){let o=If(),s=new cm(em(e,t,i),em(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function Mm(){return new cm(em(`root`,0,`element`),em(`root`,0,`element`),0,``)}function Nm(){return new om(new Set)}function Pm(e,t){return Im(null,e,t,null)}var Fm=new Set([` `,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`Backspace`,`Delete`,`End`,`Enter`,`Home`,`Tab`]);function Im(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=o===`keydown`&&a,l=c&&Ku(c),u=c&&(c.ctrlKey||c.metaKey||Fm.has(c.key))&&Ju(l)&&yl(l)===n,d=!Fa&&(s||u||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),f,p,m,h;if(X(e)&&!d)return e.clone();{if(t===null)return null;let r=Bu(t,n._rootElement);if(f=r.anchorNode,p=r.focusNode,m=r.anchorOffset,h=r.focusOffset,(s||u||o===void 0)&&X(e)&&!_l(n,f,p))return e.clone()}let g=km(f,m,p,h,n,e);if(g===null)return null;let[_,v,y]=g,b=X(e)?e:null,x=new cm(_,v,b?b.format:0,b?b.style:``);return b&&Lm(x,b.anchor.key),x.dirty=y,x}function Lm(e,t){let n=e.anchor;if(n.key===t)return;let r=n.getNode(),i=0,a=``;J(r)?(i=r.getFormat(),a=r.getStyle()):q(r)&&(i=r.getTextFormat(),a=r.getTextStyle()),e.format===i&&e.style===a||(e.format=i,e.style=a,e.dirty=!0)}function Z(){return If()._selection}function Rm(){return Rf()._editorState._selection}function zm(e,t){let n=t.__key;return e.anchor.key===n||e.focus.key===n}function Bm(e,t,n,r=1){if(zm(e,t))for(let i of[e.anchor,e.focus]){i.key===t.__key&&(n<=i.offset&&r>0||n<i.offset&&r<0)&&i.set(t.__key,Math.max(0,i.offset+r),`element`);let e=i.getNode();if(q(e)){let t=e.getChildrenSize(),n=i.offset>=t,r=e.getChildAtIndex(n?t-1:i.offset);J(r)&&i.set(r.__key,n?r.getTextContentSize():0,`text`)}}}function Vm(e,t,n,r,i){let a=r||i;if(J(a)||q(a)){let t=J(a);e.set(a.__key,r===null?0:t?a.getTextContentSize():a.getChildrenSize(),t?`text`:`element`)}else{let r=t.getIndexWithinParent();e.set(n.__key,r===-1?n.getChildrenSize():r,`element`)}}function Hm(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function Um(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function Wm(e,t,n){let r=uu(e,t.getKey());if(q(t)){let i=nd(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function Gm(e,t,n,r,i,a){let o=a.getRootNode(),s=wl(o)||Mu(o)?Gu(o):null;if(i.has(`collaboration`)&&s!==a||s!==null&&hl(s,s))return;let c=Bu(r,a),l;if(!X(t))return void(e!==null&&_l(n,c.anchorNode,c.focusNode)&&r.removeAllRanges());let u=t.anchor,d=t.focus,f=u.getNode(),p=d.getNode(),[m,h]=Wm(n,f,u.offset),[g,_]=Wm(n,p,d.offset),v=t.format,y=t.style,b=t.isCollapsed(),x=m,S=g,C=!1;if(u.type===`text`?(x=J(f)?id(f,m,n):null,C=f.getFormat()!==v||f.getStyle()!==y):X(e)&&e.anchor.type===`text`&&(C=!0),d.type===`text`&&(S=J(p)?id(p,g,n):null),x===null||S===null)return;let w=b&&J(p)&&Ml(p)&&Cl(S)&&S.nodeValue===ii?ii.length:_;if(b&&(e===null||C||X(e)&&(e.format!==v||e.style!==y))&&function(e,t,n,r,i,a){e._inputState.collapsedSelectionFormat={format:t,key:i,offset:r,style:n,timeStamp:a}}(n,v,y,u.offset,u.key,performance.now()),(r.type!==`Range`||!b)&&c.anchorOffset===h&&c.focusOffset===w&&c.anchorNode===x&&c.focusNode===S){if(s===null||!a.contains(s)){let e=s===null?null:yl(s);e!==null&&e!==n||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0})}if(u.type!==`element`)return}if(Um(r,x,h,S,w),Kr&&t.isCollapsed()&&a!==null&&!i.has(`skip-selection-focus`)){let e=Wu(a);if(e===null||!a.contains(e)){let e=Gu(a.ownerDocument),t=e===null?null:yl(e);t!==null&&t!==n||a.focus({preventScroll:!0})}}if(!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===Wu(a)){let e=X(t)&&t.anchor.type===`element`?function(e,t,n){let r=t.childNodes[n];if(!qu(r))return r||null;let i=Il(r,e),a=i===void 0?null:Nl(i);return a===null||q(a)?r:nd(a,r,e).element}(n,x,h):(l===void 0&&(l=zu(r,a)),l);if(e!==null){let t;if(Cl(e)){let n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=qu(e)?e.getBoundingClientRect():function(e){let t=e.getBoundingClientRect(),{startContainer:n,startOffset:r}=e;if(!e.collapsed||t.width!==0||t.height!==0||!Cl(n)||n.length===0)return t;let i=e.cloneRange();return r>0?i.setStart(n,r-1):i.setEnd(n,1),i.getBoundingClientRect()}(e);(function(e,t,n,r=null){let i=fu(n),a=vu(i);if(i===null||a===null)return;let o=n.getBoundingClientRect();if(t.bottom<o.top)return;if(r!==null&&t.height>0){let{left:e,right:i}=t,o=qu(r)?r:du(r);for(;o!==null&&n.contains(o);){let t=mu(a,o,e,i);e-=t,i-=t,o=o===n?null:du(o)}}let{top:s,bottom:c}=t,l=0,u=0,d=n;for(;d!==null;){let t=d===i.body;if(t){let t=a.visualViewport;if(t){let e=t.offsetTop;l=e,u=e+t.height}else l=0,u=yu(e).innerHeight;let n=a.getComputedStyle(i.documentElement),r=parseFloat(n.scrollPaddingTop),o=parseFloat(n.scrollPaddingBottom);isFinite(r)&&(l+=r),isFinite(o)&&(u-=o)}else{let e=d===n?o:d.getBoundingClientRect();l=e.top,u=e.bottom}let r=0;if(s<l?r=-(l-s):c>u&&(r=c-u),r!==0){if(t)a.scrollBy(0,r);else{let e=d.scrollTop;d.scrollTop+=r;let t=d.scrollTop-e;s-=t,c-=t}}if(t)break;d=du(d)}})(n,t,a,x)}}(function(e,t,n,r,i){let a=e._inputState;a.isSelectionChangeFromDOMUpdate=!0,a.selectionChangeFromDOMUpdatePoints=t!==void 0&&n!==void 0&&r!==void 0&&i!==void 0?{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:i}:null})(n,x,h,S,w)}function Km(e,t){for(let n of e.split(/(\r?\n|\t)/))n===`
31
- `||n===`\r
32
- `?t.linebreak():n===` `?t.tab():n!==``&&t.text(n)}function qm(e){let t=[];return Km(e,{linebreak:()=>t.push(lf()),tab:()=>t.push(ol()),text:e=>t.push(jc(e))}),t}function Jm(e){let t=[];for(let n of e)uf(n)||(!q(n)&&!sc(n)||n.isInline()?t.push(n):q(n)&&t.push(...Jm(n.getChildren())));return t}function Ym(e,t=!1){let n=e;e.isCollapsed()||n.removeText();let r=Z();X(r)&&(n=r),X(n)||G(161);let i=n.anchor,a=i.getNode(),o=i.offset;for(;!Y(a)&&dh(a)===null;){let e=a;if([a,o]=Xm(a,o,t),e.is(a))break}return[a,o]}function Xm(e,t,n=!1){let r=e.getParent();if(!r){let e=nl();return Vl().append(e),e.select(),[Vl(),0]}if(J(e)){let n=e.splitText(t);if(n.length===0)return[r,e.getIndexWithinParent()];let i=t===0?0:1;return[r,n[0].getIndexWithinParent()+i]}if(!q(e)||t===0)return[r,e.getIndexWithinParent()];let i=e.getChildAtIndex(t);if(i){let r=new cm(em(e.__key,t,`element`),em(e.__key,t,`element`),0,``),a=e.insertNewAfter(r);if(a)a.append(i,...i.getNextSiblings());else if(n)return[e,t]}return[r,e.getIndexWithinParent()+1]}function Zm(e){return uf(e)||bu(e)||J(e)||e.isParentRequired()}function Qm(e){let t=nl(),n=null;for(let r=0;r<e.length;r++){let i=e[r];if(Zm(i)){if(n===null){n=i.createParentElementNode(),t.append(n);let a=e[r+1];if(uf(i)&&(a===void 0||!Zm(a)))continue}n.append(i)}else t.append(i),n=null}return t}function $m(e,t,n,r,i=`decorators-and-blocks`){if(t===`move`&&r===`character`&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let a=Nc(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`,u=!1;if(!Wc(c)){for(let e of c){l=!1;let{origin:t}=e;if(sc(t)){if(t.isIsolated()){u=!0;break}if(c=e,o&&t.isInline())continue}break}if(u)return!0;if(l)for(let e of eg(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(zh(e))e.origin.isInline()||(c=e);else{if(q(e.origin))continue;sc(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&sc(c.origin)&&c.origin.isKeyboardSelectable()){let e=Nm();return e.add(c.origin.getKey()),Ul(e),!0}return c=Uc(c),s&&Pc(e.anchor,c),Pc(e.focus,c),l||!o}function eh(e,t,n){let r=t===null?null:t.__key,i=n===null?null:n.__key;t===null?e.__first=i:t.__next=i,n===null?e.__last=r:n.__prev=r}function th(e){let t=Rf();if(!t._recordNodeMoves)return;let n=t._editorState._nodeMap;if(n.has(e.__key)){let t=If(),r=t._movedNodes||=new WeakMap,i=r.get(n);i===void 0&&(i=new Set,r.set(n,i)),i.add(e.__key)}}function nh(e,t,n,r){let i=t.__key;n===null?e.__first=i:n.__next=i,r===null?e.__last=i:r.__prev=i,t.__prev=n===null?null:n.__key,t.__next=r===null?null:r.__key,t.__parent=e.__key}function rh(e){dh(e)!==null&&G(380,e.__key,String(dh(e)));let t=e.getParent();if(t!==null){let n=t.getWritable();th(e);let r=e.getPreviousSibling(),i=e.getNextSibling();eh(n,r&&r.getWritable(),i&&i.getWritable()),e.__prev=null,e.__next=null,e.__parent=null,n.__size--}}function ih(e,t){let n=t&&e.getParent(),r=t&&n&&zm(t,n)?e.getIndexWithinParent():-1,i=t&&n&&r!==-1?[t.anchor,t.focus].filter(e=>e.type===`element`&&e.key===n.__key&&e.offset===r+1):null;return t&&n&&r!==-1&&t.isBackward(),rh(e),t&&n&&r!==-1&&Bm(t,n,r,-1),t&&(t._cachedIsBackward=null),i}function ah(e,t,n,r){Pf();let i=t===`next`;Eu(e,n);let a=e.getWritable(),o=n.getWritable();e.getParentOrThrow();let s=Z(),c=r&&X(s)?s:null,l=ih(o,c),u=e.getParentOrThrow().getWritable(),d=c&&(i&&l!==null&&l.length>0||zm(c,u))?e.getIndexWithinParent()+ +!!i:-1,f=i?e.getNextSibling():e.getPreviousSibling(),p=f&&f.getWritable();if(nh(u,o,i?a:p,i?p:a),u.__size++,c&&d!==-1&&(Bm(c,u,d),i&&l!==null))for(let e of l)e.set(u.__key,d+1,`element`);return n}function oh(e,t,n){Pf();let{origin:r,direction:i}=e,a=i===`next`,o=fh(r);if(o!==null)return a?o.selectNext(t,n):o.selectPrevious(t,n);let s=e.getNodeAtCaret(),c=r.getParentOrThrow();if(s===null)return a?c.select():c.select(0,0);if(q(s))return a?s.select(0,0):s.select();if(J(s))return s.select(t,n);let l=s.getIndexWithinParent()+ +!a;return c.select(l,l)}function sh(e,t){let n=[];for(let r=e;r!==null;r=t===`next`?r.getNextSibling():r.getPreviousSibling())n.push(r);return n}var ch=new Map;function lh(e){return q(e)||sc(e)}function uh(e){return q(e)||sc(e)}function dh(e){let t=e.getLatest();return uh(t)?t.__slotHost:null}function fh(e){let t=dh(e);if(t===null)return null;let n=Nl(t);return q(n)||sc(n)||G(370),n}function ph(e){let t=fh(e);if(t===null)return null;let n=e.getLatest().__key;for(let[e,r]of gh(t))if(r===n)return e;return null}function mh(e){let t=e.getLatest();for(;t!==null;){if(dh(t)!==null)return t;t=t.getParent()}return null}function hh(e){if(e===null)return null;let t=X(e)?e.anchor.getNode():e.getNodes()[0]??null;return t===null?null:mh(t)}function gh(e){let t=e.getLatest();return lh(t)&&t.__slots!==null?t.__slots:ch}function _h(e){return Array.from(gh(e).keys())}function vh(e,t){let n=gh(e).get(t);return n===void 0?null:Nl(n)}var yh=[`__proto__`,`constructor`,`prototype`],bh=Symbol(`slotMapOwner`);function xh(e){let t=e.__slots;return t!==null&&t[bh]===e||(t=new Map(t),t[bh]=e,e.__slots=t),t}var Sh=new WeakMap,Ch=[];function wh(e){for(let{ownNodeConfig:t}of Wd(e)){let e=t&&t.slots;if(e)return e}return Ch}function Th(e){let t=``;for(let n of gh(e).values()){let e=Nl(n);e!==null&&(t+=e.getTextContent())}return t}function Eh(e,t,n){let r=n.get(e),i=n.get(t);return r===void 0?i===void 0?e<t?-1:+(e>t):1:i===void 0?-1:r-i}function Dh(e,t,n){t!==`__proto__`&&t!==`constructor`&&t!==`prototype`||G(373,t);let r=e.getLatest();if(r.__slots!==null&&r.__slots.get(t)===n.getLatest().__key)return r;(!q(n)&&!sc(n)||n.isInline())&&G(374,n.__key);let i=e.getWritable(),a=xh(i),o=a.get(t);o!==void 0&&Oh(o);let s=n.getWritable(),c=fh(s);if(c!==null){let e=ph(s);e!==null&&xh(c.getWritable()).delete(e),s.__slotHost=null}return rh(s),s.__slotHost=i.__key,a.set(t,s.__key),function(e){let t=e.__slots;if(t===null||t.size<2)return;let n=function(e){let t=Sh.get(e);if(t===void 0){let n=wh(e),r=new Map;for(let t of n)yh.includes(t)&&G(371,e.name,t),r.has(t)&&G(372,e.name,t),r.set(t,r.size);t=r,Sh.set(e,t)}return t}(e.constructor),r=null,i=!0;for(let e of t.keys()){if(r!==null&&Eh(r,e,n)>0){i=!1;break}r=e}if(i)return;let a=Array.from(t).sort(([e],[t])=>Eh(e,t,n));t.clear();for(let[e,n]of a)t.set(e,n)}(i),Rf()._slotsUsed=!0,If()._slotsUsed=!0,i}function Oh(e){let t=Nl(e);if(t===null)return;let n=t.getWritable();uh(n)||G(377,e),n.__slotHost=null,n.remove()}var kh={next:`previous`,previous:`next`},Ah=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return rg({hasNext:Rh,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return Uh(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Uh(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of r){if(o.size>0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&G(263,Array.from(o).join(` `))}else i.insert(e);i=Uh(e,this.direction)}for(let e of o.values())e.remove();return this}},jh=class e extends Ah{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:qh(e,this.direction)}getParentCaret(e=`root`){return Uh(Ph(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Nh(this.direction);return Uh(this.getNodeAtCaret(),e)||qh(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},Mh={root:uc,shadowRoot:Cu};function Nh(e){return kh[e]}function Ph(e,t=`root`){return e===null||Mh[t](e)?null:dh(e)===null?e:null}var Fh=class e extends Ah{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Uh(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return q(this.origin)?qh(this.origin,this.direction):null}getParentCaret(e=`root`){return Uh(Ph(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=Nh(this.direction);return Uh(this.getNodeAtCaret(),e)||qh(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof Ih)&&this.direction===t.direction&&this.origin.is(t.origin)}},Ih=class e extends Ah{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Wh(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return Uh(Ph(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Wh(this.origin,Nh(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Fh||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return Uh(this.origin,this.direction)}};function Lh(e){return e instanceof Ih}function Rh(e){return e instanceof Fh}function zh(e){return e instanceof jh}var Bh={next:class extends Ih{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Ih{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Vh={next:class extends Fh{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Fh{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Hh={next:class extends jh{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends jh{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function Uh(e,t){return e?new Vh[t](e):null}function Wh(e,t,n){return e?new Bh[t](e,Gh(e,n)):null}function Gh(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&Rr(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function Kh(e,t){return new Zh(e,t)}function qh(e,t){return q(e)?new Hh[t](e):null}function Jh(e){return e&&e.getChildCaret()||e}function Yh(e){return e&&Jh(e.getAdjacentCaret())}var Xh=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=this.anchor.getLatest(),t=this.focus.getLatest();return Lh(e)&&Lh(t)&&e.isSameNodeCaret(t)?[Kh(e,t.offset-e.offset),null]:[Lh(e)?Qh(e,`anchor`):null,Lh(t)?Qh(t,`focus`):null]}iterNodeCarets(e=`root`){let t=Lh(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=Lh(n),i=t=>t.isSameNodeCaret(n)?null:Yh(t)||t.getParentCaret(e);return rg({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},Zh=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return Wh(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function Qh(e,t){let{direction:n,origin:r}=e;return Kh(e,Gh(r,t===`focus`?Nh(n):n)-e.offset)}function $h(e,t){return e.direction===t?e:e.getFlipped()}function eg(e){return ng(e,$h(qh(Vl(),Nh(e.direction)),e.direction))}function tg(e){return ng(e,e)}function ng(e,t){return e.direction!==t.direction&&G(265),new Xh(e,t,e.direction)}function rg(e){let{initial:t,hasNext:n,step:r,map:i}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let e={done:!1,value:i(a)};return a=r(a),e}}}function ig(e,t){let n=ug(e.origin,t.origin);switch(n===null&&G(275,e.origin.getKey(),t.origin.getKey()),n.type){case`same`:return og(e,t);case`ancestor`:return e.type===`child`?-1:1;case`descendant`:return t.type===`child`?1:-1;case`branch`:return sg(n)}}function ag(e){return e.getParent()||fh(e)}function og(e,t){let n=e.type===`text`,r=t.type===`text`;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:e.type===`child`?-1:1}function sg(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,a=t,o=n;for(;a&&o;a=a.getNextSibling(),o=o.getNextSibling()){if(a.__key===i)return-1;if(o.__key===r)return 1}return a===null?1:-1}function cg(e,t){return t.is(e)}function lg(e){return q(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function ug(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=new Map;for(let[t,r]=lg(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=lg(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(cg(e,r)||G(276),{commonAncestor:r,type:`ancestor`}):i===null?(cg(t,r)||G(277),{commonAncestor:r,type:`descendant`}):((q(a)||cg(e,a))&&(q(i)||cg(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||G(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function dg(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function fg(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function pg(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}var mg={tag:tf};function hg(){let e=Vl();e.isEmpty()&&e.append(nl())}var gg={config:{setOptions:mg,updateOptions:mg},init:({$initialEditorState:e=hg})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){let i=r.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:r}=i;if(Qd(r))e.setEditorState(r,n);else if(typeof r==`function`)e.update(()=>{r(e)},t);else if(r&&(typeof r==`string`||typeof r==`object`)){let t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[lc,Sc,sf,al,el]};function _g(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function vg(){let e;try{e=`0.53.0+prod.esm`}catch{}return e??`"<unknown>+source"`}var yg=vg(),bg=new Set([`__proto__`,`constructor`,`prototype`]);function xg(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)!bg.has(e)&&Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=xg(n[e],r[e]));return e}return t}function Sg(e){return e.id===0}function Cg(e){return e.id===2}var wg=new Set,Tg=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:0}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):dg;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;Cg(t)||_g(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:3,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:4,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==4&&_g(307,String(t.id),`5`),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:5,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==5&&_g(308,String(n.id),`5`);let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:6})}(n),()=>{let e=this.state;e.id!==7&&_g(309,String(n.id),`7`),this.state=function(e){return Object.assign(e,{id:5})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==6&&_g(310,String(t.id),`6`),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:7})}(t),n}getSignal(){return this._signal===void 0&&_g(311),this._signal}getInitResult(){this.extension.init===void 0&&_g(312,this.extension.name);let e=this.state;return function(e){return e.id>=4}(e)||_g(313,String(e.id),`4`),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=3}(e)||_g(314,String(e.id),`3`),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&_g(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&_g(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=7}(e)||_g(316,String(e.id),`7`),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||wg}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=5})(e)||_g(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},Eg=Symbol.for(`@lexical/extension/LexicalBuilder`);function Dg(){}function Og(e){throw e}function kg(e){return Array.isArray(e)?e:[e]}var Ag=yg,jg=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=Ag,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[kg(gg)];for(let e of t)n.push(kg(e));return new e(n)}static maybeFromEditor(t){let n=t[Eg];return n&&(n.PACKAGE_VERSION!==Ag&&_g(292,n.PACKAGE_VERSION,Ag),n instanceof e||_g(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&_g(294),n}constructEditor(){let{$initialEditorState:e,onError:t,onWarn:n,...r}=this.buildCreateEditorArgs(),i=Object.assign(vf({...r,...t?{onError:e=>{t(e,i)}}:{},...n?{onWarn:e=>{n(e,i)}}:{}}),{[Eg]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=Dg;function t(){try{e()}finally{e=Dg}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=tp(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&_g(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);if(r){let e=r.get(t);e?e.push(...n):r.set(t,n)}else this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&_g(296);let[t]=kg(e);typeof t.name!=`string`&&_g(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&_g(298,t.name),!n){n=new Tg(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&_g(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&_g(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=kg(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(Cg(i))return;let a=n.extension.name;var o;Sg(i)||_g(300,a,r||`[unknown]`),Sg(o=i)||_g(304,String(o.id),`0`),i=Object.assign(o,{id:1}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=function(e){return function(e){return e.id===1}(e)||_g(305,String(e.id),`1`),Object.assign(e,{id:2})}(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())Sg(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&_g(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return tp(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.onWarn!==void 0&&(e.onWarn=o.onWarn),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of pg(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&_g(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&xg(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=Array.from(t));let s=Object.keys(i).length>0,c=r.size>0;(s||c)&&(e.html={},s&&(e.html.import=i),c&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=Og,e}};function Mg(e,t){let n=jg.maybeFromEditor(e);if(!n)return;let r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}function Ng(e){let t=ed().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function Pg(e){let t=uc(e)?e:e.getParent();return t&&Ng(t)}function Fg(e,t,n=`self`){let r=e.getStartEndPoints();if(r!==null&&t.isSelected(e)&&!Sl(t)){let[i,a]=e.isBackward()?[r[1],r[0]]:r,o=!X(e)||i.type!==`element`&&a.type!==`element`?void 0:Jc(Lc(e).getTextSlices(),t),[s,c]=o?o.getSliceIndices():[t.__key===i.key?i.offset:0,t.__key===a.key?a.offset:void 0],l=t.__text.slice(s,c);l!==t.__text&&(n===`clone`&&(t=ld(t)),t.__text=l)}return t}function Ig(e){let t=Lg(e);return t!==null&&t.writingMode===`vertical-rl`}function Lg(e){let t=e.anchor.getNode();return q(t)?Ng(t):Pg(t)}function Rg(e,t){let n=Ig(e)?!t:t;Bg(e)&&(n=!n);let r=Nc(e.focus,n?`previous`:`next`);if(Wc(r))return!1;if(Lh(r)&&!sl(r.origin)&&r.origin.isUnmergeable()){let e=r.getNodeAtCaret();if(J(e)&&!sl(e))return!0}for(let e of eg(r)){if(zh(e))return!e.origin.isInline();if(!q(e.origin)){if(sc(e.origin))return!0;break}}return!1}function zg(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function Bg(e){let t=Lg(e);return t!==null&&t.direction===`rtl`}function Vg(e,t,n){let r=Bg(e),i;i=Ig(e)||r?!n:n,zg(e,t,i,`character`)}function Hg(e,t){if(e==null)return!1;let n=Object.getPrototypeOf(e);return n!=null&&n.constructor!=null&&n.constructor.name===t.name}function Ug(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var Wg;function Gg(e,t){let{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function Kg(e){return Wg&&Wg.editor===e?Wg:void 0}function qg(e,t){if(`cfg`in t){let{cfg:n,updater:r}=t;return[n,r(Gg(e,n))]}return t}function Jg(e,t){let n=t;for(let r of e){let[e,i]=qg(n,r),a=e.key;if(n===t&&Gg(n,e)===i)continue;let o=n===t||n===void 0?Yg(t):n;o[a]=i,n=o}return n}function Yg(e){return Object.create(e||null)}function Xg(e,t){return[e,t]}function Zg(e,t,n,r=ed()){let i=Wg,a=Kg(r);try{return Wg={...a,editor:r,[e]:t},n()}finally{Wg=i}}function Qg(e,t=()=>{}){return(n,r=ed())=>i=>{let a=Kg(r),o=a&&a[e],s=Jg(n,o||t(r));return s&&s!==o?Zg(e,s,i,r):i()}}function $g(e,t,n,r){return Object.assign(yo(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}var e_=`@lexical/html/DOM`,t_=Symbol.for(`@lexical/html/DOMExportContext`);function n_(e,t,n){return $g(t_,e,t,n)}var r_=n_(`isExport`,Boolean);function i_(e){let t=Mg(e,e_);return t?t.output.defaults:void 0}function a_(e){let t=Mg(e,e_);return t?t.output.runtime:void 0}function o_(e=ed()){let t=a_(e);return t?t.getSessionConfig():td(e)}var s_=Qg(t_,i_);function c_(e,t=null,n=ed()){return s_([Xg(r_,!0)],n)(()=>{let r=Vl(),i=o_(n),a=hh(t),o=e.append.bind(e);for(let e of(q(a)?a:r).getChildren())u_(n,e,o,t,i);return e})}function l_(e,t=null){return(typeof document>`u`||typeof window>`u`&&global.window===void 0)&&Ug(338),Lf(e),c_(Lu().createElement(`div`),t,e).innerHTML}function u_(e,t,n,r=null,i=td(e)){let a=i.$shouldInclude(t,r,e),o=i.$shouldExclude(t,r,e),s=t;r!==null&&J(t)&&(s=Fg(r,t,`clone`));let{element:c,after:l,append:u,$getChildNodes:d}=i.$exportDOM(s,e);if(!c)return!1;let f=Lu().createDocumentFragment(),p=d?d():q(s)?s.getChildren():[],m=a&&lm(r)&&q(t)?null:r,h=f.append.bind(f),g=null;for(let n of p){let o=u_(e,n,h,m,i);o&&(g=n),!a&&o&&i.$extractWithChild(t,n,r,`html`,e)&&(a=!0)}if(a&&!o){if((qu(c)||Yu(c))&&(u?u(f):c.append(f),function(e,t){let n=e.lastChild;if(uf(t)&&qu(e)&&$u(e)&&n!==null&&n.nodeName===`BR`){let t=Lu().createElement(`br`);t.setAttribute(`data-lexical-managed-linebreak`,`true`),e.append(t)}}(c,g)),Yu(c)){if(l){let e=l.call(s,c);e&&c.replaceChildren(e)}n(c)}else if(n(c),l){let e=l.call(s,c);e&&c.replaceWith(e)}}else n(f);return a}function d_(e,t,n=null){let r=Iu(n),i=n?Pu(n):[],a=n!==null&&i.length>0;if(a&&typeof r.caretPositionFromPoint==`function`){let a=r.caretPositionFromPoint(e,t,{shadowRoots:i});if(a!==null&&function(e,t){for(let n=e;n!==null;){if(n===t)return!0;n=du(n)}return!1}(a.offsetNode,n))return{node:a.offsetNode,offset:a.offset}}if(a){let i=n.getRootNode();if(Mu(i)){let a=i.elementFromPoint(e,t);if(a!==null&&n.contains(a)){let n=function(e,t,n,r){let i=r.createRange(),a=e=>t<e.top?e.top-t:t>e.bottom?t-e.bottom:0,o=t=>e<t.left?t.left-e:e>t.right?e-t.right:0,s=r.createTreeWalker(n,NodeFilter.SHOW_TEXT),c=null,l=1/0,u=1/0;for(let e=s.nextNode();e;e=s.nextNode()){i.selectNodeContents(e);for(let t of i.getClientRects()){let n=a(t),r=o(t);(n<l||n===l&&r<u)&&(l=n,u=r,c=e)}}if(c===null)return null;let d=0,f=1/0,p=1/0;for(let t=0;t<=c.length;t++){i.setStart(c,t),i.collapse(!0);let n=i.getBoundingClientRect(),r=a(n),o=Math.abs(e-n.left);(r<f||r===f&&o<p)&&(f=r,p=o,d=t)}return{node:c,offset:d}}(e,t,a,r);if(n!==null)return n}}}if(typeof r.caretRangeFromPoint==`function`){let n=r.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(typeof r.caretPositionFromPoint==`function`){let n=r.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}function f_(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function p_(e,t=Z()){return t??f_(166),X(t)&&t.isCollapsed()||t.getNodes().length===0?``:l_(e,t)}function m_(e,t){let n=e.getData(`text/plain`)||e.getData(`text/uri-list`);n!=null&&t.insertRawText(n)}var h_=`application/x-lexical-drag`;function g_(e,t){let n={editorKey:t.getKey()};e.setData(h_,JSON.stringify(n))}function __(e){let t=e;if(Lh(t)){if(t.offset===0)t=Rc(t.getSiblingCaret());else{if(t.offset!==t.origin.getTextContentSize())return t;t=t.getSiblingCaret()}}for(;;){let e=t.getParentAtCaret();if(e===null||!e.isInline()||e.isShadowRoot())return t;if(zh(t))t=Rc(Uh(e,`next`));else{if(t.getNodeAtCaret()!==null)return t;t=Uh(e,`next`)}}}function v_(e,t,n){let r=e.dataTransfer;if(r===null)return!1;let i=function(e){let t=e.getData(h_);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}return(r=n)!==null&&typeof r==`object`&&`editorKey`in r&&typeof r.editorKey==`string`?n:null;var r}(r);if(i===null)return!1;let a=function(e,t){let n=d_(e.clientX,e.clientY,t.getRootElement());if(n===null)return null;let r=Ll(n.node);if(r===null)return null;if(J(r))return Wh(r,`next`,n.offset);let i=r.getParent();if(q(r)){let e=t.getElementByKey(r.getKey());if(e===null)return null;let a=nd(r,e,t);return n.node===a.element||i?Kc(...a.resolveChildIndex(r,e,n.node,n.offset),`next`):null}return i&&Kc(i,r.getIndexWithinParent()+1,`next`)}(e,t);if(a===null)return!1;let o=i.editorKey===t.getKey(),s=Z();if(o){if(!X(s)||s.isCollapsed())return!1;if(function(e,t){let{anchor:n,focus:r}=Gc(Lc(t),`next`),i=__(e);return ig(__(n),i)<=0&&ig(i,__(r))<=0}(a,s))return e.preventDefault(),!0}let c=Uc(a),l=Lh(c)?Zc(c):c;if(l===null)return!1;let u=l.getFlipped();o&&X(s)&&s.removeText();let d=l.origin.isAttached()?l:u;if(d.origin.isAttached()||f_(438),n(r,Fc(tg(d)),t),!o){let e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){for(let n of Fu(t)){let t=bl(n);if(vl(t)&&t.getKey()===e&&qu(n))return n}return null}(i.editorKey,n):null;r!==null&&r.dispatchEvent(new InputEvent(`beforeinput`,{bubbles:!0,cancelable:!0,inputType:`deleteByDrag`}))}return e.preventDefault(),!0}function y_(e,t){return v_(e,t,(e,t)=>m_(e,t))}function b_(e,t){t.update(()=>{if(e!==null){let n=Hg(e,KeyboardEvent)?null:e.clipboardData,r=Z();if(r!==null&&!r.isCollapsed()&&n!=null){e.preventDefault();let i=p_(t);i!==null&&n.setData(`text/html`,i),n.setData(`text/plain`,r.getTextContent())}}})}function x_(e){return tp(e.registerCommand(wi,e=>{let t=Z();return!!X(t)&&(t.deleteCharacter(e),!0)},0),e.registerCommand(Ai,e=>{let t=Z();return!!X(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(ji,e=>{let t=Z();return!!X(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(Di,e=>{let t=Z();if(!X(t))return!1;if(typeof e==`string`)t.insertText(e);else{let n=e.dataTransfer;if(n!=null)m_(n,t);else{let n=e.data;n&&t.insertText(n)}}return!0},0),e.registerCommand(ki,()=>{let e=Z();return!!X(e)&&(e.removeText(),!0)},0),e.registerCommand(Ti,e=>{let t=Z();return!!X(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(Ei,()=>{let e=Z();return!!X(e)&&(e.insertLineBreak(),!0)},0),e.registerCommand(Ri,e=>{let t=Z();if(!X(t))return!1;let n=e,r=n.shiftKey;return!!Rg(t,!0)&&(n.preventDefault(),Vg(t,r,!0),!0)},0),e.registerCommand(Ii,e=>{let t=Z();if(!X(t))return!1;let n=e,r=n.shiftKey;return!!Rg(t,!1)&&(n.preventDefault(),Vg(t,r,!1),!0)},0),e.registerCommand(Wi,t=>!!X(Z())&&(!Xr||!Jr)&&(t.preventDefault(),e.dispatchCommand(wi,!0)),0),e.registerCommand(Ki,t=>!!X(Z())&&(t.preventDefault(),e.dispatchCommand(wi,!1)),0),e.registerCommand(Hi,t=>{if(!X(Z()))return!1;if(t!==null){if((Xr||Qr||ti)&&Jr)return!1;t.preventDefault()}return e.dispatchCommand(Ti,!1)},0),e.registerCommand(ea,()=>{let e=Z();return nu(X(e)&&mh(e.anchor.getNode())!==null?e:null),!0},0),e.registerCommand(Qi,t=>!(!X(Z())||gl(t)||(b_(t,e),0)),0),e.registerCommand($i,t=>!(!X(Z())||gl(t)||(function(e,t){b_(e,t),t.update(()=>{let e=Z();X(e)&&e.removeText()},{tag:`cut`})}(t,e),0)),0),e.registerCommand(Oi,t=>!(!X(Z())||gl(t)||(function(e,t){e.preventDefault(),t.update(()=>{let t=Z(),n=Hg(e,ClipboardEvent)?e.clipboardData:null;n!=null&&X(t)&&m_(n,t)},{tag:`paste`})}(t,e),0)),0),e.registerCommand(Ji,t=>y_(t,e),0),e.registerCommand(Yi,t=>{let n=Z();return!!X(n)&&(n.isCollapsed()||t.dataTransfer===null||g_(t.dataTransfer,e),!0)},0))}function S_(e){return JSON.stringify([e.exportJSON(),q(e)?e.getChildrenKeys():null])}function C_(e,t,n){let r=n(),i=0,a=r,o=0,s=null,c=new Set;return(l,u,d,f,p,m)=>{let h=n();if(m.has(`composition-start`)&&(a=r,o=i,s=l,c.clear()),s!==null){for(let e of f)c.add(e);for(let e of p.keys())c.add(e)}if(m.has(`historic`))return i=0,r=h,s=null,c.clear(),2;let g=m.has(af);g&&s&&(r=a,i=o,l=s);let _=m.has(`paste`)||m.has(`cut`)?0:function(e,t,n,r,i){if(e===null||n.size===0&&r.size===0&&!i)return 0;let a=t._selection,o=e._selection;if(i)return 1;if(!(X(a)&&X(o)&&o.isCollapsed()&&a.isCollapsed()))return 0;let s=function(e,t,n){let r=e._nodeMap,i=[];for(let e of t){let t=r.get(e);t!==void 0&&i.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);n===void 0||uc(n)||i.push(n)}return i}(t,n,r);if(s.length===0)return 0;if(s.length>1){let n=t._nodeMap,r=n.get(a.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&J(r)&&r.__text.length===1&&a.anchor.offset===1?2:0}let c=s[0],l=e._nodeMap.get(c.__key);if(!J(l)||!J(c)||l.__mode!==c.__mode)return 0;let u=l.__text,d=c.__text;if(u===d)return 0;let f=a.anchor,p=o.anchor;if(f.key!==p.key||f.type!==`text`)return 0;let m=f.offset,h=p.offset,g=d.length-u.length;return g===1&&h===m-1?2:g===-1&&h===m+1?3:g===-1&&h===m?4:0}(l,u,f,p,e.isComposing()),v=!1,y=(()=>{let n=d===null||d.editor===e,a=m.has(ef),o=!a&&n&&m.has(`history-merge`);if(g&&s!==null&&n&&!a&&function(e,t,n){for(let r of e){let e=t._nodeMap.get(r),i=n._nodeMap.get(r);if(!(e===i||e&&i&&t.read(()=>S_(e))===n.read(()=>S_(i))))return!1}return!0}(c,s,u))return v=!0,0;if(o)return 0;if(_===1)return 2;if(l===null)return 1;let y=u._selection;if(!(f.size>0||p.size>0))return y===null?2:0;let b=typeof t==`number`?t:t.peek();return!1===a&&_!==0&&_===i&&h<r+b&&n||!a&&f.size===1&&function(e,t,n){let r=t._nodeMap.get(e),i=n._nodeMap.get(e),a=t._selection,o=n._selection;return!(X(a)&&X(o)&&a.anchor.type===`element`&&a.focus.type===`element`&&o.anchor.type===`text`&&o.focus.type===`text`||!J(r)||!J(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(f)[0],l,u)?0:1})();return g&&(s=null,c.clear()),v||(r=h,i=_),y}}function w_(e,t){if(t!==null&&t.editor===e.editor)return t;let{editor:n}=e,r=n.getEditorState();return r.isEmpty()?null:{editor:n,editorState:r}}function T_(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}function E_(e,t,n,r=Date.now,i,a=null){let o=C_(e,n,r),s=()=>{i&&i(t)};return s(),tp(e.registerCommand(Ni,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(i.length!==0){let a=t.current,o=i.pop();if(o){let t=w_(o,a);t!==null&&(r.push(t),e.dispatchCommand(ra,!0))}i.length===0&&e.dispatchCommand(ia,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(Pi,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(r.length!==0){let a=t.current,o=r.pop();if(o){let t=w_(o,a);t!==null&&(i.push(t),e.dispatchCommand(ia,!0))}r.length===0&&e.dispatchCommand(ra,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(ta,()=>(T_(t,i),!1),0),e.registerCommand(na,()=>(T_(t,i),e.dispatchCommand(ra,!1),e.dispatchCommand(ia,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:i,dirtyElements:c,tags:l})=>{let u=t.current,d=t.redoStack,f=t.undoStack,p=u===null?null:u.editorState;if(u!==null&&n===p)return;let m=o(r,n,u,i,c,l);if(m===1){d.length!==0&&(t.redoStack=[],e.dispatchCommand(ra,!1));let n=function(e,t,n){return n===null?null:n.editor===e?{...n}:t.isEmpty()?null:{editor:e,editorState:t}}(e,r,u);if(n!==null){f.push(n);let t=typeof a==`number`||a===null?a:a.peek();t!==null&&f.length>t&&f.splice(0,f.length-t),e.dispatchCommand(ia,!0)}}else if(m===2)return;t.current={editor:e,editorState:n},s()}))}function D_(){return{current:null,redoStack:[],undoStack:[]}}function O_({editor:e,editable:t,...n}){let r=(0,B.useRef)(null);return(0,B.useLayoutEffect)(()=>{let t=r.current;if(e!==null&&t!==null)return e.setRootElement(t),()=>{e.setRootElement(null)}},[e]),(0,B.useLayoutEffect)(()=>{e!==null&&e.setEditable(t)},[e,t]),(0,W.jsx)(`div`,{ref:r,contentEditable:e!==null&&t,suppressContentEditableWarning:!0,role:`textbox`,"aria-multiline":`true`,"data-composer-input":!0,...n})}var k_=`color: var(--dsw-alias-state-business-primary)`;function A_(){let e=Vl().getFirstChild();if(!q(e))return null;let t=e.getFirstChild();return J(t)?t:null}function j_(e,t){return e.registerNodeTransform(Sc,e=>{let n=A_();if(n===null||e.getKey()!==n.getKey()){e.getStyle()===k_&&e.setStyle(``);return}let r=e.getTextContent(),i=t(),a=r===i?.trimEnd()?r:i;if(a===null||!r.startsWith(a))e.getStyle()===k_&&e.setStyle(``);else if(r.length>a.length){let[t]=e.splitText(a.length);t!==void 0&&t.getStyle()!==k_&&t.setStyle(k_)}else e.getStyle()!==k_&&e.setStyle(k_)})}function M_(e){e.update(()=>{A_()?.markDirty()})}var N_=(0,B.forwardRef)(function(e,t){let n=(0,B.useRef)(e);n.current=e;let[r]=(0,B.useState)(()=>vf({namespace:`pi-composer`,onError:e=>{throw e}})),[i,a]=(0,B.useState)(!1);return(0,B.useImperativeHandle)(t,()=>({focus:()=>{r.getRootElement()?.focus({preventScroll:!0}),r.focus()}}),[r]),(0,B.useLayoutEffect)(()=>{let e=()=>{let e=r.getRootElement();return e&&!e.contains(e.ownerDocument.activeElement)&&hu(nf),!1},t=[r.registerCommand(oa,()=>(r.update(e,{discrete:!0}),!1),4),r.registerCommand(vi,e,4),r.registerNodeTransform(lc,e),x_(r),E_(r,D_(),1e3),j_(r,()=>n.current.claimToken),r.registerUpdateListener(({editorState:e,dirtyElements:t,dirtyLeaves:r})=>{if(t.size===0&&r.size===0)return;let i=e.read(()=>Vl().getTextContent());i!==n.current.value&&n.current.onChange(i)})];return()=>{for(let e of t)e()}},[r]),(0,B.useLayoutEffect)(()=>{(r.getEditorState().read(()=>Vl().getTextContent())!==e.value||r.getEditorState().isEmpty())&&(r.update(()=>{let t=Vl(),n=r.getRootElement()?.contains(document.activeElement);n||hu(nf);let i=nl();for(let[t,n]of e.value.split(`
33
- `).entries())t&&i.append(lf()),n&&i.append(jc(n));t.clear().append(i),n&&i.selectEnd()},{discrete:!0}),e.value||r.dispatchCommand(na,void 0))},[r,e.value]),(0,B.useLayoutEffect)(()=>{M_(r)},[r,e.claimToken]),(0,W.jsx)(`div`,{className:Ut.scroll,"data-input-scroll":!0,children:(0,W.jsxs)(`div`,{className:Ut.grow,children:[(0,W.jsx)(O_,{editor:r,editable:e.editable,className:Ut.input,"aria-label":e.ariaLabel,"aria-disabled":!e.editable||void 0,"aria-haspopup":`listbox`,"aria-expanded":e.menuOpen,"aria-activedescendant":e.activeOption,"data-phase":e.claimToken?`claimed`:`plain`,"data-placeholder":e.placeholder,"data-composer-composing":i||void 0,style:e.hint===null?void 0:{"--dsh-composer-hint":JSON.stringify(e.hint)},onKeyDownCapture:t=>{e.onKeyDown(t),t.defaultPrevented&&t.stopPropagation()},onPasteCapture:t=>{e.onPaste(t),t.defaultPrevented&&t.stopPropagation()},onCompositionStart:()=>a(!0),onCompositionEnd:()=>a(!1)}),e.value===``&&(0,W.jsx)(`div`,{"aria-hidden":!0,className:Ut.placeholder,"data-composer-placeholder":!0,children:e.placeholder})]})})});function P_(e,t){return typeof e==`string`?e:e?.[t]}function F_(e,t,n,r){let i=new Map;for(let n of[...e,...t.map(e=>({...e,section:`commands`}))])i.has(n.name)||i.set(n.name,{...n,section:n.section??`commands`});for(let e of n){for(let t of e.definition.commands??[])i.set(t.id,{name:t.id,label:P_(t.presentation?.label,r)??t.title,description:P_(t.presentation?.description,r)??t.description,icon:t.presentation?.icon,section:t.presentation?.section??`commands`,input:t.input,pluginId:e.id,action:t.action});for(let t of e.definition.menuItems??[])t.menu===`composer`&&i.set(`${e.id}:${t.id}`,{name:t.title,label:t.title,section:`add`,pluginId:e.id,action:t.action,menuOnly:!0})}return[...i.values()].sort((e,t)=>Number(t.section===`add`)-Number(e.section===`add`))}function I_(e){let t=e.input?.token;return[e.name,...typeof t==`string`?[t]:t?[t.zh,t.en]:[]]}function L_(e,t){let n=/^\/(\S+)(?:\s([\s\S]*))?$/.exec(e.trimStart());if(!n)return;let r=t.find(e=>!e.menuOnly&&e.name===n[1])??t.find(e=>!e.menuOnly&&I_(e).includes(n[1]));return r?{command:r,token:`/${n[1]}`,text:(n[2]??``).trim()}:void 0}function R_(e,t,n){let r=t.toLocaleLowerCase();return e.filter(e=>(!n||!e.menuOnly)&&[...I_(e),e.label??``].some(e=>e.toLocaleLowerCase().includes(r)))}function z_(e,t,n,r,i){if(!(!t||t.idle&&(r.trim()||i))){for(let r of e){let e=r.definition.composerAction?.(t,n);if(!(!e||(t.idle?e.kind!==`invoke`:e.kind!==`stop`)))return{...e,pluginId:r.id,sessionId:t.sessionId}}if(!t.idle)return{kind:`stop`,sessionId:t.sessionId,label:n===`zh`?`暂停执行`:`Pause`,title:n===`zh`?`暂停当前执行,保留已有进度`:`Pause execution and keep existing progress`};if(t.paused)return{kind:`resume`,sessionId:t.sessionId,label:n===`zh`?`继续执行`:`Continue`,title:n===`zh`?`基于已有进度继续执行`:`Continue from existing progress`}}}async function B_(e,t,n,r,i,a){if(i()!==e.sessionId)throw Error(`Session changed`);if(e.kind===`stop`)return r();if(e.kind===`resume`){if(!a)throw Error(`Resume is unavailable`);return a()}if(!e.pluginId)throw Error(`Missing plugin for composer action`);let o=await t(e.pluginId,e.action,e.input);if(i()!==e.sessionId)throw Error(`Session changed`);if(!e.sendResultMessage)return;let s=o?.message;if(typeof s!=`string`||!s.trim())throw Error(`Plugin action did not return a message`);await n(s)}var V_=12;function H_(e,t,n){let[r,i]=(0,B.useState)(t);return(0,B.useLayoutEffect)(()=>{let n=e.current;if(n===null)return;let r=()=>{i(Math.min(t,Math.max(0,n.getBoundingClientRect().bottom-V_)))};return r(),window.addEventListener(`resize`,r),window.addEventListener(`scroll`,r,!0),()=>{window.removeEventListener(`resize`,r),window.removeEventListener(`scroll`,r,!0)}},[e,t,n]),r}var U_={menu:`_menu_1lxmu_1`,viewport:`_viewport_1lxmu_44`,item:`_item_1lxmu_51`,active:`_active_1lxmu_70`,sectionTitle:`_sectionTitle_1lxmu_74`,itemIcon:`_itemIcon_1lxmu_88`,itemName:`_itemName_1lxmu_103`,itemAlias:`_itemAlias_1lxmu_113`,itemDescription:`_itemDescription_1lxmu_126`,trailing:`_trailing_1lxmu_140`,drillHintText:`_drillHintText_1lxmu_151`,drillHint:`_drillHint_1lxmu_151`,drill:`_drill_1lxmu_151`,groupTitle:`_groupTitle_1lxmu_194`,skeletonRow:`_skeletonRow_1lxmu_204`,skeletonBar:`_skeletonBar_1lxmu_213`,"dsh-menu-skeleton":`_dsh-menu-skeleton_1lxmu_1`,crumbs:`_crumbs_1lxmu_229`,crumb:`_crumb_1lxmu_229`,crumbCurrent:`_crumbCurrent_1lxmu_264`,crumbSeparator:`_crumbSeparator_1lxmu_270`};function W_(){return[{name:`file`,label:U(`文件`,`File`),section:`add`,icon:l,menuOnly:!1},{name:`compact`,label:U(`压缩`,`Compact`),icon:f,description:U(`压缩当前会话内容`,`Compact the current session`)},{name:`model`,label:U(`模型`,`Model`),icon:S,description:U(`选择本会话使用的模型`,`Choose the model for this session`)},{name:`new`,label:U(`新会话`,`New session`),icon:_,description:U(`创建新会话`,`Create a new session`)}]}function G_({commands:e,active:t,onHover:n,onPick:r,grouped:i=!0}){let a=(0,B.useRef)(null),o=H_(a,400,e.length);return(0,B.useLayoutEffect)(()=>{a.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`})},[t,e.length]),(0,W.jsx)(L,{ref:a,className:U_.menu,"data-trigger-menu":``,style:{maxHeight:o},children:(0,W.jsxs)(`div`,{className:U_.viewport,role:`listbox`,"aria-label":U(`指令`,`Commands`),"aria-activedescendant":e[t]?`pi-command-${t}`:void 0,children:[e.map((a,o)=>(0,W.jsxs)(B.Fragment,{children:[i&&(o===0||a.section!==e[o-1]?.section)&&(0,W.jsx)(`div`,{className:U_.sectionTitle,role:`presentation`,children:a.section===`add`?U(`添加`,`Add`):U(`指令`,`Commands`)}),(0,W.jsxs)(`button`,{id:`pi-command-${o}`,type:`button`,role:`option`,"aria-selected":o===t,className:`${U_.item} ${o===t?U_.active:``}`,onMouseDown:e=>{e.preventDefault(),r(a)},onMouseMove:o===t?void 0:()=>n(o),children:[a.icon&&(0,W.jsx)(`span`,{className:U_.itemIcon,"aria-hidden":!0,children:(0,W.jsx)(a.icon,{size:14})}),(0,W.jsx)(`span`,{className:U_.itemName,children:a.label??a.name}),a.label&&a.label.toLowerCase()!==a.name.toLowerCase()&&(0,W.jsx)(`span`,{className:U_.itemAlias,children:a.name}),a.description&&(0,W.jsx)(`span`,{className:U_.itemDescription,children:a.description})]})]},`${a.pluginId??`pi`}:${a.name}`)),e.length===0&&(0,W.jsx)(`div`,{className:U_.groupTitle,children:U(`没有匹配的指令`,`No matching commands`)})]})})}var K_={mask:`_mask_dzmab_3`,"fade-in":`_fade-in_dzmab_1`,wrap:`_wrap_dzmab_27`,illustration:`_illustration_dzmab_37`,title:`_title_dzmab_42`,desc:`_desc_dzmab_47`};function q_({disabled:e,labels:t}){return(0,_t.createPortal)((0,W.jsx)(`div`,{className:K_.mask,role:`status`,children:(0,W.jsxs)(`div`,{className:K_.wrap,children:[(0,W.jsx)(`div`,{className:K_.illustration,"aria-hidden":`true`,children:e?(0,W.jsx)(Y_,{}):(0,W.jsx)(J_,{})}),(0,W.jsx)(`div`,{className:K_.title,children:t.title}),!e&&t.desc!==void 0&&(0,W.jsx)(`div`,{className:K_.desc,children:t.desc})]})}),document.body)}var J_=()=>(0,W.jsxs)(`svg`,{width:`115`,height:`84`,viewBox:`0 0 115 84`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,W.jsxs)(`g`,{clipPath:`url(#piwDropOverlayClip)`,children:[(0,W.jsx)(`rect`,{y:`17.0742`,width:`44.1832`,height:`43.6431`,rx:`12`,transform:`rotate(-22.7338 0 17.0742)`,fill:`#9CE5ED`}),(0,W.jsx)(`rect`,{x:`73.4043`,y:`8.54297`,width:`43.7267`,height:`50.5284`,rx:`8`,transform:`rotate(17.403 73.4043 8.54297)`,fill:`#679EFE`}),(0,W.jsx)(`path`,{d:`M30.4917 28.1369L40.8865 33.4564L37.2232 34.9524L29.5302 31.0159L26.7919 39.2122L23.1285 40.7082L26.8287 29.6338L16.8967 24.5516L20.5601 23.0556L27.7902 26.7549L30.3639 19.052L34.0273 17.556L30.4917 28.1369Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M77.5088 26.3047L101.057 33.7966`,stroke:`white`,strokeWidth:`3`}),(0,W.jsx)(`path`,{d:`M72.2646 42.7871L86.3938 47.2823`,stroke:`white`,strokeWidth:`3`}),(0,W.jsx)(`path`,{d:`M74.8867 34.5469L98.4353 42.0388`,stroke:`white`,strokeWidth:`3`}),(0,W.jsx)(`rect`,{x:`31.583`,y:`38.6641`,width:`44.9157`,height:`44.3666`,rx:`12`,transform:`rotate(-0.134233 31.583 38.6641)`,fill:`#3964FE`}),(0,W.jsx)(`path`,{d:`M38.9521 73.0337C39.6129 71.7086 41.7113 66.0937 43.5113 61.1663C44.1607 59.3885 46.7484 59.3923 47.4591 61.1465C48.9728 64.8828 50.7969 68.6922 51.9988 69.1925C54.2946 70.1482 57.9854 59.3573 68.0064 70.1801`,stroke:`white`,strokeWidth:`3`}),(0,W.jsx)(`circle`,{cx:`60.6157`,cy:`52.247`,r:`4.38794`,transform:`rotate(22.5996 60.6157 52.247)`,fill:`white`})]}),(0,W.jsx)(`defs`,{children:(0,W.jsx)(`clipPath`,{id:`piwDropOverlayClip`,children:(0,W.jsx)(`rect`,{width:`115`,height:`84`,fill:`white`})})})]}),Y_=()=>(0,W.jsxs)(`svg`,{width:`115`,height:`84`,viewBox:`0 0 115 84`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,W.jsx)(`path`,{d:`M29.6829 4.63701L11.0677 12.4368C4.95519 14.998 2.07624 22.0294 4.6374 28.1419L12.2285 46.259C14.7896 52.3715 21.8211 55.2505 27.9336 52.6893L46.5488 44.8895C52.6613 42.3283 55.5403 35.2969 52.9791 29.1844L45.388 11.0673C42.8269 4.9548 35.7954 2.07585 29.6829 4.63701Z`,fill:`#979DA6`}),(0,W.jsx)(`path`,{d:`M30.4915 28.1375L40.8863 33.4569L37.223 34.9529L29.53 31.0165L26.7917 39.2128L23.1283 40.7088L26.8285 29.6344L16.8965 24.5522L20.5599 23.0562L27.79 26.7555L30.3637 19.0526L34.0271 17.5566L30.4915 28.1375Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M107.496 19.2285L81.0381 10.9357C76.8221 9.61423 72.333 11.9607 71.0116 16.1768L60.6844 49.1246C59.363 53.3406 61.7095 57.8297 65.9255 59.1511L92.383 67.4439C96.599 68.7654 101.088 66.4189 102.41 62.2029L112.737 29.255C114.058 25.039 111.712 20.55 107.496 19.2285Z`,fill:`#979DA6`}),(0,W.jsx)(`path`,{d:`M77.5088 26.3047L101.057 33.7967`,stroke:`white`,strokeWidth:`3`}),(0,W.jsx)(`path`,{d:`M72.2646 42.7871L86.3938 47.2823`,stroke:`white`,strokeWidth:`3`}),(0,W.jsx)(`path`,{d:`M74.8867 34.5469L98.4353 42.0388`,stroke:`white`,strokeWidth:`3`}),(0,W.jsx)(`path`,{d:`M66.5798 30.1418L41.481 30.2006C33.5281 30.2193 27.0962 36.6815 27.1148 44.6343L27.172 69.0742C27.1907 77.0271 33.6529 83.459 41.6057 83.4404L66.7045 83.3816C74.6574 83.363 81.0894 76.9008 81.0707 68.9479L81.0135 44.5081C80.9949 36.5552 74.5327 30.1232 66.5798 30.1418Z`,fill:`#F59E0B`}),(0,W.jsx)(`path`,{d:`M54 70.7969C61.732 70.7969 68 64.5289 68 56.7969C68 49.0649 61.732 42.7969 54 42.7969C46.268 42.7969 40 49.0649 40 56.7969C40 64.5289 46.268 70.7969 54 70.7969Z`,stroke:`white`,strokeWidth:`3.5`}),(0,W.jsx)(`path`,{d:`M44 46.7969L64 66.7969`,stroke:`white`,strokeWidth:`3.5`,strokeLinecap:`round`})]}),X_=`[pi-web workspace tab in view] `,Z_=` — The user wrote this while looking at that workspace tab. Read "this", "here" or "current" as its content, and when a tool can act on that content (for example read and patch the open drawing or file), act on it in place instead of creating something new.`;function Q_(e,t){if(!t)return e;let n=$_(t);return[e,`${X_}${JSON.stringify(n)}${Z_}`].filter(Boolean).join(`
34
-
35
- `)}function $_(e){return{title:e.title,kind:e.kind,contentId:e.contentId,...e.plugin?{plugin:e.plugin}:{},...e.detail?{detail:e.detail}:{},...e.reference?{reference:e.reference}:{}}}function ev(e){let t=e.endsWith(Z_)?e.slice(0,-257):e;try{let e=JSON.parse(t);if(typeof e.title!=`string`||typeof e.kind!=`string`||typeof e.contentId!=`string`)return null;for(let t of[`plugin`,`detail`,`reference`])if(e[t]!==void 0&&typeof e[t]!=`string`)return null;return $_(e)}catch{return null}}function tv(e){let t=[],n=e;for(;;){let e=/(^|\n\n)附件 ("(?:\\.|[^"\\])*"):([^\n]+)$/u.exec(n);if(!e||!/[\\/]pi-web[\\/]attachments[\\/][a-f0-9]{64}[\\/]/u.test(e[3]))break;let r;try{r=JSON.parse(e[2])}catch{break}t.unshift({name:r,image:/\.(?:png|jpe?g|webp|gif)$/iu.test(r)}),n=n.slice(0,e.index)}let r=n.lastIndexOf(X_);if(r!==-1&&(r===0||n.slice(r-2,r)===`
36
-
37
- `)&&!n.slice(r).includes(`
38
- `)){let e=ev(n.slice(r+31));if(e)return{text:n.slice(0,Math.max(0,r-2)),attachments:t,context:e}}return{text:n,attachments:t}}var nv=[`tl`,`tc`,`tr`,`bl`,`bc`,`br`],rv={anchor:`bc`,dx:0,dy:0},iv=e=>e[0]===`t`;function av(e){return e<480?Math.max(0,e-24):Math.round(Math.min(640,Math.max(320,e*.46)))}function ov(e,t,n){let r=e[1];return{x:r===`l`?12:r===`r`?t.width-n.width-12:(t.width-n.width)/2,y:iv(e)?12:t.height-n.height-16}}function sv(e,t,n){let r=(e,t,n,r)=>{let i=t-n-r;return i<12?(t-n)/2:Math.min(i,Math.max(12,e))};return{x:Math.round(r(e.x,t.width,n.width,12)),y:Math.round(r(e.y,t.height,n.height,12))}}function cv(e,t,n){let r=ov(e.anchor,t,n);return sv({x:r.x+e.dx,y:r.y+e.dy},t,n)}function lv(e,t,n,r=t.width<480){let i=sv(e,t,n);if(r)return{anchor:i.y+n.height/2<t.height/2?`tc`:`bc`,dx:0,dy:0};let a=`bc`,o=1/0;for(let e of nv){let r=ov(e,t,n),s=Math.hypot(r.x-i.x,r.y-i.y);s<o&&(o=s,a=e)}if(o<=48)return{anchor:a,dx:0,dy:0};let s=ov(a,t,n);return{anchor:a,dx:Math.round(i.x-s.x),dy:Math.round(i.y-s.y)}}function uv(e,t,n,r){let i=cv(e,n,r),a=sv({x:i.x+t.x,y:i.y+t.y},n,r),o=ov(e.anchor,n,r);return{anchor:e.anchor,dx:Math.round(a.x-o.x),dy:Math.round(a.y-o.y)}}function dv(e){let t={placement:rv,collapsed:!1};if(!e)return t;try{let t=JSON.parse(e),n=nv.includes(t.anchor)?t.anchor:null,r=e=>typeof e==`number`&&Number.isFinite(e)?Math.round(e):0;return{placement:n?{anchor:n,dx:r(t.dx),dy:r(t.dy)}:rv,collapsed:t.collapsed===!0}}catch{return t}}function fv(e){return JSON.stringify({...e.placement,collapsed:e.collapsed})}var Q={root:`_root_fcn3p_6`,bar:`_bar_fcn3p_35`,status:`_status_fcn3p_36`,icon:`_icon_fcn3p_37`,"floating-composer-in":`_floating-composer-in_fcn3p_1`,grip:`_grip_fcn3p_69`,form:`_form_fcn3p_101`,line:`_line_fcn3p_119`,editor:`_editor_fcn3p_126`,chip:`_chip_fcn3p_151`,chipIcon:`_chipIcon_fcn3p_176`,chipLabel:`_chipLabel_fcn3p_182`,chipRemove:`_chipRemove_fcn3p_187`,action:`_action_fcn3p_207`,send:`_send_fcn3p_236`,statusLine:`_statusLine_fcn3p_271`,statusLabel:`_statusLabel_fcn3p_279`,statusMeta:`_statusMeta_fcn3p_287`,pulse:`_pulse_fcn3p_294`,"floating-composer-pulse":`_floating-composer-pulse_fcn3p_1`,tail:`_tail_fcn3p_304`,replyHead:`_replyHead_fcn3p_315`,replyTitle:`_replyTitle_fcn3p_323`,replyActions:`_replyActions_fcn3p_329`,replyBody:`_replyBody_fcn3p_343`,replyFoot:`_replyFoot_fcn3p_353`,textButton:`_textButton_fcn3p_359`,summary:`_summary_fcn3p_377`,warn:`_warn_fcn3p_396`,transcript:`_transcript_fcn3p_402`,transcriptHead:`_transcriptHead_fcn3p_408`,transcriptState:`_transcriptState_fcn3p_418`,transcriptBanner:`_transcriptBanner_fcn3p_429`,transcriptBody:`_transcriptBody_fcn3p_435`,"floating-composer-ring":`_floating-composer-ring_fcn3p_1`,badge:`_badge_fcn3p_481`,ghost:`_ghost_fcn3p_497`,"floating-composer-ghost":`_floating-composer-ghost_fcn3p_1`,model:`_model_fcn3p_536`},pv=`pi.floatingComposer.v1`,mv=40,hv=44,gv=120,_v=400;function vv(){try{return dv(localStorage.getItem(pv))}catch{return{placement:rv,collapsed:!1}}}var yv=()=>/Mac|iPhone|iPad/u.test(navigator.platform);function bv(e){if(e.isComposing||e.altKey||e.shiftKey||e.key.toLowerCase()!==`j`)return!1;let t=yv();return(t?!e.metaKey||e.ctrlKey:!e.ctrlKey||e.metaKey)?!1:t||!(e.target instanceof Element&&e.target.closest(`.xterm`))}function xv({host:e,bounds:t,status:n,iconState:r,iconLabel:i,labels:a,focusInput:o,onContentPointerDown:s,children:c}){let[l,u]=(0,B.useState)(vv),[d,f]=(0,B.useState)(null),[p,m]=(0,B.useState)(hv),[h,g]=(0,B.useState)(null),[_,v]=(0,B.useState)(!1),y=(0,B.useRef)(null),b=(0,B.useRef)(null),x=(0,B.useRef)(null),S=(0,B.useRef)(null),C=(0,B.useRef)(null),w=(0,B.useRef)(!1),T=(0,B.useRef)(s);T.current=s;let E=d!==null&&d.height<_v,[D,O]=(0,B.useState)(!1);(0,B.useEffect)(()=>{E||O(!1)},[E]);let k=(0,B.useRef)(E);k.current=E;let A=E?!D:l.collapsed;(0,B.useEffect)(()=>{try{localStorage.setItem(pv,fv(l))}catch{}},[l]),(0,B.useLayoutEffect)(()=>{if(!t){f(null);return}let n=null,r=()=>{n=null;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=t.querySelector(`[data-dockkit-strip]`)?.getBoundingClientRect(),o=a&&a.bottom>i.top&&a.bottom<i.bottom?a.bottom:i.top,s={left:Math.round(i.left-r.left),top:Math.round(o-r.top),width:Math.round(i.width),height:Math.round(i.bottom-o)};f(e=>e&&e.left===s.left&&e.top===s.top&&e.width===s.width&&e.height===s.height?e:s)},i=()=>{n??=requestAnimationFrame(r)};r();let a=new ResizeObserver(i);return a.observe(t),a.observe(e),window.addEventListener(`resize`,i),t.addEventListener(`transitionend`,i),()=>{a.disconnect(),window.removeEventListener(`resize`,i),t.removeEventListener(`transitionend`,i),n!==null&&cancelAnimationFrame(n)}},[e,t]),(0,B.useLayoutEffect)(()=>{let e=y.current;if(!e)return;let t=()=>m(Math.round(e.getBoundingClientRect().height)||(A?mv:hv));t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[A,d!==null]);let ee=(d?.width??0)<480,j=A?mv:av(d?.width??0),M={width:j,height:A?mv:Math.max(p,hv)},N=ee?A?{anchor:`br`,dx:0,dy:0}:{anchor:iv(l.placement.anchor)?`tc`:`bc`,dx:0,dy:0}:l.placement,P=iv(N.anchor),te=d?h??cv(N,d,M):null,F=(0,B.useRef)(M);F.current=M;let I=(0,B.useRef)(d);I.current=d;let L=(0,B.useCallback)(e=>{k.current?O(!e):u(t=>t.collapsed===e?t:{...t,collapsed:e})},[]),ne=(0,B.useCallback)(()=>{let e=x.current;e?.isConnected?e.focus():document.activeElement instanceof HTMLElement&&y.current?.contains(document.activeElement)&&document.activeElement.blur()},[]),R=(0,B.useCallback)(()=>{S.current=y.current?.contains(document.activeElement)?`icon`:null,L(!0)},[L]),re=(0,B.useCallback)(e=>{S.current=e?`input`:null,L(!1)},[L]);(0,B.useEffect)(()=>{let e=S.current;if(!e)return;S.current=null;let t=requestAnimationFrame(()=>{e===`input`?o():e===`icon`?b.current?.focus():ne()});return()=>cancelAnimationFrame(t)},[A,o,ne]),(0,B.useEffect)(()=>{let e=e=>{bv(e)&&(e.preventDefault(),e.stopPropagation(),A?re(!0):y.current?.contains(document.activeElement)?(S.current=`return`,L(!0)):o())};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[A,re,o,L]),(0,B.useEffect)(()=>{if(!t)return;let e=null,n=n=>{n.target instanceof Node&&t.contains(n.target)&&!y.current?.contains(n.target)&&(e=n.pointerId,T.current?.())},r=t=>{if(e!==t.pointerId||t.buttons===0)return;let n=y.current?.getBoundingClientRect();n&&t.clientX>=n.left&&t.clientX<=n.right&&t.clientY>=n.top&&t.clientY<=n.bottom&&v(!0)},i=t=>{e===t.pointerId&&(e=null,v(!1))};return document.addEventListener(`pointerdown`,n,!0),document.addEventListener(`pointermove`,r,{capture:!0,passive:!0}),document.addEventListener(`pointerup`,i,!0),document.addEventListener(`pointercancel`,i,!0),()=>{document.removeEventListener(`pointerdown`,n,!0),document.removeEventListener(`pointermove`,r,!0),document.removeEventListener(`pointerup`,i,!0),document.removeEventListener(`pointercancel`,i,!0)}},[t]);let ie=!P&&!E&&d&&te&&d.height-(te.y+M.height)<=gv?M.height+16:0,z=ee?ie:0,ae=ee?0:ie;(0,B.useEffect)(()=>{if(!t)return;let e=(e,n)=>{n?t.style.setProperty(e,`${n}px`):t.style.removeProperty(e)};return e(`--pi-floating-composer-inset`,z),e(`--pi-floating-composer-overlap`,ae),()=>{t.style.removeProperty(`--pi-floating-composer-inset`),t.style.removeProperty(`--pi-floating-composer-overlap`)}},[t,z,ae]),(0,B.useEffect)(()=>{if(t&&!A)return t.setAttribute(`data-floating-composer-open`,``),()=>t.removeAttribute(`data-floating-composer-open`)},[t,A]);let oe=(e,t)=>{e.button===0&&te&&!C.current&&(e.currentTarget.setPointerCapture(e.pointerId),C.current={id:e.pointerId,origin:{x:e.clientX,y:e.clientY},start:te,moved:!1,target:t},t===`grip`&&e.preventDefault())},se=e=>{let t=C.current,n=I.current;if(!t||t.id!==e.pointerId||!n)return;let r=e.clientX-t.origin.x,i=e.clientY-t.origin.y;!t.moved&&Math.hypot(r,i)<4||(t.moved=!0,g(sv({x:t.start.x+(ee?0:r),y:t.start.y+i},n,F.current)))},ce=(e,t)=>{let n=C.current;if(!n||n.id!==e.pointerId)return;C.current=null;let r=I.current;if(n.moved&&r&&!t){let t=lv(sv({x:n.start.x+(ee?0:e.clientX-n.origin.x),y:n.start.y+e.clientY-n.origin.y},r,F.current),r,F.current);u(e=>({...e,placement:t}))}w.current=n.moved,g(null)},le=()=>u(e=>({...e,placement:rv})),V=e=>{let t=I.current;if(!t)return;if(e.key===`Home`){e.preventDefault(),le();return}let n=e.shiftKey?64:16,r={ArrowLeft:{x:-n,y:0},ArrowRight:{x:n,y:0},ArrowUp:{x:0,y:-n},ArrowDown:{x:0,y:n}}[e.key];r&&(e.preventDefault(),ee?r.y&&u(e=>({...e,placement:{anchor:r.y<0?`tc`:`bc`,dx:0,dy:0}})):u(e=>({...e,placement:uv(e.placement,r,t,F.current)})))};if(!d||!te||d.width<=0||d.height<=0)return null;let H=h?lv(h,d,M):null,ue=H&&H.dx===0&&H.dy===0?ov(H.anchor,d,M):null,de=h||P?{left:d.left+te.x,top:d.top+te.y,width:j}:{left:d.left+te.x,bottom:`calc(100% - ${d.top+te.y+M.height}px)`,width:j};return(0,_t.createPortal)((0,W.jsxs)(W.Fragment,{children:[ue&&(0,W.jsx)(`div`,{className:Q.ghost,"aria-hidden":`true`,"data-floating-snap-target":!0,style:{left:d.left+ue.x,top:d.top+ue.y,width:M.width,height:M.height}}),(0,W.jsx)(`section`,{ref:y,className:Q.root,style:de,"data-floating-composer":A?`collapsed`:`expanded`,"data-edge":P?`top`:`bottom`,"data-dragging":h?``:void 0,"data-passthrough":_||void 0,"data-narrow":ee||void 0,"aria-label":a.region,onFocus:e=>{e.relatedTarget instanceof HTMLElement&&y.current?.contains(e.relatedTarget)||(x.current=e.relatedTarget instanceof HTMLElement?e.relatedTarget:null)},children:A?(0,W.jsxs)(`button`,{ref:b,type:`button`,className:Q.icon,"data-state":r,"aria-label":i,title:i,"aria-expanded":!1,onPointerDown:e=>oe(e,`icon`),onPointerMove:se,onPointerUp:e=>ce(e,!1),onPointerCancel:e=>ce(e,!0),onClick:()=>{w.current?w.current=!1:re(!0)},children:[(0,W.jsx)(Fe,{size:18}),r!==`idle`&&r!==`offline`&&(0,W.jsx)(`span`,{className:Q.badge,"aria-hidden":`true`})]}):(0,W.jsxs)(W.Fragment,{children:[n&&(0,W.jsx)(`div`,{className:Q.status,"data-floating-status":!0,children:n}),(0,W.jsxs)(`div`,{className:Q.bar,children:[(0,W.jsx)(`button`,{type:`button`,className:Q.grip,"aria-label":a.grip,title:a.snapHint,onPointerDown:e=>oe(e,`grip`),onPointerMove:se,onPointerUp:e=>ce(e,!1),onPointerCancel:e=>ce(e,!0),onDoubleClick:le,onKeyDown:V,children:(0,W.jsx)(`svg`,{viewBox:`0 0 8 14`,width:`8`,height:`14`,"aria-hidden":`true`,children:[2,7,12].flatMap(e=>[2,6].map(t=>(0,W.jsx)(`circle`,{cx:t,cy:e,r:`1.1`,fill:`currentColor`},`${t}-${e}`)))})}),c({collapse:R,releaseFocus:ne})]})]})})]}),e)}var Sv={keys:`_keys_38b9q_1`,key:`_key_38b9q_1`,tooltip:`_tooltip_38b9q_20`,separator:`_separator_38b9q_30`,joined:`_joined_38b9q_32`};function Cv({keys:e,variant:t=`plain`,className:n}){return(0,W.jsx)(`span`,{className:F(Sv.keys,t===`tooltip`&&Sv.tooltip,t===`tooltip`&&e.includes(`+`)&&Sv.joined,n),children:e.map((e,t)=>(0,W.jsx)(`kbd`,{className:e===`+`?Sv.separator:Sv.key,children:e},t))})}var wv={bubble:`_bubble_ugtpz_1`,"tooltip-in":`_tooltip-in_ugtpz_1`,label:`_label_ugtpz_26`},Tv={pointer:`pointer`,keyboard:`keyboard`},Ev=`data-input-modality`,Dv=new Set([`Tab`,`Home`,`End`,`PageUp`,`PageDown`]),Ov=!1,kv=!1,Av;function jv(){document.documentElement.setAttribute(Ev,kv?Tv.pointer:Tv.keyboard)}function Mv(){return Ov}typeof window<`u`&&(window.addEventListener(`pointerdown`,()=>{Ov=!0,kv=!0,Av=void 0,jv()},!0),window.addEventListener(`keydown`,e=>{typeof e.key==`string`&&(Ov=!1,e.isComposing?Av=void 0:(Av=e.composedPath()[0],(Dv.has(e.key)||e.key.startsWith(`Arrow`))&&(kv=!1,jv())))},!0),window.addEventListener(`focusin`,e=>{Av!==void 0&&e.composedPath()[0]!==Av&&(Av=void 0,kv&&(kv=!1,jv()))},!0),window.addEventListener(`blur`,()=>{Av=void 0}));var Nv=(0,B.createContext)(null);function Pv({label:e,shortcutKeys:t,side:n=`right`,align:r=`center`,delayMs:i=0,gap:a=8,disabled:o=!1,portal:s=!1,maxWidth:c,children:l}){let u=(0,B.useRef)(null),d=l.props.ref,f=(0,B.useCallback)(e=>{u.current=e,typeof d==`function`?d(e):d!=null&&(d.current=e)},[d]),[p,m]=(0,B.useState)(null),h=(0,B.useRef)(null),g=p===null?null:typeof e==`function`?e():e,_=p===null?0:n===`right`?p.top+(p.bottom-p.top)/2:n===`top`?p.top-a:p.bottom+a,v=(0,B.useRef)(null),y=(0,B.useRef)({hover:!1,focus:!1}),b=(0,B.useContext)(Nv),[x,S]=(0,B.useState)(!1),C=(0,B.useCallback)(e=>{b?.(e)},[b]),w=p!==null&&!o;(0,B.useEffect)(()=>{let e=h.current;if(p===null||!w||x||e===null)return;let t,i=n,o=()=>{if(t===void 0)return;let{inlineSize:o,blockSize:s}=t,c=n===`right`?0:r===`end`?o:o/2,l=Math.max(12,Math.min(p.x-c,window.innerWidth-12-o)),u=p.bottom+a+s<=window.innerHeight-12,d=p.top-a-s>=12;i===`bottom`&&!u&&d?i=`top`:i===`top`&&!d&&u&&(i=`bottom`),e.style.left=`${l+c}px`,e.style.top=`${i===`right`?(p.top+p.bottom)/2:i===`top`?p.top-a:p.bottom+a}px`,e.dataset.side=i,e.style.visibility=`visible`},s=new ResizeObserver(e=>{t=e[0]?.borderBoxSize[0],o()});return s.observe(e,{box:`border-box`}),window.addEventListener(`resize`,o),()=>{s.disconnect(),window.removeEventListener(`resize`,o)}},[r,a,p,n,x,w]),(0,B.useEffect)(()=>(C(w),()=>{C(!1)}),[C,w]);let T=(0,B.useCallback)(()=>{v.current!==null&&(clearTimeout(v.current),v.current=null)},[]);(0,B.useEffect)(()=>(o&&(T(),y.current={hover:!1,focus:!1},m(null)),T),[T,o]);let E=()=>{if(o)return;let e=u.current;if(e===null)return;let t=e.getBoundingClientRect();m({x:n===`right`?t.right+10:r===`end`?t.right:t.left+t.width/2,top:t.top,bottom:t.bottom}),C(!0)},D=()=>{T(),i<=0?E():v.current=setTimeout(()=>{v.current=null,E()},i)},O=()=>{m(null),C(!1)},k=()=>{T(),!y.current.hover&&!y.current.focus&&O()},A=w&&!x&&(0,W.jsxs)(`span`,{ref:h,className:wv.bubble,"data-side":n,"data-portal":s||void 0,"data-align":r,"data-has-shortcut":t?.length?!0:void 0,style:{left:p.x,top:_,visibility:`hidden`,...c===void 0?{}:{maxWidth:c}},role:`tooltip`,"aria-label":t?.length?[g,t.join(` `)].filter(Boolean).join(` `):void 0,children:[g&&(0,W.jsx)(`span`,{className:wv.label,children:g}),t!==void 0&&t.length>0&&(0,W.jsx)(Cv,{keys:t,variant:`tooltip`})]});return(0,W.jsxs)(Nv.Provider,{value:S,children:[(0,B.cloneElement)(l,{ref:f,onMouseEnter:e=>{l.props.onMouseEnter?.(e),y.current.hover=!0,D()},onMouseLeave:e=>{l.props.onMouseLeave?.(e),y.current.hover=!1,T(),O()},onClick:e=>{l.props.onClick?.(e),y.current.focus=!1,T(),O()},onFocus:e=>{l.props.onFocus?.(e),Mv()||(y.current.focus=!0,T(),E())},onBlur:e=>{l.props.onBlur?.(e),y.current.focus=!1,k()}}),s?A!==!1&&(0,_t.createPortal)(A,document.body):A]})}var Fv={dock:`_dock_1dh5u_3`,panel:`_panel_1dh5u_11`,header:`_header_1dh5u_40`,lead:`_lead_1dh5u_57`,chevron:`_chevron_1dh5u_57`,count:`_count_1dh5u_58`,list:`_list_1dh5u_59`,row:`_row_1dh5u_60`,content:`_content_1dh5u_61`,actions:`_actions_1dh5u_62`,action:`_action_1dh5u_62`,editor:`_editor_1dh5u_67`,status:`_status_1dh5u_69`,error:`_error_1dh5u_70`,kind:`_kind_1dh5u_79`,preview:`_preview_1dh5u_80`,attachments:`_attachments_1dh5u_81`,file:`_file_1dh5u_83`,paused:`_paused_1dh5u_86`};function Iv({session:e,connected:t,onUpdate:n}){let[r,i]=(0,B.useState)(!0),[o,s]=(0,B.useState)(null),[c,l]=(0,B.useState)(null),[f,m]=(0,B.useState)(``);At(`prompt-queue`,f);let h=(0,B.useRef)(!1),_=(0,B.useId)(),v=(0,B.useRef)(null),y=(0,B.useRef)(null);(0,B.useLayoutEffect)(()=>{if(y.current&&o===null&&c===null){let e=document.activeElement;(!e||e===document.body||v.current?.contains(e))&&v.current?.querySelector(`[data-prompt-id="${CSS.escape(y.current)}"] [data-edit-prompt]`)?.focus(),y.current=null}},[o,c,e?.queuedPrompts]);let S=[...(e?.promptQueue?.steering??[]).map((e,t)=>({id:`steer-${t}`,label:U(`引导`,`Steer`),...tv(e)})),...(e?.promptQueue?.followUp??[]).map((e,t)=>({id:`native-${t}`,label:U(`排队`,`Queue`),...tv(e)})),...(e?.queuedPrompts??[]).map(e=>({id:e.id,label:U(`排队`,`Queue`),text:e.text,attachments:e.attachments,item:e}))];if((0,B.useEffect)(()=>{S.length===0&&i(!0),o&&!S.some(e=>e.id===o.id&&e.item?.status===`queued`)&&s(null)},[S.length,o,e?.queuedPrompts]),!S.length&&!e?.hasPendingPrompts)return null;let C=S.length===1||!r||o!==null||c!==null,T=U(`${S.length} 条待处理提示词`,`${S.length} pending prompts`),E=e=>{y.current=e},D=async(e,r)=>{if(h.current||!t)return!1;h.current=!0,l(e.id),m(``);try{return await n(e.id,e.revision,r),!0}catch(e){return m(e instanceof Error?e.message:U(`队列操作失败`,`Queue action failed`)),!1}finally{h.current=!1,l(null)}},O=async()=>{if(!o)return;let e=o;await D(e,{kind:`edit`,text:e.text})&&(s(null),E(e.id))},k=(e,t,n,r,i=!1)=>(0,W.jsx)(Pv,{portal:!0,label:e,side:`top`,delayMs:500,disabled:t,children:(0,W.jsx)(`button`,{className:Fv.action,type:`button`,"aria-label":e,disabled:t,onClick:n,"data-edit-prompt":i||void 0,children:r})});return(0,W.jsx)(`section`,{className:Fv.dock,"aria-label":U(`待处理提示词`,`Pending prompts`),"data-queue-dock":``,children:(0,W.jsxs)(`div`,{className:Fv.panel,children:[S.length>1&&(0,W.jsxs)(`button`,{type:`button`,className:Fv.header,"aria-label":T,"aria-controls":_,"aria-expanded":C,disabled:o!==null||c!==null,onClick:()=>i(e=>!e),children:[(0,W.jsx)(`span`,{className:Fv.lead,"aria-hidden":!0,children:(0,W.jsx)(d,{})}),(0,W.jsx)(`span`,{className:Fv.count,role:`status`,children:T}),!C&&S.some(e=>e.item?.status===`sending`)&&(0,W.jsx)(`span`,{className:Fv.status,children:U(`发送中…`,`Sending…`)}),(0,W.jsx)(`span`,{className:Fv.chevron,"aria-hidden":!0,children:C?(0,W.jsx)(g,{}):(0,W.jsx)(u,{})})]}),S.length===0&&(0,W.jsxs)(`div`,{className:Fv.header,children:[(0,W.jsx)(`span`,{className:Fv.lead,"aria-hidden":!0,children:(0,W.jsx)(d,{})}),(0,W.jsx)(`span`,{className:Fv.count,role:`status`,children:U(`等待 Pi 接收`,`Waiting for Pi`)})]}),(0,W.jsx)(`ol`,{ref:v,id:_,className:Fv.list,hidden:!C,children:S.map(n=>{let r=n.item,i=!t||c!==null||r?.status===`sending`;return(0,W.jsxs)(`li`,{className:Fv.row,"data-prompt-id":n.id,children:[S.length===1&&(0,W.jsx)(`span`,{className:Fv.lead,"aria-hidden":!0,children:(0,W.jsx)(d,{})}),(0,W.jsx)(`span`,{className:Fv.kind,children:n.label}),(0,W.jsxs)(`div`,{className:Fv.content,children:[n.attachments.length>0&&(0,W.jsx)(`span`,{className:Fv.attachments,children:n.attachments.map((e,t)=>(0,W.jsxs)(`span`,{className:Fv.file,title:e.name,children:[(0,W.jsx)(re,{path:e.name}),(0,W.jsx)(`span`,{children:e.name})]},t))}),o?.id===n.id?(0,W.jsx)(`textarea`,{className:Fv.editor,autoFocus:!0,rows:2,maxLength:32e3,"aria-label":U(`编辑排队提示词`,`Edit queued prompt`),value:o.text,disabled:c!==null,onChange:e=>s({...o,text:e.target.value}),onKeyDown:e=>{e.nativeEvent.isComposing||e.keyCode===229||(e.key===`Escape`&&(e.preventDefault(),s(null),E(n.id)),e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),O()))}}):n.text&&(0,W.jsx)(`span`,{className:Fv.preview,title:n.text,children:n.text}),r?.error&&(0,W.jsx)(`span`,{className:Fv.error,role:`alert`,children:r.error})]}),r?.status===`sending`&&(0,W.jsx)(`span`,{className:Fv.status,role:`status`,children:U(`发送中…`,`Sending…`)}),r&&(0,W.jsx)(`div`,{className:Fv.actions,children:o?.id===n.id?(0,W.jsxs)(W.Fragment,{children:[k(U(`保存修改`,`Save changes`),i||!o.text.trim()&&n.attachments.length===0,()=>{O()},(0,W.jsx)(b,{})),k(U(`取消编辑`,`Cancel edit`),c!==null,()=>{s(null),E(n.id)},(0,W.jsx)(x,{}))]}):(0,W.jsxs)(W.Fragment,{children:[k(U(`编辑`,`Edit`),i,()=>{s({id:r.id,revision:r.revision,text:r.text}),m(``)},(0,W.jsx)(p,{}),!0),k(U(`删除`,`Delete`),i,()=>{D(r,{kind:`remove`})},(0,W.jsx)(a,{})),k(U(`发送(引导)`,`Send (steer)`),i||!!e?.idle||!!e?.interactions?.length,()=>{D(r,{kind:`steer`})},(0,W.jsx)(w,{}))]})})]},n.id)})}),e?.paused&&(0,W.jsx)(`div`,{className:Fv.paused,role:`status`,children:U(`已暂停,继续后处理`,`Paused; processed on resume`)})]})})}var Lv={controls:`_controls_1d60f_1`,action:`_action_1d60f_2`};function Rv({hasDraft:e,canSend:t,canStop:n,pauseLabel:r,pauseTitle:a,pauseIcon:o,onStop:s}){let l=e=>e.preventDefault(),u=(0,W.jsx)(Pv,{label:a??r,side:`top`,delayMs:500,disabled:!n,children:(0,W.jsx)(`button`,{className:e?Lv.action:Ut.primary,type:`button`,"aria-label":r,disabled:!n,onMouseDown:l,onClick:s,children:o??(0,W.jsx)(c,{size:16})})});return(0,W.jsxs)(`div`,{className:Lv.controls,role:`group`,"aria-label":U(`追加提示词`,`Append prompt`),children:[u,e&&(0,W.jsx)(Pv,{label:U(`当前任务完成后排队处理`,`Queue after the current task finishes`),shortcutKeys:[`Enter`],side:`top`,delayMs:500,disabled:!t,children:(0,W.jsx)(`button`,{className:Ut.primary,type:`submit`,"aria-label":U(`发送消息`,`Send message`),disabled:!t,onMouseDown:l,children:(0,W.jsx)(i,{size:16})})})]})}function zv(e,t,n){let r=(0,B.useRef)(null),i=(0,B.useRef)(null),a=(0,B.useRef)(null),o=(0,B.useRef)(!0),s=(0,B.useRef)(0),[c,l]=(0,B.useState)(!1),u=(0,B.useCallback)(()=>{let e=r.current;e&&(e.scrollTop=e.scrollHeight,s.current=e.scrollTop,l(!1))},[]),d=(0,B.useCallback)(()=>{o.current=!0,u()},[u]),f=(0,B.useCallback)(()=>{let e=r.current;if(!e)return;let t=e.scrollHeight-e.clientHeight-e.scrollTop;e.scrollTop<s.current-1?o.current=!1:t<=24&&(o.current=!0),s.current=e.scrollTop,l(!o.current&&t>1)},[]),p=(0,B.useCallback)(e=>{e.deltaY<0&&(o.current=!1)},[]);return(0,B.useLayoutEffect)(()=>{if(o.current=!0,l(!1),!t)return;u();let e=new ResizeObserver(()=>{let e=r.current;e&&(e.style.setProperty(`--piw-composer-height`,`${a.current?.getBoundingClientRect().height??152}px`),o.current?u():l(e.scrollHeight-e.clientHeight-e.scrollTop>1))});for(let t of[r.current,i.current,a.current])t&&e.observe(t);return()=>e.disconnect()},[e,t,u]),(0,B.useLayoutEffect)(()=>{t&&n&&d()},[t,n,d]),(0,B.useLayoutEffect)(()=>{t&&o.current&&u()}),{scroll:r,content:i,composer:a,onScroll:f,onWheel:p,showLatest:t&&c,returnToLatest:d}}var Bv=e=>typeof e==`string`&&e.trim()?e.trim():void 0;function Vv(e){let t=e.trim(),n=/^(?:(\d{3})\s*)?(\{[\s\S]*\})$/.exec(t),r=t,i=n?.[1]?Number(n[1]):void 0,a,o;if(n)try{let e=JSON.parse(n[2]),s=e.error&&typeof e.error==`object`?e.error:void 0;r=Bv(s?.message)??Bv(e.error)??Bv(e.message)??Bv(e.detail)??t,a=Bv(s?.type)??Bv(s?.code)??(e.type===`error`?void 0:Bv(e.type)),o=Bv(e.request_id)??Bv(s?.request_id),i===void 0&&typeof e.status==`number`&&(i=e.status)}catch{}return{message:r,status:i,type:a,requestId:o,usageLimit:/usage limit has been reached/i.test(t),raw:t}}var Hv=(0,B.memo)(function({block:e,result:t,running:n,cwd:r,onInspect:i}){_e();let a=e.toolCallId;return(0,W.jsx)(Jn,{block:e,result:t,running:n,cwd:r,onInspect:a&&i?()=>i(a):void 0})});function Uv({message:e,results:t,loadImage:n,running:r=!1,onInspect:i,cwd:a}){if(e.role===`tool`&&e.toolCallId&&t.has(e.toolCallId))return null;if(e.role===`notice`&&e.subagentNotice)return(0,W.jsx)(`div`,{className:`pi-subagent-notice`,"data-message-role":`notice`,children:lr(e.subagentNotice)});if(e.role===`user`){let t=tv(e.blocks.filter(e=>e.kind===`text`).map(e=>e.text).join(`
39
- `)),r=e.localFiles?{...t,attachments:e.localFiles.map(e=>({name:e.name,image:/\.(?:png|jpe?g|webp|gif)$/iu.test(e.name)||/^image\/(?:png|jpeg|webp|gif)$/.test(e.type)}))}:t,i=e.blocks.map((e,t)=>({block:e,index:t})).filter(({block:e})=>e.kind===`image`),a=r.attachments.filter(e=>e.image),o=e.localFiles?.filter(e=>/\.(?:png|jpe?g|webp|gif)$/iu.test(e.name)||/^image\/(?:png|jpeg|webp|gif)$/.test(e.type));return(0,W.jsx)(`div`,{className:Gt.userRow,"data-message-role":`user`,children:(0,W.jsxs)(`div`,{className:Gt.userStack,children:[(i.length>0||r.attachments.some(e=>!e.image))&&(0,W.jsxs)(`div`,{className:Gt.attachmentRow,"data-message-attachments":!0,children:[i.map(({index:t},s)=>(0,W.jsx)(Ir,{name:a[s]?.name??o?.[s]?.name??U(`图片`,`Image`),messageId:e.id,index:t,file:o?.[s],tile:i.length>1||r.attachments.length>i.length,loadImage:n},t)),r.attachments.filter(e=>!e.image).map((e,t)=>(0,W.jsxs)(`span`,{className:Gt.fileCard,title:e.name,children:[(0,W.jsx)(re,{path:e.name,className:Gt.fileIcon}),(0,W.jsxs)(`span`,{className:Gt.fileContent,children:[(0,W.jsx)(`span`,{className:Gt.fileName,children:e.name}),(0,W.jsxs)(`span`,{className:Gt.fileMeta,children:[ie(e.name).toUpperCase(),` `,U(`文件`,`file`)]})]})]},`${e.name}-${t}`))]}),r.text&&(0,W.jsx)(`div`,{className:Gt.bubble,children:r.text}),r.context&&(0,W.jsxs)(`div`,{className:`pi-message-context`,"data-message-context":!0,title:U(`发送时正在查看的工作区标签页`,`Workspace tab in view when this was sent`),children:[(0,W.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:`12`,height:`12`,"aria-hidden":`true`,children:[(0,W.jsx)(`rect`,{x:`2`,y:`3`,width:`12`,height:`10`,rx:`2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`}),(0,W.jsx)(`path`,{d:`M2 6h12`,stroke:`currentColor`,strokeWidth:`1.3`})]}),(0,W.jsx)(`span`,{children:U(`来自 ${r.context.detail??r.context.title}`,`From ${r.context.detail??r.context.title}`)})]})]})})}return(0,W.jsx)(`div`,{className:`pi-message`,"data-message-role":e.role,children:e.blocks.map((e,n)=>e.kind===`thinking`?(0,W.jsx)(en,{text:e.text,running:r},n):e.kind===`toolCall`?(0,W.jsx)(Hv,{block:e,result:e.toolCallId?t.get(e.toolCallId):void 0,running:r,cwd:a,onInspect:i},e.toolCallId||n):e.kind===`image`?(0,W.jsx)(`div`,{className:`pi-image-note`,children:e.text},n):(0,W.jsx)(Xt,{text:e.text,streaming:r},n))})}function Wv({error:e,onDismiss:t}){let[n,r]=(0,B.useState)(!1),i=Vv(e),a=[i.status&&`HTTP ${i.status}`,i.type].filter(Boolean).join(` · `);return(0,W.jsxs)(`div`,{className:`pi-model-error`,role:`alert`,children:[(0,W.jsxs)(`div`,{className:`pi-model-error-title`,children:[(0,W.jsx)(`strong`,{children:U(`模型请求失败`,`Model request failed`)}),a&&(0,W.jsx)(`span`,{className:`pi-model-error-meta`,children:a}),(0,W.jsx)(`button`,{type:`button`,className:`pi-error-dismiss`,"aria-label":U(`关闭错误`,`Dismiss error`),onClick:t,children:`×`})]}),(0,W.jsx)(`p`,{className:`pi-model-error-message`,children:i.usageLimit?U(`模型服务的使用额度已耗尽。请切换模型或等待额度恢复后重试。`,`The model service usage limit has been reached. Switch models or try again after the limit resets.`):i.message}),(0,W.jsxs)(`div`,{className:`pi-model-error-footer`,children:[i.requestId&&(0,W.jsx)(`span`,{className:`pi-model-error-request`,title:U(`请求 ID`,`Request ID`),children:i.requestId}),(0,W.jsx)(`button`,{type:`button`,className:`pi-model-error-copy`,onClick:()=>{navigator.clipboard?.writeText(i.raw).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},children:n?U(`已复制`,`Copied`):U(`复制详情`,`Copy details`)})]})]})}function Gv({turn:e,results:t,model:n,loadImage:r,onInspect:i,renderPluginSlot:a,renderToolView:o,artifactTools:s,viewTools:c,running:l=!1,cwd:u,superseded:d=!1}){let f=[...e.messages].reverse().find(e=>e.role===`assistant`&&e.blocks.some(e=>e.kind===`text`&&e.text.trim())),p=f?.blocks.filter(e=>e.kind===`text`)??[],m=[];for(let t of e.messages)t.role===`assistant`&&t.blocks.forEach((e,n)=>{t===f&&e.kind===`text`||e.kind===`toolCall`&&(c.includes(e.toolName??``)||s.includes(e.toolName??``))||m.push({message:t,block:e,index:n})});let[h,g]=(0,B.useState)(!1),_=m.filter(({block:e})=>e.kind===`toolCall`).length,v=new Set(m.filter(({block:e})=>e.kind!==`toolCall`).map(({message:e})=>e.id)).size,y=p.map(e=>e.text).join(`
40
- `),b=l||h,[x,S]=(0,B.useState)(new Set),C=e.messages.filter(e=>e.role===`assistant`&&e.error),w=[...e.messages].reverse().find(e=>e.role===`assistant`),T=d||w&&!w.error&&w.id!==C.at(-1)?.id?[]:C.filter(e=>!x.has(e.id));return(0,W.jsxs)(`div`,{className:`pi-turn`,"data-turn":e.index,children:[e.messages.filter(e=>e.role===`user`||e.role===`notice`).map(e=>(0,W.jsx)(Uv,{message:e,results:t,loadImage:r},e.id)),m.length>0&&(0,W.jsxs)(W.Fragment,{children:[p.length>0&&(0,W.jsx)(Yn,{toolCount:_,messageCount:v,open:b,onToggle:()=>g(e=>!e)}),(b||p.length===0)&&(0,W.jsx)(`div`,{className:`pi-turn-process-content`,children:m.map(({message:e,block:n,index:a})=>(0,W.jsx)(Uv,{message:{...e,blocks:[n]},results:t,loadImage:r,running:e.id===`stream`,cwd:u,onInspect:i},`${e.id}-${a}`))})]}),nr(e.messages,c).map(({key:e,call:n})=>(0,W.jsx)(`div`,{"data-tool-view":n.toolName,children:o?.(n,n.toolCallId?t.get(n.toolCallId):void 0,l&&!t.has(n.toolCallId??``))},e)),p.length>0&&f&&(0,W.jsx)(Uv,{message:{...f,blocks:p},results:t,loadImage:r,running:f.id===`stream`}),e.messages.filter(e=>e.role===`tool`&&(!e.toolCallId||!t.has(e.toolCallId))).map(e=>(0,W.jsx)(Uv,{message:e,results:t,loadImage:r},e.id)),T.map(e=>(0,W.jsx)(Wv,{error:e.error,onDismiss:()=>S(t=>new Set(t).add(e.id))},`${e.id}-error`)),!l&&T.length===0&&(f||e.usage&&e.usage.totalTokens>0)&&(0,W.jsx)(Qn,{text:y,timestamp:f?.timestamp,usage:e.usage,model:f?.model??n}),a(`turn.tail`,{id:e.id,completed:!l,messageIds:e.messages.map(e=>e.id),toolCallIds:e.messages.flatMap(e=>e.blocks.filter(e=>e.kind===`toolCall`&&e.toolCallId).map(e=>e.toolCallId))})]})}function Kv({hero:e,suspended:t=!1,floating:n=null,floatingStatus:r,renderTranscript:i,latestTurnHasCard:a=!1,interaction:o,session:s,connection:c,onSend:l,onUpload:u,onDiscardAttachment:d,onStop:f,onResume:p,onCompact:m,onNewSession:h,commands:g,models:_,modelsStatus:v,onConfigureModels:y,onSetModel:b,onSetThinkingLevel:x,onUpdateQueuedPrompt:S,renderPluginSlot:C,plugins:w,onPluginAction:T}){let E=_e(),D=s?.sessionId??``,[O,k]=(0,B.useState)({}),A=O[D],j=A?.text??``,M=A?.attachments??[],N=A?.error??``,P=e=>{k(t=>({...t,[D]:e(t[D]??{text:``,attachments:[],error:``})}))},te=e=>P(t=>({...t,text:e})),F=e=>P(t=>({...t,attachments:typeof e==`function`?e(t.attachments):e})),I=e=>P(t=>({...t,error:e}));(0,B.useEffect)(()=>{N?Et({key:`composer-error`,message:N}):kt(`composer-error`)},[N]);let L=(0,B.useRef)(O);L.current=O;let[ne,R]=(0,B.useState)(!1),[ie,z]=(0,B.useState)(null),[ae,oe]=(0,B.useState)(0),[se,ce]=(0,B.useState)(0),[le,V]=(0,B.useState)(!1),H=(0,B.useRef)(0),ue=(0,B.useRef)(null),de=(0,B.useRef)(new Map),fe=(0,B.useRef)(new Set),pe=(0,B.useRef)(null),me=(0,B.useRef)(null),he=(0,B.useRef)(s?.sessionId);he.current=s?.sessionId;let ge=(0,B.useRef)(!1),ve=(0,B.useRef)(t);(0,B.useEffect)(()=>{ve.current&&!t&&me.current?.focus(),ve.current=t},[t]);let ye=c===`connected`&&s!==null,be=ye&&v===`ready`&&_.length===0,xe=ye&&_.some(e=>`${e.provider}/${e.id}`===s.model),Se=ye&&!s.idle,Ce=ye&&!ne&&!t,we=Ce&&!Se,Te=M.length===0&&[`/compact`,`/new`,`/model`].includes(j.trim()),Ee=(0,B.useMemo)(()=>F_(W_(),g,w,E),[g,w,E]),De=L_(j,Ee),Oe=De?.command.pluginId?De.command:void 0,ke=De?.command.input?`${De.token}${/\s$/.test(j)||De.text?` `:``}`:null,Ae=De?.command.input&&!De.text?P_(De.command.input.hint,E)??null:null,je=Ce&&!s?.interactions?.length&&!(Se&&j.trimStart().startsWith(`/`))&&(v===`ready`&&xe||!Se&&(Te||!!Oe))&&(j.trim().length>0||M.length>0)&&M.every(e=>e.status===`ready`)&&(!Oe||M.length===0||Oe.input?.attachments===!0),Me=z_(w,s,E,j,M.length),Ne=Me?.icon,Pe=we&&(Me?.kind===`resume`||Me?.kind===`invoke`)&&(Me.kind===`invoke`&&!Me.sendResultMessage||v===`ready`&&xe),Fe=Se&&!ne&&!t,Ie=ie===`slash`?j.slice(1).toLowerCase():``,Le=ie===null?[]:R_(Se?Ee.filter(e=>!e.pluginId&&e.name===`file`):Ee,Ie,ie===`slash`),Re=n!==null,ze=j.trim().length>0||M.length>0,[Be,Ve]=(0,B.useState)(null),[He,Ue]=(0,B.useState)(!1),We=(0,B.useRef)(ze);(0,B.useEffect)(()=>{We.current&&!ze?(Ve(null),Ue(!1)):ze&&!Be&&n?.context&&Ve(n.context),We.current=ze},[ze,n?.context,Be]),(0,B.useEffect)(()=>{Ve(null),Ue(!1)},[D]);let Ge=n===null||He?null:ze&&Be?((e,t)=>!!e&&!!t&&e.kind===t.kind&&e.contentId===t.contentId&&e.title===t.title)(Be,n.context)?n.context:Be:n.context,Ke=Ge?Ge.detail??Ge.title:``,[Je,Ye]=(0,B.useState)(!1),[Xe,Ze]=(0,B.useState)(null),Qe=(0,B.useRef)(Se),$e=(0,B.useRef)(!1);(0,B.useEffect)(()=>{Qe.current&&!Se&&Re&&(a?($e.current=!0,Ze(null),Ye(!0)):!Je&&r.latestReply&&Ze({id:r.latestReply.id,compact:!1})),Qe.current=Se},[Se,Re,Je,a,r.latestReply]);let et=(0,B.useRef)(null),tt=(0,B.useRef)(!0),nt=(0,B.useCallback)(()=>{let e=et.current;if(!e)return;let t=$e.current?[...e.querySelectorAll(`[data-tool-view]`)].at(-1):void 0;if(t){tt.current=!1;let n=e.getBoundingClientRect();e.scrollTop=t.getBoundingClientRect().bottom-n.top+e.scrollTop-n.height+12}else tt.current&&(e.scrollTop=e.scrollHeight)},[]);(0,B.useLayoutEffect)(nt),(0,B.useEffect)(()=>{let e=et.current?.firstElementChild;if(!Je||!e)return;let t=new ResizeObserver(nt);t.observe(e);let n=window.setTimeout(()=>{$e.current=!1},8e3);return()=>{t.disconnect(),window.clearTimeout(n)}},[Je,nt]),(0,B.useEffect)(()=>{Re||(Ze(null),Ye(!1))},[Re,D]);let rt=e=>{tt.current=!0,Ye(e),e&&Ze(null)},it=t||!!s?.interactions?.length,at=(0,B.useRef)(null),ot=(0,B.useRef)(Re),st=(0,B.useRef)(!1);ot.current!==Re&&(st.current=!!pe.current?.contains(document.activeElement),ot.current=Re),(0,B.useEffect)(()=>{if(!st.current)return;st.current=!1;let e=requestAnimationFrame(()=>me.current?.focus());return()=>cancelAnimationFrame(e)},[Re]);let ct=e=>{n?.onShowConversation(),e&&requestAnimationFrame(e)};(0,B.useEffect)(()=>{z(null)},[s?.sessionId,Se]),(0,B.useEffect)(()=>()=>{for(let e of Object.values(L.current))for(let t of e.attachments)fe.current.add(t.key),t.receipt&&t.discard(t.receipt.id).catch(()=>{});for(let e of de.current.values())e.abort();de.current.clear()},[]),(0,B.useEffect)(()=>{if(ie===null)return;let e=e=>{e.target instanceof Node&&!pe.current?.contains(e.target)&&z(null)};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[ie]);let lt=async e=>{if(Ce&&(we||!e.pluginId&&e.name===`file`)){if(ie===`slash`&&[`file`,`model`,`compact`,`new`].includes(e.name)&&te(``),z(null),!e.pluginId&&e.name===`file`)ue.current?.click();else if(e.pluginId&&e.action&&e.menuOnly){R(!0);try{await T(e.pluginId,e.action,{args:[]}),I(``)}catch(e){I(e instanceof Error?e.message:String(e))}finally{R(!1)}}else if(!e.pluginId&&e.name===`model`)ce(e=>e+1);else if(!e.pluginId&&(e.name===`compact`||e.name===`new`)){R(!0);try{await(e.name===`compact`?m():h())}catch{}finally{R(!1)}}else te(`/${P_(e.input?.token,E)??e.name} `),me.current?.focus()}},ut=(0,B.useCallback)((e,t)=>{let n=new AbortController;de.current.set(e,n),u(t,n.signal).then(t=>{fe.current.has(e)?d(t.id).catch(()=>{}):F(n=>n.map(n=>n.key===e?{...n,status:`ready`,receipt:t,error:void 0}:n))}).catch(t=>{if(fe.current.has(e))return;let n=t instanceof Error?t.message:U(`上传失败`,`Upload failed`);I(n),F(t=>t.map(t=>t.key===e?{...t,status:`error`,error:n}:t))}).finally(()=>{de.current.get(e)===n&&de.current.delete(e)})},[u,d,D]),dt=(0,B.useRef)(D);(0,B.useEffect)(()=>{let e=dt.current;if(e===D)return;dt.current=D;let t=L.current[e];for(let e of t?.attachments??[])fe.current.add(e.key),de.current.get(e.key)?.abort();let n=L.current[D],r=(n?.attachments??[]).map(e=>({key:ee(),file:e.file,discard:d,status:`uploading`}));k(i=>({...i,...t?{[e]:{...t,attachments:t.attachments.map(e=>({...e,receipt:void 0,status:`error`}))}}:{},...n?{[D]:{...n,attachments:r,error:``}}:{}})),r.forEach(e=>ut(e.key,e.file))},[D]);let ft=e=>{fe.current.add(e.key),de.current.get(e.key)?.abort(),e.receipt&&e.discard(e.receipt.id).catch(()=>{}),e.status===`error`&&!M.some(t=>t.key!==e.key&&t.status===`error`)&&I(``),F(t=>t.filter(t=>t.key!==e.key))},pt=(0,B.useCallback)(e=>{if(!Ce||e.length===0)return;let t=Math.max(0,20-M.length),n=e.slice(0,t).filter(e=>e.size>0&&e.size<=20971520);n.length===e.length?I(``):I(U(`最多添加 20 个文件,单个文件不得超过 20 MB 且不能为空`,`Add up to 20 nonempty files, each no larger than 20 MB`));let r=n.map(e=>({key:ee(),file:e,discard:d,status:`uploading`}));F(e=>[...e,...r]),r.forEach(e=>ut(e.key,e.file))},[M.length,Ce,ut,d]);(0,B.useEffect)(()=>{if(Re)return;let e=e=>e.dataTransfer?.types.includes(`Files`)??!1,t=()=>{H.current=0,V(!1)},n=t=>{e(t)&&(t.preventDefault(),H.current++,V(!0))},r=t=>{e(t)&&(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect=Ce?`copy`:`none`))},i=t=>{e(t)&&(H.current=Math.max(0,H.current-1),H.current===0&&V(!1))},a=n=>{if(!e(n))return;n.preventDefault();let r=[...n.dataTransfer?.files??[]];t(),pt(r)};return document.addEventListener(`dragenter`,n),document.addEventListener(`dragover`,r),document.addEventListener(`dragleave`,i),document.addEventListener(`drop`,a),window.addEventListener(`dragend`,t),()=>{document.removeEventListener(`dragenter`,n),document.removeEventListener(`dragover`,r),document.removeEventListener(`dragleave`,i),document.removeEventListener(`drop`,a),window.removeEventListener(`dragend`,t)}},[Ce,pt,Re]);let mt=async(e=Se?`followUp`:void 0)=>{if(!je||ge.current)return;ge.current=!0,R(!0);let t=j.trim(),n=M;Te||(te(``),F([]));try{if(Te)t===`/model`?ce(e=>e+1):await(t===`/compact`?m():h()),te(``);else if(Oe?.pluginId&&Oe.action&&De){I(``);let e=await T(Oe.pluginId,Oe.action,{args:De.text.split(/\s+/).filter(Boolean),text:De.text,attachments:n.map(e=>e.receipt.id)});typeof e?.message==`string`&&e.message?await l(e.message,n.map(e=>e.receipt.id),n.map(e=>e.file)):n.length&&(F(n),I(U(`指令未发送附件,文件仍保留在输入框`,`The command did not send the files; they remain in the composer`))),te(``)}else Ze(null),await l(t,n.map(e=>e.receipt.id),n.map(e=>e.file),e,Ge)}catch{Te||(te(t),F(n))}finally{ge.current=!1,R(!1)}},ht=async()=>{if(Fe&&!ge.current){ge.current=!0,R(!0);try{await f()}catch{}finally{ge.current=!1,R(!1)}}},gt=async()=>{if(Pe&&Me&&!ge.current){ge.current=!0,R(!0),I(``);try{await B_(Me,T,e=>l(e,[],[]),f,()=>he.current,p)}catch(e){Me.kind!==`resume`&&he.current===Me.sessionId&&I(e instanceof Error?e.message:String(e))}finally{ge.current=!1,R(!1)}}},_t=ie!==null&&(0,W.jsx)(G_,{commands:Le,active:ae,grouped:!Ie,onHover:oe,onPick:e=>{lt(e)}}),vt=(0,W.jsx)(`input`,{ref:ue,className:`pi-file-input`,type:`file`,multiple:!0,tabIndex:-1,"aria-label":U(`选择要上传的文件`,`Choose files to upload`),onChange:e=>{pt([...e.target.files??[]]),e.target.value=``}}),yt=M.length>0&&(0,W.jsx)(`div`,{className:`pi-attachment-rail`,role:`group`,"aria-label":U(`待发送附件`,`Pending attachments`),children:M.map(e=>(0,W.jsx)(Nr,{file:e.file,status:e.status,error:e.error,onRemove:()=>ft(e),onRetry:()=>{I(``),F(t=>t.map(t=>t.key===e.key?{...t,status:`uploading`,error:void 0}:t)),ut(e.key,e.file)}},e.key))}),bt=(0,W.jsx)(N_,{ref:me,value:j,claimToken:ke,hint:Ae,editable:ye&&!ne&&!t,placeholder:ye&&!be&&v===`ready`&&xe&&Re?Ge?U(`询问 Pi 关于「${Ke}」…`,`Ask Pi about ${Ke}…`):U(`询问 Pi…`,`Ask Pi…`):be?U(`先连接模型,再开始对话`,`Connect a model to start chatting`):ye&&v===`ready`&&!xe?U(`先选择模型,再开始对话`,`Choose a model to start chatting`):ye?s&&w.map(e=>e.definition.composerPlaceholder?.(s,E)).find(Boolean)||U(`给 Pi 发送消息`,`Message Pi`):U(`打开 Pi 中 /web 给出的完整地址`,`Open the full address provided by /web in Pi`),ariaLabel:U(`给当前 Pi 会话发送消息`,`Send a message to the current Pi session`),menuOpen:ie!==null,activeOption:ie!==null&&Le[ae]?`pi-command-${ae}`:void 0,onChange:e=>{te(e),we&&/^\/[^\s]*$/.test(e)?(z(`slash`),oe(0)):ie===`slash`&&z(null)},onPaste:e=>{let t=[...e.clipboardData.files];t.length&&(e.preventDefault(),pt(t))},onKeyDown:e=>{if(!(e.nativeEvent.isComposing||e.keyCode===229)){if(ie!==null){if(e.key===`Escape`){e.preventDefault(),z(null);return}if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),oe(t=>(t+(e.key===`ArrowDown`?1:-1)+Le.length)%Math.max(Le.length,1));return}if((e.key===`Enter`||e.key===`Tab`)&&Le[ae]){e.preventDefault(),lt(Le[ae]);return}}e.key===`Escape`&&Re?(e.preventDefault(),at.current?.releaseFocus()):e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),mt(Se&&(e.ctrlKey||e.metaKey)?`steer`:Se?`followUp`:void 0))}}}),xt=Se?(0,W.jsx)(Rv,{hasDraft:j.trim().length>0||M.length>0,canSend:je,canStop:Fe,pauseLabel:Me?.label??U(`暂停执行`,`Pause`),pauseTitle:Me?.title,pauseIcon:Ne?(0,W.jsx)(Ne,{size:16}):void 0,onStop:()=>{ht()}}):Me?.kind===`invoke`||Me?.kind===`resume`?(0,W.jsx)(`button`,{className:Ut.primary,type:`button`,"aria-label":Me.label,title:Me.title,disabled:!Pe,onClick:()=>{gt()},children:Ne?(0,W.jsx)(Ne,{size:16}):(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`M5 2.5 13 8l-8 5.5z`,fill:`currentColor`})})}):(0,W.jsx)(`button`,{className:Ut.primary,type:`submit`,"aria-label":U(`发送消息`,`Send message`),disabled:!je,children:(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`M8.3125 0.980183C8.66767 1.0531 8.97902 1.20418 9.2627 1.43233C9.48724 1.61297 9.73029 1.85793 9.97949 2.10714L14.707 6.83468L13.293 8.24874L9 3.95577V15.0417H7V3.95577L2.70703 8.24874L1.29297 6.83468L6.02051 2.10714C6.26971 1.85793 6.51277 1.61297 6.7373 1.43233C6.97662 1.23986 7.28445 1.04402 7.6875 0.980183C7.8973 0.947006 8.1031 0.95516 8.3125 0.980183Z`,fill:`currentColor`})})}),St=be?(0,W.jsx)(`button`,{className:`pi-model-setup-trigger`,type:`button`,onClick:y,children:U(`配置模型`,`Set up a model`)}):(0,W.jsx)(Er,{compact:Re,openSignal:se,current:s?.model??null,models:_,disabled:!ye||!s?.idle,onSelect:b,thinkingLevel:s?.thinkingLevel??null,thinkingLevels:s?.thinkingLevels??[],onSelectThinkingLevel:x}),Ct=Se&&j.trimStart().startsWith(`/`)&&(0,W.jsx)(`div`,{className:`pi-prompt-hint`,children:U(`运行中不执行斜杠指令,请等待当前回复结束`,`Wait for the current reply before running slash commands`)});if(n){let e=r.latestReply,t=Xe&&e?.id===Xe.id?e.text:null,a=ye?it?`input`:Se?`running`:t?`unread`:N?`error`:`idle`:`offline`,s={offline:U(`Pi 未连接`,`Pi is disconnected`),input:U(`Pi 需要你的输入`,`Pi needs your input`),running:U(`Pi 正在处理`,`Pi is working`),unread:U(`Pi 已回复`,`Pi replied`),error:U(`发送遇到问题`,`Something went wrong`),idle:U(`询问 Pi`,`Ask Pi`)}[a]+` · ${/Mac|iPhone|iPad/u.test(navigator.platform)?`⌘J`:`Ctrl+J`}`,c=(0,W.jsxs)(`div`,{className:Q.statusLine,children:[(0,W.jsx)(`span`,{className:Q.pulse,"aria-hidden":`true`}),(0,W.jsx)(`span`,{className:Q.statusLabel,role:`status`,"aria-live":`polite`,children:r.label}),(0,W.jsxs)(`span`,{className:Q.statusMeta,"aria-hidden":`true`,children:[tn(r.elapsedSeconds),r.queued>0?` · ${U(`排队 ${r.queued}`,`+${r.queued} queued`)}`:``]})]}),l=(0,W.jsxs)(`div`,{className:Q.statusLine,children:[(0,W.jsxs)(`svg`,{className:Q.warn,viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:[(0,W.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`}),(0,W.jsx)(`path`,{d:`M8 4.5v4.2M8 10.8v.7`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})]}),(0,W.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:Q.replyTitle,children:U(`Pi 需要你的输入`,`Pi needs your input`)}),(0,W.jsx)(`span`,{className:Q.replyActions,children:(0,W.jsx)(`button`,{type:`button`,className:Q.textButton,onClick:()=>ct(),children:U(`去回答`,`Answer`)})})]}),u=(0,W.jsx)(`button`,{type:`button`,className:Q.action,"aria-label":U(`在完整对话中打开`,`Open the full chat`),title:U(`在完整对话中打开`,`Open the full chat`),onClick:()=>{Ze(null),ct()},children:(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`M9.5 2.5h4v4M13.5 2.5 8 8M6.5 3.5h-2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),d=Je?(0,W.jsxs)(`div`,{className:Q.transcript,"data-floating-transcript":!0,children:[(0,W.jsxs)(`div`,{className:Q.transcriptHead,children:[(0,W.jsx)(`span`,{className:Q.replyTitle,children:U(`对话`,`Conversation`)}),Se&&!it&&(0,W.jsxs)(`span`,{className:Q.transcriptState,children:[(0,W.jsx)(`span`,{className:Q.pulse,"aria-hidden":`true`}),(0,W.jsx)(`span`,{role:`status`,"aria-live":`polite`,children:r.label})]}),(0,W.jsxs)(`span`,{className:Q.replyActions,children:[u,(0,W.jsx)(`button`,{type:`button`,className:Q.action,"aria-label":U(`收起对话`,`Hide conversation`),title:U(`收起对话`,`Hide conversation`),"aria-expanded":!0,onClick:()=>rt(!1),children:(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`m4 6 4 4 4-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]})]}),it&&(0,W.jsx)(`div`,{className:Q.transcriptBanner,"data-floating-interaction":!0,children:o??l}),(0,W.jsx)(`div`,{ref:et,className:Q.transcriptBody,"data-floating-transcript-body":!0,onWheel:()=>{$e.current=!1},onPointerDown:()=>{$e.current=!1},onKeyDown:()=>{$e.current=!1},onScroll:e=>{if($e.current)return;let t=e.currentTarget;tt.current=t.scrollHeight-t.scrollTop-t.clientHeight<24},children:i?.()??null})]}):it?o?(0,W.jsx)(`div`,{"data-floating-interaction":!0,children:o}):l:Se?(0,W.jsxs)(W.Fragment,{children:[c,r.tail&&(0,W.jsx)(`div`,{className:Q.tail,children:r.tail})]}):t!==null&&Xe?Xe.compact?(0,W.jsxs)(`button`,{type:`button`,className:Q.summary,onClick:()=>Ze({...Xe,compact:!1}),children:[(0,W.jsx)(`span`,{role:`status`,"aria-live":`polite`,children:U(`Pi 已回复`,`Pi replied`)}),(0,W.jsx)(`span`,{children:U(`查看`,`View`)})]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:Q.replyHead,children:[(0,W.jsx)(`span`,{className:Q.replyTitle,role:`status`,"aria-live":`polite`,children:U(`Pi 已回复`,`Pi replied`)}),(0,W.jsxs)(`span`,{className:Q.replyActions,children:[(0,W.jsx)(`button`,{type:`button`,className:Q.action,"aria-label":U(`复制回复`,`Copy reply`),title:U(`复制回复`,`Copy reply`),onClick:()=>{navigator.clipboard?.writeText(t).catch(()=>{})},children:(0,W.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:[(0,W.jsx)(`rect`,{x:`5`,y:`5`,width:`8.5`,height:`8.5`,rx:`2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`}),(0,W.jsx)(`path`,{d:`M3.5 10.5h-.2A1.3 1.3 0 0 1 2 9.2V3.3A1.3 1.3 0 0 1 3.3 2h5.9a1.3 1.3 0 0 1 1.3 1.3v.2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`})]})}),u,(0,W.jsx)(`button`,{type:`button`,className:Q.action,"aria-label":U(`关闭回复`,`Dismiss reply`),title:U(`关闭回复`,`Dismiss reply`),onClick:()=>Ze(null),children:(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`m4 4 8 8M12 4l-8 8`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinecap:`round`})})})]})]}),(0,W.jsx)(`div`,{className:Q.replyBody,children:(0,W.jsx)(Xt,{text:t,streaming:!1})}),(0,W.jsx)(`div`,{className:Q.replyFoot,children:(0,W.jsx)(`button`,{type:`button`,className:Q.textButton,onClick:()=>rt(!0),children:U(`展开对话`,`Show conversation`)})})]}):null,f=e=>e.dataTransfer.types.includes(`Files`);return(0,W.jsx)(xv,{host:n.host,bounds:n.panel,status:ie===null?d:null,iconState:a,iconLabel:s,labels:{region:U(`询问 Pi`,`Ask Pi`),grip:U(`移动输入框:方向键移动,Home 复位`,`Move composer: arrow keys move, Home resets`),snapHint:U(`拖动以移动,双击复位`,`Drag to move, double-click to reset`)},focusInput:()=>me.current?.focus(),onContentPointerDown:()=>Ze(e=>e&&!e.compact?{...e,compact:!0}:e),children:e=>(at.current=e,(0,W.jsxs)(`form`,{ref:pe,className:Q.form,"data-composer-card":!0,"data-floating-form":!0,onSubmit:e=>{e.preventDefault(),mt()},onDragOver:e=>{f(e)&&(e.preventDefault(),e.dataTransfer.dropEffect=Ce?`copy`:`none`)},onDrop:e=>{f(e)&&(e.preventDefault(),pt([...e.dataTransfer.files]))},children:[_t,vt,yt,(0,W.jsxs)(`div`,{className:Q.line,children:[Ge&&(0,W.jsxs)(`span`,{className:Q.chip,"data-pinned":ze||void 0,"data-floating-context":!0,title:ze?U(`本条消息会附带「${Ge.title} · ${Ke}」`,`This message is about ${Ge.title} · ${Ke}`):U(`当前标签页:${Ge.title}`,`Tab in view: ${Ge.title}`),children:[Ge.kind===`files`||Ge.kind===`file-preview`?(0,W.jsx)(re,{...Ge.detail?{path:Ge.detail.split(` · `)[0]}:{kind:`folder`},size:14,className:Q.chipIcon}):(0,W.jsxs)(`svg`,{className:Q.chipIcon,viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:[(0,W.jsx)(`rect`,{x:`2`,y:`3`,width:`12`,height:`10`,rx:`2.2`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`}),(0,W.jsx)(`path`,{d:`M2 6.2h12`,stroke:`currentColor`,strokeWidth:`1.3`})]}),(0,W.jsx)(`span`,{className:Q.chipLabel,children:Ke}),(0,W.jsx)(`button`,{type:`button`,className:Q.chipRemove,"aria-label":U(`不附带标签页上下文`,`Remove tab context`),onClick:()=>{Ue(!0),me.current?.focus()},children:(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`10`,height:`10`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`m4 4 8 8M12 4l-8 8`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`})})})]}),(0,W.jsx)(`div`,{className:Q.editor,children:bt}),(0,W.jsx)(`span`,{className:Q.model,"data-floating-model":!0,children:St}),(0,W.jsx)(`button`,{className:Q.action,type:`button`,"data-active":Je||void 0,"aria-expanded":Je,"aria-label":Je?U(`收起对话`,`Hide conversation`):U(`展开对话`,`Show conversation`),title:Je?U(`收起对话`,`Hide conversation`):U(`展开对话`,`Show conversation`),onMouseDown:e=>e.preventDefault(),onClick:()=>rt(!Je),children:(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`M3 4.6A1.6 1.6 0 0 1 4.6 3h6.8A1.6 1.6 0 0 1 13 4.6v4.8A1.6 1.6 0 0 1 11.4 11H7.2L4.4 13.2V11h0A1.6 1.6 0 0 1 3 9.4z`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinejoin:`round`})})}),(0,W.jsx)(`button`,{className:Q.action,type:`button`,"aria-label":U(`添加指令`,`Add command`),title:U(`添加指令`,`Add command`),"aria-haspopup":`listbox`,"aria-expanded":ie!==null,disabled:!Ce,onMouseDown:e=>e.preventDefault(),onClick:()=>{z(ie===null?`button`:null),oe(0),me.current?.focus()},children:(0,W.jsx)(qe,{size:16})}),(0,W.jsx)(`button`,{className:Q.action,type:`button`,"aria-label":U(`收起输入框`,`Collapse composer`),title:U(`收起输入框`,`Collapse composer`),onMouseDown:e=>e.preventDefault(),onClick:e.collapse,children:(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`m4 6 4 4 4-4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),(0,W.jsx)(`span`,{className:Q.send,children:xt})]}),Ct]}))})}return(0,W.jsxs)(`div`,{hidden:t,className:`${Ut.root} ${e?Ut.hero:``} ${t?Ut.suspended:``}`,children:[le&&(0,W.jsx)(q_,{disabled:!Ce,labels:{title:Ce?U(`松开以上传文件`,`Drop to upload files`):U(`当前无法上传文件`,`Files cannot be uploaded now`),desc:Ce?U(`最多 20 个文件,每个不超过 20 MB`,`Up to 20 files, 20 MB each`):void 0}}),(0,W.jsx)(Iv,{session:s,onUpdate:S,connected:ye},s?.sessionId),(0,W.jsxs)(`form`,{ref:pe,className:Ut.card,"data-composer-card":!0,onSubmit:e=>{e.preventDefault(),mt()},children:[_t,vt,yt,bt,(0,W.jsxs)(`div`,{className:Ut.row,children:[(0,W.jsxs)(`div`,{className:Ut.tools,children:[(0,W.jsx)(`button`,{className:Ut.add,type:`button`,"aria-label":U(`添加指令`,`Add command`),title:U(`添加指令`,`Add command`),"aria-haspopup":`listbox`,"aria-expanded":ie!==null,disabled:!Ce,onMouseDown:e=>e.preventDefault(),onClick:()=>{z(ie===null?`button`:null),oe(0),me.current?.focus()},children:(0,W.jsx)(qe,{size:16})}),C(`composer.controls`)]}),(0,W.jsxs)(`div`,{className:Ut.trailing,children:[St,xt]})]}),Ct]})]})}function qv(e,t,n,r,i){let a=t?.blocks.at(-1),o=n&&!t?U(`正在发送`,`Sending`):a?.kind===`toolCall`?U(`正在运行 ${a.toolName??`工具`}`,`Running ${a.toolName??`a tool`}`):a?.kind===`thinking`?U(`正在思考`,`Thinking`):a?.kind===`text`&&a.text.trim()?U(`正在回复`,`Writing a reply`):U(`正在处理`,`Working`),s=t?.blocks.filter(e=>e.kind===`text`).map(e=>e.text).join(`
41
- `).trim()??``,c=s.length>240?`…${s.slice(-240)}`:s,l=(e?.promptQueue?.steering.length??0)+(e?.promptQueue?.followUp.length??0)+(e?.queuedPrompts?.length??0),u=null;for(let t of[...e?.messages??[]].reverse()){if(t.role===`user`)break;if(t.role!==`assistant`)continue;let e=t.blocks.filter(e=>e.kind===`text`).map(e=>e.text).join(`
42
-
43
- `).trim();if(e){u={id:t.id,text:e};break}}return{working:r,label:o,elapsedSeconds:i,tail:c,queued:l,latestReply:u}}function Jv({floating:e=null,rightbarControl:t,composerInteraction:n,session:r,streaming:i,connection:a,error:o,onDismissError:s,onSend:c,onLoadImage:l,onUpload:u,onDiscardAttachment:d,onStop:f,onResume:p,onCompact:m,onNewSession:h,commands:g,models:_,modelsStatus:v,onConfigureModels:y,onSetModel:b,onSetThinkingLevel:x,onUpdateQueuedPrompt:S,renderPluginSlot:C,renderToolView:w,plugins:T,onPluginAction:E}){let[D,O]=(0,B.useState)(`chat`),[k,A]=(0,B.useState)(null),[j,M]=(0,B.useState)(null),N=j&&r?.sessionId===j.sessionId&&r.messages.some(e=>e.role===`user`&&!j.knownIds.has(e.id)&&tv(e.blocks.filter(e=>e.kind===`text`).map(e=>e.text).join(`
44
- `)).text===j.text);(0,B.useEffect)(()=>{j&&(N||r&&r.sessionId!==j.sessionId)&&M(null)},[j,N,r?.sessionId]);let P=j&&!N&&r?.sessionId===j.sessionId?{id:j.id,role:`user`,timestamp:j.timestamp,blocks:[{kind:`text`,text:j.wire},...j.files.filter(e=>/\.(?:png|jpe?g|webp|gif)$/iu.test(e.name)||/^image\/(?:png|jpeg|webp|gif)$/.test(e.type)).map(()=>({kind:`image`,text:``}))],localFiles:j.files}:null,te=on(r,i,a,P!==null),F=an(r,i,a,P!==null),I=sn(F,r?.sessionId,r?.activityId),L=P!==null,ne=(0,B.useMemo)(()=>qv(r,i,L,F,I),[r,i,L,F,I]),R=(0,B.useMemo)(()=>T.flatMap(e=>e.definition.workbench?.toolViews?.flatMap(e=>e.tools)??[]),[T]),re=(0,B.useMemo)(()=>T.flatMap(e=>e.definition.artifactTools??[]),[T]),ie=(0,B.useCallback)(e=>{A(e),O(`trajectory`)},[]),z=cr(r?.sessionId,[...r?.messages??[],...P?[P]:[],...i?[i]:[]],R),ae=r===null||z.messages.length===0&&te===null,oe=(0,B.useRef)(s);oe.current=s,(0,B.useEffect)(()=>{if(!o)return;let e=Vv(o);Et({key:`conversation-error`,message:e.message,detail:e.raw===e.message?void 0:e.raw,detailLabel:U(`诊断信息`,`Diagnostics`)}),oe.current()},[o]);let se=(0,B.useRef)(z.retry);se.current=z.retry,(0,B.useEffect)(()=>{z.error?Et({key:`transcript-cleanup`,message:z.error,action:{label:U(`重试视图清理`,`Retry view cleanup`),onClick:()=>se.current()}}):kt(`transcript-cleanup`)},[z.error]);let ce=async(e,t,n,i,a)=>{if(!r)return;let o=Q_(e,a);if(i){await c(o,t,i);return}let s=`pending-${ee()}`;M({id:s,sessionId:r.sessionId,text:e,wire:o,files:n,knownIds:new Set(r.messages.map(e=>e.id)),timestamp:new Date().toISOString()});try{await c(o,t)}catch(e){throw M(e=>e?.id===s?null:e),e}},le=(0,B.useRef)(null),{scroll:V,content:H,composer:ue,onScroll:de,onWheel:fe,showLatest:pe,returnToLatest:me}=zv(r?.sessionId,!ae&&D===`chat`,P?.id),[he,ge]=(0,B.useState)(0);(0,B.useLayoutEffect)(()=>{let e=le.current;if(!e)return;let t=()=>ge(e.getBoundingClientRect().width);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let _e=r?.cwd.split(/[\\/]/).filter(Boolean).at(-1)||U(`Pi 工作区`,`Pi workspace`),ve=z.messages,ye=ar(ve),be=tr(ve),xe=()=>{let e=be.slice(-20);return e.length===0&&!te?(0,W.jsx)(`p`,{className:`pi-floating-transcript-empty`,children:U(`还没有对话。`,`No messages yet.`)}):(0,W.jsxs)(`div`,{className:`pi-floating-transcript`,children:[e.map(e=>(0,W.jsx)(Gv,{turn:e,results:ye,model:r?.model??null,loadImage:l,cwd:r?.cwd,renderPluginSlot:C,renderToolView:w,viewTools:R,artifactTools:re,running:e===be.at(-1)&&!r?.idle||e.messages.some(e=>e.id===`stream`),superseded:e!==be.at(-1),onInspect:ie},rr(e,R))),te&&(0,W.jsx)(rn,{state:te,elapsedSeconds:I})]})},Se=nr(be.at(-1)?.messages??[],R).some(({call:e})=>or(e.toolCallId?ye.get(e.toolCallId):void 0));return(0,W.jsxs)(`div`,{ref:le,className:Ht.root,"data-phase":ae?`hero`:`active`,style:{"--piw-conversation-column-width":`${he}px`},children:[ae&&(0,W.jsx)(`div`,{className:Ht.heroTools,children:t}),r&&!ae&&(0,W.jsxs)(`header`,{className:Ht.header,children:[(0,W.jsxs)(`div`,{className:Ht.titleRow,children:[(0,W.jsx)(`div`,{className:Ht.titleCluster,children:(0,W.jsx)(`div`,{className:Ht.crumbs,children:(0,W.jsx)(`span`,{className:`${Ht.crumb} ${Ht.crumbCurrent}`,children:r.name||U(`新会话`,`New chat`)})})}),(0,W.jsxs)(`div`,{className:Ht.headerActions,children:[t,(0,W.jsx)(Be,{state:a===`connected`?r.idle?`done`:`ongoing`:`error`}),(0,W.jsx)(`span`,{className:`pi-header-state`,children:a===`connected`?r.idle?U(`已连接`,`Connected`):U(`运行中`,`Running`):U(`已断开`,`Disconnected`)})]})]}),(0,W.jsxs)(`div`,{className:Ht.tabs,role:`tablist`,"aria-label":U(`会话视图`,`Session views`),children:[(0,W.jsx)(`button`,{className:`${Ht.tab} ${D===`chat`?Ht.tabActive:``}`,role:`tab`,"aria-selected":D===`chat`,type:`button`,onClick:()=>O(`chat`),children:U(`对话`,`Chat`)}),(0,W.jsx)(`button`,{className:`${Ht.tab} ${D===`trajectory`?Ht.tabActive:``}`,role:`tab`,"aria-selected":D===`trajectory`,type:`button`,onClick:()=>O(`trajectory`),children:U(`轨迹`,`Trajectory`)})]})]}),(0,W.jsx)(`div`,{className:Ht.body,children:(0,W.jsxs)(`div`,{ref:V,className:Ht.scrollBody,"data-conversation-scroll":``,onScroll:de,onWheel:fe,children:[!ae&&(0,W.jsx)(`div`,{ref:H,className:Ht.viewArea,children:D===`chat`?(0,W.jsx)(`div`,{className:Wt.root,children:(0,W.jsx)(`div`,{className:Wt.scroll,children:(0,W.jsx)(`div`,{className:Wt.column,children:(0,W.jsxs)(W.Fragment,{children:[be.map(e=>(0,W.jsx)(Gv,{turn:e,results:ye,model:r?.model??null,loadImage:l,cwd:r?.cwd,renderPluginSlot:C,renderToolView:w,viewTools:R,artifactTools:re,running:e===be.at(-1)&&!r?.idle||e.messages.some(e=>e.id===`stream`),superseded:e!==be.at(-1),onInspect:ie},rr(e,R))),te&&(0,W.jsx)(rn,{state:te,elapsedSeconds:I})]})})})}):(0,W.jsx)(wr,{messages:ve,inspectCallId:k})}),(0,W.jsx)(`div`,{ref:ue,className:Ht.composerSeat,"data-composer-seat":``,children:(0,W.jsxs)(`div`,{className:`${Ht.composerStack} ${ae?Ht.composerHero:``}`,children:[ae&&(0,W.jsx)(Vt,{t:e=>({"hero.headline":U(`有什么可以帮你?`,`How can I help?`),"hero.preview":`Pi`})[e]??e,renderSlot:(e,t,n)=>n?.fallback??null}),ae&&(0,W.jsx)(`div`,{className:Ht.heroWorkspaceRow,children:(0,W.jsxs)(`span`,{className:Bt.workspace,children:[(0,W.jsx)(st,{size:16}),(0,W.jsx)(`span`,{className:Bt.workspaceLabel,children:_e})]})}),!e&&n,(0,W.jsx)(Kv,{interaction:e?n:void 0,floating:e,floatingStatus:ne,renderTranscript:xe,latestTurnHasCard:Se,suspended:n!=null,hero:ae,session:r,connection:a,onSend:ce,onUpdateQueuedPrompt:S,onUpload:u,onDiscardAttachment:d,onStop:f,onResume:p,onCompact:m,onNewSession:h,commands:g,models:_,modelsStatus:v,onConfigureModels:y,onSetModel:b,onSetThinkingLevel:x,renderPluginSlot:C,plugins:T,onPluginAction:E})]})}),pe&&(0,W.jsx)(`div`,{className:Wt.toBottomSlot,children:(0,W.jsx)(`button`,{className:Wt.toBottom,type:`button`,"aria-label":U(`回到最新`,`Back to latest`),title:U(`回到最新并继续跟随`,`Back to latest and resume following`),onClick:me,children:(0,W.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`M8 2v12m-5-5 5 5 5-5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})})})]})})]})}var Yv={button:`_button_cfgyt_4`,md:`_md_cfgyt_24`,sm:`_sm_cfgyt_30`,primary:`_primary_cfgyt_38`,ghost:`_ghost_cfgyt_47`,outline:`_outline_cfgyt_56`,toolbar:`_toolbar_cfgyt_65`,icon:`_icon_cfgyt_73`};function Xv({variant:e=`ghost`,size:t=`md`,icon:n,className:r,children:i,...a}){return(0,W.jsxs)(`button`,{type:`button`,className:F(Yv.button,Yv[e],Yv[t],r),...a,children:[n!=null&&(0,W.jsx)(`span`,{className:Yv.icon,children:n}),i]})}var Zv={root:`_root_w1urq_2`,mask:`_mask_w1urq_14`,dialog:`_dialog_w1urq_22`,content:`_content_w1urq_37`,header:`_header_w1urq_45`,title:`_title_w1urq_53`,close:`_close_w1urq_61`,description:`_description_w1urq_80`,body:`_body_w1urq_89`,footer:`_footer_w1urq_97`};function Qv({open:e,onClose:t,title:n,closeLabel:r,description:i,children:a,footer:o,className:s,contentClassName:c,headless:l=!1}){let u=(0,B.useRef)(null);return Ee(u,e,t),e?(0,_t.createPortal)((0,W.jsx)(R.Provider,{value:u,children:(0,W.jsxs)(`div`,{className:Zv.root,role:`presentation`,children:[(0,W.jsx)(`div`,{className:Zv.mask,"aria-hidden":`true`,onClick:t}),(0,W.jsx)(`div`,{ref:u,tabIndex:-1,className:F(Zv.dialog,s),role:`dialog`,"aria-modal":`true`,"aria-label":n,children:l?a:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:F(Zv.content,c),children:[(0,W.jsxs)(`div`,{className:Zv.header,children:[(0,W.jsx)(`h2`,{className:Zv.title,children:n}),(0,W.jsx)(`button`,{type:`button`,className:Zv.close,"aria-label":r,onClick:t,children:(0,W.jsx)(Ze,{size:14})})]}),i!==void 0&&i!==``&&(0,W.jsx)(`p`,{className:Zv.description,children:i}),a!==void 0&&(0,W.jsx)(`div`,{className:Zv.body,children:a})]}),o!==void 0&&(0,W.jsx)(`div`,{className:Zv.footer,children:o})]})})]})}),document.body):null}var $v={group:`_group_1ybj6_4`,workspaceLine:`_workspaceLine_1ybj6_5`,workspaceButton:`_workspaceButton_1ybj6_7`,workspaceTitle:`_workspaceTitle_1ybj6_8`,folder:`_folder_1ybj6_9`,folderActive:`_folderActive_1ybj6_10`,unavailable:`_unavailable_1ybj6_11`,chevron:`_chevron_1ybj6_12`,chevronOpen:`_chevronOpen_1ybj6_13`,rowActions:`_rowActions_1ybj6_16`,rowAction:`_rowAction_1ybj6_16`,sessionButton:`_sessionButton_1ybj6_23`,sessionLine:`_sessionLine_1ybj6_24`,sessionTime:`_sessionTime_1ybj6_27`,untitled:`_untitled_1ybj6_31`,renameInput:`_renameInput_1ybj6_32`,menu:`_menu_1ybj6_38`,menuItem:`_menuItem_1ybj6_39`,menuItemNeutral:`_menuItemNeutral_1ybj6_41`,menuHint:`_menuHint_1ybj6_43`};function ey({title:e,active:t,disabled:n,open:r,onOpenChange:i,onRemove:a}){return(0,W.jsx)(ny,{label:U(`${e} 的工作区操作`,`Workspace actions for ${e}`),title:U(`工作区操作`,`Workspace actions`),disabled:n,open:r,onOpenChange:i,items:[{label:U(`从列表移除工作区`,`Remove workspace from list`),icon:(0,W.jsx)(nt,{}),destructive:!0,disabled:t,onSelect:a}],hint:t?U(`请先切换到其他工作区再移除`,`Switch to another workspace before removing`):U(`不删除目录、文件或会话历史`,`Keeps directories, files and session history`)})}function ty({title:e,disabled:t,open:n,onOpenChange:r,onRename:i,onDelete:a}){return(0,W.jsx)(ny,{label:U(`${e} 的会话操作`,`Chat actions for ${e}`),title:U(`会话操作`,`Chat actions`),disabled:t,open:n,onOpenChange:r,items:[{label:U(`重命名`,`Rename`),icon:(0,W.jsx)(et,{}),onSelect:i},{label:U(`删除会话`,`Delete chat`),icon:(0,W.jsx)(nt,{}),destructive:!0,onSelect:a}]})}function ny({label:e,title:t,disabled:n,open:r,onOpenChange:i,items:a,hint:o}){let s=(0,B.useRef)(null),c=(0,B.useRef)(null),[l,u]=(0,B.useState)({top:0,left:0}),d=(0,B.useRef)({onOpenChange:i});d.current={onOpenChange:i};let f=(e=!0)=>{i(!1),e&&s.current?.focus()};return(0,B.useLayoutEffect)(()=>{if(!r)return;let e=s.current.getBoundingClientRect(),t=c.current.getBoundingClientRect().height;u({top:Math.max(12,Math.min(e.bottom+4,window.innerHeight-t-12)),left:Math.max(12,Math.min(e.right-220,window.innerWidth-232))}),(c.current?.querySelector(`button:not(:disabled)`)??c.current)?.focus();let n=e=>{!c.current?.contains(e.target)&&!s.current?.contains(e.target)&&d.current.onOpenChange(!1)},i=()=>{d.current.onOpenChange(!1),s.current?.focus()};return document.addEventListener(`pointerdown`,n,!0),window.addEventListener(`resize`,i),window.addEventListener(`scroll`,i,!0),()=>{document.removeEventListener(`pointerdown`,n,!0),window.removeEventListener(`resize`,i),window.removeEventListener(`scroll`,i,!0)}},[r]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{ref:s,type:`button`,className:$v.rowAction,disabled:n,"aria-label":e,title:t,"aria-haspopup":`menu`,"aria-expanded":r,onClick:()=>r?f():i(!0),onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),i(!0))},children:(0,W.jsx)(Ke,{})}),r&&(0,_t.createPortal)((0,W.jsxs)(L,{ref:c,role:`menu`,tabIndex:-1,"aria-label":e,className:$v.menu,style:l,onKeyDown:e=>{if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),f();else if(e.key===`Tab`)f();else if([`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key)){e.preventDefault();let t=[...c.current?.querySelectorAll(`button:not(:disabled)`)??[]],n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:e.key===`ArrowDown`?(n+1)%t.length:(n-1+t.length)%t.length]?.focus()}},children:[a.map(e=>(0,W.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`${$v.menuItem} ${e.destructive?``:$v.menuItemNeutral}`,disabled:n||e.disabled,onClick:()=>{f(),e.onSelect()},children:[e.icon,e.label]},e.label)),o&&(0,W.jsx)(`p`,{className:$v.menuHint,children:o})]}),document.body)]})}function ry(e,t,n){let r=Date.parse(e);if(!Number.isFinite(r))return``;let i=Math.max(0,Math.floor((t-r)/6e4));if(i<1)return n===`zh`?`刚刚`:`now`;let[a,o,s]=[[525600,`年`,`yr`],[43200,`个月`,`mo`],[10080,`周`,`wk`],[1440,`天`,`d`],[60,`小时`,`h`],[1,`分钟`,`min`]].find(([e])=>i>=e);return`${Math.floor(i/a)}${n===`zh`?o:s}`}var iy={dialog:`_dialog_s0tgk_1`,editorScope:`_editorScope_s0tgk_21`,header:`_header_s0tgk_26`,title:`_title_s0tgk_35`,crumbBar:`_crumbBar_s0tgk_51`,crumbEditZone:`_crumbEditZone_s0tgk_65`,pathInput:`_pathInput_s0tgk_67`,millerRow:`_millerRow_s0tgk_78`,crumbTrail:`_crumbTrail_s0tgk_91`,crumbSeat:`_crumbSeat_s0tgk_101`,crumb:`_crumb_s0tgk_51`,crumbChevron:`_crumbChevron_s0tgk_128`,crumbEditGlyph:`_crumbEditGlyph_s0tgk_151`,content:`_content_s0tgk_187`,column:`_column_s0tgk_186`,divider:`_divider_s0tgk_216`,rowSeat:`_rowSeat_s0tgk_222`,row:`_row_s0tgk_222`,rowSelected:`_rowSelected_s0tgk_247`,rowIcon:`_rowIcon_s0tgk_252`,rowIconSelected:`_rowIconSelected_s0tgk_257`,rowName:`_rowName_s0tgk_262`,rowChevron:`_rowChevron_s0tgk_274`,status:`_status_s0tgk_279`,error:`_error_s0tgk_280`,loadingFloat:`_loadingFloat_s0tgk_192`,footerBar:`_footerBar_s0tgk_317`,showHiddenToggle:`_showHiddenToggle_s0tgk_333`,showHiddenToggleActive:`_showHiddenToggleActive_s0tgk_357`,footerGap:`_footerGap_s0tgk_361`,footerAction:`_footerAction_s0tgk_365`,createDialog:`_createDialog_s0tgk_370`,createBody:`_createBody_s0tgk_376`,createTitle:`_createTitle_s0tgk_383`,createIn:`_createIn_s0tgk_391`,createInput:`_createInput_s0tgk_398`,createActions:`_createActions_s0tgk_416`};function ay(e){if(typeof e==`object`&&e&&`rpcError`in e){let t=e.rpcError;if(typeof t==`object`&&t&&`message`in t&&typeof t.message==`string`)return t.message}return e instanceof Error?e.message:String(e)}var oy=300,sy=200,cy=250;function ly(e,t){let n=e.crumbs.findIndex(t=>t.path===e.home);if(n===-1)return e.crumbs;let r=e.crumbs.slice(n+1);return[{name:t,path:e.home,hidden:!1},...r]}function uy(e){return e.home.includes(`\\`)?`\\`:`/`}function dy(e){let t=uy(e);return e.path.endsWith(t)?e.path:`${e.path}${t}`}function fy(e,t){let n=uy(e)===`\\`?Math.max(t.lastIndexOf(`\\`),t.lastIndexOf(`/`)):t.lastIndexOf(`/`);return n===-1?null:t.slice(0,n+1)}function py(e,t,n){let r=fy(e,t);return r===null?{directory:null,tail:null}:{directory:r,tail:r===dy(e)||n!==null&&n.directory===r&&n.landed===e.path?t.slice(r.length):null}}function my(e,t,n,r){let i=r===null?``:r.toLowerCase(),a=e=>n||!e.hidden||i.startsWith(`.`),o=e=>a(e)&&e.name.toLowerCase().startsWith(i),s=i!==``&&e.some(o);return e.filter(e=>e.path===t?!0:s?o(e):n||!e.hidden)}function hy({entries:e,selectedPath:t,busy:n,onPick:r,showHidden:i,filterPrefix:a,pathEditing:o}){let s=my(e,t,i,a);return(0,W.jsx)(`div`,{className:iy.column,role:`list`,children:s.map(e=>{let i=e.path===t;return(0,W.jsx)(`span`,{role:`listitem`,className:iy.rowSeat,children:(0,W.jsxs)(`button`,{type:`button`,"aria-current":i||void 0,className:F(iy.row,i&&iy.rowSelected),disabled:n,onMouseDown:o?e=>{e.preventDefault()}:void 0,onClick:()=>{r(e)},children:[i?(0,W.jsx)(st,{size:16,className:iy.rowIconSelected}):(0,W.jsx)(ct,{size:16,className:iy.rowIcon}),(0,W.jsx)(`span`,{className:iy.rowName,children:e.name}),(0,W.jsx)(Xe,{size:12,className:iy.rowChevron})]})},e.path)})})}function gy({open:e,listDirectory:t,createDirectory:n,onOpen:r,onClose:i,busy:a,t:o}){let[s,c]=(0,B.useState)(null),[l,u]=(0,B.useState)(null),[d,f]=(0,B.useState)(null),[p,m]=(0,B.useState)(!1),[h,g]=(0,B.useState)(!1),[_,v]=(0,B.useState)(0),[y,b]=(0,B.useState)(null),[x,S]=(0,B.useState)(null),[C,w]=(0,B.useState)(!1),[T,E]=(0,B.useState)(null),[D,O]=(0,B.useState)(!1),[k,A]=(0,B.useState)(null),ee=(0,B.useRef)(0),j=(0,B.useRef)(null),M=(0,B.useRef)(0),N=(0,B.useRef)(null),P=(0,B.useRef)(!1);(0,B.useEffect)(()=>()=>{ee.current+=1,M.current+=1,j.current?.abort()},[]);let te={onCompositionStart:()=>{P.current=!0},onCompositionEnd:()=>{P.current=!1}},I=(0,B.useCallback)(()=>(j.current?.abort(),j.current=null,++ee.current),[]),L=(0,B.useCallback)(()=>{g(!1),v(e=>e+1)},[]),ne=(0,B.useCallback)(e=>{let n=I(),r=new AbortController;return j.current=r,L(),{seq:n,scan:t(e,r.signal)}},[I,L,t]),R=(0,B.useCallback)(e=>{let n=new AbortController;return j.current=n,L(),t(e,n.signal)},[L,t]),re=(0,B.useRef)(!1),ie=(0,B.useRef)({parent:null,child:null});(0,B.useEffect)(()=>{ie.current={parent:s,child:d}},[s,d]);let z=(0,B.useRef)(null),ae=(0,B.useRef)(!1),oe=(0,B.useCallback)((e,t)=>{let{seq:n,scan:r}=ne(e);m(!0),t.announce&&b(null);let i=()=>{m(!1),t.closeEditor?S(null):(b(null),ae.current=!0)};r.then(r=>{if(n!==ee.current)return;!t.closeEditor&&e!==void 0&&(z.current={directory:e,landed:r.path});let a=!1,o=()=>{a||n!==ee.current||(a=!0,c(r),u(null),f(null),i())};if(ly(r,``).length<2){o();return}let s=r.crumbs.at(-2);s===void 0?o():(R(s.path).then(e=>{if(n!==ee.current)return;let t=uy(e),s=e=>t===`\\`?e.toLowerCase():e,l=e.entries.find(e=>s(e.path)===s(r.path));l===void 0?o():(a=!0,c(e),u(l),f(r),i())},()=>{o()}),t.closeEditor&&window.setTimeout(o,sy))},e=>{n===ee.current&&(m(!1),t.announce&&b(ay(e)))})},[ne,R]),se=(0,B.useCallback)(e=>{oe(e,{closeEditor:!0,announce:!0})},[oe]),ce=(0,B.useRef)(!1),le=(0,B.useRef)(!1),V=(0,B.useRef)(null),H=(0,B.useRef)(null),ue=(0,B.useCallback)(e=>{let{seq:t,scan:n}=ne(e.path);x!==null&&(ce.current=!0),S(null),u(e),f(null),m(!0),b(null),n.then(e=>{t===ee.current&&(f(e),m(!1))},e=>{t===ee.current&&(m(!1),b(ay(e)),u(null),le.current=!0)})},[ne,x]),de=(0,B.useCallback)(e=>{oe(e,{closeEditor:!1,announce:!1})},[oe]),fe=(0,B.useCallback)(()=>{I(),m(!1),S(null),b(null),d===null&&u(null),s===null&&se()},[I,d,s,se]),pe=(0,B.useCallback)(e=>{d!==null&&(c(d),ue(e))},[d,ue]);(0,B.useEffect)(()=>{M.current+=1,e?(c(null),u(null),f(null),O(!1),w(!1),se()):(I(),m(!1),b(null),S(null),E(null),A(null),ce.current=!1,le.current=!1)},[e,se,I]);let me=l?.path??s?.path??null,he=l?.name??(s===null?``:ly(s,o(`browser.home`)).at(-1)?.name??s.path),ge=()=>{if(me===null||T===null||D)return;let e=T;if(e.trim()===``)return;O(!0),A(null);let t=M.current;n(me,e).then(n=>{if(t!==M.current)return;O(!1),E(null);let{seq:r,scan:i}=ne(me);m(!0),b(null),i.then(t=>{r===ee.current&&(c(t),m(!1),ue({name:e,path:n,hidden:!1}))},e=>{r===ee.current&&(m(!1),b(ay(e)))})},e=>{t===M.current&&(O(!1),A(ay(e)))})};(0,B.useEffect)(()=>{if(!p){g(!1);return}let e=window.setTimeout(()=>{g(!0)},oy);return()=>{window.clearTimeout(e)}},[p,_]),(0,B.useEffect)(()=>{if(x===null)return;let e=window.setTimeout(()=>{if(re.current)return;let e=ie.current.child??ie.current.parent;if(e===null)return;let{directory:t,tail:n}=py(e,x,z.current);t!==null&&n===null&&de(t)},cy);return()=>{window.clearTimeout(e)}},[x,de]);let _e=d??s,ve=_e===null||x===null?null:py(_e,x,z.current).tail,U=_e===null?[]:ly(_e,o(`browser.home`)),ye=U.at(-1)?.path;(0,B.useEffect)(()=>{let e=N.current;e!==null&&(e.scrollLeft=e.scrollWidth)},[ye]);let be=(0,B.useRef)(null),xe=d?.path;if((0,B.useEffect)(()=>{let e=be.current;e!==null&&xe!==void 0&&(e.scrollLeft=e.scrollWidth)},[xe]),(0,B.useEffect)(()=>{if(ae.current&&(ae.current=!1,document.activeElement===document.body&&V.current?.focus()),x===null){if(ce.current){ce.current=!1,le.current=!1;let e=be.current;if(e===null)return;let t=e.querySelector(`button[aria-current="true"]`);if(t===null)return;t.focus()}else if(le.current){if(le.current=!1,document.activeElement!==document.body)return;let e=H.current;if(e===null)return;e.focus()}}}),!e)return null;let Se=l!==null,Ce=a||T!==null,we=x!==null;return(0,W.jsxs)(Qv,{open:e,onClose:()=>{T===null&&!a&&i()},title:o(`browser.title`),className:F(iy.dialog),headless:!0,children:[(0,W.jsxs)(`div`,{className:iy.editorScope,onKeyDown:e=>{e.key===`Escape`&&x!==null&&(e.stopPropagation(),le.current=document.activeElement===V.current,fe())},onBlur:e=>{if(x===null||!document.hasFocus())return;let t=e.currentTarget.closest(`[role="dialog"]`);t!==null&&(e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||(le.current=!1,fe()))},children:[(0,W.jsxs)(`div`,{className:iy.header,children:[(0,W.jsx)(`h2`,{className:iy.title,children:o(`browser.title`)}),(0,W.jsx)(`div`,{className:iy.crumbBar,children:x===null?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:iy.crumbTrail,role:`navigation`,ref:N,children:U.map((e,t)=>(0,W.jsxs)(`span`,{className:iy.crumbSeat,children:[t>0&&(0,W.jsx)(Xe,{size:12,className:iy.crumbChevron}),(0,W.jsx)(`button`,{type:`button`,className:iy.crumb,disabled:Ce,onClick:()=>{se(e.path)},children:e.name})]},e.path))}),(0,W.jsx)(`button`,{type:`button`,className:iy.crumbEditZone,"aria-label":o(`browser.editPath`),title:o(`browser.editPath`),disabled:Ce,ref:H,onClick:()=>{if(I(),m(!1),re.current=!1,s===null){S(``);return}let e=l?.path??s.path,t=uy(s);S(e.endsWith(t)?e:`${e}${t}`)},children:(0,W.jsx)(et,{size:14,className:iy.crumbEditGlyph})})]}):(0,W.jsx)(`input`,{className:iy.pathInput,value:x,"aria-label":o(`browser.editPath`),autoFocus:!0,ref:V,disabled:Ce,onChange:e=>{I(),m(!1),re.current=!1,S(e.target.value)},...te,onKeyDown:e=>{e.key===`Enter`&&!P.current&&(e.preventDefault(),x.trim()!==``&&(le.current=!0,re.current=!0,se(x)))}})})]}),(0,W.jsxs)(`div`,{className:iy.content,children:[(0,W.jsxs)(`div`,{className:iy.millerRow,ref:be,children:[s!==null&&(0,W.jsx)(hy,{entries:s.entries,selectedPath:l?.path??null,busy:Ce,onPick:ue,showHidden:C,filterPrefix:d===null?ve:null,pathEditing:we}),Se&&(0,W.jsx)(`span`,{className:iy.divider}),Se&&d!==null&&(0,W.jsx)(hy,{entries:d.entries,selectedPath:null,busy:Ce,onPick:pe,showHidden:C,filterPrefix:ve,pathEditing:we})]}),p&&h&&(0,W.jsx)(`div`,{className:F(iy.status,iy.loadingFloat),role:`status`,children:o(`browser.loading`)}),(s?.truncated===!0||d?.truncated===!0)&&(0,W.jsx)(`div`,{className:iy.status,role:`status`,children:o(`browser.truncated`)}),y!==null&&(0,W.jsx)(`div`,{className:iy.error,role:`alert`,children:y})]}),(0,W.jsxs)(`div`,{className:iy.footerBar,children:[(0,W.jsx)(Xv,{variant:`outline`,icon:(0,W.jsx)(qe,{size:14}),disabled:s===null||p||Ce||we,onClick:()=>{E(``),A(null)},children:o(`browser.newFolder`)}),(0,W.jsxs)(`button`,{type:`button`,className:F(iy.showHiddenToggle,C&&iy.showHiddenToggleActive),"aria-pressed":C,disabled:Ce,onMouseDown:we?e=>{e.preventDefault()}:void 0,onClick:()=>{w(e=>!e)},children:[o(`browser.showHidden`),C&&(0,W.jsx)(Je,{size:14})]}),(0,W.jsx)(`span`,{className:iy.footerGap}),(0,W.jsx)(Xv,{variant:`outline`,className:F(iy.footerAction),disabled:Ce,onClick:i,children:o(`browser.cancel`)}),(0,W.jsx)(Xv,{variant:`primary`,className:F(iy.footerAction),disabled:me===null||p||Ce||we,onClick:()=>{me!==null&&r(me)},children:o(`browser.open`)})]})]}),(0,W.jsx)(Qv,{open:T!==null,onClose:()=>{D||E(null)},title:o(`browser.newFolder`),className:F(iy.createDialog),headless:!0,children:(0,W.jsxs)(`div`,{className:iy.createBody,children:[(0,W.jsx)(`h3`,{className:iy.createTitle,children:o(`browser.newFolder`)}),(0,W.jsx)(`p`,{className:iy.createIn,children:o(`browser.createIn`,{name:he})}),(0,W.jsx)(`input`,{className:iy.createInput,value:T??``,"aria-label":o(`browser.folderName`),placeholder:o(`browser.untitledFolder`),autoFocus:!0,disabled:D,onChange:e=>{E(e.target.value)},...te,onKeyDown:e=>{e.key===`Enter`&&!P.current&&(e.preventDefault(),ge()),e.key===`Escape`&&(e.stopPropagation(),D||E(null))}}),k!==null&&(0,W.jsx)(`div`,{className:iy.error,role:`alert`,children:k}),(0,W.jsxs)(`div`,{className:iy.createActions,children:[(0,W.jsx)(Xv,{variant:`outline`,disabled:D,onClick:()=>{E(null)},children:o(`browser.cancel`)}),(0,W.jsx)(Xv,{variant:`primary`,disabled:D||T===null||T.trim()===``,onClick:ge,children:o(`browser.create`)})]})]})})]})}var _y={root:`_root_1vp8c_1`,rail:`_rail_1vp8c_13`,iconButton:`_iconButton_1vp8c_17`,searchButton:`_searchButton_1vp8c_33`,clearButton:`_clearButton_1vp8c_34`,sectionHeader:`_sectionHeader_1vp8c_45`,sectionLabel:`_sectionLabel_1vp8c_65`,sectionLabelHidden:`_sectionLabelHidden_1vp8c_82`,searchSlot:`_searchSlot_1vp8c_91`,searchSlotExpanded:`_searchSlotExpanded_1vp8c_105`,headerActions:`_headerActions_1vp8c_110`,headerActionsHidden:`_headerActionsHidden_1vp8c_126`,search:`_search_1vp8c_33`,searchExpanded:`_searchExpanded_1vp8c_160`,searchInput:`_searchInput_1vp8c_199`,listArea:`_listArea_1vp8c_285`,treeBody:`_treeBody_1vp8c_305`,fade:`_fade_1vp8c_315`,wide:`_wide_1vp8c_326`,"wide-in":`_wide-in_1vp8c_1`,list:`_list_1vp8c_285`,flatList:`_flatList_1vp8c_356`,searchTree:`_searchTree_1vp8c_357`,groupSection:`_groupSection_1vp8c_358`,searchStatus:`_searchStatus_1vp8c_362`,searchWarning:`_searchWarning_1vp8c_363`,listTopDropIndicator:`_listTopDropIndicator_1vp8c_383`,workspaceDropBefore:`_workspaceDropBefore_1vp8c_384`,workspaceDropAfter:`_workspaceDropAfter_1vp8c_385`,listTopDropActive:`_listTopDropActive_1vp8c_419`,sessionOverflowButton:`_sessionOverflowButton_1vp8c_431`,empty:`_empty_1vp8c_453`,renameInput:`_renameInput_1vp8c_460`,renameError:`_renameError_1vp8c_479`,deleteAction:`_deleteAction_1vp8c_486`,deleteStatus:`_deleteStatus_1vp8c_490`},vy={projectRow:`_projectRow_mhb10_1`,sessionRow:`_sessionRow_mhb10_2`,selected:`_selected_mhb10_18`,searchResultRow:`_searchResultRow_mhb10_22`,searchResultHeading:`_searchResultHeading_mhb10_46`,searchResultTitle:`_searchResultTitle_mhb10_52`,searchResultMeta:`_searchResultMeta_mhb10_63`,searchResultWorkspace:`_searchResultWorkspace_mhb10_71`,searchResultSnippet:`_searchResultSnippet_mhb10_72`,rowActions:`_rowActions_mhb10_99`,"row-in":`_row-in_mhb10_1`,title:`_title_mhb10_112`,flatSessionRowWithoutStatus:`_flatSessionRowWithoutStatus_mhb10_116`,slot:`_slot_mhb10_124`,visuallyHidden:`_visuallyHidden_mhb10_134`,folderActive:`_folderActive_mhb10_143`,chevron:`_chevron_mhb10_149`,folder:`_folder_mhb10_143`,arrow:`_arrow_mhb10_154`,arrowOpen:`_arrowOpen_mhb10_158`,projectText:`_projectText_mhb10_162`,renameInput:`_renameInput_mhb10_179`,meta:`_meta_mhb10_195`,time:`_time_mhb10_204`,scheduleIndicator:`_scheduleIndicator_mhb10_211`,searchScheduleIndicator:`_searchScheduleIndicator_mhb10_222`,dot:`_dot_mhb10_227`,menuOpen:`_menuOpen_mhb10_242`,dropBefore:`_dropBefore_mhb10_261`,dropAfter:`_dropAfter_mhb10_262`,hoverContent:`_hoverContent_mhb10_302`,hoverTitle:`_hoverTitle_mhb10_308`,hoverPath:`_hoverPath_mhb10_315`,hoverTime:`_hoverTime_mhb10_322`,hoverStatus:`_hoverStatus_mhb10_328`,iconButton:`_iconButton_mhb10_337`},yy=(e,t)=>({"browser.title":U(`选择工作区目录`,`Select workspace directory`),"browser.home":U(`主目录`,`Home`),"browser.newFolder":U(`新建文件夹`,`New folder`),"browser.folderName":U(`文件夹名称`,`Folder name`),"browser.createIn":U(`在"{name}"中新建文件夹`,`Create folder in "{name}"`),"browser.untitledFolder":U(`未命名文件夹`,`Untitled folder`),"browser.create":U(`创建`,`Create`),"browser.cancel":U(`取消`,`Cancel`),"browser.open":U(`打开`,`Open`),"browser.editPath":U(`编辑路径`,`Edit path`),"browser.loading":U(`加载中…`,`Loading…`),"browser.truncated":U(`文件夹过多,仅显示开头部分。`,`Too many folders; only the first few are shown.`),"browser.showHidden":U(`显示隐藏文件`,`Show hidden files`)}[e]??e).replace(/\{(\w+)\}/g,(e,n)=>t?.[n]??``);function by({wide:e,navigationBusy:t=!1,connected:n=!0,expandSidebar:r,session:i,workspaces:a,onAdd:o,directoryPickerKind:s,pickDirectory:c,listDirectory:l,createDirectory:u,onRemove:d,onSelectSession:f,onNewSession:p,onRenameSession:m,onDeleteSession:h}){let g=_e(),[_,v]=(0,B.useState)(Date.now),[y,b]=(0,B.useState)(null),[x,S]=(0,B.useState)(null),[C,w]=(0,B.useState)(null),[T,E]=(0,B.useState)(``),[D,O]=(0,B.useState)(null),k=(0,B.useRef)(null);(0,B.useEffect)(()=>{if(!C)return;let e=requestAnimationFrame(()=>{k.current?.focus(),k.current?.select()});return()=>cancelAnimationFrame(e)},[C]),(0,B.useEffect)(()=>{if(!e){b(null),S(null);return}v(Date.now());let t=window.setInterval(()=>v(Date.now()),6e4);return()=>window.clearInterval(t)},[e]);let[A,ee]=(0,B.useState)(!1),[j,M]=(0,B.useState)(!1),N=j||t,P=N||!n,te=(0,B.useId)(),F=(0,B.useRef)(null),[I,L]=(0,B.useState)(null),[ne,R]=(0,B.useState)(``),[re,ie]=(0,B.useState)(``),[z,ae]=(0,B.useState)(!1),[oe,se]=(0,B.useState)(``);(0,B.useEffect)(()=>{se(``)},[i?.sessionId]);let[ce,le]=(0,B.useState)(new Set);(0,B.useEffect)(()=>{a.activeId&&le(e=>e.has(a.activeId)?e:new Set([...e,a.activeId]))},[a.activeId,i?.sessionId]),(0,B.useEffect)(()=>{F.current?.querySelector(`[aria-current="page"]`)?.scrollIntoView({block:`nearest`})},[e,i?.sessionId,ce]);let V=(0,B.useRef)(null),H=(0,B.useRef)(null),ue=oe.trim().toLocaleLowerCase(),de=()=>{se(``),ae(!1),V.current?.focus()},fe=a.items.filter(e=>!ue||e.title.toLocaleLowerCase().includes(ue)||e.path.toLocaleLowerCase().includes(ue)||a.sessions.some(t=>t.workspaceId===e.id&&t.name.toLocaleLowerCase().includes(ue)));At(`workspace-action`,A||I||C||D?null:ne);let pe=async e=>{if(!P){M(!0),R(``);try{await e()}catch(e){R(e instanceof Error?e.message:U(`操作失败`,`Operation failed`))}finally{M(!1)}}},me=async e=>{M(!0);try{await o(e,!1),ee(!1)}catch(e){ee(!1),ie(e instanceof Error?e.message:String(e))}finally{M(!1)}},he=async()=>{if(s!==null){if(e||r(),R(``),s===`browse`)ee(!0);else{M(!0);try{let e=await c();e!==null&&await me(e)}catch(e){ie(e instanceof Error?e.message:String(e))}finally{M(!1)}}}};return(0,W.jsxs)(`div`,{ref:F,"aria-busy":N,className:`${_y.root} ${e?``:_y.rail}`,children:[(0,W.jsxs)(`div`,{className:_y.sectionHeader,children:[e&&(0,W.jsx)(`span`,{className:`${_y.sectionLabel} ${_y.wide} ${z?_y.sectionLabelHidden:``}`,children:U(`工作区`,`Workspaces`)}),e&&(0,W.jsx)(`div`,{className:`${_y.searchSlot} ${z?_y.searchSlotExpanded:``}`,children:(0,W.jsxs)(`div`,{className:`${_y.search} ${z?_y.searchExpanded:``}`,onClick:()=>{ae(!0),H.current?.focus()},children:[(0,W.jsx)(`button`,{ref:V,type:`button`,className:_y.searchButton,"aria-label":U(`搜索工作区和会话`,`Search workspaces and sessions`),"aria-expanded":z,onClick:()=>{ae(!0),H.current?.focus()},children:(0,W.jsx)(He,{size:z?11:14})}),(0,W.jsx)(`input`,{ref:H,className:_y.searchInput,type:`search`,"aria-label":U(`按名称或工作区路径搜索`,`Search by name or workspace path`),placeholder:U(`按名称或工作区路径搜索`,`Search by name or workspace path`),maxLength:120,value:oe,tabIndex:z?0:-1,onChange:e=>se(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),de())}}),z&&(0,W.jsx)(`button`,{type:`button`,className:_y.clearButton,"aria-label":U(`关闭搜索`,`Close search`),onClick:e=>{e.stopPropagation(),de()},children:(0,W.jsx)(Qe,{})})]})}),(0,W.jsx)(`div`,{className:`${_y.headerActions} ${e&&z?_y.headerActionsHidden:``}`,children:(0,W.jsx)(`button`,{type:`button`,className:_y.iconButton,"aria-label":U(`添加工作区`,`Add workspace`),title:U(`添加工作区`,`Add workspace`),disabled:P||s===null,onClick:()=>{he()},children:(0,W.jsx)(ot,{size:e?16:18})})})]}),e&&(0,W.jsx)(`div`,{className:_y.listArea,children:(0,W.jsx)(`div`,{className:_y.treeBody,children:(0,W.jsxs)(`div`,{className:_y.list,role:`list`,"aria-label":U(`工作区`,`Workspaces`),children:[fe.map(e=>{let t=e.id===a.activeId,n=e.available===!1,r=ce.has(e.id)||!!ue;return(0,W.jsxs)(`div`,{className:$v.group,role:`listitem`,children:[(0,W.jsxs)(`div`,{className:$v.workspaceLine,"data-menu-open":y===e.id||void 0,children:[(0,W.jsxs)(`button`,{type:`button`,className:`${vy.projectRow} ${$v.workspaceButton}`,"aria-expanded":r,"aria-controls":`${te}-${e.id}`,title:e.path,disabled:N,onContextMenu:t=>{P||(t.preventDefault(),t.stopPropagation(),S(null),b(e.id))},onClick:()=>le(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),children:[(0,W.jsxs)(`span`,{className:vy.slot,"aria-hidden":`true`,children:[(0,W.jsx)(`span`,{"data-workspace-leading":`folder`,className:`${$v.folder} ${t?$v.folderActive:``}`,children:r?(0,W.jsx)(st,{size:16}):(0,W.jsx)(ct,{size:16})}),(0,W.jsx)(`span`,{"data-workspace-leading":`chevron`,className:`${$v.chevron} ${r?$v.chevronOpen:``}`,children:(0,W.jsx)(Ye,{size:14})})]}),(0,W.jsx)(`span`,{className:`${vy.title} ${$v.workspaceTitle}`,children:e.title}),n&&(0,W.jsx)(`span`,{className:$v.unavailable,children:U(`不可用`,`Unavailable`)})]}),(0,W.jsxs)(`span`,{className:$v.rowActions,"data-workspace-actions":!0,children:[(0,W.jsx)(ey,{title:e.title,active:t,disabled:P,open:y===e.id,onOpenChange:t=>b(t?e.id:null),onRemove:()=>{R(``),L({id:e.id,title:e.title})}}),(0,W.jsx)(`button`,{type:`button`,className:$v.rowAction,title:n?U(`目录不可用,请恢复目录或移除后重新添加`,`Directory unavailable; restore it or remove and add the workspace again`):U(`新建会话`,`New session`),"aria-label":U(`在 ${e.title} 新建会话`,`Create a session in ${e.title}`),disabled:P||n,onClick:()=>{pe(async()=>{await p(e.id),se(``),le(t=>new Set([...t,e.id]))})},children:(0,W.jsx)(Ve,{size:16})})]})]}),(0,W.jsxs)(`div`,{id:`${te}-${e.id}`,role:`group`,"aria-label":e.title,hidden:!r,children:[r&&a.sessions.filter(t=>t.workspaceId===e.id&&(!ue||e.title.toLocaleLowerCase().includes(ue)||e.path.toLocaleLowerCase().includes(ue)||t.name.toLocaleLowerCase().includes(ue))).map(r=>{let a=t&&i?.sessionId===r.id,o=i?.sessionId===r.id?!i.idle:r.idle===!1,s=r.name||U(`新会话`,`New chat`),c={workspaceId:e.id,id:r.id,path:r.path,name:r.name,running:o};return(0,W.jsxs)(`div`,{className:$v.sessionLine,"data-menu-open":x===r.id||void 0,children:[(0,W.jsxs)(`button`,{type:`button`,className:`${vy.sessionRow} ${$v.sessionButton} ${a?vy.selected:``}`,title:s,"aria-label":s,"aria-describedby":`${te}-${r.id}-status`,"aria-current":a?`page`:void 0,disabled:P||n,onContextMenu:e=>{P||n||(e.preventDefault(),e.stopPropagation(),b(null),S(r.id))},onClick:()=>{pe(()=>f(e.id,r.id,r.path))},children:[(0,W.jsx)(`span`,{className:vy.slot,children:o&&(0,W.jsx)(Be,{state:`ongoing`})}),(0,W.jsx)(`span`,{className:`${vy.title} ${r.name?``:$v.untitled}`,children:s}),(0,W.jsx)(`time`,{className:$v.sessionTime,dateTime:r.modified,title:r.modified,children:ry(r.modified,_,g)}),(0,W.jsx)(`span`,{id:`${te}-${r.id}-status`,className:vy.visuallyHidden,children:o?U(`运行中`,`Running`):U(`空闲`,`Idle`)})]}),(0,W.jsx)(`span`,{className:$v.rowActions,children:(0,W.jsx)(ty,{title:s,disabled:P||n,open:x===r.id,onOpenChange:e=>S(e?r.id:null),onRename:()=>{R(``),E(r.name),w(c)},onDelete:()=>{R(``),O(c)}})})]},r.id)}),r&&!ue&&!a.sessions.some(t=>t.workspaceId===e.id)&&(0,W.jsx)(`p`,{className:_y.empty,children:U(`还没有会话,创建新会话开始`,`No sessions yet. Create a session to start.`)})]})]},e.id)}),fe.length===0&&(0,W.jsxs)(`p`,{className:_y.empty,role:`status`,children:[ue?U(`没有找到匹配的工作区或会话`,`No matching workspaces or sessions`):U(`添加工作区,开始管理对话`,`Add a workspace to start organizing conversations`),ue&&(0,W.jsx)(`button`,{type:`button`,className:_y.sessionOverflowButton,onClick:de,children:U(`清除搜索`,`Clear search`)})]}),N&&(0,W.jsx)(`p`,{className:_y.searchStatus,role:`status`,children:U(`正在处理…`,`Working…`)})]})})}),(0,W.jsxs)(Qv,{open:I!==null,onClose:()=>{N||L(null)},title:U(`移除工作区?`,`Remove workspace?`),closeLabel:U(`关闭`,`Close`),footer:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Xv,{variant:`outline`,disabled:N,onClick:()=>L(null),children:U(`取消`,`Cancel`)}),(0,W.jsx)(Xv,{variant:`primary`,disabled:P,onClick:()=>{I&&pe(async()=>{await d(I.id),L(null)})},children:U(`从列表移除`,`Remove from list`)})]}),children:[(0,W.jsx)(`p`,{children:I?.title}),(0,W.jsx)(`p`,{children:U(`仅从侧栏移除,不删除目录、文件或会话历史。`,`Only removes it from the sidebar. Directories, files and session history are not deleted.`)}),ne&&(0,W.jsx)(`p`,{role:`alert`,children:ne})]}),(0,W.jsxs)(Qv,{open:C!==null,onClose:()=>{N||w(null)},title:U(`重命名会话`,`Rename chat`),closeLabel:U(`关闭`,`Close`),footer:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Xv,{variant:`outline`,disabled:N,onClick:()=>w(null),children:U(`取消`,`Cancel`)}),(0,W.jsx)(Xv,{variant:`primary`,type:`submit`,form:`${te}-rename`,disabled:P,children:U(`保存`,`Save`)})]}),children:[(0,W.jsx)(`form`,{id:`${te}-rename`,onSubmit:e=>{e.preventDefault(),C&&pe(async()=>{await m(C.workspaceId,C.id,C.path,T),w(null)})},children:(0,W.jsx)(`input`,{className:$v.renameInput,"aria-label":U(`会话名称`,`Chat name`),placeholder:U(`留空则使用第一条消息`,`Leave empty to use the first message`),maxLength:120,ref:k,value:T,onChange:e=>E(e.target.value)})}),ne&&(0,W.jsx)(`p`,{role:`alert`,children:ne})]}),(0,W.jsxs)(Qv,{open:D!==null,onClose:()=>{N||O(null)},title:U(`删除会话?`,`Delete chat?`),closeLabel:U(`关闭`,`Close`),footer:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Xv,{variant:`outline`,disabled:N,onClick:()=>O(null),children:U(`取消`,`Cancel`)}),(0,W.jsx)(Xv,{variant:`primary`,disabled:P||D?.running,onClick:()=>{D&&pe(async()=>{await h(D.workspaceId,D.id,D.path),O(null)})},children:U(`删除`,`Delete`)})]}),children:[(0,W.jsx)(`p`,{children:D?.name||U(`新会话`,`New chat`)}),(0,W.jsx)(`p`,{children:D?.running?U(`Pi 正在运行,请等待当前回复结束后再删除。`,`Pi is still working. Wait for the reply to finish before deleting.`):U(`会话会从列表中移除,文件移到 Pi 数据目录的 pi-web/trash 中,可手动恢复。项目文件不受影响。`,`The chat leaves the list and its file moves to pi-web/trash in the Pi data folder, where you can restore it by hand. Project files are not affected.`)}),ne&&(0,W.jsx)(`p`,{role:`alert`,children:ne})]}),(0,W.jsx)(gy,{open:A,busy:N,listDirectory:l,createDirectory:u,onOpen:e=>{me(e)},onClose:()=>{N||ee(!1)},t:yy}),(0,W.jsx)(Qv,{open:!!re,onClose:()=>ie(``),title:U(`无法添加工作区`,`Could not add workspace`),closeLabel:U(`关闭`,`Close`),footer:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Xv,{variant:`outline`,onClick:()=>ie(``),children:U(`取消`,`Cancel`)}),(0,W.jsx)(Xv,{variant:`primary`,onClick:()=>{ie(``),he()},children:U(`重新选择`,`Choose again`)})]}),children:(0,W.jsx)(`div`,{role:`alert`,children:re})})]})}function xy(e){let t=e.trim();if(!t)return;let n=/^(\d+(?:\.\d+)?)([km])?$/i.exec(t);if(!n)return NaN;let r=n[2]?.toLowerCase(),i=r===`m`?1e6:r===`k`?1e3:1,a=Number(n[1])*i,o=Math.round(a);return Math.abs(a-o)<1e-6?o:a}function Sy(e){return e===void 0?``:!Number.isInteger(e)||e<=0?String(e):e%1e6==0?`${e/1e6}M`:e%1e3==0?`${e/1e3}K`:String(e)}function Cy({model:e,position:t,onSave:n,onRemove:r,onCancel:i}){let[a,o]=(0,B.useState)(e.id),[s,c]=(0,B.useState)(e.name??``),[l,u]=(0,B.useState)(Sy(e.contextWindow)),[d,f]=(0,B.useState)(Sy(e.maxTokens)),[p,m]=(0,B.useState)(e.input?.length?e.input:[`text`]),[h,g]=(0,B.useState)(!e.id),[_,v]=(0,B.useState)(!1),[y,b]=(0,B.useState)(!1),[x,S]=(0,B.useState)(``),C=!e.id,w=!C&&(e.source===`custom`||e.overridden),T=async()=>{let e=xy(l),t=xy(d);if(!a.trim()||[e,t].some(e=>e!==void 0&&(!Number.isSafeInteger(e)||e<=0)))S(U(`请填写模型 ID,并使用正整数或 K/M 单位填写容量。`,`Enter a model ID and positive token counts, optionally with K/M suffixes.`));else{b(!0),S(``);try{await n({id:a.trim(),...s.trim()?{name:s.trim()}:{},...e===void 0?{}:{contextWindow:e},...t===void 0?{}:{maxTokens:t},input:p})}catch(e){S(e instanceof Error?e.message:U(`保存失败`,`Could not save`))}finally{b(!1)}}},E=async()=>{b(!0),S(``);try{await r()}catch(e){S(e instanceof Error?e.message:U(`操作失败`,`Action failed`)),v(!1)}finally{b(!1)}},D=e=>{m(t=>{let n=t.includes(e)?t.filter(t=>t!==e):[...t,e];return n.length?n:t})};return(0,W.jsxs)(`div`,{className:`pi-model-entry`,children:[(0,W.jsxs)(`div`,{className:`pi-model-row`,children:[(0,W.jsx)(`input`,{"aria-label":`${U(`模型 ID`,`Model ID`)} ${t}`,placeholder:U(`模型 ID`,`Model ID`),value:a,disabled:y||!C&&e.source===`builtin`,onFocus:()=>g(!0),onChange:e=>o(e.target.value)}),(0,W.jsx)(`input`,{"aria-label":`${U(`显示名称`,`Display name`)} ${t}`,placeholder:U(`显示名称`,`Display name`),value:s,disabled:y,onFocus:()=>g(!0),onChange:e=>c(e.target.value)}),(0,W.jsx)(`button`,{type:`button`,"aria-label":`${U(`模型参数`,`Model settings`)} ${t}`,"aria-expanded":h,onClick:()=>g(!h),children:h?`⌄`:`›`})]}),h&&(0,W.jsxs)(`div`,{className:`pi-model-details`,children:[(0,W.jsxs)(`label`,{children:[U(`上下文窗口`,`Context window`),(0,W.jsx)(`input`,{"aria-label":`${U(`上下文窗口`,`Context window`)} ${t}`,inputMode:`decimal`,placeholder:`128K`,value:l,disabled:y,onChange:e=>u(e.target.value)})]}),(0,W.jsxs)(`label`,{children:[U(`最大输出 token 数`,`Max output tokens`),(0,W.jsx)(`input`,{"aria-label":`${U(`最大输出 token 数`,`Max output tokens`)} ${t}`,inputMode:`decimal`,placeholder:`16K`,value:d,disabled:y,onChange:e=>f(e.target.value)})]}),(0,W.jsxs)(`fieldset`,{className:`pi-model-input-types`,children:[(0,W.jsx)(`legend`,{children:U(`输入类型`,`Input types`)}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:p.includes(`text`),disabled:y||p.length===1&&p.includes(`text`),onChange:()=>D(`text`)}),U(`文本`,`Text`)]}),(0,W.jsxs)(`label`,{children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:p.includes(`image`),disabled:y||p.length===1&&p.includes(`image`),onChange:()=>D(`image`)}),U(`图片`,`Image`)]})]}),(0,W.jsxs)(`div`,{className:`pi-model-actions`,children:[(0,W.jsx)(`button`,{type:`button`,disabled:y,onClick:()=>{T()},children:y?U(`保存中…`,`Saving…`):U(`保存模型`,`Save model`)}),C&&i&&(0,W.jsx)(`button`,{type:`button`,disabled:y,onClick:i,children:U(`取消`,`Cancel`)}),w&&(0,W.jsx)(`button`,{type:`button`,disabled:y,onClick:()=>v(!_),children:e.source===`custom`?U(`移除模型`,`Remove model`):U(`恢复默认`,`Restore default`)})]}),_&&(0,W.jsxs)(`div`,{className:`pi-model-confirm`,children:[(0,W.jsx)(`span`,{children:e.source===`custom`?U(`从配置中移除这个模型?`,`Remove this model from configuration?`):U(`撤销这个模型的自定义参数?`,`Discard this model’s custom settings?`)}),(0,W.jsx)(`button`,{type:`button`,disabled:y,onClick:()=>{E()},children:U(`确认`,`Confirm`)}),(0,W.jsx)(`button`,{type:`button`,disabled:y,onClick:()=>v(!1),children:U(`取消`,`Cancel`)})]}),x&&(0,W.jsx)(`p`,{className:`pi-settings-error`,role:`alert`,children:x})]})]})}function wy({providerId:e,getModels:t,updateModel:n}){let[r,i]=(0,B.useState)(null),[a,o]=(0,B.useState)(``),[s,c]=(0,B.useState)(``),[l,u]=(0,B.useState)(!1),d=async()=>{o(``);try{i(await t(e))}catch(e){throw o(e instanceof Error?e.message:U(`无法读取模型目录`,`Could not load model catalog`)),e}};(0,B.useEffect)(()=>{d().catch(()=>{})},[e]);let f=async t=>{await n(e,t),u(!1),await d().catch(()=>{})},p=r?.models.filter(e=>`${e.id} ${e.name??``}`.toLocaleLowerCase().includes(s.toLocaleLowerCase()))??[];return(0,W.jsxs)(`section`,{className:`pi-provider-models`,"aria-label":U(`模型目录`,`Model catalog`),children:[(0,W.jsxs)(`div`,{className:`pi-provider-models-head`,children:[(0,W.jsx)(`strong`,{children:U(`模型目录`,`Model catalog`)}),(0,W.jsxs)(`span`,{children:[r?.models.length??0,` `,U(`个模型`,`models`)]})]}),r?.baseUrl&&(0,W.jsxs)(`p`,{className:`pi-provider-models-endpoint`,title:r.baseUrl,children:[U(`API 地址`,`API URL`),`: `,r.baseUrl]}),a&&(0,W.jsxs)(`p`,{className:`pi-settings-error`,role:`alert`,children:[a,` `,r&&(0,W.jsx)(`button`,{type:`button`,onClick:()=>{d().catch(()=>{})},children:U(`重试读取`,`Retry`)})]}),r?(0,W.jsxs)(W.Fragment,{children:[r.models.length>5&&(0,W.jsx)(`input`,{className:`pi-model-search`,type:`search`,"aria-label":U(`搜索模型`,`Search models`),placeholder:U(`搜索模型`,`Search models`),value:s,onChange:e=>c(e.target.value)}),(0,W.jsx)(`div`,{className:`pi-model-list`,children:p.map((e,t)=>(0,W.jsx)(Cy,{model:e,position:t+1,onSave:t=>f({action:`save`,originalId:e.id,model:t}),onRemove:()=>f({action:`remove`,id:e.id})},`${e.id}:${e.name}:${e.contextWindow}:${e.maxTokens}:${e.overridden}`))}),p.length===0&&!l&&(0,W.jsx)(`p`,{className:`pi-provider-models-empty`,children:U(`没有匹配的模型`,`No matching models`)}),l&&(0,W.jsx)(Cy,{model:{id:``,source:`custom`,overridden:!1},position:r.models.length+1,onSave:e=>f({action:`save`,model:e}),onRemove:async()=>u(!1),onCancel:()=>u(!1)},`new`),!l&&(0,W.jsx)(`button`,{type:`button`,className:`pi-model-add`,onClick:()=>u(!0),children:U(`+ 添加模型`,`+ Add model`)})]}):a?(0,W.jsx)(`button`,{type:`button`,className:`pi-model-add`,onClick:()=>{d().catch(()=>{})},children:U(`重试读取`,`Retry`)}):(0,W.jsx)(`p`,{role:`status`,children:U(`正在读取模型…`,`Loading models…`)})]})}var Ty={id:``,name:``,baseUrl:``,api:`openai-completions`,modelId:``};function Ey(e){try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`?t.href:null}catch{return null}}function Dy(){let e=null;try{return e=window.open(`about:blank`,`_blank`),e&&(e.opener=null,e.document.title=U(`正在准备授权页面`,`Preparing sign-in`),e.document.body.textContent=U(`正在准备授权页面…`,`Preparing sign-in…`)),e}catch{return e?.close(),null}}function Oy({provider:e,configured:t,busy:n,getProviderModels:r,updateProviderModel:i,onConnect:a}){let[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(``),[u,d]=(0,B.useState)(``),[f,p]=(0,B.useState)(!0),[m,h]=(0,B.useState)(!1),[g,_]=(0,B.useState)(``);(0,B.useEffect)(()=>{let t=!0;return p(!0),r(e.id).then(e=>{t&&(l(e.baseUrl??``),d(e.baseUrl??``),p(!1))}).catch(e=>{t&&(p(!1),_(e instanceof Error?e.message:U(`无法读取 API 地址`,`Could not load API URL`)))}),()=>{t=!1}},[e.id]);let v=async()=>{let n=o.trim(),r=c.trim();if(n||t){if(r&&!Ey(r))_(U(`请输入有效的 http 或 https 地址。`,`Enter a valid HTTP or HTTPS URL.`));else{h(!0),_(``);try{r!==u&&(await i(e.id,{action:`base_url`,baseUrl:r||null}),d(r)),n&&(s(``),await a(n))}catch(e){_(e instanceof Error?e.message:U(`保存失败`,`Could not save`))}finally{h(!1)}}}};return(0,W.jsxs)(`form`,{className:`pi-provider-key-form`,onSubmit:e=>{e.preventDefault(),v()},children:[(0,W.jsxs)(`label`,{children:[U(`API Key`,`API key`),(0,W.jsx)(`input`,{type:`password`,autoComplete:`off`,maxLength:16384,value:o,onChange:e=>s(e.target.value),placeholder:t?U(`已配置,输入新值可替换`,`Configured; enter a new key to replace`):U(`输入 API Key`,`Enter API key`)})]}),(0,W.jsxs)(`details`,{className:`pi-provider-advanced`,children:[(0,W.jsx)(`summary`,{children:U(`自定义设置`,`Custom settings`)}),(0,W.jsxs)(`label`,{children:[U(`API 地址(可选)`,`API URL (optional)`),(0,W.jsx)(`input`,{type:`url`,maxLength:2048,value:c,onChange:e=>l(e.target.value),placeholder:U(`使用提供方默认地址`,`Use provider default URL`)})]})]}),(0,W.jsx)(`button`,{type:`submit`,disabled:n||m||f||!o.trim()&&(c.trim()===u||!t),children:m?U(`保存中…`,`Saving…`):t?U(`保存`,`Save`):U(`连接`,`Connect`)}),g&&(0,W.jsx)(`p`,{className:`pi-settings-error`,role:`alert`,children:g})]})}function ky({setupMode:e=!1,onReturnToConversation:t,getProviders:n,getProviderModels:r,updateProviderModel:i,logoutProvider:a,addCustomProvider:o,startLogin:s,getLogin:c,getActiveLogin:l,respondLogin:u,cancelLogin:d,refreshModels:f}){let[p,m]=(0,B.useState)([]),[h,g]=(0,B.useState)(!1),[_,v]=(0,B.useState)(e?`builtin`:null),[y,b]=(0,B.useState)(``),[x,S]=(0,B.useState)(null),[C,w]=(0,B.useState)(null),[T,E]=(0,B.useState)(Ty),[D,O]=(0,B.useState)(null),[k,A]=(0,B.useState)(``),[ee,j]=(0,B.useState)(``),[M,N]=(0,B.useState)(!1),P=(0,B.useRef)(null);(0,B.useEffect)(()=>{e&&v(e=>e??`builtin`)},[e]),(0,B.useEffect)(()=>{let e=!0;return l().then(t=>{e&&t&&O(e=>e??t)}).catch(()=>{}),()=>{e=!1,P.current?.popup?.close()}},[]);let te=async()=>{m(await n()),g(!0)},F=async e=>{let t=P.current,n=e.authorization??(e.event?.type===`auth_url`||e.event?.type===`device_code`?e.event:void 0);if(t?.id===e.id&&n){let e=Ey(n.type===`auth_url`?n.url:n.verificationUri);if(e){try{t.popup&&!t.popup.closed?t.popup.location.replace(e):window.open(e,`_blank`,`noopener,noreferrer`)}catch{t.popup?.close()}P.current=null}}t?.id===e.id&&(e.status===`done`||e.status===`error`||e.status===`cancelled`)&&(t.popup?.close(),P.current=null),O(e),e.status===`done`&&(v(null),S(null),await Promise.all([te(),f()]))};(0,B.useEffect)(()=>{te().catch(e=>{g(!0),j(e instanceof Error?e.message:U(`无法读取模型提供方`,`Could not load model providers`))})},[]),(0,B.useEffect)(()=>{if(!D||D.status===`done`||D.status===`error`||D.status===`cancelled`)return;let e=!0,t=window.setInterval(()=>{c(D.id).then(async t=>{e&&await F(t)}).catch(t=>{e&&j(t instanceof Error?t.message:U(`登录状态不可用`,`Login status is unavailable`))})},700);return()=>{e=!1,window.clearInterval(t)}},[D?.id,D?.status]);let I=M||D?.status===`running`||D?.status===`waiting`,L=p.find(e=>e.id===D?.providerId)?.name,ne=p.filter(e=>e.configured),R=p.filter(e=>!e.configured&&e.methods.length>0),re=R.find(e=>e.id===y)??(e?R.find(e=>e.id===`openai-codex`)??R.find(e=>e.methods.includes(`oauth`)):void 0)??R.find(e=>e.id===`openai`)??R[0],ie=async(e,t,n)=>{P.current=t===`oauth`?{id:null,popup:Dy()}:null,N(!0),j(``),A(``);try{let{id:r}=await s(e,t,n);P.current&&(P.current.id=r),await F(await c(r))}catch(e){P.current?.popup?.close(),P.current=null,j(e instanceof Error?e.message:U(`无法开始登录`,`Could not start sign-in`)),D||l().then(e=>{e&&O(e)}).catch(()=>{})}finally{N(!1)}},z=async e=>{if(D){N(!0),j(``);try{await u(D.id,e),A(``),await F(await c(D.id))}catch(e){j(e instanceof Error?e.message:U(`提交失败`,`Submission failed`))}finally{N(!1)}}},ae=async()=>{N(!0),j(``);try{await o(T);let e=T.id;await te(),b(e),v(`builtin`),E(Ty)}catch(e){j(e instanceof Error?e.message:U(`无法添加自定义提供方`,`Could not add custom provider`))}finally{N(!1)}},oe=async e=>{N(!0),j(``);try{await a(e),await te(),w(null),S(null)}catch(e){j(e instanceof Error?e.message:U(`移除认证失败`,`Could not remove credentials`))}finally{N(!1)}},se=D?.authorization??(D?.event?.type===`auth_url`||D?.event?.type===`device_code`?D.event:void 0),ce=D?.status===`waiting`&&D.prompt&&D.prompt.type!==`select`&&(0,W.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),k.trim()&&z(k.trim())},children:[(0,W.jsx)(`label`,{htmlFor:`pi-provider-answer`,children:D.prompt.message}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`input`,{id:`pi-provider-answer`,type:D.prompt.type===`secret`?`password`:`text`,autoComplete:`off`,placeholder:D.prompt.placeholder,value:k,onChange:e=>A(e.target.value)}),(0,W.jsx)(`button`,{type:`submit`,disabled:M||!k.trim(),children:U(`继续`,`Continue`)})]})]});return(0,W.jsxs)(`div`,{className:`pi-settings-content`,children:[(0,W.jsx)(`h2`,{children:e?U(`先连接一个模型`,`Connect a model to begin`):U(`模型`,`Models`)}),(0,W.jsx)(`p`,{className:`pi-settings-intro`,children:e?U(`当前没有可用模型。选择提供方完成认证,再在会话中选择模型;也可以添加自定义提供方。`,`No models are available yet. Sign in to a provider, then choose a model in the conversation. You can also add a custom provider.`):U(`已接入的提供方显示在这里。添加新的提供方后,即可在会话中选择其模型。`,`Connected providers appear here. Add a provider to use its models in a conversation.`)}),ee&&(0,W.jsx)(`p`,{className:`pi-settings-error`,role:`alert`,children:ee}),D&&(0,W.jsxs)(`section`,{className:`pi-provider-flow`,"aria-label":U(`模型登录`,`Model sign-in`),children:[(0,W.jsxs)(`div`,{className:`pi-provider-flow-head`,children:[(0,W.jsxs)(`strong`,{children:[U(`模型登录`,`Model sign-in`),L?` · ${L}`:``]}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>{P.current?.id===D.id&&(P.current.popup?.close(),P.current=null),D.status===`running`||D.status===`waiting`?d(D.id).finally(()=>O(null)):O(null)},children:D.status===`running`||D.status===`waiting`?U(`取消`,`Cancel`):U(`关闭`,`Close`)})]}),D.status===`done`&&(0,W.jsxs)(`div`,{role:`status`,children:[(0,W.jsx)(`p`,{children:U(`已连接。现在可以在会话中选择该提供方的模型。`,`Connected. You can now select this provider’s models in a conversation.`)}),(0,W.jsx)(`button`,{type:`button`,onClick:t,children:U(`返回会话选择模型`,`Return to conversation and choose a model`)})]}),D.status===`error`&&(0,W.jsx)(`p`,{role:`alert`,children:D.error}),D.status===`running`&&!se&&(0,W.jsx)(`p`,{role:`status`,children:U(`正在等待提供方响应…`,`Waiting for the provider…`)}),D.event?.type===`info`&&(0,W.jsxs)(`p`,{children:[D.event.message,D.event.links?.map(e=>{let t=Ey(e.url);return t&&(0,W.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,children:e.label??U(`打开链接`,`Open link`)},t)})]}),D.event?.type===`progress`&&se?.type!==`auth_url`&&(0,W.jsx)(`p`,{children:D.event.message}),se?.type===`auth_url`&&(0,W.jsxs)(`p`,{role:`status`,children:[U(`请在授权页面完成登录;若页面未自动打开,请点击右侧链接。完成后这里会自动更新。`,`Complete sign-in on the authorization page. If it did not open, use the link. This page will update automatically.`),` `,Ey(se.url)&&(0,W.jsx)(`a`,{href:Ey(se.url),target:`_blank`,rel:`noopener noreferrer`,children:U(`打开授权页面`,`Open authorization page`)})]}),se?.type===`device_code`&&(0,W.jsxs)(`p`,{children:[U(`在`,`On the`),` `,Ey(se.verificationUri)&&(0,W.jsx)(`a`,{href:Ey(se.verificationUri),target:`_blank`,rel:`noopener noreferrer`,children:U(`验证页面`,`verification page`)}),` `,U(`输入代码`,`enter code`),` `,(0,W.jsx)(`code`,{children:se.userCode})]}),D.status===`waiting`&&D.prompt?.type===`select`&&(0,W.jsxs)(`div`,{className:`pi-provider-options`,children:[(0,W.jsx)(`p`,{children:D.prompt.message}),D.prompt.options.map(e=>(0,W.jsxs)(`button`,{type:`button`,disabled:M,onClick:()=>{z(e.id)},children:[e.label,e.description&&(0,W.jsx)(`small`,{children:e.description})]},e.id))]}),ce&&D.prompt?.type===`manual_code`&&se?.type===`auth_url`?(0,W.jsxs)(`details`,{className:`pi-provider-manual-login`,children:[(0,W.jsx)(`summary`,{children:U(`无法自动完成?手动输入授权码`,`Can't finish automatically? Enter an authorization code`)}),ce]}):ce]}),(0,W.jsxs)(`section`,{className:`pi-provider-list`,"aria-label":U(`已接入的模型提供方`,`Connected model providers`),children:[ne.map(e=>(0,W.jsxs)(`div`,{className:`pi-provider-card`,children:[(0,W.jsxs)(`div`,{className:`pi-provider-card-head`,children:[(0,W.jsxs)(`span`,{className:`pi-provider-name`,children:[e.name,(0,W.jsx)(`span`,{className:`pi-provider-dot`,role:`img`,"aria-label":U(`已配置认证`,`Authentication configured`)}),(0,W.jsx)(`small`,{children:U(`已配置`,`Configured`)})]}),(0,W.jsx)(`button`,{type:`button`,disabled:I,"aria-label":`${U(`编辑`,`Edit`)} ${e.name}`,"aria-expanded":x===e.id,onClick:()=>{v(null),S(x===e.id?null:e.id)},children:U(`编辑`,`Edit`)})]}),x===e.id&&(0,W.jsxs)(`div`,{className:`pi-provider-editor`,children:[e.methods.includes(`api_key`)&&(0,W.jsx)(Oy,{provider:e,configured:!0,busy:!!I,getProviderModels:r,updateProviderModel:i,onConnect:t=>ie(e.id,`api_key`,t)},e.id),e.methods.includes(`oauth`)&&(0,W.jsx)(`div`,{className:`pi-provider-methods`,children:(0,W.jsx)(`button`,{type:`button`,disabled:!!I,onClick:()=>{ie(e.id,`oauth`)},children:U(`网页登录`,`Browser sign-in`)})}),(0,W.jsx)(wy,{providerId:e.id,getModels:r,updateModel:i}),e.storedCredential&&(0,W.jsx)(`div`,{className:`pi-provider-credential-action`,children:(0,W.jsx)(`button`,{type:`button`,disabled:I,onClick:()=>w(e.id),children:U(`移除认证`,`Remove credentials`)})}),!e.storedCredential&&(0,W.jsx)(`p`,{className:`pi-provider-auth-source`,children:U(`当前认证来自环境变量、模型配置或其他运行时来源,请在对应位置移除。`,`Authentication comes from an environment variable, model configuration, or another runtime source. Remove it at its source.`)}),C===e.id&&(0,W.jsxs)(`div`,{className:`pi-model-confirm`,role:`group`,"aria-label":U(`确认移除认证`,`Confirm credential removal`),children:[(0,W.jsx)(`span`,{children:U(`移除本机保存的认证后,该模型可能无法继续使用。`,`Removing stored credentials may make this provider unavailable.`)}),(0,W.jsx)(`button`,{type:`button`,disabled:M,onClick:()=>{oe(e.id)},children:U(`确认移除`,`Remove`)}),(0,W.jsx)(`button`,{type:`button`,disabled:M,onClick:()=>w(null),children:U(`取消`,`Cancel`)})]})]})]},e.id)),h&&ne.length===0&&(0,W.jsx)(`p`,{className:`pi-provider-empty`,children:U(`尚未接入提供方`,`No providers connected yet`)}),!h&&(0,W.jsx)(`p`,{role:`status`,children:U(`正在读取模型提供方…`,`Loading model providers…`)})]}),_===`builtin`&&(0,W.jsxs)(`section`,{className:`pi-provider-add-card`,"aria-label":U(`添加提供方`,`Add provider`),children:[(0,W.jsxs)(`div`,{className:`pi-provider-flow-head`,children:[(0,W.jsx)(`strong`,{children:U(`添加提供方`,`Add provider`)}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>v(null),children:U(`关闭`,`Close`)})]}),re?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`label`,{htmlFor:`pi-provider-select`,children:U(`提供方`,`Provider`)}),(0,W.jsx)(`select`,{id:`pi-provider-select`,value:re.id,onChange:e=>b(e.target.value),children:R.map(e=>(0,W.jsx)(`option`,{value:e.id,children:e.name},e.id))}),re.methods.includes(`api_key`)&&(0,W.jsx)(Oy,{provider:re,configured:!1,busy:!!I,getProviderModels:r,updateProviderModel:i,onConnect:e=>ie(re.id,`api_key`,e)},re.id),re.methods.includes(`oauth`)&&(0,W.jsx)(`div`,{className:`pi-provider-methods`,children:(0,W.jsx)(`button`,{type:`button`,disabled:!!I,onClick:()=>{ie(re.id,`oauth`)},children:U(`网页登录`,`Browser sign-in`)})}),(0,W.jsx)(`p`,{children:U(`认证完成后,可在提供方的“编辑”中调整模型目录。`,`After sign-in, open the provider’s Edit panel to adjust its model catalog.`)})]}):(0,W.jsx)(`p`,{children:U(`没有可添加的提供方。`,`No providers can be added.`)})]}),_===`custom`&&(0,W.jsxs)(`section`,{className:`pi-provider-add-card`,"aria-label":U(`添加自定义提供方`,`Add custom provider`),children:[(0,W.jsxs)(`div`,{className:`pi-provider-flow-head`,children:[(0,W.jsx)(`strong`,{children:U(`添加自定义提供方`,`Add custom provider`)}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>v(null),children:U(`关闭`,`Close`)})]}),(0,W.jsx)(`p`,{children:U(`适用于兼容 Pi 已支持协议的模型服务。保存后再添加 API Key;密钥不会写入 models.json。`,`For model services compatible with Pi’s supported protocols. Add an API key after saving; it will not be written to models.json.`)}),(0,W.jsxs)(`form`,{className:`pi-provider-custom-form`,onSubmit:e=>{e.preventDefault(),ae()},children:[(0,W.jsxs)(`label`,{children:[U(`名称`,`Name`),(0,W.jsx)(`input`,{required:!0,maxLength:100,value:T.name,onChange:e=>E({...T,name:e.target.value}),placeholder:U(`我的模型服务`,`My model service`)})]}),(0,W.jsxs)(`label`,{children:[U(`提供方 ID`,`Provider ID`),(0,W.jsx)(`input`,{required:!0,maxLength:64,value:T.id,onChange:e=>E({...T,id:e.target.value}),placeholder:`my-provider`})]}),(0,W.jsxs)(`label`,{children:[U(`接口地址`,`API URL`),(0,W.jsx)(`input`,{required:!0,type:`url`,maxLength:2048,value:T.baseUrl,onChange:e=>E({...T,baseUrl:e.target.value}),placeholder:`https://api.example.com/v1`})]}),(0,W.jsxs)(`label`,{children:[U(`接口协议`,`API protocol`),(0,W.jsxs)(`select`,{value:T.api,onChange:e=>E({...T,api:e.target.value}),children:[(0,W.jsx)(`option`,{value:`openai-completions`,children:`OpenAI Chat Completions`}),(0,W.jsx)(`option`,{value:`openai-responses`,children:`OpenAI Responses`}),(0,W.jsx)(`option`,{value:`anthropic-messages`,children:`Anthropic Messages`})]})]}),(0,W.jsxs)(`label`,{children:[U(`模型 ID`,`Model ID`),(0,W.jsx)(`input`,{required:!0,maxLength:200,value:T.modelId,onChange:e=>E({...T,modelId:e.target.value}),placeholder:`model-name`})]}),(0,W.jsx)(`button`,{type:`submit`,disabled:M,children:U(`保存并继续`,`Save and continue`)})]})]}),!_&&(0,W.jsxs)(`div`,{className:`pi-provider-add-actions`,children:[(0,W.jsx)(`button`,{type:`button`,disabled:!h||R.length===0||I,onClick:()=>{S(null),v(`builtin`),b(``)},children:U(`+ 添加提供方`,`+ Add provider`)}),(0,W.jsx)(`button`,{type:`button`,disabled:I,onClick:()=>{S(null),v(`custom`)},children:U(`+ 添加自定义提供方`,`+ Add custom provider`)})]})]})}var Ay=`pi-web-theme`,jy=new Set,My=window.matchMedia(`(prefers-color-scheme: dark)`),Ny=Py();function Py(){try{let e=localStorage.getItem(Ay);if(e===`light`||e===`dark`||e===`system`)return e}catch{}return`system`}function Fy(){document.body.toggleAttribute(`data-ds-dark-theme`,Ny===`dark`||Ny===`system`&&My.matches)}function Iy(){Fy(),My.addEventListener(`change`,Fy),window.addEventListener(`storage`,e=>{e.key===Ay&&(Ny=Py(),Fy(),jy.forEach(e=>e()))})}function Ly(e){Ny=e;try{localStorage.setItem(Ay,e)}catch{}Fy(),jy.forEach(e=>e())}function Ry(){return(0,B.useSyncExternalStore)(e=>(jy.add(e),()=>{jy.delete(e)}),()=>Ny)}var zy={group:`_group_8jvbt_4`,title:`_title_8jvbt_12`,cubeRow:`_cubeRow_8jvbt_19`,themeCube:`_themeCube_8jvbt_29`,selected:`_selected_8jvbt_48`};function By(){let e=Ry(),t=_e(),n=[{id:`light`,label:t===`zh`?`浅色`:`Light`,Icon:lt},{id:`dark`,label:t===`zh`?`深色`:`Dark`,Icon:ut},{id:`system`,label:t===`zh`?`跟随系统`:`System`,Icon:dt}];return(0,W.jsxs)(`div`,{className:zy.group,children:[(0,W.jsx)(`div`,{className:zy.title,children:t===`zh`?`外观`:`Appearance`}),(0,W.jsx)(`div`,{className:zy.cubeRow,children:n.map(({id:t,label:n,Icon:r})=>(0,W.jsxs)(`button`,{type:`button`,className:F(zy.themeCube,e===t&&zy.selected),"aria-pressed":e===t,onClick:()=>Ly(t),children:[(0,W.jsx)(r,{}),n]},t))})]})}var Vy={selectorWrap:`_selectorWrap_5eqgx_1`,selector:`_selector_5eqgx_1`,value:`_value_5eqgx_23`,option:`_option_5eqgx_24`,chevron:`_chevron_5eqgx_25`,menu:`_menu_5eqgx_27`};function Hy({label:e,menuLabel:t,value:n,options:r,disabled:i,onChange:a}){let[o,s]=(0,B.useState)(!1),c=(0,B.useId)(),l=(0,B.useRef)(null),u=(0,B.useRef)(null),d=(0,B.useRef)(null);return(0,B.useEffect)(()=>{i&&s(!1)},[i]),(0,B.useEffect)(()=>{if(!o)return;d.current?.focus();let e=e=>{l.current?.contains(e.target)||s(!1)},t=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopImmediatePropagation(),s(!1),u.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[o]),(0,W.jsxs)(`div`,{className:Vy.selectorWrap,ref:l,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||s(!1)},children:[(0,W.jsxs)(`button`,{ref:u,type:`button`,className:Vy.selector,"aria-label":e,"aria-haspopup":`menu`,"aria-expanded":o,"aria-controls":o?c:void 0,disabled:i,onClick:()=>s(e=>!e),children:[(0,W.jsx)(`span`,{className:Vy.value,children:r.find(e=>e.id===n)?.label}),(0,W.jsx)(`svg`,{className:Vy.chevron,width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`m3.5 5.25 3.5 3.5 3.5-3.5`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinecap:`round`,strokeLinejoin:`round`})})]}),o&&(0,W.jsx)(`div`,{id:c,className:Vy.menu,role:`menu`,"aria-label":t,onKeyDown:e=>{if(![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=Array.from(e.currentTarget.querySelectorAll(`[role="menuitemradio"]`)),n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowDown`?1:t.length-1))%t.length]?.focus()},children:r.map(e=>(0,W.jsxs)(`button`,{ref:e.id===n?d:void 0,type:`button`,role:`menuitemradio`,"aria-checked":e.id===n,className:Vy.option,onClick:()=>{s(!1),u.current?.focus(),e.id!==n&&a(e.id)},children:[(0,W.jsx)(`span`,{children:e.label}),e.id===n&&(0,W.jsx)(`svg`,{className:Vy.chevron,width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`m3 8 3.2 3.2L13 4.5`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`})})]},e.id))})]})}var Uy={row:`_row_1rrpk_1`,title:`_title_1rrpk_9`},Wy=[{id:`zh`,label:`中文`},{id:`en`,label:`English`}];function Gy(){let e=_e(),t=e===`zh`?`语言`:`Language`;return(0,W.jsxs)(`div`,{className:Uy.row,children:[(0,W.jsx)(`div`,{className:Uy.title,children:t}),(0,W.jsx)(Hy,{label:t,menuLabel:e===`zh`?`选择语言`:`Choose language`,value:e,options:Wy,onChange:ge})]})}var Ky=class extends Error{status;reason;constructor(e,t,n){super(e),this.name=`HttpError`,this.status=t,this.reason=n}},qy={请等待当前回复结束后再升级:`Wait for the current reply to finish before updating.`,请等待所有聊天任务结束后再升级:`Wait for all chat tasks to finish before updating.`};function Jy(e,t,n){return e instanceof Ky&&e.status===404?t===`zh`?`后台服务仍在运行旧版。请重启 pi-webapp 后重新打开页面,再检查更新。`:`The background service is still running an older version. Restart pi-webapp, reopen this page, then check again.`:e instanceof Error&&e.message?(t===`en`?qy[e.message]:void 0)??e.message:n===`check`?t===`zh`?`检查更新失败`:`Could not check for updates`:t===`zh`?`升级失败`:`Update failed`}function Yy({getUpdate:e,getRunningVersion:t,setUpdateChannel:n,cancelUpdate:r,update:i}){let a=_e(),[o,s]=(0,B.useState)(null),[c,l]=(0,B.useState)(!0),[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)(!1),[m,h]=(0,B.useState)(null),[g,_]=(0,B.useState)(!1),[v,y]=(0,B.useState)(``),b=(0,B.useRef)(!1),x=(0,B.useRef)(!1),S=(0,B.useRef)(0),C=(0,B.useRef)(!0);(0,B.useEffect)(()=>(C.current=!0,()=>{C.current=!1}),[]);let w=async()=>{let t=++S.current;l(!0),y(``);try{let n=await e();C.current&&t===S.current&&s(n)}catch(e){C.current&&t===S.current&&(s(null),y(Jy(e,a,`check`)))}finally{C.current&&t===S.current&&l(!1)}};return(0,B.useEffect)(()=>{w();let e=()=>{w()};return window.addEventListener(`pi-update-channel`,e),()=>{window.removeEventListener(`pi-update-channel`,e)}},[]),(0,B.useEffect)(()=>{if(!m)return;let e=!1,n=new AbortController,r,i=setTimeout(()=>{e=!0,n.abort(),clearTimeout(r),h(null),_(!0),y(ve(a,`新版未能及时就绪,后台可能已回退到旧版。请刷新页面检查当前版本;若无法连接,请重新打开应用。`,`The new version was not ready in time; the backend may have rolled back. Refresh to check the running version, or reopen the app if disconnected.`)),j(Error(`Updated service did not become ready within 60 seconds`),{stage:`update_restart`,code:`update_restart_timeout`,route:`/api/update/version`,timeoutMs:6e4})},6e4),o=async()=>{try{let r=await t(n.signal);if(e)return;if(r.current===m){clearTimeout(i),location.reload();return}}catch{}e||(r=setTimeout(()=>{o()},1200))};return r=setTimeout(()=>{o()},1200),()=>{e=!0,n.abort(),clearTimeout(r),clearTimeout(i)}},[m]),{status:o,checking:c,installing:u,cancelling:f,targetVersion:m,restartTimedOut:g,error:v,check:w,install:async()=>{if(b.current||c||!o?.available||!o.canRestart||m||g||o.downgrade&&!window.confirm(ve(a,`将从 ${o.current} 切换至稳定版 ${o.latest}。部分新功能可能不可用;请先备份重要数据。是否继续?`,`Switch from ${o.current} to stable ${o.latest}? Some new features may be unavailable. Back up important data before continuing.`)))return;b.current=!0,d(!0),y(``);let t=o.channel&&o.latest?{channel:o.channel,version:o.latest,...o.downgrade?{allowDowngrade:!0}:{}}:void 0;try{let e;try{e=await i(t)}catch(n){if(n?.reason!==`update_confirm_required`)throw n;if(!window.confirm(ve(a,`${n.message}。\n\n仍然升级?`,`${n.message}.\n\nUpdate anyway?`)))return;e=await i({...t,force:!0})}C.current&&h(e.version)}catch(t){C.current&&y(Jy(t,a,`install`));try{let t=await e();C.current&&s(t)}catch{}}finally{b.current=!1,C.current&&d(!1)}},changeChannel:async e=>{if(!(!n||c||u||m)){++S.current,l(!0),y(``);try{await n(e),window.dispatchEvent(new Event(`pi-update-channel`))}catch(e){C.current&&(l(!1),y(Jy(e,a,`check`)))}}},cancel:async()=>{if(!(!r||x.current||m)){x.current=!0,p(!0),y(``);try{await r(),_(!1),await w()}catch(e){C.current&&y(Jy(e,a,`install`))}finally{x.current=!1,C.current&&p(!1)}}}}}var Xy=(0,B.createContext)(null);function Zy({actions:e,children:t}){let n=Yy(e);return(0,W.jsx)(Xy.Provider,{value:n,children:t})}function Qy(){return(0,B.useContext)(Xy)}function $y(e){let t=/(?:^| )PiDesktop\/(\d+\.\d+\.\d+(?:-[\w.-]+)?) PiDesktopBuild\/(\d+)(?: |$)/.exec(e);return!t||t[1].length>80||!Number.isSafeInteger(Number(t[2]))?null:{version:t[1],build:Number(t[2]),handoff:Number(t[2])>=14}}var eb={group:`_group_14gt8_1`,row:`_row_14gt8_8`,details:`_details_14gt8_15`,preference:`_preference_14gt8_17`,title:`_title_14gt8_25`,summary:`_summary_14gt8_31`,note:`_note_14gt8_31`,error:`_error_14gt8_31`,diagnostics:`_diagnostics_14gt8_41`,actions:`_actions_14gt8_51`};function tb(e){let t=Qy();return t?(0,W.jsx)(rb,{...e,controller:t}):(0,W.jsx)(nb,{...e})}function nb(e){let t=Yy(e);return(0,W.jsx)(rb,{...e,controller:t})}function rb(e){let t=_e(),n=(e,n)=>ve(t,e,n),{status:r,checking:i,installing:a,cancelling:o,targetVersion:s,restartTimedOut:c,error:l,check:u,install:d,changeChannel:f,cancel:p}=e.controller,m=$y(navigator.userAgent),h=!(!r?.latest||r.available||i),g=r?(0,W.jsxs)(W.Fragment,{children:[n(`当前版本`,`Current version`),` `,r.current,r.available&&r.latest?` → ${r.latest}`:h&&(0,W.jsxs)(W.Fragment,{children:[` · `,(0,W.jsx)(`span`,{role:`status`,children:n(`已是最新版本`,`Up to date`)})]})]}):i?n(`正在读取版本…`,`Reading version…`):n(`暂时无法读取版本`,`Version unavailable`),_=!!(m&&r?.desktopShell&&String(m.build)!==r.desktopShell.build)||!!(r?.launcherHandoff?.required||r?.requiresDesktopUpgrade||r?.launcher&&!r.launcher.releaseChannels),v=!!(m||r?.launcher||r?.desktopShell);return(0,W.jsxs)(`section`,{className:eb.group,"aria-label":n(`应用更新`,`App updates`),children:[r?.channel&&e.setUpdateChannel&&(0,W.jsxs)(`div`,{className:eb.preference,children:[(0,W.jsx)(`div`,{className:eb.title,children:n(`更新偏好`,`Update preference`)}),(0,W.jsx)(Hy,{label:n(`更新偏好`,`Update preference`),menuLabel:n(`选择更新偏好`,`Choose update preference`),value:r.channel,disabled:i||a||!!s||c,onChange:e=>{f(e)},options:[{id:`stable`,label:n(`稳定版(推荐)`,`Stable (recommended)`)},{id:`alpha`,label:n(`体验版(包含 alpha)`,`Preview (including alpha)`)}]})]}),r?.channel===`alpha`&&(0,W.jsx)(`p`,{className:eb.note,children:n(`体验版包含尚在验证的新功能,可能不稳定。`,`Preview releases include features still under testing and may be unstable.`)}),(0,W.jsxs)(`div`,{className:eb.row,children:[(0,W.jsxs)(`div`,{className:eb.details,children:[(0,W.jsx)(`div`,{className:eb.title,children:n(`应用更新`,`App updates`)}),(0,W.jsx)(`p`,{className:eb.summary,children:g})]}),(0,W.jsxs)(`div`,{className:eb.actions,children:[r?.available&&r.canRestart&&!s&&!c&&(0,W.jsx)(Xv,{variant:`primary`,disabled:a||i,onClick:()=>{d()},children:a?n(`正在安装…`,`Installing…`):r.downgrade?n(`切换到稳定版并重启`,`Switch to stable and restart`):n(`升级并重启`,`Update and restart`)}),(r?.recovery?.canCancel||a)&&e.cancelUpdate&&!s&&(0,W.jsx)(Xv,{variant:`outline`,disabled:o,onClick:()=>{p()},children:o?n(`正在取消…`,`Cancelling…`):a?n(`取消下载`,`Cancel download`):n(`取消未完成的升级`,`Cancel unfinished update`)}),(0,W.jsx)(Xv,{variant:`outline`,disabled:i||a||!!s,onClick:()=>{u()},children:i?n(`检查中…`,`Checking…`):n(`检查更新`,`Check for updates`)})]})]}),r?.launcherHandoff?.required&&(0,W.jsxs)(`div`,{className:eb.note,children:[(0,W.jsx)(`p`,{children:n(`安装新版桌面不会自动接管仍在运行的共享后台。需要先安全交接启动器,再使用体验版在线升级。交接会等待聊天空闲、终端关闭和真实图稿保存确认,并保留原本地地址。`,`Installing a desktop update does not take over a running shared backend. Safely hand off the launcher before preview updates. Handoff requires idle chats, closed terminals and real drawing save confirmations, and preserves the local address.`)}),m?.handoff?(0,W.jsx)(`a`,{href:`pi-desktop://launcher-handoff`,target:`_blank`,rel:`noreferrer`,children:n(`安全切换到当前桌面启动器…`,`Safely switch to this desktop launcher…`)}):(0,W.jsxs)(`p`,{children:[n(`安全交接入口从桌面 build 14 开始提供。build 12 已支持体验版,但缺少旧共享后台交接功能;无需重复安装 build 12。`,`The safe handoff action is available from desktop build 14. Build 12 supports preview releases but lacks shared-backend handoff; reinstalling build 12 will not help.`),` `,(0,W.jsx)(`a`,{href:`https://github.com/chengzhiyi/pi-webapp/releases`,target:`_blank`,rel:`noreferrer`,children:n(`下载支持安全交接的桌面版本`,`Get a desktop release with safe handoff`)})]}),!r.launcherHandoff.supported&&(0,W.jsx)(`p`,{children:n(`当前后台还缺少安全交接协议:请先选择稳定版并升级业务包,再从桌面菜单重试交接。`,`This backend lacks the safe handoff protocol: first update its business package on Stable, then retry from the desktop menu.`)})]}),r?.available&&!!r.pluginWarnings?.length&&(0,W.jsxs)(`div`,{className:eb.note,children:[(0,W.jsx)(`p`,{children:n(`以下插件在新版本中暂时不可用(不影响升级,数据保留):`,`These plugins will be unavailable on the new version (the update is not blocked; their data is kept):`)}),(0,W.jsx)(`ul`,{children:r.pluginWarnings.map(e=>(0,W.jsxs)(`li`,{children:[e.pluginId,`: `,e.message]},e.pluginId))})]}),r?.lastFailure&&!a&&!s&&(0,W.jsxs)(`p`,{className:eb.note,children:[n(`上次升级到 ${r.lastFailure.version} 未完成,已保留当前版本:`,`The last update to ${r.lastFailure.version} did not complete; the current version was kept: `),r.lastFailure.message]}),r?.reason&&(0,W.jsx)(`p`,{className:eb.note,children:r.reason}),r?.requiresDesktopUpgrade&&(0,W.jsxs)(`p`,{className:eb.note,children:[(0,W.jsx)(`a`,{href:`https://github.com/chengzhiyi/pi-webapp/releases`,target:`_blank`,rel:`noreferrer`,children:n(`下载新版桌面应用`,`Download desktop update`)}),n(`。安装支持更新通道的桌面版本后,可在此选择体验版并在线升级。`,`. Install a desktop release with update-channel support, then return here to select preview and update online.`)]}),s&&(0,W.jsx)(`p`,{className:eb.note,role:`status`,children:n(`正在重启并等待新版连接…`,`Restarting and waiting for the new version…`)}),l&&(0,W.jsx)(`p`,{className:eb.error,role:`alert`,children:l}),l?.includes(`Missing view flush acknowledgement`)&&(0,W.jsx)(`p`,{className:eb.note,children:n(`插件视图尚未确认保存。请保存并关闭绘图或编辑器;若视图已失联,请先在插件恢复记录中处理未确认的编辑,再重试升级。`,`A plugin view has not confirmed its save. Save and close drawings or editors; if a view disconnected, review its unconfirmed edits in plugin recovery before retrying.`)}),v&&(0,W.jsxs)(`details`,{className:eb.diagnostics,open:_,children:[(0,W.jsx)(`summary`,{children:n(`版本详情`,`Version details`)}),m&&(0,W.jsxs)(`p`,{className:eb.summary,children:[n(`当前桌面窗口`,`Current desktop window`),` `,m.version,` · build `,m.build]}),r?.launcher&&(0,W.jsxs)(`p`,{className:eb.summary,children:[n(`后台启动器`,`Backend launcher`),` `,r.launcher.version,` · `,n(`体验版持久化`,`Preview persistence`),` `,r.launcher.releaseChannels?n(`支持`,`supported`):n(`不支持`,`unsupported`)]}),r?.desktopShell&&(0,W.jsxs)(`p`,{className:eb.summary,children:[n(`后台启动时的桌面外壳`,`Desktop shell at backend startup`),` `,r.desktopShell.version,` · build `,r.desktopShell.build]}),r?.desktopShell&&(0,W.jsx)(`p`,{className:eb.note,children:n(`共享后台可能由旧版桌面启动。当前窗口的桌面版本请查看菜单「pi → 关于 pi」。业务包升级不会替换桌面应用。`,`A shared backend may have been started by an older desktop. For this window’s desktop version, see pi → About pi. Updating the business package does not replace the desktop app.`)})]})]})}var ib=`https://pi.emath.top`,ab=`https://github.com/chengzhiyi/pi-webapp/issues`;function ob(e,t){let n={home:``,quickStart:`getting-started`,troubleshooting:`troubleshooting`}[e];return`${ib}/${String(t).toLowerCase().startsWith(`zh`)?`zh/`:``}${n}`}function sb(e){let t=(t,n)=>ve(e,t,n);return[{id:`docs`,label:t(`使用文档`,`Documentation`),href:ob(`home`,e)},{id:`quick-start`,label:t(`快速开始`,`Quick start`),href:ob(`quickStart`,e)},{id:`troubleshooting`,label:t(`故障排查`,`Troubleshooting`),href:ob(`troubleshooting`,e)},{id:`issues`,label:t(`在 GitHub 上反馈问题`,`Report an issue on GitHub`),href:ab}]}var cb={row:`_row_wp8ea_1`,title:`_title_wp8ea_9`,summary:`_summary_wp8ea_15`,links:`_links_wp8ea_22`};function lb(){let e=_e(),t=(t,n)=>ve(e,t,n);return(0,W.jsxs)(`section`,{className:cb.row,"aria-label":t(`帮助与文档`,`Help & documentation`),children:[(0,W.jsx)(`div`,{className:cb.title,children:t(`帮助与文档`,`Help & documentation`)}),(0,W.jsx)(`p`,{className:cb.summary,children:t(`查看使用指南、快速开始和常见问题的解决方法。`,`Read the guides, get started quickly, and find fixes for common problems.`)}),(0,W.jsx)(`ul`,{className:cb.links,children:sb(e).map(e=>(0,W.jsx)(`li`,{children:(0,W.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,children:e.label})},e.id))})]})}var ub={triggerRow:`_triggerRow_f00qz_1`,railRow:`_railRow_f00qz_10`,trigger:`_trigger_f00qz_1`,rail:`_rail_f00qz_10`,triggerLabel:`_triggerLabel_f00qz_54`,overlay:`_overlay_f00qz_61`,mask:`_mask_f00qz_70`,panel:`_panel_f00qz_83`,nav:`_nav_f00qz_105`,navTitle:`_navTitle_f00qz_116`,navList:`_navList_f00qz_125`,navCell:`_navCell_f00qz_133`,active:`_active_f00qz_156`,navIcon:`_navIcon_f00qz_160`,navLabel:`_navLabel_f00qz_164`,content:`_content_f00qz_173`,header:`_header_f00qz_181`,actions:`_actions_f00qz_192`,close:`_close_f00qz_202`,options:`_options_f00qz_82`,hiddenLabel:`_hiddenLabel_f00qz_229`};function db(e){return e===`general`?(0,W.jsx)(We,{className:ub.navIcon,size:16}):e===`models`?(0,W.jsx)(ft,{className:ub.navIcon,size:16}):e===`packages`?(0,W.jsx)(gt,{className:ub.navIcon,size:16}):e===`plugins`||e===`extensions`?(0,W.jsx)(at,{className:ub.navIcon,size:16}):(0,W.jsx)(mt,{className:ub.navIcon,size:16})}function fb({title:e,sections:t,activeId:n,onSelect:r,onClose:i,children:a}){let o=_e(),s=(0,B.useId)(),c=(0,B.useRef)(null);return(0,B.useEffect)(()=>{c.current?.focus();let e=e=>{e.key===`Escape`&&!e.defaultPrevented&&!(e.target instanceof Element&&e.target.closest(`[role="menu"]`))&&i()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[i]),(0,W.jsxs)(`div`,{className:ub.overlay,role:`presentation`,children:[(0,W.jsx)(`div`,{className:ub.mask,"aria-hidden":`true`,onClick:i}),(0,W.jsxs)(`div`,{className:ub.panel,role:`dialog`,"aria-modal":`true`,"aria-labelledby":s,children:[(0,W.jsxs)(`nav`,{className:ub.nav,"aria-label":o===`zh`?`Pi 设置分类`:`Pi settings sections`,children:[(0,W.jsx)(`div`,{className:ub.navTitle,id:s,children:e}),(0,W.jsx)(`div`,{className:ub.navList,children:t.map(e=>(0,W.jsxs)(`button`,{type:`button`,className:`${ub.navCell} ${n===e.id?ub.active:``}`,"aria-current":n===e.id?`true`:void 0,onClick:()=>r(e.id),children:[db(e.id),(0,W.jsx)(`span`,{className:ub.navLabel,children:e.label})]},e.id))})]}),(0,W.jsxs)(`div`,{className:ub.content,children:[(0,W.jsxs)(`header`,{className:ub.header,children:[(0,W.jsx)(`div`,{className:ub.actions}),(0,W.jsx)(`button`,{ref:c,className:ub.close,type:`button`,onClick:i,"aria-label":o===`zh`?`关闭 Pi 设置`:`Close Pi settings`,children:(0,W.jsx)(Ze,{size:14})})]}),(0,W.jsx)(`div`,{className:ub.options,children:a})]})]})]})}function pb(e){return/^(?:npm:|git:|https?:\/\/|ssh:\/\/|git@)/i.test(e.trim())}function mb(e){let t=_e(),n=(e,n)=>ve(t,e,n),r=[{kind:`packages`,title:n(`包与扩展`,`Packages & extensions`),hint:n(`包可以包含扩展和技能;本地扩展也可以单独加载。`,`Packages can contain extensions and skills; local extensions can also be loaded separately.`),placeholder:n(`npm 包名、Git 地址或本地目录`,`npm package, Git URL, or local directory`)},{kind:`skills`,title:n(`技能`,`Skills`),hint:n(`Pi 已发现和加载的技能。`,`Skills discovered and loaded by Pi.`),placeholder:n(`SKILL.md 文件或目录路径`,`SKILL.md file or directory path`)}],i=[{id:`general`,label:n(`通用设置`,`General`)},{id:`models`,label:n(`模型`,`Models`)},...r.map(({kind:e,title:t})=>({id:e,label:e===`packages`?n(`包与扩展`,`Packages`):t}))],{onBack:a,getConfig:o,updateConfig:s}=e,[c,l]=(0,B.useState)(null),[u,d]=(0,B.useState)({packages:``,extensions:``,skills:``}),[f,p]=(0,B.useState)(e.setupMode?`models`:`general`),[m,h]=(0,B.useState)(!1),[g,_]=(0,B.useState)(!0),[v,y]=(0,B.useState)(``);(0,B.useEffect)(()=>{e.setupMode&&p(`models`)},[e.setupMode]),(0,B.useEffect)(()=>{let e=!0;return o().then(t=>{e&&l(t)}).catch(t=>{e&&y(t instanceof Error?t.message:n(`无法读取 Pi 设置`,`Could not load Pi settings`))}).finally(()=>{e&&_(!1)}),()=>{e=!1}},[]);let b=async()=>{_(!0),y(``);try{l(await o())}catch(e){y(e instanceof Error?e.message:n(`无法读取 Pi 设置`,`Could not load Pi settings`))}finally{_(!1)}},x=async(e,t,r)=>{h(!0),y(``);try{l(await s(e,`global`,t,r)),t===`add`&&d(t=>({...t,[e]:``}))}catch(e){y(e instanceof Error?e.message:n(`保存失败`,`Save failed`))}finally{h(!1)}},S=r.find(({kind:e})=>e===f),C=S?c?.global[S.kind]??[]:[],w=S?c?.installed?.[S.kind]??[]:[],T=S?u[S.kind].trim():``,E=S?.kind!==`packages`&&pb(T),D=new Set(c?.installed.packages.map(e=>e.source)??[]),O=c?.installed.extensions.filter(e=>!D.has(e.source))??[],k=c?.global.packages.filter(e=>!D.has(e))??[],A=u.extensions.trim(),ee=pb(A),j=e=>{d(t=>({...t,packages:e})),p(`packages`),y(``)};return(0,W.jsxs)(fb,{title:n(`Pi 设置`,`Pi Settings`),sections:i,activeId:f,onSelect:e=>{p(e),y(``)},onClose:a,children:[f===`general`&&(0,W.jsxs)(`div`,{className:`pi-settings-content`,children:[(0,W.jsx)(`h2`,{children:n(`通用设置`,`General`)}),(0,W.jsx)(`p`,{className:`pi-settings-intro`,children:n(`调整网页的显示方式。`,`Choose how the web interface appears.`)}),(0,W.jsxs)(`div`,{className:`pi-settings-general`,children:[(0,W.jsx)(Gy,{}),(0,W.jsx)(By,{}),(0,W.jsx)(tb,{getUpdate:e.getUpdate,getRunningVersion:e.getRunningVersion,setUpdateChannel:e.setUpdateChannel,cancelUpdate:e.cancelUpdate,update:e.update}),(0,W.jsx)(lb,{})]})]}),f===`models`&&(0,W.jsx)(ky,{setupMode:e.setupMode,onReturnToConversation:a,getProviders:e.getProviders,getProviderModels:e.getProviderModels,updateProviderModel:e.updateProviderModel,logoutProvider:e.logoutProvider,addCustomProvider:e.addCustomProvider,startLogin:e.startProviderLogin,getLogin:e.getProviderLogin,getActiveLogin:e.getActiveProviderLogin,respondLogin:e.respondProviderLogin,cancelLogin:e.cancelProviderLogin,refreshModels:e.refreshModels}),S&&(0,W.jsxs)(`div`,{className:`pi-settings-content`,children:[(0,W.jsx)(`h2`,{children:S.title}),(0,W.jsxs)(`p`,{className:`pi-settings-intro`,children:[S.hint,` `,n(`添加或移除后会重新加载 Pi 资源。`,`Pi resources reload after you add or remove one.`)]}),v&&(0,W.jsx)(`p`,{className:`pi-settings-error`,role:`alert`,children:v}),c?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`section`,{className:`pi-settings-section`,"aria-label":`${n(`已发现`,`Discovered `)}${S.title}`,children:[(0,W.jsxs)(`h3`,{children:[S.kind===`packages`?n(`已安装的包`,`Installed packages`):n(`已发现的技能`,`Discovered skills`),` `,(0,W.jsx)(`span`,{children:w.length})]}),(0,W.jsx)(`ul`,{children:w.length?w.map(e=>{let t=S.kind===`packages`?c.installed.extensions.filter(t=>t.source===e.source):[];return(0,W.jsxs)(`li`,{className:`pi-resource-item`,children:[(0,W.jsxs)(`div`,{className:`pi-resource-main`,children:[(0,W.jsx)(`strong`,{title:e.name,children:e.name}),(0,W.jsx)(`small`,{title:e.path||e.source,children:e.path||e.source}),t.length>0&&(0,W.jsxs)(`div`,{className:`pi-package-contents`,children:[(0,W.jsx)(`span`,{children:n(`包含扩展`,`Includes extensions`)}),t.map(e=>(0,W.jsx)(`span`,{title:e.path,children:e.name},e.path))]})]}),(0,W.jsxs)(`div`,{className:`pi-resource-actions`,children:[(0,W.jsxs)(`span`,{className:`pi-resource-meta`,children:[e.enabled?n(`已启用`,`Enabled`):n(`已停用`,`Disabled`),` · `,e.scope===`project`?n(`项目`,`Project`):e.scope===`user`?n(`用户`,`User`):n(`临时`,`Temporary`)]}),S.kind===`packages`&&c.global.packages.includes(e.source)&&(0,W.jsx)(`button`,{type:`button`,disabled:m,onClick:()=>{x(`packages`,`remove`,e.source)},children:n(`移除`,`Remove`)})]})]},`${e.path}:${e.source}`)}):(0,W.jsxs)(`li`,{className:`pi-settings-empty`,children:[n(`未发现`,`No `),S.title]})})]}),S.kind===`packages`&&(0,W.jsxs)(`section`,{className:`pi-settings-section`,"aria-label":n(`独立扩展`,`Standalone extensions`),children:[(0,W.jsxs)(`h3`,{children:[n(`独立扩展`,`Standalone extensions`),` `,(0,W.jsx)(`span`,{children:O.length})]}),(0,W.jsx)(`ul`,{children:O.length?O.map(e=>(0,W.jsxs)(`li`,{className:`pi-resource-item`,children:[(0,W.jsxs)(`div`,{className:`pi-resource-main`,children:[(0,W.jsx)(`strong`,{title:e.name,children:e.name}),(0,W.jsx)(`small`,{title:e.path,children:e.path})]}),(0,W.jsxs)(`span`,{className:`pi-resource-meta`,children:[e.enabled?n(`已启用`,`Enabled`):n(`已停用`,`Disabled`),` · `,e.scope===`project`?n(`项目`,`Project`):e.scope===`user`?n(`用户`,`User`):n(`临时`,`Temporary`)]})]},e.path)):(0,W.jsx)(`li`,{className:`pi-settings-empty`,children:n(`未发现独立扩展`,`No standalone extensions found`)})})]}),(0,W.jsxs)(`section`,{className:`pi-settings-section`,"aria-label":`${n(`手动配置`,`Configure `)}${S.title}`,children:[(0,W.jsx)(`h3`,{children:S.kind===`packages`?n(`添加包`,`Add package`):n(`手动配置技能`,`Configure skills manually`)}),(S.kind===`packages`?k:C).length>0&&(0,W.jsx)(`ul`,{children:(S.kind===`packages`?k:C).map(e=>(0,W.jsxs)(`li`,{className:`pi-config-item`,children:[(0,W.jsxs)(`div`,{className:`pi-resource-main`,children:[(0,W.jsx)(`code`,{title:e,children:e}),S.kind===`packages`&&(0,W.jsx)(`small`,{children:n(`已配置,但未发现安装目录`,`Configured, but installation directory was not found`)}),S.kind!==`packages`&&pb(e)&&(0,W.jsx)(`small`,{className:`pi-config-warning`,children:n(`未加载:包来源请在“包与扩展”中添加。`,`Not loaded: add package sources under Packages & extensions.`)})]}),(0,W.jsxs)(`div`,{className:`pi-resource-actions`,children:[S.kind!==`packages`&&pb(e)&&(0,W.jsx)(`button`,{type:`button`,disabled:m,onClick:()=>j(e),children:n(`转到包`,`Go to packages`)}),(0,W.jsx)(`button`,{type:`button`,disabled:m,"aria-label":`${n(`移除`,`Remove`)} ${e}`,onClick:()=>{x(S.kind,`remove`,e)},children:n(`移除`,`Remove`)})]})]},e))}),(0,W.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),T&&!E&&x(S.kind,`add`,T)},children:[(0,W.jsx)(`input`,{"aria-label":`${n(`添加`,`Add `)}${S.title}`,"aria-invalid":E||void 0,"aria-describedby":E?`pi-config-source-help`:void 0,placeholder:S.placeholder,value:u[S.kind],onChange:e=>d(t=>({...t,[S.kind]:e.target.value}))}),(0,W.jsx)(`button`,{type:`submit`,disabled:m||!T||E,children:n(`添加`,`Add`)})]}),E&&(0,W.jsxs)(`p`,{id:`pi-config-source-help`,className:`pi-config-hint`,children:[n(`这是包来源,请在「包」中添加。`,`This is a package source. Add it under Packages.`),(0,W.jsx)(`button`,{type:`button`,onClick:()=>j(T),children:n(`转到包`,`Go to packages`)})]})]}),S.kind===`packages`&&(0,W.jsxs)(`section`,{className:`pi-settings-section`,"aria-label":n(`手动配置扩展路径`,`Configure extension paths manually`),children:[(0,W.jsx)(`h3`,{children:n(`扩展路径`,`Extension paths`)}),c.global.extensions.length>0&&(0,W.jsx)(`ul`,{children:c.global.extensions.map(e=>(0,W.jsxs)(`li`,{className:`pi-config-item`,children:[(0,W.jsxs)(`div`,{className:`pi-resource-main`,children:[(0,W.jsx)(`code`,{title:e,children:e}),pb(e)&&(0,W.jsx)(`small`,{className:`pi-config-warning`,children:n(`未加载:包来源不能作为扩展路径,请在上方添加包。`,`Not loaded: package sources cannot be extension paths. Add the package above.`)})]}),(0,W.jsxs)(`div`,{className:`pi-resource-actions`,children:[pb(e)&&(0,W.jsx)(`button`,{type:`button`,disabled:m,onClick:()=>j(e),children:n(`填入包`,`Use as package`)}),(0,W.jsx)(`button`,{type:`button`,disabled:m,onClick:()=>{x(`extensions`,`remove`,e)},children:n(`移除`,`Remove`)})]})]},e))}),(0,W.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),A&&!ee&&x(`extensions`,`add`,A)},children:[(0,W.jsx)(`input`,{"aria-label":n(`添加扩展路径`,`Add extension path`),"aria-invalid":ee||void 0,"aria-describedby":ee?`pi-extension-source-help`:void 0,placeholder:n(`扩展文件或目录路径`,`Extension file or directory path`),value:u.extensions,onChange:e=>d(t=>({...t,extensions:e.target.value}))}),(0,W.jsx)(`button`,{type:`submit`,disabled:m||!A||ee,children:n(`添加扩展`,`Add extension`)})]}),ee&&(0,W.jsxs)(`p`,{id:`pi-extension-source-help`,className:`pi-config-hint`,children:[n(`这是包来源,请使用上方的“添加包”输入框。`,`This is a package source. Use the Add package field above.`),(0,W.jsx)(`button`,{type:`button`,onClick:()=>j(A),children:n(`填入包`,`Use as package`)})]})]})]}):g?(0,W.jsx)(`p`,{role:`status`,children:n(`正在读取设置…`,`Loading settings…`)}):(0,W.jsx)(`button`,{className:`pi-settings-retry`,type:`button`,onClick:()=>{b()},children:n(`重试读取设置`,`Retry loading settings`)})]},S.kind)]})}var hb={diagrams:`@pi-webapp/diagrams`,git:`@pi-webapp/git`,files:`@pi-webapp/files`,terminal:`@pi-webapp/terminal`};function gb({size:e=24}){return(0,W.jsxs)(`svg`,{"aria-hidden":`true`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,style:{display:`block`,flexShrink:0},children:[(0,W.jsx)(`path`,{d:`m14.5 4.5 5 5M4 20l5.3-1.3L20 8a2.8 2.8 0 0 0-4-4L5.3 14.7 4 20Z`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,W.jsx)(`path`,{d:`m5.5 14.5 4 4M8 15l8-8`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`})]})}var $={page:`_page_1c6kn_2`,pageHead:`_pageHead_1c6kn_4`,pageHeading:`_pageHeading_1c6kn_5`,pageIntro:`_pageIntro_1c6kn_7`,infoButton:`_infoButton_1c6kn_8`,toolbar:`_toolbar_1c6kn_10`,search:`_search_1c6kn_11`,iconButton:`_iconButton_1c6kn_15`,spin:`_spin_1c6kn_18`,crumb:`_crumb_1c6kn_20`,scope:`_scope_1c6kn_22`,error:`_error_1c6kn_23`,notice:`_notice_1c6kn_23`,group:`_group_1c6kn_26`,groupTitle:`_groupTitle_1c6kn_27`,cards:`_cards_1c6kn_28`,card:`_card_1c6kn_28`,artwork:`_artwork_1c6kn_31`,cardMain:`_cardMain_1c6kn_34`,titleRow:`_titleRow_1c6kn_35`,cardOpen:`_cardOpen_1c6kn_36`,tag:`_tag_1c6kn_42`,cardEnd:`_cardEnd_1c6kn_45`,switch:`_switch_1c6kn_46`,thumb:`_thumb_1c6kn_48`,back:`_back_1c6kn_50`,skeleton:`_skeleton_1c6kn_52`,pulse:`_pulse_1c6kn_1`,skeletonLine:`_skeletonLine_1c6kn_54`,detail:`_detail_1c6kn_56`,detailHead:`_detailHead_1c6kn_57`,detailMain:`_detailMain_1c6kn_59`,detailDesc:`_detailDesc_1c6kn_61`,detailName:`_detailName_1c6kn_62`,detailSection:`_detailSection_1c6kn_64`,danger:`_danger_1c6kn_69`},_b={pluginId:`@chengzhiyi/pi-excalidraw`,name:`Excalidraw`,official:!0,icon:`drawing`,installed:!1,enabled:!1,phase:`not-installed`};async function vb(e,t={},n={}){let r=ee(),i=e.split(`?`)[0],a=i===`/api/message`?ee():void 0,o=new Headers(t.headers);o.set(`X-Request-ID`,r),a&&o.set(`X-Operation-ID`,a);let s={requestId:r,operationId:a},c=performance.now();N(`request_start`,{...s,route:i,method:t.method??`GET`});try{let n=await fetch(e,{...t,headers:o});return s.requestId=n.headers.get(`X-Request-ID`)||r,s.operationId=n.headers.get(`X-Operation-ID`)||a,N(`request_end`,{...s,route:i,status:n.status,durationMs:Math.round(performance.now()-c)}),{response:n,correlation:s,route:i}}catch(e){let t={...s,route:i,stage:`network`,durationMs:Math.round(performance.now()-c)};throw N(`request_failed`,t),n.expectedNetworkFailure||j(e,t),e}}async function yb(e){let{response:t,correlation:n,route:r}=e,i;try{i=await t.json()}catch(e){throw j(e,{...n,route:r,status:t.status,stage:`response_parse`}),e}if(!t.ok){let e=new Ky(typeof i?.error==`string`?i.error:`Request failed: ${t.status}`,t.status,typeof i?.reason==`string`?i.reason:void 0),a=typeof i?.errorId==`string`&&/^[a-f0-9]{32}$/.test(i.errorId),o=i?.errorCode===`validation_error`||t.status<500&&i?.errorCode!==`unexpected_error`;throw a||i?.errorReported===!0||o||j(P(r)?O(e,`Agent or provider operation failed`):e,{...n,route:r,status:t.status,stage:`http`}),A(e),e}return i}async function bb(e,t,n){let r=M(),{response:i}=await vb(`/api/hosted-plugins${e}`,{method:t===void 0?`GET`:`POST`,credentials:`same-origin`,signal:n,headers:{...r?{Authorization:`Bearer ${r}`}:{},...t===void 0?{}:{"Content-Type":`application/json`}},body:t===void 0?void 0:JSON.stringify(t)}),a=await i.json();if(!i.ok)throw Object.assign(Error(a.error?.message??a.error??`Hosted plugin request failed (${i.status})`),{status:i.status,code:a.error?.code??a.errorCode,reason:a.error?.reason??a.reason});return a}var xb={catalog:e=>bb(``,void 0,e),manage:e=>bb(`/manage`,e),action:e=>bb(`/action`,e),decide:(e,t)=>bb(`/approvals`,{id:e,decision:t}),secret:(e,t,n)=>bb(`/secrets`,{pluginId:e,name:t,value:n}),signIn:e=>bb(`/secrets`,e),pendingViews:e=>bb(`/views`,{operation:`list-pending`,pluginId:e}),view:(e,t)=>bb(`/views`,e,t)},Sb={section:`_section_8lsu2_1`,notice:`_notice_8lsu2_4`,error:`_error_8lsu2_5`,devInfo:`_devInfo_8lsu2_6`,devProblems:`_devProblems_8lsu2_7`,actions:`_actions_8lsu2_13`,configuration:`_configuration_8lsu2_18`,rowActions:`_rowActions_8lsu2_19`};function Cb({pluginId:e,t}){let[n,r]=(0,B.useState)(null),[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(!1),[u,d]=(0,B.useState)(0);(0,B.useEffect)(()=>{let t=!0;return xb.pendingViews(e).then(e=>{t&&r(e.views)}).catch(e=>{t&&s(String(e))}),()=>{t=!1}},[e,u]);let f=async e=>{l(!0),s(``);try{await xb.view({pluginId:e.pluginId,sessionId:e.sessionId,generation:e.generation,mountId:e.mountId,viewToken:e.viewToken,operation:`discard`,confirmation:`discard-unconfirmed-edits`}),a(null),d(e=>e+1)}catch(e){s(String(e))}finally{l(!1)}};return!n?.length&&!o?null:(0,W.jsxs)(`div`,{className:Sb.error,"data-pending-views":!0,children:[(0,W.jsx)(`p`,{children:t(`宿主仍持有以下视图。若原窗口已关闭,可丢弃该视图后重试;仍打开的窗口请先保存并关闭。丢弃不会保存内容,无法找回的修改可能永久丢失。`,`The host still holds these views. If the original window is closed, discard the view and retry; save and close windows that are still open first. Discarding does not save content; unrecovered edits may be permanently lost.`)}),n?.map(e=>(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`code`,{children:[e.kind,` · `,e.mountId,` · `,t(`会话`,`session`),` `,e.sessionId,e.dirty||e.busy?` · ${t(`有未确认修改`,`unconfirmed edits`)}`:``]}),` `,i===e.viewToken?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Xv,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void f(e),children:t(`确认丢弃`,`Confirm discard`)}),` `,(0,W.jsx)(Xv,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>a(null),children:t(`取消`,`Cancel`)})]}):(0,W.jsx)(Xv,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>a(e.viewToken),children:t(`丢弃此视图`,`Discard this view`)})]},e.viewToken)),o&&(0,W.jsx)(`p`,{role:`alert`,children:o})]})}function wb({size:e=24}){return(0,W.jsxs)(`svg`,{"aria-hidden":`true`,width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,style:{display:`block`,flexShrink:0},children:[(0,W.jsx)(`path`,{d:`M5 19C5 11 10 6 18 6`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`}),(0,W.jsx)(`path`,{d:`M18 6h-6`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`}),(0,W.jsx)(`rect`,{x:`3`,y:`17`,width:`4`,height:`4`,rx:`0.8`,fill:`currentColor`}),(0,W.jsx)(`rect`,{x:`16`,y:`4`,width:`4`,height:`4`,rx:`0.8`,fill:`currentColor`}),(0,W.jsx)(`circle`,{cx:`10.5`,cy:`6`,r:`1.5`,fill:`currentColor`})]})}function Tb({card:e,size:t=24}){let n=e.icon??(e.pluginId===_b.pluginId?_b.icon:void 0);return(0,W.jsx)(n===`drawing`?gb:n===`design`?wb:C,{size:t})}function Eb(e,t,n){let r=(e,n)=>t===`zh`?e:n;return e===`uninstall`?{title:r(`卸载 ${n}?`,`Uninstall ${n}?`),description:r(`保存成功后将关闭相关视图并卸载插件。工作区文件和插件数据会保留,可重新安装后继续使用;保存失败时不会卸载。`,`After saving successfully, related views close and the plugin is uninstalled. Workspace files and plugin data are retained for reinstallation. A failed save stops uninstallation.`),confirm:r(`卸载`,`Uninstall`)}:e===`disable`?{title:r(`停用 ${n}?`,`Disable ${n}?`),description:r(`保存成功后将关闭相关视图并停用插件。插件仍保持安装,工作区文件和插件数据会保留;保存失败时不会停用。`,`After saving successfully, related views close and the plugin is disabled. It remains installed, with workspace files and plugin data retained. A failed save stops disabling.`),confirm:r(`停用`,`Disable`)}:{title:r(`立即更新 ${n} 并重新打开?`,`Update ${n} and reopen now?`),description:r(`全部视图保存成功后将更新插件并重新打开视图,撤销/重做历史会清空。工作区文件和插件数据会保留;保存失败时不会更新。`,`After all views save successfully, update the plugin and reopen its views. Undo/redo history will be cleared. Workspace files and plugin data are retained. A failed save stops the update.`),confirm:r(`更新并重新打开`,`Update and reopen`)}}function Db({card:e,t,onCatalog:n,disabled:r}){let[i,a]=(0,B.useState)({}),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(null),[u,d]=(0,B.useState)(!1),f=(0,B.useRef)(!0);if((0,B.useEffect)(()=>(f.current=!0,()=>{f.current=!1}),[]),(0,B.useEffect)(()=>{if(!c)return;let e=!1;return(async()=>{for(;!e&&f.current;){if(await new Promise(e=>setTimeout(e,3e3)),e||!f.current)return;try{let e=await xb.signIn({auth:`poll`,deviceId:c.deviceId});if(e.status===`granted`&&e.catalog){n(e.catalog),l(null),s(t(`已授权。`,`Authorized.`));return}if(e.status===`denied`||e.status===`expired`){l(null),s(e.status===`denied`?t(`授权已被拒绝。`,`Authorization was denied.`):t(`授权已过期,请重试。`,`Authorization expired. Try again.`));return}}catch(e){l(null),s(e instanceof Error?e.message:String(e));return}}})(),()=>{e=!0}},[c]),!e.secrets?.length)return null;let p=async(r,i)=>{s(``);try{n(await xb.secret(e.pluginId,r,i)),a(e=>({...e,[r]:``})),s(i===null?t(`已移除。`,`Removed.`):t(`已保存。`,`Saved.`))}catch(e){s(e instanceof Error?e.message:String(e))}},m=async t=>{s(``);try{let n=await xb.signIn({auth:`start`,pluginId:e.pluginId,name:t});d(!1),l({name:t,deviceId:n.deviceId,userCode:n.userCode,verificationUri:n.verificationUri})}catch(e){s(e instanceof Error?e.message:String(e))}},h=async e=>{d(await jn(e))},g=e=>{window.open(e.verificationUri,`_blank`,`noopener,noreferrer`),h(e.userCode)},_=()=>{c&&xb.signIn({auth:`cancel`,deviceId:c.deviceId}).catch(()=>{}),l(null)};return(0,W.jsxs)(`section`,{className:Sb.configuration,children:[(0,W.jsx)(`h2`,{children:t(`授权`,`Authorization`)}),(0,W.jsx)(`p`,{className:$.scope,children:t(`令牌只保存在本机,由主程序代为发起请求;插件进程和页面永远读不到它。`,`The token is stored on this machine and used by the host on the plugin's behalf; plugin code and pages can never read it.`)}),e.secrets.map(e=>(0,W.jsxs)(`div`,{className:Sb.configuration,children:[(0,W.jsxs)(`div`,{className:Sb.actions,children:[(0,W.jsx)(`span`,{role:`status`,children:e.configured?t(`已授权`,`Authorized`):t(`未授权`,`Not authorized`)}),e.signIn===`browser`&&(0,W.jsx)(Xv,{variant:`outline`,size:`sm`,disabled:r||!!c,onClick:()=>void m(e.name),children:e.configured?t(`重新授权`,`Re-authorize`):t(`在浏览器中授权 GitHub`,`Authorize with GitHub`)}),e.signIn===`token-page`&&e.createUrl&&(0,W.jsx)(Xv,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>window.open(e.createUrl,`_blank`,`noopener,noreferrer`),children:t(`打开 GitHub 创建令牌`,`Open GitHub to create a token`)}),e.configured&&(0,W.jsx)(Xv,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>void p(e.name,null),children:t(`移除`,`Remove`)})]}),c?.name===e.name&&(0,W.jsxs)(`div`,{className:$.scope,role:`status`,children:[(0,W.jsxs)(`ol`,{style:{margin:0,paddingLeft:20,display:`grid`,gap:10},children:[(0,W.jsxs)(`li`,{children:[t(`复制下面的验证码`,`Copy this code`),(0,W.jsxs)(`div`,{className:Sb.actions,style:{marginTop:6},children:[(0,W.jsx)(`code`,{style:{fontSize:28,letterSpacing:4,fontWeight:600,padding:`6px 14px`,border:`1px solid currentColor`,borderRadius:8,userSelect:`all`},children:c.userCode}),(0,W.jsx)(Xv,{variant:`outline`,size:`sm`,onClick:()=>void h(c.userCode),children:u?t(`已复制`,`Copied`):t(`复制`,`Copy`)})]})]}),(0,W.jsxs)(`li`,{children:[t(`打开 GitHub 授权页,粘贴验证码并点击 Authorize`,`Open GitHub, paste the code and click Authorize`),(0,W.jsx)(`div`,{className:Sb.actions,style:{marginTop:6},children:(0,W.jsx)(Xv,{size:`sm`,onClick:()=>g(c),children:t(`复制验证码并打开 GitHub`,`Copy code and open GitHub`)})})]})]}),(0,W.jsxs)(`div`,{className:Sb.actions,style:{marginTop:10},children:[(0,W.jsx)(`span`,{children:t(`等待授权中… 完成后这里会自动更新。`,`Waiting for authorization… this updates automatically.`)}),(0,W.jsx)(Xv,{variant:`outline`,size:`sm`,onClick:_,children:t(`取消`,`Cancel`)})]})]}),(0,W.jsxs)(`details`,{open:e.signIn===`token-page`&&!e.configured,children:[(0,W.jsx)(`summary`,{children:e.signIn===`token-page`?t(`创建后在此粘贴令牌(建议只授予该插件所需的仓库和权限)`,`Paste the token here after creating it (grant only the repositories and permissions this plugin needs)`):t(`改用手动粘贴令牌`,`Paste a token instead`)}),(0,W.jsxs)(`div`,{className:Sb.actions,children:[(0,W.jsx)(`input`,{type:`password`,autoComplete:`off`,"aria-label":e.name,value:i[e.name]??``,onChange:t=>a(n=>({...n,[e.name]:t.target.value}))}),(0,W.jsx)(Xv,{variant:`outline`,size:`sm`,disabled:r||!(i[e.name]??``).trim(),onClick:()=>void p(e.name,(i[e.name]??``).trim()),children:t(`保存`,`Save`)})]})]})]},e.name)),o&&(0,W.jsx)(`p`,{role:`status`,className:$.scope,children:o})]})}function Ob(e,t,n){let r={metadata_not_found:n(`官方插件暂未发布,暂不可安装。稍后可重新检查。`,`The official package is not currently published. Check again later.`),tarball_not_found:n(`发行文件暂不可用。请重新检查或稍后重试。`,`The release file is unavailable. Check again or retry later.`),no_compatible_version:n(`暂无适用于此软件版本的插件。稍后可重新检查。`,`No compatible release for this app version. Check again later.`),registry_unreachable:n(`暂时无法访问下载服务。请检查网络后重试。`,`Cannot reach the download service. Check your network and retry.`),download_cancelled:n(`下载已取消。`,`Download cancelled.`),view_barrier:n(`尚未完成所有视图的保存确认,操作已停止。请先处理本页的刷新前视图记录,并检查仍打开的编辑器,然后重试。`,`Save confirmation is still pending for some views, so the operation stopped. Review previous-view records on this page and any open editors, then retry.`),runtime_owned:n(`插件运行时被其他宿主或遗留锁占用,当前无法打开或卸载。请停止所有宿主并校验备份后,按恢复说明处理;重新安装不会清除此锁。`,`Another host or a retained ownership lock blocks this runtime, including opening and uninstalling. Stop all hosts, verify a backup and follow recovery instructions; reinstalling does not clear the lock.`)}[e.code??``]??n(`操作未完成。请查看诊断信息后重试。`,`Operation did not finish. Review diagnostics and retry.`);return(t&&[`metadata_not_found`,`tarball_not_found`,`no_compatible_version`,`registry_unreachable`,`download_cancelled`].includes(e.code??``)?n(`更新未完成,当前插件及数据已保留。`,`Update did not finish; current plugin and data retained. `):``)+r}function kb({locale:e,generation:t=0,reload:n=0,query:r=``,selectedId:i,visible:a=!0,disabled:o=!1,onSelect:s,onBusyChange:c,onMatchCountChange:l}){let u=(t,n)=>e===`zh`?t:n,[d,f]=(0,B.useState)({plugins:[_b],offline:!0}),[p,m]=(0,B.useState)(!1),[h,g]=(0,B.useState)(!0),[_,v]=(0,B.useState)(!1),y=(0,B.useRef)(!1),b=(0,B.useRef)(0),x=(0,B.useRef)(new Set);(0,B.useEffect)(()=>{for(let e of d.plugins)e.installed&&x.current.add(e.pluginId)},[d]);let[S,C]=(0,B.useState)(null),[w,T]=(0,B.useState)(null),[E,D]=(0,B.useState)(null),[O,k]=(0,B.useState)(``),[A,ee]=(0,B.useState)(0),[j,M]=(0,B.useState)(null),N=j?Eb(j.operation,e,j.card.name):null,P=e=>({message:e instanceof Error?e.message:String(e),code:e?.code});(0,B.useEffect)(()=>{if(y.current)return;let e=++b.current,t=new AbortController;return g(!0),D(null),xb.catalog(t.signal).then(t=>{e===b.current&&(f(t),m(!0),T(null))}).catch(n=>{!t.signal.aborted&&e===b.current&&(T(P(n)),f(e=>({...e,offline:!0})))}).finally(()=>{e===b.current&&g(!1)}),()=>{t.abort()}},[t,n,A]);let te=async(e,t,n=!1)=>{if(y.current||o||h)return;y.current=!0,++b.current,M(null);let r=[`install`,`update`,`check`].includes(t)?crypto.randomUUID():void 0;C(r?{pluginId:e.pluginId,id:r}:null),v(!0),c(!0),D(null),k(``);try{let i=await xb.manage({pluginId:e.pluginId,operation:t,...r?{downloadId:r}:{},...n?{reopenEditors:!0}:{}});f(i),m(!0),T(null),k(i.plugins.some(e=>e.pendingVersion)?u(`更新已准备好,关闭编辑器后生效。`,`Update ready. Close editors to apply.`):u(`操作完成。`,`Done.`)),window.dispatchEvent(new Event(`pi:hosted-catalog-changed`))}catch(t){D({id:e.pluginId,problem:P(t)});try{f(await xb.catalog()),m(!0),window.dispatchEvent(new Event(`pi:hosted-catalog-changed`))}catch{}}finally{y.current=!1,v(!1),c(!1),C(null)}},F=(e,t)=>{t===`disable`||t===`uninstall`?M({card:e,operation:t}):te(e,t)},I=d.plugins.some(e=>e.pluginId===_b.pluginId)?d.plugins:[...d.plugins,_b],L=I.find(e=>e.pluginId===i),ne=I.filter(e=>`${e.name} ${e.pluginId} ${re(e)}`.toLowerCase().includes(r.trim().toLowerCase()));(0,B.useEffect)(()=>{l(ne.length)},[ne.length,l]);let R=_||h||o||!p||!!d.offline;function re(t){return t.contribution?.entry.description[e]??t.description?.[e]??(t.pluginId===_b.pluginId?u(`绘制、编辑手绘图表,并将图稿保存到工作区。`,`Draw and edit hand-drawn diagrams, and save them to your workspace.`):u(`按需下载安装的官方插件。`,`An official plugin available on demand.`))}let ie=e=>`${e.name}${e.official?u(`(官方)`,` (Official)`):``}`,z=new Map((d.dev?.sources??[]).map(e=>[e.pluginId,e])),ae=e=>({"waiting-build":u(`等待构建`,`Waiting for build`),switching:u(`正在切换`,`Switching`),synced:u(`已同步`,`Synced`),pending:u(`待应用`,`Pending`),"not-installed":u(`未安装`,`Not installed`),error:u(`出错`,`Error`)})[e.state],oe=e=>{let t=z.get(e.pluginId);return t&&(0,W.jsxs)(`span`,{className:$.tag,"data-tone":t.state===`error`?`danger`:`info`,title:t.root,"data-hosted-dev-source":t.pluginId,children:[u(`开发目录`,`Dev directory`),` · `,ae(t)]})},se=[...(d.dev?.notices??[]).filter(e=>e.level!==`info`),...(d.dev?.sources??[]).filter(e=>e.state===`error`).map(e=>({level:`error`,pluginId:e.pluginId,message:`${e.root}${e.message?`: ${e.message}`:``}`}))],ce=(d.dev?.sources??[]).filter(e=>e.state!==`error`&&!I.some(t=>t.pluginId===e.pluginId)),le=e=>E?.id===e.pluginId?E.problem:e.error?{code:e.errorCode,message:e.error}:e.updateDiagnostic?.status===`failed`?e.updateDiagnostic:null,V=e=>p?`${e.installed?u(`已安装`,`Installed`):u(`未安装`,`Not installed`)} · ${e.enabled?u(`已启用`,`Enabled`):u(`未启用`,`Disabled`)}${e.version?` ${e.version}`:``}${e.enabled&&e.phase!==`active`?u(` · 运行时不可用`,` · Runtime unavailable`):``}`:u(`安装状态未知 · 启用状态未知`,`Installation unknown · Enablement unknown`),H=e=>(0,W.jsx)(`button`,{type:`button`,role:`switch`,className:$.switch,"aria-label":u(`启用 ${e.name}`,`Enable ${e.name}`),"aria-checked":p&&e.enabled,disabled:R||!e.installed,title:p?e.installed?void 0:u(`请先下载插件`,`Download the plugin first`):u(`请先读取插件状态`,`Read plugin status first`),onClick:()=>F(e,e.enabled?`disable`:`enable`),children:(0,W.jsx)(`span`,{className:$.thumb})}),ue=e=>{let t=le(e),n=!e.installed&&!!t&&[`metadata_not_found`,`tarball_not_found`,`no_compatible_version`].includes(t.code??``);return(0,W.jsx)(Xv,{variant:`outline`,size:`sm`,disabled:R||n,onClick:()=>F(e,e.pendingVersion?`retry`:e.installed?`update`:`install`),children:e.pendingVersion?u(`应用待更新版本`,`Apply pending update`):e.installed?u(`更新`,`Update`):n?u(`暂不可下载`,`Unavailable`):e.hasRetainedData||x.current.has(e.pluginId)?u(`重新安装`,`Reinstall`):u(`下载`,`Download`)})};return(0,B.useEffect)(()=>{if(!E||L)return;let e=I.find(e=>e.pluginId===E.id);Et({key:`hosted-operation-${E.id}`,message:`${e?`${ie(e)}:`:``}${Ob(E.problem,!!e?.installed,u)}`,detail:[E.problem.code,E.problem.message].filter(Boolean).join(`: `),detailLabel:u(`诊断信息`,`Diagnostics`)})},[E]),(0,W.jsxs)(`section`,{className:Sb.section,"data-hosted-management":!0,"aria-busy":_||h,style:a?void 0:{display:`none`},children:[!L&&(0,W.jsx)(`h2`,{className:$.groupTitle,children:u(`官方插件`,`Official plugins`)}),w&&(0,W.jsxs)(`div`,{role:`alert`,className:Sb.error,children:[u(`无法读取插件状态,请重试。`,`Cannot read plugin status. Please retry.`),(0,W.jsxs)(`details`,{children:[(0,W.jsx)(`summary`,{children:u(`诊断信息`,`Diagnostics`)}),w.message]}),(0,W.jsx)(Xv,{variant:`outline`,size:`sm`,disabled:_||h||o,onClick:()=>ee(e=>e+1),children:u(`重试`,`Retry`)})]}),!L&&d.dev&&(0,W.jsxs)(W.Fragment,{children:[d.dev.notices.filter(e=>e.level===`info`).map((e,t)=>(0,W.jsxs)(`p`,{className:Sb.devInfo,role:`status`,children:[u(`开发模式`,`Dev mode`),e.pluginId?` · ${e.pluginId}`:``,`: `,e.message]},t)),ce.map(e=>(0,W.jsxs)(`p`,{className:Sb.devInfo,role:`status`,"data-hosted-dev-source":e.pluginId,children:[u(`开发目录`,`Dev directory`),` · `,e.pluginId,` · `,ae(e),` · `,(0,W.jsx)(`code`,{children:e.root})]},e.pluginId)),se.length>0&&(0,W.jsxs)(`div`,{className:Sb.devProblems,"data-hosted-dev":!0,role:`alert`,children:[(0,W.jsx)(`strong`,{children:u(`开发模式:${se.length} 个配置问题`,`Dev mode: ${se.length} configuration ${se.length===1?`issue`:`issues`}`)}),(0,W.jsx)(`ul`,{children:se.map((e,t)=>(0,W.jsxs)(`li`,{"data-level":e.level,children:[e.pluginId&&(0,W.jsxs)(`span`,{children:[e.pluginId,`: `]}),(0,W.jsx)(`code`,{children:e.message})]},t))}),(0,W.jsx)(`p`,{children:u(`来自 hosted-dev.json 或 PI_WEBAPP_HOSTED_DEV_ROOTS,修改后会自动重新读取。其余插件不受影响。`,`From hosted-dev.json or PI_WEBAPP_HOSTED_DEV_ROOTS; edits are picked up automatically. Other plugins are unaffected.`)})]})]}),O&&(0,W.jsx)(`p`,{className:Sb.notice,role:`status`,children:O}),S&&(0,W.jsx)(Xv,{variant:`outline`,onClick:()=>{xb.manage({pluginId:S.pluginId,operation:`cancel-download`,downloadId:S.id}).then(()=>k(u(`已请求取消,已完成的安装不会回滚。`,`Cancellation requested; committed installations are not rolled back.`))).catch(e=>D({id:S.pluginId,problem:P(e)}))},children:u(`取消下载(不回滚已提交安装)`,`Cancel download (no rollback after commit)`)}),L?(0,W.jsxs)(`div`,{className:$.detail,"data-hosted-detail":L.pluginId,children:[(0,W.jsxs)(`div`,{className:$.detailHead,children:[(0,W.jsx)(`span`,{className:$.artwork,"aria-hidden":`true`,children:(0,W.jsx)(Tb,{card:L,size:30})}),H(L)]}),(0,W.jsxs)(`div`,{className:$.detailMain,children:[(0,W.jsxs)(`div`,{className:$.titleRow,children:[(0,W.jsx)(`h1`,{children:L.name}),L.official&&(0,W.jsx)(`span`,{className:$.tag,"data-tone":`info`,children:u(`官方`,`Official`)}),L.version&&(0,W.jsxs)(`span`,{className:$.tag,children:[`v`,L.version]}),oe(L),le(L)&&(0,W.jsx)(`span`,{className:$.tag,"data-tone":`danger`,children:u(`需要处理`,`Needs attention`)})]}),(0,W.jsx)(`p`,{className:$.detailDesc,children:re(L)}),(0,W.jsx)(`p`,{className:$.detailName,children:(0,W.jsx)(`code`,{children:L.pluginId})})]}),((e,t)=>{let n=le(e),r=e.updateDiagnostic;return n?(0,W.jsxs)(`div`,{className:Sb.error,role:`alert`,children:[Ob(n,e.installed,u),(0,W.jsxs)(`details`,{children:[(0,W.jsx)(`summary`,{children:u(`诊断信息`,`Diagnostics`)}),(0,W.jsx)(`code`,{children:n.code}),(0,W.jsx)(`p`,{children:n.message}),r&&(0,W.jsxs)(`p`,{children:[r.checkedAt,` · `,r.hostVersion]}),/lock|owned/i.test(n.message)&&(0,W.jsx)(`p`,{children:u(`停止所有程序并备份后,按 docs/hosted-update-recovery.md 恢复。此页面不会清锁。`,`Stop all hosts and back up data before following docs/hosted-update-recovery.md. This page never clears locks.`)})]}),n.code===`view_barrier`&&(0,W.jsx)(Cb,{pluginId:e.pluginId,t:u})]}):null})(L,!0),(0,W.jsxs)(`section`,{className:$.detailSection,children:[(0,W.jsx)(`h2`,{children:u(`详细信息`,`Details`)}),(0,W.jsxs)(`dl`,{children:[(0,W.jsx)(`dt`,{children:u(`来源`,`Source`)}),(0,W.jsx)(`dd`,{children:z.has(L.pluginId)?(0,W.jsxs)(W.Fragment,{children:[u(`开发目录`,`Dev directory`),` · `,ae(z.get(L.pluginId)),(0,W.jsx)(`br`,{}),(0,W.jsx)(`code`,{children:z.get(L.pluginId).root}),z.get(L.pluginId).message&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`br`,{}),z.get(L.pluginId).message]})]}):u(`按需下载的官方插件`,`Official on-demand package`)}),(0,W.jsx)(`dt`,{children:u(`状态`,`Status`)}),(0,W.jsx)(`dd`,{children:V(L)}),L.availableVersion&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{children:u(`可用版本`,`Available release`)}),(0,W.jsx)(`dd`,{children:L.availableVersion})]}),L.pendingVersion&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{children:u(`待更新版本`,`Pending release`)}),(0,W.jsx)(`dd`,{children:L.pendingVersion})]})]})]}),(0,W.jsx)(Db,{card:L,t:u,disabled:R,onCatalog:e=>{f(e),window.dispatchEvent(new Event(`pi:hosted-catalog-changed`))}}),(0,W.jsxs)(`section`,{className:`${Sb.configuration} ${$.detailSection}`,children:[(0,W.jsx)(`h2`,{children:u(`配置与更新`,`Configuration & updates`)}),(0,W.jsx)(`p`,{className:$.scope,children:L.icon===`drawing`||L.pluginId===_b.pluginId?u(`无需额外配置。启用后,可从工作区侧栏打开,也可查看对话中的图稿。图稿保存在工作区,停用或卸载不会删除文件和插件数据。`,`No additional configuration is required. Once enabled, open it from the workspace sidebar or view diagrams in conversations. Disabling or uninstalling retains workspace files and plugin data.`):u(`启用后从工作区侧栏打开。停用或卸载不会删除插件数据。`,`Once enabled, open it from the workspace sidebar. Disabling or uninstalling retains plugin data.`)}),(0,W.jsx)(`p`,{className:$.scope,children:u(`兼容的插件可独立更新;软件升级仅在协议不兼容时协调插件版本。`,`Compatible plugins update independently. App upgrades coordinate plugins only when their protocol is incompatible.`)}),(0,W.jsx)(`p`,{className:$.scope,children:u(`停用或卸载前会先保存并关闭相关视图;保存失败时不会继续。`,`Disabling or uninstalling first saves and closes related views; a failed save stops the operation.`)}),L.pendingVersion&&(0,W.jsxs)(`p`,{className:$.scope,role:`status`,children:[u(`关闭编辑器后更新至:`,`Close editors to update to: `),L.pendingVersion]}),!le(L)&&L.updateDiagnostic?.status===`up-to-date`&&!L.pendingVersion&&(0,W.jsx)(`p`,{className:$.scope,children:u(`兼容版本检查已完成。`,`Compatible release check complete.`)}),(0,W.jsxs)(`div`,{className:Sb.actions,children:[ue(L),(0,W.jsx)(Xv,{variant:`outline`,size:`sm`,disabled:R,onClick:()=>F(L,`check`),children:u(`检查更新`,`Check updates`)}),L.installed&&(0,W.jsx)(Xv,{variant:`outline`,size:`sm`,disabled:R,onClick:()=>F(L,`uninstall`),children:u(`卸载`,`Uninstall`)}),L.pendingVersion&&(0,W.jsx)(Xv,{variant:`outline`,size:`sm`,disabled:R,onClick:()=>M({card:L,operation:`update`,reopen:!0}),children:u(`立即更新并重新打开`,`Update and reopen now`)})]})]})]}):(0,W.jsx)(`ul`,{className:$.cards,children:ne.map(e=>(0,W.jsxs)(`li`,{className:$.card,"data-hosted-card":e.pluginId,children:[(0,W.jsx)(`span`,{className:$.artwork,"aria-hidden":`true`,children:(0,W.jsx)(Tb,{card:e,size:30})}),(0,W.jsxs)(`div`,{className:$.cardMain,children:[(0,W.jsxs)(`div`,{className:$.titleRow,children:[(0,W.jsx)(`button`,{className:$.cardOpen,type:`button`,onClick:()=>s({id:e.pluginId,name:e.name}),children:ie(e)}),(0,W.jsx)(`span`,{className:$.tag,"data-tone":_?`info`:void 0,children:_?u(`正在应用…`,`Applying…`):V(e)}),oe(e),!_&&le(e)&&(0,W.jsx)(`span`,{className:$.tag,"data-tone":`danger`,children:u(`需要处理`,`Needs attention`)}),e.pendingVersion?(0,W.jsxs)(`span`,{className:$.tag,"data-tone":`info`,children:[u(`关闭编辑器后更新至:`,`Close editors to update to: `),e.pendingVersion]}):e.availableVersion&&e.availableVersion!==e.version&&(0,W.jsxs)(`span`,{className:$.tag,"data-tone":`info`,children:[u(`可用版本:`,`Available release: `),e.availableVersion]})]}),(0,W.jsx)(`p`,{children:re(e)})]}),(0,W.jsxs)(`div`,{className:`${$.cardEnd} ${Sb.rowActions}`,children:[ue(e),H(e)]})]},e.pluginId))}),(0,W.jsx)(Qv,{open:j!==null,onClose:()=>M(null),title:N?.title??``,closeLabel:u(`关闭`,`Close`),description:N?.description,footer:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Xv,{variant:`outline`,onClick:()=>M(null),children:u(`取消`,`Cancel`)}),(0,W.jsx)(Xv,{variant:`primary`,disabled:R,onClick:()=>{j&&te(j.card,j.operation,j.reopen)},children:N?.confirm})]})})]})}function Ab({size:e}){return(0,W.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,W.jsx)(`path`,{d:`m5 7 5 5-5 5`}),(0,W.jsx)(`path`,{d:`M13 17h6`})]})}function jb({getPluginManagement:e,togglePlugin:t,generation:n=0,recovery:r}){let i=_e(),a=(e,t)=>ve(i,e,t),o=e=>typeof e==`string`?e:e[i],[c,l]=(0,B.useState)(null),[u,d]=(0,B.useState)(null),[f,p]=(0,B.useState)(null),[h,g]=(0,B.useState)(!1),[_,y]=(0,B.useState)(1),[b,x]=(0,B.useState)(0),[S,w]=(0,B.useState)(``),[E,D]=(0,B.useState)(null),[O,k]=(0,B.useState)(!0),[A,ee]=(0,B.useState)(``),[j,M]=(0,B.useState)(null),N=(0,B.useRef)(!1),P=(0,B.useRef)(!1),te=(0,B.useRef)(n),F=(0,B.useRef)(!0),I=async(t=!0)=>{if(N.current)P.current=!0;else{N.current=!0,k(!0),t&&(ee(``),x(e=>e+1));try{let t=await e();F.current&&l(t)}catch(e){F.current&&ee(e instanceof Error?e.message:a(`无法读取插件`,`Could not load plugins`))}finally{N.current=!1,F.current&&k(!1),P.current&&F.current&&(P.current=!1,I(!1))}}};(0,B.useEffect)(()=>(F.current=!0,I(),()=>{F.current=!1}),[]),(0,B.useEffect)(()=>{te.current!==n&&(te.current=n,I(!1))},[n]);let L=async e=>{if(c&&!N.current){N.current=!0,D(e.id),ee(``),M(null);try{let n=await t({id:e.id,enabled:!e.enabled,expected:c.revision});F.current&&(l(n),Et({key:`plugin-settings-saved`,tone:`info`,message:a(`插件配置已保存并生效`,`Plugin settings saved and applied`)}))}catch(e){F.current&&ee((e instanceof Error?e.message:a(`保存失败`,`Could not save`))+a(`。请刷新确认状态;操作不会自动重试。`,`. Refresh to verify the state; this operation is not retried automatically.`))}finally{N.current=!1,F.current&&D(null),P.current&&F.current&&(P.current=!1,I(!1))}}},ne=e=>{e.id===hb.terminal&&e.enabled?M(e):L(e)},R=e=>(0,W.jsx)(`button`,{type:`button`,role:`switch`,className:$.switch,"aria-label":a(`启用 ${o(e.name)}`,`Enable ${o(e.name)}`),"aria-checked":e.enabled,disabled:O||E!==null||h||!e.managed,title:e.managed?void 0:a(`请在包与扩展中管理 Pi 运行时`,`Manage the Pi runtime under Packages & extensions`),onClick:()=>ne(e),children:(0,W.jsx)(`span`,{className:$.thumb})}),ie=(e,t=26)=>e.id===hb.git?(0,W.jsx)(v,{size:t}):e.id===hb.terminal?(0,W.jsx)(Ab,{size:t}):e.id===hb.files?(0,W.jsx)(re,{kind:`folder`,size:t}):e.id===hb.diagrams?(0,W.jsx)(gb,{size:t}):(0,W.jsx)(C,{size:t}),z=e=>e.id===hb.git?`git`:e.id===hb.terminal?`terminal`:void 0,ae=a(`全局设置 · 影响此服务的所有工作区和聊天;所有聊天空闲后才可修改。`,`Global settings · Applies to every workspace and chat on this service. Changes require all chats to be idle.`),oe=c?.items.find(e=>e.id===u),se=!!(oe||f),ce=c?.items.filter(e=>`${o(e.name)} ${o(e.description)} ${e.id}`.toLowerCase().includes(S.trim().toLowerCase()))??[];return(0,W.jsxs)(`section`,{className:$.page,"data-plugin-panel":!0,"aria-busy":O||E!==null,children:[(0,W.jsxs)(`header`,{className:$.pageHead,children:[(0,W.jsx)(`div`,{className:$.pageHeading,children:se?(0,W.jsx)(`button`,{type:`button`,className:$.crumb,onClick:()=>{d(null),p(null)},children:a(`‹ 插件`,`‹ Plugins`)}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h1`,{children:a(`插件`,`Plugins`)}),(0,W.jsxs)(`p`,{className:$.pageIntro,children:[a(`管理此服务的可选能力,按需启用。`,`Manage optional capabilities on this service.`),(0,W.jsx)(Le,{label:ae,side:`bottom`,maxWidth:320,children:(0,W.jsx)(`button`,{type:`button`,className:$.infoButton,"aria-label":ae,children:(0,W.jsx)(m,{size:14})})})]})]})}),(0,W.jsxs)(`div`,{className:$.toolbar,children:[!se&&c&&(0,W.jsxs)(`label`,{className:$.search,children:[(0,W.jsx)(s,{size:14}),(0,W.jsx)(`input`,{type:`search`,value:S,onChange:e=>w(e.target.value),placeholder:a(`搜索插件`,`Search plugins`),"aria-label":a(`搜索插件`,`Search plugins`)})]}),(0,W.jsx)(`button`,{type:`button`,className:$.iconButton,disabled:O||E!==null||h,onClick:()=>void I(),"aria-label":a(`刷新插件`,`Refresh plugins`),children:(0,W.jsx)(T,{size:16,className:O?$.spin:void 0})})]})]}),r,A&&(0,W.jsx)(`p`,{className:$.error,role:`alert`,children:A}),O&&!c&&(0,W.jsx)(`section`,{className:$.group,role:`status`,"aria-label":a(`正在读取插件…`,`Loading plugins…`),children:(0,W.jsx)(`ul`,{className:$.cards,children:[0,1,2].map(e=>(0,W.jsxs)(`li`,{className:$.card,children:[(0,W.jsx)(`span`,{className:`${$.artwork} ${$.skeleton}`}),(0,W.jsxs)(`div`,{className:$.cardMain,children:[(0,W.jsx)(`span`,{className:`${$.skeletonLine} ${$.skeleton}`,style:{width:144}}),(0,W.jsx)(`span`,{className:`${$.skeletonLine} ${$.skeleton}`,style:{width:280,maxWidth:`85%`}})]})]},e))})}),!c&&!O&&(0,W.jsx)(`button`,{type:`button`,className:$.back,onClick:()=>void I(),children:a(`重试`,`Retry`)}),oe?(0,W.jsxs)(`div`,{className:$.detail,children:[(0,W.jsxs)(`div`,{className:$.detailHead,children:[(0,W.jsx)(`span`,{className:$.artwork,"data-icon":z(oe),"aria-hidden":`true`,children:ie(oe,30)}),R(oe)]}),(0,W.jsxs)(`div`,{className:$.detailMain,children:[(0,W.jsxs)(`div`,{className:$.titleRow,children:[(0,W.jsx)(`h1`,{children:o(oe.name)}),oe.version&&(0,W.jsxs)(`span`,{className:$.tag,children:[`v`,oe.version]}),E===oe.id&&(0,W.jsx)(`span`,{className:$.tag,"data-tone":`info`,children:a(`正在应用…`,`Applying…`)})]}),(0,W.jsx)(`p`,{className:$.detailDesc,children:o(oe.description)}),(0,W.jsx)(`p`,{className:$.detailName,children:(0,W.jsx)(`code`,{children:oe.id})})]}),(0,W.jsxs)(`section`,{className:$.detailSection,children:[(0,W.jsx)(`h2`,{children:a(`详细信息`,`Details`)}),(0,W.jsxs)(`dl`,{children:[(0,W.jsx)(`dt`,{children:a(`来源`,`Source`)}),(0,W.jsx)(`dd`,{children:oe.kind===`builtin`?a(`随应用内置`,`Bundled with the application`):a(`Pi 软件包`,`Pi package`)}),(0,W.jsx)(`dt`,{children:a(`状态`,`Status`)}),(0,W.jsx)(`dd`,{children:oe.enabled?a(`已启用`,`Enabled`):a(`已停用`,`Disabled`)}),oe.version&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{children:a(`契约版本`,`Contract version`)}),(0,W.jsx)(`dd`,{children:oe.version})]})]})]}),(0,W.jsxs)(`section`,{className:$.detailSection,children:[(0,W.jsx)(`h2`,{children:a(`说明`,`Notes`)}),(0,W.jsx)(`p`,{className:$.scope,children:oe.managed?a(`停用会移除入口、关闭相关标签并阻止该插件的后端请求。不会删除工作区文件或聊天记录。`,`Disabling removes entries, closes related tabs and blocks backend requests. Workspace files and chat history are not deleted.`):a(`此插件的 Pi 运行时由软件包管理。当前协议未提供独立、安全卸载该运行时的能力,因此这里仅展示状态,不提供假开关。`,`The Pi package owns this runtime. Its protocol does not expose independent safe teardown, so this page shows its status without a misleading toggle.`)}),oe.id===hb.git&&(0,W.jsx)(`p`,{className:$.scope,children:a(`关闭 Git 面板不禁止 Agent 或其他终端执行系统 git。`,`Disabling the Git panel does not prevent an agent or another terminal from running system git.`)}),(0,W.jsx)(`p`,{className:$.scope,children:ae})]})]}):c&&!f&&(0,W.jsxs)(W.Fragment,{children:[[`builtin`,`external`].map(e=>{let t=ce.filter(t=>t.kind===e);return t.length?(0,W.jsxs)(`section`,{className:$.group,children:[(0,W.jsx)(`h2`,{className:$.groupTitle,children:e===`builtin`?a(`内置插件`,`Built-in plugins`):a(`已安装的 Web 插件`,`Installed Web plugins`)}),(0,W.jsx)(`ul`,{className:$.cards,children:t.map(e=>(0,W.jsxs)(`li`,{className:$.card,"data-plugin-package":e.id,children:[(0,W.jsx)(`span`,{className:$.artwork,"data-icon":z(e),"aria-hidden":`true`,children:ie(e)}),(0,W.jsxs)(`div`,{className:$.cardMain,children:[(0,W.jsxs)(`div`,{className:$.titleRow,children:[(0,W.jsx)(`button`,{className:$.cardOpen,type:`button`,onClick:()=>d(e.id),children:o(e.name)}),E===e.id&&(0,W.jsx)(`span`,{className:$.tag,"data-tone":`info`,children:a(`正在应用…`,`Applying…`)}),!e.managed&&(0,W.jsx)(`span`,{className:$.tag,children:a(`由软件包管理`,`Package-managed`)})]}),(0,W.jsx)(`p`,{children:o(e.description)})]}),(0,W.jsx)(`div`,{className:$.cardEnd,children:R(e)})]},e.id))})]},e):null}),!ce.length&&!_&&(0,W.jsx)(`p`,{className:$.scope,children:a(`没有匹配的插件`,`No matching plugins`)})]}),(0,W.jsx)(kb,{locale:i,generation:n,reload:b,query:S,selectedId:f?.id??null,visible:!oe,disabled:O||E!==null,onSelect:p,onBusyChange:g,onMatchCountChange:y}),(0,W.jsx)(Qv,{open:j!==null,onClose:()=>M(null),title:a(`停用终端?`,`Disable Terminal?`),closeLabel:a(`关闭`,`Close`),description:a(`这会结束此服务所有聊天中的终端进程。未保存的 shell 工作可能丢失。`,`This ends terminal processes in every chat on this service. Unsaved shell work may be lost.`),footer:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{className:$.back,type:`button`,onClick:()=>M(null),children:a(`取消`,`Cancel`)}),(0,W.jsx)(`button`,{className:$.danger,type:`button`,onClick:()=>{j&&L(j)},children:a(`停用并结束终端`,`Disable and stop terminals`)})]})})]})}var Mb={root:`_root_1ikfi_1`,trigger:`_trigger_1ikfi_2`,glyph:`_glyph_1ikfi_4`,dot:`_dot_1ikfi_5`,srOnly:`_srOnly_1ikfi_6`};function Nb(e){let t=Qy();return t?(0,W.jsx)(Fb,{...e,controller:t}):(0,W.jsx)(Pb,{...e})}function Pb(e){let t=Yy(e);return(0,W.jsx)(Fb,{...e,controller:t})}function Fb({wide:e,hideError:t,controller:n}){let r=_e(),i=(e,t)=>ve(r,e,t),{status:a,checking:o,installing:s,targetVersion:c,restartTimedOut:l,error:u,install:d}=n;if(At(`app-update`,t?null:u&&i(`升级未完成,当前版本和数据已保留。可稍后重试。`,`Update did not finish; the current version and data are retained. You can retry.`),u??void 0,i(`诊断信息`,`Diagnostics`)),!a?.available||!a.canRestart)return null;let f=s?i(`正在升级…`,`Updating…`):c?i(`正在重启…`,`Restarting…`):a.downgrade?i(`切换到稳定版`,`Switch to stable`):i(`下载升级`,`Download updates`),p=a.downgrade?i(`按更新偏好切换到稳定版,需要确认后重启`,`Switch to stable based on your preference; confirmation and restart required`):i(`下载并升级到新版本,服务将短暂重启`,`Download and update to the new version; the service will briefly restart`);return(0,W.jsxs)(`div`,{className:Mb.root,children:[(0,W.jsx)(`div`,{className:`pi-settings-trigger-row ${e?``:`pi-settings-trigger-rail`}`,children:(0,W.jsx)(Le,{label:p,children:(0,W.jsxs)(`button`,{className:`pi-settings-sidebar ${Mb.trigger}`,"data-wide":e,type:`button`,"aria-label":f,disabled:o||s||!!c||l,onClick:()=>{d()},children:[(0,W.jsxs)(`span`,{className:Mb.glyph,children:[(0,W.jsx)(rt,{size:e?16:18}),(0,W.jsx)(`span`,{className:Mb.dot})]}),e&&(0,W.jsx)(`span`,{children:f})]})})}),(s||c)&&(0,W.jsx)(`span`,{className:Mb.srOnly,role:`status`,children:f})]})}var Ib={trigger:`_trigger_1s641_2`,item:`_item_1s641_3`};function Lb({wide:e}){let t=_e(),n=((e,n)=>ve(t,e,n))(`帮助与文档`,`Help & documentation`),r=(0,B.useRef)(null),i=(0,B.useRef)(null),[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)({top:0,left:0}),l=(e=!0)=>{o(!1),e&&r.current?.focus()};return(0,B.useLayoutEffect)(()=>{if(!a)return;let t=r.current.getBoundingClientRect(),{height:n,width:s}=i.current.getBoundingClientRect();c({top:Math.max(12,t.top-n-4),left:Math.max(12,Math.min(e?t.right-s:t.left,window.innerWidth-s-12))}),i.current?.querySelector(`a`)?.focus();let l=e=>{!i.current?.contains(e.target)&&!r.current?.contains(e.target)&&o(!1)},u=()=>{o(!1),r.current?.focus()};return document.addEventListener(`pointerdown`,l,!0),window.addEventListener(`resize`,u),()=>{document.removeEventListener(`pointerdown`,l,!0),window.removeEventListener(`resize`,u)}},[a,e]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Le,{label:n,disabled:a,children:(0,W.jsx)(`button`,{ref:r,type:`button`,className:`pi-settings-sidebar ${Ib.trigger}`,"data-wide":e,"aria-label":n,"aria-haspopup":`menu`,"aria-expanded":a,onClick:()=>a?l():o(!0),onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),o(!0))},children:(0,W.jsx)(ht,{size:e?16:18})})}),a&&(0,_t.createPortal)((0,W.jsx)(L,{ref:i,role:`menu`,tabIndex:-1,"aria-label":n,className:$v.menu,style:s,onKeyDown:e=>{if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),l();else if(e.key===`Tab`)l();else if([`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key)){e.preventDefault();let t=[...i.current?.querySelectorAll(`a`)??[]],n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:e.key===`ArrowDown`?(n+1)%t.length:(n-1+t.length)%t.length]?.focus()}},children:sb(t).map(e=>(0,W.jsx)(`a`,{role:`menuitem`,href:e.href,target:`_blank`,rel:`noreferrer`,className:`${$v.menuItem} ${$v.menuItemNeutral} ${Ib.item}`,onClick:()=>l(!1),children:e.label},e.id))}),document.body)]})}var Rb=e=>typeof e==`object`&&!!e&&!Array.isArray(e),zb=e=>typeof e==`string`,Bb=e=>typeof e==`boolean`,Vb=e=>typeof e==`number`&&Number.isFinite(e),Hb=e=>t=>t===null||e(t),Ub=e=>t=>Array.isArray(t)&&t.every(e),Wb=(e,t,n)=>e[t]===void 0||n(e[t]),Gb=(e,t)=>t.every(t=>zb(e[t])),Kb=(e,t)=>t.every(t=>Wb(e,t,zb));function qb(e){return Rb(e)&&Gb(e,[`id`,`timestamp`])&&[`user`,`assistant`,`tool`,`notice`].includes(e.role)&&Ub(e=>Rb(e)&&[`text`,`thinking`,`image`,`toolCall`].includes(e.kind)&&zb(e.text)&&Kb(e,[`toolName`,`toolCallId`]))(e.blocks)&&Kb(e,[`toolName`,`toolCallId`,`model`,`error`])&&Wb(e,`isError`,Bb)&&Wb(e,`subagentNotice`,t=>e.role===`notice`&&Rb(t)&&[`completed`,`failed`,`cancelled`,`unknown`].includes(t.status)&&Wb(t,`description`,zb))&&Wb(e,`usage`,e=>Rb(e)&&[`input`,`output`,`cacheRead`,`cacheWrite`,`totalTokens`,`cost`].every(t=>Vb(e[t]))&&Wb(e,`reasoning`,Vb))}function Jb(e){return Rb(e)&&e.schemaVersion===1&&Gb(e,[`sessionId`,`cwd`,`name`])&&Hb(zb)(e.model)&&Hb(zb)(e.thinkingLevel)&&Ub(zb)(e.thinkingLevels)&&Bb(e.idle)&&Wb(e,`paused`,Bb)&&Wb(e,`hasPendingPrompts`,Bb)&&Wb(e,`promptQueue`,e=>Rb(e)&&Ub(zb)(e.steering)&&Ub(zb)(e.followUp))&&Wb(e,`queuedPrompts`,Ub(e=>Rb(e)&&Gb(e,[`id`,`text`])&&Number.isSafeInteger(e.revision)&&e.revision>0&&[`queued`,`sending`].includes(e.status)&&Wb(e,`error`,zb)&&Ub(e=>Rb(e)&&zb(e.name)&&Bb(e.image))(e.attachments)))&&Hb(e=>Rb(e)&&Hb(Vb)(e.tokens)&&Vb(e.contextWindow)&&Hb(Vb)(e.percent))(e.contextUsage)&&Ub(qb)(e.messages)&&Ub(e=>Rb(e)&&Gb(e,[`id`,`pluginId`,`kind`,`timestamp`])&&Wb(e,`afterMessageId`,zb))(e.pluginEntries)&&Wb(e,`interactions`,Ub(e=>Rb(e)&&Gb(e,[`requestId`,`sessionId`,`pluginId`,`kind`])))&&Wb(e,`streaming`,Hb(qb))}function Yb(e){return Rb(e)&&Hb(zb)(e.activeId)&&Ub(e=>Rb(e)&&Gb(e,[`id`,`path`,`title`])&&Wb(e,`available`,Bb))(e.items)&&Ub(e=>Rb(e)&&Gb(e,[`id`,`workspaceId`,`name`,`modified`])&&Hb(zb)(e.path)&&Wb(e,`idle`,Bb))(e.sessions)}function Xb(e){return Rb(e)&&e.type===`error`&&zb(e.message)&&Kb(e,[`errorCode`,`errorId`,`requestId`,`operationId`])&&Wb(e,`errorReported`,Bb)&&Wb(e,`inTranscript`,Bb)}function Zb(e){if(!Rb(e)||!zb(e.type))throw Error(`Invalid stream event`);switch(e.type){case`snapshot`:if(Rb(e.session)&&e.session.schemaVersion!==1)throw Error(`Unsupported session schema`);if(Jb(e.session))return{type:`snapshot`,session:e.session};throw Error(`Invalid session snapshot`);case`stream`:if(e.message===null||qb(e.message))return{type:`stream`,message:e.message};break;case`workspaces`:if(Yb(e.value))return{type:`workspaces`,value:e.value};break;case`shutdown`:if(Wb(e,`reconnect`,Bb))return{type:`shutdown`,...e.reconnect===void 0?{}:{reconnect:e.reconnect}};break;case`plugins_changed`:return{type:`plugins_changed`};case`hosted_plugins_changed`:return{type:`hosted_plugins_changed`};case`plugin_state`:if(Array.isArray(e.disabled)&&e.disabled.every(e=>typeof e==`string`&&e.length<=200))return{type:`plugin_state`,disabled:e.disabled};break;case`error`:if(Xb(e))return e;break;default:throw Error(`Unsupported stream event`)}throw Error(`Invalid stream event`)}var Qb=M();async function $b(e,t,n){return yb(await vb(e,{method:`POST`,headers:{Authorization:`Bearer ${Qb}`,"Content-Type":`application/json`},body:JSON.stringify(t),signal:n}))}async function ex(e){return yb(await vb(e,{headers:{Authorization:`Bearer ${Qb}`}}))}function tx(){let e=_e(),[t,n]=(0,B.useState)(null),[r,i]=(0,B.useState)(null),[a,o]=(0,B.useState)(Qb?`connecting`:`missing-token`),[s,c]=(0,B.useState)(``),[l,u]=(0,B.useState)([]),[d,f]=(0,B.useState)(`loading`),[p,m]=(0,B.useState)([]),[h,g]=(0,B.useState)({items:[],activeId:null,sessions:[]}),[_,v]=(0,B.useState)(null),[y,b]=(0,B.useState)([]),[x,S]=(0,B.useState)(0);return(0,B.useEffect)(()=>{if(!Qb)return;let e=new AbortController,t,r=!0,a=!1;return(async()=>{for(;r;){let s,l,u=`stream_connect`;try{o(`connecting`);let t=await vb(`/api/events`,{headers:{Authorization:`Bearer ${Qb}`},cache:`no-store`,signal:e.signal}),{response:d}=t;if(l=t.correlation,d.ok||await yb(t),!d.body)throw Error(d.status===401?U(`访问令牌无效,请在 Pi 中重新输入 /web。`,`Invalid access token. Run /web again in Pi.`):U(`连接 Pi 失败`,`Could not connect to Pi`));o(`connected`),k({connection:`connected`}),N(`stream_connected`,{...l}),c(``),s=d.body.getReader();let f=new TextDecoder,p=``;for(;r;){u=`stream_read`;let{done:e,value:t}=await s.read();if(e)break;u=`stream_event`,p+=f.decode(t,{stream:!0});let d=p.indexOf(`
45
- `);for(;d!==-1;){let e=p.slice(0,d);if(p=p.slice(d+1),e){let t;try{t=Zb(JSON.parse(e))}catch(e){let t=e instanceof SyntaxError?Error(`Invalid event JSON`):e;throw j(t,{...l,stage:`ndjson_parse`}),t}if(t.type===`shutdown`){if(s.cancel().catch(()=>{}),t.reconnect===!0)throw new DOMException(`Pi web service is restarting`,`AbortError`);r=!1,o(`disconnected`),k({connection:`disconnected`}),N(`bridge_shutdown`),c(U(`Pi 网页服务已关闭,请在 Pi 中重新输入 /web。`,`The Pi web service stopped. Run /web again in Pi.`));return}if(t.type===`snapshot`&&(n(t.session),k({sessionId:t.session.sessionId,idle:t.session.idle,model:t.session.model,thinkingLevel:t.session.thinkingLevel,messageCount:t.session.messages?.length??0}),(t.session.idle||`streaming`in t.session)&&i(t.session.streaming??null)),t.type===`stream`){let e=t.message!==null;e&&c(``),e!==a&&N(e?`stream_start`:`stream_end`),a=e,i(t.message)}t.type===`workspaces`&&g(t.value),t.type===`error`&&(t.inTranscript||c(t.message),!t.errorId&&!t.errorReported&&t.errorCode!==`validation_error`&&j(Error(`Agent response failed`),{stage:`agent`,code:`agent_failed`,requestId:t.requestId,operationId:t.operationId}),N(`agent_error`,{errorId:t.errorId,requestId:t.requestId,operationId:t.operationId})),t.type===`plugins_changed`&&window.location.reload(),t.type===`hosted_plugins_changed`&&S(e=>e+1),t.type===`plugin_state`&&(b(t.disabled),S(e=>e+1))}d=p.indexOf(`
46
- `)}}throw u=`stream_end`,Error(U(`Pi 网页连接已关闭`,`The Pi web connection has closed`))}catch(e){if(s?.cancel().catch(()=>{}),!r)return;k({connection:`disconnected`});let n={...l,route:`/api/events`,stage:u,connection:`disconnected`};j(e,n),N(`stream_disconnected`,n),o(`disconnected`),f(`loading`),c(e instanceof Error?e.message:U(`连接 Pi 失败`,`Could not connect to Pi`)),await new Promise(e=>{t=setTimeout(e,1500)})}}})(),()=>{r=!1,e.abort(),t&&clearTimeout(t)}},[]),(0,B.useEffect)(()=>{Qb||c(U(`请在 Pi 终端输入 /web,打开显示的完整地址。`,`Enter /web in the Pi terminal and open the full address shown.`))},[e]),(0,B.useEffect)(()=>{if(a!==`connected`)return;let e=!0;return f(`loading`),ex(`/api/plugin-management`).then(t=>{e&&b(t.items.filter(e=>!e.enabled).map(e=>e.id))}).catch(()=>{}),ex(`/api/models`).then(t=>{e&&(u(t),f(`ready`))}).catch(t=>{e&&(f(`error`),c(t instanceof Error?t.message:U(`无法获取模型列表`,`Could not load the model list`)))}),ex(`/api/commands`).then(t=>{e&&m(t)}).catch(()=>{e&&m([])}),()=>{e=!1}},[a,t?.sessionId]),(0,B.useEffect)(()=>{if(a!==`connected`)return;let e=!0;return ex(`/api/workspaces`).then(t=>{e&&g(t)}).catch(()=>{}),ex(`/api/directory/capability`).then(t=>{e&&v(t.kind)}).catch(()=>{e&&v(`browse`)}),()=>{e=!1}},[a]),{session:t,streaming:r,connection:a,error:s,models:l,modelsStatus:d,commands:p,workspaces:h,directoryPickerKind:_,async resolvePluginInteraction(e,n,r){if(!t)throw Error(`No active session`);await $b(`/api/plugin-interaction`,{sessionId:t.sessionId,pluginId:e,requestId:n,value:r})},plugins:()=>ex(`/api/plugins`),async invokePluginAction(e,n,r){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));return(await $b(`/api/plugin-action`,{sessionId:t.sessionId,pluginId:e,action:n,input:r})).value},async pickDirectory(){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));return(await $b(`/api/directory/pick`,{sessionId:t.sessionId})).path},async listDirectory(e,n){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));return $b(`/api/directory/list`,{sessionId:t.sessionId,...e===void 0?{}:{path:e}},n)},async createDirectory(e,n){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));return(await $b(`/api/directory/create`,{sessionId:t.sessionId,path:e,name:n})).path},disabledPlugins:y,pluginGeneration:x,getPluginManagement:()=>ex(`/api/plugin-management`),async togglePlugin(e){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));return $b(`/api/plugin-management`,{sessionId:t.sessionId,...e})},clearError:()=>c(``),async upload(e,n){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));let r=await vb(`/api/attachment?sessionId=${encodeURIComponent(t.sessionId)}&name=${encodeURIComponent(e.name)}`,{method:`POST`,headers:{Authorization:`Bearer ${Qb}`,"Content-Type":e.type||`application/octet-stream`},body:e,signal:n});if(r.response.status===404)throw Error(U(`当前 Pi 桥接服务仍是旧版。请在 Pi 中输入 /reload,再输入 /web 并打开新地址,然后重试上传。`,`The Pi bridge is outdated. Run /reload, then /web in Pi, open the new address, and retry the upload.`));return await yb(r)},async discardAttachment(e){t&&a===`connected`&&await $b(`/api/attachment/remove`,{sessionId:t.sessionId,id:e})},async updateQueuedPrompt(e,n,r){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));await $b(`/api/prompt-queue`,{sessionId:t.sessionId,id:e,revision:n,action:r})},async send(e,n=[],r){if(t&&a===`connected`){c(``);try{await $b(`/api/message`,{sessionId:t.sessionId,text:e,attachments:n,delivery:r})}catch(e){throw c(e instanceof Error?e.message:U(`发送失败`,`Send failed`)),e}}},async loadMessageImage(e,n){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));let r=await vb(`/api/image?sessionId=${encodeURIComponent(t.sessionId)}&messageId=${encodeURIComponent(e)}&index=${n}`,{headers:{Authorization:`Bearer ${Qb}`}});r.response.ok||await yb(r);try{return await r.response.blob()}catch(e){throw j(e,{...r.correlation,stage:`image_read`}),e}},async stop(){if(t&&a===`connected`)try{await $b(`/api/abort`,{sessionId:t.sessionId}),c(``)}catch(e){throw c(e instanceof Error?e.message:U(`停止失败`,`Could not stop`)),e}},async resume(){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));c(``);try{await $b(`/api/resume`,{sessionId:t.sessionId})}catch(e){throw c(e instanceof Error?e.message:U(`继续失败`,`Could not continue`)),e}},async compact(){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));try{await $b(`/api/compact`,{sessionId:t.sessionId}),c(``)}catch(e){throw c(e instanceof Error?e.message:U(`压缩失败`,`Compaction failed`)),e}},async newSession(){if(t&&a===`connected`)try{await $b(`/api/new-session`,{sessionId:t.sessionId})}catch(e){throw c(e instanceof Error?e.message:U(`无法创建新会话`,`Could not create a new session`)),e}},async addWorkspace(e,n){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));await $b(`/api/workspace/add`,{sessionId:t.sessionId,path:e,create:n})},async selectWorkspace(e){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));await $b(`/api/workspace/select`,{sessionId:t.sessionId,id:e})},async newSessionInWorkspace(e){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));await $b(`/api/workspace/new-session`,{sessionId:t.sessionId,id:e})},async removeWorkspace(e){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));await $b(`/api/workspace/remove`,{sessionId:t.sessionId,id:e})},async selectSession(e,n,r){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));await $b(`/api/session/select`,{sessionId:t.sessionId,workspaceId:e,id:n,path:r??``})},async renameSession(e,n,r,i){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));await $b(`/api/session/rename`,{sessionId:t.sessionId,workspaceId:e,id:n,path:r??``,name:i})},async deleteSession(e,n,r){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));await $b(`/api/session/delete`,{sessionId:t.sessionId,workspaceId:e,id:n,path:r??``})},async setModel(e,n){if(t&&a===`connected`)try{await $b(`/api/model`,{sessionId:t.sessionId,provider:e,id:n}),c(``)}catch(e){throw c(e instanceof Error?e.message:U(`切换模型失败`,`Could not change model`)),e}},async setThinkingLevel(e){if(t&&a===`connected`)try{await $b(`/api/thinking-level`,{sessionId:t.sessionId,level:e}),c(``)}catch(e){throw c(e instanceof Error?e.message:U(`切换推理强度失败`,`Could not change reasoning effort`)),e}},async getConfig(){return ex(`/api/config`)},async getUpdate(){return ex(`/api/update`)},async getRunningVersion(e){return yb(await vb(`/api/update/version`,{headers:{Authorization:`Bearer ${Qb}`},signal:e},{expectedNetworkFailure:!0}))},async setUpdateChannel(e){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));return $b(`/api/update/channel`,{sessionId:t.sessionId,channel:e})},async cancelUpdate(){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));await $b(`/api/update/cancel`,{sessionId:t.sessionId})},async update(e){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));return $b(`/api/update`,{sessionId:t.sessionId,...e})},async getProviders(){return ex(`/api/providers`)},async getProviderModels(e){return ex(`/api/provider/models?providerId=${encodeURIComponent(e)}`)},async updateProviderModel(e,n){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));await $b(`/api/provider/models`,{sessionId:t.sessionId,providerId:e,change:n});try{u(await ex(`/api/models`)),f(`ready`)}catch{c(U(`模型已保存,但会话模型列表暂时无法刷新。`,`Model saved, but the conversation model list could not refresh.`))}},async logoutProvider(e){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));await $b(`/api/provider/logout`,{sessionId:t.sessionId,providerId:e});try{u(await ex(`/api/models`)),f(`ready`)}catch{c(U(`认证已移除,但会话模型列表暂时无法刷新。`,`Credentials removed, but the conversation model list could not refresh.`))}},async addCustomProvider(e){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));await $b(`/api/provider/custom`,{sessionId:t.sessionId,provider:e})},async startProviderLogin(e,n,r){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));return $b(`/api/provider/login`,{sessionId:t.sessionId,providerId:e,method:n,...r===void 0?{}:{initialSecret:r}})},async getProviderLogin(e){return ex(`/api/provider/login?id=${encodeURIComponent(e)}`)},async getActiveProviderLogin(){return(await ex(`/api/provider/login/active`)).active},async respondProviderLogin(e,n){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));await $b(`/api/provider/login/respond`,{sessionId:t.sessionId,id:e,value:n})},async cancelProviderLogin(e){t&&a===`connected`&&await $b(`/api/provider/login/cancel`,{sessionId:t.sessionId,id:e})},async refreshModels(){u(await ex(`/api/models`)),f(`ready`)},async updateConfig(e,n,r,i){if(!t||a!==`connected`)throw Error(U(`Pi 会话不可用`,`Pi session is unavailable`));return $b(`/api/config`,{sessionId:t.sessionId,kind:e,scope:n,action:r,value:i})}}}var nx=(0,B.createContext)({});function rx({children:e,openExternalLink:t,openFile:n,fileImages:r}){let i=(0,B.useMemo)(()=>({openExternalLink:t,openFile:n,fileImages:r}),[t,n,r]);return(0,W.jsx)(nx.Provider,{value:i,children:e})}function ix(){return(0,B.useContext)(nx)}function ax(e,t){throw Error(`${t}: unhandled ${JSON.stringify(e)}`)}function ox(e,t){let n=e.nodes[t];if(n===void 0)throw Error(`layout: unknown node ${t}`);return n}function sx(e,t){let n=ox(e,t);if(n.kind!==`pane`)throw Error(`layout: ${t} is not a pane`);return n}function cx(e,t){let n=ox(e,t);if(n.kind!==`split`)throw Error(`layout: ${t} is not a split`);return n}function lx(e,t){let n=e.tabs[t];if(n===void 0)throw Error(`layout: unknown tab ${t}`);return n}function ux(e){if(e.host!==`float`||e.rect===void 0)throw Error(`layout: ${e.id} is not floating`);return e.rect}function dx(e,t){let n=e.floats.indexOf(t);if(n<0)throw Error(`layout: floating pane ${t} is not in the z order`);return n}function fx(e){let t=e.tabs[0];if(t===void 0||e.tabs.length!==1)throw Error(`layout: ${e.id} does not hold exactly one tab`);return t}function px(e,t){for(let n of Object.values(e.nodes))if(n.kind===`split`&&n.children.includes(t))return n}function mx(e,t){for(let n of Object.values(e.nodes))if(n.kind===`pane`&&n.tabs.includes(t))return n;throw Error(`layout: tab ${t} has no pane`)}function hx(e){let t=[],n=r=>{let i=ox(e,r);if(i.kind===`pane`)t.push(i.id);else for(let e of i.children)n(e)};return n(e.rootId),t}function gx(e){let t=e.reduce((e,t)=>e+t,0);if(!(t>0))throw Error(`layout: sizes must sum above zero`);return Math.abs(t-1)<1e-12?[...e]:e.map(e=>e/t)}function _x(e){return Object.entries(e)}function vx(e){return Object.keys(e)}function yx(e,t){let n={};for(let[r,i]of _x(e.nodes))r in t||(n[r]=i);for(let[e,r]of _x(t))r!==null&&(n[e]=r);return{...e,nodes:n}}function bx(e,t){let n={};for(let[r,i]of _x(e.tabs))r in t||(n[r]=i);for(let[e,r]of _x(t))r!==null&&(n[e]=r);return{...e,tabs:n}}function xx(e,t,n){let r=Math.max(0,Math.min(t,e.length));return[...e.slice(0,r),n,...e.slice(r)]}function Sx(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function Cx(e,t){let n=Sx(e,t);if(n.length!==0)return n[Math.max(0,t-1)]}function wx(e,t,n){return{...e,tabs:t,activeTabId:n}}function Tx(e,t,n){let r=px(e,t);if(r===void 0){if(e.rootId!==t)throw Error(`layout: ${t} is neither rooted nor parented`);return{...e,rootId:n}}let i=r.children.map(e=>e===t?n:e);return yx(e,{[r.id]:{...r,children:i}})}function Ex(e,t){let n=ox(e,e.rootId);for(;n.kind===`split`;){let r=t(n);if(r===void 0)throw Error(`layout: split ${n.id} has no children`);n=ox(e,r)}return n.id}function Dx(e){return Ex(e,e=>e.children[0])}function Ox(e){return Ex(e,e=>e.axis===`row`?e.children.at(-1):e.children[0])}function kx(e,t){let n={};for(let r of t)n[r]=sx(e,r).activeTabId;return{type:`restoreFocus`,activePaneId:e.activePaneId,floats:e.floats,paneActiveTabs:n}}function Ax(e,t){return[...e.filter(e=>e!==t),t]}function jx(e,t){return e.activePaneId===t?{...e,activePaneId:Dx(e)}:e}function Mx(e){return{kind:`pane`,id:e,host:`dock`,tabs:[],activeTabId:void 0,rect:void 0}}function Nx(e,t){if(e.nodes[t]!==void 0)throw Error(`layout: node ${t} already exists`)}function Px(e,t){if(e.tabs[t]!==void 0)throw Error(`layout: tab ${t} already exists`)}function Fx(e,t){if(sx(e,t.paneId).host!==`dock`)throw Error(`layout: split requires a docked pane`);Nx(e,t.newPaneId);let n=Mx(t.newPaneId),r=px(e,t.paneId);if(r!==void 0&&r.axis===t.axis){let i=r.children.indexOf(t.paneId),a=t.direction===`after`?i+1:i,o=xx(r.children,a,t.newPaneId),s=r.sizes.flatMap((e,t)=>t===i?[e/2,e/2]:[e]);return{state:yx(e,{[t.newPaneId]:n,[r.id]:{...r,children:o,sizes:s}}),inverse:[{type:`merge`,paneId:t.newPaneId},{type:`resize`,splitId:r.id,sizes:r.sizes}]}}Nx(e,t.newSplitId);let i=Tx(e,t.paneId,t.newSplitId),a=t.direction===`after`?[t.paneId,t.newPaneId]:[t.newPaneId,t.paneId];return{state:yx(i,{[t.newPaneId]:n,[t.newSplitId]:{kind:`split`,id:t.newSplitId,axis:t.axis,children:a,sizes:[.5,.5]}}),inverse:[{type:`merge`,paneId:t.newPaneId}]}}function Ix(e,t){let n=sx(e,t.paneId);if(n.tabs.length>0)throw Error(`layout: merge requires an empty pane`);let r=kx(e,[]);if(n.host===`float`){let i=dx(e,t.paneId);return{state:jx(yx({...e,floats:Sx(e.floats,i)},{[t.paneId]:null}),t.paneId),inverse:[{type:`insertPane`,pane:n,tabs:[],attach:{mode:`float`,index:i}},r]}}let i=px(e,t.paneId);if(i===void 0)throw Error(`layout: the docked root pane cannot be merged`);let a=i.children.indexOf(t.paneId);if(i.children.length>2){let o=Sx(i.children,a),s=gx(Sx(i.sizes,a));return{state:jx(yx(e,{[t.paneId]:null,[i.id]:{...i,children:o,sizes:s}}),t.paneId),inverse:[{type:`insertPane`,pane:n,tabs:[],attach:{mode:`child`,parentId:i.id,index:a,sizes:i.sizes}},r]}}let o=i.children[1-a];if(o===void 0)throw Error(`layout: merge found a split without a sibling`);return{state:jx(yx(Tx(e,i.id,o),{[t.paneId]:null,[i.id]:null}),t.paneId),inverse:[{type:`insertPane`,pane:n,tabs:[],attach:{mode:`wrap`,targetId:o,split:i}},r]}}function Lx(e,t){let n=sx(e,t.paneId);if(n.host!==`dock`)throw Error(`layout: openTab requires a docked pane`);Px(e,t.tab.id);let r=kx(e,[n.id]);return{state:{...yx(bx(e,{[t.tab.id]:t.tab}),{[n.id]:wx(n,xx(n.tabs,t.index,t.tab.id),t.tab.id)}),activePaneId:n.id},inverse:[{type:`closeTab`,tabId:t.tab.id},r]}}function Rx(e,t){let n=sx(e,t.paneId);if(n.host!==`dock`)throw Error(`layout: insertTab requires a docked pane`);Px(e,t.tab.id);let r=kx(e,[n.id]),i=xx(n.tabs,t.index,t.tab.id);return{state:yx(bx(e,{[t.tab.id]:t.tab}),{[n.id]:wx(n,i,n.activeTabId??t.tab.id)}),inverse:[{type:`closeTab`,tabId:t.tab.id},r]}}function zx(e,t){let n=lx(e,t.tabId),r=mx(e,t.tabId),i=r.tabs.indexOf(t.tabId),a=kx(e,[r.id]);if(r.host===`float`){let i=dx(e,r.id);return{state:jx(bx(yx({...e,floats:Sx(e.floats,i)},{[r.id]:null}),{[t.tabId]:null}),r.id),inverse:[{type:`insertPane`,pane:r,tabs:[n],attach:{mode:`float`,index:i}},a]}}let o=r.activeTabId===t.tabId?Cx(r.tabs,i):r.activeTabId;return{state:bx(yx(e,{[r.id]:wx(r,Sx(r.tabs,i),o)}),{[t.tabId]:null}),inverse:[{type:`insertTab`,paneId:r.id,tab:n,index:i},a]}}function Bx(e,t){if(Nx(e,t.pane.id),t.pane.tabs.length!==t.tabs.length)throw Error(`layout: insertPane tab records do not match the pane`);if(t.pane.host===`dock`&&t.tabs.length>0)throw Error(`layout: insertPane returns a docked pane empty`);let n={};for(let r of t.tabs)Px(e,r.id),n[r.id]=r;let r=t.tabs[0],i=r===void 0?[{type:`merge`,paneId:t.pane.id}]:[{type:`closeTab`,tabId:r.id},kx(e,[])],a=t.attach;switch(a.mode){case`child`:{let r=cx(e,a.parentId),o=xx(r.children,a.index,t.pane.id);if(a.sizes.length!==o.length)throw Error(`layout: insertPane sizes do not match the split`);return i.push({type:`resize`,splitId:r.id,sizes:r.sizes}),{state:yx(bx(e,n),{[t.pane.id]:t.pane,[r.id]:{...r,children:o,sizes:a.sizes}}),inverse:i}}case`wrap`:if(!a.split.children.includes(t.pane.id))throw Error(`layout: insertPane wrap split does not list the pane`);return{state:yx(bx(Tx(e,a.targetId,a.split.id),n),{[t.pane.id]:t.pane,[a.split.id]:a.split}),inverse:i};case`float`:{if(t.pane.host!==`float`)throw Error(`layout: float attachment requires a floating pane`);let r=xx(e.floats,a.index,t.pane.id);return{state:yx(bx({...e,floats:r},n),{[t.pane.id]:t.pane}),inverse:i}}default:return ax(a,`layout: insertPane attachment`)}}function Vx(e,t){let n=mx(e,t.tabId);if(n.host!==`dock`)throw Error(`layout: moveTab source must be docked; use unfloat`);let r=sx(e,t.toPaneId);if(r.host!==`dock`)throw Error(`layout: moveTab target must be docked`);if(r.id===n.id)throw Error(`layout: moveTab across one pane; use reorderTab`);let i=n.tabs.indexOf(t.tabId),a=kx(e,[n.id,r.id]),o=n.activeTabId===t.tabId?Cx(n.tabs,i):n.activeTabId;return{state:{...yx(e,{[n.id]:wx(n,Sx(n.tabs,i),o),[r.id]:wx(r,xx(r.tabs,t.index,t.tabId),t.tabId)}),activePaneId:r.id},inverse:[{type:`moveTab`,tabId:t.tabId,toPaneId:n.id,index:i},a]}}function Hx(e,t){let n=mx(e,t.tabId),r=n.tabs.indexOf(t.tabId),i=xx(Sx(n.tabs,r),t.index,t.tabId);return{state:yx(e,{[n.id]:{...n,tabs:i}}),inverse:[{type:`reorderTab`,tabId:t.tabId,index:r}]}}function Ux(e,t){let n=mx(e,t.tabId),r=kx(e,[n.id]),i=yx(e,{[n.id]:{...n,activeTabId:t.tabId}}),a=n.host===`float`?Ax(i.floats,n.id):i.floats;return{state:{...i,activePaneId:n.id,floats:a},inverse:[r]}}function Wx(e,t){let n=sx(e,t.paneId),r=kx(e,[]),i=n.host===`float`?Ax(e.floats,n.id):e.floats;return{state:{...e,activePaneId:n.id,floats:i},inverse:[r]}}function Gx(e,t){let n=cx(e,t.splitId);if(t.sizes.length!==n.children.length)throw Error(`layout: resize sizes do not match the split`);if(t.sizes.some(e=>!(e>0)))throw Error(`layout: resize sizes must all be above zero`);return{state:yx(e,{[n.id]:{...n,sizes:gx(t.sizes)}}),inverse:[{type:`resize`,splitId:n.id,sizes:n.sizes}]}}function Kx(e,t){lx(e,t.tabId);let n=mx(e,t.tabId);if(n.host!==`dock`)throw Error(`layout: float requires a docked tab`);Nx(e,t.newPaneId);let r=n.tabs.indexOf(t.tabId),i=kx(e,[n.id]),a=n.activeTabId===t.tabId?Cx(n.tabs,r):n.activeTabId,o=yx(e,{[n.id]:wx(n,Sx(n.tabs,r),a),[t.newPaneId]:{kind:`pane`,id:t.newPaneId,host:`float`,tabs:[t.tabId],activeTabId:t.tabId,rect:t.rect}});return{state:{...o,floats:[...o.floats,t.newPaneId],activePaneId:t.newPaneId},inverse:[{type:`unfloat`,paneId:t.newPaneId,toPaneId:n.id,index:r},i]}}function qx(e,t){let n=sx(e,t.paneId),r=ux(n),i=fx(n),a=sx(e,t.toPaneId);if(a.host!==`dock`)throw Error(`layout: unfloat target must be docked`);let o=kx(e,[a.id]);return{state:{...yx({...e,floats:Sx(e.floats,dx(e,t.paneId))},{[t.paneId]:null,[a.id]:wx(a,xx(a.tabs,t.index,i),i)}),activePaneId:a.id},inverse:[{type:`float`,tabId:i,newPaneId:t.paneId,rect:r},o]}}function Jx(e,t,n){let r=yx(e,{[t.id]:{...t,rect:n}});return{...r,activePaneId:t.id,floats:Ax(r.floats,t.id)}}function Yx(e,t){let n=sx(e,t.paneId),r=ux(n);return{state:Jx(e,n,{...r,x:t.x,y:t.y}),inverse:[{type:`moveFloat`,paneId:t.paneId,x:r.x,y:r.y},kx(e,[])]}}function Xx(e,t){let n=sx(e,t.paneId),r=ux(n);if(!(t.rect.width>0)||!(t.rect.height>0))throw Error(`layout: float size must be above zero`);return{state:Jx(e,n,t.rect),inverse:[{type:`resizeFloat`,paneId:t.paneId,rect:r},kx(e,[])]}}function Zx(e,t){let n=kx(e,vx(t.paneActiveTabs));for(let n of t.floats)if(sx(e,n).host!==`float`)throw Error(`layout: restoreFocus lists docked pane ${n} as floating`);let r=e;for(let[e,n]of _x(t.paneActiveTabs)){let t=sx(r,e);r=yx(r,{[e]:{...t,activeTabId:n}})}return sx(r,t.activePaneId),{state:{...r,activePaneId:t.activePaneId,floats:t.floats},inverse:[n]}}function Qx(e,t){switch(t.type){case`split`:return Fx(e,t);case`merge`:return Ix(e,t);case`openTab`:return Lx(e,t);case`insertTab`:return Rx(e,t);case`closeTab`:return zx(e,t);case`insertPane`:return Bx(e,t);case`moveTab`:return Vx(e,t);case`reorderTab`:return Hx(e,t);case`focusTab`:return Ux(e,t);case`focusPane`:return Wx(e,t);case`resize`:return Gx(e,t);case`float`:return Kx(e,t);case`unfloat`:return qx(e,t);case`moveFloat`:return Yx(e,t);case`resizeFloat`:return Xx(e,t);case`setExpanded`:return{state:{...e,expanded:t.expanded},inverse:[{type:`setExpanded`,expanded:e.expanded}]};case`setMode`:return{state:{...e,mode:t.mode},inverse:[{type:`setMode`,mode:e.mode}]};case`restoreFocus`:return Zx(e,t);default:return ax(t,`layout: operation`)}}function $x(e,t){return t.reduce((e,t)=>Qx(e,t).state,e)}var eS={entries:[],cursor:0},tS=new Set([`focusTab`,`focusPane`,`restoreFocus`]);function nS(e){return tS.has(e.type)}function rS(e,t){let n=e.entries[t];return n!==void 0&&n.ops.every(nS)}function iS(e){return e.cursor>0}function aS(e){return e.cursor<e.entries.length}function oS(e){return e.entries.flatMap(e=>e.ops)}function sS(e,t,n){if(n.length===0)return{history:e,state:t};let r=t,i=[];for(let e of n){let t=Qx(r,e);r=t.state,i.unshift(...t.inverse)}return{history:{entries:[...e.cursor===e.entries.length?e.entries:e.entries.slice(0,e.cursor),{ops:n,inverse:i}],cursor:e.cursor+1},state:r}}function cS(e,t){if(!iS(e))return;let n=1;if(rS(e,e.cursor-1))for(;rS(e,e.cursor-1-n);)n+=1;let r=t;for(let t of e.entries.slice(e.cursor-n,e.cursor).reverse())for(let e of t.inverse)r=Qx(r,e).state;return{history:{entries:e.entries,cursor:e.cursor-n},state:r}}function lS(e,t){if(!aS(e))return;let n=1;if(rS(e,e.cursor))for(;rS(e,e.cursor+n);)n+=1;let r=t;for(let t of e.entries.slice(e.cursor,e.cursor+n))for(let e of t.ops)r=Qx(r,e).state;return{history:{entries:e.entries,cursor:e.cursor+n},state:r}}var uS=class{current;recorded=eS;constructor(e){this.current=e}get state(){return this.current}get history(){return this.recorded}get ops(){return oS(this.recorded)}get cursor(){return this.recorded.cursor}get canUndo(){return iS(this.recorded)}get canRedo(){return aS(this.recorded)}dispatch(e){return this.dispatchAll([e])}dispatchAll(e){let t=sS(this.recorded,this.current,e);return this.recorded=t.history,this.current=t.state,this.current}undo(){let e=cS(this.recorded,this.current);return e!==void 0&&(this.recorded=e.history,this.current=e.state,!0)}redo(){let e=lS(this.recorded,this.current);return e!==void 0&&(this.recorded=e.history,this.current=e.state,!0)}},dS=.12,fS={width:380,height:300},pS={width:220,height:140},mS=.25;function hS(e){return hx(e).length}function gS(e){return hS(e)<4}function _S(e,t,n=mS){let r=`left`,i=e;return 1-e<i&&(r=`right`,i=1-e),t<i&&(r=`top`,i=t),1-t<i&&(r=`bottom`,i=1-t),i<n?r:`center`}function vS(e){switch(e){case`center`:return;case`left`:return{axis:`row`,direction:`before`};case`right`:return{axis:`row`,direction:`after`};case`top`:return{axis:`column`,direction:`before`};case`bottom`:return{axis:`column`,direction:`after`};default:return ax(e,`layout: dock zone`)}}function yS(e,t=dS){if(e.length===0)return[];let n=Math.min(t,1/e.length),r=e.map(e=>e>0?e:0),i=r.reduce((e,t)=>e+t,0),a=i>0?r.map(e=>e/i):r.map(()=>1/e.length),o=new Set;for(;;){let e=a.flatMap((e,t)=>!o.has(t)&&e<n?[t]:[]);if(e.length===0)return a;for(let t of e)o.add(t);let t=1-o.size*n,r=a.reduce((e,t,n)=>o.has(n)?e:e+t,0);a=a.map((e,i)=>o.has(i)?n:e/r*t)}}function bS(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function xS(e,t,n,r=mS){return!(e.width>0)||!(e.height>0)?`center`:_S((t-e.x)/e.width,(n-e.y)/e.height,r)}function SS(e,t){let n=0;for(let r of e){if(t<r.x+r.width/2)break;n+=1}return n}var CS={divider:0,chip:100,body:48};function wS(e,t=CS){let{pane:n,strip:r}=e;if(!(n.width>0)||!(n.height>0)||!(r.width>0))return{row:!0,column:!0};let i=Math.max(0,n.width-r.width),a=Math.max(0,r.width-e.chipsWidth-e.fillWidth-(e.splitControlWidth??0)),o=(n.width-t.divider)/2-i,s=(n.height-t.divider)/2-i;return{row:o>=a+t.chip,column:s>=r.height+t.body}}function TS(e,t,n,r){return Math.abs(n-e)>=4||Math.abs(r-t)>=4}function ES(e,t,n){let r=e[t],i=e[t+1];if(r===void 0||i===void 0)return[...e];let a=[...e];return a[t]=r+n,a[t+1]=i-n,a}function DS(e,t,n){return{...e,x:e.x+t,y:e.y+n}}function OS(e,t,n,r){return{...e,width:Math.max(r.width,e.width+t),height:Math.max(r.height,e.height+n)}}function kS(e,t,n){return{x:Math.max(0,e-AS.x),y:Math.max(0,t-AS.y),...n}}var AS={x:60,y:14},jS=24,MS={x:160,y:120},NS=[];function PS(e,t,n,r){for(let i of sx(e,t).tabs){let t=e.tabs[i];if(t?.contentId===n&&(r===void 0||t.kind===r))return i}}function FS(e,t,n){for(let r of[...hx(e),...e.floats]){let i=PS(e,r,t,n);if(i!==void 0)return i}}function IS(e){let t=sx(e,e.activePaneId);return t.host===`dock`?t.id:Dx(e)}function LS(e,t,n,r){return e.host===`float`?{type:`unfloat`,paneId:e.id,toPaneId:n,index:r}:{type:`moveTab`,tabId:t,toPaneId:n,index:r}}function RS(e,t){return e.expanded===t?NS:[{type:`setExpanded`,expanded:t}]}function zS(e,t){return e.mode===t?NS:[{type:`setMode`,mode:t}]}function BS(e,t,n,r){if(!gS(e))return NS;let i=n??IS(e);if(sx(e,i).host!==`dock`)return NS;let a=t(`pane`),o=[{type:`split`,paneId:i,axis:`row`,direction:`after`,newPaneId:a,newSplitId:t(`split`)}],s=r?.(t(`tab`));return s!==void 0&&o.push({type:`openTab`,paneId:a,tab:s,index:0}),o}function VS(e,t,n,r){if(r===void 0)return NS;let i=sx(e,n);return i.host===`dock`?[{type:`openTab`,paneId:n,tab:r(t(`tab`)),index:i.tabs.length}]:NS}function HS(e,t,n){let r=n.revealIfOpened===!1?void 0:FS(e,n.contentId,n.kind);if(r!==void 0)return{ops:[{type:`focusTab`,tabId:r}],tabId:r};let i=n.paneId??IS(e),a={id:t(`tab`),kind:n.kind,contentId:n.contentId,title:n.title};return{ops:[{type:`openTab`,paneId:i,tab:a,index:n.index??sx(e,i).tabs.length}],tabId:a.id}}function US(e,t,n){let r=lx(e,n),i=mx(e,n),a=i.host===`dock`?i.id:IS(e),o=i.host===`dock`?i.tabs.indexOf(n)+1:sx(e,a).tabs.length,s={...r,id:t(`tab`)};return{ops:[{type:`openTab`,paneId:a,tab:s,index:o}],tabId:s.id}}function WS(e,t,n,r){let i=mx(e,t);if(sx(e,n).host!==`dock`)return NS;if(i.id===n){let e=i.tabs.indexOf(t),n=r>e?r-1:r;return n===e?NS:[{type:`reorderTab`,tabId:t,index:n}]}return[LS(i,t,n,r)]}function GS(e,t,n,r,i,a){let o=mx(e,n),s=sx(e,r);if(s.host!==`dock`)return NS;let c=vS(i);if(c===void 0)return o.id===r?NS:[LS(o,n,r,s.tabs.length)];let l=o.id===r&&o.tabs.length===1;if(l&&a===void 0||!gS(e))return NS;let u=t(`pane`),d=[{type:`split`,paneId:r,axis:c.axis,direction:c.direction,newPaneId:u,newSplitId:t(`split`)}];return l&&a!==void 0&&d.push({type:`openTab`,paneId:r,tab:a(t(`tab`)),index:o.tabs.length}),d.push(LS(o,n,u,0)),d}function KS(e,t,n,r){let i=e.floats.length*jS,a=t(`float`);return{ops:[{type:`float`,tabId:n,newPaneId:a,rect:r??{x:MS.x+i,y:MS.y+i,width:fS.width,height:fS.height}}],paneId:a}}function qS(e,t,n){let r=n??IS(e);return[{type:`unfloat`,paneId:t,toPaneId:r,index:sx(e,r).tabs.length}]}function JS(e,t,n){return[{type:`resize`,splitId:e,sizes:yS(t,n)}]}function YS(e,t,n){let r=[],i=e;for(;;){let e=hx(i).find(e=>e!==i.rootId&&sx(i,e).tabs.length===0);if(e===void 0)break;let t={type:`merge`,paneId:e};r.push(t),i=Qx(i,t).state}let a=ox(i,i.rootId);return a.kind===`pane`&&a.tabs.length===0&&n!==void 0&&r.push({type:`openTab`,paneId:a.id,tab:n(t(`tab`)),index:0}),r}function XS(e=0){let t=e;return{next:(e=>(t+=1,`${e}${t}`))}}function ZS(e,t,n=`push`){let r=e.next(`pane`),i=t?.(e.next(`tab`));return{nodes:{[r]:{kind:`pane`,id:r,host:`dock`,tabs:i===void 0?[]:[i.id],activeTabId:i?.id,rect:void 0}},tabs:i===void 0?{}:{[i.id]:i},rootId:r,floats:[],activePaneId:r,expanded:!1,mode:n}}var QS=class{minter;sequencer;listeners=new Set;makePaneTab;snapshot;constructor(e={}){this.minter=XS(),this.makePaneTab=e.makePaneTab,this.sequencer=new uS(ZS(this.minter,e.makeInitialTab,e.mode)),this.snapshot=this.buildSnapshot()}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.snapshot;get ops(){return this.sequencer.ops}buildSnapshot(){let e=this.sequencer.state;return{state:e,canUndo:this.sequencer.canUndo,canRedo:this.sequencer.canRedo,canSplit:gS(e),opCount:this.sequencer.ops.length,cursor:this.sequencer.cursor}}commit(){this.snapshot=this.buildSnapshot();for(let e of[...this.listeners])e()}get state(){return this.sequencer.state}get mint(){return this.minter.next}run(e,t=!1){if(e.length===0)return!1;if(t){let t=$x(this.state,e);e=[...e,...YS(t,this.mint,t.floats.length>0?this.makePaneTab:void 0)]}return this.sequencer.dispatchAll(e),this.commit(),!0}setExpanded(e){this.run(RS(this.state,e))}toggleExpanded(){this.setExpanded(!this.state.expanded)}setMode(e){this.run(zS(this.state,e))}splitPane(e){return this.run(BS(this.state,this.mint,e,this.makePaneTab))}addTab(e){return this.run(VS(this.state,this.mint,e,this.makePaneTab))}openContent(e){let t=HS(this.state,this.mint,e);return this.run(t.ops),t.tabId}duplicateTab(e){let t=US(this.state,this.mint,e);return this.run(t.ops),t.tabId}closeTab(e){this.run([{type:`closeTab`,tabId:e}],!0)}focusTab(e){this.run([{type:`focusTab`,tabId:e}])}focusPane(e){this.run([{type:`focusPane`,paneId:e}])}reorderTab(e,t){this.run([{type:`reorderTab`,tabId:e,index:t}])}placeTab(e,t,n){return this.run(WS(this.state,e,t,n),!0)}dropTab(e,t,n){return this.run(GS(this.state,this.mint,e,t,n),!0)}floatTab(e,t){let n=KS(this.state,this.mint,e,t);return this.run(n.ops,!0),n.paneId}unfloatPane(e,t){this.run(qS(this.state,e,t))}moveFloat(e,t,n){this.run([{type:`moveFloat`,paneId:e,x:t,y:n}])}resizeFloat(e,t){this.run([{type:`resizeFloat`,paneId:e,rect:t}])}resizeSplit(e,t){this.run(JS(e,t))}undo(){return this.sequencer.undo()?(this.commit(),!0):!1}redo(){return this.sequencer.redo()?(this.commit(),!0):!1}activeDockPaneId(){return IS(this.state)}},$S={x:0,y:0,width:0,height:0},eC={row:!0,column:!0};function tC(e){return e===null?$S:e.getBoundingClientRect()}function nC(e){let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function rC(e){let t=[];for(let n of e.querySelectorAll(`[data-dockkit-pane]`)){let e=n.dataset.dockkitPane;e!==void 0&&t.push([e,n])}return t}function iC(e){let t=e.querySelector(`[data-dockkit-tab]`);if(t===null)return CS.chip;let n=getComputedStyle(t),r=nC(n.minWidth);return r<=0?CS.chip:n.boxSizing===`border-box`?r:r+nC(n.paddingLeft)+nC(n.paddingRight)+nC(n.borderLeftWidth)+nC(n.borderRightWidth)}function aC(e){let t=e.querySelector(`[data-dockkit-divider]`);if(t===null)return CS.divider;let{width:n,height:r}=t.getBoundingClientRect(),i=Math.min(n,r);return i>0?i:CS.divider}function oC(e){let t=e.querySelector(`[data-dockkit-split-button]`);if(t===null)return 0;let n=t.getBoundingClientRect().width;if(!(n>0))return 0;let r=e.querySelector(`[data-dockkit-strip]`);return n+(r===null?0:nC(getComputedStyle(r).columnGap))}function sC(e,t=!1){let n={divider:aC(e),chip:iC(e),body:CS.body},r=new Map;for(let[i,a]of rC(e))r.set(i,wS({pane:tC(a),strip:tC(a.querySelector(`[data-dockkit-strip]`)),chipsWidth:tC(a.querySelector(`[data-dockkit-strip-tabs]`)).width,fillWidth:tC(a.querySelector(`[data-dockkit-strip-fill]`)).width,splitControlWidth:t?oC(a):0},n));return r}function cC(e,t){return e.get(t)??eC}function lC(e,t){if(e.size!==t.size)return!1;for(let[n,r]of e){let e=t.get(n);if(e===void 0||e.row!==r.row||e.column!==r.column)return!1}return!0}function uC(e,t){typeof e.setPointerCapture==`function`&&e.setPointerCapture(t)}function dC(e,t,n){uC(e,t);let r=new AbortController,{signal:i}=r;e.dataset.dockkitPointer=String(t),i.addEventListener(`abort`,()=>{e.dataset.dockkitPointer===String(t)&&delete e.dataset.dockkitPointer},{once:!0});let a=e=>e.pointerId===t;return window.addEventListener(`pointermove`,e=>{a(e)&&n.move(e)},{signal:i}),window.addEventListener(`pointerup`,e=>{a(e)&&(r.abort(),n.up(e))},{signal:i}),window.addEventListener(`pointercancel`,e=>{a(e)&&(r.abort(),n.cancel())},{signal:i}),()=>{r.abort()}}function fC(e){let t=(0,B.useRef)(void 0);return(0,B.useEffect)(()=>()=>{t.current?.stop()},[]),(n,r,i)=>{t.current?.end();let a=()=>{t.current=void 0,e()},o=dC(n,r,{move:i.move,up:e=>{a(),i.up(e)},cancel:a});t.current={stop:o,end:()=>{o(),a()}}}}var pC={split:`_split_1s7ij_17`,splitRow:`_splitRow_1s7ij_24`,splitColumn:`_splitColumn_1s7ij_28`,splitCell:`_splitCell_1s7ij_32`,divider:`_divider_1s7ij_39`,surface:`_surface_1s7ij_125`,tabLayout:`_tabLayout_1s7ij_134`,tabCell:`_tabCell_1s7ij_142`,emptyTabHost:`_emptyTabHost_1s7ij_143`,floatingCell:`_floatingCell_1s7ij_156`,tabHost:`_tabHost_1s7ij_162`,float:`_float_1s7ij_156`,tabHostHeader:`_tabHostHeader_1s7ij_177`,tabHostBody:`_tabHostBody_1s7ij_181`,tabLayoutDivider:`_tabLayoutDivider_1s7ij_186`,pane:`_pane_1s7ij_209`,tabStrip:`_tabStrip_1s7ij_237`,stripTabs:`_stripTabs_1s7ij_257`,stripFill:`_stripFill_1s7ij_288`,stripChrome:`_stripChrome_1s7ij_296`,paneBody:`_paneBody_1s7ij_318`,slot:`_slot_1s7ij_327`,tabActive:`_tabActive_1s7ij_346`,slotCaret:`_slotCaret_1s7ij_346`,tab:`_tab_1s7ij_134`,tabTitle:`_tabTitle_1s7ij_389`,floatTitle:`_floatTitle_1s7ij_409`,tabClose:`_tabClose_1s7ij_417`,addTab:`_addTab_1s7ij_449`,tabQuiet:`_tabQuiet_1s7ij_488`,tabDragging:`_tabDragging_1s7ij_505`,iconButton:`_iconButton_1s7ij_511`,menu:`_menu_1s7ij_547`,menuItem:`_menuItem_1s7ij_561`,empty:`_empty_1s7ij_143`,dockScrim:`_dockScrim_1s7ij_599`,dockScrimIn:`_dockScrimIn_1s7ij_1`,dockHint:`_dockHint_1s7ij_601`,dockHintCard:`_dockHintCard_1s7ij_606`,dockHintIn:`_dockHintIn_1s7ij_1`,dockHintLabel:`_dockHintLabel_1s7ij_694`,floatHeader:`_floatHeader_1s7ij_765`,dockGlyph:`_dockGlyph_1s7ij_782`,floatBody:`_floatBody_1s7ij_787`,floatResize:`_floatResize_1s7ij_797`},mC=4;function hC(e,t){let n=e.getBoundingClientRect(),r=t.offsetWidth,i=n.left+r+mC>window.innerWidth?Math.max(mC,n.right-r):n.left;return{top:n.bottom+mC,left:i}}function gC({labels:e,anchor:t,onClose:n,onDismiss:r,extras:i}){let a=(0,B.useRef)(null),[o,s]=(0,B.useState)(void 0),c=n!==void 0||B.Children.toArray(i).some(e=>e!==``);return(0,B.useLayoutEffect)(()=>{a.current!==null&&s(hC(t,a.current))},[t,c]),(0,B.useEffect)(()=>{let e=a.current;if(e===null)return;let n=e.ownerDocument,i=ne(n),o=a=>{if(i.guards(a)||a.defaultPrevented||a.key!==`Escape`||a.ctrlKey||a.altKey||a.metaKey||a.shiftKey||[...n.querySelectorAll(`[role="dialog"][aria-modal="true"], [role="menu"]`)].at(-1)!==e||(a.preventDefault(),a.repeat))return;let o=e.contains(n.activeElement);r(),o&&I(t)};n.addEventListener(`keydown`,o,!0);let s=t=>{t.target instanceof Node&&e.contains(t.target)||r()};return window.addEventListener(`pointerdown`,s,!0),()=>{i.dispose(),n.removeEventListener(`keydown`,o,!0),window.removeEventListener(`pointerdown`,s,!0)}},[t,r,c]),c?(0,_t.createPortal)((0,W.jsxs)(L,{className:pC.menu,ref:a,role:`menu`,"data-dockkit-tab-menu":!0,style:o??{visibility:`hidden`,top:0,left:0},onPointerDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation()},children:[n!==void 0&&(0,W.jsx)(`button`,{type:`button`,role:`menuitem`,className:pC.menuItem,"data-dockkit-menu-close":!0,onClick:n,children:e.closeTab}),i]}),document.body):null}function _C(e){e.scrollWidth>e.clientWidth+1?e.dataset.dockkitTabClipped=``:delete e.dataset.dockkitTabClipped}function vC({children:e}){let t=(0,B.useRef)(null);return(0,B.useLayoutEffect)(()=>{t.current!==null&&_C(t.current)}),(0,B.useLayoutEffect)(()=>{let e=t.current;if(e===null||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(()=>{_C(e)});return n.observe(e),()=>{n.disconnect()}},[]),(0,W.jsx)(`span`,{ref:t,className:pC.tabTitle,"data-dockkit-tab-title":!0,children:e})}var yC=`M9.67272 0.522841C10.8339 0.522841 11.76 0.522714 12.4963 0.602493C13.2453 0.683657 13.8789 0.854248 14.4264 1.25197C14.7504 1.48739 15.0355 1.77247 15.2709 2.0965C15.6686 2.64394 15.8392 3.27758 15.9204 4.02655C16.0002 4.7629 16 5.68895 16 6.85014V9.14986C16 10.3111 16.0002 11.2371 15.9204 11.9735C15.8392 12.7224 15.6686 13.3561 15.2709 13.9035C15.0355 14.2275 14.7504 14.5126 14.4264 14.748C13.8789 15.1458 13.2453 15.3163 12.4963 15.3975C11.76 15.4773 10.8339 15.4772 9.67272 15.4772H6.3273C5.16611 15.4772 4.24006 15.4773 3.50371 15.3975C2.75474 15.3163 2.1211 15.1458 1.57366 14.748C1.24963 14.5126 0.964549 14.2275 0.729131 13.9035C0.331407 13.3561 0.160817 12.7224 0.0796529 11.9735C-0.000126137 11.2371 1.25338e-09 10.3111 1.25338e-09 9.14986V6.85014C1.25329e-09 5.68895 -0.000126137 4.7629 0.0796529 4.02655C0.160817 3.27758 0.331407 2.64394 0.729131 2.0965C0.964549 1.77247 1.24963 1.48739 1.57366 1.25197C2.1211 0.854248 2.75474 0.683657 3.50371 0.602493C4.24006 0.522714 5.16611 0.522841 6.3273 0.522841H9.67272ZM4.1828 14.0873L5.54303 14.1118C5.78636 14.1128 6.04709 14.1169 6.3273 14.1169H9.67272C10.8639 14.1169 11.7032 14.1164 12.3493 14.0465C12.9824 13.9779 13.3497 13.8494 13.6268 13.6482C13.8354 13.4966 14.0195 13.3125 14.1711 13.1039C14.3723 12.8268 14.5007 12.4595 14.5693 11.8264C14.6393 11.1803 14.6398 10.341 14.6398 9.14986V6.85014C14.6398 5.65896 14.6393 4.81967 14.5693 4.1736C14.5007 3.54048 14.3723 3.17318 14.1711 2.89609C14.0195 2.68747 13.8354 2.50337 13.6268 2.35179C13.3497 2.1506 12.9824 2.02212 12.3493 1.95353C11.7032 1.88358 10.8639 1.88307 9.67272 1.88307H6.3273C6.04709 1.88307 5.78636 1.8862 5.54303 1.88715L4.1828 1.91166C3.99125 1.9216 3.8148 1.93577 3.65076 1.95353C3.01764 2.02212 2.65034 2.1506 2.37325 2.35179C2.16463 2.50337 1.98052 2.68747 1.82895 2.89609C1.62776 3.17318 1.49928 3.54048 1.43069 4.1736C1.36074 4.81967 1.36023 5.65896 1.36023 6.85014V9.14986C1.36023 10.341 1.36074 11.1803 1.43069 11.8264C1.49928 12.4595 1.62776 12.8268 1.82895 13.1039C1.98052 13.3125 2.16463 13.4966 2.37325 13.6482C2.65034 13.8494 3.01764 13.9779 3.65076 14.0465C3.81478 14.0642 3.99127 14.0774 4.1828 14.0873Z`;function bC(){return(0,W.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,W.jsx)(`path`,{d:`M13.5 1.5H2.5C1.94772 1.5 1.5 1.94772 1.5 2.5V13.5C1.5 14.0523 1.94772 14.5 2.5 14.5H13.5C14.0523 14.5 14.5 14.0523 14.5 13.5V2.5C14.5 1.94772 14.0523 1.5 13.5 1.5Z`,stroke:`currentColor`}),(0,W.jsx)(`path`,{d:`M8 1.5V14.5`,stroke:`currentColor`})]})}var xC={center:`M4.56 3.48H11.44A1.6 1.6 0 0 1 13.04 5.08V10.92A1.6 1.6 0 0 1 11.44 12.52H4.56A1.6 1.6 0 0 1 2.96 10.92V5.08A1.6 1.6 0 0 1 4.56 3.48Z`,left:`M4 0.523H8V15.477H4A4 4 0 0 1 0 11.477V4.523A4 4 0 0 1 4 0.523Z`,right:`M8 0.523H12A4 4 0 0 1 16 4.523V11.477A4 4 0 0 1 12 15.477H8Z`,top:`M0 8V4.523A4 4 0 0 1 4 0.523H12A4 4 0 0 1 16 4.523V8Z`,bottom:`M0 8H16V11.477A4 4 0 0 1 12 15.477H4A4 4 0 0 1 0 11.477Z`};function SC({zone:e}){return(0,W.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:yC,fill:`currentColor`}),(0,W.jsx)(`path`,{d:xC[e],fill:`currentColor`})]})}function CC({zone:e,active:t,labels:n}){return(0,W.jsx)(`div`,{className:pC.dockHint,"data-dockkit-dock-zone":e,"data-dockkit-drop-active":t||void 0,children:(0,W.jsxs)(`div`,{className:pC.dockHintCard,children:[(0,W.jsx)(SC,{zone:e}),(0,W.jsx)(`span`,{className:pC.dockHintLabel,children:n.dropZone[e]})]})})}function wC(e,t,n){let r=t.length,i=t.indexOf(n);switch(e){case`ArrowLeft`:return t[(i-1+r)%r];case`ArrowRight`:return t[(i+1)%r];case`Home`:return t[0];case`End`:return t.at(-1);default:return}}function TC(e){return e===`Enter`||e===` `}function EC(e){let t=e.scrollLeft>1,n=e.scrollLeft+e.clientWidth<e.scrollWidth-1;if(t&&n)return`start end`;if(t)return`start`;if(n)return`end`}function DC(e,t){(0,B.useLayoutEffect)(()=>{let t=e.current;if(t===null)return;let n=()=>{let e=EC(t);e===void 0?delete t.dataset.dockkitStripScroll:t.dataset.dockkitStripScroll=e};n(),t.addEventListener(`scroll`,n,{passive:!0});let r=typeof ResizeObserver>`u`?void 0:new ResizeObserver(n);return r?.observe(t),()=>{t.removeEventListener(`scroll`,n),r?.disconnect()}},[e,t])}function OC(e,t,n,r){(0,B.useLayoutEffect)(()=>{let n=e.current,i=r===void 0?void 0:t.get(r);if(n===null||i===void 0)return;let a=n.getBoundingClientRect(),o=i.getBoundingClientRect();o.left<a.left?n.scrollLeft+=o.left-a.left-kC:o.right>a.right&&(n.scrollLeft+=o.right-a.right+kC)},[e,t,n,r])}var kC=24;function AC(e,t){switch(t){case`budget`:return e.splitPaneDisabled;case`width`:return e.splitPaneNarrow}}function jC({state:e,pane:t,callbacks:n}){let[r,i]=(0,B.useState)(void 0),[a]=(0,B.useState)(()=>new Map),o=(0,B.useRef)(null);DC(o,t.tabs),OC(o,a,t.tabs,t.activeTabId);let s=n.splitBlock(t.id),c=n.dropTarget,l=c!==void 0&&c.kind===`strip`&&c.paneId===t.id?c.index:void 0,u=r=>{(e.activePaneId!==t.id||t.activeTabId!==r)&&n.onFocusTab(r)},d=e=>{let t=a.get(e);t!==void 0&&t.focus()};return(0,W.jsxs)(`div`,{className:pC.tabStrip,role:`tablist`,"data-dockkit-strip":t.id,"data-window-drag":e.floats.length===0||void 0,children:[(0,W.jsxs)(`div`,{ref:o,className:pC.stripTabs,role:`presentation`,"data-dockkit-strip-tabs":t.id,children:[t.tabs.map((o,s)=>{let c=lx(e,o),f=o===t.activeTabId,p=n.canCloseTab(o),m=!p&&t.tabs.length===1;return(0,W.jsxs)(B.Fragment,{children:[(s>0||l===s)&&(0,W.jsx)(`div`,{className:F(pC.slot,l===s&&pC.slotCaret),"data-dockkit-caret":l===s?s:void 0}),(0,W.jsxs)(`div`,{role:`tab`,"aria-selected":f,tabIndex:f?0:-1,className:F(pC.tab,f&&pC.tabActive,m&&pC.tabQuiet,n.draggingTabId===o&&pC.tabDragging),"data-dockkit-tab":o,"data-dockkit-tab-quiet":m||void 0,ref:e=>{e===null?a.delete(o):a.set(o,e)},onPointerDown:e=>{e.button!==2&&n.onTabPressed(o,e)},onClick:e=>{e.stopPropagation(),u(o)},onKeyDown:e=>{if(e.target!==e.currentTarget||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||e.nativeEvent.isComposing)return;let n=wC(e.key,t.tabs,o);n===void 0?TC(e.key)&&(e.preventDefault(),u(o)):(e.preventDefault(),d(n))},onContextMenu:e=>{e.preventDefault();let t=e.currentTarget;i(e=>e?.tabId===o?void 0:{tabId:o,anchor:t})},children:[(0,W.jsx)(vC,{children:n.renderTabTitle?.(c)??c.title}),p&&(0,W.jsx)(Pv,{disabled:r!==void 0,label:n.labels.closeTab,shortcutKeys:n.labels.closeTabKeys,side:`bottom`,delayMs:500,children:(0,W.jsx)(`button`,{type:`button`,className:pC.tabClose,"aria-label":n.labels.closeTab,"aria-keyshortcuts":n.labels.closeTabShortcut,"data-dockkit-tab-close":o,onPointerDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),n.onCloseTab(o)},children:(0,W.jsx)(y,{size:14})})}),r?.tabId===o&&(0,W.jsx)(gC,{labels:n.labels,anchor:r.anchor,onClose:p?()=>{i(void 0),n.onCloseTab(o)}:void 0,onDismiss:()=>{i(void 0)},extras:n.renderTabMenuItems?.(c,()=>{i(void 0)})})]})]},o)}),l===t.tabs.length&&(0,W.jsx)(`div`,{className:F(pC.slot,pC.slotCaret),"data-dockkit-caret":l})]}),n.canAddTab(t.id)&&(0,W.jsx)(Pv,{label:n.labels.addTab,side:`bottom`,delayMs:500,children:(0,W.jsx)(`button`,{type:`button`,className:pC.addTab,"aria-label":n.labels.addTab,"data-dockkit-add-tab":t.id,onClick:e=>{e.stopPropagation(),n.onAddTab(t.id)},children:(0,W.jsx)(E,{size:14})})}),(0,W.jsx)(`div`,{className:pC.stripFill,"data-dockkit-strip-fill":!0}),!(n.hideSplitWhenBlocked&&s!==void 0)&&(0,W.jsx)(Pv,{label:s===void 0?n.labels.splitPane:AC(n.labels,s),shortcutKeys:n.labels.splitPaneKeys,side:`bottom`,delayMs:500,children:(0,W.jsx)(`span`,{tabIndex:s===void 0?void 0:0,"aria-label":s===void 0?void 0:AC(n.labels,s),children:(0,W.jsx)(`button`,{type:`button`,className:pC.iconButton,"aria-label":n.labels.splitPane,"aria-keyshortcuts":n.labels.splitPaneShortcut,disabled:s!==void 0,"data-dockkit-split-button":t.id,"data-dockkit-split-blocked":s,onClick:e=>{e.stopPropagation(),n.onSplitPane(t.id)},children:(0,W.jsx)(bC,{})})})}),t.id===n.chromePaneId&&n.chrome!==void 0&&(0,W.jsx)(`div`,{className:pC.stripChrome,"data-dockkit-strip-chrome":!0,onClick:e=>{e.stopPropagation()},children:n.chrome})]})}function MC({pane:e,callbacks:t}){let n=t.dropTarget,r=n?.kind===`zone`&&n.paneId===e.id?n.zone:void 0;return r===void 0?null:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:pC.dockScrim,"data-dockkit-dock-scrim":!0}),t.horizontalDrops&&r!==`center`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(CC,{zone:`left`,active:r===`left`,labels:t.labels}),(0,W.jsx)(CC,{zone:`right`,active:r===`right`,labels:t.labels})]}):(0,W.jsx)(CC,{zone:r,active:!0,labels:t.labels})]})}function NC({state:e,pane:t,callbacks:n}){let r=t.activeTabId===void 0?void 0:lx(e,t.activeTabId);return(0,W.jsxs)(`section`,{className:pC.pane,"data-dockkit-pane":t.id,tabIndex:-1,"data-dockkit-pane-active":e.activePaneId===t.id||void 0,onClick:()=>{e.activePaneId!==t.id&&n.onFocusPane(t.id)},children:[(0,W.jsx)(jC,{state:e,pane:t,callbacks:n}),(0,W.jsxs)(`div`,{className:pC.paneBody,children:[r===void 0?(0,W.jsx)(`p`,{className:pC.empty,children:n.labels.emptyPane}):n.renderTab(r),(0,W.jsx)(MC,{pane:t,callbacks:n})]})]})}function PC(e,t,n){let r=t-e.originX,i=n-e.originY;return e.mode===`move`?DS(e.rect,r,i):OS(e.rect,r,i,pS)}function FC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function IC(e,t){return e.activePaneId===t&&e.floats.at(-1)===t}function LC(e,t){let[n,r]=(0,B.useState)(void 0),i=fC(()=>{r(void 0)}),a=n=>{IC(e,n)||t.focusPane(n)};return{preview:n,raise:a,drag:(n,o,s)=>{s.stopPropagation();let c={mode:n,originX:s.clientX,originY:s.clientY,rect:ux(sx(e,o))};i(s.currentTarget,s.pointerId,{move:e=>{r({paneId:o,rect:PC(c,e.clientX,e.clientY)})},up:e=>{let r=PC(c,e.clientX,e.clientY);FC(r,c.rect)?a(o):n===`move`?t.moveFloat(o,r.x,r.y):t.resizeFloat(o,r)}})}}}function RC({paneId:e,tab:t,labels:n,intents:r,renderTabTitle:i,canCloseTab:a,drag:o}){return(0,W.jsxs)(`header`,{className:F(pC.tabStrip,pC.floatHeader),"data-dockkit-float-grip":e,onPointerDown:t=>{o(`move`,e,t)},children:[(0,W.jsx)(`div`,{className:F(pC.tab,pC.floatTitle),"data-dockkit-float-title":!0,children:(0,W.jsx)(vC,{children:i?.(t)??t.title})}),(0,W.jsx)(`div`,{className:pC.stripFill}),(0,W.jsx)(Pv,{label:n.dockFloat,side:`bottom`,delayMs:500,children:(0,W.jsx)(`button`,{type:`button`,className:pC.iconButton,"aria-label":n.dockFloat,"data-dockkit-float-dock":e,onPointerDown:e=>{e.stopPropagation()},onClick:()=>{r.unfloatPane(e)},children:(0,W.jsx)(h,{className:pC.dockGlyph})})}),(a?.(t.id)??!0)&&(0,W.jsx)(Pv,{label:n.closeTab,shortcutKeys:n.closeTabKeys,side:`bottom`,delayMs:500,children:(0,W.jsx)(`button`,{type:`button`,className:pC.iconButton,"aria-label":n.closeTab,"data-dockkit-float-close":e,onPointerDown:e=>{e.stopPropagation()},onClick:()=>{r.closeTab(t.id)},children:(0,W.jsx)(x,{})})})]})}function zC({state:e,callbacks:t,intents:n,tab:r,pane:i,column:a,floats:o,focusRequest:s,keepMounted:c,active:l=!0}){let u=i.host===`float`,d=u||i.activeTabId===r.id,f=l&&d&&(u||e.expanded),p=c?.(r)??!1,[m,h]=(0,B.useState)(f);f&&!m&&h(!0);let g=(0,B.useRef)(null),_=(0,B.useRef)(null);(0,B.useLayoutEffect)(()=>{let e=g.current;e.inert=!f;let t=document.activeElement;!f&&t instanceof HTMLElement&&e.contains(t)&&t.blur();let n=s.current;f&&n?.tabId===r.id&&(s.current=void 0,(t===null||t===document.body||t===document.documentElement||t===n.origin)&&[...e.querySelector(`[data-dockkit-strip]`)?.querySelectorAll(`[data-dockkit-tab]`)??[]].find(e=>e.dataset.dockkitTab===r.id)?.focus({preventScroll:!0}))},[f,r.id,s]),(0,B.useEffect)(()=>{let n=_.current,r=()=>{f&&(u?o.raise(i.id):e.activePaneId!==i.id&&t.onFocusPane(i.id))};return n.addEventListener(`focus`,r,!0),()=>{n.removeEventListener(`focus`,r,!0)}},[f,u,o,i.id,e.activePaneId,t]);let v=u&&o.preview?.paneId===i.id?o.preview.rect:void 0,y=u?v??ux(i):void 0,b=v===void 0?e.floats.indexOf(i.id)+1:e.floats.length+1;return(0,W.jsx)(`div`,{className:F(pC.tabCell,u&&pC.floatingCell),hidden:!d,"data-dockkit-host":u?`float`:`dock`,"data-dockkit-column":u?void 0:a,style:{gridColumn:u?1:a*2+1,gridRow:1,order:u?b:0},children:(0,W.jsxs)(`section`,{ref:g,tabIndex:-1,className:F(pC.tabHost,u?pC.float:pC.pane),"aria-hidden":!f||void 0,"data-dockkit-content":r.id,"data-dockkit-pane":!u&&d?i.id:void 0,"data-dockkit-pane-active":!u&&e.activePaneId===i.id||void 0,"data-dockkit-float":u?i.id:void 0,"data-dockkit-float-active":u&&e.activePaneId===i.id||void 0,"data-dockkit-column":u?void 0:a,style:y===void 0?void 0:{left:y.x,top:y.y,width:y.width,height:y.height},onPointerDown:()=>{u&&o.raise(i.id)},onClick:()=>{!u&&e.activePaneId!==i.id&&t.onFocusPane(i.id)},children:[(0,W.jsx)(`div`,{className:pC.tabHostHeader,children:d&&(u?(0,W.jsx)(RC,{paneId:i.id,tab:r,labels:t.labels,intents:n,renderTabTitle:t.renderTabTitle,canCloseTab:t.canCloseTab,drag:o.drag}):(0,W.jsx)(jC,{state:e,pane:i,callbacks:t}))}),(0,W.jsxs)(`div`,{ref:_,className:F(pC.tabHostBody,u?pC.floatBody:pC.paneBody),children:[m&&(p||l&&d)?t.renderTab(r):null,!u&&(0,W.jsx)(MC,{pane:i,callbacks:t})]}),u&&(0,W.jsx)(`div`,{className:pC.floatResize,"data-dockkit-float-resize":i.id,onPointerDown:e=>{o.drag(`resize`,i.id,e)}})]})})}function BC(e){let{state:t,callbacks:n,preview:r}=e,i=(0,B.useRef)(void 0),a={...n,onFocusTab:e=>{i.current=mx(t,e).activeTabId===e?void 0:{tabId:e,origin:document.activeElement},n.onFocusTab(e)}},o=ox(t,t.rootId);if(o.kind===`split`&&(o.axis!==`row`||o.children.length!==2))throw Error(`DockLayout requires one pane or two horizontally split panes`);let s=o.kind===`pane`?[o]:o.children.map(e=>sx(t,e)),c=o.kind===`split`?r?.splitId===o.id?r.sizes:o.sizes:[1],l=LC(t,e.intents),u=c.map(e=>`minmax(0, ${e}fr)`).join(` 0px `);return(0,W.jsxs)(`div`,{className:pC.tabLayout,"data-dockkit-split":o.kind===`split`?o.id:void 0,style:{gridTemplateColumns:u},children:[Object.values(t.tabs).sort((e,t)=>e.id.localeCompare(t.id)).map(n=>{let r=mx(t,n.id);return(0,W.jsx)(zC,{...e,callbacks:a,tab:n,pane:r,column:s.findIndex(e=>e.id===r.id),floats:l,focusRequest:i},n.id)}),s.filter(e=>e.tabs.length===0).map(e=>(0,W.jsx)(`div`,{className:pC.emptyTabHost,"data-dockkit-empty":!0,style:{gridColumn:s.indexOf(e)*2+1,gridRow:1},children:(0,W.jsx)(NC,{state:t,pane:e,callbacks:n})},e.id)),o.kind===`split`&&(0,W.jsx)(`div`,{className:F(pC.divider,pC.tabLayoutDivider),"data-dockkit-divider":`${o.id}:0`,style:{gridColumn:2,gridRow:1},onPointerDown:e=>{n.onDividerPressed(o.id,0,e)}})]})}var VC={draggingTabId:void 0,dropTarget:void 0,sizes:void 0},HC=new Map,UC=()=>!0;function WC(e,t,n,r,i,a){for(let[o,s]of rC(e)){let e=s.getBoundingClientRect();if(!bS(e,t,n))continue;let c=s.querySelector(`[data-dockkit-strip]`);if(c!==null&&bS(c.getBoundingClientRect(),t,n))return{kind:`strip`,paneId:o,index:SS([...c.querySelectorAll(`[data-dockkit-tab]`)].map(e=>e.getBoundingClientRect()),t)};let l=a===`horizontal`?r&&cC(i,o).row?t<e.x+e.width/2?`left`:`right`:`center`:xS(e,t,n);if(l!==`center`){let e=cC(i,o),t=l===`left`||l===`right`?e.row:e.column;if(!r||!t)return}return{kind:`zone`,paneId:o,zone:l}}}function GC(e,t,n,r){let i=(e.axis===`row`?t:n)-e.origin,a=e.extent>0?i/e.extent:0;return yS(ES(e.sizes,e.index,a),r)}var KC=1e-9;function qC(e,t){return e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!==void 0&&Math.abs(e-r)<KC})}function JC({state:e,canSplit:t,canAddTab:n,canCloseTab:r,intents:i,labels:a,renderTab:o,renderTabTitle:s,renderTabMenuItems:c,chrome:l,onRoom:u,draw:d,dropZones:f=`edges`,minPaneFraction:p=dS,hideSplitWhenBlocked:m=!1}){let h=(0,B.useRef)(null),[g,_]=(0,B.useState)(VC),[v,y]=(0,B.useState)(HC),b=fC(()=>{_(VC)}),x=(0,B.useCallback)(e=>{let t=h.current;t!==null&&e(t)},[]),S=(0,B.useCallback)(()=>{x(e=>{let t=sC(e,m);y(e=>lC(e,t)?e:t)})},[x,m]);(0,B.useLayoutEffect)(()=>{S()}),(0,B.useEffect)(()=>{u?.(v)},[v,u]),(0,B.useEffect)(()=>{let e=h.current;if(e===null||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>{S()});return t.observe(e),()=>{t.disconnect()}},[S]);let C={onFocusTab:i.focusTab.bind(i),onFocusPane:i.focusPane.bind(i),onSplitPane:i.splitPane.bind(i),onAddTab:i.addTab.bind(i),onCloseTab:i.closeTab.bind(i),onTabPressed:(e,n)=>{x(r=>{let a=n.clientX,o=n.clientY,s=!1;b(n.currentTarget,n.pointerId,{move:n=>{if(!s){if(!TS(a,o,n.clientX,n.clientY))return;s=!0}_({...VC,draggingTabId:e,dropTarget:WC(r,n.clientX,n.clientY,t,v,f)})},up:n=>{if(!s)return;let a=WC(r,n.clientX,n.clientY,t,v,f);if(a===void 0){if(bS(r.getBoundingClientRect(),n.clientX,n.clientY))return;i.floatTab(e,kS(n.clientX,n.clientY,fS))}else a.kind===`strip`?i.placeTab(e,a.paneId,a.index):i.dropTab(e,a.paneId,a.zone)}})})},onDividerPressed:(t,n,r)=>{let a=r.currentTarget.parentElement;if(a===null)return;let o=cx(e,t),s=a.getBoundingClientRect(),c={splitId:t,index:n,axis:o.axis,origin:o.axis===`row`?r.clientX:r.clientY,extent:o.axis===`row`?s.width:s.height,sizes:o.sizes};b(r.currentTarget,r.pointerId,{move:e=>{_({...VC,sizes:{splitId:t,sizes:GC(c,e.clientX,e.clientY,p)}})},up:e=>{let n=GC(c,e.clientX,e.clientY,p);qC(n,c.sizes)||i.resizeSplit(t,n)}})},splitBlock:e=>t?cC(v,e).row?void 0:`width`:`budget`,hideSplitWhenBlocked:m,canAddTab:n??UC,canCloseTab:r??UC,dropTarget:g.dropTarget,horizontalDrops:f===`horizontal`,draggingTabId:g.draggingTabId,labels:a,renderTab:o,renderTabTitle:s,renderTabMenuItems:c,chromePaneId:Ox(e),chrome:l};return(0,W.jsx)(`div`,{className:pC.surface,ref:h,"data-dockkit-surface":!0,"data-dockkit-drop-zones":f,children:d(C,g.sizes)})}function YC(e){return(0,W.jsx)(JC,{...e,draw:(t,n)=>(0,W.jsx)(BC,{...e,callbacks:t,preview:n})})}var XC={session:`_session_17bxj_24`,panel:`_panel_17bxj_32`,iconButton:`_iconButton_17bxj_129`,collapseGlyph:`_collapseGlyph_17bxj_155`,panelBody:`_panelBody_17bxj_159`,unavailable:`_unavailable_17bxj_165`,tabTitle:`_tabTitle_17bxj_173`,tabBody:`_tabBody_17bxj_177`};function ZC(){return(0,W.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:`M2.33203 10.4054V13.1681C2.33229 13.444 2.55605 13.6681 2.83203 13.6681H5.49512V14.6681H2.83203C2.00376 14.6681 1.33229 13.9963 1.33203 13.1681V10.4054H2.33203ZM14.6689 13.1681C14.6687 13.996 13.9968 14.6676 13.1689 14.6681H10.4951V13.6681H13.1689C13.4445 13.6676 13.6687 13.4437 13.6689 13.1681V10.4054H14.6689V13.1681ZM13.1689 1.33118C13.9969 1.33163 14.6688 2.00315 14.6689 2.83118V5.4054H13.6689V2.83118C13.6688 2.55544 13.4446 2.33162 13.1689 2.33118H10.4951V1.33118H13.1689ZM5.49512 2.33118H2.83203C2.55598 2.33118 2.33218 2.55516 2.33203 2.83118V5.4054H1.33203V2.83118C1.33218 2.00288 2.00369 1.33118 2.83203 1.33118H5.49512V2.33118Z`,fill:`currentColor`})})}function QC(){return(0,W.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[(0,W.jsx)(`path`,{d:`M9 2.5V6C9 6.26522 9.10536 6.51957 9.29289 6.70711C9.48043 6.89464 9.73478 7 10 7H13.5`,stroke:`currentColor`}),(0,W.jsx)(`path`,{d:`M7 13.5V10C7 9.73478 6.89464 9.48043 6.70711 9.29289C6.51957 9.10536 6.26522 9 6 9H2.5`,stroke:`currentColor`})]})}function $C({sessionId:e,fullscreen:t,focus:n=!1,actions:r,t:i,shortcuts:a,toggleFullscreen:o}){let s=t?`push`:`fullscreen`,c=i(n?`chrome.exitFocus`:t?`chrome.exitFullscreen`:`chrome.toFullscreen`),l=a.find(e=>e.id===`pane.fullscreen.toggle`),u=a.find(e=>e.id===`sidebar.right.toggle`);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Pv,{label:c,shortcutKeys:l?.keys,side:`bottom`,delayMs:500,children:(0,W.jsx)(`button`,{type:`button`,className:XC.iconButton,"aria-label":c,"aria-keyshortcuts":l?.aria,"data-sidebar-right-mode":s,onClick:o,children:t?(0,W.jsx)(QC,{}):(0,W.jsx)(ZC,{})})}),(0,W.jsx)(Pv,{label:i(`chrome.collapse`),shortcutKeys:u?.keys,side:`bottom`,delayMs:500,children:(0,W.jsx)(`button`,{type:`button`,className:XC.iconButton,"aria-label":i(`chrome.collapseAria`),"aria-keyshortcuts":u?.aria,"data-sidebar-right-toggle":!0,onClick:()=>{r.toggleExpanded(e)},children:(0,W.jsx)(h,{className:XC.collapseGlyph})})})]})}function ew(e,t,n){return{emptyPane:e(`dock.emptyPane`),splitPane:e(`dock.splitPane`),splitPaneShortcut:t?.aria,splitPaneKeys:t?.keys,splitPaneDisabled:e(`dock.splitPaneDisabled`),splitPaneNarrow:e(`dock.splitPaneNarrow`),closeTab:e(`dock.closeTab`),closeTabShortcut:n?.aria,closeTabKeys:n?.keys,addTab:e(`dock.addTab`),dockFloat:e(`dock.dockFloat`),closeFloat:e(`dock.closeFloat`),dropZone:{center:e(`dock.drop.center`),left:e(`dock.drop.left`),right:e(`dock.drop.right`),top:e(`dock.drop.top`),bottom:e(`dock.drop.bottom`)}}}var tw={"command.close":`关闭当前页面/窗口`,"command.refresh":`刷新当前页面`,"command.noRefresh":`当前页面不支持刷新`,"command.toggle":`展开/收起右侧栏`,"command.fullscreen":`面板全屏/退出全屏`,"command.noSession":`请先选择会话`,"command.noFocus":`请先聚焦右侧面板`,"command.stale":`页面已切换,请重新聚焦`,"command.collapsed":`请先展开右侧栏`,"command.float":`浮动面板不支持此操作`,"command.empty":`请先打开页面`,"command.budget":`已达两格上限`,"command.width":`栏宽不足,拖宽侧边栏后再分栏`,"chrome.expand":`打开侧边栏`,"chrome.expandAria":`打开右侧边栏`,"chrome.collapse":`收起侧边栏`,"chrome.collapseAria":`收起右侧边栏`,"chrome.toFullscreen":`全屏`,"chrome.exitFullscreen":`退出全屏`,"chrome.exitFocus":`退出专注模式`,"dock.emptyPane":`空面板`,"dock.splitPane":`分栏`,"dock.splitPaneDisabled":`已达两格上限`,"dock.splitPaneNarrow":`栏宽不足,拖宽侧边栏后再分栏`,"dock.closeTab":`关闭`,"dock.addTab":`新标签页`,"dock.dockFloat":`收回到侧边栏`,"dock.closeFloat":`关闭`,"dock.drop.center":`移到这里`,"dock.drop.left":`左分栏`,"dock.drop.right":`右分栏`,"dock.drop.top":`上分栏`,"dock.drop.bottom":`下分栏`,"tab.guide.title":`开始`,"tab.unavailable":`这类内容还没有可用的查看方式。`},nw={"command.close":`Close current page or window`,"command.refresh":`Refresh current page`,"command.noRefresh":`This page cannot be refreshed`,"command.toggle":`Toggle right sidebar`,"command.fullscreen":`Toggle panel fullscreen`,"command.noSession":`Select a session first`,"command.noFocus":`Focus a right sidebar pane first`,"command.stale":`The page changed; focus it again`,"command.collapsed":`Expand the right sidebar first`,"command.float":`This action is unavailable in a floating panel`,"command.empty":`Open a page first`,"command.budget":`Two panes is the limit`,"command.width":`Not enough width to split, widen the sidebar`,"chrome.expand":`Open sidebar`,"chrome.expandAria":`Open right sidebar`,"chrome.collapse":`Collapse sidebar`,"chrome.collapseAria":`Collapse right sidebar`,"chrome.toFullscreen":`Fullscreen`,"chrome.exitFullscreen":`Exit fullscreen`,"chrome.exitFocus":`Exit focus mode`,"dock.emptyPane":`Empty pane`,"dock.splitPane":`Split`,"dock.splitPaneDisabled":`Two panes is the limit`,"dock.splitPaneNarrow":`Not enough width to split, widen the sidebar`,"dock.closeTab":`Close`,"dock.addTab":`New tab`,"dock.dockFloat":`Send back to the sidebar`,"dock.closeFloat":`Close`,"dock.drop.center":`Move here`,"dock.drop.left":`Add left split`,"dock.drop.right":`Add right split`,"dock.drop.top":`Add top split`,"dock.drop.bottom":`Add bottom split`,"tab.guide.title":`Start`,"tab.unavailable":`Nothing here can view this kind of content yet.`},rw={button:`_button_1rv3m_2`,md:`_md_1rv3m_23`,sm:`_sm_1rv3m_28`,primary:`_primary_1rv3m_36`,ghost:`_ghost_1rv3m_45`,outline:`_outline_1rv3m_54`,toolbar:`_toolbar_1rv3m_63`,icon:`_icon_1rv3m_71`},iw=(0,B.forwardRef)(function({variant:e=`ghost`,size:t=`md`,icon:n,className:r,children:i,...a},o){return(0,W.jsxs)(`button`,{ref:o,type:`button`,className:F(rw.button,rw[e],rw[t],r),...a,children:[n!=null&&(0,W.jsx)(`span`,{className:rw.icon,children:n}),i]})}),aw={button:`_button_11lrx_2`,icon:`_icon_11lrx_15`};function ow(e){if(typeof e==`string`)return e.length>0;if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.zh==`string`&&t.zh.length>0&&typeof t.en==`string`&&t.en.length>0}function sw(e){if(!e||typeof e!=`object`)return!1;let t=e;if(typeof t.id!=`string`||!t.id||typeof t.title!=`string`||!t.title||typeof t.action!=`string`||!t.action||t.description!==void 0&&typeof t.description!=`string`||t.args!==void 0&&(!Array.isArray(t.args)||t.args.some(e=>typeof e!=`string`)))return!1;if(t.presentation!==void 0){let e=t.presentation;if(!e||!ow(e.label)||e.description!==void 0&&!ow(e.description)||e.icon!==void 0&&typeof e.icon!=`function`||e.section!==void 0&&![`add`,`commands`].includes(e.section))return!1}if(t.input!==void 0){let e=t.input;if(!e||!ow(e.hint)||e.attachments!==void 0&&typeof e.attachments!=`boolean`||e.token!==void 0&&(!ow(e.token)||(typeof e.token==`string`?[e.token]:[e.token.zh,e.token.en]).some(e=>/[\s/]/.test(e))))return!1}return!0}function cw(e){return e}function lw(e,t){if(!e||typeof e!=`object`)throw Error(`Module must default export a plugin definition`);let n=e;if(n.id!==t||n.apiVersion!==1)throw Error(`Plugin id or apiVersion does not match the catalog`);if(typeof n.activate!=`function`)throw Error(`Plugin must declare synchronous activate(context)`);for(let e of[`slots`,`commands`,`menuItems`,`interactions`,`artifactTools`])if(n[e]!==void 0&&!Array.isArray(n[e]))throw Error(`${e} must be an array`);let r=new Set;for(let e of n.slots??[]){if(!e||![`composer.controls`,`turn.tail`,`rightbar.panel`,`rightbar.title`].includes(e.slot)||typeof e.id!=`string`||typeof e.component!=`function`||r.has(e.id))throw Error(`Invalid or duplicate slot`);r.add(e.id)}for(let e of[...n.commands??[],...n.menuItems??[]]){if(!e||typeof e.id!=`string`||typeof e.action!=`string`||r.has(e.id))throw Error(`Invalid or duplicate command/menu contribution`);r.add(e.id)}if((n.commands??[]).some(e=>!sw(e)))throw Error(`Invalid command`);let i=new Set;for(let e of n.interactions??[]){if(!e||typeof e.kind!=`string`||!e.kind||i.has(e.kind)||typeof e.component!=`function`)throw Error(`Invalid or duplicate interaction`);i.add(e.kind)}if(n.composerPlaceholder!==void 0&&typeof n.composerPlaceholder!=`function`)throw Error(`Invalid composer placeholder`);if(n.composerAction!==void 0&&typeof n.composerAction!=`function`)throw Error(`Invalid composer action`);if(n.artifactTools?.some(e=>typeof e!=`string`))throw Error(`Invalid artifact tools`);if(n.workbench){let{entry:e,panels:t,toolViews:r,beforeSend:i}=n.workbench;if(i!==void 0&&typeof i!=`function`)throw Error(`Invalid workbench pre-send hook`);if(r!==void 0&&(!Array.isArray(r)||r.some(e=>!e||!Array.isArray(e.tools)||!e.tools.length||e.tools.some(e=>typeof e!=`string`||!e)||typeof e.component!=`function`)))throw Error(`Invalid workbench tool view`);if(n.workbench.resolvePanel!==void 0&&typeof n.workbench.resolvePanel!=`function`)throw Error(`Invalid workbench artifact resolver`);if(n.workbench.apiVersion!==1||!Array.isArray(t)||t.some(e=>typeof e.kind!=`string`||typeof e.component!=`function`)||new Set(t.map(e=>e.kind)).size!==t.length)throw Error(`Invalid workbench contribution`);if(e!==void 0&&(!e||typeof e.kind!=`string`||!e.kind||!ow(e.label)||!ow(e.description)||e.panelTitle!==void 0&&!ow(e.panelTitle)||typeof e.icon!=`function`||!t.some(t=>t.kind===e.kind)))throw Error(`Invalid workbench entry`)}return n}function uw(e,t,n){return new Promise((r,i)=>{let a,o=()=>s(Error(`Plugin load aborted`)),s=(e,n)=>{clearTimeout(a),t.removeEventListener(`abort`,o),e?i(e):r(n)};t.addEventListener(`abort`,o,{once:!0}),n!==void 0&&(a=setTimeout(()=>s(Error(`Plugin load timed out`)),n)),e.then(e=>s(null,e),e=>s(e)),t.aborted&&o()})}var dw=class{controller=new AbortController;cleanups=[];disposed=!1;report;constructor(e){this.report=e}context(e){return{sessionId:e,signal:this.controller.signal,onDispose:e=>{if(typeof e!=`function`)throw Error(`onDispose expects a cleanup function`);this.disposed?this.clean(e):this.cleanups.push(e)}}}clean(e){try{e()}catch(e){this.report(e)}}dispose(){if(!this.disposed){this.disposed=!0,this.controller.abort();for(let e of this.cleanups.splice(0).reverse())this.clean(e)}}},fw=(e,t=null)=>({sessionId:t,generation:e,plugins:[],errors:[],ready:!1}),pw=class{environment;run=null;snapshot=fw(0);generation=0;listeners=new Set;constructor(e){this.environment=e}getSnapshot=()=>this.snapshot;subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});update(e){this.snapshot=e;for(let e of this.listeners)e()}error(e,t,n,r){let i=`plugin=${t} session=${e.sessionId} generation=${e.generation} stage=${n}: ${r instanceof Error?r.message:String(r)}`;(this.environment.report??console.error)(i),this.run===e&&this.update({...this.snapshot,errors:[...this.snapshot.errors,i]})}async start(e,t){this.dispose();let n={sessionId:e,generation:++this.generation,controller:new AbortController,scopes:[]};this.run=n,this.update(fw(n.generation,e));try{let r=await uw(Promise.resolve().then(t),n.controller.signal);if(this.run!==n)return;for(let e of r.errors)this.error(n,`catalog`,`discover`,e);for(let t of r.plugins){if(this.run!==n)break;let r=new dw(e=>this.error(n,t.id,`dispose`,e));n.scopes.push(r);let i=r.context(e),a=`load`;try{let e=await uw(this.environment.loadModule(t.client),n.controller.signal,this.environment.loadTimeoutMs??1e4);if(this.run!==n)break;a=`validate`;let o=lw(e?.default,t.id);if(t.style&&(a=`style`,await uw(this.environment.loadStyle(t.style,i.signal).then(e=>{i.onDispose(e)}),n.controller.signal,this.environment.loadTimeoutMs??1e4)),this.run!==n)break;a=`activate`;let s=new Set(this.snapshot.plugins.flatMap(e=>e.definition.workbench?.panels.map(e=>e.kind)??[]));if(o.workbench?.panels.some(e=>s.has(e.kind)))throw Error(`Workbench panel kind already registered`);let c=o.activate(i);if(c!==void 0)throw Promise.resolve(c).catch(e=>this.error(n,t.id,`activate`,e)),Error(`activate must be synchronous and return void`);if(this.run!==n){r.dispose();break}this.update({...this.snapshot,plugins:[...this.snapshot.plugins,{id:t.id,definition:o,instanceId:`${n.generation}/${t.id}`}]})}catch(e){this.run===n&&this.error(n,t.id,a,e),r.dispose()}}}catch(e){this.run===n&&this.error(n,`catalog`,`discover`,e)}this.run===n&&this.update({...this.snapshot,ready:!0})}dispose(){let e=this.run;if(e){this.run=null,e.controller.abort();for(let t of e.scopes.reverse())t.dispose();this.update(fw(this.generation))}}},mw={"builtin:@pi-webapp/files":()=>D(()=>import(`./plugin-CZx51rmJ.js`),__vite__mapDeps([7,1,8,2,4,3,9,5])),"builtin:@pi-webapp/terminal":()=>D(()=>import(`./plugin-D1z0mcl1.js`),__vite__mapDeps([10,1,5,2,3,11])),"builtin:@pi-webapp/git":()=>D(()=>import(`./plugin-CvqNiFRV.js`),__vite__mapDeps([12,1,4,2,3,8,9,5,13]))};function hw(e){let t=mw[e];if(!t)throw Error(`Unknown builtin plugin module`);return t()}function gw(e,t){return new Promise((n,r)=>{let i=document.createElement(`link`);i.rel=`stylesheet`,i.href=e;let a=()=>{t.removeEventListener(`abort`,o),i.onload=i.onerror=null,i.remove()},o=()=>{a(),r(Error(`Plugin stylesheet aborted`))};t.addEventListener(`abort`,o,{once:!0}),i.onload=()=>{t.removeEventListener(`abort`,o),i.onload=i.onerror=null,n(a)},i.onerror=()=>{a(),r(Error(`Plugin stylesheet failed to load`))},t.aborted?o():document.head.append(i)})}function _w(e,t,n,r=0){let[i]=(0,B.useState)(()=>new pw({loadModule:e=>e.startsWith(`builtin:`)?hw(e):import(e),loadStyle:gw})),a=(0,B.useSyncExternalStore)(i.subscribe,i.getSnapshot),o=(0,B.useRef)(new Map);a.sessionId&&a.ready&&o.current.set(a.sessionId,a.plugins.filter(e=>e.definition.workbench)),(0,B.useEffect)(()=>{if(e&&t)return globalThis.__PI_WEBAPP_REACT__=B,i.start(t,n),()=>i.dispose()},[i,e,t,r]);let s=e&&a.sessionId===t;return{plugins:s?a.plugins:!e&&t?o.current.get(t)??[]:[],errors:s?a.errors:[]}}var vw=class extends B.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){console.error(`pi-webapp plugin ${this.props.id}:`,e)}render(){return this.state.failed?null:this.props.children}};function yw(e,t){return{...e,invokeAction:(n,r)=>e.invokePluginAction(t,n,r),resolveInteraction:n=>!e.interaction||e.interaction.pluginId!==t?Promise.reject(Error(`No pending interaction`)):e.resolvePluginInteraction(t,e.interaction.requestId,n)}}function bw({plugins:e,props:t}){let n=t.session?.interactions?.find(t=>e.some(e=>e.id===t.pluginId&&e.definition.interactions?.some(e=>e.kind===t.kind))),r=e.find(e=>e.id===n?.pluginId),i=r?.definition.interactions?.find(e=>e.kind===n?.kind)?.component;return!n||!r||!i?null:(0,W.jsx)(vw,{id:r.id,children:(0,W.jsx)(i,{...yw({...t,interaction:n},r.id)})},`${r.instanceId??r.id}/${n.requestId}`)}function xw({plugins:e,props:t,call:n,result:r,running:i}){let a=e.flatMap(e=>(e.definition.workbench?.toolViews??[]).map(t=>({plugin:e,view:t}))).find(({view:e})=>e.tools.includes(n.toolName??``));if(!a)return null;let o=a.view.component;return(0,W.jsx)(vw,{id:a.plugin.id,children:(0,W.jsx)(o,{...yw(t,a.plugin.id),call:n,result:r,running:i})})}function Sw({plugins:e,slot:t,props:n}){let r=e.flatMap(e=>(e.definition.slots??[]).filter(e=>e.slot===t).map(t=>({plugin:e,item:t})));return r.sort((e,t)=>(e.item.order??0)-(t.item.order??0)||e.plugin.id.localeCompare(t.plugin.id)||e.item.id.localeCompare(t.item.id)),(0,W.jsx)(W.Fragment,{children:r.map(({plugin:e,item:t})=>{let r=t.component;return(0,W.jsx)(vw,{id:e.id,children:(0,W.jsx)(r,{...yw(n,e.id)})},`${e.instanceId??e.id}/${t.id}`)})})}function Cw(e,t=[]){let n=(0,B.useRef)(new Map),r=(0,B.useMemo)(()=>{let t=e??``,r=n.current.get(t);if(!r){let e=e=>({id:e,kind:`guide`,contentId:`guide`,title:`开始`});r={controller:new QS({makeInitialTab:e,makePaneTab:e}),resources:new Map,owners:new Map,contexts:new Map,reporters:new Map};let i=r;i.controller.subscribe(()=>{let e=i.controller.getSnapshot().state.tabs;for(let[t,n]of i.resources)e[t]||(n.dispose?.(),i.resources.delete(t));for(let t of i.owners.keys())e[t]||i.owners.delete(t);for(let t of i.reporters.keys())e[t]||(i.reporters.delete(t),i.contexts.delete(t))}),n.current.set(t,r)}return r},[e]),{controller:i,resources:a,owners:o}=r,[s,c]=(0,B.useState)(0),l=(0,B.useCallback)(e=>{let t=r.reporters.get(e);return t||(t=t=>{let n=r.contexts.get(e);(n?.detail!==t?.detail||n?.reference!==t?.reference)&&(t?r.contexts.set(e,t):r.contexts.delete(e),c(e=>e+1))},r.reporters.set(e,t)),t},[r]);(0,B.useEffect)(()=>{for(let[t,r]of n.current)for(let n of r.resources.values())n.activate?.(t===e)},[e]),(0,B.useEffect)(()=>{for(let e of n.current.values())for(let[n,r]of[...e.owners])t.includes(r)&&e.controller.closeTab(n)},[t]),(0,B.useEffect)(()=>()=>{for(let e of n.current.values())for(let t of e.resources.values())t.dispose?.()},[]);let u=(0,B.useSyncExternalStore)(i.subscribe,i.getSnapshot),d=sx(u.state,u.state.activePaneId).activeTabId,f=d?lx(u.state,d):void 0,p=f?.kind===`plugin`?f.contentId:null,m=()=>{Object.keys(i.getSnapshot().state.tabs).length||i.openContent({kind:`guide`,contentId:`guide`,title:`开始`}),i.setExpanded(!0)},h=(0,B.useCallback)((e,t,n,r,a)=>{let s=i.getSnapshot().state,c=r&&sx(s,r).host===`dock`?r:IS(s),l=sx(s,c),u=l.activeTabId&&s.tabs[l.activeTabId]?.kind===`guide`?l.activeTabId:void 0,d=l.tabs.find(n=>s.tabs[n]?.kind===e&&s.tabs[n]?.contentId===t),f=d??i.openContent({kind:e,contentId:t,title:n,paneId:c,revealIfOpened:e!==`files`});return a&&o.set(f,a),d&&i.focusTab(d),u&&i.closeTab(u),i.setExpanded(!0),requestAnimationFrame(()=>document.querySelector(`[data-dockkit-content="${f}"]`)?.focus()),f},[i,o]);return{controller:i,snapshot:u,panelId:p,resources:a,owners:o,contexts:r.contexts,contextVersion:s,reporterFor:l,expand:m,openContent:h,shown:u.state.expanded&&Object.keys(u.state.tabs).length>0}}function ww({panel:e,width:t,narrow:n,focus:r,onExitFocus:i,plugins:a,props:o,cwd:s}){let{controller:c,snapshot:l,openContent:u}=e,{state:d}=l,[f,p]=(0,B.useState)(``);At(`plugin-panel-close`,f);let m=(0,B.useRef)(!1),h=(0,B.useMemo)(()=>new Proxy(c,{get(e,t){if(t===`closeTab`)return t=>{if(m.current)return;m.current=!0;let n=o.session?.sessionId??``;er.flush(n).then(async()=>{let r=document.querySelector(`[data-dockkit-content="${CSS.escape(t)}"]`);r&&await er.retireWithin(n,r),p(``),e.closeTab(t)}).catch(e=>p(e instanceof Error?e.message:String(e))).finally(()=>{m.current=!1})};let n=Reflect.get(e,t,e);return typeof n==`function`?n.bind(e):n}}),[c,o.session?.sessionId]),g=n||d.mode===`fullscreen`,_=o.locale===`zh`?tw:nw,v=e=>_[e]??e,y=e=>typeof e==`string`?e:e[o.locale],b=a.flatMap(e=>(e.definition.workbench?.panels??[]).map(t=>({plugin:e,contribution:t}))),x=()=>{i(),c.setExpanded(!1),requestAnimationFrame(()=>document.querySelector(`[data-sidebar-right-expand]`)?.focus())},S=n?`100vw`:t;return(0,W.jsx)(`div`,{className:XC.panel,style:{width:S,"--dsh-sidebar-width":typeof S==`number`?`${S}px`:S},"data-sidebar-right-session":o.session?.sessionId,"data-sidebar-right-panel":g?`fullscreen`:r?`focus`:`push`,"data-sidebar-right-open":e.shown||void 0,"aria-hidden":!e.shown||void 0,children:(0,W.jsx)(`div`,{className:XC.panelBody,children:(0,W.jsx)(YC,{state:d,canSplit:l.canSplit&&hx(d).length<2,dropZones:`horizontal`,minPaneFraction:.2,intents:h,labels:ew(v),active:!0,keepMounted:()=>!0,renderTab:t=>{let n=mx(d,t.id).id,r=d.expanded&&sx(d,n).activeTabId===t.id;if(t.kind===`guide`)return(0,W.jsx)(`div`,{className:z.guide,children:(0,W.jsxs)(`div`,{className:z.guideGrid,role:`group`,"aria-label":U(`工作区工具`,`Workspace tools`),children:[a.map(e=>{let t=e.definition.workbench?.entry;if(!t)return null;let r=t.icon;return(0,W.jsxs)(`button`,{type:`button`,className:z.guideEntry,disabled:!o.session||!s,"aria-label":y(t.label),onClick:()=>u(t.kind,t.multiple?ee():`workspace`,y(t.panelTitle??t.label),n,e.id),children:[(0,W.jsx)(`span`,{className:z.guideIcon,"aria-hidden":`true`,children:(0,W.jsx)(r,{size:24})}),(0,W.jsxs)(`span`,{className:z.guideCopy,children:[(0,W.jsx)(`span`,{className:z.guideLabel,children:y(t.label)}),(0,W.jsx)(`span`,{className:z.guideDescription,children:y(t.description)})]})]},e.id)}),!a.some(e=>e.definition.workbench?.entry)&&(0,W.jsx)(`p`,{className:z.state,children:U(`没有已启用的工作区插件,可在设置中启用。`,`No workspace plugins enabled. Enable one in Settings.`)})]})});let i=b.find(e=>e.contribution.kind===t.kind);if(i&&o.session){let{plugin:a,contribution:s}=i;e.owners.set(t.id,a.id);let c=s.component;return(0,W.jsx)(vw,{id:a.id,children:(0,W.jsx)(c,{sendMessage:o.sendMessage,session:o.session,locale:o.locale,visible:r,contentId:t.contentId,title:t.title,renderMarkdown:o.renderMarkdown,resource:(n,r,i)=>{let a=e.resources.get(t.id);if(!a){let o=n();a={value:o,dispose:()=>r?.(o),activate:e=>i?.(o,e)},e.resources.set(t.id,a)}return a.value},reportContext:e.reporterFor(t.id),open:(e,t,r)=>u(e,t,r,n,a.id)})})}return(0,W.jsx)(Sw,{plugins:a,slot:`rightbar.panel`,props:{...o,panelId:t.contentId}})},renderTabTitle:e=>{if(e.kind===`guide`)return v(`tab.guide.title`);let t=b.find(t=>t.contribution.kind===e.kind);return t?(0,W.jsx)(`span`,{className:z.title,children:t.contribution.title?.(e.contentId,e.title)??e.title}):(0,W.jsx)(Sw,{plugins:a,slot:`rightbar.title`,props:{...o,panelId:e.contentId}})},chrome:(0,W.jsx)($C,{sessionId:o.session?.sessionId??``,fullscreen:g||r,focus:r,shortcuts:[],t:v,actions:{toggleExpanded:x},toggleFullscreen:()=>r?i():n?x():c.setMode(g?`push`:`fullscreen`)})})})})}function Tw({panel:e,locale:t}){if(e.shown)return null;let n=t===`zh`?tw:nw;return(0,W.jsx)(Pv,{label:n[`chrome.expand`],side:`bottom`,delayMs:500,children:(0,W.jsx)(iw,{size:`sm`,className:aw.button,"aria-label":n[`chrome.expandAria`],"data-sidebar-right-expand":!0,onClick:e.expand,children:(0,W.jsx)(h,{className:aw.icon})})})}function Ew(e,t){let n=e.filter(e=>e.enabled&&e.generation!==void 0&&e.contribution&&e.documentUrl&&e.controllerUrl).map(e=>{let n=t.find(t=>t.pluginId===e.pluginId);return n&&n.generation===e.generation&&n.name===e.name&&n.icon===e.icon&&n.documentUrl===e.documentUrl&&n.controllerUrl===e.controllerUrl&&JSON.stringify(n.contribution)===JSON.stringify(e.contribution)?n:e});return n.length===t.length&&n.every((e,n)=>e===t[n])?t:n}var Dw=`pi:hosted:unconfirmed-views:v1`,Ow=`pi:hosted:unconfirmed-view:v1:`,kw=`pi:hosted:retired-view:v1:`,Aw=``,jw=()=>{Aw=`View recovery journal could not be read. Its original data has been retained.`},Mw=()=>{Aw=`View recovery journal could not be stored. Keep this page open and download local drafts.`};function Nw(e){if(!e||typeof e!=`object`)return!1;let t=e;return[`controller`,`workspace`,`editor`,`tool`].includes(String(t.kind))&&[`sessionId`,`pluginId`,`mountId`,`viewToken`].every(e=>typeof t[e]==`string`&&t[e].length>0&&t[e].length<=214)&&Number.isSafeInteger(t.generation)&&Number(t.generation)>=1&&(t.contentId===void 0||typeof t.contentId==`string`)&&(t.createdAt===void 0||Number.isSafeInteger(t.createdAt))&&(t.orphanedAt===void 0||Number.isSafeInteger(t.orphanedAt))&&[`retained`,`frameStarted`].every(e=>t[e]===void 0||typeof t[e]==`boolean`)&&(t.backups===void 0||Array.isArray(t.backups)&&t.backups.every(e=>e&&typeof e.key==`string`&&typeof e.name==`string`))}function Pw(){try{if(typeof sessionStorage>`u`)return[];let e=sessionStorage.getItem(Dw);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t)||!t.every(Nw))throw Error(`Invalid view recovery journal`);return t}catch{return jw(),[]}}function Fw(e){if(typeof localStorage>`u`)return null;let t=localStorage.getItem(kw+e);if(t!==null){if(JSON.parse(t)!==!0)throw Error(`Invalid view retirement receipt`);return`retired`}let n=localStorage.getItem(Ow+e);if(!n)return null;let r=JSON.parse(n);if(!Nw(r)||r.viewToken!==e)throw Error(`Invalid durable view recovery record`);return r}function Iw(e,t){return e.sessionId===t.sessionId&&e.pluginId===t.pluginId&&e.generation===t.generation&&e.mountId===t.mountId}var Lw=Pw(),Rw=new Set(Lw.map(e=>e.viewToken));function zw(){let e=new Map(Lw.map(e=>[e.viewToken,e]));try{if(typeof localStorage<`u`)for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t),r=n?.startsWith(Ow)?Ow:n?.startsWith(kw)?kw:void 0;if(!r)continue;let i=n.slice(r.length);try{let t=Fw(i);if(t===`retired`)e.delete(i);else if(t){let n=e.get(i);if(n&&!Iw(n,t))throw Error(`Conflicting view recovery identity`);e.set(i,{...t,discovered:!Rw.has(i)})}}catch{jw()}}}catch{jw()}return[...e.values()]}var Bw=zw(),Vw=[...Bw];function Hw(){return Vw=Vw.filter(e=>{try{return Fw(e.viewToken)!==`retired`}catch{return jw(),!0}}),Vw.filter(e=>Bw.some(t=>t.viewToken===e.viewToken))}var Uw=new Map,Ww=`pi:hosted:recovery-draft:v1:`,Gw=()=>Aw;function Kw(){if(Aw)return!1;try{return typeof sessionStorage<`u`&&sessionStorage.setItem(Dw,JSON.stringify(Vw.filter(e=>Rw.has(e.viewToken)))),!0}catch{return Mw(),!1}}function qw(e){if(Aw)return!1;try{if(typeof localStorage>`u`)return!0;let t=Fw(e.viewToken);if(t===`retired`)return!1;if(t&&!Iw(t,e))throw Error(`Conflicting view recovery identity`);let{discovered:n,...r}={...e,...t?.frameStarted?{frameStarted:!0}:{},...t?.retained?{retained:!0}:{},...t?.orphanedAt===void 0?{}:{orphanedAt:t.orphanedAt},backups:[...new Map([...t?.backups??[],...e.backups??[]].map(e=>[e.key,e])).values()]};return localStorage.setItem(Ow+e.viewToken,JSON.stringify(r)),!0}catch{return Mw(),!1}}function Jw(e,t,n){Rw.add(t),Vw=Vw.filter(e=>e.viewToken!==t);let r={...e,viewToken:t,kind:n.kind,contentId:n.contentId,frameStarted:!1,createdAt:Date.now()};Vw.push(r),qw(r),Kw()}function Yw(e){let t=Vw.find(t=>t.viewToken===e);if(!t||t.retained)return!1;let n={...t,frameStarted:!0};return qw(n)?(Vw=Vw.map(t=>t.viewToken===e?n:t),Kw()):!1}function Xw(e){Vw=Vw.filter(t=>t.viewToken!==e),Rw.delete(e);try{if(Fw(e),typeof localStorage<`u`){localStorage.setItem(kw+e,JSON.stringify(!0));let t=`${Ww}${e}:`,n=[];for(let e=0;e<localStorage.length;e++){let r=localStorage.key(e);r?.startsWith(t)&&n.push(r)}for(let e of n)localStorage.removeItem(e),Uw.delete(e)}}catch{jw()}Kw()}async function Zw(e){if(e.discovered&&(e.kind===`controller`||e.frameStarted!==!0))return;let t=(await xb.view({...e,operation:`reconcile`})).recovery;return t?.state===`unconfirmed`&&e.frameStarted===!1&&Rw.has(e.viewToken)&&(await xb.view({...e,operation:`cancel-initialization`}),Xw(e.viewToken),t={...t,state:`retired`}),(t?.state===`retired`||t?.state===`absent`&&e.kind===`controller`)&&Xw(e.viewToken),t}var Qw=3e5,$w=6048e5,eT=(e,t)=>e.frameStarted===!0||e.createdAt===void 0||t-e.createdAt>Qw;function tT(e,t,n=Date.now()){return t?.state===`retained`||t?.state===`absent`&&eT(e,n)}function nT(e,t){let n=Vw.find(t=>t.viewToken===e.viewToken),r=n?.orphanedAt??e.orphanedAt;if(r!==void 0&&t-r>6048e5)return Xw(e.viewToken),{state:`retired`};if(r===void 0&&n){let r={...n,orphanedAt:t};qw(r)&&(Vw=Vw.map(t=>t.viewToken===e.viewToken?r:t),Kw())}e.orphanedAt=r??t}var rT=new Set([`invalid_scope`,`unknown_plugin`]),iT=`@chengzhiyi/pi-excalidraw`;function aT(e){if(!Array.isArray(e))return;let t=e.filter(e=>e&&typeof e==`object`&&!e.isDeleted).map(e=>[String(e.id),e.version,e.versionNonce]);return JSON.stringify(t.sort((e,t)=>e[0]<t[0]?-1:+(e[0]>t[0])))}async function oT(e,t){if(e.kind===`controller`)return!0;let n=dT(e);if(!n.length)return!0;if(e.pluginId!==iT||t===void 0)return!1;for(let r of n){let n=/^recovery-(.+)\.excalidraw$/.exec(r.name)?.[1];if(!n)return!1;try{let i=await xb.action({sessionId:e.sessionId,pluginId:e.pluginId,generation:t,action:`get`,input:{id:n}}),a=aT(JSON.parse(r.json).elements);if(!a||a!==aT(i?.scene?.elements))return!1}catch{return!1}}return!0}async function sT(e,t,n=Date.now()){let r=await cT(e,t,n);return tT(e,r,n)?nT(e,n)??r:r}async function cT(e,t,n){let r=eT(e,n),i=async()=>await oT(e,t)?(Xw(e.viewToken),!0):!1;if(e.retained)return await i()?{state:`retired`}:{state:`retained`};let a;try{a=(await xb.view({...e,operation:`status`})).recovery}catch(t){let n=t?.code;if(r&&typeof n==`string`&&rT.has(n))return await i()?{state:`retired`}:{state:`absent`};if(t instanceof Error&&t.message===`Unknown view operation`)return Zw(e);throw t}if(a?.state===`retired`)return Xw(e.viewToken),a;if(a?.state===`absent`)return r&&await i()?{state:`retired`}:r||e.discovered?a:Zw(e);if(a?.state===`unconfirmed`&&a.stale){if(e.kind===`controller`)return Zw({...e,discovered:!1});if(!a.dirty&&!a.busy&&await oT(e,t))try{return await xb.view({...e,operation:`close`}),Xw(e.viewToken),{state:`retired`}}catch{return a}return a}return a?.state===`unconfirmed`&&!e.discovered?Zw(e):a}async function lT(e){let t=await xb.view({...e,operation:`recover`,confirmation:`retain-unconfirmed-edits`});if(t.recovery?.state===`retired`){Xw(e.viewToken);return}if(!t.recovery||![`retained`,`absent`].includes(t.recovery.state))throw Error(`This view still has an active operation. Its recovery state was preserved.`);Vw=Vw.map(t=>t.viewToken===e.viewToken?{...t,retained:!0}:t);let n=Vw.find(t=>t.viewToken===e.viewToken);n&&qw(n),Kw()}async function uT(e){(await xb.view({...e,operation:`reconcile`})).recovery?.state!==`absent`&&await xb.view({...e,operation:`discard`,confirmation:`discard-unconfirmed-edits`}),Xw(e.viewToken)}function dT(e){if(e.pluginId!==`@chengzhiyi/pi-excalidraw`)return[];let t=`pi-diagram:${e.sessionId}:`,n=[];try{if(typeof localStorage>`u`)return[];for(let t of e.backups??[]){if(!t.key.startsWith(`${Ww}${e.viewToken}:`))continue;let r=Uw.get(t.key)??localStorage.getItem(t.key);r&&n.push({name:t.name,json:r})}if(n.length)return n;for(let r=0;r<localStorage.length;r++){let i=localStorage.key(r);if(!i?.startsWith(t)||e.contentId&&i!==t+e.contentId)continue;let a=localStorage.getItem(i);if(!(!a||a.length>16777216))try{let e=JSON.parse(a);if(!e||!Array.isArray(e.elements))continue;let r=i.slice(t.length).replace(/[^\w.-]/g,`_`).slice(0,100);n.push({name:`recovery-${r}.excalidraw`,json:a})}catch{}}}catch{}return n}for(let e of Bw){if(e.kind===`controller`)continue;let t=dT(e);t.length&&(e.backups=t.map(t=>{let n=`${Ww}${e.viewToken}:${t.name}`;Uw.set(n,t.json);try{localStorage.getItem(n)||localStorage.setItem(n,t.json)}catch{Aw=`Recovery copy could not be stored. Keep this page open and download local drafts before reloading.`}return{key:n,name:t.name}}))}for(let e of Vw)qw(e);Kw();function fT(e){let t=e;if(!t||!(t.blob instanceof Blob)||!t.blob.size||t.blob.size>16777216||typeof t.name!=`string`||t.name.length>200||/[/\\\x00-\x1f\x7f]/.test(t.name))throw Error(`Invalid drawing download`);let n={png:`image/png`,jpg:`image/jpeg`,webp:`image/webp`,svg:`image/svg+xml`,excalidraw:`application/json`,json:`application/json`}[t.name.split(`.`).pop()?.toLowerCase()??``];if(!n||t.blob.type!==n)throw Error(`Unsupported drawing download`);return{blob:t.blob,name:t.name}}function pT(e){let{blob:t,name:n}=fT(e),r=URL.createObjectURL(t),i=document.createElement(`a`);i.href=r,i.download=n,i.hidden=!0,document.body.append(i);try{i.click()}finally{i.remove(),setTimeout(()=>URL.revokeObjectURL(r),3e4)}}var mT={entry:`_entry_d5j2n_1`,quiet:`_quiet_d5j2n_4`,link:`_link_d5j2n_5`,trigger:`_trigger_d5j2n_8`,dialog:`_dialog_d5j2n_10`,content:`_content_d5j2n_13`,list:`_list_d5j2n_15`,item:`_item_d5j2n_16`,error:`_error_d5j2n_19`,history:`_history_d5j2n_25`,actions:`_actions_d5j2n_29`};function hT({sessionId:e,locale:t,openRecovered:n}){let[r,i]=(0,B.useState)(Hw),[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(null),[l,u]=(0,B.useState)(``),[d,f]=(0,B.useState)(!1),[p,m]=(0,B.useState)(0),h=(e,n)=>t===`zh`?e:n,[g,_]=(0,B.useState)(new Set),[v,y]=(0,B.useState)(new Set),[b,x]=(0,B.useState)(new Set),S=r.filter(e=>v.has(e.viewToken)&&!g.has(e.viewToken)),C=Gw(),w=S.filter(e=>!b.has(e.viewToken)),T=e=>{Xw(e),i(t=>t.filter(t=>t.viewToken!==e))};if((0,B.useEffect)(()=>{o(!1),c(null),u(``)},[e]),(0,B.useEffect)(()=>{let e=!0;return(async()=>{let t=new Map;try{t=new Map((await xb.catalog()).plugins.flatMap(e=>e.generation===void 0?[]:[[e.pluginId,e.generation]]))}catch{}let n=e=>y(t=>new Set(t).add(e)),a=(e,t)=>x(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r});for(let o of r){if(!e)return;try{let r=await sT(o,t.get(o.pluginId));if(!e)return;r?.state===`retired`||r?.state===`absent`&&o.kind===`controller`?T(o.viewToken):r?.state===`retained`&&i(e=>e.map(e=>e.viewToken===o.viewToken?{...e,retained:!0}:e)),_(e=>{let t=new Set(e);return o.discovered&&r?.state===`unconfirmed`&&r.stale===!1?t.add(o.viewToken):t.delete(o.viewToken),t}),a(o.viewToken,tT(o,r)),n(o.viewToken)}catch(t){if(!e)return;if(t instanceof Error&&t.message===`Unknown view operation`){y(new Set(r.map(e=>e.viewToken)));return}a(o.viewToken,!1),n(o.viewToken),u(String(t))}}})(),()=>{e=!1}},[e,p]),!S.length&&!C)return null;let E=e=>({controller:h(`后台控制器`,`Controller`),workspace:h(`工作区`,`Workspace`),editor:h(`编辑器`,`Editor`),tool:h(`工具预览`,`Tool preview`)})[e]??h(`插件视图`,`Plugin view`),D=s?.operation===`retain`,O=(s?.items.length??0)>1,k=e=>Math.max(1,Math.ceil(((e.orphanedAt??Date.now())+$w-Date.now())/864e5)),A=(0,W.jsxs)(`button`,{type:`button`,className:mT.trigger,"aria-haspopup":`dialog`,onClick:()=>o(!0),children:[h(`插件视图恢复`,`Plugin view recovery`),` · `,S.length]});return(0,W.jsxs)(W.Fragment,{children:[w.length||C?(0,W.jsxs)(`div`,{className:mT.entry,"data-hosted-recovery":!0,children:[(0,W.jsx)(`p`,{children:h(`刷新或关闭窗口后,部分插件视图尚未确认保存,插件更新、卸载等操作会因此被阻塞。请先核对原窗口及备份,再保留或丢弃这些记录。`,`Some plugin views were not confirmed as saved before a window reloaded or closed, which blocks plugin updates, uninstalls and similar operations. Check original windows and backups, then retain or discard these records.`)}),A]}):(0,W.jsxs)(`div`,{className:mT.quiet,"data-hosted-recovery":!0,children:[(0,W.jsx)(`span`,{children:h(`已关闭的插件视图在此浏览器里留下 ${S.length} 份未保存的草稿,不影响任何操作,最迟 7 天后自动清除。`,`Closed plugin views left ${S.length} unsaved ${S.length===1?`draft`:`drafts`} in this browser. They block nothing and clear themselves within 7 days.`)}),(0,W.jsx)(`button`,{type:`button`,className:mT.link,"aria-haspopup":`dialog`,onClick:()=>o(!0),children:h(`查看草稿`,`Review drafts`)})]}),(0,W.jsx)(Qv,{open:a,onClose:()=>o(!1),title:h(`检查之前的插件视图`,`Review previous plugin views`),closeLabel:h(`关闭`,`Close`),className:mT.dialog,footer:(0,W.jsxs)(W.Fragment,{children:[S.length>1&&(0,W.jsxs)(Xv,{variant:`outline`,disabled:d,onClick:()=>c({items:S,operation:`discard`}),children:[h(`全部丢弃`,`Discard all`),` · `,S.length]}),(0,W.jsx)(Xv,{variant:`outline`,disabled:d,onClick:()=>{u(``),m(e=>e+1)},children:h(`重新检查`,`Check again`)})]}),children:(0,W.jsxs)(`div`,{className:mT.content,children:[(0,W.jsx)(`p`,{children:h(`以下列出所有会话中待确认的旧插件视图。请先检查原窗口、编辑器和本地备份,只处理已失联的视图;仍打开的窗口请先正常保存并关闭。`,`These are previous plugin views awaiting confirmation across all sessions. Check original windows, editors and local backups. Only recover disconnected views; save and close windows that remain open first.`)}),(0,W.jsx)(`p`,{children:h(`保留恢复记录会停止旧视图继续写入,不会覆盖当前图稿。丢弃未确认的记录不会保存或恢复图稿,无法找回的最新修改可能永久丢失。`,`Retaining recovery records stops old views writing without overwriting the current drawing. Discarding unconfirmed records does not save or restore a drawing; unrecoverable recent edits may be permanently lost.`)}),(0,W.jsx)(`div`,{className:mT.list,children:S.map((t,r)=>(0,W.jsxs)(`section`,{className:mT.item,"data-unconfirmed-view":t.mountId,children:[(0,W.jsxs)(`h3`,{children:[E(t.kind),` `,r+1]}),t.retained?(0,W.jsx)(`p`,{children:h(`失联视图的恢复记录已保留。插件可继续操作;旧稿是否完整仍需核对。约 ${k(t)} 天后自动清除。`,`Disconnected view recovery record retained. Plugin operations may continue; the old draft still needs verification. It clears itself in about ${k(t)} day(s).`)}):b.has(t.viewToken)&&(0,W.jsx)(`p`,{children:h(`此视图已不阻塞任何操作,仅保留与已保存图稿不同的本地副本,约 ${k(t)} 天后自动清除。`,`This view no longer blocks anything. It only keeps a local copy that differs from the saved drawing, and clears itself in about ${k(t)} day(s).`)}),(0,W.jsxs)(`details`,{children:[(0,W.jsx)(`summary`,{children:h(`视图信息`,`View details`)}),(0,W.jsxs)(`dl`,{children:[(0,W.jsx)(`dt`,{children:h(`会话`,`Session`)}),(0,W.jsx)(`dd`,{children:t.sessionId}),(0,W.jsx)(`dt`,{children:h(`插件`,`Plugin`)}),(0,W.jsx)(`dd`,{children:t.pluginId}),(0,W.jsx)(`dt`,{children:h(`版本代次`,`Generation`)}),(0,W.jsx)(`dd`,{children:t.generation}),(0,W.jsx)(`dt`,{children:h(`视图标识`,`View ID`)}),(0,W.jsx)(`dd`,{children:t.mountId}),t.contentId&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`dt`,{children:h(`内容标识`,`Content ID`)}),(0,W.jsx)(`dd`,{children:t.contentId})]})]})]}),(0,W.jsxs)(`div`,{className:mT.actions,children:[dT(t).map(e=>(0,W.jsxs)(Xv,{variant:`outline`,disabled:d,onClick:()=>pT({blob:new Blob([e.json],{type:`application/json`}),name:e.name}),children:[h(`下载本地恢复副本`,`Download local recovery copy`),` · `,e.name]},e.name)),t.contentId&&t.sessionId===e&&n&&(0,W.jsx)(Xv,{variant:`outline`,disabled:d,onClick:()=>{o(!1),n(t.contentId)},children:h(`打开图稿并核对备份`,`Open drawing and compare backup`)}),!t.retained&&!b.has(t.viewToken)&&(0,W.jsx)(Xv,{variant:`outline`,disabled:d,onClick:()=>c({items:[t],operation:`retain`}),children:h(`保留恢复记录并解除阻塞`,`Retain recovery record and unblock`)}),(0,W.jsx)(Xv,{variant:`outline`,disabled:d,onClick:()=>c({items:[t],operation:`discard`}),children:h(`丢弃此视图的未确认修改`,`Discard this view's unconfirmed edits`)})]})]},t.viewToken))}),(l||C)&&(0,W.jsxs)(`div`,{role:`alert`,className:mT.error,children:[h(`未能确认部分视图,请保留恢复记录并重试。`,`Some views could not be verified. Keep their recovery records and retry.`),(0,W.jsxs)(`details`,{children:[(0,W.jsx)(`summary`,{children:h(`诊断信息`,`Diagnostics`)}),l||C]})]})]})}),(0,W.jsx)(Qv,{open:!!s&&a,onClose:()=>c(null),title:D?h(`保留此视图用于恢复?`,`Retain this view for recovery?`):O?h(`丢弃全部 ${s.items.length} 个视图的未确认修改?`,`Discard unconfirmed edits from all ${s.items.length} views?`):h(`丢弃此视图的未确认修改?`,`Discard this view's unconfirmed edits?`),closeLabel:h(`关闭`,`Close`),description:D?h(`请先确认旧视图已失联并核对备份。此操作保留恢复记录和本地副本,停止旧视图继续写入,不会保存、覆盖或丢弃图稿。`,`First confirm the old view is disconnected and review backups. This preserves recovery records and local copies and stops the old view writing, without saving, overwriting or discarding a drawing.`):O?h(`请先确认原标签页都已关闭,并下载需要保留的草稿。此操作会清除全部记录及其本地副本,不会保存或恢复内容;无法找回的修改可能永久丢失。`,`First confirm the original tabs are closed and download any drafts you want to keep. This clears every record and its local copies without saving or restoring content; unrecovered edits may be permanently lost.`):h(`请先确认原标签页已关闭,并下载可恢复的草稿。此操作不会保存或恢复内容;无法找回的修改可能永久丢失。`,`First confirm the original tab is closed and download any recoverable draft. This does not save or restore content; unrecovered edits may be permanently lost.`),footer:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Xv,{variant:`outline`,disabled:d,onClick:()=>c(null),children:h(`取消`,`Cancel`)}),(0,W.jsx)(Xv,{variant:`primary`,disabled:d,onClick:()=>{if(!s||d)return;let{items:e,operation:t}=s;f(!0),u(``),(async()=>{for(let n of e)t===`retain`?(await lT(n),i(Hw()),x(e=>new Set(e).add(n.viewToken))):(await uT(n),T(n.viewToken))})().then(()=>c(null)).catch(e=>{u(String(e)),c(null)}).finally(()=>f(!1))},children:D?h(`保留恢复记录`,`Retain record`):O?h(`全部丢弃`,`Discard all`):h(`确认丢弃`,`Discard edits`)})]})})]})}var gT=new class{entries=new Set;releaseLock;timer;running=!1;interval;request;constructor(e=250,t=async e=>{let t=new AbortController,n=setTimeout(()=>t.abort(),5e3);try{return await bb(`/views`,{operation:`pollMany`,views:e},t.signal)}finally{clearTimeout(n)}}){this.interval=e,this.request=t}add(e){return this.entries.add(e),this.holdLock(),this.schedule(0),()=>{this.entries.delete(e),this.entries.size||(this.timer&&=(clearTimeout(this.timer),void 0),this.releaseLock?.())}}holdLock(){if(this.releaseLock||typeof navigator>`u`||!navigator.locks)return;let e,t=new Promise(t=>{e=t});this.releaseLock=()=>{this.releaseLock=void 0,e()},navigator.locks.request(`pi:hosted:view-poller:${crypto.randomUUID()}`,()=>t).catch(()=>{this.releaseLock=void 0})}wake(){!this.running&&this.entries.size&&(this.timer&&=(clearTimeout(this.timer),void 0),this.schedule(0))}schedule(e){this.running||this.timer||!this.entries.size||(this.timer=setTimeout(()=>{this.timer=void 0,this.tick()},e))}async tick(){this.running=!0;let e=[...this.entries];try{for(let t=0;t<e.length;t+=64){let n=e.slice(t,t+64).filter(e=>this.entries.has(e));if(!n.length)continue;let{replies:r}=await this.request(n.map(e=>e.input()));if(!Array.isArray(r)||r.length!==n.length)throw Error(`Invalid aggregate view reply`);await Promise.all(n.map(async(e,t)=>{if(this.entries.has(e))try{let n=r[t];if(n.failure)throw Object.assign(Error(n.failure.body.error),{status:n.failure.status});if(!n.reply||n.reply.viewToken!==e.input().viewToken)throw Error(`Mismatched view reply`);await e.accept(n.reply)}catch(t){this.entries.delete(e),e.fail(t)}}))}}catch(t){for(let n of e)this.entries.delete(n)&&n.fail(t)}finally{this.running=!1,this.schedule(this.interval)}}};typeof document<`u`&&document.addEventListener(`visibilitychange`,()=>{document.hidden||gT.wake()});var _T=class{token=``;get capability(){return{viewToken:this.token,mountId:this.identity.mountId}}stopped=!1;closed=!1;closing;abort=new AbortController;unlisten;after=0;snapshot;frozen=!1;localCloseCheckpoint=!1;frameStarted=!1;connecting(){if(!Yw(this.token)&&this.mount.kind!==`controller`)throw Error(`Cannot protect the editor recovery journal; download local drafts before opening another editor`);this.frameStarted=!0}async flushed(){await this.changed({dirty:!1,busy:!1})}identity;adapter;mount;reconnect;failed;poller;constructor(e,t,n,r,i,a=gT){this.poller=a,this.identity=e,this.adapter=t,this.mount=n,this.reconnect=r,this.failed=i}async start(){this.token=crypto.randomUUID(),Jw(this.identity,this.token,this.mount);let e=await xb.view({...this.identity,operation:`register`,kind:this.mount.kind,viewToken:this.token});e.viewToken!==this.token&&(Xw(this.token),this.token=e.viewToken,Jw(this.identity,this.token,this.mount))}listen(){this.stopped||this.unlisten||(this.unlisten=this.poller.add({input:()=>({...this.identity,viewToken:this.token,operation:`poll`,after:this.after}),accept:e=>this.receive(e),fail:e=>{this.stopped||this.failed(e)}}))}retry(){if(this.closed)throw Error(`Closed view cannot reconnect`);this.unlisten?.(),this.unlisten=void 0,this.stopped=!1,this.abort=new AbortController,this.localCloseCheckpoint?this.adapter.call(`restore`,this.snapshot).then(()=>{this.frozen=!1,this.localCloseCheckpoint=!1,this.listen()}).catch(this.failed):this.listen()}request(e){return xb.view({...this.identity,viewToken:this.token,...e},this.abort.signal)}async changed(e){let t=e;if(typeof t?.dirty!=`boolean`||typeof t.busy!=`boolean`)throw Error(`Invalid frame status`);await this.request({operation:`change`,dirty:t.dirty,busy:t.busy})}async receive(e){for(let t of e.commands){if(this.stopped)return;let e;try{if(t.type===`freeze`&&!this.frozen&&(this.snapshot=await this.adapter.call(`freeze`),this.frozen=!0),t.type===`resume`&&this.frozen&&(await this.adapter.call(`restore`,this.snapshot),this.frozen=!1),t.type===`committed`){await this.request({operation:`ack`,commandId:t.id,ok:!0}),await this.close(),this.reconnect();return}}catch(t){e=t}await this.request({operation:`ack`,commandId:t.id,ok:!e,...e?{error:e instanceof Error?e.message:String(e)}:{}}),this.after=t.id,e&&this.failed(e)}}close(){return this.closed?Promise.resolve():(this.closing||=(this.stopped=!0,this.unlisten?.(),this.abort.abort(),(async()=>{this.token&&(this.mount.kind!==`controller`&&!this.frameStarted?await xb.view({...this.identity,viewToken:this.token,operation:`cancel-initialization`}):(this.mount.kind!==`controller`&&!this.frozen&&(this.snapshot=await this.adapter.call(`freeze`),this.frozen=!0,this.localCloseCheckpoint=!0),this.localCloseCheckpoint&&await xb.view({...this.identity,viewToken:this.token,operation:`change`,dirty:!1,busy:!1}),await xb.view({...this.identity,viewToken:this.token,operation:`close`})),this.closed=!0,Xw(this.token))})().catch(e=>{throw this.closing=void 0,e})),this.closing)}},vT={card:`_card_1g0je_1`,header:`_header_1g0je_2`,toggle:`_toggle_1g0je_6`,title:`_title_1g0je_7`,status:`_status_1g0je_8`,chevron:`_chevron_1g0je_9`,parameters:`_parameters_1g0je_12`,preview:`_preview_1g0je_13`,dialog:`_dialog_1g0je_15`,details:`_details_1g0je_18`};function yT({title:e,tool:t,locale:n,children:r}){let[i,a]=(0,B.useState)(!1),[o,s]=(0,B.useState)(!1),c=(0,B.useId)(),l=(e,t)=>n===`zh`?e:t,u=t.result?.blocks.filter(e=>e.kind===`text`).map(e=>e.text??``).join(`
47
- `);return(0,W.jsxs)(`article`,{className:e?vT.card:void 0,"data-hosted-tool-card":e?``:void 0,children:[e&&(0,W.jsxs)(`header`,{className:vT.header,children:[(0,W.jsxs)(`button`,{type:`button`,className:vT.toggle,"aria-label":l(`展开或收起预览`,`Toggle preview`),"aria-expanded":!i,"aria-controls":c,onClick:()=>a(e=>!e),children:[(0,W.jsx)(`span`,{className:vT.title,children:e}),(0,W.jsx)(`span`,{className:vT.status,children:t.result?.isError?l(`失败`,`Failed`):t.result?l(`已完成`,`Completed`):t.running?l(`运行中`,`Running`):l(`未完成`,`Incomplete`)}),(0,W.jsx)(`span`,{className:vT.chevron,"data-collapsed":i,"aria-hidden":`true`,children:(0,W.jsx)(Ye,{size:16})})]}),(0,W.jsx)(`button`,{type:`button`,className:vT.parameters,"aria-haspopup":`dialog`,onClick:()=>s(!0),children:l(`查看参数`,`View parameters`)})]}),(0,W.jsx)(`div`,{id:c,hidden:!!e&&i,className:vT.preview,children:r}),(0,W.jsx)(Qv,{open:o&&!!e,onClose:()=>s(!1),title:l(`工具参数`,`Tool parameters`),closeLabel:l(`关闭`,`Close`),className:vT.dialog,children:(0,W.jsxs)(`div`,{className:vT.details,"data-tool-parameters":!0,children:[(0,W.jsx)(`h3`,{children:l(`输入参数`,`Input`)}),(0,W.jsx)(`pre`,{tabIndex:0,children:t.call.text}),u!==void 0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h3`,{children:l(`工具结果`,`Result`)}),(0,W.jsx)(`pre`,{tabIndex:0,children:u})]})]})})]})}function bT(e){let t=e;if(typeof t?.title!=`string`||!t.title.trim()||t.title.length>160)throw Error(`Invalid tool presentation`);return{title:t.title}}function xT(e){let t=e?.height;if(typeof t!=`number`||!Number.isFinite(t)||t<0||t>4096)throw Error(`Invalid tool height`);return Math.max(1,Math.ceil(t))}function ST(e){let t=e;if(typeof t?.message!=`string`||t.message.length>4e3||t.level!==`info`&&t.level!==`error`)throw Error(`Invalid notification`);return{message:t.message,level:t.level}}var CT=new Map;function wT(e,t,n,r,i){let a=CT.get(e.pluginId)??new Map;CT.set(e.pluginId,a),a.set(t,i);let o=n===`zh`;Et({key:`hosted-view:${e.pluginId}`,message:o?`${e.name} 连接中断`:`${e.name} lost its connection`,detail:r instanceof Error?r.message:String(r),detailLabel:o?`诊断信息`:`Diagnostics`,action:{label:o?`重新连接`:`Reconnect`,onClick:()=>{let e=[...a.values()];a.clear();for(let t of e)t()}}})}function TT(e,t){let n=CT.get(e);n?.delete(t)&&!n.size&&kt(`hosted-view:${e}`)}function ET({card:e,mount:t,update:n,open:r,sendMessage:i,reconnect:a,abort:o}){let s=(0,B.useRef)(null),c=(0,B.useRef)(null),l=(0,B.useRef)(null),u=(0,B.useRef)(Promise.resolve()),d=(0,B.useRef)({open:r,sendMessage:i,reconnect:a,abort:o});d.current={open:r,sendMessage:i,reconnect:a,abort:o};let f=(0,B.useRef)({}).current,p=(0,B.useRef)(!1),[m,h]=(0,B.useState)(0),g=(0,B.useRef)(e=>{}),_=(0,B.useRef)(()=>{});g.current=n=>wT(e,f,t.locale,n,()=>_.current()),_.current=()=>{if(!p.current)h(e=>e+1);else try{l.current?.retry()}catch(e){g.current(e)}},(0,B.useEffect)(()=>()=>TT(e.pluginId,f),[e.pluginId,f]);let[v,y]=(0,B.useState)(),[b,x]=(0,B.useState)(240),[S,C]=(0,B.useState)(DT);(0,B.useEffect)(()=>{let e=new MutationObserver(()=>C(DT()));return e.observe(document.body,{attributes:!0,attributeFilter:[`data-ds-dark-theme`]}),()=>e.disconnect()},[]),(0,B.useEffect)(()=>{if(!s.current||e.generation===void 0)return;let r={pluginId:e.pluginId,generation:e.generation,sessionId:t.sessionId,mountId:crypto.randomUUID()},i=!0;p.current=!1;let a=e=>{i&&g.current(e)},o,m=new $n(s.current,r,async(n,a)=>{if(!i)throw Error(`Frame mount cancelled`);let s=a;if(n===`toolPresentation`&&t.kind===`tool`)return y(bT(a)),null;if(n===`resize`&&t.kind===`tool`)return x(xT(a)),null;if(n===`notify`){let e=ST(a);return Et({tone:e.level,message:e.message}),null}if(n===`action`){if(typeof s?.action!=`string`)throw Error(`Invalid action`);return xb.action({sessionId:r.sessionId,pluginId:r.pluginId,generation:r.generation,...o.capability,action:s.action,input:s.input})}if(n===`downloadDrawing`&&[`editor`,`workspace`].includes(t.kind))return pT(a),null;if(n===`changed`)return o.changed(a);if(n===`abort`&&d.current.abort)return await d.current.abort(),null;if(n===`openPanel`){if(typeof s?.kind!=`string`||!e.contribution?.panels.includes(s.kind)||typeof s.contentId!=`string`)throw Error(`Undeclared panel`);return d.current.open(s.kind,s.contentId,typeof s.title==`string`?s.title:e.name),null}if(n===`sendMessage`&&typeof s?.text==`string`)return await d.current.sendMessage(s.text),null;throw Error(`Unsupported frame host method: ${n}`)});o=new _T(r,m,t,()=>d.current.reconnect(),a),c.current=m,l.current=o;let h=(async()=>{if(await o.start(),!i)throw Error(`Frame mount cancelled`);o.connecting(),await m.connect(t.kind===`controller`?e.controllerUrl:e.documentUrl,{...t,theme:DT(),hostUi:{toolCard:!0,autoResize:!0,notifications:!0}}),o.listen(),p.current=!0,TT(e.pluginId,f)})();u.current=h;let _=er.add({identity:r,ready:h,adapter:m,afterFlush:()=>o.flushed(),toolCallId:n?.call?.toolCallId,retire:()=>o.close()});return h.catch(a),()=>{i=!1,_(),c.current=null,l.current=null,h.catch(()=>{}).then(()=>o.close()).catch(e=>console.error(`Hosted view cleanup did not acknowledge edits`,e)).finally(()=>m.dispose())}},[e.pluginId,e.generation,e.documentUrl,e.controllerUrl,t.sessionId,t.kind,t.contentId,m]),(0,B.useEffect)(()=>{u.current.then(()=>{let e=c.current;return e?.call(`update`,{...t,...n??{},theme:S}).catch(t=>{c.current===e&&g.current(t)})},()=>{})},[n,t.locale,S,t.visible,t.title]);let w=(0,W.jsx)(`div`,{"data-hosted-plugin":e.pluginId,style:{height:t.kind===`controller`||t.kind===`tool`?`auto`:`100%`,minHeight:0},children:(0,W.jsx)(`iframe`,{hidden:t.kind===`controller`,ref:s,title:`${e.name} ${t.kind}`,style:{display:t.kind===`controller`?`none`:`block`,width:`100%`,height:t.kind===`tool`?b:`100%`,border:0}})});return t.kind===`tool`?(0,W.jsx)(yT,{title:v?.title,tool:n,locale:t.locale,children:w}):w}var DT=()=>document.body.hasAttribute(`data-ds-dark-theme`)?`dark`:`light`;function OT(e,t,n){let r=e.contribution,i=t=>`hosted:${e.pluginId}:${t}`;return{id:e.pluginId,instanceId:`${e.pluginId}/${e.generation}`,definition:{id:e.pluginId,apiVersion:1,activate(){},artifactTools:r.artifactTools,workbench:{apiVersion:1,entry:{...r.entry,kind:i(r.entry.kind),icon:t=>(0,W.jsx)(Tb,{card:e,...t})},panels:r.panels.map(a=>({kind:i(a),component:o=>(0,W.jsx)(ET,{card:e,reconnect:t,abort:()=>n.current.abort?.()??Promise.reject(Error(`Abort unavailable`)),mount:{kind:a===r.entry.kind?`workspace`:`editor`,sessionId:o.session.sessionId,contentId:o.contentId,title:o.title,visible:o.visible,locale:o.locale,theme:DT()},open:(e,t,n)=>o.open(i(e),t,n),sendMessage:o.sendMessage})})),toolViews:r.toolViews.length?[{tools:r.toolViews,component:i=>i.session?(0,W.jsx)(ET,{card:e,reconnect:t,abort:()=>n.current.abort?.()??Promise.reject(Error(`Abort unavailable`)),mount:{kind:`tool`,sessionId:i.session.sessionId,locale:i.locale,theme:DT()},update:{call:i.call,result:i.result,running:i.running},open:(e,t)=>i.openPanel(`${r.panelAlias.prefix}${t}`),sendMessage:i.sendMessage},er.incarnation(i.session.sessionId,i.call.toolCallId)):null}]:[],resolvePanel:e=>e.startsWith(r.panelAlias.prefix)?{kind:i(r.panelAlias.kind),contentId:e.slice(r.panelAlias.prefix.length),title:r.panelAlias.title}:null}}}}function kT(e,t,n,r,i){let a=hT({sessionId:t,locale:i,openRecovered:e=>r.current.openPanel?.(`diagram:${e}`)}),[o,s]=(0,B.useState)([]),[c,l]=(0,B.useState)([]),[u,d]=(0,B.useState)([]),[f,p]=(0,B.useState)(0),[m,h]=(0,B.useState)(``),g=(0,B.useMemo)(()=>()=>p(e=>e+1),[]);(0,B.useEffect)(()=>{if(!e||!t){s([]);return}let n=!0,r=new AbortController;return window.addEventListener(`pi:hosted-catalog-changed`,g),xb.catalog(r.signal).then(e=>{n&&(s(t=>Ew(e.plugins,t)),l(e.approvals??[]),e.offline||d(e.plugins.filter(e=>!e.installed||!e.enabled).map(e=>e.pluginId)),h(``))}).catch(()=>{}),()=>{n=!1,r.abort(),window.removeEventListener(`pi:hosted-catalog-changed`,g)}},[e,t,n,f]);let _=(0,B.useRef)(new WeakMap),v=(0,B.useMemo)(()=>o.map(e=>{let t=_.current.get(e);return t||(t=OT(e,g,r),_.current.set(e,t)),t}),[o,g,r]),y=e&&t?o.map(e=>(0,W.jsx)(ET,{card:e,reconnect:g,abort:()=>r.current.abort?.()??Promise.reject(Error(`Abort unavailable`)),mount:{kind:`controller`,sessionId:t,locale:i,theme:DT()},open:(t,n)=>r.current.openPanel?.(`${e.contribution.panelAlias.prefix}${n}`),sendMessage:async e=>{if(!r.current.sendMessage)throw Error(`Composer unavailable`);await r.current.sendMessage(e)}},`${t}/${e.pluginId}/${e.generation}`)):null,b=(0,B.useCallback)((e,t)=>{xb.decide(e,t).then(e=>l(e.approvals??[])).catch(e=>h(String(e)))},[]);return{plugins:e?v:[],inactivePlugins:u,recovery:a,controllers:y,error:m,approvals:c,decide:b}}var AT={zh:{title:`插件请求执行权限`,body:(e,t)=>`${e} 想让后台会话「${t}」获得写入与命令权限(此前只读)。`,allow:`允许`,deny:`拒绝`},en:{title:`A plugin requests permission to execute`,body:(e,t)=>`${e} wants background session "${t}" to gain write and command access (read-only until now).`,allow:`Allow`,deny:`Deny`}};function jT({approvals:e,locale:t,decide:n}){let r=AT[t];return e.length?(0,W.jsxs)(`section`,{role:`alertdialog`,"aria-label":r.title,style:{position:`fixed`,right:16,bottom:16,zIndex:1e3,maxWidth:420,padding:12,borderRadius:8,background:`var(--pi-surface, #fff)`,color:`var(--pi-text, #111)`,border:`1px solid var(--pi-border, #888)`,boxShadow:`0 4px 16px rgba(0,0,0,.25)`},children:[(0,W.jsx)(`strong`,{children:r.title}),e.map(e=>(0,W.jsxs)(`div`,{style:{marginTop:8},children:[(0,W.jsx)(`p`,{style:{margin:`0 0 6px`},children:r.body(e.pluginId,e.title)}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>n(e.id,`allow`),children:r.allow}),` `,(0,W.jsx)(`button`,{type:`button`,onClick:()=>n(e.id,`deny`),children:r.deny})]},e.id))]}):null}var MT=`@chengzhiyi/pi-excalidraw`,NT=[`excalidraw_create_view`,`diagram_create`,`diagram_patch`];function PT(e){let t=({locale:t})=>(0,W.jsxs)(`section`,{role:`status`,className:mT.history,children:[(0,W.jsx)(`h3`,{children:`Excalidraw`}),(0,W.jsx)(`p`,{children:t===`zh`?`Excalidraw 编辑器当前不可用。请在插件管理中检查安装、启用状态及运行时诊断。未从历史工具参数重建图稿;原检查点、工作区文件和浏览器备份均保留。`:`The Excalidraw editor is currently unavailable. Check installation, enablement and runtime diagnostics in plugin management. Historical tool arguments are not the latest scene. Checkpoints, workspace files and browser backups are preserved.`}),(0,W.jsx)(Xv,{variant:`outline`,onClick:e,children:t===`zh`?`打开插件管理`:`Open plugin management`})]});return{id:MT,instanceId:`drawing-recovery`,definition:{id:MT,apiVersion:1,activate(){},artifactTools:NT,workbench:{apiVersion:1,panels:[{kind:`drawing-recovery`,component:t}],toolViews:[{tools:NT,component:t}],resolvePanel:e=>/^diagram:[\w-]{1,80}$/.test(e)?{kind:`drawing-recovery`,contentId:e.slice(8),title:`Excalidraw`}:null}}}}function FT(){let e=_e(),t={"session.new.label":U(`新会话`,`New session`),"session.new":U(`新会话`,`New session`),"toggle.open":U(`展开侧栏`,`Expand sidebar`),"toggle.collapse":U(`收起侧栏`,`Collapse sidebar`),"sidebar.label":U(`对话管理`,`Conversation navigation`),"sidebar.close":U(`关闭侧栏`,`Close sidebar`),"panels.label":U(`面板`,`Panels`),"rightbar.drag.focus":U(`继续拖动以专注工作区`,`Keep dragging to focus workspace`),"rightbar.drag.collapse":U(`继续拖动以收起工作区面板`,`Keep dragging to collapse workspace panel`),"brand.localBuild":`pi-webapp`},n=tx(),r=(0,B.useRef)(n.session?.sessionId);r.current=n.session?.sessionId;let[i,a]=(0,B.useState)(``);(0,B.useEffect)(()=>a(``),[n.session?.sessionId]);let{plugins:o,errors:s}=_w(n.connection===`connected`,n.session?.sessionId,n.plugins,n.pluginGeneration),c=(0,B.useRef)({}),l=kT(n.connection===`connected`,n.session?.sessionId,n.pluginGeneration,c,e);At(`hosted-runtime`,l.error),At(`plugin-load`,s.length?`${U(`插件加载失败`,`Plugin load failed`)}: ${s.length}`:null,s.join(`
48
- `),U(`诊断信息`,`Diagnostics`));let[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)(!1),m=(0,B.useMemo)(()=>PT(()=>p(!0)),[]),h=[...o,...l.plugins.filter(e=>!o.some(t=>t.id===e.id||t.definition.artifactTools?.some(t=>e.definition.artifactTools?.includes(t))))],g=h.some(e=>e.id===`@chengzhiyi/pi-excalidraw`)?h:[...h,m],_=(0,B.useMemo)(()=>[...n.disabledPlugins,...l.inactivePlugins],[n.disabledPlugins,l.inactivePlugins]),v=Cw(n.session?.sessionId,_),y=v.panelId,b=n.connection===`connected`&&n.session!==null&&n.modelsStatus===`ready`&&n.models.length===0;(0,B.useEffect)(()=>{b&&d(!0)},[b]);let x=(0,B.useCallback)(()=>{d(!1),requestAnimationFrame(()=>document.querySelector(`[aria-haspopup="dialog"].pi-settings-sidebar`)?.focus())},[]),[S,w]=(0,B.useState)(()=>({sidebar:280,viewportWidth:window.innerWidth,narrowExpanded:!1,rightbar:null,rightbarShown:!1,rightbarTrack:!1,rightbarFullscreen:!1,rightbarFocus:!1,rightbarInstant:!1})),T=(0,B.useRef)(280),E=(0,B.useRef)(!1),[D,O]=(0,B.useState)(!1),k=(0,B.useCallback)(()=>w(e=>({...e,narrowExpanded:!1})),[]),A=async e=>{if(!E.current){E.current=!0,O(!0);try{n.session?.sessionId&&await er.flush(n.session.sessionId),await e(),p(!1),k()}catch(e){throw a(e instanceof Error?e.message:String(e)),e}finally{E.current=!1,O(!1)}}},ee=(0,B.useMemo)(()=>({closeSidebar:k,setViewportWidth(e){w(t=>t.viewportWidth===e?t:{...t,viewportWidth:e,narrowExpanded:t.viewportWidth<1024==e<1024&&t.narrowExpanded})},setSidebar(e){T.current=Math.min(420,Math.max(264,Math.round(e))),w(e=>({...e,sidebar:T.current}))},setRightbar(e){w(t=>({...t,rightbar:we(e,300,t.viewportWidth*xe)}))},focusRightbar(){w(e=>({...e,rightbarFocus:!0}))},collapseRightbar(){w(e=>({...e,rightbarFocus:!1})),v.controller.setExpanded(!1)}}),[k,v.controller]),j=e=>{let t=g.flatMap(t=>{let n=t.definition.workbench?.resolvePanel?.(e);return n?[{...n,pluginId:t.id}]:[]})[0];t?v.openContent(t.kind,t.contentId,t.title,void 0,t.pluginId):v.controller.openContent({kind:`plugin`,contentId:e,title:U(`预览`,`Preview`)}),v.controller.setExpanded(!0),p(!1),w(e=>({...e,narrowExpanded:!1}))},M=()=>v.controller.setExpanded(!1),N=(0,B.useCallback)(e=>{if(!n.session||n.disabledPlugins.includes(hb.files))return;let t=zt(n.session.cwd,e);v.openContent(`file-preview`,t,t.split(`/`).at(-1),void 0,hb.files),w(e=>({...e,narrowExpanded:!1}))},[n.session?.cwd,n.disabledPlugins,v.openContent]);(0,B.useEffect)(()=>{let e=S.viewportWidth<767||v.snapshot.state.mode===`fullscreen`;w(t=>({...t,rightbarShown:v.shown&&!f,rightbarTrack:v.shown&&!f,rightbarFullscreen:e,rightbarFocus:t.rightbarFocus&&v.shown&&!f&&!e}))},[v.shown,v.snapshot.state.mode,S.viewportWidth,f]),(0,B.useEffect)(()=>{w(e=>e.rightbarFocus?{...e,rightbarFocus:!1}:e)},[n.session?.sessionId]),(0,B.useEffect)(()=>{Kt()},[]);let[P,te]=(0,B.useState)(null),[F,I]=(0,B.useState)(null),L=S.rightbarShown&&(S.rightbarFocus||S.rightbarFullscreen)&&!f&&!u&&n.session!==null;(0,B.useLayoutEffect)(()=>{I(L?document.querySelector(`[data-sidebar-right-session]`):null)},[L,n.session?.sessionId]);let ne=sx(v.snapshot.state,v.snapshot.state.activePaneId).activeTabId,R=ne?lx(v.snapshot.state,ne):void 0,re=(0,B.useMemo)(()=>{if(!R||R.kind===`guide`||!R.title)return null;let e=v.owners.get(R.id),t=v.contexts.get(R.id);return{title:R.title,kind:R.kind,contentId:R.contentId,...e?{plugin:e}:{},...t}},[R,v.owners,v.contexts,v.contextVersion]),ie=(0,B.useCallback)(()=>{S.viewportWidth<767?v.controller.setExpanded(!1):(w(e=>({...e,rightbarFocus:!1})),v.controller.getSnapshot().state.mode===`fullscreen`&&v.controller.setMode(`push`))},[S.viewportWidth,v.controller]),z=L&&P&&F?{host:P,panel:F,context:re,onShowConversation:ie}:null,ae=Jt(),oe=(0,B.useCallback)((e,t)=>(0,W.jsx)(Yt,{text:e,pathImages:t,labels:ae}),[ae]),se=async(...e)=>{let t=n.session?.sessionId;a(``);try{if(t){await er.flush(t);for(let e of g)await e.definition.workbench?.beforeSend?.(t)}if(t!==r.current)throw Error(U(`会话已切换,请在原会话重试`,`Session changed. Retry in the original conversation.`))}catch(e){throw a(e instanceof Error?e.message:String(e)),e}return n.send(...e)},ce={session:n.session,locale:e,openPanel:j,closePanel:M,panelId:y,invokePluginAction:n.invokePluginAction,resolvePluginInteraction:n.resolvePluginInteraction,sendMessage:e=>se(e,[]),renderMarkdown:oe};c.current={openPanel:j,sendMessage:ce.sendMessage,abort:n.stop};let le=(e,t)=>(0,W.jsx)(Sw,{plugins:g,slot:e,props:{...ce,turn:t}}),V=()=>w(e=>e.viewportWidth<1024?{...e,narrowExpanded:!e.narrowExpanded}:{...e,sidebar:e.sidebar===0?T.current:0}),H=e=>e({layoutInfo:S}),ue=e=>e({activePanelId:f?`plugins`:null}),de=e=>e([{id:`plugins`,label:U(`插件`,`Plugins`)}]),fe=(e,t,r)=>e===`sidebar.brand.mark`?(0,W.jsx)(Fe,{size:24}):e===`sidebar.brand.name`?(0,W.jsx)(`span`,{children:`pi-webapp`}):e===`sidebar.footer.action`?(0,W.jsx)(Nb,{wide:t.wide,hideError:u,getUpdate:n.getUpdate,getRunningVersion:n.getRunningVersion,setUpdateChannel:n.setUpdateChannel,cancelUpdate:n.cancelUpdate,update:n.update}):e===`sidebar.panellist`?(0,W.jsx)(C,{size:t.size}):e===`sidebar.settings`?(0,W.jsxs)(`div`,{className:`pi-settings-trigger-row pi-settings-trigger-split ${t.wide?``:`pi-settings-trigger-rail`}`,children:[!t.wide&&(0,W.jsx)(Lb,{wide:!1}),(0,W.jsxs)(`button`,{className:`pi-settings-sidebar`,"data-wide":t.wide,type:`button`,"aria-label":U(`Pi 设置`,`Pi Settings`),"aria-haspopup":`dialog`,"aria-expanded":u,onClick:()=>d(!0),children:[t.wide?(0,W.jsx)(We,{size:16}):(0,W.jsx)(Ue,{size:18}),t.wide&&(0,W.jsx)(`span`,{children:U(`Pi 设置`,`Pi Settings`)})]}),t.wide&&(0,W.jsx)(Lb,{wide:!0})]}):e===`sidebar.workspaces`?(0,W.jsx)(by,{wide:t.wide,expandSidebar:t.expandSidebar,session:n.session,workspaces:n.workspaces,navigationBusy:D,connected:n.connection===`connected`&&n.session!==null,onAdd:(e,t)=>A(()=>n.addWorkspace(e,t)),directoryPickerKind:n.directoryPickerKind,pickDirectory:n.pickDirectory,listDirectory:n.listDirectory,createDirectory:n.createDirectory,onRemove:e=>A(()=>n.removeWorkspace(e)),onSelectSession:(e,t,r)=>A(()=>n.selectSession(e,t,r)),onNewSession:e=>A(()=>n.newSessionInWorkspace(e)),onRenameSession:(e,t,r,i)=>n.renameSession(e,t,r,i),onDeleteSession:(e,t,r)=>A(()=>n.deleteSession(e,t,r))}):r?.fallback??null;return(0,W.jsxs)(Zy,{actions:n,children:[l.controllers,(0,W.jsx)(Nt,{closeLabel:U(`关闭`,`Dismiss`),detailLabel:U(`诊断信息`,`Diagnostics`)}),(0,W.jsx)(jT,{approvals:l.approvals,locale:e,decide:l.decide}),(0,W.jsx)(`div`,{ref:te,"data-floating-host":``,style:{position:`fixed`,inset:0,zIndex:50,pointerEvents:`none`}}),(0,W.jsx)(Ne,{useStore:H,usePanelInfo:ue,actions:ee,renderSlot:(r,o)=>r===`sidebar`?(0,W.jsx)(Rt,{collapsed:o.collapsed,width:o.width,startSession:()=>{A(n.newSession).catch(()=>{})},sessionBusy:D||n.connection!==`connected`||n.session===null,toggleSidebar:V,selectPanel:()=>{p(!0),k()},usePanels:de,usePanelInfo:ue,t:e=>t[e]??e,renderSlot:fe}):r===`main`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{hidden:f,style:{height:`100%`},children:(0,W.jsx)(rx,{openFile:N,children:(0,W.jsx)(Jv,{floating:z,rightbarControl:(0,W.jsx)(Tw,{panel:v,locale:e}),session:n.session,streaming:n.streaming,connection:n.connection,error:i||n.error,onDismissError:()=>{a(``),n.clearError()},onSend:se,onUpdateQueuedPrompt:n.updateQueuedPrompt,onLoadImage:n.loadMessageImage,onUpload:n.upload,onDiscardAttachment:n.discardAttachment,onStop:n.stop,onResume:n.resume,onCompact:n.compact,onNewSession:()=>A(n.newSession),commands:n.commands,models:n.models,modelsStatus:n.modelsStatus,onConfigureModels:()=>d(!0),onSetModel:n.setModel,onSetThinkingLevel:n.setThinkingLevel,composerInteraction:n.session?.interactions?.some(e=>g.some(t=>t.id===e.pluginId&&t.definition.interactions?.some(t=>t.kind===e.kind)))?(0,W.jsx)(bw,{plugins:g,props:ce}):void 0,renderToolView:(e,t,n)=>(0,W.jsx)(xw,{plugins:g,props:ce,call:e,result:t,running:n}),renderPluginSlot:le,plugins:g,onPluginAction:n.invokePluginAction})})}),f&&(0,W.jsx)(jb,{recovery:l.recovery,getPluginManagement:n.getPluginManagement,togglePlugin:n.togglePlugin,generation:n.pluginGeneration})]}):r===`rightbar`&&Object.keys(v.snapshot.state.tabs).length>0?(0,W.jsx)(`div`,{hidden:f,style:{height:`100%`},children:(0,W.jsx)(ww,{panel:v,cwd:n.session?.cwd,width:o.width,narrow:S.viewportWidth<767,focus:S.rightbarFocus,onExitFocus:()=>w(e=>({...e,rightbarFocus:!1})),plugins:g,props:ce},n.session?.sessionId)}):null,t:e=>t[e]??e}),u&&(0,W.jsx)(mb,{onBack:x,setupMode:b,getConfig:n.getConfig,updateConfig:n.updateConfig,getUpdate:n.getUpdate,getRunningVersion:n.getRunningVersion,setUpdateChannel:n.setUpdateChannel,cancelUpdate:n.cancelUpdate,update:n.update,getProviders:n.getProviders,getProviderModels:n.getProviderModels,updateProviderModel:n.updateProviderModel,logoutProvider:n.logoutProvider,addCustomProvider:n.addCustomProvider,startProviderLogin:n.startProviderLogin,getProviderLogin:n.getProviderLogin,getActiveProviderLogin:n.getActiveProviderLogin,respondProviderLogin:n.respondProviderLogin,cancelProviderLogin:n.cancelProviderLogin,refreshModels:n.refreshModels})]})}var IT=new WeakMap,LT=900;function RT(){document.addEventListener(`scroll`,e=>{let t=e.target===document?document.documentElement:e.target;t instanceof Element&&(t.setAttribute(`data-scrolling`,``),window.clearTimeout(IT.get(t)),IT.set(t,window.setTimeout(()=>t.removeAttribute(`data-scrolling`),LT)))},{capture:!0,passive:!0})}var zT=e({});Iy(),he(),RT();var BT=document.getElementById(`root`);if(!BT)throw Error(`Missing #root`);(0,V.createRoot)(BT).render((0,W.jsx)(ye,{children:(0,W.jsx)(FT,{})}));export{vb as a,Ky as c,Or as d,jn as f,_e as g,U as h,ix as i,Pv as l,st as m,cw as n,yb as o,ct as p,iw as r,hb as s,zT as t,Nv as u};
49
- //# debugId=1baec048-013a-4bbd-8463-25078a1fc9a8