@a-t-h-i/bot-lobby 0.6.26 → 0.6.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/package.json +1 -1
- package/prompts/master.md +24 -3
- package/prompts/qa.md +139 -77
- package/prompts/reviewer.md +4 -0
- package/src/classifier/qa-risk.ts +537 -0
- package/src/lobby/planner.ts +14 -0
- package/src/master/decisions.ts +5 -2
- package/src/master/master.ts +6 -0
- package/src/pi/events.ts +4 -3
- package/src/pi/start-task.ts +31 -4
- package/src/pi/tools.ts +3 -0
- package/src/schemas/configuration.ts +2 -2
- package/src/schemas/task.ts +32 -0
- package/src/state/backlog.ts +19 -3
- package/src/webui/api/tasks.ts +1 -0
- package/src/webui/protocol.ts +3 -0
- package/src/workflow/track.ts +46 -7
- package/src/workflow/workflow.ts +196 -34
- package/webui/dist/assets/index-BUzOUrih.css +2 -0
- package/webui/dist/assets/{index-C4Ww36TW.js → index-myC4UiEg.js} +18 -15
- package/webui/dist/build.json +18 -10
- package/webui/dist/index.html +2 -2
- package/webui/dist/assets/index-C1IwecNS.css +0 -2
|
@@ -7,15 +7,15 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
7
7
|
${_}px !important;
|
|
8
8
|
${v}px !important;
|
|
9
9
|
}
|
|
10
|
-
`),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,L.jsx)(Jl,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:m.cloneElement(e,{ref:u})})}var Xl=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=Se(Zl),d=(0,m.useId)(),f=(0,m.useRef)(n),p=(0,m.useRef)(r);Ce(()=>{f.current=n,p.current=r});let h=!0,g=(0,m.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&h&&(g={...g}),(0,m.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),m.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,L.jsx)(Yl,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,L.jsx)(we.Provider,{value:g,children:e})};function Zl(){return new Map}function Ql(e=!0){let t=(0,m.useContext)(we);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,m.useId)();(0,m.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,m.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var $l=e=>e.key||``;function eu(e){let t=[];return m.Children.forEach(e,e=>{(0,m.isValidElement)(e)&&t.push(e)}),t}var tu=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=Ql(o),f=(0,m.useMemo)(()=>eu(e),[e]),p=o&&!u?[]:f.map($l),h=(0,m.useRef)(!0),g=Se(()=>new Map),_=(0,m.useRef)(new Set),[v,y]=(0,m.useState)(f),[b,x]=(0,m.useState)(f);Ce(()=>{o&&!u&&!b.length&&d?.()},[u,o,b.length,d]),Ce(()=>{h.current=!1;for(let e=0;e<b.length;e++){let t=$l(b[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[b,p.length,p.join(`-`)]);let S=[];if(f!==v){let e=[...f],t=0;for(let n of b){let r=p.indexOf($l(n));r===-1?(e.splice(t++,0,n),S.push(n)):t=r+S.length+1}return S.every(e=>g.get($l(e)))?e=f:a===`wait`&&(e=S),x(eu(e)),y(f),null}let{forceRender:C}=(0,m.useContext)(xe);return(0,L.jsx)(L.Fragment,{children:b.map(e=>{let m=$l(e),v=o&&!u?!1:f===b||p.includes(m);return(0,L.jsx)(Xl,{isPresent:v,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:v?void 0:()=>{if(_.current.has(m))return;if(g.has(m))_.current.add(m),g.set(m,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(C?.(),y([]),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},m)})})},nu=(0,m.createContext)({strict:!1}),ru={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},iu=!1;function au(){if(iu)return;let e={};for(let t in ru)e[t]={isEnabled:e=>ru[t].some(t=>!!e[t])};Ws(e),iu=!0}function ou(){return au(),Gs()}function su(e){let t=ou();for(let n in e)t[n]={...t[n],...e[n]};Ws(t)}function cu({children:e,...t}){let n=(0,m.useContext)(Wl);t={...n,...t},t.transition=qi(t.transition,n.transition),t.isStatic=Se(()=>t.isStatic);let r=(0,m.useMemo)(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return(0,L.jsx)(Wl.Provider,{value:r,children:e})}var lu=(0,m.createContext)({});function uu(e,t){if(Fs(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Ms(t)?t:void 0,animate:Ms(n)?n:void 0}}return e.inherit===!1?{}:t}function du(e){let{initial:t,animate:n}=uu(e,(0,m.useContext)(lu));return(0,m.useMemo)(()=>({initial:t,animate:n}),[fu(t),fu(n)])}function fu(e){return Array.isArray(e)?e.join(` `):e}var pu=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function mu(e,t,n){for(let r in t)!ma(t[r])&&!Zs(r,n)&&(e[r]=t[r])}function hu({transformTemplate:e},t){return(0,m.useMemo)(()=>{let n=pu();return ao(n,t,e),Object.assign({},n.vars,n.style)},[t])}function gu(e,t){let n=e.style||{},r={};return mu(r,n,e),Object.assign(r,hu(e,t)),r}function _u(e,t){let n={},r=gu(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var vu=()=>({...pu(),attrs:{}});function yu(e,t,n,r){let i=(0,m.useMemo)(()=>{let n=vu();return uo(n,t,nc(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};mu(t,e.style,e),i.style={...t,...i.style}}return i}var bu=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function xu(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||bu.has(e)}function Su(e,t){return e.startsWith(`on`)?!xu(e):t?.(e)??!xu(e)}function Cu(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(ma(e[a])||(Su(a,r)||n===!0&&xu(a)||!t&&!xu(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var wu=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function Tu(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(wu.indexOf(e)>-1||/[A-Z]/u.test(e))}function Eu(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??Tu(e)?yu:_u)(t,r,i,e),l=Cu(t,typeof e==`string`,a,s),u=e===m.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,m.useMemo)(()=>ma(d)?d.get():d,[d]);return(0,m.createElement)(e,{...u,children:f})}function Du({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Ou(n,r,i,e),renderState:t()}}function Ou(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=rl(a[e]);let{initial:o,animate:s}=e,c=Fs(e),l=Is(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!js(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=sa(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var ku=e=>(t,n)=>{let r=(0,m.useContext)(lu),i=(0,m.useContext)(we),a=()=>Du(e,t,r,i);return n?a():Se(a)},Au=ku({scrapeMotionValuesFromProps:Qs,createRenderState:pu}),ju=ku({scrapeMotionValuesFromProps:ic,createRenderState:vu}),Mu=Symbol.for(`motionComponentSymbol`);function Nu(e,t,n){let r=(0,m.useRef)(n);(0,m.useInsertionEffect)(()=>{r.current=n});let i=(0,m.useRef)(null);return(0,m.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var Pu=(0,m.createContext)({});function Fu(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Iu(e,t,n,r,i,a){let{visualElement:o}=(0,m.useContext)(lu),s=(0,m.useContext)(nu),c=(0,m.useContext)(we),l=(0,m.useContext)(Wl),u=l.reducedMotion,d=l.skipAnimations,f=(0,m.useRef)(null),p=(0,m.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let h=f.current,g=(0,m.useContext)(Pu);h&&!h.projection&&i&&(h.type===`html`||h.type===`svg`)&&Lu(f.current,n,i,g);let _=(0,m.useRef)(!1);(0,m.useInsertionEffect)(()=>{h&&_.current&&h.update(n,c)});let v=n[va],y=(0,m.useRef)(!!v&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return Ce(()=>{p.current&&h&&(h.animationState?.animateChanges(),h.enteringChildren=void 0)},[]),Ce(()=>{p.current=!0,h&&(_.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),y.current&&h.animationState&&h.animationState.animateChanges())}),(0,m.useEffect)(()=>{h&&(!y.current&&h.animationState&&h.animationState.animateChanges(),y.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),!1),h.enteringChildren=void 0)}),h}function Lu(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Ru(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Fu(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Ru(e){if(e)return e.options.allowProjection===!1?Ru(e.parent):e.projection}function zu(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&su(r);let a=n?n===`svg`:Tu(e),o=a?ju:Au;function s(n,s){let c,l={...(0,m.useContext)(Wl),...n,layoutId:Bu(n)},{isStatic:u,isValidProp:d}=l,f=du(n),p=o(n,u);if(!u&&typeof window<`u`){Vu(l,r);let t=Hu(l);c=t.MeasureLayout,f.visualElement=Iu(e,p,l,i,t.ProjectionNode,a)}return(0,L.jsxs)(lu.Provider,{value:f,children:[c&&f.visualElement?(0,L.jsx)(c,{visualElement:f.visualElement,...l}):null,Eu(e,n,Nu(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,m.forwardRef)(s);return c[Mu]=e,c}function Bu({layoutId:e}){let t=(0,m.useContext)(xe).id;return t&&e!==void 0?t+`-`+e:e}function Vu(e,t){(0,m.useContext)(nu).strict}function Hu(e){let{drag:t,layout:n}=ou();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Uu(e,t){if(typeof Proxy>`u`)return zu;let n=new Map,r=(n,r)=>zu(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,zu(a,void 0,e,t)),n.get(a))})}var Wu=(e,t)=>t.isSVG??Tu(e)?new ac(t):new ec(t,{allowProjection:e!==m.Fragment}),Gu=class extends Js{constructor(e){super(e),e.animationState||=cc(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();js(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Ku=0,qu={animation:{Feature:Gu},exit:{Feature:class extends Js{constructor(){super(...arguments),this.id=Ku++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=F(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Ju(e){return{point:{x:e.pageX,y:e.pageY}}}var Yu=e=>t=>Zo(t)&&e(t,Ju(t));function Xu(e,t,n,r){return $c(e,t,Yu(n),r)}var Zu=({current:e})=>e?e.ownerDocument.defaultView:null,Qu=(e,t)=>Math.abs(e-t);function $u(e,t){let n=Qu(e.x,t.x),r=Qu(e.y,t.y);return Math.sqrt(n**2+r**2)}var ed=new Set([`auto`,`scroll`]),td=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=nd(this.lastRawMoveEventInfo,this.transformPagePoint));let e=id(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=$u(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:pt.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=nd(t,this.transformPagePoint),this.hasPendingMove=!0,Mn.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=id(e.type===`pointercancel`?this.lastMoveEventInfo:nd(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Zo(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=nd(Ju(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=ut;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,id(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Pe(Xu(this.contextWindow,`pointermove`,this.handlePointerMove,d),Xu(this.contextWindow,`pointerup`,this.handlePointerUp,d),Xu(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(ed.has(e.overflowX)||ed.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Mn.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Nn(this.updatePoint)}};function nd(e,t){return t?{point:t(e.point)}:e}function rd(e,t){return{x:e.x-t.x,y:e.y-t.y}}function id({point:e},t){return{point:e,delta:rd(e,od(t)),offset:rd(e,ad(t)),velocity:sd(t,.1)}}function ad(e){return e[0]}function od(e){return e[e.length-1]}function sd(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=od(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Le(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Le(t)*2&&(r=e[1]);let a=Re(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function R(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?dn(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?dn(n,e,r.max):Math.min(e,n)),e}function z(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function cd(e,{top:t,left:n,bottom:r,right:i}){return{x:z(e.x,n,i),y:z(e.y,t,r)}}function ld(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function ud(e,t){return{x:ld(e.x,t.x),y:ld(e.y,t.y)}}function dd(e,t){let n=.5,r=vc(e),i=vc(t);return i>r?n=Fe(t.min,t.max-r,e.min):r>i&&(n=Fe(e.min,e.max-i,t.min)),De(0,1,n)}function fd(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var pd=.35;function md(e=pd){return e===!1?e=0:e===!0&&(e=pd),{x:hd(e,`left`,`right`),y:hd(e,`top`,`bottom`)}}function hd(e,t,n){return{min:gd(e,t),max:gd(e,n)}}function gd(e,t){return typeof e==`number`?e:e[t]||0}var _d=new WeakMap,vd=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ks(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ko(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Bc(e=>{let t=this.getAxisMotionValue(e).get()||0;if(It.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=vc(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&Mn.update(()=>i(e,t),!1,!0),ga(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Sd(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&Mn.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new td(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Zu(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&Mn.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!xd(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=R(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Fu(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?cd(n.layoutBox,e):!1,this.elastic=md(t),r!==this.constraints&&!Fu(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Bc(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=fd(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Fu(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Lo(n,r.root,this.visualElement.getTransformPagePoint()),a=ud(r.layout.layoutBox,i);if(t){let e=t(vo(a));this.hasMutatedConstraints=!!e,e&&(a=_o(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Bc(o=>{if(!xd(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return ga(this.visualElement,e),n.start(na(e,n,0,t,this.visualElement,!1))}stopAnimation(){Bc(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Bc(e=>{if(!xd(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-dn(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Fu(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Bc(e=>{let t=this.getAxisMotionValue(e).get();i[e]=dd({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Bc(t=>{let n=this.getAxisMotionValue(t);if(!xd(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(dn(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;_d.set(this.visualElement,this);let e=this.visualElement.current,t=Xu(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&ts(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Fu(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=bd(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Mn.read(r);let o=$c(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Bc(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=pd,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function yd(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function bd(e,t,n){let r=Ss(e,yd(n)),i=Ss(t,yd(n));return()=>{r(),i()}}function xd(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Sd(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Cd=class extends Js{constructor(e){super(e),this.removeGroupControls=Ne,this.removeListeners=Ne,this.controls=new vd(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ne}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},wd=e=>(t,n)=>{e&&Mn.update(()=>e(t,n),!1,!0)},Td=class extends Js{constructor(){super(...arguments),this.removePointerDownListener=Ne}onPointerDown(e){this.session=new td(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Zu(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:wd(e),onStart:wd(t),onMove:wd(n),onEnd:(e,t)=>{delete this.session,r&&Mn.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Xu(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Ed=!1,Dd=class extends m.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Ed&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ol.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Ed=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Mn.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Uo.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Ed=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Od(e){let[t,n]=Ql(),r=(0,m.useContext)(xe);return(0,L.jsx)(Dd,{...e,layoutGroup:r,switchLayoutGroup:(0,m.useContext)(Pu),isPresent:t,safeToRemove:n})}var kd={pan:{Feature:Td},drag:{Feature:Cd,ProjectionNode:Ul,MeasureLayout:Od}};function Ad(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&Mn.postRender(()=>i(t,Ju(t)))}var jd=class extends Js{mount(){let{current:e}=this.node;e&&(this.unmount=Yo(e,(e,t)=>(Ad(this.node,t,`Start`),e=>Ad(this.node,e,`End`))))}unmount(){}},Md=class extends Js{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Pe($c(this.node.current,`focus`,()=>this.onFocus()),$c(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Nd(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&Mn.postRender(()=>i(t,Ju(t)))}var Pd=class extends Js{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=cs(e,(e,t)=>(Nd(this.node,t,`Start`),(e,{success:t})=>Nd(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Fd=new WeakMap,Id=new WeakMap,Ld=e=>{let t=Fd.get(e.target);t&&t(e)},Rd=e=>{e.forEach(Ld)};function zd({root:e,...t}){let n=e||document;Id.has(n)||Id.set(n,{});let r=Id.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Rd,{root:e,...t})),r[i]}function Bd(e,t,n){let r=zd(t);return Fd.set(e,n),r.observe(e),()=>{Fd.delete(e),r.unobserve(e)}}var Vd={some:0,all:1},Hd=class extends Js{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Vd[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Bd(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Ud(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Ud({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Wd={inView:{Feature:Hd},tap:{Feature:Pd},focus:{Feature:Md},hover:{Feature:jd}},Gd={layout:{ProjectionNode:Ul,MeasureLayout:Od}},Kd=Uu({...qu,...Wd,...kd,...Gd},Wu);function qd(){!zs.current&&Vs();let[e]=(0,m.useState)(Rs.current);return e}function Jd(e){return typeof e==`object`&&!Array.isArray(e)}function Yd(e,t,n,r){return e==null?[]:typeof e==`string`&&Jd(t)?Wa(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function Xd(e,t,n){return e*(t+1)+n*t}function Zd(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function Qd(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(Ee(e,i),r--)}}function $d(e,t,n,r,i,a){Qd(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:dn(i,a,r[o]),easing:at(n,o)})}function ef(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function tf(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var nf=`easeInOut`,rf=20;function af(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}if(!Array.isArray(o)){l.set(o.name,Zd(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=Zd(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=cf(e),{delay:l=0,times:u=nr(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=vi(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&df(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=Le(b));let r=zn(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&tr(u,T),c.length===1&&c.unshift(null),m&&`${m}${rf}`,m&&m<rf){let e=b>0?_/b:0;b=Xd(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?qe(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:at(f,e-1))}ef(u,m,e)}let E=w+b;$d(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(ma(p)){let e=of(p,s);_(m,h,sf(`default`,e))}else{let e=Yd(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=of(r,s);for(let e in m)_(m[e],lf(h,e),sf(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(tf);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(Fe(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(nf)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function of(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function sf(e,t){return t[e]||(t[e]=[]),t[e]}function cf(e){return Array.isArray(e)?e:[e]}function lf(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var uf=e=>typeof e==`number`,df=e=>e.every(uf);function ff(e,t){return ma(e)||typeof e==`number`||typeof e==`string`&&!Jd(t)}function pf(e,t,n,r){let i=[];if(ff(e,t))i.push(Qc(e,Jd(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=Yd(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s={...n};`delay`in s&&typeof s.delay==`function`&&(s.delay=s.delay(e,o)),r instanceof Element?i.push(...Vo(r,t,s,As.get(r))):i.push(...za(La(r)??Ho,r,t,s))}}return i}function mf(e,t,n){let r=[];return af(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=Ki(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:Zn}).forEach(({keyframes:e,transition:t},n)=>{r.push(...pf(n,e,t))}),r}function hf(e){return Array.isArray(e)&&e.some(Array.isArray)}function gf(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),hf(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=mf(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=pf(e,i,{...c,...r},t)}let l=new Bi(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{Ee(t.animations,l)})),l}return i}var _f=Object.assign(gf(),{addEffect:Fa,removeEffect:Ia}),B=Kd,vf=o((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&&te(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&&te(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,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function te(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,te(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}}}})),yf=o(((e,t)=>{t.exports=vf()})),bf=o((e=>{var t=p();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),xf=o(((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=bf()})),Sf=o((e=>{var t=yf(),n=p(),r=xf();function i(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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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 s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}function f(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)&&f(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(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 h(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 g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(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)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var y=null,b=null;function x(e,t,n){return e===n||e===t&&(y=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function C(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 w(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 T=Object.assign,E=Symbol.for(`react.element`),D=Symbol.for(`react.transitional.element`),O=Symbol.for(`react.portal`),k=Symbol.for(`react.fragment`),ee=Symbol.for(`react.strict_mode`),te=Symbol.for(`react.profiler`),ne=Symbol.for(`react.consumer`),A=Symbol.for(`react.context`),re=Symbol.for(`react.forward_ref`),ie=Symbol.for(`react.suspense`),j=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.legacy_hidden`),le=Symbol.for(`react.memo_cache_sentinel`),ue=Symbol.for(`react.view_transition`),de=Symbol.for(`react.recoverable`),fe=Symbol.iterator;function pe(e){return typeof e!=`object`||!e?null:(e=fe&&e[fe]||e[`@@iterator`],typeof e==`function`?e:null)}var me=Symbol.for(`react.client.reference`);function he(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case k:return`Fragment`;case te:return`Profiler`;case ee:return`StrictMode`;case ie:return`Suspense`;case j:return`SuspenseList`;case se:return`Activity`;case ue:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case O:return`Portal`;case A:return e.displayName||`Context`;case ne:return(e._context.displayName||`Context`)+`.Consumer`;case re:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?he(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}var ge=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e={pending:!1,data:null,method:null,action:null},ve=[],ye=-1;function be(e){return{current:e}}function xe(e){0>ye||(e.current=ve[ye],ve[ye]=null,ye--)}function Se(e,t){ye++,ve[ye]=e.current,e.current=t}var Ce=be(null),we=be(null),Te=be(null),Ee=be(null);function De(e,t){switch(Se(Te,t),Se(we,e),Se(Ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?bp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=bp(t),e=xp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}xe(Ce),Se(Ce,e)}function Oe(){xe(Ce),xe(we),xe(Te)}function ke(e){var t=e.memoizedState;t!==null&&(_h._currentValue=t.memoizedState,Se(Ee,e)),t=Ce.current;var n=xp(t,e.type);t!==n&&(Se(we,e),Se(Ce,n))}function Ae(e){we.current===e&&(xe(Ce),xe(we)),Ee.current===e&&(xe(Ee),_h._currentValue=_e)}var je,Me;function Ne(e){if(je===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);je=t&&t[1]||``,Me=-1<e.stack.indexOf(`
|
|
10
|
+
`),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,L.jsx)(Jl,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:m.cloneElement(e,{ref:u})})}var Xl=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=Se(Zl),d=(0,m.useId)(),f=(0,m.useRef)(n),p=(0,m.useRef)(r);Ce(()=>{f.current=n,p.current=r});let h=!0,g=(0,m.useMemo)(()=>(h=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&h&&(g={...g}),(0,m.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),m.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,L.jsx)(Yl,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,L.jsx)(we.Provider,{value:g,children:e})};function Zl(){return new Map}function Ql(e=!0){let t=(0,m.useContext)(we);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,m.useId)();(0,m.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,m.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var $l=e=>e.key||``;function eu(e){let t=[];return m.Children.forEach(e,e=>{(0,m.isValidElement)(e)&&t.push(e)}),t}var tu=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=Ql(o),f=(0,m.useMemo)(()=>eu(e),[e]),p=o&&!u?[]:f.map($l),h=(0,m.useRef)(!0),g=Se(()=>new Map),_=(0,m.useRef)(new Set),[v,y]=(0,m.useState)(f),[b,x]=(0,m.useState)(f);Ce(()=>{o&&!u&&!b.length&&d?.()},[u,o,b.length,d]),Ce(()=>{h.current=!1;for(let e=0;e<b.length;e++){let t=$l(b[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[b,p.length,p.join(`-`)]);let S=[];if(f!==v){let e=[...f],t=0;for(let n of b){let r=p.indexOf($l(n));r===-1?(e.splice(t++,0,n),S.push(n)):t=r+S.length+1}return S.every(e=>g.get($l(e)))?e=f:a===`wait`&&(e=S),x(eu(e)),y(f),null}let{forceRender:C}=(0,m.useContext)(xe);return(0,L.jsx)(L.Fragment,{children:b.map(e=>{let m=$l(e),v=o&&!u?!1:f===b||p.includes(m);return(0,L.jsx)(Xl,{isPresent:v,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:v?void 0:()=>{if(_.current.has(m))return;if(g.has(m))_.current.add(m),g.set(m,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(C?.(),y([]),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},m)})})},nu=(0,m.createContext)({strict:!1}),ru={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},iu=!1;function au(){if(iu)return;let e={};for(let t in ru)e[t]={isEnabled:e=>ru[t].some(t=>!!e[t])};Ws(e),iu=!0}function ou(){return au(),Gs()}function su(e){let t=ou();for(let n in e)t[n]={...t[n],...e[n]};Ws(t)}function cu({children:e,...t}){let n=(0,m.useContext)(Wl);t={...n,...t},t.transition=qi(t.transition,n.transition),t.isStatic=Se(()=>t.isStatic);let r=(0,m.useMemo)(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion,t.skipAnimations,t.isValidProp]);return(0,L.jsx)(Wl.Provider,{value:r,children:e})}var lu=(0,m.createContext)({});function uu(e,t){if(Fs(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Ms(t)?t:void 0,animate:Ms(n)?n:void 0}}return e.inherit===!1?{}:t}function du(e){let{initial:t,animate:n}=uu(e,(0,m.useContext)(lu));return(0,m.useMemo)(()=>({initial:t,animate:n}),[fu(t),fu(n)])}function fu(e){return Array.isArray(e)?e.join(` `):e}var pu=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function mu(e,t,n){for(let r in t)!ma(t[r])&&!Zs(r,n)&&(e[r]=t[r])}function hu({transformTemplate:e},t){return(0,m.useMemo)(()=>{let n=pu();return ao(n,t,e),Object.assign({},n.vars,n.style)},[t])}function gu(e,t){let n=e.style||{},r={};return mu(r,n,e),Object.assign(r,hu(e,t)),r}function _u(e,t){let n={},r=gu(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var vu=()=>({...pu(),attrs:{}});function yu(e,t,n,r){let i=(0,m.useMemo)(()=>{let n=vu();return uo(n,t,nc(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};mu(t,e.style,e),i.style={...t,...i.style}}return i}var bu=new Set(`animate.exit.variants.initial.style.values.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function xu(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||bu.has(e)}function Su(e,t){return e.startsWith(`on`)?!xu(e):t?.(e)??!xu(e)}function Cu(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(ma(e[a])||(Su(a,r)||n===!0&&xu(a)||!t&&!xu(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var wu=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function Tu(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(wu.indexOf(e)>-1||/[A-Z]/u.test(e))}function Eu(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??Tu(e)?yu:_u)(t,r,i,e),l=Cu(t,typeof e==`string`,a,s),u=e===m.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,m.useMemo)(()=>ma(d)?d.get():d,[d]);return(0,m.createElement)(e,{...u,children:f})}function Du({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:Ou(n,r,i,e),renderState:t()}}function Ou(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=rl(a[e]);let{initial:o,animate:s}=e,c=Fs(e),l=Is(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!js(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=sa(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var ku=e=>(t,n)=>{let r=(0,m.useContext)(lu),i=(0,m.useContext)(we),a=()=>Du(e,t,r,i);return n?a():Se(a)},Au=ku({scrapeMotionValuesFromProps:Qs,createRenderState:pu}),ju=ku({scrapeMotionValuesFromProps:ic,createRenderState:vu}),Mu=Symbol.for(`motionComponentSymbol`);function Nu(e,t,n){let r=(0,m.useRef)(n);(0,m.useInsertionEffect)(()=>{r.current=n});let i=(0,m.useRef)(null);return(0,m.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var Pu=(0,m.createContext)({});function Fu(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Iu(e,t,n,r,i,a){let{visualElement:o}=(0,m.useContext)(lu),s=(0,m.useContext)(nu),c=(0,m.useContext)(we),l=(0,m.useContext)(Wl),u=l.reducedMotion,d=l.skipAnimations,f=(0,m.useRef)(null),p=(0,m.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let h=f.current,g=(0,m.useContext)(Pu);h&&!h.projection&&i&&(h.type===`html`||h.type===`svg`)&&Lu(f.current,n,i,g);let _=(0,m.useRef)(!1);(0,m.useInsertionEffect)(()=>{h&&_.current&&h.update(n,c)});let v=n[va],y=(0,m.useRef)(!!v&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(v)&&window.MotionHasOptimisedAnimation?.(v));return Ce(()=>{p.current&&h&&(h.animationState?.animateChanges(),h.enteringChildren=void 0)},[]),Ce(()=>{p.current=!0,h&&(_.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),y.current&&h.animationState&&h.animationState.animateChanges())}),(0,m.useEffect)(()=>{h&&(!y.current&&h.animationState&&h.animationState.animateChanges(),y.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(v)}),!1),h.enteringChildren=void 0)}),h}function Lu(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Ru(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Fu(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Ru(e){if(e)return e.options.allowProjection===!1?Ru(e.parent):e.projection}function zu(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&su(r);let a=n?n===`svg`:Tu(e),o=a?ju:Au;function s(n,s){let c,l={...(0,m.useContext)(Wl),...n,layoutId:Bu(n)},{isStatic:u,isValidProp:d}=l,f=du(n),p=o(n,u);if(!u&&typeof window<`u`){Vu(l,r);let t=Hu(l);c=t.MeasureLayout,f.visualElement=Iu(e,p,l,i,t.ProjectionNode,a)}return(0,L.jsxs)(lu.Provider,{value:f,children:[c&&f.visualElement?(0,L.jsx)(c,{visualElement:f.visualElement,...l}):null,Eu(e,n,Nu(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,m.forwardRef)(s);return c[Mu]=e,c}function Bu({layoutId:e}){let t=(0,m.useContext)(xe).id;return t&&e!==void 0?t+`-`+e:e}function Vu(e,t){(0,m.useContext)(nu).strict}function Hu(e){let{drag:t,layout:n}=ou();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Uu(e,t){if(typeof Proxy>`u`)return zu;let n=new Map,r=(n,r)=>zu(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,zu(a,void 0,e,t)),n.get(a))})}var Wu=(e,t)=>t.isSVG??Tu(e)?new ac(t):new ec(t,{allowProjection:e!==m.Fragment}),Gu=class extends Js{constructor(e){super(e),e.animationState||=cc(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();js(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Ku=0,qu={animation:{Feature:Gu},exit:{Feature:class extends Js{constructor(){super(...arguments),this.id=Ku++}update(){let{presenceContext:e,prevPresenceContext:t,animationState:n}=this.node;if(!e||!n)return;let{isPresent:r,onExitComplete:i}=e,a=t?.isPresent;if(r===a)return;if(r&&a===!1){if(this.exit===!0){let{initial:e}=this.node.getProps();if(e&&!Array.isArray(e)){let{transition:t,transitionEnd:n,...r}=F(this.node,e)||{};for(let e in r)this.node.getValue(e)?.jump(r[e])}this.node.blockInitialAnimation=!1,n.reset(),n.animateChanges()}else n.setActive(`exit`,!1);this.exit=void 0;return}let o=this.exit=n.setActive(`exit`,!r);i&&!r&&o.then(()=>{this.exit===o&&(this.exit=!0,i(this.id))})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Ju(e){return{point:{x:e.pageX,y:e.pageY}}}var Yu=e=>t=>Zo(t)&&e(t,Ju(t));function Xu(e,t,n,r){return $c(e,t,Yu(n),r)}var Zu=({current:e})=>e?e.ownerDocument.defaultView:null,Qu=(e,t)=>Math.abs(e-t);function $u(e,t){let n=Qu(e.x,t.x),r=Qu(e.y,t.y);return Math.sqrt(n**2+r**2)}var ed=new Set([`auto`,`scroll`]),td=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=nd(this.lastRawMoveEventInfo,this.transformPagePoint));let e=id(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=$u(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e;this.history.push({...r,timestamp:pt.now()});let{onStart:i,onMove:a}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),a&&a(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=nd(t,this.transformPagePoint),this.hasPendingMove=!0,Mn.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.hasPendingMove&&this.updatePoint(),this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=id(e.type===`pointercancel`?this.lastMoveEventInfo:nd(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Zo(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=nd(Ju(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=ut;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,id(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Pe(Xu(this.contextWindow,`pointermove`,this.handlePointerMove,d),Xu(this.contextWindow,`pointerup`,this.handlePointerUp,d),Xu(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(ed.has(e.overflowX)||ed.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Mn.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Nn(this.updatePoint)}};function nd(e,t){return t?{point:t(e.point)}:e}function rd(e,t){return{x:e.x-t.x,y:e.y-t.y}}function id({point:e},t){return{point:e,delta:rd(e,od(t)),offset:rd(e,ad(t)),velocity:sd(t,.1)}}function ad(e){return e[0]}function od(e){return e[e.length-1]}function sd(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=od(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Le(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Le(t)*2&&(r=e[1]);let a=Re(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function cd(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?dn(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?dn(n,e,r.max):Math.min(e,n)),e}function R(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function ld(e,{top:t,left:n,bottom:r,right:i}){return{x:R(e.x,n,i),y:R(e.y,t,r)}}function ud(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function dd(e,t){return{x:ud(e.x,t.x),y:ud(e.y,t.y)}}function fd(e,t){let n=.5,r=vc(e),i=vc(t);return i>r?n=Fe(t.min,t.max-r,e.min):r>i&&(n=Fe(e.min,e.max-i,t.min)),De(0,1,n)}function pd(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var md=.35;function hd(e=md){return e===!1?e=0:e===!0&&(e=md),{x:gd(e,`left`,`right`),y:gd(e,`top`,`bottom`)}}function gd(e,t,n){return{min:_d(e,t),max:_d(e,n)}}function _d(e,t){return typeof e==`number`?e:e[t]||0}var vd=new WeakMap,yd=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ks(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(e),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ko(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Bc(e=>{let t=this.getAxisMotionValue(e).get()||0;if(It.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=vc(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&Mn.update(()=>i(e,t),!1,!0),ga(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Cd(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&Mn.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new td(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Zu(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&Mn.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Sd(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=cd(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Fu(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?ld(n.layoutBox,e):!1,this.elastic=hd(t),r!==this.constraints&&!Fu(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Bc(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=pd(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Fu(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Lo(n,r.root,this.visualElement.getTransformPagePoint()),a=dd(r.layout.layoutBox,i);if(t){let e=t(vo(a));this.hasMutatedConstraints=!!e,e&&(a=_o(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Bc(o=>{if(!Sd(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return ga(this.visualElement,e),n.start(na(e,n,0,t,this.visualElement,!1))}stopAnimation(){Bc(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor({clientX:e,clientY:t}){let{drag:n}=this.getProps(),r={x:e,y:t},i=this.visualElement.getTransformPagePoint()?.(r)||r,a=this.visualElement.measureViewportBox();Bc(e=>{if(!Sd(e,n,this.currentDirection))return;let t=this.getAxisMotionValue(e),{min:r,max:o}=a[e];t.set((t.get()||0)+i[e]-dn(r,o,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Fu(t)||!n||!this.constraints)return;this.stopAnimation();let r=this.constraints,i={x:0,y:0};Bc(e=>{let t=this.getAxisMotionValue(e).get();i[e]=fd({min:t,max:t},r[e])});let{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Bc(t=>{let n=this.getAxisMotionValue(t);if(!Sd(t,e,null)||!n.get())return;let{min:r,max:a}=this.constraints[t];n.set(dn(r,a,i[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;vd.set(this.visualElement,this);let e=this.visualElement.current,t=Xu(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&ts(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Fu(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=xd(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Mn.read(r);let o=$c(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Bc(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=md,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function bd(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function xd(e,t,n){let r=Ss(e,bd(n)),i=Ss(t,bd(n));return()=>{r(),i()}}function Sd(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Cd(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var wd=class extends Js{constructor(e){super(e),this.removeGroupControls=Ne,this.removeListeners=Ne,this.controls=new yd(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ne}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},Td=e=>(t,n)=>{e&&Mn.update(()=>e(t,n),!1,!0)},Ed=class extends Js{constructor(){super(...arguments),this.removePointerDownListener=Ne}onPointerDown(e){this.session=new td(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Zu(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Td(e),onStart:Td(t),onMove:Td(n),onEnd:(e,t)=>{delete this.session,r&&Mn.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Xu(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Dd=!1,Od=class extends m.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Dd&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ol.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Dd=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Mn.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Uo.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Dd=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function kd(e){let[t,n]=Ql(),r=(0,m.useContext)(xe);return(0,L.jsx)(Od,{...e,layoutGroup:r,switchLayoutGroup:(0,m.useContext)(Pu),isPresent:t,safeToRemove:n})}var Ad={pan:{Feature:Ed},drag:{Feature:wd,ProjectionNode:Ul,MeasureLayout:kd}};function jd(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&Mn.postRender(()=>i(t,Ju(t)))}var Md=class extends Js{mount(){let{current:e}=this.node;e&&(this.unmount=Yo(e,(e,t)=>(jd(this.node,t,`Start`),e=>jd(this.node,e,`End`))))}unmount(){}},Nd=class extends Js{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}e&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Pe($c(this.node.current,`focus`,()=>this.onFocus()),$c(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Pd(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&Mn.postRender(()=>i(t,Ju(t)))}var Fd=class extends Js{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=cs(e,(e,t)=>(Pd(this.node,t,`Start`),(e,{success:t})=>Pd(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Id=new WeakMap,Ld=new WeakMap,Rd=e=>{let t=Id.get(e.target);t&&t(e)},zd=e=>{e.forEach(Rd)};function Bd({root:e,...t}){let n=e||document;Ld.has(n)||Ld.set(n,{});let r=Ld.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(zd,{root:e,...t})),r[i]}function Vd(e,t,n){let r=Bd(t);return Id.set(e,n),r.observe(e),()=>{Id.delete(e),r.unobserve(e)}}var Hd={some:0,all:1},Ud=class extends Js{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Hd[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Vd(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Wd(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Wd({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Gd={inView:{Feature:Ud},tap:{Feature:Fd},focus:{Feature:Nd},hover:{Feature:Md}},Kd={layout:{ProjectionNode:Ul,MeasureLayout:kd}},qd=Uu({...qu,...Gd,...Ad,...Kd},Wu);function Jd(){!zs.current&&Vs();let[e]=(0,m.useState)(Rs.current);return e}function Yd(e){return typeof e==`object`&&!Array.isArray(e)}function Xd(e,t,n,r){return e==null?[]:typeof e==`string`&&Yd(t)?Wa(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function Zd(e,t,n){return e*(t+1)+n*t}function Qd(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function $d(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(Ee(e,i),r--)}}function ef(e,t,n,r,i,a){$d(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:dn(i,a,r[o]),easing:at(n,o)})}function tf(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function nf(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var rf=`easeInOut`,af=20;function of(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}if(!Array.isArray(o)){l.set(o.name,Qd(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=Qd(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=lf(e),{delay:l=0,times:u=nr(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=vi(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&ff(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=Le(b));let r=zn(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&tr(u,T),c.length===1&&c.unshift(null),m&&`${m}${af}`,m&&m<af){let e=b>0?_/b:0;b=Zd(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?qe(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:at(f,e-1))}tf(u,m,e)}let E=w+b;ef(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(ma(p)){let e=sf(p,s);_(m,h,cf(`default`,e))}else{let e=Xd(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=sf(r,s);for(let e in m)_(m[e],uf(h,e),cf(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(nf);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(Fe(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(rf)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function sf(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function cf(e,t){return t[e]||(t[e]=[]),t[e]}function lf(e){return Array.isArray(e)?e:[e]}function uf(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var df=e=>typeof e==`number`,ff=e=>e.every(df);function pf(e,t){return ma(e)||typeof e==`number`||typeof e==`string`&&!Yd(t)}function mf(e,t,n,r){let i=[];if(pf(e,t))i.push(Qc(e,Yd(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=Xd(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s={...n};`delay`in s&&typeof s.delay==`function`&&(s.delay=s.delay(e,o)),r instanceof Element?i.push(...Vo(r,t,s,As.get(r))):i.push(...za(La(r)??Ho,r,t,s))}}return i}function hf(e,t,n){let r=[];return of(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=Ki(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:Zn}).forEach(({keyframes:e,transition:t},n)=>{r.push(...mf(n,e,t))}),r}function gf(e){return Array.isArray(e)&&e.some(Array.isArray)}function _f(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),gf(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=hf(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=mf(e,i,{...c,...r},t)}let l=new Bi(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{Ee(t.animations,l)})),l}return i}var vf=Object.assign(_f(),{addEffect:Fa,removeEffect:Ia}),z=qd,yf=o((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&&te(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&&te(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,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function te(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,te(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}}}})),bf=o(((e,t)=>{t.exports=yf()})),xf=o((e=>{var t=p();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),Sf=o(((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=xf()})),Cf=o((e=>{var t=bf(),n=p(),r=Sf();function i(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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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 s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}function f(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)&&f(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(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 h(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 g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(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)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var y=null,b=null;function x(e,t,n){return e===n||e===t&&(y=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function C(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 w(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 T=Object.assign,E=Symbol.for(`react.element`),D=Symbol.for(`react.transitional.element`),O=Symbol.for(`react.portal`),k=Symbol.for(`react.fragment`),ee=Symbol.for(`react.strict_mode`),te=Symbol.for(`react.profiler`),ne=Symbol.for(`react.consumer`),A=Symbol.for(`react.context`),re=Symbol.for(`react.forward_ref`),ie=Symbol.for(`react.suspense`),j=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.legacy_hidden`),le=Symbol.for(`react.memo_cache_sentinel`),ue=Symbol.for(`react.view_transition`),de=Symbol.for(`react.recoverable`),fe=Symbol.iterator;function pe(e){return typeof e!=`object`||!e?null:(e=fe&&e[fe]||e[`@@iterator`],typeof e==`function`?e:null)}var me=Symbol.for(`react.client.reference`);function he(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case k:return`Fragment`;case te:return`Profiler`;case ee:return`StrictMode`;case ie:return`Suspense`;case j:return`SuspenseList`;case se:return`Activity`;case ue:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case O:return`Portal`;case A:return e.displayName||`Context`;case ne:return(e._context.displayName||`Context`)+`.Consumer`;case re:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?he(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}var ge=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e={pending:!1,data:null,method:null,action:null},ve=[],ye=-1;function be(e){return{current:e}}function xe(e){0>ye||(e.current=ve[ye],ve[ye]=null,ye--)}function Se(e,t){ye++,ve[ye]=e.current,e.current=t}var Ce=be(null),we=be(null),Te=be(null),Ee=be(null);function De(e,t){switch(Se(Te,t),Se(we,e),Se(Ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?bp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=bp(t),e=xp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}xe(Ce),Se(Ce,e)}function Oe(){xe(Ce),xe(we),xe(Te)}function ke(e){var t=e.memoizedState;t!==null&&(_h._currentValue=t.memoizedState,Se(Ee,e)),t=Ce.current;var n=xp(t,e.type);t!==n&&(Se(we,e),Se(Ce,n))}function Ae(e){we.current===e&&(xe(Ce),xe(we)),Ee.current===e&&(xe(Ee),_h._currentValue=_e)}var je,Me;function Ne(e){if(je===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);je=t&&t[1]||``,Me=-1<e.stack.indexOf(`
|
|
11
11
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
12
12
|
`+je+e+Me}var Pe=!1;function Fe(e,t){if(!e||Pe)return``;Pe=!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(`
|
|
13
13
|
`),l=s.split(`
|
|
14
14
|
`);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=`
|
|
15
15
|
`+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{Pe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ne(n):``}function Ie(e,t){switch(e.tag){case 26:case 27:case 5:return Ne(e.type);case 16:return Ne(`Lazy`);case 13:return e.child!==t&&t!==null?Ne(`Suspense Fallback`):Ne(`Suspense`);case 19:return Ne(`SuspenseList`);case 0:case 15:return Fe(e.type,!1);case 11:return Fe(e.type.render,!1);case 1:return Fe(e.type,!0);case 31:return Ne(`Activity`);case 30:return Ne(`ViewTransition`);default:return``}}function Le(e){try{var t=``,n=null;do t+=Ie(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
16
16
|
Error generating stack: `+e.message+`
|
|
17
|
-
`+e.stack}}var Re=Object.prototype.hasOwnProperty,ze=t.unstable_scheduleCallback,Be=t.unstable_cancelCallback,Ve=t.unstable_shouldYield,He=t.unstable_requestPaint,Ue=t.unstable_now,We=t.unstable_getCurrentPriorityLevel,Ge=t.unstable_ImmediatePriority,Ke=t.unstable_UserBlockingPriority,qe=t.unstable_NormalPriority,Je=t.unstable_LowPriority,Ye=t.unstable_IdlePriority,Xe=t.log,Ze=t.unstable_setDisableYieldValue,Qe=null,$e=null;function et(e){if(typeof Xe==`function`&&Ze(e),$e&&typeof $e.setStrictMode==`function`)try{$e.setStrictMode(Qe,e)}catch{}}var tt=Math.clz32?Math.clz32:it,nt=Math.log,rt=Math.LN2;function it(e){return e>>>=0,e===0?32:31-(nt(e)/rt|0)|0}var at=256,ot=262144,st=4194304;function ct(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 lt(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=ct(n))):i=ct(o):i=ct(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ct(n))):i=ct(o)):i=ct(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 ut(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function dt(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-tt(n),i=1<<r;t|=e[r],n&=~i}return t}function ft(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 pt(){var e=st;return st<<=1,!(st&62914560)&&(st=4194304),e}function mt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ht(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gt(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-tt(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&&_t(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function _t(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-tt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-tt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function yt(e,t){var n=t&-t;return n=n&42?1:bt(n),(n&(e.suspendedLanes|t))===0?n:0}function bt(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 xt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function St(){var e=N.p;return e===0?(e=window.event,e===void 0?32:Nh(e.type)):e}function Ct(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var wt=Math.random().toString(36).slice(2),Tt=`__reactFiber$`+wt,Et=`__reactProps$`+wt,Dt=`__reactContainer$`+wt,Ot=`__reactEvents$`+wt,kt=`__reactListeners$`+wt,At=`__reactHandles$`+wt,jt=`__reactResources$`+wt,Mt=`__reactMarker$`+wt,Nt=`__reactLoad$`+wt;function Pt(e){delete e[Tt],delete e[Et],delete e[kt],delete e[At]}function Ft(e){var t;if(t=e[Tt])return t;for(var n=e.parentNode;n;){if(t=n[Dt]||n[Tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Sm(e);e!==null;){if(n=e[Tt])return n;e=Sm(e)}return t}e=n,n=e.parentNode}return null}function It(e){if(e=e[Tt]||e[Dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function P(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Lt(e){var t=e[jt];return t||=e[jt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Rt(e){e[Mt]=!0}function zt(e){e[Nt]=void 0}var Bt=new Set,Vt={};function Ht(e,t){Ut(e,t),Ut(e+`Capture`,t)}function Ut(e,t){for(Vt[e]=t,e=0;e<t.length;e++)Bt.add(t[e])}var Wt=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]*$`),Gt={},Kt={};function qt(e){return Re.call(Kt,e)?!0:Re.call(Gt,e)?!1:Wt.test(e)?Kt[e]=!0:(Gt[e]=!0,!1)}var Jt=!1;function Yt(){var e=Jt;return Jt=!1,e}function Xt(e,t,n){if(qt(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 Zt(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 Qt(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 $t(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function en(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function tn(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 nn(e){if(!e._valueTracker){var t=en(e)?`checked`:`value`;e._valueTracker=tn(e,t,``+e[t])}}function rn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=en(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var an=/[\n"\\]/g;function on(e){return e.replace(an,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function sn(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=``+$t(t)):e.value!==``+$t(t)&&(e.value=``+$t(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):ln(e,$t(n)):o===`number`&&e.value==t?ln(e,$t(e.value)):ln(e,$t(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=``+$t(s):e.removeAttribute(`name`)}function cn(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)){nn(e);return}n=n==null?``:``+$t(n),t=t==null?n:``+$t(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),nn(e)}function ln(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function un(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=``+$t(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 dn(e,t,n){if(t!=null&&(t=``+$t(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+$t(n)}function fn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ge(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=$t(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),nn(e)}function pn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var mn=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 hn(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||mn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function gn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(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]=``,Jt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(hn(e,a,r),Jt=!0)}else for(var o in t)t.hasOwnProperty(o)&&hn(e,o,t[o])}function _n(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 vn=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`]]),yn=/^[\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 bn(e){return yn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function xn(){}var Sn=null;function Cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wn=null,Tn=null;function En(e){var t=It(e);if(t&&(e=t.stateNode)){var n=e[Et]||null;a:switch(e=t.stateNode,t.type){case`input`:if(sn(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="`+on(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Et]||null;if(!a)throw Error(i(90));sn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&rn(r)}break a;case`textarea`:dn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&un(e,!!n.multiple,t,!1)}}}var Dn=!1;function On(e,t,n){if(Dn)return e(t,n);Dn=!0;try{return e(t)}finally{if(Dn=!1,(wn!==null||Tn!==null)&&(Jd(),wn&&(t=wn,e=Tn,Tn=wn=null,En(t),e)))for(t=0;t<e.length;t++)En(e[t])}}function kn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Et]||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(i(231,t,typeof n));return n}var An=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,jn=!1;if(An)try{var Mn={};Object.defineProperty(Mn,"passive",{get:function(){jn=!0}}),window.addEventListener(`test`,Mn,Mn),window.removeEventListener(`test`,Mn,Mn)}catch{jn=!1}var Nn=null,Pn=null,Fn=null;function In(){if(Fn)return Fn;var e,t=Pn,n=t.length,r,i=`value`in Nn?Nn.value:Nn.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 Fn=i.slice(e,1<r?1-r:void 0)}function Ln(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 Rn(){return!0}function zn(){return!1}function Bn(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)?Rn:zn,this.isPropagationStopped=zn,this}return T(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=Rn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Rn)},persist:function(){},isPersistent:Rn}),t}var Vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hn=Bn(Vn),Un=T({},Vn,{view:0,detail:0}),Wn=Bn(Un),Gn,Kn,qn,Jn=T({},Un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ar,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!==qn&&(qn&&e.type===`mousemove`?(Gn=e.screenX-qn.screenX,Kn=e.screenY-qn.screenY):Kn=Gn=0,qn=e),Gn)},movementY:function(e){return`movementY`in e?e.movementY:Kn}}),Yn=Bn(Jn),Xn=Bn(T({},Jn,{dataTransfer:0})),Zn=Bn(T({},Un,{relatedTarget:0})),Qn=Bn(T({},Vn,{animationName:0,elapsedTime:0,pseudoElement:0})),$n=Bn(T({},Vn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),er=Bn(T({},Vn,{data:0})),tr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},nr={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`},rr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function ir(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rr[e])?!!t[e]:!1}function ar(){return ir}var or=Bn(T({},Un,{key:function(e){if(e.key){var t=tr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Ln(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?nr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ar,charCode:function(e){return e.type===`keypress`?Ln(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Ln(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),sr=Bn(T({},Jn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),cr=Bn(T({},Vn,{submitter:0})),lr=Bn(T({},Un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ar})),ur=Bn(T({},Vn,{propertyName:0,elapsedTime:0,pseudoElement:0})),dr=Bn(T({},Jn,{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})),fr=Bn(T({},Vn,{newState:0,oldState:0,source:0})),pr=[9,13,27,32],mr=An&&`CompositionEvent`in window,hr=null;An&&`documentMode`in document&&(hr=document.documentMode);var gr=An&&`TextEvent`in window&&!hr,_r=An&&(!mr||hr&&8<hr&&11>=hr),vr=` `,yr=!1;function br(e,t){switch(e){case`keyup`:return pr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function xr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Sr=!1;function Cr(e,t){switch(e){case`compositionend`:return xr(t);case`keypress`:return t.which===32?(yr=!0,vr):null;case`textInput`:return e=t.data,e===vr&&yr?null:e;default:return null}}function wr(e,t){if(Sr)return e===`compositionend`||!mr&&br(e,t)?(e=In(),Fn=Pn=Nn=null,Sr=!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 _r&&t.locale!==`ko`?null:t.data;default:return null}}var Tr={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 Er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Tr[e.type]:t===`textarea`}function Dr(e,t,n,r){wn?Tn?Tn.push(r):Tn=[r]:wn=r,t=ip(t,`onChange`),0<t.length&&(n=new Hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Or=null,kr=null;function Ar(e){Xf(e,0)}function jr(e){if(rn(P(e)))return e}function Mr(e,t){if(e===`change`)return t}var Nr=!1;if(An){var Pr;if(An){var Fr=`oninput`in document;if(!Fr){var Ir=document.createElement(`div`);Ir.setAttribute(`oninput`,`return;`),Fr=typeof Ir.oninput==`function`}Pr=Fr}else Pr=!1;Nr=Pr&&(!document.documentMode||9<document.documentMode)}function Lr(){Or&&(Or.detachEvent(`onpropertychange`,Rr),kr=Or=null)}function Rr(e){if(e.propertyName===`value`&&jr(kr)){var t=[];Dr(t,kr,e,Cn(e)),On(Ar,t)}}function zr(e,t,n){e===`focusin`?(Lr(),Or=t,kr=n,Or.attachEvent(`onpropertychange`,Rr)):e===`focusout`&&Lr()}function Br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return jr(kr)}function Vr(e,t){if(e===`click`)return jr(t)}function Hr(e,t){if(e===`input`||e===`change`)return jr(t)}function Ur(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Wr=typeof Object.is==`function`?Object.is:Ur;function Gr(e,t){if(Wr(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(!Re.call(t,i)||!Wr(e[i],t[i]))return!1}return!0}function Kr(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 qr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jr(e,t){var n=qr(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=qr(n)}}function Yr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Kr(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=Kr(e.document)}return t}function Zr(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 Qr=An&&`documentMode`in document&&11>=document.documentMode,$r=null,ei=null,ti=null,ni=!1;function ri(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ni||$r==null||$r!==Kr(r)||(r=$r,`selectionStart`in r&&Zr(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}),ti&&Gr(ti,r)||(ti=r,r=ip(ei,`onSelect`),0<r.length&&(t=new Hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=$r)))}function ii(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ai={animationend:ii(`Animation`,`AnimationEnd`),animationiteration:ii(`Animation`,`AnimationIteration`),animationstart:ii(`Animation`,`AnimationStart`),transitionrun:ii(`Transition`,`TransitionRun`),transitionstart:ii(`Transition`,`TransitionStart`),transitioncancel:ii(`Transition`,`TransitionCancel`),transitionend:ii(`Transition`,`TransitionEnd`)},oi={},si={};An&&(si=document.createElement(`div`).style,`AnimationEvent`in window||(delete ai.animationend.animation,delete ai.animationiteration.animation,delete ai.animationstart.animation),`TransitionEvent`in window||delete ai.transitionend.transition);function ci(e){if(oi[e])return oi[e];if(!ai[e])return e;var t=ai[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in si)return oi[e]=t[n];return e}var li=ci(`animationend`),ui=ci(`animationiteration`),di=ci(`animationstart`),fi=ci(`transitionrun`),pi=ci(`transitionstart`),mi=ci(`transitioncancel`),hi=ci(`transitionend`),gi=new Map,_i=`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(` `);_i.push(`scrollEnd`);function vi(e,t){gi.set(e,t),Ht(t,[e])}var yi=0;function bi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=kd.identifierPrefix;var n=yi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function xi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ld;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 Si(e,t){return e=xi(e),t=xi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Ci=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)},wi=[],Ti=0,Ei=0;function Di(){for(var e=Ti,t=Ei=Ti=0;t<e;){var n=wi[t];wi[t++]=null;var r=wi[t];wi[t++]=null;var i=wi[t];wi[t++]=null;var a=wi[t];if(wi[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&&ji(n,i,a)}}function Oi(e,t,n,r){wi[Ti++]=e,wi[Ti++]=t,wi[Ti++]=n,wi[Ti++]=r,Ei|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ki(e,t,n,r){return Oi(e,t,n,r),Mi(e)}function Ai(e,t){return Oi(e,null,null,t),Mi(e)}function ji(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-tt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Mi(e){if(50<Rd)throw Rd=0,zd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ni={};function Pi(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 Fi(e,t,n,r){return new Pi(e,t,n,r)}function Ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Li(e,t){var n=e.alternate;return n===null?(n=Fi(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 Ri(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 zi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ii(r)&&(s=1);else if(typeof r==`string`)s=rh(e,n,Ce.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case se:return e=Fi(31,n,t,a),e.elementType=se,e.lanes=o,e;case k:return Bi(n.children,a,o,t);case ee:s=8,a|=24;break;case te:return e=Fi(12,n,t,a|2),e.elementType=te,e.lanes=o,e;case ie:return e=Fi(13,n,t,a),e.elementType=ie,e.lanes=o,e;case j:return e=Fi(19,n,t,a),e.elementType=j,e.lanes=o,e;case ce:case ue:return e=a|32,e=Fi(30,n,t,e),e.elementType=ue,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case A:s=10;break a;case ne:s=9;break a;case re:s=11;break a;case ae:s=14;break a;case oe:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Fi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Bi(e,t,n,r){return e=Fi(7,e,r,t),e.lanes=n,e}function Vi(e,t,n){return e=Fi(6,e,null,t),e.lanes=n,e}function Hi(e){var t=Fi(18,null,null,0);return t.stateNode=e,t}function Ui(e,t,n){return t=Fi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Wi=new WeakMap;function Gi(e,t){if(typeof e==`object`&&e){var n=Wi.get(e);return n===void 0?(t={value:e,source:t,stack:Le(t)},Wi.set(e,t),t):n}return{value:e,source:t,stack:Le(t)}}var Ki=[],qi=0,Ji=null,Yi=0,Xi=[],Zi=0,Qi=null,$i=1,ea=``;function ta(e,t){Ki[qi++]=Yi,Ki[qi++]=Ji,Ji=e,Yi=t}function na(e,t,n){Xi[Zi++]=$i,Xi[Zi++]=ea,Xi[Zi++]=Qi,Qi=e;var r=$i;e=ea;var i=32-tt(r)-1;r&=~(1<<i),n+=1;var a=32-tt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,$i=1<<32-tt(t)+i|n<<i|r,ea=a+e}else $i=1<<a|n<<i|r,ea=e}function ra(e){e.return!==null&&(ta(e,1),na(e,1,0))}function ia(e){for(;e===Ji;)Ji=Ki[--qi],Ki[qi]=null,Yi=Ki[--qi],Ki[qi]=null;for(;e===Qi;)Qi=Xi[--Zi],Xi[Zi]=null,ea=Xi[--Zi],Xi[Zi]=null,$i=Xi[--Zi],Xi[Zi]=null}function aa(e,t){Xi[Zi++]=$i,Xi[Zi++]=ea,Xi[Zi++]=Qi,$i=t.id,ea=t.overflow,Qi=e}var oa=null,sa=null,F=!1,ca=null,la=!1,ua=Error(i(519));function da(e){throw _a(Gi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ua}function fa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Tt]=e,t[Et]=r,n){case`dialog`:Zf(`cancel`,t),Zf(`close`,t);break;case`iframe`:case`object`:case`embed`:Zf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Yf.length;n++)Zf(Yf[n],t);break;case`source`:Zf(`error`,t);break;case`img`:case`image`:case`link`:Zf(`error`,t),Zf(`load`,t);break;case`details`:Zf(`toggle`,t);break;case`input`:Zf(`invalid`,t),cn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Zf(`invalid`,t);break;case`textarea`:Zf(`invalid`,t),fn(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||lp(t.textContent,n)?(r.popover!=null&&(Zf(`beforetoggle`,t),Zf(`toggle`,t)),r.onScroll!=null&&Zf(`scroll`,t),r.onScrollEnd!=null&&Zf(`scrollend`,t),r.onClick!=null&&(t.onclick=xn),t=!0):t=!1,t||da(e,!0)}function pa(e){for(oa=e.return;oa;)switch(oa.tag){case 5:case 31:case 13:la=!1;return;case 27:case 3:la=!0;return;default:oa=oa.return}}function ma(e){if(e!==oa)return!1;if(!F)return pa(e),F=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Cp(e.type,e.memoizedProps)),n=!n),n&&sa&&da(e),pa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));sa=xm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));sa=xm(e)}else t===27?(t=sa,Mp(e.type)?(e=bm,bm=null,sa=e):sa=t):sa=oa?ym(e.stateNode.nextSibling):null;return!0}function ha(){sa=oa=null,F=!1}function ga(){var e=ca;return e!==null&&(xd===null?xd=e:xd.push.apply(xd,e),ca=null),e}function _a(e){ca===null?ca=[e]:ca.push(e)}var va=be(null),ya=null,ba=null;function xa(e,t,n){Se(va,t._currentValue),t._currentValue=n}function Sa(e){e._currentValue=va.current,xe(va)}function Ca(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 wa(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ca(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ca(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Ca(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ta(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Wr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Ee.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[_h]:e.push(_h))}a=a.return}return e!==null&&wa(t,e,n,r),t.flags|=262144,e!==null}function Ea(e){for(e=e.firstContext;e!==null;){if(!Wr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Da(e){ya=e,ba=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Oa(e){return Aa(ya,e)}function ka(e,t){return ya===null&&Da(e),Aa(e,t)}function Aa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ba===null){if(e===null)throw Error(i(308));ba=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ba=ba.next=t;return n}var ja=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()})}},Ma=t.unstable_scheduleCallback,Na=t.unstable_NormalPriority,Pa={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Fa(){return{controller:new ja,data:new Map,refCount:0}}function Ia(e){e.refCount--,e.refCount===0&&Ma(Na,function(){e.controller.abort()})}function La(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 Ra=null;function za(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ba=null,Va=0,Ha=0,Ua=null;function Wa(e,t){if(Ba===null){var n=Ba=[];Va=0,Ha=Wf(),Ua={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Va++,t.then(Ga,Ga),t}function Ga(){if(--Va===0&&(Ra=null,Ba!==null)){Ua!==null&&(Ua.status=`fulfilled`);var e=Ba;Ba=null,Ha=0,Ua=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ka(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 qa=M.S;M.S=function(e,t){if(wd=Ue(),typeof t==`object`&&t&&typeof t.then==`function`&&Wa(e,t),Ra!==null)for(var n=jf;n!==null;)La(n,Ra),n=n.next;if(n=e.types,n!==null){for(var r=jf;r!==null;)La(r,n),r=r.next;if(Ha!==0){r=Ra,r===null&&(r=Ra=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}qa!==null&&qa(e,t)};var Ja=be(null);function Ya(){var e=Ja.current;return e===null?sd.pooledCache:e}function Xa(e,t){t===null?Se(Ja,Ja.current):Se(Ja,t.pool)}function Za(){var e=Ya();return e===null?null:{parent:Pa._currentValue,pool:e}}var Qa=Error(i(460)),$a=Error(i(474)),eo=Error(i(542)),to={then:function(){}};function no(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ro(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(xn,xn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,so(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(xn,xn);else{if(e=sd,e!==null&&100<e.shellSuspendCounter)throw Error(i(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,so(e),e}throw ao=t,Qa}}function io(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ao=e,Qa):e}}var ao=null;function oo(){if(ao===null)throw Error(i(459));var e=ao;return ao=null,e}function so(e){if(e===Qa||e===eo)throw Error(i(483))}var co=null,lo=0;function uo(e){var t=lo;return lo+=1,co===null&&(co=[]),ro(co,e,t)}function fo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function po(e,t){throw t.$$typeof===E?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function mo(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 a(e,t){return e=Li(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=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=Vi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===k?(e=d(e,t,n.props.children,r,n.key),fo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===oe&&io(i)===t.type)?(t=a(t,n.props),fo(t,n),t.return=e,t):(t=zi(n.type,n.key,n.props,null,e.mode,r),fo(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=Ui(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Bi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Vi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case D:return n=zi(t.type,t.key,t.props,null,e.mode,n),fo(n,t),n.return=e,n;case O:return t=Ui(t,e.mode,n),t.return=e,t;case oe:return t=io(t),f(e,t,n)}if(ge(t)||pe(t))return t=Bi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,uo(t),n);if(t.$$typeof===A)return f(e,ka(e,t),n);po(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 D:return n.key===i?l(e,t,n,r):null;case O:return n.key===i?u(e,t,n,r):null;case oe:return n=io(n),p(e,t,n,r)}if(ge(n)||pe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,uo(n),r);if(n.$$typeof===A)return p(e,t,ka(e,n),r);po(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 D:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case O:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case oe:return r=io(r),m(e,t,n,r,i)}if(ge(r)||pe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,uo(r),i);if(r.$$typeof===A)return m(e,t,n,ka(t,r),i);po(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),F&&ta(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 F&&ta(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)}),F&&ta(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(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(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),F&&ta(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return F&&ta(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,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(a,e)}),F&&ta(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case D:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),fo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===oe&&io(l)===r.type){n(e,r.sibling),c=a(r,o.props),fo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=Bi(o.props.children,e.mode,c,o.key),fo(c,o),c.return=e,e=c):(c=zi(o.type,o.key,o.props,null,e.mode,c),fo(c,o),c.return=e,e=c)}return s(e);case O: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=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ui(o,e.mode,c),c.return=e,e=c}return s(e);case oe:return o=io(o),_(e,r,o,c)}if(ge(o))return h(e,r,o,c);if(pe(o)){if(l=pe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,uo(o),c);if(o.$$typeof===A)return _(e,r,ka(e,o),c);po(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=a(r,o),c.return=e,e=c):(n(e,r),c=Vi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{lo=0;var i=_(e,t,n,r);return co=null,i}catch(t){if(t===Qa||t===eo)throw t;var a=Fi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ho=mo(!0),go=mo(!1),_o=!1;function vo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yo(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 bo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,od&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Mi(e),ji(e,null,n),t}return Oi(e,r,t,n),Mi(e)}function So(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,vt(e,n)}}function Co(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var wo=!1;function To(){if(wo){var e=Ua;if(e!==null)throw e}}function Eo(e,t,n,r){wo=!1;var i=e.updateQueue;_o=!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?(z&f)===f:(r&f)===f){f!==0&&f===Ha&&(wo=!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=T({},d,f);break a;case 2:_o=!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),hd|=o,e.lanes=o,e.memoizedState=d}}function Do(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Oo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Do(n[e],t)}var ko=be(null),Ao=be(0);function jo(e,t){e=pd,Se(Ao,e),Se(ko,t),pd=e|t.baseLanes}function Mo(){Se(Ao,pd),Se(ko,ko.current)}function No(){pd=Ao.current,xe(ko),xe(Ao)}var Po=be(null),Fo=null;function Io(e){var t=e.alternate;Se(Vo,Vo.current&1),Se(Po,e),Fo===null&&(t===null||ko.current!==null||t.memoizedState!==null)&&(Fo=e)}function Lo(e){Se(Vo,Vo.current),Se(Po,e),Fo===null&&(Fo=e)}function Ro(e){e.tag===22?(Se(Vo,Vo.current),Se(Po,e),Fo===null&&(Fo=e)):zo()}function zo(){Se(Vo,Vo.current),Se(Po,Po.current)}function Bo(e){xe(Po),Fo===e&&(Fo=null),xe(Vo)}var Vo=be(0);function Ho(e,t){Se(Po,Po.current),Se(Vo,t)}function Uo(e){xe(Vo),xe(Po),Fo===e&&(Fo=null)}function Wo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||gm(n)||_m(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 Go=0,I=null,Ko=null,qo=null,Jo=!1,Yo=!1,Xo=!1,Zo=0,Qo=0,$o=null,es=0;function ts(){throw Error(i(321))}function ns(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Wr(e[n],t[n]))return!1;return!0}function rs(e,t,n,r,i,a){return Go=a,I=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?bc:xc,Xo=!1,a=n(r,i),Xo=!1,Yo&&(a=as(t,n,r,i)),is(e),a}function is(e){M.H=yc;var t=Ko!==null&&Ko.next!==null;if(Go=0,qo=Ko=I=null,Jo=!1,Qo=0,$o=null,t)throw Error(i(300));e===null||Rc||(e=e.dependencies,e!==null&&Ea(e)&&(Rc=!0))}function as(e,t,n,r){I=e;var a=0;do{if(Yo&&($o=null),Qo=0,Yo=!1,25<=a)throw Error(i(301));if(a+=1,qo=Ko=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=Sc,o=t(n,r)}while(Yo);return o}function os(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?ps(t):t,e=e.useState()[0],(Ko===null?null:Ko.memoizedState)!==e&&(I.flags|=1024),t}function ss(){var e=Zo!==0;return Zo=0,e}function cs(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ls(e){if(Jo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Jo=!1}Go=0,qo=Ko=I=null,Yo=!1,Qo=Zo=0,$o=null}function us(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qo===null?I.memoizedState=qo=e:qo=qo.next=e,qo}function ds(){if(Ko===null){var e=I.alternate;e=e===null?null:e.memoizedState}else e=Ko.next;var t=qo===null?I.memoizedState:qo.next;if(t!==null)qo=t,Ko=e;else{if(e===null)throw I.alternate===null?Error(i(467)):Error(i(310));Ko=e,e={memoizedState:Ko.memoizedState,baseState:Ko.baseState,baseQueue:Ko.baseQueue,queue:Ko.queue,next:null},qo===null?I.memoizedState=qo=e:qo=qo.next=e}return qo}function fs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ps(e){var t=Qo;return Qo+=1,$o===null&&($o=[]),e=ro($o,e,t),t=I,(qo===null?t.memoizedState:qo.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?bc:xc),e}function ms(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ps(e);if(e.$$typeof===de)return;if(e.$$typeof===A)return Oa(e)}throw Error(i(438,String(e)))}function hs(e){var t=null,n=I.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=I.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=fs(),I.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]=le;return t.index++,n}function gs(e,t){return typeof t==`function`?t(e):t}function _s(e){return vs(ds(),Ko,e)}function vs(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Go&f)===f:(z&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===Ha&&(d=!0);else if((Go&p)===p){u=u.next,p===Ha&&(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,I.lanes|=p,hd|=p;f=u.action,Xo&&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,I.lanes|=f,hd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Wr(o,e.memoizedState)&&(Rc=!0,d&&(n=Ua,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ys(e){var t=ds(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Wr(o,t.memoizedState)||(Rc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function bs(e,t,n){var r=I,a=ds(),o=F;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Wr((Ko||a).memoizedState,n);if(s&&(a.memoizedState=n,Rc=!0),a=a.queue,Gs(Cs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||qo!==null&&!!(qo.memoizedState.tag&1),Bs(e?9:8,{destroy:void 0},Ss.bind(null,r,a,n,t),null),e){if(r.flags|=2048,sd===null)throw Error(i(349));o||Go&127||xs(r,t,n)}return n}function xs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=I.updateQueue,t===null?(t=fs(),I.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ss(e,t,n,r){t.value=n,t.getSnapshot=r,ws(t)&&Ts(e)}function Cs(e,t,n){return n(function(){ws(t)&&Ts(e)})}function ws(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Wr(e,n)}catch{return!0}}function Ts(e){var t=Ai(e,2);t!==null&&Ud(t,e,2)}function Es(e){var t=us();if(typeof e==`function`){var n=e;if(e=n(),Xo){et(!0);try{n()}finally{et(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gs,lastRenderedState:e},t}function Ds(e,t,n,r){return e.baseState=n,vs(e,Ko,typeof r==`function`?r:gs)}function Os(e,t,n,r,a){if(gc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,ks(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ks(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};o.types=a===null?null:a.types,M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),As(e,t,s)}catch(n){Ms(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),As(e,t,a)}catch(n){Ms(e,t,n)}}function As(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){js(e,t,n)},function(n){return Ms(e,t,n)}):js(e,t,n)}function js(e,t,n){t.status=`fulfilled`,t.value=n,Ns(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ks(e,n)))}function Ms(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ns(t),t=t.next;while(t!==r)}e.action=null}function Ns(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ps(e,t){return t}function Fs(e,t){if(F){var n=sd.formState;if(n!==null){a:{var r=I;if(F){if(sa){b:{for(var i=sa,a=la;i.nodeType!==8;){if(!a){i=null;break b}if(i=ym(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){sa=ym(i.nextSibling),r=i.data===`F!`;break a}}da(r)}r=!1}r&&(t=n[0])}}return n=us(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ps,lastRenderedState:t},n.queue=r,n=pc.bind(null,I,r),r.dispatch=n,r=Es(!1),a=hc.bind(null,I,!1,r.queue),r=us(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Os.bind(null,I,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Is(e){return Ls(ds(),Ko,e)}function Ls(e,t,n){if(t=vs(e,t,Ps)[0],e=_s(gs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ps(t)}catch(e){throw e===Qa?eo:e}else r=t;t=ds();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(I.flags|=2048,Bs(9,{destroy:void 0},Rs.bind(null,i,n),null)),[r,a,e]}function Rs(e,t){e.action=t}function zs(e){var t=ds(),n=Ko;if(n!==null)return Ls(t,n,e);ds(),t=t.memoizedState,n=ds();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Bs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=I.updateQueue,t===null&&(t=fs(),I.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 Vs(){return ds().memoizedState}function Hs(e,t,n,r){var i=us();I.flags|=e,i.memoizedState=Bs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Us(e,t,n,r){var i=ds();r=r===void 0?null:r;var a=i.memoizedState.inst;Ko!==null&&r!==null&&ns(r,Ko.memoizedState.deps)?i.memoizedState=Bs(t,a,n,r):(I.flags|=e,i.memoizedState=Bs(1|t,a,n,r))}function Ws(e,t){Hs(8390656,8,e,t)}function Gs(e,t){Us(2048,8,e,t)}function Ks(e){I.flags|=4;var t=I.updateQueue;if(t===null)t=fs(),I.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function qs(e){var t=ds().memoizedState;return Ks({ref:t,nextImpl:e}),function(){if(od&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Js(e,t){return Us(4,2,e,t)}function Ys(e,t){return Us(4,4,e,t)}function Xs(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 Zs(e,t,n){n=n==null?null:n.concat([e]),Us(4,4,Xs.bind(null,t,e),n)}function Qs(){}function $s(e,t){var n=ds();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ns(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ec(e,t){var n=ds();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ns(t,r[1]))return r[0];if(r=e(),Xo){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r}function tc(e,t,n){return n===void 0||Go&1073741824&&!(z&261930)?e.memoizedState=t:(e.memoizedState=n,e=Vd(),I.lanes|=e,hd|=e,n)}function nc(e,t,n,r){return Wr(n,t)?n:ko.current===null?!(Go&106)||Go&1073741824&&!(z&261930)?(Rc=!0,e.memoizedState=n):(e=Vd(),I.lanes|=e,hd|=e,t):(e=tc(e,n,r),Wr(e,t)||(Rc=!0),e)}function rc(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};s.types=o===null?null:o.types,M.T=s,hc(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?mc(e,t,Ka(c,r),Bd(e)):mc(e,t,r,Bd(e))}catch(n){mc(e,t,{then:function(){},status:`rejected`,reason:n},Bd())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function ic(){}function ac(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=oc(e).queue;rc(e,a,t,_e,n===null?ic:function(){return sc(e),n(r)})}function oc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:_e,baseState:_e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gs,lastRenderedState:_e},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function sc(e){var t=oc(e);t.next===null&&(t=e.alternate.memoizedState),mc(e,t.next.queue,{},Bd())}function cc(){return Oa(_h)}function lc(){return ds().memoizedState}function uc(){return ds().memoizedState}function dc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Bd();e=bo(n);var r=xo(t,e,n);r!==null&&(Ud(r,t,n),So(r,t,n)),t={cache:Fa()},e.payload=t;return}t=t.return}}function fc(e,t,n){var r=Bd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},gc(e)?_c(t,n):(n=ki(e,t,n,r),n!==null&&(Ud(n,e,r),vc(n,t,r)))}function pc(e,t,n){mc(e,t,n,Bd())}function mc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(gc(e))_c(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,Wr(s,o))return Oi(e,t,i,0),sd===null&&Di(),!1}catch{}if(n=ki(e,t,i,r),n!==null)return Ud(n,e,r),vc(n,t,r),!0}return!1}function hc(e,t,n,r){if(r={lane:2,revertLane:Wf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},gc(e)){if(t)throw Error(i(479))}else t=ki(e,n,r,2),t!==null&&Ud(t,e,2)}function gc(e){var t=e.alternate;return e===I||t!==null&&t===I}function _c(e,t){Yo=Jo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vt(e,n)}}var yc={readContext:Oa,use:ms,useCallback:ts,useContext:ts,useEffect:ts,useImperativeHandle:ts,useLayoutEffect:ts,useInsertionEffect:ts,useMemo:ts,useReducer:ts,useRef:ts,useState:ts,useDebugValue:ts,useDeferredValue:ts,useTransition:ts,useSyncExternalStore:ts,useId:ts,useHostTransitionStatus:ts,useFormState:ts,useActionState:ts,useOptimistic:ts,useMemoCache:ts,useCacheRefresh:ts,useEffectEvent:ts},bc={readContext:Oa,use:ms,useCallback:function(e,t){return us().memoizedState=[e,t===void 0?null:t],e},useContext:Oa,useEffect:Ws,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Hs(4194308,4,Xs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Hs(4194308,4,e,t)},useInsertionEffect:function(e,t){Hs(4,2,e,t)},useMemo:function(e,t){var n=us();t=t===void 0?null:t;var r=e();if(Xo){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=us();if(n!==void 0){var i=n(t);if(Xo){et(!0);try{n(t)}finally{et(!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=fc.bind(null,I,e),[r.memoizedState,e]},useRef:function(e){var t=us();return e={current:e},t.memoizedState=e},useState:function(e){e=Es(e);var t=e.queue,n=pc.bind(null,I,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Qs,useDeferredValue:function(e,t){return tc(us(),e,t)},useTransition:function(){var e=Es(!1);return e=rc.bind(null,I,e.queue,!0,!1),us().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=I,a=us();if(F){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),sd===null)throw Error(i(349));z&127||xs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ws(Cs.bind(null,r,o,e),[e]),r.flags|=2048,Bs(9,{destroy:void 0},Ss.bind(null,r,o,n,t),null),n},useId:function(){var e=us(),t=sd.identifierPrefix;if(F){var n=ea,r=$i;n=(r&~(1<<32-tt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Zo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=es++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:cc,useFormState:Fs,useActionState:Fs,useOptimistic:function(e){var t=us();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=hc.bind(null,I,!0,n),n.dispatch=t,[e,t]},useMemoCache:hs,useCacheRefresh:function(){return us().memoizedState=dc.bind(null,I)},useEffectEvent:function(e){var t=us(),n={impl:e};return t.memoizedState=n,function(){if(od&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},xc={readContext:Oa,use:ms,useCallback:$s,useContext:Oa,useEffect:Gs,useImperativeHandle:Zs,useInsertionEffect:Js,useLayoutEffect:Ys,useMemo:ec,useReducer:_s,useRef:Vs,useState:function(){return _s(gs)},useDebugValue:Qs,useDeferredValue:function(e,t){return nc(ds(),Ko.memoizedState,e,t)},useTransition:function(){var e=_s(gs)[0],t=ds().memoizedState;return[typeof e==`boolean`?e:ps(e),t]},useSyncExternalStore:bs,useId:lc,useHostTransitionStatus:cc,useFormState:Is,useActionState:Is,useOptimistic:function(e,t){return Ds(ds(),Ko,e,t)},useMemoCache:hs,useCacheRefresh:uc,useEffectEvent:qs},Sc={readContext:Oa,use:ms,useCallback:$s,useContext:Oa,useEffect:Gs,useImperativeHandle:Zs,useInsertionEffect:Js,useLayoutEffect:Ys,useMemo:ec,useReducer:ys,useRef:Vs,useState:function(){return ys(gs)},useDebugValue:Qs,useDeferredValue:function(e,t){var n=ds();return Ko===null?tc(n,e,t):nc(n,Ko.memoizedState,e,t)},useTransition:function(){var e=ys(gs)[0],t=ds().memoizedState;return[typeof e==`boolean`?e:ps(e),t]},useSyncExternalStore:bs,useId:lc,useHostTransitionStatus:cc,useFormState:zs,useActionState:zs,useOptimistic:function(e,t){var n=ds();return Ko===null?(n.baseState=e,[e,n.queue.dispatch]):Ds(n,Ko,e,t)},useMemoCache:hs,useCacheRefresh:uc,useEffectEvent:qs};function Cc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var wc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Bd(),i=bo(r);i.payload=t,n!=null&&(i.callback=n),t=xo(e,i,r),t!==null&&(Ud(t,e,r),So(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Bd(),i=bo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=xo(e,i,r),t!==null&&(Ud(t,e,r),So(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Bd(),r=bo(n);r.tag=2,t!=null&&(r.callback=t),t=xo(e,r,n),t!==null&&(Ud(t,e,n),So(t,e,n))}};function Tc(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?!Gr(n,r)||!Gr(i,a):!0}function Ec(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&&wc.enqueueReplaceState(t,t.state,null)}function Dc(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=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Oc(e){Ci(e)}function kc(e){console.error(e)}function Ac(e){Ci(e)}function jc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Mc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Nc(e,t,n){return n=bo(n),n.tag=3,n.payload={element:null},n.callback=function(){jc(e,t)},n}function Pc(e){return e=bo(e),e.tag=3,e}function Fc(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(){Mc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Mc(t,n,r),typeof i!=`function`&&(Dd===null?Dd=new Set([this]):Dd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ic(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ta(t,n,a,!0),n=Po.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Fo===null?tf():n.alternate===null&&md===0&&(md=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===to?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Tf(e,r,a)),!1;case 22:return n.flags|=65536,r===to?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)),Tf(e,r,a)),!1}throw Error(i(435,n.tag))}return Tf(e,r,a),tf(),!1}if(F)return t=Po.current,t===null?(r!==ua&&(t=Error(i(423),{cause:r}),_a(Gi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Gi(r,n),a=Nc(e.stateNode,r,a),Co(e,a),md!==4&&(md=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ua&&(e=Error(i(422),{cause:r}),_a(Gi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Gi(o,n),bd===null?bd=[o]:bd.push(o),md!==4&&(md=2),t===null)return!0;r=Gi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Nc(n.stateNode,r,e),Co(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`&&(Dd===null||!Dd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Pc(a),Fc(a,e,n,r),Co(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Lc=Error(i(461)),Rc=!1;function zc(e,t,n,r){t.child=e===null?go(t,null,n,r):ho(t,e.child,n,r)}function Bc(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 Da(t),r=rs(e,t,n,o,a,i),s=ss(),e!==null&&!Rc?(cs(e,t,i),ml(e,t,i)):(F&&s&&ra(t),t.flags|=1,zc(e,t,r,i),t.child)}function Vc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Hc(e,t,a,r,i)):(e=zi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!hl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Gr:n,n(o,r)&&e.ref===t.ref)return ml(e,t,i)}return t.flags|=1,e=Li(a,r),e.ref=t.ref,e.return=t,t.child=e}function Hc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Gr(a,r)&&e.ref===t.ref){if(Rc=!1,t.pendingProps=r=a,hl(e,i))e.flags&131072&&(Rc=!0);else return t.lanes=e.lanes,ml(e,t,i)}}return Xc(e,t,n,r,i)}function Uc(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 Gc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Xa(t,a===null?null:a.cachePool),a===null?Mo():jo(t,a),Ro(t);else return r=t.lanes=536870912,Gc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Xa(t,null),Mo(),zo()):(Xa(t,a.cachePool),jo(t,a),zo(),t.memoizedState=null);return zc(e,t,i,n),t.child}function Wc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Gc(e,t,n,r,i){var a=Ya();return a=a===null?null:{parent:Pa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Xa(t,null),Mo(),Ro(t),e!==null&&Ta(e,t,r,!0),t.childLanes=i,null}function Kc(e,t){return t=al({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function qc(e,t,n){return ho(t,e.child,null,n),e=Kc(t,t.pendingProps),e.flags|=2,Bo(t),t.memoizedState=null,e}function Jc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(F){if(r.mode===`hidden`)return e=Kc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Wc(null,e);if(Lo(t),(e=sa)?(e=hm(e,la),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qi===null?null:{id:$i,overflow:ea},retryLane:536870912,hydrationErrors:null},n=Hi(e),n.return=t,t.child=n,oa=t,sa=null)):e=null,e===null)throw da(t);return t.lanes=536870912,null}return Kc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Lo(t),a){if(t.flags&256)t.flags&=-257,t=qc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Rc||Ta(e,t,n,!1),a=(n&e.childLanes)!==0,Rc||a){if(ko.current===null){if(r=sd,r!==null&&(s=yt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ai(e,s),Ud(r,e,s),Lc;tf()}t=qc(e,t,n)}else e=o.treeContext,sa=ym(s.nextSibling),oa=t,F=!0,ca=null,la=!1,e!==null&&aa(t,e),t=Kc(t,r),t.flags|=134221824;return t}return e=Li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Yc(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(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Xc(e,t,n,r,i){return Da(t),n=rs(e,t,n,r,void 0,i),r=ss(),e!==null&&!Rc?(cs(e,t,i),ml(e,t,i)):(F&&r&&ra(t),t.flags|=1,zc(e,t,n,i),t.child)}function Zc(e,t,n,r,i,a){return Da(t),t.updateQueue=null,n=as(t,r,n,i),is(e),r=ss(),e!==null&&!Rc?(cs(e,t,a),ml(e,t,a)):(F&&r&&ra(t),t.flags|=1,zc(e,t,n,a),t.child)}function Qc(e,t,n,r,i){if(Da(t),t.stateNode===null){var a=Ni,o=n.contextType;typeof o==`object`&&o&&(a=Oa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=wc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},vo(t),o=n.contextType,a.context=typeof o==`object`&&o?Oa(o):Ni,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Cc(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&&wc.enqueueReplaceState(a,a.state,null),Eo(t,r,a,i),To(),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=Dc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ni,typeof u==`object`&&u&&(o=Oa(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)&&Ec(t,a,r,o),_o=!1;var f=t.memoizedState;a.state=f,Eo(t,r,a,i),To(),l=t.memoizedState,s||f!==l||_o?(typeof d==`function`&&(Cc(t,n,d,r),l=t.memoizedState),(c=_o||Tc(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,yo(e,t),o=t.memoizedProps,u=Dc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ni,typeof l==`object`&&l&&(c=Oa(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)&&Ec(t,a,r,c),_o=!1,f=t.memoizedState,a.state=f,Eo(t,r,a,i),To();var p=t.memoizedState;o!==d||f!==p||_o||e!==null&&e.dependencies!==null&&Ea(e.dependencies)?(typeof s==`function`&&(Cc(t,n,s,r),p=t.memoizedState),(u=_o||Tc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ea(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,Yc(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=ho(t,e.child,null,i),t.child=ho(t,null,n,i)):zc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ml(e,t,i),e}function $c(e,t,n,r){return ha(),t.flags|=256,zc(e,t,n,r),t.child}var el={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tl(e){return{baseLanes:e,cachePool:Za()}}function nl(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=vd),e}function rl(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Vo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(F){if(i?Io(t):zo(),(e=sa)?(e=hm(e,la),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qi===null?null:{id:$i,overflow:ea},retryLane:536870912,hydrationErrors:null},n=Hi(e),n.return=t,t.child=n,oa=t,sa=null)):e=null,e===null)throw da(t);return t.lanes=_m(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(zo(),i=t.mode,a=al({mode:`hidden`,children:a},i),r=Bi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=tl(n),r.childLanes=nl(e,o,n),t.memoizedState=el,Wc(null,r)):(Io(t),il(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return sl(e,t,a,o,r,c,s,n)}return i?(zo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Li(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Bi(i,a,n,null),i.flags|=2):i=Li(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Wc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=tl(n):(a=i.cachePool,a===null?a=Za():(s=Pa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=nl(e,o,n),t.memoizedState=el,Wc(e.child,r)):(Io(t),n=e.child,e=n.sibling,n=Li(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 il(e,t){return t=al({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function al(e,t){return e=Fi(22,e,null,t),e.lanes=0,e}function ol(e,t,n){return ho(t,e.child,null,n),e=il(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Io(t),t.flags&=-257,ol(e,t,c)):t.memoizedState===null?(zo(),o=a.fallback,s=t.mode,a=al({mode:`visible`,children:a.children},s),o=Bi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,ho(t,e.child,null,c),a=t.child,a.memoizedState=tl(c),a.childLanes=nl(e,r,c),t.memoizedState=el,Wc(null,a)):(zo(),t.child=e.child,t.flags|=128,null);if(Io(t),_m(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,_a({value:a,source:null,stack:null})),ol(e,t,c)}if(Rc||Ta(e,t,c,!1),r=(c&e.childLanes)!==0,Rc||r){if(ko.current!==null)return ol(e,t,c);if(r=sd,r!==null&&(a=yt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ai(e,a),Ud(r,e,a),Lc;return gm(o)||tf(),ol(e,t,c)}return gm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,sa=ym(o.nextSibling),oa=t,F=!0,ca=null,la=!1,e!==null&&aa(t,e),t=il(t,a.children),t.flags|=134221824,t)}function cl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ca(e.return,t,n)}function ll(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Wo(n)===null&&(t=e),e=e.sibling}return t}function ul(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 dl(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 fl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Vo.current;if(t.flags&128)return Ho(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Ho(t,o),i===`backwards`&&e!==null?(dl(e),zc(e,t,r,n),dl(e)):zc(e,t,r,n),r=F?Yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cl(e,n,t);else if(e.tag===19)cl(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=ll(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,dl(t)),ul(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&&Wo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ul(t,!0,n,null,a,r);break;case`together`:ul(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=ll(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ul(t,!1,i,n,a,r)}return t.child}function pl(e,t,n){var r=t.pendingProps;return xa(t,t.type,r.value),zc(e,t,r.children,n),t.child}function ml(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),hd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ta(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function hl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ea(e)))}function gl(e,t,n){switch(t.tag){case 3:De(t,t.stateNode.containerInfo),xa(t,Pa,e.memoizedState.cache),ha();break;case 27:case 5:ke(t);break;case 4:De(t,t.stateNode.containerInfo);break;case 10:xa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Lo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Io(t),t.flags|=128,null;r=Ta(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?rl(e,t,n):(Io(t),e=ml(e,t,n),e===null?null:e.sibling)}Io(t);break;case 19:if(t.flags&128)return fl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ta(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return fl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ho(t,Vo.current),r)break;return null;case 22:return t.lanes=0,Uc(e,t,n,t.pendingProps);case 24:xa(t,Pa,e.memoizedState.cache)}return ml(e,t,n)}function _l(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Rc=!0;else{if(!hl(e,n)&&!(t.flags&128))return Rc=!1,gl(e,t,n);Rc=!!(e.flags&131072)}}else Rc=!1,F&&t.flags&1048576&&na(t,Yi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=io(t.elementType),t.type=e,typeof e==`function`)Ii(e)?(r=Dc(e,r),t.tag=1,t=Qc(null,t,e,r,n)):(t.tag=0,t=Xc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===re){t.tag=11,t=Bc(null,t,e,r,n);break a}if(a===ae){t.tag=14,t=Vc(null,t,e,r,n);break a}if(a===A){t.tag=10,t.type=e,t=pl(null,t,n);break a}}throw t=he(e)||e,Error(i(306,t,``))}}return t;case 0:return Xc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Dc(r,t.pendingProps),Qc(e,t,r,a,n);case 3:a:{if(De(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,yo(e,t),Eo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,xa(t,Pa,r),r!==o.cache&&wa(t,[Pa],n,!0),To(),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=$c(e,t,r,n);break a}if(r!==a){a=Gi(Error(i(424)),t),_a(a),t=$c(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(sa=ym(e.firstChild),oa=t,F=!0,ca=null,la=!0,n=go(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ha(),r===a){t=ml(e,t,n);break a}zc(e,t,r,n)}t=t.child}return t;case 26:return Yc(e,t),e===null?(n=Um(t.type,null,t.pendingProps,null))?t.memoizedState=n:F||(t.stateNode=Sp(t.type,t.pendingProps,Te.current,t)):t.memoizedState=Um(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ke(t),e===null&&F&&(r=t.stateNode=Tm(t.type,t.pendingProps,Te.current),oa=t,la=!0,a=sa,Mp(t.type)?(bm=a,sa=ym(r.firstChild)):sa=a),zc(e,t,t.pendingProps.children,n),Yc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&F&&((a=r=sa)&&(r=pm(r,t.type,t.pendingProps,la),r===null?a=!1:(t.stateNode=r,oa=t,sa=ym(r.firstChild),la=!1,a=!0)),a||da(t)),ke(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Cp(a,o)?r=null:s!==null&&Cp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=rs(e,t,os,null,null,n),_h._currentValue=a),Yc(e,t),zc(e,t,r,n),t.child;case 6:return e===null&&F&&((e=n=sa)&&(n=mm(n,t.pendingProps,la),n===null?e=!1:(t.stateNode=n,oa=t,sa=null,e=!0)),e||da(t)),null;case 13:return rl(e,t,n);case 4:return De(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ho(t,null,r,n):zc(e,t,r,n),t.child;case 11:return Bc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Yc(e,t),zc(e,t,r,n),t.child;case 8:return zc(e,t,t.pendingProps.children,n),t.child;case 12:return zc(e,t,t.pendingProps.children,n),t.child;case 10:return pl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Da(t),a=Oa(a),r=r(a),t.flags|=1,zc(e,t,r,n),t.child;case 14:return Vc(e,t,t.type,t.pendingProps,n);case 15:return Hc(e,t,t.type,t.pendingProps,n);case 19:return fl(e,t,n);case 31:return Jc(e,t,n);case 22:return Uc(e,t,n,t.pendingProps);case 24:return Da(t),r=Oa(Pa),e===null?(a=Ya(),a===null&&(a=sd,o=Fa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},vo(t),xa(t,Pa,a)):((e.lanes&n)!==0&&(yo(e,t),Eo(t,null,null,n),To()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,xa(t,Pa,r),r!==a.cache&&wa(t,[Pa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),xa(t,Pa,r))),zc(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:F&&ra(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Yc(e,t),zc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function vl(e){e.flags|=4}function yl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?ih(t,r):ih(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(Qd())e.flags|=8192;else throw ao=to,$a}}else e.flags&=-16777217}function bl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ah(t)){if(Qd())e.flags|=8192;else throw ao=to,$a}}function xl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:pt(),e.lanes|=t,yd|=t)}function Sl(e,t){if(!F)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 Cl(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 wl(e,t,n){var r=t.pendingProps;switch(ia(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Cl(t),null;case 1:return Cl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Sa(Pa),Oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ma(t)?vl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ga())),Cl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(vl(t),o===null?(Cl(t),yl(t,a,null,r,n)):(Cl(t),bl(t,o))):o?o===e.memoizedState?(Cl(t),t.flags&=-16777217):(vl(t),Cl(t),bl(t,o)):(e=e.memoizedProps,e!==r&&vl(t),Cl(t),yl(t,a,e,r,n)),null;case 27:if(Ae(t),n=Te.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&vl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Cl(t),t.subtreeFlags&=-33554433,null}e=Ce.current,ma(t)?fa(t,e):(e=Tm(a,r,n),t.stateNode=e,vl(t))}return Cl(t),t.subtreeFlags&=-33554433,null;case 5:if(Ae(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&vl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Cl(t),t.subtreeFlags&=-33554433,null}if(o=Ce.current,ma(t))fa(t,o);else{var s=yp(Te.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);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(a,{is:r.is}):s.createElement(a)}}o[Tt]=t,o[Et]=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(fp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&vl(t)}}return Cl(t),t.subtreeFlags&=-33554433,yl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&vl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Te.current,ma(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=oa,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Tt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||lp(e.nodeValue,n)),e||da(t,!0)}else e=yp(e).createTextNode(r),e[Tt]=t,t.stateNode=e}return Cl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ma(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[Tt]=t}else ha(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cl(t),e=!1}else n=ga(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Bo(t),t):(Bo(t),null);if(t.flags&128)throw Error(i(558))}return Cl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ma(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[Tt]=t}else ha(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cl(t),a=!1}else a=ga(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Bo(t),t):(Bo(t),null)}return Bo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),xl(t,t.updateQueue),Cl(t),null);case 4:return Oe(),e===null&&ep(t.stateNode.containerInfo),t.flags|=67108864,Cl(t),null;case 10:return Sa(t.type),Cl(t),null;case 19:if(Uo(t),r=t.memoizedState,r===null)return Cl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Sl(r,!1);else{if(md!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Wo(e),o!==null){for(t.flags|=128,Sl(r,!1),e=o.updateQueue,t.updateQueue=e,xl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ri(n,e),n=n.sibling;return Ho(t,Vo.current&1|2),F&&ta(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ue()>Td&&(t.flags|=128,a=!0,Sl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Wo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,xl(t,e),Sl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!F)return Cl(t),null}else 2*Ue()-r.renderingStartTime>Td&&n!==536870912&&(t.flags|=128,a=!0,Sl(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=Ue(),e.sibling=null,o=Vo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||F?Ho(t,o):(n=o,Se(Po,t),Se(Vo,n),Fo===null&&(Fo=t)),F&&ta(t,r.treeForkCount),e}return Cl(t),null;case 22:case 23:return Bo(t),No(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Cl(t),t.subtreeFlags&6&&(t.flags|=8192)):Cl(t),n=t.updateQueue,n!==null&&xl(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&&xe(Ja),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Sa(Pa),Cl(t),null;case 25:return null;case 30:return t.flags|=33554432,Cl(t),null}throw Error(i(156,t.tag))}function Tl(e,t){switch(ia(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Sa(Pa),Oe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ae(t),null;case 31:if(t.memoizedState!==null){if(Bo(t),t.alternate===null)throw Error(i(340));ha()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Bo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ha()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Uo(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 Oe(),null;case 10:return Sa(t.type),null;case 22:case 23:return Bo(t),No(),e!==null&&xe(Ja),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Sa(Pa),null;case 25:return null;default:return null}}function El(e,t){switch(ia(t),t.tag){case 3:Sa(Pa),Oe();break;case 26:case 27:case 5:Ae(t);break;case 4:Oe();break;case 31:t.memoizedState!==null&&Bo(t);break;case 13:Bo(t);break;case 19:Uo(t);break;case 10:Sa(t.type);break;case 22:case 23:Bo(t),No(),e!==null&&xe(Ja);break;case 24:Sa(Pa)}}function Dl(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){wf(t,t.return,e)}}function Ol(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){wf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){wf(t,t.return,e)}}function kl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Oo(t,n)}catch(t){wf(e,e.return,t)}}}function Al(e,t,n){n.props=Dc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){wf(e,t,n)}}function jl(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=bi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Wp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Gp(e);f(e.child,!1,cm,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){wf(e,t,n)}}function Ml(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){wf(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){wf(e,t,n)}else n.current=null}}function Nl(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++)um(e.stateNode,t[n])}function Pl(e){for(var t=e.return;t!==null&&(Ll(t)&&um(e.stateNode,t.stateNode),!Il(t));)t=t.return}function Fl(e){for(var t=e.return;t!==null&&(Ll(t)&&dm(e.stateNode,t.stateNode),!Il(t));)t=t.return}function Il(e){return e.tag===5||e.tag===3||e.tag===27}function Ll(e){return e&&e.tag===7&&e.stateNode!==null}function Rl(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){wf(e,e.return,t)}}function zl(e,t,n){try{var r=e.stateNode;mp(r,e.type,n,t),r[Et]=t}catch(t){wf(e,e.return,t)}}function Bl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Mp(e.type)||e.tag===4}function Vl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Bl(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&&Mp(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 Hl(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=xn)),Nl(e,r),Jt=!0;else if(i!==4&&(i===27&&(Nl(e,r),r=null,Mp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Hl(e,t,n,r),e=e.sibling;e!==null;)Hl(e,t,n,r),e=e.sibling}function Ul(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Nl(e,r),Jt=!0;else if(i!==4&&(i===27&&(Nl(e,r),r=null,Mp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ul(e,t,n,r),e=e.sibling;e!==null;)Ul(e,t,n,r),e=e.sibling}function Wl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);fp(t,r,n),t[Tt]=e,t[Et]=n}catch(t){wf(e,e.return,t)}}var Gl=!1,Kl=null;function ql(e){(e.tag===30||e.subtreeFlags&33554432)&&(Gl=!0)}var L=null;function Jl(){var e=L;return L=null,e}var Yl=0;function Xl(e,t,n,r,i){return Yl=0,Zl(e.child,t,n,r,i)}function Zl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Rp(o);r.push(s),s.view&&(a=!0)}else a||Rp(o).view&&(a=!0);Gl=!0,Fp(o,Yl===0?t:t+`_`+Yl,n),Yl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Zl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Ql(e,t){for(;e!==null;)e.tag===5?Ip(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Ql(e.child,t)),e=e.sibling}function $l(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&($l(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=Si(t.default,t.share),t!==`none`&&(Xl(e,n,t,null,!1)||Ql(e.child,!1))}e=e.sibling}}function eu(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=bi(r,n),a=Si(r.default,n.paired?r.share:r.enter);a===`none`?$l(e):Xl(e,i,a,null,!1)?($l(e),n.paired||t||Hd(e,r.onEnter)):Ql(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)eu(e,t),e=e.sibling;else $l(e)}function tu(e){if(Kl!==null&&Kl.size!==0){var t=Kl;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=Si(n.default,n.share);if(a!==`none`&&(Xl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Hd(e,n.onShare)):Ql(e.child,!1)),t.delete(r),t.size===0)break}}}tu(e)}e=e.sibling}}}function nu(e){if(e.tag===30){var t=e.memoizedProps,n=bi(t,e.stateNode),r=Kl===null?void 0:Kl.get(n),i=Si(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Xl(e,n,i,null,!1)?r===void 0?Hd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Kl.delete(n),Hd(e,t.onShare)):Ql(e.child,!1)),Kl!==null&&tu(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)nu(e),e=e.sibling;else Kl!==null&&tu(e)}function ru(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=bi(t,e.stateNode);t=Si(t.default,t.update),e.flags&=-5,t!==`none`&&Xl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&ru(e);e=e.sibling}}function iu(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,Ql(e.child,!1))}iu(e)}e=e.sibling}}function au(e){if(e.tag===30)e.stateNode.paired=null,Ql(e.child,!1),iu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)au(e),e=e.sibling;else iu(e)}function ou(e){for(e=e.child;e!==null;)e.tag===30?Ql(e.child,!1):e.subtreeFlags&33554432&&ou(e),e=e.sibling}function su(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Yl<a.length){var l=a[Yl],u=Rp(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&&Fp(c,Yl===0?n:n+`_`+Yl,i),s&&e.flags&4||(L===null&&(L=[]),L.push(c,Yl===0?r:r+`_`+Yl,t.memoizedProps)),Yl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:su(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function cu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=bi(n,r),a=Si(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(zp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Yl=0,i=su(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Hd(e,n.onUpdate))}else e.subtreeFlags&33554432&&cu(e,t);e=e.sibling}}var lu=!1,uu=!1,du=!1,fu=!1,pu=typeof WeakSet==`function`?WeakSet:Set,mu=null,hu=!1,gu=!1,_u=!1,vu=!1;function yu(e,t,n){if(e=e.containerInfo,_p=Eh,e=Xr(e),Zr(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(vp={focusedElem:e,selectionRange:r},Eh=!1,n=(n&335544064)===n,mu=t,t=n?9270:1024;mu!==null;){if(e=mu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&nu(r[a]);if(e.alternate===null&&e.flags&2)n&&ql(e),bu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&nu(r),bu(n);continue}if(r!==null&&r.memoizedState!==null){n&&ql(e),bu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,mu=r):(n&&ru(e),bu(n))}}Kl=null}function bu(e){for(;mu!==null;){var t=mu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Dc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){wf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)fm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:fm(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=bi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=Si(a.default,a.update),a!==`none`&&Xl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,mu=r;break}mu=t.return}}function xu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Vu(e,n),r&4&&Dl(5,n);break;case 1:if(Vu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){wf(n,n.return,e)}else{var i=Dc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){wf(n,n.return,e)}}}r&64&&kl(n),r&512&&jl(n,n.return);break;case 3:if(Vu(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{Oo(e,t)}catch(e){wf(n,n.return,e)}}break;case 27:t===null&&r&4&&Wl(n);case 26:case 5:Vu(e,n),t===null&&r&4&&Rl(n),r&512&&jl(n,n.return);break;case 12:Vu(e,n);break;case 31:Vu(e,n),r&4&&Au(e,n);break;case 13:Vu(e,n),r&4&&ju(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Of.bind(null,n),vm(e,n))));break;case 22:if(r=n.memoizedState!==null||lu,!r){var a=t!==null&&t.memoizedState!==null||uu;t=lu,i=uu,lu=r,(uu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Uu(e,n,r)):Vu(e,n),lu=t,uu=i}break;case 30:Vu(e,n),r&512&&jl(n,n.return);break;case 7:r&512&&jl(n,n.return);default:Vu(e,n)}}function Su(e,t){for(e=e.child;e!==null;)Cu(e,t),e=e.sibling}function Cu(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){wf(e,e.return,t)}wu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Jt=!0}catch(t){wf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Pp(s,!0):Pp(e.stateNode,!1)}catch(t){wf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&Su(e,t);break;default:Su(e,t)}}function wu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:Cu(n,r);break a;case 22:n.memoizedState===null&&wu(n,r);break a;default:wu(n,r)}}e=e.sibling}}function Tu(e){var t=e.alternate;t!==null&&(e.alternate=null,Tu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Pt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Eu=null,Du=!1;function Ou(e,t,n){for(n=n.child;n!==null;)ku(e,t,n),n=n.sibling}function ku(e,t,n){if($e&&typeof $e.onCommitFiberUnmount==`function`)try{$e.onCommitFiberUnmount(Qe,n)}catch{}switch(n.tag){case 26:uu||Ml(n,t),Ou(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!uu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:uu||Ml(n,t),Fl(n);var r=Eu,i=Du;Mp(n.type)&&(Eu=n.stateNode,Du=!1),Ou(e,t,n),Em(n.stateNode,n.type,n.memoizedProps),Eu=r,Du=i;break;case 5:uu||Ml(n,t),Fl(n);case 6:if(n.tag===6&&Fl(n),r=Eu,i=Du,Eu=null,Ou(e,t,n),Eu=r,Du=i,Eu!==null){if(Du)try{(Eu.nodeType===9?Eu.body:Eu.nodeName===`HTML`?Eu.ownerDocument.body:Eu).removeChild(n.stateNode),Jt=!0}catch(e){wf(n,t,e)}else try{Eu.removeChild(n.stateNode),Jt=!0}catch(e){wf(n,t,e)}}break;case 18:Eu!==null&&(Du?(e=Eu,Np(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Qh(e)):Np(Eu,n.stateNode));break;case 4:r=Eu,i=Du,Eu=n.stateNode.containerInfo,Du=!0,Ou(e,t,n),Eu=r,Du=i;break;case 0:case 11:case 14:case 15:Ol(2,n,t),uu||Ol(4,n,t),Ou(e,t,n);break;case 1:uu||(Ml(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Al(n,t,r)),Ou(e,t,n);break;case 21:Ou(e,t,n);break;case 22:uu=(r=uu)||n.memoizedState!==null,Ou(e,t,n),uu=r;break;case 30:Ml(n,t),Ou(e,t,n);break;case 7:uu||Ml(n,t),Ou(e,t,n);break;default:Ou(e,t,n)}}function Au(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Qh(e)}catch(e){wf(t,t.return,e)}}}function ju(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Qh(e)}catch(e){wf(t,t.return,e)}}function Mu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new pu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new pu),t;default:throw Error(i(435,e.tag))}}function Nu(e,t){var n=Mu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=kf.bind(null,e,t);t.then(r,r)}})}function Pu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Mp(l.type)){Eu=l.stateNode,Du=!1;break a}break;case 5:Eu=l.stateNode,Du=!1;break a;case 3:case 4:Eu=l.stateNode.containerInfo,Du=!0;break a}l=l.return}if(Eu===null)throw Error(i(160));ku(s,c,o),Eu=null,Du=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Iu(t,e,n),t=t.sibling}var Fu=null;function Iu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&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}Pu(t,e,n),Lu(e),a&4&&(Ol(3,e,e.return),Dl(3,e),Ol(5,e,e.return));break;case 1:Pu(t,e,n),Lu(e),a&512&&(uu||r===null||Ml(r,r.return)),a&64&&lu&&(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=Fu,Pu(t,e,n),Lu(e),a&512&&(uu||r===null||Ml(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(lu)e.stateNode=Sp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Mt]||r[Tt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),fp(r,t,n),r[Tt]=e,Rt(r),t=r;break a;case`link`:if(o=th(`link`,`href`,a).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=a.createElement(t),fp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=th(`meta`,`content`,a).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=a.createElement(t),fp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Tt]=e,Rt(r),t=r}e.stateNode=t}}else lu||nh(o,e.type,e.stateNode)}else e.stateNode=Xm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&zl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||uu||t.parentNode.removeChild(t)):a.count--,n===null?lu||nh(o,e.type,e.stateNode):Xm(o,n,e.memoizedProps))}break;case 27:Pu(t,e,n),Lu(e),a&512&&(uu||r===null||Ml(r,r.return)),r!==null&&a&4&&zl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=du,du=!1,Pu(t,e,n),du=o,Lu(e),a&512&&(uu||r===null||Ml(r,r.return)),e.flags&32){t=e.stateNode;try{pn(t,``),Jt=!0}catch(t){wf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,zl(e,t,r===null?t:r.memoizedProps)),a&1024&&(fu=!0);break;case 6:if(Pu(t,e,n),Lu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Jt=!0}catch(t){wf(e,e.return,t)}}break;case 3:if(Jt=!1,eh=null,o=Fu,Fu=Am(t.containerInfo),Pu(t,e,n),Fu=o,Lu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Qh(t.containerInfo)}catch(t){wf(e,e.return,t)}fu&&(fu=!1,Ru(e)),Jt=!1;break;case 4:a=du,du=lu,r=Yt(),o=Fu,Fu=Am(e.stateNode.containerInfo),Pu(t,e,n),Lu(e),Fu=o,Jt&&gu&&(_u=!0),Jt=r,du=a;break;case 12:Pu(t,e,n),Lu(e);break;case 31:Pu(t,e,n),Lu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Nu(e,t)));break;case 13:Pu(t,e,n),Lu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Cd=Ue()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Nu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=lu,l=uu,u=du;lu=c||o,du=u||o,uu=l||s,Pu(t,e,n),uu=l,du=u,lu=c,Lu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||lu||uu||(t=s||uu,n=lu,r=uu,lu=o||lu,uu=t,Hu(e,2),lu=n,uu=r),!o&&du||Su(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Nu(e,n))));break;case 19:Pu(t,e,n),Lu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Nu(e,t)));break;case 30:a&512&&(uu||r===null||Ml(r,r.return)),a=Yt(),o=gu,s=(n&335544064)===n,c=e.memoizedProps,gu=s&&Si(c.default,c.update)!==`none`,Pu(t,e,n),Lu(e),s&&r!==null&&Jt&&(e.flags|=4),gu=o,Jt=a;break;case 21:break;case 7:a&512&&(uu||r===null||Ml(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Pu(t,e,n),Lu(e)}}function Lu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Bl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Ll(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Il(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Ul(e,Vl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(pn(l,``),n.flags&=-33),Ul(e,Vl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Hl(e,Vl(e),u,s);break;default:throw Error(i(161))}}catch(t){wf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ru(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ru(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Eh=!0,t.reset(),Eh=!1),e=e.sibling}}function zu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Bu(t,e),t=t.sibling;else cu(t,!1)}function Bu(e,t){var n=e.alternate;if(n===null)eu(e,!1);else switch(e.tag){case 3:if(vu=hu=!1,Jl(),zu(t,e),!hu&&!_u){if(e=L,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ip(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`})),vu=!0}L=null;break;case 5:zu(t,e);break;case 4:r=hu,hu=!1,zu(t,e),hu&&(_u=!0),hu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?zu(t,e):eu(e,!1));break;case 30:r=hu,i=Jl(),hu=!1,zu(t,e),hu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=bi(a,o),o=bi(n.memoizedProps,o);var s=Si(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Yl=0,t=su(e,n,t,o,s,a,!0),Yl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Hd(e,e.memoizedProps.onUpdate),L=i):i!==null&&(i.push.apply(i,L),L=i),hu=e.flags&32?!0:r;break;default:zu(t,e)}}function Vu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)xu(e,t.alternate,t),t=t.sibling}function Hu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Ol(4,n,n.return),Hu(n,r);break;case 1:Ml(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Al(n,n.return,i),Hu(n,r);break;case 27:r&2&&Em(n.stateNode,n.type,n.memoizedProps);case 5:Ml(n,n.return),n.tag!==5&&n.tag!==27||Fl(n),Hu(n,r);break;case 6:Fl(n);break;case 26:Ml(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||uu||i.parentNode.removeChild(i),Hu(n,r);break;case 22:n.memoizedState===null&&Hu(n,r);break;case 30:Ml(n,n.return),Hu(n,r);break;case 7:Ml(n,n.return);default:Hu(n,r)}e=e.sibling}}function Uu(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:Uu(i,a,n),Dl(4,a);break;case 1:if(Uu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){wf(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++)Do(l[i],c)}catch(e){wf(r,r.return,e)}}s&&o&64&&kl(a),jl(a,a.return);break;case 27:n&2&&Wl(a);case 5:a.tag!==5&&a.tag!==27||Pl(a),Uu(i,a,n),s&&r===null&&o&4&&Rl(a),jl(a,a.return);break;case 6:Pl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||lu||nh(Am(c.ownerDocument),a.type,c),Uu(i,a,n),s&&r===null&&o&4&&Rl(a),jl(a,a.return);break;case 12:Uu(i,a,n);break;case 31:Uu(i,a,n),s&&o&4&&Au(i,a);break;case 13:Uu(i,a,n),s&&o&4&&ju(i,a);break;case 22:a.memoizedState===null&&Uu(i,a,n),jl(a,a.return);break;case 30:Uu(i,a,n),jl(a,a.return);break;case 7:jl(a,a.return);default:Uu(i,a,n)}t=t.sibling}}function Wu(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&&Ia(n))}function Gu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ia(e))}function Ku(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)qu(e,t,n,r),t=t.sibling;else i&&ou(t)}function qu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&au(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Ku(e,t,n,r),a&2048&&Dl(9,t);break;case 1:Ku(e,t,n,r);break;case 3:Ku(e,t,n,r),i&&vu&&(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&&Ia(a)));break;case 12:if(a&2048){Ku(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){wf(t,t.return,e)}}else Ku(e,t,n,r);break;case 31:Ku(e,t,n,r);break;case 13:Ku(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&&au(t),o._visibility&2?Ku(e,t,n,r):(o._visibility|=2,Ju(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&au(s),o._visibility&2?Ku(e,t,n,r):Yu(e,t)),a&2048&&Wu(s,t);break;case 24:Ku(e,t,n,r),a&2048&&Gu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Ql(a.child,!0),Ql(t.child,!0))),Ku(e,t,n,r);break;default:Ku(e,t,n,r)}}function Ju(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:Ju(a,o,s,c,i),Dl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ju(a,o,s,c,i)):u._visibility&2?Ju(a,o,s,c,i):Yu(a,o),i&&l&2048&&Wu(o.alternate,o);break;case 24:Ju(a,o,s,c,i),i&&l&2048&&Gu(o.alternate,o);break;default:Ju(a,o,s,c,i)}t=t.sibling}}function Yu(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:Yu(n,r),i&2048&&Wu(r.alternate,r);break;case 24:Yu(n,r),i&2048&&Gu(r.alternate,r);break;default:Yu(n,r)}t=t.sibling}}var Xu=8192;function Zu(e,t,n){if(e.subtreeFlags&Xu)for(e=e.child;e!==null;)Qu(e,t,n),e=e.sibling}function Qu(e,t,n){switch(e.tag){case 26:Zu(e,t,n),e.flags&Xu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&sh(n,e)):ch(n,Fu,e.memoizedState,e.memoizedProps));break;case 5:Zu(e,t,n),e.flags&Xu&&(e=e.stateNode,(t&335544128)===t&&sh(n,e));break;case 3:case 4:var r=Fu;Fu=Am(e.stateNode.containerInfo),Zu(e,t,n),Fu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Xu,Xu=16777216,Zu(e,t,n),Xu=r):Zu(e,t,n));break;case 30:if((e.flags&Xu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Kl===null&&(Kl=new Map),Kl.set(r,i)}Zu(e,t,n);break;default:Zu(e,t,n)}}function $u(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 ed(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];mu=r,rd(r,e)}$u(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)td(e),e=e.sibling}function td(e){switch(e.tag){case 0:case 11:case 15:ed(e),e.flags&2048&&Ol(9,e,e.return);break;case 3:ed(e);break;case 12:ed(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,nd(e)):ed(e);break;default:ed(e)}}function nd(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];mu=r,rd(r,e)}$u(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ol(8,t,t.return),nd(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,nd(t));break;default:nd(t)}e=e.sibling}}function rd(e,t){for(;mu!==null;){var n=mu;switch(n.tag){case 0:case 11:case 15:Ol(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:Ia(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,mu=r;else a:for(n=e;mu!==null;){r=mu;var i=r.sibling,a=r.return;if(Tu(r),r===n){mu=null;break a}if(i!==null){i.return=a,mu=i;break a}mu=a}}}var id={getCacheForType:function(e){var t=Oa(Pa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Oa(Pa).controller.signal}},ad=typeof WeakMap==`function`?WeakMap:Map,od=0,sd=null,R=null,z=0,cd=0,ld=null,ud=!1,dd=!1,fd=!1,pd=0,md=0,hd=0,gd=0,_d=0,vd=0,yd=0,bd=null,xd=null,Sd=!1,Cd=0,wd=0,Td=1/0,Ed=null,Dd=null,Od=0,kd=null,Ad=null,jd=0,Md=0,Nd=null,Pd=null,Fd=null,Id=null,Ld=null,Rd=0,zd=null;function Bd(){return od&2&&z!==0?z&-z:M.T===null?St():Wf()}function Vd(){if(vd===0){if(!(z&536870912)||F){var e=ot;ot<<=1,!(ot&3932160)&&(ot=262144),vd=e}else vd=536870912}return e=Po.current,e!==null&&(e.flags|=32),vd}function Hd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Wp(bi(e.memoizedProps,n))),Id===null&&(Id=[]),Id.push(t.bind(null,r))}}function Ud(e,t,n){(e===sd&&(cd===2||cd===9)||e.cancelPendingCommit!==null)&&(Xd(e,0),qd(e,z,vd,!1)),ht(e,n),(!(od&2)||e!==sd)&&(e===sd&&(!(od&2)&&(gd|=n),md===4&&qd(e,z,vd,!1)),V(e))}function Wd(e,t,n){if(od&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ut(e,t),a=r?af(e,t):nf(e,t,!0),o=r;do{if(a===0){dd&&!r&&qd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Kd(n)){a=nf(e,t,!1),o=!1;continue}if(a===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;a=bd;var l=c.current.memoizedState.isDehydrated;if(l&&(Xd(c,s).flags|=256),s=nf(c,s,!1),s!==2&&s!==6){if(fd&&!l){c.errorRecoveryDisabledLanes|=o,gd|=o,a=4;break a}o=xd,xd=a,o!==null&&(xd===null?xd=o:xd.push.apply(xd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Xd(e,0),qd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:qd(r,t,vd,!ud);break a;case 2:xd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Cd+300-Ue(),10<a)){if(qd(r,t,vd,!ud),lt(r,0,!0)!==0)break a;jd=t,r.timeoutHandle=Ep(Gd.bind(null,r,n,xd,Ed,Sd,t,vd,gd,yd,ud,o,`Throttled`,-0,0),a);break a}Gd(r,n,xd,Ed,Sd,t,vd,gd,yd,ud,o,null,-0,0)}break}while(1);V(e)}function Gd(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;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xn},Kl=null,Qu(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=fh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?Cd-Ue():(a&4194048)===a?wd-Ue():0,m=uh(d,m),m!==null)){jd=a,e.cancelPendingCommit=m(ff.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),qd(e,a,o,!l);return}ff(e,t,a,n,r,i,o,s,c,l,u,d)}function Kd(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(!Wr(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 qd(e,t,n,r){t=dt(e,t),t&=~_d,t&=~gd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-tt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&_t(e,n,t)}function Jd(){return od&6?!0:(Lf(0,!1),!1)}function Yd(){if(R!==null){if(cd===0)var e=R.return;else e=R,ba=ya=null,ls(e),co=null,lo=0,e=R;for(;e!==null;)El(e.alternate,e),e=e.return;R=null}}function Xd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Dp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),jd=0,Yd(),sd=e,R=n=Li(e.current,null),z=t,cd=0,ld=null,ud=!1,dd=ut(e,t),fd=!1,yd=vd=_d=gd=hd=md=0,xd=bd=null,Sd=!1,pd=dt(e,t),Di(),n}function Zd(e,t){I=null,M.H=yc,t===Qa||t===eo?(t=oo(),cd=3):t===$a?(t=oo(),cd=4):cd=t===Lc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ld=t,R===null&&(md=1,jc(e,Gi(t,e.current)))}function Qd(){var e=Po.current;return e===null?!0:(z&4194048)===z?Fo===null:(z&62914560)===z||z&536870912?e===Fo:!1}function $d(){var e=M.H;return M.H=yc,e===null?yc:e}function ef(){var e=M.A;return M.A=id,e}function tf(){md=4,ud||(z&4194048)!==z&&Po.current!==null||(dd=!0),!(hd&134217727)&&!(gd&134217727)||sd===null||qd(sd,z,vd,!1)}function nf(e,t,n){var r=od;od|=2;var i=$d(),a=ef();(sd!==e||z!==t)&&(Ed=null,Xd(e,t)),t=!1;var o=md;a:do try{if(cd!==0&&R!==null){var s=R,c=ld;switch(cd){case 8:Yd(),o=6;break a;case 3:case 2:case 9:case 6:Po.current===null&&(t=!0);var l=cd;if(cd=0,ld=null,lf(e,s,c,l),n&&dd){o=0;break a}break;default:l=cd,cd=0,ld=null,lf(e,s,c,l)}}rf(),o=md;break}catch(t){Zd(e,t)}while(1);return t&&e.shellSuspendCounter++,ba=ya=null,od=r,M.H=i,M.A=a,R===null&&(sd=null,z=0,Di()),o}function rf(){for(;R!==null;)sf(R)}function af(e,t){var n=od;od|=2;var r=$d(),a=ef();sd!==e||z!==t?(Ed=null,Td=Ue()+500,Xd(e,t)):dd=ut(e,t);a:do try{if(cd!==0&&R!==null){t=R;var o=ld;b:switch(cd){case 1:cd=0,ld=null,lf(e,t,o,1);break;case 2:case 9:if(no(o)){cd=0,ld=null,cf(t);break}t=function(){cd!==2&&cd!==9||sd!==e||(cd=7),V(e)},o.then(t,t);break a;case 3:cd=7;break a;case 4:cd=5;break a;case 7:no(o)?(cd=0,ld=null,cf(t)):(cd=0,ld=null,lf(e,t,o,7));break;case 5:var s=null;switch(R.tag){case 26:s=R.memoizedState;case 5:case 27:var c=R;if(s?ah(s):c.stateNode.complete){cd=0,ld=null;var l=c.sibling;if(l!==null)R=l;else{var u=c.return;u===null?R=null:(R=u,uf(u))}break b}}cd=0,ld=null,lf(e,t,o,5);break;case 6:cd=0,ld=null,lf(e,t,o,6);break;case 8:Yd(),md=6;break a;default:throw Error(i(462))}}of();break}catch(t){Zd(e,t)}while(1);return ba=ya=null,M.H=r,M.A=a,od=n,R===null?(sd=null,z=0,Di(),md):0}function of(){for(;R!==null&&!Ve();)sf(R)}function sf(e){var t=_l(e.alternate,e,pd);e.memoizedProps=e.pendingProps,t===null?uf(e):R=t}function cf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Zc(n,t,t.pendingProps,t.type,void 0,z);break;case 11:t=Zc(n,t,t.pendingProps,t.type.render,t.ref,z);break;case 5:ls(t);var r=t;r===oa&&(F?(pa(r),r.tag===5&&r.stateNode!=null&&(sa=r.stateNode)):(pa(r),F=!0));default:El(n,t),t=R=Ri(t,pd),t=_l(n,t,pd)}e.memoizedProps=e.pendingProps,t===null?uf(e):R=t}function lf(e,t,n,r){ba=ya=null,ls(t),co=null,lo=0;var i=t.return;try{if(Ic(e,i,t,n,z)){md=1,jc(e,Gi(n,e.current)),R=null;return}}catch(t){if(i!==null)throw R=i,t;md=1,jc(e,Gi(n,e.current)),R=null;return}t.flags&32768?(F||r===1?e=!0:dd||z&536870912?e=!1:(ud=e=!0,(r===2||r===9||r===3||r===6)&&(r=Po.current,r!==null&&r.tag===13&&(r.flags|=16384))),df(t,e)):uf(t)}function uf(e){var t=e;do{if(t.flags&32768){df(t,ud);return}e=t.return;var n=wl(t.alternate,t,pd);if(n!==null){R=n;return}if(t=t.sibling,t!==null){R=t;return}R=t=e}while(t!==null);md===0&&(md=5)}function df(e,t){do{var n=Tl(e.alternate,e);if(n!==null){n.flags&=32767,R=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){R=e;return}R=e=n}while(e!==null);md=6,R=null}function ff(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do bf();while(Od!==0);if(od&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===sd&&(R=sd=null,z=0),Ad=t,kd=e,jd=n,Nd=a,Pd=r,pf(e,t,n,s,c,l,f)}}function pf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Md=s,s|=Ei,gt(e,n,s,r,i,a),Id=null,(n&335544064)===n?(Ld=za(e),r=10262):(Ld=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Af(qe,function(){return Sf(),null})):(e.callbackNode=null,e.callbackPriority=0),Gl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=M.T,M.T=null,i=N.p,N.p=2,a=od,od|=4;try{yu(e,t,n)}finally{od=a,N.p=i,M.T=r}}Od=1,Gl?Fd=Hp(o,e.containerInfo,Ld,gf,_f,hf,B,Sf,mf,null,null):(gf(),_f(),B())}function mf(e){if(Od!==0){var t=kd.onRecoverableError;t(e,{componentStack:null})}}function hf(){Od===3&&(Od=0,Bu(Ad,kd),Od=4)}function gf(){if(Od===1){Od=0;var e=kd,t=Ad,n=jd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=M.T,M.T=null;var i=N.p;N.p=2;var a=od;od|=4;try{gu=_u=!1,Iu(t,e,n),n=vp;var o=Xr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Yr(s.ownerDocument.documentElement,s)){if(c!==null&&Zr(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 _=Jr(s,h),v=Jr(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}}Eh=!!_p,vp=_p=null}finally{od=a,N.p=i,M.T=r}}e.current=t,Od=2}}function _f(){if(Od===2){Od=0;var e=kd,t=Ad,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=od;od|=4;try{xu(e,t.alternate,t)}finally{od=i,N.p=r,M.T=n}}Od=3}}function B(){if(Od===4||Od===3){Od=0;var e=Fd;Fd=null,He();var t=kd,n=Ad,r=jd,i=Pd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Od=5:(Od=0,Ad=kd=null,vf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Dd=null),xt(r),n=n.stateNode,$e&&typeof $e.onCommitFiberRoot==`function`)try{$e.onCommitFiberRoot(Qe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=M.T,a=N.p,N.p=2,M.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{M.T=n,N.p=a}}if(i=Id,o=Ld,Ld=null,i!==null&&(Id=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);jd&3&&bf(),V(t),a=t.pendingLanes,r&261930&&a&42?t===zd?Rd++:(Rd=0,zd=t):(Rd=0,zd=null),Lf(0,!1)}}function vf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ia(t)))}function bf(){return Fd!==null&&(Fd.skipTransition(),Fd=null),gf(),_f(),B(),Sf()}function Sf(){if(Od!==5)return!1;var e=kd,t=Md;Md=0;var n=xt(jd),r=M.T,a=N.p;try{N.p=32>n?32:n,M.T=null,n=Nd,Nd=null;var o=kd,s=jd;if(Od=0,Ad=kd=null,jd=0,od&6)throw Error(i(331));var c=od;if(od|=4,td(o.current),qu(o,o.current,s,n),od=c,Lf(0,!1),$e&&typeof $e.onPostCommitFiberRoot==`function`)try{$e.onPostCommitFiberRoot(Qe,o)}catch{}return!0}finally{N.p=a,M.T=r,vf(e,t)}}function Cf(e,t,n){t=Gi(n,t),t=Nc(e.stateNode,t,2),e=xo(e,t,2),e!==null&&(ht(e,2),V(e))}function wf(e,t,n){if(e.tag===3)Cf(e,e,n);else for(;t!==null;){if(t.tag===3){Cf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Dd===null||!Dd.has(r))){e=Gi(n,e),n=Pc(2),r=xo(t,n,2),r!==null&&(Fc(n,r,t,e),ht(r,2),V(r));break}}t=t.return}}function Tf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ad;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)||(fd=!0,i.add(n),e=Ef.bind(null,e,t,n),t.then(e,e))}function Ef(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,sd===e&&(z&n)===n&&(md===4||md===3&&(z&62914560)===z&&300>Ue()-Cd?od&2?_d|=n:Xd(e,0):_d|=n,yd===z&&(yd=0)),V(e)}function Df(e,t){t===0&&(t=pt()),e=Ai(e,t),e!==null&&(ht(e,t),V(e))}function Of(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Df(e,n)}function kf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Df(e,n)}function Af(e,t){return ze(e,t)}var jf=null,Mf=null,Nf=!1,Pf=!1,Ff=!1,If=0;function V(e){e!==Mf&&e.next===null&&(Mf===null?jf=Mf=e:Mf=Mf.next=e),Pf=!0,Nf||(Nf=!0,Uf())}function Lf(e,t){if(!Ff&&Pf){Ff=!0;do for(var n=!1,r=jf;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-tt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Hf(r,a))}else a=z,a=lt(r,r===sd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ut(r,a)||(n=!0,Hf(r,a))}r=r.next}while(n);Ff=!1}}function Rf(){zf()}function zf(){Pf=Nf=!1;var e=0;If!==0&&Tp()&&(e=If);for(var t=Ue(),n=null,r=jf;r!==null;){var i=r.next,a=Bf(r,t);a===0?(r.next=null,n===null?jf=i:n.next=i,i===null&&(Mf=n)):(n=r,(e!==0||a&3)&&(Pf=!0)),r=i}Od!==0&&Od!==5||Lf(e,!1),If!==0&&(If=0)}function Bf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-tt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ft(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=sd,n=z,n=lt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(cd===2||cd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Be(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ut(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Be(r),xt(n)){case 2:case 8:n=Ke;break;case 32:n=qe;break;case 268435456:n=Ye;break;default:n=qe}return r=Vf.bind(null,e),n=ze(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Be(r),e.callbackPriority=2,e.callbackNode=null,2}function Vf(e,t){if(Od!==0&&Od!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(bf()&&e.callbackNode!==n)return null;var r=z;return r=lt(e,e===sd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Wd(e,r,t),Bf(e,Ue()),e.callbackNode!=null&&e.callbackNode===n?Vf.bind(null,e):null)}function Hf(e,t){if(bf())return null;Wd(e,t,!0)}function Uf(){Ap(function(){od&6?ze(Ge,Rf):zf()})}function Wf(){if(If===0){var e=Ha;e===0&&(e=at,at<<=1,!(at&261888)&&(at=256)),If=e}return If}function Gf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:bn(e)}function Kf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Gf((i[Et]||null).action),o=r.submitter;o&&(t=(t=o[Et]||null)?Gf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Hn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(If!==0){var e=new FormData(i,o);ac(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),ac(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var qf=0;qf<_i.length;qf++){var Jf=_i[qf];vi(Jf.toLowerCase(),`on`+(Jf[0].toUpperCase()+Jf.slice(1)))}vi(li,`onAnimationEnd`),vi(ui,`onAnimationIteration`),vi(di,`onAnimationStart`),vi(`dblclick`,`onDoubleClick`),vi(`focusin`,`onFocus`),vi(`focusout`,`onBlur`),vi(fi,`onTransitionRun`),vi(pi,`onTransitionStart`),vi(mi,`onTransitionCancel`),vi(hi,`onTransitionEnd`),Ut(`onMouseEnter`,[`mouseout`,`mouseover`]),Ut(`onMouseLeave`,[`mouseout`,`mouseover`]),Ut(`onPointerEnter`,[`pointerout`,`pointerover`]),Ut(`onPointerLeave`,[`pointerout`,`pointerover`]),Ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Yf=`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(` `),H=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Yf));function Xf(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){Ci(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){Ci(e)}i.currentTarget=null,a=c}}}}function Zf(e,t){var n=t[Ot];n===void 0&&(n=t[Ot]=new Set);var r=e+`__bubble`;n.has(r)||(tp(t,e,2,!1),n.add(r))}function Qf(e,t,n){var r=0;t&&(r|=4),tp(n,e,r,t)}var $f=`_reactListening`+Math.random().toString(36).slice(2);function ep(e){if(!e[$f]){e[$f]=!0,Bt.forEach(function(t){t!==`selectionchange`&&(H.has(t)||Qf(t,!1,e),Qf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$f]||(t[$f]=!0,Qf(`selectionchange`,!1,t))}}function tp(e,t,n,r){switch(Nh(t)){case 2:var i=Dh;break;case 8:i=Oh;break;default:i=kh}n=i.bind(null,t,n,e),i=void 0,!jn||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 np(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Ft(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}On(function(){var r=a,i=Cn(n),s=[];a:{var c=gi.get(e);if(c!==void 0){var l=Hn,u=e;switch(e){case`keypress`:if(Ln(n)===0)break a;case`keydown`:case`keyup`:l=or;break;case`focusin`:u=`focus`,l=Zn;break;case`focusout`:u=`blur`,l=Zn;break;case`beforeblur`:case`afterblur`:l=Zn;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=Yn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Xn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=lr;break;case li:case ui:case di:l=Qn;break;case hi:l=ur;break;case`scroll`:case`scrollend`:l=Wn;break;case`wheel`:l=dr;break;case`copy`:case`cut`:case`paste`:l=$n;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=sr;break;case`submit`:l=cr;break;case`toggle`:case`beforetoggle`:l=fr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;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=kn(m,p),g!=null&&d.push(rp(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==Sn&&(u=n.relatedTarget||n.fromElement)&&(Ft(u)||u[Dt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Ft(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Yn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=sr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:P(c),h=l==null?u:P(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Ft(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,ap):null,c!==null&&op(s,u,c,d,!1),l!==null&&f!==null&&op(s,f,l,d,!0)))}a:{if(c=r?P(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Mr;else if(Er(c)){if(Nr)_=Hr;else{_=Br;var v=zr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&_n(r.elementType)&&(_=Mr):_=Vr;if(_&&=_(e,r)){Dr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?P(r):window,e){case`focusin`:(Er(v)||v.contentEditable===`true`)&&($r=v,ei=r,ti=null);break;case`focusout`:ti=ei=$r=null;break;case`mousedown`:ni=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ni=!1,ri(s,n,i);break;case`selectionchange`:if(Qr)break;case`keydown`:case`keyup`:ri(s,n,i)}var y;if(mr)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 Sr?br(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(_r&&n.locale!==`ko`&&(Sr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Sr&&(y=In()):(Nn=i,Pn=`value`in Nn?Nn.value:Nn.textContent,Sr=!0)),v=ip(r,b),0<v.length&&(b=new er(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=xr(n),y!==null&&(b.data=y)))),(y=gr?Cr(e,n):wr(e,n))&&(b=ip(r,`onBeforeInput`),0<b.length&&(v=new er(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Kf(s,e,r,n,i)}Xf(s,t)})}function rp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ip(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=kn(e,n),i!=null&&r.unshift(rp(e,i,a)),i=kn(e,t),i!=null&&r.push(rp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ap(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function op(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=kn(n,a),l!=null&&o.unshift(rp(n,l,c))):i||(l=kn(n,a),l!=null&&o.push(rp(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var sp=/\r\n?/g,cp=/\u0000|\uFFFD/g;function U(e){return(typeof e==`string`?e:``+e).replace(sp,`
|
|
18
|
-
`).replace(cp,``)}function lp(e,t){return t=U(t),U(e)===t}function up(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&pn(e,``+r);else return;break;case`className`:Zt(e,`class`,r);break;case`tabIndex`:Zt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Zt(e,n,r);break;case`style`:gn(e,r,o);return;case`data`:if(t!==`object`){Zt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=bn(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`&&up(e,t,`name`,a.name,a,null),up(e,t,`formEncType`,a.formEncType,a,null),up(e,t,`formMethod`,a.formMethod,a,null),up(e,t,`formTarget`,a.formTarget,a,null)):(up(e,t,`encType`,a.encType,a,null),up(e,t,`method`,a.method,a,null),up(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=bn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=xn);return;case`onScroll`:r!=null&&Zf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Zf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(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=bn(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`:Zf(`beforetoggle`,e),Zf(`toggle`,e),Xt(e,`popover`,r);break;case`xlinkActuate`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Xt(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=vn.get(n)||n,Xt(e,n,r);else return}Jt=!0}function dp(e,t,n,r,a,o){switch(n){case`style`:gn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)pn(e,``+r);else return;break;case`onScroll`:r!=null&&Zf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Zf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=xn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Vt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Et]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Jt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Xt(e,n,r)}return}Jt=!0}function fp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Zf(`error`,e),Zf(`load`,e);var r=!1,a=!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`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:up(e,t,o,s,n,null)}}a&&up(e,t,`srcSet`,n.srcSet,n,null),r&&up(e,t,`src`,n.src,n,null);return;case`input`:Zf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=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(i(137,t));break;default:up(e,t,r,d,n,null)}}cn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Zf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:up(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&un(e,!!r,n,!0):un(e,!!r,t,!1);return;case`textarea`:for(s in Zf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:up(e,t,s,c,n,null)}fn(e,r,a,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:up(e,t,l,r,n,null)}return;case`dialog`:Zf(`beforetoggle`,e),Zf(`toggle`,e),Zf(`cancel`,e),Zf(`close`,e);break;case`iframe`:case`object`:Zf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Yf.length;r++)Zf(Yf[r],e);break;case`image`:Zf(`error`,e),Zf(`load`,e);break;case`details`:Zf(`toggle`,e);break;case`embed`:case`source`:case`link`:Zf(`error`,e),Zf(`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(i(137,t));default:up(e,t,u,r,n,null)}return;default:if(_n(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&dp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&up(e,t,c,r,n,null))}var pp={};function mp(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 a=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)||up(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&&(Jt=!0),o=m;break;case`name`:m!==f&&(Jt=!0),a=m;break;case`checked`:m!==f&&(Jt=!0),u=m;break;case`defaultChecked`:m!==f&&(Jt=!0),d=m;break;case`value`:m!==f&&(Jt=!0),s=m;break;case`defaultValue`:m!==f&&(Jt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&up(e,t,p,m,r,f)}}sn(e,s,c,l,u,d,o,a);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)||up(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Jt=!0),p=o;break;case`defaultValue`:o!==l&&(Jt=!0),c=o;break;case`multiple`:o!==l&&(Jt=!0),s=o;default:o!==l&&up(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?un(e,!!n,n?[]:``,!1):un(e,!!n,t,!0)):un(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:up(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Jt=!0),p=a;break;case`defaultValue`:a!==o&&(Jt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&up(e,t,s,a,r,o)}dn(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:up(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&&(Jt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:up(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)&&up(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(i(137,t));break;default:up(e,t,u,p,r,m)}return;default:if(_n(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&dp(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||dp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&up(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||up(e,t,f,p,r,m)}function hp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function gp(){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&&hp(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&&hp(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 _p=null,vp=null;function yp(e){return e.nodeType===9?e:e.ownerDocument}function bp(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 xp(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 Sp(e,t,n,r){return n=yp(n).createElement(e),n[Tt]=r,n[Et]=t,fp(n,e,t),Rt(n),n}function Cp(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 wp=null;function Tp(){var e=window.event;return e&&e.type===`popstate`?e!==wp&&(wp=e,!0):(wp=null,!1)}var Ep=typeof setTimeout==`function`?setTimeout:void 0,Dp=typeof clearTimeout==`function`?clearTimeout:void 0,Op=typeof Promise==`function`?Promise:void 0,kp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Ep,Ap=typeof queueMicrotask==`function`?queueMicrotask:Op===void 0?Ep:function(e){return Op.resolve(null).then(e).catch(jp)};function jp(e){setTimeout(function(){throw e})}function Mp(e){return e===`head`}function Np(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),Qh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Dm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Dm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Dm(e.ownerDocument.body)}n=i}while(n);Qh(t)}function Pp(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 Fp(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 Ip(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 Lp(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 Rp(e){return Lp(e.getBoundingClientRect(),getComputedStyle(e),e)}function zp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Lp(t,n,e)}function Bp(e){return e.documentElement.clientHeight}function Vp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Hp(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`&&(Bp(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+=oh(f),u>lh){s.length=o;break}f=new Promise(Vp.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 Up(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Up.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Up.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},Up.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Wp(e){return{name:e,group:new Up(`group`,e),imagePair:new Up(`image-pair`,e),old:new Up(`old`,e),new:new Up(`new`,e)}}function Gp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Gp.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(Xp(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=Jp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Kp,e,s,r)}this._eventListeners=a}};function Kp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Gp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Xp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Jp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,qp,e,n,i),r.splice(t,1),a!==null&&a()}};function qp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function Jp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Yp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Xp(e,t,n,r){if(e.length===0)return-1;r=Yp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Yp(a.optionsOrUseCapture)===r)return i}return-1}Gp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(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,Jp(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,Jp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Gp.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Zp,e,void 0,void 0)};function Zp(e,t){return e.tag!==6&&(e=v(e),Cm(e,t))}Gp.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,Qp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Zp(t[n],e);n--);};function Qp(e,t){return t.push(e),!1}Gp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=yp(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,$p,e,void 0,void 0))};function $p(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Gp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,em,e,void 0,void 0)};function em(e,t){return e.tag!==6&&(e=v(e),t.observe(e),!1)}Gp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,tm,e,void 0,void 0);for(var n=t=0;n<nm.length;n++){var r=nm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):nm[t++]=r}nm.length=t}};function tm(e,t){return e.tag!==6&&(e=v(e),t.unobserve(e),!1)}var nm=[],rm=!1;function im(e,t,n){nm.push({fragmentInstance:e,observer:t,instance:n}),rm||(rm=!0,wm(function(){rm=!1;var e=nm;nm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Gp.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,am,e,void 0,void 0),e};function am(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=v(e),t.push.apply(t,e.getClientRects());return!1}Gp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Gp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,Qp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(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=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(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=v(n[0]),i=v(n[n.length-1]);var a=h(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||om(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function om(e,t,n,r,i){var a=Ft(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=m(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=w(n,a,C),t===null?t=!1:(f(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(f(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function sm(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)}Gp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,Qp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),sm(e,n);return}if(r=v(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 a=t[r];a.tag===6?(a=v(a),sm(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function cm(e,t){return e=v(e),lm(e,t),!1}function lm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function um(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,Jp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<nm.length;i++){var a=nm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(nm[r++]=a)}nm.length=r,n.observe(e)}),lm(e,t))}function dm(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,Jp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?im(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function fm(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`:fm(n),Pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function pm(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[Mt])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=ym(e.nextSibling),e===null)break}return null}function mm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=ym(e.nextSibling),e===null))return null;return e}function hm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=ym(e.nextSibling),e===null))return null;return e}function gm(e){return e.data===`$?`||e.data===`$~`}function _m(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function vm(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 ym(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 bm=null;function xm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return ym(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Sm(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 Cm(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 wm(e){kp(function(){kp(function(t){return e(t)})})}function Tm(e,t,n){switch(t=yp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Em(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&up(e,t,r,null,pp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===xn&&(e.onclick=null),Pt(e)}function Dm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pt(e)}var Om=new Map,km=new Set;function Am(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 jm=N.d;N.d={f:Mm,r:Nm,D:Im,C:Lm,L:Rm,m:zm,X:Vm,S:Bm,M:Hm};function Mm(){var e=jm.f(),t=Jd();return e||t}function Nm(e){var t=It(e);t!==null&&t.tag===5&&t.type===`form`?sc(t):jm.r(e)}var Pm=typeof document>`u`?null:document;function Fm(e,t,n){var r=Pm;if(r&&typeof t==`string`&&t){var i=on(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),km.has(i)||(km.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),fp(t,`link`,e),Rt(t),r.head.appendChild(t)))}}function Im(e){jm.D(e),Fm(`dns-prefetch`,e,null)}function Lm(e,t){jm.C(e,t),Fm(`preconnect`,e,t)}function Rm(e,t,n){jm.L(e,t,n);var r=Pm;if(r&&e&&t){var i=`link[rel="preload"][as="`+on(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+on(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+on(n.imageSizes)+`"]`)):i+=`[href="`+on(e)+`"]`;var a=i;switch(t){case`style`:a=Wm(e);break;case`script`:a=Jm(e)}if(!(Om.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Om.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Gm(a))||t===`script`&&r.querySelector(Ym(a))))){var o=r.createElement(`link`);fp(o,`link`,e),t===`style`&&(o[Nt]=!0,o.onload=o.onerror=function(){zt(o)}),Rt(o),r.head.appendChild(o)}}}function zm(e,t){jm.m(e,t);var n=Pm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+on(r)+`"][href="`+on(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Jm(e)}if(!Om.has(a)&&(e=T({rel:`modulepreload`,href:e},t),Om.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ym(a)))return}r=n.createElement(`link`),fp(r,`link`,e),Rt(r),n.head.appendChild(r)}}}function Bm(e,t,n){jm.S(e,t,n);var r=Pm;if(r&&e){var i=Lt(r).hoistableStyles,a=Wm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Gm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Om.get(a))&&Qm(e,n);var c=o=r.createElement(`link`);Rt(c),fp(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,Zm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Vm(e,t){jm.X(e,t);var n=Pm;if(n&&e){var r=Lt(n).hoistableScripts,i=Jm(e),a=r.get(i);a||(a=n.querySelector(Ym(i)),a||(e=T({src:e,async:!0},t),(t=Om.get(i))&&$m(e,t),a=n.createElement(`script`),Rt(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hm(e,t){jm.M(e,t);var n=Pm;if(n&&e){var r=Lt(n).hoistableScripts,i=Jm(e),a=r.get(i);a||(a=n.querySelector(Ym(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=Om.get(i))&&$m(e,t),a=n.createElement(`script`),Rt(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Um(e,t,n,r){var a=(a=Te.current)?Am(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Wm(n.href),t=Lt(a).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=Wm(n.href);var o=Lt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Gm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Om.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},Om.set(e,o)),qm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Jm(n),t=Lt(a).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(i(444,e))}}function Wm(e){return`href="`+on(e)+`"`}function Gm(e){return`link[rel="stylesheet"][`+e+`]`}function Km(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function qm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Nt]){r.loading=1;return}}else t=e.createElement(`link`),t[Nt]=!0,t.onload=t.onerror=zt.bind(null,t),fp(t,`link`,n),Rt(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 Jm(e){return`[src="`+on(e)+`"]`}function Ym(e){return`script[async]`+e}function Xm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+on(n.href)+`"]`);if(r)return t.instance=r,Rt(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Rt(r),fp(r,`style`,a),Zm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Wm(n.href);var o=e.querySelector(Gm(a));if(o)return t.state.loading|=4,t.instance=o,Rt(o),o;r=Km(n),(a=Om.get(a))&&Qm(r,a),o=(e.ownerDocument||e).createElement(`link`),Rt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),fp(o,`link`,r),t.state.loading|=4,Zm(o,n.precedence,e),t.instance=o;case`script`:return o=Jm(n.src),(a=e.querySelector(Ym(o)))?(t.instance=a,Rt(a),a):(r=n,(a=Om.get(o))&&(r=T({},n),$m(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Rt(a),fp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Zm(r,n.precedence,e));return t.instance}function Zm(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 Qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function $m(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var eh=null;function th(e,t,n){if(eh===null){var r=new Map,i=eh=new Map;i.set(n,r)}else i=eh,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[Mt]||a[Tt]||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 nh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function rh(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 ih(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function ah(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function oh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function sh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=oh(t),e.suspenseyImages.push(t)),e=ph.bind(e),t.decode().then(e,e))}function ch(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=Wm(r.href),a=t.querySelector(Gm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=fh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Rt(a);return}a=t.ownerDocument||t,r=Km(r),(i=Om.get(i))&&Qm(r,i),a=a.createElement(`link`),Rt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),fp(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=fh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var lh=0;function uh(e,t){return e.stylesheets&&e.count===0&&hh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&hh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&lh===0&&(lh=62500*gp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&hh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>lh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function dh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)hh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function fh(){this.count--,dh(this)}function ph(){this.imgCount--,dh(this)}var mh=null;function hh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,mh=new Map,t.forEach(gh,e),mh=null,fh.call(e))}function gh(e,t){if(!(t.state.loading&4)){var n=mh.get(e);if(n)var r=n.get(null);else{n=new Map,mh.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=fh.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 _h={$$typeof:A,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function vh(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=mt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.hiddenUpdates=mt(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 yh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new vh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Fi(3,null,null,t),e.current=a,a.stateNode=e,t=Fa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},vo(a),e}function bh(e){return e?(e=Ni,e):Ni}function xh(e,t,n,r,i,a){i=bh(i),r.context===null?r.context=i:r.pendingContext=i,r=bo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=xo(e,r,t),n!==null&&(Ud(n,e,t),So(n,e,t))}function Sh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ch(e,t){Sh(e,t),(e=e.alternate)&&Sh(e,t)}function wh(e){if(e.tag===13||e.tag===31){var t=Ai(e,67108864);t!==null&&Ud(t,e,67108864),Ch(e,67108864)}}function Th(e){if(e.tag===13||e.tag===31){var t=Bd();t=bt(t);var n=Ai(e,t);n!==null&&Ud(n,e,t),Ch(e,t)}}var Eh=!0;function Dh(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,kh(e,t,n,r)}finally{N.p=a,M.T=i}}function Oh(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,kh(e,t,n,r)}finally{N.p=a,M.T=i}}function kh(e,t,n,r){if(Eh){var i=Ah(r);if(i===null)np(e,t,r,jh,n),Hh(e,r);else if(Wh(i,e,t,n,r))r.stopPropagation();else if(Hh(e,r),t&4&&-1<Vh.indexOf(e)){for(;i!==null;){var a=It(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ct(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-tt(o);s.entanglements[1]|=c,o&=~c}V(a),!(od&6)&&(Td=Ue()+500,Lf(0,!1))}}break;case 31:case 13:s=Ai(a,2),s!==null&&Ud(s,a,2),Jd(),Ch(a,2)}if(a=Ah(r),a===null&&np(e,t,r,jh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else np(e,t,r,null,n)}}function Ah(e){return e=Cn(e),Mh(e)}var jh=null;function Mh(e){if(jh=null,e=Ft(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 jh=e,null}function Nh(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(We()){case Ge:return 2;case Ke:return 8;case qe:case Je:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var Ph=!1,Fh=null,Ih=null,Lh=null,Rh=new Map,zh=new Map,Bh=[],Vh=`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 Hh(e,t){switch(e){case`focusin`:case`focusout`:Fh=null;break;case`dragenter`:case`dragleave`:Ih=null;break;case`mouseover`:case`mouseout`:Lh=null;break;case`pointerover`:case`pointerout`:Rh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:zh.delete(t.pointerId)}}function Uh(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=It(t),t!==null&&wh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Wh(e,t,n,r,i){switch(t){case`focusin`:return Fh=Uh(Fh,e,t,n,r,i),!0;case`dragenter`:return Ih=Uh(Ih,e,t,n,r,i),!0;case`mouseover`:return Lh=Uh(Lh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Rh.set(a,Uh(Rh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,zh.set(a,Uh(zh.get(a)||null,e,t,n,r,i)),!0}return!1}function Gh(e){var t=Ft(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Ct(e.priority,function(){Th(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Ct(e.priority,function(){Th(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 Kh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ah(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Sn=r,n.target.dispatchEvent(r),Sn=null}else return t=It(n),t!==null&&wh(t),e.blockedOn=n,!1;t.shift()}return!0}function qh(e,t,n){Kh(e)&&n.delete(t)}function Jh(){Ph=!1,Fh!==null&&Kh(Fh)&&(Fh=null),Ih!==null&&Kh(Ih)&&(Ih=null),Lh!==null&&Kh(Lh)&&(Lh=null),Rh.forEach(qh),zh.forEach(qh)}function Yh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ph||(Ph=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Jh)))}var Xh=null;function Zh(e){Xh!==e&&(Xh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Xh===e&&(Xh=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(Mh(r||n)===null)continue;break}var a=It(n);a!==null&&(e.splice(t,3),t-=3,ac(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Qh(e){function t(t){return Yh(t,e)}Fh!==null&&Yh(Fh,e),Ih!==null&&Yh(Ih,e),Lh!==null&&Yh(Lh,e),Rh.forEach(t),zh.forEach(t);for(var n=0;n<Bh.length;n++){var r=Bh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Bh.length&&(n=Bh[0],n.blockedOn===null);)Gh(n),n.blockedOn===null&&Bh.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[Et]||null;if(typeof a==`function`)o||Zh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Et]||null)s=o.formAction;else if(Mh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Zh(n)}}}function $h(){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 eg(e){this._internalRoot=e}tg.prototype.render=eg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;xh(n,Bd(),e,t,null,null)},tg.prototype.unmount=eg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xh(e.current,2,null,e,null,null),Jd(),t[Dt]=null}};function tg(e){this._internalRoot=e}tg.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Bh.length&&t!==0&&t<Bh[n].priority;n++);Bh.splice(n,0,e),n===0&&Gh(e)}};var ng=n.version;if(ng!==`19.3.0`)throw Error(i(527,ng,`19.3.0`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var rg={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ig=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ig.isDisabled&&ig.supportsFiber)try{Qe=ig.inject(rg),$e=ig}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Oc,s=kc,c=Ac;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=yh(e,1,!1,null,null,n,r,null,o,s,c,$h),e[Dt]=t.current,ep(e),new eg(t)}})),Cf=o(((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=Sf()}))(),wf={activity:400,thoughts:40,chat:100};function Tf(e,t,n){let r=e??[],i=new Set(r.map(e=>e.id)),a=t.filter(e=>typeof e?.id==`number`&&!i.has(e.id));return[...r,...a].slice(-n)}var Ef=class{records=new Map;listeners=new Set;reads=new Map;used=new Set;reader;currentStatus={connection:`connecting`,signedOut:!1};get(e){let t=this.records.get(e);if(t)return t;let n={version:0,data:void 0,loading:!1,error:void 0,stale:!1};return this.records.set(e,n),n}status(){return{...this.currentStatus}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}markUsed(e,t){this.reader=t;let n=e.filter(e=>!this.used.has(e));this.used=new Set(e);for(let e of n)this.read(e)}onHello(e){for(let t of this.used){let n=e[t];n!==void 0&&(this.get(t).version=n),this.read(t)}}onChanged(e,t){let n=this.get(e);n.version=t,this.used.has(e)?this.read(e):n.stale=!0,this.notify()}onFeedDelta(e){let t=this.get(`lobby`).data;t&&(this.get(`lobby`).data={...t,activity:Tf(t.activity,e.activity??[],wf.activity),thoughts:Tf(t.thoughts,e.thoughts??[],wf.thoughts),chat:Tf(t.chat,e.chat??[],wf.chat)},this.notify())}onReplyDelta(e){let t=this.get(`lobby`),n=t.data;n&&(t.data={...n,reply:e},this.notify())}onStatus(e){this.currentStatus={...this.currentStatus,...e},this.notify()}async read(e){let t=this.reader;if(!t)return;let n=(this.reads.get(e)??0)+1;this.reads.set(e,n);let r=this.get(e);r.loading=!0,r.error=void 0,this.notify();try{let i=await t(e);if(this.reads.get(e)!==n)return;this.apply(r,i)}catch(t){if(this.reads.get(e)!==n)return;r.loading=!1,r.error=t instanceof Error?t.message:String(t)}this.notify()}apply(e,t){e.data=t,e.loading=!1,e.stale=!1,e.error=void 0}notify(){for(let e of[...this.listeners])e()}};function Df(){return new Ef}var Of=Df(),kf={info:3600,success:3e3,warning:5e3,error:6e3},Af,jf=[],Mf=0,Nf=new Set;function Pf(){for(let e of[...Nf])e()}function Ff(e,t,n){let r=t.trim();if(!r||Af?.message===r||jf.some(e=>e.message===r))return;let i={id:++Mf,kind:e,message:r,duration:n?.duration??kf[e],...n?.action?{action:n.action}:{}};Af?jf=[...jf,i].slice(-3):Af=i,Pf()}function If(e){Af?.id===e&&(Af=jf[0],jf=jf.slice(1),Pf())}var V=Object.assign((e,t)=>Ff(`info`,e,t),{success:(e,t)=>Ff(`success`,e,t),error:(e,t)=>Ff(`error`,e,t),warning:(e,t)=>Ff(`warning`,e,t),info:(e,t)=>Ff(`info`,e,t)});function Lf(e){return Nf.add(e),()=>{Nf.delete(e)}}function Rf(){return{item:(0,m.useSyncExternalStore)(Lf,()=>Af,()=>void 0),waiting:(0,m.useSyncExternalStore)(Lf,()=>jf.length,()=>0)}}var zf=/^[a-f0-9]{32}$/;function Bf(){return globalThis.location}function Vf(){let e=Bf()?.search??``,t=new URLSearchParams(e).getAll(`project`);if(t.length){if(t.length!==1||!zf.test(t[0]))throw Error(`Invalid project ID. Choose a running project below.`);return t[0]}}function Hf(e){if(!e.startsWith(`/api/`)&&!e.startsWith(`/files/preview/`))return e;let t=Vf();return t?`/projects/${t}${e}`:e}function Uf(e,t){if(!zf.test(e))throw Error(`Invalid project ID.`);let n=Bf();if(!n)throw Error(`Project switching requires a browser.`);let r=new URL(n.origin);r.pathname=n.pathname,r.searchParams.set(`project`,e),r.hash=`/${t}`,n.assign(r.href)}var Wf=class extends Error{code;status;constructor(e,t,n){super(e),this.name=`ApiError`,this.code=t,this.status=n}},Gf={"Content-Type":`application/json`};async function Kf(e,t={}){let n=await fetch(e===`auth.login`||e===`projects.list`?`/api/${e}`:Hf(`/api/${e}`),{method:`POST`,headers:Gf,body:JSON.stringify(t),credentials:`same-origin`}),r=await n.json().catch(()=>void 0);if(!r)throw new Wf(`the lobby answered ${n.status}`,`failed`,n.status);if(!r.ok)throw r.code===`unauthorized`&&Of.onStatus({signedOut:!0}),new Wf(r.error,r.code,n.status);return r.result}function qf(){return globalThis.location}async function Jf(){let e=qf(),t=e?new URLSearchParams(e.hash.replace(/^#/,``)).get(`token`):null;if(!t||!(await fetch(`/api/auth.login`,{method:`POST`,headers:Gf,body:JSON.stringify({token:t}),credentials:`same-origin`}).catch(()=>void 0))?.ok)return!1;let n=globalThis.history;return n&&n.replaceState(null,``,e.pathname+e.search),Of.onStatus({signedOut:!1}),!0}function Yf(e){return e instanceof Error?e.message:`That did not work. Try again.`}async function H(e,t,n={}){try{let r=await Kf(e,t),i=r.notice;return i&&V(i,n.undo?{action:{label:`Undo`,onClick:n.undo}}:void 0),r}catch(e){V.error(Yf(e));return}}var Xf=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Zf(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Xf(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Qf=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},$f=e=>{let t=Qf(e);return t.charAt(0).toUpperCase()+t.slice(1)},ep=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),tp={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function np(e){return e!=null}function rp(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??tp.width,a=e.size??e.height??tp.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?ep(...c):ep(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??tp[`stroke-width`])*Number(e.size??e.width??tp.width)/Number(t.size??t.width??tp.width):t.strokeWidth??tp[`stroke-width`];return[`svg`,{...Object.entries(tp).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&np(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&np(t.width)&&{[r(`width`)]:t.width},...`height`in t&&np(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function ip(e,t={}){return rp(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var ap=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},op=(0,m.createContext)({}),sp=()=>(0,m.useContext)(op),cp=(0,m.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=sp()??{},b=!!c||ap(d),[x,S,C=[]]=ip(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:ep(y,s),hasA11yProp:b,attributes:d});return(0,m.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,m.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function U(e,t=[],n=[]){let r=typeof e==`string`?Zf(e,t,n):e,i=(0,m.forwardRef)(({className:e,...t},n)=>(0,m.createElement)(cp,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=$f(r.name)),i}var lp={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};lp.node;var up=U(lp),dp={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};dp.node;var fp=U(dp),pp={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};pp.node;var mp=U(pp),hp={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};hp.node;var gp=U(hp),_p={name:`arrow-right-to-line`,size:24,node:[[`path`,{d:`M17 12H3`,key:`8awo09`}],[`path`,{d:`m11 18 6-6-6-6`,key:`8c2y43`}],[`path`,{d:`M21 5v14`,key:`nzette`}]]};_p.node;var vp=U(_p),yp={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};yp.node;var bp=U(yp),xp={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};xp.node;var Sp=U(xp),Cp={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};Cp.node;var wp=U(Cp),Tp={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]};Tp.node;var Ep=U(Tp),Dp={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Dp.node;var Op=U(Dp),kp={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};kp.node;var Ap=U(kp),jp={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};jp.node;var Mp=U(jp),Np={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Np.node;var Pp=U(Np),Fp={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};Fp.node;var Ip=U(Fp),Lp={name:`chevrons-up`,size:24,node:[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]};Lp.node;var Rp=U(Lp),zp={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};zp.node;var Bp=U(zp),Vp={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Vp.node;var Hp=U(Vp),Up={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};Up.node;var Wp=U(Up),Gp={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Gp.node;var Kp=U(Gp),qp={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};qp.node;var Jp=U(qp),Yp={name:`circle-stop`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]],aliases:[`stop-circle`]};Yp.node;var Xp=U(Yp),Zp={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};Zp.node;var Qp=U(Zp),$p={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};$p.node;var em=U($p),tm={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};tm.node;var nm=U(tm),rm={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};rm.node;var im=U(rm),am={name:`compass`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]};am.node;var om=U(am),sm={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};sm.node;var cm=U(sm),lm={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};lm.node;var um=U(lm),dm={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};dm.node;var fm=U(dm),pm={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};pm.node;var mm=U(pm),hm={name:`file-pen`,size:24,node:[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]],aliases:[`file-edit`]};hm.node;var gm=U(hm),_m={name:`file-plus`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]};_m.node;var vm=U(_m),ym={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};ym.node;var bm=U(ym),xm={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};xm.node;var Sm=U(xm),Cm={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};Cm.node;var wm=U(Cm),Tm={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};Tm.node;var Em=U(Tm),Dm={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Dm.node;var Om=U(Dm),km={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};km.node;var Am=U(km),jm={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};jm.node;var Mm=U(jm),Nm={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};Nm.node;var Pm=U(Nm),Fm={name:`list-plus`,size:24,node:[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]};Fm.node;var Im=U(Fm),Lm={name:`loader`,size:24,node:[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]};Lm.node;var Rm=U(Lm),zm={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]};zm.node;var Bm=U(zm),Vm={name:`maximize`,size:24,node:[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]};Vm.node;var Hm=U(Vm),Um={name:`message-circle-question-mark`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`message-circle-question`]};Um.node;var Wm=U(Um),Gm={name:`message-square-plus`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]};Gm.node;var Km=U(Gm),qm={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};qm.node;var Jm=U(qm),Ym={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};Ym.node;var Xm=U(Ym),Zm={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};Zm.node;var Qm=U(Zm),$m={name:`minimize`,size:24,node:[[`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`,key:`hohbtr`}],[`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`,key:`5jw1f3`}],[`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`,key:`198tvr`}],[`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`,key:`ph8mxp`}]]};$m.node;var eh=U($m),th={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};th.node;var nh=U(th),rh={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};rh.node;var ih=U(rh),ah={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};ah.node;var oh=U(ah),sh={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};sh.node;var ch=U(sh),lh={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};lh.node;var uh=U(lh),dh={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};dh.node;var fh=U(dh),ph={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};ph.node;var mh=U(ph),hh={name:`pen-tool`,size:24,node:[[`path`,{d:`M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z`,key:`nt11vn`}],[`path`,{d:`m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18`,key:`15qc1e`}],[`path`,{d:`m2.3 2.3 7.286 7.286`,key:`1wuzzi`}],[`circle`,{cx:`11`,cy:`11`,r:`2`,key:`xmgehs`}]]};hh.node;var gh=U(hh),_h={name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]};_h.node;var vh=U(_h),yh={name:`pencil-off`,size:24,node:[[`path`,{d:`m10 10-6.157 6.162a2 2 0 0 0-.5.833l-1.322 4.36a.5.5 0 0 0 .622.624l4.358-1.323a2 2 0 0 0 .83-.5L14 13.982`,key:`bjo8r8`}],[`path`,{d:`m12.829 7.172 4.359-4.346a1 1 0 1 1 3.986 3.986l-4.353 4.353`,key:`16h5ne`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};yh.node;var bh=U(yh),xh={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};xh.node;var Sh=U(xh),Ch={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};Ch.node;var wh=U(Ch),Th={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Th.node;var Eh=U(Th),Dh={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};Dh.node;var Oh=U(Dh),kh={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};kh.node;var Ah=U(kh),jh={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};jh.node;var Mh=U(jh),Nh={name:`route`,size:24,node:[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]};Nh.node;var Ph=U(Nh),Fh={name:`save`,size:24,node:[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]};Fh.node;var Ih=U(Fh),Lh={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Lh.node;var Rh=U(Lh),zh={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};zh.node;var Bh=U(zh),Vh={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};Vh.node;var Hh=U(Vh),Uh={name:`square-arrow-out-up-right`,size:24,node:[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]],aliases:[`arrow-up-right-from-square`]};Uh.node;var Wh=U(Uh),Gh={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};Gh.node;var Kh=U(Gh),qh={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};qh.node;var Jh=U(qh),Yh={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};Yh.node;var Xh=U(Yh),Zh={name:`tags`,size:24,node:[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]};Zh.node;var Qh=U(Zh),$h={name:`telescope`,size:24,node:[[`path`,{d:`m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44`,key:`k4qptu`}],[`path`,{d:`m13.56 11.747 4.332-.924`,key:`19l80z`}],[`path`,{d:`m16 21-3.105-6.21`,key:`7oh9d`}],[`path`,{d:`M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z`,key:`m7xp4m`}],[`path`,{d:`m6.158 8.633 1.114 4.456`,key:`74o979`}],[`path`,{d:`m8 21 3.105-6.21`,key:`1fvxut`}],[`circle`,{cx:`12`,cy:`13`,r:`2`,key:`1c1ljs`}]]};$h.node;var eg=U($h),tg={name:`timer`,size:24,node:[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]};tg.node;var ng=U(tg),rg={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};rg.node;var ig=U(rg),ag={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};ag.node;var og=U(ag),sg={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};sg.node;var cg=U(sg),lg={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};lg.node;var ug=U(lg),dg={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};dg.node;var fg=U(dg),pg={name:`volume-2`,size:24,node:[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]};pg.node;var mg=U(pg),hg={name:`volume-x`,size:24,node:[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]};hg.node;var gg=U(hg),_g={name:`wifi-off`,size:24,node:[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};_g.node;var vg=U(_g),yg={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};yg.node;var bg=U(yg),xg={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};xg.node;var Sg=U(xg);function Cg(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Cg(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function wg(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Cg(e))&&(r&&(r+=` `),r+=t);return r}var Tg=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Eg=wg,Dg=(e,t)=>n=>{if(t?.variants==null)return Eg(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Tg(t)||Tg(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Eg(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Og=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},kg=(e,t)=>({classGroupId:e,validator:t}),Ag=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),jg=`-`,Mg=[],Ng=`arbitrary..`,Pg=e=>{let t=Lg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Ig(e);let n=e.split(jg);return Fg(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Og(i,t):t:i||Mg}return n[e]||Mg}}},Fg=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Fg(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(jg):e.slice(t).join(jg),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Ig=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ng+r:void 0})(),Lg=e=>{let{theme:t,classGroups:n}=e;return Rg(n,t)},Rg=(e,t)=>{let n=Ag();for(let r in e){let i=e[r];zg(i,n,r,t)}return n},zg=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Bg(i,t,n,r)}},Bg=(e,t,n,r)=>{if(typeof e==`string`){Vg(e,t,n);return}if(typeof e==`function`){Hg(e,t,n,r);return}Ug(e,t,n,r)},Vg=(e,t,n)=>{let r=e===``?t:Wg(t,e);r.classGroupId=n},Hg=(e,t,n,r)=>{if(Gg(e)){zg(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(kg(n,e))},Ug=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];zg(o,Wg(t,a),n,r)}},Wg=(e,t)=>{let n=e,r=t.split(jg),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Ag(),n.nextPart.set(t,i)),n=i}return n},Gg=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Kg=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},qg=`!`,Jg=`:`,Yg=[],Xg=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Zg=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Jg){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(qg)?(c=s.slice(0,-1),l=!0):s.startsWith(qg)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Xg(t,l,c,u)};if(t){let e=t+Jg,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Xg(Yg,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Qg=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},$g=e=>({cache:Kg(e.cacheSize),parseClassName:Zg(e),sortModifiers:Qg(e),postfixLookupClassGroupIds:e_(e),...Pg(e)}),e_=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},t_=/\s+/,n_=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(t_),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+qg:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},r_=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=i_(n))&&(i&&(i+=` `),i+=r);return i},i_=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=i_(e[r]))&&(n&&(n+=` `),n+=t);return n},a_=(e,...t)=>{let n,r,i,a,o=o=>(n=$g(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=n_(e,n);return i(e,a),a};return a=o,(...e)=>a(r_(...e))},o_=[],s_=e=>{let t=t=>t[e]||o_;return t.isThemeGetter=!0,t.themeKey=e,t},c_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,l_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,u_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,d_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,f_=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,p_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,m_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,h_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,g_=e=>u_.test(e),W=e=>!!e&&!Number.isNaN(Number(e)),__=e=>!!e&&Number.isInteger(Number(e)),v_=e=>e.endsWith(`%`)&&W(e.slice(0,-1)),y_=e=>d_.test(e),b_=()=>!0,x_=e=>f_.test(e)&&!p_.test(e),S_=()=>!1,C_=e=>m_.test(e),w_=e=>h_.test(e),T_=e=>!G(e)&&!K(e),E_=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),D_=e=>H_(e,K_,S_),G=e=>c_.test(e),O_=e=>H_(e,q_,x_),k_=e=>H_(e,J_,W),A_=e=>H_(e,X_,b_),j_=e=>H_(e,Y_,S_),M_=e=>H_(e,W_,S_),N_=e=>H_(e,G_,w_),P_=e=>H_(e,Z_,C_),K=e=>l_.test(e),F_=e=>U_(e,q_),I_=e=>U_(e,Y_),L_=e=>U_(e,W_),R_=e=>U_(e,K_),z_=e=>U_(e,G_),B_=e=>U_(e,Z_,!0),V_=e=>U_(e,X_,!0),H_=(e,t,n)=>{let r=c_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},U_=(e,t,n=!1)=>{let r=l_.exec(e);return r?r[1]?t(r[1]):n:!1},W_=e=>e===`position`||e===`percentage`,G_=e=>e===`image`||e===`url`,K_=e=>e===`length`||e===`size`||e===`bg-size`,q_=e=>e===`length`,J_=e=>e===`number`,Y_=e=>e===`family-name`,X_=e=>e===`number`||e===`weight`,Z_=e=>e===`shadow`,Q_=a_(()=>{let e=s_(`color`),t=s_(`font`),n=s_(`text`),r=s_(`font-weight`),i=s_(`tracking`),a=s_(`leading`),o=s_(`breakpoint`),s=s_(`container`),c=s_(`spacing`),l=s_(`radius`),u=s_(`shadow`),d=s_(`inset-shadow`),f=s_(`text-shadow`),p=s_(`drop-shadow`),m=s_(`blur`),h=s_(`perspective`),g=s_(`aspect`),_=s_(`ease`),v=s_(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),K,G],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[K,G,c],T=()=>[g_,`full`,`auto`,...w()],E=()=>[__,`none`,`subgrid`,K,G],D=()=>[`auto`,{span:[`full`,__,K,G]},__,K,G],O=()=>[__,`auto`,K,G],k=()=>[`auto`,`min`,`max`,`fr`,K,G],ee=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],te=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ne=()=>[`auto`,...w()],A=()=>[g_,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],re=()=>[s,g_,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ie=()=>[g_,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],j=()=>[e,K,G],ae=()=>[...b(),L_,M_,{position:[K,G]}],oe=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],se=()=>[`auto`,`cover`,`contain`,R_,D_,{size:[K,G]}],ce=()=>[v_,F_,O_],le=()=>[``,`none`,`full`,l,K,G],ue=()=>[``,W,F_,O_],de=()=>[`solid`,`dashed`,`dotted`,`double`],fe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],pe=()=>[W,v_,L_,M_],me=()=>[``,`none`,m,K,G],he=()=>[`none`,W,K,G],ge=()=>[`none`,W,K,G],M=()=>[W,K,G],N=()=>[g_,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[y_],breakpoint:[y_],color:[b_],container:[y_],"drop-shadow":[y_],ease:[`in`,`out`,`in-out`],font:[T_],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[y_],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[y_],shadow:[y_],spacing:[`px`,W],text:[y_],"text-shadow":[y_],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,g_,G,K,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,K,G]}],"container-named":[E_],columns:[{columns:[W,`auto`,G,K,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[__,`auto`,K,G]}],basis:[{basis:[g_,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[W,g_,`auto`,`initial`,`none`,G]}],grow:[{grow:[``,W,K,G]}],shrink:[{shrink:[``,W,K,G]}],order:[{order:[__,`first`,`last`,`none`,K,G]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ee(),`normal`]}],"justify-items":[{"justify-items":[...te(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...te()]}],"align-content":[{content:[`normal`,...ee()]}],"align-items":[{items:[...te(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...te(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...te(),`baseline`]}],"place-self":[{"place-self":[`auto`,...te()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:ne()}],mx:[{mx:ne()}],my:[{my:ne()}],ms:[{ms:ne()}],me:[{me:ne()}],mbs:[{mbs:ne()}],mbe:[{mbe:ne()}],mt:[{mt:ne()}],mr:[{mr:ne()}],mb:[{mb:ne()}],ml:[{ml:ne()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:A()}],"inline-size":[{inline:[`auto`,...re()]}],"min-inline-size":[{"min-inline":[`auto`,...re()]}],"max-inline-size":[{"max-inline":[`none`,...re()]}],"block-size":[{block:[`auto`,...ie()]}],"min-block-size":[{"min-block":[`auto`,...ie()]}],"max-block-size":[{"max-block":[`none`,...ie()]}],w:[{w:[s,`screen`,...A()]}],"min-w":[{"min-w":[s,`screen`,`none`,...A()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...A()]}],h:[{h:[`screen`,`lh`,...A()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...A()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...A()]}],"font-size":[{text:[`base`,n,F_,O_]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,V_,A_]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,v_,G]}],"font-family":[{font:[I_,j_,t]}],"font-features":[{"font-features":[G]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,K,G]}],"line-clamp":[{"line-clamp":[W,`none`,K,k_]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,K,G]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,K,G]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...de(),`wavy`]}],"text-decoration-thickness":[{decoration:[W,`from-font`,`auto`,K,O_]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[W,`auto`,K,G]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[__,K,G]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,K,G]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,K,G]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ae()}],"bg-repeat":[{bg:oe()}],"bg-size":[{bg:se()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},__,K,G],radial:[``,K,G],conic:[``,__,K,G]},z_,N_]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...de(),`hidden`,`none`]}],"divide-style":[{divide:[...de(),`hidden`,`none`]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...de(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[W,K,G]}],"outline-w":[{outline:[``,W,F_,O_]}],"outline-color":[{outline:j()}],shadow:[{shadow:[``,`inner`,`none`,u,B_,P_]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":[`none`,d,B_,P_]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:ue()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[W,O_]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":[`none`,f,B_,P_]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[W,K,G]}],"mix-blend":[{"mix-blend":[...fe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":fe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[W]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[K,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[W]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ae()}],"mask-repeat":[{mask:oe()}],"mask-size":[{mask:se()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,K,G]}],filter:[{filter:[``,`none`,K,G]}],blur:[{blur:me()}],brightness:[{brightness:[W,K,G]}],contrast:[{contrast:[W,K,G]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,B_,P_]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:[``,W,K,G]}],"hue-rotate":[{"hue-rotate":[W,K,G]}],invert:[{invert:[``,W,K,G]}],saturate:[{saturate:[W,K,G]}],sepia:[{sepia:[``,W,K,G]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,K,G]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[W,K,G]}],"backdrop-contrast":[{"backdrop-contrast":[W,K,G]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,W,K,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[W,K,G]}],"backdrop-invert":[{"backdrop-invert":[``,W,K,G]}],"backdrop-opacity":[{"backdrop-opacity":[W,K,G]}],"backdrop-saturate":[{"backdrop-saturate":[W,K,G]}],"backdrop-sepia":[{"backdrop-sepia":[``,W,K,G]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,K,G]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[W,`initial`,K,G]}],ease:[{ease:[`linear`,`initial`,_,K,G]}],delay:[{delay:[W,K,G]}],animate:[{animate:[`none`,v,K,G]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,K,G]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":[`scale-3d`],skew:[{skew:M()}],"skew-x":[{"skew-x":M()}],"skew-y":[{"skew-y":M()}],transform:[{transform:[K,G,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:N()}],"translate-x":[{"translate-x":N()}],"translate-y":[{"translate-y":N()}],"translate-z":[{"translate-z":N()}],"translate-none":[`translate-none`],zoom:[{zoom:[__,K,G]}],accent:[{accent:j()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,K,G]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":j()}],"scrollbar-track-color":[{"scrollbar-track":j()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,K,G]}],fill:[{fill:[`none`,...j()]}],"stroke-w":[{stroke:[W,F_,O_,k_]}],stroke:[{stroke:[`none`,...j()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function q(...e){return Q_(wg(e))}var $_=Object.defineProperty,ev=(e,t)=>$_(e,`name`,{value:t,configurable:!0});function tv(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ev(tv,`setRef`);function nv(...e){return t=>{let n=!1,r=e.map(e=>{let r=tv(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():tv(e[t],null)}}}}ev(nv,`composeRefs`);function rv(...e){return m.useCallback(nv(...e),e)}ev(rv,`useComposedRefs`);var iv=Object.defineProperty,av=(e,t)=>iv(e,`name`,{value:t,configurable:!0});function ov(e){let t=m.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];hv(r)&&typeof yv==`function`&&(r=yv(r._payload)),m.Children.forEach(r,e=>{if(pv(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;hv(n)&&typeof yv==`function`&&(n=yv(n._payload)),a=uv(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=m.cloneElement(a,void 0,s):!o&&m.Children.count(r)===1&&m.isValidElement(r)&&(a=r);let c=a?fv(a):void 0,l=rv(n,c);if(!a){if(r||r===0)throw Error(o?vv(e):_v(e));return r}let u=dv(i,a.props??{});return a.type!==m.Fragment&&(u.ref=n?l:c),m.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}av(ov,`createSlot`);var sv=ov(`Slot`),cv=Symbol.for(`radix.slottable`);function lv(e){let t=av(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=cv,t}av(lv,`createSlottable`);var uv=av((e,t)=>{if(`child`in e.props){let t=e.props.child;return m.isValidElement(t)?m.cloneElement(t,void 0,e.props.children(t.props.children)):null}return m.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function dv(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}av(dv,`mergeProps`);function fv(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}av(fv,`getElementRef`);function pv(e){return m.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===cv}av(pv,`isSlottable`);var mv=Symbol.for(`react.lazy`);function hv(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===mv&&`_payload`in e&&gv(e._payload)}av(hv,`isLazyComponent`);function gv(e){return typeof e==`object`&&!!e&&`then`in e}av(gv,`isPromiseLike`);var _v=av(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),vv=av(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),yv=m.use,bv=l(xf(),1),xv=Object.defineProperty,Sv=(e,t)=>xv(e,`name`,{value:t,configurable:!0}),Cv=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=ov(`Primitive.${t}`),r=m.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,L.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function wv(e,t){e&&bv.flushSync(()=>e.dispatchEvent(t))}Sv(wv,`dispatchDiscreteCustomEvent`);var Tv=Object.defineProperty,Ev=(e,t)=>Tv(e,`name`,{value:t,configurable:!0}),Dv=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Ov=m.forwardRef(Ev(function(e,t){return(0,L.jsx)(Cv.span,{...e,ref:t,style:{...Dv,...e.style}})},`VisuallyHidden`)),kv=Object.defineProperty,Av=(e,t)=>kv(e,`name`,{value:t,configurable:!0});function jv(e,t){let n=m.createContext(t);n.displayName=e+`Context`;let r=Av(e=>{let{children:t,...r}=e,i=m.useMemo(()=>r,Object.values(r));return(0,L.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=m.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Av(i,`useContext`),[r,i]}Av(jv,`createContext`);function Mv(e,t=[]){let n=[];function r(t,r){let i=m.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Av(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=m.useMemo(()=>o,Object.values(o));return(0,L.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=m.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Av(s,`useContext`),[o,s]}Av(r,`createContext`);let i=Av(()=>{let t=n.map(e=>m.createContext(e));return Av(function(n){let r=n?.[e]||t;return m.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Nv(i,...t)]}Av(Mv,`createContextScope`);function Nv(...e){let t=e[0];if(e.length===1)return t;let n=Av(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Av(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Av(Nv,`composeContextScopes`);var Pv=Object.defineProperty,Fv=(e,t)=>Pv(e,`name`,{value:t,configurable:!0}),Iv=!!(typeof window<`u`&&window.document&&window.document.createElement);function Lv(e,t,{checkForDefaultPrevented:n=!0}={}){return Fv(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Fv(Lv,`composeEventHandlers`);function Rv(e){if(!Iv)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Fv(Rv,`getOwnerWindow`);function zv(e){if(!Iv)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Fv(zv,`getOwnerDocument`);function Bv(e,t=!1){let{activeElement:n}=zv(e);if(!n?.nodeName)return null;if(Vv(n)&&n.contentDocument)return Bv(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=zv(n).getElementById(e);if(t)return t}}return n}Fv(Bv,`getActiveElement`);function Vv(e){return e.tagName===`IFRAME`}Fv(Vv,`isFrame`);var Hv=globalThis?.document?m.useLayoutEffect:()=>{},Uv=Object.defineProperty,Wv=(e,t)=>Uv(e,`name`,{value:t,configurable:!0}),Gv=m.useEffectEvent,Kv=m.useInsertionEffect;function qv(e){if(typeof Gv==`function`)return Gv(e);let t=m.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Kv==`function`?Kv(()=>{t.current=e}):Hv(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}Wv(qv,`useEffectEvent`);var Jv=Object.defineProperty,Yv=(e,t)=>Jv(e,`name`,{value:t,configurable:!0}),Xv=m.useInsertionEffect||Hv;function Zv({prop:e,defaultProp:t,onChange:n=Yv(()=>{},`onChange`),caller:r}){let[i,a,o]=Qv({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,m.useCallback(t=>{if(s){let n=$v(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Yv(Zv,`useControllableState`);function Qv({defaultProp:e,onChange:t}){let[n,r]=m.useState(e),i=m.useRef(n),a=m.useRef(t);return Xv(()=>{a.current=t},[t]),m.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Yv(Qv,`useUncontrolledState`);function $v(e){return typeof e==`function`}Yv($v,`isFunction`);var ey=Symbol(`RADIX:SYNC_STATE`);function ty(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=qv(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=m.useReducer((t,n)=>{if(n.type===ey)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,h=m.useRef(p);m.useEffect(()=>{h.current!==p&&(h.current=p,c||l(p))},[p,h,c]);let g=m.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return m.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:ey,state:i})},[i,d.state,c]),[g,f]}Yv(ty,`useControllableStateReducer`);var ny=Object.defineProperty,ry=(e,t)=>ny(e,`name`,{value:t,configurable:!0});function iy(e,t){return m.useReducer((e,n)=>t[e][n]??e,e)}ry(iy,`useStateMachine`);var ay=ry(e=>{let{present:t,children:n}=e,r=oy(t),i=typeof n==`function`?n({present:r.isPresent}):m.Children.only(n),a=cy(r.ref,uy(i));return typeof n==`function`||r.isPresent?m.cloneElement(i,{ref:a}):null},`Presence`);function oy(e){let[t,n]=m.useState(),r=m.useRef(null),i=m.useRef(e),a=m.useRef(`none`),o=m.useRef(void 0),[s,c]=iy(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return m.useEffect(()=>{s===`mounted`?(a.current=o.current??ly(r.current),o.current=void 0):a.current=`none`},[s]),Hv(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=ly(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Hv(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=ry(a=>{let o=ly(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=ry(e=>{e.target===t&&(a.current=ly(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:m.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=ly(t)}else r.current=null;n(e)},[])}}ry(oy,`usePresence`);function sy(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ry(sy,`setRef`);function cy(...e){let t=m.useRef(e);return t.current=e,m.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=sy(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():sy(n[e],null)}}},[])}ry(cy,`useStableComposedRefs`);function ly(e){return e?.animationName||`none`}ry(ly,`getAnimationName`);function uy(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}ry(uy,`getElementRef`);var dy=Object.defineProperty,fy=(e,t)=>dy(e,`name`,{value:t,configurable:!0}),py=m.useId||(()=>void 0),my=0;function hy(e){let[t,n]=m.useState(py());return Hv(()=>{e||n(e=>e??String(my++))},[e]),e||(t?`radix-${t}`:``)}fy(hy,`useId`);var gy=Object.defineProperty,_y=(e,t)=>gy(e,`name`,{value:t,configurable:!0});function vy(e){let t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}_y(vy,`useCallbackRef`);var yy=Object.defineProperty,by=(e,t)=>yy(e,`name`,{value:t,configurable:!0}),xy=`dismissableLayer.update`,Sy=`dismissableLayer.pointerDownOutside`,Cy=`dismissableLayer.focusOutside`,wy,Ty=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ey=m.forwardRef(by(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=m.useContext(Ty),[d,f]=m.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=m.useState({}),g=rv(t,f),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=d?_.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=m.useRef(!1),w=ky(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=Ay(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===_.length-1:!1,D=vy(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return m.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),m.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(wy=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),jy(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=wy))}},[d,p,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),jy())},[d,u]),m.useEffect(()=>{let e=by(()=>h({}),`handleUpdate`);return document.addEventListener(xy,e),()=>document.removeEventListener(xy,e)},[]),(0,L.jsx)(Cv.div,{...l,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:Lv(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Lv(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Lv(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Dy(){let e=m.useContext(Ty),[t,n]=m.useState(null);return m.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}by(Dy,`useDismissableLayerSurface`);var Oy=by(()=>!0,`IS_TRUE`);function ky(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Oy}=t,s=vy(e),c=m.useRef(!1),l=m.useRef(!1),u=m.useRef(new Map),d=m.useRef(()=>{});return m.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}by(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}by(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}by(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}by(p,`handleInteractionBubble`);let m=by(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||My(Sy,s,p,{discrete:!0})};if(by(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:by(()=>c.current=!0,`onPointerDownCapture`)}}by(ky,`usePointerDownOutside`);function Ay(e,t=globalThis?.document){let n=vy(e),r=m.useRef(!1);return m.useEffect(()=>{let e=by(e=>{e.target&&!r.current&&My(Cy,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:by(()=>r.current=!0,`onFocusCapture`),onBlurCapture:by(()=>r.current=!1,`onBlurCapture`)}}by(Ay,`useFocusOutside`);function jy(){let e=new CustomEvent(xy);document.dispatchEvent(e)}by(jy,`dispatchUpdate`);function My(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?wv(i,a):i.dispatchEvent(a)}by(My,`handleAndDispatchCustomEvent`);var Ny=Object.defineProperty,Py=(e,t)=>Ny(e,`name`,{value:t,configurable:!0}),Fy=`focusScope.autoFocusOnMount`,Iy=`focusScope.autoFocusOnUnmount`,Ly={bubbles:!1,cancelable:!0},Ry=m.forwardRef(Py(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=m.useState(null),l=vy(i),u=vy(a),d=m.useRef(null),f=rv(t,c),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Gy(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Gy(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Gy(s)};Py(e,`handleFocusIn`),Py(t,`handleFocusOut`),Py(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),m.useEffect(()=>{if(s){Ky.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Fy,Ly);s.addEventListener(Fy,l),s.dispatchEvent(t),t.defaultPrevented||(zy(Yy(Vy(s)),{select:!0}),document.activeElement===e&&Gy(s))}return()=>{s.removeEventListener(Fy,l),setTimeout(()=>{let t=new CustomEvent(Iy,Ly);s.addEventListener(Iy,u),s.dispatchEvent(t),t.defaultPrevented||Gy(e??document.body,{select:!0}),s.removeEventListener(Iy,u),Ky.remove(p)},0)}}},[s,l,u,p]);let h=m.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=By(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Gy(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Gy(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,L.jsx)(Cv.div,{tabIndex:-1,...o,ref:f,onKeyDown:h})},`FocusScope`));function zy(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Gy(r,{select:t}),document.activeElement!==n)return}Py(zy,`focusFirst`);function By(e){let t=Vy(e);return[Hy(t,e),Hy(t.reverse(),e)]}Py(By,`getTabbableEdges`);function Vy(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Py(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Py(Vy,`getTabbableCandidates`);function Hy(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Uy(r,{upTo:t})))return r}Py(Hy,`findVisible`);function Uy(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Py(Uy,`isHidden`);function Wy(e){return e instanceof HTMLInputElement&&`select`in e}Py(Wy,`isSelectableInput`);function Gy(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Wy(e)&&t&&e.select()}}Py(Gy,`focus`);var Ky=qy();function qy(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Jy(e,t),e.unshift(t)},remove(t){e=Jy(e,t),e[0]?.resume()}}}Py(qy,`createFocusScopesStack`);function Jy(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Py(Jy,`arrayRemove`);function Yy(e){return e.filter(e=>e.tagName!==`A`)}Py(Yy,`removeLinks`);var Xy=Object.defineProperty,Zy=m.forwardRef(((e,t)=>Xy(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=m.useState(!1);Hv(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?bv.createPortal((0,L.jsx)(Cv.div,{...r,ref:t}),o):null},`Portal`)),Qy=Object.defineProperty,$y=(e,t)=>Qy(e,`name`,{value:t,configurable:!0}),eb=0,tb=null;function nb(e){return rb(),e.children}$y(nb,`FocusGuards`);function rb(){m.useEffect(()=>{tb||={start:ib(),end:ib()};let{start:e,end:t}=tb;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),eb++,()=>{eb===1&&(tb?.start.remove(),tb?.end.remove(),tb=null),eb=Math.max(0,eb-1)}},[])}$y(rb,`useFocusGuards`);function ib(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}$y(ib,`createFocusGuard`);var ab=function(){return ab=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ab.apply(this,arguments)};function ob(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function sb(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var cb=`right-scroll-bar-position`,lb=`width-before-scroll-bar`,ub=`with-scroll-bars-hidden`,db=`--removed-body-scroll-bar-size`;function fb(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function pb(e,t){var n=(0,m.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var mb=typeof window<`u`?m.useLayoutEffect:m.useEffect,hb=new WeakMap;function gb(e,t){var n=pb(t||null,function(t){return e.forEach(function(e){return fb(e,t)})});return mb(function(){var t=hb.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||fb(e,null)}),i.forEach(function(e){r.has(e)||fb(e,a)})}hb.set(n,e)},[e]),n}function _b(e){return e}function vb(e,t){t===void 0&&(t=_b);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function yb(e){e===void 0&&(e={});var t=vb(null);return t.options=ab({async:!0,ssr:!1},e),t}var bb=function(e){var t=e.sideCar,n=ob(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return m.createElement(r,ab({},n))};bb.isSideCarExport=!0;function xb(e,t){return e.useMedium(t),bb}var Sb=yb(),Cb=function(){},wb=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Cb,onWheelCapture:Cb,onTouchMoveCapture:Cb}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=ob(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=gb([n,t]),w=ab(ab({},x),i);return m.createElement(m.Fragment,null,u&&m.createElement(S,{sideCar:Sb,removeScrollBar:l,shards:d,noRelative:p,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?m.cloneElement(m.Children.only(s),ab(ab({},w),{ref:C})):m.createElement(y,ab({},w,{className:c,ref:C}),s))});wb.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},wb.classNames={fullWidth:lb,zeroRight:cb};var Tb=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Eb(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Tb();return t&&e.setAttribute(`nonce`,t),e}function Db(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ob(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var kb=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Eb())&&(Db(t,n),Ob(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ab=function(){var e=kb();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},jb=function(){var e=Ab();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Mb={left:0,top:0,right:0,gap:0},Nb=function(e){return parseInt(e||``,10)||0},Pb=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Nb(n),Nb(r),Nb(i)]},Fb=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Mb;var t=Pb(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ib=jb(),Lb=`data-scroll-locked`,Rb=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
17
|
+
`+e.stack}}var Re=Object.prototype.hasOwnProperty,ze=t.unstable_scheduleCallback,Be=t.unstable_cancelCallback,Ve=t.unstable_shouldYield,He=t.unstable_requestPaint,Ue=t.unstable_now,We=t.unstable_getCurrentPriorityLevel,Ge=t.unstable_ImmediatePriority,Ke=t.unstable_UserBlockingPriority,qe=t.unstable_NormalPriority,Je=t.unstable_LowPriority,Ye=t.unstable_IdlePriority,Xe=t.log,Ze=t.unstable_setDisableYieldValue,Qe=null,$e=null;function et(e){if(typeof Xe==`function`&&Ze(e),$e&&typeof $e.setStrictMode==`function`)try{$e.setStrictMode(Qe,e)}catch{}}var tt=Math.clz32?Math.clz32:it,nt=Math.log,rt=Math.LN2;function it(e){return e>>>=0,e===0?32:31-(nt(e)/rt|0)|0}var at=256,ot=262144,st=4194304;function ct(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 lt(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=ct(n))):i=ct(o):i=ct(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ct(n))):i=ct(o)):i=ct(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 ut(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function dt(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-tt(n),i=1<<r;t|=e[r],n&=~i}return t}function ft(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 pt(){var e=st;return st<<=1,!(st&62914560)&&(st=4194304),e}function mt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ht(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gt(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-tt(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&&_t(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function _t(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-tt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-tt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function yt(e,t){var n=t&-t;return n=n&42?1:bt(n),(n&(e.suspendedLanes|t))===0?n:0}function bt(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 xt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function St(){var e=N.p;return e===0?(e=window.event,e===void 0?32:Nh(e.type)):e}function Ct(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var wt=Math.random().toString(36).slice(2),Tt=`__reactFiber$`+wt,Et=`__reactProps$`+wt,Dt=`__reactContainer$`+wt,Ot=`__reactEvents$`+wt,kt=`__reactListeners$`+wt,At=`__reactHandles$`+wt,jt=`__reactResources$`+wt,Mt=`__reactMarker$`+wt,Nt=`__reactLoad$`+wt;function Pt(e){delete e[Tt],delete e[Et],delete e[kt],delete e[At]}function Ft(e){var t;if(t=e[Tt])return t;for(var n=e.parentNode;n;){if(t=n[Dt]||n[Tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Sm(e);e!==null;){if(n=e[Tt])return n;e=Sm(e)}return t}e=n,n=e.parentNode}return null}function It(e){if(e=e[Tt]||e[Dt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function P(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Lt(e){var t=e[jt];return t||=e[jt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Rt(e){e[Mt]=!0}function zt(e){e[Nt]=void 0}var Bt=new Set,Vt={};function Ht(e,t){Ut(e,t),Ut(e+`Capture`,t)}function Ut(e,t){for(Vt[e]=t,e=0;e<t.length;e++)Bt.add(t[e])}var Wt=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]*$`),Gt={},Kt={};function qt(e){return Re.call(Kt,e)?!0:Re.call(Gt,e)?!1:Wt.test(e)?Kt[e]=!0:(Gt[e]=!0,!1)}var Jt=!1;function Yt(){var e=Jt;return Jt=!1,e}function Xt(e,t,n){if(qt(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 Zt(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 Qt(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 $t(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function en(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function tn(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 nn(e){if(!e._valueTracker){var t=en(e)?`checked`:`value`;e._valueTracker=tn(e,t,``+e[t])}}function rn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=en(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var an=/[\n"\\]/g;function on(e){return e.replace(an,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function sn(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=``+$t(t)):e.value!==``+$t(t)&&(e.value=``+$t(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):ln(e,$t(n)):o===`number`&&e.value==t?ln(e,$t(e.value)):ln(e,$t(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=``+$t(s):e.removeAttribute(`name`)}function cn(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)){nn(e);return}n=n==null?``:``+$t(n),t=t==null?n:``+$t(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),nn(e)}function ln(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function un(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=``+$t(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 dn(e,t,n){if(t!=null&&(t=``+$t(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+$t(n)}function fn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ge(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=$t(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),nn(e)}function pn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var mn=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 hn(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||mn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function gn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(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]=``,Jt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(hn(e,a,r),Jt=!0)}else for(var o in t)t.hasOwnProperty(o)&&hn(e,o,t[o])}function _n(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 vn=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`]]),yn=/^[\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 bn(e){return yn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function xn(){}var Sn=null;function Cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wn=null,Tn=null;function En(e){var t=It(e);if(t&&(e=t.stateNode)){var n=e[Et]||null;a:switch(e=t.stateNode,t.type){case`input`:if(sn(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="`+on(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Et]||null;if(!a)throw Error(i(90));sn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&rn(r)}break a;case`textarea`:dn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&un(e,!!n.multiple,t,!1)}}}var Dn=!1;function On(e,t,n){if(Dn)return e(t,n);Dn=!0;try{return e(t)}finally{if(Dn=!1,(wn!==null||Tn!==null)&&(Yd(),wn&&(t=wn,e=Tn,Tn=wn=null,En(t),e)))for(t=0;t<e.length;t++)En(e[t])}}function kn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Et]||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(i(231,t,typeof n));return n}var An=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,jn=!1;if(An)try{var Mn={};Object.defineProperty(Mn,"passive",{get:function(){jn=!0}}),window.addEventListener(`test`,Mn,Mn),window.removeEventListener(`test`,Mn,Mn)}catch{jn=!1}var Nn=null,Pn=null,Fn=null;function In(){if(Fn)return Fn;var e,t=Pn,n=t.length,r,i=`value`in Nn?Nn.value:Nn.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 Fn=i.slice(e,1<r?1-r:void 0)}function Ln(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 Rn(){return!0}function zn(){return!1}function Bn(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)?Rn:zn,this.isPropagationStopped=zn,this}return T(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=Rn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Rn)},persist:function(){},isPersistent:Rn}),t}var Vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hn=Bn(Vn),Un=T({},Vn,{view:0,detail:0}),Wn=Bn(Un),Gn,Kn,qn,Jn=T({},Un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ar,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!==qn&&(qn&&e.type===`mousemove`?(Gn=e.screenX-qn.screenX,Kn=e.screenY-qn.screenY):Kn=Gn=0,qn=e),Gn)},movementY:function(e){return`movementY`in e?e.movementY:Kn}}),Yn=Bn(Jn),Xn=Bn(T({},Jn,{dataTransfer:0})),Zn=Bn(T({},Un,{relatedTarget:0})),Qn=Bn(T({},Vn,{animationName:0,elapsedTime:0,pseudoElement:0})),$n=Bn(T({},Vn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),er=Bn(T({},Vn,{data:0})),tr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},nr={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`},rr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function ir(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rr[e])?!!t[e]:!1}function ar(){return ir}var or=Bn(T({},Un,{key:function(e){if(e.key){var t=tr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Ln(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?nr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ar,charCode:function(e){return e.type===`keypress`?Ln(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Ln(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),sr=Bn(T({},Jn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),cr=Bn(T({},Vn,{submitter:0})),lr=Bn(T({},Un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ar})),ur=Bn(T({},Vn,{propertyName:0,elapsedTime:0,pseudoElement:0})),dr=Bn(T({},Jn,{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})),fr=Bn(T({},Vn,{newState:0,oldState:0,source:0})),pr=[9,13,27,32],mr=An&&`CompositionEvent`in window,hr=null;An&&`documentMode`in document&&(hr=document.documentMode);var gr=An&&`TextEvent`in window&&!hr,_r=An&&(!mr||hr&&8<hr&&11>=hr),vr=` `,yr=!1;function br(e,t){switch(e){case`keyup`:return pr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function xr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Sr=!1;function Cr(e,t){switch(e){case`compositionend`:return xr(t);case`keypress`:return t.which===32?(yr=!0,vr):null;case`textInput`:return e=t.data,e===vr&&yr?null:e;default:return null}}function wr(e,t){if(Sr)return e===`compositionend`||!mr&&br(e,t)?(e=In(),Fn=Pn=Nn=null,Sr=!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 _r&&t.locale!==`ko`?null:t.data;default:return null}}var Tr={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 Er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Tr[e.type]:t===`textarea`}function Dr(e,t,n,r){wn?Tn?Tn.push(r):Tn=[r]:wn=r,t=ip(t,`onChange`),0<t.length&&(n=new Hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Or=null,kr=null;function Ar(e){Zf(e,0)}function jr(e){if(rn(P(e)))return e}function Mr(e,t){if(e===`change`)return t}var Nr=!1;if(An){var Pr;if(An){var Fr=`oninput`in document;if(!Fr){var Ir=document.createElement(`div`);Ir.setAttribute(`oninput`,`return;`),Fr=typeof Ir.oninput==`function`}Pr=Fr}else Pr=!1;Nr=Pr&&(!document.documentMode||9<document.documentMode)}function Lr(){Or&&(Or.detachEvent(`onpropertychange`,Rr),kr=Or=null)}function Rr(e){if(e.propertyName===`value`&&jr(kr)){var t=[];Dr(t,kr,e,Cn(e)),On(Ar,t)}}function zr(e,t,n){e===`focusin`?(Lr(),Or=t,kr=n,Or.attachEvent(`onpropertychange`,Rr)):e===`focusout`&&Lr()}function Br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return jr(kr)}function Vr(e,t){if(e===`click`)return jr(t)}function Hr(e,t){if(e===`input`||e===`change`)return jr(t)}function Ur(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Wr=typeof Object.is==`function`?Object.is:Ur;function Gr(e,t){if(Wr(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(!Re.call(t,i)||!Wr(e[i],t[i]))return!1}return!0}function Kr(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 qr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jr(e,t){var n=qr(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=qr(n)}}function Yr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Kr(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=Kr(e.document)}return t}function Zr(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 Qr=An&&`documentMode`in document&&11>=document.documentMode,$r=null,ei=null,ti=null,ni=!1;function ri(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ni||$r==null||$r!==Kr(r)||(r=$r,`selectionStart`in r&&Zr(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}),ti&&Gr(ti,r)||(ti=r,r=ip(ei,`onSelect`),0<r.length&&(t=new Hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=$r)))}function ii(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ai={animationend:ii(`Animation`,`AnimationEnd`),animationiteration:ii(`Animation`,`AnimationIteration`),animationstart:ii(`Animation`,`AnimationStart`),transitionrun:ii(`Transition`,`TransitionRun`),transitionstart:ii(`Transition`,`TransitionStart`),transitioncancel:ii(`Transition`,`TransitionCancel`),transitionend:ii(`Transition`,`TransitionEnd`)},oi={},si={};An&&(si=document.createElement(`div`).style,`AnimationEvent`in window||(delete ai.animationend.animation,delete ai.animationiteration.animation,delete ai.animationstart.animation),`TransitionEvent`in window||delete ai.transitionend.transition);function ci(e){if(oi[e])return oi[e];if(!ai[e])return e;var t=ai[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in si)return oi[e]=t[n];return e}var li=ci(`animationend`),ui=ci(`animationiteration`),di=ci(`animationstart`),fi=ci(`transitionrun`),pi=ci(`transitionstart`),mi=ci(`transitioncancel`),hi=ci(`transitionend`),gi=new Map,_i=`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(` `);_i.push(`scrollEnd`);function vi(e,t){gi.set(e,t),Ht(t,[e])}var yi=0;function bi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Ad.identifierPrefix;var n=yi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function xi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Rd;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 Si(e,t){return e=xi(e),t=xi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Ci=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)},wi=[],Ti=0,Ei=0;function Di(){for(var e=Ti,t=Ei=Ti=0;t<e;){var n=wi[t];wi[t++]=null;var r=wi[t];wi[t++]=null;var i=wi[t];wi[t++]=null;var a=wi[t];if(wi[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&&ji(n,i,a)}}function Oi(e,t,n,r){wi[Ti++]=e,wi[Ti++]=t,wi[Ti++]=n,wi[Ti++]=r,Ei|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ki(e,t,n,r){return Oi(e,t,n,r),Mi(e)}function Ai(e,t){return Oi(e,null,null,t),Mi(e)}function ji(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-tt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Mi(e){if(50<zd)throw zd=0,Bd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ni={};function Pi(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 Fi(e,t,n,r){return new Pi(e,t,n,r)}function Ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Li(e,t){var n=e.alternate;return n===null?(n=Fi(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 Ri(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 zi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ii(r)&&(s=1);else if(typeof r==`string`)s=rh(e,n,Ce.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case se:return e=Fi(31,n,t,a),e.elementType=se,e.lanes=o,e;case k:return Bi(n.children,a,o,t);case ee:s=8,a|=24;break;case te:return e=Fi(12,n,t,a|2),e.elementType=te,e.lanes=o,e;case ie:return e=Fi(13,n,t,a),e.elementType=ie,e.lanes=o,e;case j:return e=Fi(19,n,t,a),e.elementType=j,e.lanes=o,e;case ce:case ue:return e=a|32,e=Fi(30,n,t,e),e.elementType=ue,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case A:s=10;break a;case ne:s=9;break a;case re:s=11;break a;case ae:s=14;break a;case oe:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Fi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Bi(e,t,n,r){return e=Fi(7,e,r,t),e.lanes=n,e}function Vi(e,t,n){return e=Fi(6,e,null,t),e.lanes=n,e}function Hi(e){var t=Fi(18,null,null,0);return t.stateNode=e,t}function Ui(e,t,n){return t=Fi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Wi=new WeakMap;function Gi(e,t){if(typeof e==`object`&&e){var n=Wi.get(e);return n===void 0?(t={value:e,source:t,stack:Le(t)},Wi.set(e,t),t):n}return{value:e,source:t,stack:Le(t)}}var Ki=[],qi=0,Ji=null,Yi=0,Xi=[],Zi=0,Qi=null,$i=1,ea=``;function ta(e,t){Ki[qi++]=Yi,Ki[qi++]=Ji,Ji=e,Yi=t}function na(e,t,n){Xi[Zi++]=$i,Xi[Zi++]=ea,Xi[Zi++]=Qi,Qi=e;var r=$i;e=ea;var i=32-tt(r)-1;r&=~(1<<i),n+=1;var a=32-tt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,$i=1<<32-tt(t)+i|n<<i|r,ea=a+e}else $i=1<<a|n<<i|r,ea=e}function ra(e){e.return!==null&&(ta(e,1),na(e,1,0))}function ia(e){for(;e===Ji;)Ji=Ki[--qi],Ki[qi]=null,Yi=Ki[--qi],Ki[qi]=null;for(;e===Qi;)Qi=Xi[--Zi],Xi[Zi]=null,ea=Xi[--Zi],Xi[Zi]=null,$i=Xi[--Zi],Xi[Zi]=null}function aa(e,t){Xi[Zi++]=$i,Xi[Zi++]=ea,Xi[Zi++]=Qi,$i=t.id,ea=t.overflow,Qi=e}var oa=null,sa=null,F=!1,ca=null,la=!1,ua=Error(i(519));function da(e){throw _a(Gi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ua}function fa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Tt]=e,t[Et]=r,n){case`dialog`:H(`cancel`,t),H(`close`,t);break;case`iframe`:case`object`:case`embed`:H(`load`,t);break;case`video`:case`audio`:for(n=0;n<Xf.length;n++)H(Xf[n],t);break;case`source`:H(`error`,t);break;case`img`:case`image`:case`link`:H(`error`,t),H(`load`,t);break;case`details`:H(`toggle`,t);break;case`input`:H(`invalid`,t),cn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:H(`invalid`,t);break;case`textarea`:H(`invalid`,t),fn(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||lp(t.textContent,n)?(r.popover!=null&&(H(`beforetoggle`,t),H(`toggle`,t)),r.onScroll!=null&&H(`scroll`,t),r.onScrollEnd!=null&&H(`scrollend`,t),r.onClick!=null&&(t.onclick=xn),t=!0):t=!1,t||da(e,!0)}function pa(e){for(oa=e.return;oa;)switch(oa.tag){case 5:case 31:case 13:la=!1;return;case 27:case 3:la=!0;return;default:oa=oa.return}}function ma(e){if(e!==oa)return!1;if(!F)return pa(e),F=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Cp(e.type,e.memoizedProps)),n=!n),n&&sa&&da(e),pa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));sa=xm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));sa=xm(e)}else t===27?(t=sa,Mp(e.type)?(e=bm,bm=null,sa=e):sa=t):sa=oa?ym(e.stateNode.nextSibling):null;return!0}function ha(){sa=oa=null,F=!1}function ga(){var e=ca;return e!==null&&(Sd===null?Sd=e:Sd.push.apply(Sd,e),ca=null),e}function _a(e){ca===null?ca=[e]:ca.push(e)}var va=be(null),ya=null,ba=null;function xa(e,t,n){Se(va,t._currentValue),t._currentValue=n}function Sa(e){e._currentValue=va.current,xe(va)}function Ca(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 wa(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ca(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ca(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Ca(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ta(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Wr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Ee.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[_h]:e.push(_h))}a=a.return}return e!==null&&wa(t,e,n,r),t.flags|=262144,e!==null}function Ea(e){for(e=e.firstContext;e!==null;){if(!Wr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Da(e){ya=e,ba=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Oa(e){return Aa(ya,e)}function ka(e,t){return ya===null&&Da(e),Aa(e,t)}function Aa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ba===null){if(e===null)throw Error(i(308));ba=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ba=ba.next=t;return n}var ja=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()})}},Ma=t.unstable_scheduleCallback,Na=t.unstable_NormalPriority,Pa={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Fa(){return{controller:new ja,data:new Map,refCount:0}}function Ia(e){e.refCount--,e.refCount===0&&Ma(Na,function(){e.controller.abort()})}function La(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 Ra=null;function za(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ba=null,Va=0,Ha=0,Ua=null;function Wa(e,t){if(Ba===null){var n=Ba=[];Va=0,Ha=Gf(),Ua={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Va++,t.then(Ga,Ga),t}function Ga(){if(--Va===0&&(Ra=null,Ba!==null)){Ua!==null&&(Ua.status=`fulfilled`);var e=Ba;Ba=null,Ha=0,Ua=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ka(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 qa=M.S;M.S=function(e,t){if(Td=Ue(),typeof t==`object`&&t&&typeof t.then==`function`&&Wa(e,t),Ra!==null)for(var n=Mf;n!==null;)La(n,Ra),n=n.next;if(n=e.types,n!==null){for(var r=Mf;r!==null;)La(r,n),r=r.next;if(Ha!==0){r=Ra,r===null&&(r=Ra=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}qa!==null&&qa(e,t)};var Ja=be(null);function Ya(){var e=Ja.current;return e===null?sd.pooledCache:e}function Xa(e,t){t===null?Se(Ja,Ja.current):Se(Ja,t.pool)}function Za(){var e=Ya();return e===null?null:{parent:Pa._currentValue,pool:e}}var Qa=Error(i(460)),$a=Error(i(474)),eo=Error(i(542)),to={then:function(){}};function no(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ro(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(xn,xn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,so(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(xn,xn);else{if(e=sd,e!==null&&100<e.shellSuspendCounter)throw Error(i(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,so(e),e}throw ao=t,Qa}}function io(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ao=e,Qa):e}}var ao=null;function oo(){if(ao===null)throw Error(i(459));var e=ao;return ao=null,e}function so(e){if(e===Qa||e===eo)throw Error(i(483))}var co=null,lo=0;function uo(e){var t=lo;return lo+=1,co===null&&(co=[]),ro(co,e,t)}function fo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function po(e,t){throw t.$$typeof===E?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function mo(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 a(e,t){return e=Li(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=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=Vi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===k?(e=d(e,t,n.props.children,r,n.key),fo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===oe&&io(i)===t.type)?(t=a(t,n.props),fo(t,n),t.return=e,t):(t=zi(n.type,n.key,n.props,null,e.mode,r),fo(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=Ui(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Bi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Vi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case D:return n=zi(t.type,t.key,t.props,null,e.mode,n),fo(n,t),n.return=e,n;case O:return t=Ui(t,e.mode,n),t.return=e,t;case oe:return t=io(t),f(e,t,n)}if(ge(t)||pe(t))return t=Bi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,uo(t),n);if(t.$$typeof===A)return f(e,ka(e,t),n);po(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 D:return n.key===i?l(e,t,n,r):null;case O:return n.key===i?u(e,t,n,r):null;case oe:return n=io(n),p(e,t,n,r)}if(ge(n)||pe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,uo(n),r);if(n.$$typeof===A)return p(e,t,ka(e,n),r);po(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 D:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case O:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case oe:return r=io(r),m(e,t,n,r,i)}if(ge(r)||pe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,uo(r),i);if(r.$$typeof===A)return m(e,t,n,ka(t,r),i);po(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),F&&ta(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 F&&ta(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)}),F&&ta(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(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(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),F&&ta(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return F&&ta(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,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(a,e)}),F&&ta(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case D:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),fo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===oe&&io(l)===r.type){n(e,r.sibling),c=a(r,o.props),fo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=Bi(o.props.children,e.mode,c,o.key),fo(c,o),c.return=e,e=c):(c=zi(o.type,o.key,o.props,null,e.mode,c),fo(c,o),c.return=e,e=c)}return s(e);case O: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=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ui(o,e.mode,c),c.return=e,e=c}return s(e);case oe:return o=io(o),_(e,r,o,c)}if(ge(o))return h(e,r,o,c);if(pe(o)){if(l=pe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,uo(o),c);if(o.$$typeof===A)return _(e,r,ka(e,o),c);po(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=a(r,o),c.return=e,e=c):(n(e,r),c=Vi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{lo=0;var i=_(e,t,n,r);return co=null,i}catch(t){if(t===Qa||t===eo)throw t;var a=Fi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ho=mo(!0),go=mo(!1),_o=!1;function vo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yo(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 bo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,od&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Mi(e),ji(e,null,n),t}return Oi(e,r,t,n),Mi(e)}function So(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,vt(e,n)}}function Co(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var wo=!1;function To(){if(wo){var e=Ua;if(e!==null)throw e}}function Eo(e,t,n,r){wo=!1;var i=e.updateQueue;_o=!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?(R&f)===f:(r&f)===f){f!==0&&f===Ha&&(wo=!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=T({},d,f);break a;case 2:_o=!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),gd|=o,e.lanes=o,e.memoizedState=d}}function Do(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Oo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Do(n[e],t)}var ko=be(null),Ao=be(0);function jo(e,t){e=md,Se(Ao,e),Se(ko,t),md=e|t.baseLanes}function Mo(){Se(Ao,md),Se(ko,ko.current)}function No(){md=Ao.current,xe(ko),xe(Ao)}var Po=be(null),Fo=null;function Io(e){var t=e.alternate;Se(Vo,Vo.current&1),Se(Po,e),Fo===null&&(t===null||ko.current!==null||t.memoizedState!==null)&&(Fo=e)}function Lo(e){Se(Vo,Vo.current),Se(Po,e),Fo===null&&(Fo=e)}function Ro(e){e.tag===22?(Se(Vo,Vo.current),Se(Po,e),Fo===null&&(Fo=e)):zo()}function zo(){Se(Vo,Vo.current),Se(Po,Po.current)}function Bo(e){xe(Po),Fo===e&&(Fo=null),xe(Vo)}var Vo=be(0);function Ho(e,t){Se(Po,Po.current),Se(Vo,t)}function Uo(e){xe(Vo),xe(Po),Fo===e&&(Fo=null)}function Wo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||gm(n)||_m(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 Go=0,I=null,Ko=null,qo=null,Jo=!1,Yo=!1,Xo=!1,Zo=0,Qo=0,$o=null,es=0;function ts(){throw Error(i(321))}function ns(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Wr(e[n],t[n]))return!1;return!0}function rs(e,t,n,r,i,a){return Go=a,I=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?bc:xc,Xo=!1,a=n(r,i),Xo=!1,Yo&&(a=as(t,n,r,i)),is(e),a}function is(e){M.H=yc;var t=Ko!==null&&Ko.next!==null;if(Go=0,qo=Ko=I=null,Jo=!1,Qo=0,$o=null,t)throw Error(i(300));e===null||Rc||(e=e.dependencies,e!==null&&Ea(e)&&(Rc=!0))}function as(e,t,n,r){I=e;var a=0;do{if(Yo&&($o=null),Qo=0,Yo=!1,25<=a)throw Error(i(301));if(a+=1,qo=Ko=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=Sc,o=t(n,r)}while(Yo);return o}function os(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?ps(t):t,e=e.useState()[0],(Ko===null?null:Ko.memoizedState)!==e&&(I.flags|=1024),t}function ss(){var e=Zo!==0;return Zo=0,e}function cs(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ls(e){if(Jo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Jo=!1}Go=0,qo=Ko=I=null,Yo=!1,Qo=Zo=0,$o=null}function us(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qo===null?I.memoizedState=qo=e:qo=qo.next=e,qo}function ds(){if(Ko===null){var e=I.alternate;e=e===null?null:e.memoizedState}else e=Ko.next;var t=qo===null?I.memoizedState:qo.next;if(t!==null)qo=t,Ko=e;else{if(e===null)throw I.alternate===null?Error(i(467)):Error(i(310));Ko=e,e={memoizedState:Ko.memoizedState,baseState:Ko.baseState,baseQueue:Ko.baseQueue,queue:Ko.queue,next:null},qo===null?I.memoizedState=qo=e:qo=qo.next=e}return qo}function fs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ps(e){var t=Qo;return Qo+=1,$o===null&&($o=[]),e=ro($o,e,t),t=I,(qo===null?t.memoizedState:qo.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?bc:xc),e}function ms(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ps(e);if(e.$$typeof===de)return;if(e.$$typeof===A)return Oa(e)}throw Error(i(438,String(e)))}function hs(e){var t=null,n=I.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=I.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=fs(),I.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]=le;return t.index++,n}function gs(e,t){return typeof t==`function`?t(e):t}function _s(e){return vs(ds(),Ko,e)}function vs(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Go&f)===f:(R&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===Ha&&(d=!0);else if((Go&p)===p){u=u.next,p===Ha&&(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,I.lanes|=p,gd|=p;f=u.action,Xo&&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,I.lanes|=f,gd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Wr(o,e.memoizedState)&&(Rc=!0,d&&(n=Ua,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ys(e){var t=ds(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Wr(o,t.memoizedState)||(Rc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function bs(e,t,n){var r=I,a=ds(),o=F;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Wr((Ko||a).memoizedState,n);if(s&&(a.memoizedState=n,Rc=!0),a=a.queue,Gs(Cs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||qo!==null&&!!(qo.memoizedState.tag&1),Bs(e?9:8,{destroy:void 0},Ss.bind(null,r,a,n,t),null),e){if(r.flags|=2048,sd===null)throw Error(i(349));o||Go&127||xs(r,t,n)}return n}function xs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=I.updateQueue,t===null?(t=fs(),I.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ss(e,t,n,r){t.value=n,t.getSnapshot=r,ws(t)&&Ts(e)}function Cs(e,t,n){return n(function(){ws(t)&&Ts(e)})}function ws(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Wr(e,n)}catch{return!0}}function Ts(e){var t=Ai(e,2);t!==null&&Wd(t,e,2)}function Es(e){var t=us();if(typeof e==`function`){var n=e;if(e=n(),Xo){et(!0);try{n()}finally{et(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gs,lastRenderedState:e},t}function Ds(e,t,n,r){return e.baseState=n,vs(e,Ko,typeof r==`function`?r:gs)}function Os(e,t,n,r,a){if(gc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,ks(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ks(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};o.types=a===null?null:a.types,M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),As(e,t,s)}catch(n){Ms(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),As(e,t,a)}catch(n){Ms(e,t,n)}}function As(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){js(e,t,n)},function(n){return Ms(e,t,n)}):js(e,t,n)}function js(e,t,n){t.status=`fulfilled`,t.value=n,Ns(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ks(e,n)))}function Ms(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ns(t),t=t.next;while(t!==r)}e.action=null}function Ns(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ps(e,t){return t}function Fs(e,t){if(F){var n=sd.formState;if(n!==null){a:{var r=I;if(F){if(sa){b:{for(var i=sa,a=la;i.nodeType!==8;){if(!a){i=null;break b}if(i=ym(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){sa=ym(i.nextSibling),r=i.data===`F!`;break a}}da(r)}r=!1}r&&(t=n[0])}}return n=us(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ps,lastRenderedState:t},n.queue=r,n=pc.bind(null,I,r),r.dispatch=n,r=Es(!1),a=hc.bind(null,I,!1,r.queue),r=us(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Os.bind(null,I,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Is(e){return Ls(ds(),Ko,e)}function Ls(e,t,n){if(t=vs(e,t,Ps)[0],e=_s(gs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ps(t)}catch(e){throw e===Qa?eo:e}else r=t;t=ds();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(I.flags|=2048,Bs(9,{destroy:void 0},Rs.bind(null,i,n),null)),[r,a,e]}function Rs(e,t){e.action=t}function zs(e){var t=ds(),n=Ko;if(n!==null)return Ls(t,n,e);ds(),t=t.memoizedState,n=ds();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Bs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=I.updateQueue,t===null&&(t=fs(),I.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 Vs(){return ds().memoizedState}function Hs(e,t,n,r){var i=us();I.flags|=e,i.memoizedState=Bs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Us(e,t,n,r){var i=ds();r=r===void 0?null:r;var a=i.memoizedState.inst;Ko!==null&&r!==null&&ns(r,Ko.memoizedState.deps)?i.memoizedState=Bs(t,a,n,r):(I.flags|=e,i.memoizedState=Bs(1|t,a,n,r))}function Ws(e,t){Hs(8390656,8,e,t)}function Gs(e,t){Us(2048,8,e,t)}function Ks(e){I.flags|=4;var t=I.updateQueue;if(t===null)t=fs(),I.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function qs(e){var t=ds().memoizedState;return Ks({ref:t,nextImpl:e}),function(){if(od&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Js(e,t){return Us(4,2,e,t)}function Ys(e,t){return Us(4,4,e,t)}function Xs(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 Zs(e,t,n){n=n==null?null:n.concat([e]),Us(4,4,Xs.bind(null,t,e),n)}function Qs(){}function $s(e,t){var n=ds();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ns(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ec(e,t){var n=ds();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ns(t,r[1]))return r[0];if(r=e(),Xo){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r}function tc(e,t,n){return n===void 0||Go&1073741824&&!(R&261930)?e.memoizedState=t:(e.memoizedState=n,e=Hd(),I.lanes|=e,gd|=e,n)}function nc(e,t,n,r){return Wr(n,t)?n:ko.current===null?!(Go&106)||Go&1073741824&&!(R&261930)?(Rc=!0,e.memoizedState=n):(e=Hd(),I.lanes|=e,gd|=e,t):(e=tc(e,n,r),Wr(e,t)||(Rc=!0),e)}function rc(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};s.types=o===null?null:o.types,M.T=s,hc(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?mc(e,t,Ka(c,r),Vd(e)):mc(e,t,r,Vd(e))}catch(n){mc(e,t,{then:function(){},status:`rejected`,reason:n},Vd())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function ic(){}function ac(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=oc(e).queue;rc(e,a,t,_e,n===null?ic:function(){return sc(e),n(r)})}function oc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:_e,baseState:_e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gs,lastRenderedState:_e},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function sc(e){var t=oc(e);t.next===null&&(t=e.alternate.memoizedState),mc(e,t.next.queue,{},Vd())}function cc(){return Oa(_h)}function lc(){return ds().memoizedState}function uc(){return ds().memoizedState}function dc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Vd();e=bo(n);var r=xo(t,e,n);r!==null&&(Wd(r,t,n),So(r,t,n)),t={cache:Fa()},e.payload=t;return}t=t.return}}function fc(e,t,n){var r=Vd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},gc(e)?_c(t,n):(n=ki(e,t,n,r),n!==null&&(Wd(n,e,r),vc(n,t,r)))}function pc(e,t,n){mc(e,t,n,Vd())}function mc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(gc(e))_c(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,Wr(s,o))return Oi(e,t,i,0),sd===null&&Di(),!1}catch{}if(n=ki(e,t,i,r),n!==null)return Wd(n,e,r),vc(n,t,r),!0}return!1}function hc(e,t,n,r){if(r={lane:2,revertLane:Gf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},gc(e)){if(t)throw Error(i(479))}else t=ki(e,n,r,2),t!==null&&Wd(t,e,2)}function gc(e){var t=e.alternate;return e===I||t!==null&&t===I}function _c(e,t){Yo=Jo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vt(e,n)}}var yc={readContext:Oa,use:ms,useCallback:ts,useContext:ts,useEffect:ts,useImperativeHandle:ts,useLayoutEffect:ts,useInsertionEffect:ts,useMemo:ts,useReducer:ts,useRef:ts,useState:ts,useDebugValue:ts,useDeferredValue:ts,useTransition:ts,useSyncExternalStore:ts,useId:ts,useHostTransitionStatus:ts,useFormState:ts,useActionState:ts,useOptimistic:ts,useMemoCache:ts,useCacheRefresh:ts,useEffectEvent:ts},bc={readContext:Oa,use:ms,useCallback:function(e,t){return us().memoizedState=[e,t===void 0?null:t],e},useContext:Oa,useEffect:Ws,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Hs(4194308,4,Xs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Hs(4194308,4,e,t)},useInsertionEffect:function(e,t){Hs(4,2,e,t)},useMemo:function(e,t){var n=us();t=t===void 0?null:t;var r=e();if(Xo){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=us();if(n!==void 0){var i=n(t);if(Xo){et(!0);try{n(t)}finally{et(!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=fc.bind(null,I,e),[r.memoizedState,e]},useRef:function(e){var t=us();return e={current:e},t.memoizedState=e},useState:function(e){e=Es(e);var t=e.queue,n=pc.bind(null,I,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Qs,useDeferredValue:function(e,t){return tc(us(),e,t)},useTransition:function(){var e=Es(!1);return e=rc.bind(null,I,e.queue,!0,!1),us().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=I,a=us();if(F){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),sd===null)throw Error(i(349));R&127||xs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ws(Cs.bind(null,r,o,e),[e]),r.flags|=2048,Bs(9,{destroy:void 0},Ss.bind(null,r,o,n,t),null),n},useId:function(){var e=us(),t=sd.identifierPrefix;if(F){var n=ea,r=$i;n=(r&~(1<<32-tt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Zo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=es++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:cc,useFormState:Fs,useActionState:Fs,useOptimistic:function(e){var t=us();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=hc.bind(null,I,!0,n),n.dispatch=t,[e,t]},useMemoCache:hs,useCacheRefresh:function(){return us().memoizedState=dc.bind(null,I)},useEffectEvent:function(e){var t=us(),n={impl:e};return t.memoizedState=n,function(){if(od&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},xc={readContext:Oa,use:ms,useCallback:$s,useContext:Oa,useEffect:Gs,useImperativeHandle:Zs,useInsertionEffect:Js,useLayoutEffect:Ys,useMemo:ec,useReducer:_s,useRef:Vs,useState:function(){return _s(gs)},useDebugValue:Qs,useDeferredValue:function(e,t){return nc(ds(),Ko.memoizedState,e,t)},useTransition:function(){var e=_s(gs)[0],t=ds().memoizedState;return[typeof e==`boolean`?e:ps(e),t]},useSyncExternalStore:bs,useId:lc,useHostTransitionStatus:cc,useFormState:Is,useActionState:Is,useOptimistic:function(e,t){return Ds(ds(),Ko,e,t)},useMemoCache:hs,useCacheRefresh:uc,useEffectEvent:qs},Sc={readContext:Oa,use:ms,useCallback:$s,useContext:Oa,useEffect:Gs,useImperativeHandle:Zs,useInsertionEffect:Js,useLayoutEffect:Ys,useMemo:ec,useReducer:ys,useRef:Vs,useState:function(){return ys(gs)},useDebugValue:Qs,useDeferredValue:function(e,t){var n=ds();return Ko===null?tc(n,e,t):nc(n,Ko.memoizedState,e,t)},useTransition:function(){var e=ys(gs)[0],t=ds().memoizedState;return[typeof e==`boolean`?e:ps(e),t]},useSyncExternalStore:bs,useId:lc,useHostTransitionStatus:cc,useFormState:zs,useActionState:zs,useOptimistic:function(e,t){var n=ds();return Ko===null?(n.baseState=e,[e,n.queue.dispatch]):Ds(n,Ko,e,t)},useMemoCache:hs,useCacheRefresh:uc,useEffectEvent:qs};function Cc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var wc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Vd(),i=bo(r);i.payload=t,n!=null&&(i.callback=n),t=xo(e,i,r),t!==null&&(Wd(t,e,r),So(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Vd(),i=bo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=xo(e,i,r),t!==null&&(Wd(t,e,r),So(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Vd(),r=bo(n);r.tag=2,t!=null&&(r.callback=t),t=xo(e,r,n),t!==null&&(Wd(t,e,n),So(t,e,n))}};function Tc(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?!Gr(n,r)||!Gr(i,a):!0}function Ec(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&&wc.enqueueReplaceState(t,t.state,null)}function Dc(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=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Oc(e){Ci(e)}function kc(e){console.error(e)}function Ac(e){Ci(e)}function jc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Mc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Nc(e,t,n){return n=bo(n),n.tag=3,n.payload={element:null},n.callback=function(){jc(e,t)},n}function Pc(e){return e=bo(e),e.tag=3,e}function Fc(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(){Mc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Mc(t,n,r),typeof i!=`function`&&(Od===null?Od=new Set([this]):Od.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ic(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ta(t,n,a,!0),n=Po.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Fo===null?nf():n.alternate===null&&hd===0&&(hd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===to?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Ef(e,r,a)),!1;case 22:return n.flags|=65536,r===to?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)),Ef(e,r,a)),!1}throw Error(i(435,n.tag))}return Ef(e,r,a),nf(),!1}if(F)return t=Po.current,t===null?(r!==ua&&(t=Error(i(423),{cause:r}),_a(Gi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Gi(r,n),a=Nc(e.stateNode,r,a),Co(e,a),hd!==4&&(hd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ua&&(e=Error(i(422),{cause:r}),_a(Gi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Gi(o,n),xd===null?xd=[o]:xd.push(o),hd!==4&&(hd=2),t===null)return!0;r=Gi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Nc(n.stateNode,r,e),Co(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`&&(Od===null||!Od.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Pc(a),Fc(a,e,n,r),Co(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Lc=Error(i(461)),Rc=!1;function zc(e,t,n,r){t.child=e===null?go(t,null,n,r):ho(t,e.child,n,r)}function Bc(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 Da(t),r=rs(e,t,n,o,a,i),s=ss(),e!==null&&!Rc?(cs(e,t,i),ml(e,t,i)):(F&&s&&ra(t),t.flags|=1,zc(e,t,r,i),t.child)}function Vc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Hc(e,t,a,r,i)):(e=zi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!hl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Gr:n,n(o,r)&&e.ref===t.ref)return ml(e,t,i)}return t.flags|=1,e=Li(a,r),e.ref=t.ref,e.return=t,t.child=e}function Hc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Gr(a,r)&&e.ref===t.ref){if(Rc=!1,t.pendingProps=r=a,hl(e,i))e.flags&131072&&(Rc=!0);else return t.lanes=e.lanes,ml(e,t,i)}}return Xc(e,t,n,r,i)}function Uc(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 Gc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Xa(t,a===null?null:a.cachePool),a===null?Mo():jo(t,a),Ro(t);else return r=t.lanes=536870912,Gc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Xa(t,null),Mo(),zo()):(Xa(t,a.cachePool),jo(t,a),zo(),t.memoizedState=null);return zc(e,t,i,n),t.child}function Wc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Gc(e,t,n,r,i){var a=Ya();return a=a===null?null:{parent:Pa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Xa(t,null),Mo(),Ro(t),e!==null&&Ta(e,t,r,!0),t.childLanes=i,null}function Kc(e,t){return t=al({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function qc(e,t,n){return ho(t,e.child,null,n),e=Kc(t,t.pendingProps),e.flags|=2,Bo(t),t.memoizedState=null,e}function Jc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(F){if(r.mode===`hidden`)return e=Kc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Wc(null,e);if(Lo(t),(e=sa)?(e=hm(e,la),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qi===null?null:{id:$i,overflow:ea},retryLane:536870912,hydrationErrors:null},n=Hi(e),n.return=t,t.child=n,oa=t,sa=null)):e=null,e===null)throw da(t);return t.lanes=536870912,null}return Kc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Lo(t),a){if(t.flags&256)t.flags&=-257,t=qc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Rc||Ta(e,t,n,!1),a=(n&e.childLanes)!==0,Rc||a){if(ko.current===null){if(r=sd,r!==null&&(s=yt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ai(e,s),Wd(r,e,s),Lc;nf()}t=qc(e,t,n)}else e=o.treeContext,sa=ym(s.nextSibling),oa=t,F=!0,ca=null,la=!1,e!==null&&aa(t,e),t=Kc(t,r),t.flags|=134221824;return t}return e=Li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Yc(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(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Xc(e,t,n,r,i){return Da(t),n=rs(e,t,n,r,void 0,i),r=ss(),e!==null&&!Rc?(cs(e,t,i),ml(e,t,i)):(F&&r&&ra(t),t.flags|=1,zc(e,t,n,i),t.child)}function Zc(e,t,n,r,i,a){return Da(t),t.updateQueue=null,n=as(t,r,n,i),is(e),r=ss(),e!==null&&!Rc?(cs(e,t,a),ml(e,t,a)):(F&&r&&ra(t),t.flags|=1,zc(e,t,n,a),t.child)}function Qc(e,t,n,r,i){if(Da(t),t.stateNode===null){var a=Ni,o=n.contextType;typeof o==`object`&&o&&(a=Oa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=wc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},vo(t),o=n.contextType,a.context=typeof o==`object`&&o?Oa(o):Ni,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Cc(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&&wc.enqueueReplaceState(a,a.state,null),Eo(t,r,a,i),To(),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=Dc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ni,typeof u==`object`&&u&&(o=Oa(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)&&Ec(t,a,r,o),_o=!1;var f=t.memoizedState;a.state=f,Eo(t,r,a,i),To(),l=t.memoizedState,s||f!==l||_o?(typeof d==`function`&&(Cc(t,n,d,r),l=t.memoizedState),(c=_o||Tc(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,yo(e,t),o=t.memoizedProps,u=Dc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ni,typeof l==`object`&&l&&(c=Oa(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)&&Ec(t,a,r,c),_o=!1,f=t.memoizedState,a.state=f,Eo(t,r,a,i),To();var p=t.memoizedState;o!==d||f!==p||_o||e!==null&&e.dependencies!==null&&Ea(e.dependencies)?(typeof s==`function`&&(Cc(t,n,s,r),p=t.memoizedState),(u=_o||Tc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ea(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,Yc(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=ho(t,e.child,null,i),t.child=ho(t,null,n,i)):zc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ml(e,t,i),e}function $c(e,t,n,r){return ha(),t.flags|=256,zc(e,t,n,r),t.child}var el={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tl(e){return{baseLanes:e,cachePool:Za()}}function nl(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=yd),e}function rl(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Vo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(F){if(i?Io(t):zo(),(e=sa)?(e=hm(e,la),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qi===null?null:{id:$i,overflow:ea},retryLane:536870912,hydrationErrors:null},n=Hi(e),n.return=t,t.child=n,oa=t,sa=null)):e=null,e===null)throw da(t);return t.lanes=_m(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(zo(),i=t.mode,a=al({mode:`hidden`,children:a},i),r=Bi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=tl(n),r.childLanes=nl(e,o,n),t.memoizedState=el,Wc(null,r)):(Io(t),il(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return sl(e,t,a,o,r,c,s,n)}return i?(zo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Li(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Bi(i,a,n,null),i.flags|=2):i=Li(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Wc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=tl(n):(a=i.cachePool,a===null?a=Za():(s=Pa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=nl(e,o,n),t.memoizedState=el,Wc(e.child,r)):(Io(t),n=e.child,e=n.sibling,n=Li(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 il(e,t){return t=al({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function al(e,t){return e=Fi(22,e,null,t),e.lanes=0,e}function ol(e,t,n){return ho(t,e.child,null,n),e=il(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Io(t),t.flags&=-257,ol(e,t,c)):t.memoizedState===null?(zo(),o=a.fallback,s=t.mode,a=al({mode:`visible`,children:a.children},s),o=Bi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,ho(t,e.child,null,c),a=t.child,a.memoizedState=tl(c),a.childLanes=nl(e,r,c),t.memoizedState=el,Wc(null,a)):(zo(),t.child=e.child,t.flags|=128,null);if(Io(t),_m(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,_a({value:a,source:null,stack:null})),ol(e,t,c)}if(Rc||Ta(e,t,c,!1),r=(c&e.childLanes)!==0,Rc||r){if(ko.current!==null)return ol(e,t,c);if(r=sd,r!==null&&(a=yt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ai(e,a),Wd(r,e,a),Lc;return gm(o)||nf(),ol(e,t,c)}return gm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,sa=ym(o.nextSibling),oa=t,F=!0,ca=null,la=!1,e!==null&&aa(t,e),t=il(t,a.children),t.flags|=134221824,t)}function cl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ca(e.return,t,n)}function ll(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Wo(n)===null&&(t=e),e=e.sibling}return t}function ul(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 dl(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 fl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Vo.current;if(t.flags&128)return Ho(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Ho(t,o),i===`backwards`&&e!==null?(dl(e),zc(e,t,r,n),dl(e)):zc(e,t,r,n),r=F?Yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cl(e,n,t);else if(e.tag===19)cl(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=ll(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,dl(t)),ul(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&&Wo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ul(t,!0,n,null,a,r);break;case`together`:ul(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=ll(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ul(t,!1,i,n,a,r)}return t.child}function pl(e,t,n){var r=t.pendingProps;return xa(t,t.type,r.value),zc(e,t,r.children,n),t.child}function ml(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),gd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ta(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function hl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ea(e)))}function gl(e,t,n){switch(t.tag){case 3:De(t,t.stateNode.containerInfo),xa(t,Pa,e.memoizedState.cache),ha();break;case 27:case 5:ke(t);break;case 4:De(t,t.stateNode.containerInfo);break;case 10:xa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Lo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Io(t),t.flags|=128,null;r=Ta(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?rl(e,t,n):(Io(t),e=ml(e,t,n),e===null?null:e.sibling)}Io(t);break;case 19:if(t.flags&128)return fl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ta(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return fl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ho(t,Vo.current),r)break;return null;case 22:return t.lanes=0,Uc(e,t,n,t.pendingProps);case 24:xa(t,Pa,e.memoizedState.cache)}return ml(e,t,n)}function _l(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Rc=!0;else{if(!hl(e,n)&&!(t.flags&128))return Rc=!1,gl(e,t,n);Rc=!!(e.flags&131072)}}else Rc=!1,F&&t.flags&1048576&&na(t,Yi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=io(t.elementType),t.type=e,typeof e==`function`)Ii(e)?(r=Dc(e,r),t.tag=1,t=Qc(null,t,e,r,n)):(t.tag=0,t=Xc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===re){t.tag=11,t=Bc(null,t,e,r,n);break a}if(a===ae){t.tag=14,t=Vc(null,t,e,r,n);break a}if(a===A){t.tag=10,t.type=e,t=pl(null,t,n);break a}}throw t=he(e)||e,Error(i(306,t,``))}}return t;case 0:return Xc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Dc(r,t.pendingProps),Qc(e,t,r,a,n);case 3:a:{if(De(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,yo(e,t),Eo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,xa(t,Pa,r),r!==o.cache&&wa(t,[Pa],n,!0),To(),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=$c(e,t,r,n);break a}if(r!==a){a=Gi(Error(i(424)),t),_a(a),t=$c(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(sa=ym(e.firstChild),oa=t,F=!0,ca=null,la=!0,n=go(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ha(),r===a){t=ml(e,t,n);break a}zc(e,t,r,n)}t=t.child}return t;case 26:return Yc(e,t),e===null?(n=Um(t.type,null,t.pendingProps,null))?t.memoizedState=n:F||(t.stateNode=Sp(t.type,t.pendingProps,Te.current,t)):t.memoizedState=Um(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ke(t),e===null&&F&&(r=t.stateNode=Tm(t.type,t.pendingProps,Te.current),oa=t,la=!0,a=sa,Mp(t.type)?(bm=a,sa=ym(r.firstChild)):sa=a),zc(e,t,t.pendingProps.children,n),Yc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&F&&((a=r=sa)&&(r=pm(r,t.type,t.pendingProps,la),r===null?a=!1:(t.stateNode=r,oa=t,sa=ym(r.firstChild),la=!1,a=!0)),a||da(t)),ke(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Cp(a,o)?r=null:s!==null&&Cp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=rs(e,t,os,null,null,n),_h._currentValue=a),Yc(e,t),zc(e,t,r,n),t.child;case 6:return e===null&&F&&((e=n=sa)&&(n=mm(n,t.pendingProps,la),n===null?e=!1:(t.stateNode=n,oa=t,sa=null,e=!0)),e||da(t)),null;case 13:return rl(e,t,n);case 4:return De(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ho(t,null,r,n):zc(e,t,r,n),t.child;case 11:return Bc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Yc(e,t),zc(e,t,r,n),t.child;case 8:return zc(e,t,t.pendingProps.children,n),t.child;case 12:return zc(e,t,t.pendingProps.children,n),t.child;case 10:return pl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Da(t),a=Oa(a),r=r(a),t.flags|=1,zc(e,t,r,n),t.child;case 14:return Vc(e,t,t.type,t.pendingProps,n);case 15:return Hc(e,t,t.type,t.pendingProps,n);case 19:return fl(e,t,n);case 31:return Jc(e,t,n);case 22:return Uc(e,t,n,t.pendingProps);case 24:return Da(t),r=Oa(Pa),e===null?(a=Ya(),a===null&&(a=sd,o=Fa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},vo(t),xa(t,Pa,a)):((e.lanes&n)!==0&&(yo(e,t),Eo(t,null,null,n),To()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,xa(t,Pa,r),r!==a.cache&&wa(t,[Pa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),xa(t,Pa,r))),zc(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:F&&ra(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Yc(e,t),zc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function vl(e){e.flags|=4}function yl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?ih(t,r):ih(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($d())e.flags|=8192;else throw ao=to,$a}}else e.flags&=-16777217}function bl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ah(t)){if($d())e.flags|=8192;else throw ao=to,$a}}function xl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:pt(),e.lanes|=t,bd|=t)}function Sl(e,t){if(!F)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 Cl(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 wl(e,t,n){var r=t.pendingProps;switch(ia(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Cl(t),null;case 1:return Cl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Sa(Pa),Oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ma(t)?vl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ga())),Cl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(vl(t),o===null?(Cl(t),yl(t,a,null,r,n)):(Cl(t),bl(t,o))):o?o===e.memoizedState?(Cl(t),t.flags&=-16777217):(vl(t),Cl(t),bl(t,o)):(e=e.memoizedProps,e!==r&&vl(t),Cl(t),yl(t,a,e,r,n)),null;case 27:if(Ae(t),n=Te.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&vl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Cl(t),t.subtreeFlags&=-33554433,null}e=Ce.current,ma(t)?fa(t,e):(e=Tm(a,r,n),t.stateNode=e,vl(t))}return Cl(t),t.subtreeFlags&=-33554433,null;case 5:if(Ae(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&vl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Cl(t),t.subtreeFlags&=-33554433,null}if(o=Ce.current,ma(t))fa(t,o);else{var s=yp(Te.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);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(a,{is:r.is}):s.createElement(a)}}o[Tt]=t,o[Et]=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(fp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&vl(t)}}return Cl(t),t.subtreeFlags&=-33554433,yl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&vl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Te.current,ma(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=oa,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Tt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||lp(e.nodeValue,n)),e||da(t,!0)}else e=yp(e).createTextNode(r),e[Tt]=t,t.stateNode=e}return Cl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ma(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[Tt]=t}else ha(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cl(t),e=!1}else n=ga(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Bo(t),t):(Bo(t),null);if(t.flags&128)throw Error(i(558))}return Cl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ma(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[Tt]=t}else ha(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cl(t),a=!1}else a=ga(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Bo(t),t):(Bo(t),null)}return Bo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),xl(t,t.updateQueue),Cl(t),null);case 4:return Oe(),e===null&&ep(t.stateNode.containerInfo),t.flags|=67108864,Cl(t),null;case 10:return Sa(t.type),Cl(t),null;case 19:if(Uo(t),r=t.memoizedState,r===null)return Cl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Sl(r,!1);else{if(hd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Wo(e),o!==null){for(t.flags|=128,Sl(r,!1),e=o.updateQueue,t.updateQueue=e,xl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ri(n,e),n=n.sibling;return Ho(t,Vo.current&1|2),F&&ta(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ue()>Ed&&(t.flags|=128,a=!0,Sl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Wo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,xl(t,e),Sl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!F)return Cl(t),null}else 2*Ue()-r.renderingStartTime>Ed&&n!==536870912&&(t.flags|=128,a=!0,Sl(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=Ue(),e.sibling=null,o=Vo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||F?Ho(t,o):(n=o,Se(Po,t),Se(Vo,n),Fo===null&&(Fo=t)),F&&ta(t,r.treeForkCount),e}return Cl(t),null;case 22:case 23:return Bo(t),No(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Cl(t),t.subtreeFlags&6&&(t.flags|=8192)):Cl(t),n=t.updateQueue,n!==null&&xl(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&&xe(Ja),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Sa(Pa),Cl(t),null;case 25:return null;case 30:return t.flags|=33554432,Cl(t),null}throw Error(i(156,t.tag))}function Tl(e,t){switch(ia(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Sa(Pa),Oe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ae(t),null;case 31:if(t.memoizedState!==null){if(Bo(t),t.alternate===null)throw Error(i(340));ha()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Bo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ha()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Uo(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 Oe(),null;case 10:return Sa(t.type),null;case 22:case 23:return Bo(t),No(),e!==null&&xe(Ja),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Sa(Pa),null;case 25:return null;default:return null}}function El(e,t){switch(ia(t),t.tag){case 3:Sa(Pa),Oe();break;case 26:case 27:case 5:Ae(t);break;case 4:Oe();break;case 31:t.memoizedState!==null&&Bo(t);break;case 13:Bo(t);break;case 19:Uo(t);break;case 10:Sa(t.type);break;case 22:case 23:Bo(t),No(),e!==null&&xe(Ja);break;case 24:Sa(Pa)}}function Dl(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){Tf(t,t.return,e)}}function Ol(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){Tf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Tf(t,t.return,e)}}function kl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Oo(t,n)}catch(t){Tf(e,e.return,t)}}}function Al(e,t,n){n.props=Dc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Tf(e,t,n)}}function jl(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=bi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Wp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Gp(e);f(e.child,!1,cm,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){Tf(e,t,n)}}function Ml(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Tf(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){Tf(e,t,n)}else n.current=null}}function Nl(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++)um(e.stateNode,t[n])}function Pl(e){for(var t=e.return;t!==null&&(Ll(t)&&um(e.stateNode,t.stateNode),!Il(t));)t=t.return}function Fl(e){for(var t=e.return;t!==null&&(Ll(t)&&dm(e.stateNode,t.stateNode),!Il(t));)t=t.return}function Il(e){return e.tag===5||e.tag===3||e.tag===27}function Ll(e){return e&&e.tag===7&&e.stateNode!==null}function Rl(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){Tf(e,e.return,t)}}function zl(e,t,n){try{var r=e.stateNode;mp(r,e.type,n,t),r[Et]=t}catch(t){Tf(e,e.return,t)}}function Bl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Mp(e.type)||e.tag===4}function Vl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Bl(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&&Mp(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 Hl(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=xn)),Nl(e,r),Jt=!0;else if(i!==4&&(i===27&&(Nl(e,r),r=null,Mp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Hl(e,t,n,r),e=e.sibling;e!==null;)Hl(e,t,n,r),e=e.sibling}function Ul(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Nl(e,r),Jt=!0;else if(i!==4&&(i===27&&(Nl(e,r),r=null,Mp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ul(e,t,n,r),e=e.sibling;e!==null;)Ul(e,t,n,r),e=e.sibling}function Wl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);fp(t,r,n),t[Tt]=e,t[Et]=n}catch(t){Tf(e,e.return,t)}}var Gl=!1,Kl=null;function ql(e){(e.tag===30||e.subtreeFlags&33554432)&&(Gl=!0)}var L=null;function Jl(){var e=L;return L=null,e}var Yl=0;function Xl(e,t,n,r,i){return Yl=0,Zl(e.child,t,n,r,i)}function Zl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Rp(o);r.push(s),s.view&&(a=!0)}else a||Rp(o).view&&(a=!0);Gl=!0,Fp(o,Yl===0?t:t+`_`+Yl,n),Yl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Zl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Ql(e,t){for(;e!==null;)e.tag===5?Ip(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Ql(e.child,t)),e=e.sibling}function $l(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&($l(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=Si(t.default,t.share),t!==`none`&&(Xl(e,n,t,null,!1)||Ql(e.child,!1))}e=e.sibling}}function eu(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=bi(r,n),a=Si(r.default,n.paired?r.share:r.enter);a===`none`?$l(e):Xl(e,i,a,null,!1)?($l(e),n.paired||t||Ud(e,r.onEnter)):Ql(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)eu(e,t),e=e.sibling;else $l(e)}function tu(e){if(Kl!==null&&Kl.size!==0){var t=Kl;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=Si(n.default,n.share);if(a!==`none`&&(Xl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Ud(e,n.onShare)):Ql(e.child,!1)),t.delete(r),t.size===0)break}}}tu(e)}e=e.sibling}}}function nu(e){if(e.tag===30){var t=e.memoizedProps,n=bi(t,e.stateNode),r=Kl===null?void 0:Kl.get(n),i=Si(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Xl(e,n,i,null,!1)?r===void 0?Ud(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Kl.delete(n),Ud(e,t.onShare)):Ql(e.child,!1)),Kl!==null&&tu(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)nu(e),e=e.sibling;else Kl!==null&&tu(e)}function ru(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=bi(t,e.stateNode);t=Si(t.default,t.update),e.flags&=-5,t!==`none`&&Xl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&ru(e);e=e.sibling}}function iu(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,Ql(e.child,!1))}iu(e)}e=e.sibling}}function au(e){if(e.tag===30)e.stateNode.paired=null,Ql(e.child,!1),iu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)au(e),e=e.sibling;else iu(e)}function ou(e){for(e=e.child;e!==null;)e.tag===30?Ql(e.child,!1):e.subtreeFlags&33554432&&ou(e),e=e.sibling}function su(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Yl<a.length){var l=a[Yl],u=Rp(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&&Fp(c,Yl===0?n:n+`_`+Yl,i),s&&e.flags&4||(L===null&&(L=[]),L.push(c,Yl===0?r:r+`_`+Yl,t.memoizedProps)),Yl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:su(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function cu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=bi(n,r),a=Si(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(zp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Yl=0,i=su(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Ud(e,n.onUpdate))}else e.subtreeFlags&33554432&&cu(e,t);e=e.sibling}}var lu=!1,uu=!1,du=!1,fu=!1,pu=typeof WeakSet==`function`?WeakSet:Set,mu=null,hu=!1,gu=!1,_u=!1,vu=!1;function yu(e,t,n){if(e=e.containerInfo,_p=Eh,e=Xr(e),Zr(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(vp={focusedElem:e,selectionRange:r},Eh=!1,n=(n&335544064)===n,mu=t,t=n?9270:1024;mu!==null;){if(e=mu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&nu(r[a]);if(e.alternate===null&&e.flags&2)n&&ql(e),bu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&nu(r),bu(n);continue}if(r!==null&&r.memoizedState!==null){n&&ql(e),bu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,mu=r):(n&&ru(e),bu(n))}}Kl=null}function bu(e){for(;mu!==null;){var t=mu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Dc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Tf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)fm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:fm(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=bi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=Si(a.default,a.update),a!==`none`&&Xl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,mu=r;break}mu=t.return}}function xu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Vu(e,n),r&4&&Dl(5,n);break;case 1:if(Vu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Tf(n,n.return,e)}else{var i=Dc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Tf(n,n.return,e)}}}r&64&&kl(n),r&512&&jl(n,n.return);break;case 3:if(Vu(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{Oo(e,t)}catch(e){Tf(n,n.return,e)}}break;case 27:t===null&&r&4&&Wl(n);case 26:case 5:Vu(e,n),t===null&&r&4&&Rl(n),r&512&&jl(n,n.return);break;case 12:Vu(e,n);break;case 31:Vu(e,n),r&4&&Au(e,n);break;case 13:Vu(e,n),r&4&&ju(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=kf.bind(null,n),vm(e,n))));break;case 22:if(r=n.memoizedState!==null||lu,!r){var a=t!==null&&t.memoizedState!==null||uu;t=lu,i=uu,lu=r,(uu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Uu(e,n,r)):Vu(e,n),lu=t,uu=i}break;case 30:Vu(e,n),r&512&&jl(n,n.return);break;case 7:r&512&&jl(n,n.return);default:Vu(e,n)}}function Su(e,t){for(e=e.child;e!==null;)Cu(e,t),e=e.sibling}function Cu(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){Tf(e,e.return,t)}wu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Jt=!0}catch(t){Tf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Pp(s,!0):Pp(e.stateNode,!1)}catch(t){Tf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&Su(e,t);break;default:Su(e,t)}}function wu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:Cu(n,r);break a;case 22:n.memoizedState===null&&wu(n,r);break a;default:wu(n,r)}}e=e.sibling}}function Tu(e){var t=e.alternate;t!==null&&(e.alternate=null,Tu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Pt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Eu=null,Du=!1;function Ou(e,t,n){for(n=n.child;n!==null;)ku(e,t,n),n=n.sibling}function ku(e,t,n){if($e&&typeof $e.onCommitFiberUnmount==`function`)try{$e.onCommitFiberUnmount(Qe,n)}catch{}switch(n.tag){case 26:uu||Ml(n,t),Ou(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!uu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:uu||Ml(n,t),Fl(n);var r=Eu,i=Du;Mp(n.type)&&(Eu=n.stateNode,Du=!1),Ou(e,t,n),Em(n.stateNode,n.type,n.memoizedProps),Eu=r,Du=i;break;case 5:uu||Ml(n,t),Fl(n);case 6:if(n.tag===6&&Fl(n),r=Eu,i=Du,Eu=null,Ou(e,t,n),Eu=r,Du=i,Eu!==null){if(Du)try{(Eu.nodeType===9?Eu.body:Eu.nodeName===`HTML`?Eu.ownerDocument.body:Eu).removeChild(n.stateNode),Jt=!0}catch(e){Tf(n,t,e)}else try{Eu.removeChild(n.stateNode),Jt=!0}catch(e){Tf(n,t,e)}}break;case 18:Eu!==null&&(Du?(e=Eu,Np(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Qh(e)):Np(Eu,n.stateNode));break;case 4:r=Eu,i=Du,Eu=n.stateNode.containerInfo,Du=!0,Ou(e,t,n),Eu=r,Du=i;break;case 0:case 11:case 14:case 15:Ol(2,n,t),uu||Ol(4,n,t),Ou(e,t,n);break;case 1:uu||(Ml(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Al(n,t,r)),Ou(e,t,n);break;case 21:Ou(e,t,n);break;case 22:uu=(r=uu)||n.memoizedState!==null,Ou(e,t,n),uu=r;break;case 30:Ml(n,t),Ou(e,t,n);break;case 7:uu||Ml(n,t),Ou(e,t,n);break;default:Ou(e,t,n)}}function Au(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Qh(e)}catch(e){Tf(t,t.return,e)}}}function ju(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Qh(e)}catch(e){Tf(t,t.return,e)}}function Mu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new pu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new pu),t;default:throw Error(i(435,e.tag))}}function Nu(e,t){var n=Mu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Af.bind(null,e,t);t.then(r,r)}})}function Pu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Mp(l.type)){Eu=l.stateNode,Du=!1;break a}break;case 5:Eu=l.stateNode,Du=!1;break a;case 3:case 4:Eu=l.stateNode.containerInfo,Du=!0;break a}l=l.return}if(Eu===null)throw Error(i(160));ku(s,c,o),Eu=null,Du=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Iu(t,e,n),t=t.sibling}var Fu=null;function Iu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&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}Pu(t,e,n),Lu(e),a&4&&(Ol(3,e,e.return),Dl(3,e),Ol(5,e,e.return));break;case 1:Pu(t,e,n),Lu(e),a&512&&(uu||r===null||Ml(r,r.return)),a&64&&lu&&(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=Fu,Pu(t,e,n),Lu(e),a&512&&(uu||r===null||Ml(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(lu)e.stateNode=Sp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Mt]||r[Tt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),fp(r,t,n),r[Tt]=e,Rt(r),t=r;break a;case`link`:if(o=th(`link`,`href`,a).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=a.createElement(t),fp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=th(`meta`,`content`,a).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=a.createElement(t),fp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Tt]=e,Rt(r),t=r}e.stateNode=t}}else lu||nh(o,e.type,e.stateNode)}else e.stateNode=Xm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&zl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||uu||t.parentNode.removeChild(t)):a.count--,n===null?lu||nh(o,e.type,e.stateNode):Xm(o,n,e.memoizedProps))}break;case 27:Pu(t,e,n),Lu(e),a&512&&(uu||r===null||Ml(r,r.return)),r!==null&&a&4&&zl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=du,du=!1,Pu(t,e,n),du=o,Lu(e),a&512&&(uu||r===null||Ml(r,r.return)),e.flags&32){t=e.stateNode;try{pn(t,``),Jt=!0}catch(t){Tf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,zl(e,t,r===null?t:r.memoizedProps)),a&1024&&(fu=!0);break;case 6:if(Pu(t,e,n),Lu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Jt=!0}catch(t){Tf(e,e.return,t)}}break;case 3:if(Jt=!1,eh=null,o=Fu,Fu=Am(t.containerInfo),Pu(t,e,n),Fu=o,Lu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Qh(t.containerInfo)}catch(t){Tf(e,e.return,t)}fu&&(fu=!1,Ru(e)),Jt=!1;break;case 4:a=du,du=lu,r=Yt(),o=Fu,Fu=Am(e.stateNode.containerInfo),Pu(t,e,n),Lu(e),Fu=o,Jt&&gu&&(_u=!0),Jt=r,du=a;break;case 12:Pu(t,e,n),Lu(e);break;case 31:Pu(t,e,n),Lu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Nu(e,t)));break;case 13:Pu(t,e,n),Lu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(wd=Ue()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Nu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=lu,l=uu,u=du;lu=c||o,du=u||o,uu=l||s,Pu(t,e,n),uu=l,du=u,lu=c,Lu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||lu||uu||(t=s||uu,n=lu,r=uu,lu=o||lu,uu=t,Hu(e,2),lu=n,uu=r),!o&&du||Su(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Nu(e,n))));break;case 19:Pu(t,e,n),Lu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Nu(e,t)));break;case 30:a&512&&(uu||r===null||Ml(r,r.return)),a=Yt(),o=gu,s=(n&335544064)===n,c=e.memoizedProps,gu=s&&Si(c.default,c.update)!==`none`,Pu(t,e,n),Lu(e),s&&r!==null&&Jt&&(e.flags|=4),gu=o,Jt=a;break;case 21:break;case 7:a&512&&(uu||r===null||Ml(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Pu(t,e,n),Lu(e)}}function Lu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Bl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Ll(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Il(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Ul(e,Vl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(pn(l,``),n.flags&=-33),Ul(e,Vl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Hl(e,Vl(e),u,s);break;default:throw Error(i(161))}}catch(t){Tf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ru(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ru(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Eh=!0,t.reset(),Eh=!1),e=e.sibling}}function zu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Bu(t,e),t=t.sibling;else cu(t,!1)}function Bu(e,t){var n=e.alternate;if(n===null)eu(e,!1);else switch(e.tag){case 3:if(vu=hu=!1,Jl(),zu(t,e),!hu&&!_u){if(e=L,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ip(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`})),vu=!0}L=null;break;case 5:zu(t,e);break;case 4:r=hu,hu=!1,zu(t,e),hu&&(_u=!0),hu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?zu(t,e):eu(e,!1));break;case 30:r=hu,i=Jl(),hu=!1,zu(t,e),hu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=bi(a,o),o=bi(n.memoizedProps,o);var s=Si(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Yl=0,t=su(e,n,t,o,s,a,!0),Yl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Ud(e,e.memoizedProps.onUpdate),L=i):i!==null&&(i.push.apply(i,L),L=i),hu=e.flags&32?!0:r;break;default:zu(t,e)}}function Vu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)xu(e,t.alternate,t),t=t.sibling}function Hu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Ol(4,n,n.return),Hu(n,r);break;case 1:Ml(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Al(n,n.return,i),Hu(n,r);break;case 27:r&2&&Em(n.stateNode,n.type,n.memoizedProps);case 5:Ml(n,n.return),n.tag!==5&&n.tag!==27||Fl(n),Hu(n,r);break;case 6:Fl(n);break;case 26:Ml(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||uu||i.parentNode.removeChild(i),Hu(n,r);break;case 22:n.memoizedState===null&&Hu(n,r);break;case 30:Ml(n,n.return),Hu(n,r);break;case 7:Ml(n,n.return);default:Hu(n,r)}e=e.sibling}}function Uu(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:Uu(i,a,n),Dl(4,a);break;case 1:if(Uu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Tf(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++)Do(l[i],c)}catch(e){Tf(r,r.return,e)}}s&&o&64&&kl(a),jl(a,a.return);break;case 27:n&2&&Wl(a);case 5:a.tag!==5&&a.tag!==27||Pl(a),Uu(i,a,n),s&&r===null&&o&4&&Rl(a),jl(a,a.return);break;case 6:Pl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||lu||nh(Am(c.ownerDocument),a.type,c),Uu(i,a,n),s&&r===null&&o&4&&Rl(a),jl(a,a.return);break;case 12:Uu(i,a,n);break;case 31:Uu(i,a,n),s&&o&4&&Au(i,a);break;case 13:Uu(i,a,n),s&&o&4&&ju(i,a);break;case 22:a.memoizedState===null&&Uu(i,a,n),jl(a,a.return);break;case 30:Uu(i,a,n),jl(a,a.return);break;case 7:jl(a,a.return);default:Uu(i,a,n)}t=t.sibling}}function Wu(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&&Ia(n))}function Gu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ia(e))}function Ku(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)qu(e,t,n,r),t=t.sibling;else i&&ou(t)}function qu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&au(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Ku(e,t,n,r),a&2048&&Dl(9,t);break;case 1:Ku(e,t,n,r);break;case 3:Ku(e,t,n,r),i&&vu&&(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&&Ia(a)));break;case 12:if(a&2048){Ku(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){Tf(t,t.return,e)}}else Ku(e,t,n,r);break;case 31:Ku(e,t,n,r);break;case 13:Ku(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&&au(t),o._visibility&2?Ku(e,t,n,r):(o._visibility|=2,Ju(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&au(s),o._visibility&2?Ku(e,t,n,r):Yu(e,t)),a&2048&&Wu(s,t);break;case 24:Ku(e,t,n,r),a&2048&&Gu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Ql(a.child,!0),Ql(t.child,!0))),Ku(e,t,n,r);break;default:Ku(e,t,n,r)}}function Ju(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:Ju(a,o,s,c,i),Dl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ju(a,o,s,c,i)):u._visibility&2?Ju(a,o,s,c,i):Yu(a,o),i&&l&2048&&Wu(o.alternate,o);break;case 24:Ju(a,o,s,c,i),i&&l&2048&&Gu(o.alternate,o);break;default:Ju(a,o,s,c,i)}t=t.sibling}}function Yu(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:Yu(n,r),i&2048&&Wu(r.alternate,r);break;case 24:Yu(n,r),i&2048&&Gu(r.alternate,r);break;default:Yu(n,r)}t=t.sibling}}var Xu=8192;function Zu(e,t,n){if(e.subtreeFlags&Xu)for(e=e.child;e!==null;)Qu(e,t,n),e=e.sibling}function Qu(e,t,n){switch(e.tag){case 26:Zu(e,t,n),e.flags&Xu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&sh(n,e)):ch(n,Fu,e.memoizedState,e.memoizedProps));break;case 5:Zu(e,t,n),e.flags&Xu&&(e=e.stateNode,(t&335544128)===t&&sh(n,e));break;case 3:case 4:var r=Fu;Fu=Am(e.stateNode.containerInfo),Zu(e,t,n),Fu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Xu,Xu=16777216,Zu(e,t,n),Xu=r):Zu(e,t,n));break;case 30:if((e.flags&Xu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Kl===null&&(Kl=new Map),Kl.set(r,i)}Zu(e,t,n);break;default:Zu(e,t,n)}}function $u(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 ed(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];mu=r,rd(r,e)}$u(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)td(e),e=e.sibling}function td(e){switch(e.tag){case 0:case 11:case 15:ed(e),e.flags&2048&&Ol(9,e,e.return);break;case 3:ed(e);break;case 12:ed(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,nd(e)):ed(e);break;default:ed(e)}}function nd(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];mu=r,rd(r,e)}$u(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ol(8,t,t.return),nd(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,nd(t));break;default:nd(t)}e=e.sibling}}function rd(e,t){for(;mu!==null;){var n=mu;switch(n.tag){case 0:case 11:case 15:Ol(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:Ia(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,mu=r;else a:for(n=e;mu!==null;){r=mu;var i=r.sibling,a=r.return;if(Tu(r),r===n){mu=null;break a}if(i!==null){i.return=a,mu=i;break a}mu=a}}}var id={getCacheForType:function(e){var t=Oa(Pa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Oa(Pa).controller.signal}},ad=typeof WeakMap==`function`?WeakMap:Map,od=0,sd=null,cd=null,R=0,ld=0,ud=null,dd=!1,fd=!1,pd=!1,md=0,hd=0,gd=0,_d=0,vd=0,yd=0,bd=0,xd=null,Sd=null,Cd=!1,wd=0,Td=0,Ed=1/0,Dd=null,Od=null,kd=0,Ad=null,jd=null,Md=0,Nd=0,Pd=null,Fd=null,Id=null,Ld=null,Rd=null,zd=0,Bd=null;function Vd(){return od&2&&R!==0?R&-R:M.T===null?St():Gf()}function Hd(){if(yd===0){if(!(R&536870912)||F){var e=ot;ot<<=1,!(ot&3932160)&&(ot=262144),yd=e}else yd=536870912}return e=Po.current,e!==null&&(e.flags|=32),yd}function Ud(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Wp(bi(e.memoizedProps,n))),Ld===null&&(Ld=[]),Ld.push(t.bind(null,r))}}function Wd(e,t,n){(e===sd&&(ld===2||ld===9)||e.cancelPendingCommit!==null)&&(Zd(e,0),Jd(e,R,yd,!1)),ht(e,n),(!(od&2)||e!==sd)&&(e===sd&&(!(od&2)&&(_d|=n),hd===4&&Jd(e,R,yd,!1)),B(e))}function Gd(e,t,n){if(od&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ut(e,t),a=r?of(e,t):rf(e,t,!0),o=r;do{if(a===0){fd&&!r&&Jd(e,t,0,!1);break}if(n=e.current.alternate,o&&!qd(n)){a=rf(e,t,!1),o=!1;continue}if(a===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;a=xd;var l=c.current.memoizedState.isDehydrated;if(l&&(Zd(c,s).flags|=256),s=rf(c,s,!1),s!==2&&s!==6){if(pd&&!l){c.errorRecoveryDisabledLanes|=o,_d|=o,a=4;break a}o=Sd,Sd=a,o!==null&&(Sd===null?Sd=o:Sd.push.apply(Sd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Zd(e,0),Jd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Jd(r,t,yd,!dd);break a;case 2:Sd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=wd+300-Ue(),10<a)){if(Jd(r,t,yd,!dd),lt(r,0,!0)!==0)break a;Md=t,r.timeoutHandle=Ep(Kd.bind(null,r,n,Sd,Dd,Cd,t,yd,_d,bd,dd,o,`Throttled`,-0,0),a);break a}Kd(r,n,Sd,Dd,Cd,t,yd,_d,bd,dd,o,null,-0,0)}break}while(1);B(e)}function Kd(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;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xn},Kl=null,Qu(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=fh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?wd-Ue():(a&4194048)===a?Td-Ue():0,m=uh(d,m),m!==null)){Md=a,e.cancelPendingCommit=m(pf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Jd(e,a,o,!l);return}pf(e,t,a,n,r,i,o,s,c,l,u,d)}function qd(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(!Wr(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 Jd(e,t,n,r){t=dt(e,t),t&=~vd,t&=~_d,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-tt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&_t(e,n,t)}function Yd(){return od&6?!0:(Rf(0,!1),!1)}function Xd(){if(cd!==null){if(ld===0)var e=cd.return;else e=cd,ba=ya=null,ls(e),co=null,lo=0,e=cd;for(;e!==null;)El(e.alternate,e),e=e.return;cd=null}}function Zd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Dp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Md=0,Xd(),sd=e,cd=n=Li(e.current,null),R=t,ld=0,ud=null,dd=!1,fd=ut(e,t),pd=!1,bd=yd=vd=_d=gd=hd=0,Sd=xd=null,Cd=!1,md=dt(e,t),Di(),n}function Qd(e,t){I=null,M.H=yc,t===Qa||t===eo?(t=oo(),ld=3):t===$a?(t=oo(),ld=4):ld=t===Lc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ud=t,cd===null&&(hd=1,jc(e,Gi(t,e.current)))}function $d(){var e=Po.current;return e===null?!0:(R&4194048)===R?Fo===null:(R&62914560)===R||R&536870912?e===Fo:!1}function ef(){var e=M.H;return M.H=yc,e===null?yc:e}function tf(){var e=M.A;return M.A=id,e}function nf(){hd=4,dd||(R&4194048)!==R&&Po.current!==null||(fd=!0),!(gd&134217727)&&!(_d&134217727)||sd===null||Jd(sd,R,yd,!1)}function rf(e,t,n){var r=od;od|=2;var i=ef(),a=tf();(sd!==e||R!==t)&&(Dd=null,Zd(e,t)),t=!1;var o=hd;a:do try{if(ld!==0&&cd!==null){var s=cd,c=ud;switch(ld){case 8:Xd(),o=6;break a;case 3:case 2:case 9:case 6:Po.current===null&&(t=!0);var l=ld;if(ld=0,ud=null,uf(e,s,c,l),n&&fd){o=0;break a}break;default:l=ld,ld=0,ud=null,uf(e,s,c,l)}}af(),o=hd;break}catch(t){Qd(e,t)}while(1);return t&&e.shellSuspendCounter++,ba=ya=null,od=r,M.H=i,M.A=a,cd===null&&(sd=null,R=0,Di()),o}function af(){for(;cd!==null;)cf(cd)}function of(e,t){var n=od;od|=2;var r=ef(),a=tf();sd!==e||R!==t?(Dd=null,Ed=Ue()+500,Zd(e,t)):fd=ut(e,t);a:do try{if(ld!==0&&cd!==null){t=cd;var o=ud;b:switch(ld){case 1:ld=0,ud=null,uf(e,t,o,1);break;case 2:case 9:if(no(o)){ld=0,ud=null,lf(t);break}t=function(){ld!==2&&ld!==9||sd!==e||(ld=7),B(e)},o.then(t,t);break a;case 3:ld=7;break a;case 4:ld=5;break a;case 7:no(o)?(ld=0,ud=null,lf(t)):(ld=0,ud=null,uf(e,t,o,7));break;case 5:var s=null;switch(cd.tag){case 26:s=cd.memoizedState;case 5:case 27:var c=cd;if(s?ah(s):c.stateNode.complete){ld=0,ud=null;var l=c.sibling;if(l!==null)cd=l;else{var u=c.return;u===null?cd=null:(cd=u,df(u))}break b}}ld=0,ud=null,uf(e,t,o,5);break;case 6:ld=0,ud=null,uf(e,t,o,6);break;case 8:Xd(),hd=6;break a;default:throw Error(i(462))}}sf();break}catch(t){Qd(e,t)}while(1);return ba=ya=null,M.H=r,M.A=a,od=n,cd===null?(sd=null,R=0,Di(),hd):0}function sf(){for(;cd!==null&&!Ve();)cf(cd)}function cf(e){var t=_l(e.alternate,e,md);e.memoizedProps=e.pendingProps,t===null?df(e):cd=t}function lf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Zc(n,t,t.pendingProps,t.type,void 0,R);break;case 11:t=Zc(n,t,t.pendingProps,t.type.render,t.ref,R);break;case 5:ls(t);var r=t;r===oa&&(F?(pa(r),r.tag===5&&r.stateNode!=null&&(sa=r.stateNode)):(pa(r),F=!0));default:El(n,t),t=cd=Ri(t,md),t=_l(n,t,md)}e.memoizedProps=e.pendingProps,t===null?df(e):cd=t}function uf(e,t,n,r){ba=ya=null,ls(t),co=null,lo=0;var i=t.return;try{if(Ic(e,i,t,n,R)){hd=1,jc(e,Gi(n,e.current)),cd=null;return}}catch(t){if(i!==null)throw cd=i,t;hd=1,jc(e,Gi(n,e.current)),cd=null;return}t.flags&32768?(F||r===1?e=!0:fd||R&536870912?e=!1:(dd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Po.current,r!==null&&r.tag===13&&(r.flags|=16384))),ff(t,e)):df(t)}function df(e){var t=e;do{if(t.flags&32768){ff(t,dd);return}e=t.return;var n=wl(t.alternate,t,md);if(n!==null){cd=n;return}if(t=t.sibling,t!==null){cd=t;return}cd=t=e}while(t!==null);hd===0&&(hd=5)}function ff(e,t){do{var n=Tl(e.alternate,e);if(n!==null){n.flags&=32767,cd=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){cd=e;return}cd=e=n}while(e!==null);hd=6,cd=null}function pf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do xf();while(kd!==0);if(od&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===sd&&(cd=sd=null,R=0),jd=t,Ad=e,Md=n,Pd=a,Fd=r,mf(e,t,n,s,c,l,f)}}function mf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Nd=s,s|=Ei,gt(e,n,s,r,i,a),Ld=null,(n&335544064)===n?(Rd=za(e),r=10262):(Rd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,jf(qe,function(){return Cf(),null})):(e.callbackNode=null,e.callbackPriority=0),Gl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=M.T,M.T=null,i=N.p,N.p=2,a=od,od|=4;try{yu(e,t,n)}finally{od=a,N.p=i,M.T=r}}kd=1,Gl?Id=Hp(o,e.containerInfo,Rd,_f,vf,gf,z,Cf,hf,null,null):(_f(),vf(),z())}function hf(e){if(kd!==0){var t=Ad.onRecoverableError;t(e,{componentStack:null})}}function gf(){kd===3&&(kd=0,Bu(jd,Ad),kd=4)}function _f(){if(kd===1){kd=0;var e=Ad,t=jd,n=Md,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=M.T,M.T=null;var i=N.p;N.p=2;var a=od;od|=4;try{gu=_u=!1,Iu(t,e,n),n=vp;var o=Xr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Yr(s.ownerDocument.documentElement,s)){if(c!==null&&Zr(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 _=Jr(s,h),v=Jr(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}}Eh=!!_p,vp=_p=null}finally{od=a,N.p=i,M.T=r}}e.current=t,kd=2}}function vf(){if(kd===2){kd=0;var e=Ad,t=jd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=od;od|=4;try{xu(e,t.alternate,t)}finally{od=i,N.p=r,M.T=n}}kd=3}}function z(){if(kd===4||kd===3){kd=0;var e=Id;Id=null,He();var t=Ad,n=jd,r=Md,i=Fd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?kd=5:(kd=0,jd=Ad=null,yf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Od=null),xt(r),n=n.stateNode,$e&&typeof $e.onCommitFiberRoot==`function`)try{$e.onCommitFiberRoot(Qe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=M.T,a=N.p,N.p=2,M.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{M.T=n,N.p=a}}if(i=Ld,o=Rd,Rd=null,i!==null&&(Ld=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);Md&3&&xf(),B(t),a=t.pendingLanes,r&261930&&a&42?t===Bd?zd++:(zd=0,Bd=t):(zd=0,Bd=null),Rf(0,!1)}}function yf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ia(t)))}function xf(){return Id!==null&&(Id.skipTransition(),Id=null),_f(),vf(),z(),Cf()}function Cf(){if(kd!==5)return!1;var e=Ad,t=Nd;Nd=0;var n=xt(Md),r=M.T,a=N.p;try{N.p=32>n?32:n,M.T=null,n=Pd,Pd=null;var o=Ad,s=Md;if(kd=0,jd=Ad=null,Md=0,od&6)throw Error(i(331));var c=od;if(od|=4,td(o.current),qu(o,o.current,s,n),od=c,Rf(0,!1),$e&&typeof $e.onPostCommitFiberRoot==`function`)try{$e.onPostCommitFiberRoot(Qe,o)}catch{}return!0}finally{N.p=a,M.T=r,yf(e,t)}}function wf(e,t,n){t=Gi(n,t),t=Nc(e.stateNode,t,2),e=xo(e,t,2),e!==null&&(ht(e,2),B(e))}function Tf(e,t,n){if(e.tag===3)wf(e,e,n);else for(;t!==null;){if(t.tag===3){wf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Od===null||!Od.has(r))){e=Gi(n,e),n=Pc(2),r=xo(t,n,2),r!==null&&(Fc(n,r,t,e),ht(r,2),B(r));break}}t=t.return}}function Ef(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ad;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)||(pd=!0,i.add(n),e=Df.bind(null,e,t,n),t.then(e,e))}function Df(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,sd===e&&(R&n)===n&&(hd===4||hd===3&&(R&62914560)===R&&300>Ue()-wd?od&2?vd|=n:Zd(e,0):vd|=n,bd===R&&(bd=0)),B(e)}function Of(e,t){t===0&&(t=pt()),e=Ai(e,t),e!==null&&(ht(e,t),B(e))}function kf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Of(e,n)}function Af(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Of(e,n)}function jf(e,t){return ze(e,t)}var Mf=null,Nf=null,Pf=!1,Ff=!1,If=!1,Lf=0;function B(e){e!==Nf&&e.next===null&&(Nf===null?Mf=Nf=e:Nf=Nf.next=e),Ff=!0,Pf||(Pf=!0,Wf())}function Rf(e,t){if(!If&&Ff){If=!0;do for(var n=!1,r=Mf;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-tt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Uf(r,a))}else a=R,a=lt(r,r===sd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ut(r,a)||(n=!0,Uf(r,a))}r=r.next}while(n);If=!1}}function zf(){Bf()}function Bf(){Ff=Pf=!1;var e=0;Lf!==0&&Tp()&&(e=Lf);for(var t=Ue(),n=null,r=Mf;r!==null;){var i=r.next,a=Vf(r,t);a===0?(r.next=null,n===null?Mf=i:n.next=i,i===null&&(Nf=n)):(n=r,(e!==0||a&3)&&(Ff=!0)),r=i}kd!==0&&kd!==5||Rf(e,!1),Lf!==0&&(Lf=0)}function Vf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-tt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ft(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=sd,n=R,n=lt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ld===2||ld===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Be(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ut(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Be(r),xt(n)){case 2:case 8:n=Ke;break;case 32:n=qe;break;case 268435456:n=Ye;break;default:n=qe}return r=Hf.bind(null,e),n=ze(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Be(r),e.callbackPriority=2,e.callbackNode=null,2}function Hf(e,t){if(kd!==0&&kd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(xf()&&e.callbackNode!==n)return null;var r=R;return r=lt(e,e===sd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Gd(e,r,t),Vf(e,Ue()),e.callbackNode!=null&&e.callbackNode===n?Hf.bind(null,e):null)}function Uf(e,t){if(xf())return null;Gd(e,t,!0)}function Wf(){Ap(function(){od&6?ze(Ge,zf):Bf()})}function Gf(){if(Lf===0){var e=Ha;e===0&&(e=at,at<<=1,!(at&261888)&&(at=256)),Lf=e}return Lf}function Kf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:bn(e)}function qf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Kf((i[Et]||null).action),o=r.submitter;o&&(t=(t=o[Et]||null)?Kf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Hn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Lf!==0){var e=new FormData(i,o);ac(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),ac(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Jf=0;Jf<_i.length;Jf++){var Yf=_i[Jf];vi(Yf.toLowerCase(),`on`+(Yf[0].toUpperCase()+Yf.slice(1)))}vi(li,`onAnimationEnd`),vi(ui,`onAnimationIteration`),vi(di,`onAnimationStart`),vi(`dblclick`,`onDoubleClick`),vi(`focusin`,`onFocus`),vi(`focusout`,`onBlur`),vi(fi,`onTransitionRun`),vi(pi,`onTransitionStart`),vi(mi,`onTransitionCancel`),vi(hi,`onTransitionEnd`),Ut(`onMouseEnter`,[`mouseout`,`mouseover`]),Ut(`onMouseLeave`,[`mouseout`,`mouseover`]),Ut(`onPointerEnter`,[`pointerout`,`pointerover`]),Ut(`onPointerLeave`,[`pointerout`,`pointerover`]),Ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Xf=`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(` `),V=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Xf));function Zf(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){Ci(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){Ci(e)}i.currentTarget=null,a=c}}}}function H(e,t){var n=t[Ot];n===void 0&&(n=t[Ot]=new Set);var r=e+`__bubble`;n.has(r)||(tp(t,e,2,!1),n.add(r))}function Qf(e,t,n){var r=0;t&&(r|=4),tp(n,e,r,t)}var $f=`_reactListening`+Math.random().toString(36).slice(2);function ep(e){if(!e[$f]){e[$f]=!0,Bt.forEach(function(t){t!==`selectionchange`&&(V.has(t)||Qf(t,!1,e),Qf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$f]||(t[$f]=!0,Qf(`selectionchange`,!1,t))}}function tp(e,t,n,r){switch(Nh(t)){case 2:var i=Dh;break;case 8:i=Oh;break;default:i=kh}n=i.bind(null,t,n,e),i=void 0,!jn||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 np(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Ft(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}On(function(){var r=a,i=Cn(n),s=[];a:{var c=gi.get(e);if(c!==void 0){var l=Hn,u=e;switch(e){case`keypress`:if(Ln(n)===0)break a;case`keydown`:case`keyup`:l=or;break;case`focusin`:u=`focus`,l=Zn;break;case`focusout`:u=`blur`,l=Zn;break;case`beforeblur`:case`afterblur`:l=Zn;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=Yn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Xn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=lr;break;case li:case ui:case di:l=Qn;break;case hi:l=ur;break;case`scroll`:case`scrollend`:l=Wn;break;case`wheel`:l=dr;break;case`copy`:case`cut`:case`paste`:l=$n;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=sr;break;case`submit`:l=cr;break;case`toggle`:case`beforetoggle`:l=fr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;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=kn(m,p),g!=null&&d.push(rp(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==Sn&&(u=n.relatedTarget||n.fromElement)&&(Ft(u)||u[Dt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Ft(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Yn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=sr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:P(c),h=l==null?u:P(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Ft(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,ap):null,c!==null&&op(s,u,c,d,!1),l!==null&&f!==null&&op(s,f,l,d,!0)))}a:{if(c=r?P(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Mr;else if(Er(c)){if(Nr)_=Hr;else{_=Br;var v=zr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&_n(r.elementType)&&(_=Mr):_=Vr;if(_&&=_(e,r)){Dr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?P(r):window,e){case`focusin`:(Er(v)||v.contentEditable===`true`)&&($r=v,ei=r,ti=null);break;case`focusout`:ti=ei=$r=null;break;case`mousedown`:ni=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ni=!1,ri(s,n,i);break;case`selectionchange`:if(Qr)break;case`keydown`:case`keyup`:ri(s,n,i)}var y;if(mr)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 Sr?br(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(_r&&n.locale!==`ko`&&(Sr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Sr&&(y=In()):(Nn=i,Pn=`value`in Nn?Nn.value:Nn.textContent,Sr=!0)),v=ip(r,b),0<v.length&&(b=new er(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=xr(n),y!==null&&(b.data=y)))),(y=gr?Cr(e,n):wr(e,n))&&(b=ip(r,`onBeforeInput`),0<b.length&&(v=new er(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),qf(s,e,r,n,i)}Zf(s,t)})}function rp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ip(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=kn(e,n),i!=null&&r.unshift(rp(e,i,a)),i=kn(e,t),i!=null&&r.push(rp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ap(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function op(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=kn(n,a),l!=null&&o.unshift(rp(n,l,c))):i||(l=kn(n,a),l!=null&&o.push(rp(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var sp=/\r\n?/g,cp=/\u0000|\uFFFD/g;function U(e){return(typeof e==`string`?e:``+e).replace(sp,`
|
|
18
|
+
`).replace(cp,``)}function lp(e,t){return t=U(t),U(e)===t}function up(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&pn(e,``+r);else return;break;case`className`:Zt(e,`class`,r);break;case`tabIndex`:Zt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Zt(e,n,r);break;case`style`:gn(e,r,o);return;case`data`:if(t!==`object`){Zt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=bn(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`&&up(e,t,`name`,a.name,a,null),up(e,t,`formEncType`,a.formEncType,a,null),up(e,t,`formMethod`,a.formMethod,a,null),up(e,t,`formTarget`,a.formTarget,a,null)):(up(e,t,`encType`,a.encType,a,null),up(e,t,`method`,a.method,a,null),up(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=bn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=xn);return;case`onScroll`:r!=null&&H(`scroll`,e);return;case`onScrollEnd`:r!=null&&H(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(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=bn(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`:H(`beforetoggle`,e),H(`toggle`,e),Xt(e,`popover`,r);break;case`xlinkActuate`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Xt(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=vn.get(n)||n,Xt(e,n,r);else return}Jt=!0}function dp(e,t,n,r,a,o){switch(n){case`style`:gn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)pn(e,``+r);else return;break;case`onScroll`:r!=null&&H(`scroll`,e);return;case`onScrollEnd`:r!=null&&H(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=xn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Vt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Et]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Jt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Xt(e,n,r)}return}Jt=!0}function fp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:H(`error`,e),H(`load`,e);var r=!1,a=!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`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:up(e,t,o,s,n,null)}}a&&up(e,t,`srcSet`,n.srcSet,n,null),r&&up(e,t,`src`,n.src,n,null);return;case`input`:H(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=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(i(137,t));break;default:up(e,t,r,d,n,null)}}cn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in H(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:up(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&un(e,!!r,n,!0):un(e,!!r,t,!1);return;case`textarea`:for(s in H(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:up(e,t,s,c,n,null)}fn(e,r,a,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:up(e,t,l,r,n,null)}return;case`dialog`:H(`beforetoggle`,e),H(`toggle`,e),H(`cancel`,e),H(`close`,e);break;case`iframe`:case`object`:H(`load`,e);break;case`video`:case`audio`:for(r=0;r<Xf.length;r++)H(Xf[r],e);break;case`image`:H(`error`,e),H(`load`,e);break;case`details`:H(`toggle`,e);break;case`embed`:case`source`:case`link`:H(`error`,e),H(`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(i(137,t));default:up(e,t,u,r,n,null)}return;default:if(_n(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&dp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&up(e,t,c,r,n,null))}var pp={};function mp(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 a=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)||up(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&&(Jt=!0),o=m;break;case`name`:m!==f&&(Jt=!0),a=m;break;case`checked`:m!==f&&(Jt=!0),u=m;break;case`defaultChecked`:m!==f&&(Jt=!0),d=m;break;case`value`:m!==f&&(Jt=!0),s=m;break;case`defaultValue`:m!==f&&(Jt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&up(e,t,p,m,r,f)}}sn(e,s,c,l,u,d,o,a);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)||up(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Jt=!0),p=o;break;case`defaultValue`:o!==l&&(Jt=!0),c=o;break;case`multiple`:o!==l&&(Jt=!0),s=o;default:o!==l&&up(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?un(e,!!n,n?[]:``,!1):un(e,!!n,t,!0)):un(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:up(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Jt=!0),p=a;break;case`defaultValue`:a!==o&&(Jt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&up(e,t,s,a,r,o)}dn(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:up(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&&(Jt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:up(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)&&up(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(i(137,t));break;default:up(e,t,u,p,r,m)}return;default:if(_n(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&dp(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||dp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&up(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||up(e,t,f,p,r,m)}function hp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function gp(){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&&hp(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&&hp(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 _p=null,vp=null;function yp(e){return e.nodeType===9?e:e.ownerDocument}function bp(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 xp(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 Sp(e,t,n,r){return n=yp(n).createElement(e),n[Tt]=r,n[Et]=t,fp(n,e,t),Rt(n),n}function Cp(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 wp=null;function Tp(){var e=window.event;return e&&e.type===`popstate`?e!==wp&&(wp=e,!0):(wp=null,!1)}var Ep=typeof setTimeout==`function`?setTimeout:void 0,Dp=typeof clearTimeout==`function`?clearTimeout:void 0,Op=typeof Promise==`function`?Promise:void 0,kp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Ep,Ap=typeof queueMicrotask==`function`?queueMicrotask:Op===void 0?Ep:function(e){return Op.resolve(null).then(e).catch(jp)};function jp(e){setTimeout(function(){throw e})}function Mp(e){return e===`head`}function Np(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),Qh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Dm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Dm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Dm(e.ownerDocument.body)}n=i}while(n);Qh(t)}function Pp(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 Fp(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 Ip(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 Lp(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 Rp(e){return Lp(e.getBoundingClientRect(),getComputedStyle(e),e)}function zp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Lp(t,n,e)}function Bp(e){return e.documentElement.clientHeight}function Vp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Hp(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`&&(Bp(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+=oh(f),u>lh){s.length=o;break}f=new Promise(Vp.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 Up(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Up.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Up.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},Up.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Wp(e){return{name:e,group:new Up(`group`,e),imagePair:new Up(`image-pair`,e),old:new Up(`old`,e),new:new Up(`new`,e)}}function Gp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Gp.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(Xp(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=Jp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Kp,e,s,r)}this._eventListeners=a}};function Kp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Gp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Xp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Jp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,qp,e,n,i),r.splice(t,1),a!==null&&a()}};function qp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function Jp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Yp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Xp(e,t,n,r){if(e.length===0)return-1;r=Yp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Yp(a.optionsOrUseCapture)===r)return i}return-1}Gp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(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,Jp(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,Jp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Gp.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Zp,e,void 0,void 0)};function Zp(e,t){return e.tag!==6&&(e=v(e),Cm(e,t))}Gp.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,Qp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Zp(t[n],e);n--);};function Qp(e,t){return t.push(e),!1}Gp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=yp(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,$p,e,void 0,void 0))};function $p(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Gp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,em,e,void 0,void 0)};function em(e,t){return e.tag!==6&&(e=v(e),t.observe(e),!1)}Gp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,tm,e,void 0,void 0);for(var n=t=0;n<nm.length;n++){var r=nm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):nm[t++]=r}nm.length=t}};function tm(e,t){return e.tag!==6&&(e=v(e),t.unobserve(e),!1)}var nm=[],rm=!1;function im(e,t,n){nm.push({fragmentInstance:e,observer:t,instance:n}),rm||(rm=!0,wm(function(){rm=!1;var e=nm;nm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Gp.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,am,e,void 0,void 0),e};function am(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=v(e),t.push.apply(t,e.getClientRects());return!1}Gp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Gp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,Qp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(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=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(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=v(n[0]),i=v(n[n.length-1]);var a=h(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||om(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function om(e,t,n,r,i){var a=Ft(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=m(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=w(n,a,C),t===null?t=!1:(f(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(f(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function sm(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)}Gp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,Qp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),sm(e,n);return}if(r=v(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 a=t[r];a.tag===6?(a=v(a),sm(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function cm(e,t){return e=v(e),lm(e,t),!1}function lm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function um(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,Jp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<nm.length;i++){var a=nm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(nm[r++]=a)}nm.length=r,n.observe(e)}),lm(e,t))}function dm(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,Jp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?im(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function fm(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`:fm(n),Pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function pm(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[Mt])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=ym(e.nextSibling),e===null)break}return null}function mm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=ym(e.nextSibling),e===null))return null;return e}function hm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=ym(e.nextSibling),e===null))return null;return e}function gm(e){return e.data===`$?`||e.data===`$~`}function _m(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function vm(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 ym(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 bm=null;function xm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return ym(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Sm(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 Cm(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 wm(e){kp(function(){kp(function(t){return e(t)})})}function Tm(e,t,n){switch(t=yp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Em(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&up(e,t,r,null,pp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===xn&&(e.onclick=null),Pt(e)}function Dm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pt(e)}var Om=new Map,km=new Set;function Am(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 jm=N.d;N.d={f:Mm,r:Nm,D:Im,C:Lm,L:Rm,m:zm,X:Vm,S:Bm,M:Hm};function Mm(){var e=jm.f(),t=Yd();return e||t}function Nm(e){var t=It(e);t!==null&&t.tag===5&&t.type===`form`?sc(t):jm.r(e)}var Pm=typeof document>`u`?null:document;function Fm(e,t,n){var r=Pm;if(r&&typeof t==`string`&&t){var i=on(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),km.has(i)||(km.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),fp(t,`link`,e),Rt(t),r.head.appendChild(t)))}}function Im(e){jm.D(e),Fm(`dns-prefetch`,e,null)}function Lm(e,t){jm.C(e,t),Fm(`preconnect`,e,t)}function Rm(e,t,n){jm.L(e,t,n);var r=Pm;if(r&&e&&t){var i=`link[rel="preload"][as="`+on(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+on(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+on(n.imageSizes)+`"]`)):i+=`[href="`+on(e)+`"]`;var a=i;switch(t){case`style`:a=Wm(e);break;case`script`:a=Jm(e)}if(!(Om.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Om.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Gm(a))||t===`script`&&r.querySelector(Ym(a))))){var o=r.createElement(`link`);fp(o,`link`,e),t===`style`&&(o[Nt]=!0,o.onload=o.onerror=function(){zt(o)}),Rt(o),r.head.appendChild(o)}}}function zm(e,t){jm.m(e,t);var n=Pm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+on(r)+`"][href="`+on(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Jm(e)}if(!Om.has(a)&&(e=T({rel:`modulepreload`,href:e},t),Om.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ym(a)))return}r=n.createElement(`link`),fp(r,`link`,e),Rt(r),n.head.appendChild(r)}}}function Bm(e,t,n){jm.S(e,t,n);var r=Pm;if(r&&e){var i=Lt(r).hoistableStyles,a=Wm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Gm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Om.get(a))&&Qm(e,n);var c=o=r.createElement(`link`);Rt(c),fp(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,Zm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Vm(e,t){jm.X(e,t);var n=Pm;if(n&&e){var r=Lt(n).hoistableScripts,i=Jm(e),a=r.get(i);a||(a=n.querySelector(Ym(i)),a||(e=T({src:e,async:!0},t),(t=Om.get(i))&&$m(e,t),a=n.createElement(`script`),Rt(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hm(e,t){jm.M(e,t);var n=Pm;if(n&&e){var r=Lt(n).hoistableScripts,i=Jm(e),a=r.get(i);a||(a=n.querySelector(Ym(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=Om.get(i))&&$m(e,t),a=n.createElement(`script`),Rt(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Um(e,t,n,r){var a=(a=Te.current)?Am(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Wm(n.href),t=Lt(a).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=Wm(n.href);var o=Lt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Gm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Om.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},Om.set(e,o)),qm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Jm(n),t=Lt(a).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(i(444,e))}}function Wm(e){return`href="`+on(e)+`"`}function Gm(e){return`link[rel="stylesheet"][`+e+`]`}function Km(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function qm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Nt]){r.loading=1;return}}else t=e.createElement(`link`),t[Nt]=!0,t.onload=t.onerror=zt.bind(null,t),fp(t,`link`,n),Rt(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 Jm(e){return`[src="`+on(e)+`"]`}function Ym(e){return`script[async]`+e}function Xm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+on(n.href)+`"]`);if(r)return t.instance=r,Rt(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Rt(r),fp(r,`style`,a),Zm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Wm(n.href);var o=e.querySelector(Gm(a));if(o)return t.state.loading|=4,t.instance=o,Rt(o),o;r=Km(n),(a=Om.get(a))&&Qm(r,a),o=(e.ownerDocument||e).createElement(`link`),Rt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),fp(o,`link`,r),t.state.loading|=4,Zm(o,n.precedence,e),t.instance=o;case`script`:return o=Jm(n.src),(a=e.querySelector(Ym(o)))?(t.instance=a,Rt(a),a):(r=n,(a=Om.get(o))&&(r=T({},n),$m(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Rt(a),fp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Zm(r,n.precedence,e));return t.instance}function Zm(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 Qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function $m(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var eh=null;function th(e,t,n){if(eh===null){var r=new Map,i=eh=new Map;i.set(n,r)}else i=eh,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[Mt]||a[Tt]||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 nh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function rh(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 ih(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function ah(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function oh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function sh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=oh(t),e.suspenseyImages.push(t)),e=ph.bind(e),t.decode().then(e,e))}function ch(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=Wm(r.href),a=t.querySelector(Gm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=fh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Rt(a);return}a=t.ownerDocument||t,r=Km(r),(i=Om.get(i))&&Qm(r,i),a=a.createElement(`link`),Rt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),fp(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=fh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var lh=0;function uh(e,t){return e.stylesheets&&e.count===0&&hh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&hh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&lh===0&&(lh=62500*gp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&hh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>lh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function dh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)hh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function fh(){this.count--,dh(this)}function ph(){this.imgCount--,dh(this)}var mh=null;function hh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,mh=new Map,t.forEach(gh,e),mh=null,fh.call(e))}function gh(e,t){if(!(t.state.loading&4)){var n=mh.get(e);if(n)var r=n.get(null);else{n=new Map,mh.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=fh.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 _h={$$typeof:A,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function vh(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=mt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.hiddenUpdates=mt(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 yh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new vh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Fi(3,null,null,t),e.current=a,a.stateNode=e,t=Fa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},vo(a),e}function bh(e){return e?(e=Ni,e):Ni}function xh(e,t,n,r,i,a){i=bh(i),r.context===null?r.context=i:r.pendingContext=i,r=bo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=xo(e,r,t),n!==null&&(Wd(n,e,t),So(n,e,t))}function Sh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ch(e,t){Sh(e,t),(e=e.alternate)&&Sh(e,t)}function wh(e){if(e.tag===13||e.tag===31){var t=Ai(e,67108864);t!==null&&Wd(t,e,67108864),Ch(e,67108864)}}function Th(e){if(e.tag===13||e.tag===31){var t=Vd();t=bt(t);var n=Ai(e,t);n!==null&&Wd(n,e,t),Ch(e,t)}}var Eh=!0;function Dh(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,kh(e,t,n,r)}finally{N.p=a,M.T=i}}function Oh(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,kh(e,t,n,r)}finally{N.p=a,M.T=i}}function kh(e,t,n,r){if(Eh){var i=Ah(r);if(i===null)np(e,t,r,jh,n),Hh(e,r);else if(Wh(i,e,t,n,r))r.stopPropagation();else if(Hh(e,r),t&4&&-1<Vh.indexOf(e)){for(;i!==null;){var a=It(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ct(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-tt(o);s.entanglements[1]|=c,o&=~c}B(a),!(od&6)&&(Ed=Ue()+500,Rf(0,!1))}}break;case 31:case 13:s=Ai(a,2),s!==null&&Wd(s,a,2),Yd(),Ch(a,2)}if(a=Ah(r),a===null&&np(e,t,r,jh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else np(e,t,r,null,n)}}function Ah(e){return e=Cn(e),Mh(e)}var jh=null;function Mh(e){if(jh=null,e=Ft(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 jh=e,null}function Nh(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(We()){case Ge:return 2;case Ke:return 8;case qe:case Je:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var Ph=!1,Fh=null,Ih=null,Lh=null,Rh=new Map,zh=new Map,Bh=[],Vh=`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 Hh(e,t){switch(e){case`focusin`:case`focusout`:Fh=null;break;case`dragenter`:case`dragleave`:Ih=null;break;case`mouseover`:case`mouseout`:Lh=null;break;case`pointerover`:case`pointerout`:Rh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:zh.delete(t.pointerId)}}function Uh(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=It(t),t!==null&&wh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Wh(e,t,n,r,i){switch(t){case`focusin`:return Fh=Uh(Fh,e,t,n,r,i),!0;case`dragenter`:return Ih=Uh(Ih,e,t,n,r,i),!0;case`mouseover`:return Lh=Uh(Lh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Rh.set(a,Uh(Rh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,zh.set(a,Uh(zh.get(a)||null,e,t,n,r,i)),!0}return!1}function Gh(e){var t=Ft(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Ct(e.priority,function(){Th(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Ct(e.priority,function(){Th(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 Kh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ah(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Sn=r,n.target.dispatchEvent(r),Sn=null}else return t=It(n),t!==null&&wh(t),e.blockedOn=n,!1;t.shift()}return!0}function qh(e,t,n){Kh(e)&&n.delete(t)}function Jh(){Ph=!1,Fh!==null&&Kh(Fh)&&(Fh=null),Ih!==null&&Kh(Ih)&&(Ih=null),Lh!==null&&Kh(Lh)&&(Lh=null),Rh.forEach(qh),zh.forEach(qh)}function Yh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ph||(Ph=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Jh)))}var Xh=null;function Zh(e){Xh!==e&&(Xh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Xh===e&&(Xh=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(Mh(r||n)===null)continue;break}var a=It(n);a!==null&&(e.splice(t,3),t-=3,ac(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Qh(e){function t(t){return Yh(t,e)}Fh!==null&&Yh(Fh,e),Ih!==null&&Yh(Ih,e),Lh!==null&&Yh(Lh,e),Rh.forEach(t),zh.forEach(t);for(var n=0;n<Bh.length;n++){var r=Bh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Bh.length&&(n=Bh[0],n.blockedOn===null);)Gh(n),n.blockedOn===null&&Bh.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[Et]||null;if(typeof a==`function`)o||Zh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Et]||null)s=o.formAction;else if(Mh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Zh(n)}}}function $h(){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 eg(e){this._internalRoot=e}tg.prototype.render=eg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;xh(n,Vd(),e,t,null,null)},tg.prototype.unmount=eg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xh(e.current,2,null,e,null,null),Yd(),t[Dt]=null}};function tg(e){this._internalRoot=e}tg.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Bh.length&&t!==0&&t<Bh[n].priority;n++);Bh.splice(n,0,e),n===0&&Gh(e)}};var ng=n.version;if(ng!==`19.3.0`)throw Error(i(527,ng,`19.3.0`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var rg={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ig=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ig.isDisabled&&ig.supportsFiber)try{Qe=ig.inject(rg),$e=ig}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Oc,s=kc,c=Ac;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=yh(e,1,!1,null,null,n,r,null,o,s,c,$h),e[Dt]=t.current,ep(e),new eg(t)}})),wf=o(((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=Cf()}))(),Tf={activity:400,thoughts:40,chat:100};function Ef(e,t,n){let r=e??[],i=new Set(r.map(e=>e.id)),a=t.filter(e=>typeof e?.id==`number`&&!i.has(e.id));return[...r,...a].slice(-n)}var Df=class{records=new Map;listeners=new Set;reads=new Map;used=new Set;reader;currentStatus={connection:`connecting`,signedOut:!1};get(e){let t=this.records.get(e);if(t)return t;let n={version:0,data:void 0,loading:!1,error:void 0,stale:!1};return this.records.set(e,n),n}status(){return{...this.currentStatus}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}markUsed(e,t){this.reader=t;let n=e.filter(e=>!this.used.has(e));this.used=new Set(e);for(let e of n)this.read(e)}onHello(e){for(let t of this.used){let n=e[t];n!==void 0&&(this.get(t).version=n),this.read(t)}}onChanged(e,t){let n=this.get(e);n.version=t,this.used.has(e)?this.read(e):n.stale=!0,this.notify()}onFeedDelta(e){let t=this.get(`lobby`).data;t&&(this.get(`lobby`).data={...t,activity:Ef(t.activity,e.activity??[],Tf.activity),thoughts:Ef(t.thoughts,e.thoughts??[],Tf.thoughts),chat:Ef(t.chat,e.chat??[],Tf.chat)},this.notify())}onReplyDelta(e){let t=this.get(`lobby`),n=t.data;n&&(t.data={...n,reply:e},this.notify())}onStatus(e){this.currentStatus={...this.currentStatus,...e},this.notify()}async read(e){let t=this.reader;if(!t)return;let n=(this.reads.get(e)??0)+1;this.reads.set(e,n);let r=this.get(e);r.loading=!0,r.error=void 0,this.notify();try{let i=await t(e);if(this.reads.get(e)!==n)return;this.apply(r,i)}catch(t){if(this.reads.get(e)!==n)return;r.loading=!1,r.error=t instanceof Error?t.message:String(t)}this.notify()}apply(e,t){e.data=t,e.loading=!1,e.stale=!1,e.error=void 0}notify(){for(let e of[...this.listeners])e()}};function Of(){return new Df}var kf=Of(),Af={info:3600,success:3e3,warning:5e3,error:6e3},jf,Mf=[],Nf=0,Pf=new Set;function Ff(){for(let e of[...Pf])e()}function If(e,t,n){let r=t.trim();if(!r||jf?.message===r||Mf.some(e=>e.message===r))return;let i={id:++Nf,kind:e,message:r,duration:n?.duration??Af[e],...n?.action?{action:n.action}:{}};jf?Mf=[...Mf,i].slice(-3):jf=i,Ff()}function Lf(e){jf?.id===e&&(jf=Mf[0],Mf=Mf.slice(1),Ff())}var B=Object.assign((e,t)=>If(`info`,e,t),{success:(e,t)=>If(`success`,e,t),error:(e,t)=>If(`error`,e,t),warning:(e,t)=>If(`warning`,e,t),info:(e,t)=>If(`info`,e,t)});function Rf(e){return Pf.add(e),()=>{Pf.delete(e)}}function zf(){return{item:(0,m.useSyncExternalStore)(Rf,()=>jf,()=>void 0),waiting:(0,m.useSyncExternalStore)(Rf,()=>Mf.length,()=>0)}}var Bf=/^[a-f0-9]{32}$/;function Vf(){return globalThis.location}function Hf(){let e=Vf()?.search??``,t=new URLSearchParams(e).getAll(`project`);if(t.length){if(t.length!==1||!Bf.test(t[0]))throw Error(`Invalid project ID. Choose a running project below.`);return t[0]}}function Uf(e){if(!e.startsWith(`/api/`)&&!e.startsWith(`/files/preview/`))return e;let t=Hf();return t?`/projects/${t}${e}`:e}function Wf(e,t){if(!Bf.test(e))throw Error(`Invalid project ID.`);let n=Vf();if(!n)throw Error(`Project switching requires a browser.`);let r=new URL(n.origin);r.pathname=n.pathname,r.searchParams.set(`project`,e),r.hash=`/${t}`,n.assign(r.href)}var Gf=class extends Error{code;status;constructor(e,t,n){super(e),this.name=`ApiError`,this.code=t,this.status=n}},Kf={"Content-Type":`application/json`};async function qf(e,t={}){let n=await fetch(e===`auth.login`||e===`projects.list`?`/api/${e}`:Uf(`/api/${e}`),{method:`POST`,headers:Kf,body:JSON.stringify(t),credentials:`same-origin`}),r=await n.json().catch(()=>void 0);if(!r)throw new Gf(`the lobby answered ${n.status}`,`failed`,n.status);if(!r.ok)throw r.code===`unauthorized`&&kf.onStatus({signedOut:!0}),new Gf(r.error,r.code,n.status);return r.result}function Jf(){return globalThis.location}async function Yf(){let e=Jf(),t=e?new URLSearchParams(e.hash.replace(/^#/,``)).get(`token`):null;if(!t||!(await fetch(`/api/auth.login`,{method:`POST`,headers:Kf,body:JSON.stringify({token:t}),credentials:`same-origin`}).catch(()=>void 0))?.ok)return!1;let n=globalThis.history;return n&&n.replaceState(null,``,e.pathname+e.search),kf.onStatus({signedOut:!1}),!0}function Xf(e){return e instanceof Error?e.message:`That did not work. Try again.`}async function V(e,t,n={}){try{let r=await qf(e,t),i=r.notice;return i&&B(i,n.undo?{action:{label:`Undo`,onClick:n.undo}}:void 0),r}catch(e){B.error(Xf(e));return}}var Zf=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function H(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Zf(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Qf=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},$f=e=>{let t=Qf(e);return t.charAt(0).toUpperCase()+t.slice(1)},ep=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),tp={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function np(e){return e!=null}function rp(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??tp.width,a=e.size??e.height??tp.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?ep(...c):ep(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??tp[`stroke-width`])*Number(e.size??e.width??tp.width)/Number(t.size??t.width??tp.width):t.strokeWidth??tp[`stroke-width`];return[`svg`,{...Object.entries(tp).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&np(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&np(t.width)&&{[r(`width`)]:t.width},...`height`in t&&np(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function ip(e,t={}){return rp(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var ap=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},op=(0,m.createContext)({}),sp=()=>(0,m.useContext)(op),cp=(0,m.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=sp()??{},b=!!c||ap(d),[x,S,C=[]]=ip(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:ep(y,s),hasA11yProp:b,attributes:d});return(0,m.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,m.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function U(e,t=[],n=[]){let r=typeof e==`string`?H(e,t,n):e,i=(0,m.forwardRef)(({className:e,...t},n)=>(0,m.createElement)(cp,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=$f(r.name)),i}var lp={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};lp.node;var up=U(lp),dp={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};dp.node;var fp=U(dp),pp={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};pp.node;var mp=U(pp),hp={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};hp.node;var gp=U(hp),_p={name:`arrow-right-to-line`,size:24,node:[[`path`,{d:`M17 12H3`,key:`8awo09`}],[`path`,{d:`m11 18 6-6-6-6`,key:`8c2y43`}],[`path`,{d:`M21 5v14`,key:`nzette`}]]};_p.node;var vp=U(_p),yp={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};yp.node;var bp=U(yp),xp={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};xp.node;var Sp=U(xp),Cp={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};Cp.node;var wp=U(Cp),Tp={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]};Tp.node;var Ep=U(Tp),Dp={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Dp.node;var Op=U(Dp),kp={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};kp.node;var Ap=U(kp),jp={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};jp.node;var Mp=U(jp),Np={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Np.node;var Pp=U(Np),Fp={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};Fp.node;var Ip=U(Fp),Lp={name:`chevrons-up`,size:24,node:[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]};Lp.node;var Rp=U(Lp),zp={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};zp.node;var Bp=U(zp),Vp={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Vp.node;var Hp=U(Vp),Up={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};Up.node;var Wp=U(Up),Gp={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Gp.node;var Kp=U(Gp),qp={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};qp.node;var Jp=U(qp),Yp={name:`circle-stop`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]],aliases:[`stop-circle`]};Yp.node;var Xp=U(Yp),Zp={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};Zp.node;var Qp=U(Zp),$p={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};$p.node;var em=U($p),tm={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};tm.node;var nm=U(tm),rm={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};rm.node;var im=U(rm),am={name:`compass`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]};am.node;var om=U(am),sm={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};sm.node;var cm=U(sm),lm={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};lm.node;var um=U(lm),dm={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};dm.node;var fm=U(dm),pm={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};pm.node;var mm=U(pm),hm={name:`file-pen`,size:24,node:[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]],aliases:[`file-edit`]};hm.node;var gm=U(hm),_m={name:`file-plus`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]};_m.node;var vm=U(_m),ym={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};ym.node;var bm=U(ym),xm={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]};xm.node;var Sm=U(xm),Cm={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};Cm.node;var wm=U(Cm),Tm={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};Tm.node;var Em=U(Tm),Dm={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Dm.node;var Om=U(Dm),km={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};km.node;var Am=U(km),jm={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};jm.node;var Mm=U(jm),Nm={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};Nm.node;var Pm=U(Nm),Fm={name:`list-plus`,size:24,node:[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]};Fm.node;var Im=U(Fm),Lm={name:`loader`,size:24,node:[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]};Lm.node;var Rm=U(Lm),zm={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]};zm.node;var Bm=U(zm),Vm={name:`maximize`,size:24,node:[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]};Vm.node;var Hm=U(Vm),Um={name:`message-circle-question-mark`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`message-circle-question`]};Um.node;var Wm=U(Um),Gm={name:`message-square-plus`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]};Gm.node;var Km=U(Gm),qm={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};qm.node;var Jm=U(qm),Ym={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};Ym.node;var Xm=U(Ym),Zm={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};Zm.node;var Qm=U(Zm),$m={name:`minimize`,size:24,node:[[`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`,key:`hohbtr`}],[`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`,key:`5jw1f3`}],[`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`,key:`198tvr`}],[`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`,key:`ph8mxp`}]]};$m.node;var eh=U($m),th={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};th.node;var nh=U(th),rh={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};rh.node;var ih=U(rh),ah={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};ah.node;var oh=U(ah),sh={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};sh.node;var ch=U(sh),lh={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};lh.node;var uh=U(lh),dh={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};dh.node;var fh=U(dh),ph={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};ph.node;var mh=U(ph),hh={name:`pen-tool`,size:24,node:[[`path`,{d:`M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z`,key:`nt11vn`}],[`path`,{d:`m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18`,key:`15qc1e`}],[`path`,{d:`m2.3 2.3 7.286 7.286`,key:`1wuzzi`}],[`circle`,{cx:`11`,cy:`11`,r:`2`,key:`xmgehs`}]]};hh.node;var gh=U(hh),_h={name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]};_h.node;var vh=U(_h),yh={name:`pencil-off`,size:24,node:[[`path`,{d:`m10 10-6.157 6.162a2 2 0 0 0-.5.833l-1.322 4.36a.5.5 0 0 0 .622.624l4.358-1.323a2 2 0 0 0 .83-.5L14 13.982`,key:`bjo8r8`}],[`path`,{d:`m12.829 7.172 4.359-4.346a1 1 0 1 1 3.986 3.986l-4.353 4.353`,key:`16h5ne`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};yh.node;var bh=U(yh),xh={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};xh.node;var Sh=U(xh),Ch={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};Ch.node;var wh=U(Ch),Th={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Th.node;var Eh=U(Th),Dh={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};Dh.node;var Oh=U(Dh),kh={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};kh.node;var Ah=U(kh),jh={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};jh.node;var Mh=U(jh),Nh={name:`route`,size:24,node:[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]};Nh.node;var Ph=U(Nh),Fh={name:`save`,size:24,node:[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]};Fh.node;var Ih=U(Fh),Lh={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Lh.node;var Rh=U(Lh),zh={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};zh.node;var Bh=U(zh),Vh={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};Vh.node;var Hh=U(Vh),Uh={name:`square-arrow-out-up-right`,size:24,node:[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]],aliases:[`arrow-up-right-from-square`]};Uh.node;var Wh=U(Uh),Gh={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};Gh.node;var Kh=U(Gh),qh={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};qh.node;var Jh=U(qh),Yh={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};Yh.node;var Xh=U(Yh),Zh={name:`tags`,size:24,node:[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]};Zh.node;var Qh=U(Zh),$h={name:`telescope`,size:24,node:[[`path`,{d:`m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44`,key:`k4qptu`}],[`path`,{d:`m13.56 11.747 4.332-.924`,key:`19l80z`}],[`path`,{d:`m16 21-3.105-6.21`,key:`7oh9d`}],[`path`,{d:`M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z`,key:`m7xp4m`}],[`path`,{d:`m6.158 8.633 1.114 4.456`,key:`74o979`}],[`path`,{d:`m8 21 3.105-6.21`,key:`1fvxut`}],[`circle`,{cx:`12`,cy:`13`,r:`2`,key:`1c1ljs`}]]};$h.node;var eg=U($h),tg={name:`timer`,size:24,node:[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]};tg.node;var ng=U(tg),rg={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};rg.node;var ig=U(rg),ag={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};ag.node;var og=U(ag),sg={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};sg.node;var cg=U(sg),lg={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};lg.node;var ug=U(lg),dg={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};dg.node;var fg=U(dg),pg={name:`volume-2`,size:24,node:[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]};pg.node;var mg=U(pg),hg={name:`volume-x`,size:24,node:[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]};hg.node;var gg=U(hg),_g={name:`wifi-off`,size:24,node:[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};_g.node;var vg=U(_g),yg={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};yg.node;var bg=U(yg),xg={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};xg.node;var Sg=U(xg);function Cg(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Cg(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function wg(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Cg(e))&&(r&&(r+=` `),r+=t);return r}var Tg=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Eg=wg,Dg=(e,t)=>n=>{if(t?.variants==null)return Eg(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Tg(t)||Tg(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Eg(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Og=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},kg=(e,t)=>({classGroupId:e,validator:t}),Ag=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),jg=`-`,Mg=[],Ng=`arbitrary..`,Pg=e=>{let t=Lg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Ig(e);let n=e.split(jg);return Fg(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Og(i,t):t:i||Mg}return n[e]||Mg}}},Fg=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Fg(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(jg):e.slice(t).join(jg),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Ig=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ng+r:void 0})(),Lg=e=>{let{theme:t,classGroups:n}=e;return Rg(n,t)},Rg=(e,t)=>{let n=Ag();for(let r in e){let i=e[r];zg(i,n,r,t)}return n},zg=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Bg(i,t,n,r)}},Bg=(e,t,n,r)=>{if(typeof e==`string`){Vg(e,t,n);return}if(typeof e==`function`){Hg(e,t,n,r);return}Ug(e,t,n,r)},Vg=(e,t,n)=>{let r=e===``?t:Wg(t,e);r.classGroupId=n},Hg=(e,t,n,r)=>{if(Gg(e)){zg(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(kg(n,e))},Ug=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];zg(o,Wg(t,a),n,r)}},Wg=(e,t)=>{let n=e,r=t.split(jg),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Ag(),n.nextPart.set(t,i)),n=i}return n},Gg=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Kg=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},qg=`!`,Jg=`:`,Yg=[],Xg=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Zg=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Jg){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(qg)?(c=s.slice(0,-1),l=!0):s.startsWith(qg)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Xg(t,l,c,u)};if(t){let e=t+Jg,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Xg(Yg,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Qg=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},$g=e=>({cache:Kg(e.cacheSize),parseClassName:Zg(e),sortModifiers:Qg(e),postfixLookupClassGroupIds:e_(e),...Pg(e)}),e_=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},t_=/\s+/,n_=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(t_),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+qg:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},r_=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=i_(n))&&(i&&(i+=` `),i+=r);return i},i_=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=i_(e[r]))&&(n&&(n+=` `),n+=t);return n},a_=(e,...t)=>{let n,r,i,a,o=o=>(n=$g(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=n_(e,n);return i(e,a),a};return a=o,(...e)=>a(r_(...e))},o_=[],s_=e=>{let t=t=>t[e]||o_;return t.isThemeGetter=!0,t.themeKey=e,t},c_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,l_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,u_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,d_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,f_=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,p_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,m_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,h_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,g_=e=>u_.test(e),W=e=>!!e&&!Number.isNaN(Number(e)),__=e=>!!e&&Number.isInteger(Number(e)),v_=e=>e.endsWith(`%`)&&W(e.slice(0,-1)),y_=e=>d_.test(e),b_=()=>!0,x_=e=>f_.test(e)&&!p_.test(e),S_=()=>!1,C_=e=>m_.test(e),w_=e=>h_.test(e),T_=e=>!G(e)&&!K(e),E_=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),D_=e=>H_(e,K_,S_),G=e=>c_.test(e),O_=e=>H_(e,q_,x_),k_=e=>H_(e,J_,W),A_=e=>H_(e,X_,b_),j_=e=>H_(e,Y_,S_),M_=e=>H_(e,W_,S_),N_=e=>H_(e,G_,w_),P_=e=>H_(e,Z_,C_),K=e=>l_.test(e),F_=e=>U_(e,q_),I_=e=>U_(e,Y_),L_=e=>U_(e,W_),R_=e=>U_(e,K_),z_=e=>U_(e,G_),B_=e=>U_(e,Z_,!0),V_=e=>U_(e,X_,!0),H_=(e,t,n)=>{let r=c_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},U_=(e,t,n=!1)=>{let r=l_.exec(e);return r?r[1]?t(r[1]):n:!1},W_=e=>e===`position`||e===`percentage`,G_=e=>e===`image`||e===`url`,K_=e=>e===`length`||e===`size`||e===`bg-size`,q_=e=>e===`length`,J_=e=>e===`number`,Y_=e=>e===`family-name`,X_=e=>e===`number`||e===`weight`,Z_=e=>e===`shadow`,Q_=a_(()=>{let e=s_(`color`),t=s_(`font`),n=s_(`text`),r=s_(`font-weight`),i=s_(`tracking`),a=s_(`leading`),o=s_(`breakpoint`),s=s_(`container`),c=s_(`spacing`),l=s_(`radius`),u=s_(`shadow`),d=s_(`inset-shadow`),f=s_(`text-shadow`),p=s_(`drop-shadow`),m=s_(`blur`),h=s_(`perspective`),g=s_(`aspect`),_=s_(`ease`),v=s_(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),K,G],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[K,G,c],T=()=>[g_,`full`,`auto`,...w()],E=()=>[__,`none`,`subgrid`,K,G],D=()=>[`auto`,{span:[`full`,__,K,G]},__,K,G],O=()=>[__,`auto`,K,G],k=()=>[`auto`,`min`,`max`,`fr`,K,G],ee=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],te=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ne=()=>[`auto`,...w()],A=()=>[g_,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],re=()=>[s,g_,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ie=()=>[g_,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],j=()=>[e,K,G],ae=()=>[...b(),L_,M_,{position:[K,G]}],oe=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],se=()=>[`auto`,`cover`,`contain`,R_,D_,{size:[K,G]}],ce=()=>[v_,F_,O_],le=()=>[``,`none`,`full`,l,K,G],ue=()=>[``,W,F_,O_],de=()=>[`solid`,`dashed`,`dotted`,`double`],fe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],pe=()=>[W,v_,L_,M_],me=()=>[``,`none`,m,K,G],he=()=>[`none`,W,K,G],ge=()=>[`none`,W,K,G],M=()=>[W,K,G],N=()=>[g_,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[y_],breakpoint:[y_],color:[b_],container:[y_],"drop-shadow":[y_],ease:[`in`,`out`,`in-out`],font:[T_],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[y_],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[y_],shadow:[y_],spacing:[`px`,W],text:[y_],"text-shadow":[y_],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,g_,G,K,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,K,G]}],"container-named":[E_],columns:[{columns:[W,`auto`,G,K,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[__,`auto`,K,G]}],basis:[{basis:[g_,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[W,g_,`auto`,`initial`,`none`,G]}],grow:[{grow:[``,W,K,G]}],shrink:[{shrink:[``,W,K,G]}],order:[{order:[__,`first`,`last`,`none`,K,G]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ee(),`normal`]}],"justify-items":[{"justify-items":[...te(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...te()]}],"align-content":[{content:[`normal`,...ee()]}],"align-items":[{items:[...te(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...te(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...te(),`baseline`]}],"place-self":[{"place-self":[`auto`,...te()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:ne()}],mx:[{mx:ne()}],my:[{my:ne()}],ms:[{ms:ne()}],me:[{me:ne()}],mbs:[{mbs:ne()}],mbe:[{mbe:ne()}],mt:[{mt:ne()}],mr:[{mr:ne()}],mb:[{mb:ne()}],ml:[{ml:ne()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:A()}],"inline-size":[{inline:[`auto`,...re()]}],"min-inline-size":[{"min-inline":[`auto`,...re()]}],"max-inline-size":[{"max-inline":[`none`,...re()]}],"block-size":[{block:[`auto`,...ie()]}],"min-block-size":[{"min-block":[`auto`,...ie()]}],"max-block-size":[{"max-block":[`none`,...ie()]}],w:[{w:[s,`screen`,...A()]}],"min-w":[{"min-w":[s,`screen`,`none`,...A()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...A()]}],h:[{h:[`screen`,`lh`,...A()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...A()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...A()]}],"font-size":[{text:[`base`,n,F_,O_]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,V_,A_]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,v_,G]}],"font-family":[{font:[I_,j_,t]}],"font-features":[{"font-features":[G]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,K,G]}],"line-clamp":[{"line-clamp":[W,`none`,K,k_]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,K,G]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,K,G]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...de(),`wavy`]}],"text-decoration-thickness":[{decoration:[W,`from-font`,`auto`,K,O_]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[W,`auto`,K,G]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[__,K,G]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,K,G]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,K,G]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ae()}],"bg-repeat":[{bg:oe()}],"bg-size":[{bg:se()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},__,K,G],radial:[``,K,G],conic:[``,__,K,G]},z_,N_]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...de(),`hidden`,`none`]}],"divide-style":[{divide:[...de(),`hidden`,`none`]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...de(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[W,K,G]}],"outline-w":[{outline:[``,W,F_,O_]}],"outline-color":[{outline:j()}],shadow:[{shadow:[``,`inner`,`none`,u,B_,P_]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":[`none`,d,B_,P_]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:ue()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[W,O_]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":[`none`,f,B_,P_]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[W,K,G]}],"mix-blend":[{"mix-blend":[...fe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":fe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[W]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[K,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[W]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ae()}],"mask-repeat":[{mask:oe()}],"mask-size":[{mask:se()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,K,G]}],filter:[{filter:[``,`none`,K,G]}],blur:[{blur:me()}],brightness:[{brightness:[W,K,G]}],contrast:[{contrast:[W,K,G]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,B_,P_]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:[``,W,K,G]}],"hue-rotate":[{"hue-rotate":[W,K,G]}],invert:[{invert:[``,W,K,G]}],saturate:[{saturate:[W,K,G]}],sepia:[{sepia:[``,W,K,G]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,K,G]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[W,K,G]}],"backdrop-contrast":[{"backdrop-contrast":[W,K,G]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,W,K,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[W,K,G]}],"backdrop-invert":[{"backdrop-invert":[``,W,K,G]}],"backdrop-opacity":[{"backdrop-opacity":[W,K,G]}],"backdrop-saturate":[{"backdrop-saturate":[W,K,G]}],"backdrop-sepia":[{"backdrop-sepia":[``,W,K,G]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,K,G]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[W,`initial`,K,G]}],ease:[{ease:[`linear`,`initial`,_,K,G]}],delay:[{delay:[W,K,G]}],animate:[{animate:[`none`,v,K,G]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,K,G]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":[`scale-3d`],skew:[{skew:M()}],"skew-x":[{"skew-x":M()}],"skew-y":[{"skew-y":M()}],transform:[{transform:[K,G,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:N()}],"translate-x":[{"translate-x":N()}],"translate-y":[{"translate-y":N()}],"translate-z":[{"translate-z":N()}],"translate-none":[`translate-none`],zoom:[{zoom:[__,K,G]}],accent:[{accent:j()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,K,G]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":j()}],"scrollbar-track-color":[{"scrollbar-track":j()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,K,G]}],fill:[{fill:[`none`,...j()]}],"stroke-w":[{stroke:[W,F_,O_,k_]}],stroke:[{stroke:[`none`,...j()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function q(...e){return Q_(wg(e))}var $_=Object.defineProperty,ev=(e,t)=>$_(e,`name`,{value:t,configurable:!0});function tv(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ev(tv,`setRef`);function nv(...e){return t=>{let n=!1,r=e.map(e=>{let r=tv(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():tv(e[t],null)}}}}ev(nv,`composeRefs`);function rv(...e){return m.useCallback(nv(...e),e)}ev(rv,`useComposedRefs`);var iv=Object.defineProperty,av=(e,t)=>iv(e,`name`,{value:t,configurable:!0});function ov(e){let t=m.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];hv(r)&&typeof yv==`function`&&(r=yv(r._payload)),m.Children.forEach(r,e=>{if(pv(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;hv(n)&&typeof yv==`function`&&(n=yv(n._payload)),a=uv(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=m.cloneElement(a,void 0,s):!o&&m.Children.count(r)===1&&m.isValidElement(r)&&(a=r);let c=a?fv(a):void 0,l=rv(n,c);if(!a){if(r||r===0)throw Error(o?vv(e):_v(e));return r}let u=dv(i,a.props??{});return a.type!==m.Fragment&&(u.ref=n?l:c),m.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}av(ov,`createSlot`);var sv=ov(`Slot`),cv=Symbol.for(`radix.slottable`);function lv(e){let t=av(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=cv,t}av(lv,`createSlottable`);var uv=av((e,t)=>{if(`child`in e.props){let t=e.props.child;return m.isValidElement(t)?m.cloneElement(t,void 0,e.props.children(t.props.children)):null}return m.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function dv(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}av(dv,`mergeProps`);function fv(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}av(fv,`getElementRef`);function pv(e){return m.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===cv}av(pv,`isSlottable`);var mv=Symbol.for(`react.lazy`);function hv(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===mv&&`_payload`in e&&gv(e._payload)}av(hv,`isLazyComponent`);function gv(e){return typeof e==`object`&&!!e&&`then`in e}av(gv,`isPromiseLike`);var _v=av(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),vv=av(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),yv=m.use,bv=l(Sf(),1),xv=Object.defineProperty,Sv=(e,t)=>xv(e,`name`,{value:t,configurable:!0}),Cv=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=ov(`Primitive.${t}`),r=m.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,L.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function wv(e,t){e&&bv.flushSync(()=>e.dispatchEvent(t))}Sv(wv,`dispatchDiscreteCustomEvent`);var Tv=Object.defineProperty,Ev=(e,t)=>Tv(e,`name`,{value:t,configurable:!0}),Dv=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Ov=m.forwardRef(Ev(function(e,t){return(0,L.jsx)(Cv.span,{...e,ref:t,style:{...Dv,...e.style}})},`VisuallyHidden`)),kv=Object.defineProperty,Av=(e,t)=>kv(e,`name`,{value:t,configurable:!0});function jv(e,t){let n=m.createContext(t);n.displayName=e+`Context`;let r=Av(e=>{let{children:t,...r}=e,i=m.useMemo(()=>r,Object.values(r));return(0,L.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=m.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Av(i,`useContext`),[r,i]}Av(jv,`createContext`);function Mv(e,t=[]){let n=[];function r(t,r){let i=m.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Av(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=m.useMemo(()=>o,Object.values(o));return(0,L.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=m.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Av(s,`useContext`),[o,s]}Av(r,`createContext`);let i=Av(()=>{let t=n.map(e=>m.createContext(e));return Av(function(n){let r=n?.[e]||t;return m.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Nv(i,...t)]}Av(Mv,`createContextScope`);function Nv(...e){let t=e[0];if(e.length===1)return t;let n=Av(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Av(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Av(Nv,`composeContextScopes`);var Pv=Object.defineProperty,Fv=(e,t)=>Pv(e,`name`,{value:t,configurable:!0}),Iv=!!(typeof window<`u`&&window.document&&window.document.createElement);function Lv(e,t,{checkForDefaultPrevented:n=!0}={}){return Fv(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Fv(Lv,`composeEventHandlers`);function Rv(e){if(!Iv)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Fv(Rv,`getOwnerWindow`);function zv(e){if(!Iv)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Fv(zv,`getOwnerDocument`);function Bv(e,t=!1){let{activeElement:n}=zv(e);if(!n?.nodeName)return null;if(Vv(n)&&n.contentDocument)return Bv(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=zv(n).getElementById(e);if(t)return t}}return n}Fv(Bv,`getActiveElement`);function Vv(e){return e.tagName===`IFRAME`}Fv(Vv,`isFrame`);var Hv=globalThis?.document?m.useLayoutEffect:()=>{},Uv=Object.defineProperty,Wv=(e,t)=>Uv(e,`name`,{value:t,configurable:!0}),Gv=m.useEffectEvent,Kv=m.useInsertionEffect;function qv(e){if(typeof Gv==`function`)return Gv(e);let t=m.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Kv==`function`?Kv(()=>{t.current=e}):Hv(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}Wv(qv,`useEffectEvent`);var Jv=Object.defineProperty,Yv=(e,t)=>Jv(e,`name`,{value:t,configurable:!0}),Xv=m.useInsertionEffect||Hv;function Zv({prop:e,defaultProp:t,onChange:n=Yv(()=>{},`onChange`),caller:r}){let[i,a,o]=Qv({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,m.useCallback(t=>{if(s){let n=$v(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Yv(Zv,`useControllableState`);function Qv({defaultProp:e,onChange:t}){let[n,r]=m.useState(e),i=m.useRef(n),a=m.useRef(t);return Xv(()=>{a.current=t},[t]),m.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Yv(Qv,`useUncontrolledState`);function $v(e){return typeof e==`function`}Yv($v,`isFunction`);var ey=Symbol(`RADIX:SYNC_STATE`);function ty(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=qv(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=m.useReducer((t,n)=>{if(n.type===ey)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,h=m.useRef(p);m.useEffect(()=>{h.current!==p&&(h.current=p,c||l(p))},[p,h,c]);let g=m.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return m.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:ey,state:i})},[i,d.state,c]),[g,f]}Yv(ty,`useControllableStateReducer`);var ny=Object.defineProperty,ry=(e,t)=>ny(e,`name`,{value:t,configurable:!0});function iy(e,t){return m.useReducer((e,n)=>t[e][n]??e,e)}ry(iy,`useStateMachine`);var ay=ry(e=>{let{present:t,children:n}=e,r=oy(t),i=typeof n==`function`?n({present:r.isPresent}):m.Children.only(n),a=cy(r.ref,uy(i));return typeof n==`function`||r.isPresent?m.cloneElement(i,{ref:a}):null},`Presence`);function oy(e){let[t,n]=m.useState(),r=m.useRef(null),i=m.useRef(e),a=m.useRef(`none`),o=m.useRef(void 0),[s,c]=iy(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return m.useEffect(()=>{s===`mounted`?(a.current=o.current??ly(r.current),o.current=void 0):a.current=`none`},[s]),Hv(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=ly(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Hv(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=ry(a=>{let o=ly(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=ry(e=>{e.target===t&&(a.current=ly(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:m.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=ly(t)}else r.current=null;n(e)},[])}}ry(oy,`usePresence`);function sy(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ry(sy,`setRef`);function cy(...e){let t=m.useRef(e);return t.current=e,m.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=sy(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():sy(n[e],null)}}},[])}ry(cy,`useStableComposedRefs`);function ly(e){return e?.animationName||`none`}ry(ly,`getAnimationName`);function uy(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}ry(uy,`getElementRef`);var dy=Object.defineProperty,fy=(e,t)=>dy(e,`name`,{value:t,configurable:!0}),py=m.useId||(()=>void 0),my=0;function hy(e){let[t,n]=m.useState(py());return Hv(()=>{e||n(e=>e??String(my++))},[e]),e||(t?`radix-${t}`:``)}fy(hy,`useId`);var gy=Object.defineProperty,_y=(e,t)=>gy(e,`name`,{value:t,configurable:!0});function vy(e){let t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}_y(vy,`useCallbackRef`);var yy=Object.defineProperty,by=(e,t)=>yy(e,`name`,{value:t,configurable:!0}),xy=`dismissableLayer.update`,Sy=`dismissableLayer.pointerDownOutside`,Cy=`dismissableLayer.focusOutside`,wy,Ty=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ey=m.forwardRef(by(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=m.useContext(Ty),[d,f]=m.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=m.useState({}),g=rv(t,f),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=d?_.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=m.useRef(!1),w=ky(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=Ay(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===_.length-1:!1,D=vy(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return m.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),m.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(wy=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),jy(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=wy))}},[d,p,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),jy())},[d,u]),m.useEffect(()=>{let e=by(()=>h({}),`handleUpdate`);return document.addEventListener(xy,e),()=>document.removeEventListener(xy,e)},[]),(0,L.jsx)(Cv.div,{...l,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:Lv(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Lv(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Lv(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Dy(){let e=m.useContext(Ty),[t,n]=m.useState(null);return m.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}by(Dy,`useDismissableLayerSurface`);var Oy=by(()=>!0,`IS_TRUE`);function ky(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Oy}=t,s=vy(e),c=m.useRef(!1),l=m.useRef(!1),u=m.useRef(new Map),d=m.useRef(()=>{});return m.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}by(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}by(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}by(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}by(p,`handleInteractionBubble`);let m=by(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||My(Sy,s,p,{discrete:!0})};if(by(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:by(()=>c.current=!0,`onPointerDownCapture`)}}by(ky,`usePointerDownOutside`);function Ay(e,t=globalThis?.document){let n=vy(e),r=m.useRef(!1);return m.useEffect(()=>{let e=by(e=>{e.target&&!r.current&&My(Cy,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:by(()=>r.current=!0,`onFocusCapture`),onBlurCapture:by(()=>r.current=!1,`onBlurCapture`)}}by(Ay,`useFocusOutside`);function jy(){let e=new CustomEvent(xy);document.dispatchEvent(e)}by(jy,`dispatchUpdate`);function My(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?wv(i,a):i.dispatchEvent(a)}by(My,`handleAndDispatchCustomEvent`);var Ny=Object.defineProperty,Py=(e,t)=>Ny(e,`name`,{value:t,configurable:!0}),Fy=`focusScope.autoFocusOnMount`,Iy=`focusScope.autoFocusOnUnmount`,Ly={bubbles:!1,cancelable:!0},Ry=m.forwardRef(Py(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=m.useState(null),l=vy(i),u=vy(a),d=m.useRef(null),f=rv(t,c),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Gy(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Gy(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Gy(s)};Py(e,`handleFocusIn`),Py(t,`handleFocusOut`),Py(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),m.useEffect(()=>{if(s){Ky.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Fy,Ly);s.addEventListener(Fy,l),s.dispatchEvent(t),t.defaultPrevented||(zy(Yy(Vy(s)),{select:!0}),document.activeElement===e&&Gy(s))}return()=>{s.removeEventListener(Fy,l),setTimeout(()=>{let t=new CustomEvent(Iy,Ly);s.addEventListener(Iy,u),s.dispatchEvent(t),t.defaultPrevented||Gy(e??document.body,{select:!0}),s.removeEventListener(Iy,u),Ky.remove(p)},0)}}},[s,l,u,p]);let h=m.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=By(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Gy(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Gy(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,L.jsx)(Cv.div,{tabIndex:-1,...o,ref:f,onKeyDown:h})},`FocusScope`));function zy(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Gy(r,{select:t}),document.activeElement!==n)return}Py(zy,`focusFirst`);function By(e){let t=Vy(e);return[Hy(t,e),Hy(t.reverse(),e)]}Py(By,`getTabbableEdges`);function Vy(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Py(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Py(Vy,`getTabbableCandidates`);function Hy(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Uy(r,{upTo:t})))return r}Py(Hy,`findVisible`);function Uy(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Py(Uy,`isHidden`);function Wy(e){return e instanceof HTMLInputElement&&`select`in e}Py(Wy,`isSelectableInput`);function Gy(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Wy(e)&&t&&e.select()}}Py(Gy,`focus`);var Ky=qy();function qy(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Jy(e,t),e.unshift(t)},remove(t){e=Jy(e,t),e[0]?.resume()}}}Py(qy,`createFocusScopesStack`);function Jy(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Py(Jy,`arrayRemove`);function Yy(e){return e.filter(e=>e.tagName!==`A`)}Py(Yy,`removeLinks`);var Xy=Object.defineProperty,Zy=m.forwardRef(((e,t)=>Xy(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=m.useState(!1);Hv(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?bv.createPortal((0,L.jsx)(Cv.div,{...r,ref:t}),o):null},`Portal`)),Qy=Object.defineProperty,$y=(e,t)=>Qy(e,`name`,{value:t,configurable:!0}),eb=0,tb=null;function nb(e){return rb(),e.children}$y(nb,`FocusGuards`);function rb(){m.useEffect(()=>{tb||={start:ib(),end:ib()};let{start:e,end:t}=tb;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),eb++,()=>{eb===1&&(tb?.start.remove(),tb?.end.remove(),tb=null),eb=Math.max(0,eb-1)}},[])}$y(rb,`useFocusGuards`);function ib(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}$y(ib,`createFocusGuard`);var ab=function(){return ab=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ab.apply(this,arguments)};function ob(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function sb(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var cb=`right-scroll-bar-position`,lb=`width-before-scroll-bar`,ub=`with-scroll-bars-hidden`,db=`--removed-body-scroll-bar-size`;function fb(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function pb(e,t){var n=(0,m.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var mb=typeof window<`u`?m.useLayoutEffect:m.useEffect,hb=new WeakMap;function gb(e,t){var n=pb(t||null,function(t){return e.forEach(function(e){return fb(e,t)})});return mb(function(){var t=hb.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||fb(e,null)}),i.forEach(function(e){r.has(e)||fb(e,a)})}hb.set(n,e)},[e]),n}function _b(e){return e}function vb(e,t){t===void 0&&(t=_b);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function yb(e){e===void 0&&(e={});var t=vb(null);return t.options=ab({async:!0,ssr:!1},e),t}var bb=function(e){var t=e.sideCar,n=ob(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return m.createElement(r,ab({},n))};bb.isSideCarExport=!0;function xb(e,t){return e.useMedium(t),bb}var Sb=yb(),Cb=function(){},wb=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Cb,onWheelCapture:Cb,onTouchMoveCapture:Cb}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=ob(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=gb([n,t]),w=ab(ab({},x),i);return m.createElement(m.Fragment,null,u&&m.createElement(S,{sideCar:Sb,removeScrollBar:l,shards:d,noRelative:p,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?m.cloneElement(m.Children.only(s),ab(ab({},w),{ref:C})):m.createElement(y,ab({},w,{className:c,ref:C}),s))});wb.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},wb.classNames={fullWidth:lb,zeroRight:cb};var Tb=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Eb(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Tb();return t&&e.setAttribute(`nonce`,t),e}function Db(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ob(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var kb=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Eb())&&(Db(t,n),Ob(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ab=function(){var e=kb();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},jb=function(){var e=Ab();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Mb={left:0,top:0,right:0,gap:0},Nb=function(e){return parseInt(e||``,10)||0},Pb=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Nb(n),Nb(r),Nb(i)]},Fb=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Mb;var t=Pb(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ib=jb(),Lb=`data-scroll-locked`,Rb=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
19
19
|
.${ub} {
|
|
20
20
|
overflow: hidden ${r};
|
|
21
21
|
padding-right: ${s}px ${r};
|
|
@@ -55,7 +55,7 @@ Error generating stack: `+e.message+`
|
|
|
55
55
|
`},zb=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Bb=function(){m.useEffect(function(){return document.body.setAttribute(Lb,(zb()+1).toString()),function(){var e=zb()-1;e<=0?document.body.removeAttribute(Lb):document.body.setAttribute(Lb,e.toString())}},[])},Vb=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Bb();var a=m.useMemo(function(){return Fb(i)},[i]);return m.createElement(Ib,{styles:Rb(a,!t,i,n?``:`!important`)})},Hb=!1;if(typeof window<`u`)try{var Ub=Object.defineProperty({},"passive",{get:function(){return Hb=!0,!0}});window.addEventListener(`test`,Ub,Ub),window.removeEventListener(`test`,Ub,Ub)}catch{Hb=!1}var Wb=Hb?{passive:!1}:!1,Gb=function(e){return e.tagName===`TEXTAREA`},Kb=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Gb(e)&&n[t]===`visible`)},qb=function(e){return Kb(e,`overflowY`)},Jb=function(e){return Kb(e,`overflowX`)},Yb=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Qb(e,r)){var i=$b(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Xb=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Zb=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Qb=function(e,t){return e===`v`?qb(t):Jb(t)},$b=function(e,t){return e===`v`?Xb(t):Zb(t)},ex=function(e,t){return e===`h`&&t===`rtl`?-1:1},tx=function(e,t,n,r,i){var a=ex(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=$b(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Qb(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},nx=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},rx=function(e){return[e.deltaX,e.deltaY]},ix=function(e){return e&&`current`in e?e.current:e},ax=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ox=function(e){return`
|
|
56
56
|
.block-interactivity-${e} {pointer-events: none;}
|
|
57
57
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
58
|
-
`},sx=0,cx=[];function lx(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),i=m.useState(sx++)[0],a=m.useState(jb)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=sb([e.lockRef.current],(e.shards||[]).map(ix),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=m.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=nx(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Yb(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Yb(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return tx(h,t,e,h===`h`?s:c,!0)},[]),c=m.useCallback(function(e){var n=e;if(cx.length&&cx[cx.length-1]===a){var r=`deltaY`in n?rx(n):nx(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&ax(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(ix).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=m.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ux(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=m.useCallback(function(e){n.current=nx(e),r.current=void 0},[]),d=m.useCallback(function(t){l(t.type,rx(t),t.target,s(t,e.lockRef.current))},[]),f=m.useCallback(function(t){l(t.type,nx(t),t.target,s(t,e.lockRef.current))},[]);m.useEffect(function(){return cx.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Wb),document.addEventListener(`touchmove`,c,Wb),document.addEventListener(`touchstart`,u,Wb),function(){cx=cx.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Wb),document.removeEventListener(`touchmove`,c,Wb),document.removeEventListener(`touchstart`,u,Wb)}},[]);var p=e.removeScrollBar,h=e.inert;return m.createElement(m.Fragment,null,h?m.createElement(a,{styles:ox(i)}):null,p?m.createElement(Vb,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ux(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var dx=xb(Sb,lx),fx=m.forwardRef(function(e,t){return m.createElement(wb,ab({},e,{ref:t,sideCar:dx}))});fx.classNames=wb.classNames;var px=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},mx=new WeakMap,hx=new WeakMap,gx={},_x=0,vx=function(e){return e&&(e.host||vx(e.parentNode))},yx=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=vx(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},bx=function(e,t,n,r){var i=yx(t,Array.isArray(e)?e:[e]);gx[n]||(gx[n]=new WeakMap);var a=gx[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(mx.get(e)||0)+1,l=(a.get(e)||0)+1;mx.set(e,c),a.set(e,l),o.push(e),c===1&&i&&hx.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),_x++,function(){o.forEach(function(e){var t=mx.get(e)-1,i=a.get(e)-1;mx.set(e,t),a.set(e,i),t||(hx.has(e)||e.removeAttribute(r),hx.delete(e)),i||e.removeAttribute(n)}),_x--,_x||(mx=new WeakMap,mx=new WeakMap,hx=new WeakMap,gx={})}},xx=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||px(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),bx(r,i,n,`aria-hidden`)):function(){return null}},Sx=Object.defineProperty,Cx=(e,t)=>Sx(e,`name`,{value:t,configurable:!0}),wx=`Dialog`,[Tx,Ex]=Mv(wx),[Dx,Ox]=Tx(wx),kx=Cx(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=m.useRef(null),c=m.useRef(null),[l,u]=Zv({prop:r,defaultProp:i??!1,onChange:a,caller:wx}),[d,f]=m.useState(0),[p,h]=m.useState(0);return(0,L.jsx)(Dx,{scope:t,triggerRef:s,contentRef:c,contentId:hy(),titleId:hy(),descriptionId:hy(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:h,open:l,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),Ax=`DialogTrigger`,jx=m.forwardRef(Cx(function(e,t){let{__scopeDialog:n,...r}=e,i=Ox(Ax,n),a=rv(t,i.triggerRef);return(0,L.jsx)(Cv.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Zx(i.open),...r,ref:a,onClick:Lv(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),Mx=`DialogPortal`,[Nx,Px]=Tx(Mx,{forceMount:void 0}),Fx=Cx(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Ox(Mx,t);return(0,L.jsx)(Nx,{scope:t,forceMount:n,children:m.Children.map(r,e=>(0,L.jsx)(ay,{present:n||a.open,children:(0,L.jsx)(Zy,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Ix=`DialogOverlay`,Lx=m.forwardRef(Cx(function(e,t){let n=Px(Ix,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ox(Ix,e.__scopeDialog);return a.modal?(0,L.jsx)(ay,{present:r||a.open,children:(0,L.jsx)(zx,{...i,ref:t})}):null},`DialogOverlay`)),Rx=ov(`DialogOverlay.RemoveScroll`),zx=m.forwardRef(Cx(function(e,t){let{__scopeDialog:n,...r}=e,i=Ox(Ix,n),a=rv(t,Dy());return(0,L.jsx)(fx,{as:Rx,allowPinchZoom:!0,shards:[i.contentRef],children:(0,L.jsx)(Cv.div,{"data-state":Zx(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Bx=`DialogContent`,Vx=m.forwardRef(Cx(function(e,t){let n=Px(Bx,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ox(Bx,e.__scopeDialog);return(0,L.jsx)(ay,{present:r||a.open,children:a.modal?(0,L.jsx)(Hx,{...i,ref:t}):(0,L.jsx)(Ux,{...i,ref:t})})},`DialogContent`)),Hx=m.forwardRef(Cx(function(e,t){let n=Ox(Bx,e.__scopeDialog),r=m.useRef(null),i=rv(t,n.contentRef,r);return m.useEffect(()=>{let e=r.current;if(e)return xx(e)},[]),(0,L.jsx)(Wx,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Lv(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Lv(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Lv(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Ux=m.forwardRef(Cx(function(e,t){let n=Ox(Bx,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return(0,L.jsx)(Wx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Wx=m.forwardRef(Cx(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Ox(Bx,n);return rb(),(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(Ry,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(Ey,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Zx(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),Gx=`DialogTitle`,Kx=m.forwardRef(Cx(function(e,t){let{__scopeDialog:n,...r}=e,i=Ox(Gx,n),{setTitleCount:a}=i;return Hv(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,L.jsx)(Cv.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),qx=`DialogDescription`,Jx=m.forwardRef(Cx(function(e,t){let{__scopeDialog:n,...r}=e,i=Ox(qx,n),{setDescriptionCount:a}=i;return Hv(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,L.jsx)(Cv.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Yx=`DialogClose`,Xx=m.forwardRef(Cx(function(e,t){let{__scopeDialog:n,...r}=e,i=Ox(Yx,n);return(0,L.jsx)(Cv.button,{type:`button`,...r,ref:t,onClick:Lv(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Zx(e){return e?`open`:`closed`}Cx(Zx,`getState`);var Qx=Object.defineProperty,$x=(e,t)=>Qx(e,`name`,{value:t,configurable:!0}),[eS,tS]=Mv(`AlertDialog`,[Ex]),nS=Ex(),rS=$x(e=>{let{__scopeAlertDialog:t,...n}=e,r=nS(t);return(0,L.jsx)(kx,{...r,...n,modal:!0})},`AlertDialog`);m.forwardRef($x(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=nS(n);return(0,L.jsx)(jx,{...i,...r,ref:t})},`AlertDialogTrigger`));var iS=$x(e=>{let{__scopeAlertDialog:t,...n}=e,r=nS(t);return(0,L.jsx)(Fx,{...r,...n})},`AlertDialogPortal`),aS=m.forwardRef($x(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=nS(n);return(0,L.jsx)(Lx,{...i,...r,ref:t})},`AlertDialogOverlay`)),[oS,sS]=eS(`AlertDialogContent`),cS=m.forwardRef($x(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=nS(n),o=rv(t,m.useRef(null)),s=m.useRef(null);return(0,L.jsx)(oS,{scope:n,cancelRef:s,children:(0,L.jsx)(Vx,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:Lv(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),lS=m.forwardRef($x(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=nS(n);return(0,L.jsx)(Kx,{...i,...r,ref:t})},`AlertDialogTitle`)),uS=m.forwardRef($x(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=nS(n);return(0,L.jsx)(Jx,{...i,...r,ref:t})},`AlertDialogDescription`)),dS=m.forwardRef($x(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=nS(n);return(0,L.jsx)(Xx,{...i,...r,ref:t})},`AlertDialogAction`)),fS=`AlertDialogCancel`,pS=m.forwardRef($x(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=sS(fS,n),a=nS(n),o=rv(t,i);return(0,L.jsx)(Xx,{...a,...r,ref:o})},`AlertDialogCancel`)),mS=rS,hS=iS,gS=aS,_S=cS,vS=dS,yS=pS,bS=lS,xS=uS,SS=Object.defineProperty,CS=(e,t)=>SS(e,`name`,{value:t,configurable:!0});function wS(e){let[t,n]=m.useState(void 0);return Hv(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}CS(wS,`useSize`);var TS=Object.defineProperty,ES=(e,t)=>TS(e,`name`,{value:t,configurable:!0}),DS=`Checkbox`,[OS,kS]=Mv(DS),[AS,jS]=OS(DS);function MS(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Zv({prop:n,defaultProp:i??!1,onChange:c,caller:DS}),[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useRef(!1),[b,x]=m.useReducer(e=>e+1,0),S=!h||!!o||!!h.closest(`form`),C={checked:f,disabled:a,setChecked:p,control:h,setControl:g,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:!VS(i)&&i,isFormControl:S,bubbleInput:_,setBubbleInput:v};return(0,L.jsx)(AS,{scope:t,...C,children:BS(d)?d(C):r})}ES(MS,`CheckboxProvider`);var NS=`CheckboxTrigger`,PS=m.forwardRef(ES(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:h,bubbleInput:g}=jS(NS,e),_=rv(i,u),v=m.useRef(c);return m.useEffect(()=>{let e=a?.form;if(e){let t=ES(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,L.jsx)(Cv.button,{type:`button`,role:`checkbox`,"aria-checked":VS(c)?`mixed`:c,"aria-required":l,"data-state":HS(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:_,onKeyDown:Lv(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:Lv(n,e=>{p(),d(e=>VS(e)?!0:!e),g&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),FS=m.forwardRef(ES(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,L.jsx)(MS,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(PS,{...d,ref:t,__scopeCheckbox:n}),e&&(0,L.jsx)(zS,{__scopeCheckbox:n})]})})},`Checkbox`)),IS=`CheckboxIndicator`,LS=m.forwardRef(ES(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=jS(IS,n);return(0,L.jsx)(ay,{present:r||VS(a.checked)||a.checked===!0,children:(0,L.jsx)(Cv.span,{"data-state":HS(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),RS=`CheckboxBubbleInput`,zS=m.forwardRef(ES(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:g}=jS(RS,e),_=rv(r,g),v=wS(i),y=m.useRef(!1),b=m.useRef(s),x=m.useRef(o);m.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=VS(s),n.call(e,!VS(s)&&s),e.dispatchEvent(t),y.current=!1}},[h,s,a,o]);let S=m.useRef(!VS(s)&&s);return(0,L.jsx)(Cv.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:_,onClick:Lv(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function BS(e){return typeof e==`function`}ES(BS,`isFunction`);function VS(e){return e===`indeterminate`}ES(VS,`isIndeterminate`);function HS(e){return VS(e)?`indeterminate`:e?`checked`:`unchecked`}ES(HS,`getState`);var US=[`top`,`right`,`bottom`,`left`],WS=Math.min,GS=Math.max,KS=Math.round,qS=Math.floor,JS=e=>({x:e,y:e}),YS={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function XS(e,t,n){return GS(e,WS(t,n))}function ZS(e,t){return typeof e==`function`?e(t):e}function QS(e){return e.split(`-`)[0]}function $S(e){return e.split(`-`)[1]}function eC(e){return e===`x`?`y`:`x`}function tC(e){return e===`y`?`height`:`width`}function nC(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function rC(e){return eC(nC(e))}function iC(e,t,n){n===void 0&&(n=!1);let r=$S(e),i=rC(e),a=tC(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=pC(o)),[o,pC(o)]}function aC(e){let t=pC(e);return[oC(e),t,oC(t)]}function oC(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var sC=[`left`,`right`],cC=[`right`,`left`],lC=[`top`,`bottom`],uC=[`bottom`,`top`];function dC(e,t,n){switch(e){case`top`:case`bottom`:return n?t?cC:sC:t?sC:cC;case`left`:case`right`:return t?lC:uC;default:return[]}}function fC(e,t,n,r){let i=$S(e),a=dC(QS(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(oC)))),a}function pC(e){let t=QS(e);return YS[t]+e.slice(t.length)}function mC(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function hC(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:mC(e)}function gC(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function _C(e,t,n){let{reference:r,floating:i}=e,a=nC(t),o=rC(t),s=tC(o),c=QS(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=$S(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function vC(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ZS(t,e),p=hC(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=gC(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=gC(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var yC=50,bC=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:vC},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=_C(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<yC&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=_C(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},xC=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ZS(e,t)||{};if(l==null)return{};let d=hC(u),f={x:n,y:r},p=rC(i),m=tC(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=WS(d[_],T),D=WS(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,ee=XS(E,k,O),te=!c.arrow&&$S(i)!=null&&k!==ee&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,ne=te?k<E?k-E:k-O:0;return{[p]:f[p]+ne,data:{[p]:ee,centerOffset:k-ee-ne,...te&&{alignmentOffset:ne}},reset:te}}}),SC=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ZS(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=QS(r),_=nC(o),v=QS(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[pC(o)]:aC(o)),x=p!==`none`;!d&&x&&b.push(...fC(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=iC(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===nC(t)||T.every(e=>nC(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=nC(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function CC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wC(e){return US.some(t=>e[t]>=0)}var TC=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ZS(e,t);switch(i){case`referenceHidden`:{let e=CC(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:wC(e)}}}case`escaped`:{let e=CC(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:wC(e)}}}default:return{}}}}},EC=new Set([`left`,`top`]);async function DC(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=QS(n),s=$S(n),c=nC(n)===`y`,l=EC.has(o)?-1:1,u=a&&c?-1:1,d=ZS(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var OC=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await DC(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},kC=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ZS(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=nC(i),p=eC(f),m=u[p],h=u[f],g=(e,t)=>XS(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},AC=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ZS(e,t),u={x:n,y:r},d=nC(i),f=eC(d),p=u[f],m=u[d],h=ZS(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=EC.has(QS(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},jC=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=ZS(e,t),c=await i.detectOverflow(t,s),l=QS(n),u=$S(n),d=nC(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=WS(p-c[m],g),y=WS(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*GS(c.left,c.right):S=p-2*GS(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function MC(){return typeof window<`u`}function NC(e){return IC(e)?(e.nodeName||``).toLowerCase():`#document`}function PC(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function FC(e){return((IC(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function IC(e){return MC()?e instanceof Node||e instanceof PC(e).Node:!1}function LC(e){return MC()?e instanceof Element||e instanceof PC(e).Element:!1}function RC(e){return MC()?e instanceof HTMLElement||e instanceof PC(e).HTMLElement:!1}function zC(e){return!MC()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof PC(e).ShadowRoot}function BC(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ZC(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function VC(e){return/^(table|td|th)$/.test(NC(e))}function HC(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var UC=/transform|translate|scale|rotate|perspective|filter/,WC=/paint|layout|strict|content/,GC=e=>!!e&&e!==`none`,KC;function qC(e){let t=LC(e)?ZC(e):e;return GC(t.transform)||GC(t.translate)||GC(t.scale)||GC(t.rotate)||GC(t.perspective)||!YC()&&(GC(t.backdropFilter)||GC(t.filter))||UC.test(t.willChange||``)||WC.test(t.contain||``)}function JC(e){let t=$C(e);for(;RC(t)&&!XC(t);){if(qC(t))return t;if(HC(t))return null;t=$C(t)}return null}function YC(){return KC??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),KC}function XC(e){return/^(html|body|#document)$/.test(NC(e))}function ZC(e){return PC(e).getComputedStyle(e)}function QC(e){return LC(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $C(e){if(NC(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||zC(e)&&e.host||FC(e);return zC(t)?t.host:t}function ew(e){let t=$C(e);return XC(t)?(e.ownerDocument||e).body:RC(t)&&BC(t)?t:ew(t)}function tw(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ew(e),i=r===e.ownerDocument?.body,a=PC(r);if(i){let e=nw(a);return t.concat(a,a.visualViewport||[],BC(r)?r:[],e&&n?tw(e):[])}return t.concat(r,tw(r,[],n))}function nw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function rw(e){let t=ZC(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=RC(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=KS(n)!==a||KS(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function iw(e){return LC(e)?e:e.contextElement}function aw(e){let t=iw(e);if(!RC(t))return JS(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=rw(t),o=(a?KS(n.width):n.width)/r,s=(a?KS(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ow=JS(0);function sw(e){let t=PC(e);return!YC()||!t.visualViewport?ow:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function cw(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===PC(e)}function lw(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=iw(e),o=JS(1);t&&(r?LC(r)&&(o=aw(r)):o=aw(e));let s=cw(a,n,r)?sw(a):JS(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=PC(a),t=LC(r)?PC(r):r,n=e,i=nw(n);for(;i&&t!==n;){let e=aw(i),t=i.getBoundingClientRect(),r=ZC(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=PC(i),i=nw(n)}}return gC({width:u,height:d,x:c,y:l})}function uw(e,t){let n=QC(e).scrollLeft;return t?t.left+n:lw(FC(e)).left+n}function dw(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-uw(e,n),y:n.top+t.scrollTop}}function fw(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=FC(r),s=t?HC(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=JS(1),u=JS(0),d=RC(r);if((d||!a)&&((NC(r)!==`body`||BC(o))&&(c=QC(r)),d)){let e=lw(r);l=aw(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?dw(o,c):JS(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function pw(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function mw(e){let t=QC(e),n=e.ownerDocument.body,r=GS(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=GS(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+uw(e),o=-t.scrollTop;return ZC(n).direction===`rtl`&&(a+=GS(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var hw=25;function gw(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=PC(e),a=FC(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!YC()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(uw(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=hw&&(s-=o)}return{width:s,height:c,x:l,y:u}}function _w(e,t){let n=lw(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=aw(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function vw(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=gw(e,n,t);else if(t===`document`)r=mw(FC(e));else if(LC(t))r=_w(t,n);else{let n=sw(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return gC(r)}function yw(e,t){let n=t.get(e);if(n)return n;let r=tw(e,[],!1).filter(e=>LC(e)&&NC(e)!==`body`),i=null,a=ZC(e).position===`fixed`,o=a?$C(e):e;for(;LC(o)&&!XC(o);){let e=ZC(o),t=qC(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=$C(o)}return t.set(e,r),r}function bw(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?HC(t)?[]:yw(t,this._c):[].concat(n),r],o=vw(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=vw(t,a[e],i);s=GS(n.top,s),c=WS(n.right,c),l=WS(n.bottom,l),u=GS(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function xw(e){let{width:t,height:n}=rw(e);return{width:t,height:n}}function Sw(e,t,n){let r=RC(t),i=FC(t),a=n===`fixed`,o=lw(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=JS(0);if((r||!a)&&((NC(t)!==`body`||BC(i))&&(s=QC(t)),r)){let e=lw(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=uw(i));let l=i&&!r&&!a?dw(i,s):JS(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Cw(e){return ZC(e).position===`static`}function ww(e,t){if(!RC(e)||ZC(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return FC(e)===n&&(n=n.ownerDocument.body),n}function Tw(e,t){let n=PC(e);if(HC(e))return n;if(!RC(e)){let t=$C(e);for(;t&&!XC(t);){if(LC(t)&&!Cw(t))return t;t=$C(t)}return n}let r=ww(e,t);for(;r&&VC(r)&&Cw(r);)r=ww(r,t);return r&&XC(r)&&Cw(r)&&!qC(r)?n:r||JC(e)||n}var Ew=async function(e){let t=this.getOffsetParent||Tw,n=this.getDimensions,r=await n(e.floating);return{reference:Sw(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Dw(e){return ZC(e).direction===`rtl`}var Ow={convertOffsetParentRelativeRectToViewportRelativeRect:fw,getDocumentElement:FC,getClippingRect:bw,getOffsetParent:Tw,getElementRects:Ew,getClientRects:pw,getDimensions:xw,getScale:aw,isElement:LC,isRTL:Dw};function kw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Aw(e,t,n){let r=null,i,a=FC(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=qS(d),h=qS(a.clientWidth-(u+f)),g=qS(a.clientHeight-(d+p)),_=qS(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:GS(0,WS(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!kw(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=PC(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function jw(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=iw(e),u=i||a?[...l?tw(l):[],...t?tw(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Aw(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?lw(e):null;c&&g();function g(){let t=lw(e);h&&!kw(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Mw=OC,Nw=kC,Pw=SC,Fw=jC,Iw=TC,Lw=xC,Rw=AC,zw=(e,t,n)=>{let r=new Map,i=n??{},a={...Ow,...i.platform,_c:r};return bC(e,t,{...i,platform:a})},Bw=typeof document<`u`?m.useLayoutEffect:function(){};function Vw(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Vw(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Vw(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Hw(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Uw(e,t){let n=Hw(e);return Math.round(t*n)/n}function Ww(e){let t=m.useRef(e);return Bw(()=>{t.current=e}),t}function Gw(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);Vw(f,r)||p(r);let[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=m.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=m.useRef(null),w=m.useRef(null),T=m.useRef(u),E=c!=null,D=Ww(c),O=Ww(i),k=Ww(l),ee=m.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),zw(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};te.current&&!Vw(T.current,t)&&(T.current=t,bv.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Bw(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let te=m.useRef(!1);Bw(()=>(te.current=!0,()=>{te.current=!1}),[]),Bw(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,ee);ee()}},[x,S,ee,D,E]);let ne=m.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),A=m.useMemo(()=>({reference:x,floating:S}),[x,S]),re=m.useMemo(()=>{let e={position:n,left:0,top:0};if(!A.floating)return e;let t=Uw(A.floating,u.x),r=Uw(A.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Hw(A.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,A.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:ee,refs:ne,elements:A,floatingStyles:re}),[u,ee,ne,A,re])}var Kw=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Lw({element:r.current,padding:i}).fn(n):r?Lw({element:r,padding:i}).fn(n):{}}}},qw=(e,t)=>{let n=Mw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jw=(e,t)=>{let n=Nw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yw=(e,t)=>({fn:Rw(e).fn,options:[e,t]}),Xw=(e,t)=>{let n=Pw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zw=(e,t)=>{let n=Fw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qw=(e,t)=>{let n=Iw(e);return{name:n.name,fn:n.fn,options:[e,t]}},$w=(e,t)=>{let n=Kw(e);return{name:n.name,fn:n.fn,options:[e,t]}},eT=Object.defineProperty,tT=m.forwardRef(((e,t)=>eT(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,L.jsx)(Cv.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,L.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),nT=Object.defineProperty,rT=(e,t)=>nT(e,`name`,{value:t,configurable:!0}),iT=`Popper`,[aT,oT]=Mv(iT),[sT,cT]=aT(iT),lT=rT(e=>{let{__scopePopper:t,children:n}=e,[r,i]=m.useState(null),[a,o]=m.useState(void 0);return(0,L.jsx)(sT,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),uT=`PopperAnchor`,dT=m.forwardRef(rT(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=cT(uT,n),o=m.useRef(null),s=a.onAnchorChange,c=rv(t,m.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=m.useRef(null);m.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&xT(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,L.jsx)(Cv.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),fT=`PopperContent`,[pT,mT]=aT(fT),hT=m.forwardRef(rT(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:h,...g}=e,_=cT(fT,n),[v,y]=m.useState(null),b=rv(t,y),[x,S]=m.useState(null),C=wS(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,ee={padding:D,boundary:O.filter(yT),altBoundary:k},{refs:te,floatingStyles:ne,placement:A,isPositioned:re,middlewareData:ie}=Gw({strategy:`fixed`,placement:E,whileElementsMounted:rT((...e)=>jw(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[qw({mainAxis:i+T,alignmentAxis:o}),c&&Jw({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Yw():void 0,...ee}),c&&Xw({...ee}),Zw({...ee,apply:rT(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&$w({element:x,padding:s}),bT({arrowWidth:w,arrowHeight:T}),f&&Qw({strategy:`referenceHidden`,...ee,boundary:k?ee.boundary:void 0})]}),j=_.setPlacementState;Hv(()=>(j(A),()=>{j(void 0)}),[A,j]);let[ae,oe]=xT(A),se=vy(h);Hv(()=>{re&&se?.()},[re,se]);let ce=ie.arrow?.x,le=ie.arrow?.y,ue=ie.arrow?.centerOffset!==0,[de,fe]=m.useState();return Hv(()=>{v&&fe(window.getComputedStyle(v).zIndex)},[v]),(0,L.jsx)(`div`,{ref:te.setFloating,"data-radix-popper-content-wrapper":``,style:{...ne,transform:re?ne.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:de,"--radix-popper-transform-origin":[ie.transformOrigin?.x,ie.transformOrigin?.y].join(` `),...ie.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,L.jsx)(pT,{scope:n,placedSide:ae,placedAlign:oe,onArrowChange:S,arrowX:ce,arrowY:le,shouldHideArrow:ue,children:(0,L.jsx)(Cv.div,{"data-side":ae,"data-align":oe,...g,ref:b,style:{...g.style,animation:re?g.style?.animation:`none`}})})})},`PopperContent`)),gT=`PopperArrow`,_T={top:`bottom`,right:`left`,bottom:`top`,left:`right`},vT=m.forwardRef(rT(function(e,t){let{__scopePopper:n,...r}=e,i=mT(gT,n),a=_T[i.placedSide];return(0,L.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,L.jsx)(tT,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function yT(e){return e!==null}rT(yT,`isNotNull`);var bT=rT(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=xT(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function xT(e){let[t,n=`center`]=e.split(`-`);return[t,n]}rT(xT,`getSideAndAlignFromPlacement`);var ST=lT,CT=dT,wT=hT,TT=vT,ET=Object.defineProperty,DT=(e,t)=>ET(e,`name`,{value:t,configurable:!0}),OT=`Popover`,[kT,AT]=Mv(OT,[oT]),jT=oT(),[MT,NT]=kT(OT),PT=DT(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=jT(t),c=m.useRef(null),[l,u]=m.useState(!1),[d,f]=Zv({prop:r,defaultProp:i??!1,onChange:a,caller:OT});return(0,L.jsx)(ST,{...s,children:(0,L.jsx)(MT,{scope:t,contentId:hy(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),FT=`PopoverTrigger`,IT=m.forwardRef(DT(function(e,t){let{__scopePopover:n,...r}=e,i=NT(FT,n),a=jT(n),o=rv(t,i.triggerRef),s=(0,L.jsx)(Cv.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":qT(i.open),...r,ref:o,onClick:Lv(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,L.jsx)(CT,{asChild:!0,...a,children:s})},`PopoverTrigger`)),LT=`PopoverPortal`,[RT,zT]=kT(LT,{forceMount:void 0}),BT=DT(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=NT(LT,t);return(0,L.jsx)(RT,{scope:t,forceMount:n,children:(0,L.jsx)(ay,{present:n||a.open,children:(0,L.jsx)(Zy,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),VT=`PopoverContent`,HT=m.forwardRef(DT(function(e,t){let n=zT(VT,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=NT(VT,e.__scopePopover);return(0,L.jsx)(ay,{present:r||a.open,children:a.modal?(0,L.jsx)(WT,{...i,ref:t}):(0,L.jsx)(GT,{...i,ref:t})})},`PopoverContent`)),UT=ov(`PopoverContent.RemoveScroll`),WT=m.forwardRef(DT(function(e,t){let n=NT(VT,e.__scopePopover),r=m.useRef(null),i=rv(t,r),a=m.useRef(!1);return m.useEffect(()=>{let e=r.current;if(e)return xx(e)},[]),(0,L.jsx)(fx,{as:UT,allowPinchZoom:!0,children:(0,L.jsx)(KT,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Lv(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Lv(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:Lv(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),GT=m.forwardRef(DT(function(e,t){let n=NT(VT,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return(0,L.jsx)(KT,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),KT=m.forwardRef(DT(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=NT(VT,n),p=jT(n);return rb(),(0,L.jsx)(Ry,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(Ey,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,L.jsx)(wT,{"data-state":qT(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`));function qT(e){return e?`open`:`closed`}DT(qT,`getState`);var JT=PT,YT=IT,XT=BT,ZT=HT,QT=Object.defineProperty,$T=(e,t)=>QT(e,`name`,{value:t,configurable:!0}),eE=`Switch`,[tE,nE]=Mv(eE),[rE,iE]=tE(eE);function aE(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Zv({prop:n,defaultProp:i??!1,onChange:c,caller:eE}),[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useRef(!1),[b,x]=m.useReducer(e=>e+1,0),S={checked:f,setChecked:p,disabled:a,control:h,setControl:g,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:i,isFormControl:!h||!!o||!!h.closest(`form`),bubbleInput:_,setBubbleInput:v};return(0,L.jsx)(rE,{scope:t,...S,children:pE(d)?d(S):r})}$T(aE,`SwitchProvider`);var oE=`SwitchTrigger`,sE=m.forwardRef($T(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:h,bubbleInput:g}=iE(oE,e),_=rv(r,u),v=m.useRef(c);return m.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=$T(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,L.jsx)(Cv.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":mE(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:_,onClick:Lv(t,e=>{p(),d(e=>!e),g&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`SwitchTrigger`)),cE=m.forwardRef($T(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,L.jsx)(aE,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(sE,{...d,ref:t,__scopeSwitch:n}),e&&(0,L.jsx)(fE,{__scopeSwitch:n})]})})},`Switch`)),lE=`SwitchThumb`,uE=m.forwardRef($T(function(e,t){let{__scopeSwitch:n,...r}=e,i=iE(lE,n);return(0,L.jsx)(Cv.span,{"data-state":mE(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),dE=`SwitchBubbleInput`,fE=m.forwardRef($T(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:g}=iE(dE,e),_=rv(r,g),v=wS(i),y=m.useRef(!1),b=m.useRef(s),x=m.useRef(o);m.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});n.call(e,s),e.dispatchEvent(t),y.current=!1}},[h,s,a,o]);let S=m.useRef(s);return(0,L.jsx)(Cv.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:_,onClick:Lv(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function pE(e){return typeof e==`function`}$T(pE,`isFunction`);function mE(e){return e?`checked`:`unchecked`}$T(mE,`getState`);var hE=Object.defineProperty,gE=(e,t)=>hE(e,`name`,{value:t,configurable:!0}),[_E,vE]=Mv(`Tooltip`,[oT]),yE=oT(),bE=`TooltipProvider`,xE=700,SE=`tooltip.open`,[CE,wE]=_E(bE),TE=gE(e=>{let{__scopeTooltip:t,delayDuration:n=xE,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=m.useRef(!0),s=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,L.jsx)(CE,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:m.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:m.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),EE=`Tooltip`,[DE,OE]=_E(EE),kE=gE(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=wE(EE,e.__scopeTooltip),l=yE(t),[u,d]=m.useState(null),[f,p]=m.useState(void 0),h=hy(),g=m.useRef(0),_=o??c.disableHoverableContent,v=s??c.delayDuration,y=m.useRef(!1),[b,x]=Zv({prop:r,defaultProp:i??!1,onChange:gE(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(SE))):c.onClose(),a?.(e)},`onChange`),caller:EE}),S=m.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=m.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,x(!0)},[x]),w=m.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x(!1)},[x]),T=m.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,x(!0),g.current=0},v)},[v,x]);m.useEffect(()=>()=>{g.current&&=(window.clearTimeout(g.current),0)},[]);let E=f??h;return(0,L.jsx)(ST,{...l,children:(0,L.jsx)(DE,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:m.useCallback(()=>{_?w():(window.clearTimeout(g.current),g.current=0)},[w,_]),onOpen:C,onClose:w,disableHoverableContent:_,children:n})})},`Tooltip`),AE=`TooltipTrigger`,jE=m.forwardRef(gE(function(e,t){let{__scopeTooltip:n,...r}=e,i=OE(AE,n),a=wE(AE,n),o=yE(n),s=rv(t,m.useRef(null),i.onTriggerChange),c=m.useRef(!1),l=m.useRef(!1),u=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,L.jsx)(CT,{asChild:!0,...o,children:(0,L.jsx)(Cv.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:Lv(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:Lv(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:Lv(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:Lv(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Lv(e.onBlur,i.onClose),onClick:Lv(e.onClick,i.onClose)})})},`TooltipTrigger`)),ME=`TooltipPortal`,[NE,PE]=_E(ME,{forceMount:void 0}),FE=gE(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=OE(ME,t);return(0,L.jsx)(NE,{scope:t,forceMount:n,children:(0,L.jsx)(ay,{present:n||a.open,children:(0,L.jsx)(Zy,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),IE=`TooltipContent`,LE=m.forwardRef(gE(function(e,t){let n=PE(IE,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=OE(IE,e.__scopeTooltip);return(0,L.jsx)(ay,{present:r||o.open,children:o.disableHoverableContent?(0,L.jsx)(BE,{side:i,...a,ref:t}):(0,L.jsx)(RE,{side:i,...a,ref:t})})},`TooltipContent`)),RE=m.forwardRef(gE(function(e,t){let n=OE(IE,e.__scopeTooltip),r=wE(IE,e.__scopeTooltip),i=m.useRef(null),a=rv(t,i),[o,s]=m.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=m.useCallback(()=>{s(null),d(!1)},[d]),p=m.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=UE(r,HE(r,n.getBoundingClientRect())),a=WE(t.getBoundingClientRect()),o=KE([...i,...a]);s(o),d(!0)},[d]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&u){let e=gE(e=>p(e,u),`handleTriggerLeave`),t=gE(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),m.useEffect(()=>{if(o){let e=gE(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!GE(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,L.jsx)(BE,{...e,ref:a})},`TooltipContentHoverable`)),zE=lv(`TooltipContent`),BE=m.forwardRef(gE(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=OE(IE,n),u=yE(n),{onClose:d}=l;m.useEffect(()=>(document.addEventListener(SE,d),()=>document.removeEventListener(SE,d)),[d]),m.useEffect(()=>{if(l.trigger){let e=gE(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return Hv(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,L.jsx)(Ey,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,L.jsxs)(wT,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,L.jsx)(zE,{children:r}),i?(0,L.jsx)(Ov,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),VE=m.forwardRef(gE(function(e,t){let{__scopeTooltip:n,...r}=e,i=yE(n);return(0,L.jsx)(TT,{...i,...r,ref:t})},`TooltipArrow`));function HE(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}gE(HE,`getExitSideFromRect`);function UE(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}gE(UE,`getPaddedExitPoints`);function WE(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}gE(WE,`getPointsFromRect`);function GE(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}gE(GE,`isPointInPolygon`);function KE(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),qE(t)}gE(KE,`getHull`);function qE(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}gE(qE,`getHullPresorted`);var JE=TE,YE=kE,XE=jE,ZE=FE,QE=LE,$E=VE,eD=Dg(`group/button motion-reduce:transition-none motion-reduce:active:translate-none inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-[0.8125rem] font-medium whitespace-nowrap transition-[transform,background-color,box-shadow,color,border-color,filter] duration-150 active:not-aria-[haspopup]:translate-y-px ease-snap outline-none select-none focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`btn-tint text-primary-foreground [--tint:var(--primary)] disabled:text-muted-foreground`,soft:`btn-raised btn-soft text-foreground`,outline:`btn-raised bg-card text-foreground`,secondary:`btn-raised bg-card text-secondary-foreground`,ghost:`btn-ghost text-foreground`,destructive:`btn-tint text-background [--tint:var(--destructive)] focus-visible:outline-destructive disabled:text-muted-foreground`,link:`text-link underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-3`,xs:`h-7 gap-1 px-2.5 text-xs [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1.5 px-2.5 text-xs [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-2 px-4`,icon:`size-8`,"icon-xs":`size-7 [&_svg:not([class*='size-'])]:size-3.5`,"icon-sm":`size-7`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function J({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?sv:`button`;return(0,L.jsx)(a,{"aria-keyshortcuts":r?void 0:`Enter Space`,"aria-description":r?`When focused, press Enter to activate.`:`When focused, press Enter or Space to activate.`,"aria-describedby":`focused-action-help`,"data-slot":`button`,"data-variant":t,"data-size":n,className:q(eD({variant:t,size:n,className:e})),...i})}var tD=q(`pointer-events-none inline-flex h-[1.125rem] min-w-[1.125rem] w-fit items-center justify-center gap-1 rounded-[5px] border border-border bg-background px-1 font-sans text-[0.7rem] leading-none font-medium text-muted-foreground shadow-[inset_0_-1px_0_var(--border)] select-none`,`in-data-[slot=tooltip-content]:border-background/25 in-data-[slot=tooltip-content]:bg-transparent in-data-[slot=tooltip-content]:text-background in-data-[slot=tooltip-content]:shadow-none`,`in-data-[variant=default]:border-primary-foreground/35 in-data-[variant=default]:bg-primary-foreground/10 in-data-[variant=default]:text-primary-foreground in-data-[variant=default]:shadow-none`,`in-data-[variant=destructive]:border-background/40 in-data-[variant=destructive]:bg-background/10 in-data-[variant=destructive]:text-background in-data-[variant=destructive]:shadow-none`,`[&_svg:not([class*='size-'])]:size-3`);function nD({className:e,...t}){return(0,L.jsx)(`kbd`,{"data-slot":`kbd`,className:q(tD,e),...t})}function rD({className:e,...t}){return(0,L.jsx)(`kbd`,{"data-slot":`kbd-group`,className:q(`inline-flex items-center gap-0.5`,e),...t})}var iD=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),aD={alt:`⌥`,ctrl:`⌃`,shift:`⇧`,meta:`⌘`,cmd:`⌘`},oD={enter:`↵`,esc:`Esc`,escape:`Esc`,arrowleft:`←`,arrowright:`→`,arrowup:`↑`,arrowdown:`↓`,space:`Space`,delete:`Del`,backspace:`⌫`};function sD(e){return e.split(`+`).map(e=>{let t=e.toLowerCase();return iD&&aD[t]?aD[t]:oD[t]??(e.length===1?e.toUpperCase():e[0].toUpperCase()+e.slice(1))})}function cD({chord:e,className:t}){let n=sD(e);return(0,L.jsx)(rD,{className:t,children:n.map((e,t)=>(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[t>0?(0,L.jsx)(`span`,{className:`sr-only`,children:`plus`}):null,(0,L.jsx)(nD,{children:e})]},t))})}function lD({chord:e,children:t,className:n}){return(0,L.jsxs)(`span`,{className:q(`kbd-hint inline-flex shrink-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,n),children:[(0,L.jsx)(cD,{chord:e}),t]})}function uD({open:e,onOpenChange:t,label:n,description:r,dismissOnBackdrop:i=!0,className:a,style:o,onCloseAutoFocus:s,children:c}){let l=qd();return(0,L.jsx)(kx,{open:e,onOpenChange:t,children:(0,L.jsx)(tu,{children:e?(0,L.jsxs)(Fx,{forceMount:!0,children:[(0,L.jsx)(Lx,{asChild:!0,forceMount:!0,children:(0,L.jsx)(B.div,{className:`fixed inset-0 z-50 bg-scrim backdrop-blur-sm`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:`easeOut`}})}),(0,L.jsx)(`div`,{className:`pointer-events-none fixed inset-0 z-50 grid place-items-center p-4`,children:(0,L.jsx)(Vx,{asChild:!0,forceMount:!0,onCloseAutoFocus:s,onInteractOutside:e=>{i||e.preventDefault()},onOpenAutoFocus:e=>{let t=e.currentTarget?.querySelector(`[data-nav], [data-autofocus], textarea`);t&&(e.preventDefault(),t.focus())},...r?{}:{"aria-describedby":void 0},children:(0,L.jsxs)(B.div,{className:q(`glass-pop pointer-events-auto flex max-h-[min(86svh,48rem)] w-full max-w-2xl flex-col overflow-hidden rounded-xl outline-none`,a),style:o,initial:{opacity:0,scale:l?1:.92,y:l?0:18},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:l?1:.96,y:l?0:8,transition:{duration:.12,ease:`easeIn`}},transition:{type:`spring`,stiffness:460,damping:32,mass:.9},children:[(0,L.jsx)(Kx,{className:`sr-only`,children:n}),r?(0,L.jsx)(Jx,{className:`sr-only`,children:r}):null,c]})})})]}):null})})}var dD=[],fD=0,pD=new Set;function mD(){for(let e of[...pD])e()}function hD(e){return pD.add(e),()=>{pD.delete(e)}}function gD(){let e;for(let t of dD)(!e||t.priority>e.priority||t.priority===e.priority&&t.order<e.order)&&(e=t);return e?.id}var _D={question:30,confirm:20,help:10,sheet:5};function vD(e,t){let n=(0,m.useId)();(0,m.useEffect)(()=>{if(e)return dD=[...dD,{id:n,priority:t,order:++fD}],mD(),()=>{dD=dD.filter(e=>e.id!==n),mD()}},[e,t,n]);let r=(0,m.useSyncExternalStore)(hD,gD,()=>void 0);return e&&r===n}function yD(){return dD.length>0}function bD(){return(0,m.useSyncExternalStore)(hD,()=>dD.length>0,()=>!1)}var xD=[`lobby`,`tasks`,`plan`,`quickfix`,`issues`,`excalidraw`,`git`,`knowledge`,`metrics`],SD=`already answered in another window`,CD=`Attached files:`,wD=new Set(xD);function TD(e){let t=e.replace(/^#\/?/,``).split(`/`).filter(Boolean),n=t[0];if(!n||n===`lobby`)return{kind:`tab`,tab:`lobby`,rest:t.slice(1)};if(n===`settings`)return{kind:`settings`};if(n===`sessions`)return{kind:`sessions`,...t[1]?{key:t[1]}:{}};if(wD.has(n))return{kind:`tab`,tab:n,rest:t.slice(1)}}function ED(e,...t){return`#/${e}${t.filter(Boolean).map(e=>`/${encodeURIComponent(e)}`).join(``)}`}function DD(e){window.location.hash!==e&&(window.location.hash=e)}function OD(){let[e,t]=(0,m.useState)(()=>TD(window.location.hash)??{kind:`tab`,tab:`lobby`,rest:[]});return(0,m.useEffect)(()=>{let e=()=>{let e=TD(window.location.hash);e?t(e):(window.history.replaceState(null,``,`#/lobby`),t({kind:`tab`,tab:`lobby`,rest:[]}))};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),e}function kD({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`empty`,className:q(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 p-6 text-center text-balance`,e),...t})}function AD({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`empty-header`,className:q(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var jD=Dg(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-muted text-muted-foreground [&_svg:not([class*='size-'])]:size-5`}},defaultVariants:{variant:`default`}});function MD({className:e,variant:t=`default`,...n}){return(0,L.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:q(jD({variant:t,className:e})),...n})}function ND({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`empty-title`,className:q(`text-sm font-medium tracking-tight`,e),...t})}function PD({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`empty-description`,className:q(`text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function FD({className:e,...t}){return(0,L.jsx)(`span`,{"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:q(`inline-flex size-4 shrink-0 items-end justify-between text-primary`,e),...t,children:[0,1,2].map(e=>(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`block aspect-square h-[28%] shrink-0 rounded-full bg-current motion-safe:animate-[hop_0.9s_ease-in-out_infinite]`,style:{animationDelay:`${e*.14}s`}},e))})}function ID({label:e=`Connecting…`}){return(0,L.jsxs)(`div`,{className:`flex min-h-48 flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(FD,{}),(0,L.jsx)(`span`,{children:e})]})}function LD({message:e,onRetry:t}){return(0,L.jsxs)(kD,{className:`m-4 flex-1`,children:[(0,L.jsxs)(AD,{children:[(0,L.jsxs)(ND,{className:`flex items-center gap-2`,children:[(0,L.jsx)(og,{className:`size-4 text-destructive`,"aria-hidden":`true`}),`Could not load this view`]}),(0,L.jsx)(PD,{children:e??`The request failed. Try again.`})]}),t?(0,L.jsxs)(J,{variant:`outline`,onClick:t,children:[(0,L.jsx)(Mh,{"aria-hidden":`true`}),`Try again`]}):null]})}function RD({onRetry:e}){return(0,L.jsxs)(`div`,{role:`status`,className:`mx-3 mb-1 flex items-center gap-2 rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive max-sm:mx-2`,children:[(0,L.jsx)(vg,{className:`size-4`,"aria-hidden":`true`}),(0,L.jsx)(`span`,{children:`Connection lost — retrying every 2 s.`}),e?(0,L.jsx)(J,{variant:`link`,className:`h-8 px-1 text-destructive`,onClick:e,children:`Retry now`}):null]})}function zD(){let[e,t]=(0,m.useReducer)(e=>e+1,0);return(0,m.useEffect)(()=>Of.subscribe(t),[]),e}function BD(){return zD(),Of.status()}function VD(e){return zD(),Of.get(e)}function HD(e){let t=(0,m.useCallback)(t=>{let n=window.matchMedia(e);return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},[e]),n=(0,m.useCallback)(()=>window.matchMedia(e).matches,[e]);return(0,m.useSyncExternalStore)(t,n)}function UD(e,t,n,r=!0){zD();let[i,a]=(0,m.useState)({loading:!0,at:0}),[o,s]=(0,m.useState)(0),c=[Of.status().connection,...n.map(e=>Of.get(e).version)].join(`,`),l=JSON.stringify(t);(0,m.useEffect)(()=>{if(!r)return;let t=!0,n=performance.now();return a(e=>({...e,loading:!0})),Kf(e,JSON.parse(l)).then(e=>t&&a({data:e,loading:!1,at:n}),e=>t&&a(t=>({...t,error:e instanceof Error?e.message:String(e),loading:!1}))),()=>{t=!1}},[e,l,c,o,r]);let u=(0,m.useCallback)(()=>s(e=>e+1),[]);return{data:i.data,error:i.error,loading:i.loading,requestedAt:i.at,reload:u}}function WD({delayDuration:e=400,...t}){return(0,L.jsx)(JE,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function GD({...e}){return(0,L.jsx)(YE,{"data-slot":`tooltip`,...e})}function KD({...e}){return(0,L.jsx)(XE,{"data-slot":`tooltip-trigger`,...e})}function qD({className:e,sideOffset:t=6,children:n,...r}){return(0,L.jsx)(ZE,{children:(0,L.jsxs)(QE,{"data-slot":`tooltip-content`,sideOffset:t,className:q(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-lg data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[n,(0,L.jsx)($E,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}function JD(e){return[...e.querySelectorAll(`[data-nav]`)].filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`)}function YD(e,t,n){let r=JD(e);if(r.length===0)return!1;let i=t?r.findIndex(e=>e===t||e.contains(t)):-1,a=r[n===`first`?0:n===`last`?r.length-1:Math.max(0,Math.min(r.length-1,(i<0?n>0?-1:r.length:i)+n))];return!a||a===t?!1:(a.focus({preventScroll:!1}),!0)}function XD(e){return e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&![`checkbox`,`radio`,`button`].includes(e.type)||e instanceof HTMLElement&&e.isContentEditable}function ZD(e,t=!0){return e===`ArrowDown`||t&&e===`j`?1:e===`ArrowUp`||t&&e===`k`?-1:0}function QD(e,t=!0){return e===`ArrowRight`||t&&e===`l`?1:e===`ArrowLeft`||t&&e===`h`?-1:0}var $D=`button:not([disabled]), a[href], [role='button']:not([aria-disabled='true'])`;function eO(e){return[...e.querySelectorAll($D)].filter(e=>e.offsetParent!==null)}function tO(e,t,n){let r=eO(e);if(r.length===0)return;let i=t?r.findIndex(e=>e===t||e.contains(t)):-1;r[n===`first`?0:n===`last`?r.length-1:Math.max(0,Math.min(r.length-1,(i<0?n>0?-1:r.length:i)+n))]?.focus()}function nO(e,t=document.querySelector(`[data-pane='list']`)){if(!t)return;let n=[...t.querySelectorAll(`button[data-row]`)].filter(e=>e.offsetParent!==null),r=n.findIndex(e=>e.getAttribute(`aria-current`)===`true`),i=Math.max(0,Math.min(n.length-1,r<0?e>0?0:n.length-1:r+e));n[i]?.click(),n[i]?.focus({preventScroll:!0}),n[i]?.scrollIntoView({block:`nearest`})}function rO(e){return e.querySelector(`[aria-current='true']`)??eO(e)[0]}function iO(){let e=document.getElementById(`main`);if(!e)return!1;let t=e.querySelector(`[data-pane='list']`);return((t?rO(t):void 0)??eO(e)[0]??e).focus(),!0}function aO(){let e=document.querySelector(`[role='tab'][aria-selected='true']`);if(e)return e.focus({preventScroll:!0}),!0;let t=document.getElementById(`main`);return t?.focus({preventScroll:!0}),!!t}var oO={active:!1},sO=new Set([`g`,`j`,`k`,`h`,`l`,`d`,`p`,`/`,`?`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`]);function cO(e){if(!e)return!1;let t=e.toLowerCase();return t===`delete`||/^[a-z]$/.test(t)&&!sO.has(t)}function lO(e,t){return t.toLowerCase()===`delete`?e.key===`Delete`||e.key===`Backspace`:e.key.toLowerCase()===t.toLowerCase()}function uO(){return yD()||!!document.querySelector(`[role='dialog'], [role='alertdialog'], [role='menu'], [role='listbox']`)}function dO(e,t,{enabled:n=!0,inDialog:r=!1}={}){let i=(0,m.useRef)(t);i.current=t,(0,m.useEffect)(()=>{if(!n||!e)return;let t=t=>{t.defaultPrevented||t.isComposing||t.repeat||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||lO(t,e)&&(XD(t.target)||(r||!uO())&&(t.preventDefault(),i.current()))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n,r])}var fO={neutral:`text-foreground`,primary:``,danger:`text-destructive hover:text-destructive`};function Y({label:e,icon:t,tone:n=`neutral`,shortcut:r,href:i,pressed:a,text:o,iconOnly:s,className:c,disabled:l,...u}){let d=(0,m.useRef)(null),f=cO(r);dO(f?r:void 0,()=>d.current?.click(),{enabled:f&&!l});let p=(0,L.jsx)(t,{"aria-hidden":`true`}),h=n===`primary`?`default`:s?`ghost`:`outline`,g=q(!s&&`px-2.5`,fO[n],c),_=s?`icon`:`default`,v=s?p:(0,L.jsxs)(L.Fragment,{children:[p,(0,L.jsx)(`span`,{children:o??e}),r?(0,L.jsx)(cD,{chord:r,className:`kbd-hint ml-1`}):null]}),y=i?(0,L.jsx)(J,{asChild:!0,ref:d,variant:h,size:_,"data-tone":n,className:g,children:(0,L.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer noopener`,"aria-label":e,"aria-keyshortcuts":f?r:void 0,children:v})}):(0,L.jsx)(J,{ref:d,type:`button`,variant:h,size:_,"data-tone":n,"aria-label":e,"aria-pressed":a,"aria-keyshortcuts":f?r:void 0,disabled:l,className:g,...u,children:v});return s?(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:y}),(0,L.jsxs)(qD,{children:[e,(0,L.jsx)(cD,{chord:r??(i?`Enter`:`Enter / Space`)})]})]}):y}function pO({children:e,className:t}){function n(e){let t=e.key===`ArrowRight`?1:e.key===`ArrowLeft`?-1:0;if(!t)return;let n=[...e.currentTarget.querySelectorAll(`button:not([disabled]), a[href]`)],r=n.indexOf(e.target);r<0||(e.preventDefault(),e.stopPropagation(),n[Math.max(0,Math.min(n.length-1,r+t))]?.focus())}return(0,L.jsx)(`div`,{role:`toolbar`,"aria-label":`Actions`,onKeyDown:n,className:q(`sticky -top-5 z-10 -mx-5 -mt-5 flex min-h-12 flex-wrap items-center gap-1 border-b border-border bg-card/90 px-4 py-2 backdrop-blur-sm [&>[data-tone=danger]:not(:first-child)]:ml-auto`,t),children:e})}function mO({...e}){return(0,L.jsx)(kx,{"data-slot":`sheet`,...e})}function hO({...e}){return(0,L.jsx)(Xx,{"data-slot":`sheet-close`,...e})}function gO({...e}){return(0,L.jsx)(Fx,{"data-slot":`sheet-portal`,...e})}function _O({className:e,...t}){return(0,L.jsx)(Lx,{"data-slot":`sheet-overlay`,className:q(`fixed inset-0 z-50 bg-scrim backdrop-blur-sm duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function vO({className:e,children:t,side:n=`right`,showCloseButton:r=!0,forceMount:i,hidden:a,...o}){return(0,L.jsxs)(gO,{forceMount:i,children:[a?null:(0,L.jsx)(_O,{}),(0,L.jsxs)(Vx,{forceMount:i,hidden:a,"data-slot":`sheet-content`,"data-side":n,className:q(`glass-pop fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm transition duration-200 ease-in-out data-[side=right]:rounded-l-xl data-[side=left]:rounded-r-xl data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10`,e),...o,children:[t,r&&(0,L.jsx)(Xx,{"data-slot":`sheet-close`,asChild:!0,children:(0,L.jsxs)(J,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,L.jsx)(bg,{}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function yO({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`sheet-header`,className:q(`flex flex-col gap-0.5 p-4`,e),...t})}function bO({className:e,...t}){return(0,L.jsx)(Kx,{"data-slot":`sheet-title`,className:q(`text-base font-medium text-foreground`,e),...t})}function xO({className:e,...t}){return(0,L.jsx)(Jx,{"data-slot":`sheet-description`,className:q(`text-sm text-muted-foreground`,e),...t})}function SO(){return HD(`(min-width: 1024px)`)}function CO({className:e,...t}){return(0,L.jsx)(`section`,{className:q(`min-h-0 min-w-0`,e),...t})}function wO({open:e,onClose:t,describe:n,children:r}){let i=vD(e,_D.sheet),a=(0,m.useRef)(!1);return i&&(a.current=!0),e||(a.current=!1),(0,L.jsx)(mO,{open:e&&i,onOpenChange:e=>!e&&t(),children:(0,L.jsxs)(vO,{forceMount:e&&a.current?!0:void 0,hidden:!i,showCloseButton:!1,className:q(`gap-0 data-[side=right]:w-[92%] data-[side=right]:sm:max-w-3xl`,!i&&`!hidden`),children:[(0,L.jsxs)(yO,{className:`flex-row items-center justify-between border-b px-4 py-2`,children:[(0,L.jsx)(bO,{className:`text-sm`,children:`Detail`}),(0,L.jsx)(xO,{className:`sr-only`,children:n}),(0,L.jsx)(hO,{asChild:!0,children:(0,L.jsxs)(J,{variant:`ghost`,size:`sm`,"aria-label":`Close detail`,title:`Close · Esc`,className:`gap-2`,children:[(0,L.jsx)(bg,{"aria-hidden":`true`}),`Close`,(0,L.jsx)(cD,{chord:`Esc`,className:`kbd-hint`})]})})]}),(0,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:r})]})})}function TO({wide:e,list:t,detail:n,open:r,onClose:i,hint:a,describe:o}){let s=(0,m.useRef)(null),c=(0,m.useRef)(null);function l(t){let n=s.current;if(!n||t.defaultPrevented||t.nativeEvent.isComposing||yD()||t.altKey||t.ctrlKey||t.metaKey||XD(t.target)||t.target instanceof HTMLInputElement)return;let r=ZD(t.key,!1);r?(t.preventDefault(),tO(n,t.target,r)):t.key===`Home`||t.key===`End`?(t.preventDefault(),tO(n,t.target,t.key===`Home`?`first`:`last`)):e&&QD(t.key)===1&&c.current&&(t.preventDefault(),c.current.focus())}function u(e){e.defaultPrevented||e.nativeEvent.isComposing||yD()||e.altKey||e.ctrlKey||e.metaKey||XD(e.target)||QD(e.key)===-1&&s.current&&(e.preventDefault(),rO(s.current)?.focus())}return e?(0,L.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[clamp(17rem,28%,23rem)_minmax(0,1fr)]`,children:[(0,L.jsx)(CO,{"data-pane":`list`,ref:s,onKeyDown:l,className:`overflow-y-auto border-r border-border pb-dock`,children:t}),(0,L.jsx)(CO,{"data-pane":`detail`,ref:c,tabIndex:0,"aria-label":`Detail`,onKeyDown:u,className:`overflow-y-auto px-5 pt-5 pb-dock outline-none focus-visible:bg-muted/30`,children:n??(0,L.jsx)(`div`,{className:`grid h-full min-h-48 place-items-center`,children:(0,L.jsxs)(`div`,{className:`flex max-w-xs flex-col items-center gap-3 text-center`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground`,children:(0,L.jsx)(uh,{className:`size-5`})}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a}),(0,L.jsxs)(`p`,{className:`kbd-hint flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,L.jsx)(cD,{chord:`ArrowUp`}),(0,L.jsx)(cD,{chord:`ArrowDown`}),`move`]}),(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,L.jsx)(cD,{chord:`ArrowRight`}),`open`]})]})]})})})]}):(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto pb-dock`,children:[(0,L.jsx)(CO,{"data-pane":`list`,ref:s,onKeyDown:l,children:t}),(0,L.jsx)(wO,{open:r&&n!==null,onClose:i,describe:o,children:n})]})}function EO({title:e,count:t,children:n}){return(0,L.jsxs)(`div`,{className:`sticky top-0 z-10 flex min-h-12 flex-wrap items-center gap-x-3 gap-y-1 border-b border-border bg-card/90 px-4 py-2 backdrop-blur-sm`,children:[(0,L.jsx)(`h2`,{className:`text-sm font-medium`,children:e}),(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-2 flex-1`}),t?(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t}):null,n?(0,L.jsx)(`div`,{className:`flex items-center gap-1.5`,children:n}):null]})}function DO(){return(0,L.jsx)(`div`,{className:`flex flex-col gap-1.5 p-3`,role:`status`,"aria-label":`Loading`,children:[0,1,2,3].map(e=>(0,L.jsx)(`div`,{className:`h-11 rounded-lg bg-muted motion-safe:animate-pulse`},e))})}function OO({className:e,...t}){return(0,L.jsx)(`textarea`,{"data-slot":`textarea`,className:q(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-background px-3.5 py-2.5 text-base transition-[border-color,box-shadow] duration-150 outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:disabled:bg-input/80`,e),...t})}function kO(e){return e<10?`0${e}`:String(e)}function AO(e){if(!Number.isFinite(e))return`0`;let t=new Date(e);return`${kO(t.getHours())}:${kO(t.getMinutes())}`}function jO(e){if(!Number.isFinite(e)||e<0)return`0s`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m`:`${Math.floor(n/60)}h ${kO(n%60)}m`}function MO(e){if(!Number.isFinite(e)||e<5e3)return`now`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<48?`${r}h`:`${Math.floor(r/24)}d`}function NO(e){let t=MO(e);return t===`now`?`just now`:`${t} ago`}function PO({...e}){return(0,L.jsx)(mS,{"data-slot":`alert-dialog`,...e})}function FO({...e}){return(0,L.jsx)(hS,{"data-slot":`alert-dialog-portal`,...e})}function IO({className:e,...t}){return(0,L.jsx)(gS,{"data-slot":`alert-dialog-overlay`,className:q(`fixed inset-0 z-50 bg-scrim backdrop-blur-sm duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function LO({className:e,...t}){return(0,L.jsxs)(FO,{children:[(0,L.jsx)(IO,{}),(0,L.jsx)(_S,{"data-slot":`alert-dialog-content`,className:q(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 glass-pop rounded-xl p-5 text-sm duration-150 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...t})]})}function RO({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:q(`flex flex-col gap-1.5`,e),...t})}function zO({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:q(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function BO({className:e,...t}){return(0,L.jsx)(bS,{"data-slot":`alert-dialog-title`,className:q(`text-base font-medium text-foreground`,e),...t})}function VO({className:e,...t}){return(0,L.jsx)(xS,{"data-slot":`alert-dialog-description`,className:q(`text-sm text-muted-foreground`,e),...t})}function HO({className:e,variant:t=`default`,...n}){return(0,L.jsx)(J,{variant:t,size:`sm`,className:q(`h-7 gap-1 px-2.5`,e),asChild:!0,children:(0,L.jsx)(vS,{"data-slot":`alert-dialog-action`,...n})})}function UO({className:e,...t}){return(0,L.jsx)(J,{variant:`outline`,size:`sm`,className:q(`h-7 gap-1 px-2.5`,e),asChild:!0,children:(0,L.jsx)(yS,{"data-slot":`alert-dialog-cancel`,...t})})}function WO({label:e,text:t,shortcut:n,title:r,description:i,confirmLabel:a,onConfirm:o,icon:s,disabled:c,variant:l=`outline`,iconOnly:u,compact:d}){let[f,p]=(0,m.useState)(!1),h=vD(f,_D.confirm),g=l===`destructive`;return dO(`y`,()=>{p(!1),o()},{enabled:f&&h,inDialog:!0}),(0,L.jsxs)(PO,{open:f&&h,onOpenChange:p,children:[(0,L.jsx)(Y,{label:e,icon:s,tone:g?`danger`:`neutral`,disabled:c,shortcut:n,iconOnly:u,...d?{"data-compact":!0,className:`size-8`}:{},...t?{text:t}:{},onClick:()=>p(!0)}),(0,L.jsxs)(LO,{children:[(0,L.jsxs)(RO,{children:[(0,L.jsx)(BO,{children:r}),(0,L.jsx)(VO,{children:i})]}),(0,L.jsxs)(zO,{children:[(0,L.jsxs)(UO,{children:[`Keep it`,(0,L.jsx)(cD,{chord:`Esc`,className:`kbd-hint ml-1`})]}),(0,L.jsxs)(HO,{variant:g?`destructive`:`default`,onClick:o,children:[a,(0,L.jsx)(cD,{chord:`Y`,className:`kbd-hint ml-1`})]})]})]})]})}function GO(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var KO=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qO=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JO={};function YO(e,t){return((t||JO).jsx?qO:KO).test(e)}var XO=/[ \t\n\f\r]/g;function ZO(e){return typeof e==`object`?e.type===`text`&&QO(e.value):QO(e)}function QO(e){return e.replace(XO,``)===``}var $O=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};$O.prototype.normal={},$O.prototype.property={},$O.prototype.space=void 0;function ek(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new $O(n,r,t)}function tk(e){return e.toLowerCase()}var nk=class{constructor(e,t){this.attribute=t,this.property=e}};nk.prototype.attribute=``,nk.prototype.booleanish=!1,nk.prototype.boolean=!1,nk.prototype.commaOrSpaceSeparated=!1,nk.prototype.commaSeparated=!1,nk.prototype.defined=!1,nk.prototype.mustUseProperty=!1,nk.prototype.number=!1,nk.prototype.overloadedBoolean=!1,nk.prototype.property=``,nk.prototype.spaceSeparated=!1,nk.prototype.space=void 0;var rk=s({boolean:()=>X,booleanish:()=>ak,commaOrSpaceSeparated:()=>lk,commaSeparated:()=>ck,number:()=>Z,overloadedBoolean:()=>ok,spaceSeparated:()=>sk}),ik=0,X=uk(),ak=uk(),ok=uk(),Z=uk(),sk=uk(),ck=uk(),lk=uk();function uk(){return 2**++ik}var dk=Object.keys(rk),fk=class extends nk{constructor(e,t,n,r){let i=-1;if(super(e,t),pk(this,`space`,r),typeof n==`number`)for(;++i<dk.length;){let e=dk[i];pk(this,dk[i],(n&rk[e])===rk[e])}}};fk.prototype.defined=!0;function pk(e,t,n){n&&(e[t]=n)}function mk(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new fk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[tk(r)]=r,n[tk(a.attribute)]=r}return new $O(t,n,e.space)}var hk=mk({properties:{ariaActiveDescendant:null,ariaAtomic:ak,ariaAutoComplete:null,ariaBusy:ak,ariaChecked:ak,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:sk,ariaCurrent:null,ariaDescribedBy:sk,ariaDetails:null,ariaDisabled:ak,ariaDropEffect:sk,ariaErrorMessage:null,ariaExpanded:ak,ariaFlowTo:sk,ariaGrabbed:ak,ariaHasPopup:null,ariaHidden:ak,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:sk,ariaLevel:Z,ariaLive:null,ariaModal:ak,ariaMultiLine:ak,ariaMultiSelectable:ak,ariaOrientation:null,ariaOwns:sk,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:ak,ariaReadOnly:ak,ariaRelevant:null,ariaRequired:ak,ariaRoleDescription:sk,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:ak,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function gk(e,t){return t in e?e[t]:t}function _k(e,t){return gk(e,t.toLowerCase())}var vk=mk({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:ck,acceptCharset:sk,accessKey:sk,action:null,allow:null,allowFullScreen:X,allowPaymentRequest:X,allowUserMedia:X,alpha:X,alt:null,as:null,async:X,autoCapitalize:null,autoComplete:sk,autoFocus:X,autoPlay:X,blocking:sk,capture:null,charSet:null,checked:X,cite:null,className:sk,closedBy:null,colorSpace:null,cols:Z,colSpan:Z,command:null,commandFor:null,content:null,contentEditable:ak,controls:X,controlsList:sk,coords:Z|ck,crossOrigin:null,data:null,dateTime:null,decoding:null,default:X,defer:X,dir:null,dirName:null,disabled:X,download:ok,draggable:ak,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:X,formTarget:null,headers:sk,height:Z,hidden:ok,high:Z,href:null,hrefLang:null,htmlFor:sk,httpEquiv:sk,id:null,imageSizes:null,imageSrcSet:null,inert:X,inputMode:null,integrity:null,is:null,isMap:X,itemId:null,itemProp:sk,itemRef:sk,itemScope:X,itemType:sk,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:X,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:X,muted:X,name:null,nonce:null,noModule:X,noValidate:X,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:X,optimum:Z,pattern:null,ping:sk,placeholder:null,playsInline:X,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:X,referrerPolicy:null,rel:sk,required:X,reversed:X,rows:Z,rowSpan:Z,sandbox:sk,scope:null,scoped:X,seamless:X,selected:X,shadowRootClonable:X,shadowRootCustomElementRegistry:X,shadowRootDelegatesFocus:X,shadowRootMode:null,shadowRootSerializable:X,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:ak,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:X,useMap:null,value:ak,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:sk,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:X,declare:X,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:X,noHref:X,noShade:X,noWrap:X,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:ak,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:X,disablePictureInPicture:X,disableRemotePlayback:X,exportParts:ck,part:sk,prefix:null,property:null,results:Z,security:null,unselectable:null},space:`html`,transform:_k}),yk=mk({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,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`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,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`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,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`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:lk,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:sk,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:X,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ck,g2:ck,glyphName:ck,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:lk,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:sk,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:lk,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:lk,rev:lk,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:lk,requiredFeatures:lk,requiredFonts:lk,requiredFormats:lk,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:lk,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:lk,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:lk,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:gk}),bk=mk({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),xk=mk({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:_k}),Sk=mk({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ck={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},wk=/[A-Z]/g,Tk=/-[a-z]/g,Ek=/^data[-\w.:]+$/i;function Dk(e,t){let n=tk(t),r=t,i=nk;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Ek.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Tk,kk);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Tk.test(e)){let n=e.replace(wk,Ok);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=fk}return new i(r,t)}function Ok(e){return`-`+e.toLowerCase()}function kk(e){return e.charAt(1).toUpperCase()}var Ak=ek([hk,vk,bk,xk,Sk],`html`),jk=ek([hk,yk,bk,xk,Sk],`svg`);function Mk(e){return e.join(` `).trim()}var Nk=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
58
|
+
`},sx=0,cx=[];function lx(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),i=m.useState(sx++)[0],a=m.useState(jb)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=sb([e.lockRef.current],(e.shards||[]).map(ix),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=m.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=nx(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Yb(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Yb(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return tx(h,t,e,h===`h`?s:c,!0)},[]),c=m.useCallback(function(e){var n=e;if(cx.length&&cx[cx.length-1]===a){var r=`deltaY`in n?rx(n):nx(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&ax(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(ix).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=m.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ux(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=m.useCallback(function(e){n.current=nx(e),r.current=void 0},[]),d=m.useCallback(function(t){l(t.type,rx(t),t.target,s(t,e.lockRef.current))},[]),f=m.useCallback(function(t){l(t.type,nx(t),t.target,s(t,e.lockRef.current))},[]);m.useEffect(function(){return cx.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Wb),document.addEventListener(`touchmove`,c,Wb),document.addEventListener(`touchstart`,u,Wb),function(){cx=cx.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Wb),document.removeEventListener(`touchmove`,c,Wb),document.removeEventListener(`touchstart`,u,Wb)}},[]);var p=e.removeScrollBar,h=e.inert;return m.createElement(m.Fragment,null,h?m.createElement(a,{styles:ox(i)}):null,p?m.createElement(Vb,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ux(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var dx=xb(Sb,lx),fx=m.forwardRef(function(e,t){return m.createElement(wb,ab({},e,{ref:t,sideCar:dx}))});fx.classNames=wb.classNames;var px=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},mx=new WeakMap,hx=new WeakMap,gx={},_x=0,vx=function(e){return e&&(e.host||vx(e.parentNode))},yx=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=vx(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},bx=function(e,t,n,r){var i=yx(t,Array.isArray(e)?e:[e]);gx[n]||(gx[n]=new WeakMap);var a=gx[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(mx.get(e)||0)+1,l=(a.get(e)||0)+1;mx.set(e,c),a.set(e,l),o.push(e),c===1&&i&&hx.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),_x++,function(){o.forEach(function(e){var t=mx.get(e)-1,i=a.get(e)-1;mx.set(e,t),a.set(e,i),t||(hx.has(e)||e.removeAttribute(r),hx.delete(e)),i||e.removeAttribute(n)}),_x--,_x||(mx=new WeakMap,mx=new WeakMap,hx=new WeakMap,gx={})}},xx=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||px(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),bx(r,i,n,`aria-hidden`)):function(){return null}},Sx=Object.defineProperty,Cx=(e,t)=>Sx(e,`name`,{value:t,configurable:!0}),wx=`Dialog`,[Tx,Ex]=Mv(wx),[Dx,Ox]=Tx(wx),kx=Cx(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=m.useRef(null),c=m.useRef(null),[l,u]=Zv({prop:r,defaultProp:i??!1,onChange:a,caller:wx}),[d,f]=m.useState(0),[p,h]=m.useState(0);return(0,L.jsx)(Dx,{scope:t,triggerRef:s,contentRef:c,contentId:hy(),titleId:hy(),descriptionId:hy(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:h,open:l,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),Ax=`DialogTrigger`,jx=m.forwardRef(Cx(function(e,t){let{__scopeDialog:n,...r}=e,i=Ox(Ax,n),a=rv(t,i.triggerRef);return(0,L.jsx)(Cv.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Zx(i.open),...r,ref:a,onClick:Lv(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),Mx=`DialogPortal`,[Nx,Px]=Tx(Mx,{forceMount:void 0}),Fx=Cx(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Ox(Mx,t);return(0,L.jsx)(Nx,{scope:t,forceMount:n,children:m.Children.map(r,e=>(0,L.jsx)(ay,{present:n||a.open,children:(0,L.jsx)(Zy,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Ix=`DialogOverlay`,Lx=m.forwardRef(Cx(function(e,t){let n=Px(Ix,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ox(Ix,e.__scopeDialog);return a.modal?(0,L.jsx)(ay,{present:r||a.open,children:(0,L.jsx)(zx,{...i,ref:t})}):null},`DialogOverlay`)),Rx=ov(`DialogOverlay.RemoveScroll`),zx=m.forwardRef(Cx(function(e,t){let{__scopeDialog:n,...r}=e,i=Ox(Ix,n),a=rv(t,Dy());return(0,L.jsx)(fx,{as:Rx,allowPinchZoom:!0,shards:[i.contentRef],children:(0,L.jsx)(Cv.div,{"data-state":Zx(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Bx=`DialogContent`,Vx=m.forwardRef(Cx(function(e,t){let n=Px(Bx,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ox(Bx,e.__scopeDialog);return(0,L.jsx)(ay,{present:r||a.open,children:a.modal?(0,L.jsx)(Hx,{...i,ref:t}):(0,L.jsx)(Ux,{...i,ref:t})})},`DialogContent`)),Hx=m.forwardRef(Cx(function(e,t){let n=Ox(Bx,e.__scopeDialog),r=m.useRef(null),i=rv(t,n.contentRef,r);return m.useEffect(()=>{let e=r.current;if(e)return xx(e)},[]),(0,L.jsx)(Wx,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Lv(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Lv(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Lv(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Ux=m.forwardRef(Cx(function(e,t){let n=Ox(Bx,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return(0,L.jsx)(Wx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Wx=m.forwardRef(Cx(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Ox(Bx,n);return rb(),(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(Ry,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(Ey,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Zx(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),Gx=`DialogTitle`,Kx=m.forwardRef(Cx(function(e,t){let{__scopeDialog:n,...r}=e,i=Ox(Gx,n),{setTitleCount:a}=i;return Hv(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,L.jsx)(Cv.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),qx=`DialogDescription`,Jx=m.forwardRef(Cx(function(e,t){let{__scopeDialog:n,...r}=e,i=Ox(qx,n),{setDescriptionCount:a}=i;return Hv(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,L.jsx)(Cv.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Yx=`DialogClose`,Xx=m.forwardRef(Cx(function(e,t){let{__scopeDialog:n,...r}=e,i=Ox(Yx,n);return(0,L.jsx)(Cv.button,{type:`button`,...r,ref:t,onClick:Lv(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Zx(e){return e?`open`:`closed`}Cx(Zx,`getState`);var Qx=Object.defineProperty,$x=(e,t)=>Qx(e,`name`,{value:t,configurable:!0}),[eS,tS]=Mv(`AlertDialog`,[Ex]),nS=Ex(),rS=$x(e=>{let{__scopeAlertDialog:t,...n}=e,r=nS(t);return(0,L.jsx)(kx,{...r,...n,modal:!0})},`AlertDialog`);m.forwardRef($x(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=nS(n);return(0,L.jsx)(jx,{...i,...r,ref:t})},`AlertDialogTrigger`));var iS=$x(e=>{let{__scopeAlertDialog:t,...n}=e,r=nS(t);return(0,L.jsx)(Fx,{...r,...n})},`AlertDialogPortal`),aS=m.forwardRef($x(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=nS(n);return(0,L.jsx)(Lx,{...i,...r,ref:t})},`AlertDialogOverlay`)),[oS,sS]=eS(`AlertDialogContent`),cS=m.forwardRef($x(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=nS(n),o=rv(t,m.useRef(null)),s=m.useRef(null);return(0,L.jsx)(oS,{scope:n,cancelRef:s,children:(0,L.jsx)(Vx,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:Lv(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),lS=m.forwardRef($x(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=nS(n);return(0,L.jsx)(Kx,{...i,...r,ref:t})},`AlertDialogTitle`)),uS=m.forwardRef($x(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=nS(n);return(0,L.jsx)(Jx,{...i,...r,ref:t})},`AlertDialogDescription`)),dS=m.forwardRef($x(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=nS(n);return(0,L.jsx)(Xx,{...i,...r,ref:t})},`AlertDialogAction`)),fS=`AlertDialogCancel`,pS=m.forwardRef($x(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=sS(fS,n),a=nS(n),o=rv(t,i);return(0,L.jsx)(Xx,{...a,...r,ref:o})},`AlertDialogCancel`)),mS=rS,hS=iS,gS=aS,_S=cS,vS=dS,yS=pS,bS=lS,xS=uS,SS=Object.defineProperty,CS=(e,t)=>SS(e,`name`,{value:t,configurable:!0});function wS(e){let[t,n]=m.useState(void 0);return Hv(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}CS(wS,`useSize`);var TS=Object.defineProperty,ES=(e,t)=>TS(e,`name`,{value:t,configurable:!0}),DS=`Checkbox`,[OS,kS]=Mv(DS),[AS,jS]=OS(DS);function MS(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Zv({prop:n,defaultProp:i??!1,onChange:c,caller:DS}),[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useRef(!1),[b,x]=m.useReducer(e=>e+1,0),S=!h||!!o||!!h.closest(`form`),C={checked:f,disabled:a,setChecked:p,control:h,setControl:g,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:!VS(i)&&i,isFormControl:S,bubbleInput:_,setBubbleInput:v};return(0,L.jsx)(AS,{scope:t,...C,children:BS(d)?d(C):r})}ES(MS,`CheckboxProvider`);var NS=`CheckboxTrigger`,PS=m.forwardRef(ES(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:h,bubbleInput:g}=jS(NS,e),_=rv(i,u),v=m.useRef(c);return m.useEffect(()=>{let e=a?.form;if(e){let t=ES(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,L.jsx)(Cv.button,{type:`button`,role:`checkbox`,"aria-checked":VS(c)?`mixed`:c,"aria-required":l,"data-state":HS(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:_,onKeyDown:Lv(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:Lv(n,e=>{p(),d(e=>VS(e)?!0:!e),g&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),FS=m.forwardRef(ES(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,L.jsx)(MS,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(PS,{...d,ref:t,__scopeCheckbox:n}),e&&(0,L.jsx)(zS,{__scopeCheckbox:n})]})})},`Checkbox`)),IS=`CheckboxIndicator`,LS=m.forwardRef(ES(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=jS(IS,n);return(0,L.jsx)(ay,{present:r||VS(a.checked)||a.checked===!0,children:(0,L.jsx)(Cv.span,{"data-state":HS(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),RS=`CheckboxBubbleInput`,zS=m.forwardRef(ES(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:g}=jS(RS,e),_=rv(r,g),v=wS(i),y=m.useRef(!1),b=m.useRef(s),x=m.useRef(o);m.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=VS(s),n.call(e,!VS(s)&&s),e.dispatchEvent(t),y.current=!1}},[h,s,a,o]);let S=m.useRef(!VS(s)&&s);return(0,L.jsx)(Cv.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:_,onClick:Lv(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function BS(e){return typeof e==`function`}ES(BS,`isFunction`);function VS(e){return e===`indeterminate`}ES(VS,`isIndeterminate`);function HS(e){return VS(e)?`indeterminate`:e?`checked`:`unchecked`}ES(HS,`getState`);var US=[`top`,`right`,`bottom`,`left`],WS=Math.min,GS=Math.max,KS=Math.round,qS=Math.floor,JS=e=>({x:e,y:e}),YS={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function XS(e,t,n){return GS(e,WS(t,n))}function ZS(e,t){return typeof e==`function`?e(t):e}function QS(e){return e.split(`-`)[0]}function $S(e){return e.split(`-`)[1]}function eC(e){return e===`x`?`y`:`x`}function tC(e){return e===`y`?`height`:`width`}function nC(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function rC(e){return eC(nC(e))}function iC(e,t,n){n===void 0&&(n=!1);let r=$S(e),i=rC(e),a=tC(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=pC(o)),[o,pC(o)]}function aC(e){let t=pC(e);return[oC(e),t,oC(t)]}function oC(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var sC=[`left`,`right`],cC=[`right`,`left`],lC=[`top`,`bottom`],uC=[`bottom`,`top`];function dC(e,t,n){switch(e){case`top`:case`bottom`:return n?t?cC:sC:t?sC:cC;case`left`:case`right`:return t?lC:uC;default:return[]}}function fC(e,t,n,r){let i=$S(e),a=dC(QS(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(oC)))),a}function pC(e){let t=QS(e);return YS[t]+e.slice(t.length)}function mC(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function hC(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:mC(e)}function gC(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function _C(e,t,n){let{reference:r,floating:i}=e,a=nC(t),o=rC(t),s=tC(o),c=QS(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=$S(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function vC(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ZS(t,e),p=hC(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=gC(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=gC(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var yC=50,bC=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:vC},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=_C(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<yC&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=_C(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},xC=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ZS(e,t)||{};if(l==null)return{};let d=hC(u),f={x:n,y:r},p=rC(i),m=tC(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=WS(d[_],T),D=WS(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,ee=XS(E,k,O),te=!c.arrow&&$S(i)!=null&&k!==ee&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,ne=te?k<E?k-E:k-O:0;return{[p]:f[p]+ne,data:{[p]:ee,centerOffset:k-ee-ne,...te&&{alignmentOffset:ne}},reset:te}}}),SC=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ZS(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=QS(r),_=nC(o),v=QS(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[pC(o)]:aC(o)),x=p!==`none`;!d&&x&&b.push(...fC(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=iC(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===nC(t)||T.every(e=>nC(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=nC(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function CC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wC(e){return US.some(t=>e[t]>=0)}var TC=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ZS(e,t);switch(i){case`referenceHidden`:{let e=CC(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:wC(e)}}}case`escaped`:{let e=CC(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:wC(e)}}}default:return{}}}}},EC=new Set([`left`,`top`]);async function DC(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=QS(n),s=$S(n),c=nC(n)===`y`,l=EC.has(o)?-1:1,u=a&&c?-1:1,d=ZS(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var OC=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await DC(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},kC=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ZS(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=nC(i),p=eC(f),m=u[p],h=u[f],g=(e,t)=>XS(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},AC=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ZS(e,t),u={x:n,y:r},d=nC(i),f=eC(d),p=u[f],m=u[d],h=ZS(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=EC.has(QS(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},jC=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=ZS(e,t),c=await i.detectOverflow(t,s),l=QS(n),u=$S(n),d=nC(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=WS(p-c[m],g),y=WS(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*GS(c.left,c.right):S=p-2*GS(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function MC(){return typeof window<`u`}function NC(e){return IC(e)?(e.nodeName||``).toLowerCase():`#document`}function PC(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function FC(e){return((IC(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function IC(e){return MC()?e instanceof Node||e instanceof PC(e).Node:!1}function LC(e){return MC()?e instanceof Element||e instanceof PC(e).Element:!1}function RC(e){return MC()?e instanceof HTMLElement||e instanceof PC(e).HTMLElement:!1}function zC(e){return!MC()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof PC(e).ShadowRoot}function BC(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ZC(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function VC(e){return/^(table|td|th)$/.test(NC(e))}function HC(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var UC=/transform|translate|scale|rotate|perspective|filter/,WC=/paint|layout|strict|content/,GC=e=>!!e&&e!==`none`,KC;function qC(e){let t=LC(e)?ZC(e):e;return GC(t.transform)||GC(t.translate)||GC(t.scale)||GC(t.rotate)||GC(t.perspective)||!YC()&&(GC(t.backdropFilter)||GC(t.filter))||UC.test(t.willChange||``)||WC.test(t.contain||``)}function JC(e){let t=$C(e);for(;RC(t)&&!XC(t);){if(qC(t))return t;if(HC(t))return null;t=$C(t)}return null}function YC(){return KC??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),KC}function XC(e){return/^(html|body|#document)$/.test(NC(e))}function ZC(e){return PC(e).getComputedStyle(e)}function QC(e){return LC(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $C(e){if(NC(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||zC(e)&&e.host||FC(e);return zC(t)?t.host:t}function ew(e){let t=$C(e);return XC(t)?(e.ownerDocument||e).body:RC(t)&&BC(t)?t:ew(t)}function tw(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ew(e),i=r===e.ownerDocument?.body,a=PC(r);if(i){let e=nw(a);return t.concat(a,a.visualViewport||[],BC(r)?r:[],e&&n?tw(e):[])}return t.concat(r,tw(r,[],n))}function nw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function rw(e){let t=ZC(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=RC(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=KS(n)!==a||KS(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function iw(e){return LC(e)?e:e.contextElement}function aw(e){let t=iw(e);if(!RC(t))return JS(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=rw(t),o=(a?KS(n.width):n.width)/r,s=(a?KS(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ow=JS(0);function sw(e){let t=PC(e);return!YC()||!t.visualViewport?ow:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function cw(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===PC(e)}function lw(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=iw(e),o=JS(1);t&&(r?LC(r)&&(o=aw(r)):o=aw(e));let s=cw(a,n,r)?sw(a):JS(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=PC(a),t=LC(r)?PC(r):r,n=e,i=nw(n);for(;i&&t!==n;){let e=aw(i),t=i.getBoundingClientRect(),r=ZC(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=PC(i),i=nw(n)}}return gC({width:u,height:d,x:c,y:l})}function uw(e,t){let n=QC(e).scrollLeft;return t?t.left+n:lw(FC(e)).left+n}function dw(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-uw(e,n),y:n.top+t.scrollTop}}function fw(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=FC(r),s=t?HC(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=JS(1),u=JS(0),d=RC(r);if((d||!a)&&((NC(r)!==`body`||BC(o))&&(c=QC(r)),d)){let e=lw(r);l=aw(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?dw(o,c):JS(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function pw(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function mw(e){let t=QC(e),n=e.ownerDocument.body,r=GS(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=GS(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+uw(e),o=-t.scrollTop;return ZC(n).direction===`rtl`&&(a+=GS(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var hw=25;function gw(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=PC(e),a=FC(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!YC()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(uw(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=hw&&(s-=o)}return{width:s,height:c,x:l,y:u}}function _w(e,t){let n=lw(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=aw(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function vw(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=gw(e,n,t);else if(t===`document`)r=mw(FC(e));else if(LC(t))r=_w(t,n);else{let n=sw(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return gC(r)}function yw(e,t){let n=t.get(e);if(n)return n;let r=tw(e,[],!1).filter(e=>LC(e)&&NC(e)!==`body`),i=null,a=ZC(e).position===`fixed`,o=a?$C(e):e;for(;LC(o)&&!XC(o);){let e=ZC(o),t=qC(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=$C(o)}return t.set(e,r),r}function bw(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?HC(t)?[]:yw(t,this._c):[].concat(n),r],o=vw(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=vw(t,a[e],i);s=GS(n.top,s),c=WS(n.right,c),l=WS(n.bottom,l),u=GS(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function xw(e){let{width:t,height:n}=rw(e);return{width:t,height:n}}function Sw(e,t,n){let r=RC(t),i=FC(t),a=n===`fixed`,o=lw(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=JS(0);if((r||!a)&&((NC(t)!==`body`||BC(i))&&(s=QC(t)),r)){let e=lw(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=uw(i));let l=i&&!r&&!a?dw(i,s):JS(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Cw(e){return ZC(e).position===`static`}function ww(e,t){if(!RC(e)||ZC(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return FC(e)===n&&(n=n.ownerDocument.body),n}function Tw(e,t){let n=PC(e);if(HC(e))return n;if(!RC(e)){let t=$C(e);for(;t&&!XC(t);){if(LC(t)&&!Cw(t))return t;t=$C(t)}return n}let r=ww(e,t);for(;r&&VC(r)&&Cw(r);)r=ww(r,t);return r&&XC(r)&&Cw(r)&&!qC(r)?n:r||JC(e)||n}var Ew=async function(e){let t=this.getOffsetParent||Tw,n=this.getDimensions,r=await n(e.floating);return{reference:Sw(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Dw(e){return ZC(e).direction===`rtl`}var Ow={convertOffsetParentRelativeRectToViewportRelativeRect:fw,getDocumentElement:FC,getClippingRect:bw,getOffsetParent:Tw,getElementRects:Ew,getClientRects:pw,getDimensions:xw,getScale:aw,isElement:LC,isRTL:Dw};function kw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Aw(e,t,n){let r=null,i,a=FC(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=qS(d),h=qS(a.clientWidth-(u+f)),g=qS(a.clientHeight-(d+p)),_=qS(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:GS(0,WS(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!kw(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=PC(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function jw(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=iw(e),u=i||a?[...l?tw(l):[],...t?tw(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Aw(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?lw(e):null;c&&g();function g(){let t=lw(e);h&&!kw(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Mw=OC,Nw=kC,Pw=SC,Fw=jC,Iw=TC,Lw=xC,Rw=AC,zw=(e,t,n)=>{let r=new Map,i=n??{},a={...Ow,...i.platform,_c:r};return bC(e,t,{...i,platform:a})},Bw=typeof document<`u`?m.useLayoutEffect:function(){};function Vw(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Vw(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Vw(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Hw(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Uw(e,t){let n=Hw(e);return Math.round(t*n)/n}function Ww(e){let t=m.useRef(e);return Bw(()=>{t.current=e}),t}function Gw(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);Vw(f,r)||p(r);let[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=m.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=m.useRef(null),w=m.useRef(null),T=m.useRef(u),E=c!=null,D=Ww(c),O=Ww(i),k=Ww(l),ee=m.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),zw(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};te.current&&!Vw(T.current,t)&&(T.current=t,bv.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Bw(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let te=m.useRef(!1);Bw(()=>(te.current=!0,()=>{te.current=!1}),[]),Bw(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,ee);ee()}},[x,S,ee,D,E]);let ne=m.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),A=m.useMemo(()=>({reference:x,floating:S}),[x,S]),re=m.useMemo(()=>{let e={position:n,left:0,top:0};if(!A.floating)return e;let t=Uw(A.floating,u.x),r=Uw(A.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Hw(A.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,A.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:ee,refs:ne,elements:A,floatingStyles:re}),[u,ee,ne,A,re])}var Kw=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Lw({element:r.current,padding:i}).fn(n):r?Lw({element:r,padding:i}).fn(n):{}}}},qw=(e,t)=>{let n=Mw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jw=(e,t)=>{let n=Nw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yw=(e,t)=>({fn:Rw(e).fn,options:[e,t]}),Xw=(e,t)=>{let n=Pw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zw=(e,t)=>{let n=Fw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qw=(e,t)=>{let n=Iw(e);return{name:n.name,fn:n.fn,options:[e,t]}},$w=(e,t)=>{let n=Kw(e);return{name:n.name,fn:n.fn,options:[e,t]}},eT=Object.defineProperty,tT=m.forwardRef(((e,t)=>eT(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,L.jsx)(Cv.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,L.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),nT=Object.defineProperty,rT=(e,t)=>nT(e,`name`,{value:t,configurable:!0}),iT=`Popper`,[aT,oT]=Mv(iT),[sT,cT]=aT(iT),lT=rT(e=>{let{__scopePopper:t,children:n}=e,[r,i]=m.useState(null),[a,o]=m.useState(void 0);return(0,L.jsx)(sT,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),uT=`PopperAnchor`,dT=m.forwardRef(rT(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=cT(uT,n),o=m.useRef(null),s=a.onAnchorChange,c=rv(t,m.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=m.useRef(null);m.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&xT(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,L.jsx)(Cv.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),fT=`PopperContent`,[pT,mT]=aT(fT),hT=m.forwardRef(rT(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:h,...g}=e,_=cT(fT,n),[v,y]=m.useState(null),b=rv(t,y),[x,S]=m.useState(null),C=wS(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,ee={padding:D,boundary:O.filter(yT),altBoundary:k},{refs:te,floatingStyles:ne,placement:A,isPositioned:re,middlewareData:ie}=Gw({strategy:`fixed`,placement:E,whileElementsMounted:rT((...e)=>jw(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[qw({mainAxis:i+T,alignmentAxis:o}),c&&Jw({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Yw():void 0,...ee}),c&&Xw({...ee}),Zw({...ee,apply:rT(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&$w({element:x,padding:s}),bT({arrowWidth:w,arrowHeight:T}),f&&Qw({strategy:`referenceHidden`,...ee,boundary:k?ee.boundary:void 0})]}),j=_.setPlacementState;Hv(()=>(j(A),()=>{j(void 0)}),[A,j]);let[ae,oe]=xT(A),se=vy(h);Hv(()=>{re&&se?.()},[re,se]);let ce=ie.arrow?.x,le=ie.arrow?.y,ue=ie.arrow?.centerOffset!==0,[de,fe]=m.useState();return Hv(()=>{v&&fe(window.getComputedStyle(v).zIndex)},[v]),(0,L.jsx)(`div`,{ref:te.setFloating,"data-radix-popper-content-wrapper":``,style:{...ne,transform:re?ne.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:de,"--radix-popper-transform-origin":[ie.transformOrigin?.x,ie.transformOrigin?.y].join(` `),...ie.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,L.jsx)(pT,{scope:n,placedSide:ae,placedAlign:oe,onArrowChange:S,arrowX:ce,arrowY:le,shouldHideArrow:ue,children:(0,L.jsx)(Cv.div,{"data-side":ae,"data-align":oe,...g,ref:b,style:{...g.style,animation:re?g.style?.animation:`none`}})})})},`PopperContent`)),gT=`PopperArrow`,_T={top:`bottom`,right:`left`,bottom:`top`,left:`right`},vT=m.forwardRef(rT(function(e,t){let{__scopePopper:n,...r}=e,i=mT(gT,n),a=_T[i.placedSide];return(0,L.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,L.jsx)(tT,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function yT(e){return e!==null}rT(yT,`isNotNull`);var bT=rT(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=xT(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function xT(e){let[t,n=`center`]=e.split(`-`);return[t,n]}rT(xT,`getSideAndAlignFromPlacement`);var ST=lT,CT=dT,wT=hT,TT=vT,ET=Object.defineProperty,DT=(e,t)=>ET(e,`name`,{value:t,configurable:!0}),OT=`Popover`,[kT,AT]=Mv(OT,[oT]),jT=oT(),[MT,NT]=kT(OT),PT=DT(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=jT(t),c=m.useRef(null),[l,u]=m.useState(!1),[d,f]=Zv({prop:r,defaultProp:i??!1,onChange:a,caller:OT});return(0,L.jsx)(ST,{...s,children:(0,L.jsx)(MT,{scope:t,contentId:hy(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),FT=`PopoverTrigger`,IT=m.forwardRef(DT(function(e,t){let{__scopePopover:n,...r}=e,i=NT(FT,n),a=jT(n),o=rv(t,i.triggerRef),s=(0,L.jsx)(Cv.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":qT(i.open),...r,ref:o,onClick:Lv(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,L.jsx)(CT,{asChild:!0,...a,children:s})},`PopoverTrigger`)),LT=`PopoverPortal`,[RT,zT]=kT(LT,{forceMount:void 0}),BT=DT(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=NT(LT,t);return(0,L.jsx)(RT,{scope:t,forceMount:n,children:(0,L.jsx)(ay,{present:n||a.open,children:(0,L.jsx)(Zy,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),VT=`PopoverContent`,HT=m.forwardRef(DT(function(e,t){let n=zT(VT,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=NT(VT,e.__scopePopover);return(0,L.jsx)(ay,{present:r||a.open,children:a.modal?(0,L.jsx)(WT,{...i,ref:t}):(0,L.jsx)(GT,{...i,ref:t})})},`PopoverContent`)),UT=ov(`PopoverContent.RemoveScroll`),WT=m.forwardRef(DT(function(e,t){let n=NT(VT,e.__scopePopover),r=m.useRef(null),i=rv(t,r),a=m.useRef(!1);return m.useEffect(()=>{let e=r.current;if(e)return xx(e)},[]),(0,L.jsx)(fx,{as:UT,allowPinchZoom:!0,children:(0,L.jsx)(KT,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Lv(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Lv(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:Lv(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),GT=m.forwardRef(DT(function(e,t){let n=NT(VT,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return(0,L.jsx)(KT,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),KT=m.forwardRef(DT(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=NT(VT,n),p=jT(n);return rb(),(0,L.jsx)(Ry,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(Ey,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,L.jsx)(wT,{"data-state":qT(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`));function qT(e){return e?`open`:`closed`}DT(qT,`getState`);var JT=PT,YT=IT,XT=BT,ZT=HT,QT=Object.defineProperty,$T=(e,t)=>QT(e,`name`,{value:t,configurable:!0}),eE=`Switch`,[tE,nE]=Mv(eE),[rE,iE]=tE(eE);function aE(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Zv({prop:n,defaultProp:i??!1,onChange:c,caller:eE}),[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useRef(!1),[b,x]=m.useReducer(e=>e+1,0),S={checked:f,setChecked:p,disabled:a,control:h,setControl:g,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:i,isFormControl:!h||!!o||!!h.closest(`form`),bubbleInput:_,setBubbleInput:v};return(0,L.jsx)(rE,{scope:t,...S,children:pE(d)?d(S):r})}$T(aE,`SwitchProvider`);var oE=`SwitchTrigger`,sE=m.forwardRef($T(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:h,bubbleInput:g}=iE(oE,e),_=rv(r,u),v=m.useRef(c);return m.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=$T(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,L.jsx)(Cv.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":mE(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:_,onClick:Lv(t,e=>{p(),d(e=>!e),g&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`SwitchTrigger`)),cE=m.forwardRef($T(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,L.jsx)(aE,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(sE,{...d,ref:t,__scopeSwitch:n}),e&&(0,L.jsx)(fE,{__scopeSwitch:n})]})})},`Switch`)),lE=`SwitchThumb`,uE=m.forwardRef($T(function(e,t){let{__scopeSwitch:n,...r}=e,i=iE(lE,n);return(0,L.jsx)(Cv.span,{"data-state":mE(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),dE=`SwitchBubbleInput`,fE=m.forwardRef($T(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:g}=iE(dE,e),_=rv(r,g),v=wS(i),y=m.useRef(!1),b=m.useRef(s),x=m.useRef(o);m.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});n.call(e,s),e.dispatchEvent(t),y.current=!1}},[h,s,a,o]);let S=m.useRef(s);return(0,L.jsx)(Cv.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:_,onClick:Lv(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function pE(e){return typeof e==`function`}$T(pE,`isFunction`);function mE(e){return e?`checked`:`unchecked`}$T(mE,`getState`);var hE=Object.defineProperty,gE=(e,t)=>hE(e,`name`,{value:t,configurable:!0}),[_E,vE]=Mv(`Tooltip`,[oT]),yE=oT(),bE=`TooltipProvider`,xE=700,SE=`tooltip.open`,[CE,wE]=_E(bE),TE=gE(e=>{let{__scopeTooltip:t,delayDuration:n=xE,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=m.useRef(!0),s=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,L.jsx)(CE,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:m.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:m.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),EE=`Tooltip`,[DE,OE]=_E(EE),kE=gE(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=wE(EE,e.__scopeTooltip),l=yE(t),[u,d]=m.useState(null),[f,p]=m.useState(void 0),h=hy(),g=m.useRef(0),_=o??c.disableHoverableContent,v=s??c.delayDuration,y=m.useRef(!1),[b,x]=Zv({prop:r,defaultProp:i??!1,onChange:gE(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(SE))):c.onClose(),a?.(e)},`onChange`),caller:EE}),S=m.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=m.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,x(!0)},[x]),w=m.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x(!1)},[x]),T=m.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,x(!0),g.current=0},v)},[v,x]);m.useEffect(()=>()=>{g.current&&=(window.clearTimeout(g.current),0)},[]);let E=f??h;return(0,L.jsx)(ST,{...l,children:(0,L.jsx)(DE,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:m.useCallback(()=>{_?w():(window.clearTimeout(g.current),g.current=0)},[w,_]),onOpen:C,onClose:w,disableHoverableContent:_,children:n})})},`Tooltip`),AE=`TooltipTrigger`,jE=m.forwardRef(gE(function(e,t){let{__scopeTooltip:n,...r}=e,i=OE(AE,n),a=wE(AE,n),o=yE(n),s=rv(t,m.useRef(null),i.onTriggerChange),c=m.useRef(!1),l=m.useRef(!1),u=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,L.jsx)(CT,{asChild:!0,...o,children:(0,L.jsx)(Cv.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:Lv(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:Lv(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:Lv(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:Lv(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Lv(e.onBlur,i.onClose),onClick:Lv(e.onClick,i.onClose)})})},`TooltipTrigger`)),ME=`TooltipPortal`,[NE,PE]=_E(ME,{forceMount:void 0}),FE=gE(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=OE(ME,t);return(0,L.jsx)(NE,{scope:t,forceMount:n,children:(0,L.jsx)(ay,{present:n||a.open,children:(0,L.jsx)(Zy,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),IE=`TooltipContent`,LE=m.forwardRef(gE(function(e,t){let n=PE(IE,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=OE(IE,e.__scopeTooltip);return(0,L.jsx)(ay,{present:r||o.open,children:o.disableHoverableContent?(0,L.jsx)(BE,{side:i,...a,ref:t}):(0,L.jsx)(RE,{side:i,...a,ref:t})})},`TooltipContent`)),RE=m.forwardRef(gE(function(e,t){let n=OE(IE,e.__scopeTooltip),r=wE(IE,e.__scopeTooltip),i=m.useRef(null),a=rv(t,i),[o,s]=m.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=m.useCallback(()=>{s(null),d(!1)},[d]),p=m.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=UE(r,HE(r,n.getBoundingClientRect())),a=WE(t.getBoundingClientRect()),o=KE([...i,...a]);s(o),d(!0)},[d]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&u){let e=gE(e=>p(e,u),`handleTriggerLeave`),t=gE(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),m.useEffect(()=>{if(o){let e=gE(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!GE(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,L.jsx)(BE,{...e,ref:a})},`TooltipContentHoverable`)),zE=lv(`TooltipContent`),BE=m.forwardRef(gE(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=OE(IE,n),u=yE(n),{onClose:d}=l;m.useEffect(()=>(document.addEventListener(SE,d),()=>document.removeEventListener(SE,d)),[d]),m.useEffect(()=>{if(l.trigger){let e=gE(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return Hv(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,L.jsx)(Ey,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,L.jsxs)(wT,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,L.jsx)(zE,{children:r}),i?(0,L.jsx)(Ov,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),VE=m.forwardRef(gE(function(e,t){let{__scopeTooltip:n,...r}=e,i=yE(n);return(0,L.jsx)(TT,{...i,...r,ref:t})},`TooltipArrow`));function HE(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}gE(HE,`getExitSideFromRect`);function UE(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}gE(UE,`getPaddedExitPoints`);function WE(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}gE(WE,`getPointsFromRect`);function GE(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}gE(GE,`isPointInPolygon`);function KE(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),qE(t)}gE(KE,`getHull`);function qE(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}gE(qE,`getHullPresorted`);var JE=TE,YE=kE,XE=jE,ZE=FE,QE=LE,$E=VE,eD=Dg(`group/button motion-reduce:transition-none motion-reduce:active:translate-none inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-[0.8125rem] font-medium whitespace-nowrap transition-[transform,background-color,box-shadow,color,border-color,filter] duration-150 active:not-aria-[haspopup]:translate-y-px ease-snap outline-none select-none focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`btn-tint text-primary-foreground [--tint:var(--primary)] disabled:text-muted-foreground`,soft:`btn-raised btn-soft text-foreground`,outline:`btn-raised bg-card text-foreground`,secondary:`btn-raised bg-card text-secondary-foreground`,ghost:`btn-ghost text-foreground`,destructive:`btn-tint text-background [--tint:var(--destructive)] focus-visible:outline-destructive disabled:text-muted-foreground`,link:`text-link underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-3`,xs:`h-7 gap-1 px-2.5 text-xs [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1.5 px-2.5 text-xs [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-2 px-4`,icon:`size-8`,"icon-xs":`size-7 [&_svg:not([class*='size-'])]:size-3.5`,"icon-sm":`size-7`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function J({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?sv:`button`;return(0,L.jsx)(a,{"aria-keyshortcuts":r?void 0:`Enter Space`,"aria-description":r?`When focused, press Enter to activate.`:`When focused, press Enter or Space to activate.`,"aria-describedby":`focused-action-help`,"data-slot":`button`,"data-variant":t,"data-size":n,className:q(eD({variant:t,size:n,className:e})),...i})}var tD=q(`pointer-events-none inline-flex h-[1.125rem] min-w-[1.125rem] w-fit items-center justify-center gap-1 rounded-[5px] border border-border bg-background px-1 font-sans text-[0.7rem] leading-none font-medium text-muted-foreground shadow-[inset_0_-1px_0_var(--border)] select-none`,`in-data-[slot=tooltip-content]:border-background/25 in-data-[slot=tooltip-content]:bg-transparent in-data-[slot=tooltip-content]:text-background in-data-[slot=tooltip-content]:shadow-none`,`in-data-[variant=default]:border-primary-foreground/35 in-data-[variant=default]:bg-primary-foreground/10 in-data-[variant=default]:text-primary-foreground in-data-[variant=default]:shadow-none`,`in-data-[variant=destructive]:border-background/40 in-data-[variant=destructive]:bg-background/10 in-data-[variant=destructive]:text-background in-data-[variant=destructive]:shadow-none`,`[&_svg:not([class*='size-'])]:size-3`);function nD({className:e,...t}){return(0,L.jsx)(`kbd`,{"data-slot":`kbd`,className:q(tD,e),...t})}function rD({className:e,...t}){return(0,L.jsx)(`kbd`,{"data-slot":`kbd-group`,className:q(`inline-flex items-center gap-0.5`,e),...t})}var iD=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),aD={alt:`⌥`,ctrl:`⌃`,shift:`⇧`,meta:`⌘`,cmd:`⌘`},oD={enter:`↵`,esc:`Esc`,escape:`Esc`,arrowleft:`←`,arrowright:`→`,arrowup:`↑`,arrowdown:`↓`,space:`Space`,delete:`Del`,backspace:`⌫`};function sD(e){return e.split(`+`).map(e=>{let t=e.toLowerCase();return iD&&aD[t]?aD[t]:oD[t]??(e.length===1?e.toUpperCase():e[0].toUpperCase()+e.slice(1))})}function cD({chord:e,className:t}){let n=sD(e);return(0,L.jsx)(rD,{className:t,children:n.map((e,t)=>(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[t>0?(0,L.jsx)(`span`,{className:`sr-only`,children:`plus`}):null,(0,L.jsx)(nD,{children:e})]},t))})}function lD({chord:e,children:t,className:n}){return(0,L.jsxs)(`span`,{className:q(`kbd-hint inline-flex shrink-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,n),children:[(0,L.jsx)(cD,{chord:e}),t]})}function uD({open:e,onOpenChange:t,label:n,description:r,dismissOnBackdrop:i=!0,className:a,style:o,onCloseAutoFocus:s,children:c}){let l=Jd();return(0,L.jsx)(kx,{open:e,onOpenChange:t,children:(0,L.jsx)(tu,{children:e?(0,L.jsxs)(Fx,{forceMount:!0,children:[(0,L.jsx)(Lx,{asChild:!0,forceMount:!0,children:(0,L.jsx)(z.div,{className:`fixed inset-0 z-50 bg-scrim backdrop-blur-sm`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:`easeOut`}})}),(0,L.jsx)(`div`,{className:`pointer-events-none fixed inset-0 z-50 grid place-items-center p-4`,children:(0,L.jsx)(Vx,{asChild:!0,forceMount:!0,onCloseAutoFocus:s,onInteractOutside:e=>{i||e.preventDefault()},onOpenAutoFocus:e=>{let t=e.currentTarget?.querySelector(`[data-nav], [data-autofocus], textarea`);t&&(e.preventDefault(),t.focus())},...r?{}:{"aria-describedby":void 0},children:(0,L.jsxs)(z.div,{className:q(`glass-pop pointer-events-auto flex max-h-[min(86svh,48rem)] w-full max-w-2xl flex-col overflow-hidden rounded-xl outline-none`,a),style:o,initial:{opacity:0,scale:l?1:.92,y:l?0:18},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:l?1:.96,y:l?0:8,transition:{duration:.12,ease:`easeIn`}},transition:{type:`spring`,stiffness:460,damping:32,mass:.9},children:[(0,L.jsx)(Kx,{className:`sr-only`,children:n}),r?(0,L.jsx)(Jx,{className:`sr-only`,children:r}):null,c]})})})]}):null})})}var dD=[],fD=0,pD=new Set;function mD(){for(let e of[...pD])e()}function hD(e){return pD.add(e),()=>{pD.delete(e)}}function gD(){let e;for(let t of dD)(!e||t.priority>e.priority||t.priority===e.priority&&t.order<e.order)&&(e=t);return e?.id}var _D={question:30,confirm:20,help:10,sheet:5};function vD(e,t){let n=(0,m.useId)();(0,m.useEffect)(()=>{if(e)return dD=[...dD,{id:n,priority:t,order:++fD}],mD(),()=>{dD=dD.filter(e=>e.id!==n),mD()}},[e,t,n]);let r=(0,m.useSyncExternalStore)(hD,gD,()=>void 0);return e&&r===n}function yD(){return dD.length>0}function bD(){return(0,m.useSyncExternalStore)(hD,()=>dD.length>0,()=>!1)}var xD=[`lobby`,`tasks`,`plan`,`quickfix`,`issues`,`excalidraw`,`git`,`knowledge`,`metrics`],SD=`already answered in another window`,CD=`Attached files:`,wD=new Set(xD);function TD(e){let t=e.replace(/^#\/?/,``).split(`/`).filter(Boolean),n=t[0];if(!n||n===`lobby`)return{kind:`tab`,tab:`lobby`,rest:t.slice(1)};if(n===`settings`)return{kind:`settings`};if(n===`sessions`)return{kind:`sessions`,...t[1]?{key:t[1]}:{}};if(wD.has(n))return{kind:`tab`,tab:n,rest:t.slice(1)}}function ED(e,...t){return`#/${e}${t.filter(Boolean).map(e=>`/${encodeURIComponent(e)}`).join(``)}`}function DD(e){window.location.hash!==e&&(window.location.hash=e)}function OD(){let[e,t]=(0,m.useState)(()=>TD(window.location.hash)??{kind:`tab`,tab:`lobby`,rest:[]});return(0,m.useEffect)(()=>{let e=()=>{let e=TD(window.location.hash);e?t(e):(window.history.replaceState(null,``,`#/lobby`),t({kind:`tab`,tab:`lobby`,rest:[]}))};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),e}function kD({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`empty`,className:q(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 p-6 text-center text-balance`,e),...t})}function AD({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`empty-header`,className:q(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var jD=Dg(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-muted text-muted-foreground [&_svg:not([class*='size-'])]:size-5`}},defaultVariants:{variant:`default`}});function MD({className:e,variant:t=`default`,...n}){return(0,L.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:q(jD({variant:t,className:e})),...n})}function ND({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`empty-title`,className:q(`text-sm font-medium tracking-tight`,e),...t})}function PD({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`empty-description`,className:q(`text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function FD({className:e,...t}){return(0,L.jsx)(`span`,{"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:q(`inline-flex size-4 shrink-0 items-end justify-between text-primary`,e),...t,children:[0,1,2].map(e=>(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`block aspect-square h-[28%] shrink-0 rounded-full bg-current motion-safe:animate-[hop_0.9s_ease-in-out_infinite]`,style:{animationDelay:`${e*.14}s`}},e))})}function ID({label:e=`Connecting…`}){return(0,L.jsxs)(`div`,{className:`flex min-h-48 flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(FD,{}),(0,L.jsx)(`span`,{children:e})]})}function LD({message:e,onRetry:t}){return(0,L.jsxs)(kD,{className:`m-4 flex-1`,children:[(0,L.jsxs)(AD,{children:[(0,L.jsxs)(ND,{className:`flex items-center gap-2`,children:[(0,L.jsx)(og,{className:`size-4 text-destructive`,"aria-hidden":`true`}),`Could not load this view`]}),(0,L.jsx)(PD,{children:e??`The request failed. Try again.`})]}),t?(0,L.jsxs)(J,{variant:`outline`,onClick:t,children:[(0,L.jsx)(Mh,{"aria-hidden":`true`}),`Try again`]}):null]})}function RD({onRetry:e}){return(0,L.jsxs)(`div`,{role:`status`,className:`mx-3 mb-1 flex items-center gap-2 rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive max-sm:mx-2`,children:[(0,L.jsx)(vg,{className:`size-4`,"aria-hidden":`true`}),(0,L.jsx)(`span`,{children:`Connection lost — retrying every 2 s.`}),e?(0,L.jsx)(J,{variant:`link`,className:`h-8 px-1 text-destructive`,onClick:e,children:`Retry now`}):null]})}function zD(){let[e,t]=(0,m.useReducer)(e=>e+1,0);return(0,m.useEffect)(()=>kf.subscribe(t),[]),e}function BD(){return zD(),kf.status()}function VD(e){return zD(),kf.get(e)}function HD(e){let t=(0,m.useCallback)(t=>{let n=window.matchMedia(e);return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},[e]),n=(0,m.useCallback)(()=>window.matchMedia(e).matches,[e]);return(0,m.useSyncExternalStore)(t,n)}function UD(e,t,n,r=!0){zD();let[i,a]=(0,m.useState)({loading:!0,at:0}),[o,s]=(0,m.useState)(0),c=[kf.status().connection,...n.map(e=>kf.get(e).version)].join(`,`),l=JSON.stringify(t);(0,m.useEffect)(()=>{if(!r)return;let t=!0,n=performance.now();return a(e=>({...e,loading:!0})),qf(e,JSON.parse(l)).then(e=>t&&a({data:e,loading:!1,at:n}),e=>t&&a(t=>({...t,error:e instanceof Error?e.message:String(e),loading:!1}))),()=>{t=!1}},[e,l,c,o,r]);let u=(0,m.useCallback)(()=>s(e=>e+1),[]);return{data:i.data,error:i.error,loading:i.loading,requestedAt:i.at,reload:u}}function WD({delayDuration:e=400,...t}){return(0,L.jsx)(JE,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function GD({...e}){return(0,L.jsx)(YE,{"data-slot":`tooltip`,...e})}function KD({...e}){return(0,L.jsx)(XE,{"data-slot":`tooltip-trigger`,...e})}function qD({className:e,sideOffset:t=6,children:n,...r}){return(0,L.jsx)(ZE,{children:(0,L.jsxs)(QE,{"data-slot":`tooltip-content`,sideOffset:t,className:q(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-lg data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[n,(0,L.jsx)($E,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}function JD(e){return[...e.querySelectorAll(`[data-nav]`)].filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`)}function YD(e,t,n){let r=JD(e);if(r.length===0)return!1;let i=t?r.findIndex(e=>e===t||e.contains(t)):-1,a=r[n===`first`?0:n===`last`?r.length-1:Math.max(0,Math.min(r.length-1,(i<0?n>0?-1:r.length:i)+n))];return!a||a===t?!1:(a.focus({preventScroll:!1}),!0)}function XD(e){return e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&![`checkbox`,`radio`,`button`].includes(e.type)||e instanceof HTMLElement&&e.isContentEditable}function ZD(e,t=!0){return e===`ArrowDown`||t&&e===`j`?1:e===`ArrowUp`||t&&e===`k`?-1:0}function QD(e,t=!0){return e===`ArrowRight`||t&&e===`l`?1:e===`ArrowLeft`||t&&e===`h`?-1:0}var $D=`button:not([disabled]), a[href], [role='button']:not([aria-disabled='true'])`;function eO(e){return[...e.querySelectorAll($D)].filter(e=>e.offsetParent!==null)}function tO(e,t,n){let r=eO(e);if(r.length===0)return;let i=t?r.findIndex(e=>e===t||e.contains(t)):-1;r[n===`first`?0:n===`last`?r.length-1:Math.max(0,Math.min(r.length-1,(i<0?n>0?-1:r.length:i)+n))]?.focus()}function nO(e,t=document.querySelector(`[data-pane='list']`)){if(!t)return;let n=[...t.querySelectorAll(`button[data-row]`)].filter(e=>e.offsetParent!==null),r=n.findIndex(e=>e.getAttribute(`aria-current`)===`true`),i=Math.max(0,Math.min(n.length-1,r<0?e>0?0:n.length-1:r+e));n[i]?.click(),n[i]?.focus({preventScroll:!0}),n[i]?.scrollIntoView({block:`nearest`})}function rO(e){return e.querySelector(`[aria-current='true']`)??eO(e)[0]}function iO(){let e=document.getElementById(`main`);if(!e)return!1;let t=e.querySelector(`[data-pane='list']`);return((t?rO(t):void 0)??eO(e)[0]??e).focus(),!0}function aO(){let e=document.querySelector(`[role='tab'][aria-selected='true']`);if(e)return e.focus({preventScroll:!0}),!0;let t=document.getElementById(`main`);return t?.focus({preventScroll:!0}),!!t}var oO={active:!1},sO=new Set([`g`,`j`,`k`,`h`,`l`,`d`,`p`,`/`,`?`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`]);function cO(e){if(!e)return!1;let t=e.toLowerCase();return t===`delete`||/^[a-z]$/.test(t)&&!sO.has(t)}function lO(e,t){return t.toLowerCase()===`delete`?e.key===`Delete`||e.key===`Backspace`:e.key.toLowerCase()===t.toLowerCase()}function uO(){return yD()||!!document.querySelector(`[role='dialog'], [role='alertdialog'], [role='menu'], [role='listbox']`)}function dO(e,t,{enabled:n=!0,inDialog:r=!1}={}){let i=(0,m.useRef)(t);i.current=t,(0,m.useEffect)(()=>{if(!n||!e)return;let t=t=>{t.defaultPrevented||t.isComposing||t.repeat||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||lO(t,e)&&(XD(t.target)||(r||!uO())&&(t.preventDefault(),i.current()))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n,r])}var fO={neutral:`text-foreground`,primary:``,danger:`text-destructive hover:text-destructive`};function Y({label:e,icon:t,tone:n=`neutral`,shortcut:r,href:i,pressed:a,text:o,iconOnly:s,className:c,disabled:l,...u}){let d=(0,m.useRef)(null),f=cO(r);dO(f?r:void 0,()=>d.current?.click(),{enabled:f&&!l});let p=(0,L.jsx)(t,{"aria-hidden":`true`}),h=n===`primary`?`default`:s?`ghost`:`outline`,g=q(!s&&`px-2.5`,fO[n],c),_=s?`icon`:`default`,v=s?p:(0,L.jsxs)(L.Fragment,{children:[p,(0,L.jsx)(`span`,{children:o??e}),r?(0,L.jsx)(cD,{chord:r,className:`kbd-hint ml-1`}):null]}),y=i?(0,L.jsx)(J,{asChild:!0,ref:d,variant:h,size:_,"data-tone":n,className:g,children:(0,L.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer noopener`,"aria-label":e,"aria-keyshortcuts":f?r:void 0,children:v})}):(0,L.jsx)(J,{ref:d,type:`button`,variant:h,size:_,"data-tone":n,"aria-label":e,"aria-pressed":a,"aria-keyshortcuts":f?r:void 0,disabled:l,className:g,...u,children:v});return s?(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:y}),(0,L.jsxs)(qD,{children:[e,(0,L.jsx)(cD,{chord:r??(i?`Enter`:`Enter / Space`)})]})]}):y}function pO({children:e,className:t}){function n(e){let t=e.key===`ArrowRight`?1:e.key===`ArrowLeft`?-1:0;if(!t)return;let n=[...e.currentTarget.querySelectorAll(`button:not([disabled]), a[href]`)],r=n.indexOf(e.target);r<0||(e.preventDefault(),e.stopPropagation(),n[Math.max(0,Math.min(n.length-1,r+t))]?.focus())}return(0,L.jsx)(`div`,{role:`toolbar`,"aria-label":`Actions`,onKeyDown:n,className:q(`sticky -top-5 z-10 -mx-5 -mt-5 flex min-h-12 flex-wrap items-center gap-1 border-b border-border bg-card/90 px-4 py-2 backdrop-blur-sm [&>[data-tone=danger]:not(:first-child)]:ml-auto`,t),children:e})}function mO({...e}){return(0,L.jsx)(kx,{"data-slot":`sheet`,...e})}function hO({...e}){return(0,L.jsx)(Xx,{"data-slot":`sheet-close`,...e})}function gO({...e}){return(0,L.jsx)(Fx,{"data-slot":`sheet-portal`,...e})}function _O({className:e,...t}){return(0,L.jsx)(Lx,{"data-slot":`sheet-overlay`,className:q(`fixed inset-0 z-50 bg-scrim backdrop-blur-sm duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function vO({className:e,children:t,side:n=`right`,showCloseButton:r=!0,forceMount:i,hidden:a,...o}){return(0,L.jsxs)(gO,{forceMount:i,children:[a?null:(0,L.jsx)(_O,{}),(0,L.jsxs)(Vx,{forceMount:i,hidden:a,"data-slot":`sheet-content`,"data-side":n,className:q(`glass-pop fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm transition duration-200 ease-in-out data-[side=right]:rounded-l-xl data-[side=left]:rounded-r-xl data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10`,e),...o,children:[t,r&&(0,L.jsx)(Xx,{"data-slot":`sheet-close`,asChild:!0,children:(0,L.jsxs)(J,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,L.jsx)(bg,{}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function yO({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`sheet-header`,className:q(`flex flex-col gap-0.5 p-4`,e),...t})}function bO({className:e,...t}){return(0,L.jsx)(Kx,{"data-slot":`sheet-title`,className:q(`text-base font-medium text-foreground`,e),...t})}function xO({className:e,...t}){return(0,L.jsx)(Jx,{"data-slot":`sheet-description`,className:q(`text-sm text-muted-foreground`,e),...t})}function SO(){return HD(`(min-width: 1024px)`)}function CO({className:e,...t}){return(0,L.jsx)(`section`,{className:q(`min-h-0 min-w-0`,e),...t})}function wO({open:e,onClose:t,describe:n,children:r}){let i=vD(e,_D.sheet),a=(0,m.useRef)(!1);return i&&(a.current=!0),e||(a.current=!1),(0,L.jsx)(mO,{open:e&&i,onOpenChange:e=>!e&&t(),children:(0,L.jsxs)(vO,{forceMount:e&&a.current?!0:void 0,hidden:!i,showCloseButton:!1,className:q(`gap-0 data-[side=right]:w-[92%] data-[side=right]:sm:max-w-3xl`,!i&&`!hidden`),children:[(0,L.jsxs)(yO,{className:`flex-row items-center justify-between border-b px-4 py-2`,children:[(0,L.jsx)(bO,{className:`text-sm`,children:`Detail`}),(0,L.jsx)(xO,{className:`sr-only`,children:n}),(0,L.jsx)(hO,{asChild:!0,children:(0,L.jsxs)(J,{variant:`ghost`,size:`sm`,"aria-label":`Close detail`,title:`Close · Esc`,className:`gap-2`,children:[(0,L.jsx)(bg,{"aria-hidden":`true`}),`Close`,(0,L.jsx)(cD,{chord:`Esc`,className:`kbd-hint`})]})})]}),(0,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:r})]})})}function TO({wide:e,list:t,detail:n,open:r,onClose:i,hint:a,describe:o}){let s=(0,m.useRef)(null),c=(0,m.useRef)(null);function l(t){let n=s.current;if(!n||t.defaultPrevented||t.nativeEvent.isComposing||yD()||t.altKey||t.ctrlKey||t.metaKey||XD(t.target)||t.target instanceof HTMLInputElement)return;let r=ZD(t.key,!1);r?(t.preventDefault(),tO(n,t.target,r)):t.key===`Home`||t.key===`End`?(t.preventDefault(),tO(n,t.target,t.key===`Home`?`first`:`last`)):e&&QD(t.key)===1&&c.current&&(t.preventDefault(),c.current.focus())}function u(e){e.defaultPrevented||e.nativeEvent.isComposing||yD()||e.altKey||e.ctrlKey||e.metaKey||XD(e.target)||QD(e.key)===-1&&s.current&&(e.preventDefault(),rO(s.current)?.focus())}return e?(0,L.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[clamp(17rem,28%,23rem)_minmax(0,1fr)]`,children:[(0,L.jsx)(CO,{"data-pane":`list`,ref:s,onKeyDown:l,className:`overflow-y-auto border-r border-border pb-dock`,children:t}),(0,L.jsx)(CO,{"data-pane":`detail`,ref:c,tabIndex:0,"aria-label":`Detail`,onKeyDown:u,className:`overflow-y-auto px-5 pt-5 pb-dock outline-none focus-visible:bg-muted/30`,children:n??(0,L.jsx)(`div`,{className:`grid h-full min-h-48 place-items-center`,children:(0,L.jsxs)(`div`,{className:`flex max-w-xs flex-col items-center gap-3 text-center`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground`,children:(0,L.jsx)(uh,{className:`size-5`})}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a}),(0,L.jsxs)(`p`,{className:`kbd-hint flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,L.jsx)(cD,{chord:`ArrowUp`}),(0,L.jsx)(cD,{chord:`ArrowDown`}),`move`]}),(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,L.jsx)(cD,{chord:`ArrowRight`}),`open`]})]})]})})})]}):(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto pb-dock`,children:[(0,L.jsx)(CO,{"data-pane":`list`,ref:s,onKeyDown:l,children:t}),(0,L.jsx)(wO,{open:r&&n!==null,onClose:i,describe:o,children:n})]})}function EO({title:e,count:t,children:n}){return(0,L.jsxs)(`div`,{className:`sticky top-0 z-10 flex min-h-12 flex-wrap items-center gap-x-3 gap-y-1 border-b border-border bg-card/90 px-4 py-2 backdrop-blur-sm`,children:[(0,L.jsx)(`h2`,{className:`text-sm font-medium`,children:e}),(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-2 flex-1`}),t?(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t}):null,n?(0,L.jsx)(`div`,{className:`flex items-center gap-1.5`,children:n}):null]})}function DO(){return(0,L.jsx)(`div`,{className:`flex flex-col gap-1.5 p-3`,role:`status`,"aria-label":`Loading`,children:[0,1,2,3].map(e=>(0,L.jsx)(`div`,{className:`h-11 rounded-lg bg-muted motion-safe:animate-pulse`},e))})}function OO({className:e,...t}){return(0,L.jsx)(`textarea`,{"data-slot":`textarea`,className:q(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-background px-3.5 py-2.5 text-base transition-[border-color,box-shadow] duration-150 outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:disabled:bg-input/80`,e),...t})}function kO(e){return e<10?`0${e}`:String(e)}function AO(e){if(!Number.isFinite(e))return`0`;let t=new Date(e);return`${kO(t.getHours())}:${kO(t.getMinutes())}`}function jO(e){if(!Number.isFinite(e)||e<0)return`0s`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m`:`${Math.floor(n/60)}h ${kO(n%60)}m`}function MO(e){if(!Number.isFinite(e)||e<5e3)return`now`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<48?`${r}h`:`${Math.floor(r/24)}d`}function NO(e){let t=MO(e);return t===`now`?`just now`:`${t} ago`}function PO({...e}){return(0,L.jsx)(mS,{"data-slot":`alert-dialog`,...e})}function FO({...e}){return(0,L.jsx)(hS,{"data-slot":`alert-dialog-portal`,...e})}function IO({className:e,...t}){return(0,L.jsx)(gS,{"data-slot":`alert-dialog-overlay`,className:q(`fixed inset-0 z-50 bg-scrim backdrop-blur-sm duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function LO({className:e,...t}){return(0,L.jsxs)(FO,{children:[(0,L.jsx)(IO,{}),(0,L.jsx)(_S,{"data-slot":`alert-dialog-content`,className:q(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 glass-pop rounded-xl p-5 text-sm duration-150 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...t})]})}function RO({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:q(`flex flex-col gap-1.5`,e),...t})}function zO({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:q(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function BO({className:e,...t}){return(0,L.jsx)(bS,{"data-slot":`alert-dialog-title`,className:q(`text-base font-medium text-foreground`,e),...t})}function VO({className:e,...t}){return(0,L.jsx)(xS,{"data-slot":`alert-dialog-description`,className:q(`text-sm text-muted-foreground`,e),...t})}function HO({className:e,variant:t=`default`,...n}){return(0,L.jsx)(J,{variant:t,size:`sm`,className:q(`h-7 gap-1 px-2.5`,e),asChild:!0,children:(0,L.jsx)(vS,{"data-slot":`alert-dialog-action`,...n})})}function UO({className:e,...t}){return(0,L.jsx)(J,{variant:`outline`,size:`sm`,className:q(`h-7 gap-1 px-2.5`,e),asChild:!0,children:(0,L.jsx)(yS,{"data-slot":`alert-dialog-cancel`,...t})})}function WO({label:e,text:t,shortcut:n,title:r,description:i,confirmLabel:a,onConfirm:o,icon:s,disabled:c,variant:l=`outline`,iconOnly:u,compact:d}){let[f,p]=(0,m.useState)(!1),h=vD(f,_D.confirm),g=l===`destructive`;return dO(`y`,()=>{p(!1),o()},{enabled:f&&h,inDialog:!0}),(0,L.jsxs)(PO,{open:f&&h,onOpenChange:p,children:[(0,L.jsx)(Y,{label:e,icon:s,tone:g?`danger`:`neutral`,disabled:c,shortcut:n,iconOnly:u,...d?{"data-compact":!0,className:`size-8`}:{},...t?{text:t}:{},onClick:()=>p(!0)}),(0,L.jsxs)(LO,{children:[(0,L.jsxs)(RO,{children:[(0,L.jsx)(BO,{children:r}),(0,L.jsx)(VO,{children:i})]}),(0,L.jsxs)(zO,{children:[(0,L.jsxs)(UO,{children:[`Keep it`,(0,L.jsx)(cD,{chord:`Esc`,className:`kbd-hint ml-1`})]}),(0,L.jsxs)(HO,{variant:g?`destructive`:`default`,onClick:o,children:[a,(0,L.jsx)(cD,{chord:`Y`,className:`kbd-hint ml-1`})]})]})]})]})}function GO(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var KO=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qO=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JO={};function YO(e,t){return((t||JO).jsx?qO:KO).test(e)}var XO=/[ \t\n\f\r]/g;function ZO(e){return typeof e==`object`?e.type===`text`&&QO(e.value):QO(e)}function QO(e){return e.replace(XO,``)===``}var $O=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};$O.prototype.normal={},$O.prototype.property={},$O.prototype.space=void 0;function ek(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new $O(n,r,t)}function tk(e){return e.toLowerCase()}var nk=class{constructor(e,t){this.attribute=t,this.property=e}};nk.prototype.attribute=``,nk.prototype.booleanish=!1,nk.prototype.boolean=!1,nk.prototype.commaOrSpaceSeparated=!1,nk.prototype.commaSeparated=!1,nk.prototype.defined=!1,nk.prototype.mustUseProperty=!1,nk.prototype.number=!1,nk.prototype.overloadedBoolean=!1,nk.prototype.property=``,nk.prototype.spaceSeparated=!1,nk.prototype.space=void 0;var rk=s({boolean:()=>X,booleanish:()=>ak,commaOrSpaceSeparated:()=>lk,commaSeparated:()=>ck,number:()=>Z,overloadedBoolean:()=>ok,spaceSeparated:()=>sk}),ik=0,X=uk(),ak=uk(),ok=uk(),Z=uk(),sk=uk(),ck=uk(),lk=uk();function uk(){return 2**++ik}var dk=Object.keys(rk),fk=class extends nk{constructor(e,t,n,r){let i=-1;if(super(e,t),pk(this,`space`,r),typeof n==`number`)for(;++i<dk.length;){let e=dk[i];pk(this,dk[i],(n&rk[e])===rk[e])}}};fk.prototype.defined=!0;function pk(e,t,n){n&&(e[t]=n)}function mk(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new fk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[tk(r)]=r,n[tk(a.attribute)]=r}return new $O(t,n,e.space)}var hk=mk({properties:{ariaActiveDescendant:null,ariaAtomic:ak,ariaAutoComplete:null,ariaBusy:ak,ariaChecked:ak,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:sk,ariaCurrent:null,ariaDescribedBy:sk,ariaDetails:null,ariaDisabled:ak,ariaDropEffect:sk,ariaErrorMessage:null,ariaExpanded:ak,ariaFlowTo:sk,ariaGrabbed:ak,ariaHasPopup:null,ariaHidden:ak,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:sk,ariaLevel:Z,ariaLive:null,ariaModal:ak,ariaMultiLine:ak,ariaMultiSelectable:ak,ariaOrientation:null,ariaOwns:sk,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:ak,ariaReadOnly:ak,ariaRelevant:null,ariaRequired:ak,ariaRoleDescription:sk,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:ak,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function gk(e,t){return t in e?e[t]:t}function _k(e,t){return gk(e,t.toLowerCase())}var vk=mk({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:ck,acceptCharset:sk,accessKey:sk,action:null,allow:null,allowFullScreen:X,allowPaymentRequest:X,allowUserMedia:X,alpha:X,alt:null,as:null,async:X,autoCapitalize:null,autoComplete:sk,autoFocus:X,autoPlay:X,blocking:sk,capture:null,charSet:null,checked:X,cite:null,className:sk,closedBy:null,colorSpace:null,cols:Z,colSpan:Z,command:null,commandFor:null,content:null,contentEditable:ak,controls:X,controlsList:sk,coords:Z|ck,crossOrigin:null,data:null,dateTime:null,decoding:null,default:X,defer:X,dir:null,dirName:null,disabled:X,download:ok,draggable:ak,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:X,formTarget:null,headers:sk,height:Z,hidden:ok,high:Z,href:null,hrefLang:null,htmlFor:sk,httpEquiv:sk,id:null,imageSizes:null,imageSrcSet:null,inert:X,inputMode:null,integrity:null,is:null,isMap:X,itemId:null,itemProp:sk,itemRef:sk,itemScope:X,itemType:sk,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:X,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:X,muted:X,name:null,nonce:null,noModule:X,noValidate:X,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:X,optimum:Z,pattern:null,ping:sk,placeholder:null,playsInline:X,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:X,referrerPolicy:null,rel:sk,required:X,reversed:X,rows:Z,rowSpan:Z,sandbox:sk,scope:null,scoped:X,seamless:X,selected:X,shadowRootClonable:X,shadowRootCustomElementRegistry:X,shadowRootDelegatesFocus:X,shadowRootMode:null,shadowRootSerializable:X,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:ak,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:X,useMap:null,value:ak,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:sk,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:X,declare:X,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:X,noHref:X,noShade:X,noWrap:X,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:ak,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:X,disablePictureInPicture:X,disableRemotePlayback:X,exportParts:ck,part:sk,prefix:null,property:null,results:Z,security:null,unselectable:null},space:`html`,transform:_k}),yk=mk({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,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`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,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`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,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`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:lk,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:sk,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:X,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ck,g2:ck,glyphName:ck,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:lk,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:sk,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:lk,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:lk,rev:lk,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:lk,requiredFeatures:lk,requiredFonts:lk,requiredFormats:lk,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:lk,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:lk,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:lk,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:gk}),bk=mk({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),xk=mk({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:_k}),Sk=mk({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ck={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},wk=/[A-Z]/g,Tk=/-[a-z]/g,Ek=/^data[-\w.:]+$/i;function Dk(e,t){let n=tk(t),r=t,i=nk;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Ek.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Tk,kk);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Tk.test(e)){let n=e.replace(wk,Ok);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=fk}return new i(r,t)}function Ok(e){return`-`+e.toLowerCase()}function kk(e){return e.charAt(1).toUpperCase()}var Ak=ek([hk,vk,bk,xk,Sk],`html`),jk=ek([hk,yk,bk,xk,Sk],`svg`);function Mk(e){return e.join(` `).trim()}var Nk=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
59
59
|
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),Pk=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(Nk());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),Fk=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Ik=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Pk()),r=Fk();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),Lk=zk(`end`),Rk=zk(`start`);function zk(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Bk(e){let t=Rk(e),n=Lk(e);if(t&&n)return{start:t,end:n}}function Vk(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Uk(e.position):`start`in e||`end`in e?Uk(e):`line`in e||`column`in e?Hk(e):``}function Hk(e){return Wk(e&&e.line)+`:`+Wk(e&&e.column)}function Uk(e){return Hk(e&&e.start)+`-`+Hk(e&&e.end)}function Wk(e){return e&&typeof e==`number`?e:1}var Gk=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Vk(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Gk.prototype.file=``,Gk.prototype.name=``,Gk.prototype.reason=``,Gk.prototype.message=``,Gk.prototype.stack=``,Gk.prototype.column=void 0,Gk.prototype.line=void 0,Gk.prototype.ancestors=void 0,Gk.prototype.cause=void 0,Gk.prototype.fatal=void 0,Gk.prototype.place=void 0,Gk.prototype.ruleId=void 0,Gk.prototype.source=void 0;var Kk=l(Ik(),1),qk={}.hasOwnProperty,Jk=new Map,Yk=/[A-Z]/g,Xk=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Zk=new Set([`td`,`th`]),Qk=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function $k(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=uA(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=lA(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?jk:Ak,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=eA(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function eA(e,t,n){if(t.type===`element`)return tA(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return nA(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return iA(e,t,n);if(t.type===`mdxjsEsm`)return rA(e,t);if(t.type===`root`)return aA(e,t,n);if(t.type===`text`)return oA(e,t)}function tA(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=jk,e.schema=i),e.ancestors.push(t);let a=gA(e,t.tagName,!1),o=dA(e,t),s=pA(e,t);return Xk.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!ZO(e)})),sA(e,o,a,t),cA(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function nA(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}_A(e,t.position)}function rA(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);_A(e,t.position)}function iA(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=jk,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:gA(e,t.name,!0),o=fA(e,t),s=pA(e,t);return sA(e,o,a,t),cA(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function aA(e,t,n){let r={};return cA(r,pA(e,t)),e.create(t,e.Fragment,r,n)}function oA(e,t){return t.value}function sA(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function cA(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function lA(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function uA(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Rk(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function dA(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&qk.call(t.properties,i)){let a=mA(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Zk.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function fA(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else _A(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else _A(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function pA(e,t){let n=[],r=-1,i=e.passKeys?new Map:Jk;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=eA(e,a,o);s!==void 0&&n.push(s)}return n}function mA(e,t,n){let r=Dk(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?GO(n):Mk(n)),r.property===`style`){let t=typeof n==`object`?n:hA(e,String(n));return e.stylePropertyNameCase===`css`&&(t=vA(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Ck[r.property]||r.property:r.attribute,n]}}function hA(e,t){try{return(0,Kk.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Gk("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Qk+`#cannot-parse-style-attribute`,r}}function gA(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=YO(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=YO(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return qk.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);_A(e)}function _A(e,t){let n=new Gk("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Qk+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function vA(e){let t={},n;for(n in e)qk.call(e,n)&&(t[yA(n)]=e[n]);return t}function yA(e){let t=e.replace(Yk,bA);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function bA(e){return`-`+e.toLowerCase()}var xA={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},SA={};function CA(e,t){let n=t||SA;return wA(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function wA(e,t,n){if(EA(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return TA(e.children,t,n)}return Array.isArray(e)?TA(e,t,n):``}function TA(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=wA(e[i],t,n);return r.join(``)}function EA(e){return!!(e&&typeof e==`object`)}var DA=document.createElement(`i`);function OA(e){let t=`&`+e+`;`;DA.innerHTML=t;let n=DA.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function kA(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function AA(e,t){return e.length>0?(kA(e,e.length,0,t),e):t}var jA={}.hasOwnProperty;function MA(e){let t={},n=-1;for(;++n<e.length;)NA(t,e[n]);return t}function NA(e,t){let n;for(n in t){let r=(jA.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){jA.call(r,a)||(r[a]=[]);let e=i[a];PA(r[a],Array.isArray(e)?e:e?[e]:[])}}}function PA(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);kA(e,0,0,r)}function FA(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function IA(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var LA=qA(/[A-Za-z]/),RA=qA(/[\dA-Za-z]/),zA=qA(/[#-'*+\--9=?A-Z^-~]/);function BA(e){return e!==null&&(e<32||e===127)}var VA=qA(/\d/),HA=qA(/[\dA-Fa-f]/),UA=qA(/[!-/:-@[-`{-~]/);function Q(e){return e!==null&&e<-2}function WA(e){return e!==null&&(e<0||e===32)}function $(e){return e===-2||e===-1||e===32}var GA=qA(/\p{P}|\p{S}/u),KA=qA(/\s/);function qA(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function JA(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&RA(e.charCodeAt(n+1))&&RA(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function YA(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return $(r)?(e.enter(n),s(r)):t(r)}function s(r){return $(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function XA(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&$(t)?(e.enter(r),c(t)):l(t)}function c(t){return $(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var ZA={tokenize:QA};function QA(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),YA(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Q(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var $A=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){ej(this,e,t,n,!1)}addBefore(e,t,n){ej(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function ej(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var tj={tokenize:rj},nj={tokenize:ij};function rj(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new $A;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(nj,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(nj,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Q(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new $A;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ij(e,t,n){return YA(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function aj(e){if(e===null||WA(e)||KA(e))return 1;if(GA(e))return 2}function oj(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var sj={name:`attention`,resolveAll:cj,tokenize:lj};function cj(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};uj(o,-a),uj(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=AA(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=AA(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=AA(r,oj(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=AA(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=AA(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),kA(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function lj(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=aj(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=aj(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function uj(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var dj={name:`autolink`,tokenize:fj};function fj(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return LA(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||RA(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||RA(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||BA(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):zA(t)?(e.consume(t),l):n(t)}function u(e){return RA(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||RA(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var pj={partial:!0,tokenize:mj};function mj(e,t,n){return r;function r(t){return $(t)?YA(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Q(e)?t(e):n(e)}}var hj={continuation:{tokenize:_j},exit:vj,name:`blockQuote`,tokenize:gj};function gj(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return $(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function _j(e,t,n){let r=this;return i;function i(t){return $(t)?YA(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(hj,t,n)(r)}}function vj(e){e.exit(`blockQuote`)}var yj={name:`characterEscape`,tokenize:bj};function bj(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return UA(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var xj={name:`characterReference`,tokenize:Sj};function Sj(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=RA,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=HA,u):(e.enter(`characterReferenceValue`),a=7,o=VA,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===RA&&!OA(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Cj={partial:!0,tokenize:wj};function wj(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Tj={concrete:!0,name:`codeFenced`,tokenize:Ej};function Ej(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),$(t)?YA(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Q(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Cj,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),YA(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Q(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&$(t)?YA(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Q(t)?e.check(Cj,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),$(t)?YA(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),$(t)?YA(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var Dj={name:`codeIndented`,tokenize:kj},Oj={partial:!0,tokenize:Aj};function kj(e,t,n){return r;function r(t){return e.enter(`codeIndented`),XA(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):Q(t)?e.attempt(Oj,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Aj(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Q(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):XA(e,t,a,`linePrefix`,4,4)(o)}function a(e){return Q(e)?i(e):n(e)}}var jj={name:`codeText`,previous:Nj,resolve:Mj,tokenize:Pj};function Mj(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Nj(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Pj(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Q(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Fj=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Ij(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Ij(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ij(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Ij(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Ij(this.left,t.reverse())}}}};function Ij(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Lj(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Fj(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Rj(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return kA(e,0,1/0,u.slice(0)),!l}function Rj(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var zj={resolve:Vj,tokenize:Hj},Bj={partial:!0,tokenize:Uj};function Vj(e){return Lj(e),e}function Hj(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Q(t)?e.check(Bj,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Uj(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),YA(e,a,`linePrefix`)}function a(i){if(i===null||Q(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Wj(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||BA(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Q(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||WA(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||BA(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Gj(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Q(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!$(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Kj(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),YA(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Q(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function qj(e,t){let n;return r;function r(i){return Q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):$(i)?YA(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Jj={name:`definition`,tokenize:Xj},Yj={partial:!0,tokenize:Zj};function Xj(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Gj.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=IA(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return WA(t)?qj(e,l)(t):l(t)}function l(t){return Wj(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Yj,d,d)(t)}function d(t){return $(t)?YA(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Zj(e,t,n){return r;function r(t){return WA(t)?qj(e,i)(t):n(t)}function i(t){return Kj(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return $(t)?YA(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Q(e)?t(e):n(e)}}var Qj={name:`hardBreakEscape`,tokenize:$j};function $j(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var eM={name:`headingAtx`,resolve:tM,tokenize:nM};function tM(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};kA(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function nM(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||WA(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Q(n)?(e.exit(`atxHeading`),t(n)):$(n)?YA(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||WA(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var rM=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),iM=[`pre`,`script`,`style`,`textarea`],aM={concrete:!0,name:`htmlFlow`,resolveTo:sM,tokenize:cM},oM={partial:!0,tokenize:lM};function sM(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function cM(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:j):LA(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):LA(a)?(e.consume(a),i=4,r.interrupt?t:j):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:j):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return LA(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||WA(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&iM.includes(l)?(i=1,r.interrupt?t(s):O(s)):rM.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||RA(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return $(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||LA(t)?(e.consume(t),b):$(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||RA(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):$(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):$(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Q(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||WA(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||$(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Q(t)?O(t):$(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),ne):t===60&&i===1?(e.consume(t),A):t===62&&i===4?(e.consume(t),ae):t===63&&i===3?(e.consume(t),j):t===93&&i===5?(e.consume(t),ie):Q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(oM,oe,k)(t)):t===null||Q(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Cj,ee,oe)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||Q(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function ne(t){return t===45?(e.consume(t),j):O(t)}function A(t){return t===47?(e.consume(t),o=``,re):O(t)}function re(t){if(t===62){let n=o.toLowerCase();return iM.includes(n)?(e.consume(t),ae):O(t)}return LA(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),re):O(t)}function ie(t){return t===93?(e.consume(t),j):O(t)}function j(t){return t===62?(e.consume(t),ae):t===45&&i===2?(e.consume(t),j):O(t)}function ae(t){return t===null||Q(t)?(e.exit(`htmlFlowData`),oe(t)):(e.consume(t),ae)}function oe(n){return e.exit(`htmlFlow`),t(n)}}function lM(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(pj,t,n)}}var uM={name:`htmlText`,tokenize:dM};function dM(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):LA(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):LA(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Q(t)?(o=d,A(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ne(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Q(t)?(o=h,A(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ne(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ne(t):Q(t)?(o=v,A(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Q(t)?(o=y,A(t)):(e.consume(t),y)}function b(e){return e===62?ne(e):y(e)}function x(t){return LA(t)?(e.consume(t),S):n(t)}function S(t){return t===45||RA(t)?(e.consume(t),S):C(t)}function C(t){return Q(t)?(o=C,A(t)):$(t)?(e.consume(t),C):ne(t)}function w(t){return t===45||RA(t)?(e.consume(t),w):t===47||t===62||WA(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ne):t===58||t===95||LA(t)?(e.consume(t),E):Q(t)?(o=T,A(t)):$(t)?(e.consume(t),T):ne(t)}function E(t){return t===45||t===46||t===58||t===95||RA(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Q(t)?(o=D,A(t)):$(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Q(t)?(o=O,A(t)):$(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,te):t===null?n(t):Q(t)?(o=k,A(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||WA(t)?T(t):(e.consume(t),ee)}function te(e){return e===47||e===62||WA(e)?T(e):n(e)}function ne(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function A(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return $(t)?YA(e,ie,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ie(t)}function ie(t){return e.enter(`htmlTextData`),o(t)}}var fM={name:`labelEnd`,resolveAll:gM,resolveTo:_M,tokenize:vM},pM={tokenize:yM},mM={tokenize:bM},hM={tokenize:xM};function gM(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&kA(e,0,e.length,n),e}function _M(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=AA(o,e.slice(i+1,i+r+3)),o=AA(o,[[`enter`,l,t]]),o=AA(o,oj(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=AA(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=AA(o,e.slice(a+1)),o=AA(o,[[`exit`,s,t]]),kA(e,i,e.length,o),e}function vM(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(IA(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(pM,u,o?u:d)(t):t===91?e.attempt(mM,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(hM,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function yM(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return WA(t)?qj(e,a)(t):a(t)}function a(t){return t===41?u(t):Wj(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return WA(t)?qj(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Kj(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return WA(t)?qj(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function bM(e,t,n){let r=this;return i;function i(t){return Gj.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(IA(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function xM(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var SM={name:`labelStartImage`,resolveAll:fM.resolveAll,tokenize:CM};function CM(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var wM={name:`labelStartLink`,resolveAll:fM.resolveAll,tokenize:TM};function TM(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var EM={name:`lineEnding`,tokenize:DM};function DM(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),YA(e,t,`linePrefix`)}}var OM={name:`thematicBreak`,tokenize:kM};function kM(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),$(t)?YA(e,s,`whitespace`)(t):s(t))}}var AM={continuation:{tokenize:PM},exit:IM,name:`list`,tokenize:NM},jM={partial:!0,tokenize:LM},MM={partial:!0,tokenize:FM};function NM(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:VA(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(OM,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return VA(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(pj,r.interrupt?n:u,e.attempt(jM,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return $(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function PM(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(pj,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,YA(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!$(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(MM,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,YA(e,e.attempt(AM,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function FM(e,t,n){let r=this;return YA(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function IM(e){e.exit(this.containerState.type)}function LM(e,t,n){let r=this;return YA(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!$(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var RM={name:`setextUnderline`,resolveTo:zM,tokenize:BM};function zM(e,t){let n=new $A,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function BM(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),$(t)?YA(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var VM={tokenize:HM};function HM(e){let t=this,n=e.attempt(pj,r,e.attempt(this.parser.constructs.flowInitial,i,YA(e,e.attempt(this.parser.constructs.flow,i,e.attempt(zj,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var UM={resolveAll:qM()},WM=KM(`string`),GM=KM(`text`);function KM(e){return{resolveAll:qM(e===`text`?JM:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function qM(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function JM(e,t){let n=new $A,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var YM=s({attentionMarkers:()=>rN,contentInitial:()=>ZM,disable:()=>iN,document:()=>XM,flow:()=>$M,flowInitial:()=>QM,insideSpan:()=>nN,string:()=>eN,text:()=>tN}),XM={42:AM,43:AM,45:AM,48:AM,49:AM,50:AM,51:AM,52:AM,53:AM,54:AM,55:AM,56:AM,57:AM,62:hj},ZM={91:Jj},QM={[-2]:Dj,[-1]:Dj,32:Dj},$M={35:eM,42:OM,45:[RM,OM],60:aM,61:RM,95:OM,96:Tj,126:Tj},eN={38:xj,92:yj},tN={[-5]:EM,[-4]:EM,[-3]:EM,33:SM,38:xj,42:sj,60:[dj,uM],91:wM,92:[Qj,yj],93:fM,95:sj,96:jj},nN={null:[sj,UM]},rN={null:[42,95]},iN={null:[]};function aN(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=AA(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=oj(a,l.events,l),l.events):[]}function f(e,t){return sN(p(e),t)}function p(e){return oN(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){Q(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&kA(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function oN(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function sN(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
60
60
|
`;break;case-3:o=`\r
|
|
61
61
|
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function cN(e){let t={constructs:MA([YM,...(e||{}).extensions||[]]),content:n(ZA),defined:[],document:n(tj),flow:n(VM),lazy:{},string:n(WM),text:n(GM)};return t;function n(e){return n;function n(n){return aN(t,e,n)}}}function lN(e){for(;!Lj(e););return e}var uN=/[\0\t\n\r]/g;function dN(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){uN.lastIndex=c;let n=uN.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var fN=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function pN(e){return e.replace(fN,mN)}function mN(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return FA(n.slice(t?2:1),t?16:10)}return OA(n)||e}var hN={}.hasOwnProperty;function gN(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),_N(n)(lN(cN(n).document().write(dN()(e,t,!0))))}function _N(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(xe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(_e),blockQuote:a(me),characterEscape:T,characterReference:T,codeFenced:a(he),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(he,o),codeText:a(ge,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(M),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(N),hardBreakEscape:a(ve),hardBreakTrailing:a(ve),htmlFlow:a(ye,o),htmlFlowData:T,htmlText:a(ye,o),htmlTextData:T,image:a(be),label:o,link:a(xe),listItem:a(Ce),listItemValue:f,listOrdered:a(Se,d),listUnordered:a(Se),paragraph:a(we),reference:se,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(_e),strong:a(Te),thematicBreak:a(De)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:pe,autolinkProtocol:fe,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:ue,characterReference:de,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(te),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(ee),htmlTextData:E,image:c(A),label:ie,labelText:re,lineEnding:D,link:c(ne),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ce,resourceDestinationString:j,resourceTitleString:ae,resource:oe,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};yN(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];hN.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||xN).call(a,void 0,e[0])}for(r.position={start:vN(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:vN(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:vN(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||xN).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Vk({start:e.start,end:e.end})+`): it’s not open`);n.position.end=vN(e.end)}function u(){return CA(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=IA(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ee(),n.position={start:vN(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=vN(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=vN(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function A(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function re(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=pN(t),n.identifier=IA(t).toLowerCase()}function ie(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ae(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function oe(){this.data.inReference=void 0}function se(){this.data.referenceType=`collapsed`}function ce(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=IA(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function le(e){this.data.characterReferenceType=e.type}function ue(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=FA(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=OA(t);let i=this.stack[this.stack.length-1];i.value+=r}function de(e){let t=this.stack.pop();t.position.end=vN(e.end)}function fe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function pe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function me(){return{type:`blockquote`,children:[]}}function he(){return{type:`code`,lang:null,meta:null,value:``}}function ge(){return{type:`inlineCode`,value:``}}function M(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function N(){return{type:`emphasis`,children:[]}}function _e(){return{type:`heading`,depth:0,children:[]}}function ve(){return{type:`break`}}function ye(){return{type:`html`,value:``}}function be(){return{type:`image`,title:null,url:``,alt:null}}function xe(){return{type:`link`,title:null,url:``,children:[]}}function Se(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Ce(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function we(){return{type:`paragraph`,children:[]}}function Te(){return{type:`strong`,children:[]}}function Ee(){return{type:`text`,value:``}}function De(){return{type:`thematicBreak`}}}function vN(e){return{line:e.line,column:e.column,offset:e.offset}}function yN(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?yN(e,r):bN(e,r)}}function bN(e,t){let n;for(n in t)if(hN.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function xN(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Vk({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Vk({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Vk({start:t.start,end:t.end})+`) is still open`)}function SN(e){let t=this;t.parser=n;function n(n){return gN(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function CN(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function wN(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
@@ -83,23 +83,26 @@ Error generating stack: `+e.message+`
|
|
|
83
83
|
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
84
84
|
`,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=UI(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}KI.peek=qI;function KI(e){return e.value||``}function qI(){return`<`}JI.peek=YI;function JI(e,t,n,r){let i=LI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function YI(){return`!`}XI.peek=ZI;function XI(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function ZI(){return`!`}QI.peek=$I;function QI(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function $I(){return"`"}function eL(e,t){let n=CA(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}tL.peek=nL;function tL(e,t,n,r){let i=LI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(eL(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function nL(e,t,n){return eL(e,n)?`<`:`[`}rL.peek=iL;function rL(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function iL(){return`[`}function aL(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function oL(e){let t=aL(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function sL(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function cL(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function lL(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?sL(n):aL(n),s=e.ordered?o===`.`?`)`:`.`:oL(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),cL(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function uL(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function dL(e,t,n,r){let i=uL(n),a=n.bulletCurrent||aL(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function fL(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function pL(e,t,n,r){if(!e.children.some(function(e){return EI(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function mL(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}hL.attention=gL,hL.peek=_L;function hL(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function gL(e,t){return{construct:`strong`,markers:mL(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function _L(e,t,n){return n.options.strong||`*`}function vL(e,t,n,r){return n.safe(e.value,r)}function yL(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function bL(e,t,n){let r=(cL(n)+(n.options.ruleSpaces?` `:``)).repeat(yL(n));return n.options.ruleSpaces?r.slice(0,-1):r}var xL={blockquote:DI,break:jI,code:FI,definition:RI,emphasis:BI,hardBreak:jI,heading:GI,html:KI,image:JI,imageReference:XI,inlineCode:QI,link:tL,linkReference:rL,list:lL,listItem:dL,paragraph:fL,root:pL,strong:hL,text:vL,thematicBreak:bL};function SL(){return{enter:{table:CL,tableData:DL,tableHeader:DL,tableRow:TL},exit:{codeText:OL,table:wL,tableData:EL,tableHeader:EL,tableRow:EL}}}function CL(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function wL(e){this.exit(e),this.data.inTable=void 0}function TL(e){this.enter({type:`tableRow`,children:[]},e)}function EL(e){this.exit(e)}function DL(e){this.enter({type:`tableCell`,children:[]},e)}function OL(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,kL));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function kL(e,t){return t===`|`?t:e}function AL(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
85
85
|
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
86
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return CI(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=xL.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function jL(){return{exit:{taskListCheckValueChecked:NL,taskListCheckValueUnchecked:NL,paragraph:PL}}}function ML(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:FL}}}function NL(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function PL(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function FL(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=xL.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function IL(){return[BF(),uI(),hI(),SL(),jL()]}function LL(e){return{extensions:[VF(),dI(e),gI(),AL(e),ML()]}}var RL={tokenize:QL,partial:!0},zL={tokenize:$L,partial:!0},BL={tokenize:eR,partial:!0},VL={tokenize:tR,partial:!0},HL={tokenize:nR,partial:!0},UL={name:`wwwAutolink`,tokenize:XL,previous:rR},WL={name:`protocolAutolink`,tokenize:ZL,previous:iR},GL={name:`emailAutolink`,tokenize:YL,previous:aR},KL={};function qL(){return{text:KL}}for(var JL=48;JL<123;)KL[JL]=GL,JL++,JL===58?JL=65:JL===91&&(JL=97);KL[43]=GL,KL[45]=GL,KL[46]=GL,KL[95]=GL,KL[72]=[GL,WL],KL[104]=[GL,WL],KL[87]=[GL,UL],KL[119]=[GL,UL];function YL(e,t,n){let r=this,i,a;return o;function o(t){return!oR(t)||!aR.call(r,r.previous)||sR(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return oR(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(HL,u,l)(t):t===45||t===95||RA(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&LA(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function XL(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!rR.call(r,r.previous)||sR(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(RL,e.attempt(zL,e.attempt(BL,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function ZL(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&iR.call(r,r.previous)&&!sR(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(LA(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||BA(t)||WA(t)||KA(t)||GA(t)?n(t):e.attempt(zL,e.attempt(BL,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function QL(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function $L(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(VL,c,s)(t):t===null||WA(t)||KA(t)||t!==45&&GA(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function eR(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(VL,t,a)(o):o===null||WA(o)||KA(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function tR(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||WA(o)||KA(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||WA(e)||KA(e)?t(e):r(e)}function a(e){return LA(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):LA(t)?(e.consume(t),o):n(t)}}function nR(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return RA(e)?n(e):t(e)}}function rR(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||WA(e)}function iR(e){return!LA(e)}function aR(e){return!(e===47||oR(e))}function oR(e){return e===43||e===45||e===46||e===95||RA(e)}function sR(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var cR={tokenize:gR,partial:!0};function lR(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:pR,continuation:{tokenize:mR},exit:hR}},text:{91:{name:`gfmFootnoteCall`,tokenize:fR},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:uR,resolveTo:dR}}}}function uR(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=IA(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function dR(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function fR(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||WA(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(IA(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return WA(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function pR(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||WA(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=IA(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return WA(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),YA(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function mR(e,t,n){return e.check(pj,t,e.attempt(cR,t,n))}function hR(e){e.exit(`gfmFootnoteDefinition`)}function gR(e,t,n){let r=this;return YA(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function _R(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&kA(o,o.length,0,oj(s,e.slice(r+1,n),t)),kA(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),kA(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=aj(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=aj(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var vR=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){yR(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function yR(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function bR(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function xR(){return{flow:{null:{name:`table`,tokenize:SR,resolveAll:CR}}}}function SR(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):$(t)?YA(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||WA(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,$(t)?YA(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return $(t)?YA(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Q(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return $(t)?YA(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Q(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Q(n)?(e.exit(`tableRow`),t(n)):$(n)?YA(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||WA(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function CR(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new vR;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(TR(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=wR(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=wR(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=wR(f,t,o,i,n,d)):(o[0]=o[1],d=wR(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&TR(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=bR(t.events,n))}return e}function wR(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},ER(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=ER(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=ER(t.events,n[2]),a=ER(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},ER(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function TR(e,t,n,r,i){let a=[],o=ER(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function ER(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var DR={name:`tasklistCheck`,tokenize:kR};function OR(){return{text:{91:DR}}}function kR(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return WA(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Q(r)?t(r):$(r)?e.check({tokenize:AR},t,n)(r):n(r)}}function AR(e,t,n){return YA(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function jR(e){return MA([qL(),lR(),_R(e),xR(),OR()])}var MR={};function NR(e){let t=this,n=e||MR,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(jR(n)),a.push(IL()),o.push(LL(n))}var PR=new Set([`http:`,`https:`,`mailto:`,`tel:`]);function FR(e){let t=(e??``).trim();if(t===``)return``;if(/^[#/.]/.test(t))return t;try{let e=new URL(t,`https://example.invalid`);return PR.has(e.protocol)?t:``}catch{return``}}function IR(e,t,n=!1){let r=t?.start?.offset,i=t?.end?.offset;if(r===void 0||i===void 0)return;let a=e.slice(r,i);if(!n){let e=a.match(/^`+/)?.[0];return e&&a.endsWith(e)?a.slice(e.length,-e.length):a}let o=a.match(/^ {0,3}(`{3,}|~{3,})[^\r\n]*(?:\r\n|\n|\r)/);if(!o)return a;let s=a.slice(o[0].length),c=RegExp(`^ {0,3}${o[1][0]}{${o[1].length},}[ \\t]*$`,`m`).exec(s);return c?s.slice(0,c.index):s}function LR(e,t){return!e&&!t}async function RR(e,t){if(!t)throw Error(`Clipboard is unavailable. Select the code and copy it manually.`);await t.writeText(e)}var zR=/^-\s+(.+?)\s+\(([^()\s]+\/[^()\s]+)\)\s*$/;function BR(e){let t=e.lastIndexOf(`${CD}\n`);if(t<0||t>0&&e[t-1]!==`
|
|
86
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return CI(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=xL.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function jL(){return{exit:{taskListCheckValueChecked:NL,taskListCheckValueUnchecked:NL,paragraph:PL}}}function ML(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:FL}}}function NL(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function PL(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function FL(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=xL.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function IL(){return[BF(),uI(),hI(),SL(),jL()]}function LL(e){return{extensions:[VF(),dI(e),gI(),AL(e),ML()]}}var RL={tokenize:QL,partial:!0},zL={tokenize:$L,partial:!0},BL={tokenize:eR,partial:!0},VL={tokenize:tR,partial:!0},HL={tokenize:nR,partial:!0},UL={name:`wwwAutolink`,tokenize:XL,previous:rR},WL={name:`protocolAutolink`,tokenize:ZL,previous:iR},GL={name:`emailAutolink`,tokenize:YL,previous:aR},KL={};function qL(){return{text:KL}}for(var JL=48;JL<123;)KL[JL]=GL,JL++,JL===58?JL=65:JL===91&&(JL=97);KL[43]=GL,KL[45]=GL,KL[46]=GL,KL[95]=GL,KL[72]=[GL,WL],KL[104]=[GL,WL],KL[87]=[GL,UL],KL[119]=[GL,UL];function YL(e,t,n){let r=this,i,a;return o;function o(t){return!oR(t)||!aR.call(r,r.previous)||sR(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return oR(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(HL,u,l)(t):t===45||t===95||RA(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&LA(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function XL(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!rR.call(r,r.previous)||sR(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(RL,e.attempt(zL,e.attempt(BL,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function ZL(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&iR.call(r,r.previous)&&!sR(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(LA(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||BA(t)||WA(t)||KA(t)||GA(t)?n(t):e.attempt(zL,e.attempt(BL,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function QL(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function $L(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(VL,c,s)(t):t===null||WA(t)||KA(t)||t!==45&&GA(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function eR(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(VL,t,a)(o):o===null||WA(o)||KA(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function tR(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||WA(o)||KA(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||WA(e)||KA(e)?t(e):r(e)}function a(e){return LA(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):LA(t)?(e.consume(t),o):n(t)}}function nR(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return RA(e)?n(e):t(e)}}function rR(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||WA(e)}function iR(e){return!LA(e)}function aR(e){return!(e===47||oR(e))}function oR(e){return e===43||e===45||e===46||e===95||RA(e)}function sR(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var cR={tokenize:gR,partial:!0};function lR(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:pR,continuation:{tokenize:mR},exit:hR}},text:{91:{name:`gfmFootnoteCall`,tokenize:fR},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:uR,resolveTo:dR}}}}function uR(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=IA(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function dR(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function fR(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||WA(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(IA(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return WA(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function pR(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||WA(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=IA(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return WA(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),YA(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function mR(e,t,n){return e.check(pj,t,e.attempt(cR,t,n))}function hR(e){e.exit(`gfmFootnoteDefinition`)}function gR(e,t,n){let r=this;return YA(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function _R(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&kA(o,o.length,0,oj(s,e.slice(r+1,n),t)),kA(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),kA(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=aj(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=aj(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var vR=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){yR(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function yR(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function bR(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function xR(){return{flow:{null:{name:`table`,tokenize:SR,resolveAll:CR}}}}function SR(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):$(t)?YA(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||WA(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,$(t)?YA(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return $(t)?YA(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Q(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return $(t)?YA(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Q(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Q(n)?(e.exit(`tableRow`),t(n)):$(n)?YA(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||WA(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function CR(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new vR;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(TR(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=wR(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=wR(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=wR(f,t,o,i,n,d)):(o[0]=o[1],d=wR(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&TR(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=bR(t.events,n))}return e}function wR(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},ER(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=ER(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=ER(t.events,n[2]),a=ER(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},ER(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function TR(e,t,n,r,i){let a=[],o=ER(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function ER(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var DR={name:`tasklistCheck`,tokenize:kR};function OR(){return{text:{91:DR}}}function kR(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return WA(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Q(r)?t(r):$(r)?e.check({tokenize:AR},t,n)(r):n(r)}}function AR(e,t,n){return YA(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function jR(e){return MA([qL(),lR(),_R(e),xR(),OR()])}var MR={};function NR(e){let t=this,n=e||MR,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(jR(n)),a.push(IL()),o.push(LL(n))}var PR=new Set([`http:`,`https:`,`mailto:`,`tel:`]);function FR(e){let t=(e??``).trim();if(t===``)return``;if(/^[#/.]/.test(t))return t;try{let e=new URL(t,`https://example.invalid`);return PR.has(e.protocol)?t:``}catch{return``}}var IR=4e3,LR=/^\s*(?:```|~~~)/,RR=/^#{1,6}\s/,zR=/^\s{0,3}\[[^\]]+\]:\s*\S|\[\^[^\]]+\]/m;function BR(e){if(e.length<=IR||zR.test(e))return[e];let t=[],n=[],r=!1;for(let i of e.split(`
|
|
87
|
+
`))LR.test(i)?r=!r:!r&&RR.test(i)&&n.some(e=>e.trim())&&(t.push(n.join(`
|
|
88
|
+
`)),n=[]),n.push(i);return t.push(n.join(`
|
|
89
|
+
`)),t}function VR(e,t,n=!1){let r=t?.start?.offset,i=t?.end?.offset;if(r===void 0||i===void 0)return;let a=e.slice(r,i);if(!n){let e=a.match(/^`+/)?.[0];return e&&a.endsWith(e)?a.slice(e.length,-e.length):a}let o=a.match(/^ {0,3}(`{3,}|~{3,})[^\r\n]*(?:\r\n|\n|\r)/);if(!o)return a;let s=a.slice(o[0].length),c=RegExp(`^ {0,3}${o[1][0]}{${o[1].length},}[ \\t]*$`,`m`).exec(s);return c?s.slice(0,c.index):s}function HR(e,t){return!e&&!t}async function UR(e,t){if(!t)throw Error(`Clipboard is unavailable. Select the code and copy it manually.`);await t.writeText(e)}var WR=/^-\s+(.+?)\s+\(([^()\s]+\/[^()\s]+)\)\s*$/;function GR(e){let t=e.lastIndexOf(`${CD}\n`);if(t<0||t>0&&e[t-1]!==`
|
|
87
90
|
`)return{body:e,files:[]};let n=e.slice(t+CD.length+1).split(`
|
|
88
|
-
`).filter(Boolean),r=[];for(let t of n){let n=zR.exec(t);if(!n)return{body:e,files:[]};let i=n[1].split(/[\\/]/).pop()??``;if(!/^[\w.-]+$/.test(i))return{body:e,files:[]};r.push({id:i,name:i.replace(/^[a-z0-9]+-/,``),mime:n[2]})}return r.length>0?{body:e.slice(0,t).trimEnd(),files:r}:{body:e,files:[]}}var VR=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);function HR({files:e}){return e.length===0?null:(0,L.jsx)(`ul`,{className:`mt-2 flex flex-wrap gap-2`,"aria-label":`Attached files`,children:e.map(e=>(0,L.jsx)(`li`,{children:VR.has(e.mime)?(0,L.jsx)(`a`,{href:Hf(`/files/preview/attachments/${e.id}`),target:`_blank`,rel:`noopener noreferrer`,className:`block overflow-hidden rounded-lg border border-border bg-muted/40 transition-transform duration-150 ease-snap hover:scale-[1.02]`,children:(0,L.jsx)(`img`,{src:Hf(`/files/preview/attachments/${e.id}`),alt:e.name,loading:`lazy`,className:`max-h-40 max-w-56 object-cover`})}):(0,L.jsxs)(`span`,{className:`inline-flex max-w-64 items-center gap-2 rounded-lg border border-border bg-muted/40 px-3 py-2 text-xs text-muted-foreground`,children:[e.mime===`application/pdf`?(0,L.jsx)(bm,{"aria-hidden":`true`,className:`size-4 shrink-0`}):(0,L.jsx)(fh,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,L.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))})}function UR(e){return e?.type===`text`?e.value??``:(e?.children??[]).map(UR).join(``)}function WR(e,t=!1){let n=t||e.tagName===`a`;e.tagName===`code`&&(e.properties={...e.properties,copyBlocked:n,blockCode:t===!1&&e.properties?.blockCode});for(let t of e.children??[])e.tagName===`pre`&&(t.properties={...t.properties,blockCode:!0}),WR(t,n)}function GR(){return e=>WR(e)}function KR(e){let[t,n]=(0,m.useState)(!1);async function r(){try{await RR(e,navigator.clipboard),n(!0),V.success(`Code copied.`)}catch{V.error(`Could not copy code. Select it and copy manually, or allow clipboard access.`)}}return{copied:t,copy:r}}function qR({text:e,children:t,block:n=!1}){let{copy:r}=KR(e),i=(0,m.useRef)(void 0);return(0,L.jsxs)(`code`,{role:`button`,tabIndex:0,"aria-label":`Copy code`,"aria-keyshortcuts":`Enter Space`,title:`Copy code · Enter / Space`,className:`cursor-copy focus-visible:outline-2 focus-visible:outline-ring`,onPointerDown:e=>{i.current={x:e.clientX,y:e.clientY,moved:!1}},onPointerMove:e=>{let t=i.current;t&&Math.hypot(e.clientX-t.x,e.clientY-t.y)>4&&(t.moved=!0)},onClick:e=>{e.stopPropagation(),LR(window.getSelection()?.toString()??``,i.current?.moved??!1)&&r(),i.current=void 0},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),LR(window.getSelection()?.toString()??``,!1)&&r())},children:[t,n?null:(0,L.jsx)(`span`,{className:`sr-only`,children:` (activate to copy)`})]})}function JR({node:e,children:t,source:n}){let r=e,{copied:i,copy:a}=KR(IR(n,r?.position,!0)??UR(r)),o=r?.children?.find(e=>e.tagName===`code`)?.properties?.className,s=(Array.isArray(o)?o:[]).map(String).find(e=>e.startsWith(`language-`))?.slice(9);return(0,L.jsxs)(`div`,{className:`relative my-3 rounded-lg bg-muted`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between pl-3`,children:[(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[s&&/^[\w+#.-]{1,20}$/.test(s)?s:`code`,` · tap to copy`]}),(0,L.jsx)(Y,{label:i?`Copied`:`Copy the code`,icon:i?Op:cm,iconOnly:!0,onClick:()=>void a()})]}),(0,L.jsx)(`pre`,{className:`!my-0 overflow-x-auto !rounded-t-none !bg-transparent px-3 pb-3 text-sm leading-relaxed [&>code]:block`,children:t})]})}function YR(e){return{pre:t=>(0,L.jsx)(JR,{...t,source:e}),code:({node:t,children:n})=>{let r=t;if(r?.properties?.copyBlocked)return(0,L.jsx)(`code`,{children:n});let i=!!r?.properties?.blockCode;return(0,L.jsx)(qR,{text:IR(e,r?.position,i)??UR(r),block:i,children:n})},a:({href:e,children:t})=>(0,L.jsx)(`a`,{href:e?Hf(e):void 0,target:`_blank`,rel:`noopener noreferrer nofollow`,children:t}),img:({src:e,alt:t})=>(0,L.jsx)(`img`,{src:e?Hf(e):void 0,alt:t??``,loading:`lazy`}),table:({children:e})=>(0,L.jsx)(`div`,{className:`my-3 w-full overflow-x-auto`,children:(0,L.jsx)(`table`,{className:`w-full border-collapse text-sm`,children:e})})}}var XR=(0,m.memo)(function({text:e,className:t}){let{body:n,files:r}=BR(e);return(0,L.jsxs)(`div`,{className:q(`md-body`,t),children:[n?(0,L.jsx)(DF,{remarkPlugins:[NR],rehypePlugins:[GR],urlTransform:FR,components:YR(n),children:n}):null,(0,L.jsx)(HR,{files:r})]})});function ZR({title:e,note:t,className:n,children:r,collapsed:i,onToggle:a,shortcut:o,...s}){let c=typeof e==`string`?e:`pane`;return(0,L.jsxs)(`section`,{className:q(`group/frame relative flex min-h-0 min-w-0 flex-col`,i&&`flex-none`,n),...s,children:[e||t||a?(0,L.jsxs)(`div`,{className:q(`flex min-h-12 shrink-0 items-center justify-between gap-3 px-4`,!i&&`border-b border-border`),children:[e?(0,L.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-medium`,children:e}):(0,L.jsx)(`span`,{}),(0,L.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[t?(0,L.jsx)(`span`,{className:`flex items-center gap-2 truncate text-xs text-muted-foreground`,children:t}):null,a?(0,L.jsxs)(`button`,{type:`button`,"aria-expanded":!i,"aria-label":i?`Expand ${c}`:`Minimize ${c}`,title:`${i?`Expand`:`Minimize`}${o?` · ${o}`:``}`,"aria-keyshortcuts":o?`${o} Enter Space`:`Enter Space`,"aria-describedby":`focused-action-help`,onClick:a,className:`btn-ghost -mr-1.5 inline-flex h-8 items-center gap-1.5 rounded-lg border border-transparent px-2 text-muted-foreground transition-[box-shadow,color,translate] duration-150 ease-snap outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none`,children:[o?(0,L.jsx)(cD,{chord:o,className:`kbd-hint`}):null,(0,L.jsx)(Ap,{"aria-hidden":`true`,className:q(`size-4 transition-transform duration-200 ease-snap`,i&&`-rotate-90`)})]}):null]})]}):null,i?null:r]})}function QR({title:e,right:t,className:n}){return(0,L.jsxs)(`span`,{className:q(`flex min-w-0 items-center gap-3`,n),children:[(0,L.jsx)(`span`,{className:`truncate font-medium`,children:e}),(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-4 flex-1`}),t?(0,L.jsx)(`span`,{className:`shrink-0 text-xs font-normal text-muted-foreground`,children:t}):null]})}function $R({title:e,right:t,prominent:n,children:r}){return(0,L.jsxs)(`section`,{className:q(`flex flex-col`,n?`gap-3`:`gap-2.5`),children:[(0,L.jsx)(`h3`,{className:n?`text-sm text-foreground`:`text-xs text-muted-foreground`,children:(0,L.jsx)(QR,{title:e,right:t,className:n?`[&>span:first-child]:font-semibold`:void 0})}),r]})}var ez=`Pull requests`,tz=`An agent reviews it, optionally with a focus you type; Jev's quick read sizes it up first.`,nz=`nothing is posted to GitHub`,rz=`Refresh to load open pull requests with the GitHub CLI (gh).`,iz=`No open pull requests.`,az=`loading pull requests from GitHub…`,oz=`reading the diff…`,sz=`the pull request has new commits since this review — review it again`,cz=`(no description)`,lz=`Review with a focus (optional)`,uz=`Leave it empty for a full review.`;function dz(e){return e===`passing`?`✓`:e===`failing`?`✗`:e===`pending`?`…`:``}function fz(e){return e===`passing`?`text-success`:e===`failing`?`text-destructive`:`text-muted-foreground`}function pz(e,t){return`+${e} −${t}`}function mz(e){return e===`APPROVED`?`approved`:e===`CHANGES_REQUESTED`?`changes requested`:e===`REVIEW_REQUIRED`?`review required`:``}function hz(e){return e?e.status===`running`?`reviewing`:e.status!==`done`||!e.verdict?``:e.verdict===`approve`?`approved`:e.verdict===`changes`?`changes found`:`commented`:``}function gz(e){return e===`approve`?`approve`:e===`changes`?`request changes`:e===`comment`?`comment`:``}function _z(e,t){if(e.status===`running`)return vz(e,t);if(e.status===`cancelled`)return`stopped`;let n=e.status===`done`?vz(e,t):e.status;return[gz(e.verdict),n].filter(Boolean).join(` · `)}function vz(e,t){let n=Math.max(0,Math.round(((e.finishedAt??t)-e.startedAt)/1e3));return n<60?`${n}s`:`${Math.floor(n/60)}m ${String(n%60).padStart(2,`0`)}s`}function yz(e,t){return[e.state?e.draft?`draft`:e.state.toLowerCase():e.draft?`draft`:``,e.author?`by ${e.author}`:``,e.updatedAt?`updated ${NO(t-Date.parse(e.updatedAt))}`:``].filter(Boolean).join(` · `)}function bz(e){let t=`${e.changedFiles} file${e.changedFiles===1?``:`s`}`;return`${e.headRef||`?`} → ${e.baseRef||`?`} · ${pz(e.additions,e.deletions)} · ${t}`}function xz(e){let t=e.mergeable===`CONFLICTING`?`conflicts`:e.mergeable===`MERGEABLE`?`mergeable`:``;return[e.checks?`checks ${e.checks} (${e.checkCount})`:``,mz(e.decision),t,e.labels.join(`, `)].filter(Boolean).join(` · `)}function Sz(e){return[`${e.changedFiles} file${e.changedFiles===1?``:`s`}`,e.labels.join(`, `),e.review?.stale?`stale`:``].filter(Boolean).join(` · `)}function Cz(e){return e.read?`${e.read.model} · ${e.read.ms} ms`:``}function wz(e){let[t,n]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{if(!e)return;let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),e?t:Date.now()}function Tz({pull:e,now:t}){return(0,L.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,L.jsxs)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:[(0,L.jsxs)(`span`,{className:`font-normal text-muted-foreground tabular-nums`,children:[`#`,e.number]}),` `,e.title]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:yz(e,t)}),(0,L.jsx)(`p`,{className:`text-sm tabular-nums`,children:bz(e)}),xz(e)?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:xz(e)}):null,e.url?(0,L.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,className:`text-xs break-all text-primary underline underline-offset-4`,children:e.url}):null]})}function Ez({read:e}){return(0,L.jsxs)($R,{title:`Jev's read`,right:Cz(e),children:[e.status===`running`?(0,L.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(FD,{className:`size-3.5`}),oz]}):null,e.status===`failed`?(0,L.jsx)(`p`,{className:`text-sm text-foreground`,children:e.error??`Jev could not read it`}):null,e.status===`done`&&e.line?(0,L.jsx)(XR,{text:e.line}):null]})}function Dz({review:e,now:t}){return(0,L.jsxs)(L.Fragment,{children:[e.model?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:[e.model,e.thinking].filter(Boolean).join(` · `)}):null,e.focus?(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`focus: `,e.focus]}):null,e.saved?(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`kept from `,NO(t-e.startedAt)]}):null,e.stale?(0,L.jsx)(`p`,{className:`text-sm text-foreground`,children:sz}):null,e.status===`running`?(0,L.jsx)(Oz,{steps:e.steps}):null,e.status===`cancelled`?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`stopped`}):null,e.status===`failed`||e.status===`timeout`?(0,L.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`✗ `,e.error??e.status]}):null,e.text?(0,L.jsx)(XR,{text:e.text}):null]})}function Oz({steps:e}){return(0,L.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.slice(-6).map((e,t)=>(0,L.jsxs)(`li`,{className:`break-words`,children:[`· `,e]},t))})}function kz({number:e,focus:t,onChange:n}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(`label`,{htmlFor:`focus-${e}`,className:`text-[0.8125rem] font-medium text-foreground`,children:lz}),(0,L.jsx)(OO,{id:`focus-${e}`,value:t,rows:2,maxLength:2e3,onChange:e=>n(e.target.value)}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:uz})]})}function Az({number:e,review:t,now:n,focus:r,onFocus:i}){return(0,L.jsxs)($R,{title:`Review`,right:t?_z(t,n):void 0,children:[t?(0,L.jsx)(Dz,{review:t,now:n}):null,(0,L.jsx)(kz,{number:e,focus:r,onChange:i}),(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`A read-only agent reviews it — `,nz,`.`]})]})}function jz({files:e}){return(0,L.jsx)($R,{title:`Files`,right:String(e.length),children:(0,L.jsx)(`div`,{className:`overflow-x-auto rounded-lg border border-border`,children:(0,L.jsx)(`table`,{className:`w-full border-collapse text-sm tabular-nums`,children:(0,L.jsx)(`tbody`,{children:e.map(e=>(0,L.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,L.jsx)(`td`,{className:`max-w-0 px-3 py-1.5 break-all`,children:e.path}),(0,L.jsx)(`td`,{className:`px-3 py-1.5 text-right text-xs whitespace-nowrap text-muted-foreground`,children:pz(e.additions,e.deletions)})]},e.path))})})})})}function Mz({note:e,now:t}){let n=[e.state&&e.state!==`COMMENTED`?e.state.toLowerCase().replace(/_/g,` `):``,e.at?NO(t-Date.parse(e.at)):``].filter(Boolean).join(` · `);return(0,L.jsxs)(`article`,{className:`card-raised flex flex-col gap-1.5 rounded-lg border px-3.5 py-2.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author??`comment`}),n?(0,L.jsx)(`span`,{children:n}):null]}),e.body.trim()?(0,L.jsx)(XR,{text:e.body.trim()}):null]})}function Nz({notes:e,now:t}){return e.length===0?null:(0,L.jsx)($R,{title:`Discussion`,right:String(e.length),children:(0,L.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map((e,n)=>(0,L.jsx)(Mz,{note:e,now:t},n))})})}function Pz({number:e,error:t}){return t?(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load #`,e,`. `,t]}):(0,L.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(FD,{className:`size-3.5`}),`loading #`,e,`…`]})}function Fz({number:e,onChanged:t}){let n=UD(`git.pull`,{number:e},[`git`]),[r,i]=(0,m.useState)(``),a=n.data?.review?.status===`running`,o=wz(a);if(!n.data)return(0,L.jsx)(Pz,{number:e,error:n.error});let{pull:s,review:c,read:l}=n.data,u=()=>{n.reload(),t?.()},d=async()=>{let t=r.trim();i(``),await H(`git.review`,{number:e,...t?{focus:t}:{}}),u()},f=async()=>{await H(`git.jev`,{number:e}),u()},p=async()=>{await H(`git.cancelReview`,{number:e}),u()};return(0,L.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`Pull request #${e}`,children:[(0,L.jsxs)(pO,{children:[(0,L.jsx)(Y,{label:`Review`,icon:wh,tone:`primary`,shortcut:`V`,disabled:a,onClick:()=>void d()}),(0,L.jsx)(Y,{label:`Jev's read`,icon:Sp,shortcut:`Q`,disabled:a,onClick:()=>void f()}),a?(0,L.jsx)(WO,{icon:Xp,label:`Stop the review`,text:`Stop`,shortcut:`X`,title:`Stop this review?`,description:`The agent stops reading the pull request. Nothing is posted to GitHub.`,confirmLabel:`Stop review`,variant:`destructive`,onConfirm:()=>void p()}):null]}),(0,L.jsx)(Tz,{pull:s,now:o}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:tz}),l?(0,L.jsx)(Ez,{read:l}):null,(0,L.jsx)(Az,{number:e,review:c,now:o,focus:r,onFocus:i}),s.files.length>0?(0,L.jsx)(jz,{files:s.files}):null,(0,L.jsx)($R,{title:`Description`,children:s.body.trim()?(0,L.jsx)(XR,{text:s.body.trim()}):(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:cz})}),(0,L.jsx)(Nz,{notes:s.notes,now:o})]})}var Iz=Dg(`group/badge inline-flex h-6 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-lg border border-transparent px-2.5 text-xs font-medium whitespace-nowrap transition-colors focus-visible:ring-[3px] focus-visible:ring-ring/40 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-accent text-foreground [a]:hover:bg-primary/20`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-accent`,destructive:`bg-destructive/12 text-destructive [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-accent`,ghost:`hover:bg-accent hover:text-foreground`,link:`text-link underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function Lz({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?sv:`span`;return(0,L.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:q(Iz({variant:t}),e),...r})}var Rz=`flex min-h-10 w-full flex-col gap-0.5 rounded-lg px-2.5 py-2 text-left outline-none transition-colors duration-150 hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/40 aria-[current=true]:bg-accent`,zz=`flex flex-col gap-0.5 px-2 pb-2`,Bz=`px-4 pt-4 pb-1 text-xs font-medium text-muted-foreground`;function Vz({checks:e}){let t=dz(e);return t?(0,L.jsx)(`span`,{className:q(`w-4 shrink-0 text-center`,fz(e)),"aria-hidden":`true`,children:t}):(0,L.jsx)(`span`,{className:`w-4 shrink-0`,"aria-hidden":`true`})}function Hz({pull:e,selected:t,onSelect:n}){let r=hz(e.review);return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(e.number),className:Rz,children:[(0,L.jsxs)(`span`,{className:`flex items-start gap-2 text-sm`,children:[(0,L.jsxs)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:[`#`,e.number]}),(0,L.jsx)(Vz,{checks:e.checks}),e.draft?(0,L.jsx)(Lz,{variant:`secondary`,children:`draft`}):null,(0,L.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.title})]}),(0,L.jsxs)(`span`,{className:`flex flex-wrap items-baseline justify-between gap-x-3 text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{children:Sz(e)}),(0,L.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[r?(0,L.jsx)(`span`,{children:r}):null,(0,L.jsx)(`span`,{className:`tabular-nums`,children:pz(e.additions,e.deletions)})]})]})]})})}function Uz({pulls:e,selectedId:t,onSelect:n}){return(0,L.jsx)(`ul`,{className:zz,children:e.map(e=>(0,L.jsx)(Hz,{pull:e,selected:e.number===t,onSelect:n},e.number))})}var Wz=()=>DD(ED(`git`)),Gz=e=>DD(ED(`git`,String(e)));function Kz(e){let t=Number(e[0]);return Number.isInteger(t)&&t>0?t:void 0}function qz({loading:e,loaded:t,error:n,onRetry:r}){let i=n?`✗ ${n}`:t?iz:e?az:rz;return(0,L.jsxs)(kD,{className:`m-4 flex-1`,children:[(0,L.jsxs)(AD,{children:[(0,L.jsx)(MD,{variant:`icon`,children:(0,L.jsx)(wm,{"aria-hidden":`true`})}),(0,L.jsx)(PD,{className:n?`text-destructive`:void 0,children:i})]}),n?(0,L.jsx)(J,{variant:`outline`,onClick:r,children:`Retry`}):null]})}function Jz({rest:e}){let t=SO(),n=UD(`git.pulls`,{},[`git`]),r=Kz(e),i=n.data?.pulls??[],a=(0,m.useCallback)(()=>{H(`git.pulls`,{refresh:!0}).then(()=>n.reload())},[n]);if(!n.data&&n.error)return(0,L.jsx)(LD,{message:`Could not load pull requests. ${n.error}`,onRetry:n.reload});if(n.data&&i.length===0)return(0,L.jsx)(qz,{loading:n.data.loading,loaded:n.data.loaded,error:n.data.error,onRetry:n.reload});let o=n.loading||!!n.data?.loading,s=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(EO,{title:ez,count:n.data?`${i.length} open`:void 0,children:(0,L.jsx)(Y,{label:`Refresh`,icon:Oh,shortcut:`R`,disabled:o,className:q(`h-7`,o&&`[&_svg]:animate-spin`),onClick:a})}),n.data?.error?(0,L.jsxs)(`p`,{className:`px-3 pt-2 text-sm text-destructive`,children:[`✗ `,n.data.error]}):null,n.data?(0,L.jsx)(Uz,{pulls:i,selectedId:r,onSelect:Gz}):(0,L.jsx)(DO,{})]}),c=r===void 0?null:(0,L.jsx)(Fz,{number:r,onChanged:n.reload},r);return(0,L.jsx)(TO,{wide:t,list:s,detail:c,open:r!==void 0,onClose:Wz,hint:`Select a pull request to see its detail.`,describe:`Pull request detail`})}function Yz(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function Xz({label:e,hint:t,buttonLabel:n=`Send`,onSend:r}){let i=(0,m.useId)(),[a,o]=(0,m.useState)(``),[s,c]=(0,m.useState)(!1),l=async()=>{a.trim()&&!s&&(c(!0),await r(a)&&o(``),c(!1))};return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`label`,{htmlFor:i,className:`text-sm font-medium text-foreground`,children:e}),(0,L.jsx)(OO,{id:i,value:a,rows:2,"aria-describedby":t?`${i}-hint`:void 0,onChange:e=>o(e.target.value),onKeyDown:e=>{Yz(e)&&(e.preventDefault(),l())}}),t?(0,L.jsx)(`p`,{id:`${i}-hint`,className:`text-xs text-muted-foreground`,children:t}):null,(0,L.jsx)(`div`,{className:`flex self-end`,children:(0,L.jsx)(Y,{label:n,icon:s?Rm:bp,tone:`primary`,shortcut:`Enter`,className:s?`[&_svg]:animate-spin`:void 0,onClick:()=>void l(),disabled:!a.trim()||s})})]})}var Zz=`Issues`,Qz=`Issue`,$z=`p plans it with the planning panel, then save it as a task`,eB=`Refresh to load open issues with the GitHub CLI (gh).`,tB=`No open issues. File one with New issue.`,nB=`loading issues from GitHub…`,rB=`issues are off (lobby.issues)`,iB=`(no description)`;function aB(e,t){return[e.state?e.state.toLowerCase():``,e.author?`by ${e.author}`:``,e.updatedAt?`updated ${NO(t-Date.parse(e.updatedAt))}`:``,e.labels.join(`, `)].filter(Boolean).join(` · `)}function oB(e,t){return[e.author?`by ${e.author}`:``,e.updatedAt?NO(t-Date.parse(e.updatedAt)):``].filter(Boolean).join(` · `)}function sB(e){return e.length>0?`[${e.slice(0,2).join(`, `)}]`:``}function cB({issue:e,now:t}){return(0,L.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,L.jsxs)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:[(0,L.jsxs)(`span`,{className:`font-normal text-muted-foreground tabular-nums`,children:[`#`,e.number]}),` `,e.title]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:aB(e,t)}),e.url?(0,L.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,className:`text-xs break-all text-primary underline underline-offset-4`,children:e.url}):null]})}function lB({comment:e,now:t}){return(0,L.jsxs)(`article`,{className:`card-raised flex flex-col gap-1.5 rounded-lg border px-3.5 py-2.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author??`comment`}),e.createdAt?(0,L.jsx)(`span`,{children:NO(t-Date.parse(e.createdAt))}):null]}),(0,L.jsx)(XR,{text:e.body.trim()})]})}function uB({comments:e,now:t}){return e.length===0?null:(0,L.jsx)($R,{title:`Comments`,right:String(e.length),children:(0,L.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map((e,n)=>(0,L.jsx)(lB,{comment:e,now:t},n))})})}function dB({number:e}){let t=UD(`issues.get`,{number:e},[`issues`]),n=Date.now();if(!t.data)return t.error?(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load #`,e,`. `,t.error]}):(0,L.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(FD,{className:`size-3.5`}),`loading #`,e,`…`]});let r=t.data.issue;return(0,L.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`${Qz} #${e}`,children:[(0,L.jsx)(cB,{issue:r,now:n}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:$z}),(0,L.jsx)($R,{title:`Description`,children:r.body.trim()?(0,L.jsx)(XR,{text:r.body.trim()}):(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:iB})}),(0,L.jsx)(uB,{comments:r.comments,now:n})]})}function fB({issue:e,selected:t,now:n,onSelect:r}){let i=sB(e.labels);return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>r(e.number),className:Rz,children:[(0,L.jsxs)(`span`,{className:`flex flex-wrap items-start gap-2 text-sm`,children:[(0,L.jsxs)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:[`#`,e.number]}),(0,L.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.title}),i?(0,L.jsx)(`span`,{className:`max-w-full break-words text-xs text-muted-foreground`,children:i}):null]}),(0,L.jsx)(`span`,{className:`pl-9 text-xs text-muted-foreground`,children:oB(e,n)})]})})}function pB({issues:e,selectedId:t,now:n,onSelect:r}){return(0,L.jsx)(`ul`,{className:zz,children:e.map(e=>(0,L.jsx)(fB,{issue:e,selected:e.number===t,now:n,onSelect:r},e.number))})}var mB=()=>DD(ED(`issues`)),hB=e=>DD(ED(`issues`,String(e)));function gB(e){let t=Number(e[0]);return Number.isInteger(t)&&t>0?t:void 0}function _B(){return(0,L.jsx)(kD,{className:`m-4 flex-1`,children:(0,L.jsxs)(AD,{children:[(0,L.jsx)(MD,{variant:`icon`,children:(0,L.jsx)(Kp,{"aria-hidden":`true`})}),(0,L.jsx)(ND,{children:`Issues are off`}),(0,L.jsx)(PD,{className:`font-mono`,children:rB})]})})}function vB({loading:e,loaded:t,error:n,onRetry:r}){let i=n?`✗ ${n}`:t?tB:e?nB:eB;return(0,L.jsxs)(kD,{className:`m-4 flex-1`,children:[(0,L.jsxs)(AD,{children:[(0,L.jsx)(MD,{variant:`icon`,children:(0,L.jsx)(Kp,{"aria-hidden":`true`})}),(0,L.jsx)(PD,{className:n?`text-destructive`:void 0,children:i})]}),n?(0,L.jsx)(J,{variant:`outline`,onClick:r,children:`Retry`}):null]})}function yB({onCreate:e}){return(0,L.jsx)(CO,{className:`shrink-0 border-t border-border p-4`,children:(0,L.jsx)(Xz,{label:`New issue`,hint:`The first line becomes the title; the rest is the body. Enter files it.`,buttonLabel:`File issue`,onSend:e})})}function bB({rest:e}){let t=SO(),n=VD(`status`).data?.issuesEnabled??!0,r=UD(`issues.list`,{},[`issues`],n),i=gB(e),a=r.data?.issues??[],o=Date.now(),s=(0,m.useCallback)(()=>{H(`issues.list`,{refresh:!0}).then(()=>r.reload())},[r]),c=async e=>await H(`issues.create`,{text:e})?(r.reload(),!0):!1;if(!n)return(0,L.jsx)(_B,{});if(!r.data&&r.error)return r.error.includes(`issues are off`)?(0,L.jsx)(_B,{}):(0,L.jsx)(LD,{message:`Could not load issues. ${r.error}`,onRetry:r.reload});let l=r.loading||!!r.data?.loading,u=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(EO,{title:Zz,count:r.data?`${a.length} open`:void 0,children:(0,L.jsx)(Y,{label:`Refresh`,icon:Oh,shortcut:`R`,disabled:l,className:q(`h-7`,l&&`[&_svg]:animate-spin`),onClick:s})}),r.data?.error?(0,L.jsxs)(`p`,{className:`px-3 pt-2 text-sm text-destructive`,children:[`✗ `,r.data.error]}):null,r.data?(0,L.jsx)(pB,{issues:a,selectedId:i,now:o,onSelect:hB}):(0,L.jsx)(DO,{}),(0,L.jsx)(yB,{onCreate:c})]}),d=i===void 0?null:(0,L.jsx)(dB,{number:i},i),f=r.data&&a.length===0?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(vB,{loading:r.data.loading,loaded:r.data.loaded,error:r.data.error,onRetry:r.reload}),(0,L.jsx)(`div`,{className:`shrink-0 pb-dock`,children:(0,L.jsx)(yB,{onCreate:c})})]}):(0,L.jsx)(TO,{wide:t,list:u,detail:d,open:i!==void 0,onClose:mB,hint:`Select an issue to read it.`,describe:`Issue detail`});return(0,L.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:f})}var xB=[`master`,`designer`,`backend`,`qa`],SB={master:`Master (oracle)`,designer:`Designer`,backend:`Backend`,qa:`QA`},CB={master:`Master`,designer:`Designer`,backend:`Backend`,qa:`QA`},wB=`Every write archives the version before it.`;function TB(e){if(e<1e3)return String(e);let t=e/1e3;return`${t>=10?Math.round(t):t.toFixed(1)}k`}function EB(e){return`over the compaction threshold — ask the oracle to compact ${e}`}function DB(e){return{text:e.text,occurrence:e.occurrence}}function OB(e){return xB.map(t=>{let n=e.filter(e=>e.agent===t);return{agent:t,files:n,notes:n.reduce((e,t)=>e+t.notes,0)}}).filter(e=>e.files.length>0)}function kB(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function AB({initial:e,busy:t,onSave:n,onCancel:r}){let[i,a]=(0,m.useState)(e),o=()=>{!t&&i.trim()&&n(i)};return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-input p-3`,children:[(0,L.jsx)(`label`,{htmlFor:`knowledge-entry`,className:`text-sm font-medium text-foreground`,children:`Edit entry`}),(0,L.jsx)(OO,{id:`knowledge-entry`,value:i,rows:4,autoFocus:!0,onChange:e=>a(e.target.value),onKeyDown:e=>{kB(e)&&(e.preventDefault(),o())}}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:wB}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(J,{variant:`outline`,onClick:r,disabled:t,children:`Cancel`}),(0,L.jsxs)(J,{onClick:o,disabled:t||!i.trim(),children:[t?(0,L.jsx)(FD,{}):null,`Save`]})]})]})]})}function jB({open:e,file:t,initial:n,busy:r,onClose:i,onSave:a}){let[o,s]=(0,m.useState)(n),c=vD(e,_D.confirm);return(0,L.jsx)(uD,{open:e&&c,onOpenChange:e=>!e&&i(),label:`Edit ${t}`,description:wB,dismissOnBackdrop:!1,className:`max-w-3xl`,children:(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 p-6`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`h2`,{className:`text-base font-medium`,children:[`Edit `,t]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:wB})]}),(0,L.jsx)(OO,{value:o,rows:14,className:`min-h-0 flex-1 font-mono text-sm`,onChange:e=>s(e.target.value)}),(0,L.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,L.jsx)(J,{variant:`outline`,onClick:i,disabled:r,children:`Cancel`}),(0,L.jsxs)(J,{onClick:()=>a(o),disabled:r,children:[r?(0,L.jsx)(FD,{}):null,`Save file`]})]})]})})}function MB({note:e,about:t,onTakeBack:n,busy:r}){let i=t?`about "${t.replace(/\s+/g,` `).trim().slice(0,50)}": ${e.text}`:e.text;return(0,L.jsxs)(`li`,{className:`flex items-start gap-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(vh,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-primary`}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:i}),(0,L.jsx)(Y,{label:`Take the note back`,icon:cg,iconOnly:!0,className:`-my-1 size-7`,disabled:r,onClick:()=>n(e.id)})]})}function NB({entry:e,index:t,selected:n,notes:r,onPick:i,onTakeBack:a,busy:o}){let s=()=>i(t);return(0,L.jsxs)(`li`,{role:`button`,tabIndex:0,"aria-pressed":n,onClick:s,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s())},className:n?`flex min-h-9 cursor-pointer flex-col gap-1 rounded-lg border border-primary/30 bg-accent px-3 py-2.5 outline-none focus-visible:ring-3 focus-visible:ring-ring/40`:`flex min-h-9 cursor-pointer flex-col gap-1 rounded-lg border border-border px-3 py-2.5 outline-none transition-colors hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/40`,children:[(0,L.jsx)(`div`,{className:`flex gap-2`,children:(0,L.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,L.jsx)(XR,{text:e.text})})}),r.length>0?(0,L.jsx)(`ul`,{className:`flex flex-col gap-1 pl-1`,children:r.map(e=>(0,L.jsx)(MB,{note:e,onTakeBack:a,busy:o},e.id))}):null]})}function PB({notes:e,onTakeBack:t,busy:n}){return e.length===0?null:(0,L.jsx)($R,{title:`Notes on entries that changed`,right:String(e.length),children:(0,L.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.map(e=>(0,L.jsx)(MB,{note:e,about:e.entry,onTakeBack:t,busy:n},e.id))})})}function FB({view:e}){let t=e.entries.length;return(0,L.jsxs)(`header`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsxs)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:[CB[e.agent],` `,(0,L.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`· `,e.file]})]}),(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t,` `,t===1?`entry`:`entries`,` · `,TB(e.chars),` chars`]}),e.over?(0,L.jsx)(`p`,{className:`text-sm text-foreground`,children:EB(e.file)}):null]})}function IB({draft:e,picked:t,setDraft:n,onEditFile:r,onDelete:i}){let a=!!e;return(0,L.jsxs)(pO,{children:[(0,L.jsx)(Y,{label:`Edit the entry`,text:`Edit`,icon:Sh,shortcut:`E`,disabled:a||!t,onClick:()=>n({kind:`edit`,entry:t})}),(0,L.jsx)(Y,{label:t?`Add an entry after it`:`Add an entry`,text:`Add`,icon:Eh,shortcut:`A`,disabled:a,onClick:()=>n({kind:`add`,entry:t})}),(0,L.jsx)(Y,{label:`Comment on the entry`,text:`Comment`,icon:Km,shortcut:`C`,disabled:a||!t,onClick:()=>n({kind:`comment`,entry:t})}),(0,L.jsx)(Y,{label:`Edit the whole file`,text:`Edit file`,icon:gm,shortcut:`F`,disabled:a,onClick:r}),(0,L.jsx)(WO,{icon:ig,label:`Delete the entry`,text:`Delete`,shortcut:`Delete`,title:`Delete this entry?`,description:`The entry and its notes are removed. The version before is archived.`,confirmLabel:`Delete entry`,variant:`destructive`,disabled:a||!t,onConfirm:i})]})}function LB({agent:e,file:t,onChanged:n}){let r=UD(`knowledge.open`,{agent:e,file:t},[`knowledge`]),[i,a]=(0,m.useState)(0),[o,s]=(0,m.useState)(),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),f=r.data?.view,p=f?.entries??[],h=p[Math.min(i,Math.max(0,p.length-1))],g=async e=>{d(!0),await e(),s(void 0),r.reload(),n(),d(!1)},_=e=>void g(()=>H(`knowledge.unnote`,{id:e})),v=()=>{h&&g(()=>H(`knowledge.remove`,{agent:e,file:t,ref:DB(h)}))},y=n=>{let r=o?.entry;if(o?.kind===`edit`&&r)return void g(()=>H(`knowledge.edit`,{agent:e,file:t,ref:DB(r),text:n}));if(o?.kind===`comment`&&r)return void g(()=>H(`knowledge.comment`,{agent:e,file:t,ref:DB(r),text:n}));g(()=>H(`knowledge.add`,{agent:e,file:t,...h?{ref:DB(h)}:{},text:n}))};return f?(0,L.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`${CB[e]} ${t}`,children:[(0,L.jsx)(IB,{draft:o,picked:h,setDraft:s,onEditFile:()=>l(!0),onDelete:v}),(0,L.jsx)(FB,{view:f}),p.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing here yet. Add the first entry below.`}):null,(0,L.jsx)(`ul`,{className:`flex flex-col gap-2`,children:p.map((e,t)=>(0,L.jsx)(NB,{entry:e,index:t,selected:t===i,notes:f.attached.filter(t=>t.entry===e.text),onPick:a,onTakeBack:_,busy:u},`${t}-${e.text}`))}),o?.kind===`edit`?(0,L.jsx)(AB,{initial:o.entry.text,busy:u,onSave:y,onCancel:()=>s(void 0)}):null,o?.kind===`comment`?(0,L.jsx)(Xz,{label:`Comment on this entry`,hint:wB,buttonLabel:`Add note`,onSend:async e=>(y(e),!0)}):null,o?.kind===`add`?(0,L.jsx)(Xz,{label:`Add an entry`,hint:wB,buttonLabel:`Add entry`,onSend:async e=>(y(e),!0)}):null,u&&!o?(0,L.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(FD,{}),` saving…`]}):null,(0,L.jsx)(PB,{notes:f.detached,onTakeBack:_,busy:u}),(0,L.jsx)(jB,{open:c,file:t,initial:f.content,busy:u,onClose:()=>l(!1),onSave:n=>{l(!1),g(()=>H(`knowledge.replaceFile`,{agent:e,file:t,text:n}))}})]}):r.error?(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not read the file. `,r.error]}):(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`reading…`})}var RB={DEV:im,DESIGN:ch,QA:Hh,RESEARCH:eg,"QUICK FIX":Sg,SCOUT:om,PLANNER:Ph,CLASSIFIER:Qh,LOBBY:Xm,LINT:Pm};function zB(e){return e?RB[e.toUpperCase()]??wp:Ep}function BB(e){let t=e?.toUpperCase();return t===`ORACLE`||t===`MASTER`}function VB({source:e,className:t,strokeWidth:n}){if(BB(e))return(0,L.jsx)(`span`,{"aria-hidden":`true`,"data-agent-icon":e,className:q(`agent-oracle shrink-0`,t)});let r=zB(e);return(0,L.jsx)(r,{"aria-hidden":`true`,"data-agent-icon":e??`thinking`,strokeWidth:n,className:q(`shrink-0`,t)})}var HB={MASTER:`text-primary`,DEV:`text-source-dev`,DESIGN:`text-source-design`,QA:`text-source-qa`,RESEARCH:`text-source-research`,"QUICK FIX":`text-source-quickfix`,ORACLE:`text-primary`,LOBBY:`text-muted-foreground`};function UB(e){return e.length<=2?e:e.charAt(0)+e.slice(1).toLowerCase()}function WB(e){return HB[e]??`text-muted-foreground`}var GB={MASTER:`var(--primary)`,DEV:`var(--source-dev)`,DESIGN:`var(--source-design)`,QA:`var(--source-qa)`,RESEARCH:`var(--source-research)`,"QUICK FIX":`var(--source-quickfix)`,ORACLE:`var(--primary)`,LOBBY:`var(--muted-foreground)`};function KB(e){return GB[e]??`var(--muted-foreground)`}function qB(e){if(e.role===`researcher`)return`RESEARCH`;let t=e.domain??e.role;return t===`backend`||t===`dev`?`DEV`:t===`designer`||t===`design`?`DESIGN`:t===`researcher`||t===`research`?`RESEARCH`:t===`qa`?`QA`:t?String(t).toUpperCase():`AGENT`}function JB(e){return e?.runs??[]}function YB(e,t=40){let n=new Map;for(let t of e)n.set(t.source,t);return[...n.values()].sort((e,t)=>e.at-t.at).slice(-t)}function XB(e){return`${e.agent}/${e.file}`}var ZB={master:`ORACLE`,designer:`DESIGN`,backend:`DEV`,qa:`QA`},QB=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function $B({info:e}){return(0,L.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 text-xs text-muted-foreground tabular-nums`,children:[(0,L.jsx)(`span`,{children:TB(e.chars)}),e.over?(0,L.jsx)(`span`,{className:`text-foreground`,children:`· over`}):null,e.notes>0?(0,L.jsx)(`span`,{className:`text-primary`,children:QB(e.notes,`note`)}):null]})}function eV({info:e,selected:t,onSelect:n}){return(0,L.jsx)(`li`,{className:`ktree-leaf`,children:(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(XB(e)),className:q(Rz,`ktree-file min-h-9 flex-row items-center gap-2 py-1.5`),children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`ktree-bud`}),(0,L.jsx)(`span`,{className:q(`min-w-0 flex-1 truncate text-sm text-foreground`,t&&`font-medium`),children:e.label}),(0,L.jsx)($B,{info:e})]})})}var tV=`bot-lobby.knowledge.folded`;function nV(){try{let e=JSON.parse(window.localStorage.getItem(tV)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}}function rV({files:e,models:t={},selectedKey:n,onSelect:r}){let[i,a]=(0,m.useState)(nV),o=OB(e),s=e.reduce((e,t)=>e+t.notes,0);function c(e,t){a(n=>{let r=t?n.filter(t=>t!==e):[...new Set([...n,e])];try{window.localStorage.setItem(tV,JSON.stringify(r))}catch{}return r})}return(0,L.jsxs)(`div`,{className:`ktree px-3 pt-1 pb-3`,children:[(0,L.jsxs)(`p`,{className:`ktree-root`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`card-raised grid size-8 shrink-0 place-items-center rounded-lg border text-primary`,children:(0,L.jsx)(Sp,{className:`size-4`})}),(0,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:`block text-sm font-medium`,children:`Project knowledge`}),(0,L.jsxs)(`span`,{className:`block text-xs text-muted-foreground`,children:[QB(e.length,`file`),` · `,QB(o.length,`agent`),s>0?` · ${QB(s,`note`)}`:``]})]})]}),(0,L.jsx)(`ul`,{className:`ktree-branches`,"aria-label":`Agents and their knowledge`,children:o.map(e=>{let a=!i.includes(e.agent),o=ZB[e.agent],s=`knowledge-${e.agent}`,l=t[e.agent];return(0,L.jsxs)(`li`,{className:`ktree-branch`,style:{"--orb":KB(o)},children:[(0,L.jsx)(`h3`,{children:(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space ArrowLeft ArrowRight`,"aria-describedby":`focused-action-help`,type:`button`,"aria-expanded":a,"aria-controls":s,onClick:()=>c(e.agent,!a),onKeyDown:t=>{t.key===`ArrowLeft`||t.key===`h`?(t.preventDefault(),t.stopPropagation(),c(e.agent,!1)):(t.key===`ArrowRight`||t.key===`l`)&&(t.preventDefault(),t.stopPropagation(),a||c(e.agent,!0))},className:`ktree-node`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`ktree-tile`,children:(0,L.jsx)(VB,{source:o,strokeWidth:2.25,className:o===`ORACLE`?`size-5`:`size-3.5`})}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`span`,{className:`block truncate text-sm font-medium text-foreground`,children:SB[e.agent]}),l?(0,L.jsxs)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`sr-only`,children:`runs on `}),l]}):null]}),(0,L.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:[e.notes>0?(0,L.jsxs)(`span`,{className:`text-primary`,children:[QB(e.notes,`note`),` · `]}):null,QB(e.files.length,`file`)]}),(0,L.jsx)(Pp,{"aria-hidden":`true`,className:q(`size-3.5 shrink-0 text-muted-foreground transition-transform duration-200 ease-snap`,a&&`rotate-90`)})]})}),(0,L.jsx)(tu,{initial:!1,children:a?(0,L.jsx)(B.ul,{id:s,"aria-label":`${SB[e.agent]}'s knowledge`,initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{type:`spring`,stiffness:520,damping:42},className:`ktree-leaves`,children:e.files.map(e=>(0,L.jsx)(eV,{info:e,selected:XB(e)===n,onSelect:r},XB(e)))},`files`):null})]},e.agent)})})]})}var iV=()=>DD(ED(`knowledge`)),aV=e=>{let[t,n]=e.split(`/`);DD(ED(`knowledge`,t??``,n??``))};function oV(){return(0,L.jsx)(kD,{className:`m-4 flex-1`,children:(0,L.jsxs)(AD,{children:[(0,L.jsx)(MD,{variant:`icon`,children:(0,L.jsx)(Sp,{"aria-hidden":`true`})}),(0,L.jsx)(PD,{children:`No knowledge files yet.`})]})})}function sV(e,t,n,r){let i=e.find(e=>e.agent===t&&e.file===n);return i?(0,L.jsx)(LB,{agent:i.agent,file:i.file,onChanged:r},XB(i)):t&&n?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That file is not on the list any more.`}):null}function cV({agent:e,file:t}){let n=SO(),r=UD(`knowledge.files`,{},[`knowledge`]),i=r.data?.files??[];if(!r.data&&r.error)return(0,L.jsx)(LD,{message:`Could not load the knowledge files. ${r.error}`,onRetry:r.reload});if(r.data&&i.length===0)return(0,L.jsx)(oV,{});let a=i.reduce((e,t)=>e+t.notes,0),o=i.find(n=>n.agent===e&&n.file===t),s=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(EO,{title:`Knowledge`,count:a>0?`${a} note${a===1?``:`s`}`:void 0}),r.data?(0,L.jsx)(rV,{files:i,models:r.data.models??{},selectedKey:o?XB(o):void 0,onSelect:aV}):(0,L.jsx)(DO,{})]});return(0,L.jsx)(TO,{wide:n,list:s,detail:sV(i,e,t,r.reload),open:!!(e&&t),onClose:iV,hint:`Select a file to read its entries.`,describe:`Knowledge file`})}function lV({className:e,...t}){return(0,L.jsx)(FS,{"aria-keyshortcuts":`Space`,"aria-description":`When focused, press Space to toggle.`,"data-slot":`checkbox`,className:q(`peer relative flex size-[1.125rem] shrink-0 items-center justify-center rounded-[5px] border border-input bg-background text-primary-foreground transition-colors duration-150 outline-none before:absolute before:-inset-3 before:content-[''] focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary`,e),...t,children:(0,L.jsx)(LS,{"data-slot":`checkbox-indicator`,className:`flex items-center justify-center`,children:(0,L.jsx)(Op,{"aria-hidden":`true`,className:`size-3`,strokeWidth:3})})})}var uV=`Sessions`,dV=`No sessions yet.`,fV=`Up to 5 sessions; each can be assigned to one agent or several.`,pV=`A session is a live Excalidraw room that you and your agents draw in together.`,mV=[{title:`Start a live room`,text:`In Excalidraw: Share → Live collaboration → Start session.`},{title:`Add it here`,text:`Paste the room link, or make a new room and open it in Excalidraw.`},{title:`Assign agents`,text:`They read the board and draw on it, under their own name.`}],hV=`Sessions`,gV=`Pick a session on the left to see its link, its room and its agents.`,_V=`Room link`,vV=`Masked until revealed. A revealed link stays in this tab and is never saved.`,yV=`Room`,bV=`Drawing`,xV=`Last check`,SV=`not checked yet`,CV=`Add a session`,wV=`https://excalidraw.com/#room=…`,TV=`Optional name`;function EV(e){return`${e} of 5 in use`}var DV=`Agents may draw here.`,OV=`Agents may only look.`,kV=`checking the room…`,AV=`Check that the room can be reached.`,jV=`Assigned to`,MV=`Assigned agents read the board and draw on it with excalidraw_read and excalidraw_draw, and appear in the room under their own name.`,NV=`Add or rename`,PV=`Add by link`,FV=`In Excalidraw, Share → Live collaboration → Start session, then paste the link. Enter adds it.`,IV=`New room`,LV=`Makes a fresh room link to open in Excalidraw; the name is optional.`,RV=`Rename`,zV=`draw`,BV=`look only`,VV=`Copied to the clipboard`,HV=`Could not reveal the link.`,UV=[`master`,`designer`,`backend`,`qa`,`scout`,`researcher`,`quickfix`,`planner`],WV={master:`Master (oracle)`,designer:`Designer`,backend:`Backend`,qa:`QA`,scout:`Scouts`,researcher:`Researcher`,quickfix:`Quick fix`,planner:`Planner`};function GV(e){return e===0?`no agents`:`${e} agent${e===1?``:`s`}`}function KV(e){return e?e.ok?`✓`:`!`:``}function qV({title:e,right:t,className:n,children:r}){return(0,L.jsxs)(`section`,{className:q(`card-raised flex min-w-0 flex-col gap-3 rounded-xl border p-4`,n),children:[(0,L.jsxs)(`header`,{className:`flex items-baseline justify-between gap-3`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:e}),t?(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t}):null]}),r]})}function JV({row:e=!1}){return(0,L.jsx)(`ol`,{className:q(`grid gap-3`,e&&`@2xl:grid-cols-3`),children:mV.map((e,t)=>(0,L.jsxs)(`li`,{className:`card-raised flex gap-3 rounded-xl border p-3.5`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-6 shrink-0 place-items-center rounded-full bg-accent text-xs font-semibold text-primary tabular-nums`,children:t+1}),(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.title}),(0,L.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:e.text})]})]},e.title))})}function YV({label:e,hint:t,buttonLabel:n,placeholder:r,initial:i=``,required:a,mono:o,primary:s,onSubmit:c}){let l=(0,m.useId)(),[u,d]=(0,m.useState)(i),[f,p]=(0,m.useState)(!1),h=a&&!u.trim(),g=async()=>{h||f||(p(!0),await c(u)&&d(i),p(!1))};return(0,L.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-2`,onSubmit:e=>{e.preventDefault(),g()},children:[(0,L.jsx)(`label`,{htmlFor:l,className:`text-xs font-medium text-muted-foreground`,children:e}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(`input`,{id:l,value:u,maxLength:o?2e3:80,placeholder:r,"aria-describedby":t?`${l}-hint`:void 0,onChange:e=>d(e.target.value),className:q(`h-8 min-w-0 flex-1 rounded-lg border border-input bg-background px-3 text-sm outline-none transition-[border-color,box-shadow] placeholder:text-muted-foreground/70 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30`,o&&`font-mono text-[0.8125rem]`)}),(0,L.jsx)(Y,{type:`submit`,label:n,icon:f?Rm:Eh,tone:s?`primary`:`neutral`,shortcut:`Enter`,disabled:h||f,className:f?`[&_svg]:animate-spin`:void 0})]}),t?(0,L.jsx)(`p`,{id:`${l}-hint`,className:`text-xs leading-relaxed text-muted-foreground`,children:t}):null]})}function XV({onChanged:e,primary:t}){return(0,L.jsx)(YV,{label:PV,hint:FV,buttonLabel:`Add`,placeholder:wV,required:!0,mono:!0,primary:t,onSubmit:async t=>await H(`excalidraw.add`,{link:t.trim()})?(e(),!0):!1})}function ZV({onChanged:e,primary:t}){return(0,L.jsx)(YV,{label:IV,hint:LV,buttonLabel:`Create`,placeholder:TV,primary:t,onSubmit:async t=>{let n=t.trim();return await H(`excalidraw.create`,n?{name:n}:{})?(e(),!0):!1}})}function QV({onChanged:e,stacked:t=!1}){return(0,L.jsxs)(`div`,{className:q(`grid gap-4`,!t&&`@2xl:grid-cols-2`),children:[(0,L.jsx)(XV,{onChanged:e,primary:!0}),(0,L.jsx)(ZV,{onChanged:e,primary:!0})]})}function $V({session:e,onChanged:t}){return(0,L.jsx)(YV,{label:RV,initial:e.name,required:!0,buttonLabel:RV,onSubmit:async n=>await H(`excalidraw.rename`,{id:e.id,name:n.trim()})?(t(),!0):!1},e.name)}function eH({icon:e,tone:t=`muted`,children:n}){return(0,L.jsxs)(`span`,{className:q(`inline-flex h-6 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium`,t===`primary`?`bg-accent text-primary`:t===`warning`?`bg-warning/10 text-warning`:`bg-muted text-muted-foreground`),children:[(0,L.jsx)(e,{"aria-hidden":`true`,className:`size-3.5`}),n]})}function tH({check:e,checking:t}){return t?(0,L.jsx)(eH,{icon:Rm,children:kV}):e?e.ok?(0,L.jsx)(eH,{icon:Hp,tone:`primary`,children:`reachable`}):(0,L.jsx)(eH,{icon:Bp,tone:`warning`,children:`unreachable`}):(0,L.jsx)(eH,{icon:Wp,children:SV})}function nH({label:e,children:t}){return(0,L.jsxs)(`div`,{className:`grid grid-cols-[6rem_minmax(0,1fr)] items-baseline gap-3 text-sm`,children:[(0,L.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,L.jsx)(`dd`,{className:`min-w-0`,children:t})]})}function rH({check:e,checking:t}){return t?(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,L.jsx)(FD,{className:`size-3.5`,"aria-hidden":`true`}),kV]}):e?(0,L.jsxs)(`span`,{className:e.ok?`text-primary`:`text-foreground`,children:[e.ok?`✓`:`!`,` `,e.text]}):(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:AV})}function iH({agent:e,on:t,onToggle:n}){return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`label`,{className:q(`flex h-9 w-full cursor-pointer items-center gap-2.5 rounded-lg border px-2.5 text-sm transition-[background-color,border-color,color]`,t?`border-primary/25 bg-accent text-foreground`:`border-border text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,L.jsx)(lV,{checked:t,onCheckedChange:()=>n(e)}),(0,L.jsx)(`span`,{className:`truncate`,children:WV[e]})]})})}function aH({session:e,onChanged:t}){let n=async n=>{await H(`excalidraw.toggleAgent`,{id:e.id,agent:n})&&t()},r=async()=>{await H(`excalidraw.toggleAll`,{id:e.id})&&t()},i=e.agents.length===UV.length;return(0,L.jsxs)(qV,{title:jV,right:GV(e.agents.length),children:[(0,L.jsx)(`ul`,{className:`grid grid-cols-1 gap-1.5 @md:grid-cols-2`,children:UV.map(t=>(0,L.jsx)(iH,{agent:t,on:e.agents.includes(t),onToggle:n},t))}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,L.jsx)(`p`,{className:`min-w-0 flex-1 text-xs leading-relaxed text-muted-foreground`,children:MV}),(0,L.jsx)(Y,{label:i?`Take every agent off`:`Assign every agent`,icon:Pm,onClick:()=>void r()})]})]})}function oH({session:e,check:t,checking:n,onCheck:r,onChanged:i,onRemove:a}){let[o,s]=(0,m.useState)(),c=async()=>{try{s((await Kf(`excalidraw.reveal`,{id:e.id})).link)}catch(e){V.error(e instanceof Error?e.message:HV)}},l=()=>void navigator.clipboard?.writeText(o??``).then(()=>V(VV)).catch(()=>void 0),u=async()=>{await H(`excalidraw.toggleContribute`,{id:e.id})&&i()};return(0,L.jsxs)(`article`,{"aria-label":`Session detail`,className:`@container flex flex-col gap-4`,children:[(0,L.jsxs)(pO,{children:[o?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Y,{label:`Copy the link`,text:`Copy`,icon:cm,shortcut:`C`,onClick:l}),(0,L.jsx)(Y,{label:`Open board`,icon:fm,tone:`primary`,shortcut:`O`,href:o})]}):(0,L.jsx)(Y,{label:`Reveal the link`,text:`Reveal`,icon:mm,shortcut:`R`,onClick:()=>void c()}),(0,L.jsx)(Y,{label:e.contribute?`Look only: agents stop drawing`:`Let agents draw`,text:e.contribute?`Look only`:`Let agents draw`,icon:e.contribute?bh:Sh,shortcut:`W`,pressed:e.contribute,onClick:()=>void u()}),(0,L.jsx)(Y,{label:`Check the room`,text:`Check`,icon:n?Rm:Hh,shortcut:`T`,disabled:n,onClick:r}),(0,L.jsx)(WO,{icon:ig,label:`Remove the session`,text:`Remove`,shortcut:`Delete`,title:`Remove "${e.name}"?`,description:`Agents lose this session at once; the Excalidraw room itself is not touched.`,confirmLabel:`Remove session`,variant:`destructive`,onConfirm:a})]}),(0,L.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:e.name}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,L.jsx)(eH,{icon:e.contribute?Sh:mm,tone:e.contribute?`primary`:`muted`,children:e.contribute?zV:BV}),(0,L.jsx)(eH,{icon:fg,children:GV(e.agents.length)}),(0,L.jsx)(tH,{check:t,checking:n})]})]}),(0,L.jsxs)(`div`,{className:`grid gap-4 @3xl:grid-cols-2`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,L.jsxs)(qV,{title:_V,children:[(0,L.jsx)(`p`,{className:`rounded-lg border border-border bg-muted px-3 py-2 font-mono text-[0.8125rem] break-all text-foreground`,children:o??e.masked}),(0,L.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:vV})]}),(0,L.jsx)(qV,{title:yV,children:(0,L.jsxs)(`dl`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(nH,{label:bV,children:(0,L.jsx)(`span`,{className:e.contribute?`text-primary`:`text-muted-foreground`,children:e.contribute?DV:OV})}),(0,L.jsx)(nH,{label:xV,children:(0,L.jsx)(rH,{check:t,checking:n})})]})})]}),(0,L.jsx)(aH,{session:e,onChanged:i})]}),(0,L.jsx)(qV,{title:NV,children:(0,L.jsxs)(`div`,{className:`grid gap-4 @3xl:grid-cols-3`,children:[(0,L.jsx)($V,{session:e,onChanged:i}),(0,L.jsx)(XV,{onChanged:i}),(0,L.jsx)(ZV,{onChanged:i})]})})]})}function sH({check:e,checking:t}){if(t)return(0,L.jsx)(FD,{className:`size-3.5 shrink-0 text-muted-foreground`});let n=KV(e);return n?(0,L.jsx)(`span`,{className:q(`w-3.5 shrink-0 text-center`,e?.ok?`text-primary`:`text-foreground`),"aria-hidden":`true`,children:n}):(0,L.jsx)(`span`,{className:`w-3.5 shrink-0`,"aria-hidden":`true`})}function cH({session:e,check:t,checking:n,selected:r,onSelect:i}){return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":r?`true`:void 0,onClick:()=>i(e.id),className:Rz,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-sm`,children:[(0,L.jsx)(sH,{check:t,checking:n}),(0,L.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,r&&`font-medium`),children:e.name}),(0,L.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:GV(e.agents.length)})]}),(0,L.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 pl-[1.375rem] text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`font-mono break-all`,children:e.masked}),(0,L.jsx)(Lz,{variant:`secondary`,children:e.contribute?zV:BV})]})]})})}function lH({sessions:e,checks:t,checking:n,selectedId:r,onSelect:i}){return(0,L.jsx)(`ul`,{className:zz,children:e.map(e=>(0,L.jsx)(cH,{session:e,check:t[e.id],checking:n.includes(e.id),selected:e.id===r,onSelect:i},e.id))})}var uH=()=>DD(ED(`excalidraw`)),dH=e=>DD(ED(`excalidraw`,e));function fH({count:e}){return(0,L.jsxs)(`span`,{className:`flex items-center gap-2.5 text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`flex gap-1`,children:Array.from({length:5},(t,n)=>(0,L.jsx)(`span`,{className:q(`h-1.5 w-5 rounded-full`,n<e?`bg-primary`:`bg-border`)},n))}),(0,L.jsx)(`span`,{className:`tabular-nums`,children:EV(e)})]})}function pH({count:e,onChanged:t}){return(0,L.jsxs)(`div`,{className:`@container flex max-w-4xl flex-col gap-5`,children:[(0,L.jsxs)(`header`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:hV}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:gV})]}),(0,L.jsx)(fH,{count:e})]}),(0,L.jsx)(JV,{row:!0}),e<5?(0,L.jsx)(qV,{title:CV,children:(0,L.jsx)(QV,{onChanged:t})}):null,(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-4`,children:[(0,L.jsx)(lD,{chord:`ArrowDown`,children:`next session`}),(0,L.jsx)(lD,{chord:`ArrowRight`,children:`into its detail`})]})]})}function mH({onChanged:e}){return(0,L.jsx)(`div`,{className:`@container flex-1 overflow-y-auto px-5 pt-10 pb-dock sm:px-8`,children:(0,L.jsxs)(`div`,{className:`mx-auto grid max-w-5xl gap-8 @4xl:grid-cols-[minmax(0,1fr)_minmax(0,24rem)]`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`card-raised grid size-11 place-items-center rounded-xl border text-primary`,children:(0,L.jsx)(gh,{className:`size-5`})}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:dV}),(0,L.jsx)(`p`,{className:`max-w-prose text-sm leading-relaxed text-muted-foreground`,children:pV})]}),(0,L.jsx)(JV,{}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:fV})]}),(0,L.jsx)(qV,{title:CV,className:`self-start`,children:(0,L.jsx)(QV,{onChanged:e,stacked:!0})})]})})}function hH({id:e}){let t=SO(),n=UD(`excalidraw.list`,{},[`excalidraw`]),[r,i]=(0,m.useState)({}),[a,o]=(0,m.useState)([]),s=n.data?.sessions??[],c=s.find(t=>t.id===e),l=async e=>{o(t=>[...t,e]);let t=await H(`excalidraw.check`,{id:e});o(t=>t.filter(t=>t!==e)),t&&i(n=>({...n,[e]:t}))},u=async()=>{c&&await H(`excalidraw.remove`,{id:c.id})&&(n.reload(),uH())};if(!n.data&&n.error)return(0,L.jsx)(LD,{message:`Could not load sessions. ${n.error}`,onRetry:n.reload});if(n.data&&s.length===0)return(0,L.jsx)(mH,{onChanged:n.reload});let d=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(EO,{title:uV,count:n.data?`${s.length}/5`:void 0}),n.data?(0,L.jsx)(lH,{sessions:s,checks:r,checking:a,selectedId:e,onSelect:dH}):(0,L.jsx)(DO,{})]}),f=c?(0,L.jsx)(oH,{session:c,check:r[c.id],checking:a.includes(c.id),onCheck:()=>void l(c.id),onChanged:n.reload,onRemove:()=>void u()}):t&&n.data?(0,L.jsx)(pH,{count:s.length,onChanged:n.reload}):null;return(0,L.jsx)(TO,{wide:t,list:d,detail:f,open:c!==void 0,onClose:uH,hint:`Select a session to see its link and agents.`,describe:`Session detail`})}function gH(e,t){return e===`lobby.thinking`||t===`1`}var _H=`bot-lobby.collapsed.`,vH=new Set,yH=new Map;function bH(e){if(yH.has(e))return yH.get(e);if(e===`lobby.thinking`)return gH(e);try{return gH(e,localStorage.getItem(_H+e))}catch{return!1}}function xH(e,t){yH.set(e,t);try{e!==`lobby.thinking`&&localStorage.setItem(_H+e,t?`1`:`0`)}catch{}for(let e of[...vH])e()}function SH(e){return vH.add(e),()=>{vH.delete(e)}}function CH(e){xH(e,!bH(e))}function wH(e){return[(0,m.useSyncExternalStore)(SH,()=>bH(e),()=>gH(e)),(0,m.useCallback)(()=>xH(e,!bH(e)),[e])]}function TH(e){let t=(0,m.useRef)(null),n=(0,m.useRef)(!0),[r,i]=(0,m.useState)(!0),a=(0,m.useRef)(void 0),o=(0,m.useRef)(null),s=(0,m.useCallback)(()=>{n.current=!0,i(!0);let e=t.current;e&&(e.scrollTop=e.scrollHeight)},[]);return(0,m.useLayoutEffect)(()=>{n.current&&s()},[e,s]),(0,m.useLayoutEffect)(()=>{let e=t.current;if(!e||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(()=>{n.current&&(e.scrollTop=e.scrollHeight)});return r.observe(e),a.current=r,()=>{r.disconnect(),a.current=void 0,o.current=null}},[]),(0,m.useLayoutEffect)(()=>{let e=a.current,n=t.current?.firstElementChild??null;e&&n!==o.current&&(o.current&&e.unobserve(o.current),n&&e.observe(n),o.current=n)},[e]),{ref:t,atBottom:r,stick:s,onScroll:(0,m.useCallback)(()=>{let e=t.current;e&&(n.current=e.scrollHeight-e.scrollTop-e.clientHeight<48,i(n.current))},[])}}function EH({entry:e}){return e.pending?(0,L.jsx)(FD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}):e.kind===`error`?(0,L.jsx)(bg,{"aria-hidden":`true`,className:`size-3.5 text-destructive`}):e.kind===`warning`?(0,L.jsx)(og,{"aria-hidden":`true`,className:`size-3.5 text-warning`}):e.kind===`success`?(0,L.jsx)(Op,{"aria-hidden":`true`,className:`size-3.5 text-success`}):(0,L.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`})}function DH({entry:e}){return(0,L.jsxs)(`li`,{className:`grid grid-cols-[2.75rem_5rem_1rem_minmax(0,1fr)] items-baseline gap-x-2 rounded-lg px-2 py-1.5 text-sm transition-colors hover:bg-muted`,children:[(0,L.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:AO(e.at)}),(0,L.jsx)(`span`,{className:q(`overflow-hidden text-xs font-medium whitespace-nowrap`,WB(e.source)),children:UB(e.source)}),(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`flex items-center justify-center self-center`,children:(0,L.jsx)(EH,{entry:e})}),(0,L.jsx)(`span`,{className:`sr-only`,children:e.pending?`pending`:e.kind}),(0,L.jsx)(`span`,{className:q(`min-w-0 break-words`,e.kind===`error`?`text-destructive`:e.pending?``:`text-muted-foreground`),children:e.pending?`${e.text}…`:e.text})]})}function OH({entries:e,collapsed:t,onToggle:n,shortcut:r,bare:i}){let a=e.slice(-400),o=a.filter(e=>e.pending).length,{ref:s,atBottom:c,stick:l,onScroll:u}=TH(JSON.stringify(a));return(0,L.jsxs)(ZR,{"aria-label":`Activity`,...i?{}:{title:`Activity`},collapsed:t,...n?{onToggle:n}:{},shortcut:r,className:`flex-1`,note:o?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(FD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}),` `,o,` running`]}):void 0,children:[(0,L.jsx)(`div`,{ref:s,onScroll:u,className:`min-h-0 flex-1 overflow-y-auto overscroll-y-contain px-2 pt-2 pb-dock outline-none focus-visible:bg-muted/30`,role:`log`,"aria-label":`Activity`,tabIndex:0,children:a.length===0?(0,L.jsx)(`p`,{className:`px-2 py-1 text-sm text-muted-foreground`,children:`No activity yet.`}):(0,L.jsx)(`ul`,{children:a.map(e=>(0,L.jsx)(DH,{entry:e},e.id))})}),c?null:(0,L.jsx)(`div`,{className:`absolute inset-x-0 bottom-dock z-10 flex justify-center`,children:(0,L.jsx)(Y,{label:`Jump to latest`,text:`Latest`,icon:mp,className:`rounded-full bg-card shadow-card`,onClick:l})})]})}function kH({source:e,live:t}){let n=BB(e);return(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`chat-avatar`,"data-live":t||void 0,"data-oracle":n||void 0,style:{"--orb":KB(e)},children:(0,L.jsx)(VB,{source:e,strokeWidth:2.25,className:n?`size-7`:`size-3.5`})})}function AH({source:e,name:t,time:n,head:r,live:i,children:a,aside:o,bubble:s=!0}){return(0,L.jsxs)(`div`,{className:`chat-row group/msg`,children:[(0,L.jsx)(`div`,{className:`chat-gutter`,children:r?(0,L.jsx)(kH,{source:e,live:i}):n?(0,L.jsx)(`time`,{className:`chat-hover-time`,children:n}):null}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[r?(0,L.jsxs)(`p`,{className:`chat-speaker`,children:[(0,L.jsx)(`span`,{className:`font-medium text-foreground`,children:t}),n?(0,L.jsx)(`time`,{className:`text-xs text-muted-foreground tabular-nums`,children:n}):null,o?(0,L.jsx)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:o}):null]}):null,s?(0,L.jsx)(`div`,{className:`chat-bubble-agent`,style:{"--orb":KB(e)},children:a}):a]})]})}function jH({time:e,head:t,note:n,children:r,below:i}){return(0,L.jsxs)(`div`,{className:`flex flex-col items-end gap-1`,children:[t?(0,L.jsxs)(`p`,{className:`flex items-baseline gap-2 text-xs text-muted-foreground`,children:[e?(0,L.jsx)(`time`,{className:`tabular-nums`,children:e}):null,(0,L.jsx)(`span`,{className:`font-medium text-foreground`,children:`You`}),n?(0,L.jsx)(`span`,{children:n}):null]}):null,(0,L.jsx)(`div`,{className:`chat-bubble`,children:r}),i]})}function MH({failed:e,children:t}){return(0,L.jsx)(`div`,{role:`note`,className:q(`chat-note`,e&&`text-destructive`),children:(0,L.jsx)(`span`,{children:t})})}function NH({className:e}){return(0,L.jsxs)(`span`,{"aria-hidden":`true`,className:q(`typing-dots`,e),children:[(0,L.jsx)(`span`,{}),(0,L.jsx)(`span`,{}),(0,L.jsx)(`span`,{})]})}var PH=3e5,FH=`earlier messages load as you scroll up`,IH=`No task is running in this session.`,LH=`Type a request below and press enter to start one: the oracle scouts, proposes, plans and delegates.`,RH=`Nothing said yet. Type below to talk to the oracle about this task.`;function zH({entry:e}){return(0,L.jsxs)(MH,{failed:e.text.startsWith(`✗`),children:[e.text,e.at?` · ${AO(e.at)}`:``]})}function BH({entry:e,head:t}){if(e.role===`you`)return(0,L.jsx)(jH,{time:AO(e.at),head:t,children:(0,L.jsx)(XR,{text:e.text})});let n=e.role===`panel`;return(0,L.jsx)(AH,{source:n?`PLANNER`:`ORACLE`,name:n?`Panel`:`Oracle`,time:AO(e.at),head:t,children:(0,L.jsx)(XR,{text:e.text})})}var VH=(0,m.memo)(function({entry:e,head:t,fresh:n}){return(0,L.jsx)(B.div,{initial:n?{opacity:0,y:10}:!1,animate:{opacity:1,y:0},transition:{type:`spring`,stiffness:420,damping:32},children:e.role===`note`?(0,L.jsx)(zH,{entry:e}):(0,L.jsx)(BH,{entry:e,head:t})})},(e,t)=>e.head===t.head&&e.entry.id===t.entry.id&&e.entry.text===t.entry.text&&e.entry.at===t.entry.at);function HH({text:e,busy:t}){let n=!!e?.trim();return!n&&!t?null:(0,L.jsx)(AH,{source:`ORACLE`,name:`Oracle`,head:!0,live:t,aside:t&&n?`writing…`:void 0,children:n?(0,L.jsx)(XR,{text:e??``}):(0,L.jsx)(NH,{className:`mt-1`})})}function UH({hasTask:e}){return(0,L.jsxs)(kD,{className:`h-full border-0`,children:[(0,L.jsxs)(AD,{children:[(0,L.jsx)(MD,{variant:`icon`,children:(0,L.jsx)(Jm,{"aria-hidden":`true`})}),e?null:(0,L.jsx)(ND,{children:IH}),(0,L.jsx)(PD,{children:e?RH:LH})]}),e?null:(0,L.jsxs)(`ul`,{className:`flex flex-col gap-2 text-sm text-muted-foreground`,children:[(0,L.jsxs)(`li`,{className:`flex items-center justify-center gap-2`,children:[`Or plan it first with the whole panel in `,(0,L.jsx)(cD,{chord:`3`}),` Plan`]}),(0,L.jsxs)(`li`,{className:`flex items-center justify-center gap-2`,children:[`or make a direct change in `,(0,L.jsx)(cD,{chord:`4`}),` Quick fix`]})]})]})}async function WH(e){let t=await Kf(`lobby.history`,{before:e});return{entries:t.entries,hasOlder:t.hasOlder}}function GH(e,t,n){let[r,i]=(0,m.useState)([]),[a,o]=(0,m.useState)(t),[s,c]=(0,m.useState)(!1),l=(0,m.useMemo)(()=>{let t=new Set(e.map(e=>e.id));return[...r.filter(e=>!t.has(e.id)),...e]},[r,e]);return{merged:l,more:a,loading:s,load:(0,m.useCallback)(async()=>{let e=l[0]?.id;if(e===void 0||s||!a)return;c(!0);let t=n.current,r=t?.scrollHeight??0,u=t?.scrollTop??0;try{let t=await WH(e);i(e=>[...t.entries,...e]),o(t.hasOlder),window.requestAnimationFrame(()=>{let e=n.current;e&&(e.scrollTop=e.scrollHeight-r+u)})}catch{o(!1)}finally{c(!1)}},[l,s,a,n])}}function KH({chat:e,reply:t,busy:n,hasOlder:r,hasTask:i,bare:a}){let{ref:o,atBottom:s,stick:c,onScroll:l}=TH(e.length+(t?.length??0)),{merged:u,more:d,loading:f,load:p}=GH(e,r,o),h=(0,m.useCallback)(()=>{l();let e=o.current;e&&e.scrollTop<80&&d&&!f&&p()},[l,o,d,f,p]),g=u.length===0&&!t?.trim()&&!n,[_,v]=(0,m.useState)(!1);return(0,m.useEffect)(()=>v(!0),[]),(0,L.jsxs)(ZR,{"aria-label":`Conversation`,...a?{}:{title:`Conversation`},note:d?FH:void 0,className:`flex-1`,children:[(0,L.jsx)(`div`,{ref:o,onScroll:h,className:`min-h-0 flex-1 overflow-y-auto overscroll-y-contain px-5 pt-4 pb-dock outline-none focus-visible:bg-muted/30`,role:`log`,"aria-label":`Conversation`,tabIndex:0,children:g?(0,L.jsx)(UH,{hasTask:i}):(0,L.jsxs)(`div`,{className:`chat-column`,children:[u.map((e,t)=>{let n=u[t-1],r=!n||n.role!==e.role||e.at-n.at>PH;return(0,L.jsx)(VH,{entry:e,head:r,fresh:_},e.id)}),(0,L.jsx)(HH,{text:t,busy:n})]})}),s?null:(0,L.jsx)(`div`,{className:`absolute right-4 bottom-dock z-10`,children:(0,L.jsx)(Y,{label:`Jump to latest`,text:`Latest`,icon:mp,tone:`primary`,className:`rounded-full shadow-sm`,onClick:c})})]})}function qH(e){let[t,n]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{if(!e)return;let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),t}function JH(e){return e===`running`?(0,L.jsx)(FD,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5`}):e===`success`?(0,L.jsx)(Op,{"aria-hidden":`true`,className:`size-3.5 text-success`}):e===`failed`||e===`timeout`||e===`error`?(0,L.jsx)(bg,{"aria-hidden":`true`,className:`size-3.5 text-destructive`}):(0,L.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/50`})}function YH(e,t){let n=e.startedAt?Date.parse(e.startedAt):NaN;return jO((e.finishedAt?Date.parse(e.finishedAt):t)-n)}function XH({runs:e}){let t=qH(e.some(e=>e.status===`running`));return e.length===0?null:(0,L.jsx)(`ul`,{className:`-mt-1 flex shrink-0 flex-wrap items-center gap-1.5 px-4 pb-3`,"aria-label":`Runs`,children:e.map((e,n)=>(0,L.jsxs)(`li`,{className:`flex items-center gap-2 rounded-full bg-muted py-1 pr-3 pl-2 text-xs`,children:[(0,L.jsx)(`span`,{className:`flex size-4 items-center justify-center`,children:JH(e.status)}),(0,L.jsx)(`span`,{className:`sr-only`,children:e.status??`unknown`}),(0,L.jsx)(`span`,{className:q(`font-medium`,WB(qB(e))),children:UB(qB(e))}),e.activity??e.step?(0,L.jsx)(`span`,{className:`max-w-[18rem] truncate text-muted-foreground`,children:e.activity??e.step}):null,(0,L.jsx)(`span`,{className:`tabular-nums text-muted-foreground`,children:YH(e,t)})]},e.runId??n))})}function ZH(e,t=0,n=!1){let r=!n&&!e.waiting&&!!e.runningSince,i=r?Date.parse(e.serverNow)-Date.parse(e.runningSince):0;return Math.max(0,e.elapsedMs)+(Number.isFinite(i)?Math.max(0,i):0)+(r?Math.max(0,t):0)}function QH(e){let t=Math.floor(e/1e3);return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m ${t%60}s`:`${Math.floor(t/3600)}h ${Math.floor(t%3600/60)}m`}function $H(e,t){let[n,r]=(0,m.useState)(0);return(0,m.useEffect)(()=>{if(r(0),!e)return;let t=performance.now(),n=window.setInterval(()=>r(performance.now()-t),1e3);return()=>window.clearInterval(n)},[e,t]),e?n:0}var eU=8;function tU(e){return e?e.path===`fast`?`fast track (${e.size})`:`full workflow (${e.size})`:``}function nU(e,t){let n=Math.min(t,eU);if(n<=0)return[];let r=Math.min(n,Math.round(Math.max(0,e)/t*n));return Array.from({length:n},(e,t)=>t<r)}function rU({done:e,total:t}){return(0,L.jsx)(`span`,{className:`inline-flex items-center gap-0.5`,"aria-hidden":`true`,children:nU(e,t).map((e,t)=>(0,L.jsx)(`span`,{className:q(`h-1.5 w-3 rounded-full`,e?`bg-primary`:`bg-muted-foreground/25`)},t))})}function iU({check:e,className:t}){return(0,L.jsx)(e===`done`?Hp:e===`dropped`?Qp:em,{"aria-hidden":`true`,className:q(`size-4 shrink-0`,e===`done`?`text-success`:`text-muted-foreground`,t)})}function aU({children:e}){return(0,L.jsx)(`span`,{className:`hidden shrink-0 items-center gap-1 text-xs text-muted-foreground md:inline-flex`,children:e})}function oU({ms:e,running:t,sample:n}){let r=$H(t,n);return(0,L.jsx)(`span`,{className:`tabular-nums`,children:QH(e+r)})}function sU({work:e}){return(0,L.jsxs)(`span`,{className:`hidden shrink-0 items-center gap-1 text-xs text-muted-foreground md:inline-flex`,title:`How long the agents have worked on this task (idle time left out)`,children:[(0,L.jsx)(ng,{"aria-hidden":`true`,className:`size-3 shrink-0`}),`worked `,(0,L.jsx)(oU,{ms:e.workedMs,running:e.running,sample:e})]})}function cU({active:e,current:t}){let n=e?.[0];return n?(0,L.jsxs)(`span`,{className:`hidden max-w-[20rem] min-w-0 items-center gap-1.5 xl:inline-flex`,children:[(0,L.jsx)(`span`,{className:`truncate text-foreground`,children:n.text}),(0,L.jsxs)(`span`,{className:`shrink-0 rounded-md bg-primary/10 px-1.5 py-px font-medium text-primary`,children:[`active · `,(0,L.jsx)(oU,{ms:n.workedMs,running:!0,sample:n})]}),e.length>1?(0,L.jsxs)(`span`,{className:`shrink-0`,children:[`+`,e.length-1]}):null]}):t?(0,L.jsxs)(`span`,{className:`hidden max-w-[16rem] truncate xl:inline`,children:[`next: `,(0,L.jsx)(`span`,{className:`text-foreground`,children:t})]}):null}function lU({done:e,total:t,current:n,active:r}){let i=t>0?Math.min(100,Math.round(e/t*100)):0;return(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,L.jsxs)(`span`,{className:`tabular-nums`,children:[e,` of `,t,` steps`]}),(0,L.jsx)(`div`,{className:`h-1.5 w-16 overflow-hidden rounded-full bg-border`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":e,"aria-label":`Plan progress`,children:(0,L.jsx)(B.div,{className:`h-full rounded-full bg-primary`,initial:!1,animate:{width:`${i}%`},transition:{type:`spring`,stiffness:260,damping:30}})}),(0,L.jsx)(cU,{...r?{active:r}:{},...n?{current:n}:{}})]})}function uU({task:e,status:t}){let n=t?.branch??t?.workspace.branch,r=e?.git?.branch??n;return(0,L.jsxs)(`section`,{className:`flex h-12 shrink-0 items-center gap-3 px-4`,"aria-label":`Task`,role:`group`,children:[(0,L.jsxs)(`h2`,{className:`min-w-0 flex-1 truncate text-[0.8125rem] font-medium`,title:e?.title,children:[e?.title??`No task yet`,e?null:(0,L.jsx)(`span`,{className:`ml-2 font-normal text-muted-foreground`,children:t?.sessionName??`Type a request below to start one.`})]}),e?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium`,children:e.state.replace(/_/g,` `)}),(0,L.jsx)(aU,{children:e.id}),e.track?(0,L.jsx)(aU,{children:tU(e.track)}):null,(e.domains??[]).length>0?(0,L.jsx)(aU,{children:e.domains.join(`, `)}):null,r?(0,L.jsxs)(`span`,{className:`hidden max-w-48 shrink-0 items-center gap-1 text-xs text-muted-foreground lg:inline-flex`,children:[(0,L.jsx)(Sm,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,L.jsxs)(`span`,{className:`truncate`,children:[r,e.git?.from?` · from ${e.git.from}`:``]})]}):null,e.work?(0,L.jsx)(sU,{work:e.work}):null,e.progress?(0,L.jsx)(lU,{done:e.progress.done,total:e.progress.total,...e.currentStep?{current:e.currentStep}:{},...e.activeSteps?{active:e.activeSteps}:{}}):null]}):null]})}var dU=(e,t)=>e?.keys.find(e=>e.action===t)?.label,fU=e=>e?.panels??{conversation:!0,activity:!0,thinking:!0};function pU({name:e,icon:t,shortcut:n,onClick:r}){return(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-label":`Expand ${e}`,"aria-expanded":!1,"aria-keyshortcuts":n,onClick:r,className:`btn-ghost inline-flex size-8 shrink-0 items-center justify-center rounded-lg border border-transparent text-muted-foreground transition-[box-shadow,color,translate] duration-150 ease-snap outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none`,children:(0,L.jsx)(t,{"aria-hidden":`true`,className:`size-4`})})}),(0,L.jsxs)(qD,{side:`left`,children:[`Expand `,e,n?(0,L.jsx)(cD,{chord:n}):null]})]})}function mU(e){let t=fU(e.status);return(0,L.jsx)(`aside`,{"aria-label":`Minimized panes`,className:`flex w-12 shrink-0 flex-col items-center gap-1 border-l border-border py-2`,children:t.activity&&e.activityFolded?(0,L.jsx)(pU,{name:`Activity`,icon:up,shortcut:dU(e.status,`activity`),onClick:e.toggleActivity}):null})}function hU(e){let{data:t,status:n,activityFolded:r,toggleActivity:i}=e,a=fU(n),o=a.activity&&!r;if(!a.conversation&&!o)return null;let s=a.conversation&&o;return(0,L.jsxs)(`div`,{className:q(`grid min-h-0 flex-1`,s?`grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)] divide-x divide-border`:`grid-cols-1`),children:[a.conversation?(0,L.jsx)(KH,{chat:t?.chat??[],reply:t?.reply,busy:n?.busy??!1,hasOlder:t?.hasOlderChat??!1,hasTask:!!t?.task}):null,o?(0,L.jsx)(OH,{entries:t?.activity??[],collapsed:!1,onToggle:i,shortcut:dU(n,`activity`)}):null]})}function gU(e){let{status:t}=e,n=fU(t).activity&&e.activityFolded;return(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,L.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:(0,L.jsx)(hU,{...e})}),n?(0,L.jsx)(mU,{...e}):null]})}function _U({data:e,status:t}){let n=fU(t),r=[...n.conversation?[{id:`conversation`,label:`Conversation`,icon:Jm}]:[],...n.activity?[{id:`activity`,label:`Activity`,icon:up}]:[]],[i,a]=(0,m.useState)(`conversation`),o=r.find(e=>e.id===i)??r[0],s=(e?.activity??[]).filter(e=>e.pending).length;return o?(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[r.length>1?(0,L.jsx)(`div`,{role:`radiogroup`,"aria-label":`Pane`,className:`flex shrink-0 items-center gap-0.5 border-b border-border px-3 py-2`,children:r.map(e=>{let t=e.id===o.id,n=e.icon;return(0,L.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,onClick:()=>a(e.id),className:q(`inline-flex h-8 items-center gap-1.5 rounded-lg border border-transparent px-2.5 text-[0.8125rem] font-medium outline-none transition-[box-shadow,color] focus-visible:ring-3 focus-visible:ring-ring/40`,t?`btn-raised bg-card text-foreground`:`btn-ghost text-muted-foreground hover:text-foreground`),children:[(0,L.jsx)(n,{"aria-hidden":`true`,className:`size-4`}),e.label,e.id===`activity`&&s>0?(0,L.jsx)(FD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}):null]},e.id)})}):null,o.id===`conversation`?(0,L.jsx)(KH,{chat:e?.chat??[],reply:e?.reply,busy:t?.busy??!1,hasOlder:e?.hasOlderChat??!1,hasTask:!!e?.task,bare:!0}):null,o.id===`activity`?(0,L.jsx)(OH,{entries:e?.activity??[],collapsed:!1,bare:!0}):null]}):null}function vU(e){let{data:t,status:n}=e,r=SO();return(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,L.jsxs)(`div`,{className:`shrink-0 border-b border-border`,children:[(0,L.jsx)(uU,{task:t?.task,status:n}),(0,L.jsx)(XH,{runs:JB(t)})]}),r?(0,L.jsx)(gU,{...e}):(0,L.jsx)(_U,{...e})]})}function yU(){let e=VD(`lobby`),t=VD(`status`),[n,r]=wH(`lobby.activity`);return!e.data&&e.loading?(0,L.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(FD,{}),(0,L.jsx)(`span`,{children:`Connecting…`})]}):!e.data&&e.error?(0,L.jsx)(LD,{message:e.error,onRetry:()=>Of.onHello({})}):(0,L.jsx)(vU,{data:e.data,status:t.data,activityFolded:n,toggleActivity:r})}var bU={master:`master`,scout:`scout`,worker:`worker`,reviewer:`QA gate`,researcher:`research`,quickfix:`quick fix`,planner:`oracle (plan)`,panel:`panel`};function xU(e){let t=Number.isFinite(e)?Math.max(0,Math.round(e/1e3)):0,n=Math.floor(t/60);if(n===0)return`${t}s`;let r=t%60;return r===0?`${n}m`:`${n}m ${String(r).padStart(2,`0`)}s`}function SU(e){return e>0?xU(e):`—`}function CU(e,t){return t>0?`${Math.round(e/t*100)}%`:`—`}function wU(e){return e<=0?`—`:e<.01?`<$0.01`:`$${e.toFixed(2)}`}function TU(e){return!Number.isFinite(e)||e<1e3?String(Math.max(0,Math.round(e||0))):e<1e6?`${Math.round(e/1e3)}k`:`${(e/1e6).toFixed(1)}M`}function EU(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(1)}s`}function DU(e){return e>=.9?{icon:`✓`,word:`healthy`,tone:`healthy`}:e>=.7?{icon:`!`,word:`shaky`,tone:`shaky`}:{icon:`✗`,word:`failing`,tone:`failing`}}function OU(e){return e===`model`?`by model · thinking`:`by model · thinking · agent`}function kU(e,t){let n=t===`model-kind`?bU[e.kinds[0]??``]??e.kinds[0]??``:``;return[e.model,e.thinking,n].filter(Boolean).join(` · `)}var AU=[`bg-chart-1`,`bg-chart-2`,`bg-chart-3`,`bg-chart-4`,`bg-chart-5`],jU={MASTER:`bg-primary`,ORACLE:`bg-primary`,DEV:`bg-source-dev`,DESIGN:`bg-source-design`,QA:`bg-source-qa`,RESEARCH:`bg-source-research`,"QUICK FIX":`bg-source-quickfix`};function MU(e){let t=jU[e.toUpperCase()];if(t)return t;let n=0;for(let t of e)n=(n*31+t.charCodeAt(0))%AU.length;return AU[n]??AU[0]}function NU(e){return bU[e]??e}var PU=6;function FU({title:e,right:t,children:n}){return(0,L.jsxs)(`section`,{className:`card-raised flex min-w-0 flex-col gap-3 rounded-xl border p-4`,"aria-label":e,children:[(0,L.jsxs)(`h2`,{className:`flex items-baseline justify-between gap-3 text-sm font-medium`,children:[(0,L.jsx)(`span`,{children:e}),t?(0,L.jsx)(`span`,{className:`truncate text-xs font-normal text-muted-foreground`,children:t}):null]}),n]})}function IU({rows:e,render:t}){let[n,r]=(0,m.useState)(!1),i=n?e:e.slice(0,PU);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:i.map(t)}),e.length>PU?(0,L.jsx)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"aria-expanded":n,onClick:()=>r(e=>!e),className:`h-6 self-start rounded-lg text-xs text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/30`,children:n?`Show fewer`:`Show all ${e.length}`}):null]})}function LU(e,t){return t>0?Math.max(1.5,e/t*100):0}function RU({label:e,value:t,marker:n,max:r,valueText:i,sub:a}){return(0,L.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-[0.8125rem]`,children:[(0,L.jsx)(`span`,{className:`min-w-0 truncate`,title:e,children:e}),(0,L.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[i,a?(0,L.jsx)(`span`,{className:`ml-2 text-xs text-muted-foreground`,children:a}):null]})]}),(0,L.jsxs)(`div`,{className:`relative h-1.5 rounded-full bg-muted`,role:`img`,"aria-label":`${e}: ${i}`,children:[(0,L.jsx)(`div`,{className:`h-full rounded-full bg-primary/70`,style:{width:`${LU(t,r)}%`}}),n?(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-1/2 h-3 w-0.5 -translate-y-1/2 rounded-full bg-foreground/40`,style:{left:`${Math.min(99.5,LU(n,r))}%`}}):null]})]})}function zU({groups:e,label:t}){let n=e.filter(e=>e.avgMs>0).sort((e,t)=>t.avgMs-e.avgMs),r=Math.max(...n.map(e=>Math.max(e.avgMs,e.p90Ms)),1);return(0,L.jsx)(FU,{title:`Average run time`,right:`per model · thinking · tick is p90`,children:n.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No timed runs yet.`}):(0,L.jsx)(IU,{rows:n,render:e=>(0,L.jsx)(RU,{label:t(e),value:e.avgMs,marker:e.p90Ms,max:r,valueText:SU(e.avgMs),sub:`p90 ${SU(e.p90Ms)}`},t(e))})})}var BU={healthy:`bg-success`,shaky:`bg-warning`,failing:`bg-destructive`},VU={healthy:`text-success`,shaky:`text-warning`,failing:`text-destructive`};function HU({label:e,rate:t,runs:n}){let r=DU(t),i=`${Math.round(t*100)}%`;return(0,L.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-[0.8125rem]`,children:[(0,L.jsx)(`span`,{className:`min-w-0 truncate`,title:e,children:e}),(0,L.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 tabular-nums`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5 ${VU[r.tone]}`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 rounded-full ${BU[r.tone]}`}),(0,L.jsx)(`span`,{className:`sr-only`,children:r.word}),i]}),(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[n,` run`,n===1?``:`s`]})]})]}),(0,L.jsxs)(`div`,{className:`flex h-1.5 overflow-hidden rounded-full bg-muted`,role:`img`,"aria-label":`${e}: ${r.word}, ${i} of ${n} runs`,children:[(0,L.jsx)(`div`,{className:`h-full bg-success/70`,style:{width:`${t*100}%`}}),(0,L.jsx)(`div`,{className:`h-full bg-destructive/45`,style:{width:`${(1-t)*100}%`}})]})]})}function UU({groups:e,label:t}){let n=e.filter(e=>e.runs>0).sort((e,t)=>e.successes/e.runs-t.successes/t.runs);return(0,L.jsx)(FU,{title:`Success rate`,right:`green worked · red failed`,children:n.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No runs yet.`}):(0,L.jsx)(IU,{rows:n,render:e=>(0,L.jsx)(HU,{label:t(e),rate:e.successes/e.runs,runs:e.runs},t(e))})})}function WU({share:e}){return(0,L.jsx)(`ul`,{className:`flex flex-wrap gap-x-6 gap-y-1.5 text-xs`,children:e.map(e=>(0,L.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`size-2 shrink-0 rounded-full ${MU(e.agent)}`,"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`text-[0.8125rem]`,children:UB(e.agent)}),(0,L.jsxs)(`span`,{className:`tabular-nums`,children:[Math.round(e.share*100),`%`]}),(0,L.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[`avg `,xU(e.ms/Math.max(1,e.runs)),` ×`,e.runs]})]},e.agent))})}function GU({share:e}){return(0,L.jsx)(`div`,{className:`flex h-2.5 gap-0.5 overflow-hidden rounded-full`,role:`img`,"aria-label":`Share of run time by agent`,children:e.map(e=>(0,L.jsx)(`span`,{className:`${MU(e.agent)} opacity-75 first:rounded-l-full last:rounded-r-full`,style:{width:`${e.share*100}%`},title:`${e.agent} ${Math.round(e.share*100)}%`},e.agent))})}function KU({times:e}){if(e.length===0)return null;let t=Math.max(...e.map(e=>e.avgMs),1);return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2.5 pt-1`,children:[(0,L.jsx)(`h3`,{className:`text-xs text-muted-foreground`,children:`Request to done, by the oracle's model`}),(0,L.jsx)(IU,{rows:e,render:e=>(0,L.jsx)(RU,{label:[e.model,e.thinking].filter(Boolean).join(` · `),value:e.avgMs,max:t,valueText:xU(e.avgMs),sub:`×${e.tasks}`},`${e.model}-${e.thinking}`)})]})}function qU({timeShare:e}){let t=e.byAgent;return(0,L.jsx)(FU,{title:`Where the time goes`,right:`share of run time by agent`,children:t.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No timed runs yet.`}):(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(GU,{share:t}),(0,L.jsx)(WU,{share:t}),(0,L.jsx)(KU,{times:e.taskTimes})]})})}function JU({label:e,value:t,sub:n}){return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,L.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:t}),n?(0,L.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:n}):null]})}var YU=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function XU({summary:e}){let t=Object.entries(e.byPurpose).sort((e,t)=>t[1]-e[1]);return(0,L.jsxs)(`section`,{className:`card-raised flex flex-col gap-3 rounded-xl border p-4`,"aria-label":`Classifier (Jev)`,children:[(0,L.jsx)(`h2`,{className:`text-sm font-medium`,children:`Classifier (Jev)`}),e.calls===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`no calls recorded`}):(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-3 sm:grid-cols-4`,children:[(0,L.jsx)(JU,{label:`Calls`,value:YU(e.calls,`call`),sub:`${CU(e.ok,e.calls)} ok`}),(0,L.jsx)(JU,{label:`Speed`,value:`p50 ${EU(e.p50Ms)}`,sub:`p90 ${EU(e.p90Ms)}`}),(0,L.jsx)(JU,{label:`Read`,value:e.input>0?`${TU(e.input)} tokens`:`—`}),(0,L.jsx)(JU,{label:`Routed down`,value:e.routed>0?YU(e.routed,`run`):`none`,sub:e.routed>0?`${CU(e.routedOk,e.routed)} ok`:`no runs routed`})]}),(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`text-primary`,children:`spared`}),` `,YU(e.seatRunsSkipped,`seat run`),` skipped · `,YU(e.questionsAnswered,`question`),` answered · `,YU(e.quickFixesHeld,`quick fix`,`quick fixes`),` held`,t.length>0?(0,L.jsx)(`span`,{className:`ml-3 border-l border-border pl-3`,children:t.map(([e,t])=>`${e} ${t}`).join(` · `)}):null]})]})}var ZU=[`Runs`,`OK`,`Avg`,`p50`,`p90`,`Turns`,`Tools`,`Tokens`,`tok/s`,`$/run`,`$ total`,`Stalls`];function QU(e,t=0){return e>0?e.toFixed(t):`—`}function $U(e){return[String(e.runs),CU(e.successes,e.runs),SU(e.avgMs),SU(e.p50Ms),SU(e.p90Ms),QU(e.avgTurns,1),QU(e.avgTools,1),e.avgTokens>0?TU(e.avgTokens):`—`,e.tokensPerSecond>0?e.tokensPerSecond.toFixed(0):`—`,wU(e.avgCost),wU(e.totalCost),e.timeouts>0?String(e.timeouts):`—`]}function eW(e,t){return t===`model-kind`?NU(e.kinds[0]??``):e.kinds.map(NU).join(`, `)}function tW({groups:e,groupBy:t}){return(0,L.jsxs)(`section`,{className:`card-raised flex min-h-0 flex-col gap-2 overflow-hidden rounded-xl border pt-4`,"aria-label":`All models`,children:[(0,L.jsxs)(`h2`,{className:`flex flex-wrap items-baseline justify-between gap-3 px-4 text-sm font-medium`,children:[(0,L.jsx)(`span`,{children:`All models`}),(0,L.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[t===`model`?`by model · thinking`:`by model · thinking · agent`,` · sorted by runs`]})]}),(0,L.jsx)(`div`,{className:`max-h-80 overflow-auto outline-none focus-visible:ring-3 focus-visible:ring-ring/40`,tabIndex:0,role:`region`,"aria-label":`All model metrics, scroll horizontally to see all columns`,children:(0,L.jsxs)(`table`,{className:`w-full border-collapse text-xs`,children:[(0,L.jsx)(`thead`,{className:`sticky top-0 bg-card text-muted-foreground`,children:(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-left font-medium`,children:`Model`}),(0,L.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-left font-medium`,children:`Think`}),(0,L.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-left font-medium`,children:t===`model-kind`?`Agent`:`Agents`}),ZU.map(e=>(0,L.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-right font-medium whitespace-nowrap`,children:e},e))]})}),(0,L.jsx)(`tbody`,{children:e.map(e=>(0,L.jsxs)(`tr`,{className:`border-t border-border/70 transition-colors hover:bg-muted`,children:[(0,L.jsx)(`th`,{scope:`row`,className:`px-3 py-1.5 text-left font-normal text-foreground`,children:e.model}),(0,L.jsx)(`td`,{className:`px-3 py-1.5 whitespace-nowrap text-muted-foreground`,children:e.thinking||`—`}),(0,L.jsx)(`td`,{className:`px-3 py-1.5 whitespace-nowrap text-muted-foreground`,children:eW(e,t)||`—`}),$U(e).map((e,t)=>(0,L.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums whitespace-nowrap text-foreground`,children:e},ZU[t]))]},kU(e,t)))})]})})]})}var nW={healthy:`bg-success`,shaky:`bg-warning`,failing:`bg-destructive`};function rW({label:e,value:t,sub:n,dot:r}){return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5 bg-card px-4 py-3.5`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-2xl leading-tight font-semibold tracking-tight tabular-nums`,children:[r?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 shrink-0 rounded-full ${nW[r.tone]}`}),(0,L.jsx)(`span`,{className:`sr-only`,children:r.word})]}):null,t]}),(0,L.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:n||`\xA0`})]})}function iW({tiles:e}){let t=DU(e.runs>0?e.successes/e.runs:0),n=e.runs-e.successes;return(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-px overflow-hidden rounded-xl border border-border bg-border shadow-card sm:grid-cols-5 [&>:last-child]:col-span-2 sm:[&>:last-child]:col-span-1`,children:[(0,L.jsx)(rW,{label:`Runs`,value:String(e.runs),sub:e.runs===0?`no runs yet`:``}),(0,L.jsx)(rW,{label:`Success`,value:CU(e.successes,e.runs),sub:`${n} failed${e.stalls>0?` · ${e.stalls} stalled`:``}`,dot:{tone:t.tone,word:t.word}}),(0,L.jsx)(rW,{label:`Avg run`,value:SU(e.avgMs),sub:`p90 ${SU(e.p90Ms)}`}),(0,L.jsx)(rW,{label:`Cost`,value:wU(e.cost),sub:e.runs>0?`${wU(e.cost/e.runs)} per run`:`—`}),(0,L.jsx)(rW,{label:`Tasks`,value:`${e.completed} done`,sub:e.avgCompleteMs>0?`avg ${xU(e.avgCompleteMs)} · ${e.active} active`:`${e.active} active`})]})}var aW=`No runs recorded yet. Every Master turn, subagent run, quick fix and planning round lands here with its model, thinking level, time, tokens and cost.`;function oW({groupBy:e,onGroup:t}){return(0,L.jsx)(`div`,{role:`radiogroup`,"aria-label":`Group by`,className:`flex gap-0.5 rounded-lg bg-muted p-0.5`,onKeyDown:n=>{let r=n.key===`ArrowRight`||n.key===`ArrowDown`?1:n.key===`ArrowLeft`||n.key===`ArrowUp`?-1:0;if(!r)return;n.preventDefault();let i=[`model`,`model-kind`],a=i[(i.indexOf(e)+r+i.length)%i.length];t(a),requestAnimationFrame(()=>n.currentTarget.querySelector(`[aria-checked='true']`)?.focus())},children:[`model`,`model-kind`].map(n=>(0,L.jsx)(J,{variant:`ghost`,size:`sm`,role:`radio`,tabIndex:e===n?0:-1,className:e===n?`bg-card text-foreground shadow-card hover:bg-card`:`text-muted-foreground`,"aria-checked":e===n,onClick:()=>t(n),children:OU(n)},n))})}function sW({query:e,onQuery:t}){return(0,L.jsxs)(`label`,{className:`relative flex items-center`,children:[(0,L.jsx)(`span`,{className:`sr-only`,children:`Search runs`}),(0,L.jsx)(Rh,{"aria-hidden":`true`,className:`pointer-events-none absolute left-2.5 size-3.5 text-muted-foreground`}),(0,L.jsx)(`input`,{id:`metrics-search`,type:`search`,value:e,maxLength:500,placeholder:`Search runs: model, agent, tool…`,onChange:e=>t(e.target.value),className:`h-8 w-64 max-w-full rounded-lg border border-input bg-background pr-9 pl-8 text-xs outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30`}),(0,L.jsx)(cD,{chord:`/`,className:`kbd-hint pointer-events-none absolute right-2`})]})}function cW({data:e,groupBy:t,query:n}){let r=e=>kU(e,t);return e.tiles.runs===0?(0,L.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,L.jsx)(iW,{tiles:e.tiles}),(0,L.jsx)(`p`,{className:`card-raised rounded-xl border p-4 text-sm text-muted-foreground`,children:n?`No run matches "${n}".`:aW})]}):(0,L.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,L.jsx)(iW,{tiles:e.tiles}),e.classifier?(0,L.jsx)(XU,{summary:e.classifier}):null,(0,L.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,L.jsx)(zU,{groups:e.groups,label:r}),(0,L.jsx)(UU,{groups:e.groups,label:r})]}),(0,L.jsx)(qU,{timeShare:e.timeShare}),(0,L.jsx)(tW,{groups:e.groups,groupBy:t})]})}function lW(){return(0,L.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5`,role:`status`,"aria-label":`Loading metrics`,children:[0,1,2,3,4].map(e=>(0,L.jsx)(`div`,{className:`h-20 rounded-lg bg-muted motion-safe:animate-pulse`},e))})}function uW(){let[e,t]=(0,m.useState)(`model`),[n,r]=(0,m.useState)(``),i=UD(`metrics.get`,{groupBy:e,query:n},[`metrics`]);return!i.data&&i.error?(0,L.jsx)(LD,{message:`Could not load metrics. ${i.error}`,onRetry:i.reload}):(0,L.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-4 px-5 pt-5 pb-dock`,children:[(0,L.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,L.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`Metrics`}),i.loading&&i.data?(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,L.jsx)(FD,{className:`size-3`,"aria-hidden":`true`,role:`presentation`}),` refreshing`]}):null,(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-4 flex-1`}),(0,L.jsx)(oW,{groupBy:e,onGroup:t}),(0,L.jsx)(sW,{query:n,onQuery:r})]}),i.data?(0,L.jsx)(cW,{data:i.data,groupBy:e,query:n}):(0,L.jsx)(lW,{})]})}var dW=class{seen=new Set;initialized=new Set;storage;constructor(e){this.storage=e;try{let t=JSON.parse(e?.getItem(`bot-lobby.prompt-seen`)??`[]`);Array.isArray(t)&&(this.seen=new Set(t.filter(e=>typeof e==`string`)))}catch{}}observe(e,t,n=!1){let r=this.initialized.has(e)&&!n?t.filter(e=>!this.seen.has(e)):[];this.initialized.add(e);for(let e of t)this.seen.add(e);try{this.storage?.setItem(`bot-lobby.prompt-seen`,JSON.stringify([...this.seen]))}catch{}return r}};function fW(e,t){return JSON.stringify([e,`prompt`,t])}function pW(e,t,n){return JSON.stringify([e,`dialog`,t,n])}function mW(e,t,n){return JSON.stringify([e,`delivery`,t,n])}var hW=`bot-lobby.prompt-sound-muted`,gW=new Set,_W,vW=!1;function yW(){try{return localStorage.getItem(hW)===`on`}catch{return vW}}function bW(e){vW=e;try{localStorage.setItem(hW,e?`on`:`off`)}catch{}for(let e of gW)e()}function xW(e){return gW.add(e),()=>{gW.delete(e)}}function SW(){return(0,m.useSyncExternalStore)(xW,yW,()=>!1)}function CW(){(0,m.useEffect)(()=>{let e=()=>{try{_W??=new AudioContext,_W.resume().catch(()=>void 0)}catch{}};return window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,e)}},[])}function wW(){if(!yW()&&_W&&_W.state===`running`)try{let e=_W.currentTime,t=_W.createOscillator(),n=_W.createGain();t.frequency.setValueAtTime(960,e),t.frequency.exponentialRampToValueAtTime(360,e+.16),n.gain.setValueAtTime(1e-4,e),n.gain.exponentialRampToValueAtTime(.12,e+.012),n.gain.exponentialRampToValueAtTime(1e-4,e+.22),t.connect(n),n.connect(_W.destination),t.start(e),t.stop(e+.24),t.onended=()=>{t.disconnect(),n.disconnect()}}catch{}}var TW=`bot-lobby.notifications`,EW=`/icon-192.png`,DW=new Set;function OW(){for(let e of[...DW])e()}function kW(){try{return localStorage.getItem(TW)===`on`}catch{return!1}}function AW(e){return DW.add(e),()=>{DW.delete(e)}}function jW(e){try{localStorage.setItem(TW,e?`on`:`off`)}catch{}OW()}function MW(){return(0,m.useSyncExternalStore)(AW,kW,()=>!1)}async function NW(){return typeof Notification>`u`?`unsupported`:(Notification.permission==="default"&&await Notification.requestPermission().catch(()=>void 0),Notification.permission===`granted`?(jW(!0),`granted`):`denied`)}function PW(){jW(!1)}function FW(e){if(e===`completed`)return`finished`;if(e===`abandoned`)return`dropped`}function IW(){return typeof Notification<`u`&&Notification.permission===`granted`&&document.hidden}function LW(e){try{new Notification(`bot-lobby`,{body:e,icon:EW,tag:`bot-lobby`})}catch{}}function RW(){try{return new dW(sessionStorage)}catch{return new dW}}function zW(e,t){let n=t.payload;return t.kind===`sessionDialog`&&n?.dialog?.id?pW(e,t.sessionId??n.key??t.from,n.dialog.id):fW(e,t.id)}function BW(){let e=MW();CW(),zD();let t=UD(`tasks.list`,{},[`tasks`]),n=UD(`sessions.list`,{},[`sessions`]),r=Of.get(`prompts`),i=Of.get(`lobby`).data,a=(0,m.useRef)(RW()),o=(0,m.useRef)(new Set([`prompts`,`sessions`,`delivery`])),s=(0,m.useRef)(void 0),c=Vf()??`current`,l=Of.status().connection;return{enabled:e,tasks:t,sessions:n,prompts:r,lobby:i,seen:a,quiet:o,previousState:s,project:c,connection:l,lastConnection:(0,m.useRef)(l)}}function VW(e,t,n,r,i){if(!i)return;let{seen:a,project:o,quiet:s,enabled:c}=e,l=a.current.observe(`${o}:${t}`,n,s.current.has(t));s.current.delete(t),l.length&&(l.forEach(()=>wW()),c&&IW()&&LW(r),t===`delivery`&&V.info(r,{action:{label:`Review tasks`,onClick:()=>DD(`#/tasks`)}}))}function HW(e){let{prompts:t,sessions:n,tasks:r,project:i}=e,a=t.data?.prompts;VW(e,`prompts`,(a??[]).map(e=>zW(i,e)),`A question is waiting for you.`,!!a&&!t.loading),VW(e,`sessions`,n.data?.background.flatMap(e=>e.dialogs.map(t=>pW(i,e.sessionId??e.key,t.id)))??[],`A background session is asking something.`,!!n.data&&!n.loading),VW(e,`delivery`,r.data?.rows.filter(e=>e.delivery&&(e.delivery.status===`pending_approval`||e.delivery.status===`deferred`||e.delivery.status===`recoverable_failure`)).map(e=>mW(i,e.id,e.delivery.reviewId))??[],`Completed work is ready for delivery review in Tasks.`,!!r.data&&!r.loading)}function UW(e){let{lastConnection:t,connection:n,quiet:r,previousState:i,lobby:a,enabled:o}=e;if(t.current!==n||n!==`live`){t.current=n,r.current=new Set([`prompts`,`sessions`,`delivery`]),i.current=void 0;return}HW(e);let s=a?.task?.state??``,c=FW(s);i.current&&c&&s!==i.current&&o&&IW()&&LW(`${a?.task?.title??`The task`} ${c}.`),i.current=s}function WW(){let e=BW(),{connection:t,enabled:n,project:r,prompts:i,sessions:a,tasks:o,lobby:s}=e;(0,m.useEffect)(()=>UW(e),[t,n,r,i.data,i.loading,a.data,a.loading,o.data,o.loading,s])}function GW({className:e,type:t,...n}){return(0,L.jsx)(`input`,{type:t,"data-slot":`input`,className:q(`flex h-8 w-full rounded-lg border border-input bg-background px-3 py-1 text-base transition-[border-color,box-shadow] duration-150 outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:disabled:bg-input/80`,e),...n})}function KW({className:e,thumbClassName:t,...n}){return(0,L.jsx)(cE,{"aria-keyshortcuts":`Enter Space`,"aria-description":`When focused, press Enter or Space to toggle.`,"data-slot":`switch`,className:q(`peer relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors duration-150 outline-none before:absolute before:-inset-x-2 before:-inset-y-3 before:content-[''] focus-visible:ring-3 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,e),...n,children:(0,L.jsx)(uE,{"data-slot":`switch-thumb`,className:q(`pointer-events-none block size-4 rounded-full bg-white shadow-sm ring-0 transition-transform duration-200 ease-snap data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0`,t)})})}var qW=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],JW={repeat:1/0},YW=`M0 -4 L1 -1 L4 0 L1 1 L0 4 L-1 1 L-4 0 L-1 -1Z`,XW=[`var(--rainbow-1)`,`var(--rainbow-2)`,`var(--rainbow-3)`,`var(--rainbow-4)`,`var(--rainbow-5)`,`var(--rainbow-6)`,`var(--rainbow-7)`],ZW={transformBox:`fill-box`,transformOrigin:`center`};function QW(e){switch(e){case`off`:return{animate:{scale:[1,1.03,1],rotate:-5},transition:{...JW,duration:4,ease:`easeInOut`}};case`minimal`:return{animate:{rotate:[0,0,7,9,0,0],y:[0,0,1.5,2,0,0]},transition:{...JW,duration:4.2,times:[0,.35,.7,.82,.86,1],ease:`easeInOut`}};case`low`:return{animate:{rotate:[-4,4,-4],y:[0,-1,0]},transition:{...JW,duration:3.2,ease:`easeInOut`}};case`medium`:return{animate:{rotate:[0,-5,-5,5,5,0],y:[0,-1,-1,-1,-1,0]},transition:{...JW,duration:4,times:[0,.12,.4,.52,.8,1],ease:`easeInOut`}};case`high`:return{animate:{y:[0,-1.5,0]},transition:{...JW,duration:.6,ease:`easeInOut`}};case`xhigh`:return{animate:{y:[0,-7,0,0],scaleY:[1,1.06,.88,1],scaleX:[1,.96,1.1,1]},transition:{...JW,duration:.7,times:[0,.4,.75,1],ease:`easeInOut`}};case`max`:return{animate:{y:[-1,-4,-1],rotate:[-3,3,-3]},transition:{...JW,duration:1.6,ease:`easeInOut`}}}}function $W(){return(0,L.jsx)(`g`,{className:`fill-muted-foreground`,fontWeight:`700`,children:[0,1,2].map(e=>(0,L.jsx)(B.text,{x:44+e*4.5,y:17-e*5.5,fontSize:5.5+e*2,initial:{opacity:0},animate:{opacity:[0,1,0],y:[3,-4],x:[0,2.5]},transition:{...JW,duration:2.6,delay:e*.8,ease:`easeOut`},children:`z`},e))})}function eG(){return(0,L.jsx)(`g`,{className:`fill-primary`,fontSize:`9`,children:[0,1].map(e=>(0,L.jsx)(B.text,{x:48,y:20,initial:{opacity:0},animate:{opacity:[0,1,1,0],y:[2,-5,-11,-17],x:[0,3,1,5],rotate:[0,12,-8,10]},transition:{...JW,duration:3,delay:e*1.5,ease:`easeOut`},style:ZW,children:e?`♫`:`♪`},e))})}function tG(){return(0,L.jsx)(B.text,{x:52,y:14,fontSize:`12`,fontWeight:`700`,className:`fill-primary`,initial:{opacity:0,scale:0},animate:{opacity:[0,0,1,1,0],scale:[0,0,1.2,1,.6],rotate:[0,0,-12,8,0]},transition:{...JW,duration:4,times:[0,.5,.58,.85,1]},style:ZW,children:`?`})}function nG({spots:e,rainbow:t}){return(0,L.jsx)(`g`,{children:e.map(([e,n,r],i)=>(0,L.jsx)(B.path,{d:YW,className:t?void 0:`fill-primary`,style:{x:e,y:n,...t?{fill:XW[i%XW.length]}:{}},initial:{scale:0},animate:{scale:[0,1.1,0],rotate:[0,90,180]},transition:{...JW,duration:1.3,delay:r,ease:`easeInOut`}},i))})}function rG(){return(0,L.jsx)(`g`,{children:[-20,20].map((e,t)=>(0,L.jsxs)(`g`,{transform:`rotate(${e} 32 34)`,children:[(0,L.jsx)(`ellipse`,{cx:32,cy:34,rx:30,ry:9,fill:`none`,strokeWidth:.8,strokeDasharray:`2 3`,className:`stroke-primary/35`}),(0,L.jsx)(B.circle,{r:2,className:`fill-primary`,animate:{cx:[2,32,62,32,2],cy:[34,43,34,25,34]},transition:{...JW,duration:1.1,delay:t*.55,ease:`linear`}})]},e))})}function iG(){return(0,L.jsx)(B.path,{d:`M53 22 Q56 27 53 29 Q50 27 53 22Z`,className:`fill-primary/60`,animate:{y:[0,8],opacity:[0,1,0]},transition:{...JW,duration:.9,ease:`easeIn`,repeatDelay:.5}})}function aG({id:e}){return(0,L.jsx)(B.circle,{cx:32,cy:34,r:27,fill:`url(#${e}-glow)`,animate:{scale:[.92,1.08,.92],opacity:[.5,.85,.5]},transition:{...JW,duration:1.6,ease:`easeInOut`},style:{transformOrigin:`32px 34px`}})}function oG({rainbow:e}){return(0,L.jsx)(`g`,{children:Array.from({length:8},(t,n)=>{let r=n/8*Math.PI*2;return(0,L.jsx)(B.circle,{cx:32,cy:34,r:2,className:e?void 0:`fill-primary`,style:e?{fill:XW[n%XW.length]}:void 0,initial:{opacity:1,scale:1},animate:{cx:32+Math.cos(r)*32,cy:34+Math.sin(r)*30,opacity:0,scale:.3},transition:{duration:.6,ease:`easeOut`}},n)})})}function sG({level:e,move:t}){let n={fill:`none`,strokeWidth:2.2,strokeLinecap:`round`,className:`stroke-foreground`};if(e===`off`)return(0,L.jsx)(`path`,{d:`M20 33 Q24.5 36.5 29 33 M35 33 Q39.5 36.5 44 33`,...n});if(e===`low`)return(0,L.jsx)(`path`,{d:`M20 34 Q24.5 29.5 29 34 M35 34 Q39.5 29.5 44 34`,...n});if(e===`max`)return(0,L.jsx)(`g`,{children:[25,39].map((e,n)=>(0,L.jsx)(B.path,{d:`M0 -5.5 L1.6 -1.6 L5.5 0 L1.6 1.6 L0 5.5 L-1.6 1.6 L-5.5 0 L-1.6 -1.6Z`,style:{x:e,y:33,fill:XW[n?4:0]},animate:t?{rotate:[0,90,180],scale:[1,1.25,1]}:{},transition:{...JW,duration:1.2,ease:`easeInOut`,delay:n*.2}},e))});let r=e===`minimal`?.45:e===`high`?.7:e===`xhigh`?1.2:1,i=t&&e===`medium`?{x:[0,-2.5,-2.5,2.5,2.5,0]}:{x:0},a=t&&e===`medium`?{...JW,duration:4,times:[0,.12,.4,.52,.8,1]}:{duration:.2},o=e===`minimal`?3.2:e===`xhigh`?1.4:3.6,s=t?{scaleY:[r,r,.1,r,r]}:{scaleY:r},c=t?{...JW,duration:o,times:[0,.44,.5,.56,1]}:{duration:.2};return(0,L.jsx)(B.g,{animate:i,transition:a,children:[25,39].map(t=>(0,L.jsxs)(`g`,{children:[(0,L.jsx)(B.ellipse,{cx:t,cy:33,rx:3.4,ry:3.8,className:`fill-foreground`,style:ZW,animate:s,transition:c}),e===`minimal`?null:(0,L.jsx)(`circle`,{cx:t+1.2,cy:31.6,r:1,className:`fill-card`})]},t))})}function cG({level:e,move:t}){let n={fill:`none`,strokeWidth:2,strokeLinecap:`round`,className:`stroke-foreground`};switch(e){case`off`:return(0,L.jsxs)(`g`,{children:[(0,L.jsx)(`circle`,{cx:32,cy:42,r:1.4,className:`fill-foreground`}),t?(0,L.jsx)(B.circle,{cx:35,cy:42,r:3,fill:`none`,strokeWidth:.9,className:`stroke-primary/60`,animate:{scale:[.2,1.3,1.5,0],opacity:[.6,.9,.9,0]},transition:{...JW,duration:4,times:[0,.7,.9,1]},style:{transformOrigin:`33px 42px`}}):null]});case`minimal`:return(0,L.jsx)(B.ellipse,{cx:32,cy:42,rx:3,ry:.8,className:`fill-foreground`,animate:t?{ry:[.8,.8,3.6,3.6,.8],rx:[3,3,3.6,3.6,3]}:{},transition:{...JW,duration:6,times:[0,.6,.7,.85,1]}});case`low`:return(0,L.jsx)(`path`,{d:`M26 40 Q32 45 38 40`,...n});case`medium`:return(0,L.jsx)(`path`,{d:`M28 41.5 Q32 43 36 41.5`,...n});case`high`:return(0,L.jsx)(`path`,{d:`M27 42 L37 41`,...n});case`xhigh`:return(0,L.jsx)(`path`,{d:`M25.5 39.5 Q32 47 38.5 39.5Z`,className:`fill-foreground`});case`max`:return(0,L.jsxs)(`g`,{children:[(0,L.jsx)(`path`,{d:`M24 38.5 Q32 50 40 38.5Z`,className:`fill-foreground`}),(0,L.jsx)(`path`,{d:`M28.5 44.5 Q32 47.5 35.5 44.5 Q32 43 28.5 44.5Z`,style:{fill:`var(--rainbow-1)`}})]})}}function lG({level:e,className:t}){let n=qd()??!1,r=qW.includes(e)?e:`medium`,i=`m${(0,m.useId)().replace(/[^a-zA-Z0-9]/g,``)}`,a=!n,o=qW.indexOf(r),s=(0,m.useRef)(o),[c,l]=(0,m.useState)({n:0,up:!0});(0,m.useEffect)(()=>{o!==s.current&&(l(e=>({n:e.n+1,up:o>s.current})),s.current=o)},[o]);let u=QW(r),d=r===`max`,f=d?{stroke:`url(#${i}-rainbow)`}:void 0,p=!a||c.n===0?void 0:c.up?{y:[0,-9,0,0],scaleX:[1,.9,1.1,1],scaleY:[1,1.12,.9,1]}:{y:[0,0,0],scaleX:[1,1.12,1],scaleY:[1,.84,1]};return(0,L.jsxs)(`svg`,{viewBox:`0 0 64 64`,"data-slot":`effort-mascot`,"data-level":r,"aria-hidden":`true`,focusable:`false`,className:q(`size-14 shrink-0 overflow-visible`,t),children:[(0,L.jsxs)(`defs`,{children:[(0,L.jsxs)(`linearGradient`,{id:`${i}-rainbow`,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[XW.map((e,t)=>(0,L.jsx)(`stop`,{offset:t/(XW.length-1),stopColor:e},t)),a&&d?(0,L.jsx)(`animateTransform`,{attributeName:`gradientTransform`,type:`rotate`,from:`0 0.5 0.5`,to:`360 0.5 0.5`,dur:`2.4s`,repeatCount:`indefinite`}):null]}),(0,L.jsxs)(`radialGradient`,{id:`${i}-glow`,children:[(0,L.jsx)(`stop`,{offset:`0.35`,stopColor:`var(--rainbow-6)`,stopOpacity:`0.45`}),(0,L.jsx)(`stop`,{offset:`0.7`,stopColor:`var(--rainbow-1)`,stopOpacity:`0.18`}),(0,L.jsx)(`stop`,{offset:`1`,stopColor:`var(--rainbow-3)`,stopOpacity:`0`})]})]}),d?a?(0,L.jsx)(aG,{id:i}):(0,L.jsx)(`circle`,{cx:32,cy:34,r:27,fill:`url(#${i}-glow)`}):null,a&&r===`xhigh`?(0,L.jsx)(rG,{}):null,(0,L.jsx)(B.g,{animate:p,transition:{duration:c.up?.55:.45,ease:`easeOut`},style:{transformOrigin:`32px 56px`},children:(0,L.jsxs)(B.g,{animate:a?u.animate:{rotate:r===`off`?-5:0},transition:a?u.transition:{duration:0},style:{transformOrigin:`32px 56px`},children:[(0,L.jsxs)(B.g,{style:{transformOrigin:`32px 17px`},animate:r===`off`?{rotate:32}:r===`minimal`?{rotate:14}:a&&r===`medium`?{rotate:[0,-12,10,0]}:a&&(r===`xhigh`||r===`max`)?{rotate:[-10,10,-10]}:{rotate:0},transition:a&&(r===`medium`||r===`xhigh`||r===`max`)?{...JW,duration:r===`medium`?2:.5,ease:`easeInOut`}:{type:`spring`,stiffness:200,damping:14},children:[(0,L.jsx)(`path`,{d:`M32 17 V10`,strokeWidth:2,strokeLinecap:`round`,className:d?void 0:`stroke-primary/70`,style:f}),(0,L.jsx)(B.circle,{cx:32,cy:7.5,r:3.2,className:d?void 0:r===`off`?`fill-muted-foreground/40`:`fill-primary`,style:{...ZW,...d?{fill:`url(#${i}-rainbow)`}:{}},animate:a?r===`high`?{opacity:[1,.3,1]}:r===`medium`?{scale:[1,1.25,1]}:d||r===`xhigh`?{scale:[1,1.5,1]}:{scale:1,opacity:1}:{scale:1,opacity:1},transition:{...JW,duration:r===`high`?.5:r===`medium`?1.6:.4}})]}),[4.5,54].map((e,t)=>(0,L.jsx)(B.rect,{x:e,y:29,width:5.5,height:11,rx:2.5,className:d?void 0:`fill-primary/25`,style:{...ZW,...d?{fill:XW[t?5:1],opacity:.6}:{}},animate:a&&(r===`xhigh`||d)?{rotate:t?[0,18,0]:[0,-18,0]}:{rotate:0},transition:{...JW,duration:.35}},e)),(0,L.jsx)(`rect`,{x:10,y:17,width:44,height:36,rx:11,strokeWidth:d?2.6:2,className:d?`fill-primary/10`:`fill-primary/10 stroke-primary/75`,style:f}),(0,L.jsx)(`rect`,{x:15,y:23,width:34,height:25,rx:7.5,className:`fill-card stroke-border`,strokeWidth:1}),a&&r===`high`?(0,L.jsx)(B.rect,{y:24,width:2,height:23,rx:1,className:`fill-primary/25`,animate:{x:[16,46,16]},transition:{...JW,duration:1.6,ease:`easeInOut`}}):null,r===`low`||d?(0,L.jsxs)(`g`,{className:`fill-destructive/25`,children:[(0,L.jsx)(`ellipse`,{cx:19.5,cy:39.5,rx:2.6,ry:1.6}),(0,L.jsx)(`ellipse`,{cx:44.5,cy:39.5,rx:2.6,ry:1.6})]}):null,(0,L.jsx)(sG,{level:r,move:a}),r===`high`||r===`xhigh`?(0,L.jsx)(`path`,{d:`M20 27 L28.5 28.8 M44 27 L35.5 28.8`,strokeWidth:1.9,strokeLinecap:`round`,className:`stroke-foreground`}):null,(0,L.jsx)(cG,{level:r,move:a}),(0,L.jsx)(`rect`,{x:20,y:53,width:24,height:4,rx:2,className:d?void 0:`fill-primary/25`,style:d?{fill:`url(#${i}-rainbow)`}:void 0})]})},c.n),r===`off`?a?(0,L.jsx)($W,{}):(0,L.jsx)(`text`,{x:48,y:14,fontSize:`9`,fontWeight:`700`,className:`fill-muted-foreground`,children:`z`}):null,a&&r===`minimal`?(0,L.jsx)($W,{}):null,a&&r===`low`?(0,L.jsx)(eG,{}):null,a&&r===`medium`?(0,L.jsx)(tG,{}):null,a&&r===`high`?(0,L.jsx)(nG,{spots:[[6,14,0],[58,12,.6]]}):null,a&&r===`xhigh`?(0,L.jsx)(iG,{}):null,d?a?(0,L.jsx)(nG,{rainbow:!0,spots:[[5,12,0],[59,10,.2],[2,44,.45],[62,46,.65],[32,-2,.85],[14,60,1.05],[50,60,.3]]}):(0,L.jsx)(`g`,{children:[[5,12],[59,10],[32,-2]].map(([e,t],n)=>(0,L.jsx)(`path`,{d:YW,style:{x:e,y:t,fill:XW[n*2]}},n))}):null,a&&c.n>0&&c.up?(0,L.jsx)(oG,{rainbow:d},`burst-${c.n}`):null]})}var uG={minimal:`min`,medium:`med`},dG={off:`No extra reasoning: the quickest, cheapest answer.`,minimal:`A moment of reasoning, barely.`,low:`Light reasoning for simple work.`,medium:`Balanced reasoning for most work.`,high:`Careful reasoning: slower, better on hard problems.`,xhigh:`Very deep reasoning: slow and costly.`,max:`As deep as the model goes.`};function fG(e,t,n){let r=-1;for(let i=0;i<e.length;i+=1)t.includes(e[i])&&(r<0||Math.abs(i-n)<Math.abs(r-n))&&(r=i);return r}function pG(e,t,n,r){for(let i=n+r;i>=0&&i<e.length;i+=r)if(t.includes(e[i]))return i;return n}function mG({value:e,levels:t,supported:n,model:r,label:i,disabled:a,onChange:o}){let s=(0,m.useRef)(null),[c,l]=(0,m.useState)(),[u,d]=(0,m.useState)(),f=(0,m.useRef)(void 0),p=(0,m.useRef)(0),h=(0,m.useCallback)(()=>{f.current=void 0,p.current=0,d(void 0)},[]),g=Math.max(t.length-1,1),_=fG(t,n,Math.max(0,t.indexOf(e))),v=c??u??_,y=v<0?0:v/g*100,b=t[v]??e,x=v>=0&&b!==e;(0,m.useEffect)(()=>{if(u===void 0)return;let e=window.setTimeout(h,1e4);return()=>window.clearTimeout(e)},[u,h]);let S=(0,m.useCallback)(e=>{let r=s.current?.getBoundingClientRect();if(!r||r.width===0)return _;let i=Math.min(1,Math.max(0,(e-r.left)/r.width));return fG(t,n,Math.round(i*g))},[g,t,_,n]);function C(e){a||n.length===0||(e.currentTarget.setPointerCapture(e.pointerId),l(S(e.clientX)))}function w(e){if(c===void 0)return;let t=S(e.clientX);t!==c&&l(t)}function T(){if(c===void 0)return;let n=t[c];l(void 0),n&&n!==e&&o(n)}function E(e){if(a||v<0)return;let r=f.current??v,i={ArrowRight:pG(t,n,r,1),ArrowUp:pG(t,n,r,1),ArrowLeft:pG(t,n,r,-1),ArrowDown:pG(t,n,r,-1),Home:fG(t,n,0),End:fG(t,n,g)}[e.key];if(i===void 0)return;e.preventDefault();let s=t[i];s&&i!==r&&(f.current=i,d(i),p.current+=1,Promise.resolve(o(s)).catch(()=>void 0).then(()=>{--p.current,p.current<=0&&h()}))}return(0,L.jsxs)(`div`,{className:q(`flex flex-col gap-1`,a&&`opacity-60`),children:[(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,L.jsx)(`span`,{"data-level":b,className:`effort-word text-[0.8125rem] font-medium capitalize`,"aria-hidden":`true`,children:b}),(0,L.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:dG[b]??``})]}),(0,L.jsxs)(`div`,{ref:s,role:`slider`,tabIndex:a?-1:0,"aria-label":i,"aria-valuemin":0,"aria-valuemax":t.length-1,"aria-valuenow":Math.max(v,0),"aria-valuetext":b,"aria-disabled":a||void 0,onPointerDown:C,onPointerMove:w,onPointerUp:T,onPointerCancel:()=>l(void 0),onKeyDown:E,className:`relative mx-2.5 h-6 touch-none cursor-pointer rounded-full outline-none select-none focus-visible:ring-3 focus-visible:ring-ring/40`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-x-0 top-1/2 h-1.5 -translate-y-1/2 rounded-full bg-muted`}),(0,L.jsx)(B.span,{"aria-hidden":`true`,className:`absolute top-1/2 left-0 h-1.5 -translate-y-1/2 rounded-full bg-primary`,animate:{width:`${y}%`},transition:{type:`spring`,stiffness:520,damping:34}}),t.map((e,t)=>{let i=n.includes(e);return(0,L.jsx)(`span`,{"aria-hidden":`true`,title:i?e:`${r??`This model`} does not support ${e}`,className:q(`absolute top-1/2 size-1 -translate-x-1/2 -translate-y-1/2 rounded-full`,i?t<=v?`bg-primary-foreground/80`:`bg-muted-foreground/40`:`bg-transparent ring-1 ring-muted-foreground/30`),style:{left:`${t/g*100}%`}},e)}),(0,L.jsx)(B.span,{"aria-hidden":`true`,className:q(`absolute top-1/2 size-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-primary bg-white shadow-sm`,c!==void 0&&`scale-110`),animate:{left:`${y}%`},transition:{type:`spring`,stiffness:520,damping:28}})]}),(0,L.jsx)(`div`,{className:`relative mx-2.5 h-3.5 text-[0.68rem] text-muted-foreground`,"aria-hidden":`true`,children:t.map((e,t)=>{let i=n.includes(e);return(0,L.jsx)(`span`,{title:i?void 0:`${r??`This model`} does not support ${e}`,className:q(`absolute -translate-x-1/2 whitespace-nowrap`,t===v&&`font-medium text-foreground`,!i&&`opacity-40`),style:{left:`${t/g*100}%`},children:uG[e]??e},e)})}),x?(0,L.jsxs)(`p`,{className:`text-xs text-warning`,children:[e,` is not supported by `,r??`this model`,`, so it runs at `,b,`.`]}):null]})}function hG(e,t){let n=`${e.label} ${e.hint??``} ${e.value}`.toLowerCase();return t.toLowerCase().split(/\s+/).filter(Boolean).every(e=>n.includes(e))}function gG({value:e,options:t,onChange:n,label:r,className:i,disabled:a}){let[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(``),[u,d]=(0,m.useState)(0),f=(0,m.useRef)(null),p=(0,m.useId)(),h=(0,m.useMemo)(()=>t.filter(e=>hG(e,c)),[t,c]),g=t.find(t=>t.value===e);(0,m.useEffect)(()=>{o&&(l(``),d(Math.max(0,t.findIndex(t=>t.value===e))))},[o]),(0,m.useEffect)(()=>{c&&d(0)},[c]),(0,m.useEffect)(()=>{f.current?.querySelector(`[data-index="${u}"]`)?.scrollIntoView({block:`nearest`})},[u,o,h.length]);function _(t){t&&(s(!1),t.value!==e&&n(t.value))}function v(e){e.key===`ArrowDown`?(e.preventDefault(),d(e=>Math.min(h.length-1,e+1))):e.key===`ArrowUp`?(e.preventDefault(),d(e=>Math.max(0,e-1))):e.key===`Home`&&!c?(e.preventDefault(),d(0)):e.key===`End`&&!c?(e.preventDefault(),d(Math.max(0,h.length-1))):e.key===`Tab`?s(!1):e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),_(h[u]))}return(0,L.jsxs)(JT,{open:o,onOpenChange:s,children:[(0,L.jsxs)(YT,{type:`button`,role:`combobox`,"aria-label":r,"aria-keyshortcuts":`Enter Space ArrowDown ArrowUp`,"aria-description":`When focused, press Enter, Space or an arrow key to choose. Type to search.`,"aria-expanded":o,"aria-haspopup":`listbox`,"aria-controls":o?p:void 0,disabled:a,onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),s(!0))},"data-slot":`select-trigger`,className:q(`btn-raised flex h-8 w-full min-w-0 items-center justify-between gap-2 overflow-hidden rounded-lg border bg-card px-2.5 text-[0.8125rem] whitespace-nowrap outline-none transition-[border-color,box-shadow] duration-150 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:opacity-50`,i),children:[(0,L.jsx)(`span`,{className:`min-w-0 truncate`,children:g?.label??e}),(0,L.jsx)(Ap,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`})]}),(0,L.jsx)(XT,{children:(0,L.jsxs)(ZT,{align:`start`,sideOffset:4,collisionPadding:8,onOpenAutoFocus:e=>{e.preventDefault(),e.currentTarget.querySelector(`input`)?.focus()},className:`glass-pop z-50 flex max-h-[min(20rem,var(--radix-popover-content-available-height))] w-[max(var(--radix-popover-trigger-width),17rem)] max-w-(--radix-popover-content-available-width) flex-col overflow-hidden rounded-lg outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-2.5`,children:[(0,L.jsx)(Rh,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,L.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),onKeyDown:v,role:`searchbox`,"aria-label":`Search ${r}`,"aria-controls":p,"aria-activedescendant":h[u]?`${p}-${u}`:void 0,placeholder:`Search…`,autoComplete:`off`,spellCheck:!1,className:`h-8 min-w-0 flex-1 bg-transparent text-[0.8125rem] outline-none placeholder:text-muted-foreground`})]}),(0,L.jsxs)(`div`,{ref:f,id:p,role:`listbox`,"aria-label":r,className:`min-h-0 flex-1 overflow-y-auto p-1`,children:[h.length===0?(0,L.jsxs)(`p`,{className:`px-2.5 py-2 text-xs text-muted-foreground`,children:[`Nothing matches “`,c,`”.`]}):null,h.map((t,n)=>(0,L.jsxs)(`div`,{id:`${p}-${n}`,role:`option`,"aria-selected":t.value===e,"data-index":n,onPointerMove:()=>d(n),onClick:()=>_(t),className:q(`flex cursor-default items-center gap-2 rounded-lg px-2.5 py-1.5 text-[0.8125rem] select-none`,n===u&&`bg-accent`),children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,L.jsx)(`span`,{className:`truncate`,children:t.label}),t.hint?(0,L.jsx)(`span`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:t.hint}):null]}),t.value===e?(0,L.jsx)(Op,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},t.value))]})]})})]})}function _G({label:e,help:t,children:n,stacked:r}){return(0,L.jsxs)(`div`,{className:r?`grid gap-1.5`:`grid gap-1.5 sm:grid-cols-[minmax(0,1fr)_minmax(0,18rem)] sm:items-center sm:gap-6`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`text-[0.8125rem] font-medium`,children:e}),t?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}):null]}),(0,L.jsx)(`div`,{className:`min-w-0`,children:n})]})}function vG({children:e}){return(0,L.jsx)(`div`,{className:`card-raised flex flex-col divide-y divide-border rounded-xl border px-4 [&>*]:py-3`,children:e})}function yG({value:e,items:t,label:n,onChange:r}){return(0,L.jsx)(gG,{value:e,options:t.map(e=>({value:e.value,label:e.label,...e.help?{hint:e.help}:{}})),label:n,onChange:r})}var bG=`(prefers-color-scheme: dark)`,xG=[`dark`,`light`,`system`],SG=m.createContext(void 0);function CG(e){return e!==null&&xG.includes(e)}function wG(){return window.matchMedia(bG).matches?`dark`:`light`}function TG(){let e=document.createElement(`style`);return e.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;transition:none!important}`)),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.remove()})})}}function EG(e){return e instanceof HTMLElement&&!!(e.isContentEditable||e.closest(`input, textarea, select, [contenteditable='true']`))}function DG({children:e,defaultTheme:t=`system`,storageKey:n=`theme`,disableTransitionOnChange:r=!0,...i}){let[a,o]=m.useState(()=>{let e=localStorage.getItem(n);return CG(e)?e:t}),s=m.useCallback(e=>{localStorage.setItem(n,e),o(e)},[n]),c=m.useCallback(e=>{let t=document.documentElement,n=e===`system`?wG():e,i=r?TG():null;t.classList.remove(`light`,`dark`),t.classList.add(n),i&&i()},[r]);m.useEffect(()=>{if(c(a),a!==`system`)return;let e=window.matchMedia(bG),t=()=>{c(`system`)};return e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}},[a,c]),m.useEffect(()=>{let e=e=>{e.repeat||e.metaKey||e.ctrlKey||e.altKey||EG(e.target)||e.key.toLowerCase()===`d`&&o(e=>{let t=e===`dark`?`light`:e===`light`?`dark`:wG()===`dark`?`light`:`dark`;return localStorage.setItem(n,t),t})};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[n]),m.useEffect(()=>{let e=e=>{if(e.storageArea===localStorage&&e.key===n){if(CG(e.newValue)){o(e.newValue);return}o(t)}};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}},[t,n]);let l=m.useMemo(()=>({theme:a,setTheme:s}),[a,s]);return(0,L.jsx)(SG.Provider,{...i,value:l,children:e})}var OG=()=>{let e=m.useContext(SG);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e},kG=[`master`,`designer`,`backend`,`qa`,`scout`,`researcher`,`quickfix`,`planner`],AG={master:`Master`,designer:`Designer`,backend:`Backend`,qa:`QA`,scout:`Scout`,researcher:`Researcher`,quickfix:`Quick fix`,planner:`Planner`},jG={model:`Model`,thinking:`Effort`,timeout:`Time limit`,instructions:`Instructions`},MG=`inherit`,NG=`inherit`,PG=`Use the session's current model`,FG=`__custom__`,IG=`custom…`,LG=`Type a provider/model id`,RG=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],zG={agents:`Agents`,workflow:`Workflow`,lint:`Linting`,lobby:`Lobby`,classifier:`Classifier`,appearance:`Appearance`,notifications:`Notifications`,install:`Install as app`},BG=[{id:`startOn`,label:`On when pi starts`,help:`off: pi starts as plain pi, and ctrl+shift+m or /bot-lobby on turns bot-lobby on (a session that owns a task under way always starts on)`},{id:`issues`,label:`Issues tab`,help:`the GitHub Issues tab`}],VG=[{id:`conversation`,label:`Conversation pane`},{id:`activity`,label:`Activity log pane`},{id:`thinking`,label:`Thinking bubble`}],HG=`shown on the Lobby tab`,UG=`Planning rounds`,WG=`how many rounds the panel gets before the oracle settles the rest alone`,GG=[2,3,5,8,0],KG=`Split long plans`,qG=`saving a plan with more steps offers to split it into up to 5 tasks`,JG=[6,8,10,12,0],YG=`Port`,XG=`the base port (then the next free up to +20); 0 means any free port; applies the next time pi starts`,ZG=`Open browser`,QG=`open this page in the browser when pi starts`,$G=[{id:`off`,label:`off`,help:`tasks work in the folder you started them in`},{id:`branch`,label:`branch`,help:`each new task gets a git branch named after it, checked out in the working folder`},{id:`worktree`,label:`worktree`,help:`each new task gets its own worktree and branch, named after it: every agent runs there, apart from your checkout`}],eK=`Git isolation`,tK=[{id:`off`,label:`off`,help:`agents' work is never linted`},{id:`advise`,label:`advise`,help:`the oracle and QA are told what the project's linter finds on the lines a task changed; nothing is held`},{id:`block`,label:`block`,help:`new lint errors also hold a task's completion until they are fixed, or you accept the work as it is`}],nK={intro:`After every worker step, before QA and at completion, bot-lobby lints only the files the task's agents touched. Problems on the lines the task changed are the task's; anything already there is shown but never holds it. Suppressions and lint-config changes the task adds go to QA to judge.`,mode:`Lint gate`,command:`Command`,commandHelp:`empty runs the linters the project configures (ESLint, Biome, Oxlint, Ruff), each from its own folder; a command runs without a shell from the repository's top, with {files} standing for the touched files`,commandPlaceholder:`found from the project`,extensions:`File types`,extensionsHelp:`which touched files the command is given, such as .ts .tsx .py`,extensionsPlaceholder:`every touched file`,timeout:`Time limit`,timeoutHelp:`for one linter run; one that runs over reads as could not run, and holds nothing`,found:`Found in this project`,foundHelp:`config files in the project and the folders a few levels below it`,foundNone:`No linter config found. Add one to the project, or set a command above.`,foundReplaced:`The command replaces these.`,installed:`installed`,missing:`not installed`,missingHelp:`install the project's dependencies there, or lint cannot run`,top:`project root`},rK=[{id:`auto`,label:`Auto (OpenCode's free Jev, else TypeSafe)`},{id:`opencode`,label:`OpenCode Zen`},{id:`typesafe`,label:`TypeSafe`},{id:`openrouter`,label:`OpenRouter`},{id:`vercel`,label:`Vercel AI Gateway`}],iK=[{id:`seats`,label:`Planning seats`,help:`each round, only the seats your idea or latest answers touch sit; 1-4 in the Plan tab pins one`},{id:`answers`,label:`Obvious answers`,help:`a panel question whose recommended option the conversation already makes clearly right is answered for you (listed under Assumptions)`},{id:`triage`,label:`Task triage`,help:`a new task's size, domains and research need reach the Master as hints; a quick fix that is really a task is held for you`},{id:`effort`,label:`Effort routing`,help:`a simple step runs one thinking level lower, a trivial one on the cheaper model below; a routed run that falls short runs again on your settings`},{id:`review`,label:`Pull request read`,help:`the Git tab's quick read of a pull request: its size, and how likely it is risky, security-relevant, breaking or untested, before an agent reviews it`},{id:`knowledge`,label:`Relevant knowledge`,help:`when an agent's knowledge, standards or decisions file is too long for its prompt, Jev picks the sections that bear on the step, and the agent is told where the rest is`},{id:`files`,label:`File hints`,help:`scouts, workers, quick fixes and the planning panel start with the files most likely needed, and can look more up with find_relevant_files`}],aK={enabled:`Classifier`,enabledHelp:`Jev makes the obvious decisions so large models spend fewer tokens on them`,host:`Host`,model:`Model`,modelHelp:`empty uses the host's default`,key:`API key`,keyNote:`the key pi already holds for this host; it is never read by this page`,cheap:`Cheaper model`,cheapNone:`none: trivial steps keep their model and drop a thinking level`,cheapHelp:`what effort routing runs trivial steps on`},oK={title:`Settings`,intro:`Each agent's model and effort, the workflow and its lint gate, the lobby and the classifier. Changes save as you make them.`,loading:`Loading settings…`,loadFailed:`Could not load settings.`,saved:`Settings saved`,saving:`Saving…`,appearanceHelp:`Light, dark, or follow your system. Kept in this browser only.`,themeLabel:`Mode`,themeItems:[{id:`light`,label:`Light`},{id:`dark`,label:`Dark`},{id:`system`,label:`System`}],notificationsLabel:`Browser notifications`,notificationsHelp:`While this page is hidden, tell me when a question waits, a task finishes or a background session asks something.`,notificationsBlocked:`Notifications are blocked in your browser. Allow them for this site and try again.`,notificationsUnsupported:`This browser does not offer notifications.`,notificationsOn:`Browser notifications are on.`,notificationsOff:`Browser notifications are off.`,installLabel:`Install bot-lobby`,installHelp:`Opens in its own fullscreen window, with the shell cached so it starts when Pi is not running.`,installButton:`Install as fullscreen app`,installUnavailable:`Your browser has not offered to install it. Use its menu: “Install app” (Chrome, Edge) or Share, then “Add to Home Screen” (Safari).`,installDone:`bot-lobby is installed.`,installedNow:`Running as an installed app.`,fullscreenLabel:`Fullscreen`,fullscreenHelp:`Hide the browser's own bars for this tab (F11 does the same).`,fullscreenOn:`Exit fullscreen`,fullscreenOff:`Go fullscreen`},sK=`https://tweakcn.com/editor/theme`;function cK(){let{theme:e}=OG();return e===`dark`||e===`system`&&typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches}function lK({palette:e,dark:t}){let n=le(e,t);return(0,L.jsxs)(`span`,{"aria-hidden":`true`,className:`flex h-9 items-center gap-1.5 rounded-lg border border-border px-2`,style:{background:n.background},children:[(0,L.jsx)(`span`,{className:`size-4 rounded-full border border-black/10`,style:{background:n.card}}),(0,L.jsx)(`span`,{className:`size-4 rounded-full`,style:{background:n.primary}}),(0,L.jsx)(`span`,{className:`h-2 flex-1 rounded-full`,style:{background:n.accent}})]})}function uK(){let e=ve(),t=cK(),n=(0,m.useRef)(null);function r(t){let r=t.key===`ArrowRight`||t.key===`ArrowDown`?1:t.key===`ArrowLeft`||t.key===`ArrowUp`?-1:0;if(!r)return;t.preventDefault(),t.stopPropagation();let i=Math.max(0,e.all.findIndex(t=>t.id===e.active.id)),a=e.all[(i+r+e.all.length)%e.all.length];e.choose(a.id),window.requestAnimationFrame(()=>n.current?.querySelector(`[data-theme-id="${a.id}"]`)?.focus())}return(0,L.jsx)(`div`,{ref:n,role:`radiogroup`,"aria-label":`Colour theme`,onKeyDown:r,className:`grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4`,children:e.all.map(n=>{let r=n.id===e.active.id;return(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space ArrowLeft ArrowRight`,"aria-describedby":`focused-action-help`,type:`button`,role:`radio`,"aria-checked":r,"data-theme-id":n.id,tabIndex:r?0:-1,onClick:()=>e.choose(n.id),className:q(`grid gap-1.5 rounded-lg border p-2 text-left outline-none transition-[border-color,box-shadow,background-color] duration-150 focus-visible:ring-3 focus-visible:ring-ring/40`,r?`border-primary bg-accent shadow-[0_0_0_1px_var(--primary)]`:`border-border hover:bg-accent/50`),children:[(0,L.jsx)(lK,{palette:n,dark:t}),(0,L.jsxs)(`span`,{className:`flex items-center justify-between gap-2 px-0.5 text-[0.8125rem] font-medium`,children:[(0,L.jsxs)(`span`,{className:`truncate`,children:[n.name,n.id===`custom`?(0,L.jsx)(`span`,{className:`ml-1.5 text-xs font-normal text-muted-foreground`,children:`imported`}):null]}),r?(0,L.jsx)(Op,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]})]},n.id)})})}function dK(){let e=ve(),[t,n]=(0,m.useState)(``),[r,i]=(0,m.useState)(),a=(0,m.useRef)(null);function o(t,r){let a=te(t);if(`error`in a){i(a.error);return}i(void 0);let o=e.adopt(a,r);n(``);let s=a.light?a.dark?void 0:`dark`:`light`;V.success(s?`${o.name} applied. It has no ${s} colours, so ${s} mode keeps the default ones.`:`${o.name} applied.`)}async function s(e){if(e){if(e.size>2e5){i(`That file is too large to be a theme.`);return}o(await e.text(),e.name.replace(/\.[^.]+$/,``)||`Custom theme`)}}return(0,L.jsxs)(`div`,{className:`grid gap-2`,children:[(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Pick or build a theme in the`,` `,(0,L.jsxs)(`a`,{href:sK,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-0.5 text-link underline-offset-2 hover:underline`,children:[`tweakcn editor `,(0,L.jsx)(fm,{"aria-hidden":`true`,className:`size-3`})]}),`, press Code, copy it, and paste it here, or save it as a file and upload that. Colours and fonts are used; corners stay the page's own.`]}),(0,L.jsx)(OO,{value:t,onChange:e=>{n(e.target.value),i(void 0)},rows:4,spellCheck:!1,"aria-label":`Theme CSS from tweakcn`,"aria-invalid":r?!0:void 0,placeholder:`:root {
|
|
91
|
+
`).filter(Boolean),r=[];for(let t of n){let n=WR.exec(t);if(!n)return{body:e,files:[]};let i=n[1].split(/[\\/]/).pop()??``;if(!/^[\w.-]+$/.test(i))return{body:e,files:[]};r.push({id:i,name:i.replace(/^[a-z0-9]+-/,``),mime:n[2]})}return r.length>0?{body:e.slice(0,t).trimEnd(),files:r}:{body:e,files:[]}}var KR=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);function qR({files:e}){return e.length===0?null:(0,L.jsx)(`ul`,{className:`mt-2 flex flex-wrap gap-2`,"aria-label":`Attached files`,children:e.map(e=>(0,L.jsx)(`li`,{children:KR.has(e.mime)?(0,L.jsx)(`a`,{href:Uf(`/files/preview/attachments/${e.id}`),target:`_blank`,rel:`noopener noreferrer`,className:`block overflow-hidden rounded-lg border border-border bg-muted/40 transition-transform duration-150 ease-snap hover:scale-[1.02]`,children:(0,L.jsx)(`img`,{src:Uf(`/files/preview/attachments/${e.id}`),alt:e.name,loading:`lazy`,className:`max-h-40 max-w-56 object-cover`})}):(0,L.jsxs)(`span`,{className:`inline-flex max-w-64 items-center gap-2 rounded-lg border border-border bg-muted/40 px-3 py-2 text-xs text-muted-foreground`,children:[e.mime===`application/pdf`?(0,L.jsx)(bm,{"aria-hidden":`true`,className:`size-4 shrink-0`}):(0,L.jsx)(fh,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,L.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))})}var JR=!1,YR=[],XR=0,ZR=900;function QR(){JR=!0,window.clearTimeout(XR),XR=window.setTimeout($R,ZR)}function $R(){JR=!1,window.clearTimeout(XR);let e=YR;YR=[];for(let t of e)t()}function ez(e){if(!JR)return e(),()=>{};let t=()=>e();return YR.push(t),()=>{YR=YR.filter(e=>e!==t)}}var tz=8;function nz(e,t=24){let[n,r]=(0,m.useState)(t),i=(0,m.useRef)(8),a=n<e;return(0,m.useEffect)(()=>{if(!a)return;let e=0,t=ez(()=>{e=requestAnimationFrame(()=>{let e=performance.now();(0,bv.flushSync)(()=>r(e=>e+i.current));let t=Math.max(1,performance.now()-e);i.current=Math.max(2,Math.min(400,Math.round(i.current*tz/t)))})});return()=>{t(),cancelAnimationFrame(e)}},[a,n]),Math.min(n,e)}function rz(e){return e?.type===`text`?e.value??``:(e?.children??[]).map(rz).join(``)}function iz(e,t=!1){let n=t||e.tagName===`a`;e.tagName===`code`&&(e.properties={...e.properties,copyBlocked:n,blockCode:t===!1&&e.properties?.blockCode});for(let t of e.children??[])e.tagName===`pre`&&(t.properties={...t.properties,blockCode:!0}),iz(t,n)}function az(){return e=>iz(e)}function oz(e){let[t,n]=(0,m.useState)(!1);async function r(){try{await UR(e,navigator.clipboard),n(!0),B.success(`Code copied.`)}catch{B.error(`Could not copy code. Select it and copy manually, or allow clipboard access.`)}}return{copied:t,copy:r}}function sz({text:e,children:t,block:n=!1}){let{copy:r}=oz(e),i=(0,m.useRef)(void 0);return(0,L.jsxs)(`code`,{role:`button`,tabIndex:0,"aria-label":`Copy code`,"aria-keyshortcuts":`Enter Space`,title:`Copy code · Enter / Space`,className:`cursor-copy focus-visible:outline-2 focus-visible:outline-ring`,onPointerDown:e=>{i.current={x:e.clientX,y:e.clientY,moved:!1}},onPointerMove:e=>{let t=i.current;t&&Math.hypot(e.clientX-t.x,e.clientY-t.y)>4&&(t.moved=!0)},onClick:e=>{e.stopPropagation(),HR(window.getSelection()?.toString()??``,i.current?.moved??!1)&&r(),i.current=void 0},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),HR(window.getSelection()?.toString()??``,!1)&&r())},children:[t,n?null:(0,L.jsx)(`span`,{className:`sr-only`,children:` (activate to copy)`})]})}function cz({node:e,children:t,source:n}){let r=e,{copied:i,copy:a}=oz(VR(n,r?.position,!0)??rz(r)),o=r?.children?.find(e=>e.tagName===`code`)?.properties?.className,s=(Array.isArray(o)?o:[]).map(String).find(e=>e.startsWith(`language-`))?.slice(9);return(0,L.jsxs)(`div`,{className:`relative my-3 rounded-lg bg-muted`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between pl-3`,children:[(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[s&&/^[\w+#.-]{1,20}$/.test(s)?s:`code`,` · tap to copy`]}),(0,L.jsx)(Y,{label:i?`Copied`:`Copy the code`,icon:i?Op:cm,iconOnly:!0,onClick:()=>void a()})]}),(0,L.jsx)(`pre`,{className:`!my-0 overflow-x-auto !rounded-t-none !bg-transparent px-3 pb-3 text-sm leading-relaxed [&>code]:block`,children:t})]})}function lz(e){return{pre:t=>(0,L.jsx)(cz,{...t,source:e}),code:({node:t,children:n})=>{let r=t;if(r?.properties?.copyBlocked)return(0,L.jsx)(`code`,{children:n});let i=!!r?.properties?.blockCode;return(0,L.jsx)(sz,{text:VR(e,r?.position,i)??rz(r),block:i,children:n})},a:({href:e,children:t})=>(0,L.jsx)(`a`,{href:e?Uf(e):void 0,target:`_blank`,rel:`noopener noreferrer nofollow`,children:t}),img:({src:e,alt:t})=>(0,L.jsx)(`img`,{src:e?Uf(e):void 0,alt:t??``,loading:`lazy`}),table:({children:e})=>(0,L.jsx)(`div`,{className:`my-3 w-full overflow-x-auto`,children:(0,L.jsx)(`table`,{className:`w-full border-collapse text-sm`,children:e})})}}var uz=(0,m.memo)(function({text:e}){return(0,L.jsx)(DF,{remarkPlugins:[NR],rehypePlugins:[az],urlTransform:FR,components:lz(e),children:e})}),dz=(0,m.memo)(function({text:e,className:t}){let{body:n,files:r}=GR(e),i=n?BR(n):[],a=nz(i.length,3);return(0,L.jsxs)(`div`,{className:q(`md-body`,t),children:[i.slice(0,a).map((e,t)=>(0,L.jsx)(uz,{text:e},t)),(0,L.jsx)(qR,{files:r})]})});function fz({title:e,note:t,className:n,children:r,collapsed:i,onToggle:a,shortcut:o,...s}){let c=typeof e==`string`?e:`pane`;return(0,L.jsxs)(`section`,{className:q(`group/frame relative flex min-h-0 min-w-0 flex-col`,i&&`flex-none`,n),...s,children:[e||t||a?(0,L.jsxs)(`div`,{className:q(`flex min-h-12 shrink-0 items-center justify-between gap-3 px-4`,!i&&`border-b border-border`),children:[e?(0,L.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-medium`,children:e}):(0,L.jsx)(`span`,{}),(0,L.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[t?(0,L.jsx)(`span`,{className:`flex items-center gap-2 truncate text-xs text-muted-foreground`,children:t}):null,a?(0,L.jsxs)(`button`,{type:`button`,"aria-expanded":!i,"aria-label":i?`Expand ${c}`:`Minimize ${c}`,title:`${i?`Expand`:`Minimize`}${o?` · ${o}`:``}`,"aria-keyshortcuts":o?`${o} Enter Space`:`Enter Space`,"aria-describedby":`focused-action-help`,onClick:a,className:`btn-ghost -mr-1.5 inline-flex h-8 items-center gap-1.5 rounded-lg border border-transparent px-2 text-muted-foreground transition-[box-shadow,color,translate] duration-150 ease-snap outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none`,children:[o?(0,L.jsx)(cD,{chord:o,className:`kbd-hint`}):null,(0,L.jsx)(Ap,{"aria-hidden":`true`,className:q(`size-4 transition-transform duration-200 ease-snap`,i&&`-rotate-90`)})]}):null]})]}):null,i?null:r]})}function pz({title:e,right:t,className:n}){return(0,L.jsxs)(`span`,{className:q(`flex min-w-0 items-center gap-3`,n),children:[(0,L.jsx)(`span`,{className:`truncate font-medium`,children:e}),(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-4 flex-1`}),t?(0,L.jsx)(`span`,{className:`shrink-0 text-xs font-normal text-muted-foreground`,children:t}):null]})}function mz({title:e,right:t,prominent:n,children:r}){return(0,L.jsxs)(`section`,{className:q(`flex flex-col`,n?`gap-3`:`gap-2.5`),children:[(0,L.jsx)(`h3`,{className:n?`text-sm text-foreground`:`text-xs text-muted-foreground`,children:(0,L.jsx)(pz,{title:e,right:t,className:n?`[&>span:first-child]:font-semibold`:void 0})}),r]})}var hz=`Pull requests`,gz=`An agent reviews it, optionally with a focus you type; Jev's quick read sizes it up first.`,_z=`nothing is posted to GitHub`,vz=`Refresh to load open pull requests with the GitHub CLI (gh).`,yz=`No open pull requests.`,bz=`loading pull requests from GitHub…`,xz=`reading the diff…`,Sz=`the pull request has new commits since this review — review it again`,Cz=`(no description)`,wz=`Review with a focus (optional)`,Tz=`Leave it empty for a full review.`;function Ez(e){return e===`passing`?`✓`:e===`failing`?`✗`:e===`pending`?`…`:``}function Dz(e){return e===`passing`?`text-success`:e===`failing`?`text-destructive`:`text-muted-foreground`}function Oz(e,t){return`+${e} −${t}`}function kz(e){return e===`APPROVED`?`approved`:e===`CHANGES_REQUESTED`?`changes requested`:e===`REVIEW_REQUIRED`?`review required`:``}function Az(e){return e?e.status===`running`?`reviewing`:e.status!==`done`||!e.verdict?``:e.verdict===`approve`?`approved`:e.verdict===`changes`?`changes found`:`commented`:``}function jz(e){return e===`approve`?`approve`:e===`changes`?`request changes`:e===`comment`?`comment`:``}function Mz(e,t){if(e.status===`running`)return Nz(e,t);if(e.status===`cancelled`)return`stopped`;let n=e.status===`done`?Nz(e,t):e.status;return[jz(e.verdict),n].filter(Boolean).join(` · `)}function Nz(e,t){let n=Math.max(0,Math.round(((e.finishedAt??t)-e.startedAt)/1e3));return n<60?`${n}s`:`${Math.floor(n/60)}m ${String(n%60).padStart(2,`0`)}s`}function Pz(e,t){return[e.state?e.draft?`draft`:e.state.toLowerCase():e.draft?`draft`:``,e.author?`by ${e.author}`:``,e.updatedAt?`updated ${NO(t-Date.parse(e.updatedAt))}`:``].filter(Boolean).join(` · `)}function Fz(e){let t=`${e.changedFiles} file${e.changedFiles===1?``:`s`}`;return`${e.headRef||`?`} → ${e.baseRef||`?`} · ${Oz(e.additions,e.deletions)} · ${t}`}function Iz(e){let t=e.mergeable===`CONFLICTING`?`conflicts`:e.mergeable===`MERGEABLE`?`mergeable`:``;return[e.checks?`checks ${e.checks} (${e.checkCount})`:``,kz(e.decision),t,e.labels.join(`, `)].filter(Boolean).join(` · `)}function Lz(e){return[`${e.changedFiles} file${e.changedFiles===1?``:`s`}`,e.labels.join(`, `),e.review?.stale?`stale`:``].filter(Boolean).join(` · `)}function Rz(e){return e.read?`${e.read.model} · ${e.read.ms} ms`:``}function zz(e){let[t,n]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{if(!e)return;let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),e?t:Date.now()}function Bz({pull:e,now:t}){return(0,L.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,L.jsxs)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:[(0,L.jsxs)(`span`,{className:`font-normal text-muted-foreground tabular-nums`,children:[`#`,e.number]}),` `,e.title]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:Pz(e,t)}),(0,L.jsx)(`p`,{className:`text-sm tabular-nums`,children:Fz(e)}),Iz(e)?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:Iz(e)}):null,e.url?(0,L.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,className:`text-xs break-all text-primary underline underline-offset-4`,children:e.url}):null]})}function Vz({read:e}){return(0,L.jsxs)(mz,{title:`Jev's read`,right:Rz(e),children:[e.status===`running`?(0,L.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(FD,{className:`size-3.5`}),xz]}):null,e.status===`failed`?(0,L.jsx)(`p`,{className:`text-sm text-foreground`,children:e.error??`Jev could not read it`}):null,e.status===`done`&&e.line?(0,L.jsx)(dz,{text:e.line}):null]})}function Hz({review:e,now:t}){return(0,L.jsxs)(L.Fragment,{children:[e.model?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:[e.model,e.thinking].filter(Boolean).join(` · `)}):null,e.focus?(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`focus: `,e.focus]}):null,e.saved?(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`kept from `,NO(t-e.startedAt)]}):null,e.stale?(0,L.jsx)(`p`,{className:`text-sm text-foreground`,children:Sz}):null,e.status===`running`?(0,L.jsx)(Uz,{steps:e.steps}):null,e.status===`cancelled`?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`stopped`}):null,e.status===`failed`||e.status===`timeout`?(0,L.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`✗ `,e.error??e.status]}):null,e.text?(0,L.jsx)(dz,{text:e.text}):null]})}function Uz({steps:e}){return(0,L.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.slice(-6).map((e,t)=>(0,L.jsxs)(`li`,{className:`break-words`,children:[`· `,e]},t))})}function Wz({number:e,focus:t,onChange:n}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(`label`,{htmlFor:`focus-${e}`,className:`text-[0.8125rem] font-medium text-foreground`,children:wz}),(0,L.jsx)(OO,{id:`focus-${e}`,value:t,rows:2,maxLength:2e3,onChange:e=>n(e.target.value)}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:Tz})]})}function Gz({number:e,review:t,now:n,focus:r,onFocus:i}){return(0,L.jsxs)(mz,{title:`Review`,right:t?Mz(t,n):void 0,children:[t?(0,L.jsx)(Hz,{review:t,now:n}):null,(0,L.jsx)(Wz,{number:e,focus:r,onChange:i}),(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`A read-only agent reviews it — `,_z,`.`]})]})}function Kz({files:e}){return(0,L.jsx)(mz,{title:`Files`,right:String(e.length),children:(0,L.jsx)(`div`,{className:`overflow-x-auto rounded-lg border border-border`,children:(0,L.jsx)(`table`,{className:`w-full border-collapse text-sm tabular-nums`,children:(0,L.jsx)(`tbody`,{children:e.map(e=>(0,L.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,L.jsx)(`td`,{className:`max-w-0 px-3 py-1.5 break-all`,children:e.path}),(0,L.jsx)(`td`,{className:`px-3 py-1.5 text-right text-xs whitespace-nowrap text-muted-foreground`,children:Oz(e.additions,e.deletions)})]},e.path))})})})})}function qz({note:e,now:t}){let n=[e.state&&e.state!==`COMMENTED`?e.state.toLowerCase().replace(/_/g,` `):``,e.at?NO(t-Date.parse(e.at)):``].filter(Boolean).join(` · `);return(0,L.jsxs)(`article`,{className:`card-raised flex flex-col gap-1.5 rounded-lg border px-3.5 py-2.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author??`comment`}),n?(0,L.jsx)(`span`,{children:n}):null]}),e.body.trim()?(0,L.jsx)(dz,{text:e.body.trim()}):null]})}function Jz({notes:e,now:t}){return e.length===0?null:(0,L.jsx)(mz,{title:`Discussion`,right:String(e.length),children:(0,L.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map((e,n)=>(0,L.jsx)(qz,{note:e,now:t},n))})})}function Yz({number:e,error:t}){return t?(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load #`,e,`. `,t]}):(0,L.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(FD,{className:`size-3.5`}),`loading #`,e,`…`]})}function Xz({number:e,onChanged:t}){let n=UD(`git.pull`,{number:e},[`git`]),[r,i]=(0,m.useState)(``),a=n.data?.review?.status===`running`,o=zz(a);if(!n.data)return(0,L.jsx)(Yz,{number:e,error:n.error});let{pull:s,review:c,read:l}=n.data,u=()=>{n.reload(),t?.()},d=async()=>{let t=r.trim();i(``),await V(`git.review`,{number:e,...t?{focus:t}:{}}),u()},f=async()=>{await V(`git.jev`,{number:e}),u()},p=async()=>{await V(`git.cancelReview`,{number:e}),u()};return(0,L.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`Pull request #${e}`,children:[(0,L.jsxs)(pO,{children:[(0,L.jsx)(Y,{label:`Review`,icon:wh,tone:`primary`,shortcut:`V`,disabled:a,onClick:()=>void d()}),(0,L.jsx)(Y,{label:`Jev's read`,icon:Sp,shortcut:`Q`,disabled:a,onClick:()=>void f()}),a?(0,L.jsx)(WO,{icon:Xp,label:`Stop the review`,text:`Stop`,shortcut:`X`,title:`Stop this review?`,description:`The agent stops reading the pull request. Nothing is posted to GitHub.`,confirmLabel:`Stop review`,variant:`destructive`,onConfirm:()=>void p()}):null]}),(0,L.jsx)(Bz,{pull:s,now:o}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:gz}),l?(0,L.jsx)(Vz,{read:l}):null,(0,L.jsx)(Gz,{number:e,review:c,now:o,focus:r,onFocus:i}),s.files.length>0?(0,L.jsx)(Kz,{files:s.files}):null,(0,L.jsx)(mz,{title:`Description`,children:s.body.trim()?(0,L.jsx)(dz,{text:s.body.trim()}):(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:Cz})}),(0,L.jsx)(Jz,{notes:s.notes,now:o})]})}var Zz=Dg(`group/badge inline-flex h-6 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-lg border border-transparent px-2.5 text-xs font-medium whitespace-nowrap transition-colors focus-visible:ring-[3px] focus-visible:ring-ring/40 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-accent text-foreground [a]:hover:bg-primary/20`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-accent`,destructive:`bg-destructive/12 text-destructive [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-accent`,ghost:`hover:bg-accent hover:text-foreground`,link:`text-link underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function Qz({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?sv:`span`;return(0,L.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:q(Zz({variant:t}),e),...r})}var $z=`flex min-h-10 w-full flex-col gap-0.5 rounded-lg px-2.5 py-2 text-left outline-none transition-colors duration-150 hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/40 aria-[current=true]:bg-accent`,eB=`flex flex-col gap-0.5 px-2 pb-2`,tB=`px-4 pt-4 pb-1 text-xs font-medium text-muted-foreground`;function nB({checks:e}){let t=Ez(e);return t?(0,L.jsx)(`span`,{className:q(`w-4 shrink-0 text-center`,Dz(e)),"aria-hidden":`true`,children:t}):(0,L.jsx)(`span`,{className:`w-4 shrink-0`,"aria-hidden":`true`})}function rB({pull:e,selected:t,onSelect:n}){let r=Az(e.review);return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(e.number),className:$z,children:[(0,L.jsxs)(`span`,{className:`flex items-start gap-2 text-sm`,children:[(0,L.jsxs)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:[`#`,e.number]}),(0,L.jsx)(nB,{checks:e.checks}),e.draft?(0,L.jsx)(Qz,{variant:`secondary`,children:`draft`}):null,(0,L.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.title})]}),(0,L.jsxs)(`span`,{className:`flex flex-wrap items-baseline justify-between gap-x-3 text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{children:Lz(e)}),(0,L.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[r?(0,L.jsx)(`span`,{children:r}):null,(0,L.jsx)(`span`,{className:`tabular-nums`,children:Oz(e.additions,e.deletions)})]})]})]})})}function iB({pulls:e,selectedId:t,onSelect:n}){return(0,L.jsx)(`ul`,{className:eB,children:e.map(e=>(0,L.jsx)(rB,{pull:e,selected:e.number===t,onSelect:n},e.number))})}var aB=()=>DD(ED(`git`)),oB=e=>DD(ED(`git`,String(e)));function sB(e){let t=Number(e[0]);return Number.isInteger(t)&&t>0?t:void 0}function cB({loading:e,loaded:t,error:n,onRetry:r}){let i=n?`✗ ${n}`:t?yz:e?bz:vz;return(0,L.jsxs)(kD,{className:`m-4 flex-1`,children:[(0,L.jsxs)(AD,{children:[(0,L.jsx)(MD,{variant:`icon`,children:(0,L.jsx)(wm,{"aria-hidden":`true`})}),(0,L.jsx)(PD,{className:n?`text-destructive`:void 0,children:i})]}),n?(0,L.jsx)(J,{variant:`outline`,onClick:r,children:`Retry`}):null]})}function lB({rest:e}){let t=SO(),n=UD(`git.pulls`,{},[`git`]),r=sB(e),i=n.data?.pulls??[],a=(0,m.useCallback)(()=>{V(`git.pulls`,{refresh:!0}).then(()=>n.reload())},[n]);if(!n.data&&n.error)return(0,L.jsx)(LD,{message:`Could not load pull requests. ${n.error}`,onRetry:n.reload});if(n.data&&i.length===0)return(0,L.jsx)(cB,{loading:n.data.loading,loaded:n.data.loaded,error:n.data.error,onRetry:n.reload});let o=n.loading||!!n.data?.loading,s=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(EO,{title:hz,count:n.data?`${i.length} open`:void 0,children:(0,L.jsx)(Y,{label:`Refresh`,icon:Oh,shortcut:`R`,disabled:o,className:q(`h-7`,o&&`[&_svg]:animate-spin`),onClick:a})}),n.data?.error?(0,L.jsxs)(`p`,{className:`px-3 pt-2 text-sm text-destructive`,children:[`✗ `,n.data.error]}):null,n.data?(0,L.jsx)(iB,{pulls:i,selectedId:r,onSelect:oB}):(0,L.jsx)(DO,{})]}),c=r===void 0?null:(0,L.jsx)(Xz,{number:r,onChanged:n.reload},r);return(0,L.jsx)(TO,{wide:t,list:s,detail:c,open:r!==void 0,onClose:aB,hint:`Select a pull request to see its detail.`,describe:`Pull request detail`})}function uB(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function dB({label:e,hint:t,buttonLabel:n=`Send`,onSend:r}){let i=(0,m.useId)(),[a,o]=(0,m.useState)(``),[s,c]=(0,m.useState)(!1),l=async()=>{a.trim()&&!s&&(c(!0),await r(a)&&o(``),c(!1))};return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`label`,{htmlFor:i,className:`text-sm font-medium text-foreground`,children:e}),(0,L.jsx)(OO,{id:i,value:a,rows:2,"aria-describedby":t?`${i}-hint`:void 0,onChange:e=>o(e.target.value),onKeyDown:e=>{uB(e)&&(e.preventDefault(),l())}}),t?(0,L.jsx)(`p`,{id:`${i}-hint`,className:`text-xs text-muted-foreground`,children:t}):null,(0,L.jsx)(`div`,{className:`flex self-end`,children:(0,L.jsx)(Y,{label:n,icon:s?Rm:bp,tone:`primary`,shortcut:`Enter`,className:s?`[&_svg]:animate-spin`:void 0,onClick:()=>void l(),disabled:!a.trim()||s})})]})}var fB=`Issues`,pB=`Issue`,mB=`p plans it with the planning panel, then save it as a task`,hB=`Refresh to load open issues with the GitHub CLI (gh).`,gB=`No open issues. File one with New issue.`,_B=`loading issues from GitHub…`,vB=`issues are off (lobby.issues)`,yB=`(no description)`;function bB(e,t){return[e.state?e.state.toLowerCase():``,e.author?`by ${e.author}`:``,e.updatedAt?`updated ${NO(t-Date.parse(e.updatedAt))}`:``,e.labels.join(`, `)].filter(Boolean).join(` · `)}function xB(e,t){return[e.author?`by ${e.author}`:``,e.updatedAt?NO(t-Date.parse(e.updatedAt)):``].filter(Boolean).join(` · `)}function SB(e){return e.length>0?`[${e.slice(0,2).join(`, `)}]`:``}function CB({issue:e,now:t}){return(0,L.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,L.jsxs)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:[(0,L.jsxs)(`span`,{className:`font-normal text-muted-foreground tabular-nums`,children:[`#`,e.number]}),` `,e.title]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:bB(e,t)}),e.url?(0,L.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,className:`text-xs break-all text-primary underline underline-offset-4`,children:e.url}):null]})}function wB({comment:e,now:t}){return(0,L.jsxs)(`article`,{className:`card-raised flex flex-col gap-1.5 rounded-lg border px-3.5 py-2.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author??`comment`}),e.createdAt?(0,L.jsx)(`span`,{children:NO(t-Date.parse(e.createdAt))}):null]}),(0,L.jsx)(dz,{text:e.body.trim()})]})}function TB({comments:e,now:t}){return e.length===0?null:(0,L.jsx)(mz,{title:`Comments`,right:String(e.length),children:(0,L.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map((e,n)=>(0,L.jsx)(wB,{comment:e,now:t},n))})})}function EB({number:e}){let t=UD(`issues.get`,{number:e},[`issues`]),n=Date.now();if(!t.data)return t.error?(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load #`,e,`. `,t.error]}):(0,L.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(FD,{className:`size-3.5`}),`loading #`,e,`…`]});let r=t.data.issue;return(0,L.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`${pB} #${e}`,children:[(0,L.jsx)(CB,{issue:r,now:n}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:mB}),(0,L.jsx)(mz,{title:`Description`,children:r.body.trim()?(0,L.jsx)(dz,{text:r.body.trim()}):(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:yB})}),(0,L.jsx)(TB,{comments:r.comments,now:n})]})}function DB({issue:e,selected:t,now:n,onSelect:r}){let i=SB(e.labels);return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>r(e.number),className:$z,children:[(0,L.jsxs)(`span`,{className:`flex flex-wrap items-start gap-2 text-sm`,children:[(0,L.jsxs)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:[`#`,e.number]}),(0,L.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.title}),i?(0,L.jsx)(`span`,{className:`max-w-full break-words text-xs text-muted-foreground`,children:i}):null]}),(0,L.jsx)(`span`,{className:`pl-9 text-xs text-muted-foreground`,children:xB(e,n)})]})})}function OB({issues:e,selectedId:t,now:n,onSelect:r}){return(0,L.jsx)(`ul`,{className:eB,children:e.map(e=>(0,L.jsx)(DB,{issue:e,selected:e.number===t,now:n,onSelect:r},e.number))})}var kB=()=>DD(ED(`issues`)),AB=e=>DD(ED(`issues`,String(e)));function jB(e){let t=Number(e[0]);return Number.isInteger(t)&&t>0?t:void 0}function MB(){return(0,L.jsx)(kD,{className:`m-4 flex-1`,children:(0,L.jsxs)(AD,{children:[(0,L.jsx)(MD,{variant:`icon`,children:(0,L.jsx)(Kp,{"aria-hidden":`true`})}),(0,L.jsx)(ND,{children:`Issues are off`}),(0,L.jsx)(PD,{className:`font-mono`,children:vB})]})})}function NB({loading:e,loaded:t,error:n,onRetry:r}){let i=n?`✗ ${n}`:t?gB:e?_B:hB;return(0,L.jsxs)(kD,{className:`m-4 flex-1`,children:[(0,L.jsxs)(AD,{children:[(0,L.jsx)(MD,{variant:`icon`,children:(0,L.jsx)(Kp,{"aria-hidden":`true`})}),(0,L.jsx)(PD,{className:n?`text-destructive`:void 0,children:i})]}),n?(0,L.jsx)(J,{variant:`outline`,onClick:r,children:`Retry`}):null]})}function PB({onCreate:e}){return(0,L.jsx)(CO,{className:`shrink-0 border-t border-border p-4`,children:(0,L.jsx)(dB,{label:`New issue`,hint:`The first line becomes the title; the rest is the body. Enter files it.`,buttonLabel:`File issue`,onSend:e})})}function FB({rest:e}){let t=SO(),n=VD(`status`).data?.issuesEnabled??!0,r=UD(`issues.list`,{},[`issues`],n),i=jB(e),a=r.data?.issues??[],o=Date.now(),s=(0,m.useCallback)(()=>{V(`issues.list`,{refresh:!0}).then(()=>r.reload())},[r]),c=async e=>await V(`issues.create`,{text:e})?(r.reload(),!0):!1;if(!n)return(0,L.jsx)(MB,{});if(!r.data&&r.error)return r.error.includes(`issues are off`)?(0,L.jsx)(MB,{}):(0,L.jsx)(LD,{message:`Could not load issues. ${r.error}`,onRetry:r.reload});let l=r.loading||!!r.data?.loading,u=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(EO,{title:fB,count:r.data?`${a.length} open`:void 0,children:(0,L.jsx)(Y,{label:`Refresh`,icon:Oh,shortcut:`R`,disabled:l,className:q(`h-7`,l&&`[&_svg]:animate-spin`),onClick:s})}),r.data?.error?(0,L.jsxs)(`p`,{className:`px-3 pt-2 text-sm text-destructive`,children:[`✗ `,r.data.error]}):null,r.data?(0,L.jsx)(OB,{issues:a,selectedId:i,now:o,onSelect:AB}):(0,L.jsx)(DO,{}),(0,L.jsx)(PB,{onCreate:c})]}),d=i===void 0?null:(0,L.jsx)(EB,{number:i},i),f=r.data&&a.length===0?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(NB,{loading:r.data.loading,loaded:r.data.loaded,error:r.data.error,onRetry:r.reload}),(0,L.jsx)(`div`,{className:`shrink-0 pb-dock`,children:(0,L.jsx)(PB,{onCreate:c})})]}):(0,L.jsx)(TO,{wide:t,list:u,detail:d,open:i!==void 0,onClose:kB,hint:`Select an issue to read it.`,describe:`Issue detail`});return(0,L.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:f})}var IB=[`master`,`designer`,`backend`,`qa`],LB={master:`Master (oracle)`,designer:`Designer`,backend:`Backend`,qa:`QA`},RB={master:`Master`,designer:`Designer`,backend:`Backend`,qa:`QA`},zB=`Every write archives the version before it.`;function BB(e){if(e<1e3)return String(e);let t=e/1e3;return`${t>=10?Math.round(t):t.toFixed(1)}k`}function VB(e){return`over the compaction threshold — ask the oracle to compact ${e}`}function HB(e){return{text:e.text,occurrence:e.occurrence}}function UB(e){return IB.map(t=>{let n=e.filter(e=>e.agent===t);return{agent:t,files:n,notes:n.reduce((e,t)=>e+t.notes,0)}}).filter(e=>e.files.length>0)}function WB(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function GB({initial:e,busy:t,onSave:n,onCancel:r}){let[i,a]=(0,m.useState)(e),o=()=>{!t&&i.trim()&&n(i)};return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-input p-3`,children:[(0,L.jsx)(`label`,{htmlFor:`knowledge-entry`,className:`text-sm font-medium text-foreground`,children:`Edit entry`}),(0,L.jsx)(OO,{id:`knowledge-entry`,value:i,rows:4,autoFocus:!0,onChange:e=>a(e.target.value),onKeyDown:e=>{WB(e)&&(e.preventDefault(),o())}}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:zB}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(J,{variant:`outline`,onClick:r,disabled:t,children:`Cancel`}),(0,L.jsxs)(J,{onClick:o,disabled:t||!i.trim(),children:[t?(0,L.jsx)(FD,{}):null,`Save`]})]})]})]})}function KB({open:e,file:t,initial:n,busy:r,onClose:i,onSave:a}){let[o,s]=(0,m.useState)(n),c=vD(e,_D.confirm);return(0,L.jsx)(uD,{open:e&&c,onOpenChange:e=>!e&&i(),label:`Edit ${t}`,description:zB,dismissOnBackdrop:!1,className:`max-w-3xl`,children:(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 p-6`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`h2`,{className:`text-base font-medium`,children:[`Edit `,t]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:zB})]}),(0,L.jsx)(OO,{value:o,rows:14,className:`min-h-0 flex-1 font-mono text-sm`,onChange:e=>s(e.target.value)}),(0,L.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,L.jsx)(J,{variant:`outline`,onClick:i,disabled:r,children:`Cancel`}),(0,L.jsxs)(J,{onClick:()=>a(o),disabled:r,children:[r?(0,L.jsx)(FD,{}):null,`Save file`]})]})]})})}function qB({note:e,about:t,onTakeBack:n,busy:r}){let i=t?`about "${t.replace(/\s+/g,` `).trim().slice(0,50)}": ${e.text}`:e.text;return(0,L.jsxs)(`li`,{className:`flex items-start gap-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(vh,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-primary`}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:i}),(0,L.jsx)(Y,{label:`Take the note back`,icon:cg,iconOnly:!0,className:`-my-1 size-7`,disabled:r,onClick:()=>n(e.id)})]})}function JB({entry:e,index:t,selected:n,notes:r,onPick:i,onTakeBack:a,busy:o}){let s=()=>i(t);return(0,L.jsxs)(`li`,{role:`button`,tabIndex:0,"aria-pressed":n,onClick:s,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s())},className:n?`flex min-h-9 cursor-pointer flex-col gap-1 rounded-lg border border-primary/30 bg-accent px-3 py-2.5 outline-none focus-visible:ring-3 focus-visible:ring-ring/40`:`flex min-h-9 cursor-pointer flex-col gap-1 rounded-lg border border-border px-3 py-2.5 outline-none transition-colors hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/40`,children:[(0,L.jsx)(`div`,{className:`flex gap-2`,children:(0,L.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,L.jsx)(dz,{text:e.text})})}),r.length>0?(0,L.jsx)(`ul`,{className:`flex flex-col gap-1 pl-1`,children:r.map(e=>(0,L.jsx)(qB,{note:e,onTakeBack:a,busy:o},e.id))}):null]})}function YB({notes:e,onTakeBack:t,busy:n}){return e.length===0?null:(0,L.jsx)(mz,{title:`Notes on entries that changed`,right:String(e.length),children:(0,L.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.map(e=>(0,L.jsx)(qB,{note:e,about:e.entry,onTakeBack:t,busy:n},e.id))})})}function XB({view:e}){let t=e.entries.length;return(0,L.jsxs)(`header`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsxs)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:[RB[e.agent],` `,(0,L.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`· `,e.file]})]}),(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t,` `,t===1?`entry`:`entries`,` · `,BB(e.chars),` chars`]}),e.over?(0,L.jsx)(`p`,{className:`text-sm text-foreground`,children:VB(e.file)}):null]})}function ZB({draft:e,picked:t,setDraft:n,onEditFile:r,onDelete:i}){let a=!!e;return(0,L.jsxs)(pO,{children:[(0,L.jsx)(Y,{label:`Edit the entry`,text:`Edit`,icon:Sh,shortcut:`E`,disabled:a||!t,onClick:()=>n({kind:`edit`,entry:t})}),(0,L.jsx)(Y,{label:t?`Add an entry after it`:`Add an entry`,text:`Add`,icon:Eh,shortcut:`A`,disabled:a,onClick:()=>n({kind:`add`,entry:t})}),(0,L.jsx)(Y,{label:`Comment on the entry`,text:`Comment`,icon:Km,shortcut:`C`,disabled:a||!t,onClick:()=>n({kind:`comment`,entry:t})}),(0,L.jsx)(Y,{label:`Edit the whole file`,text:`Edit file`,icon:gm,shortcut:`F`,disabled:a,onClick:r}),(0,L.jsx)(WO,{icon:ig,label:`Delete the entry`,text:`Delete`,shortcut:`Delete`,title:`Delete this entry?`,description:`The entry and its notes are removed. The version before is archived.`,confirmLabel:`Delete entry`,variant:`destructive`,disabled:a||!t,onConfirm:i})]})}function QB({agent:e,file:t,onChanged:n}){let r=UD(`knowledge.open`,{agent:e,file:t},[`knowledge`]),[i,a]=(0,m.useState)(0),[o,s]=(0,m.useState)(),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),f=r.data?.view,p=f?.entries??[],h=p[Math.min(i,Math.max(0,p.length-1))],g=async e=>{d(!0),await e(),s(void 0),r.reload(),n(),d(!1)},_=e=>void g(()=>V(`knowledge.unnote`,{id:e})),v=()=>{h&&g(()=>V(`knowledge.remove`,{agent:e,file:t,ref:HB(h)}))},y=n=>{let r=o?.entry;if(o?.kind===`edit`&&r)return void g(()=>V(`knowledge.edit`,{agent:e,file:t,ref:HB(r),text:n}));if(o?.kind===`comment`&&r)return void g(()=>V(`knowledge.comment`,{agent:e,file:t,ref:HB(r),text:n}));g(()=>V(`knowledge.add`,{agent:e,file:t,...h?{ref:HB(h)}:{},text:n}))};return f?(0,L.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`${RB[e]} ${t}`,children:[(0,L.jsx)(ZB,{draft:o,picked:h,setDraft:s,onEditFile:()=>l(!0),onDelete:v}),(0,L.jsx)(XB,{view:f}),p.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing here yet. Add the first entry below.`}):null,(0,L.jsx)(`ul`,{className:`flex flex-col gap-2`,children:p.map((e,t)=>(0,L.jsx)(JB,{entry:e,index:t,selected:t===i,notes:f.attached.filter(t=>t.entry===e.text),onPick:a,onTakeBack:_,busy:u},`${t}-${e.text}`))}),o?.kind===`edit`?(0,L.jsx)(GB,{initial:o.entry.text,busy:u,onSave:y,onCancel:()=>s(void 0)}):null,o?.kind===`comment`?(0,L.jsx)(dB,{label:`Comment on this entry`,hint:zB,buttonLabel:`Add note`,onSend:async e=>(y(e),!0)}):null,o?.kind===`add`?(0,L.jsx)(dB,{label:`Add an entry`,hint:zB,buttonLabel:`Add entry`,onSend:async e=>(y(e),!0)}):null,u&&!o?(0,L.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(FD,{}),` saving…`]}):null,(0,L.jsx)(YB,{notes:f.detached,onTakeBack:_,busy:u}),(0,L.jsx)(KB,{open:c,file:t,initial:f.content,busy:u,onClose:()=>l(!1),onSave:n=>{l(!1),g(()=>V(`knowledge.replaceFile`,{agent:e,file:t,text:n}))}})]}):r.error?(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not read the file. `,r.error]}):(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`reading…`})}var $B={DEV:im,DESIGN:ch,QA:Hh,RESEARCH:eg,"QUICK FIX":Sg,SCOUT:om,PLANNER:Ph,CLASSIFIER:Qh,LOBBY:Xm,LINT:Pm};function eV(e){return e?$B[e.toUpperCase()]??wp:Ep}function tV(e){let t=e?.toUpperCase();return t===`ORACLE`||t===`MASTER`}function nV({source:e,className:t,strokeWidth:n}){if(tV(e))return(0,L.jsx)(`span`,{"aria-hidden":`true`,"data-agent-icon":e,className:q(`agent-oracle shrink-0`,t)});let r=eV(e);return(0,L.jsx)(r,{"aria-hidden":`true`,"data-agent-icon":e??`thinking`,strokeWidth:n,className:q(`shrink-0`,t)})}var rV={MASTER:`text-primary`,DEV:`text-source-dev`,DESIGN:`text-source-design`,QA:`text-source-qa`,RESEARCH:`text-source-research`,"QUICK FIX":`text-source-quickfix`,ORACLE:`text-primary`,LOBBY:`text-muted-foreground`};function iV(e){return e.length<=2?e:e.charAt(0)+e.slice(1).toLowerCase()}function aV(e){return rV[e]??`text-muted-foreground`}var oV={MASTER:`var(--primary)`,DEV:`var(--source-dev)`,DESIGN:`var(--source-design)`,QA:`var(--source-qa)`,RESEARCH:`var(--source-research)`,"QUICK FIX":`var(--source-quickfix)`,ORACLE:`var(--primary)`,LOBBY:`var(--muted-foreground)`};function sV(e){return oV[e]??`var(--muted-foreground)`}function cV(e){if(e.role===`researcher`)return`RESEARCH`;let t=e.domain??e.role;return t===`backend`||t===`dev`?`DEV`:t===`designer`||t===`design`?`DESIGN`:t===`researcher`||t===`research`?`RESEARCH`:t===`qa`?`QA`:t?String(t).toUpperCase():`AGENT`}function lV(e){return e?.runs??[]}function uV(e,t=40){let n=new Map;for(let t of e)n.set(t.source,t);return[...n.values()].sort((e,t)=>e.at-t.at).slice(-t)}function dV(e){return`${e.agent}/${e.file}`}var fV={master:`ORACLE`,designer:`DESIGN`,backend:`DEV`,qa:`QA`},pV=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function mV({info:e}){return(0,L.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 text-xs text-muted-foreground tabular-nums`,children:[(0,L.jsx)(`span`,{children:BB(e.chars)}),e.over?(0,L.jsx)(`span`,{className:`text-foreground`,children:`· over`}):null,e.notes>0?(0,L.jsx)(`span`,{className:`text-primary`,children:pV(e.notes,`note`)}):null]})}function hV({info:e,selected:t,onSelect:n}){return(0,L.jsx)(`li`,{className:`ktree-leaf`,children:(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(dV(e)),className:q($z,`ktree-file min-h-9 flex-row items-center gap-2 py-1.5`),children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`ktree-bud`}),(0,L.jsx)(`span`,{className:q(`min-w-0 flex-1 truncate text-sm text-foreground`,t&&`font-medium`),children:e.label}),(0,L.jsx)(mV,{info:e})]})})}var gV=`bot-lobby.knowledge.folded`;function _V(){try{let e=JSON.parse(window.localStorage.getItem(gV)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}}function vV({files:e,models:t={},selectedKey:n,onSelect:r}){let[i,a]=(0,m.useState)(_V),o=UB(e),s=e.reduce((e,t)=>e+t.notes,0);function c(e,t){a(n=>{let r=t?n.filter(t=>t!==e):[...new Set([...n,e])];try{window.localStorage.setItem(gV,JSON.stringify(r))}catch{}return r})}return(0,L.jsxs)(`div`,{className:`ktree px-3 pt-1 pb-3`,children:[(0,L.jsxs)(`p`,{className:`ktree-root`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`card-raised grid size-8 shrink-0 place-items-center rounded-lg border text-primary`,children:(0,L.jsx)(Sp,{className:`size-4`})}),(0,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:`block text-sm font-medium`,children:`Project knowledge`}),(0,L.jsxs)(`span`,{className:`block text-xs text-muted-foreground`,children:[pV(e.length,`file`),` · `,pV(o.length,`agent`),s>0?` · ${pV(s,`note`)}`:``]})]})]}),(0,L.jsx)(`ul`,{className:`ktree-branches`,"aria-label":`Agents and their knowledge`,children:o.map(e=>{let a=!i.includes(e.agent),o=fV[e.agent],s=`knowledge-${e.agent}`,l=t[e.agent];return(0,L.jsxs)(`li`,{className:`ktree-branch`,style:{"--orb":sV(o)},children:[(0,L.jsx)(`h3`,{children:(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space ArrowLeft ArrowRight`,"aria-describedby":`focused-action-help`,type:`button`,"aria-expanded":a,"aria-controls":s,onClick:()=>c(e.agent,!a),onKeyDown:t=>{t.key===`ArrowLeft`||t.key===`h`?(t.preventDefault(),t.stopPropagation(),c(e.agent,!1)):(t.key===`ArrowRight`||t.key===`l`)&&(t.preventDefault(),t.stopPropagation(),a||c(e.agent,!0))},className:`ktree-node`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`ktree-tile`,children:(0,L.jsx)(nV,{source:o,strokeWidth:2.25,className:o===`ORACLE`?`size-5`:`size-3.5`})}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`span`,{className:`block truncate text-sm font-medium text-foreground`,children:LB[e.agent]}),l?(0,L.jsxs)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`sr-only`,children:`runs on `}),l]}):null]}),(0,L.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:[e.notes>0?(0,L.jsxs)(`span`,{className:`text-primary`,children:[pV(e.notes,`note`),` · `]}):null,pV(e.files.length,`file`)]}),(0,L.jsx)(Pp,{"aria-hidden":`true`,className:q(`size-3.5 shrink-0 text-muted-foreground transition-transform duration-200 ease-snap`,a&&`rotate-90`)})]})}),(0,L.jsx)(tu,{initial:!1,children:a?(0,L.jsx)(z.ul,{id:s,"aria-label":`${LB[e.agent]}'s knowledge`,initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{type:`spring`,stiffness:520,damping:42},className:`ktree-leaves`,children:e.files.map(e=>(0,L.jsx)(hV,{info:e,selected:dV(e)===n,onSelect:r},dV(e)))},`files`):null})]},e.agent)})})]})}var yV=()=>DD(ED(`knowledge`)),bV=e=>{let[t,n]=e.split(`/`);DD(ED(`knowledge`,t??``,n??``))};function xV(){return(0,L.jsx)(kD,{className:`m-4 flex-1`,children:(0,L.jsxs)(AD,{children:[(0,L.jsx)(MD,{variant:`icon`,children:(0,L.jsx)(Sp,{"aria-hidden":`true`})}),(0,L.jsx)(PD,{children:`No knowledge files yet.`})]})})}function SV(e,t,n,r){let i=e.find(e=>e.agent===t&&e.file===n);return i?(0,L.jsx)(QB,{agent:i.agent,file:i.file,onChanged:r},dV(i)):t&&n?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That file is not on the list any more.`}):null}function CV({agent:e,file:t}){let n=SO(),r=UD(`knowledge.files`,{},[`knowledge`]),i=r.data?.files??[];if(!r.data&&r.error)return(0,L.jsx)(LD,{message:`Could not load the knowledge files. ${r.error}`,onRetry:r.reload});if(r.data&&i.length===0)return(0,L.jsx)(xV,{});let a=i.reduce((e,t)=>e+t.notes,0),o=i.find(n=>n.agent===e&&n.file===t),s=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(EO,{title:`Knowledge`,count:a>0?`${a} note${a===1?``:`s`}`:void 0}),r.data?(0,L.jsx)(vV,{files:i,models:r.data.models??{},selectedKey:o?dV(o):void 0,onSelect:bV}):(0,L.jsx)(DO,{})]});return(0,L.jsx)(TO,{wide:n,list:s,detail:SV(i,e,t,r.reload),open:!!(e&&t),onClose:yV,hint:`Select a file to read its entries.`,describe:`Knowledge file`})}function wV({className:e,...t}){return(0,L.jsx)(FS,{"aria-keyshortcuts":`Space`,"aria-description":`When focused, press Space to toggle.`,"data-slot":`checkbox`,className:q(`peer relative flex size-[1.125rem] shrink-0 items-center justify-center rounded-[5px] border border-input bg-background text-primary-foreground transition-colors duration-150 outline-none before:absolute before:-inset-3 before:content-[''] focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary`,e),...t,children:(0,L.jsx)(LS,{"data-slot":`checkbox-indicator`,className:`flex items-center justify-center`,children:(0,L.jsx)(Op,{"aria-hidden":`true`,className:`size-3`,strokeWidth:3})})})}var TV=`Sessions`,EV=`No sessions yet.`,DV=`Up to 5 sessions; each can be assigned to one agent or several.`,OV=`A session is a live Excalidraw room that you and your agents draw in together.`,kV=[{title:`Start a live room`,text:`In Excalidraw: Share → Live collaboration → Start session.`},{title:`Add it here`,text:`Paste the room link, or make a new room and open it in Excalidraw.`},{title:`Assign agents`,text:`They read the board and draw on it, under their own name.`}],AV=`Sessions`,jV=`Pick a session on the left to see its link, its room and its agents.`,MV=`Room link`,NV=`Masked until revealed. A revealed link stays in this tab and is never saved.`,PV=`Room`,FV=`Drawing`,IV=`Last check`,LV=`not checked yet`,RV=`Add a session`,zV=`https://excalidraw.com/#room=…`,BV=`Optional name`;function VV(e){return`${e} of 5 in use`}var HV=`Agents may draw here.`,UV=`Agents may only look.`,WV=`checking the room…`,GV=`Check that the room can be reached.`,KV=`Assigned to`,qV=`Assigned agents read the board and draw on it with excalidraw_read and excalidraw_draw, and appear in the room under their own name.`,JV=`Add or rename`,YV=`Add by link`,XV=`In Excalidraw, Share → Live collaboration → Start session, then paste the link. Enter adds it.`,ZV=`New room`,QV=`Makes a fresh room link to open in Excalidraw; the name is optional.`,$V=`Rename`,eH=`draw`,tH=`look only`,nH=`Copied to the clipboard`,rH=`Could not reveal the link.`,iH=[`master`,`designer`,`backend`,`qa`,`scout`,`researcher`,`quickfix`,`planner`],aH={master:`Master (oracle)`,designer:`Designer`,backend:`Backend`,qa:`QA`,scout:`Scouts`,researcher:`Researcher`,quickfix:`Quick fix`,planner:`Planner`};function oH(e){return e===0?`no agents`:`${e} agent${e===1?``:`s`}`}function sH(e){return e?e.ok?`✓`:`!`:``}function cH({title:e,right:t,className:n,children:r}){return(0,L.jsxs)(`section`,{className:q(`card-raised flex min-w-0 flex-col gap-3 rounded-xl border p-4`,n),children:[(0,L.jsxs)(`header`,{className:`flex items-baseline justify-between gap-3`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:e}),t?(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t}):null]}),r]})}function lH({row:e=!1}){return(0,L.jsx)(`ol`,{className:q(`grid gap-3`,e&&`@2xl:grid-cols-3`),children:kV.map((e,t)=>(0,L.jsxs)(`li`,{className:`card-raised flex gap-3 rounded-xl border p-3.5`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-6 shrink-0 place-items-center rounded-full bg-accent text-xs font-semibold text-primary tabular-nums`,children:t+1}),(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.title}),(0,L.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:e.text})]})]},e.title))})}function uH({label:e,hint:t,buttonLabel:n,placeholder:r,initial:i=``,required:a,mono:o,primary:s,onSubmit:c}){let l=(0,m.useId)(),[u,d]=(0,m.useState)(i),[f,p]=(0,m.useState)(!1),h=a&&!u.trim(),g=async()=>{h||f||(p(!0),await c(u)&&d(i),p(!1))};return(0,L.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-2`,onSubmit:e=>{e.preventDefault(),g()},children:[(0,L.jsx)(`label`,{htmlFor:l,className:`text-xs font-medium text-muted-foreground`,children:e}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(`input`,{id:l,value:u,maxLength:o?2e3:80,placeholder:r,"aria-describedby":t?`${l}-hint`:void 0,onChange:e=>d(e.target.value),className:q(`h-8 min-w-0 flex-1 rounded-lg border border-input bg-background px-3 text-sm outline-none transition-[border-color,box-shadow] placeholder:text-muted-foreground/70 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30`,o&&`font-mono text-[0.8125rem]`)}),(0,L.jsx)(Y,{type:`submit`,label:n,icon:f?Rm:Eh,tone:s?`primary`:`neutral`,shortcut:`Enter`,disabled:h||f,className:f?`[&_svg]:animate-spin`:void 0})]}),t?(0,L.jsx)(`p`,{id:`${l}-hint`,className:`text-xs leading-relaxed text-muted-foreground`,children:t}):null]})}function dH({onChanged:e,primary:t}){return(0,L.jsx)(uH,{label:YV,hint:XV,buttonLabel:`Add`,placeholder:zV,required:!0,mono:!0,primary:t,onSubmit:async t=>await V(`excalidraw.add`,{link:t.trim()})?(e(),!0):!1})}function fH({onChanged:e,primary:t}){return(0,L.jsx)(uH,{label:ZV,hint:QV,buttonLabel:`Create`,placeholder:BV,primary:t,onSubmit:async t=>{let n=t.trim();return await V(`excalidraw.create`,n?{name:n}:{})?(e(),!0):!1}})}function pH({onChanged:e,stacked:t=!1}){return(0,L.jsxs)(`div`,{className:q(`grid gap-4`,!t&&`@2xl:grid-cols-2`),children:[(0,L.jsx)(dH,{onChanged:e,primary:!0}),(0,L.jsx)(fH,{onChanged:e,primary:!0})]})}function mH({session:e,onChanged:t}){return(0,L.jsx)(uH,{label:$V,initial:e.name,required:!0,buttonLabel:$V,onSubmit:async n=>await V(`excalidraw.rename`,{id:e.id,name:n.trim()})?(t(),!0):!1},e.name)}function hH({icon:e,tone:t=`muted`,children:n}){return(0,L.jsxs)(`span`,{className:q(`inline-flex h-6 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium`,t===`primary`?`bg-accent text-primary`:t===`warning`?`bg-warning/10 text-warning`:`bg-muted text-muted-foreground`),children:[(0,L.jsx)(e,{"aria-hidden":`true`,className:`size-3.5`}),n]})}function gH({check:e,checking:t}){return t?(0,L.jsx)(hH,{icon:Rm,children:WV}):e?e.ok?(0,L.jsx)(hH,{icon:Hp,tone:`primary`,children:`reachable`}):(0,L.jsx)(hH,{icon:Bp,tone:`warning`,children:`unreachable`}):(0,L.jsx)(hH,{icon:Wp,children:LV})}function _H({label:e,children:t}){return(0,L.jsxs)(`div`,{className:`grid grid-cols-[6rem_minmax(0,1fr)] items-baseline gap-3 text-sm`,children:[(0,L.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,L.jsx)(`dd`,{className:`min-w-0`,children:t})]})}function vH({check:e,checking:t}){return t?(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,L.jsx)(FD,{className:`size-3.5`,"aria-hidden":`true`}),WV]}):e?(0,L.jsxs)(`span`,{className:e.ok?`text-primary`:`text-foreground`,children:[e.ok?`✓`:`!`,` `,e.text]}):(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:GV})}function yH({agent:e,on:t,onToggle:n}){return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`label`,{className:q(`flex h-9 w-full cursor-pointer items-center gap-2.5 rounded-lg border px-2.5 text-sm transition-[background-color,border-color,color]`,t?`border-primary/25 bg-accent text-foreground`:`border-border text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,L.jsx)(wV,{checked:t,onCheckedChange:()=>n(e)}),(0,L.jsx)(`span`,{className:`truncate`,children:aH[e]})]})})}function bH({session:e,onChanged:t}){let n=async n=>{await V(`excalidraw.toggleAgent`,{id:e.id,agent:n})&&t()},r=async()=>{await V(`excalidraw.toggleAll`,{id:e.id})&&t()},i=e.agents.length===iH.length;return(0,L.jsxs)(cH,{title:KV,right:oH(e.agents.length),children:[(0,L.jsx)(`ul`,{className:`grid grid-cols-1 gap-1.5 @md:grid-cols-2`,children:iH.map(t=>(0,L.jsx)(yH,{agent:t,on:e.agents.includes(t),onToggle:n},t))}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,L.jsx)(`p`,{className:`min-w-0 flex-1 text-xs leading-relaxed text-muted-foreground`,children:qV}),(0,L.jsx)(Y,{label:i?`Take every agent off`:`Assign every agent`,icon:Pm,onClick:()=>void r()})]})]})}function xH({session:e,check:t,checking:n,onCheck:r,onChanged:i,onRemove:a}){let[o,s]=(0,m.useState)(),c=async()=>{try{s((await qf(`excalidraw.reveal`,{id:e.id})).link)}catch(e){B.error(e instanceof Error?e.message:rH)}},l=()=>void navigator.clipboard?.writeText(o??``).then(()=>B(nH)).catch(()=>void 0),u=async()=>{await V(`excalidraw.toggleContribute`,{id:e.id})&&i()};return(0,L.jsxs)(`article`,{"aria-label":`Session detail`,className:`@container flex flex-col gap-4`,children:[(0,L.jsxs)(pO,{children:[o?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Y,{label:`Copy the link`,text:`Copy`,icon:cm,shortcut:`C`,onClick:l}),(0,L.jsx)(Y,{label:`Open board`,icon:fm,tone:`primary`,shortcut:`O`,href:o})]}):(0,L.jsx)(Y,{label:`Reveal the link`,text:`Reveal`,icon:mm,shortcut:`R`,onClick:()=>void c()}),(0,L.jsx)(Y,{label:e.contribute?`Look only: agents stop drawing`:`Let agents draw`,text:e.contribute?`Look only`:`Let agents draw`,icon:e.contribute?bh:Sh,shortcut:`W`,pressed:e.contribute,onClick:()=>void u()}),(0,L.jsx)(Y,{label:`Check the room`,text:`Check`,icon:n?Rm:Hh,shortcut:`T`,disabled:n,onClick:r}),(0,L.jsx)(WO,{icon:ig,label:`Remove the session`,text:`Remove`,shortcut:`Delete`,title:`Remove "${e.name}"?`,description:`Agents lose this session at once; the Excalidraw room itself is not touched.`,confirmLabel:`Remove session`,variant:`destructive`,onConfirm:a})]}),(0,L.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:e.name}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,L.jsx)(hH,{icon:e.contribute?Sh:mm,tone:e.contribute?`primary`:`muted`,children:e.contribute?eH:tH}),(0,L.jsx)(hH,{icon:fg,children:oH(e.agents.length)}),(0,L.jsx)(gH,{check:t,checking:n})]})]}),(0,L.jsxs)(`div`,{className:`grid gap-4 @3xl:grid-cols-2`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,L.jsxs)(cH,{title:MV,children:[(0,L.jsx)(`p`,{className:`rounded-lg border border-border bg-muted px-3 py-2 font-mono text-[0.8125rem] break-all text-foreground`,children:o??e.masked}),(0,L.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:NV})]}),(0,L.jsx)(cH,{title:PV,children:(0,L.jsxs)(`dl`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(_H,{label:FV,children:(0,L.jsx)(`span`,{className:e.contribute?`text-primary`:`text-muted-foreground`,children:e.contribute?HV:UV})}),(0,L.jsx)(_H,{label:IV,children:(0,L.jsx)(vH,{check:t,checking:n})})]})})]}),(0,L.jsx)(bH,{session:e,onChanged:i})]}),(0,L.jsx)(cH,{title:JV,children:(0,L.jsxs)(`div`,{className:`grid gap-4 @3xl:grid-cols-3`,children:[(0,L.jsx)(mH,{session:e,onChanged:i}),(0,L.jsx)(dH,{onChanged:i}),(0,L.jsx)(fH,{onChanged:i})]})})]})}function SH({check:e,checking:t}){if(t)return(0,L.jsx)(FD,{className:`size-3.5 shrink-0 text-muted-foreground`});let n=sH(e);return n?(0,L.jsx)(`span`,{className:q(`w-3.5 shrink-0 text-center`,e?.ok?`text-primary`:`text-foreground`),"aria-hidden":`true`,children:n}):(0,L.jsx)(`span`,{className:`w-3.5 shrink-0`,"aria-hidden":`true`})}function CH({session:e,check:t,checking:n,selected:r,onSelect:i}){return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":r?`true`:void 0,onClick:()=>i(e.id),className:$z,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-sm`,children:[(0,L.jsx)(SH,{check:t,checking:n}),(0,L.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,r&&`font-medium`),children:e.name}),(0,L.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:oH(e.agents.length)})]}),(0,L.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 pl-[1.375rem] text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`font-mono break-all`,children:e.masked}),(0,L.jsx)(Qz,{variant:`secondary`,children:e.contribute?eH:tH})]})]})})}function wH({sessions:e,checks:t,checking:n,selectedId:r,onSelect:i}){return(0,L.jsx)(`ul`,{className:eB,children:e.map(e=>(0,L.jsx)(CH,{session:e,check:t[e.id],checking:n.includes(e.id),selected:e.id===r,onSelect:i},e.id))})}var TH=()=>DD(ED(`excalidraw`)),EH=e=>DD(ED(`excalidraw`,e));function DH({count:e}){return(0,L.jsxs)(`span`,{className:`flex items-center gap-2.5 text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`flex gap-1`,children:Array.from({length:5},(t,n)=>(0,L.jsx)(`span`,{className:q(`h-1.5 w-5 rounded-full`,n<e?`bg-primary`:`bg-border`)},n))}),(0,L.jsx)(`span`,{className:`tabular-nums`,children:VV(e)})]})}function OH({count:e,onChanged:t}){return(0,L.jsxs)(`div`,{className:`@container flex max-w-4xl flex-col gap-5`,children:[(0,L.jsxs)(`header`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:AV}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:jV})]}),(0,L.jsx)(DH,{count:e})]}),(0,L.jsx)(lH,{row:!0}),e<5?(0,L.jsx)(cH,{title:RV,children:(0,L.jsx)(pH,{onChanged:t})}):null,(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-4`,children:[(0,L.jsx)(lD,{chord:`ArrowDown`,children:`next session`}),(0,L.jsx)(lD,{chord:`ArrowRight`,children:`into its detail`})]})]})}function kH({onChanged:e}){return(0,L.jsx)(`div`,{className:`@container flex-1 overflow-y-auto px-5 pt-10 pb-dock sm:px-8`,children:(0,L.jsxs)(`div`,{className:`mx-auto grid max-w-5xl gap-8 @4xl:grid-cols-[minmax(0,1fr)_minmax(0,24rem)]`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`card-raised grid size-11 place-items-center rounded-xl border text-primary`,children:(0,L.jsx)(gh,{className:`size-5`})}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:EV}),(0,L.jsx)(`p`,{className:`max-w-prose text-sm leading-relaxed text-muted-foreground`,children:OV})]}),(0,L.jsx)(lH,{}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:DV})]}),(0,L.jsx)(cH,{title:RV,className:`self-start`,children:(0,L.jsx)(pH,{onChanged:e,stacked:!0})})]})})}function AH({id:e}){let t=SO(),n=UD(`excalidraw.list`,{},[`excalidraw`]),[r,i]=(0,m.useState)({}),[a,o]=(0,m.useState)([]),s=n.data?.sessions??[],c=s.find(t=>t.id===e),l=async e=>{o(t=>[...t,e]);let t=await V(`excalidraw.check`,{id:e});o(t=>t.filter(t=>t!==e)),t&&i(n=>({...n,[e]:t}))},u=async()=>{c&&await V(`excalidraw.remove`,{id:c.id})&&(n.reload(),TH())};if(!n.data&&n.error)return(0,L.jsx)(LD,{message:`Could not load sessions. ${n.error}`,onRetry:n.reload});if(n.data&&s.length===0)return(0,L.jsx)(kH,{onChanged:n.reload});let d=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(EO,{title:TV,count:n.data?`${s.length}/5`:void 0}),n.data?(0,L.jsx)(wH,{sessions:s,checks:r,checking:a,selectedId:e,onSelect:EH}):(0,L.jsx)(DO,{})]}),f=c?(0,L.jsx)(xH,{session:c,check:r[c.id],checking:a.includes(c.id),onCheck:()=>void l(c.id),onChanged:n.reload,onRemove:()=>void u()}):t&&n.data?(0,L.jsx)(OH,{count:s.length,onChanged:n.reload}):null;return(0,L.jsx)(TO,{wide:t,list:d,detail:f,open:c!==void 0,onClose:TH,hint:`Select a session to see its link and agents.`,describe:`Session detail`})}function jH(e,t){return e===`lobby.thinking`||t===`1`}var MH=`bot-lobby.collapsed.`,NH=new Set,PH=new Map;function FH(e){if(PH.has(e))return PH.get(e);if(e===`lobby.thinking`)return jH(e);try{return jH(e,localStorage.getItem(MH+e))}catch{return!1}}function IH(e,t){PH.set(e,t);try{e!==`lobby.thinking`&&localStorage.setItem(MH+e,t?`1`:`0`)}catch{}for(let e of[...NH])e()}function LH(e){return NH.add(e),()=>{NH.delete(e)}}function RH(e){IH(e,!FH(e))}function zH(e){return[(0,m.useSyncExternalStore)(LH,()=>FH(e),()=>jH(e)),(0,m.useCallback)(()=>IH(e,!FH(e)),[e])]}function BH(e){let t=(0,m.useRef)(null),n=(0,m.useRef)(!0),[r,i]=(0,m.useState)(!0),a=(0,m.useRef)(void 0),o=(0,m.useRef)(null),s=(0,m.useCallback)(()=>{n.current=!0,i(!0);let e=t.current;e&&(e.scrollTop=e.scrollHeight)},[]);return(0,m.useLayoutEffect)(()=>{n.current&&s()},[e,s]),(0,m.useLayoutEffect)(()=>{let e=t.current;if(!e||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(()=>{n.current&&(e.scrollTop=e.scrollHeight)});return r.observe(e),a.current=r,()=>{r.disconnect(),a.current=void 0,o.current=null}},[]),(0,m.useLayoutEffect)(()=>{let e=a.current,n=t.current?.firstElementChild??null;e&&n!==o.current&&(o.current&&e.unobserve(o.current),n&&e.observe(n),o.current=n)},[e]),{ref:t,atBottom:r,stick:s,onScroll:(0,m.useCallback)(()=>{let e=t.current;e&&(n.current=e.scrollHeight-e.scrollTop-e.clientHeight<48,i(n.current))},[])}}function VH({entry:e}){return e.pending?(0,L.jsx)(FD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}):e.kind===`error`?(0,L.jsx)(bg,{"aria-hidden":`true`,className:`size-3.5 text-destructive`}):e.kind===`warning`?(0,L.jsx)(og,{"aria-hidden":`true`,className:`size-3.5 text-warning`}):e.kind===`success`?(0,L.jsx)(Op,{"aria-hidden":`true`,className:`size-3.5 text-success`}):(0,L.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`})}function HH({entry:e}){return(0,L.jsxs)(`li`,{className:`grid grid-cols-[2.75rem_5rem_1rem_minmax(0,1fr)] items-baseline gap-x-2 rounded-lg px-2 py-1.5 text-sm transition-colors hover:bg-muted`,children:[(0,L.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:AO(e.at)}),(0,L.jsx)(`span`,{className:q(`overflow-hidden text-xs font-medium whitespace-nowrap`,aV(e.source)),children:iV(e.source)}),(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`flex items-center justify-center self-center`,children:(0,L.jsx)(VH,{entry:e})}),(0,L.jsx)(`span`,{className:`sr-only`,children:e.pending?`pending`:e.kind}),(0,L.jsx)(`span`,{className:q(`min-w-0 break-words`,e.kind===`error`?`text-destructive`:e.pending?``:`text-muted-foreground`),children:e.pending?`${e.text}…`:e.text})]})}function UH({entries:e,collapsed:t,onToggle:n,shortcut:r,bare:i}){let a=e.slice(-400),o=a.filter(e=>e.pending).length,{ref:s,atBottom:c,stick:l,onScroll:u}=BH(JSON.stringify(a));return(0,L.jsxs)(fz,{"aria-label":`Activity`,...i?{}:{title:`Activity`},collapsed:t,...n?{onToggle:n}:{},shortcut:r,className:`flex-1`,note:o?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(FD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}),` `,o,` running`]}):void 0,children:[(0,L.jsx)(`div`,{ref:s,onScroll:u,className:`min-h-0 flex-1 overflow-y-auto overscroll-y-contain px-2 pt-2 pb-dock outline-none focus-visible:bg-muted/30`,role:`log`,"aria-label":`Activity`,tabIndex:0,children:a.length===0?(0,L.jsx)(`p`,{className:`px-2 py-1 text-sm text-muted-foreground`,children:`No activity yet.`}):(0,L.jsx)(`ul`,{children:a.map(e=>(0,L.jsx)(HH,{entry:e},e.id))})}),c?null:(0,L.jsx)(`div`,{className:`absolute inset-x-0 bottom-dock z-10 flex justify-center`,children:(0,L.jsx)(Y,{label:`Jump to latest`,text:`Latest`,icon:mp,className:`rounded-full bg-card shadow-card`,onClick:l})})]})}function WH({source:e,live:t}){let n=tV(e);return(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`chat-avatar`,"data-live":t||void 0,"data-oracle":n||void 0,style:{"--orb":sV(e)},children:(0,L.jsx)(nV,{source:e,strokeWidth:2.25,className:n?`size-7`:`size-3.5`})})}function GH({source:e,name:t,time:n,head:r,live:i,children:a,aside:o,bubble:s=!0}){return(0,L.jsxs)(`div`,{className:`chat-row group/msg`,children:[(0,L.jsx)(`div`,{className:`chat-gutter`,children:r?(0,L.jsx)(WH,{source:e,live:i}):n?(0,L.jsx)(`time`,{className:`chat-hover-time`,children:n}):null}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[r?(0,L.jsxs)(`p`,{className:`chat-speaker`,children:[(0,L.jsx)(`span`,{className:`font-medium text-foreground`,children:t}),n?(0,L.jsx)(`time`,{className:`text-xs text-muted-foreground tabular-nums`,children:n}):null,o?(0,L.jsx)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:o}):null]}):null,s?(0,L.jsx)(`div`,{className:`chat-bubble-agent`,style:{"--orb":sV(e)},children:a}):a]})]})}function KH({time:e,head:t,note:n,children:r,below:i}){return(0,L.jsxs)(`div`,{className:`flex flex-col items-end gap-1`,children:[t?(0,L.jsxs)(`p`,{className:`flex items-baseline gap-2 text-xs text-muted-foreground`,children:[e?(0,L.jsx)(`time`,{className:`tabular-nums`,children:e}):null,(0,L.jsx)(`span`,{className:`font-medium text-foreground`,children:`You`}),n?(0,L.jsx)(`span`,{children:n}):null]}):null,(0,L.jsx)(`div`,{className:`chat-bubble`,children:r}),i]})}function qH({failed:e,children:t}){return(0,L.jsx)(`div`,{role:`note`,className:q(`chat-note`,e&&`text-destructive`),children:(0,L.jsx)(`span`,{children:t})})}function JH({className:e}){return(0,L.jsxs)(`span`,{"aria-hidden":`true`,className:q(`typing-dots`,e),children:[(0,L.jsx)(`span`,{}),(0,L.jsx)(`span`,{}),(0,L.jsx)(`span`,{})]})}var YH=3e5,XH=`earlier messages load as you scroll up`,ZH=`No task is running in this session.`,QH=`Type a request below and press enter to start one: the oracle scouts, proposes, plans and delegates.`,$H=`Nothing said yet. Type below to talk to the oracle about this task.`;function eU({entry:e}){return(0,L.jsxs)(qH,{failed:e.text.startsWith(`✗`),children:[e.text,e.at?` · ${AO(e.at)}`:``]})}function tU({entry:e,head:t}){if(e.role===`you`)return(0,L.jsx)(KH,{time:AO(e.at),head:t,children:(0,L.jsx)(dz,{text:e.text})});let n=e.role===`panel`;return(0,L.jsx)(GH,{source:n?`PLANNER`:`ORACLE`,name:n?`Panel`:`Oracle`,time:AO(e.at),head:t,children:(0,L.jsx)(dz,{text:e.text})})}var nU=(0,m.memo)(function({entry:e,head:t,fresh:n}){return(0,L.jsx)(z.div,{initial:n?{opacity:0,y:10}:!1,animate:{opacity:1,y:0},transition:{type:`spring`,stiffness:420,damping:32},children:e.role===`note`?(0,L.jsx)(eU,{entry:e}):(0,L.jsx)(tU,{entry:e,head:t})})},(e,t)=>e.head===t.head&&e.entry.id===t.entry.id&&e.entry.text===t.entry.text&&e.entry.at===t.entry.at);function rU({text:e,busy:t}){let n=!!e?.trim();return!n&&!t?null:(0,L.jsx)(GH,{source:`ORACLE`,name:`Oracle`,head:!0,live:t,aside:t&&n?`writing…`:void 0,children:n?(0,L.jsx)(dz,{text:e??``}):(0,L.jsx)(JH,{className:`mt-1`})})}function iU({hasTask:e}){return(0,L.jsxs)(kD,{className:`h-full border-0`,children:[(0,L.jsxs)(AD,{children:[(0,L.jsx)(MD,{variant:`icon`,children:(0,L.jsx)(Jm,{"aria-hidden":`true`})}),e?null:(0,L.jsx)(ND,{children:ZH}),(0,L.jsx)(PD,{children:e?$H:QH})]}),e?null:(0,L.jsxs)(`ul`,{className:`flex flex-col gap-2 text-sm text-muted-foreground`,children:[(0,L.jsxs)(`li`,{className:`flex items-center justify-center gap-2`,children:[`Or plan it first with the whole panel in `,(0,L.jsx)(cD,{chord:`3`}),` Plan`]}),(0,L.jsxs)(`li`,{className:`flex items-center justify-center gap-2`,children:[`or make a direct change in `,(0,L.jsx)(cD,{chord:`4`}),` Quick fix`]})]})]})}async function aU(e){let t=await qf(`lobby.history`,{before:e});return{entries:t.entries,hasOlder:t.hasOlder}}function oU(e,t,n){let[r,i]=(0,m.useState)([]),[a,o]=(0,m.useState)(t),[s,c]=(0,m.useState)(!1),l=(0,m.useMemo)(()=>{let t=new Set(e.map(e=>e.id));return[...r.filter(e=>!t.has(e.id)),...e]},[r,e]);return{merged:l,more:a,loading:s,load:(0,m.useCallback)(async()=>{let e=l[0]?.id;if(e===void 0||s||!a)return;c(!0);let t=n.current,r=t?.scrollHeight??0,u=t?.scrollTop??0;try{let t=await aU(e);i(e=>[...t.entries,...e]),o(t.hasOlder),window.requestAnimationFrame(()=>{let e=n.current;e&&(e.scrollTop=e.scrollHeight-r+u)})}catch{o(!1)}finally{c(!1)}},[l,s,a,n])}}function sU({chat:e,reply:t,busy:n,hasOlder:r,hasTask:i,bare:a}){let{ref:o,atBottom:s,stick:c,onScroll:l}=BH(e.length+(t?.length??0)),{merged:u,more:d,loading:f,load:p}=oU(e,r,o),h=(0,m.useCallback)(()=>{l();let e=o.current;e&&e.scrollTop<80&&d&&!f&&p()},[l,o,d,f,p]),g=u.length===0&&!t?.trim()&&!n,[_,v]=(0,m.useState)(!1);return(0,m.useEffect)(()=>v(!0),[]),(0,L.jsxs)(fz,{"aria-label":`Conversation`,...a?{}:{title:`Conversation`},note:d?XH:void 0,className:`flex-1`,children:[(0,L.jsx)(`div`,{ref:o,onScroll:h,className:`min-h-0 flex-1 overflow-y-auto overscroll-y-contain px-5 pt-4 pb-dock outline-none focus-visible:bg-muted/30`,role:`log`,"aria-label":`Conversation`,tabIndex:0,children:g?(0,L.jsx)(iU,{hasTask:i}):(0,L.jsxs)(`div`,{className:`chat-column`,children:[u.map((e,t)=>{let n=u[t-1],r=!n||n.role!==e.role||e.at-n.at>YH;return(0,L.jsx)(nU,{entry:e,head:r,fresh:_},e.id)}),(0,L.jsx)(rU,{text:t,busy:n})]})}),s?null:(0,L.jsx)(`div`,{className:`absolute right-4 bottom-dock z-10`,children:(0,L.jsx)(Y,{label:`Jump to latest`,text:`Latest`,icon:mp,tone:`primary`,className:`rounded-full shadow-sm`,onClick:c})})]})}function cU(e){let[t,n]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{if(!e)return;let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),t}function lU(e){return e===`running`?(0,L.jsx)(FD,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5`}):e===`success`?(0,L.jsx)(Op,{"aria-hidden":`true`,className:`size-3.5 text-success`}):e===`failed`||e===`timeout`||e===`error`?(0,L.jsx)(bg,{"aria-hidden":`true`,className:`size-3.5 text-destructive`}):(0,L.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/50`})}function uU(e,t){let n=e.startedAt?Date.parse(e.startedAt):NaN;return jO((e.finishedAt?Date.parse(e.finishedAt):t)-n)}function dU({runs:e}){let t=cU(e.some(e=>e.status===`running`));return e.length===0?null:(0,L.jsx)(`ul`,{className:`-mt-1 flex shrink-0 flex-wrap items-center gap-1.5 px-4 pb-3`,"aria-label":`Runs`,children:e.map((e,n)=>(0,L.jsxs)(`li`,{className:`flex items-center gap-2 rounded-full bg-muted py-1 pr-3 pl-2 text-xs`,children:[(0,L.jsx)(`span`,{className:`flex size-4 items-center justify-center`,children:lU(e.status)}),(0,L.jsx)(`span`,{className:`sr-only`,children:e.status??`unknown`}),(0,L.jsx)(`span`,{className:q(`font-medium`,aV(cV(e))),children:iV(cV(e))}),e.activity??e.step?(0,L.jsx)(`span`,{className:`max-w-[18rem] truncate text-muted-foreground`,children:e.activity??e.step}):null,(0,L.jsx)(`span`,{className:`tabular-nums text-muted-foreground`,children:uU(e,t)})]},e.runId??n))})}function fU(e,t=0,n=!1){let r=!n&&!e.waiting&&!!e.runningSince,i=r?Date.parse(e.serverNow)-Date.parse(e.runningSince):0;return Math.max(0,e.elapsedMs)+(Number.isFinite(i)?Math.max(0,i):0)+(r?Math.max(0,t):0)}function pU(e){let t=Math.floor(e/1e3);return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m ${t%60}s`:`${Math.floor(t/3600)}h ${Math.floor(t%3600/60)}m`}function mU(e,t){let[n,r]=(0,m.useState)(0);return(0,m.useEffect)(()=>{if(r(0),!e)return;let t=performance.now(),n=window.setInterval(()=>r(performance.now()-t),1e3);return()=>window.clearInterval(n)},[e,t]),e?n:0}var hU=8;function gU(e){return e?e.path===`fast`?`fast track (${e.size})`:`full workflow (${e.size})`:``}function _U(e,t){let n=Math.min(t,hU);if(n<=0)return[];let r=Math.min(n,Math.round(Math.max(0,e)/t*n));return Array.from({length:n},(e,t)=>t<r)}function vU({done:e,total:t}){return(0,L.jsx)(`span`,{className:`inline-flex items-center gap-0.5`,"aria-hidden":`true`,children:_U(e,t).map((e,t)=>(0,L.jsx)(`span`,{className:q(`h-1.5 w-3 rounded-full`,e?`bg-primary`:`bg-muted-foreground/25`)},t))})}function yU({check:e,className:t}){return(0,L.jsx)(e===`done`?Hp:e===`dropped`?Qp:em,{"aria-hidden":`true`,className:q(`size-4 shrink-0`,e===`done`?`text-success`:`text-muted-foreground`,t)})}function bU({children:e}){return(0,L.jsx)(`span`,{className:`hidden shrink-0 items-center gap-1 text-xs text-muted-foreground md:inline-flex`,children:e})}function xU({ms:e,running:t,sample:n}){let r=mU(t,n);return(0,L.jsx)(`span`,{className:`tabular-nums`,children:pU(e+r)})}function SU({work:e}){return(0,L.jsxs)(`span`,{className:`hidden shrink-0 items-center gap-1 text-xs text-muted-foreground md:inline-flex`,title:`How long the agents have worked on this task (idle time left out)`,children:[(0,L.jsx)(ng,{"aria-hidden":`true`,className:`size-3 shrink-0`}),`worked `,(0,L.jsx)(xU,{ms:e.workedMs,running:e.running,sample:e})]})}function CU({active:e,current:t}){let n=e?.[0];return n?(0,L.jsxs)(`span`,{className:`hidden max-w-[20rem] min-w-0 items-center gap-1.5 xl:inline-flex`,children:[(0,L.jsx)(`span`,{className:`truncate text-foreground`,children:n.text}),(0,L.jsxs)(`span`,{className:`shrink-0 rounded-md bg-primary/10 px-1.5 py-px font-medium text-primary`,children:[`active · `,(0,L.jsx)(xU,{ms:n.workedMs,running:!0,sample:n})]}),e.length>1?(0,L.jsxs)(`span`,{className:`shrink-0`,children:[`+`,e.length-1]}):null]}):t?(0,L.jsxs)(`span`,{className:`hidden max-w-[16rem] truncate xl:inline`,children:[`next: `,(0,L.jsx)(`span`,{className:`text-foreground`,children:t})]}):null}function wU({done:e,total:t,current:n,active:r}){let i=t>0?Math.min(100,Math.round(e/t*100)):0;return(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,L.jsxs)(`span`,{className:`tabular-nums`,children:[e,` of `,t,` steps`]}),(0,L.jsx)(`div`,{className:`h-1.5 w-16 overflow-hidden rounded-full bg-border`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":e,"aria-label":`Plan progress`,children:(0,L.jsx)(z.div,{className:`h-full rounded-full bg-primary`,initial:!1,animate:{width:`${i}%`},transition:{type:`spring`,stiffness:260,damping:30}})}),(0,L.jsx)(CU,{...r?{active:r}:{},...n?{current:n}:{}})]})}function TU({task:e,status:t}){let n=t?.branch??t?.workspace.branch,r=e?.git?.branch??n;return(0,L.jsxs)(`section`,{className:`flex h-12 shrink-0 items-center gap-3 px-4`,"aria-label":`Task`,role:`group`,children:[(0,L.jsxs)(`h2`,{className:`min-w-0 flex-1 truncate text-[0.8125rem] font-medium`,title:e?.title,children:[e?.title??`No task yet`,e?null:(0,L.jsx)(`span`,{className:`ml-2 font-normal text-muted-foreground`,children:t?.sessionName??`Type a request below to start one.`})]}),e?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium`,children:e.state.replace(/_/g,` `)}),(0,L.jsx)(bU,{children:e.id}),e.track?(0,L.jsx)(bU,{children:gU(e.track)}):null,(e.domains??[]).length>0?(0,L.jsx)(bU,{children:e.domains.join(`, `)}):null,r?(0,L.jsxs)(`span`,{className:`hidden max-w-48 shrink-0 items-center gap-1 text-xs text-muted-foreground lg:inline-flex`,children:[(0,L.jsx)(Sm,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,L.jsxs)(`span`,{className:`truncate`,children:[r,e.git?.from?` · from ${e.git.from}`:``]})]}):null,e.work?(0,L.jsx)(SU,{work:e.work}):null,e.progress?(0,L.jsx)(wU,{done:e.progress.done,total:e.progress.total,...e.currentStep?{current:e.currentStep}:{},...e.activeSteps?{active:e.activeSteps}:{}}):null]}):null]})}var EU=(e,t)=>e?.keys.find(e=>e.action===t)?.label,DU=e=>e?.panels??{conversation:!0,activity:!0,thinking:!0};function OU({name:e,icon:t,shortcut:n,onClick:r}){return(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-label":`Expand ${e}`,"aria-expanded":!1,"aria-keyshortcuts":n,onClick:r,className:`btn-ghost inline-flex size-8 shrink-0 items-center justify-center rounded-lg border border-transparent text-muted-foreground transition-[box-shadow,color,translate] duration-150 ease-snap outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none`,children:(0,L.jsx)(t,{"aria-hidden":`true`,className:`size-4`})})}),(0,L.jsxs)(qD,{side:`left`,children:[`Expand `,e,n?(0,L.jsx)(cD,{chord:n}):null]})]})}function kU(e){let t=DU(e.status);return(0,L.jsx)(`aside`,{"aria-label":`Minimized panes`,className:`flex w-12 shrink-0 flex-col items-center gap-1 border-l border-border py-2`,children:t.activity&&e.activityFolded?(0,L.jsx)(OU,{name:`Activity`,icon:up,shortcut:EU(e.status,`activity`),onClick:e.toggleActivity}):null})}function AU(e){let{data:t,status:n,activityFolded:r,toggleActivity:i}=e,a=DU(n),o=a.activity&&!r;if(!a.conversation&&!o)return null;let s=a.conversation&&o;return(0,L.jsxs)(`div`,{className:q(`grid min-h-0 flex-1`,s?`grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)] divide-x divide-border`:`grid-cols-1`),children:[a.conversation?(0,L.jsx)(sU,{chat:t?.chat??[],reply:t?.reply,busy:n?.busy??!1,hasOlder:t?.hasOlderChat??!1,hasTask:!!t?.task}):null,o?(0,L.jsx)(UH,{entries:t?.activity??[],collapsed:!1,onToggle:i,shortcut:EU(n,`activity`)}):null]})}function jU(e){let{status:t}=e,n=DU(t).activity&&e.activityFolded;return(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,L.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:(0,L.jsx)(AU,{...e})}),n?(0,L.jsx)(kU,{...e}):null]})}function MU({data:e,status:t}){let n=DU(t),r=[...n.conversation?[{id:`conversation`,label:`Conversation`,icon:Jm}]:[],...n.activity?[{id:`activity`,label:`Activity`,icon:up}]:[]],[i,a]=(0,m.useState)(`conversation`),o=r.find(e=>e.id===i)??r[0],s=(e?.activity??[]).filter(e=>e.pending).length;return o?(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[r.length>1?(0,L.jsx)(`div`,{role:`radiogroup`,"aria-label":`Pane`,className:`flex shrink-0 items-center gap-0.5 border-b border-border px-3 py-2`,children:r.map(e=>{let t=e.id===o.id,n=e.icon;return(0,L.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,onClick:()=>a(e.id),className:q(`inline-flex h-8 items-center gap-1.5 rounded-lg border border-transparent px-2.5 text-[0.8125rem] font-medium outline-none transition-[box-shadow,color] focus-visible:ring-3 focus-visible:ring-ring/40`,t?`btn-raised bg-card text-foreground`:`btn-ghost text-muted-foreground hover:text-foreground`),children:[(0,L.jsx)(n,{"aria-hidden":`true`,className:`size-4`}),e.label,e.id===`activity`&&s>0?(0,L.jsx)(FD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}):null]},e.id)})}):null,o.id===`conversation`?(0,L.jsx)(sU,{chat:e?.chat??[],reply:e?.reply,busy:t?.busy??!1,hasOlder:e?.hasOlderChat??!1,hasTask:!!e?.task,bare:!0}):null,o.id===`activity`?(0,L.jsx)(UH,{entries:e?.activity??[],collapsed:!1,bare:!0}):null]}):null}function NU(e){let{data:t,status:n}=e,r=SO();return(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,L.jsxs)(`div`,{className:`shrink-0 border-b border-border`,children:[(0,L.jsx)(TU,{task:t?.task,status:n}),(0,L.jsx)(dU,{runs:lV(t)})]}),r?(0,L.jsx)(jU,{...e}):(0,L.jsx)(MU,{...e})]})}function PU(){let e=VD(`lobby`),t=VD(`status`),[n,r]=zH(`lobby.activity`);return!e.data&&e.loading?(0,L.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(FD,{}),(0,L.jsx)(`span`,{children:`Connecting…`})]}):!e.data&&e.error?(0,L.jsx)(LD,{message:e.error,onRetry:()=>kf.onHello({})}):(0,L.jsx)(NU,{data:e.data,status:t.data,activityFolded:n,toggleActivity:r})}var FU={master:`master`,scout:`scout`,worker:`worker`,reviewer:`QA gate`,researcher:`research`,quickfix:`quick fix`,planner:`oracle (plan)`,panel:`panel`};function IU(e){let t=Number.isFinite(e)?Math.max(0,Math.round(e/1e3)):0,n=Math.floor(t/60);if(n===0)return`${t}s`;let r=t%60;return r===0?`${n}m`:`${n}m ${String(r).padStart(2,`0`)}s`}function LU(e){return e>0?IU(e):`—`}function RU(e,t){return t>0?`${Math.round(e/t*100)}%`:`—`}function zU(e){return e<=0?`—`:e<.01?`<$0.01`:`$${e.toFixed(2)}`}function BU(e){return!Number.isFinite(e)||e<1e3?String(Math.max(0,Math.round(e||0))):e<1e6?`${Math.round(e/1e3)}k`:`${(e/1e6).toFixed(1)}M`}function VU(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(1)}s`}function HU(e){return e>=.9?{icon:`✓`,word:`healthy`,tone:`healthy`}:e>=.7?{icon:`!`,word:`shaky`,tone:`shaky`}:{icon:`✗`,word:`failing`,tone:`failing`}}function UU(e){return e===`model`?`by model · thinking`:`by model · thinking · agent`}function WU(e,t){let n=t===`model-kind`?FU[e.kinds[0]??``]??e.kinds[0]??``:``;return[e.model,e.thinking,n].filter(Boolean).join(` · `)}var GU=[`bg-chart-1`,`bg-chart-2`,`bg-chart-3`,`bg-chart-4`,`bg-chart-5`],KU={MASTER:`bg-primary`,ORACLE:`bg-primary`,DEV:`bg-source-dev`,DESIGN:`bg-source-design`,QA:`bg-source-qa`,RESEARCH:`bg-source-research`,"QUICK FIX":`bg-source-quickfix`};function qU(e){let t=KU[e.toUpperCase()];if(t)return t;let n=0;for(let t of e)n=(n*31+t.charCodeAt(0))%GU.length;return GU[n]??GU[0]}function JU(e){return FU[e]??e}var YU=6;function XU({title:e,right:t,children:n}){return(0,L.jsxs)(`section`,{className:`card-raised flex min-w-0 flex-col gap-3 rounded-xl border p-4`,"aria-label":e,children:[(0,L.jsxs)(`h2`,{className:`flex items-baseline justify-between gap-3 text-sm font-medium`,children:[(0,L.jsx)(`span`,{children:e}),t?(0,L.jsx)(`span`,{className:`truncate text-xs font-normal text-muted-foreground`,children:t}):null]}),n]})}function ZU({rows:e,render:t}){let[n,r]=(0,m.useState)(!1),i=n?e:e.slice(0,YU);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:i.map(t)}),e.length>YU?(0,L.jsx)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"aria-expanded":n,onClick:()=>r(e=>!e),className:`h-6 self-start rounded-lg text-xs text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/30`,children:n?`Show fewer`:`Show all ${e.length}`}):null]})}function QU(e,t){return t>0?Math.max(1.5,e/t*100):0}function $U({label:e,value:t,marker:n,max:r,valueText:i,sub:a}){return(0,L.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-[0.8125rem]`,children:[(0,L.jsx)(`span`,{className:`min-w-0 truncate`,title:e,children:e}),(0,L.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[i,a?(0,L.jsx)(`span`,{className:`ml-2 text-xs text-muted-foreground`,children:a}):null]})]}),(0,L.jsxs)(`div`,{className:`relative h-1.5 rounded-full bg-muted`,role:`img`,"aria-label":`${e}: ${i}`,children:[(0,L.jsx)(`div`,{className:`h-full rounded-full bg-primary/70`,style:{width:`${QU(t,r)}%`}}),n?(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-1/2 h-3 w-0.5 -translate-y-1/2 rounded-full bg-foreground/40`,style:{left:`${Math.min(99.5,QU(n,r))}%`}}):null]})]})}function eW({groups:e,label:t}){let n=e.filter(e=>e.avgMs>0).sort((e,t)=>t.avgMs-e.avgMs),r=Math.max(...n.map(e=>Math.max(e.avgMs,e.p90Ms)),1);return(0,L.jsx)(XU,{title:`Average run time`,right:`per model · thinking · tick is p90`,children:n.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No timed runs yet.`}):(0,L.jsx)(ZU,{rows:n,render:e=>(0,L.jsx)($U,{label:t(e),value:e.avgMs,marker:e.p90Ms,max:r,valueText:LU(e.avgMs),sub:`p90 ${LU(e.p90Ms)}`},t(e))})})}var tW={healthy:`bg-success`,shaky:`bg-warning`,failing:`bg-destructive`},nW={healthy:`text-success`,shaky:`text-warning`,failing:`text-destructive`};function rW({label:e,rate:t,runs:n}){let r=HU(t),i=`${Math.round(t*100)}%`;return(0,L.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-[0.8125rem]`,children:[(0,L.jsx)(`span`,{className:`min-w-0 truncate`,title:e,children:e}),(0,L.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 tabular-nums`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5 ${nW[r.tone]}`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 rounded-full ${tW[r.tone]}`}),(0,L.jsx)(`span`,{className:`sr-only`,children:r.word}),i]}),(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[n,` run`,n===1?``:`s`]})]})]}),(0,L.jsxs)(`div`,{className:`flex h-1.5 overflow-hidden rounded-full bg-muted`,role:`img`,"aria-label":`${e}: ${r.word}, ${i} of ${n} runs`,children:[(0,L.jsx)(`div`,{className:`h-full bg-success/70`,style:{width:`${t*100}%`}}),(0,L.jsx)(`div`,{className:`h-full bg-destructive/45`,style:{width:`${(1-t)*100}%`}})]})]})}function iW({groups:e,label:t}){let n=e.filter(e=>e.runs>0).sort((e,t)=>e.successes/e.runs-t.successes/t.runs);return(0,L.jsx)(XU,{title:`Success rate`,right:`green worked · red failed`,children:n.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No runs yet.`}):(0,L.jsx)(ZU,{rows:n,render:e=>(0,L.jsx)(rW,{label:t(e),rate:e.successes/e.runs,runs:e.runs},t(e))})})}function aW({share:e}){return(0,L.jsx)(`ul`,{className:`flex flex-wrap gap-x-6 gap-y-1.5 text-xs`,children:e.map(e=>(0,L.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`size-2 shrink-0 rounded-full ${qU(e.agent)}`,"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`text-[0.8125rem]`,children:iV(e.agent)}),(0,L.jsxs)(`span`,{className:`tabular-nums`,children:[Math.round(e.share*100),`%`]}),(0,L.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[`avg `,IU(e.ms/Math.max(1,e.runs)),` ×`,e.runs]})]},e.agent))})}function oW({share:e}){return(0,L.jsx)(`div`,{className:`flex h-2.5 gap-0.5 overflow-hidden rounded-full`,role:`img`,"aria-label":`Share of run time by agent`,children:e.map(e=>(0,L.jsx)(`span`,{className:`${qU(e.agent)} opacity-75 first:rounded-l-full last:rounded-r-full`,style:{width:`${e.share*100}%`},title:`${e.agent} ${Math.round(e.share*100)}%`},e.agent))})}function sW({times:e}){if(e.length===0)return null;let t=Math.max(...e.map(e=>e.avgMs),1);return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2.5 pt-1`,children:[(0,L.jsx)(`h3`,{className:`text-xs text-muted-foreground`,children:`Request to done, by the oracle's model`}),(0,L.jsx)(ZU,{rows:e,render:e=>(0,L.jsx)($U,{label:[e.model,e.thinking].filter(Boolean).join(` · `),value:e.avgMs,max:t,valueText:IU(e.avgMs),sub:`×${e.tasks}`},`${e.model}-${e.thinking}`)})]})}function cW({timeShare:e}){let t=e.byAgent;return(0,L.jsx)(XU,{title:`Where the time goes`,right:`share of run time by agent`,children:t.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No timed runs yet.`}):(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsx)(oW,{share:t}),(0,L.jsx)(aW,{share:t}),(0,L.jsx)(sW,{times:e.taskTimes})]})})}function lW({label:e,value:t,sub:n}){return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,L.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:t}),n?(0,L.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:n}):null]})}var uW=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function dW({summary:e}){let t=Object.entries(e.byPurpose).sort((e,t)=>t[1]-e[1]);return(0,L.jsxs)(`section`,{className:`card-raised flex flex-col gap-3 rounded-xl border p-4`,"aria-label":`Classifier (Jev)`,children:[(0,L.jsx)(`h2`,{className:`text-sm font-medium`,children:`Classifier (Jev)`}),e.calls===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`no calls recorded`}):(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-3 sm:grid-cols-4`,children:[(0,L.jsx)(lW,{label:`Calls`,value:uW(e.calls,`call`),sub:`${RU(e.ok,e.calls)} ok`}),(0,L.jsx)(lW,{label:`Speed`,value:`p50 ${VU(e.p50Ms)}`,sub:`p90 ${VU(e.p90Ms)}`}),(0,L.jsx)(lW,{label:`Read`,value:e.input>0?`${BU(e.input)} tokens`:`—`}),(0,L.jsx)(lW,{label:`Routed down`,value:e.routed>0?uW(e.routed,`run`):`none`,sub:e.routed>0?`${RU(e.routedOk,e.routed)} ok`:`no runs routed`})]}),(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`text-primary`,children:`spared`}),` `,uW(e.seatRunsSkipped,`seat run`),` skipped · `,uW(e.questionsAnswered,`question`),` answered · `,uW(e.quickFixesHeld,`quick fix`,`quick fixes`),` held`,t.length>0?(0,L.jsx)(`span`,{className:`ml-3 border-l border-border pl-3`,children:t.map(([e,t])=>`${e} ${t}`).join(` · `)}):null]})]})}var fW=[`Runs`,`OK`,`Avg`,`p50`,`p90`,`Turns`,`Tools`,`Tokens`,`tok/s`,`$/run`,`$ total`,`Stalls`];function pW(e,t=0){return e>0?e.toFixed(t):`—`}function mW(e){return[String(e.runs),RU(e.successes,e.runs),LU(e.avgMs),LU(e.p50Ms),LU(e.p90Ms),pW(e.avgTurns,1),pW(e.avgTools,1),e.avgTokens>0?BU(e.avgTokens):`—`,e.tokensPerSecond>0?e.tokensPerSecond.toFixed(0):`—`,zU(e.avgCost),zU(e.totalCost),e.timeouts>0?String(e.timeouts):`—`]}function hW(e,t){return t===`model-kind`?JU(e.kinds[0]??``):e.kinds.map(JU).join(`, `)}function gW({groups:e,groupBy:t}){return(0,L.jsxs)(`section`,{className:`card-raised flex min-h-0 flex-col gap-2 overflow-hidden rounded-xl border pt-4`,"aria-label":`All models`,children:[(0,L.jsxs)(`h2`,{className:`flex flex-wrap items-baseline justify-between gap-3 px-4 text-sm font-medium`,children:[(0,L.jsx)(`span`,{children:`All models`}),(0,L.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[t===`model`?`by model · thinking`:`by model · thinking · agent`,` · sorted by runs`]})]}),(0,L.jsx)(`div`,{className:`max-h-80 overflow-auto outline-none focus-visible:ring-3 focus-visible:ring-ring/40`,tabIndex:0,role:`region`,"aria-label":`All model metrics, scroll horizontally to see all columns`,children:(0,L.jsxs)(`table`,{className:`w-full border-collapse text-xs`,children:[(0,L.jsx)(`thead`,{className:`sticky top-0 bg-card text-muted-foreground`,children:(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-left font-medium`,children:`Model`}),(0,L.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-left font-medium`,children:`Think`}),(0,L.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-left font-medium`,children:t===`model-kind`?`Agent`:`Agents`}),fW.map(e=>(0,L.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-right font-medium whitespace-nowrap`,children:e},e))]})}),(0,L.jsx)(`tbody`,{children:e.map(e=>(0,L.jsxs)(`tr`,{className:`border-t border-border/70 transition-colors hover:bg-muted`,children:[(0,L.jsx)(`th`,{scope:`row`,className:`px-3 py-1.5 text-left font-normal text-foreground`,children:e.model}),(0,L.jsx)(`td`,{className:`px-3 py-1.5 whitespace-nowrap text-muted-foreground`,children:e.thinking||`—`}),(0,L.jsx)(`td`,{className:`px-3 py-1.5 whitespace-nowrap text-muted-foreground`,children:hW(e,t)||`—`}),mW(e).map((e,t)=>(0,L.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums whitespace-nowrap text-foreground`,children:e},fW[t]))]},WU(e,t)))})]})})]})}var _W={healthy:`bg-success`,shaky:`bg-warning`,failing:`bg-destructive`};function vW({label:e,value:t,sub:n,dot:r}){return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5 bg-card px-4 py-3.5`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-2xl leading-tight font-semibold tracking-tight tabular-nums`,children:[r?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 shrink-0 rounded-full ${_W[r.tone]}`}),(0,L.jsx)(`span`,{className:`sr-only`,children:r.word})]}):null,t]}),(0,L.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:n||`\xA0`})]})}function yW({tiles:e}){let t=HU(e.runs>0?e.successes/e.runs:0),n=e.runs-e.successes;return(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-px overflow-hidden rounded-xl border border-border bg-border shadow-card sm:grid-cols-5 [&>:last-child]:col-span-2 sm:[&>:last-child]:col-span-1`,children:[(0,L.jsx)(vW,{label:`Runs`,value:String(e.runs),sub:e.runs===0?`no runs yet`:``}),(0,L.jsx)(vW,{label:`Success`,value:RU(e.successes,e.runs),sub:`${n} failed${e.stalls>0?` · ${e.stalls} stalled`:``}`,dot:{tone:t.tone,word:t.word}}),(0,L.jsx)(vW,{label:`Avg run`,value:LU(e.avgMs),sub:`p90 ${LU(e.p90Ms)}`}),(0,L.jsx)(vW,{label:`Cost`,value:zU(e.cost),sub:e.runs>0?`${zU(e.cost/e.runs)} per run`:`—`}),(0,L.jsx)(vW,{label:`Tasks`,value:`${e.completed} done`,sub:e.avgCompleteMs>0?`avg ${IU(e.avgCompleteMs)} · ${e.active} active`:`${e.active} active`})]})}var bW=`No runs recorded yet. Every Master turn, subagent run, quick fix and planning round lands here with its model, thinking level, time, tokens and cost.`;function xW({groupBy:e,onGroup:t}){return(0,L.jsx)(`div`,{role:`radiogroup`,"aria-label":`Group by`,className:`flex gap-0.5 rounded-lg bg-muted p-0.5`,onKeyDown:n=>{let r=n.key===`ArrowRight`||n.key===`ArrowDown`?1:n.key===`ArrowLeft`||n.key===`ArrowUp`?-1:0;if(!r)return;n.preventDefault();let i=[`model`,`model-kind`],a=i[(i.indexOf(e)+r+i.length)%i.length];t(a),requestAnimationFrame(()=>n.currentTarget.querySelector(`[aria-checked='true']`)?.focus())},children:[`model`,`model-kind`].map(n=>(0,L.jsx)(J,{variant:`ghost`,size:`sm`,role:`radio`,tabIndex:e===n?0:-1,className:e===n?`bg-card text-foreground shadow-card hover:bg-card`:`text-muted-foreground`,"aria-checked":e===n,onClick:()=>t(n),children:UU(n)},n))})}function SW({query:e,onQuery:t}){return(0,L.jsxs)(`label`,{className:`relative flex items-center`,children:[(0,L.jsx)(`span`,{className:`sr-only`,children:`Search runs`}),(0,L.jsx)(Rh,{"aria-hidden":`true`,className:`pointer-events-none absolute left-2.5 size-3.5 text-muted-foreground`}),(0,L.jsx)(`input`,{id:`metrics-search`,type:`search`,value:e,maxLength:500,placeholder:`Search runs: model, agent, tool…`,onChange:e=>t(e.target.value),className:`h-8 w-64 max-w-full rounded-lg border border-input bg-background pr-9 pl-8 text-xs outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30`}),(0,L.jsx)(cD,{chord:`/`,className:`kbd-hint pointer-events-none absolute right-2`})]})}function CW({data:e,groupBy:t,query:n}){let r=e=>WU(e,t);return e.tiles.runs===0?(0,L.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,L.jsx)(yW,{tiles:e.tiles}),(0,L.jsx)(`p`,{className:`card-raised rounded-xl border p-4 text-sm text-muted-foreground`,children:n?`No run matches "${n}".`:bW})]}):(0,L.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,L.jsx)(yW,{tiles:e.tiles}),e.classifier?(0,L.jsx)(dW,{summary:e.classifier}):null,(0,L.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,L.jsx)(eW,{groups:e.groups,label:r}),(0,L.jsx)(iW,{groups:e.groups,label:r})]}),(0,L.jsx)(cW,{timeShare:e.timeShare}),(0,L.jsx)(gW,{groups:e.groups,groupBy:t})]})}function wW(){return(0,L.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5`,role:`status`,"aria-label":`Loading metrics`,children:[0,1,2,3,4].map(e=>(0,L.jsx)(`div`,{className:`h-20 rounded-lg bg-muted motion-safe:animate-pulse`},e))})}function TW(){let[e,t]=(0,m.useState)(`model`),[n,r]=(0,m.useState)(``),i=UD(`metrics.get`,{groupBy:e,query:n},[`metrics`]);return!i.data&&i.error?(0,L.jsx)(LD,{message:`Could not load metrics. ${i.error}`,onRetry:i.reload}):(0,L.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-4 px-5 pt-5 pb-dock`,children:[(0,L.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,L.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`Metrics`}),i.loading&&i.data?(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,L.jsx)(FD,{className:`size-3`,"aria-hidden":`true`,role:`presentation`}),` refreshing`]}):null,(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-4 flex-1`}),(0,L.jsx)(xW,{groupBy:e,onGroup:t}),(0,L.jsx)(SW,{query:n,onQuery:r})]}),i.data?(0,L.jsx)(CW,{data:i.data,groupBy:e,query:n}):(0,L.jsx)(wW,{})]})}var EW=class{seen=new Set;initialized=new Set;storage;constructor(e){this.storage=e;try{let t=JSON.parse(e?.getItem(`bot-lobby.prompt-seen`)??`[]`);Array.isArray(t)&&(this.seen=new Set(t.filter(e=>typeof e==`string`)))}catch{}}observe(e,t,n=!1){let r=this.initialized.has(e)&&!n?t.filter(e=>!this.seen.has(e)):[];this.initialized.add(e);for(let e of t)this.seen.add(e);try{this.storage?.setItem(`bot-lobby.prompt-seen`,JSON.stringify([...this.seen]))}catch{}return r}};function DW(e,t){return JSON.stringify([e,`prompt`,t])}function OW(e,t,n){return JSON.stringify([e,`dialog`,t,n])}function kW(e,t,n){return JSON.stringify([e,`delivery`,t,n])}var AW=`bot-lobby.prompt-sound-muted`,jW=new Set,MW,NW=!1;function PW(){try{return localStorage.getItem(AW)===`on`}catch{return NW}}function FW(e){NW=e;try{localStorage.setItem(AW,e?`on`:`off`)}catch{}for(let e of jW)e()}function IW(e){return jW.add(e),()=>{jW.delete(e)}}function LW(){return(0,m.useSyncExternalStore)(IW,PW,()=>!1)}function RW(){(0,m.useEffect)(()=>{let e=()=>{try{MW??=new AudioContext,MW.resume().catch(()=>void 0)}catch{}};return window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,e)}},[])}function zW(){if(!PW()&&MW&&MW.state===`running`)try{let e=MW.currentTime,t=MW.createOscillator(),n=MW.createGain();t.frequency.setValueAtTime(960,e),t.frequency.exponentialRampToValueAtTime(360,e+.16),n.gain.setValueAtTime(1e-4,e),n.gain.exponentialRampToValueAtTime(.12,e+.012),n.gain.exponentialRampToValueAtTime(1e-4,e+.22),t.connect(n),n.connect(MW.destination),t.start(e),t.stop(e+.24),t.onended=()=>{t.disconnect(),n.disconnect()}}catch{}}var BW=`bot-lobby.notifications`,VW=`/icon-192.png`,HW=new Set;function UW(){for(let e of[...HW])e()}function WW(){try{return localStorage.getItem(BW)===`on`}catch{return!1}}function GW(e){return HW.add(e),()=>{HW.delete(e)}}function KW(e){try{localStorage.setItem(BW,e?`on`:`off`)}catch{}UW()}function qW(){return(0,m.useSyncExternalStore)(GW,WW,()=>!1)}async function JW(){return typeof Notification>`u`?`unsupported`:(Notification.permission==="default"&&await Notification.requestPermission().catch(()=>void 0),Notification.permission===`granted`?(KW(!0),`granted`):`denied`)}function YW(){KW(!1)}function XW(e){if(e===`completed`)return`finished`;if(e===`abandoned`)return`dropped`}function ZW(){return typeof Notification<`u`&&Notification.permission===`granted`&&document.hidden}function QW(e){try{new Notification(`bot-lobby`,{body:e,icon:VW,tag:`bot-lobby`})}catch{}}function $W(){try{return new EW(sessionStorage)}catch{return new EW}}function eG(e,t){let n=t.payload;return t.kind===`sessionDialog`&&n?.dialog?.id?OW(e,t.sessionId??n.key??t.from,n.dialog.id):DW(e,t.id)}function tG(){let e=qW();RW(),zD();let t=UD(`tasks.list`,{},[`tasks`]),n=UD(`sessions.list`,{},[`sessions`]),r=kf.get(`prompts`),i=kf.get(`lobby`).data,a=(0,m.useRef)($W()),o=(0,m.useRef)(new Set([`prompts`,`sessions`,`delivery`])),s=(0,m.useRef)(void 0),c=Hf()??`current`,l=kf.status().connection;return{enabled:e,tasks:t,sessions:n,prompts:r,lobby:i,seen:a,quiet:o,previousState:s,project:c,connection:l,lastConnection:(0,m.useRef)(l)}}function nG(e,t,n,r,i){if(!i)return;let{seen:a,project:o,quiet:s,enabled:c}=e,l=a.current.observe(`${o}:${t}`,n,s.current.has(t));s.current.delete(t),l.length&&(l.forEach(()=>zW()),c&&ZW()&&QW(r),t===`delivery`&&B.info(r,{action:{label:`Review tasks`,onClick:()=>DD(`#/tasks`)}}))}function rG(e){let{prompts:t,sessions:n,tasks:r,project:i}=e,a=t.data?.prompts;nG(e,`prompts`,(a??[]).map(e=>eG(i,e)),`A question is waiting for you.`,!!a&&!t.loading),nG(e,`sessions`,n.data?.background.flatMap(e=>e.dialogs.map(t=>OW(i,e.sessionId??e.key,t.id)))??[],`A background session is asking something.`,!!n.data&&!n.loading),nG(e,`delivery`,r.data?.rows.filter(e=>e.delivery&&(e.delivery.status===`pending_approval`||e.delivery.status===`deferred`||e.delivery.status===`recoverable_failure`)).map(e=>kW(i,e.id,e.delivery.reviewId))??[],`Completed work is ready for delivery review in Tasks.`,!!r.data&&!r.loading)}function iG(e){let{lastConnection:t,connection:n,quiet:r,previousState:i,lobby:a,enabled:o}=e;if(t.current!==n||n!==`live`){t.current=n,r.current=new Set([`prompts`,`sessions`,`delivery`]),i.current=void 0;return}rG(e);let s=a?.task?.state??``,c=XW(s);i.current&&c&&s!==i.current&&o&&ZW()&&QW(`${a?.task?.title??`The task`} ${c}.`),i.current=s}function aG(){let e=tG(),{connection:t,enabled:n,project:r,prompts:i,sessions:a,tasks:o,lobby:s}=e;(0,m.useEffect)(()=>iG(e),[t,n,r,i.data,i.loading,a.data,a.loading,o.data,o.loading,s])}function oG({className:e,type:t,...n}){return(0,L.jsx)(`input`,{type:t,"data-slot":`input`,className:q(`flex h-8 w-full rounded-lg border border-input bg-background px-3 py-1 text-base transition-[border-color,box-shadow] duration-150 outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:disabled:bg-input/80`,e),...n})}function sG({className:e,thumbClassName:t,...n}){return(0,L.jsx)(cE,{"aria-keyshortcuts":`Enter Space`,"aria-description":`When focused, press Enter or Space to toggle.`,"data-slot":`switch`,className:q(`peer relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors duration-150 outline-none before:absolute before:-inset-x-2 before:-inset-y-3 before:content-[''] focus-visible:ring-3 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,e),...n,children:(0,L.jsx)(uE,{"data-slot":`switch-thumb`,className:q(`pointer-events-none block size-4 rounded-full bg-white shadow-sm ring-0 transition-transform duration-200 ease-snap data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0`,t)})})}var cG=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],lG={repeat:1/0},uG=`M0 -4 L1 -1 L4 0 L1 1 L0 4 L-1 1 L-4 0 L-1 -1Z`,dG=[`var(--rainbow-1)`,`var(--rainbow-2)`,`var(--rainbow-3)`,`var(--rainbow-4)`,`var(--rainbow-5)`,`var(--rainbow-6)`,`var(--rainbow-7)`],fG={transformBox:`fill-box`,transformOrigin:`center`};function pG(e){switch(e){case`off`:return{animate:{scale:[1,1.03,1],rotate:-5},transition:{...lG,duration:4,ease:`easeInOut`}};case`minimal`:return{animate:{rotate:[0,0,7,9,0,0],y:[0,0,1.5,2,0,0]},transition:{...lG,duration:4.2,times:[0,.35,.7,.82,.86,1],ease:`easeInOut`}};case`low`:return{animate:{rotate:[-4,4,-4],y:[0,-1,0]},transition:{...lG,duration:3.2,ease:`easeInOut`}};case`medium`:return{animate:{rotate:[0,-5,-5,5,5,0],y:[0,-1,-1,-1,-1,0]},transition:{...lG,duration:4,times:[0,.12,.4,.52,.8,1],ease:`easeInOut`}};case`high`:return{animate:{y:[0,-1.5,0]},transition:{...lG,duration:.6,ease:`easeInOut`}};case`xhigh`:return{animate:{y:[0,-7,0,0],scaleY:[1,1.06,.88,1],scaleX:[1,.96,1.1,1]},transition:{...lG,duration:.7,times:[0,.4,.75,1],ease:`easeInOut`}};case`max`:return{animate:{y:[-1,-4,-1],rotate:[-3,3,-3]},transition:{...lG,duration:1.6,ease:`easeInOut`}}}}function mG(){return(0,L.jsx)(`g`,{className:`fill-muted-foreground`,fontWeight:`700`,children:[0,1,2].map(e=>(0,L.jsx)(z.text,{x:44+e*4.5,y:17-e*5.5,fontSize:5.5+e*2,initial:{opacity:0},animate:{opacity:[0,1,0],y:[3,-4],x:[0,2.5]},transition:{...lG,duration:2.6,delay:e*.8,ease:`easeOut`},children:`z`},e))})}function hG(){return(0,L.jsx)(`g`,{className:`fill-primary`,fontSize:`9`,children:[0,1].map(e=>(0,L.jsx)(z.text,{x:48,y:20,initial:{opacity:0},animate:{opacity:[0,1,1,0],y:[2,-5,-11,-17],x:[0,3,1,5],rotate:[0,12,-8,10]},transition:{...lG,duration:3,delay:e*1.5,ease:`easeOut`},style:fG,children:e?`♫`:`♪`},e))})}function gG(){return(0,L.jsx)(z.text,{x:52,y:14,fontSize:`12`,fontWeight:`700`,className:`fill-primary`,initial:{opacity:0,scale:0},animate:{opacity:[0,0,1,1,0],scale:[0,0,1.2,1,.6],rotate:[0,0,-12,8,0]},transition:{...lG,duration:4,times:[0,.5,.58,.85,1]},style:fG,children:`?`})}function _G({spots:e,rainbow:t}){return(0,L.jsx)(`g`,{children:e.map(([e,n,r],i)=>(0,L.jsx)(z.path,{d:uG,className:t?void 0:`fill-primary`,style:{x:e,y:n,...t?{fill:dG[i%dG.length]}:{}},initial:{scale:0},animate:{scale:[0,1.1,0],rotate:[0,90,180]},transition:{...lG,duration:1.3,delay:r,ease:`easeInOut`}},i))})}function vG(){return(0,L.jsx)(`g`,{children:[-20,20].map((e,t)=>(0,L.jsxs)(`g`,{transform:`rotate(${e} 32 34)`,children:[(0,L.jsx)(`ellipse`,{cx:32,cy:34,rx:30,ry:9,fill:`none`,strokeWidth:.8,strokeDasharray:`2 3`,className:`stroke-primary/35`}),(0,L.jsx)(z.circle,{r:2,className:`fill-primary`,animate:{cx:[2,32,62,32,2],cy:[34,43,34,25,34]},transition:{...lG,duration:1.1,delay:t*.55,ease:`linear`}})]},e))})}function yG(){return(0,L.jsx)(z.path,{d:`M53 22 Q56 27 53 29 Q50 27 53 22Z`,className:`fill-primary/60`,animate:{y:[0,8],opacity:[0,1,0]},transition:{...lG,duration:.9,ease:`easeIn`,repeatDelay:.5}})}function bG({id:e}){return(0,L.jsx)(z.circle,{cx:32,cy:34,r:27,fill:`url(#${e}-glow)`,animate:{scale:[.92,1.08,.92],opacity:[.5,.85,.5]},transition:{...lG,duration:1.6,ease:`easeInOut`},style:{transformOrigin:`32px 34px`}})}function xG({rainbow:e}){return(0,L.jsx)(`g`,{children:Array.from({length:8},(t,n)=>{let r=n/8*Math.PI*2;return(0,L.jsx)(z.circle,{cx:32,cy:34,r:2,className:e?void 0:`fill-primary`,style:e?{fill:dG[n%dG.length]}:void 0,initial:{opacity:1,scale:1},animate:{cx:32+Math.cos(r)*32,cy:34+Math.sin(r)*30,opacity:0,scale:.3},transition:{duration:.6,ease:`easeOut`}},n)})})}function SG({level:e,move:t}){let n={fill:`none`,strokeWidth:2.2,strokeLinecap:`round`,className:`stroke-foreground`};if(e===`off`)return(0,L.jsx)(`path`,{d:`M20 33 Q24.5 36.5 29 33 M35 33 Q39.5 36.5 44 33`,...n});if(e===`low`)return(0,L.jsx)(`path`,{d:`M20 34 Q24.5 29.5 29 34 M35 34 Q39.5 29.5 44 34`,...n});if(e===`max`)return(0,L.jsx)(`g`,{children:[25,39].map((e,n)=>(0,L.jsx)(z.path,{d:`M0 -5.5 L1.6 -1.6 L5.5 0 L1.6 1.6 L0 5.5 L-1.6 1.6 L-5.5 0 L-1.6 -1.6Z`,style:{x:e,y:33,fill:dG[n?4:0]},animate:t?{rotate:[0,90,180],scale:[1,1.25,1]}:{},transition:{...lG,duration:1.2,ease:`easeInOut`,delay:n*.2}},e))});let r=e===`minimal`?.45:e===`high`?.7:e===`xhigh`?1.2:1,i=t&&e===`medium`?{x:[0,-2.5,-2.5,2.5,2.5,0]}:{x:0},a=t&&e===`medium`?{...lG,duration:4,times:[0,.12,.4,.52,.8,1]}:{duration:.2},o=e===`minimal`?3.2:e===`xhigh`?1.4:3.6,s=t?{scaleY:[r,r,.1,r,r]}:{scaleY:r},c=t?{...lG,duration:o,times:[0,.44,.5,.56,1]}:{duration:.2};return(0,L.jsx)(z.g,{animate:i,transition:a,children:[25,39].map(t=>(0,L.jsxs)(`g`,{children:[(0,L.jsx)(z.ellipse,{cx:t,cy:33,rx:3.4,ry:3.8,className:`fill-foreground`,style:fG,animate:s,transition:c}),e===`minimal`?null:(0,L.jsx)(`circle`,{cx:t+1.2,cy:31.6,r:1,className:`fill-card`})]},t))})}function CG({level:e,move:t}){let n={fill:`none`,strokeWidth:2,strokeLinecap:`round`,className:`stroke-foreground`};switch(e){case`off`:return(0,L.jsxs)(`g`,{children:[(0,L.jsx)(`circle`,{cx:32,cy:42,r:1.4,className:`fill-foreground`}),t?(0,L.jsx)(z.circle,{cx:35,cy:42,r:3,fill:`none`,strokeWidth:.9,className:`stroke-primary/60`,animate:{scale:[.2,1.3,1.5,0],opacity:[.6,.9,.9,0]},transition:{...lG,duration:4,times:[0,.7,.9,1]},style:{transformOrigin:`33px 42px`}}):null]});case`minimal`:return(0,L.jsx)(z.ellipse,{cx:32,cy:42,rx:3,ry:.8,className:`fill-foreground`,animate:t?{ry:[.8,.8,3.6,3.6,.8],rx:[3,3,3.6,3.6,3]}:{},transition:{...lG,duration:6,times:[0,.6,.7,.85,1]}});case`low`:return(0,L.jsx)(`path`,{d:`M26 40 Q32 45 38 40`,...n});case`medium`:return(0,L.jsx)(`path`,{d:`M28 41.5 Q32 43 36 41.5`,...n});case`high`:return(0,L.jsx)(`path`,{d:`M27 42 L37 41`,...n});case`xhigh`:return(0,L.jsx)(`path`,{d:`M25.5 39.5 Q32 47 38.5 39.5Z`,className:`fill-foreground`});case`max`:return(0,L.jsxs)(`g`,{children:[(0,L.jsx)(`path`,{d:`M24 38.5 Q32 50 40 38.5Z`,className:`fill-foreground`}),(0,L.jsx)(`path`,{d:`M28.5 44.5 Q32 47.5 35.5 44.5 Q32 43 28.5 44.5Z`,style:{fill:`var(--rainbow-1)`}})]})}}function wG({level:e,className:t}){let n=Jd()??!1,r=cG.includes(e)?e:`medium`,i=`m${(0,m.useId)().replace(/[^a-zA-Z0-9]/g,``)}`,a=!n,o=cG.indexOf(r),s=(0,m.useRef)(o),[c,l]=(0,m.useState)({n:0,up:!0});(0,m.useEffect)(()=>{o!==s.current&&(l(e=>({n:e.n+1,up:o>s.current})),s.current=o)},[o]);let u=pG(r),d=r===`max`,f=d?{stroke:`url(#${i}-rainbow)`}:void 0,p=!a||c.n===0?void 0:c.up?{y:[0,-9,0,0],scaleX:[1,.9,1.1,1],scaleY:[1,1.12,.9,1]}:{y:[0,0,0],scaleX:[1,1.12,1],scaleY:[1,.84,1]};return(0,L.jsxs)(`svg`,{viewBox:`0 0 64 64`,"data-slot":`effort-mascot`,"data-level":r,"aria-hidden":`true`,focusable:`false`,className:q(`size-14 shrink-0 overflow-visible`,t),children:[(0,L.jsxs)(`defs`,{children:[(0,L.jsxs)(`linearGradient`,{id:`${i}-rainbow`,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[dG.map((e,t)=>(0,L.jsx)(`stop`,{offset:t/(dG.length-1),stopColor:e},t)),a&&d?(0,L.jsx)(`animateTransform`,{attributeName:`gradientTransform`,type:`rotate`,from:`0 0.5 0.5`,to:`360 0.5 0.5`,dur:`2.4s`,repeatCount:`indefinite`}):null]}),(0,L.jsxs)(`radialGradient`,{id:`${i}-glow`,children:[(0,L.jsx)(`stop`,{offset:`0.35`,stopColor:`var(--rainbow-6)`,stopOpacity:`0.45`}),(0,L.jsx)(`stop`,{offset:`0.7`,stopColor:`var(--rainbow-1)`,stopOpacity:`0.18`}),(0,L.jsx)(`stop`,{offset:`1`,stopColor:`var(--rainbow-3)`,stopOpacity:`0`})]})]}),d?a?(0,L.jsx)(bG,{id:i}):(0,L.jsx)(`circle`,{cx:32,cy:34,r:27,fill:`url(#${i}-glow)`}):null,a&&r===`xhigh`?(0,L.jsx)(vG,{}):null,(0,L.jsx)(z.g,{animate:p,transition:{duration:c.up?.55:.45,ease:`easeOut`},style:{transformOrigin:`32px 56px`},children:(0,L.jsxs)(z.g,{animate:a?u.animate:{rotate:r===`off`?-5:0},transition:a?u.transition:{duration:0},style:{transformOrigin:`32px 56px`},children:[(0,L.jsxs)(z.g,{style:{transformOrigin:`32px 17px`},animate:r===`off`?{rotate:32}:r===`minimal`?{rotate:14}:a&&r===`medium`?{rotate:[0,-12,10,0]}:a&&(r===`xhigh`||r===`max`)?{rotate:[-10,10,-10]}:{rotate:0},transition:a&&(r===`medium`||r===`xhigh`||r===`max`)?{...lG,duration:r===`medium`?2:.5,ease:`easeInOut`}:{type:`spring`,stiffness:200,damping:14},children:[(0,L.jsx)(`path`,{d:`M32 17 V10`,strokeWidth:2,strokeLinecap:`round`,className:d?void 0:`stroke-primary/70`,style:f}),(0,L.jsx)(z.circle,{cx:32,cy:7.5,r:3.2,className:d?void 0:r===`off`?`fill-muted-foreground/40`:`fill-primary`,style:{...fG,...d?{fill:`url(#${i}-rainbow)`}:{}},animate:a?r===`high`?{opacity:[1,.3,1]}:r===`medium`?{scale:[1,1.25,1]}:d||r===`xhigh`?{scale:[1,1.5,1]}:{scale:1,opacity:1}:{scale:1,opacity:1},transition:{...lG,duration:r===`high`?.5:r===`medium`?1.6:.4}})]}),[4.5,54].map((e,t)=>(0,L.jsx)(z.rect,{x:e,y:29,width:5.5,height:11,rx:2.5,className:d?void 0:`fill-primary/25`,style:{...fG,...d?{fill:dG[t?5:1],opacity:.6}:{}},animate:a&&(r===`xhigh`||d)?{rotate:t?[0,18,0]:[0,-18,0]}:{rotate:0},transition:{...lG,duration:.35}},e)),(0,L.jsx)(`rect`,{x:10,y:17,width:44,height:36,rx:11,strokeWidth:d?2.6:2,className:d?`fill-primary/10`:`fill-primary/10 stroke-primary/75`,style:f}),(0,L.jsx)(`rect`,{x:15,y:23,width:34,height:25,rx:7.5,className:`fill-card stroke-border`,strokeWidth:1}),a&&r===`high`?(0,L.jsx)(z.rect,{y:24,width:2,height:23,rx:1,className:`fill-primary/25`,animate:{x:[16,46,16]},transition:{...lG,duration:1.6,ease:`easeInOut`}}):null,r===`low`||d?(0,L.jsxs)(`g`,{className:`fill-destructive/25`,children:[(0,L.jsx)(`ellipse`,{cx:19.5,cy:39.5,rx:2.6,ry:1.6}),(0,L.jsx)(`ellipse`,{cx:44.5,cy:39.5,rx:2.6,ry:1.6})]}):null,(0,L.jsx)(SG,{level:r,move:a}),r===`high`||r===`xhigh`?(0,L.jsx)(`path`,{d:`M20 27 L28.5 28.8 M44 27 L35.5 28.8`,strokeWidth:1.9,strokeLinecap:`round`,className:`stroke-foreground`}):null,(0,L.jsx)(CG,{level:r,move:a}),(0,L.jsx)(`rect`,{x:20,y:53,width:24,height:4,rx:2,className:d?void 0:`fill-primary/25`,style:d?{fill:`url(#${i}-rainbow)`}:void 0})]})},c.n),r===`off`?a?(0,L.jsx)(mG,{}):(0,L.jsx)(`text`,{x:48,y:14,fontSize:`9`,fontWeight:`700`,className:`fill-muted-foreground`,children:`z`}):null,a&&r===`minimal`?(0,L.jsx)(mG,{}):null,a&&r===`low`?(0,L.jsx)(hG,{}):null,a&&r===`medium`?(0,L.jsx)(gG,{}):null,a&&r===`high`?(0,L.jsx)(_G,{spots:[[6,14,0],[58,12,.6]]}):null,a&&r===`xhigh`?(0,L.jsx)(yG,{}):null,d?a?(0,L.jsx)(_G,{rainbow:!0,spots:[[5,12,0],[59,10,.2],[2,44,.45],[62,46,.65],[32,-2,.85],[14,60,1.05],[50,60,.3]]}):(0,L.jsx)(`g`,{children:[[5,12],[59,10],[32,-2]].map(([e,t],n)=>(0,L.jsx)(`path`,{d:uG,style:{x:e,y:t,fill:dG[n*2]}},n))}):null,a&&c.n>0&&c.up?(0,L.jsx)(xG,{rainbow:d},`burst-${c.n}`):null]})}var TG={minimal:`min`,medium:`med`},EG={off:`No extra reasoning: the quickest, cheapest answer.`,minimal:`A moment of reasoning, barely.`,low:`Light reasoning for simple work.`,medium:`Balanced reasoning for most work.`,high:`Careful reasoning: slower, better on hard problems.`,xhigh:`Very deep reasoning: slow and costly.`,max:`As deep as the model goes.`};function DG(e,t,n){let r=-1;for(let i=0;i<e.length;i+=1)t.includes(e[i])&&(r<0||Math.abs(i-n)<Math.abs(r-n))&&(r=i);return r}function OG(e,t,n,r){for(let i=n+r;i>=0&&i<e.length;i+=r)if(t.includes(e[i]))return i;return n}function kG({value:e,levels:t,supported:n,model:r,label:i,disabled:a,onChange:o}){let s=(0,m.useRef)(null),[c,l]=(0,m.useState)(),[u,d]=(0,m.useState)(),f=(0,m.useRef)(void 0),p=(0,m.useRef)(0),h=(0,m.useCallback)(()=>{f.current=void 0,p.current=0,d(void 0)},[]),g=Math.max(t.length-1,1),_=DG(t,n,Math.max(0,t.indexOf(e))),v=c??u??_,y=v<0?0:v/g*100,b=t[v]??e,x=v>=0&&b!==e;(0,m.useEffect)(()=>{if(u===void 0)return;let e=window.setTimeout(h,1e4);return()=>window.clearTimeout(e)},[u,h]);let S=(0,m.useCallback)(e=>{let r=s.current?.getBoundingClientRect();if(!r||r.width===0)return _;let i=Math.min(1,Math.max(0,(e-r.left)/r.width));return DG(t,n,Math.round(i*g))},[g,t,_,n]);function C(e){a||n.length===0||(e.currentTarget.setPointerCapture(e.pointerId),l(S(e.clientX)))}function w(e){if(c===void 0)return;let t=S(e.clientX);t!==c&&l(t)}function T(){if(c===void 0)return;let n=t[c];l(void 0),n&&n!==e&&o(n)}function E(e){if(a||v<0)return;let r=f.current??v,i={ArrowRight:OG(t,n,r,1),ArrowUp:OG(t,n,r,1),ArrowLeft:OG(t,n,r,-1),ArrowDown:OG(t,n,r,-1),Home:DG(t,n,0),End:DG(t,n,g)}[e.key];if(i===void 0)return;e.preventDefault();let s=t[i];s&&i!==r&&(f.current=i,d(i),p.current+=1,Promise.resolve(o(s)).catch(()=>void 0).then(()=>{--p.current,p.current<=0&&h()}))}return(0,L.jsxs)(`div`,{className:q(`flex flex-col gap-1`,a&&`opacity-60`),children:[(0,L.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,L.jsx)(`span`,{"data-level":b,className:`effort-word text-[0.8125rem] font-medium capitalize`,"aria-hidden":`true`,children:b}),(0,L.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:EG[b]??``})]}),(0,L.jsxs)(`div`,{ref:s,role:`slider`,tabIndex:a?-1:0,"aria-label":i,"aria-valuemin":0,"aria-valuemax":t.length-1,"aria-valuenow":Math.max(v,0),"aria-valuetext":b,"aria-disabled":a||void 0,onPointerDown:C,onPointerMove:w,onPointerUp:T,onPointerCancel:()=>l(void 0),onKeyDown:E,className:`relative mx-2.5 h-6 touch-none cursor-pointer rounded-full outline-none select-none focus-visible:ring-3 focus-visible:ring-ring/40`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-x-0 top-1/2 h-1.5 -translate-y-1/2 rounded-full bg-muted`}),(0,L.jsx)(z.span,{"aria-hidden":`true`,className:`absolute top-1/2 left-0 h-1.5 -translate-y-1/2 rounded-full bg-primary`,animate:{width:`${y}%`},transition:{type:`spring`,stiffness:520,damping:34}}),t.map((e,t)=>{let i=n.includes(e);return(0,L.jsx)(`span`,{"aria-hidden":`true`,title:i?e:`${r??`This model`} does not support ${e}`,className:q(`absolute top-1/2 size-1 -translate-x-1/2 -translate-y-1/2 rounded-full`,i?t<=v?`bg-primary-foreground/80`:`bg-muted-foreground/40`:`bg-transparent ring-1 ring-muted-foreground/30`),style:{left:`${t/g*100}%`}},e)}),(0,L.jsx)(z.span,{"aria-hidden":`true`,className:q(`absolute top-1/2 size-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-primary bg-white shadow-sm`,c!==void 0&&`scale-110`),animate:{left:`${y}%`},transition:{type:`spring`,stiffness:520,damping:28}})]}),(0,L.jsx)(`div`,{className:`relative mx-2.5 h-3.5 text-[0.68rem] text-muted-foreground`,"aria-hidden":`true`,children:t.map((e,t)=>{let i=n.includes(e);return(0,L.jsx)(`span`,{title:i?void 0:`${r??`This model`} does not support ${e}`,className:q(`absolute -translate-x-1/2 whitespace-nowrap`,t===v&&`font-medium text-foreground`,!i&&`opacity-40`),style:{left:`${t/g*100}%`},children:TG[e]??e},e)})}),x?(0,L.jsxs)(`p`,{className:`text-xs text-warning`,children:[e,` is not supported by `,r??`this model`,`, so it runs at `,b,`.`]}):null]})}function AG(e,t){let n=`${e.label} ${e.hint??``} ${e.value}`.toLowerCase();return t.toLowerCase().split(/\s+/).filter(Boolean).every(e=>n.includes(e))}function jG({value:e,options:t,onChange:n,label:r,className:i,disabled:a}){let[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(``),[u,d]=(0,m.useState)(0),f=(0,m.useRef)(null),p=(0,m.useId)(),h=(0,m.useMemo)(()=>t.filter(e=>AG(e,c)),[t,c]),g=t.find(t=>t.value===e);(0,m.useEffect)(()=>{o&&(l(``),d(Math.max(0,t.findIndex(t=>t.value===e))))},[o]),(0,m.useEffect)(()=>{c&&d(0)},[c]),(0,m.useEffect)(()=>{f.current?.querySelector(`[data-index="${u}"]`)?.scrollIntoView({block:`nearest`})},[u,o,h.length]);function _(t){t&&(s(!1),t.value!==e&&n(t.value))}function v(e){e.key===`ArrowDown`?(e.preventDefault(),d(e=>Math.min(h.length-1,e+1))):e.key===`ArrowUp`?(e.preventDefault(),d(e=>Math.max(0,e-1))):e.key===`Home`&&!c?(e.preventDefault(),d(0)):e.key===`End`&&!c?(e.preventDefault(),d(Math.max(0,h.length-1))):e.key===`Tab`?s(!1):e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),_(h[u]))}return(0,L.jsxs)(JT,{open:o,onOpenChange:s,children:[(0,L.jsxs)(YT,{type:`button`,role:`combobox`,"aria-label":r,"aria-keyshortcuts":`Enter Space ArrowDown ArrowUp`,"aria-description":`When focused, press Enter, Space or an arrow key to choose. Type to search.`,"aria-expanded":o,"aria-haspopup":`listbox`,"aria-controls":o?p:void 0,disabled:a,onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),s(!0))},"data-slot":`select-trigger`,className:q(`btn-raised flex h-8 w-full min-w-0 items-center justify-between gap-2 overflow-hidden rounded-lg border bg-card px-2.5 text-[0.8125rem] whitespace-nowrap outline-none transition-[border-color,box-shadow] duration-150 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:opacity-50`,i),children:[(0,L.jsx)(`span`,{className:`min-w-0 truncate`,children:g?.label??e}),(0,L.jsx)(Ap,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`})]}),(0,L.jsx)(XT,{children:(0,L.jsxs)(ZT,{align:`start`,sideOffset:4,collisionPadding:8,onOpenAutoFocus:e=>{e.preventDefault(),e.currentTarget.querySelector(`input`)?.focus()},className:`glass-pop z-50 flex max-h-[min(20rem,var(--radix-popover-content-available-height))] w-[max(var(--radix-popover-trigger-width),17rem)] max-w-(--radix-popover-content-available-width) flex-col overflow-hidden rounded-lg outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-2.5`,children:[(0,L.jsx)(Rh,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,L.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),onKeyDown:v,role:`searchbox`,"aria-label":`Search ${r}`,"aria-controls":p,"aria-activedescendant":h[u]?`${p}-${u}`:void 0,placeholder:`Search…`,autoComplete:`off`,spellCheck:!1,className:`h-8 min-w-0 flex-1 bg-transparent text-[0.8125rem] outline-none placeholder:text-muted-foreground`})]}),(0,L.jsxs)(`div`,{ref:f,id:p,role:`listbox`,"aria-label":r,className:`min-h-0 flex-1 overflow-y-auto p-1`,children:[h.length===0?(0,L.jsxs)(`p`,{className:`px-2.5 py-2 text-xs text-muted-foreground`,children:[`Nothing matches “`,c,`”.`]}):null,h.map((t,n)=>(0,L.jsxs)(`div`,{id:`${p}-${n}`,role:`option`,"aria-selected":t.value===e,"data-index":n,onPointerMove:()=>d(n),onClick:()=>_(t),className:q(`flex cursor-default items-center gap-2 rounded-lg px-2.5 py-1.5 text-[0.8125rem] select-none`,n===u&&`bg-accent`),children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,L.jsx)(`span`,{className:`truncate`,children:t.label}),t.hint?(0,L.jsx)(`span`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:t.hint}):null]}),t.value===e?(0,L.jsx)(Op,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},t.value))]})]})})]})}function MG({label:e,help:t,children:n,stacked:r}){return(0,L.jsxs)(`div`,{className:r?`grid gap-1.5`:`grid gap-1.5 sm:grid-cols-[minmax(0,1fr)_minmax(0,18rem)] sm:items-center sm:gap-6`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`text-[0.8125rem] font-medium`,children:e}),t?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}):null]}),(0,L.jsx)(`div`,{className:`min-w-0`,children:n})]})}function NG({children:e}){return(0,L.jsx)(`div`,{className:`card-raised flex flex-col divide-y divide-border rounded-xl border px-4 [&>*]:py-3`,children:e})}function PG({value:e,items:t,label:n,onChange:r}){return(0,L.jsx)(jG,{value:e,options:t.map(e=>({value:e.value,label:e.label,...e.help?{hint:e.help}:{}})),label:n,onChange:r})}var FG=`(prefers-color-scheme: dark)`,IG=[`dark`,`light`,`system`],LG=m.createContext(void 0);function RG(e){return e!==null&&IG.includes(e)}function zG(){return window.matchMedia(FG).matches?`dark`:`light`}function BG(){let e=document.createElement(`style`);return e.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;transition:none!important}`)),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.remove()})})}}function VG(e){return e instanceof HTMLElement&&!!(e.isContentEditable||e.closest(`input, textarea, select, [contenteditable='true']`))}function HG({children:e,defaultTheme:t=`system`,storageKey:n=`theme`,disableTransitionOnChange:r=!0,...i}){let[a,o]=m.useState(()=>{let e=localStorage.getItem(n);return RG(e)?e:t}),s=m.useCallback(e=>{localStorage.setItem(n,e),o(e)},[n]),c=m.useCallback(e=>{let t=document.documentElement,n=e===`system`?zG():e,i=r?BG():null;t.classList.remove(`light`,`dark`),t.classList.add(n),i&&i()},[r]);m.useEffect(()=>{if(c(a),a!==`system`)return;let e=window.matchMedia(FG),t=()=>{c(`system`)};return e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}},[a,c]),m.useEffect(()=>{let e=e=>{e.repeat||e.metaKey||e.ctrlKey||e.altKey||VG(e.target)||e.key.toLowerCase()===`d`&&o(e=>{let t=e===`dark`?`light`:e===`light`?`dark`:zG()===`dark`?`light`:`dark`;return localStorage.setItem(n,t),t})};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[n]),m.useEffect(()=>{let e=e=>{if(e.storageArea===localStorage&&e.key===n){if(RG(e.newValue)){o(e.newValue);return}o(t)}};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}},[t,n]);let l=m.useMemo(()=>({theme:a,setTheme:s}),[a,s]);return(0,L.jsx)(LG.Provider,{...i,value:l,children:e})}var UG=()=>{let e=m.useContext(LG);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e},WG=[`master`,`designer`,`backend`,`qa`,`scout`,`researcher`,`quickfix`,`planner`],GG={master:`Master`,designer:`Designer`,backend:`Backend`,qa:`QA`,scout:`Scout`,researcher:`Researcher`,quickfix:`Quick fix`,planner:`Planner`},KG={model:`Model`,thinking:`Effort`,timeout:`Time limit`,instructions:`Instructions`},qG=`inherit`,JG=`inherit`,YG=`Use the session's current model`,XG=`__custom__`,ZG=`custom…`,QG=`Type a provider/model id`,$G=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],eK={agents:`Agents`,workflow:`Workflow`,lint:`Linting`,lobby:`Lobby`,classifier:`Classifier`,appearance:`Appearance`,notifications:`Notifications`,install:`Install as app`},tK=[{id:`startOn`,label:`On when pi starts`,help:`off: pi starts as plain pi, and ctrl+shift+m or /bot-lobby on turns bot-lobby on (a session that owns a task under way always starts on)`},{id:`issues`,label:`Issues tab`,help:`the GitHub Issues tab`}],nK=[{id:`conversation`,label:`Conversation pane`},{id:`activity`,label:`Activity log pane`},{id:`thinking`,label:`Thinking bubble`}],rK=`shown on the Lobby tab`,iK=`Planning rounds`,aK=`how many rounds the panel gets before the oracle settles the rest alone`,oK=[2,3,5,8,0],sK=`Split long plans`,cK=`saving a plan with more steps offers to split it into up to 5 tasks`,lK=[6,8,10,12,0],uK=`Port`,dK=`the base port (then the next free up to +20); 0 means any free port; applies the next time pi starts`,fK=`Open browser`,pK=`open this page in the browser when pi starts`,mK=[{id:`off`,label:`off`,help:`tasks work in the folder you started them in`},{id:`branch`,label:`branch`,help:`each new task gets a git branch named after it, checked out in the working folder`},{id:`worktree`,label:`worktree`,help:`each new task gets its own worktree and branch, named after it: every agent runs there, apart from your checkout`}],hK=`Git isolation`,gK=[{id:`off`,label:`off`,help:`agents' work is never linted`},{id:`advise`,label:`advise`,help:`the oracle and QA are told what the project's linter finds on the lines a task changed; nothing is held`},{id:`block`,label:`block`,help:`new lint errors also hold a task's completion until they are fixed, or you accept the work as it is`}],_K={intro:`After every worker step, before QA and at completion, bot-lobby lints only the files the task's agents touched. Problems on the lines the task changed are the task's; anything already there is shown but never holds it. Suppressions and lint-config changes the task adds go to QA to judge.`,mode:`Lint gate`,command:`Command`,commandHelp:`empty runs the linters the project configures (ESLint, Biome, Oxlint, Ruff), each from its own folder; a command runs without a shell from the repository's top, with {files} standing for the touched files`,commandPlaceholder:`found from the project`,extensions:`File types`,extensionsHelp:`which touched files the command is given, such as .ts .tsx .py`,extensionsPlaceholder:`every touched file`,timeout:`Time limit`,timeoutHelp:`for one linter run; one that runs over reads as could not run, and holds nothing`,found:`Found in this project`,foundHelp:`config files in the project and the folders a few levels below it`,foundNone:`No linter config found. Add one to the project, or set a command above.`,foundReplaced:`The command replaces these.`,installed:`installed`,missing:`not installed`,missingHelp:`install the project's dependencies there, or lint cannot run`,top:`project root`},vK=[{id:`auto`,label:`Auto (OpenCode's free Jev, else TypeSafe)`},{id:`opencode`,label:`OpenCode Zen`},{id:`typesafe`,label:`TypeSafe`},{id:`openrouter`,label:`OpenRouter`},{id:`vercel`,label:`Vercel AI Gateway`}],yK=[{id:`seats`,label:`Planning seats`,help:`each round, only the seats your idea or latest answers touch sit; 1-4 in the Plan tab pins one`},{id:`answers`,label:`Obvious answers`,help:`a panel question whose recommended option the conversation already makes clearly right is answered for you (listed under Assumptions)`},{id:`triage`,label:`Task triage`,help:`a new task's size, domains and research need reach the Master as hints; a quick fix that is really a task is held for you`},{id:`effort`,label:`Effort routing`,help:`a simple step runs one thinking level lower, a trivial one on the cheaper model below; a routed run that falls short runs again on your settings`},{id:`qa`,label:`QA risk`,help:`once a task's work is in, Jev reads the diff and sizes QA to it: no QA agent for a change with nothing that runs, a light check for a small one, deep review where a defect would spread; with it off the engine's rules decide`},{id:`review`,label:`Pull request read`,help:`the Git tab's quick read of a pull request: its size, and how likely it is risky, security-relevant, breaking or untested, before an agent reviews it`},{id:`knowledge`,label:`Relevant knowledge`,help:`when an agent's knowledge, standards or decisions file is too long for its prompt, Jev picks the sections that bear on the step, and the agent is told where the rest is`},{id:`files`,label:`File hints`,help:`scouts, workers, quick fixes and the planning panel start with the files most likely needed, and can look more up with find_relevant_files`}],bK={enabled:`Classifier`,enabledHelp:`Jev makes the obvious decisions so large models spend fewer tokens on them`,host:`Host`,model:`Model`,modelHelp:`empty uses the host's default`,key:`API key`,keyNote:`the key pi already holds for this host; it is never read by this page`,cheap:`Cheaper model`,cheapNone:`none: trivial steps keep their model and drop a thinking level`,cheapHelp:`what effort routing runs trivial steps on`},xK={title:`Settings`,intro:`Each agent's model and effort, the workflow and its lint gate, the lobby and the classifier. Changes save as you make them.`,loading:`Loading settings…`,loadFailed:`Could not load settings.`,saved:`Settings saved`,saving:`Saving…`,appearanceHelp:`Light, dark, or follow your system. Kept in this browser only.`,themeLabel:`Mode`,themeItems:[{id:`light`,label:`Light`},{id:`dark`,label:`Dark`},{id:`system`,label:`System`}],notificationsLabel:`Browser notifications`,notificationsHelp:`While this page is hidden, tell me when a question waits, a task finishes or a background session asks something.`,notificationsBlocked:`Notifications are blocked in your browser. Allow them for this site and try again.`,notificationsUnsupported:`This browser does not offer notifications.`,notificationsOn:`Browser notifications are on.`,notificationsOff:`Browser notifications are off.`,installLabel:`Install bot-lobby`,installHelp:`Opens in its own fullscreen window, with the shell cached so it starts when Pi is not running.`,installButton:`Install as fullscreen app`,installUnavailable:`Your browser has not offered to install it. Use its menu: “Install app” (Chrome, Edge) or Share, then “Add to Home Screen” (Safari).`,installDone:`bot-lobby is installed.`,installedNow:`Running as an installed app.`,fullscreenLabel:`Fullscreen`,fullscreenHelp:`Hide the browser's own bars for this tab (F11 does the same).`,fullscreenOn:`Exit fullscreen`,fullscreenOff:`Go fullscreen`},SK=`https://tweakcn.com/editor/theme`;function CK(){let{theme:e}=UG();return e===`dark`||e===`system`&&typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches}function wK({palette:e,dark:t}){let n=le(e,t);return(0,L.jsxs)(`span`,{"aria-hidden":`true`,className:`flex h-9 items-center gap-1.5 rounded-lg border border-border px-2`,style:{background:n.background},children:[(0,L.jsx)(`span`,{className:`size-4 rounded-full border border-black/10`,style:{background:n.card}}),(0,L.jsx)(`span`,{className:`size-4 rounded-full`,style:{background:n.primary}}),(0,L.jsx)(`span`,{className:`h-2 flex-1 rounded-full`,style:{background:n.accent}})]})}function TK(){let e=ve(),t=CK(),n=(0,m.useRef)(null);function r(t){let r=t.key===`ArrowRight`||t.key===`ArrowDown`?1:t.key===`ArrowLeft`||t.key===`ArrowUp`?-1:0;if(!r)return;t.preventDefault(),t.stopPropagation();let i=Math.max(0,e.all.findIndex(t=>t.id===e.active.id)),a=e.all[(i+r+e.all.length)%e.all.length];e.choose(a.id),window.requestAnimationFrame(()=>n.current?.querySelector(`[data-theme-id="${a.id}"]`)?.focus())}return(0,L.jsx)(`div`,{ref:n,role:`radiogroup`,"aria-label":`Colour theme`,onKeyDown:r,className:`grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4`,children:e.all.map(n=>{let r=n.id===e.active.id;return(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space ArrowLeft ArrowRight`,"aria-describedby":`focused-action-help`,type:`button`,role:`radio`,"aria-checked":r,"data-theme-id":n.id,tabIndex:r?0:-1,onClick:()=>e.choose(n.id),className:q(`grid gap-1.5 rounded-lg border p-2 text-left outline-none transition-[border-color,box-shadow,background-color] duration-150 focus-visible:ring-3 focus-visible:ring-ring/40`,r?`border-primary bg-accent shadow-[0_0_0_1px_var(--primary)]`:`border-border hover:bg-accent/50`),children:[(0,L.jsx)(wK,{palette:n,dark:t}),(0,L.jsxs)(`span`,{className:`flex items-center justify-between gap-2 px-0.5 text-[0.8125rem] font-medium`,children:[(0,L.jsxs)(`span`,{className:`truncate`,children:[n.name,n.id===`custom`?(0,L.jsx)(`span`,{className:`ml-1.5 text-xs font-normal text-muted-foreground`,children:`imported`}):null]}),r?(0,L.jsx)(Op,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]})]},n.id)})})}function EK(){let e=ve(),[t,n]=(0,m.useState)(``),[r,i]=(0,m.useState)(),a=(0,m.useRef)(null);function o(t,r){let a=te(t);if(`error`in a){i(a.error);return}i(void 0);let o=e.adopt(a,r);n(``);let s=a.light?a.dark?void 0:`dark`:`light`;B.success(s?`${o.name} applied. It has no ${s} colours, so ${s} mode keeps the default ones.`:`${o.name} applied.`)}async function s(e){if(e){if(e.size>2e5){i(`That file is too large to be a theme.`);return}o(await e.text(),e.name.replace(/\.[^.]+$/,``)||`Custom theme`)}}return(0,L.jsxs)(`div`,{className:`grid gap-2`,children:[(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Pick or build a theme in the`,` `,(0,L.jsxs)(`a`,{href:SK,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-0.5 text-link underline-offset-2 hover:underline`,children:[`tweakcn editor `,(0,L.jsx)(fm,{"aria-hidden":`true`,className:`size-3`})]}),`, press Code, copy it, and paste it here, or save it as a file and upload that. Colours and fonts are used; corners stay the page's own.`]}),(0,L.jsx)(OO,{value:t,onChange:e=>{n(e.target.value),i(void 0)},rows:4,spellCheck:!1,"aria-label":`Theme CSS from tweakcn`,"aria-invalid":r?!0:void 0,placeholder:`:root {
|
|
89
92
|
--background: oklch(0.98 0 0);
|
|
90
93
|
--primary: oklch(0.55 0.2 260);
|
|
91
94
|
…
|
|
92
95
|
}
|
|
93
|
-
.dark { … }`,className:`max-h-56 font-mono text-xs md:text-xs`}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(`input`,{ref:a,type:`file`,accept:`.css,.json,text/css,application/json`,hidden:!0,tabIndex:-1,"aria-label":`Upload a theme file`,onChange:e=>{s(e.target.files?.[0]),e.target.value=``}}),(0,L.jsx)(Y,{label:`Apply the pasted theme`,text:`Apply`,icon:Op,tone:`primary`,disabled:!t.trim(),onClick:()=>o(t,`Custom theme`)}),(0,L.jsx)(Y,{label:`Upload a .css or .json theme file`,text:`Upload file`,icon:ug,onClick:()=>a.current?.click()}),e.custom?(0,L.jsx)(WO,{label:`Remove ${e.custom.name}`,text:`Remove`,title:`Remove the imported theme?`,description:`The imported theme is stored in this browser. Keep a copy if you want to use it again.`,confirmLabel:`Remove theme`,icon:ig,variant:`destructive`,onConfirm:()=>e.removeCustom()}):null,r?(0,L.jsx)(`p`,{role:`alert`,className:`ml-2 min-w-0 text-xs text-destructive`,children:r}):null]})]})}function fK(){let{theme:e,setTheme:t}=OG(),n=SW();return(0,L.jsx)($R,{prominent:!0,title:zG.appearance,children:(0,L.jsxs)(vG,{children:[(0,L.jsx)(_G,{label:`Prompt sounds`,help:`A droplet for each new actionable prompt or delivery review. Kept in this browser; sound starts after interaction. Desktop notifications remain separate.`,children:(0,L.jsx)(KW,{checked:!n,onCheckedChange:e=>bW(!e),"aria-label":`Prompt sounds`})}),(0,L.jsx)(_G,{label:oK.themeLabel,help:oK.appearanceHelp,children:(0,L.jsx)(yG,{value:e,items:oK.themeItems.map(e=>({value:e.id,label:e.label})),label:oK.themeLabel,onChange:e=>t(e)})}),(0,L.jsx)(_G,{label:`Colour theme`,help:`The page's colours. Kept in this browser only.`,stacked:!0,children:(0,L.jsx)(uK,{})}),(0,L.jsx)(_G,{label:`Import a theme`,stacked:!0,children:(0,L.jsx)(dK,{})})]})})}var pK={master:[`master`],designer:[`agents`,`designer`],backend:[`agents`,`backend`],qa:[`agents`,`qa`],scout:[`scout`],researcher:[`researcher`],quickfix:[`quickFix`],planner:[`planner`]},mK=[...BG,...VG.map(e=>({id:`panel:${e.id}`,label:e.label,help:HG}))];function hK(e,t){switch(t){case`master`:return e.master;case`scout`:return{model:e.scout.model,thinking:`low`,timeoutMs:e.scout.timeoutMs};case`researcher`:return e.researcher;case`quickfix`:return e.quickFix;case`planner`:return e.planner;default:return e.agents[t]}}function gK(e,t){return pK[e].reduceRight((e,t)=>({[t]:e}),t)}function _K(e,t){return e.find(e=>e.id===t)?.thinkingLevels??RG}function vK(e,t){return RG[fG(RG,e,Math.max(0,RG.indexOf(t)))]??t}var yK=e=>e>0?`${e} round${e===1?``:`s`}`:`unlimited`,bK=e=>e>0?`over ${e} steps`:`never`;function xK({label:e,children:t}){return(0,L.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),t]})}function SK(e){let[t,n]=(0,m.useState)(!1),[r,i]=(0,m.useState)(``),a=e.models.some(t=>t.id===e.value),o=[...e.inherit?[{value:MG,label:NG,help:PG}]:[],...e.none?[{value:MG,label:`none`,help:`Use the primary model`}]:[],...!e.inherit&&!e.none&&e.value===`inherit`?[{value:MG,label:NG,help:PG}]:[],...e.models.map(e=>({value:e.id,label:e.id,...e.label&&e.label!==e.id?{help:e.label}:{}})),...!a&&e.value!==`inherit`?[{value:e.value,label:e.value,help:LG}]:[],{value:FG,label:IG,help:LG}],s=t=>{if(t!==`__custom__`)return e.onChange(t);i(a?``:e.value),n(!0)},c=()=>{let t=r.trim();n(!1),t&&t!==e.value&&e.onChange(t)};return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(yG,{value:e.value,items:o,label:e.label,onChange:s}),t?(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(GW,{autoFocus:!0,value:r,placeholder:`provider/model`,"aria-label":`Model id`,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c())}}),(0,L.jsx)(Y,{label:`Use this model`,icon:Op,tone:`primary`,onClick:c})]}):null]})}function CK({label:e,help:t,checked:n,onChange:r}){return(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`text-[0.8125rem] font-medium`,children:e}),t?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}):null]}),(0,L.jsx)(KW,{checked:n,onCheckedChange:r,"aria-label":e})]})}function wK({value:e,onSave:t,placeholder:n,label:r}){let[i,a]=(0,m.useState)(e);(0,m.useEffect)(()=>a(e),[e]);let o=()=>{let n=i.trim();n!==e&&t(n)};return(0,L.jsx)(GW,{value:i,placeholder:n,"aria-label":r,onChange:e=>a(e.target.value),onBlur:o,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())}})}function TK({value:e,label:t,onSave:n}){let r=Math.round(e/6e4);return(0,L.jsx)(DK,{label:t,value:String(r),min:1,suffix:`min`,onSave:e=>{let t=Number(e);return!Number.isFinite(t)||t<=0?(V.error(`"${e}" is not a positive number of minutes.`),!1):(n(Math.round(t*6e4)),!0)}})}function EK({value:e,onSave:t}){return(0,L.jsx)(DK,{label:YG,value:String(e),min:0,max:65535,onSave:e=>!/^\d+$/.test(e)||Number(e)>65535?(V.error(`"${e}" is not a port (0, or 1-65535).`),!1):(t(Number(e)),!0)})}function DK({label:e,value:t,min:n,max:r,suffix:i,onSave:a}){let[o,s]=(0,m.useState)(t);(0,m.useEffect)(()=>s(t),[t]);let c=()=>{o!==t&&(a(o.trim())||s(t))};return(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(GW,{type:`number`,inputMode:`numeric`,min:n,max:r,value:o,"aria-label":e,className:i?`pr-10`:void 0,onChange:e=>s(e.target.value),onBlur:c,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c())}}),i?(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-y-0 right-2.5 flex items-center text-xs text-muted-foreground`,children:i}):null]})}function OK({value:e,label:t,onSave:n}){let[r,i]=(0,m.useState)(e);return(0,m.useEffect)(()=>i(e),[e]),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(OO,{rows:2,value:r,"aria-label":t,onChange:e=>i(e.target.value),onBlur:()=>{r.trim()!==e&&n(r.trim())}}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Saved when you leave the field.`})]})}function kK({kind:e,config:t,models:n,save:r}){let i=hK(t,e),a=t=>r(gK(e,t)),o=AG[e],s=_K(n,i.model),c=t=>{let r={model:t};e!==`scout`&&!_K(n,t).includes(i.thinking)&&(r.thinking=vK(_K(n,t),i.thinking)),a(r)},l=e===`scout`?`low`:vK(s,i.thinking),u=e!==`scout`&&e!==`researcher`,[d,f]=(0,m.useState)(!!i.instructions);return(0,L.jsxs)(`section`,{className:`glass flex min-w-0 flex-col gap-3 rounded-xl p-4`,children:[(0,L.jsxs)(`header`,{className:`flex items-baseline justify-between gap-3`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-semibold`,children:o}),(0,L.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[i.model===`inherit`?`session model`:i.model,` · `,e===`scout`?`low`:i.thinking]})]}),(0,L.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-1`,children:(0,L.jsx)(xK,{label:jG.model,children:(0,L.jsx)(SK,{value:i.model,models:n,label:`${o} model`,inherit:e===`master`,onChange:c})})}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg bg-muted p-3`,children:[(0,L.jsx)(lG,{level:l,className:`size-16`}),(0,L.jsx)(`div`,{className:`min-w-0 flex-1`,children:e===`scout`?(0,L.jsxs)(`div`,{className:`grid gap-1`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:jG.thinking}),(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`low`,` (fixed for scouts)`]})]}):(0,L.jsx)(mG,{value:i.thinking,levels:RG,supported:s,model:i.model===`inherit`?`the session model`:i.model,label:`${o} effort`,onChange:e=>a({thinking:e})})})]}),(0,L.jsxs)(`div`,{className:`flex min-h-7 items-center justify-between gap-3`,children:[u?(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"aria-expanded":d,onClick:()=>f(e=>!e),className:`flex min-h-8 items-center gap-1 rounded-md text-xs text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/30`,children:[(0,L.jsx)(Pp,{"aria-hidden":`true`,className:q(`size-3.5 transition-transform duration-200 ease-snap`,d&&`rotate-90`)}),jG.instructions,!d&&i.instructions?(0,L.jsx)(`span`,{className:`text-primary`,children:`· set`}):null]}):(0,L.jsx)(`span`,{}),e===`master`?null:(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Time limit`}),(0,L.jsx)(`div`,{className:`w-24`,children:(0,L.jsx)(TK,{value:i.timeoutMs??t.workflow.agentTimeoutMs,label:`${o} time limit`,onSave:e=>a({timeoutMs:e})})})]})]}),u&&d?(0,L.jsx)(OK,{value:i.instructions??``,label:`${o} instructions`,onSave:e=>a({instructions:e})}):null]})}function AK(e,t){return t.startsWith(`panel:`)?e.lobby.panels[t.slice(6)]:e.lobby[t]}function jK({config:e,item:t,save:n}){let r=t.id.startsWith(`panel:`);return(0,L.jsx)(CK,{label:t.label,help:t.help,checked:AK(e,t.id),onChange:e=>{n(r?{lobby:{panels:{[t.id.slice(6)]:e}}}:{lobby:{[t.id]:e}})}})}function MK({config:e,save:t}){let n=e.workflow.gitIsolation;return(0,L.jsx)($R,{prominent:!0,title:zG.workflow,children:(0,L.jsx)(vG,{children:(0,L.jsx)(_G,{label:eK,help:$G.find(e=>e.id===n)?.help??`enter cycles off, branch, worktree`,children:(0,L.jsx)(yG,{value:n,items:$G.map(e=>({value:e.id,label:e.label})),label:eK,onChange:e=>void t({workflow:{gitIsolation:e}})})})})})}var NK=e=>e?`${e}/`:nK.top;function PK(e){return e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean)}function FK({replaced:e}){let t=UD(`settings.linters`,{},[]),n=t.data?.linters;return(0,L.jsx)(_G,{label:nK.found,help:e?nK.foundReplaced:nK.foundHelp,children:n?n.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground sm:text-right`,children:nK.foundNone}):(0,L.jsx)(`ul`,{"aria-label":nK.found,className:q(`flex flex-col gap-1.5 sm:items-end`,e&&`opacity-60`),children:n.map(e=>(0,L.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 text-sm`,children:[(0,L.jsx)(`span`,{className:`font-medium`,children:e.tool}),(0,L.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:NK(e.folder)}),(0,L.jsxs)(`span`,{title:e.installed?void 0:nK.missingHelp,className:q(`inline-flex shrink-0 items-center gap-1 text-xs`,e.installed?`text-success`:`text-warning`),children:[e.installed?(0,L.jsx)(Hp,{"aria-hidden":`true`,className:`size-3.5`}):(0,L.jsx)(Bp,{"aria-hidden":`true`,className:`size-3.5`}),e.installed?nK.installed:nK.missing]})]},`${e.tool}:${e.folder}`))}):(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground sm:text-right`,children:t.error?t.error:`Looking…`})})}function IK({config:e,save:t}){let n=e.lint,r=n.mode===`off`,i=n.command.trim().length>0;return(0,L.jsxs)($R,{prominent:!0,title:zG.lint,children:[(0,L.jsx)(`p`,{className:`max-w-3xl text-sm text-muted-foreground`,children:nK.intro}),(0,L.jsxs)(vG,{children:[(0,L.jsx)(_G,{label:nK.mode,help:tK.find(e=>e.id===n.mode)?.help,children:(0,L.jsx)(yG,{value:n.mode,items:tK.map(e=>({value:e.id,label:e.label})),label:nK.mode,onChange:e=>void t({lint:{mode:e}})})}),(0,L.jsxs)(`div`,{className:q(`flex flex-col divide-y divide-border [&>*]:py-3 [&>*:first-child]:pt-0 [&>*:last-child]:pb-0`,r&&`opacity-60`),"aria-disabled":r||void 0,children:[(0,L.jsx)(_G,{label:nK.command,help:nK.commandHelp,children:(0,L.jsx)(wK,{value:n.command,label:nK.command,placeholder:nK.commandPlaceholder,onSave:e=>void t({lint:{command:e}})})}),i?(0,L.jsx)(_G,{label:nK.extensions,help:nK.extensionsHelp,children:(0,L.jsx)(wK,{value:n.extensions.join(` `),label:nK.extensions,placeholder:nK.extensionsPlaceholder,onSave:e=>void t({lint:{extensions:PK(e)}})})}):null,(0,L.jsx)(_G,{label:nK.timeout,help:nK.timeoutHelp,children:(0,L.jsx)(TK,{value:n.timeoutMs,label:`Lint ${nK.timeout.toLowerCase()}`,onSave:e=>void t({lint:{timeoutMs:e}})})}),(0,L.jsx)(FK,{replaced:i})]})]})]})}function LK({config:e,save:t}){let n=e.lobby.web;return(0,L.jsx)($R,{prominent:!0,title:zG.lobby,children:(0,L.jsxs)(vG,{children:[mK.map(n=>(0,L.jsx)(jK,{config:e,item:n,save:t},n.id)),(0,L.jsx)(_G,{label:UG,help:WG,children:(0,L.jsx)(yG,{value:String(e.lobby.maxPlanningRounds),items:GG.map(e=>({value:String(e),label:yK(e)})),label:UG,onChange:e=>void t({lobby:{maxPlanningRounds:Number(e)}})})}),(0,L.jsx)(_G,{label:KG,help:qG,children:(0,L.jsx)(yG,{value:String(e.lobby.splitPlanAbove),items:JG.map(e=>({value:String(e),label:bK(e)})),label:KG,onChange:e=>void t({lobby:{splitPlanAbove:Number(e)}})})}),(0,L.jsx)(_G,{label:YG,help:XG,children:(0,L.jsx)(EK,{value:n.port,onSave:e=>void t({lobby:{web:{port:e}}})})}),(0,L.jsx)(CK,{label:ZG,help:QG,checked:n.openBrowser,onChange:e=>void t({lobby:{web:{openBrowser:e}}})})]})})}function RK({config:e,models:t,save:n}){let r=e.classifier,i=rK.find(e=>e.id===r.provider)?.label;return(0,L.jsx)($R,{prominent:!0,title:zG.classifier,children:(0,L.jsxs)(vG,{children:[(0,L.jsx)(CK,{label:aK.enabled,help:aK.enabledHelp,checked:r.enabled,onChange:e=>void n({classifier:{enabled:e}})}),(0,L.jsx)(_G,{label:aK.host,children:(0,L.jsx)(yG,{value:r.provider,items:rK.map(e=>({value:e.id,label:e.label})),label:aK.host,onChange:e=>void n({classifier:{provider:e}})})}),(0,L.jsx)(_G,{label:aK.model,help:aK.modelHelp,children:(0,L.jsx)(wK,{value:r.model,label:aK.model,placeholder:`the host's default`,onSave:e=>void n({classifier:{model:e}})})}),(0,L.jsx)(_G,{label:aK.key,help:aK.keyNote,children:(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground sm:text-right`,children:i??r.provider})}),iK.map(e=>(0,L.jsx)(CK,{label:e.label,help:e.help,checked:r.features[e.id],onChange:t=>void n({classifier:{features:{[e.id]:t}}})},e.id)),(0,L.jsx)(_G,{label:aK.cheap,help:aK.cheapHelp,children:(0,L.jsx)(SK,{value:r.effort.cheapModel,models:t,label:aK.cheap,none:!0,onChange:e=>void n({classifier:{effort:{cheapModel:e}}})})})]})})}function zK(){let e=MW(),t=async e=>{if(!e)return PW();let t=await NW();t===`granted`?V.success(oK.notificationsOn):V.error(t===`unsupported`?oK.notificationsUnsupported:oK.notificationsBlocked)};return(0,L.jsx)($R,{prominent:!0,title:zG.notifications,children:(0,L.jsx)(vG,{children:(0,L.jsx)(CK,{label:oK.notificationsLabel,help:oK.notificationsHelp,checked:e,onChange:e=>void t(e)})})})}function BK(){let{available:e,install:t}=y(),n=b(),r=x();return(0,L.jsx)($R,{prominent:!0,title:zG.install,children:(0,L.jsxs)(vG,{children:[(0,L.jsx)(_G,{label:oK.installLabel,help:n?oK.installedNow:oK.installHelp,children:n?null:(0,L.jsx)(`div`,{className:`flex sm:justify-end`,children:(0,L.jsx)(Y,{label:oK.installButton,icon:um,tone:`primary`,onClick:()=>e?void t().then(()=>V.success(oK.installDone)):V.warning(oK.installUnavailable)})})}),r.supported?(0,L.jsx)(_G,{label:oK.fullscreenLabel,help:oK.fullscreenHelp,children:(0,L.jsx)(`div`,{className:`flex sm:justify-end`,children:(0,L.jsx)(Y,{label:r.on?oK.fullscreenOn:oK.fullscreenOff,icon:r.on?eh:Hm,pressed:r.on,onClick:()=>void r.toggle()})})}):null]})})}var VK=[`Agents`,`Workflow`,`Linting`,`Lobby`,`Classifier`,`Appearance & notifications`];function HK({config:e,models:t,onConfig:n}){let[r,i]=(0,m.useState)(`Agents`),a=(0,m.useRef)(Promise.resolve()),o=e=>{let t=async()=>{try{return n((await Kf(`settings.set`,{patch:e})).config),V.success(oK.saved),!0}catch(e){return V.error(e instanceof Error?e.message:`That did not work. Try again.`),!1}},r=a.current.then(t,t);return a.current=r,r};return(0,L.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-6 px-5 pt-5 pb-dock sm:px-8 sm:pt-8`,children:[(0,L.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:oK.title}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:oK.intro})]}),(0,L.jsx)(`nav`,{"aria-label":`Settings sections`,className:`-mx-1 flex flex-wrap gap-1 border-b border-border pb-3`,children:VK.map(e=>(0,L.jsx)(`button`,{type:`button`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"aria-current":r===e?`page`:void 0,"aria-controls":`settings-${e.split(` `)[0]}`,onClick:()=>i(e),className:q(`h-8 rounded-lg border border-transparent px-3 text-sm font-medium outline-none transition-[box-shadow,color] focus-visible:ring-3 focus-visible:ring-ring/40`,r===e?`btn-raised bg-card text-foreground`:`text-muted-foreground hover:text-foreground`),children:e},e))}),(0,L.jsx)(`div`,{id:`settings-Agents`,hidden:r!==`Agents`,"aria-hidden":r!==`Agents`,children:(0,L.jsx)($R,{prominent:!0,title:zG.agents,children:(0,L.jsx)(`div`,{className:`grid grid-cols-1 gap-4 xl:grid-cols-2`,children:kG.map(n=>(0,L.jsx)(kK,{kind:n,config:e,models:t,save:o},n))})})}),(0,L.jsx)(`div`,{id:`settings-Workflow`,hidden:r!==`Workflow`,"aria-hidden":r!==`Workflow`,children:(0,L.jsx)(MK,{config:e,save:o})}),(0,L.jsx)(`div`,{id:`settings-Linting`,hidden:r!==`Linting`,"aria-hidden":r!==`Linting`,children:(0,L.jsx)(IK,{config:e,save:o})}),(0,L.jsx)(`div`,{id:`settings-Lobby`,hidden:r!==`Lobby`,"aria-hidden":r!==`Lobby`,children:(0,L.jsx)(LK,{config:e,save:o})}),(0,L.jsx)(`div`,{id:`settings-Classifier`,hidden:r!==`Classifier`,"aria-hidden":r!==`Classifier`,children:(0,L.jsx)(RK,{config:e,models:t,save:o})}),(0,L.jsx)(`div`,{id:`settings-Appearance`,hidden:r!==`Appearance & notifications`,"aria-hidden":r!==`Appearance & notifications`,children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,L.jsx)(fK,{}),(0,L.jsx)(zK,{}),(0,L.jsx)(BK,{})]})})]})}function UK(){return(0,L.jsx)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-4 px-5 pt-5 pb-dock sm:px-8 sm:pt-8`,role:`status`,"aria-label":oK.loading,children:[0,1,2,3].map(e=>(0,L.jsx)(`div`,{className:`h-48 rounded-lg bg-muted motion-safe:animate-pulse`},e))})}function WK(){let e=UD(`settings.get`,{},[`status`]),[t,n]=(0,m.useState)(),r=(0,m.useRef)(0),i=(0,m.useCallback)(e=>{r.current=performance.now(),n(e)},[]);return(0,m.useEffect)(()=>{e.data&&e.requestedAt>r.current&&n(e.data.config)},[e.data,e.requestedAt]),!t&&e.error?(0,L.jsx)(LD,{message:`${oK.loadFailed} ${e.error}`,onRetry:e.reload}):t?(0,L.jsx)(HK,{config:t,models:e.data?.models??[],onConfig:i}):(0,L.jsx)(UK,{})}function GK(){let e=globalThis.DOMParser;if(!e)throw Error(`DOMParser is unavailable`);return new e}var KK=`default-src 'none'; script-src 'none'; style-src 'unsafe-inline'; img-src 'none'; font-src 'none'; connect-src 'none'; media-src 'none'; frame-src 'none'; object-src 'none'; form-action 'none'; base-uri 'none'`,qK=new Set(`div span p br hr h1 h2 h3 h4 h5 h6 section article header footer main aside nav ul ol li dl dt dd strong em b i u s small sub sup blockquote pre code table thead tbody tfoot tr th td caption colgroup col figure figcaption style`.split(` `)),JK=new Set(`class id title role aria-label aria-hidden colspan rowspan scope`.split(` `));function YK(e){if(!e||typeof e!=`object`)return;let t=e;if(!(typeof t.html!=`string`||t.html.length>1e5)&&!(t.css!==void 0&&(typeof t.css!=`string`||t.css.length>5e4)))return{html:t.html,...typeof t.css==`string`?{css:t.css}:{}}}function XK(e){let t=e.replace(/\/\*[\s\S]*?\*\//g,``);return/\\|@import|url\s*\(|image-set\s*\(|expression\s*\(|behavior\s*:|-moz-binding/i.test(t)?``:t.replace(/<\/?style/gi,``)}function ZK(e){if(!qK.has(e.localName)||e.namespaceURI!==`http://www.w3.org/1999/xhtml`){e.remove();return}for(let t of[...e.attributes])t.name===`style`?e.setAttribute(`style`,XK(t.value)):JK.has(t.name)||e.removeAttribute(t.name);e.localName===`style`&&(e.textContent=XK(e.textContent??``));for(let t of[...e.children])ZK(t)}function QK(e,t){try{return $K(e,t??GK())}catch{return`<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${KK}"><meta name="referrer" content="no-referrer"></head><body><p role="status">Static mockup unavailable. The preview could not be safely rendered.</p></body></html>`}}function $K(e,t){let n=t.parseFromString(e.html,`text/html`);for(let e of[...n.head.children,...n.body.children])ZK(e);let r=[...n.head.querySelectorAll(`style`)].map(e=>e.outerHTML).join(``);return`<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${KK}"><meta name="referrer" content="no-referrer"><style>body{margin:16px;overflow-wrap:anywhere}*{box-sizing:border-box}${XK(e.css??``).replace(/</g,`\\3c `)}</style>${r}</head><body>${n.body.innerHTML}</body></html>`}function eq({preview:e,label:t,className:n,frameWidth:r,minWidth:i,onOpen:a}){let o=(0,m.useMemo)(()=>QK(e),[e]),s=(0,m.useRef)(null),[c,l]=(0,m.useState)();if((0,m.useLayoutEffect)(()=>{let e=s.current;if(!r&&!i||!e)return;let t=()=>l({width:e.clientWidth,height:e.clientHeight});if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[r,i]),!r&&!i)return(0,L.jsx)(`iframe`,{title:`Static mockup: ${t}`,sandbox:``,referrerPolicy:`no-referrer`,srcDoc:o,className:q(`h-80 w-full rounded-lg border bg-background`,n)});let u=r??Math.max(c?.width??0,i??0),d=c&&c.width>0&&u>0?Math.min(1,c.width/u):1;return(0,L.jsxs)(`div`,{ref:s,className:q(`group/mock relative h-80 w-full overflow-hidden rounded-lg border bg-background`,n),children:[(0,L.jsx)(`iframe`,{title:`Static mockup: ${t}`,sandbox:``,referrerPolicy:`no-referrer`,srcDoc:o,tabIndex:a?-1:void 0,className:q(`absolute top-0 left-0 origin-top-left border-0`,a&&`pointer-events-none`),style:{width:u||`100%`,height:c?c.height/d:`100%`,transform:`scale(${d})`}}),a?(0,L.jsx)(`button`,{type:`button`,"data-compact":``,onClick:a,"aria-label":`Expand the mockup: ${t}`,className:`absolute inset-0 flex items-end justify-end p-2 outline-none focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:ring-inset`,children:(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md border border-border bg-card/90 px-1.5 py-0.5 text-[0.6875rem] font-medium text-muted-foreground opacity-0 shadow-sm backdrop-blur transition-opacity group-hover/mock:opacity-100 group-focus-within/mock:opacity-100`,children:[(0,L.jsx)(Bm,{"aria-hidden":`true`,className:`size-3`}),`Expand`]})}):null]})}var tq=/\s*\(recommended\)\s*$/i,nq=1024,rq=e=>e.replace(tq,``);function iq(e){return!!(e&&(e.htmlPreview||e.image||e.preview))}function aq({option:e}){let t=rq(e.label);return iq(e)?(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[e.htmlPreview?(0,L.jsx)(eq,{preview:e.htmlPreview,label:t,minWidth:nq,className:`h-auto min-h-[18rem] flex-1`}):null,e.image?(0,L.jsx)(`img`,{src:Hf(e.image),alt:`Mockup: ${t}`,className:`min-h-0 w-full flex-1 rounded-lg border bg-background object-contain`}):null,e.preview?(0,L.jsx)(XR,{text:e.preview,className:q(`overflow-auto rounded-lg border bg-background p-4 text-sm`,!e.htmlPreview&&!e.image&&`flex-1`)}):null]}):(0,L.jsx)(`p`,{className:`grid h-full place-items-center p-6 text-sm text-muted-foreground`,children:`No mockup for this option.`})}function oq({options:e,start:t,title:n,picked:r=[],multi:i=!1,onChoose:a,onClose:o,onIndex:s}){let c=qd(),l=(0,m.useRef)(null),u=(0,m.useRef)(null),[d,f]=(0,m.useState)(()=>Math.min(Math.max(0,t),e.length-1)),p=e[d],h=e.length-1;(0,m.useEffect)(()=>s?.(d),[d,s]),(0,m.useLayoutEffect)(()=>{let e=l.current;e&&(e.scrollLeft=d*e.clientWidth),u.current?.focus()},[]);let g=(0,m.useCallback)(e=>{let t=Math.min(Math.max(0,e),h),n=l.current;f(t),n?.scrollTo({left:t*n.clientWidth,behavior:c?`auto`:`smooth`})},[h,c]);(0,m.useEffect)(()=>{let e=l.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>{e.scrollLeft=d*e.clientWidth});return t.observe(e),()=>t.disconnect()},[d]);function _(){let e=l.current;if(!e||e.clientWidth===0)return;let t=Math.round(e.scrollLeft/e.clientWidth);t!==d&&t>=0&&t<=h&&f(t)}function v(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=t.target;if(n.closest(`input, textarea, [contenteditable='true']`))return;let r={ArrowLeft:-1,ArrowRight:1,PageUp:-1,PageDown:1}[t.key];if(r){t.preventDefault(),g(d+r);return}if(t.key===`Home`||t.key===`End`){t.preventDefault(),g(t.key===`Home`?0:h);return}let i=Number(t.key);if(Number.isInteger(i)&&i>=1&&i<=e.length){t.preventDefault(),g(i-1);return}t.key===`Enter`&&a&&!(n instanceof HTMLButtonElement)&&(t.preventDefault(),a(d))}let y=r.includes(d);return(0,L.jsxs)(`div`,{ref:u,tabIndex:-1,"data-autofocus":``,onKeyDown:v,className:`mockup-viewer flex h-full min-h-0 flex-col outline-none`,role:`region`,"aria-label":`Mockups: ${n}`,"aria-roledescription":`carousel`,children:[(0,L.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 border-b border-border px-4 py-3 sm:px-5`,children:[(0,L.jsx)(J,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Back to the question`,title:`Back · Esc`,onClick:()=>o(d),children:(0,L.jsx)(Qm,{"aria-hidden":`true`})}),(0,L.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:n}),(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,"aria-live":`polite`,children:[d+1,` of `,e.length]}),(0,L.jsx)(`div`,{role:`tablist`,"aria-label":`Options`,className:`flex w-full flex-wrap gap-1.5 sm:w-auto`,children:e.map((e,t)=>(0,L.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":t===d,"aria-controls":`mockup-slide-${t}`,"data-compact":``,onClick:()=>g(t),className:q(`inline-flex h-7 max-w-48 items-center gap-1 rounded-lg border px-2.5 text-xs font-medium transition-colors outline-none focus-visible:ring-3 focus-visible:ring-ring/40`,t===d?`border-primary/50 bg-accent text-foreground`:`border-border text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,L.jsx)(`span`,{className:`tabular-nums text-muted-foreground`,children:t+1}),(0,L.jsx)(`span`,{className:`truncate`,children:rq(e.label)}),r.includes(t)?(0,L.jsx)(Op,{"aria-label":`picked`,className:`size-3 text-primary`}):null]},t))})]}),(0,L.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,L.jsx)(`div`,{ref:l,onScroll:_,className:`mockup-track flex h-full snap-x snap-mandatory overflow-x-auto overflow-y-hidden overscroll-x-contain`,children:e.map((t,n)=>(0,L.jsxs)(`section`,{id:`mockup-slide-${n}`,role:`tabpanel`,"aria-roledescription":`slide`,"aria-label":`${n+1} of ${e.length}: ${rq(t.label)}`,"aria-hidden":n!==d,className:`flex h-full w-full shrink-0 snap-center snap-always flex-col gap-2 px-4 py-4 sm:px-14`,children:[(0,L.jsxs)(`div`,{className:`flex items-baseline gap-2 text-sm`,children:[(0,L.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[n+1,`.`]}),(0,L.jsx)(`span`,{className:`font-medium`,children:rq(t.label)}),tq.test(t.label)?(0,L.jsx)(`span`,{className:`text-xs font-medium text-primary`,children:`Recommended`}):null,r.includes(n)?(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-primary`,children:[(0,L.jsx)(Op,{"aria-hidden":`true`,className:`size-3`}),`picked`]}):null]}),t.description?(0,L.jsx)(XR,{text:t.description,className:`text-sm text-muted-foreground`}):null,(0,L.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,L.jsx)(aq,{option:t})})]},n))}),d>0?(0,L.jsx)(J,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Previous option`,title:`Previous · ←`,onClick:()=>g(d-1),className:`absolute top-1/2 left-2 -translate-y-1/2 rounded-full max-sm:hidden`,children:(0,L.jsx)(Mp,{"aria-hidden":`true`})}):null,d<h?(0,L.jsx)(J,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Next option`,title:`Next · →`,onClick:()=>g(d+1),className:`absolute top-1/2 right-2 -translate-y-1/2 rounded-full max-sm:hidden`,children:(0,L.jsx)(Pp,{"aria-hidden":`true`})}):null]}),(0,L.jsxs)(`footer`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2 border-t border-border px-4 py-3 sm:px-5`,children:[(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,L.jsx)(lD,{chord:`←→`,children:`option`}),a?(0,L.jsx)(lD,{chord:`Enter`,children:i?y?`unpick`:`pick`:`choose`}):null,(0,L.jsx)(lD,{chord:`Esc`,children:`back`})]}),a&&p?(0,L.jsxs)(J,{type:`button`,onClick:()=>a(d),className:`max-w-full`,children:[i&&y?`Unpick`:i?`Pick`:`Choose`,(0,L.jsx)(`span`,{className:`truncate`,children:rq(p.label)})]}):null]})]})}function sq(e,t,n){e.nativeEvent.isComposing||(e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n()),e.key===`Enter`&&e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),t()))}function cq({text:e,disabled:t=!1,onSave:n,onCancel:r}){let[i,a]=(0,m.useState)(e),[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(``),u=(0,m.useRef)(null);(0,m.useEffect)(()=>{u.current?.focus({preventScroll:!0}),u.current?.select()},[]);let d=async()=>{if(!(t||o||!i.trim())){s(!0),l(``);try{await n(i.trim()),r()}catch(e){l(e instanceof Error?e.message:String(e)),s(!1)}}};return(0,L.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,onKeyDown:e=>sq(e,()=>void d(),()=>{o||r()}),children:[(0,L.jsxs)(`label`,{className:`text-sm`,children:[`Edit message`,(0,L.jsx)(OO,{ref:u,value:i,onChange:e=>a(e.target.value),disabled:o,className:`mt-2 max-h-[40vh] min-h-24`})]}),c?(0,L.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Could not save. `,c]}):null,(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(J,{size:`sm`,onClick:()=>void d(),disabled:t||o||!i.trim(),children:o?`Saving…`:`Save`}),(0,L.jsx)(J,{size:`sm`,variant:`ghost`,disabled:o,onClick:r,children:`Cancel`})]})]})}var lq=1200;function uq({question:e}){let[t,n]=(0,m.useState)(),r=vD(t!==void 0,_D.sheet),i=e.options.flatMap((e,t)=>e.mockup?[{option:e,index:t,mockup:e.mockup}]:[]);if(i.length===0)return null;let a=e.options.map(e=>({label:e.label,description:e.description,...e.mockup?{htmlPreview:e.mockup}:{}}));return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`ul`,{"aria-label":`Mockups`,className:`grid grid-cols-2 gap-2 sm:grid-cols-3`,children:i.map(({option:e,index:t,mockup:r})=>(0,L.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,L.jsx)(eq,{preview:r,label:rq(e.label),frameWidth:lq,onOpen:()=>n(t),className:`aspect-[3/2] h-auto`}),(0,L.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[(0,L.jsxs)(`span`,{className:`tabular-nums`,children:[t+1,`.`]}),` `,rq(e.label)]})]},t))}),(0,L.jsx)(uD,{open:t!==void 0&&r,onOpenChange:e=>{e||n(void 0)},label:`Mockups: ${e.text}`,className:`h-[min(92svh,60rem)] max-h-[min(92svh,60rem)] max-w-6xl`,children:t===void 0?null:(0,L.jsx)(oq,{options:a,start:t,title:e.text,onClose:()=>n(void 0)})})]})}function dq({questions:e}){return(0,L.jsx)(`ol`,{className:`mt-1 flex flex-col gap-2`,children:e.map((e,t)=>(0,L.jsxs)(`li`,{className:`card-raised flex flex-col gap-2 rounded-xl border p-3 text-sm`,style:{"--orb":KB(e.from)},children:[(0,L.jsxs)(`p`,{className:`flex items-start gap-2`,children:[(0,L.jsxs)(`span`,{className:`mt-px inline-flex shrink-0 items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--orb)_12%,transparent)] px-2 py-0.5 text-xs font-medium text-[color-mix(in_oklab,var(--orb)_85%,var(--foreground))]`,children:[(0,L.jsx)(VB,{source:e.from,className:`size-3`}),UB(e.from)]}),(0,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsxs)(`span`,{className:`sr-only`,children:[`Question `,t+1,`: `]}),e.text]})]}),e.options.length?(0,L.jsx)(`ul`,{"aria-label":`Options`,className:`flex flex-wrap gap-1.5`,children:e.options.map(e=>(0,L.jsxs)(`li`,{className:`rounded-lg border border-border bg-muted/60 px-2 py-1 text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`font-medium text-foreground`,children:e.label}),e.description?` — ${e.description}`:``]},e.label))}):null,(0,L.jsx)(uq,{question:e})]},t))})}function fq({message:e}){let t=e.decided??[];return t.length?(0,L.jsx)(`ul`,{className:`mt-1 flex flex-col gap-1.5`,children:t.map((e,t)=>(0,L.jsxs)(`li`,{className:`flex items-start gap-2 rounded-lg bg-muted/60 px-2.5 py-1.5 text-sm`,children:[(0,L.jsx)(Op,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-success`}),(0,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:q(`font-medium`,WB(e.from)),children:UB(e.from)}),` `,e.question,` → `,(0,L.jsx)(`strong`,{children:e.answer}),(0,L.jsxs)(`span`,{className:`block text-xs text-muted-foreground`,children:[`decided by the classifier (`,e.probability.toFixed(2),`); comment on the plan to overrule`]})]})]},t))}):null}function pq({message:e,index:t,busy:n}){let[r,i]=(0,m.useState)(!1),[a,o]=(0,m.useState)(),s=a&&(a.editedAt??0)>(e.editedAt??0)?a:e,c=n||s!==e,l=async n=>{let r=await Kf(`planner.editMessage`,{messageIndex:t,at:e.at,text:n});o(r.message)},u=!e.settled?.length&&!r?(0,L.jsxs)(J,{size:`xs`,variant:`ghost`,disabled:c,onClick:()=>i(!0),className:`text-muted-foreground`,children:[(0,L.jsx)(Sh,{"aria-hidden":`true`}),`Edit`]}):null;return(0,L.jsx)(jH,{time:e.at>0?AO(e.at):void 0,head:!0,note:s.editedAt?`(edited)`:void 0,below:u,children:r?(0,L.jsx)(cq,{text:s.text,disabled:n,onSave:l,onCancel:()=>i(!1)}):(0,L.jsx)(XR,{text:s.text})})}function mq({message:e,index:t,busy:n}){if(e.role===`you`)return(0,L.jsx)(pq,{message:e,index:t,busy:n});let r=e.questions??[];return(0,L.jsxs)(AH,{source:`PLANNER`,name:`Panel`,time:e.at>0?AO(e.at):void 0,head:!0,bubble:r.length===0,aside:r.length?`${r.length} question${r.length===1?``:`s`}`:void 0,children:[r.length>0?(0,L.jsx)(dq,{questions:r}):(0,L.jsx)(XR,{text:e.text}),(0,L.jsx)(fq,{message:e})]})}function hq({messages:e,seed:t,busy:n=!1}){return(0,L.jsxs)(`div`,{className:`chat-column`,role:`log`,"aria-label":`Panel conversation`,children:[t?(0,L.jsx)(MH,{children:t}):null,e.map((e,t)=>(0,L.jsx)(mq,{message:e,index:t,busy:n},`${e.at}-${t}`)),n?(0,L.jsx)(AH,{source:`PLANNER`,name:`Panel`,head:!0,live:!0,aside:`the panel is thinking`,children:(0,L.jsx)(NH,{className:`mt-1`})}):null]})}var gq=`ORACLE`,_q=`No draft yet.`,vq=`The draft appears after the panel's first round.`,yq=`What each seat needs`,bq=[`backend`,`designer`,`qa`,`researcher`],xq={backend:`DEV`,designer:`DESIGN`,qa:`QA`,researcher:`RESEARCH`},Sq=`Describe a task in the box below. The panel asks what it needs to know, round by round, until the plan is clear.`,Cq={ORACLE:`Chairs the panel, and settles the last round alone.`,DEV:`Code, data and the APIs it touches.`,DESIGN:`Screens, flows and the words on them.`,QA:`Tests, edge cases and what could break.`,RESEARCH:`Prior art, docs and sources.`},wq=[{title:`Describe it`,text:`Say what you want in the box below.`},{title:`The panel asks`,text:`Each seat asks what it needs to know.`},{title:`A draft forms`,text:`Answer, comment on lines, go another round.`},{title:`Save the plan`,text:`Keep it, or start it as a task.`}];function Tq(e){let t=e.filter(e=>e.member);return`${t.filter(e=>e.seated).length} of ${t.length} seated`}function Eq(e,t=0){return t<=0?`round ${e}`:e>t?`round ${e} · past the limit, revising`:e===t?`final round ${e}/${t}`:`round ${e}/${t}`}function Dq(e,t){return`${e} ${t}${e===1?``:`s`}`}function Oq(e){return e.round===0&&e.messages.length===0&&!e.busy}function kq(e){let t=e.members.find(e=>e.status===`failed`);if(t)return(t.error??`${xq[t.member]} failed`).split(`
|
|
94
|
-
`)[0]}function
|
|
95
|
-
`).map(e=>{let n=e.trimStart().startsWith("```");return n&&(t=!t),{text:e,fenced:t||n}})}function Pq({notes:e}){return(0,L.jsx)(L.Fragment,{children:e.map((e,t)=>(0,L.jsx)(`p`,{className:`ml-6 rounded-lg border border-primary/15 bg-accent px-3 py-1.5 text-sm text-foreground italic`,children:e},t))})}function Fq({row:e,notes:t,onComment:n}){let r=e.text.trim(),i=()=>n(r);return(0,L.jsxs)(`li`,{className:`group/line`,children:[(0,L.jsxs)(`div`,{className:`flex items-start gap-1`,children:[(0,L.jsx)(`span`,{className:`flex w-4 shrink-0 justify-center pt-3.5`,"aria-hidden":`true`,children:t.length>0?(0,L.jsx)(`span`,{className:`size-2 rounded-full bg-primary`}):null}),(0,L.jsx)(`div`,{className:q(`min-w-0 flex-1 cursor-pointer rounded-lg px-2 py-1.5 transition-colors hover:bg-muted`,e.fenced&&`font-mono text-sm whitespace-pre-wrap break-words`),onClick:e=>!e.target.closest(`a`)&&i(),children:e.fenced?e.text:(0,L.jsx)(XR,{text:e.text})}),(0,L.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/line:opacity-100 focus-visible:opacity-100 [@media(hover:none)]:opacity-100`,"aria-label":`Comment on this line: ${r}`,onClick:i,children:(0,L.jsx)(Km,{"aria-hidden":`true`})})]}),(0,L.jsx)(Pq,{notes:t})]})}function Iq({draft:e,comments:t,onComment:n}){return(0,L.jsx)(`ul`,{className:`flex flex-col`,"aria-label":`Draft plan lines`,children:Nq(e).map((e,r)=>e.text.trim()?(0,L.jsx)(Fq,{row:e,notes:t.get(e.text.trim())??[],onComment:n},r):(0,L.jsx)(`li`,{"aria-hidden":`true`,className:`h-2`},r))})}function Lq({notes:e}){return e.length===0?null:(0,L.jsx)($R,{title:yq,children:(0,L.jsx)(`dl`,{className:`flex flex-col gap-2 text-sm`,children:e.map((e,t)=>(0,L.jsxs)(`div`,{className:`flex gap-3`,children:[(0,L.jsx)(`dt`,{className:q(`w-20 shrink-0 font-medium`,WB(e.from)),children:UB(e.from)}),(0,L.jsx)(`dd`,{className:`min-w-0 flex-1`,children:(0,L.jsx)(XR,{text:e.text})})]},t))})})}function Rq({cell:e,intro:t}){let n=t?e.member?e.seated?`seated`:`not seated`:`chairs`:e.text;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`span`,{className:q(`inline-flex items-center gap-1.5 font-medium`,e.seated?WB(e.label):`text-muted-foreground`),children:[(0,L.jsx)(VB,{source:e.label,className:`size-3.5`}),UB(e.label)]}),e.working&&!t?(0,L.jsx)(FD,{className:`size-3.5`,"aria-hidden":`true`}):null,(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:n})]})}function zq({cell:e,intro:t,onToggled:n}){let{member:r}=e,i=`inline-flex min-h-8 items-center gap-2 rounded-lg border border-border px-3 text-[0.8125rem]`;if(!r)return(0,L.jsx)(`li`,{className:q(i,`bg-muted`),children:(0,L.jsx)(Rq,{cell:e,intro:t})});let a=async()=>{await H(`planner.toggleSeat`,{member:r})&&n()};return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`label`,{className:q(i,`cursor-pointer transition-colors`,e.seated?`btn-raised bg-card`:`border-dashed text-muted-foreground hover:bg-muted`),children:[(0,L.jsx)(lV,{checked:e.seated,onCheckedChange:()=>void a(),"aria-label":`${UB(e.label)} sits on the panel`}),(0,L.jsx)(Rq,{cell:e,intro:t})]})})}function Bq({cells:e,intro:t,onToggled:n}){return(0,L.jsx)(`ul`,{"aria-label":`Panel`,className:`flex flex-wrap gap-2`,children:e.map(e=>(0,L.jsx)(zq,{cell:e,intro:t,onToggled:n},e.label))})}function Vq({cell:e,onToggled:t}){let{member:n}=e,r=UB(e.label),i=q(`flex h-full flex-col gap-2 rounded-xl border p-3.5 transition-[background-color,border-color,box-shadow]`,e.seated?`border-[color-mix(in_oklab,var(--orb)_26%,var(--border))] bg-[color-mix(in_oklab,var(--orb)_5%,var(--card))] shadow-card`:`border-dashed border-input bg-transparent`),a=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:q(`grid size-6 place-items-center rounded-lg bg-[color-mix(in_oklab,var(--orb)_14%,transparent)] text-[color-mix(in_oklab,var(--orb)_85%,var(--foreground))]`,!e.seated&&`opacity-50 grayscale`),children:(0,L.jsx)(VB,{source:e.label,className:`size-3.5`})}),(0,L.jsx)(`span`,{className:q(`truncate text-sm font-semibold`,e.seated?WB(e.label):`text-muted-foreground`),children:r})]}),n?(0,L.jsx)(lV,{checked:e.seated,onCheckedChange:()=>void Hq(n,t),"aria-label":`${r} sits on the panel`}):null]}),(0,L.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:Cq[e.label]}),(0,L.jsx)(`span`,{className:q(`mt-auto text-xs font-medium`,e.seated?`text-foreground`:`text-muted-foreground`),children:n?e.seated?`seated`:`sits this one out`:`always chairs`})]}),o={"--orb":KB(e.label)};return n?(0,L.jsx)(`li`,{style:o,children:(0,L.jsx)(`label`,{className:q(i,`cursor-pointer`,e.seated?`hover:shadow-[0_0_0_3px_color-mix(in_oklab,var(--orb)_10%,transparent)]`:`hover:bg-muted`),children:a})}):(0,L.jsx)(`li`,{style:o,children:(0,L.jsx)(`div`,{className:i,children:a})})}async function Hq(e,t){await H(`planner.toggleSeat`,{member:e})&&t()}function Uq({cells:e,onToggled:t}){return(0,L.jsx)(`ul`,{"aria-label":`Panel`,className:`grid grid-cols-1 gap-3 @lg:grid-cols-2 @4xl:grid-cols-5`,children:e.map(e=>(0,L.jsx)(Vq,{cell:e,onToggled:t},e.label))})}function Wq({snap:e}){let t=Aq(e),n=!e.busy&&kq(e)!==void 0;return(0,L.jsxs)(`p`,{role:`status`,className:n?`flex items-center gap-2 text-sm text-destructive`:`flex items-center gap-2 text-sm text-muted-foreground`,children:[e.busy?(0,L.jsx)(FD,{className:`size-3.5`,"aria-hidden":`true`}):null,t.join(` · `)]})}function Gq({snap:e,onDone:t}){let n=VD(`status`).data?.keys.find(e=>e.action===`savePlan`)?.label,r=e=>async()=>{await H(e,{})&&t()};return(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[e.questions.length>0&&!e.busy?(0,L.jsx)(Y,{label:`Answer questions`,icon:Wm,tone:`primary`,shortcut:`A`,onClick:()=>void r(`planner.answer`)()}):null,e.retryable?(0,L.jsx)(Y,{label:`Retry`,icon:Mh,shortcut:`R`,onClick:()=>void r(`planner.retry`)()}):null,(0,L.jsx)(Y,{"data-plan-save":!0,label:`Save the plan`,text:`Save`,icon:Ih,shortcut:n??`Ctrl+S`,disabled:!e.draft||e.busy,onClick:()=>void r(`planner.save`)()}),(0,L.jsx)(WO,{icon:vm,label:`New plan`,shortcut:`N`,title:`Start a new plan?`,description:`The conversation and the draft are left behind. Saved plans are not touched.`,confirmLabel:`New plan`,onConfirm:()=>void H(`planner.new`,{}).then(t)})]})}function Kq({snap:e,onDone:t}){return(0,L.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-3 border-b border-border px-5 py-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:`Planning`}),(0,L.jsx)(Wq,{snap:e})]}),(0,L.jsx)(Gq,{snap:e,onDone:t})]}),(0,L.jsx)(Bq,{cells:Mq(e),intro:!1,onToggled:t})]})}function qq({line:e,onClose:t,onSent:n}){let r=vD(e!==void 0,_D.confirm);return(0,L.jsx)(uD,{open:e!==void 0&&r,onOpenChange:e=>!e&&t(),label:`Comment on this line`,className:`max-w-xl`,children:(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 p-6`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{className:`text-base font-medium`,children:`Comment on this line`}),(0,L.jsx)(`p`,{className:`mt-1 line-clamp-3 text-sm break-words text-muted-foreground`,children:e})]}),(0,L.jsx)(Xz,{label:`Your comment`,hint:`Enter adds the comment · Esc cancels`,buttonLabel:`Add comment`,onSend:async r=>e===void 0||!await H(`planner.commentLine`,{line:e,text:r.trim()})?!1:(n(e,r.trim()),t(),!0)})]})})}function Jq({limit:e}){return e<=0?null:(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`flex gap-1`,children:Array.from({length:e},(t,n)=>(0,L.jsx)(`span`,{className:q(`h-1.5 w-4 rounded-full`,n===e-1?`bg-primary`:`bg-border`)},n))}),(0,L.jsxs)(`span`,{children:[`up to `,e,` rounds, the last the oracle's`]})]})}function Yq({snap:e,onDone:t}){let n=Mq(e);return(0,L.jsx)(`div`,{className:`@container flex-1 overflow-y-auto px-5 pt-8 pb-dock sm:px-8 sm:pt-10`,children:(0,L.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-8`,children:[(0,L.jsxs)(`header`,{className:`flex flex-col gap-4 @3xl:flex-row @3xl:items-end @3xl:justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`card-raised grid size-11 shrink-0 place-items-center rounded-xl border text-primary`,children:(0,L.jsx)(Ph,{className:`size-5`})}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Plan with the panel`}),(0,L.jsx)(`p`,{className:`max-w-xl text-sm leading-relaxed text-muted-foreground`,children:Sq})]})]}),(0,L.jsx)(Jq,{limit:e.limit})]}),(0,L.jsxs)(`section`,{"aria-labelledby":`plan-panel`,className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h3`,{id:`plan-panel`,className:`text-xs text-muted-foreground`,children:(0,L.jsx)(QR,{title:`The panel`,right:Tq(n)})}),(0,L.jsx)(Uq,{cells:n,onToggled:t})]}),(0,L.jsxs)(`section`,{"aria-labelledby":`plan-steps`,className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h3`,{id:`plan-steps`,className:`text-xs text-muted-foreground`,children:(0,L.jsx)(QR,{title:`How a plan comes together`})}),(0,L.jsx)(`ol`,{className:`grid gap-3 @2xl:grid-cols-2 @4xl:grid-cols-4`,children:wq.map((e,t)=>(0,L.jsxs)(`li`,{className:`card-raised relative flex gap-3 rounded-xl border p-3.5`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-6 shrink-0 place-items-center rounded-full bg-accent text-xs font-semibold text-primary tabular-nums`,children:t+1}),(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(`span`,{className:`text-sm font-medium`,children:e.title}),(0,L.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:e.text})]})]},e.title))})]}),(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(mp,{"aria-hidden":`true`,className:`size-4 text-primary motion-safe:animate-bounce`}),`Start in the box below.`,(0,L.jsx)(lD,{chord:`/`,children:`write`}),(0,L.jsx)(lD,{chord:`Enter`,children:`send to the panel`})]})]})})}function Xq({snap:e,wide:t}){let{ref:n,onScroll:r}=TH(JSON.stringify(e.messages));return(0,L.jsxs)(CO,{className:`flex flex-col`,children:[(0,L.jsx)(`h2`,{className:`flex min-h-12 shrink-0 items-center border-b border-border px-4 text-sm font-medium`,children:(0,L.jsx)(QR,{title:`Conversation`,className:`w-full`})}),(0,L.jsx)(`div`,{ref:n,onScroll:r,className:q(`min-h-0 overflow-y-auto overscroll-y-contain`,t?`flex-1 px-5 pt-5 pb-dock`:`max-h-[45svh] p-5`),children:(0,L.jsx)(hq,{messages:e.messages,busy:e.busy})})]})}function Zq({snap:e,comments:t,onComment:n,wide:r}){return(0,L.jsxs)(CO,{className:`flex flex-col`,children:[(0,L.jsx)(`h2`,{className:`flex min-h-12 shrink-0 items-center border-b border-border px-4 text-sm font-medium`,children:(0,L.jsx)(QR,{title:`Draft plan`,className:`w-full`})}),(0,L.jsxs)(`div`,{className:q(`flex min-h-0 flex-col gap-5 overflow-y-auto overscroll-y-contain px-5 pt-5 pb-dock`,r&&`flex-1`),children:[e.draft?(0,L.jsx)(Iq,{draft:e.draft,comments:t,onComment:n}):(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.busy?vq:_q}),(0,L.jsx)(Lq,{notes:e.notes})]})]})}function Qq({snap:e,reload:t}){let n=SO(),[r,i]=(0,m.useState)(),[a,o]=(0,m.useState)(new Map);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Kq,{snap:e,onDone:t}),(0,L.jsxs)(`div`,{className:n?`grid min-h-0 flex-1 grid-cols-[minmax(0,46fr)_minmax(0,54fr)] grid-rows-[minmax(0,1fr)] divide-x divide-border`:`flex flex-col divide-y divide-border`,children:[(0,L.jsx)(Xq,{snap:e,wide:n}),(0,L.jsx)(Zq,{snap:e,comments:a,onComment:i,wide:n})]}),(0,L.jsx)(qq,{line:r,onClose:()=>i(void 0),onSent:(e,t)=>o(n=>new Map(n).set(e,[...n.get(e)??[],t]))})]})}function $q(){let e=UD(`planner.get`,{},[`planner`]),t=e.data;if(!t&&e.error)return(0,L.jsx)(LD,{message:`Could not load the plan. ${e.error}`,onRetry:e.reload});if(!t)return(0,L.jsx)(`p`,{role:`status`,className:`p-5 text-sm text-muted-foreground`,children:`Loading the plan…`});let n=Oq(t);return(0,L.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:n?(0,L.jsx)(Yq,{snap:t,onDone:e.reload}):(0,L.jsx)(Qq,{snap:t,reload:e.reload})})}var eJ=`Describe a small change in the box below and one agent makes it now, beside any running task.`;function tJ(e){return e.prompt.split(`
|
|
96
|
-
`).find(e=>e.trim())?.trim()??`(empty)`}function
|
|
97
|
-
`)?(0,L.jsx)(XR,{text:e.prompt}):null,(0,L.jsx)(sJ,{job:e}),(0,L.jsx)($R,{title:`Steps`,children:(0,L.jsx)(cJ,{job:e})}),e.files?.length?(0,L.jsx)($R,{title:`Edited`,children:(0,L.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.files.map(e=>(0,L.jsxs)(`li`,{className:`break-all`,children:[`· `,e]},e))})}):null,e.error?(0,L.jsx)(`p`,{className:`rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:e.error}):null,e.report?(0,L.jsx)($R,{title:`Report`,children:(0,L.jsx)(XR,{text:e.report})}):null]})}function dJ({status:e}){if(e===`running`)return(0,L.jsx)(FD,{className:`size-3.5`,"aria-label":`running`});let t={queued:nm,success:Op,failed:bg,timeout:bg,cancelled:nh,held:mh,running:nm}[e];return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(t,{"aria-hidden":`true`,className:`size-4 ${e===`success`?`text-success`:e===`failed`||e===`timeout`?`text-destructive`:e===`held`?`text-warning`:`text-muted-foreground`}`}),(0,L.jsx)(`span`,{className:`sr-only`,children:e})]})}function fJ({job:e,selected:t,now:n,onSelect:r}){let i=iJ(e,n);return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>r(e.id),className:q(Rz,`flex-row items-start gap-2.5 text-sm`),children:[(0,L.jsx)(`span`,{className:`flex h-5 w-4 shrink-0 items-center justify-center`,children:(0,L.jsx)(dJ,{status:e.status})}),(0,L.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words`,t?`font-medium text-foreground`:`text-foreground`),children:tJ(e)}),i?(0,L.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:i}):null]})})}function pJ({jobs:e,selectedId:t,now:n,onSelect:r}){return(0,L.jsx)(`ul`,{className:zz,children:e.map(e=>(0,L.jsx)(fJ,{job:e,selected:e.id===t,now:n,onSelect:r},e.id))})}var mJ=()=>DD(ED(`quickfix`)),hJ=e=>DD(ED(`quickfix`,e));function gJ(e){let[t,n]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{if(!e)return;let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),e?t:Date.now()}function _J(){return(0,L.jsx)(kD,{className:`m-4 flex-1`,children:(0,L.jsxs)(AD,{children:[(0,L.jsx)(MD,{variant:`icon`,children:(0,L.jsx)(Sg,{"aria-hidden":`true`})}),(0,L.jsx)(PD,{className:`font-medium text-foreground`,children:eJ})]})})}function vJ({id:e}){let t=SO(),n=UD(`quickfix.list`,{},[`quickfix`]),r=nJ(n.data?.jobs??[]),i=gJ(r.some(e=>e.status===`running`));if(!n.data&&n.error)return(0,L.jsx)(LD,{message:`Could not load quick fixes. ${n.error}`,onRetry:n.reload});let a=n.data&&r.length===0?(0,L.jsx)(_J,{}):(0,L.jsx)(yJ,{id:e,wide:t,loaded:!!n.data,jobs:r,now:i});return(0,L.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:a})}function yJ({id:e,wide:t,loaded:n,jobs:r,now:i}){let a=e??(t?r[0]?.id:void 0),o=r.find(e=>e.id===a),s=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(EO,{title:`Quick fixes`,count:String(r.length)}),n?(0,L.jsx)(pJ,{jobs:r,selectedId:a,now:i,onSelect:hJ}):(0,L.jsx)(DO,{})]});return(0,L.jsx)(TO,{wide:t,list:s,detail:o?(0,L.jsx)(uJ,{job:o,now:i}):e?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That quick fix is not on the list any more.`}):null,open:!!e,onClose:mJ,hint:`Select a quick fix to see its steps.`,describe:`Quick fix detail`})}var bJ={},xJ=new Set;function SJ(e){bJ=e;for(let e of[...xJ])e()}function CJ(e){bJ.taskId!==e&&SJ({...bJ,taskId:e})}function wJ(e){(bJ.session?.name!==e?.name||JSON.stringify(bJ.session?.address)!==JSON.stringify(e?.address))&&SJ({...bJ,session:e})}function TJ(e){return xJ.add(e),()=>{xJ.delete(e)}}function EJ(){return(0,m.useSyncExternalStore)(TJ,()=>bJ,()=>bJ)}function DJ({entry:e}){let t=e.at?AO(e.at):``;return e.role===`note`?(0,L.jsxs)(`li`,{className:`text-center text-xs text-muted-foreground`,children:[e.text,t?` · ${t}`:``]}):e.role===`you`?(0,L.jsxs)(`li`,{className:`flex flex-col items-end gap-1`,children:[(0,L.jsxs)(`span`,{className:`flex items-baseline gap-2 text-xs text-muted-foreground`,children:[t,` `,(0,L.jsx)(`span`,{className:`font-medium text-foreground`,children:`You`})]}),(0,L.jsx)(`div`,{className:`max-w-[85%] rounded-xl rounded-tr-sm border border-primary/10 bg-you px-3.5 py-2`,children:(0,L.jsx)(XR,{text:e.text})})]}):(0,L.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 rounded-full bg-primary`}),(0,L.jsx)(`span`,{className:`font-medium text-foreground`,children:`Oracle`}),` `,t]}),(0,L.jsx)(`div`,{className:`max-w-[90%] pl-4`,children:(0,L.jsx)(XR,{text:e.text})})]})}function OJ({entries:e,more:t,loading:n,onMore:r,empty:i}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[t?(0,L.jsx)(`div`,{className:`flex self-center`,children:(0,L.jsx)(Y,{label:`Load earlier messages`,icon:Rp,disabled:n,onClick:r??(()=>void 0)})}):null,e.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i}):(0,L.jsx)(`ol`,{"aria-label":`Conversation`,className:`flex flex-col gap-4`,children:e.map(e=>(0,L.jsx)(DJ,{entry:e},e.id))})]})}function kJ({address:e,empty:t}){let n=UD(`sessions.chat`,e,[`sessions`]),[r,i]=(0,m.useState)(),[a,o]=(0,m.useState)(!1),s=n.data?.entries??[],c=new Set(s.map(e=>e.id)),l=[...(r?.entries??[]).filter(e=>!c.has(e.id)),...s],u=async()=>{let t=l[0];if(!t)return;o(!0);let n=await H(`sessions.chat`,{...e,before:t.id});n&&i({entries:[...n.entries,...r?.entries??[]],more:n.hasOlder}),o(!1)},d=r?.more??n.data?.hasOlder??!1;return(0,L.jsx)(OJ,{entries:l,more:d,loading:a,onMore:()=>void u(),empty:n.loading&&!n.data?`Loading the conversation…`:t})}var AJ={"this window":`This window`,background:`Background`,"other terminal":`Other terminals`},jJ=[`this window`,`background`,`other terminal`],MJ=`Nothing said yet.`,NJ=`This session runs in another terminal: its conversation shows here and your messages reach its oracle within seconds, but live activity only streams from sessions started in this window.`,PJ=`No other sessions. Start one below.`;function FJ(e,t,n){let r=t?.task;return{id:`here`,where:`this window`,name:e?.sessionName??r?.title??`unnamed session`,status:e?.busy?`working`:r?.state??`no task`,waiting:n,alive:!0,dialogs:[],...r?{task:r}:{}}}function IJ(e){let t=e.status===`exited`?`ended`:e.status===`starting`?`starting`:e.busy?`working`:`idle`;return{id:e.key,where:`background`,name:e.name,status:t,waiting:e.dialogs.length,key:e.key,alive:e.alive,dialogs:e.dialogs,...e.sessionId?{sessionId:e.sessionId}:{}}}function LJ(e){return{id:e.sessionId,where:`other terminal`,name:e.name??`unnamed session`,status:`running`,waiting:0,pid:e.pid,sessionId:e.sessionId,alive:!0,dialogs:[]}}function RJ(e,t,n,r,i){let a=new Set([e?.sessionId,...r.map(e=>e.sessionId)].filter(e=>!!e)),o=i.filter(e=>!a.has(e.sessionId));return[FJ(e,t,n),...r.map(IJ),...o.map(LJ)]}function zJ(e){return`${e} question${e===1?``:`s`} waiting for you`}function BJ(e){return e.status===`starting`?`starting ${e.name}…`:e.alive?`${e.name} has not said anything yet.`:`${e.name} has ended.`}function VJ(e){return[e.where,e.status.replace(/_/g,` `),e.pid?`pid ${e.pid}`:``].filter(Boolean).join(` · `)}function HJ(e){return e.key?{key:e.key}:e.sessionId?{sessionId:e.sessionId}:void 0}function UJ({options:e,send:t}){return(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,L.jsx)(J,{variant:`outline`,onClick:()=>void t({value:e}),children:e},e))})}function WJ({dialog:e,send:t}){let n=(0,m.useId)(),[r,i]=(0,m.useState)(e.prefill??``);return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`label`,{htmlFor:n,className:`sr-only`,children:e.title}),(0,L.jsx)(OO,{id:n,rows:e.method===`editor`?4:2,value:r,placeholder:e.placeholder,onChange:e=>i(e.target.value)}),(0,L.jsx)(`div`,{className:`flex self-end`,children:(0,L.jsx)(Y,{label:`Send the answer`,text:`Send`,icon:bp,tone:`primary`,disabled:!r.trim(),onClick:()=>void t({value:r.trim()})})})]})}function GJ({dialog:e,send:t}){return e.method===`select`?(0,L.jsx)(UJ,{options:e.options??[],send:t}):e.method===`confirm`?(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(J,{onClick:()=>void t({confirmed:!0}),children:`Yes`}),(0,L.jsx)(J,{variant:`outline`,onClick:()=>void t({confirmed:!1}),children:`No`})]}):(0,L.jsx)(WJ,{dialog:e,send:t})}function KJ({sessionKey:e,dialog:t,onAnswered:n}){let r=async r=>{await H(`sessions.answer`,{key:e,dialogId:t.id,answer:r})&&n()};return(0,L.jsxs)(`div`,{className:`card-raised flex flex-col gap-3 rounded-lg border p-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:t.title}),t.message?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t.message}):null]}),(0,L.jsx)(GJ,{dialog:t,send:r}),(0,L.jsx)(`div`,{className:`flex self-start`,children:(0,L.jsx)(Y,{label:`Put it away`,text:`Put away`,icon:bg,onClick:()=>void r({cancelled:!0})})})]})}function qJ({sessionKey:e,dialogs:t,onAnswered:n}){return t.length===0?null:(0,L.jsxs)(`section`,{"aria-label":`Questions waiting`,className:`flex flex-col gap-2`,children:[(0,L.jsx)(`p`,{role:`status`,className:`text-sm font-medium text-foreground`,children:zJ(t.length)}),t.map(t=>(0,L.jsx)(KJ,{sessionKey:e,dialog:t,onAnswered:n},t.id))]})}var JJ={"this window":ih,background:Mm,"other terminal":Kh};function YJ({where:e,className:t}){let n=JJ[e];return(0,L.jsx)(n,{"aria-hidden":`true`,className:q(`size-4 shrink-0 text-muted-foreground`,t)})}function XJ({task:e}){let t=e.progress;return(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`break-all`,children:e.id}),t&&t.total>0?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(rU,{done:t.done,total:t.total}),(0,L.jsxs)(`span`,{className:`tabular-nums`,children:[t.done,`/`,t.total]})]}):null]})}function ZJ({entry:e}){let{key:t}=e;return e.where===`this window`?(0,L.jsx)(pO,{children:(0,L.jsx)(Y,{label:`Back to this window`,text:`Back to the Lobby`,icon:gp,tone:`primary`,shortcut:`B`,onClick:()=>DD(`#/lobby`)})}):t?(0,L.jsxs)(pO,{children:[(0,L.jsx)(Y,{label:`Move here`,icon:vp,tone:`primary`,shortcut:`M`,onClick:()=>void H(`sessions.switch`,{key:t})}),(0,L.jsx)(WO,{icon:Xp,label:`Stop the session`,text:`Stop`,shortcut:`S`,title:`Stop ${e.name}?`,description:`Its process ends. The task keeps its state and can be resumed in this window.`,confirmLabel:`Stop session`,variant:`destructive`,disabled:!e.alive,onConfirm:()=>void H(`sessions.stop`,{key:t})})]}):null}function QJ({entry:e,lobby:t}){let n=HJ(e);return e.where===`this window`?(0,L.jsx)(OJ,{entries:t?.chat??[],more:!1,empty:MJ}):n?(0,L.jsx)(kJ,{address:n,empty:e.where===`other terminal`?`Nothing said in this session yet.`:BJ(e)},e.id):(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:MJ})}function $J({entry:e,lobby:t,onChanged:n}){return(0,L.jsxs)(`article`,{"aria-label":`Session detail`,className:`flex flex-col gap-4`,children:[(0,L.jsx)(ZJ,{entry:e}),(0,L.jsxs)(`header`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsxs)(`h3`,{className:`flex items-center gap-2.5 text-lg font-semibold tracking-tight text-foreground`,children:[(0,L.jsx)(YJ,{where:e.where,className:`size-[1.1rem]`}),e.name]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:VJ(e)}),e.task?(0,L.jsx)(XJ,{task:e.task}):null,e.where!==`background`&&e.waiting>0?(0,L.jsx)(`p`,{className:`text-sm text-foreground`,children:zJ(e.waiting)}):null]}),e.where===`other terminal`?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:NJ}):null,e.key?(0,L.jsx)(qJ,{sessionKey:e.key,dialogs:e.dialogs,onAnswered:n}):null,(0,L.jsx)($R,{title:`Conversation`,children:(0,L.jsx)(QJ,{entry:e,lobby:t})})]})}function eY({entry:e,selected:t,onSelect:n}){return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(e.id),className:q(Rz,`flex-row items-start gap-2.5 text-sm`),children:[(0,L.jsx)(YJ,{where:e.where,className:`mt-0.5`}),(0,L.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.name}),(0,L.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[e.status===`working`||e.status===`starting`?(0,L.jsx)(FD,{className:`size-3`,"aria-hidden":`true`}):null,e.status.replace(/_/g,` `),e.waiting>0?(0,L.jsx)(`span`,{className:`rounded-md bg-warning/15 px-1.5 py-0.5 font-medium text-warning tabular-nums`,children:e.waiting}):null]})]})})}function tY({where:e,entries:t,selectedId:n,onSelect:r}){return(0,L.jsxs)(`section`,{"aria-label":AJ[e],className:`flex flex-col`,children:[(0,L.jsx)(`h3`,{className:Bz,children:(0,L.jsx)(QR,{title:AJ[e],right:String(t.length),className:`[&>span:first-child]:font-medium [&>span:first-child]:text-muted-foreground`})}),(0,L.jsx)(`ul`,{className:zz,children:t.map(e=>(0,L.jsx)(eY,{entry:e,selected:e.id===n,onSelect:r},e.id))})]})}function nY({entries:e,selectedId:t,onSelect:n}){return(0,L.jsx)(`div`,{className:`flex flex-col pb-2`,children:jJ.map(r=>{let i=e.filter(e=>e.where===r);return i.length>0?(0,L.jsx)(tY,{where:r,entries:i,selectedId:t,onSelect:n},r):null})})}var rY=()=>DD(`#/sessions`),iY=e=>DD(`#/sessions/${encodeURIComponent(e)}`);function aY({windows:e}){return e.length===0?null:(0,L.jsx)(`div`,{className:`px-4 pb-4 pt-2`,children:(0,L.jsx)($R,{title:`Other windows`,children:(0,L.jsx)(`ul`,{className:`flex flex-col`,children:e.map(e=>(0,L.jsx)(`li`,{children:(0,L.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`flex min-h-8 items-center rounded-lg px-2.5 text-sm text-foreground underline-offset-4 transition-colors hover:bg-muted hover:underline`,children:e.name})},e.url))})})})}function oY(){return(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That session is not on the list any more.`})}function sY({id:e}){let t=SO(),n=VD(`status`).data,r=VD(`lobby`).data,i=VD(`prompts`).data?.prompts.length??0,a=UD(`sessions.list`,{},[`sessions`]);if(!a.data&&a.error)return(0,L.jsx)(LD,{message:`Could not load sessions. ${a.error}`,onRetry:a.reload});let o=RJ(n,r,i,a.data?.background??[],a.data?.live??[]),s=e??(t?o[0]?.id:void 0),c=o.find(e=>e.id===s),l=c&&c.where!==`this window`&&c.alive?HJ(c):void 0,u=l?JSON.stringify(l):``,d=c?.name;(0,m.useEffect)(()=>(wJ(l&&d?{name:d,address:l}:void 0),()=>wJ(void 0)),[u,d]);let f=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(EO,{title:`Sessions`,count:String(o.length)}),a.data?(0,L.jsx)(nY,{entries:o,selectedId:s,onSelect:iY}):(0,L.jsx)(DO,{}),a.data&&o.length===1?(0,L.jsx)(`p`,{className:`px-4 pb-3 text-sm text-muted-foreground`,children:PJ}):null,(0,L.jsx)(aY,{windows:n?.windows??[]})]}),p=c?(0,L.jsx)($J,{entry:c,lobby:r,onChanged:a.reload},c.id):e?(0,L.jsx)(oY,{}):null;return(0,L.jsx)(TO,{wide:t,list:f,detail:p,open:!!e,onClose:rY,hint:`Select a session to see its conversation.`,describe:`Session detail`})}function cY({timing:e,stopped:t}){let[n,r]=(0,m.useState)(0);return(0,m.useEffect)(()=>{if(r(0),t||e.waiting||!e.runningSince)return;let n=performance.now(),i=window.setInterval(()=>r(performance.now()-n),1e3);return()=>window.clearInterval(i)},[e,t]),(0,L.jsxs)(`span`,{className:`tabular-nums`,children:[e.waiting?`Waiting for you · `:``,e.phase.replaceAll(`_`,` `),` · `,QH(ZH(e,n,t)),` execution`]})}function lY({work:e,timing:t,stopped:n}){let r=e.running&&!n&&!t?.waiting,i=$H(r,e);return(0,L.jsxs)(`span`,{className:`tabular-nums`,"data-work-clock":r?`running`:`stopped`,children:[t?.waiting?`Waiting for you · `:``,t?`${t.phase.replaceAll(`_`,` `)} · `:``,`worked `,QH(e.workedMs+i)]})}function uY({timing:e,work:t,stopped:n=!1}){return t?(0,L.jsx)(lY,{work:t,...e?{timing:e}:{},stopped:n}):e?(0,L.jsx)(cY,{timing:e,stopped:n},JSON.stringify(e)):(0,L.jsx)(`span`,{children:`Timing unavailable`})}var dY=`This directly merges the reviewed commit into main and pushes main. It does not create a pull request.`,fY={pending_approval:`Ready for your review`,deferred:`Saved for later`,in_progress:`Delivery in progress`,successful:`Delivered`,recoverable_failure:`Delivery needs attention`};function pY({delivery:e,title:t}){return(0,L.jsxs)(`div`,{className:`grid gap-2 text-sm`,children:[(0,L.jsx)(`p`,{className:`font-medium break-words`,children:t}),(0,L.jsxs)(`dl`,{className:`grid gap-1 break-all text-muted-foreground`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`dt`,{className:`inline`,children:`Project: `}),(0,L.jsx)(`dd`,{className:`inline`,children:e.project})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`dt`,{className:`inline`,children:`Repository: `}),(0,L.jsx)(`dd`,{className:`inline`,children:e.repository??`Unavailable — refresh review`})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`dt`,{className:`inline`,children:`Source: `}),(0,L.jsxs)(`dd`,{className:`inline`,children:[e.sourceBranch,` · `,e.sourceCommit??`Commit unavailable`]})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`dt`,{className:`inline`,children:`Target: `}),(0,L.jsxs)(`dd`,{className:`inline`,children:[`main`,e.targetCommit?` · ${e.targetCommit}`:``]})]})]}),(0,L.jsxs)(`p`,{children:[`Checks: `,e.verification?.checks??`unavailable`]}),(0,L.jsx)(`p`,{children:e.verification?.summary??`Verification unavailable. Refresh the review before delivery.`}),e.verification?(0,L.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Local completion/QA: `,e.verification.localVerified?`passed`:`not verified`,` · Repository rules: `,e.verification.rulesKnown?`known`:`unavailable`,e.verification.requiredChecks.length?` · Required: ${e.verification.requiredChecks.join(`, `)}`:``]}):null]})}function mY({action:e,delivery:t,busy:n,onAction:r}){let i=t.blocked[e],a=n||t.status===`in_progress`||t.status===`successful`||!!i;return(0,L.jsxs)(`div`,{className:`grid gap-1`,children:[(0,L.jsx)(J,{variant:`outline`,disabled:a,onClick:()=>r(e),children:e===`create_pr`?`Create PR`:`Merge to main`}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e===`create_pr`?`Pushes the task branch and opens a PR targeting main. Does not merge.`:`Directly updates and pushes main. Requires confirmation.`}),i?(0,L.jsxs)(`p`,{className:`text-sm text-destructive`,children:[i,` Refresh review after resolving this restriction, then choose the action again.`]}):null]})}async function hY(e,t,n){let r={taskId:t,reviewId:n};return e===`refresh`?Kf(`tasks.deliveryReview`,{taskId:t}):e===`defer`?Kf(`tasks.deliveryDefer`,r):Kf(`tasks.deliver`,{...r,action:e,...e===`merge_main`?{confirmMain:!0}:{}})}function gY({taskId:e,delivery:t}){let[n,r]=(0,m.useState)(t),[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(),[c,l]=(0,m.useState)(!1),u=(0,m.useRef)(null),d=Vf(),f=`${d}:${e}`,p=(0,m.useRef)(f);return p.current=f,(0,m.useEffect)(()=>(p.current=f,()=>{p.current=``}),[f]),(0,m.useEffect)(()=>{r(t),l(!1)},[t,e]),{current:n,setCurrent:r,busy:i,setBusy:a,error:o,setError:s,confirm:c,setConfirm:l,trigger:u,project:d,identity:f,scope:p}}function _Y(e){return e.scope.current===e.identity&&e.project===Vf()}function vY(e,t){let n=(0,m.useRef)(!1);async function r(r){if(!(n.current||r===`merge_main`&&!e.confirm)){n.current=!0,e.setBusy(!0),e.setError(void 0),e.setConfirm(!1);try{let n=await hY(r,t.taskId,e.current.reviewId);_Y(e)&&(e.setCurrent(n.delivery),t.onChanged())}catch(t){_Y(e)&&e.setError(t instanceof Error?t.message:String(t))}finally{n.current=!1,e.scope.current&&e.setBusy(!1)}}}return r}function yY(e){let t=gY(e),n=vY(t,e),r=vD(t.confirm,_D.confirm),i=t.current.status===`successful`||t.current.status===`in_progress`;function a(){t.trigger.current=document.activeElement,t.setConfirm(!0)}return{...t,request:n,slot:r,terminal:i,reviewMerge:a}}function bY({review:e}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Task completion is recorded separately. Nothing is published without your approval.`}),(0,L.jsx)(`p`,{role:`status`,className:`text-sm`,children:e.busy?`Updating delivery…`:e.current.operation?`Operation: ${e.current.operation.stage}`:fY[e.current.status]}),e.current.error||e.error?(0,L.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[e.error??e.current.error,` Completed work is retained. Refresh review to reconcile the result before retrying.`]}):null,e.current.result?(0,L.jsxs)(`p`,{className:`text-sm break-all`,children:[e.current.result.action===`create_pr`?`PR #${e.current.result.pullNumber??``} created`:`main pushed · ${e.current.result.commit??``}`,e.current.result.pullUrl?(0,L.jsxs)(`span`,{children:[` · `,e.current.result.pullUrl]}):null]}):null]})}function xY({review:e}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[(0,L.jsx)(mY,{action:`create_pr`,delivery:e.current,busy:e.busy,onAction:()=>void e.request(`create_pr`)}),(0,L.jsx)(mY,{action:`merge_main`,delivery:e.current,busy:e.busy,onAction:e.reviewMerge})]}),(0,L.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,L.jsx)(J,{variant:`ghost`,disabled:e.busy,onClick:()=>void e.request(`refresh`),children:`Refresh review`}),(0,L.jsx)(J,{variant:`ghost`,disabled:e.busy||e.terminal,onClick:()=>void e.request(`defer`),children:`Not now`})]})]})}function SY({review:e}){return(0,L.jsx)(uD,{open:e.slot,onOpenChange:e.setConfirm,label:`Confirm merge to main`,description:dY,onCloseAutoFocus:t=>{t.preventDefault(),requestAnimationFrame(()=>e.trigger.current?.focus())},children:(0,L.jsxs)(`div`,{className:`grid gap-4 p-4`,children:[(0,L.jsx)(`h3`,{className:`font-medium`,children:`Merge to main?`}),(0,L.jsx)(`p`,{className:`text-sm`,children:dY}),(0,L.jsxs)(`p`,{className:`break-all text-sm text-muted-foreground`,children:[e.current.repository,` · `,e.current.sourceCommit,` → main`]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,L.jsx)(J,{variant:`outline`,onClick:()=>e.setConfirm(!1),children:`Cancel`}),(0,L.jsx)(J,{disabled:e.busy||!!e.current.blocked.merge_main||e.terminal,onClick:()=>void e.request(`merge_main`),children:`Confirm merge and push main`})]})]})})}function CY({title:e,review:t}){return(0,L.jsxs)($R,{title:`Completed work · delivery review`,right:fY[t.current.status],children:[(0,L.jsx)(pY,{delivery:t.current,title:e}),(0,L.jsx)(bY,{review:t}),(0,L.jsx)(xY,{review:t}),(0,L.jsx)(SY,{review:t})]})}function wY(e){let t=yY(e);return(0,L.jsx)(CY,{title:e.title,review:t})}var TY={open:em,delivered:Kp,addressed:Hp},EY={open:`waiting for the owning session`,delivered:`sent to the oracle`,addressed:`plan amended`};function DY({comment:e}){let t=NO(Date.now()-Date.parse(e.createdAt)),n=TY[e.status];return(0,L.jsxs)(`p`,{className:`mt-1 flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,L.jsx)(n,{"aria-hidden":`true`,className:e.status===`addressed`?`size-3.5 text-success`:`size-3.5`}),EY[e.status],`, `,t,e.editedAt?` (edited)`:``]})}function OY({comment:e,taskId:t,own:n}){let[r,i]=(0,m.useState)(!1),[a,o]=(0,m.useState)(),s=a&&(a.editedAt??``)>(e.editedAt??``)?a:e;return(0,L.jsxs)(`li`,{className:`card-raised rounded-lg border px-3.5 py-2.5`,children:[r?(0,L.jsx)(cq,{text:s.text,onSave:async n=>{let r=await Kf(`tasks.editComment`,{taskId:t,commentId:e.id,text:n});o(r.comment)},onCancel:()=>i(!1)}):(0,L.jsx)(XR,{text:s.text}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(DY,{comment:s}),n&&!r?(0,L.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>i(!0),children:`Edit`}):null]})]})}function kY({taskId:e,finished:t,canComment:n}){let r=UD(`tasks.comments`,{taskId:e},[`tasks`]),i=VD(`status`),a=r.data?.comments??[],o=a.filter(e=>e.status!==`addressed`).length;return(0,L.jsxs)(`section`,{"aria-labelledby":`comments-${e}`,className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h3`,{id:`comments-${e}`,className:`text-sm`,children:(0,L.jsx)(QR,{title:`Comments`,right:o>0?`${o} open`:void 0})}),a.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t?`No comments.`:n?`No comments yet. Comment on the plan in the box below (Markdown and images work); the oracle amends it.`:`No comments yet.`}):(0,L.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:a.map(t=>(0,L.jsx)(OY,{taskId:e,comment:t,own:!!(t.by&&t.by===i.data?.sessionId)},`${e}-${t.id}`))})]})}function AY({step:e,stopped:t}){let n=$H(!t,e);return(0,L.jsx)(`span`,{className:`tabular-nums`,children:QH((e.workedMs??0)+n)})}function jY(){return(0,L.jsxs)(`span`,{"aria-hidden":`true`,className:`relative mt-[0.3125rem] grid size-4 shrink-0 place-items-center`,children:[(0,L.jsx)(`span`,{className:`absolute size-2.5 rounded-full bg-primary/30 motion-safe:animate-ping`}),(0,L.jsx)(`span`,{className:`size-2 rounded-full bg-primary`})]})}function MY({step:e,index:t,stopped:n}){let r=!!e.active&&!n,i=e.status===`done`,a=i?`text-success`:e.status===`current`?`text-primary`:`text-muted-foreground`,o=i?Hp:em;return(0,L.jsxs)(`li`,{className:`flex items-start gap-2.5 text-sm`,"data-step":r?`active`:e.status,children:[r?(0,L.jsx)(jY,{}):(0,L.jsx)(o,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 ${a}`}),(0,L.jsxs)(`span`,{className:`shrink-0 text-xs leading-5 text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,L.jsx)(`span`,{className:q(`min-w-0 break-words`,r||e.status===`current`?`text-foreground`:`text-muted-foreground`),children:e.text}),r?(0,L.jsxs)(`span`,{className:`shrink-0 rounded-md bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary`,children:[`active · `,(0,L.jsx)(AY,{step:e,stopped:n}),(0,L.jsx)(`span`,{className:`sr-only`,children:` (being worked on now)`})]}):e.status===`current`&&!n?(0,L.jsxs)(`span`,{className:`shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium`,children:[`next`,(0,L.jsx)(`span`,{className:`sr-only`,children:` (the step up next)`})]}):null]})}function NY({steps:e,stopped:t}){let n=e.filter(e=>e.status===`done`).length;return(0,L.jsx)($R,{title:`Steps`,right:`${n}/${e.length} done`,children:(0,L.jsx)(`ol`,{className:`flex flex-col gap-2`,"aria-label":`Steps`,children:e.map((e,n)=>(0,L.jsx)(MY,{step:e,index:n,stopped:t},`${n}-${e.text}`))})})}function PY({text:e}){let[t,n]=(0,m.useState)(!1),r=(0,m.useId)();return(0,L.jsxs)($R,{title:`Full plan`,children:[(0,L.jsxs)(`button`,{type:`button`,"aria-expanded":t,"aria-controls":r,onClick:()=>n(e=>!e),className:`inline-flex w-fit items-center gap-1.5 rounded-md text-sm text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40`,children:[(0,L.jsx)(Pp,{"aria-hidden":`true`,className:q(`size-4 transition-transform duration-200 ease-snap`,t&&`rotate-90`)}),t?`Hide the details`:`Read the details of each step`]}),t?(0,L.jsx)(`div`,{id:r,children:(0,L.jsx)(XR,{text:e})}):null]})}function FY({detail:e,finished:t}){return e.plan&&e.planDetails?(0,L.jsx)(PY,{text:e.planDetails}):e.plan?(0,L.jsx)($R,{title:`Approved plan`,children:(0,L.jsx)(XR,{text:e.plan})}):e.proposal?(0,L.jsx)($R,{title:t?`Proposal`:`Proposal (no plan yet)`,children:(0,L.jsx)(XR,{text:e.proposal})}):(0,L.jsx)($R,{title:`Plan`,children:(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t?`It ended before a plan was made.`:`No proposal or plan yet — the oracle is still clarifying or scouting.`})})}function IY({amendments:e}){return e.length===0?null:(0,L.jsx)($R,{title:`Amendments`,children:(0,L.jsx)(`ul`,{className:`flex list-disc flex-col gap-1 pl-5 text-sm text-muted-foreground`,children:e.map(e=>(0,L.jsx)(`li`,{className:`break-words`,children:e},e))})})}function LY({detail:e}){return e.waiting.length===0&&e.blockers.length===0?null:(0,L.jsx)($R,{title:`Waiting on`,children:(0,L.jsxs)(`ul`,{className:`flex flex-col gap-1 text-sm`,children:[e.waiting.map((e,t)=>(0,L.jsxs)(`li`,{className:`flex gap-2`,children:[(0,L.jsx)(Bp,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-warning`}),(0,L.jsxs)(`span`,{className:`min-w-0 break-words text-muted-foreground`,children:[e.kind,` `,e.detail]})]},`${t}-${e.kind}`)),e.blockers.map((e,t)=>(0,L.jsxs)(`li`,{className:`flex gap-2`,children:[(0,L.jsx)(Qp,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-destructive`}),(0,L.jsxs)(`span`,{className:`min-w-0 break-words text-muted-foreground`,children:[e.reason,` (needs: `,e.need,`)`]})]},`${t}-${e.reason}`))]})})}function RY({runs:e}){return e.length===0?null:(0,L.jsx)($R,{title:`Recent runs`,children:(0,L.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.map((e,t)=>(0,L.jsx)(`li`,{className:`break-words`,children:e},`${t}-${e}`))})})}function zY({detail:e,finished:t}){return(0,L.jsxs)(L.Fragment,{children:[e.steps.length>0?(0,L.jsx)(NY,{steps:e.steps,stopped:t}):null,e.request?(0,L.jsx)($R,{title:`Request`,children:(0,L.jsx)(XR,{text:e.request})}):null,(0,L.jsx)(FY,{detail:e,finished:t})]})}function BY({detail:e}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(IY,{amendments:e.amendments}),(0,L.jsx)(LY,{detail:e}),(0,L.jsx)(RY,{runs:e.runs})]})}function VY({row:e}){let t=(0,m.useRef)(!0);(0,m.useEffect)(()=>(t.current=!0,()=>{t.current=!1}),[]);async function n(){if(e.section===`mine`)return DD(`#/lobby`);let n=Vf(),r=()=>t.current&&Vf()===n;try{let t=await Kf(`tasks.open`,{taskId:e.id});if(!r())return;let n=await Kf(`status.get`,{});if(!r())return;if(t.sessionId&&t.sessionId===n.sessionId)return DD(`#/lobby`);if(t.sessionId&&!t.key)return V.info(`This task runs in another terminal. Switch to that terminal to work on it.`);if(n.busy)return V.info(`The oracle is working in this window. Stop it first, then open the task in its session.`);await H(`sessions.switch`,t.key?{key:t.key}:{claimTaskId:e.id})&&r()&&DD(`#/lobby`)}catch(e){r()&&V.error(e instanceof Error?e.message:String(e))}}let r=e.section===`mine`;return(0,L.jsx)(Y,{label:r?`Open in its session: this window`:`Open in its session`,text:`Open in session`,icon:vp,tone:`primary`,shortcut:`S`,onClick:()=>void n()})}var HY={mine:`This session`,others:`Other sessions`,pending:`Pending`,recent:`Finished`,archived:`Archived`},UY={open:`open`,done:`done`,dropped:`abandoned`},WY=`No tasks yet. Start one from the Lobby tab, or plan one in the Plan tab.`;function GY(e,t){return`${e.replace(/_/g,` `)}${t?` · paused`:``}`}function KY(e){return e===`now`?`just now`:`${e} ago`}function qY(e){if(e.kind===`plan`)return[`planned`,e.age?e.age===`now`?`saved just now`:`saved ${e.age} ago`:``,e.issue?`#${e.issue}`:``].filter(Boolean).join(` · `);let t=e.owner??(e.section===`mine`?`this session`:``);return[GY(e.status,e.paused),e.auto?`auto`:``,t].filter(Boolean).join(` · `)}function JY(e){let t=[];for(let n of e){let e=t.at(-1);e&&e.section===n.section?e.rows.push(n):t.push({section:n.section,rows:[n]})}return t}function YY(e){let t=e.filter(e=>e.kind!==`archived`),n=t.filter(e=>e.check===`open`).length,r=t.length-n,i=e.length-t.length;return[n?`${n} open`:``,r?`${r} finished`:``,i?`${i} archived`:``].filter(Boolean).join(` · `)||`0`}function XY({split:e}){let t=e.after.length>0?`, after ${e.after.map(e=>`part ${e}`).join(` and `)}`:``;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[(0,L.jsxs)(`span`,{className:`font-medium text-primary`,children:[`part `,e.part,` of `,e.of]}),` of one plan that was split into tasks`,t?(0,L.jsx)(`span`,{className:`text-foreground`,children:t}):null]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.titles.map((t,n)=>(0,L.jsxs)(`span`,{children:[n>0?(0,L.jsx)(`span`,{className:`text-muted-foreground/60`,children:` · `}):null,(0,L.jsxs)(`span`,{className:n+1===e.part?`font-medium text-foreground`:void 0,children:[n+1,`. `,t]})]},`${n}-${t}`))})]})}function ZY({planId:e}){let t=UD(`plans.get`,{planId:e},[`plans`]),n=t.data;return n?(0,L.jsxs)(L.Fragment,{children:[n.issue?(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`from issue #`,n.issue.number,` — `,n.issue.title,n.issue.url?(0,L.jsxs)(`span`,{className:`break-all`,children:[` `,n.issue.url]}):null]}):null,n.split?(0,L.jsx)(XY,{split:n.split}):null,(0,L.jsx)($R,{title:`Agreed plan`,children:(0,L.jsx)(XR,{text:n.brief})})]}):t.error?(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load the agreed plan. `,t.error]}):null}function QY({row:e,onGone:t}){let n=async n=>{await H(`plans.start`,{planId:e.id,where:n})&&t()},r=async()=>{await H(`plans.discard`,{planId:e.id})&&t()};return(0,L.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":e.title,children:[(0,L.jsxs)(pO,{children:[(0,L.jsx)(Y,{label:`Start here`,icon:wh,tone:`primary`,shortcut:`S`,onClick:()=>void n(`here`)}),(0,L.jsx)(Y,{label:`Start in a new session`,text:`New session`,icon:Wh,shortcut:`N`,onClick:()=>void n(`session`)}),(0,L.jsx)(WO,{icon:ig,label:`Discard`,shortcut:`Delete`,title:`Discard "${e.title}"?`,description:`The saved plan is removed from the list. This cannot be undone.`,confirmLabel:`Discard`,variant:`destructive`,onConfirm:()=>void r()})]}),(0,L.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,L.jsxs)(`h2`,{className:`flex items-start gap-2.5 text-lg font-medium`,children:[(0,L.jsx)(iU,{check:`open`,className:`mt-1.5`}),(0,L.jsx)(`span`,{className:`min-w-0 break-words`,children:e.title})]}),(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`pending`,e.age?` · saved ${KY(e.age)}`:``]}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:e.id})]}),(0,L.jsx)(ZY,{planId:e.id})]})}function $Y(e){if(e.kind===`archived`)return{state:`archived`,rest:KY(e.age??`now`)};let t=e.check!==`open`,n=e.owner??(e.section===`mine`?`this session`:``),r=t&&e.age?`${e.check===`dropped`?`dropped`:`done`} ${KY(e.age)}`:``;return{state:GY(e.status,e.paused),rest:[t?``:n,r].filter(Boolean).join(` · `)}}function eX(e){return e?[tU(e.track),e.domains.join(`, `)].filter(Boolean).join(` · `):``}function tX({row:e}){return e.progress?(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,L.jsx)(rU,{done:e.progress.done,total:e.progress.total}),(0,L.jsxs)(`span`,{children:[e.progress.done,` of `,e.progress.total,` steps`]})]}):null}function nX({row:e,task:t}){let n=t?.git?`branch ${t.git.branch}${t.git.from?` · from ${t.git.from}`:``}`:``,{state:r,rest:i}=$Y(e);return(0,L.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,L.jsxs)(`h2`,{className:`flex items-start gap-2.5 text-lg font-semibold tracking-tight`,children:[(0,L.jsx)(iU,{check:e.check,className:`mt-1.5`}),(0,L.jsxs)(`span`,{className:`sr-only`,children:[UY[e.check],`:`]}),(0,L.jsx)(`span`,{className:e.check===`dropped`?`min-w-0 break-words line-through`:`min-w-0 break-words`,children:e.title})]}),(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-foreground`,children:r}),i?(0,L.jsx)(`span`,{children:i}):null]}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:[e.id,eX(t),n].filter(Boolean).join(` · `)}),(0,L.jsx)(tX,{row:e})]})}function rX({row:e,onGone:t,onChanged:n}){let r=e.id;return{restore:async()=>{await H(`tasks.restore`,{taskId:r},{undo:()=>void H(`tasks.archive`,{taskId:r})})&&t()},archive:async()=>{await H(`tasks.archive`,{taskId:r},{undo:()=>void H(`tasks.restore`,{taskId:r})})&&t()},remove:async()=>{await H(`tasks.delete`,{taskId:r,where:e.kind===`archived`?`archive`:`list`})&&t()},toggleAuto:()=>void H(`tasks.auto`,{taskId:r,on:!e.auto}).then(n)}}function iX({row:e,archive:t}){return e.check===`open`?(0,L.jsx)(WO,{label:`Archive`,icon:fp,shortcut:`E`,title:`Archive "${e.title}"?`,description:`A task still under way is abandoned first, then moved to the archive. Restore brings it back.`,confirmLabel:`Archive`,onConfirm:()=>void t()}):(0,L.jsx)(Y,{label:`Archive`,icon:fp,shortcut:`E`,onClick:()=>void t()})}function aX({on:e,toggle:t}){return dO(`a`,t),(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsxs)(`label`,{className:`flex h-8 cursor-pointer items-center gap-2 rounded-lg px-2.5 text-[0.8125rem] font-medium transition-colors hover:bg-accent`,children:[(0,L.jsx)(Oh,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),(0,L.jsx)(`span`,{children:`Auto`}),(0,L.jsx)(KW,{checked:e,onCheckedChange:t,"aria-label":`Auto mode`,"aria-keyshortcuts":`A`}),(0,L.jsx)(cD,{chord:`A`,className:`kbd-hint`})]})}),(0,L.jsx)(qD,{children:`Auto mode: the oracle decides without asking`})]})}function oX(e){let{row:t}=e,{restore:n,archive:r,remove:i,toggleAuto:a}=rX(e),o=t.kind===`archived`;return(0,L.jsxs)(pO,{children:[t.kind===`task`&&t.check===`open`?(0,L.jsx)(VY,{row:t}):null,t.kind===`task`?(0,L.jsx)(sX,{taskId:t.id}):null,o?(0,L.jsx)(Y,{label:`Restore`,icon:Ah,shortcut:`R`,onClick:()=>void n()}):null,t.check===`open`&&!o?(0,L.jsx)(aX,{on:!!t.auto,toggle:a}):null,o?null:(0,L.jsx)(iX,{row:t,archive:r}),(0,L.jsx)(WO,{icon:ig,label:o?`Delete for good`:`Delete`,text:`Delete`,shortcut:`Delete`,title:`Delete "${t.title}" for good?`,description:`This cannot be undone.`,confirmLabel:`Delete`,variant:`destructive`,onConfirm:()=>void i()})]})}function sX({taskId:e}){let t=(0,m.useRef)(!0);(0,m.useEffect)(()=>(t.current=!0,()=>{t.current=!1}),[]);async function n(){let n=Vf();try{let r=await Kf(`tasks.open`,{taskId:e});if(!t.current||Vf()!==n)return;r.notice&&V.info(r.notice);let i=await Kf(`status.get`,{});if(!t.current||Vf()!==n)return;let a=r.key??(r.sessionId===i.sessionId?`here`:r.sessionId);a?DD(`#/sessions/${encodeURIComponent(a)}`):r.notice||V.info(`This task has no active session. No replacement session was created.`)}catch(e){t.current&&Vf()===n&&V.error(e instanceof Error?e.message:String(e))}}return(0,L.jsx)(Y,{label:`Open task conversation`,text:`Conversation`,icon:Jm,shortcut:`O`,onClick:()=>void n()})}function cX(e){let{row:t}=e,n=t.kind===`plan`,r=UD(`tasks.get`,{taskId:t.id},[`tasks`],!n),i=VD(`lobby`).data?.task,a=i?.id===t.id?i:void 0;if(n)return(0,L.jsx)(QY,{row:t,onGone:e.onGone});let o=t.check===`open`&&t.kind===`task`,s=r.data?r.data.work:t.work;return(0,L.jsxs)(`article`,{className:`flex flex-col gap-5`,"aria-label":t.title,children:[(0,L.jsx)(oX,{...e}),(0,L.jsx)(nX,{row:t,task:a}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,L.jsx)(uY,{timing:r.data?.timing??t.timing,...s?{work:s}:{},stopped:t.check!==`open`})}),r.data?.delivery?(0,L.jsx)(wY,{taskId:t.id,title:t.title,delivery:r.data.delivery,onChanged:r.reload},t.id):null,r.data?(0,L.jsx)(zY,{detail:r.data,finished:!o}):null,(0,L.jsx)(kY,{taskId:t.id,finished:!o,canComment:o}),r.data?(0,L.jsx)(BY,{detail:r.data}):null,r.error&&!r.data?(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load the plan detail. `,r.error]}):null]})}function lX({row:e}){return e.check===`open`&&e.progress?(0,L.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground tabular-nums`,children:[(0,L.jsx)(rU,{done:e.progress.done,total:e.progress.total}),(0,L.jsxs)(`span`,{children:[e.progress.done,`/`,e.progress.total]})]}):e.age&&e.check!==`open`?(0,L.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:e.age}):null}function uX(e){return e.check===`dropped`?`text-muted-foreground line-through`:e.kind===`archived`||e.check===`done`?`text-muted-foreground`:`text-foreground`}function dX({row:e,selected:t,onSelect:n}){return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(e.id),className:Rz,children:[(0,L.jsxs)(`span`,{className:`flex items-start gap-2 text-sm`,children:[(0,L.jsx)(iU,{check:e.check,className:`mt-0.5`}),(0,L.jsxs)(`span`,{className:`sr-only`,children:[UY[e.check],`:`]}),(0,L.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words`,uX(e),t&&`font-medium text-foreground`),children:e.title}),(0,L.jsx)(lX,{row:e})]}),e.check===`open`?(0,L.jsx)(`span`,{className:`pl-6 text-xs text-muted-foreground`,children:qY(e)}):null,e.kind===`plan`?null:(0,L.jsx)(`span`,{className:`pl-6 text-xs text-muted-foreground`,children:(0,L.jsx)(uY,{timing:e.timing,...e.work?{work:e.work}:{},stopped:e.check!==`open`})}),e.delivery?(0,L.jsxs)(`span`,{className:`pl-6 text-xs text-foreground`,children:[`Delivery: `,e.delivery.status.replaceAll(`_`,` `),` · open task to review`]}):null]})})}function fX({rows:e,selectedId:t,onSelect:n}){return(0,L.jsx)(`div`,{className:`flex flex-col pb-2`,children:JY(e).map(({section:e,rows:r})=>(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h3`,{className:Bz,children:(0,L.jsx)(QR,{title:HY[e],right:String(r.length),className:`[&>span:first-child]:font-medium [&>span:first-child]:text-muted-foreground`})}),(0,L.jsx)(`ul`,{className:zz,children:r.map(e=>(0,L.jsx)(dX,{row:e,selected:e.id===t,onSelect:n},`${e.kind}-${e.id}`))})]},e))})}var pX=()=>DD(ED(`tasks`)),mX=e=>DD(ED(`tasks`,e));function hX(){return(0,L.jsxs)(kD,{className:`m-4 flex-1`,children:[(0,L.jsxs)(AD,{children:[(0,L.jsx)(MD,{variant:`icon`,children:(0,L.jsx)(Pm,{"aria-hidden":`true`})}),(0,L.jsx)(PD,{children:WY})]}),(0,L.jsx)(J,{onClick:()=>DD(ED(`plan`)),children:`Plan a task`})]})}function gX({shown:e,count:t,onToggle:n}){return(0,L.jsxs)(`label`,{className:`btn-raised flex h-7 cursor-pointer items-center gap-2 rounded-lg border bg-card px-2 text-xs font-medium transition-[box-shadow]`,children:[(0,L.jsx)(lV,{checked:e,onCheckedChange:n,"aria-label":`Show archived tasks`,className:`size-4`}),`Archived`,(0,L.jsx)(Lz,{variant:`secondary`,className:`h-5 px-1.5`,children:t})]})}function _X({id:e}){let t=SO(),[n,r]=(0,m.useState)(!1),i=UD(`tasks.list`,{},[`tasks`,`plans`]),a=UD(`tasks.archived`,{},[`tasks`]),o=i.data?.rows??[],s=a.data?.rows??[],c=n?[...o,...s]:o,l=e??(t?c[0]?.id:void 0),u=[...c,...s].find(e=>e.id===l&&e.kind===`task`)?.id;if((0,m.useEffect)(()=>(CJ(u),()=>CJ(void 0)),[u]),!i.data&&i.error)return(0,L.jsx)(LD,{message:`Could not load tasks. ${i.error}`,onRetry:i.reload});if(i.data&&o.length===0&&s.length===0)return(0,L.jsx)(hX,{});let d=[...c,...s].find(e=>e.id===l),f=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(EO,{title:`Tasks`,count:YY(c),children:(0,L.jsx)(gX,{shown:n,count:s.length,onToggle:()=>r(e=>!e)})}),i.data?c.length===0?(0,L.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:WY}):(0,L.jsx)(fX,{rows:c,selectedId:l,onSelect:mX}):(0,L.jsx)(DO,{})]}),p=d?(0,L.jsx)(cX,{row:d,onGone:pX,onChanged:i.reload},d.id):e?(0,L.jsx)(vX,{}):null;return(0,L.jsx)(TO,{wide:t,list:f,detail:p,open:!!e,onClose:pX,hint:`Select a task to see its detail.`,describe:`Task detail`})}function vX(){return(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That task is not on the list any more.`})}var yX={l:`lobby`,p:`plan`,t:`tasks`,i:`issues`,u:`git`,s:`sessions`,n:`knowledge`,q:`quickfix`,m:`metrics`,e:`settings`,x:`excalidraw`};function bX(e){let t=e[0];if(t)try{return decodeURIComponent(t)}catch{return t}}function xX(e){if(e.kind===`settings`)return(0,L.jsx)(WK,{});if(e.kind===`sessions`)return(0,L.jsx)(sY,{id:bX(e.key?[e.key]:[])});switch(e.tab){case`lobby`:return(0,L.jsx)(yU,{});case`tasks`:return(0,L.jsx)(_X,{id:bX(e.rest)});case`plan`:return(0,L.jsx)($q,{});case`quickfix`:return(0,L.jsx)(vJ,{id:bX(e.rest)});case`issues`:return(0,L.jsx)(bB,{rest:e.rest});case`metrics`:return(0,L.jsx)(uW,{});case`git`:return(0,L.jsx)(Jz,{rest:e.rest});case`knowledge`:return(0,L.jsx)(cV,{agent:e.rest[0],file:e.rest[1]});case`excalidraw`:return(0,L.jsx)(hH,{id:bX(e.rest)})}}function SX(e,t){return t.overlay?!0:e===`savePlan`&&!t.saveAvailable}var CX={tab:`Tab`,esc:`Escape`,escape:`Escape`,enter:`Enter`,space:`Space`,pageup:`PageUp`,pagedown:`PageDown`,home:`Home`,end:`End`,"]":`BracketRight`,"[":`BracketLeft`,"/":`Slash`,"?":`Slash`,",":`Comma`,".":`Period`};function wX(e){return e.length===1&&/[a-z]/i.test(e)?`Key${e.toUpperCase()}`:e.length===1&&/[0-9]/.test(e)?`Digit${e}`:CX[e]}function TX(e){let t={alt:!1,ctrl:!1,shift:!1,meta:!1,code:``};for(let n of e.toLowerCase().split(`+`))if(n===`alt`)t.alt=!0;else if(n===`ctrl`||n===`control`)t.ctrl=!0;else if(n===`shift`)t.shift=!0;else if(n===`meta`||n===`cmd`)t.meta=!0;else{let e=wX(n);if(!e)return;t.code=e}return t.code?t:void 0}function EX(e,t){return e.code===t.code&&e.altKey===t.alt&&e.ctrlKey===t.ctrl&&e.shiftKey===t.shift&&e.metaKey===t.meta}function DX(e,t){let n=TX(t);return n?EX(e,n):!1}function OX(e,t){for(let n of t)if(DX(e,n.key))return n.action}function kX(e,t){for(let n of t)if(DX(e,n.key))return n.id}function AX(e){return XD(e.target)||e.target instanceof HTMLInputElement||e.target instanceof HTMLSelectElement||yD()||!!document.querySelector(`[role='dialog'], [role='menu'], [role='listbox']`)}function jX(e,t,n,r){let i=!e.shiftKey&&/^[1-9]$/.test(e.key)?t[Number(e.key)-1]:void 0;if(i)r(i.id);else if(e.key===`/`)n(`search`);else if(e.key===`?`)n(`help`);else if(e.key===`j`||e.key===`k`)nO(e.key===`j`?1:-1);else return!1;return!0}function MX(e,t){let n=kX(e,t.tabs),r=OX(e,t.keys);return!n&&!r?!1:SX(r,{overlay:!!document.querySelector(`[role='dialog']:not([data-state='closed']), [role='menu']:not([data-state='closed']), [role='listbox']`)||yD(),typing:XD(e.target)||e.target instanceof HTMLInputElement,saveAvailable:!!document.querySelector(`[data-plan-save]:not([disabled])`)})||(r===`search`||r===`savePlan`)&&!t.insideApp()?!0:(e.preventDefault(),n?t.onTab(n):r&&t.onAction(r),!0)}function NX(e,t,n){if(e.key===`Escape`)return Date.now()<n&&e.preventDefault(),0;if(Date.now()<n){let n=yX[e.key];return n&&(e.preventDefault(),t.onTab(n)),0}return e.key===`g`?Date.now()+1500:(jX(e,t.tabs,t.onAction,t.onTab)&&e.preventDefault(),0)}function PX(e){(0,m.useEffect)(()=>{if(!e.enabled)return;let t=0,n=n=>{if(n.defaultPrevented||n.isComposing)return;if(!e.insideApp()){OX(n,e.keys)===`help`&&(n.preventDefault(),e.onAction(`help`));return}let r=!n.altKey&&!n.ctrlKey&&!n.metaKey;if(r&&AX(n)){t=0;return}if(MX(n,e)){t=0;return}t=r?NX(n,e,t):0};return window.addEventListener(`keydown`,n,!0),()=>window.removeEventListener(`keydown`,n,!0)},[e.enabled,e.keys,e.tabs,e.insideApp,e.onAction,e.onTab])}var FX=[{id:`focus`,caps:[`/`],help:`focus search, or the message box`},{id:`send`,label:`Enter`,help:`send the message`},{id:`newline`,label:`Shift+Enter`,help:`a new line (lists carry on)`},{id:`format`,label:`Ctrl+B`,help:`bold; Ctrl+I italic, Ctrl+E code, Ctrl+K link`},{id:`leave`,label:`Esc`,help:`leave the box for the tab bar`}],IX=[{id:`digits`,caps:[`1`,`…`,`9`],help:`jump to a tab in current order`},{id:`help`,caps:[`?`],help:`keyboard shortcuts`},...Object.entries(yX).map(([e,t])=>({id:`go.${t}`,caps:[`g`,e],help:`jump to ${t}`})),{id:`project`,caps:[`P`],help:`open the project switcher`},{id:`theme`,caps:[`D`],help:`switch between light and dark`},{id:`edit`,label:`Ctrl+Enter`,help:`save an edited message; Esc cancels`}],LX=[{id:`tasks`,page:`Tasks`,keys:[[`E`,`archive`],[`R`,`restore`],[`A`,`auto mode`],[`Delete`,`delete`]]},{id:`saved`,page:`Saved plan`,keys:[[`S`,`start here`],[`N`,`new session`],[`Delete`,`discard`]]},{id:`plan`,page:`Plan`,keys:[[`A`,`answer`],[`R`,`retry`],[`Ctrl+S`,`save`],[`N`,`new plan`]]},{id:`quickfix`,page:`Quick fix`,keys:[[`R`,`run anyway`],[`T`,`make a task`],[`C`,`cancel`]]},{id:`git`,page:`Git`,keys:[[`R`,`refresh`],[`V`,`review`],[`Q`,`Jev's read`],[`X`,`stop`]]},{id:`issues`,page:`Issues`,keys:[[`R`,`refresh`]]},{id:`knowledge`,page:`Knowledge`,keys:[[`E`,`edit`],[`A`,`add`],[`C`,`comment`],[`F`,`edit file`],[`Delete`,`delete`]]},{id:`excalidraw`,page:`Excalidraw`,keys:[[`R`,`reveal`],[`C`,`copy`],[`O`,`open`],[`W`,`draw`],[`T`,`check`],[`Delete`,`remove`]]},{id:`sessions`,page:`Sessions`,keys:[[`M`,`move here`],[`S`,`stop`],[`B`,`back`]]},{id:`confirm`,page:`Asked to confirm`,keys:[[`Y`,`yes, do it`],[`Esc`,`keep it`]]}],RX=[{id:`enter`,caps:[`↓`],help:`from the tab bar, into the page`},{id:`rows`,caps:[`↑`,`↓`],help:`move through a list (j and k work too)`},{id:`pane`,caps:[`←`,`→`],help:`between a list and its detail (h and l)`},{id:`ends`,caps:[`Home`,`End`],help:`first and last row`},{id:`open`,caps:[`Enter`,`Space`],help:`activate the focused button or row (links: Enter; checkboxes: Space)`},{id:`back`,label:`Esc`,help:`back up to the tab bar`}],zX=[{id:`qmove`,caps:[`↑`,`↓`],help:`move between the options`},{id:`qpick`,label:`Space`,help:`pick an option (several when allowed)`},{id:`qchoose`,label:`Enter`,help:`choose and go on; in your own answer, send it`},{id:`qacross`,caps:[`←`,`→`],help:`previous and next question`},{id:`qdigit`,caps:[`1`,`2`,`…`],help:`pick that option`},{id:`qesc`,label:`Esc`,help:`put the question away for later`}];function BX({line:e}){return(0,L.jsxs)(`div`,{className:`flex items-center gap-3 py-1`,children:[(0,L.jsx)(`span`,{className:`flex w-28 shrink-0 items-center`,children:e.caps?(0,L.jsx)(`span`,{className:`inline-flex items-center gap-1`,children:e.caps.map(e=>(0,L.jsx)(nD,{children:e},e))}):(0,L.jsx)(cD,{chord:e.label??``})}),(0,L.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.help})]})}function VX(){return(0,L.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`h3`,{className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:`Buttons on a page`}),LX.map(e=>(0,L.jsxs)(`div`,{className:`flex items-start gap-3 py-1`,children:[(0,L.jsx)(`span`,{className:`w-28 shrink-0 pt-0.5 text-sm font-medium`,children:e.page}),(0,L.jsx)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1.5 text-sm text-muted-foreground`,children:e.keys.map(([e,t])=>(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,L.jsx)(cD,{chord:e}),t]},e))})]},e.id))]})}function HX({title:e,lines:t}){return(0,L.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`h3`,{className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:e}),t.map(e=>(0,L.jsx)(BX,{line:e},e.id))]})}function UX(e){return e.map(e=>({id:e.action,label:e.label,help:e.help}))}function WX(e){return e.map(e=>({id:`tab.${e.id}`,label:e.key,help:`jump to the ${e.label} tab`}))}function GX({open:e,onOpenChange:t,keys:n,tabs:r}){let i=vD(e,_D.help);return(0,m.useEffect)(()=>{if(!e||!i)return;let r=e=>{let r=n.find(e=>e.action===`help`)?.key;(e.key===`Escape`||r&&DX(e,r))&&(e.preventDefault(),t(!1))};return window.addEventListener(`keydown`,r,!0),()=>window.removeEventListener(`keydown`,r,!0)},[e,i,t,n]),(0,L.jsxs)(uD,{open:e&&i,onOpenChange:t,label:`Keys`,className:`max-w-4xl`,children:[(0,L.jsxs)(`header`,{className:`flex items-center justify-between gap-3 border-b border-border px-6 py-4`,children:[(0,L.jsx)(`h2`,{"aria-hidden":`true`,className:`text-base font-semibold tracking-tight`,children:`Keyboard shortcuts`}),(0,L.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(cD,{chord:`Esc`}),(0,L.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close`,onClick:()=>t(!1),children:(0,L.jsx)(bg,{"aria-hidden":`true`})})]})]}),(0,L.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-x-10 gap-y-6 overflow-y-auto px-6 py-5 md:grid-cols-2`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,L.jsx)(HX,{title:`Everywhere`,lines:UX(n)}),(0,L.jsx)(HX,{title:`Jump to a tab`,lines:WX(r)}),(0,L.jsx)(HX,{title:`Navigation and editing`,lines:IX}),(0,L.jsx)(HX,{title:`Message box`,lines:FX})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,L.jsx)(HX,{title:`Lists and panes`,lines:RX}),(0,L.jsx)(VX,{}),(0,L.jsx)(HX,{title:`Questions`,lines:zX})]})]})]})}function KX(e){return e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}async function qX(e){if(e.size===0)throw Error(`${e.name||`That file`} is empty.`);if(e.size>20971520)throw Error(`${e.name||`That file`} is larger than 20 MB.`);let t=new URLSearchParams({name:e.name||`pasted-file`,type:e.type}),n=await fetch(Hf(`/api/files.upload?${t}`),{method:`POST`,headers:{"Content-Type":`application/octet-stream`},body:e,credentials:`same-origin`}),r=await n.json().catch(()=>void 0);if(!r)throw new Wf(`the lobby answered ${n.status}`,`failed`,n.status);if(!r.ok)throw new Wf(r.error,r.code,n.status);return r.result}function JX(e,t,n,r){let i=e.slice(0,t),a=e.slice(t,n),o=e.slice(n);if(a.length>=r.length*2&&a.startsWith(r)&&a.endsWith(r)){let e=a.slice(r.length,a.length-r.length);return{value:i+e+o,start:t,end:t+e.length}}return i.endsWith(r)&&o.startsWith(r)?{value:i.slice(0,i.length-r.length)+a+o.slice(r.length),start:t-r.length,end:n-r.length}:{value:i+r+a+r+o,start:t+r.length,end:n+r.length}}function YX(e,t,n){let r=e.slice(t,n)||`text`,i=`[${r}](url)`,a=t+r.length+3;return{value:e.slice(0,t)+i+e.slice(n),start:a,end:a+3}}var XX=/^(\s*)(?:([-*+])|(\d+)([.)]))\s+(\[[ xX]\]\s+)?/;function ZX(e,t){let n=e.lastIndexOf(`
|
|
96
|
+
.dark { … }`,className:`max-h-56 font-mono text-xs md:text-xs`}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(`input`,{ref:a,type:`file`,accept:`.css,.json,text/css,application/json`,hidden:!0,tabIndex:-1,"aria-label":`Upload a theme file`,onChange:e=>{s(e.target.files?.[0]),e.target.value=``}}),(0,L.jsx)(Y,{label:`Apply the pasted theme`,text:`Apply`,icon:Op,tone:`primary`,disabled:!t.trim(),onClick:()=>o(t,`Custom theme`)}),(0,L.jsx)(Y,{label:`Upload a .css or .json theme file`,text:`Upload file`,icon:ug,onClick:()=>a.current?.click()}),e.custom?(0,L.jsx)(WO,{label:`Remove ${e.custom.name}`,text:`Remove`,title:`Remove the imported theme?`,description:`The imported theme is stored in this browser. Keep a copy if you want to use it again.`,confirmLabel:`Remove theme`,icon:ig,variant:`destructive`,onConfirm:()=>e.removeCustom()}):null,r?(0,L.jsx)(`p`,{role:`alert`,className:`ml-2 min-w-0 text-xs text-destructive`,children:r}):null]})]})}function DK(){let{theme:e,setTheme:t}=UG(),n=LW();return(0,L.jsx)(mz,{prominent:!0,title:eK.appearance,children:(0,L.jsxs)(NG,{children:[(0,L.jsx)(MG,{label:`Prompt sounds`,help:`A droplet for each new actionable prompt or delivery review. Kept in this browser; sound starts after interaction. Desktop notifications remain separate.`,children:(0,L.jsx)(sG,{checked:!n,onCheckedChange:e=>FW(!e),"aria-label":`Prompt sounds`})}),(0,L.jsx)(MG,{label:xK.themeLabel,help:xK.appearanceHelp,children:(0,L.jsx)(PG,{value:e,items:xK.themeItems.map(e=>({value:e.id,label:e.label})),label:xK.themeLabel,onChange:e=>t(e)})}),(0,L.jsx)(MG,{label:`Colour theme`,help:`The page's colours. Kept in this browser only.`,stacked:!0,children:(0,L.jsx)(TK,{})}),(0,L.jsx)(MG,{label:`Import a theme`,stacked:!0,children:(0,L.jsx)(EK,{})})]})})}var OK={master:[`master`],designer:[`agents`,`designer`],backend:[`agents`,`backend`],qa:[`agents`,`qa`],scout:[`scout`],researcher:[`researcher`],quickfix:[`quickFix`],planner:[`planner`]},kK=[...tK,...nK.map(e=>({id:`panel:${e.id}`,label:e.label,help:rK}))];function AK(e,t){switch(t){case`master`:return e.master;case`scout`:return{model:e.scout.model,thinking:`low`,timeoutMs:e.scout.timeoutMs};case`researcher`:return e.researcher;case`quickfix`:return e.quickFix;case`planner`:return e.planner;default:return e.agents[t]}}function jK(e,t){return OK[e].reduceRight((e,t)=>({[t]:e}),t)}function MK(e,t){return e.find(e=>e.id===t)?.thinkingLevels??$G}function NK(e,t){return $G[DG($G,e,Math.max(0,$G.indexOf(t)))]??t}var PK=e=>e>0?`${e} round${e===1?``:`s`}`:`unlimited`,FK=e=>e>0?`over ${e} steps`:`never`;function IK({label:e,children:t}){return(0,L.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),t]})}function LK(e){let[t,n]=(0,m.useState)(!1),[r,i]=(0,m.useState)(``),a=e.models.some(t=>t.id===e.value),o=[...e.inherit?[{value:qG,label:JG,help:YG}]:[],...e.none?[{value:qG,label:`none`,help:`Use the primary model`}]:[],...!e.inherit&&!e.none&&e.value===`inherit`?[{value:qG,label:JG,help:YG}]:[],...e.models.map(e=>({value:e.id,label:e.id,...e.label&&e.label!==e.id?{help:e.label}:{}})),...!a&&e.value!==`inherit`?[{value:e.value,label:e.value,help:QG}]:[],{value:XG,label:ZG,help:QG}],s=t=>{if(t!==`__custom__`)return e.onChange(t);i(a?``:e.value),n(!0)},c=()=>{let t=r.trim();n(!1),t&&t!==e.value&&e.onChange(t)};return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(PG,{value:e.value,items:o,label:e.label,onChange:s}),t?(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(oG,{autoFocus:!0,value:r,placeholder:`provider/model`,"aria-label":`Model id`,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c())}}),(0,L.jsx)(Y,{label:`Use this model`,icon:Op,tone:`primary`,onClick:c})]}):null]})}function RK({label:e,help:t,checked:n,onChange:r}){return(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`text-[0.8125rem] font-medium`,children:e}),t?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}):null]}),(0,L.jsx)(sG,{checked:n,onCheckedChange:r,"aria-label":e})]})}function zK({value:e,onSave:t,placeholder:n,label:r}){let[i,a]=(0,m.useState)(e);(0,m.useEffect)(()=>a(e),[e]);let o=()=>{let n=i.trim();n!==e&&t(n)};return(0,L.jsx)(oG,{value:i,placeholder:n,"aria-label":r,onChange:e=>a(e.target.value),onBlur:o,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())}})}function BK({value:e,label:t,onSave:n}){let r=Math.round(e/6e4);return(0,L.jsx)(HK,{label:t,value:String(r),min:1,suffix:`min`,onSave:e=>{let t=Number(e);return!Number.isFinite(t)||t<=0?(B.error(`"${e}" is not a positive number of minutes.`),!1):(n(Math.round(t*6e4)),!0)}})}function VK({value:e,onSave:t}){return(0,L.jsx)(HK,{label:uK,value:String(e),min:0,max:65535,onSave:e=>!/^\d+$/.test(e)||Number(e)>65535?(B.error(`"${e}" is not a port (0, or 1-65535).`),!1):(t(Number(e)),!0)})}function HK({label:e,value:t,min:n,max:r,suffix:i,onSave:a}){let[o,s]=(0,m.useState)(t);(0,m.useEffect)(()=>s(t),[t]);let c=()=>{o!==t&&(a(o.trim())||s(t))};return(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(oG,{type:`number`,inputMode:`numeric`,min:n,max:r,value:o,"aria-label":e,className:i?`pr-10`:void 0,onChange:e=>s(e.target.value),onBlur:c,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c())}}),i?(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-y-0 right-2.5 flex items-center text-xs text-muted-foreground`,children:i}):null]})}function UK({value:e,label:t,onSave:n}){let[r,i]=(0,m.useState)(e);return(0,m.useEffect)(()=>i(e),[e]),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsx)(OO,{rows:2,value:r,"aria-label":t,onChange:e=>i(e.target.value),onBlur:()=>{r.trim()!==e&&n(r.trim())}}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Saved when you leave the field.`})]})}function WK({kind:e,config:t,models:n,save:r}){let i=AK(t,e),a=t=>r(jK(e,t)),o=GG[e],s=MK(n,i.model),c=t=>{let r={model:t};e!==`scout`&&!MK(n,t).includes(i.thinking)&&(r.thinking=NK(MK(n,t),i.thinking)),a(r)},l=e===`scout`?`low`:NK(s,i.thinking),u=e!==`scout`&&e!==`researcher`,[d,f]=(0,m.useState)(!!i.instructions);return(0,L.jsxs)(`section`,{className:`glass flex min-w-0 flex-col gap-3 rounded-xl p-4`,children:[(0,L.jsxs)(`header`,{className:`flex items-baseline justify-between gap-3`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-semibold`,children:o}),(0,L.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[i.model===`inherit`?`session model`:i.model,` · `,e===`scout`?`low`:i.thinking]})]}),(0,L.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-1`,children:(0,L.jsx)(IK,{label:KG.model,children:(0,L.jsx)(LK,{value:i.model,models:n,label:`${o} model`,inherit:e===`master`,onChange:c})})}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg bg-muted p-3`,children:[(0,L.jsx)(wG,{level:l,className:`size-16`}),(0,L.jsx)(`div`,{className:`min-w-0 flex-1`,children:e===`scout`?(0,L.jsxs)(`div`,{className:`grid gap-1`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:KG.thinking}),(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`low`,` (fixed for scouts)`]})]}):(0,L.jsx)(kG,{value:i.thinking,levels:$G,supported:s,model:i.model===`inherit`?`the session model`:i.model,label:`${o} effort`,onChange:e=>a({thinking:e})})})]}),(0,L.jsxs)(`div`,{className:`flex min-h-7 items-center justify-between gap-3`,children:[u?(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"aria-expanded":d,onClick:()=>f(e=>!e),className:`flex min-h-8 items-center gap-1 rounded-md text-xs text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/30`,children:[(0,L.jsx)(Pp,{"aria-hidden":`true`,className:q(`size-3.5 transition-transform duration-200 ease-snap`,d&&`rotate-90`)}),KG.instructions,!d&&i.instructions?(0,L.jsx)(`span`,{className:`text-primary`,children:`· set`}):null]}):(0,L.jsx)(`span`,{}),e===`master`?null:(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Time limit`}),(0,L.jsx)(`div`,{className:`w-24`,children:(0,L.jsx)(BK,{value:i.timeoutMs??t.workflow.agentTimeoutMs,label:`${o} time limit`,onSave:e=>a({timeoutMs:e})})})]})]}),u&&d?(0,L.jsx)(UK,{value:i.instructions??``,label:`${o} instructions`,onSave:e=>a({instructions:e})}):null]})}function GK(e,t){return t.startsWith(`panel:`)?e.lobby.panels[t.slice(6)]:e.lobby[t]}function KK({config:e,item:t,save:n}){let r=t.id.startsWith(`panel:`);return(0,L.jsx)(RK,{label:t.label,help:t.help,checked:GK(e,t.id),onChange:e=>{n(r?{lobby:{panels:{[t.id.slice(6)]:e}}}:{lobby:{[t.id]:e}})}})}function qK({config:e,save:t}){let n=e.workflow.gitIsolation;return(0,L.jsx)(mz,{prominent:!0,title:eK.workflow,children:(0,L.jsx)(NG,{children:(0,L.jsx)(MG,{label:hK,help:mK.find(e=>e.id===n)?.help??`enter cycles off, branch, worktree`,children:(0,L.jsx)(PG,{value:n,items:mK.map(e=>({value:e.id,label:e.label})),label:hK,onChange:e=>void t({workflow:{gitIsolation:e}})})})})})}var JK=e=>e?`${e}/`:_K.top;function YK(e){return e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean)}function XK({replaced:e}){let t=UD(`settings.linters`,{},[]),n=t.data?.linters;return(0,L.jsx)(MG,{label:_K.found,help:e?_K.foundReplaced:_K.foundHelp,children:n?n.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground sm:text-right`,children:_K.foundNone}):(0,L.jsx)(`ul`,{"aria-label":_K.found,className:q(`flex flex-col gap-1.5 sm:items-end`,e&&`opacity-60`),children:n.map(e=>(0,L.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 text-sm`,children:[(0,L.jsx)(`span`,{className:`font-medium`,children:e.tool}),(0,L.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:JK(e.folder)}),(0,L.jsxs)(`span`,{title:e.installed?void 0:_K.missingHelp,className:q(`inline-flex shrink-0 items-center gap-1 text-xs`,e.installed?`text-success`:`text-warning`),children:[e.installed?(0,L.jsx)(Hp,{"aria-hidden":`true`,className:`size-3.5`}):(0,L.jsx)(Bp,{"aria-hidden":`true`,className:`size-3.5`}),e.installed?_K.installed:_K.missing]})]},`${e.tool}:${e.folder}`))}):(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground sm:text-right`,children:t.error?t.error:`Looking…`})})}function ZK({config:e,save:t}){let n=e.lint,r=n.mode===`off`,i=n.command.trim().length>0;return(0,L.jsxs)(mz,{prominent:!0,title:eK.lint,children:[(0,L.jsx)(`p`,{className:`max-w-3xl text-sm text-muted-foreground`,children:_K.intro}),(0,L.jsxs)(NG,{children:[(0,L.jsx)(MG,{label:_K.mode,help:gK.find(e=>e.id===n.mode)?.help,children:(0,L.jsx)(PG,{value:n.mode,items:gK.map(e=>({value:e.id,label:e.label})),label:_K.mode,onChange:e=>void t({lint:{mode:e}})})}),(0,L.jsxs)(`div`,{className:q(`flex flex-col divide-y divide-border [&>*]:py-3 [&>*:first-child]:pt-0 [&>*:last-child]:pb-0`,r&&`opacity-60`),"aria-disabled":r||void 0,children:[(0,L.jsx)(MG,{label:_K.command,help:_K.commandHelp,children:(0,L.jsx)(zK,{value:n.command,label:_K.command,placeholder:_K.commandPlaceholder,onSave:e=>void t({lint:{command:e}})})}),i?(0,L.jsx)(MG,{label:_K.extensions,help:_K.extensionsHelp,children:(0,L.jsx)(zK,{value:n.extensions.join(` `),label:_K.extensions,placeholder:_K.extensionsPlaceholder,onSave:e=>void t({lint:{extensions:YK(e)}})})}):null,(0,L.jsx)(MG,{label:_K.timeout,help:_K.timeoutHelp,children:(0,L.jsx)(BK,{value:n.timeoutMs,label:`Lint ${_K.timeout.toLowerCase()}`,onSave:e=>void t({lint:{timeoutMs:e}})})}),(0,L.jsx)(XK,{replaced:i})]})]})]})}function QK({config:e,save:t}){let n=e.lobby.web;return(0,L.jsx)(mz,{prominent:!0,title:eK.lobby,children:(0,L.jsxs)(NG,{children:[kK.map(n=>(0,L.jsx)(KK,{config:e,item:n,save:t},n.id)),(0,L.jsx)(MG,{label:iK,help:aK,children:(0,L.jsx)(PG,{value:String(e.lobby.maxPlanningRounds),items:oK.map(e=>({value:String(e),label:PK(e)})),label:iK,onChange:e=>void t({lobby:{maxPlanningRounds:Number(e)}})})}),(0,L.jsx)(MG,{label:sK,help:cK,children:(0,L.jsx)(PG,{value:String(e.lobby.splitPlanAbove),items:lK.map(e=>({value:String(e),label:FK(e)})),label:sK,onChange:e=>void t({lobby:{splitPlanAbove:Number(e)}})})}),(0,L.jsx)(MG,{label:uK,help:dK,children:(0,L.jsx)(VK,{value:n.port,onSave:e=>void t({lobby:{web:{port:e}}})})}),(0,L.jsx)(RK,{label:fK,help:pK,checked:n.openBrowser,onChange:e=>void t({lobby:{web:{openBrowser:e}}})})]})})}function $K({config:e,models:t,save:n}){let r=e.classifier,i=vK.find(e=>e.id===r.provider)?.label;return(0,L.jsx)(mz,{prominent:!0,title:eK.classifier,children:(0,L.jsxs)(NG,{children:[(0,L.jsx)(RK,{label:bK.enabled,help:bK.enabledHelp,checked:r.enabled,onChange:e=>void n({classifier:{enabled:e}})}),(0,L.jsx)(MG,{label:bK.host,children:(0,L.jsx)(PG,{value:r.provider,items:vK.map(e=>({value:e.id,label:e.label})),label:bK.host,onChange:e=>void n({classifier:{provider:e}})})}),(0,L.jsx)(MG,{label:bK.model,help:bK.modelHelp,children:(0,L.jsx)(zK,{value:r.model,label:bK.model,placeholder:`the host's default`,onSave:e=>void n({classifier:{model:e}})})}),(0,L.jsx)(MG,{label:bK.key,help:bK.keyNote,children:(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground sm:text-right`,children:i??r.provider})}),yK.map(e=>(0,L.jsx)(RK,{label:e.label,help:e.help,checked:r.features[e.id],onChange:t=>void n({classifier:{features:{[e.id]:t}}})},e.id)),(0,L.jsx)(MG,{label:bK.cheap,help:bK.cheapHelp,children:(0,L.jsx)(LK,{value:r.effort.cheapModel,models:t,label:bK.cheap,none:!0,onChange:e=>void n({classifier:{effort:{cheapModel:e}}})})})]})})}function eq(){let e=qW(),t=async e=>{if(!e)return YW();let t=await JW();t===`granted`?B.success(xK.notificationsOn):B.error(t===`unsupported`?xK.notificationsUnsupported:xK.notificationsBlocked)};return(0,L.jsx)(mz,{prominent:!0,title:eK.notifications,children:(0,L.jsx)(NG,{children:(0,L.jsx)(RK,{label:xK.notificationsLabel,help:xK.notificationsHelp,checked:e,onChange:e=>void t(e)})})})}function tq(){let{available:e,install:t}=y(),n=b(),r=x();return(0,L.jsx)(mz,{prominent:!0,title:eK.install,children:(0,L.jsxs)(NG,{children:[(0,L.jsx)(MG,{label:xK.installLabel,help:n?xK.installedNow:xK.installHelp,children:n?null:(0,L.jsx)(`div`,{className:`flex sm:justify-end`,children:(0,L.jsx)(Y,{label:xK.installButton,icon:um,tone:`primary`,onClick:()=>e?void t().then(()=>B.success(xK.installDone)):B.warning(xK.installUnavailable)})})}),r.supported?(0,L.jsx)(MG,{label:xK.fullscreenLabel,help:xK.fullscreenHelp,children:(0,L.jsx)(`div`,{className:`flex sm:justify-end`,children:(0,L.jsx)(Y,{label:r.on?xK.fullscreenOn:xK.fullscreenOff,icon:r.on?eh:Hm,pressed:r.on,onClick:()=>void r.toggle()})})}):null]})})}var nq=[`Agents`,`Workflow`,`Linting`,`Lobby`,`Classifier`,`Appearance & notifications`];function rq({config:e,models:t,onConfig:n}){let[r,i]=(0,m.useState)(`Agents`),a=(0,m.useRef)(Promise.resolve()),o=e=>{let t=async()=>{try{return n((await qf(`settings.set`,{patch:e})).config),B.success(xK.saved),!0}catch(e){return B.error(e instanceof Error?e.message:`That did not work. Try again.`),!1}},r=a.current.then(t,t);return a.current=r,r};return(0,L.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-6 px-5 pt-5 pb-dock sm:px-8 sm:pt-8`,children:[(0,L.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:xK.title}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:xK.intro})]}),(0,L.jsx)(`nav`,{"aria-label":`Settings sections`,className:`-mx-1 flex flex-wrap gap-1 border-b border-border pb-3`,children:nq.map(e=>(0,L.jsx)(`button`,{type:`button`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"aria-current":r===e?`page`:void 0,"aria-controls":`settings-${e.split(` `)[0]}`,onClick:()=>i(e),className:q(`h-8 rounded-lg border border-transparent px-3 text-sm font-medium outline-none transition-[box-shadow,color] focus-visible:ring-3 focus-visible:ring-ring/40`,r===e?`btn-raised bg-card text-foreground`:`text-muted-foreground hover:text-foreground`),children:e},e))}),(0,L.jsx)(`div`,{id:`settings-Agents`,hidden:r!==`Agents`,"aria-hidden":r!==`Agents`,children:(0,L.jsx)(mz,{prominent:!0,title:eK.agents,children:(0,L.jsx)(`div`,{className:`grid grid-cols-1 gap-4 xl:grid-cols-2`,children:WG.map(n=>(0,L.jsx)(WK,{kind:n,config:e,models:t,save:o},n))})})}),(0,L.jsx)(`div`,{id:`settings-Workflow`,hidden:r!==`Workflow`,"aria-hidden":r!==`Workflow`,children:(0,L.jsx)(qK,{config:e,save:o})}),(0,L.jsx)(`div`,{id:`settings-Linting`,hidden:r!==`Linting`,"aria-hidden":r!==`Linting`,children:(0,L.jsx)(ZK,{config:e,save:o})}),(0,L.jsx)(`div`,{id:`settings-Lobby`,hidden:r!==`Lobby`,"aria-hidden":r!==`Lobby`,children:(0,L.jsx)(QK,{config:e,save:o})}),(0,L.jsx)(`div`,{id:`settings-Classifier`,hidden:r!==`Classifier`,"aria-hidden":r!==`Classifier`,children:(0,L.jsx)($K,{config:e,models:t,save:o})}),(0,L.jsx)(`div`,{id:`settings-Appearance`,hidden:r!==`Appearance & notifications`,"aria-hidden":r!==`Appearance & notifications`,children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,L.jsx)(DK,{}),(0,L.jsx)(eq,{}),(0,L.jsx)(tq,{})]})})]})}function iq(){return(0,L.jsx)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-4 px-5 pt-5 pb-dock sm:px-8 sm:pt-8`,role:`status`,"aria-label":xK.loading,children:[0,1,2,3].map(e=>(0,L.jsx)(`div`,{className:`h-48 rounded-lg bg-muted motion-safe:animate-pulse`},e))})}function aq(){let e=UD(`settings.get`,{},[`status`]),[t,n]=(0,m.useState)(),r=(0,m.useRef)(0),i=(0,m.useCallback)(e=>{r.current=performance.now(),n(e)},[]);return(0,m.useEffect)(()=>{e.data&&e.requestedAt>r.current&&n(e.data.config)},[e.data,e.requestedAt]),!t&&e.error?(0,L.jsx)(LD,{message:`${xK.loadFailed} ${e.error}`,onRetry:e.reload}):t?(0,L.jsx)(rq,{config:t,models:e.data?.models??[],onConfig:i}):(0,L.jsx)(iq,{})}function oq(){let e=globalThis.DOMParser;if(!e)throw Error(`DOMParser is unavailable`);return new e}var sq=`default-src 'none'; script-src 'none'; style-src 'unsafe-inline'; img-src 'none'; font-src 'none'; connect-src 'none'; media-src 'none'; frame-src 'none'; object-src 'none'; form-action 'none'; base-uri 'none'`,cq=new Set(`div span p br hr h1 h2 h3 h4 h5 h6 section article header footer main aside nav ul ol li dl dt dd strong em b i u s small sub sup blockquote pre code table thead tbody tfoot tr th td caption colgroup col figure figcaption style`.split(` `)),lq=new Set(`class id title role aria-label aria-hidden colspan rowspan scope`.split(` `));function uq(e){if(!e||typeof e!=`object`)return;let t=e;if(!(typeof t.html!=`string`||t.html.length>1e5)&&!(t.css!==void 0&&(typeof t.css!=`string`||t.css.length>5e4)))return{html:t.html,...typeof t.css==`string`?{css:t.css}:{}}}function dq(e){let t=e.replace(/\/\*[\s\S]*?\*\//g,``);return/\\|@import|url\s*\(|image-set\s*\(|expression\s*\(|behavior\s*:|-moz-binding/i.test(t)?``:t.replace(/<\/?style/gi,``)}function fq(e){if(!cq.has(e.localName)||e.namespaceURI!==`http://www.w3.org/1999/xhtml`){e.remove();return}for(let t of[...e.attributes])t.name===`style`?e.setAttribute(`style`,dq(t.value)):lq.has(t.name)||e.removeAttribute(t.name);e.localName===`style`&&(e.textContent=dq(e.textContent??``));for(let t of[...e.children])fq(t)}function pq(e,t){try{return mq(e,t??oq())}catch{return`<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${sq}"><meta name="referrer" content="no-referrer"></head><body><p role="status">Static mockup unavailable. The preview could not be safely rendered.</p></body></html>`}}function mq(e,t){let n=t.parseFromString(e.html,`text/html`);for(let e of[...n.head.children,...n.body.children])fq(e);let r=[...n.head.querySelectorAll(`style`)].map(e=>e.outerHTML).join(``);return`<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${sq}"><meta name="referrer" content="no-referrer"><style>body{margin:16px;overflow-wrap:anywhere}*{box-sizing:border-box}${dq(e.css??``).replace(/</g,`\\3c `)}</style>${r}</head><body>${n.body.innerHTML}</body></html>`}function hq({preview:e,label:t,className:n,frameWidth:r,minWidth:i,onOpen:a}){let o=(0,m.useMemo)(()=>pq(e),[e]),s=(0,m.useRef)(null),[c,l]=(0,m.useState)();if((0,m.useLayoutEffect)(()=>{let e=s.current;if(!r&&!i||!e)return;let t=()=>l({width:e.clientWidth,height:e.clientHeight});if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[r,i]),!r&&!i)return(0,L.jsx)(`iframe`,{title:`Static mockup: ${t}`,sandbox:``,referrerPolicy:`no-referrer`,srcDoc:o,className:q(`h-80 w-full rounded-lg border bg-background`,n)});let u=r??Math.max(c?.width??0,i??0),d=c&&c.width>0&&u>0?Math.min(1,c.width/u):1;return(0,L.jsxs)(`div`,{ref:s,className:q(`group/mock relative h-80 w-full overflow-hidden rounded-lg border bg-background`,n),children:[(0,L.jsx)(`iframe`,{title:`Static mockup: ${t}`,sandbox:``,referrerPolicy:`no-referrer`,srcDoc:o,tabIndex:a?-1:void 0,className:q(`absolute top-0 left-0 origin-top-left border-0`,a&&`pointer-events-none`),style:{width:u||`100%`,height:c?c.height/d:`100%`,transform:`scale(${d})`}}),a?(0,L.jsx)(`button`,{type:`button`,"data-compact":``,onClick:a,"aria-label":`Expand the mockup: ${t}`,className:`absolute inset-0 flex items-end justify-end p-2 outline-none focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:ring-inset`,children:(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md border border-border bg-card/90 px-1.5 py-0.5 text-[0.6875rem] font-medium text-muted-foreground opacity-0 shadow-sm backdrop-blur transition-opacity group-hover/mock:opacity-100 group-focus-within/mock:opacity-100`,children:[(0,L.jsx)(Bm,{"aria-hidden":`true`,className:`size-3`}),`Expand`]})}):null]})}var gq=/\s*\(recommended\)\s*$/i,_q=1024,vq=e=>e.replace(gq,``);function yq(e){return!!(e&&(e.htmlPreview||e.image||e.preview))}function bq({option:e}){let t=vq(e.label);return yq(e)?(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[e.htmlPreview?(0,L.jsx)(hq,{preview:e.htmlPreview,label:t,minWidth:_q,className:`h-auto min-h-[18rem] flex-1`}):null,e.image?(0,L.jsx)(`img`,{src:Uf(e.image),alt:`Mockup: ${t}`,className:`min-h-0 w-full flex-1 rounded-lg border bg-background object-contain`}):null,e.preview?(0,L.jsx)(dz,{text:e.preview,className:q(`overflow-auto rounded-lg border bg-background p-4 text-sm`,!e.htmlPreview&&!e.image&&`flex-1`)}):null]}):(0,L.jsx)(`p`,{className:`grid h-full place-items-center p-6 text-sm text-muted-foreground`,children:`No mockup for this option.`})}function xq({options:e,start:t,title:n,picked:r=[],multi:i=!1,onChoose:a,onClose:o,onIndex:s}){let c=Jd(),l=(0,m.useRef)(null),u=(0,m.useRef)(null),[d,f]=(0,m.useState)(()=>Math.min(Math.max(0,t),e.length-1)),p=e[d],h=e.length-1;(0,m.useEffect)(()=>s?.(d),[d,s]),(0,m.useLayoutEffect)(()=>{let e=l.current;e&&(e.scrollLeft=d*e.clientWidth),u.current?.focus()},[]);let g=(0,m.useCallback)(e=>{let t=Math.min(Math.max(0,e),h),n=l.current;f(t),n?.scrollTo({left:t*n.clientWidth,behavior:c?`auto`:`smooth`})},[h,c]);(0,m.useEffect)(()=>{let e=l.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>{e.scrollLeft=d*e.clientWidth});return t.observe(e),()=>t.disconnect()},[d]);function _(){let e=l.current;if(!e||e.clientWidth===0)return;let t=Math.round(e.scrollLeft/e.clientWidth);t!==d&&t>=0&&t<=h&&f(t)}function v(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=t.target;if(n.closest(`input, textarea, [contenteditable='true']`))return;let r={ArrowLeft:-1,ArrowRight:1,PageUp:-1,PageDown:1}[t.key];if(r){t.preventDefault(),g(d+r);return}if(t.key===`Home`||t.key===`End`){t.preventDefault(),g(t.key===`Home`?0:h);return}let i=Number(t.key);if(Number.isInteger(i)&&i>=1&&i<=e.length){t.preventDefault(),g(i-1);return}t.key===`Enter`&&a&&!(n instanceof HTMLButtonElement)&&(t.preventDefault(),a(d))}let y=r.includes(d);return(0,L.jsxs)(`div`,{ref:u,tabIndex:-1,"data-autofocus":``,onKeyDown:v,className:`mockup-viewer flex h-full min-h-0 flex-col outline-none`,role:`region`,"aria-label":`Mockups: ${n}`,"aria-roledescription":`carousel`,children:[(0,L.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 border-b border-border px-4 py-3 sm:px-5`,children:[(0,L.jsx)(J,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Back to the question`,title:`Back · Esc`,onClick:()=>o(d),children:(0,L.jsx)(Qm,{"aria-hidden":`true`})}),(0,L.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:n}),(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,"aria-live":`polite`,children:[d+1,` of `,e.length]}),(0,L.jsx)(`div`,{role:`tablist`,"aria-label":`Options`,className:`flex w-full flex-wrap gap-1.5 sm:w-auto`,children:e.map((e,t)=>(0,L.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":t===d,"aria-controls":`mockup-slide-${t}`,"data-compact":``,onClick:()=>g(t),className:q(`inline-flex h-7 max-w-48 items-center gap-1 rounded-lg border px-2.5 text-xs font-medium transition-colors outline-none focus-visible:ring-3 focus-visible:ring-ring/40`,t===d?`border-primary/50 bg-accent text-foreground`:`border-border text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,L.jsx)(`span`,{className:`tabular-nums text-muted-foreground`,children:t+1}),(0,L.jsx)(`span`,{className:`truncate`,children:vq(e.label)}),r.includes(t)?(0,L.jsx)(Op,{"aria-label":`picked`,className:`size-3 text-primary`}):null]},t))})]}),(0,L.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,L.jsx)(`div`,{ref:l,onScroll:_,className:`mockup-track flex h-full snap-x snap-mandatory overflow-x-auto overflow-y-hidden overscroll-x-contain`,children:e.map((t,n)=>(0,L.jsxs)(`section`,{id:`mockup-slide-${n}`,role:`tabpanel`,"aria-roledescription":`slide`,"aria-label":`${n+1} of ${e.length}: ${vq(t.label)}`,"aria-hidden":n!==d,className:`flex h-full w-full shrink-0 snap-center snap-always flex-col gap-2 px-4 py-4 sm:px-14`,children:[(0,L.jsxs)(`div`,{className:`flex items-baseline gap-2 text-sm`,children:[(0,L.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[n+1,`.`]}),(0,L.jsx)(`span`,{className:`font-medium`,children:vq(t.label)}),gq.test(t.label)?(0,L.jsx)(`span`,{className:`text-xs font-medium text-primary`,children:`Recommended`}):null,r.includes(n)?(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-primary`,children:[(0,L.jsx)(Op,{"aria-hidden":`true`,className:`size-3`}),`picked`]}):null]}),t.description?(0,L.jsx)(dz,{text:t.description,className:`text-sm text-muted-foreground`}):null,(0,L.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,L.jsx)(bq,{option:t})})]},n))}),d>0?(0,L.jsx)(J,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Previous option`,title:`Previous · ←`,onClick:()=>g(d-1),className:`absolute top-1/2 left-2 -translate-y-1/2 rounded-full max-sm:hidden`,children:(0,L.jsx)(Mp,{"aria-hidden":`true`})}):null,d<h?(0,L.jsx)(J,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Next option`,title:`Next · →`,onClick:()=>g(d+1),className:`absolute top-1/2 right-2 -translate-y-1/2 rounded-full max-sm:hidden`,children:(0,L.jsx)(Pp,{"aria-hidden":`true`})}):null]}),(0,L.jsxs)(`footer`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2 border-t border-border px-4 py-3 sm:px-5`,children:[(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,L.jsx)(lD,{chord:`←→`,children:`option`}),a?(0,L.jsx)(lD,{chord:`Enter`,children:i?y?`unpick`:`pick`:`choose`}):null,(0,L.jsx)(lD,{chord:`Esc`,children:`back`})]}),a&&p?(0,L.jsxs)(J,{type:`button`,onClick:()=>a(d),className:`max-w-full`,children:[i&&y?`Unpick`:i?`Pick`:`Choose`,(0,L.jsx)(`span`,{className:`truncate`,children:vq(p.label)})]}):null]})]})}function Sq(e,t,n){e.nativeEvent.isComposing||(e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n()),e.key===`Enter`&&e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),t()))}function Cq({text:e,disabled:t=!1,onSave:n,onCancel:r}){let[i,a]=(0,m.useState)(e),[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(``),u=(0,m.useRef)(null);(0,m.useEffect)(()=>{u.current?.focus({preventScroll:!0}),u.current?.select()},[]);let d=async()=>{if(!(t||o||!i.trim())){s(!0),l(``);try{await n(i.trim()),r()}catch(e){l(e instanceof Error?e.message:String(e)),s(!1)}}};return(0,L.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,onKeyDown:e=>Sq(e,()=>void d(),()=>{o||r()}),children:[(0,L.jsxs)(`label`,{className:`text-sm`,children:[`Edit message`,(0,L.jsx)(OO,{ref:u,value:i,onChange:e=>a(e.target.value),disabled:o,className:`mt-2 max-h-[40vh] min-h-24`})]}),c?(0,L.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Could not save. `,c]}):null,(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(J,{size:`sm`,onClick:()=>void d(),disabled:t||o||!i.trim(),children:o?`Saving…`:`Save`}),(0,L.jsx)(J,{size:`sm`,variant:`ghost`,disabled:o,onClick:r,children:`Cancel`})]})]})}var wq=1200;function Tq({question:e}){let[t,n]=(0,m.useState)(),r=vD(t!==void 0,_D.sheet),i=e.options.flatMap((e,t)=>e.mockup?[{option:e,index:t,mockup:e.mockup}]:[]);if(i.length===0)return null;let a=e.options.map(e=>({label:e.label,description:e.description,...e.mockup?{htmlPreview:e.mockup}:{}}));return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`ul`,{"aria-label":`Mockups`,className:`grid grid-cols-2 gap-2 sm:grid-cols-3`,children:i.map(({option:e,index:t,mockup:r})=>(0,L.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,L.jsx)(hq,{preview:r,label:vq(e.label),frameWidth:wq,onOpen:()=>n(t),className:`aspect-[3/2] h-auto`}),(0,L.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[(0,L.jsxs)(`span`,{className:`tabular-nums`,children:[t+1,`.`]}),` `,vq(e.label)]})]},t))}),(0,L.jsx)(uD,{open:t!==void 0&&r,onOpenChange:e=>{e||n(void 0)},label:`Mockups: ${e.text}`,className:`h-[min(92svh,60rem)] max-h-[min(92svh,60rem)] max-w-6xl`,children:t===void 0?null:(0,L.jsx)(xq,{options:a,start:t,title:e.text,onClose:()=>n(void 0)})})]})}function Eq({questions:e}){return(0,L.jsx)(`ol`,{className:`mt-1 flex flex-col gap-2`,children:e.map((e,t)=>(0,L.jsxs)(`li`,{className:`card-raised flex flex-col gap-2 rounded-xl border p-3 text-sm`,style:{"--orb":sV(e.from)},children:[(0,L.jsxs)(`p`,{className:`flex items-start gap-2`,children:[(0,L.jsxs)(`span`,{className:`mt-px inline-flex shrink-0 items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--orb)_12%,transparent)] px-2 py-0.5 text-xs font-medium text-[color-mix(in_oklab,var(--orb)_85%,var(--foreground))]`,children:[(0,L.jsx)(nV,{source:e.from,className:`size-3`}),iV(e.from)]}),(0,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsxs)(`span`,{className:`sr-only`,children:[`Question `,t+1,`: `]}),e.text]})]}),e.options.length?(0,L.jsx)(`ul`,{"aria-label":`Options`,className:`flex flex-wrap gap-1.5`,children:e.options.map(e=>(0,L.jsxs)(`li`,{className:`rounded-lg border border-border bg-muted/60 px-2 py-1 text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`font-medium text-foreground`,children:e.label}),e.description?` — ${e.description}`:``]},e.label))}):null,(0,L.jsx)(Tq,{question:e})]},t))})}function Dq({message:e}){let t=e.decided??[];return t.length?(0,L.jsx)(`ul`,{className:`mt-1 flex flex-col gap-1.5`,children:t.map((e,t)=>(0,L.jsxs)(`li`,{className:`flex items-start gap-2 rounded-lg bg-muted/60 px-2.5 py-1.5 text-sm`,children:[(0,L.jsx)(Op,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-success`}),(0,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsx)(`span`,{className:q(`font-medium`,aV(e.from)),children:iV(e.from)}),` `,e.question,` → `,(0,L.jsx)(`strong`,{children:e.answer}),(0,L.jsxs)(`span`,{className:`block text-xs text-muted-foreground`,children:[`decided by the classifier (`,e.probability.toFixed(2),`); comment on the plan to overrule`]})]})]},t))}):null}function Oq({message:e,index:t,busy:n}){let[r,i]=(0,m.useState)(!1),[a,o]=(0,m.useState)(),s=a&&(a.editedAt??0)>(e.editedAt??0)?a:e,c=n||s!==e,l=async n=>{let r=await qf(`planner.editMessage`,{messageIndex:t,at:e.at,text:n});o(r.message)},u=!e.settled?.length&&!r?(0,L.jsxs)(J,{size:`xs`,variant:`ghost`,disabled:c,onClick:()=>i(!0),className:`text-muted-foreground`,children:[(0,L.jsx)(Sh,{"aria-hidden":`true`}),`Edit`]}):null;return(0,L.jsx)(KH,{time:e.at>0?AO(e.at):void 0,head:!0,note:s.editedAt?`(edited)`:void 0,below:u,children:r?(0,L.jsx)(Cq,{text:s.text,disabled:n,onSave:l,onCancel:()=>i(!1)}):(0,L.jsx)(dz,{text:s.text})})}function kq({message:e,index:t,busy:n}){if(e.role===`you`)return(0,L.jsx)(Oq,{message:e,index:t,busy:n});let r=e.questions??[];return(0,L.jsxs)(GH,{source:`PLANNER`,name:`Panel`,time:e.at>0?AO(e.at):void 0,head:!0,bubble:r.length===0,aside:r.length?`${r.length} question${r.length===1?``:`s`}`:void 0,children:[r.length>0?(0,L.jsx)(Eq,{questions:r}):(0,L.jsx)(dz,{text:e.text}),(0,L.jsx)(Dq,{message:e})]})}function Aq({messages:e,seed:t,busy:n=!1}){return(0,L.jsxs)(`div`,{className:`chat-column`,role:`log`,"aria-label":`Panel conversation`,children:[t?(0,L.jsx)(qH,{children:t}):null,e.map((e,t)=>(0,L.jsx)(kq,{message:e,index:t,busy:n},`${e.at}-${t}`)),n?(0,L.jsx)(GH,{source:`PLANNER`,name:`Panel`,head:!0,live:!0,aside:`the panel is thinking`,children:(0,L.jsx)(JH,{className:`mt-1`})}):null]})}var jq=`ORACLE`,Mq=`No draft yet.`,Nq=`The draft appears after the panel's first round.`,Pq=`What each seat needs`,Fq=[`backend`,`designer`,`qa`,`researcher`],Iq={backend:`DEV`,designer:`DESIGN`,qa:`QA`,researcher:`RESEARCH`},Lq=`Describe a task in the box below. The panel asks what it needs to know, round by round, until the plan is clear.`,Rq={ORACLE:`Chairs the panel, and settles the last round alone.`,DEV:`Code, data and the APIs it touches.`,DESIGN:`Screens, flows and the words on them.`,QA:`Tests, edge cases and what could break.`,RESEARCH:`Prior art, docs and sources.`},zq=[{title:`Describe it`,text:`Say what you want in the box below.`},{title:`The panel asks`,text:`Each seat asks what it needs to know.`},{title:`A draft forms`,text:`Answer, comment on lines, go another round.`},{title:`Save the plan`,text:`Keep it, or start it as a task.`}];function Bq(e){let t=e.filter(e=>e.member);return`${t.filter(e=>e.seated).length} of ${t.length} seated`}function Vq(e,t=0){return t<=0?`round ${e}`:e>t?`round ${e} · past the limit, revising`:e===t?`final round ${e}/${t}`:`round ${e}/${t}`}function Hq(e,t){return`${e} ${t}${e===1?``:`s`}`}function Uq(e){return e.round===0&&e.messages.length===0&&!e.busy}function Wq(e){let t=e.members.find(e=>e.status===`failed`);if(t)return(t.error??`${Iq[t.member]} failed`).split(`
|
|
97
|
+
`)[0]}function Gq(e){let t=[],n=Wq(e);return e.busy?t.push(Vq(e.round,e.limit)):n?t.push(`${n} — Retry runs the round again`):e.questions.length>0&&t.push(`${Hq(e.questions.length,`question`)} waiting`),!e.busy&&e.round>0&&t.push(Vq(e.round,e.limit)),!e.busy&&e.limit>0&&e.round+1===e.limit&&t.push(`the next round is the last: the oracle settles the rest`),t}function Kq(e,t){let n=Iq[e],r=t.seats.includes(e),i=t.members.find(t=>t.member===e),a={member:e,label:n,seated:r,working:!1};if(!r)return{...a,text:`off`};if(i?.status===`thinking`)return{...a,working:!0,text:i.step??`thinking`};if(i?.status===`failed`)return{...a,text:`failed — Retry`};if(!i)return{...a,text:`·`};if(i.reply?.status===`ready`)return{...a,text:`ready`};let o=t.questions.filter(e=>e.from===n).length;return{...a,text:o===0?`done`:Hq(o,`question`)}}function qq(e){let t=e.questions.filter(e=>e.from===jq).length;return[{label:jq,seated:!0,working:e.busy,text:e.busy?`chairing`:t?Hq(t,`question`):`·`},...Fq.map(t=>Kq(t,e))]}function Jq(e){let t=!1;return e.split(`
|
|
98
|
+
`).map(e=>{let n=e.trimStart().startsWith("```");return n&&(t=!t),{text:e,fenced:t||n}})}function Yq({notes:e}){return(0,L.jsx)(L.Fragment,{children:e.map((e,t)=>(0,L.jsx)(`p`,{className:`ml-6 rounded-lg border border-primary/15 bg-accent px-3 py-1.5 text-sm text-foreground italic`,children:e},t))})}var Xq=[],Zq=(0,m.memo)(function({row:e,notes:t,onComment:n}){let r=e.text.trim(),i=()=>n(r);return(0,L.jsxs)(`li`,{className:`group/line [contain-intrinsic-size:auto_2.75rem] [content-visibility:auto]`,children:[(0,L.jsxs)(`div`,{className:`flex items-start gap-1`,children:[(0,L.jsx)(`span`,{className:`flex w-4 shrink-0 justify-center pt-3.5`,"aria-hidden":`true`,children:t.length>0?(0,L.jsx)(`span`,{className:`size-2 rounded-full bg-primary`}):null}),(0,L.jsx)(`div`,{className:q(`min-w-0 flex-1 cursor-pointer rounded-lg px-2 py-1.5 transition-colors hover:bg-muted`,e.fenced&&`font-mono text-sm whitespace-pre-wrap break-words`),onClick:e=>!e.target.closest(`a`)&&i(),children:e.fenced?e.text:(0,L.jsx)(dz,{text:e.text})}),(0,L.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/line:opacity-100 focus-visible:opacity-100 [@media(hover:none)]:opacity-100`,"aria-label":`Comment on this line: ${r}`,onClick:i,children:(0,L.jsx)(Km,{"aria-hidden":`true`})})]}),(0,L.jsx)(Yq,{notes:t})]})});function Qq({draft:e,comments:t,onComment:n}){let r=(0,m.useMemo)(()=>Jq(e),[e]),i=nz(r.length);return(0,L.jsx)(`ul`,{className:`flex flex-col`,"aria-label":`Draft plan lines`,children:r.slice(0,i).map((e,r)=>e.text.trim()?(0,L.jsx)(Zq,{row:e,notes:t.get(e.text.trim())??Xq,onComment:n},r):(0,L.jsx)(`li`,{"aria-hidden":`true`,className:`h-2`},r))})}function $q({notes:e}){return e.length===0?null:(0,L.jsx)(mz,{title:Pq,children:(0,L.jsx)(`dl`,{className:`flex flex-col gap-2 text-sm`,children:e.map((e,t)=>(0,L.jsxs)(`div`,{className:`flex gap-3`,children:[(0,L.jsx)(`dt`,{className:q(`w-20 shrink-0 font-medium`,aV(e.from)),children:iV(e.from)}),(0,L.jsx)(`dd`,{className:`min-w-0 flex-1`,children:(0,L.jsx)(dz,{text:e.text})})]},t))})})}function eJ({cell:e,intro:t}){let n=t?e.member?e.seated?`seated`:`not seated`:`chairs`:e.text;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`span`,{className:q(`inline-flex items-center gap-1.5 font-medium`,e.seated?aV(e.label):`text-muted-foreground`),children:[(0,L.jsx)(nV,{source:e.label,className:`size-3.5`}),iV(e.label)]}),e.working&&!t?(0,L.jsx)(FD,{className:`size-3.5`,"aria-hidden":`true`}):null,(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:n})]})}function tJ({cell:e,intro:t,onToggled:n}){let{member:r}=e,i=`inline-flex min-h-8 items-center gap-2 rounded-lg border border-border px-3 text-[0.8125rem]`;if(!r)return(0,L.jsx)(`li`,{className:q(i,`bg-muted`),children:(0,L.jsx)(eJ,{cell:e,intro:t})});let a=async()=>{await V(`planner.toggleSeat`,{member:r})&&n()};return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`label`,{className:q(i,`cursor-pointer transition-colors`,e.seated?`btn-raised bg-card`:`border-dashed text-muted-foreground hover:bg-muted`),children:[(0,L.jsx)(wV,{checked:e.seated,onCheckedChange:()=>void a(),"aria-label":`${iV(e.label)} sits on the panel`}),(0,L.jsx)(eJ,{cell:e,intro:t})]})})}function nJ({cells:e,intro:t,onToggled:n}){return(0,L.jsx)(`ul`,{"aria-label":`Panel`,className:`flex flex-wrap gap-2`,children:e.map(e=>(0,L.jsx)(tJ,{cell:e,intro:t,onToggled:n},e.label))})}function rJ({cell:e,onToggled:t}){let{member:n}=e,r=iV(e.label),i=q(`flex h-full flex-col gap-2 rounded-xl border p-3.5 transition-[background-color,border-color,box-shadow]`,e.seated?`border-[color-mix(in_oklab,var(--orb)_26%,var(--border))] bg-[color-mix(in_oklab,var(--orb)_5%,var(--card))] shadow-card`:`border-dashed border-input bg-transparent`),a=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:q(`grid size-6 place-items-center rounded-lg bg-[color-mix(in_oklab,var(--orb)_14%,transparent)] text-[color-mix(in_oklab,var(--orb)_85%,var(--foreground))]`,!e.seated&&`opacity-50 grayscale`),children:(0,L.jsx)(nV,{source:e.label,className:`size-3.5`})}),(0,L.jsx)(`span`,{className:q(`truncate text-sm font-semibold`,e.seated?aV(e.label):`text-muted-foreground`),children:r})]}),n?(0,L.jsx)(wV,{checked:e.seated,onCheckedChange:()=>void iJ(n,t),"aria-label":`${r} sits on the panel`}):null]}),(0,L.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:Rq[e.label]}),(0,L.jsx)(`span`,{className:q(`mt-auto text-xs font-medium`,e.seated?`text-foreground`:`text-muted-foreground`),children:n?e.seated?`seated`:`sits this one out`:`always chairs`})]}),o={"--orb":sV(e.label)};return n?(0,L.jsx)(`li`,{style:o,children:(0,L.jsx)(`label`,{className:q(i,`cursor-pointer`,e.seated?`hover:shadow-[0_0_0_3px_color-mix(in_oklab,var(--orb)_10%,transparent)]`:`hover:bg-muted`),children:a})}):(0,L.jsx)(`li`,{style:o,children:(0,L.jsx)(`div`,{className:i,children:a})})}async function iJ(e,t){await V(`planner.toggleSeat`,{member:e})&&t()}function aJ({cells:e,onToggled:t}){return(0,L.jsx)(`ul`,{"aria-label":`Panel`,className:`grid grid-cols-1 gap-3 @lg:grid-cols-2 @4xl:grid-cols-5`,children:e.map(e=>(0,L.jsx)(rJ,{cell:e,onToggled:t},e.label))})}function oJ({snap:e}){let t=Gq(e),n=!e.busy&&Wq(e)!==void 0;return(0,L.jsxs)(`p`,{role:`status`,className:n?`flex items-center gap-2 text-sm text-destructive`:`flex items-center gap-2 text-sm text-muted-foreground`,children:[e.busy?(0,L.jsx)(FD,{className:`size-3.5`,"aria-hidden":`true`}):null,t.join(` · `)]})}function sJ({snap:e,onDone:t}){let n=VD(`status`).data?.keys.find(e=>e.action===`savePlan`)?.label,r=e=>async()=>{await V(e,{})&&t()};return(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[e.questions.length>0&&!e.busy?(0,L.jsx)(Y,{label:`Answer questions`,icon:Wm,tone:`primary`,shortcut:`A`,onClick:()=>void r(`planner.answer`)()}):null,e.retryable?(0,L.jsx)(Y,{label:`Retry`,icon:Mh,shortcut:`R`,onClick:()=>void r(`planner.retry`)()}):null,(0,L.jsx)(Y,{"data-plan-save":!0,label:`Save the plan`,text:`Save`,icon:Ih,shortcut:n??`Ctrl+S`,disabled:!e.draft||e.busy,onClick:()=>void r(`planner.save`)()}),(0,L.jsx)(WO,{icon:vm,label:`New plan`,shortcut:`N`,title:`Start a new plan?`,description:`The conversation and the draft are left behind. Saved plans are not touched.`,confirmLabel:`New plan`,onConfirm:()=>void V(`planner.new`,{}).then(t)})]})}function cJ({snap:e,onDone:t}){return(0,L.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-3 border-b border-border px-5 py-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:`Planning`}),(0,L.jsx)(oJ,{snap:e})]}),(0,L.jsx)(sJ,{snap:e,onDone:t})]}),(0,L.jsx)(nJ,{cells:qq(e),intro:!1,onToggled:t})]})}function lJ({line:e,onClose:t,onSent:n}){let r=vD(e!==void 0,_D.confirm);return(0,L.jsx)(uD,{open:e!==void 0&&r,onOpenChange:e=>!e&&t(),label:`Comment on this line`,className:`max-w-xl`,children:(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 p-6`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{className:`text-base font-medium`,children:`Comment on this line`}),(0,L.jsx)(`p`,{className:`mt-1 line-clamp-3 text-sm break-words text-muted-foreground`,children:e})]}),(0,L.jsx)(dB,{label:`Your comment`,hint:`Enter adds the comment · Esc cancels`,buttonLabel:`Add comment`,onSend:async r=>e===void 0||!await V(`planner.commentLine`,{line:e,text:r.trim()})?!1:(n(e,r.trim()),t(),!0)})]})})}function uJ({limit:e}){return e<=0?null:(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`flex gap-1`,children:Array.from({length:e},(t,n)=>(0,L.jsx)(`span`,{className:q(`h-1.5 w-4 rounded-full`,n===e-1?`bg-primary`:`bg-border`)},n))}),(0,L.jsxs)(`span`,{children:[`up to `,e,` rounds, the last the oracle's`]})]})}function dJ({snap:e,onDone:t}){let n=qq(e);return(0,L.jsx)(`div`,{className:`@container flex-1 overflow-y-auto px-5 pt-8 pb-dock sm:px-8 sm:pt-10`,children:(0,L.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-8`,children:[(0,L.jsxs)(`header`,{className:`flex flex-col gap-4 @3xl:flex-row @3xl:items-end @3xl:justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`card-raised grid size-11 shrink-0 place-items-center rounded-xl border text-primary`,children:(0,L.jsx)(Ph,{className:`size-5`})}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Plan with the panel`}),(0,L.jsx)(`p`,{className:`max-w-xl text-sm leading-relaxed text-muted-foreground`,children:Lq})]})]}),(0,L.jsx)(uJ,{limit:e.limit})]}),(0,L.jsxs)(`section`,{"aria-labelledby":`plan-panel`,className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h3`,{id:`plan-panel`,className:`text-xs text-muted-foreground`,children:(0,L.jsx)(pz,{title:`The panel`,right:Bq(n)})}),(0,L.jsx)(aJ,{cells:n,onToggled:t})]}),(0,L.jsxs)(`section`,{"aria-labelledby":`plan-steps`,className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h3`,{id:`plan-steps`,className:`text-xs text-muted-foreground`,children:(0,L.jsx)(pz,{title:`How a plan comes together`})}),(0,L.jsx)(`ol`,{className:`grid gap-3 @2xl:grid-cols-2 @4xl:grid-cols-4`,children:zq.map((e,t)=>(0,L.jsxs)(`li`,{className:`card-raised relative flex gap-3 rounded-xl border p-3.5`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-6 shrink-0 place-items-center rounded-full bg-accent text-xs font-semibold text-primary tabular-nums`,children:t+1}),(0,L.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,L.jsx)(`span`,{className:`text-sm font-medium`,children:e.title}),(0,L.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:e.text})]})]},e.title))})]}),(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(mp,{"aria-hidden":`true`,className:`size-4 text-primary motion-safe:animate-bounce`}),`Start in the box below.`,(0,L.jsx)(lD,{chord:`/`,children:`write`}),(0,L.jsx)(lD,{chord:`Enter`,children:`send to the panel`})]})]})})}function fJ({snap:e,wide:t}){let{ref:n,onScroll:r}=BH(JSON.stringify(e.messages));return(0,L.jsxs)(CO,{className:`flex flex-col`,children:[(0,L.jsx)(`h2`,{className:`flex min-h-12 shrink-0 items-center border-b border-border px-4 text-sm font-medium`,children:(0,L.jsx)(pz,{title:`Conversation`,className:`w-full`})}),(0,L.jsx)(`div`,{ref:n,onScroll:r,className:q(`min-h-0 overflow-y-auto overscroll-y-contain`,t?`flex-1 px-5 pt-5 pb-dock`:`max-h-[45svh] p-5`),children:(0,L.jsx)(Aq,{messages:e.messages,busy:e.busy})})]})}function pJ({snap:e,comments:t,onComment:n,wide:r}){return(0,L.jsxs)(CO,{className:`flex flex-col`,children:[(0,L.jsx)(`h2`,{className:`flex min-h-12 shrink-0 items-center border-b border-border px-4 text-sm font-medium`,children:(0,L.jsx)(pz,{title:`Draft plan`,className:`w-full`})}),(0,L.jsxs)(`div`,{className:q(`flex min-h-0 flex-col gap-5 overflow-y-auto overscroll-y-contain px-5 pt-5 pb-dock`,r&&`flex-1`),children:[e.draft?(0,L.jsx)(Qq,{draft:e.draft,comments:t,onComment:n}):(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.busy?Nq:Mq}),(0,L.jsx)($q,{notes:e.notes})]})]})}function mJ({snap:e,reload:t}){let n=SO(),[r,i]=(0,m.useState)(),[a,o]=(0,m.useState)(new Map);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(cJ,{snap:e,onDone:t}),(0,L.jsxs)(`div`,{className:n?`grid min-h-0 flex-1 grid-cols-[minmax(0,46fr)_minmax(0,54fr)] grid-rows-[minmax(0,1fr)] divide-x divide-border`:`flex flex-col divide-y divide-border`,children:[(0,L.jsx)(fJ,{snap:e,wide:n}),(0,L.jsx)(pJ,{snap:e,comments:a,onComment:i,wide:n})]}),(0,L.jsx)(lJ,{line:r,onClose:()=>i(void 0),onSent:(e,t)=>o(n=>new Map(n).set(e,[...n.get(e)??[],t]))})]})}function hJ(){let e=UD(`planner.get`,{},[`planner`]),t=e.data;if(!t&&e.error)return(0,L.jsx)(LD,{message:`Could not load the plan. ${e.error}`,onRetry:e.reload});if(!t)return(0,L.jsx)(`p`,{role:`status`,className:`p-5 text-sm text-muted-foreground`,children:`Loading the plan…`});let n=Uq(t);return(0,L.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:n?(0,L.jsx)(dJ,{snap:t,onDone:e.reload}):(0,L.jsx)(mJ,{snap:t,reload:e.reload})})}var gJ=`Describe a small change in the box below and one agent makes it now, beside any running task.`;function _J(e){return e.prompt.split(`
|
|
99
|
+
`).find(e=>e.trim())?.trim()??`(empty)`}function vJ(e){return[...e].reverse()}function yJ(e){let t=Number.isFinite(e)?Math.max(0,Math.round(e/1e3)):0,n=Math.floor(t/60);if(n===0)return`${t}s`;let r=t%60;return r===0?`${n}m`:`${n}m ${String(r).padStart(2,`0`)}s`}function bJ(e,t){return e.startedAt?yJ((e.finishedAt??t)-e.startedAt):``}function xJ(e,t){let n=e.model?`${e.model}${e.thinking?` · ${e.thinking}`:``}`:e.thinking??``;return[bJ(e,t),n,e.tools?`${e.tools} tool${e.tools===1?``:`s`}`:``,e.usage?.cost?`$${e.usage.cost.toFixed(2)}`:``].filter(Boolean).join(` · `)}function SJ(e){return e===`queued`?`Waiting for the quick fix ahead of it.`:e===`running`?`starting…`:e===`held`?`Not started.`:`No tool calls.`}function CJ({job:e}){let t=e.status===`held`;return(0,L.jsxs)(L.Fragment,{children:[e.route?(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Routed `,e.route]}):null,e.note&&t?(0,L.jsxs)(`p`,{className:`flex items-start gap-2 rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-sm text-foreground`,children:[(0,L.jsx)(og,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-warning`}),(0,L.jsxs)(`span`,{children:[`Held: `,e.note,`.`]})]}):null,e.note&&!t?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.routed?`Routed here by the oracle — ${e.note}`:e.note}):null,e.routed&&!e.note?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Routed here by the oracle.`}):null]})}function wJ({job:e}){let t=e.status===`running`;return e.steps.length===0?(0,L.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[t?(0,L.jsx)(FD,{className:`size-3.5`}):null,SJ(e.status)]}):(0,L.jsx)(`ol`,{className:`flex flex-col gap-1 text-sm`,children:e.steps.map((e,n)=>(0,L.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,L.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:AO(e.at)}),(0,L.jsx)(`span`,{className:`flex h-5 w-3.5 shrink-0 items-center justify-center`,"aria-hidden":`true`,children:e.pending&&t?(0,L.jsx)(FD,{className:`size-3.5`}):(0,L.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`})}),(0,L.jsx)(`span`,{className:`min-w-0 break-words text-muted-foreground`,children:e.pending&&t?`${e.text}…`:e.text})]},n))})}function TJ({job:e}){return e.status===`held`?(0,L.jsxs)(pO,{children:[(0,L.jsx)(Y,{label:`Run anyway`,icon:wh,tone:`primary`,shortcut:`R`,onClick:()=>void V(`quickfix.runAnyway`,{id:e.id})}),(0,L.jsx)(Y,{label:`Turn it into a task`,text:`Make it a task`,icon:Im,shortcut:`T`,onClick:()=>void V(`quickfix.movedToTask`,{id:e.id})})]}):e.status!==`queued`&&e.status!==`running`?null:(0,L.jsx)(pO,{children:(0,L.jsx)(WO,{icon:Xp,label:`Cancel the quick fix`,text:`Cancel`,shortcut:`C`,title:`Cancel this quick fix?`,description:`The agent stops. Files it already edited stay as they are.`,confirmLabel:`Cancel quick fix`,variant:`destructive`,onConfirm:()=>void V(`quickfix.cancel`,{id:e.id})})})}function EJ({job:e,now:t}){return(0,L.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`Quick fix detail`,children:[(0,L.jsx)(TJ,{job:e}),(0,L.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:_J(e)}),(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-foreground`,children:e.status}),xJ(e,t)?(0,L.jsx)(`span`,{children:xJ(e,t)}):null]}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:e.id})]}),e.prompt.trim().includes(`
|
|
100
|
+
`)?(0,L.jsx)(dz,{text:e.prompt}):null,(0,L.jsx)(CJ,{job:e}),(0,L.jsx)(mz,{title:`Steps`,children:(0,L.jsx)(wJ,{job:e})}),e.files?.length?(0,L.jsx)(mz,{title:`Edited`,children:(0,L.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.files.map(e=>(0,L.jsxs)(`li`,{className:`break-all`,children:[`· `,e]},e))})}):null,e.error?(0,L.jsx)(`p`,{className:`rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:e.error}):null,e.report?(0,L.jsx)(mz,{title:`Report`,children:(0,L.jsx)(dz,{text:e.report})}):null]})}function DJ({status:e}){if(e===`running`)return(0,L.jsx)(FD,{className:`size-3.5`,"aria-label":`running`});let t={queued:nm,success:Op,failed:bg,timeout:bg,cancelled:nh,held:mh,running:nm}[e];return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(t,{"aria-hidden":`true`,className:`size-4 ${e===`success`?`text-success`:e===`failed`||e===`timeout`?`text-destructive`:e===`held`?`text-warning`:`text-muted-foreground`}`}),(0,L.jsx)(`span`,{className:`sr-only`,children:e})]})}function OJ({job:e,selected:t,now:n,onSelect:r}){let i=bJ(e,n);return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>r(e.id),className:q($z,`flex-row items-start gap-2.5 text-sm`),children:[(0,L.jsx)(`span`,{className:`flex h-5 w-4 shrink-0 items-center justify-center`,children:(0,L.jsx)(DJ,{status:e.status})}),(0,L.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words`,t?`font-medium text-foreground`:`text-foreground`),children:_J(e)}),i?(0,L.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:i}):null]})})}function kJ({jobs:e,selectedId:t,now:n,onSelect:r}){return(0,L.jsx)(`ul`,{className:eB,children:e.map(e=>(0,L.jsx)(OJ,{job:e,selected:e.id===t,now:n,onSelect:r},e.id))})}var AJ=()=>DD(ED(`quickfix`)),jJ=e=>DD(ED(`quickfix`,e));function MJ(e){let[t,n]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{if(!e)return;let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),e?t:Date.now()}function NJ(){return(0,L.jsx)(kD,{className:`m-4 flex-1`,children:(0,L.jsxs)(AD,{children:[(0,L.jsx)(MD,{variant:`icon`,children:(0,L.jsx)(Sg,{"aria-hidden":`true`})}),(0,L.jsx)(PD,{className:`font-medium text-foreground`,children:gJ})]})})}function PJ({id:e}){let t=SO(),n=UD(`quickfix.list`,{},[`quickfix`]),r=vJ(n.data?.jobs??[]),i=MJ(r.some(e=>e.status===`running`));if(!n.data&&n.error)return(0,L.jsx)(LD,{message:`Could not load quick fixes. ${n.error}`,onRetry:n.reload});let a=n.data&&r.length===0?(0,L.jsx)(NJ,{}):(0,L.jsx)(FJ,{id:e,wide:t,loaded:!!n.data,jobs:r,now:i});return(0,L.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:a})}function FJ({id:e,wide:t,loaded:n,jobs:r,now:i}){let a=e??(t?r[0]?.id:void 0),o=r.find(e=>e.id===a),s=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(EO,{title:`Quick fixes`,count:String(r.length)}),n?(0,L.jsx)(kJ,{jobs:r,selectedId:a,now:i,onSelect:jJ}):(0,L.jsx)(DO,{})]});return(0,L.jsx)(TO,{wide:t,list:s,detail:o?(0,L.jsx)(EJ,{job:o,now:i}):e?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That quick fix is not on the list any more.`}):null,open:!!e,onClose:AJ,hint:`Select a quick fix to see its steps.`,describe:`Quick fix detail`})}var IJ={},LJ=new Set;function RJ(e){IJ=e;for(let e of[...LJ])e()}function zJ(e){IJ.taskId!==e&&RJ({...IJ,taskId:e})}function BJ(e){(IJ.session?.name!==e?.name||JSON.stringify(IJ.session?.address)!==JSON.stringify(e?.address))&&RJ({...IJ,session:e})}function VJ(e){return LJ.add(e),()=>{LJ.delete(e)}}function HJ(){return(0,m.useSyncExternalStore)(VJ,()=>IJ,()=>IJ)}function UJ({entry:e}){let t=e.at?AO(e.at):``;return e.role===`note`?(0,L.jsxs)(`li`,{className:`text-center text-xs text-muted-foreground`,children:[e.text,t?` · ${t}`:``]}):e.role===`you`?(0,L.jsxs)(`li`,{className:`flex flex-col items-end gap-1`,children:[(0,L.jsxs)(`span`,{className:`flex items-baseline gap-2 text-xs text-muted-foreground`,children:[t,` `,(0,L.jsx)(`span`,{className:`font-medium text-foreground`,children:`You`})]}),(0,L.jsx)(`div`,{className:`max-w-[85%] rounded-xl rounded-tr-sm border border-primary/10 bg-you px-3.5 py-2`,children:(0,L.jsx)(dz,{text:e.text})})]}):(0,L.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 rounded-full bg-primary`}),(0,L.jsx)(`span`,{className:`font-medium text-foreground`,children:`Oracle`}),` `,t]}),(0,L.jsx)(`div`,{className:`max-w-[90%] pl-4`,children:(0,L.jsx)(dz,{text:e.text})})]})}function WJ({entries:e,more:t,loading:n,onMore:r,empty:i}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[t?(0,L.jsx)(`div`,{className:`flex self-center`,children:(0,L.jsx)(Y,{label:`Load earlier messages`,icon:Rp,disabled:n,onClick:r??(()=>void 0)})}):null,e.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i}):(0,L.jsx)(`ol`,{"aria-label":`Conversation`,className:`flex flex-col gap-4`,children:e.map(e=>(0,L.jsx)(UJ,{entry:e},e.id))})]})}function GJ({address:e,empty:t}){let n=UD(`sessions.chat`,e,[`sessions`]),[r,i]=(0,m.useState)(),[a,o]=(0,m.useState)(!1),s=n.data?.entries??[],c=new Set(s.map(e=>e.id)),l=[...(r?.entries??[]).filter(e=>!c.has(e.id)),...s],u=async()=>{let t=l[0];if(!t)return;o(!0);let n=await V(`sessions.chat`,{...e,before:t.id});n&&i({entries:[...n.entries,...r?.entries??[]],more:n.hasOlder}),o(!1)},d=r?.more??n.data?.hasOlder??!1;return(0,L.jsx)(WJ,{entries:l,more:d,loading:a,onMore:()=>void u(),empty:n.loading&&!n.data?`Loading the conversation…`:t})}var KJ={"this window":`This window`,background:`Background`,"other terminal":`Other terminals`},qJ=[`this window`,`background`,`other terminal`],JJ=`Nothing said yet.`,YJ=`This session runs in another terminal: its conversation shows here and your messages reach its oracle within seconds, but live activity only streams from sessions started in this window.`,XJ=`No other sessions. Start one below.`;function ZJ(e,t,n){let r=t?.task;return{id:`here`,where:`this window`,name:e?.sessionName??r?.title??`unnamed session`,status:e?.busy?`working`:r?.state??`no task`,waiting:n,alive:!0,dialogs:[],...r?{task:r}:{}}}function QJ(e){let t=e.status===`exited`?`ended`:e.status===`starting`?`starting`:e.busy?`working`:`idle`;return{id:e.key,where:`background`,name:e.name,status:t,waiting:e.dialogs.length,key:e.key,alive:e.alive,dialogs:e.dialogs,...e.sessionId?{sessionId:e.sessionId}:{}}}function $J(e){return{id:e.sessionId,where:`other terminal`,name:e.name??`unnamed session`,status:`running`,waiting:0,pid:e.pid,sessionId:e.sessionId,alive:!0,dialogs:[]}}function eY(e,t,n,r,i){let a=new Set([e?.sessionId,...r.map(e=>e.sessionId)].filter(e=>!!e)),o=i.filter(e=>!a.has(e.sessionId));return[ZJ(e,t,n),...r.map(QJ),...o.map($J)]}function tY(e){return`${e} question${e===1?``:`s`} waiting for you`}function nY(e){return e.status===`starting`?`starting ${e.name}…`:e.alive?`${e.name} has not said anything yet.`:`${e.name} has ended.`}function rY(e){return[e.where,e.status.replace(/_/g,` `),e.pid?`pid ${e.pid}`:``].filter(Boolean).join(` · `)}function iY(e){return e.key?{key:e.key}:e.sessionId?{sessionId:e.sessionId}:void 0}function aY({options:e,send:t}){return(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,L.jsx)(J,{variant:`outline`,onClick:()=>void t({value:e}),children:e},e))})}function oY({dialog:e,send:t}){let n=(0,m.useId)(),[r,i]=(0,m.useState)(e.prefill??``);return(0,L.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,L.jsx)(`label`,{htmlFor:n,className:`sr-only`,children:e.title}),(0,L.jsx)(OO,{id:n,rows:e.method===`editor`?4:2,value:r,placeholder:e.placeholder,onChange:e=>i(e.target.value)}),(0,L.jsx)(`div`,{className:`flex self-end`,children:(0,L.jsx)(Y,{label:`Send the answer`,text:`Send`,icon:bp,tone:`primary`,disabled:!r.trim(),onClick:()=>void t({value:r.trim()})})})]})}function sY({dialog:e,send:t}){return e.method===`select`?(0,L.jsx)(aY,{options:e.options??[],send:t}):e.method===`confirm`?(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,L.jsx)(J,{onClick:()=>void t({confirmed:!0}),children:`Yes`}),(0,L.jsx)(J,{variant:`outline`,onClick:()=>void t({confirmed:!1}),children:`No`})]}):(0,L.jsx)(oY,{dialog:e,send:t})}function cY({sessionKey:e,dialog:t,onAnswered:n}){let r=async r=>{await V(`sessions.answer`,{key:e,dialogId:t.id,answer:r})&&n()};return(0,L.jsxs)(`div`,{className:`card-raised flex flex-col gap-3 rounded-lg border p-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:t.title}),t.message?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t.message}):null]}),(0,L.jsx)(sY,{dialog:t,send:r}),(0,L.jsx)(`div`,{className:`flex self-start`,children:(0,L.jsx)(Y,{label:`Put it away`,text:`Put away`,icon:bg,onClick:()=>void r({cancelled:!0})})})]})}function lY({sessionKey:e,dialogs:t,onAnswered:n}){return t.length===0?null:(0,L.jsxs)(`section`,{"aria-label":`Questions waiting`,className:`flex flex-col gap-2`,children:[(0,L.jsx)(`p`,{role:`status`,className:`text-sm font-medium text-foreground`,children:tY(t.length)}),t.map(t=>(0,L.jsx)(cY,{sessionKey:e,dialog:t,onAnswered:n},t.id))]})}var uY={"this window":ih,background:Mm,"other terminal":Kh};function dY({where:e,className:t}){let n=uY[e];return(0,L.jsx)(n,{"aria-hidden":`true`,className:q(`size-4 shrink-0 text-muted-foreground`,t)})}function fY({task:e}){let t=e.progress;return(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2 text-sm text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`break-all`,children:e.id}),t&&t.total>0?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(vU,{done:t.done,total:t.total}),(0,L.jsxs)(`span`,{className:`tabular-nums`,children:[t.done,`/`,t.total]})]}):null]})}function pY({entry:e}){let{key:t}=e;return e.where===`this window`?(0,L.jsx)(pO,{children:(0,L.jsx)(Y,{label:`Back to this window`,text:`Back to the Lobby`,icon:gp,tone:`primary`,shortcut:`B`,onClick:()=>DD(`#/lobby`)})}):t?(0,L.jsxs)(pO,{children:[(0,L.jsx)(Y,{label:`Move here`,icon:vp,tone:`primary`,shortcut:`M`,onClick:()=>void V(`sessions.switch`,{key:t})}),(0,L.jsx)(WO,{icon:Xp,label:`Stop the session`,text:`Stop`,shortcut:`S`,title:`Stop ${e.name}?`,description:`Its process ends. The task keeps its state and can be resumed in this window.`,confirmLabel:`Stop session`,variant:`destructive`,disabled:!e.alive,onConfirm:()=>void V(`sessions.stop`,{key:t})})]}):null}function mY({entry:e,lobby:t}){let n=iY(e);return e.where===`this window`?(0,L.jsx)(WJ,{entries:t?.chat??[],more:!1,empty:JJ}):n?(0,L.jsx)(GJ,{address:n,empty:e.where===`other terminal`?`Nothing said in this session yet.`:nY(e)},e.id):(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:JJ})}function hY({entry:e,lobby:t,onChanged:n}){return(0,L.jsxs)(`article`,{"aria-label":`Session detail`,className:`flex flex-col gap-4`,children:[(0,L.jsx)(pY,{entry:e}),(0,L.jsxs)(`header`,{className:`flex flex-col gap-1.5`,children:[(0,L.jsxs)(`h3`,{className:`flex items-center gap-2.5 text-lg font-semibold tracking-tight text-foreground`,children:[(0,L.jsx)(dY,{where:e.where,className:`size-[1.1rem]`}),e.name]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:rY(e)}),e.task?(0,L.jsx)(fY,{task:e.task}):null,e.where!==`background`&&e.waiting>0?(0,L.jsx)(`p`,{className:`text-sm text-foreground`,children:tY(e.waiting)}):null]}),e.where===`other terminal`?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:YJ}):null,e.key?(0,L.jsx)(lY,{sessionKey:e.key,dialogs:e.dialogs,onAnswered:n}):null,(0,L.jsx)(mz,{title:`Conversation`,children:(0,L.jsx)(mY,{entry:e,lobby:t})})]})}function gY({entry:e,selected:t,onSelect:n}){return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(e.id),className:q($z,`flex-row items-start gap-2.5 text-sm`),children:[(0,L.jsx)(dY,{where:e.where,className:`mt-0.5`}),(0,L.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.name}),(0,L.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[e.status===`working`||e.status===`starting`?(0,L.jsx)(FD,{className:`size-3`,"aria-hidden":`true`}):null,e.status.replace(/_/g,` `),e.waiting>0?(0,L.jsx)(`span`,{className:`rounded-md bg-warning/15 px-1.5 py-0.5 font-medium text-warning tabular-nums`,children:e.waiting}):null]})]})})}function _Y({where:e,entries:t,selectedId:n,onSelect:r}){return(0,L.jsxs)(`section`,{"aria-label":KJ[e],className:`flex flex-col`,children:[(0,L.jsx)(`h3`,{className:tB,children:(0,L.jsx)(pz,{title:KJ[e],right:String(t.length),className:`[&>span:first-child]:font-medium [&>span:first-child]:text-muted-foreground`})}),(0,L.jsx)(`ul`,{className:eB,children:t.map(e=>(0,L.jsx)(gY,{entry:e,selected:e.id===n,onSelect:r},e.id))})]})}function vY({entries:e,selectedId:t,onSelect:n}){return(0,L.jsx)(`div`,{className:`flex flex-col pb-2`,children:qJ.map(r=>{let i=e.filter(e=>e.where===r);return i.length>0?(0,L.jsx)(_Y,{where:r,entries:i,selectedId:t,onSelect:n},r):null})})}var yY=()=>DD(`#/sessions`),bY=e=>DD(`#/sessions/${encodeURIComponent(e)}`);function xY({windows:e}){return e.length===0?null:(0,L.jsx)(`div`,{className:`px-4 pb-4 pt-2`,children:(0,L.jsx)(mz,{title:`Other windows`,children:(0,L.jsx)(`ul`,{className:`flex flex-col`,children:e.map(e=>(0,L.jsx)(`li`,{children:(0,L.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`flex min-h-8 items-center rounded-lg px-2.5 text-sm text-foreground underline-offset-4 transition-colors hover:bg-muted hover:underline`,children:e.name})},e.url))})})})}function SY(){return(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That session is not on the list any more.`})}function CY({id:e}){let t=SO(),n=VD(`status`).data,r=VD(`lobby`).data,i=VD(`prompts`).data?.prompts.length??0,a=UD(`sessions.list`,{},[`sessions`]);if(!a.data&&a.error)return(0,L.jsx)(LD,{message:`Could not load sessions. ${a.error}`,onRetry:a.reload});let o=eY(n,r,i,a.data?.background??[],a.data?.live??[]),s=e??(t?o[0]?.id:void 0),c=o.find(e=>e.id===s),l=c&&c.where!==`this window`&&c.alive?iY(c):void 0,u=l?JSON.stringify(l):``,d=c?.name;(0,m.useEffect)(()=>(BJ(l&&d?{name:d,address:l}:void 0),()=>BJ(void 0)),[u,d]);let f=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(EO,{title:`Sessions`,count:String(o.length)}),a.data?(0,L.jsx)(vY,{entries:o,selectedId:s,onSelect:bY}):(0,L.jsx)(DO,{}),a.data&&o.length===1?(0,L.jsx)(`p`,{className:`px-4 pb-3 text-sm text-muted-foreground`,children:XJ}):null,(0,L.jsx)(xY,{windows:n?.windows??[]})]}),p=c?(0,L.jsx)(hY,{entry:c,lobby:r,onChanged:a.reload},c.id):e?(0,L.jsx)(SY,{}):null;return(0,L.jsx)(TO,{wide:t,list:f,detail:p,open:!!e,onClose:yY,hint:`Select a session to see its conversation.`,describe:`Session detail`})}function wY({timing:e,stopped:t}){let[n,r]=(0,m.useState)(0);return(0,m.useEffect)(()=>{if(r(0),t||e.waiting||!e.runningSince)return;let n=performance.now(),i=window.setInterval(()=>r(performance.now()-n),1e3);return()=>window.clearInterval(i)},[e,t]),(0,L.jsxs)(`span`,{className:`tabular-nums`,children:[e.waiting?`Waiting for you · `:``,e.phase.replaceAll(`_`,` `),` · `,pU(fU(e,n,t)),` execution`]})}function TY({work:e,timing:t,stopped:n}){let r=e.running&&!n&&!t?.waiting,i=mU(r,e);return(0,L.jsxs)(`span`,{className:`tabular-nums`,"data-work-clock":r?`running`:`stopped`,children:[t?.waiting?`Waiting for you · `:``,t?`${t.phase.replaceAll(`_`,` `)} · `:``,`worked `,pU(e.workedMs+i)]})}function EY({timing:e,work:t,stopped:n=!1}){return t?(0,L.jsx)(TY,{work:t,...e?{timing:e}:{},stopped:n}):e?(0,L.jsx)(wY,{timing:e,stopped:n},JSON.stringify(e)):(0,L.jsx)(`span`,{children:`Timing unavailable`})}var DY=`This directly merges the reviewed commit into main and pushes main. It does not create a pull request.`,OY={pending_approval:`Ready for your review`,deferred:`Saved for later`,in_progress:`Delivery in progress`,successful:`Delivered`,recoverable_failure:`Delivery needs attention`};function kY({delivery:e,title:t}){return(0,L.jsxs)(`div`,{className:`grid gap-2 text-sm`,children:[(0,L.jsx)(`p`,{className:`font-medium break-words`,children:t}),(0,L.jsxs)(`dl`,{className:`grid gap-1 break-all text-muted-foreground`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`dt`,{className:`inline`,children:`Project: `}),(0,L.jsx)(`dd`,{className:`inline`,children:e.project})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`dt`,{className:`inline`,children:`Repository: `}),(0,L.jsx)(`dd`,{className:`inline`,children:e.repository??`Unavailable — refresh review`})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`dt`,{className:`inline`,children:`Source: `}),(0,L.jsxs)(`dd`,{className:`inline`,children:[e.sourceBranch,` · `,e.sourceCommit??`Commit unavailable`]})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`dt`,{className:`inline`,children:`Target: `}),(0,L.jsxs)(`dd`,{className:`inline`,children:[`main`,e.targetCommit?` · ${e.targetCommit}`:``]})]})]}),(0,L.jsxs)(`p`,{children:[`Checks: `,e.verification?.checks??`unavailable`]}),(0,L.jsx)(`p`,{children:e.verification?.summary??`Verification unavailable. Refresh the review before delivery.`}),e.verification?(0,L.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Local completion/QA: `,e.verification.localVerified?`passed`:`not verified`,` · Repository rules: `,e.verification.rulesKnown?`known`:`unavailable`,e.verification.requiredChecks.length?` · Required: ${e.verification.requiredChecks.join(`, `)}`:``]}):null]})}function AY({action:e,delivery:t,busy:n,onAction:r}){let i=t.blocked[e],a=n||t.status===`in_progress`||t.status===`successful`||!!i;return(0,L.jsxs)(`div`,{className:`grid gap-1`,children:[(0,L.jsx)(J,{variant:`outline`,disabled:a,onClick:()=>r(e),children:e===`create_pr`?`Create PR`:`Merge to main`}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e===`create_pr`?`Pushes the task branch and opens a PR targeting main. Does not merge.`:`Directly updates and pushes main. Requires confirmation.`}),i?(0,L.jsxs)(`p`,{className:`text-sm text-destructive`,children:[i,` Refresh review after resolving this restriction, then choose the action again.`]}):null]})}async function jY(e,t,n){let r={taskId:t,reviewId:n};return e===`refresh`?qf(`tasks.deliveryReview`,{taskId:t}):e===`defer`?qf(`tasks.deliveryDefer`,r):qf(`tasks.deliver`,{...r,action:e,...e===`merge_main`?{confirmMain:!0}:{}})}function MY({taskId:e,delivery:t}){let[n,r]=(0,m.useState)(t),[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(),[c,l]=(0,m.useState)(!1),u=(0,m.useRef)(null),d=Hf(),f=`${d}:${e}`,p=(0,m.useRef)(f);return p.current=f,(0,m.useEffect)(()=>(p.current=f,()=>{p.current=``}),[f]),(0,m.useEffect)(()=>{r(t),l(!1)},[t,e]),{current:n,setCurrent:r,busy:i,setBusy:a,error:o,setError:s,confirm:c,setConfirm:l,trigger:u,project:d,identity:f,scope:p}}function NY(e){return e.scope.current===e.identity&&e.project===Hf()}function PY(e,t){let n=(0,m.useRef)(!1);async function r(r){if(!(n.current||r===`merge_main`&&!e.confirm)){n.current=!0,e.setBusy(!0),e.setError(void 0),e.setConfirm(!1);try{let n=await jY(r,t.taskId,e.current.reviewId);NY(e)&&(e.setCurrent(n.delivery),t.onChanged())}catch(t){NY(e)&&e.setError(t instanceof Error?t.message:String(t))}finally{n.current=!1,e.scope.current&&e.setBusy(!1)}}}return r}function FY(e){let t=MY(e),n=PY(t,e),r=vD(t.confirm,_D.confirm),i=t.current.status===`successful`||t.current.status===`in_progress`;function a(){t.trigger.current=document.activeElement,t.setConfirm(!0)}return{...t,request:n,slot:r,terminal:i,reviewMerge:a}}function IY({review:e}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Task completion is recorded separately. Nothing is published without your approval.`}),(0,L.jsx)(`p`,{role:`status`,className:`text-sm`,children:e.busy?`Updating delivery…`:e.current.operation?`Operation: ${e.current.operation.stage}`:OY[e.current.status]}),e.current.error||e.error?(0,L.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[e.error??e.current.error,` Completed work is retained. Refresh review to reconcile the result before retrying.`]}):null,e.current.result?(0,L.jsxs)(`p`,{className:`text-sm break-all`,children:[e.current.result.action===`create_pr`?`PR #${e.current.result.pullNumber??``} created`:`main pushed · ${e.current.result.commit??``}`,e.current.result.pullUrl?(0,L.jsxs)(`span`,{children:[` · `,e.current.result.pullUrl]}):null]}):null]})}function LY({review:e}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[(0,L.jsx)(AY,{action:`create_pr`,delivery:e.current,busy:e.busy,onAction:()=>void e.request(`create_pr`)}),(0,L.jsx)(AY,{action:`merge_main`,delivery:e.current,busy:e.busy,onAction:e.reviewMerge})]}),(0,L.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,L.jsx)(J,{variant:`ghost`,disabled:e.busy,onClick:()=>void e.request(`refresh`),children:`Refresh review`}),(0,L.jsx)(J,{variant:`ghost`,disabled:e.busy||e.terminal,onClick:()=>void e.request(`defer`),children:`Not now`})]})]})}function RY({review:e}){return(0,L.jsx)(uD,{open:e.slot,onOpenChange:e.setConfirm,label:`Confirm merge to main`,description:DY,onCloseAutoFocus:t=>{t.preventDefault(),requestAnimationFrame(()=>e.trigger.current?.focus())},children:(0,L.jsxs)(`div`,{className:`grid gap-4 p-4`,children:[(0,L.jsx)(`h3`,{className:`font-medium`,children:`Merge to main?`}),(0,L.jsx)(`p`,{className:`text-sm`,children:DY}),(0,L.jsxs)(`p`,{className:`break-all text-sm text-muted-foreground`,children:[e.current.repository,` · `,e.current.sourceCommit,` → main`]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,L.jsx)(J,{variant:`outline`,onClick:()=>e.setConfirm(!1),children:`Cancel`}),(0,L.jsx)(J,{disabled:e.busy||!!e.current.blocked.merge_main||e.terminal,onClick:()=>void e.request(`merge_main`),children:`Confirm merge and push main`})]})]})})}function zY({title:e,review:t}){return(0,L.jsxs)(mz,{title:`Completed work · delivery review`,right:OY[t.current.status],children:[(0,L.jsx)(kY,{delivery:t.current,title:e}),(0,L.jsx)(IY,{review:t}),(0,L.jsx)(LY,{review:t}),(0,L.jsx)(RY,{review:t})]})}function BY(e){let t=FY(e);return(0,L.jsx)(zY,{title:e.title,review:t})}var VY={open:em,delivered:Kp,addressed:Hp},HY={open:`waiting for the owning session`,delivered:`sent to the oracle`,addressed:`plan amended`};function UY({comment:e}){let t=NO(Date.now()-Date.parse(e.createdAt)),n=VY[e.status];return(0,L.jsxs)(`p`,{className:`mt-1 flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,L.jsx)(n,{"aria-hidden":`true`,className:e.status===`addressed`?`size-3.5 text-success`:`size-3.5`}),HY[e.status],`, `,t,e.editedAt?` (edited)`:``]})}function WY({comment:e,taskId:t,own:n}){let[r,i]=(0,m.useState)(!1),[a,o]=(0,m.useState)(),s=a&&(a.editedAt??``)>(e.editedAt??``)?a:e;return(0,L.jsxs)(`li`,{className:`card-raised rounded-lg border px-3.5 py-2.5`,children:[r?(0,L.jsx)(Cq,{text:s.text,onSave:async n=>{let r=await qf(`tasks.editComment`,{taskId:t,commentId:e.id,text:n});o(r.comment)},onCancel:()=>i(!1)}):(0,L.jsx)(dz,{text:s.text}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(UY,{comment:s}),n&&!r?(0,L.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>i(!0),children:`Edit`}):null]})]})}function GY({taskId:e,finished:t,canComment:n}){let r=UD(`tasks.comments`,{taskId:e},[`tasks`]),i=VD(`status`),a=r.data?.comments??[],o=a.filter(e=>e.status!==`addressed`).length;return(0,L.jsxs)(`section`,{"aria-labelledby":`comments-${e}`,className:`flex flex-col gap-3`,children:[(0,L.jsx)(`h3`,{id:`comments-${e}`,className:`text-sm`,children:(0,L.jsx)(pz,{title:`Comments`,right:o>0?`${o} open`:void 0})}),a.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t?`No comments.`:n?`No comments yet. Comment on the plan in the box below (Markdown and images work); the oracle amends it.`:`No comments yet.`}):(0,L.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:a.map(t=>(0,L.jsx)(WY,{taskId:e,comment:t,own:!!(t.by&&t.by===i.data?.sessionId)},`${e}-${t.id}`))})]})}var KY={mine:`This session`,others:`Other sessions`,pending:`Pending`,recent:`Finished`,archived:`Archived`},qY={open:`open`,done:`done`,dropped:`abandoned`},JY={none:{label:`None`,depth:`nothing that runs changed: the engine's checks decide, no QA agent`,tone:`bg-accent text-muted-foreground`},low:{label:`Low`,depth:`a light check: the diff, the nearest tests, done once confident`,tone:`bg-success/10 text-success`},medium:{label:`Medium`,depth:`a standard check: the acceptance criteria and realistic regressions`,tone:`bg-warning/10 text-warning`},high:{label:`High`,depth:`a deep, adversarial review: invariants, recovery and everything the change reaches`,tone:`bg-destructive/10 text-destructive`}};function YY(e){let t=e.source===`classifier`?`Jev`:`rules`;if(!e.qaRequired)return`${t} · no QA agent`;let{min:n,max:r}=e.testBudget;return`${t} · ${n===r?r:`${n}-${r}`} new tests at most`}var XY=`No tasks yet. Start one from the Lobby tab, or plan one in the Plan tab.`;function ZY(e,t){return`${e.replace(/_/g,` `)}${t?` · paused`:``}`}function QY(e){return e===`now`?`just now`:`${e} ago`}function $Y(e){if(e.kind===`plan`)return[`planned`,e.age?e.age===`now`?`saved just now`:`saved ${e.age} ago`:``,e.issue?`#${e.issue}`:``].filter(Boolean).join(` · `);let t=e.owner??(e.section===`mine`?`this session`:``);return[ZY(e.status,e.paused),e.auto?`auto`:``,t].filter(Boolean).join(` · `)}function eX(e){let t=[];for(let n of e){let e=t.at(-1);e&&e.section===n.section?e.rows.push(n):t.push({section:n.section,rows:[n]})}return t}function tX(e){let t=e.filter(e=>e.kind!==`archived`),n=t.filter(e=>e.check===`open`).length,r=t.length-n,i=e.length-t.length;return[n?`${n} open`:``,r?`${r} finished`:``,i?`${i} archived`:``].filter(Boolean).join(` · `)||`0`}function nX({step:e,stopped:t}){let n=mU(!t,e);return(0,L.jsx)(`span`,{className:`tabular-nums`,children:pU((e.workedMs??0)+n)})}function rX(){return(0,L.jsxs)(`span`,{"aria-hidden":`true`,className:`relative mt-[0.3125rem] grid size-4 shrink-0 place-items-center`,children:[(0,L.jsx)(`span`,{className:`absolute size-2.5 rounded-full bg-primary/30 motion-safe:animate-ping`}),(0,L.jsx)(`span`,{className:`size-2 rounded-full bg-primary`})]})}function iX({step:e,index:t,stopped:n}){let r=!!e.active&&!n,i=e.status===`done`,a=i?`text-success`:e.status===`current`?`text-primary`:`text-muted-foreground`,o=i?Hp:em;return(0,L.jsxs)(`li`,{className:`flex items-start gap-2.5 text-sm`,"data-step":r?`active`:e.status,children:[r?(0,L.jsx)(rX,{}):(0,L.jsx)(o,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 ${a}`}),(0,L.jsxs)(`span`,{className:`shrink-0 text-xs leading-5 text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,L.jsx)(`span`,{className:q(`min-w-0 break-words`,r||e.status===`current`?`text-foreground`:`text-muted-foreground`),children:e.text}),r?(0,L.jsxs)(`span`,{className:`shrink-0 rounded-md bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary`,children:[`active · `,(0,L.jsx)(nX,{step:e,stopped:n}),(0,L.jsx)(`span`,{className:`sr-only`,children:` (being worked on now)`})]}):e.status===`current`&&!n?(0,L.jsxs)(`span`,{className:`shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium`,children:[`next`,(0,L.jsx)(`span`,{className:`sr-only`,children:` (the step up next)`})]}):null]})}function aX({steps:e,stopped:t}){let n=e.filter(e=>e.status===`done`).length;return(0,L.jsx)(mz,{title:`Steps`,right:`${n}/${e.length} done`,children:(0,L.jsx)(`ol`,{className:`flex flex-col gap-2`,"aria-label":`Steps`,children:e.map((e,n)=>(0,L.jsx)(iX,{step:e,index:n,stopped:t},`${n}-${e.text}`))})})}function oX({text:e}){let[t,n]=(0,m.useState)(!1),r=(0,m.useId)();return(0,L.jsxs)(mz,{title:`Full plan`,children:[(0,L.jsxs)(`button`,{type:`button`,"aria-expanded":t,"aria-controls":r,onClick:()=>n(e=>!e),className:`inline-flex w-fit items-center gap-1.5 rounded-md text-sm text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40`,children:[(0,L.jsx)(Pp,{"aria-hidden":`true`,className:q(`size-4 transition-transform duration-200 ease-snap`,t&&`rotate-90`)}),t?`Hide the details`:`Read the details of each step`]}),t?(0,L.jsx)(`div`,{id:r,children:(0,L.jsx)(dz,{text:e})}):null]})}function sX({detail:e,finished:t}){return e.plan&&e.planDetails?(0,L.jsx)(oX,{text:e.planDetails}):e.plan?(0,L.jsx)(mz,{title:`Approved plan`,children:(0,L.jsx)(dz,{text:e.plan})}):e.proposal?(0,L.jsx)(mz,{title:t?`Proposal`:`Proposal (no plan yet)`,children:(0,L.jsx)(dz,{text:e.proposal})}):(0,L.jsx)(mz,{title:`Plan`,children:(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t?`It ended before a plan was made.`:`No proposal or plan yet — the oracle is still clarifying or scouting.`})})}function cX({amendments:e}){return e.length===0?null:(0,L.jsx)(mz,{title:`Amendments`,children:(0,L.jsx)(`ul`,{className:`flex list-disc flex-col gap-1 pl-5 text-sm text-muted-foreground`,children:e.map(e=>(0,L.jsx)(`li`,{className:`break-words`,children:e},e))})})}function lX({detail:e}){return e.waiting.length===0&&e.blockers.length===0?null:(0,L.jsx)(mz,{title:`Waiting on`,children:(0,L.jsxs)(`ul`,{className:`flex flex-col gap-1 text-sm`,children:[e.waiting.map((e,t)=>(0,L.jsxs)(`li`,{className:`flex gap-2`,children:[(0,L.jsx)(Bp,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-warning`}),(0,L.jsxs)(`span`,{className:`min-w-0 break-words text-muted-foreground`,children:[e.kind,` `,e.detail]})]},`${t}-${e.kind}`)),e.blockers.map((e,t)=>(0,L.jsxs)(`li`,{className:`flex gap-2`,children:[(0,L.jsx)(Qp,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-destructive`}),(0,L.jsxs)(`span`,{className:`min-w-0 break-words text-muted-foreground`,children:[e.reason,` (needs: `,e.need,`)`]})]},`${t}-${e.reason}`))]})})}function uX({risk:e}){let t=JY[e.risk];return(0,L.jsxs)(mz,{title:`QA risk`,right:YY(e),children:[(0,L.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-1 text-sm`,"data-qa-risk":e.risk,children:[(0,L.jsx)(`span`,{className:q(`rounded-md px-2 py-0.5 text-xs font-medium`,t.tone),children:t.label}),(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:t.depth})]}),e.focusAreas.length>0?(0,L.jsx)(`ul`,{className:`flex list-disc flex-col gap-1 pl-5 text-sm text-muted-foreground`,"aria-label":`What QA looks at first`,children:e.focusAreas.map(e=>(0,L.jsx)(`li`,{className:`break-words`,children:e},e))}):null,(0,L.jsxs)(`p`,{className:`text-xs break-words text-muted-foreground`,children:[e.riskFactors.join(` · `),e.qaRequired?` · existing tests ${e.existingTestsLikelySufficient?`likely enough`:`likely not enough`}`:``]})]})}function dX({runs:e}){return e.length===0?null:(0,L.jsx)(mz,{title:`Recent runs`,children:(0,L.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.map((e,t)=>(0,L.jsx)(`li`,{className:`break-words`,children:e},`${t}-${e}`))})})}function fX({detail:e,finished:t}){return(0,L.jsxs)(L.Fragment,{children:[e.steps.length>0?(0,L.jsx)(aX,{steps:e.steps,stopped:t}):null,e.request?(0,L.jsx)(mz,{title:`Request`,children:(0,L.jsx)(dz,{text:e.request})}):null,(0,L.jsx)(sX,{detail:e,finished:t})]})}function pX({detail:e}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(cX,{amendments:e.amendments}),(0,L.jsx)(lX,{detail:e}),e.qaRisk?(0,L.jsx)(uX,{risk:e.qaRisk}):null,(0,L.jsx)(dX,{runs:e.runs})]})}function mX({row:e}){let t=(0,m.useRef)(!0);(0,m.useEffect)(()=>(t.current=!0,()=>{t.current=!1}),[]);async function n(){if(e.section===`mine`)return DD(`#/lobby`);let n=Hf(),r=()=>t.current&&Hf()===n;try{let t=await qf(`tasks.open`,{taskId:e.id});if(!r())return;let n=await qf(`status.get`,{});if(!r())return;if(t.sessionId&&t.sessionId===n.sessionId)return DD(`#/lobby`);if(t.sessionId&&!t.key)return B.info(`This task runs in another terminal. Switch to that terminal to work on it.`);if(n.busy)return B.info(`The oracle is working in this window. Stop it first, then open the task in its session.`);await V(`sessions.switch`,t.key?{key:t.key}:{claimTaskId:e.id})&&r()&&DD(`#/lobby`)}catch(e){r()&&B.error(e instanceof Error?e.message:String(e))}}let r=e.section===`mine`;return(0,L.jsx)(Y,{label:r?`Open in its session: this window`:`Open in its session`,text:`Open in session`,icon:vp,tone:`primary`,shortcut:`S`,onClick:()=>void n()})}function hX({split:e}){let t=e.after.length>0?`, after ${e.after.map(e=>`part ${e}`).join(` and `)}`:``;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[(0,L.jsxs)(`span`,{className:`font-medium text-primary`,children:[`part `,e.part,` of `,e.of]}),` of one plan that was split into tasks`,t?(0,L.jsx)(`span`,{className:`text-foreground`,children:t}):null]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.titles.map((t,n)=>(0,L.jsxs)(`span`,{children:[n>0?(0,L.jsx)(`span`,{className:`text-muted-foreground/60`,children:` · `}):null,(0,L.jsxs)(`span`,{className:n+1===e.part?`font-medium text-foreground`:void 0,children:[n+1,`. `,t]})]},`${n}-${t}`))})]})}function gX({planId:e}){let t=UD(`plans.get`,{planId:e},[`plans`]),n=t.data;return n?(0,L.jsxs)(L.Fragment,{children:[n.issue?(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`from issue #`,n.issue.number,` — `,n.issue.title,n.issue.url?(0,L.jsxs)(`span`,{className:`break-all`,children:[` `,n.issue.url]}):null]}):null,n.split?(0,L.jsx)(hX,{split:n.split}):null,(0,L.jsx)(mz,{title:`Agreed plan`,children:(0,L.jsx)(dz,{text:n.brief})})]}):t.error?(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load the agreed plan. `,t.error]}):null}function _X({row:e,onGone:t}){let n=async n=>{await V(`plans.start`,{planId:e.id,where:n})&&t()},r=async()=>{await V(`plans.discard`,{planId:e.id})&&t()};return(0,L.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":e.title,children:[(0,L.jsxs)(pO,{children:[(0,L.jsx)(Y,{label:`Start here`,icon:wh,tone:`primary`,shortcut:`S`,onClick:()=>void n(`here`)}),(0,L.jsx)(Y,{label:`Start in a new session`,text:`New session`,icon:Wh,shortcut:`N`,onClick:()=>void n(`session`)}),(0,L.jsx)(WO,{icon:ig,label:`Discard`,shortcut:`Delete`,title:`Discard "${e.title}"?`,description:`The saved plan is removed from the list. This cannot be undone.`,confirmLabel:`Discard`,variant:`destructive`,onConfirm:()=>void r()})]}),(0,L.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,L.jsxs)(`h2`,{className:`flex items-start gap-2.5 text-lg font-medium`,children:[(0,L.jsx)(yU,{check:`open`,className:`mt-1.5`}),(0,L.jsx)(`span`,{className:`min-w-0 break-words`,children:e.title})]}),(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`pending`,e.age?` · saved ${QY(e.age)}`:``]}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:e.id})]}),(0,L.jsx)(gX,{planId:e.id})]})}function vX(e){if(e.kind===`archived`)return{state:`archived`,rest:QY(e.age??`now`)};let t=e.check!==`open`,n=e.owner??(e.section===`mine`?`this session`:``),r=t&&e.age?`${e.check===`dropped`?`dropped`:`done`} ${QY(e.age)}`:``;return{state:ZY(e.status,e.paused),rest:[t?``:n,r].filter(Boolean).join(` · `)}}function yX(e){return e?[gU(e.track),e.domains.join(`, `)].filter(Boolean).join(` · `):``}function bX({row:e}){return e.progress?(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,L.jsx)(vU,{done:e.progress.done,total:e.progress.total}),(0,L.jsxs)(`span`,{children:[e.progress.done,` of `,e.progress.total,` steps`]})]}):null}function xX({row:e,task:t}){let n=t?.git?`branch ${t.git.branch}${t.git.from?` · from ${t.git.from}`:``}`:``,{state:r,rest:i}=vX(e);return(0,L.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,L.jsxs)(`h2`,{className:`flex items-start gap-2.5 text-lg font-semibold tracking-tight`,children:[(0,L.jsx)(yU,{check:e.check,className:`mt-1.5`}),(0,L.jsxs)(`span`,{className:`sr-only`,children:[qY[e.check],`:`]}),(0,L.jsx)(`span`,{className:e.check===`dropped`?`min-w-0 break-words line-through`:`min-w-0 break-words`,children:e.title})]}),(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-foreground`,children:r}),i?(0,L.jsx)(`span`,{children:i}):null]}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:[e.id,yX(t),n].filter(Boolean).join(` · `)}),(0,L.jsx)(bX,{row:e})]})}function SX({row:e,onGone:t,onChanged:n}){let r=e.id;return{restore:async()=>{await V(`tasks.restore`,{taskId:r},{undo:()=>void V(`tasks.archive`,{taskId:r})})&&t()},archive:async()=>{await V(`tasks.archive`,{taskId:r},{undo:()=>void V(`tasks.restore`,{taskId:r})})&&t()},remove:async()=>{await V(`tasks.delete`,{taskId:r,where:e.kind===`archived`?`archive`:`list`})&&t()},toggleAuto:()=>void V(`tasks.auto`,{taskId:r,on:!e.auto}).then(n)}}function CX({row:e,archive:t}){return e.check===`open`?(0,L.jsx)(WO,{label:`Archive`,icon:fp,shortcut:`E`,title:`Archive "${e.title}"?`,description:`A task still under way is abandoned first, then moved to the archive. Restore brings it back.`,confirmLabel:`Archive`,onConfirm:()=>void t()}):(0,L.jsx)(Y,{label:`Archive`,icon:fp,shortcut:`E`,onClick:()=>void t()})}function wX({on:e,toggle:t}){return dO(`a`,t),(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsxs)(`label`,{className:`flex h-8 cursor-pointer items-center gap-2 rounded-lg px-2.5 text-[0.8125rem] font-medium transition-colors hover:bg-accent`,children:[(0,L.jsx)(Oh,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),(0,L.jsx)(`span`,{children:`Auto`}),(0,L.jsx)(sG,{checked:e,onCheckedChange:t,"aria-label":`Auto mode`,"aria-keyshortcuts":`A`}),(0,L.jsx)(cD,{chord:`A`,className:`kbd-hint`})]})}),(0,L.jsx)(qD,{children:`Auto mode: the oracle decides without asking`})]})}function TX(e){let{row:t}=e,{restore:n,archive:r,remove:i,toggleAuto:a}=SX(e),o=t.kind===`archived`;return(0,L.jsxs)(pO,{children:[t.kind===`task`&&t.check===`open`?(0,L.jsx)(mX,{row:t}):null,t.kind===`task`?(0,L.jsx)(EX,{taskId:t.id}):null,o?(0,L.jsx)(Y,{label:`Restore`,icon:Ah,shortcut:`R`,onClick:()=>void n()}):null,t.check===`open`&&!o?(0,L.jsx)(wX,{on:!!t.auto,toggle:a}):null,o?null:(0,L.jsx)(CX,{row:t,archive:r}),(0,L.jsx)(WO,{icon:ig,label:o?`Delete for good`:`Delete`,text:`Delete`,shortcut:`Delete`,title:`Delete "${t.title}" for good?`,description:`This cannot be undone.`,confirmLabel:`Delete`,variant:`destructive`,onConfirm:()=>void i()})]})}function EX({taskId:e}){let t=(0,m.useRef)(!0);(0,m.useEffect)(()=>(t.current=!0,()=>{t.current=!1}),[]);async function n(){let n=Hf();try{let r=await qf(`tasks.open`,{taskId:e});if(!t.current||Hf()!==n)return;r.notice&&B.info(r.notice);let i=await qf(`status.get`,{});if(!t.current||Hf()!==n)return;let a=r.key??(r.sessionId===i.sessionId?`here`:r.sessionId);a?DD(`#/sessions/${encodeURIComponent(a)}`):r.notice||B.info(`This task has no active session. No replacement session was created.`)}catch(e){t.current&&Hf()===n&&B.error(e instanceof Error?e.message:String(e))}}return(0,L.jsx)(Y,{label:`Open task conversation`,text:`Conversation`,icon:Jm,shortcut:`O`,onClick:()=>void n()})}function DX(e){let{row:t}=e,n=t.kind===`plan`,r=UD(`tasks.get`,{taskId:t.id},[`tasks`],!n),i=VD(`lobby`).data?.task,a=i?.id===t.id?i:void 0;if(n)return(0,L.jsx)(_X,{row:t,onGone:e.onGone});let o=t.check===`open`&&t.kind===`task`,s=r.data?r.data.work:t.work;return(0,L.jsxs)(`article`,{className:`flex flex-col gap-5`,"aria-label":t.title,children:[(0,L.jsx)(TX,{...e}),(0,L.jsx)(xX,{row:t,task:a}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,L.jsx)(EY,{timing:r.data?.timing??t.timing,...s?{work:s}:{},stopped:t.check!==`open`})}),r.data?.delivery?(0,L.jsx)(BY,{taskId:t.id,title:t.title,delivery:r.data.delivery,onChanged:r.reload},t.id):null,r.data?(0,L.jsx)(fX,{detail:r.data,finished:!o}):null,(0,L.jsx)(GY,{taskId:t.id,finished:!o,canComment:o}),r.data?(0,L.jsx)(pX,{detail:r.data}):null,r.error&&!r.data?(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load the plan detail. `,r.error]}):null]})}function OX({row:e}){return e.check===`open`&&e.progress?(0,L.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground tabular-nums`,children:[(0,L.jsx)(vU,{done:e.progress.done,total:e.progress.total}),(0,L.jsxs)(`span`,{children:[e.progress.done,`/`,e.progress.total]})]}):e.age&&e.check!==`open`?(0,L.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:e.age}):null}function kX(e){return e.check===`dropped`?`text-muted-foreground line-through`:e.kind===`archived`||e.check===`done`?`text-muted-foreground`:`text-foreground`}function AX({row:e,selected:t,onSelect:n}){return(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(e.id),className:$z,children:[(0,L.jsxs)(`span`,{className:`flex items-start gap-2 text-sm`,children:[(0,L.jsx)(yU,{check:e.check,className:`mt-0.5`}),(0,L.jsxs)(`span`,{className:`sr-only`,children:[qY[e.check],`:`]}),(0,L.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words`,kX(e),t&&`font-medium text-foreground`),children:e.title}),(0,L.jsx)(OX,{row:e})]}),e.check===`open`?(0,L.jsx)(`span`,{className:`pl-6 text-xs text-muted-foreground`,children:$Y(e)}):null,e.kind===`plan`?null:(0,L.jsx)(`span`,{className:`pl-6 text-xs text-muted-foreground`,children:(0,L.jsx)(EY,{timing:e.timing,...e.work?{work:e.work}:{},stopped:e.check!==`open`})}),e.delivery?(0,L.jsxs)(`span`,{className:`pl-6 text-xs text-foreground`,children:[`Delivery: `,e.delivery.status.replaceAll(`_`,` `),` · open task to review`]}):null]})})}function jX({rows:e,selectedId:t,onSelect:n}){return(0,L.jsx)(`div`,{className:`flex flex-col pb-2`,children:eX(e).map(({section:e,rows:r})=>(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h3`,{className:tB,children:(0,L.jsx)(pz,{title:KY[e],right:String(r.length),className:`[&>span:first-child]:font-medium [&>span:first-child]:text-muted-foreground`})}),(0,L.jsx)(`ul`,{className:eB,children:r.map(e=>(0,L.jsx)(AX,{row:e,selected:e.id===t,onSelect:n},`${e.kind}-${e.id}`))})]},e))})}var MX=()=>DD(ED(`tasks`)),NX=e=>DD(ED(`tasks`,e));function PX(){return(0,L.jsxs)(kD,{className:`m-4 flex-1`,children:[(0,L.jsxs)(AD,{children:[(0,L.jsx)(MD,{variant:`icon`,children:(0,L.jsx)(Pm,{"aria-hidden":`true`})}),(0,L.jsx)(PD,{children:XY})]}),(0,L.jsx)(J,{onClick:()=>DD(ED(`plan`)),children:`Plan a task`})]})}function FX({shown:e,count:t,onToggle:n}){return(0,L.jsxs)(`label`,{className:`btn-raised flex h-7 cursor-pointer items-center gap-2 rounded-lg border bg-card px-2 text-xs font-medium transition-[box-shadow]`,children:[(0,L.jsx)(wV,{checked:e,onCheckedChange:n,"aria-label":`Show archived tasks`,className:`size-4`}),`Archived`,(0,L.jsx)(Qz,{variant:`secondary`,className:`h-5 px-1.5`,children:t})]})}function IX({id:e}){let t=SO(),[n,r]=(0,m.useState)(!1),i=UD(`tasks.list`,{},[`tasks`,`plans`]),a=UD(`tasks.archived`,{},[`tasks`]),o=i.data?.rows??[],s=a.data?.rows??[],c=n?[...o,...s]:o,l=e??(t?c[0]?.id:void 0),u=[...c,...s].find(e=>e.id===l&&e.kind===`task`)?.id;if((0,m.useEffect)(()=>(zJ(u),()=>zJ(void 0)),[u]),!i.data&&i.error)return(0,L.jsx)(LD,{message:`Could not load tasks. ${i.error}`,onRetry:i.reload});if(i.data&&o.length===0&&s.length===0)return(0,L.jsx)(PX,{});let d=[...c,...s].find(e=>e.id===l),f=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(EO,{title:`Tasks`,count:tX(c),children:(0,L.jsx)(FX,{shown:n,count:s.length,onToggle:()=>r(e=>!e)})}),i.data?c.length===0?(0,L.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:XY}):(0,L.jsx)(jX,{rows:c,selectedId:l,onSelect:NX}):(0,L.jsx)(DO,{})]}),p=d?(0,L.jsx)(DX,{row:d,onGone:MX,onChanged:i.reload},d.id):e?(0,L.jsx)(LX,{}):null;return(0,L.jsx)(TO,{wide:t,list:f,detail:p,open:!!e,onClose:MX,hint:`Select a task to see its detail.`,describe:`Task detail`})}function LX(){return(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That task is not on the list any more.`})}var RX={l:`lobby`,p:`plan`,t:`tasks`,i:`issues`,u:`git`,s:`sessions`,n:`knowledge`,q:`quickfix`,m:`metrics`,e:`settings`,x:`excalidraw`};function zX(e){let t=e[0];if(t)try{return decodeURIComponent(t)}catch{return t}}function BX(e){if(e.kind===`settings`)return(0,L.jsx)(aq,{});if(e.kind===`sessions`)return(0,L.jsx)(CY,{id:zX(e.key?[e.key]:[])});switch(e.tab){case`lobby`:return(0,L.jsx)(PU,{});case`tasks`:return(0,L.jsx)(IX,{id:zX(e.rest)});case`plan`:return(0,L.jsx)(hJ,{});case`quickfix`:return(0,L.jsx)(PJ,{id:zX(e.rest)});case`issues`:return(0,L.jsx)(FB,{rest:e.rest});case`metrics`:return(0,L.jsx)(TW,{});case`git`:return(0,L.jsx)(lB,{rest:e.rest});case`knowledge`:return(0,L.jsx)(CV,{agent:e.rest[0],file:e.rest[1]});case`excalidraw`:return(0,L.jsx)(AH,{id:zX(e.rest)})}}function VX(e,t){return t.overlay?!0:e===`savePlan`&&!t.saveAvailable}var HX={tab:`Tab`,esc:`Escape`,escape:`Escape`,enter:`Enter`,space:`Space`,pageup:`PageUp`,pagedown:`PageDown`,home:`Home`,end:`End`,"]":`BracketRight`,"[":`BracketLeft`,"/":`Slash`,"?":`Slash`,",":`Comma`,".":`Period`};function UX(e){return e.length===1&&/[a-z]/i.test(e)?`Key${e.toUpperCase()}`:e.length===1&&/[0-9]/.test(e)?`Digit${e}`:HX[e]}function WX(e){let t={alt:!1,ctrl:!1,shift:!1,meta:!1,code:``};for(let n of e.toLowerCase().split(`+`))if(n===`alt`)t.alt=!0;else if(n===`ctrl`||n===`control`)t.ctrl=!0;else if(n===`shift`)t.shift=!0;else if(n===`meta`||n===`cmd`)t.meta=!0;else{let e=UX(n);if(!e)return;t.code=e}return t.code?t:void 0}function GX(e,t){return e.code===t.code&&e.altKey===t.alt&&e.ctrlKey===t.ctrl&&e.shiftKey===t.shift&&e.metaKey===t.meta}function KX(e,t){let n=WX(t);return n?GX(e,n):!1}function qX(e,t){for(let n of t)if(KX(e,n.key))return n.action}function JX(e,t){for(let n of t)if(KX(e,n.key))return n.id}function YX(e){return XD(e.target)||e.target instanceof HTMLInputElement||e.target instanceof HTMLSelectElement||yD()||!!document.querySelector(`[role='dialog'], [role='menu'], [role='listbox']`)}function XX(e,t,n,r){let i=!e.shiftKey&&/^[1-9]$/.test(e.key)?t[Number(e.key)-1]:void 0;if(i)r(i.id);else if(e.key===`/`)n(`search`);else if(e.key===`?`)n(`help`);else if(e.key===`j`||e.key===`k`)nO(e.key===`j`?1:-1);else return!1;return!0}function ZX(e,t){let n=JX(e,t.tabs),r=qX(e,t.keys);return!n&&!r?!1:VX(r,{overlay:!!document.querySelector(`[role='dialog']:not([data-state='closed']), [role='menu']:not([data-state='closed']), [role='listbox']`)||yD(),typing:XD(e.target)||e.target instanceof HTMLInputElement,saveAvailable:!!document.querySelector(`[data-plan-save]:not([disabled])`)})||(r===`search`||r===`savePlan`)&&!t.insideApp()?!0:(e.preventDefault(),n?t.onTab(n):r&&t.onAction(r),!0)}function QX(e,t,n){if(e.key===`Escape`)return Date.now()<n&&e.preventDefault(),0;if(Date.now()<n){let n=RX[e.key];return n&&(e.preventDefault(),t.onTab(n)),0}return e.key===`g`?Date.now()+1500:(XX(e,t.tabs,t.onAction,t.onTab)&&e.preventDefault(),0)}function $X(e){(0,m.useEffect)(()=>{if(!e.enabled)return;let t=0,n=n=>{if(n.defaultPrevented||n.isComposing)return;if(!e.insideApp()){qX(n,e.keys)===`help`&&(n.preventDefault(),e.onAction(`help`));return}let r=!n.altKey&&!n.ctrlKey&&!n.metaKey;if(r&&YX(n)){t=0;return}if(ZX(n,e)){t=0;return}t=r?QX(n,e,t):0};return window.addEventListener(`keydown`,n,!0),()=>window.removeEventListener(`keydown`,n,!0)},[e.enabled,e.keys,e.tabs,e.insideApp,e.onAction,e.onTab])}var eZ=[{id:`focus`,caps:[`/`],help:`focus search, or the message box`},{id:`send`,label:`Enter`,help:`send the message`},{id:`newline`,label:`Shift+Enter`,help:`a new line (lists carry on)`},{id:`format`,label:`Ctrl+B`,help:`bold; Ctrl+I italic, Ctrl+E code, Ctrl+K link`},{id:`leave`,label:`Esc`,help:`leave the box for the tab bar`}],tZ=[{id:`digits`,caps:[`1`,`…`,`9`],help:`jump to a tab in current order`},{id:`help`,caps:[`?`],help:`keyboard shortcuts`},...Object.entries(RX).map(([e,t])=>({id:`go.${t}`,caps:[`g`,e],help:`jump to ${t}`})),{id:`project`,caps:[`P`],help:`open the project switcher`},{id:`theme`,caps:[`D`],help:`switch between light and dark`},{id:`edit`,label:`Ctrl+Enter`,help:`save an edited message; Esc cancels`}],nZ=[{id:`tasks`,page:`Tasks`,keys:[[`E`,`archive`],[`R`,`restore`],[`A`,`auto mode`],[`Delete`,`delete`]]},{id:`saved`,page:`Saved plan`,keys:[[`S`,`start here`],[`N`,`new session`],[`Delete`,`discard`]]},{id:`plan`,page:`Plan`,keys:[[`A`,`answer`],[`R`,`retry`],[`Ctrl+S`,`save`],[`N`,`new plan`]]},{id:`quickfix`,page:`Quick fix`,keys:[[`R`,`run anyway`],[`T`,`make a task`],[`C`,`cancel`]]},{id:`git`,page:`Git`,keys:[[`R`,`refresh`],[`V`,`review`],[`Q`,`Jev's read`],[`X`,`stop`]]},{id:`issues`,page:`Issues`,keys:[[`R`,`refresh`]]},{id:`knowledge`,page:`Knowledge`,keys:[[`E`,`edit`],[`A`,`add`],[`C`,`comment`],[`F`,`edit file`],[`Delete`,`delete`]]},{id:`excalidraw`,page:`Excalidraw`,keys:[[`R`,`reveal`],[`C`,`copy`],[`O`,`open`],[`W`,`draw`],[`T`,`check`],[`Delete`,`remove`]]},{id:`sessions`,page:`Sessions`,keys:[[`M`,`move here`],[`S`,`stop`],[`B`,`back`]]},{id:`confirm`,page:`Asked to confirm`,keys:[[`Y`,`yes, do it`],[`Esc`,`keep it`]]}],rZ=[{id:`enter`,caps:[`↓`],help:`from the tab bar, into the page`},{id:`rows`,caps:[`↑`,`↓`],help:`move through a list (j and k work too)`},{id:`pane`,caps:[`←`,`→`],help:`between a list and its detail (h and l)`},{id:`ends`,caps:[`Home`,`End`],help:`first and last row`},{id:`open`,caps:[`Enter`,`Space`],help:`activate the focused button or row (links: Enter; checkboxes: Space)`},{id:`back`,label:`Esc`,help:`back up to the tab bar`}],iZ=[{id:`qmove`,caps:[`↑`,`↓`],help:`move between the options`},{id:`qpick`,label:`Space`,help:`pick an option (several when allowed)`},{id:`qchoose`,label:`Enter`,help:`choose and go on; in your own answer, send it`},{id:`qacross`,caps:[`←`,`→`],help:`previous and next question`},{id:`qdigit`,caps:[`1`,`2`,`…`],help:`pick that option`},{id:`qesc`,label:`Esc`,help:`put the question away for later`}];function aZ({line:e}){return(0,L.jsxs)(`div`,{className:`flex items-center gap-3 py-1`,children:[(0,L.jsx)(`span`,{className:`flex w-28 shrink-0 items-center`,children:e.caps?(0,L.jsx)(`span`,{className:`inline-flex items-center gap-1`,children:e.caps.map(e=>(0,L.jsx)(nD,{children:e},e))}):(0,L.jsx)(cD,{chord:e.label??``})}),(0,L.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.help})]})}function oZ(){return(0,L.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`h3`,{className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:`Buttons on a page`}),nZ.map(e=>(0,L.jsxs)(`div`,{className:`flex items-start gap-3 py-1`,children:[(0,L.jsx)(`span`,{className:`w-28 shrink-0 pt-0.5 text-sm font-medium`,children:e.page}),(0,L.jsx)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1.5 text-sm text-muted-foreground`,children:e.keys.map(([e,t])=>(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,L.jsx)(cD,{chord:e}),t]},e))})]},e.id))]})}function sZ({title:e,lines:t}){return(0,L.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,L.jsx)(`h3`,{className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:e}),t.map(e=>(0,L.jsx)(aZ,{line:e},e.id))]})}function cZ(e){return e.map(e=>({id:e.action,label:e.label,help:e.help}))}function lZ(e){return e.map(e=>({id:`tab.${e.id}`,label:e.key,help:`jump to the ${e.label} tab`}))}function uZ({open:e,onOpenChange:t,keys:n,tabs:r}){let i=vD(e,_D.help);return(0,m.useEffect)(()=>{if(!e||!i)return;let r=e=>{let r=n.find(e=>e.action===`help`)?.key;(e.key===`Escape`||r&&KX(e,r))&&(e.preventDefault(),t(!1))};return window.addEventListener(`keydown`,r,!0),()=>window.removeEventListener(`keydown`,r,!0)},[e,i,t,n]),(0,L.jsxs)(uD,{open:e&&i,onOpenChange:t,label:`Keys`,className:`max-w-4xl`,children:[(0,L.jsxs)(`header`,{className:`flex items-center justify-between gap-3 border-b border-border px-6 py-4`,children:[(0,L.jsx)(`h2`,{"aria-hidden":`true`,className:`text-base font-semibold tracking-tight`,children:`Keyboard shortcuts`}),(0,L.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(cD,{chord:`Esc`}),(0,L.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close`,onClick:()=>t(!1),children:(0,L.jsx)(bg,{"aria-hidden":`true`})})]})]}),(0,L.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-x-10 gap-y-6 overflow-y-auto px-6 py-5 md:grid-cols-2`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,L.jsx)(sZ,{title:`Everywhere`,lines:cZ(n)}),(0,L.jsx)(sZ,{title:`Jump to a tab`,lines:lZ(r)}),(0,L.jsx)(sZ,{title:`Navigation and editing`,lines:tZ}),(0,L.jsx)(sZ,{title:`Message box`,lines:eZ})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,L.jsx)(sZ,{title:`Lists and panes`,lines:rZ}),(0,L.jsx)(oZ,{}),(0,L.jsx)(sZ,{title:`Questions`,lines:iZ})]})]})]})}function dZ(e){return e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}async function fZ(e){if(e.size===0)throw Error(`${e.name||`That file`} is empty.`);if(e.size>20971520)throw Error(`${e.name||`That file`} is larger than 20 MB.`);let t=new URLSearchParams({name:e.name||`pasted-file`,type:e.type}),n=await fetch(Uf(`/api/files.upload?${t}`),{method:`POST`,headers:{"Content-Type":`application/octet-stream`},body:e,credentials:`same-origin`}),r=await n.json().catch(()=>void 0);if(!r)throw new Gf(`the lobby answered ${n.status}`,`failed`,n.status);if(!r.ok)throw new Gf(r.error,r.code,n.status);return r.result}function pZ(e,t,n,r){let i=e.slice(0,t),a=e.slice(t,n),o=e.slice(n);if(a.length>=r.length*2&&a.startsWith(r)&&a.endsWith(r)){let e=a.slice(r.length,a.length-r.length);return{value:i+e+o,start:t,end:t+e.length}}return i.endsWith(r)&&o.startsWith(r)?{value:i.slice(0,i.length-r.length)+a+o.slice(r.length),start:t-r.length,end:n-r.length}:{value:i+r+a+r+o,start:t+r.length,end:n+r.length}}function mZ(e,t,n){let r=e.slice(t,n)||`text`,i=`[${r}](url)`,a=t+r.length+3;return{value:e.slice(0,t)+i+e.slice(n),start:a,end:a+3}}var hZ=/^(\s*)(?:([-*+])|(\d+)([.)]))\s+(\[[ xX]\]\s+)?/;function gZ(e,t){let n=e.lastIndexOf(`
|
|
98
101
|
`,t-1)+1,r=e.indexOf(`
|
|
99
|
-
`,t),i=e.slice(n,r<0?e.length:r),a=XX.exec(i);if(!a||t-n<a[0].length)return;let[o,s=``,c,l,u=`.`,d]=a;if(i.slice(o.length).trim()===``)return{value:e.slice(0,n)+e.slice(r<0?e.length:r),start:n,end:n};let f=`\n${s}${c??`${Number(l)+1}${u}`} ${d?`[ ] `:``}`;return{value:e.slice(0,t)+f+e.slice(t),start:t+f.length,end:t+f.length}}var QX={id:`oracle`,pill:`Oracle`,label:`Message the oracle`,placeholder:`Message the oracle…`};function $X(e){if(e)try{return decodeURIComponent(e)}catch{return e}}function eZ(e,t,n){if(e.kind===`sessions`){let e={id:`newsession`,pill:`New session`,label:`Start a task in a new session`,placeholder:`Describe a task for a new session…`};return n?[{id:`session`,pill:`Message`,label:`Message ${n.name}`,placeholder:`Message ${n.name}…`,session:n},e,QX]:[e,QX]}if(e.kind!==`tab`)return[QX];if(e.tab===`plan`)return[{id:`panel`,pill:`Panel`,label:`Message the panel`,placeholder:`Describe a task, or answer the panel…`},QX];if(e.tab===`quickfix`)return[{id:`quickfix`,pill:`Quick fix`,label:`Describe a quick fix`,placeholder:`Describe a small change…`},QX];let r=e.tab===`tasks`?$X(e.rest[0])??t:void 0;return r?[{id:`comment`,pill:`Comment`,label:`Comment on ${r}`,placeholder:`Comment on ${r}'s plan…`,taskId:r},{id:`task`,pill:`Task's oracle`,label:`Message ${r}'s oracle`,placeholder:`Leave a message for ${r}'s oracle…`,taskId:r},QX]:[QX]}var tZ=0,nZ=`btn-ghost relative inline-flex size-8 items-center justify-center rounded-lg border border-transparent before:absolute before:-inset-1 before:content-[''] text-muted-foreground transition-[box-shadow,color,translate] duration-150 ease-snap outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none aria-pressed:text-foreground`;function rZ(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function iZ({file:e,onRemove:t}){let n=(0,L.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,onClick:t,className:q(`flex shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40`,e.image?`absolute top-1 right-1 size-5 bg-background/80 text-foreground backdrop-blur-sm`:`size-7`),children:(0,L.jsx)(bg,{"aria-hidden":`true`,className:`size-3.5`})});return e.image?(0,L.jsxs)(B.li,{layout:!0,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{type:`spring`,stiffness:520,damping:32},title:`${e.name} · ${KX(e.size)}`,className:`relative size-16 shrink-0 overflow-hidden rounded-lg border border-border bg-muted`,children:[(0,L.jsx)(`img`,{src:Hf(e.image),alt:e.name,className:`size-full object-cover`}),e.state===`uploading`?(0,L.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center bg-background/60`,children:(0,L.jsx)(FD,{className:`size-4`,"aria-hidden":`true`,role:`presentation`})}):null,n]}):(0,L.jsxs)(B.li,{layout:!0,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{type:`spring`,stiffness:520,damping:32},className:`flex h-9 min-w-0 items-center gap-2 rounded-lg border border-border bg-muted pr-1 pl-2.5`,children:[(0,L.jsxs)(`span`,{className:`relative flex shrink-0 items-center justify-center text-muted-foreground`,children:[(0,L.jsx)(bm,{"aria-hidden":`true`,className:`size-4`}),e.state===`uploading`?(0,L.jsx)(FD,{className:`absolute -right-1 -bottom-1 size-2.5`,"aria-hidden":`true`,role:`presentation`}):null]}),(0,L.jsxs)(`span`,{className:`min-w-0 max-w-40`,children:[(0,L.jsx)(`span`,{className:`block truncate text-xs font-medium`,children:e.name}),(0,L.jsx)(`span`,{className:`block text-[0.65rem] leading-tight text-muted-foreground`,children:e.state===`uploading`?`uploading…`:KX(e.size)})]}),n]})}function aZ({route:e,keys:t,onHelp:n}){let[r,i]=(0,m.useState)(``),[a,o]=(0,m.useState)([]),[s,c]=(0,m.useState)(!1),[l,u]=(0,m.useState)(!1),[d,f]=(0,m.useState)(!1),[p,h]=(0,m.useState)(),g=VD(`status`),_=VD(`lobby`),v=bD(),y=(g.data?.busy??!1)||!!_.data?.reply?.trim(),{taskId:b,session:x}=EJ(),S=(0,m.useMemo)(()=>eZ(e,b,x),[e,b,x]),C=S.map(e=>`${e.id}:${e.taskId??e.session?.name??``}`).join(`|`),w=S.find(e=>e.id===p)??S[0];(0,m.useEffect)(()=>h(void 0),[C]);let T=(0,m.useRef)(null),E=(0,m.useRef)(null),D=(0,m.useRef)(null),O=(0,m.useRef)(a);O.current=a;let k=(0,m.useRef)(void 0);(0,m.useLayoutEffect)(()=>{let e=k.current,t=E.current;e&&t&&(k.current=void 0,t.setSelectionRange(e.start,e.end))},[r]);let ee=(0,m.useCallback)(e=>{k.current={start:e.start,end:e.end},i(e.value)},[]);(0,m.useEffect)(()=>{let e=T.current;if(!e)return;let t=document.documentElement,n=()=>t.style.setProperty(`--composer-h`,v?`0px`:`${Math.ceil(e.getBoundingClientRect().height)}px`);n();let r=new ResizeObserver(n);return r.observe(e),()=>{r.disconnect(),t.style.setProperty(`--composer-h`,`0px`)}},[v]);let te=(0,m.useCallback)(e=>{let t=[...e],n=8-O.current.length;t.length>n&&V.warning(`At most 8 files go with one message.`);for(let e of t.slice(0,Math.max(0,n))){let t=`f${++tZ}`,n=e.type.startsWith(`image/`)?URL.createObjectURL(e):void 0;o(r=>[...r,{key:t,name:e.name||(n?`image.png`:`file`),size:e.size,...n?{image:n}:{},state:`uploading`}]),qX(e).then(e=>o(n=>n.map(n=>n.key===t?{...n,state:`ready`,info:e}:n))).catch(e=>{V.error(e instanceof Error?e.message:`That file did not upload.`),o(e=>e.filter(e=>e.key!==t))})}},[]),ne=(0,m.useCallback)(e=>{o(t=>{let n=t.find(t=>t.key===e);return n?.image&&URL.revokeObjectURL(n.image),t.filter(t=>t.key!==e)})},[]),A=a.some(e=>e.state===`uploading`),re=a.flatMap(e=>e.info?[e.info.id]:[]),ie=(r.trim().length>0||re.length>0)&&!A&&!l,j=(0,m.useCallback)(async()=>{if(!ie)return;u(!0);let e=re.length>0?re:void 0,t={text:r,...e?{attachments:e}:{}};try{let n=!0;if(w.id===`oracle`){let e=await Kf(`lobby.send`,t);e.notice&&V(e.notice)}else if(w.id===`panel`)n=await H(`planner.send`,t)!==void 0;else if(w.id===`quickfix`)n=await H(`quickfix.submit`,t)!==void 0;else if(w.id===`task`)n=await H(`tasks.message`,{taskId:w.taskId,...t})!==void 0;else if(w.id===`session`)n=await H(`sessions.message`,{...w.session.address,...t})!==void 0;else if(w.id===`newsession`){let t=await H(`sessions.start`,{request:r,...e?{attachments:e}:{}});n=t!==void 0,t?.key&&DD(`#/sessions/${encodeURIComponent(t.key)}`)}else n=await H(`tasks.comment`,{taskId:w.taskId,...t})!==void 0;if(n){i(``);for(let e of O.current)e.image&&URL.revokeObjectURL(e.image);o([])}}catch(e){V.error(e instanceof Error?e.message:`Could not send`)}finally{u(!1)}},[ie,re,w,r]),ae=(0,m.useCallback)(async()=>{try{await Kf(`lobby.abort`,{})}catch(e){V.error(e instanceof Error?e.message:`Could not stop`)}},[]);return(0,L.jsx)(`div`,{ref:T,className:q(`dock pointer-events-none absolute inset-x-0 bottom-0 z-30 px-6 pb-[max(1.25rem,env(safe-area-inset-bottom))] transition-opacity duration-200 ease-snap max-sm:px-2 max-sm:pb-[max(0.5rem,env(safe-area-inset-bottom))]`,v&&`opacity-0`),inert:v,children:(0,L.jsx)(`div`,{className:`pointer-events-auto mx-auto w-full max-w-3xl`,children:(0,L.jsxs)(`div`,{className:q(`group/composer relative rounded-2xl border border-dock-border bg-dock shadow-dock backdrop-blur-xl backdrop-saturate-150 transition-[border-color,box-shadow] duration-300 ease-snap focus-within:border-ring/45 focus-within:shadow-dock-focus`,d&&`border-primary shadow-[0_0_0_3px_color-mix(in_oklab,var(--ring)_30%,transparent)]`),onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),f(!0))},onDragLeave:()=>f(!1),onDrop:e=>{e.preventDefault(),f(!1),e.dataTransfer.files.length>0&&te(e.dataTransfer.files)},children:[(0,L.jsx)(tu,{initial:!1,children:a.length>0?(0,L.jsx)(B.ul,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{type:`spring`,stiffness:420,damping:36},"aria-label":`Attachments`,className:`flex flex-wrap items-end gap-2 overflow-hidden px-3 pt-3`,children:a.map(e=>(0,L.jsx)(iZ,{file:e,onRemove:()=>ne(e.key)},e.key))},`files`):null}),s?(0,L.jsx)(`div`,{"aria-label":`Markdown preview`,role:`region`,className:`max-h-48 overflow-y-auto border-b border-border px-4 py-3`,children:r.trim()?(0,L.jsx)(XR,{text:r}):(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing to preview yet.`})}):null,(0,L.jsx)(`div`,{className:`flex px-4 pt-3 pb-1`,children:(0,L.jsx)(`textarea`,{ref:E,id:`composer-text`,"aria-label":w.label,value:r,onChange:e=>i(e.target.value),onKeyDown:e=>{if(e.key===`Escape`&&!e.nativeEvent.isComposing){e.preventDefault(),aO();return}let t=e.currentTarget,n=e.key.toLowerCase();if((e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey&&[`b`,`i`,`e`,`k`].includes(n)){e.preventDefault();let{selectionStart:r,selectionEnd:i,value:a}=t;ee(n===`k`?YX(a,r,i):JX(a,r,i,n===`b`?`**`:n===`i`?`_`:"`"));return}if(e.altKey&&!e.ctrlKey&&!e.metaKey&&n===`p`){e.preventDefault(),c(e=>!e);return}if(e.key===`Enter`&&e.shiftKey&&!e.nativeEvent.isComposing&&t.selectionStart===t.selectionEnd){let n=ZX(t.value,t.selectionStart);n&&(e.preventDefault(),ee(n));return}if(e.key===`Backspace`&&t.value===``&&O.current.length>0){e.preventDefault(),ne(O.current.at(-1).key);return}(rZ(e)||e.key===`Enter`&&(e.metaKey||e.ctrlKey))&&(e.preventDefault(),j())},onPaste:e=>{let t=[...e.clipboardData.files];t.length!==0&&(e.preventDefault(),te(t))},placeholder:y&&w.id===`oracle`?`The oracle is working. Enter steers it…`:w.placeholder,rows:1,className:`field-sizing-content max-h-[min(45vh,20rem)] min-h-[1.75rem] w-full min-w-0 flex-1 resize-none bg-transparent text-base leading-relaxed caret-primary outline-none placeholder:text-muted-foreground md:text-[0.9375rem] md:leading-relaxed`})}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1 gap-y-1 px-2 pt-1 pb-2`,children:[(0,L.jsx)(`input`,{ref:D,type:`file`,multiple:!0,hidden:!0,tabIndex:-1,"aria-label":`Attach files`,onChange:e=>{te(e.target.files??[]),e.target.value=``}}),(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"aria-label":`Attach images, PDFs or files`,"data-compact":!0,onClick:()=>D.current?.click(),className:nZ,children:(0,L.jsx)(fh,{"aria-hidden":`true`,className:`size-4`})})}),(0,L.jsx)(qD,{children:`Attach images, PDFs or files`})]}),(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-label":`Preview the Markdown`,"aria-pressed":s,"aria-keyshortcuts":`Alt+P`,"aria-describedby":`focused-action-help`,"data-compact":!0,onClick:()=>c(e=>!e),className:nZ,children:(0,L.jsx)(mm,{"aria-hidden":`true`,className:`size-4`})})}),(0,L.jsxs)(qD,{children:[`Preview `,(0,L.jsx)(cD,{chord:`Alt+P`})]})]}),(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1.5 h-4 w-px bg-border`}),S.length>1?(0,L.jsx)(`div`,{role:`radiogroup`,"aria-label":`Send to`,className:`flex items-center gap-0.5 rounded-lg bg-muted p-0.5 shadow-[inset_0_1px_2px_rgb(0_0_0/0.07)]`,children:S.map(e=>(0,L.jsx)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,role:`radio`,"data-compact":!0,"aria-checked":e.id===w.id,onClick:()=>h(e.id),className:q(`h-6 rounded-md border border-transparent px-2.5 text-xs font-medium transition-[background-color,color,box-shadow] duration-150 outline-none focus-visible:ring-3 focus-visible:ring-ring/40`,e.id===w.id?`btn-raised bg-card text-foreground`:`text-muted-foreground hover:text-foreground`),children:e.pill},e.id))}):(0,L.jsxs)(`span`,{className:`px-1 text-xs text-muted-foreground`,children:[`To the `,w.pill.toLowerCase()]}),(0,L.jsx)(`div`,{className:`@container ml-auto flex min-w-0 flex-1 items-center justify-end overflow-hidden px-2`,children:(0,L.jsxs)(`div`,{className:`flex items-center justify-end gap-3.5`,children:[e.kind===`tab`&&e.tab===`plan`?(0,L.jsx)(lD,{chord:t.savePlan??`Ctrl+S`,className:`hidden @[34rem]:inline-flex`,children:`save plan`}):null,(0,L.jsx)(lD,{chord:`/`,className:`hidden group-focus-within/composer:!hidden @[28rem]:inline-flex`,children:`write`}),(0,L.jsx)(lD,{chord:`Esc`,className:`hidden group-[:not(:focus-within)]/composer:!hidden @[28rem]:inline-flex`,children:`tabs`}),(0,L.jsx)(lD,{chord:`Shift+Enter`,className:`hidden @[22rem]:inline-flex`,children:`new line`}),(0,L.jsx)(lD,{chord:`Enter`,className:`hidden @[11rem]:inline-flex`,children:`send`}),(0,L.jsxs)(`button`,{type:`button`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"aria-label":`Keyboard shortcuts`,"aria-haspopup":`dialog`,"data-compact":!0,onClick:n,className:`kbd-hint inline-flex h-7 shrink-0 items-center gap-1.5 rounded-lg px-1.5 text-xs text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40`,children:[(0,L.jsx)(cD,{chord:t.help??`Alt+H`,className:`kbd-hint`}),(0,L.jsx)(`span`,{className:`hidden @[8rem]:inline`,children:`shortcuts`})]})]})}),y&&w.id===`oracle`?(0,L.jsx)(WO,{label:`Stop`,icon:Jh,iconOnly:!0,compact:!0,title:`Stop the oracle?`,description:`The current response stops. Work already recorded is kept.`,confirmLabel:`Stop`,variant:`destructive`,onConfirm:()=>void ae()}):null,(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-label":`Send`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"data-compact":!0,onClick:()=>void j(),disabled:!ie,className:`btn-tint relative inline-flex size-8 items-center justify-center rounded-lg border [--tint:var(--primary)] before:absolute before:-inset-1 before:content-[''] text-primary-foreground transition-[background-color,color,box-shadow,translate,filter] duration-150 ease-snap outline-none focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none disabled:text-muted-foreground`,children:l?(0,L.jsx)(FD,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5 text-primary-foreground`}):(0,L.jsx)(bp,{"aria-hidden":`true`,className:`size-4`,strokeWidth:2.25})})}),(0,L.jsxs)(qD,{children:[`Send `,(0,L.jsx)(cD,{chord:`Enter`})]})]})]}),d?(0,L.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 flex items-center justify-center rounded-xl bg-card/90 text-sm font-medium text-primary backdrop-blur-[2px]`,children:`Drop to attach`}):null]})})})}function oZ(){try{return{id:Vf()}}catch(e){return{error:e.message}}}function sZ(e,t){if(e){if(t&&!e.projects.some(e=>e.id===t))return`Selected project is unknown or offline. Refresh or choose a running project.`;if(!e.projects.length)return`No authorized running projects found. Start a project in Pi, then refresh.`}}function cZ(){let[e,t]=(0,m.useState)(),[n,r]=(0,m.useState)(),[i,a]=(0,m.useState)(!1),o=(0,m.useRef)(0);async function s(){let e=++o.current;a(!0),r(void 0);try{let n=await Kf(`projects.list`,{});e===o.current&&t(n)}catch(t){e===o.current&&r(t.message)}finally{e===o.current&&a(!1)}}(0,m.useEffect)(()=>(s(),()=>{o.current++}),[]);let[c,l]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{if(!i)return l(!1);let e=setTimeout(()=>l(!0),300);return()=>clearTimeout(e)},[i]),{data:e,error:n,busy:i,slow:c,refresh:s}}function lZ({data:e,error:t}){let n=oZ();return n.error??t??sZ(e,n.id)}function uZ({projects:e}){let t=lZ(e);return t?(0,L.jsxs)(`p`,{role:`alert`,className:`notice flex min-w-0 items-start gap-2 pt-1 pb-0.5 text-xs break-words text-destructive`,children:[(0,L.jsx)(og,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,L.jsx)(`span`,{children:t})]}):null}function dZ(e){let t=e.key===`ArrowDown`?1:e.key===`ArrowUp`?-1:0,n=e.key===`Home`?`first`:e.key===`End`?`last`:void 0;if(!t&&!n)return;let r=[...e.currentTarget.querySelectorAll(`[role='option']`)];if(r.length===0)return;e.preventDefault();let i=r.indexOf(document.activeElement);r[n===`first`?0:n===`last`?r.length-1:Math.max(0,Math.min(r.length-1,(i<0?t>0?-1:r.length:i)+t))]?.focus()}function fZ({projects:e,tab:t,name:n,branch:r}){let{data:i,busy:a,slow:o,refresh:s}=e,[c,l]=(0,m.useState)(!1),u=oZ(),d=lZ(e),f=u.error?`invalid`:u.id??i?.currentId??``,p=!!i?.projects.length;dO(`p`,()=>l(!0),{enabled:p}),dO(`r`,()=>void s(),{enabled:c,inDialog:!0});function h(e){l(!1),e!==f&&Uf(e,t)}return(0,L.jsxs)(`div`,{"aria-busy":a,className:`flex min-w-0 items-center gap-1.5`,children:[(0,L.jsxs)(JT,{open:c&&p,onOpenChange:l,children:[(0,L.jsxs)(YT,{type:`button`,role:`combobox`,"aria-label":`Project`,"aria-description":`${n}${r?`, branch ${r}`:``}`,"aria-haspopup":`listbox`,"aria-expanded":c&&p,"aria-keyshortcuts":`P ArrowDown`,disabled:!p,onKeyDown:e=>{e.key!==`ArrowDown`||e.altKey||e.metaKey||e.ctrlKey||(e.preventDefault(),l(!0))},className:`btn-ghost group flex h-8 min-w-0 items-center gap-2 rounded-lg border border-transparent px-2.5 text-sm font-medium outline-none transition-[box-shadow,background-color] duration-150 focus-visible:ring-3 focus-visible:ring-ring/40 disabled:pointer-events-none`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:q(`size-2.5 shrink-0 rounded-full`,d?`bg-destructive`:`bg-primary`)}),(0,L.jsx)(`span`,{className:`truncate`,children:n}),(0,L.jsx)(Ip,{"aria-hidden":`true`,className:q(`size-3.5 shrink-0 text-muted-foreground`,!p&&`opacity-40`)})]}),(0,L.jsx)(XT,{children:(0,L.jsxs)(ZT,{align:`start`,sideOffset:6,"aria-label":`Projects`,onKeyDown:dZ,onOpenAutoFocus:e=>{let t=e.currentTarget?.querySelector(`[role='option'][aria-selected='true']`)??e.currentTarget?.querySelector(`[role='option']`);t&&(e.preventDefault(),t.focus())},className:`glass-pop z-50 flex w-[min(26rem,calc(100vw-1.5rem))] origin-(--radix-popover-content-transform-origin) flex-col overflow-hidden rounded-xl outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-2`,children:[(0,L.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Running projects`}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>void s(),disabled:a,"aria-label":`Refresh list`,"aria-keyshortcuts":`R`,className:`inline-flex h-7 items-center gap-1.5 rounded-lg px-2 text-xs text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 disabled:opacity-60`,children:[a?(0,L.jsx)(FD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}):(0,L.jsx)(Oh,{"aria-hidden":`true`,className:`size-3`}),`Refresh`,(0,L.jsx)(cD,{chord:`R`,className:`kbd-hint`})]})]}),(0,L.jsx)(`div`,{role:`listbox`,"aria-label":`Projects`,className:`flex max-h-72 flex-col overflow-y-auto p-1`,children:i?.projects.map(e=>{let t=e.id===f;return(0,L.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t,onClick:()=>h(e.id),className:q(`flex min-h-10 w-full items-start gap-2.5 rounded-lg px-2.5 py-2 text-left outline-none transition-colors hover:bg-muted focus-visible:bg-muted focus-visible:ring-3 focus-visible:ring-ring/30`,t&&`bg-accent`),children:[(0,L.jsx)(`span`,{className:`flex h-5 w-4 shrink-0 items-center justify-center`,children:t?(0,L.jsx)(Op,{"aria-hidden":`true`,className:`size-3.5 text-primary`}):null}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,L.jsxs)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:[e.cwd,` · :`,e.port]})]})]},e.id)})})]})})]}),r?(0,L.jsxs)(`span`,{className:`hidden min-w-0 items-center gap-1 rounded-md bg-muted px-2 py-1 text-xs text-muted-foreground sm:inline-flex`,children:[(0,L.jsx)(Sm,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,L.jsx)(`span`,{className:`truncate`,children:r})]}):null,o||d?(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-label":`Refresh projects`,disabled:a,onClick:()=>void s(),className:`btn-ghost inline-flex size-8 shrink-0 items-center justify-center rounded-lg border border-transparent text-muted-foreground outline-none transition-[box-shadow,color,translate] hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px disabled:opacity-60`,children:a?(0,L.jsx)(FD,{"aria-hidden":`true`,role:`presentation`,className:`size-4`}):(0,L.jsx)(Oh,{"aria-hidden":`true`,className:`size-4`})})}),(0,L.jsx)(qD,{side:`bottom`,children:`Refresh projects`})]}):null]})}function pZ({state:e}){return e===`live`?(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`span`,{role:`img`,"aria-label":`Connected`,className:`grid size-6 place-items-center`,children:(0,L.jsx)(`span`,{className:`size-2 rounded-full bg-success`})})}),(0,L.jsx)(qD,{children:`Connected`})]}):e===`connecting`?(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,L.jsx)(FD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}),`reconnecting…`]}):(0,L.jsx)(`span`,{className:`text-xs font-medium text-destructive`,children:`Connection lost`})}var mZ=`btn-ghost inline-flex size-8 shrink-0 items-center justify-center rounded-lg border border-transparent text-muted-foreground transition-[background-color,color,box-shadow,translate] duration-150 ease-snap outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none aria-[current=page]:text-foreground`;function hZ({label:e,hint:t,href:n,active:r,children:i}){return(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`a`,{href:n,"aria-label":e,"aria-current":r?`page`:void 0,"aria-keyshortcuts":t,"aria-describedby":`focused-action-help`,className:mZ,children:i})}),(0,L.jsxs)(qD,{side:`bottom`,children:[e,` `,(0,L.jsx)(cD,{chord:t})]})]})}function gZ({hint:e,onHelp:t}){return(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-label":`Keyboard shortcuts`,"aria-haspopup":`dialog`,"aria-keyshortcuts":e,"aria-describedby":`focused-action-help`,onClick:t,className:mZ,children:(0,L.jsx)(Am,{"aria-hidden":`true`,className:`size-[1.05rem]`})})}),(0,L.jsxs)(qD,{side:`bottom`,children:[`Keyboard shortcuts `,(0,L.jsx)(cD,{chord:e})]})]})}function _Z(){let e=SW(),t=e?`Unmute prompt sounds`:`Mute prompt sounds`;return(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-label":t,"aria-pressed":e,"aria-describedby":`focused-action-help`,className:mZ,onClick:()=>bW(!e),children:e?(0,L.jsx)(gg,{"aria-hidden":`true`,className:`size-[1.05rem]`}):(0,L.jsx)(mg,{"aria-hidden":`true`,className:`size-[1.05rem]`})})}),(0,L.jsx)(qD,{side:`bottom`,children:t})]})}function vZ(){let{theme:e,setTheme:t}=OG(),n=e===`dark`||e===`system`&&typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches;return(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-label":n?`Switch to light mode`:`Switch to dark mode`,"aria-keyshortcuts":`D`,"aria-describedby":`focused-action-help`,onClick:()=>t(n?`light`:`dark`),className:mZ,children:n?(0,L.jsx)(Xh,{"aria-hidden":`true`,className:`size-[1.05rem]`}):(0,L.jsx)(oh,{"aria-hidden":`true`,className:`size-[1.05rem]`})})}),(0,L.jsxs)(qD,{side:`bottom`,children:[n?`Light mode`:`Dark mode`,` `,(0,L.jsx)(cD,{chord:`D`})]})]})}function yZ({busy:e,task:t,sessionName:n}){return(0,L.jsxs)(`div`,{className:`mr-1 flex min-w-0 items-center gap-2 text-[0.8125rem]`,children:[e?(0,L.jsx)(FD,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5`}):null,t?(0,L.jsxs)(`span`,{className:`hidden max-w-[16rem] truncate md:inline`,children:[(0,L.jsx)(`span`,{className:`font-medium`,children:t.id}),(0,L.jsxs)(`span`,{className:`hidden text-muted-foreground min-[1500px]:inline`,children:[` · `,t.state.replace(/_/g,` `)]})]}):(0,L.jsx)(`span`,{className:`hidden max-w-[10rem] truncate text-muted-foreground min-[1500px]:inline`,children:n??`no task in this session`})]})}function bZ(e){if(!e)return 0;let t=[...e.children].filter(e=>e instanceof HTMLElement&&e.offsetParent!==null&&getComputedStyle(e).position!==`absolute`);if(!t.length)return 0;let n=Math.min(...t.map(e=>e.getBoundingClientRect().left)),r=Math.max(...t.map(e=>e.getBoundingClientRect().right)),i=0;for(let t of e.querySelectorAll(`*`))t.clientWidth<=1||t.offsetParent===null||t.scrollWidth<=t.clientWidth+1||getComputedStyle(t).textOverflow===`ellipsis`&&(i+=t.scrollWidth-t.clientWidth);return r-n+i}var xZ=24;function SZ(){let e=(0,m.useRef)(null),[t,n]=(0,m.useState)(!1),r=(0,m.useRef)(()=>{});return r.current=()=>{let t=e.current;if(!t)return;let r=t.querySelector(`[role="tablist"]`),i=getComputedStyle(t),a=parseFloat(i.columnGap)||0,o=t.clientWidth-(parseFloat(i.paddingLeft)||0)-(parseFloat(i.paddingRight)||0),s=bZ(t.querySelector(`.where`))+(r?.offsetWidth??0)+bZ(t.querySelector(`.tools`))+a*2;n(s+xZ<=o)},(0,m.useLayoutEffect)(()=>r.current()),(0,m.useLayoutEffect)(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(()=>r.current());n.observe(t);for(let e of t.querySelectorAll(`[role="tablist"], .where, .tools`))n.observe(e);return()=>n.disconnect()},[]),{header:e,one:t}}function CZ({status:e,task:t,connection:n,route:r,tabs:i,extra:a,keys:o,onHelp:s}){let c=e?.workspace.name??`bot-lobby`,l=e?.branch??e?.workspace.branch,u=e?.busy??!1,d=cZ(),{header:f,one:p}=SZ();return(0,L.jsxs)(`header`,{ref:f,className:`app-header shrink-0`,"data-one-row":p||void 0,children:[(0,L.jsx)(`div`,{className:`where flex min-w-0 items-center`,children:(0,L.jsx)(fZ,{projects:d,tab:r.kind===`tab`?r.tab:r.kind,name:c,branch:l})}),(0,L.jsx)(`div`,{className:`tabs min-w-0`,children:i}),(0,L.jsxs)(`div`,{className:`tools flex min-w-0 items-center justify-end gap-0.5`,children:[a,(0,L.jsx)(yZ,{busy:u,...t?{task:t}:{},...e?.sessionName?{sessionName:e.sessionName}:{}}),(0,L.jsx)(pZ,{state:n}),(0,L.jsx)(hZ,{label:`Sessions`,hint:o.sessions??`Alt+O`,href:`#/sessions`,active:r.kind===`sessions`,children:(0,L.jsx)(Mm,{"aria-hidden":`true`,className:`size-[1.05rem]`})}),(0,L.jsx)(hZ,{label:`Settings`,hint:o.settings??`Alt+S`,href:`#/settings`,active:r.kind===`settings`,children:(0,L.jsx)(Bh,{"aria-hidden":`true`,className:`size-[1.05rem]`})}),(0,L.jsx)(gZ,{hint:o.help??`Alt+H`,onHelp:s}),(0,L.jsx)(vZ,{}),(0,L.jsx)(_Z,{}),(0,L.jsx)(`span`,{id:`focused-action-help`,className:`sr-only`,children:`Focused buttons: Enter or Space. Links: Enter. Checkboxes: Space.`})]}),(0,L.jsx)(uZ,{projects:d})]})}function wZ(e){let t=e.match(/[#&?]?token=([^&\s#]+)/i);if(t?.[1])return decodeURIComponent(t[1]);let n=e.trim();return n&&!n.includes(`/`)&&!n.includes(` `)?n:void 0}function TZ(){let[e,t]=(0,m.useState)(``),[n,r]=(0,m.useState)(),[i,a]=(0,m.useState)(!1);async function o(e){a(!0),r(void 0),e&&(window.location.hash=`token=${encodeURIComponent(e)}`),await Jf()?window.location.reload():(r(e?`That link did not sign in. Copy the link from Pi and try again.`:`Paste the link from Pi below.`),a(!1))}function s(t){t.preventDefault(),o(wZ(e))}return(0,L.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-6`,children:(0,L.jsxs)(`form`,{onSubmit:s,className:`glass flex w-full max-w-md flex-col gap-4 rounded-xl p-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(Om,{className:`size-5`,"aria-hidden":`true`}),(0,L.jsx)(`h1`,{className:`text-base font-medium`,children:`Sign in to bot-lobby`})]}),(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Pi printed a link when it started (or run `,(0,L.jsx)(`code`,{className:`rounded-lg bg-muted px-1.5 py-0.5 font-mono text-xs`,children:`/bot-lobby web`}),`to see it again). Paste it here.`]}),(0,L.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,L.jsx)(`span`,{className:`font-medium`,children:`Lobby link or token`}),(0,L.jsx)(`input`,{value:e,onChange:e=>t(e.target.value),autoComplete:`off`,spellCheck:!1,placeholder:`http://127.0.0.1:7347/#token=…`,className:`h-8 rounded-lg border border-input bg-background px-3.5 text-sm outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30`})]}),n?(0,L.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:n}):null,(0,L.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,L.jsx)(J,{type:`button`,variant:`ghost`,disabled:i,onClick:()=>void o(void 0),children:`Retry`}),(0,L.jsx)(J,{type:`submit`,disabled:i||!e.trim(),children:`Sign in`})]})]})})}var EZ=.6;function DZ(e,t,n={}){return{initial:e?void 0:!1,animate:t,transition:{duration:EZ,...n}}}var OZ=(e,t)=>[0,Math.max(e,.001),Math.min(Math.max(t,e+.01),.999),1];function kZ(e,t=0,n=1){return DZ(e,{pathLength:[0,0,1,1],strokeOpacity:[0,0,1,1]},{pathLength:{duration:EZ,times:OZ(t,n),ease:`easeInOut`},strokeOpacity:{duration:EZ,times:OZ(t,t+.02)}})}function AZ(e,t){return DZ(e,{scale:[0,0,1.3,1]},{times:OZ(t,t+.18),ease:`easeOut`})}function jZ(e,t,n=1.3){return DZ(e,{scale:[1,1,n,1,1]},{times:[0,Math.max(t,.001),Math.min(t+.15,.9),Math.min(t+.35,.99),1],ease:`easeInOut`})}var MZ=(e=.5,t=.5)=>({transformBox:`fill-box`,originX:e,originY:t});function NZ({play:e}){return(0,L.jsxs)(B.g,{style:MZ(.1,.9),...DZ(e,{rotate:[0,-12,8,-4,0],scale:[1,1.12,.96,1.02,1]},{ease:`easeInOut`}),children:[(0,L.jsx)(`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}),[8,12,16].map((t,n)=>(0,L.jsx)(B.circle,{cx:t,cy:11,r:1.15,fill:`currentColor`,stroke:`none`,...DZ(e,{fillOpacity:[0,0,1,1,0],y:[0,0,-1.5,0,0]},{times:[0,.12+n*.12,.24+n*.12,.72,1]})},t))]})}function PZ({play:e}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B.path,{d:`M13 5h8`,...kZ(e,.15,.45)}),(0,L.jsx)(B.path,{d:`M13 12h8`,...kZ(e,.3,.6)}),(0,L.jsx)(B.path,{d:`M13 19h8`,...kZ(e,.45,.75)}),(0,L.jsx)(B.path,{d:`m3 17 2 2 4-4`,...kZ(e,.35,.7)}),(0,L.jsx)(B.path,{d:`m3 7 2 2 4-4`,...kZ(e,0,.35)})]})}function FZ({play:e}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B.circle,{cx:6,cy:19,r:3,style:MZ(),...jZ(e,0)}),(0,L.jsx)(B.path,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,...kZ(e,.1,.7)}),(0,L.jsx)(B.circle,{cx:18,cy:5,r:3,style:MZ(),...AZ(e,.62)})]})}function IZ({play:e}){return(0,L.jsx)(B.g,{style:MZ(),...DZ(e,{rotate:[0,-14,10,-6,0],scale:[1,1.18,.94,1.04,1]},{duration:.5,ease:`easeInOut`}),children:(0,L.jsx)(B.path,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,fill:`currentColor`,...DZ(e,{fillOpacity:[0,.85,0]},{duration:.5,times:[0,.2,1]})})})}function LZ({play:e}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B.circle,{cx:12,cy:12,r:10,style:MZ(),...DZ(e,{scale:[1,1,1.4],strokeOpacity:[0,.5,0]},{times:[0,.25,1],ease:`easeOut`})}),(0,L.jsx)(B.circle,{cx:12,cy:12,r:10,style:MZ(),...DZ(e,{scale:[1,.86,1.06,1]},{times:[0,.25,.55,1],ease:`easeInOut`})}),(0,L.jsx)(B.circle,{cx:12,cy:12,r:1,fill:`currentColor`,style:MZ(),...DZ(e,{scale:[1,2.4,.8,1]},{times:[0,.3,.6,1],ease:`easeInOut`})})]})}function RZ({play:e}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`}),[`M8 17v-3`,`M13 17V5`,`M18 17V9`].map((t,n)=>(0,L.jsx)(B.path,{d:t,style:MZ(.5,1),...DZ(e,{scaleY:[0,0,1.18,1]},{times:OZ(.08+n*.14,.4+n*.14),ease:`easeOut`})},t))]})}function zZ({play:e}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(B.circle,{cx:6,cy:6,r:3,style:MZ(),...jZ(e,0)}),(0,L.jsx)(B.line,{x1:6,x2:6,y1:9,y2:21,...kZ(e,.05,.45)}),(0,L.jsx)(B.path,{d:`M13 6h3a2 2 0 0 1 2 2v7`,...kZ(e,.2,.62)}),(0,L.jsx)(B.circle,{cx:18,cy:18,r:3,style:MZ(),...AZ(e,.58)})]})}function BZ({play:e}){return(0,L.jsxs)(B.g,{style:MZ(),...DZ(e,{scaleX:[1,.55,1.08,1],y:[0,-1,0,0]},{times:[0,.35,.65,1],ease:`easeInOut`}),children:[(0,L.jsx)(B.path,{d:`M12 5v16`,style:MZ(),...DZ(e,{scaleY:[1,1.12,1,1]},{times:[0,.35,.65,1]})}),(0,L.jsx)(`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`})]})}function VZ({play:e}){return(0,L.jsxs)(B.g,{style:MZ(.6,.6),...DZ(e,{x:[0,1.5,-1.5,1,0],y:[0,-1,.5,-.5,0],rotate:[0,-8,6,-3,0]},{ease:`easeInOut`}),children:[(0,L.jsx)(`path`,{d:`M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z`}),(0,L.jsx)(`path`,{d:`m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18`}),(0,L.jsx)(B.path,{d:`m2.3 2.3 7.286 7.286`,...kZ(e,.1,.6)}),(0,L.jsx)(B.circle,{cx:11,cy:11,r:2,style:MZ(),...jZ(e,.5,1.5)})]})}var HZ={lobby:NZ,tasks:PZ,plan:FZ,quickfix:IZ,issues:LZ,metrics:RZ,git:zZ,knowledge:BZ,excalidraw:VZ};function UZ({id:e,play:t,className:n}){let r=HZ[e];return r?(0,L.jsx)(`svg`,{"aria-hidden":`true`,"data-tab-icon":e,"data-play":t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,className:q(`overflow-visible`,n),children:(0,L.jsx)(r,{play:t})},t):null}function WZ(e){return/(\d)$/.exec(e)?.[1]}var GZ=160;function KZ(e){let t=qd(),[n,r]=(0,m.useState)(0),i=(0,m.useRef)(0),a=(0,m.useCallback)(()=>{t||performance.now()<i.current||(i.current=performance.now()+EZ*1e3,r(e=>e+1))},[t]),o=(0,m.useRef)(e);return(0,m.useEffect)(()=>{let t=e&&!o.current;if(o.current=e,!t)return;let n=window.setTimeout(a,GZ);return()=>window.clearTimeout(n)},[e,a]),{play:n,onPointerEnter:(0,m.useCallback)(e=>{e.pointerType!==`touch`&&a()},[a])}}var qZ=(0,m.forwardRef)(function({tab:e,active:t},n){let r=WZ(e.key),{play:i,onPointerEnter:a}=KZ(t);return(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsxs)(`a`,{ref:n,role:`tab`,id:`tab-${e.id}`,href:`#/${e.id}`,"aria-selected":t,"aria-keyshortcuts":e.key,tabIndex:t?0:-1,onPointerEnter:a,className:q(`relative z-10 inline-flex h-7.5 shrink-0 items-center gap-1.5 rounded-lg border border-input px-2.5 text-[0.8125rem] leading-none font-medium whitespace-nowrap outline-none`,`transition-colors duration-200 ease-snap focus-visible:ring-3 focus-visible:ring-ring/40`,t?`text-foreground`:`text-muted-foreground hover:text-foreground`),children:[(0,L.jsx)(UZ,{id:e.id,play:i,className:q(`size-3.5 shrink-0 transition-colors duration-200`,t&&`text-primary`)}),r?(0,L.jsx)(`span`,{"aria-hidden":`true`,className:q(`text-[0.72rem] font-semibold tabular-nums transition-colors duration-200`,t?`text-primary`:`text-muted-foreground/75`),children:r}):null,(0,L.jsx)(`span`,{children:e.label})]})}),(0,L.jsxs)(qD,{children:[e.label,` `,(0,L.jsx)(cD,{chord:e.key})]})]})}),JZ=1.5;function YZ(e,t,n=t?.left??0,r=t?.right??0,i=1){if(e){if(!t||r-n<.5){e.style.opacity=`0`;return}e.style.opacity=String(Math.min(1,(r-n)/14)),e.style.top=`${t.top}px`,e.style.height=`${t.height}px`,e.style.width=`${r-n}px`,e.style.transform=`translateX(${n}px)`,e.style.scale=i===1?``:`1 ${i}`}}function XZ(e,t){let n=e.right-e.left,{height:r}=e,i=JZ/2,a=Math.max(0,Math.min(e.radius-i,r/2-i,n/2-i)),o=r/2,s=e=>+(t===`left`?e:n-e).toFixed(2),c=+(t===`left`),l=1-c,u=i,d=n-i,f=r-i;return[`M${s(u)} ${o}L${s(u)} ${i+a}A${a} ${a} 0 0 ${c} ${s(u+a)} ${i}L${s(d-a)} ${i}A${a} ${a} 0 0 ${c} ${s(d)} ${i+a}L${s(d)} ${o}`,`M${s(u)} ${o}L${s(u)} ${f-a}A${a} ${a} 0 0 ${l} ${s(u+a)} ${f}L${s(d-a)} ${f}A${a} ${a} 0 0 ${l} ${s(d)} ${f-a}L${s(d)} ${o}`]}function ZZ(e,t,n,r){if(!e)return;if(!t||r<=.002){e.style.opacity=`0`;return}let i=t.right-t.left,a=`${i}x${t.height}r${t.radius}${n}`;e.dataset.shape!==a&&(e.dataset.shape=a,e.dataset.port=n,e.setAttribute(`viewBox`,`0 0 ${i} ${t.height}`),XZ(t,n).forEach((t,n)=>e.children[n]?.setAttribute(`d`,t))),e.style.opacity=String(Math.min(1,r*12)),e.style.top=`${t.top}px`,e.style.height=`${t.height}px`,e.style.width=`${i}px`,e.style.transform=`translateX(${t.left}px)`;let o=`${Math.min(1,r)} 2`;for(let t of e.children)t.style.strokeDasharray=o}var QZ={type:`spring`,visualDuration:.12,bounce:0},$Z={type:`spring`,visualDuration:.17,bounce:.15,delay:.015},eQ={type:`spring`,visualDuration:.17,bounce:.05,delay:.07},tQ={type:`spring`,visualDuration:.22,bounce:.25},nQ={type:`spring`,visualDuration:.2,bounce:0},rQ={type:`spring`,stiffness:900,damping:18,velocity:45,restDelta:.02,restSpeed:1},iQ=(()=>{let e=Zn({keyframes:[0,1],visualDuration:tQ.visualDuration,bounce:tQ.bounce}),t=0;for(;t<1e3&&e.next(t).value<.97;)t+=4;return t/1e3})(),aQ={type:`spring`,visualDuration:.28,bounce:.6};function oQ(e,t){let n=(0,m.useRef)(null),r=(0,m.useRef)(null),i=(0,m.useRef)(null),a=(0,m.useRef)(null),o=(0,m.useRef)(null),s=(0,m.useRef)({}),c=(0,m.useRef)([]),l=(0,m.useRef)(void 0),u=(0,m.useRef)([]),d=(0,m.useRef)(1),f=(0,m.useRef)(1),p=(0,m.useCallback)(e=>{let t=e?s.current[e]:void 0;if(!t)return;let n=parseFloat(getComputedStyle(t).borderTopLeftRadius)||0;return{left:t.offsetLeft,right:t.offsetLeft+t.offsetWidth,top:t.offsetTop,height:t.offsetHeight,radius:n}},[]),h=(0,m.useCallback)(()=>{for(let e of u.current)e.stop();u.current=[];for(let e of Object.values(s.current))e?.style.translate&&(e.style.translate=``)},[]),g=(0,m.useCallback)(e=>{h(),l.current=e,d.current=1,f.current=1;let t=p(e);YZ(r.current,t),YZ(i.current,void 0),ZZ(a.current,t,`left`,1),ZZ(o.current,void 0,`left`,0);for(let e of c.current)e&&(e.style.width=`0px`)},[p,h]),_=(0,m.useCallback)((e,t)=>{let n=p(e),m=p(t);if(!n||!m)return g(t);h(),l.current=t;let _=m.left>n.left?1:-1,v=_>0?n.right:n.left,y=_>0?m.left:m.right,b=Math.abs(y-v),x=_>0?`right`:`left`,S=_>0?`left`:`right`,C=c.current.map(e=>{let t=e?.parentElement;return t?{liquid:e,from:t.offsetLeft,to:t.offsetLeft+t.offsetWidth}:void 0}),w=b>4?1-4/b:0,T={drained:1-Math.min(1,d.current),unrung:1-Math.min(1,f.current),head:0,tail:0,filled:0,rung:0,squash:1,budge:0},E=s.current[t];d.current=0,f.current=0;let D=()=>{let e=(n.right-n.left)*Math.min(1,T.drained);YZ(i.current,n,_>0?n.left+e:n.left,_>0?n.right:n.right-e),ZZ(o.current,n,x,1-T.unrung);let t=v+_*b*T.head,s=v+_*b*T.tail,c=Math.min(t,s),l=Math.max(t,s);for(let e of C){if(!e?.liquid)continue;let t=Math.max(c,e.from),n=Math.min(l,e.to);e.liquid.style.width=`${Math.max(0,n-t)}px`,e.liquid.style.transform=`translateX(${Math.max(0,t-e.from)}px)`}let u=_*T.budge,d=u?{...m,left:m.left+u,right:m.right+u}:m;E&&(E.style.translate=Math.abs(u)>.01?`${u.toFixed(2)}px`:``);let f=(d.right-d.left)*Math.min(1,Math.max(0,T.filled));YZ(r.current,d,_>0?d.left:d.right-f,_>0?d.left+f:d.right,Math.min(1,T.squash)),ZZ(a.current,d,S,T.rung)},O=(e,t,n,r,i=1)=>{let a=_f(t,i,{...n,onUpdate:t=>{T[e]=t,r?.(t),D()}});return u.current.push(a),a},k=!1,ee=()=>{if(k)return;k=!0;let e=O(`filled`,0,tQ,e=>{d.current=e});O(`squash`,.8,aQ),O(`rung`,0,nQ,e=>{f.current=e}),O(`budge`,0,{...rQ,delay:iQ},void 0,0),Promise.all([e,...u.current]).then(()=>{l.current===t&&u.current.includes(e)&&g(t)})};O(`drained`,T.drained,QZ),O(`unrung`,T.unrung,QZ),O(`head`,0,$Z,e=>{e>=w&&ee()}),O(`tail`,0,eQ),D()},[p,g,h]);(0,m.useLayoutEffect)(()=>{let t=l.current,n=typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;!t||!e||t===e||n?g(e):_(t,e)},[e,t,_,g]);let v=(0,m.useRef)(e);return v.current=e,(0,m.useEffect)(()=>{let e=n.current;if(!e||typeof ResizeObserver>`u`)return;let t=!0,r=new ResizeObserver(()=>{if(t){t=!1;return}g(v.current)});return r.observe(e),()=>{r.disconnect(),h()}},[g,h]),{track:n,fill:r,drain:i,ring:a,unring:o,cells:s,liquids:c}}var sQ=(0,m.forwardRef)(function({which:e},t){return(0,L.jsxs)(`svg`,{ref:t,"aria-hidden":`true`,[`data-tab-${e}`]:``,className:`pointer-events-none absolute left-0 z-20 overflow-visible opacity-0 will-change-transform`,fill:`none`,children:[(0,L.jsx)(`path`,{pathLength:1,strokeWidth:JZ,strokeLinecap:`round`,className:`stroke-tab-rim`}),(0,L.jsx)(`path`,{pathLength:1,strokeWidth:JZ,strokeLinecap:`round`,className:`stroke-tab-rim`})]})});function cQ(e){if(e.left||e.right)return`linear-gradient(to right, ${e.left?`transparent 0, black 28px`:`black 0`}, ${e.right?`black calc(100% - 28px), transparent 100%`:`black 100%`})`}function lQ({tabs:e,activeId:t,onSelect:n}){let{track:r,fill:i,drain:a,ring:o,unring:s,cells:c,liquids:l}=oQ(t,e.length),u=(0,m.useRef)(null),[d,f]=(0,m.useState)({left:!1,right:!1}),p=(0,m.useCallback)(()=>{let e=u.current;if(!e)return;let t=e.scrollLeft>2,n=e.scrollLeft+e.clientWidth<e.scrollWidth-2;f(e=>e.left===t&&e.right===n?e:{left:t,right:n})},[]);(0,m.useEffect)(()=>{let e=u.current;if(!e||typeof ResizeObserver>`u`)return;p();let t=new ResizeObserver(p);return t.observe(e),e.firstElementChild&&t.observe(e.firstElementChild),()=>t.disconnect()},[p,e.length]),(0,m.useEffect)(()=>{let e=u.current,n=t?c.current[t]:void 0;e&&n&&(n.offsetLeft<e.scrollLeft?e.scrollLeft=n.offsetLeft-8:n.offsetLeft+n.offsetWidth>e.scrollLeft+e.clientWidth&&(e.scrollLeft=n.offsetLeft+n.offsetWidth-e.clientWidth+8))},[t,c]);function h(r){if(r.key===`ArrowDown`&&!r.altKey){iO()&&r.preventDefault();return}let i=r.key===`ArrowRight`?1:r.key===`ArrowLeft`?-1:0;if(!i||e.length===0)return;r.preventDefault();let a=r.target.closest(`[role='tab']`)?.id.replace(/^tab-/,``)??t,o=e[(Math.max(0,e.findIndex(e=>e.id===a))+i+e.length)%e.length];oO.active=!0,oO.to=o.id,window.setTimeout(()=>{oO.active=!1,oO.to=void 0},3e3),n(o.id),c.current[o.id]?.focus({preventScroll:!0})}return(0,L.jsx)(`div`,{ref:u,onScroll:p,style:{maskImage:cQ(d),WebkitMaskImage:cQ(d)},className:`min-w-0 max-w-full overflow-x-auto [scrollbar-width:none] pointer-coarse:-my-1.5 pointer-coarse:py-1.5 [&::-webkit-scrollbar]:hidden`,children:(0,L.jsxs)(`div`,{ref:r,role:`tablist`,"aria-label":`Lobby tabs`,onKeyDown:h,className:`relative mx-auto flex w-max items-center py-0.5`,children:[(0,L.jsx)(`span`,{ref:a,"aria-hidden":`true`,"data-tab-drain":!0,className:`pointer-events-none absolute left-0 z-0 rounded-lg bg-tab-fill opacity-0 will-change-transform`}),(0,L.jsx)(`span`,{ref:i,"aria-hidden":`true`,"data-tab-fill":!0,className:`pointer-events-none absolute left-0 z-0 rounded-lg bg-tab-fill opacity-0 will-change-transform`}),(0,L.jsx)(sQ,{ref:s,which:`unring`}),(0,L.jsx)(sQ,{ref:o,which:`ring`}),e.map((e,n)=>(0,L.jsxs)(m.Fragment,{children:[n>0?(0,L.jsxs)(`span`,{"aria-hidden":`true`,"data-tab-link":!0,className:`relative h-[2px] w-3.5 shrink-0 sm:w-4`,children:[(0,L.jsx)(`span`,{className:`absolute inset-0 border-t-2 border-dotted border-input`}),(0,L.jsx)(`span`,{ref:e=>{l.current[n-1]=e},"data-tab-liquid":!0,className:`absolute top-0 left-0 h-[2px] w-0 rounded-full bg-tab-liquid shadow-[0_0_6px_var(--tab-liquid)] will-change-transform`})]}):null,(0,L.jsx)(qZ,{ref:t=>{c.current[e.id]=t},tab:e,active:e.id===t})]},e.id))]})})}function uQ({oracleBusy:e,runs:t,activity:n,background:r}){let i=new Set;e&&i.add(`Oracle`);for(let e of t)e.status===`running`&&i.add(UB(qB(e)));for(let e of n)e.pending&&e.source!==`LOBBY`&&i.add(e.source===`MASTER`?`Oracle`:UB(e.source));let a=r.filter(e=>e.alive&&e.busy).length;return a&&i.add(a===1?`1 in the background`:`${a} in the background`),[...i]}function dQ(e){return e.length<=2?e.join(`, `):`${e.slice(0,2).join(`, `)} +${e.length-2}`}var fQ=6,pQ=`bot-lobby.orb`,mQ=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0&&e<=1;function hQ(e,t,n,r){let i=e=>e+fQ,a=(e,t)=>Math.max(e+fQ,e+t-r-fQ);return{x:Math.min(a(n.left,n.width),Math.max(i(n.left),e)),y:Math.min(a(n.top,n.height),Math.max(i(n.top),t))}}function gQ(e,t,n,r){let i=e=>Math.max(1,e-r),a=hQ(e,t,n,r);return{fx:Math.min(1,Math.max(0,(a.x-n.left)/i(n.width))),fy:Math.min(1,Math.max(0,(a.y-n.top)/i(n.height)))}}function _Q(e,t,n){return hQ(t.left+e.fx*Math.max(0,t.width-n),t.top+e.fy*Math.max(0,t.height-n),t,n)}function vQ(e){if(e)try{let t=JSON.parse(e);return mQ(t.fx)&&mQ(t.fy)?{fx:t.fx,fy:t.fy}:void 0}catch{return}}function yQ(){try{return vQ(localStorage.getItem(pQ))}catch{return}}function bQ(e){try{localStorage.setItem(pQ,JSON.stringify(e))}catch{}}var xQ=5,SQ=16;function CQ(){let e=document.getElementById(`main`)?.getBoundingClientRect();return e?{left:e.left,top:e.top,width:e.width,height:e.height}:void 0}function wQ(){let[e,t]=(0,m.useState)(CQ);return(0,m.useEffect)(()=>{let e=()=>t(CQ()),n=document.getElementById(`main`),r=typeof ResizeObserver>`u`||!n?void 0:new ResizeObserver(e);return n&&r?.observe(n),window.addEventListener(`resize`,e),e(),()=>{r?.disconnect(),window.removeEventListener(`resize`,e)}},[]),e}var TQ=(0,m.forwardRef)(function({spotlight:e,thinking:t,busy:n=[],tone:r,expanded:i,hidden:a,shortcut:o,onOpen:s},c){let l=wQ(),[u,d]=(0,m.useState)(yQ),[f,p]=(0,m.useState)(),[h,g]=(0,m.useState)(!1),_=(0,m.useRef)(void 0),v=(0,m.useRef)(!1),y=(0,m.useRef)(44),b=f??(u&&l?_Q(u,l,y.current):void 0),x=(0,m.useCallback)((e,t)=>{let n=CQ();if(!n)return;let r=gQ(e,t,n,y.current);d(r),bQ(r)},[]);function S(e){if(e.button!==0)return;let t=e.currentTarget.getBoundingClientRect();y.current=t.width,_.current={id:e.pointerId,sx:e.clientX,sy:e.clientY,ox:t.left,oy:t.top,moved:!1},e.currentTarget.setPointerCapture?.(e.pointerId)}function C(e){let t=_.current;if(!t||t.id!==e.pointerId)return;let n=e.clientX-t.sx,r=e.clientY-t.sy;if(!t.moved&&Math.hypot(n,r)<xQ)return;t.moved=!0;let i=CQ();i&&p(hQ(t.ox+n,t.oy+r,i,y.current))}function w(e){let t=_.current;_.current=void 0,t?.moved&&(v.current=!0,x(t.ox+e.clientX-t.sx,t.oy+e.clientY-t.sy),p(void 0))}function T(e){let t=e.shiftKey?64:SQ,n={ArrowLeft:[-t,0],ArrowRight:[t,0],ArrowUp:[0,-t],ArrowDown:[0,t]}[e.key];if(!n||e.altKey||e.ctrlKey||e.metaKey)return;e.preventDefault();let r=e.currentTarget.getBoundingClientRect();y.current=r.width,x(r.left+n[0],r.top+n[1])}let E=!e&&n.length>0,D=e?UB(e):E?dQ(n):void 0,O=e?`${t.map(UB).join(`, `)} thinking. `:E?`${n.join(`, `)} at work. `:``,k=b&&l?b.x-l.left<140:!1,ee={"--orb":r,...b?{left:b.x,top:b.y,right:`auto`,bottom:`auto`}:{}};return(0,L.jsxs)(GD,{open:h&&!f,onOpenChange:g,children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsxs)(`button`,{ref:c,type:`button`,"aria-label":`Open Thinking`,"aria-description":`${O}Drag, or use the arrow keys, to move it.`,"aria-haspopup":`dialog`,"aria-expanded":i,"aria-keyshortcuts":o?`${o} Enter Space`:`Enter Space`,onClick:e=>{if(v.current){v.current=!1,e.preventDefault();return}s()},onPointerDown:S,onPointerMove:C,onPointerUp:w,onPointerCancel:()=>{_.current=void 0,p(void 0)},onKeyDown:T,style:ee,"data-thinking":e?``:void 0,"data-busy":E?``:void 0,"data-dragging":f?``:void 0,"data-placed":b?``:void 0,"data-flip":k||void 0,className:q(`thinking-bubble fixed z-20 touch-none rounded-full outline-none select-none focus-visible:ring-3 focus-visible:ring-ring/40`,a&&`invisible`),children:[(0,L.jsx)(tu,{initial:!1,children:D?(0,L.jsx)(B.span,{className:`orb-label`,initial:{opacity:0,x:k?-8:8,scale:.9},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:k?-8:8,scale:.9},transition:{type:`spring`,visualDuration:.3,bounce:.35},children:(0,L.jsx)(tu,{mode:`popLayout`,initial:!1,children:(0,L.jsx)(B.span,{className:`inline-flex items-center gap-1`,initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{type:`spring`,visualDuration:.28,bounce:.3},children:D},D)})},`label`):null}),(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`orb orb-float`,children:(0,L.jsx)(`span`,{className:`orb-icon`,children:(0,L.jsx)(VB,{source:e,strokeWidth:2.25,className:`size-3.5`})})})]})}),(0,L.jsxs)(qD,{side:`top`,children:[`Thinking `,o?(0,L.jsx)(cD,{chord:o}):null,(0,L.jsx)(`span`,{className:`text-background/70`,children:` · drag to move`})]})]})}),EQ=/^\s*(?:#{1,6}\s+(.+?)\s*#*|\*\*([^*\n]{2,90}?):?\*\*:?|__([^_\n]{2,90}?):?__:?)\s*$/,DQ=260,OQ=200,kQ=/^\s*(?:[-*+]\s|\d+[.)]\s|>|```|~~~|\|)/m;function AQ(e){let t=[],n=[],r=!1;for(let i of e){if(/^\s*(```|~~~)/.test(i)&&(r=!r),!r&&!i.trim()){n.length&&t.push(n.join(`
|
|
102
|
+
`,t),i=e.slice(n,r<0?e.length:r),a=hZ.exec(i);if(!a||t-n<a[0].length)return;let[o,s=``,c,l,u=`.`,d]=a;if(i.slice(o.length).trim()===``)return{value:e.slice(0,n)+e.slice(r<0?e.length:r),start:n,end:n};let f=`\n${s}${c??`${Number(l)+1}${u}`} ${d?`[ ] `:``}`;return{value:e.slice(0,t)+f+e.slice(t),start:t+f.length,end:t+f.length}}var _Z={id:`oracle`,pill:`Oracle`,label:`Message the oracle`,placeholder:`Message the oracle…`};function vZ(e){if(e)try{return decodeURIComponent(e)}catch{return e}}function yZ(e,t,n){if(e.kind===`sessions`){let e={id:`newsession`,pill:`New session`,label:`Start a task in a new session`,placeholder:`Describe a task for a new session…`};return n?[{id:`session`,pill:`Message`,label:`Message ${n.name}`,placeholder:`Message ${n.name}…`,session:n},e,_Z]:[e,_Z]}if(e.kind!==`tab`)return[_Z];if(e.tab===`plan`)return[{id:`panel`,pill:`Panel`,label:`Message the panel`,placeholder:`Describe a task, or answer the panel…`},_Z];if(e.tab===`quickfix`)return[{id:`quickfix`,pill:`Quick fix`,label:`Describe a quick fix`,placeholder:`Describe a small change…`},_Z];let r=e.tab===`tasks`?vZ(e.rest[0])??t:void 0;return r?[{id:`comment`,pill:`Comment`,label:`Comment on ${r}`,placeholder:`Comment on ${r}'s plan…`,taskId:r},{id:`task`,pill:`Task's oracle`,label:`Message ${r}'s oracle`,placeholder:`Leave a message for ${r}'s oracle…`,taskId:r},_Z]:[_Z]}var bZ=0,xZ=`btn-ghost relative inline-flex size-8 items-center justify-center rounded-lg border border-transparent before:absolute before:-inset-1 before:content-[''] text-muted-foreground transition-[box-shadow,color,translate] duration-150 ease-snap outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none aria-pressed:text-foreground`;function SZ(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function CZ({file:e,onRemove:t}){let n=(0,L.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,onClick:t,className:q(`flex shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors outline-none hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40`,e.image?`absolute top-1 right-1 size-5 bg-background/80 text-foreground backdrop-blur-sm`:`size-7`),children:(0,L.jsx)(bg,{"aria-hidden":`true`,className:`size-3.5`})});return e.image?(0,L.jsxs)(z.li,{layout:!0,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{type:`spring`,stiffness:520,damping:32},title:`${e.name} · ${dZ(e.size)}`,className:`relative size-16 shrink-0 overflow-hidden rounded-lg border border-border bg-muted`,children:[(0,L.jsx)(`img`,{src:Uf(e.image),alt:e.name,className:`size-full object-cover`}),e.state===`uploading`?(0,L.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center bg-background/60`,children:(0,L.jsx)(FD,{className:`size-4`,"aria-hidden":`true`,role:`presentation`})}):null,n]}):(0,L.jsxs)(z.li,{layout:!0,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{type:`spring`,stiffness:520,damping:32},className:`flex h-9 min-w-0 items-center gap-2 rounded-lg border border-border bg-muted pr-1 pl-2.5`,children:[(0,L.jsxs)(`span`,{className:`relative flex shrink-0 items-center justify-center text-muted-foreground`,children:[(0,L.jsx)(bm,{"aria-hidden":`true`,className:`size-4`}),e.state===`uploading`?(0,L.jsx)(FD,{className:`absolute -right-1 -bottom-1 size-2.5`,"aria-hidden":`true`,role:`presentation`}):null]}),(0,L.jsxs)(`span`,{className:`min-w-0 max-w-40`,children:[(0,L.jsx)(`span`,{className:`block truncate text-xs font-medium`,children:e.name}),(0,L.jsx)(`span`,{className:`block text-[0.65rem] leading-tight text-muted-foreground`,children:e.state===`uploading`?`uploading…`:dZ(e.size)})]}),n]})}function wZ({route:e,keys:t,onHelp:n}){let[r,i]=(0,m.useState)(``),[a,o]=(0,m.useState)([]),[s,c]=(0,m.useState)(!1),[l,u]=(0,m.useState)(!1),[d,f]=(0,m.useState)(!1),[p,h]=(0,m.useState)(),g=VD(`status`),_=VD(`lobby`),v=bD(),y=(g.data?.busy??!1)||!!_.data?.reply?.trim(),{taskId:b,session:x}=HJ(),S=(0,m.useMemo)(()=>yZ(e,b,x),[e,b,x]),C=S.map(e=>`${e.id}:${e.taskId??e.session?.name??``}`).join(`|`),w=S.find(e=>e.id===p)??S[0];(0,m.useEffect)(()=>h(void 0),[C]);let T=(0,m.useRef)(null),E=(0,m.useRef)(null),D=(0,m.useRef)(null),O=(0,m.useRef)(a);O.current=a;let k=(0,m.useRef)(void 0);(0,m.useLayoutEffect)(()=>{let e=k.current,t=E.current;e&&t&&(k.current=void 0,t.setSelectionRange(e.start,e.end))},[r]);let ee=(0,m.useCallback)(e=>{k.current={start:e.start,end:e.end},i(e.value)},[]);(0,m.useEffect)(()=>{let e=T.current;if(!e)return;let t=document.documentElement,n=()=>t.style.setProperty(`--composer-h`,v?`0px`:`${Math.ceil(e.getBoundingClientRect().height)}px`);n();let r=new ResizeObserver(n);return r.observe(e),()=>{r.disconnect(),t.style.setProperty(`--composer-h`,`0px`)}},[v]);let te=(0,m.useCallback)(e=>{let t=[...e],n=8-O.current.length;t.length>n&&B.warning(`At most 8 files go with one message.`);for(let e of t.slice(0,Math.max(0,n))){let t=`f${++bZ}`,n=e.type.startsWith(`image/`)?URL.createObjectURL(e):void 0;o(r=>[...r,{key:t,name:e.name||(n?`image.png`:`file`),size:e.size,...n?{image:n}:{},state:`uploading`}]),fZ(e).then(e=>o(n=>n.map(n=>n.key===t?{...n,state:`ready`,info:e}:n))).catch(e=>{B.error(e instanceof Error?e.message:`That file did not upload.`),o(e=>e.filter(e=>e.key!==t))})}},[]),ne=(0,m.useCallback)(e=>{o(t=>{let n=t.find(t=>t.key===e);return n?.image&&URL.revokeObjectURL(n.image),t.filter(t=>t.key!==e)})},[]),A=a.some(e=>e.state===`uploading`),re=a.flatMap(e=>e.info?[e.info.id]:[]),ie=(r.trim().length>0||re.length>0)&&!A&&!l,j=(0,m.useCallback)(async()=>{if(!ie)return;u(!0);let e=re.length>0?re:void 0,t={text:r,...e?{attachments:e}:{}};try{let n=!0;if(w.id===`oracle`){let e=await qf(`lobby.send`,t);e.notice&&B(e.notice)}else if(w.id===`panel`)n=await V(`planner.send`,t)!==void 0;else if(w.id===`quickfix`)n=await V(`quickfix.submit`,t)!==void 0;else if(w.id===`task`)n=await V(`tasks.message`,{taskId:w.taskId,...t})!==void 0;else if(w.id===`session`)n=await V(`sessions.message`,{...w.session.address,...t})!==void 0;else if(w.id===`newsession`){let t=await V(`sessions.start`,{request:r,...e?{attachments:e}:{}});n=t!==void 0,t?.key&&DD(`#/sessions/${encodeURIComponent(t.key)}`)}else n=await V(`tasks.comment`,{taskId:w.taskId,...t})!==void 0;if(n){i(``);for(let e of O.current)e.image&&URL.revokeObjectURL(e.image);o([])}}catch(e){B.error(e instanceof Error?e.message:`Could not send`)}finally{u(!1)}},[ie,re,w,r]),ae=(0,m.useCallback)(async()=>{try{await qf(`lobby.abort`,{})}catch(e){B.error(e instanceof Error?e.message:`Could not stop`)}},[]);return(0,L.jsx)(`div`,{ref:T,className:q(`dock pointer-events-none absolute inset-x-0 bottom-0 z-30 px-6 pb-[max(1.25rem,env(safe-area-inset-bottom))] transition-opacity duration-200 ease-snap max-sm:px-2 max-sm:pb-[max(0.5rem,env(safe-area-inset-bottom))]`,v&&`opacity-0`),inert:v,children:(0,L.jsx)(`div`,{className:`pointer-events-auto mx-auto w-full max-w-3xl`,children:(0,L.jsxs)(`div`,{className:q(`group/composer relative rounded-2xl border border-dock-border bg-dock shadow-dock backdrop-blur-xl backdrop-saturate-150 transition-[border-color,box-shadow] duration-300 ease-snap focus-within:border-ring/45 focus-within:shadow-dock-focus`,d&&`border-primary shadow-[0_0_0_3px_color-mix(in_oklab,var(--ring)_30%,transparent)]`),onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),f(!0))},onDragLeave:()=>f(!1),onDrop:e=>{e.preventDefault(),f(!1),e.dataTransfer.files.length>0&&te(e.dataTransfer.files)},children:[(0,L.jsx)(tu,{initial:!1,children:a.length>0?(0,L.jsx)(z.ul,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{type:`spring`,stiffness:420,damping:36},"aria-label":`Attachments`,className:`flex flex-wrap items-end gap-2 overflow-hidden px-3 pt-3`,children:a.map(e=>(0,L.jsx)(CZ,{file:e,onRemove:()=>ne(e.key)},e.key))},`files`):null}),s?(0,L.jsx)(`div`,{"aria-label":`Markdown preview`,role:`region`,className:`max-h-48 overflow-y-auto border-b border-border px-4 py-3`,children:r.trim()?(0,L.jsx)(dz,{text:r}):(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing to preview yet.`})}):null,(0,L.jsx)(`div`,{className:`flex px-4 pt-3 pb-1`,children:(0,L.jsx)(`textarea`,{ref:E,id:`composer-text`,"aria-label":w.label,value:r,onChange:e=>i(e.target.value),onKeyDown:e=>{if(e.key===`Escape`&&!e.nativeEvent.isComposing){e.preventDefault(),aO();return}let t=e.currentTarget,n=e.key.toLowerCase();if((e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey&&[`b`,`i`,`e`,`k`].includes(n)){e.preventDefault();let{selectionStart:r,selectionEnd:i,value:a}=t;ee(n===`k`?mZ(a,r,i):pZ(a,r,i,n===`b`?`**`:n===`i`?`_`:"`"));return}if(e.altKey&&!e.ctrlKey&&!e.metaKey&&n===`p`){e.preventDefault(),c(e=>!e);return}if(e.key===`Enter`&&e.shiftKey&&!e.nativeEvent.isComposing&&t.selectionStart===t.selectionEnd){let n=gZ(t.value,t.selectionStart);n&&(e.preventDefault(),ee(n));return}if(e.key===`Backspace`&&t.value===``&&O.current.length>0){e.preventDefault(),ne(O.current.at(-1).key);return}(SZ(e)||e.key===`Enter`&&(e.metaKey||e.ctrlKey))&&(e.preventDefault(),j())},onPaste:e=>{let t=[...e.clipboardData.files];t.length!==0&&(e.preventDefault(),te(t))},placeholder:y&&w.id===`oracle`?`The oracle is working. Enter steers it…`:w.placeholder,rows:1,className:`field-sizing-content max-h-[min(45vh,20rem)] min-h-[1.75rem] w-full min-w-0 flex-1 resize-none bg-transparent text-base leading-relaxed caret-primary outline-none placeholder:text-muted-foreground md:text-[0.9375rem] md:leading-relaxed`})}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1 gap-y-1 px-2 pt-1 pb-2`,children:[(0,L.jsx)(`input`,{ref:D,type:`file`,multiple:!0,hidden:!0,tabIndex:-1,"aria-label":`Attach files`,onChange:e=>{te(e.target.files??[]),e.target.value=``}}),(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"aria-label":`Attach images, PDFs or files`,"data-compact":!0,onClick:()=>D.current?.click(),className:xZ,children:(0,L.jsx)(fh,{"aria-hidden":`true`,className:`size-4`})})}),(0,L.jsx)(qD,{children:`Attach images, PDFs or files`})]}),(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-label":`Preview the Markdown`,"aria-pressed":s,"aria-keyshortcuts":`Alt+P`,"aria-describedby":`focused-action-help`,"data-compact":!0,onClick:()=>c(e=>!e),className:xZ,children:(0,L.jsx)(mm,{"aria-hidden":`true`,className:`size-4`})})}),(0,L.jsxs)(qD,{children:[`Preview `,(0,L.jsx)(cD,{chord:`Alt+P`})]})]}),(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1.5 h-4 w-px bg-border`}),S.length>1?(0,L.jsx)(`div`,{role:`radiogroup`,"aria-label":`Send to`,className:`flex items-center gap-0.5 rounded-lg bg-muted p-0.5 shadow-[inset_0_1px_2px_rgb(0_0_0/0.07)]`,children:S.map(e=>(0,L.jsx)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,role:`radio`,"data-compact":!0,"aria-checked":e.id===w.id,onClick:()=>h(e.id),className:q(`h-6 rounded-md border border-transparent px-2.5 text-xs font-medium transition-[background-color,color,box-shadow] duration-150 outline-none focus-visible:ring-3 focus-visible:ring-ring/40`,e.id===w.id?`btn-raised bg-card text-foreground`:`text-muted-foreground hover:text-foreground`),children:e.pill},e.id))}):(0,L.jsxs)(`span`,{className:`px-1 text-xs text-muted-foreground`,children:[`To the `,w.pill.toLowerCase()]}),(0,L.jsx)(`div`,{className:`@container ml-auto flex min-w-0 flex-1 items-center justify-end overflow-hidden px-2`,children:(0,L.jsxs)(`div`,{className:`flex items-center justify-end gap-3.5`,children:[e.kind===`tab`&&e.tab===`plan`?(0,L.jsx)(lD,{chord:t.savePlan??`Ctrl+S`,className:`hidden @[34rem]:inline-flex`,children:`save plan`}):null,(0,L.jsx)(lD,{chord:`/`,className:`hidden group-focus-within/composer:!hidden @[28rem]:inline-flex`,children:`write`}),(0,L.jsx)(lD,{chord:`Esc`,className:`hidden group-[:not(:focus-within)]/composer:!hidden @[28rem]:inline-flex`,children:`tabs`}),(0,L.jsx)(lD,{chord:`Shift+Enter`,className:`hidden @[22rem]:inline-flex`,children:`new line`}),(0,L.jsx)(lD,{chord:`Enter`,className:`hidden @[11rem]:inline-flex`,children:`send`}),(0,L.jsxs)(`button`,{type:`button`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"aria-label":`Keyboard shortcuts`,"aria-haspopup":`dialog`,"data-compact":!0,onClick:n,className:`kbd-hint inline-flex h-7 shrink-0 items-center gap-1.5 rounded-lg px-1.5 text-xs text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40`,children:[(0,L.jsx)(cD,{chord:t.help??`Alt+H`,className:`kbd-hint`}),(0,L.jsx)(`span`,{className:`hidden @[8rem]:inline`,children:`shortcuts`})]})]})}),y&&w.id===`oracle`?(0,L.jsx)(WO,{label:`Stop`,icon:Jh,iconOnly:!0,compact:!0,title:`Stop the oracle?`,description:`The current response stops. Work already recorded is kept.`,confirmLabel:`Stop`,variant:`destructive`,onConfirm:()=>void ae()}):null,(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-label":`Send`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"data-compact":!0,onClick:()=>void j(),disabled:!ie,className:`btn-tint relative inline-flex size-8 items-center justify-center rounded-lg border [--tint:var(--primary)] before:absolute before:-inset-1 before:content-[''] text-primary-foreground transition-[background-color,color,box-shadow,translate,filter] duration-150 ease-snap outline-none focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none disabled:text-muted-foreground`,children:l?(0,L.jsx)(FD,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5 text-primary-foreground`}):(0,L.jsx)(bp,{"aria-hidden":`true`,className:`size-4`,strokeWidth:2.25})})}),(0,L.jsxs)(qD,{children:[`Send `,(0,L.jsx)(cD,{chord:`Enter`})]})]})]}),d?(0,L.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 flex items-center justify-center rounded-xl bg-card/90 text-sm font-medium text-primary backdrop-blur-[2px]`,children:`Drop to attach`}):null]})})})}function TZ(){try{return{id:Hf()}}catch(e){return{error:e.message}}}function EZ(e,t){if(e){if(t&&!e.projects.some(e=>e.id===t))return`Selected project is unknown or offline. Refresh or choose a running project.`;if(!e.projects.length)return`No authorized running projects found. Start a project in Pi, then refresh.`}}function DZ(){let[e,t]=(0,m.useState)(),[n,r]=(0,m.useState)(),[i,a]=(0,m.useState)(!1),o=(0,m.useRef)(0);async function s(){let e=++o.current;a(!0),r(void 0);try{let n=await qf(`projects.list`,{});e===o.current&&t(n)}catch(t){e===o.current&&r(t.message)}finally{e===o.current&&a(!1)}}(0,m.useEffect)(()=>(s(),()=>{o.current++}),[]);let[c,l]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{if(!i)return l(!1);let e=setTimeout(()=>l(!0),300);return()=>clearTimeout(e)},[i]),{data:e,error:n,busy:i,slow:c,refresh:s}}function OZ({data:e,error:t}){let n=TZ();return n.error??t??EZ(e,n.id)}function kZ({projects:e}){let t=OZ(e);return t?(0,L.jsxs)(`p`,{role:`alert`,className:`notice flex min-w-0 items-start gap-2 pt-1 pb-0.5 text-xs break-words text-destructive`,children:[(0,L.jsx)(og,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,L.jsx)(`span`,{children:t})]}):null}function AZ(e){let t=e.key===`ArrowDown`?1:e.key===`ArrowUp`?-1:0,n=e.key===`Home`?`first`:e.key===`End`?`last`:void 0;if(!t&&!n)return;let r=[...e.currentTarget.querySelectorAll(`[role='option']`)];if(r.length===0)return;e.preventDefault();let i=r.indexOf(document.activeElement);r[n===`first`?0:n===`last`?r.length-1:Math.max(0,Math.min(r.length-1,(i<0?t>0?-1:r.length:i)+t))]?.focus()}function jZ({projects:e,tab:t,name:n,branch:r}){let{data:i,busy:a,slow:o,refresh:s}=e,[c,l]=(0,m.useState)(!1),u=TZ(),d=OZ(e),f=u.error?`invalid`:u.id??i?.currentId??``,p=!!i?.projects.length;dO(`p`,()=>l(!0),{enabled:p}),dO(`r`,()=>void s(),{enabled:c,inDialog:!0});function h(e){l(!1),e!==f&&Wf(e,t)}return(0,L.jsxs)(`div`,{"aria-busy":a,className:`flex min-w-0 items-center gap-1.5`,children:[(0,L.jsxs)(JT,{open:c&&p,onOpenChange:l,children:[(0,L.jsxs)(YT,{type:`button`,role:`combobox`,"aria-label":`Project`,"aria-description":`${n}${r?`, branch ${r}`:``}`,"aria-haspopup":`listbox`,"aria-expanded":c&&p,"aria-keyshortcuts":`P ArrowDown`,disabled:!p,onKeyDown:e=>{e.key!==`ArrowDown`||e.altKey||e.metaKey||e.ctrlKey||(e.preventDefault(),l(!0))},className:`btn-ghost group flex h-8 min-w-0 items-center gap-2 rounded-lg border border-transparent px-2.5 text-sm font-medium outline-none transition-[box-shadow,background-color] duration-150 focus-visible:ring-3 focus-visible:ring-ring/40 disabled:pointer-events-none`,children:[(0,L.jsx)(`span`,{"aria-hidden":`true`,className:q(`size-2.5 shrink-0 rounded-full`,d?`bg-destructive`:`bg-primary`)}),(0,L.jsx)(`span`,{className:`truncate`,children:n}),(0,L.jsx)(Ip,{"aria-hidden":`true`,className:q(`size-3.5 shrink-0 text-muted-foreground`,!p&&`opacity-40`)})]}),(0,L.jsx)(XT,{children:(0,L.jsxs)(ZT,{align:`start`,sideOffset:6,"aria-label":`Projects`,onKeyDown:AZ,onOpenAutoFocus:e=>{let t=e.currentTarget?.querySelector(`[role='option'][aria-selected='true']`)??e.currentTarget?.querySelector(`[role='option']`);t&&(e.preventDefault(),t.focus())},className:`glass-pop z-50 flex w-[min(26rem,calc(100vw-1.5rem))] origin-(--radix-popover-content-transform-origin) flex-col overflow-hidden rounded-xl outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-2`,children:[(0,L.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Running projects`}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>void s(),disabled:a,"aria-label":`Refresh list`,"aria-keyshortcuts":`R`,className:`inline-flex h-7 items-center gap-1.5 rounded-lg px-2 text-xs text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 disabled:opacity-60`,children:[a?(0,L.jsx)(FD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}):(0,L.jsx)(Oh,{"aria-hidden":`true`,className:`size-3`}),`Refresh`,(0,L.jsx)(cD,{chord:`R`,className:`kbd-hint`})]})]}),(0,L.jsx)(`div`,{role:`listbox`,"aria-label":`Projects`,className:`flex max-h-72 flex-col overflow-y-auto p-1`,children:i?.projects.map(e=>{let t=e.id===f;return(0,L.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t,onClick:()=>h(e.id),className:q(`flex min-h-10 w-full items-start gap-2.5 rounded-lg px-2.5 py-2 text-left outline-none transition-colors hover:bg-muted focus-visible:bg-muted focus-visible:ring-3 focus-visible:ring-ring/30`,t&&`bg-accent`),children:[(0,L.jsx)(`span`,{className:`flex h-5 w-4 shrink-0 items-center justify-center`,children:t?(0,L.jsx)(Op,{"aria-hidden":`true`,className:`size-3.5 text-primary`}):null}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,L.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,L.jsxs)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:[e.cwd,` · :`,e.port]})]})]},e.id)})})]})})]}),r?(0,L.jsxs)(`span`,{className:`hidden min-w-0 items-center gap-1 rounded-md bg-muted px-2 py-1 text-xs text-muted-foreground sm:inline-flex`,children:[(0,L.jsx)(Sm,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,L.jsx)(`span`,{className:`truncate`,children:r})]}):null,o||d?(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-label":`Refresh projects`,disabled:a,onClick:()=>void s(),className:`btn-ghost inline-flex size-8 shrink-0 items-center justify-center rounded-lg border border-transparent text-muted-foreground outline-none transition-[box-shadow,color,translate] hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px disabled:opacity-60`,children:a?(0,L.jsx)(FD,{"aria-hidden":`true`,role:`presentation`,className:`size-4`}):(0,L.jsx)(Oh,{"aria-hidden":`true`,className:`size-4`})})}),(0,L.jsx)(qD,{side:`bottom`,children:`Refresh projects`})]}):null]})}function MZ({state:e}){return e===`live`?(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`span`,{role:`img`,"aria-label":`Connected`,className:`grid size-6 place-items-center`,children:(0,L.jsx)(`span`,{className:`size-2 rounded-full bg-success`})})}),(0,L.jsx)(qD,{children:`Connected`})]}):e===`connecting`?(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,L.jsx)(FD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}),`reconnecting…`]}):(0,L.jsx)(`span`,{className:`text-xs font-medium text-destructive`,children:`Connection lost`})}var NZ=`btn-ghost inline-flex size-8 shrink-0 items-center justify-center rounded-lg border border-transparent text-muted-foreground transition-[background-color,color,box-shadow,translate] duration-150 ease-snap outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none aria-[current=page]:text-foreground`;function PZ({label:e,hint:t,href:n,active:r,children:i}){return(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`a`,{href:n,"aria-label":e,"aria-current":r?`page`:void 0,"aria-keyshortcuts":t,"aria-describedby":`focused-action-help`,className:NZ,children:i})}),(0,L.jsxs)(qD,{side:`bottom`,children:[e,` `,(0,L.jsx)(cD,{chord:t})]})]})}function FZ({hint:e,onHelp:t}){return(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-label":`Keyboard shortcuts`,"aria-haspopup":`dialog`,"aria-keyshortcuts":e,"aria-describedby":`focused-action-help`,onClick:t,className:NZ,children:(0,L.jsx)(Am,{"aria-hidden":`true`,className:`size-[1.05rem]`})})}),(0,L.jsxs)(qD,{side:`bottom`,children:[`Keyboard shortcuts `,(0,L.jsx)(cD,{chord:e})]})]})}function IZ(){let e=LW(),t=e?`Unmute prompt sounds`:`Mute prompt sounds`;return(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-label":t,"aria-pressed":e,"aria-describedby":`focused-action-help`,className:NZ,onClick:()=>FW(!e),children:e?(0,L.jsx)(gg,{"aria-hidden":`true`,className:`size-[1.05rem]`}):(0,L.jsx)(mg,{"aria-hidden":`true`,className:`size-[1.05rem]`})})}),(0,L.jsx)(qD,{side:`bottom`,children:t})]})}function LZ(){let{theme:e,setTheme:t}=UG(),n=e===`dark`||e===`system`&&typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches;return(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsx)(`button`,{type:`button`,"aria-label":n?`Switch to light mode`:`Switch to dark mode`,"aria-keyshortcuts":`D`,"aria-describedby":`focused-action-help`,onClick:()=>t(n?`light`:`dark`),className:NZ,children:n?(0,L.jsx)(Xh,{"aria-hidden":`true`,className:`size-[1.05rem]`}):(0,L.jsx)(oh,{"aria-hidden":`true`,className:`size-[1.05rem]`})})}),(0,L.jsxs)(qD,{side:`bottom`,children:[n?`Light mode`:`Dark mode`,` `,(0,L.jsx)(cD,{chord:`D`})]})]})}function RZ({busy:e,task:t,sessionName:n}){return(0,L.jsxs)(`div`,{className:`mr-1 flex min-w-0 items-center gap-2 text-[0.8125rem]`,children:[e?(0,L.jsx)(FD,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5`}):null,t?(0,L.jsxs)(`span`,{className:`hidden max-w-[16rem] truncate md:inline`,children:[(0,L.jsx)(`span`,{className:`font-medium`,children:t.id}),(0,L.jsxs)(`span`,{className:`hidden text-muted-foreground min-[1500px]:inline`,children:[` · `,t.state.replace(/_/g,` `)]})]}):(0,L.jsx)(`span`,{className:`hidden max-w-[10rem] truncate text-muted-foreground min-[1500px]:inline`,children:n??`no task in this session`})]})}function zZ(e){if(!e)return 0;let t=[...e.children].filter(e=>e instanceof HTMLElement&&e.offsetParent!==null&&getComputedStyle(e).position!==`absolute`);if(!t.length)return 0;let n=Math.min(...t.map(e=>e.getBoundingClientRect().left)),r=Math.max(...t.map(e=>e.getBoundingClientRect().right)),i=0;for(let t of e.querySelectorAll(`*`))t.clientWidth<=1||t.offsetParent===null||t.scrollWidth<=t.clientWidth+1||getComputedStyle(t).textOverflow===`ellipsis`&&(i+=t.scrollWidth-t.clientWidth);return r-n+i}var BZ=24;function VZ(){let e=(0,m.useRef)(null),[t,n]=(0,m.useState)(!1),r=(0,m.useRef)(()=>{});return r.current=()=>{let t=e.current;if(!t)return;let r=t.querySelector(`[role="tablist"]`),i=getComputedStyle(t),a=parseFloat(i.columnGap)||0,o=t.clientWidth-(parseFloat(i.paddingLeft)||0)-(parseFloat(i.paddingRight)||0),s=zZ(t.querySelector(`.where`))+(r?.offsetWidth??0)+zZ(t.querySelector(`.tools`))+a*2;n(s+BZ<=o)},(0,m.useLayoutEffect)(()=>r.current()),(0,m.useLayoutEffect)(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(()=>r.current());n.observe(t);for(let e of t.querySelectorAll(`[role="tablist"], .where, .tools`))n.observe(e);return()=>n.disconnect()},[]),{header:e,one:t}}function HZ({status:e,task:t,connection:n,route:r,tabs:i,extra:a,keys:o,onHelp:s}){let c=e?.workspace.name??`bot-lobby`,l=e?.branch??e?.workspace.branch,u=e?.busy??!1,d=DZ(),{header:f,one:p}=VZ();return(0,L.jsxs)(`header`,{ref:f,className:`app-header shrink-0`,"data-one-row":p||void 0,children:[(0,L.jsx)(`div`,{className:`where flex min-w-0 items-center`,children:(0,L.jsx)(jZ,{projects:d,tab:r.kind===`tab`?r.tab:r.kind,name:c,branch:l})}),(0,L.jsx)(`div`,{className:`tabs min-w-0`,children:i}),(0,L.jsxs)(`div`,{className:`tools flex min-w-0 items-center justify-end gap-0.5`,children:[a,(0,L.jsx)(RZ,{busy:u,...t?{task:t}:{},...e?.sessionName?{sessionName:e.sessionName}:{}}),(0,L.jsx)(MZ,{state:n}),(0,L.jsx)(PZ,{label:`Sessions`,hint:o.sessions??`Alt+O`,href:`#/sessions`,active:r.kind===`sessions`,children:(0,L.jsx)(Mm,{"aria-hidden":`true`,className:`size-[1.05rem]`})}),(0,L.jsx)(PZ,{label:`Settings`,hint:o.settings??`Alt+S`,href:`#/settings`,active:r.kind===`settings`,children:(0,L.jsx)(Bh,{"aria-hidden":`true`,className:`size-[1.05rem]`})}),(0,L.jsx)(FZ,{hint:o.help??`Alt+H`,onHelp:s}),(0,L.jsx)(LZ,{}),(0,L.jsx)(IZ,{}),(0,L.jsx)(`span`,{id:`focused-action-help`,className:`sr-only`,children:`Focused buttons: Enter or Space. Links: Enter. Checkboxes: Space.`})]}),(0,L.jsx)(kZ,{projects:d})]})}function UZ(e){let t=e.match(/[#&?]?token=([^&\s#]+)/i);if(t?.[1])return decodeURIComponent(t[1]);let n=e.trim();return n&&!n.includes(`/`)&&!n.includes(` `)?n:void 0}function WZ(){let[e,t]=(0,m.useState)(``),[n,r]=(0,m.useState)(),[i,a]=(0,m.useState)(!1);async function o(e){a(!0),r(void 0),e&&(window.location.hash=`token=${encodeURIComponent(e)}`),await Yf()?window.location.reload():(r(e?`That link did not sign in. Copy the link from Pi and try again.`:`Paste the link from Pi below.`),a(!1))}function s(t){t.preventDefault(),o(UZ(e))}return(0,L.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-6`,children:(0,L.jsxs)(`form`,{onSubmit:s,className:`glass flex w-full max-w-md flex-col gap-4 rounded-xl p-6`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(Om,{className:`size-5`,"aria-hidden":`true`}),(0,L.jsx)(`h1`,{className:`text-base font-medium`,children:`Sign in to bot-lobby`})]}),(0,L.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Pi printed a link when it started (or run `,(0,L.jsx)(`code`,{className:`rounded-lg bg-muted px-1.5 py-0.5 font-mono text-xs`,children:`/bot-lobby web`}),`to see it again). Paste it here.`]}),(0,L.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,L.jsx)(`span`,{className:`font-medium`,children:`Lobby link or token`}),(0,L.jsx)(`input`,{value:e,onChange:e=>t(e.target.value),autoComplete:`off`,spellCheck:!1,placeholder:`http://127.0.0.1:7347/#token=…`,className:`h-8 rounded-lg border border-input bg-background px-3.5 text-sm outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30`})]}),n?(0,L.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:n}):null,(0,L.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,L.jsx)(J,{type:`button`,variant:`ghost`,disabled:i,onClick:()=>void o(void 0),children:`Retry`}),(0,L.jsx)(J,{type:`submit`,disabled:i||!e.trim(),children:`Sign in`})]})]})})}var GZ=.6;function KZ(e,t,n={}){return{initial:e?void 0:!1,animate:t,transition:{duration:GZ,...n}}}var qZ=(e,t)=>[0,Math.max(e,.001),Math.min(Math.max(t,e+.01),.999),1];function JZ(e,t=0,n=1){return KZ(e,{pathLength:[0,0,1,1],strokeOpacity:[0,0,1,1]},{pathLength:{duration:GZ,times:qZ(t,n),ease:`easeInOut`},strokeOpacity:{duration:GZ,times:qZ(t,t+.02)}})}function YZ(e,t){return KZ(e,{scale:[0,0,1.3,1]},{times:qZ(t,t+.18),ease:`easeOut`})}function XZ(e,t,n=1.3){return KZ(e,{scale:[1,1,n,1,1]},{times:[0,Math.max(t,.001),Math.min(t+.15,.9),Math.min(t+.35,.99),1],ease:`easeInOut`})}var ZZ=(e=.5,t=.5)=>({transformBox:`fill-box`,originX:e,originY:t});function QZ({play:e}){return(0,L.jsxs)(z.g,{style:ZZ(.1,.9),...KZ(e,{rotate:[0,-12,8,-4,0],scale:[1,1.12,.96,1.02,1]},{ease:`easeInOut`}),children:[(0,L.jsx)(`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}),[8,12,16].map((t,n)=>(0,L.jsx)(z.circle,{cx:t,cy:11,r:1.15,fill:`currentColor`,stroke:`none`,...KZ(e,{fillOpacity:[0,0,1,1,0],y:[0,0,-1.5,0,0]},{times:[0,.12+n*.12,.24+n*.12,.72,1]})},t))]})}function $Z({play:e}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(z.path,{d:`M13 5h8`,...JZ(e,.15,.45)}),(0,L.jsx)(z.path,{d:`M13 12h8`,...JZ(e,.3,.6)}),(0,L.jsx)(z.path,{d:`M13 19h8`,...JZ(e,.45,.75)}),(0,L.jsx)(z.path,{d:`m3 17 2 2 4-4`,...JZ(e,.35,.7)}),(0,L.jsx)(z.path,{d:`m3 7 2 2 4-4`,...JZ(e,0,.35)})]})}function eQ({play:e}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(z.circle,{cx:6,cy:19,r:3,style:ZZ(),...XZ(e,0)}),(0,L.jsx)(z.path,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,...JZ(e,.1,.7)}),(0,L.jsx)(z.circle,{cx:18,cy:5,r:3,style:ZZ(),...YZ(e,.62)})]})}function tQ({play:e}){return(0,L.jsx)(z.g,{style:ZZ(),...KZ(e,{rotate:[0,-14,10,-6,0],scale:[1,1.18,.94,1.04,1]},{duration:.5,ease:`easeInOut`}),children:(0,L.jsx)(z.path,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,fill:`currentColor`,...KZ(e,{fillOpacity:[0,.85,0]},{duration:.5,times:[0,.2,1]})})})}function nQ({play:e}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(z.circle,{cx:12,cy:12,r:10,style:ZZ(),...KZ(e,{scale:[1,1,1.4],strokeOpacity:[0,.5,0]},{times:[0,.25,1],ease:`easeOut`})}),(0,L.jsx)(z.circle,{cx:12,cy:12,r:10,style:ZZ(),...KZ(e,{scale:[1,.86,1.06,1]},{times:[0,.25,.55,1],ease:`easeInOut`})}),(0,L.jsx)(z.circle,{cx:12,cy:12,r:1,fill:`currentColor`,style:ZZ(),...KZ(e,{scale:[1,2.4,.8,1]},{times:[0,.3,.6,1],ease:`easeInOut`})})]})}function rQ({play:e}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`}),[`M8 17v-3`,`M13 17V5`,`M18 17V9`].map((t,n)=>(0,L.jsx)(z.path,{d:t,style:ZZ(.5,1),...KZ(e,{scaleY:[0,0,1.18,1]},{times:qZ(.08+n*.14,.4+n*.14),ease:`easeOut`})},t))]})}function iQ({play:e}){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(z.circle,{cx:6,cy:6,r:3,style:ZZ(),...XZ(e,0)}),(0,L.jsx)(z.line,{x1:6,x2:6,y1:9,y2:21,...JZ(e,.05,.45)}),(0,L.jsx)(z.path,{d:`M13 6h3a2 2 0 0 1 2 2v7`,...JZ(e,.2,.62)}),(0,L.jsx)(z.circle,{cx:18,cy:18,r:3,style:ZZ(),...YZ(e,.58)})]})}function aQ({play:e}){return(0,L.jsxs)(z.g,{style:ZZ(),...KZ(e,{scaleX:[1,.55,1.08,1],y:[0,-1,0,0]},{times:[0,.35,.65,1],ease:`easeInOut`}),children:[(0,L.jsx)(z.path,{d:`M12 5v16`,style:ZZ(),...KZ(e,{scaleY:[1,1.12,1,1]},{times:[0,.35,.65,1]})}),(0,L.jsx)(`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`})]})}function oQ({play:e}){return(0,L.jsxs)(z.g,{style:ZZ(.6,.6),...KZ(e,{x:[0,1.5,-1.5,1,0],y:[0,-1,.5,-.5,0],rotate:[0,-8,6,-3,0]},{ease:`easeInOut`}),children:[(0,L.jsx)(`path`,{d:`M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z`}),(0,L.jsx)(`path`,{d:`m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18`}),(0,L.jsx)(z.path,{d:`m2.3 2.3 7.286 7.286`,...JZ(e,.1,.6)}),(0,L.jsx)(z.circle,{cx:11,cy:11,r:2,style:ZZ(),...XZ(e,.5,1.5)})]})}var sQ={lobby:QZ,tasks:$Z,plan:eQ,quickfix:tQ,issues:nQ,metrics:rQ,git:iQ,knowledge:aQ,excalidraw:oQ};function cQ({id:e,play:t,className:n}){let r=sQ[e];return r?(0,L.jsx)(`svg`,{"aria-hidden":`true`,"data-tab-icon":e,"data-play":t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,className:q(`overflow-visible`,n),children:(0,L.jsx)(r,{play:t})},t):null}function lQ(e){return/(\d)$/.exec(e)?.[1]}var uQ=160;function dQ(e){let t=Jd(),[n,r]=(0,m.useState)(0),i=(0,m.useRef)(0),a=(0,m.useCallback)(()=>{t||performance.now()<i.current||(i.current=performance.now()+GZ*1e3,r(e=>e+1))},[t]),o=(0,m.useRef)(e);return(0,m.useEffect)(()=>{let t=e&&!o.current;if(o.current=e,!t)return;let n=window.setTimeout(a,uQ);return()=>window.clearTimeout(n)},[e,a]),{play:n,onPointerEnter:(0,m.useCallback)(e=>{e.pointerType!==`touch`&&a()},[a])}}var fQ=(0,m.forwardRef)(function({tab:e,active:t},n){let r=lQ(e.key),{play:i,onPointerEnter:a}=dQ(t);return(0,L.jsxs)(GD,{children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsxs)(`a`,{ref:n,role:`tab`,id:`tab-${e.id}`,href:`#/${e.id}`,"aria-selected":t,"aria-keyshortcuts":e.key,tabIndex:t?0:-1,onPointerEnter:a,className:q(`relative z-10 inline-flex h-7.5 shrink-0 items-center gap-1.5 rounded-lg border border-input px-2.5 text-[0.8125rem] leading-none font-medium whitespace-nowrap outline-none`,`transition-colors duration-200 ease-snap focus-visible:ring-3 focus-visible:ring-ring/40`,t?`text-foreground`:`text-muted-foreground hover:text-foreground`),children:[(0,L.jsx)(cQ,{id:e.id,play:i,className:q(`size-3.5 shrink-0 transition-colors duration-200`,t&&`text-primary`)}),r?(0,L.jsx)(`span`,{"aria-hidden":`true`,className:q(`text-[0.72rem] font-semibold tabular-nums transition-colors duration-200`,t?`text-primary`:`text-muted-foreground/75`),children:r}):null,(0,L.jsx)(`span`,{children:e.label})]})}),(0,L.jsxs)(qD,{children:[e.label,` `,(0,L.jsx)(cD,{chord:e.key})]})]})}),pQ=1.5;function mQ(e,t,n=t?.left??0,r=t?.right??0,i=1){if(e){if(!t||r-n<.5){e.style.opacity=`0`;return}e.style.opacity=String(Math.min(1,(r-n)/14)),e.style.top=`${t.top}px`,e.style.height=`${t.height}px`,e.style.width=`${r-n}px`,e.style.transform=`translateX(${n}px)`,e.style.scale=i===1?``:`1 ${i}`}}function hQ(e,t){let n=e.right-e.left,{height:r}=e,i=pQ/2,a=Math.max(0,Math.min(e.radius-i,r/2-i,n/2-i)),o=r/2,s=e=>+(t===`left`?e:n-e).toFixed(2),c=+(t===`left`),l=1-c,u=i,d=n-i,f=r-i;return[`M${s(u)} ${o}L${s(u)} ${i+a}A${a} ${a} 0 0 ${c} ${s(u+a)} ${i}L${s(d-a)} ${i}A${a} ${a} 0 0 ${c} ${s(d)} ${i+a}L${s(d)} ${o}`,`M${s(u)} ${o}L${s(u)} ${f-a}A${a} ${a} 0 0 ${l} ${s(u+a)} ${f}L${s(d-a)} ${f}A${a} ${a} 0 0 ${l} ${s(d)} ${f-a}L${s(d)} ${o}`]}function gQ(e,t,n,r){if(!e)return;if(!t||r<=.002){e.style.opacity=`0`;return}let i=t.right-t.left,a=`${i}x${t.height}r${t.radius}${n}`;e.dataset.shape!==a&&(e.dataset.shape=a,e.dataset.port=n,e.setAttribute(`viewBox`,`0 0 ${i} ${t.height}`),hQ(t,n).forEach((t,n)=>e.children[n]?.setAttribute(`d`,t))),e.style.opacity=String(Math.min(1,r*12)),e.style.top=`${t.top}px`,e.style.height=`${t.height}px`,e.style.width=`${i}px`,e.style.transform=`translateX(${t.left}px)`;let o=`${Math.min(1,r)} 2`;for(let t of e.children)t.style.strokeDasharray=o}var _Q={type:`spring`,visualDuration:.12,bounce:0},vQ={type:`spring`,visualDuration:.17,bounce:.15,delay:.015},yQ={type:`spring`,visualDuration:.17,bounce:.05,delay:.07},bQ={type:`spring`,visualDuration:.22,bounce:.25},xQ={type:`spring`,visualDuration:.2,bounce:0},SQ={type:`spring`,stiffness:900,damping:18,velocity:45,restDelta:.02,restSpeed:1},CQ=(()=>{let e=Zn({keyframes:[0,1],visualDuration:bQ.visualDuration,bounce:bQ.bounce}),t=0;for(;t<1e3&&e.next(t).value<.97;)t+=4;return t/1e3})(),wQ={type:`spring`,visualDuration:.28,bounce:.6};function TQ(e,t){let n=(0,m.useRef)(null),r=(0,m.useRef)(null),i=(0,m.useRef)(null),a=(0,m.useRef)(null),o=(0,m.useRef)(null),s=(0,m.useRef)({}),c=(0,m.useRef)([]),l=(0,m.useRef)(void 0),u=(0,m.useRef)([]),d=(0,m.useRef)(1),f=(0,m.useRef)(1),p=(0,m.useCallback)(e=>{let t=e?s.current[e]:void 0;if(!t)return;let n=parseFloat(getComputedStyle(t).borderTopLeftRadius)||0;return{left:t.offsetLeft,right:t.offsetLeft+t.offsetWidth,top:t.offsetTop,height:t.offsetHeight,radius:n}},[]),h=(0,m.useCallback)(()=>{for(let e of u.current)e.stop();u.current=[];for(let e of Object.values(s.current))e?.style.translate&&(e.style.translate=``)},[]),g=(0,m.useCallback)(e=>{h(),l.current=e,d.current=1,f.current=1;let t=p(e);mQ(r.current,t),mQ(i.current,void 0),gQ(a.current,t,`left`,1),gQ(o.current,void 0,`left`,0);for(let e of c.current)e&&(e.style.width=`0px`);$R()},[p,h]),_=(0,m.useCallback)((e,t)=>{let n=p(e),m=p(t);if(!n||!m)return g(t);h(),QR(),l.current=t;let _=m.left>n.left?1:-1,v=_>0?n.right:n.left,y=_>0?m.left:m.right,b=Math.abs(y-v),x=_>0?`right`:`left`,S=_>0?`left`:`right`,C=c.current.map(e=>{let t=e?.parentElement;return t?{liquid:e,from:t.offsetLeft,to:t.offsetLeft+t.offsetWidth}:void 0}),w=b>4?1-4/b:0,T={drained:1-Math.min(1,d.current),unrung:1-Math.min(1,f.current),head:0,tail:0,filled:0,rung:0,squash:1,budge:0},E=s.current[t];d.current=0,f.current=0;let D=()=>{let e=(n.right-n.left)*Math.min(1,T.drained);mQ(i.current,n,_>0?n.left+e:n.left,_>0?n.right:n.right-e),gQ(o.current,n,x,1-T.unrung);let t=v+_*b*T.head,s=v+_*b*T.tail,c=Math.min(t,s),l=Math.max(t,s);for(let e of C){if(!e?.liquid)continue;let t=Math.max(c,e.from),n=Math.min(l,e.to);e.liquid.style.width=`${Math.max(0,n-t)}px`,e.liquid.style.transform=`translateX(${Math.max(0,t-e.from)}px)`}let u=_*T.budge,d=u?{...m,left:m.left+u,right:m.right+u}:m;E&&(E.style.translate=Math.abs(u)>.01?`${u.toFixed(2)}px`:``);let f=(d.right-d.left)*Math.min(1,Math.max(0,T.filled));mQ(r.current,d,_>0?d.left:d.right-f,_>0?d.left+f:d.right,Math.min(1,T.squash)),gQ(a.current,d,S,T.rung)},O=(e,t,n,r,i=1)=>{let a=vf(t,i,{...n,onUpdate:t=>{T[e]=t,r?.(t),D()}});return u.current.push(a),a},k=!1,ee=()=>{if(k)return;k=!0;let e=O(`filled`,0,bQ,e=>{d.current=e});e.then(()=>{l.current===t&&$R()}),O(`squash`,.8,wQ),O(`rung`,0,xQ,e=>{f.current=e}),O(`budge`,0,{...SQ,delay:CQ},void 0,0),Promise.all([e,...u.current]).then(()=>{l.current===t&&u.current.includes(e)&&g(t)})};O(`drained`,T.drained,_Q),O(`unrung`,T.unrung,_Q),O(`head`,0,vQ,e=>{e>=w&&ee()}),O(`tail`,0,yQ),D()},[p,g,h]);(0,m.useLayoutEffect)(()=>{let t=l.current,n=typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;!t||!e||t===e||n?g(e):_(t,e)},[e,t,_,g]);let v=(0,m.useRef)(e);return v.current=e,(0,m.useEffect)(()=>{let e=n.current;if(!e||typeof ResizeObserver>`u`)return;let t=!0,r=new ResizeObserver(()=>{if(t){t=!1;return}g(v.current)});return r.observe(e),()=>{r.disconnect(),h()}},[g,h]),{track:n,fill:r,drain:i,ring:a,unring:o,cells:s,liquids:c}}var EQ=(0,m.forwardRef)(function({which:e},t){return(0,L.jsxs)(`svg`,{ref:t,"aria-hidden":`true`,[`data-tab-${e}`]:``,className:`pointer-events-none absolute left-0 z-20 overflow-visible opacity-0 will-change-transform`,fill:`none`,children:[(0,L.jsx)(`path`,{pathLength:1,strokeWidth:pQ,strokeLinecap:`round`,className:`stroke-tab-rim`}),(0,L.jsx)(`path`,{pathLength:1,strokeWidth:pQ,strokeLinecap:`round`,className:`stroke-tab-rim`})]})});function DQ(e){if(e.left||e.right)return`linear-gradient(to right, ${e.left?`transparent 0, black 28px`:`black 0`}, ${e.right?`black calc(100% - 28px), transparent 100%`:`black 100%`})`}function OQ({tabs:e,activeId:t,onSelect:n}){let{track:r,fill:i,drain:a,ring:o,unring:s,cells:c,liquids:l}=TQ(t,e.length),u=(0,m.useRef)(null),[d,f]=(0,m.useState)({left:!1,right:!1}),p=(0,m.useCallback)(()=>{let e=u.current;if(!e)return;let t=e.scrollLeft>2,n=e.scrollLeft+e.clientWidth<e.scrollWidth-2;f(e=>e.left===t&&e.right===n?e:{left:t,right:n})},[]);(0,m.useEffect)(()=>{let e=u.current;if(!e||typeof ResizeObserver>`u`)return;p();let t=new ResizeObserver(p);return t.observe(e),e.firstElementChild&&t.observe(e.firstElementChild),()=>t.disconnect()},[p,e.length]),(0,m.useEffect)(()=>{let e=u.current,n=t?c.current[t]:void 0;e&&n&&(n.offsetLeft<e.scrollLeft?e.scrollLeft=n.offsetLeft-8:n.offsetLeft+n.offsetWidth>e.scrollLeft+e.clientWidth&&(e.scrollLeft=n.offsetLeft+n.offsetWidth-e.clientWidth+8))},[t,c]);function h(r){if(r.key===`ArrowDown`&&!r.altKey){iO()&&r.preventDefault();return}let i=r.key===`ArrowRight`?1:r.key===`ArrowLeft`?-1:0;if(!i||e.length===0)return;r.preventDefault();let a=r.target.closest(`[role='tab']`)?.id.replace(/^tab-/,``)??t,o=e[(Math.max(0,e.findIndex(e=>e.id===a))+i+e.length)%e.length];oO.active=!0,oO.to=o.id,window.setTimeout(()=>{oO.active=!1,oO.to=void 0},3e3),n(o.id),c.current[o.id]?.focus({preventScroll:!0})}return(0,L.jsx)(`div`,{ref:u,onScroll:p,style:{maskImage:DQ(d),WebkitMaskImage:DQ(d)},className:`min-w-0 max-w-full overflow-x-auto [scrollbar-width:none] pointer-coarse:-my-1.5 pointer-coarse:py-1.5 [&::-webkit-scrollbar]:hidden`,children:(0,L.jsxs)(`div`,{ref:r,role:`tablist`,"aria-label":`Lobby tabs`,onKeyDown:h,className:`relative mx-auto flex w-max items-center py-0.5`,children:[(0,L.jsx)(`span`,{ref:a,"aria-hidden":`true`,"data-tab-drain":!0,className:`pointer-events-none absolute left-0 z-0 rounded-lg bg-tab-fill opacity-0 will-change-transform`}),(0,L.jsx)(`span`,{ref:i,"aria-hidden":`true`,"data-tab-fill":!0,className:`pointer-events-none absolute left-0 z-0 rounded-lg bg-tab-fill opacity-0 will-change-transform`}),(0,L.jsx)(EQ,{ref:s,which:`unring`}),(0,L.jsx)(EQ,{ref:o,which:`ring`}),e.map((e,n)=>(0,L.jsxs)(m.Fragment,{children:[n>0?(0,L.jsxs)(`span`,{"aria-hidden":`true`,"data-tab-link":!0,className:`relative h-[2px] w-3.5 shrink-0 sm:w-4`,children:[(0,L.jsx)(`span`,{className:`absolute inset-0 border-t-2 border-dotted border-input`}),(0,L.jsx)(`span`,{ref:e=>{l.current[n-1]=e},"data-tab-liquid":!0,className:`absolute top-0 left-0 h-[2px] w-0 rounded-full bg-tab-liquid shadow-[0_0_6px_var(--tab-liquid)] will-change-transform`})]}):null,(0,L.jsx)(fQ,{ref:t=>{c.current[e.id]=t},tab:e,active:e.id===t})]},e.id))]})})}function kQ({oracleBusy:e,runs:t,activity:n,background:r}){let i=new Set;e&&i.add(`Oracle`);for(let e of t)e.status===`running`&&i.add(iV(cV(e)));for(let e of n)e.pending&&e.source!==`LOBBY`&&i.add(e.source===`MASTER`?`Oracle`:iV(e.source));let a=r.filter(e=>e.alive&&e.busy).length;return a&&i.add(a===1?`1 in the background`:`${a} in the background`),[...i]}function AQ(e){return e.length<=2?e.join(`, `):`${e.slice(0,2).join(`, `)} +${e.length-2}`}var jQ=6,MQ=`bot-lobby.orb`,NQ=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0&&e<=1;function PQ(e,t,n,r){let i=e=>e+jQ,a=(e,t)=>Math.max(e+jQ,e+t-r-jQ);return{x:Math.min(a(n.left,n.width),Math.max(i(n.left),e)),y:Math.min(a(n.top,n.height),Math.max(i(n.top),t))}}function FQ(e,t,n,r){let i=e=>Math.max(1,e-r),a=PQ(e,t,n,r);return{fx:Math.min(1,Math.max(0,(a.x-n.left)/i(n.width))),fy:Math.min(1,Math.max(0,(a.y-n.top)/i(n.height)))}}function IQ(e,t,n){return PQ(t.left+e.fx*Math.max(0,t.width-n),t.top+e.fy*Math.max(0,t.height-n),t,n)}function LQ(e){if(e)try{let t=JSON.parse(e);return NQ(t.fx)&&NQ(t.fy)?{fx:t.fx,fy:t.fy}:void 0}catch{return}}function RQ(){try{return LQ(localStorage.getItem(MQ))}catch{return}}function zQ(e){try{localStorage.setItem(MQ,JSON.stringify(e))}catch{}}var BQ=5,VQ=16;function HQ(){let e=document.getElementById(`main`)?.getBoundingClientRect();return e?{left:e.left,top:e.top,width:e.width,height:e.height}:void 0}function UQ(){let[e,t]=(0,m.useState)(HQ);return(0,m.useEffect)(()=>{let e=()=>t(HQ()),n=document.getElementById(`main`),r=typeof ResizeObserver>`u`||!n?void 0:new ResizeObserver(e);return n&&r?.observe(n),window.addEventListener(`resize`,e),e(),()=>{r?.disconnect(),window.removeEventListener(`resize`,e)}},[]),e}var WQ=(0,m.forwardRef)(function({spotlight:e,thinking:t,busy:n=[],tone:r,expanded:i,hidden:a,shortcut:o,onOpen:s},c){let l=UQ(),[u,d]=(0,m.useState)(RQ),[f,p]=(0,m.useState)(),[h,g]=(0,m.useState)(!1),_=(0,m.useRef)(void 0),v=(0,m.useRef)(!1),y=(0,m.useRef)(44),b=f??(u&&l?IQ(u,l,y.current):void 0),x=(0,m.useCallback)((e,t)=>{let n=HQ();if(!n)return;let r=FQ(e,t,n,y.current);d(r),zQ(r)},[]);function S(e){if(e.button!==0)return;let t=e.currentTarget.getBoundingClientRect();y.current=t.width,_.current={id:e.pointerId,sx:e.clientX,sy:e.clientY,ox:t.left,oy:t.top,moved:!1},e.currentTarget.setPointerCapture?.(e.pointerId)}function C(e){let t=_.current;if(!t||t.id!==e.pointerId)return;let n=e.clientX-t.sx,r=e.clientY-t.sy;if(!t.moved&&Math.hypot(n,r)<BQ)return;t.moved=!0;let i=HQ();i&&p(PQ(t.ox+n,t.oy+r,i,y.current))}function w(e){let t=_.current;_.current=void 0,t?.moved&&(v.current=!0,x(t.ox+e.clientX-t.sx,t.oy+e.clientY-t.sy),p(void 0))}function T(e){let t=e.shiftKey?64:VQ,n={ArrowLeft:[-t,0],ArrowRight:[t,0],ArrowUp:[0,-t],ArrowDown:[0,t]}[e.key];if(!n||e.altKey||e.ctrlKey||e.metaKey)return;e.preventDefault();let r=e.currentTarget.getBoundingClientRect();y.current=r.width,x(r.left+n[0],r.top+n[1])}let E=!e&&n.length>0,D=e?iV(e):E?AQ(n):void 0,O=e?`${t.map(iV).join(`, `)} thinking. `:E?`${n.join(`, `)} at work. `:``,k=b&&l?b.x-l.left<140:!1,ee={"--orb":r,...b?{left:b.x,top:b.y,right:`auto`,bottom:`auto`}:{}};return(0,L.jsxs)(GD,{open:h&&!f,onOpenChange:g,children:[(0,L.jsx)(KD,{asChild:!0,children:(0,L.jsxs)(`button`,{ref:c,type:`button`,"aria-label":`Open Thinking`,"aria-description":`${O}Drag, or use the arrow keys, to move it.`,"aria-haspopup":`dialog`,"aria-expanded":i,"aria-keyshortcuts":o?`${o} Enter Space`:`Enter Space`,onClick:e=>{if(v.current){v.current=!1,e.preventDefault();return}s()},onPointerDown:S,onPointerMove:C,onPointerUp:w,onPointerCancel:()=>{_.current=void 0,p(void 0)},onKeyDown:T,style:ee,"data-thinking":e?``:void 0,"data-busy":E?``:void 0,"data-dragging":f?``:void 0,"data-placed":b?``:void 0,"data-flip":k||void 0,className:q(`thinking-bubble fixed z-20 touch-none rounded-full outline-none select-none focus-visible:ring-3 focus-visible:ring-ring/40`,a&&`invisible`),children:[(0,L.jsx)(tu,{initial:!1,children:D?(0,L.jsx)(z.span,{className:`orb-label`,initial:{opacity:0,x:k?-8:8,scale:.9},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:k?-8:8,scale:.9},transition:{type:`spring`,visualDuration:.3,bounce:.35},children:(0,L.jsx)(tu,{mode:`popLayout`,initial:!1,children:(0,L.jsx)(z.span,{className:`inline-flex items-center gap-1`,initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{type:`spring`,visualDuration:.28,bounce:.3},children:D},D)})},`label`):null}),(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`orb orb-float`,children:(0,L.jsx)(`span`,{className:`orb-icon`,children:(0,L.jsx)(nV,{source:e,strokeWidth:2.25,className:`size-3.5`})})})]})}),(0,L.jsxs)(qD,{side:`top`,children:[`Thinking `,o?(0,L.jsx)(cD,{chord:o}):null,(0,L.jsx)(`span`,{className:`text-background/70`,children:` · drag to move`})]})]})}),GQ=/^\s*(?:#{1,6}\s+(.+?)\s*#*|\*\*([^*\n]{2,90}?):?\*\*:?|__([^_\n]{2,90}?):?__:?)\s*$/,KQ=260,qQ=200,JQ=/^\s*(?:[-*+]\s|\d+[.)]\s|>|```|~~~|\|)/m;function YQ(e){let t=[],n=[],r=!1;for(let i of e){if(/^\s*(```|~~~)/.test(i)&&(r=!r),!r&&!i.trim()){n.length&&t.push(n.join(`
|
|
100
103
|
`).trim()),n=[];continue}n.push(i)}return n.length&&t.push(n.join(`
|
|
101
|
-
`).trim()),t.filter(Boolean)}function
|
|
104
|
+
`).trim()),t.filter(Boolean)}function XQ(e){let t=e.split(/(?<=[.!?…])\s+(?=[A-Z"'“‘`(\[])/),n=[];for(let e of t){let t=n.at(-1);t!==void 0&&(t.split("`").length-1)%2==1?n[n.length-1]=`${t} ${e}`:n.push(e)}return n}function ZQ(e){if(e.length<=KQ||JQ.test(e))return[e];let t=[],n=``;for(let r of XQ(e.replace(/\s*\n\s*/g,` `)))n&&n.length+r.length+1>qQ?(t.push(n),n=r):n=n?`${n} ${r}`:r;return n&&t.push(n),t}function QQ(e){let t=e.replace(/\r\n?/g,`
|
|
102
105
|
`).trim().split(`
|
|
103
|
-
`),n=[{lines:[]}],r=!1;for(let e of t){/^\s*(```|~~~)/.test(e)&&(r=!r);let t=r?null:
|
|
106
|
+
`),n=[{lines:[]}],r=!1;for(let e of t){/^\s*(```|~~~)/.test(e)&&(r=!r);let t=r?null:GQ.exec(e),i=t?(t[1]??t[2]??t[3])?.trim():void 0;i?n.push({title:i,lines:[]}):n.at(-1).lines.push(e)}let i=[];for(let e of n){let t=YQ(e.lines);if(e.title)i.push({title:e.title,text:t.join(`
|
|
104
107
|
|
|
105
|
-
`)});else for(let e of t)for(let t of MQ(e))i.push({text:t})}return i}var PQ=4,FQ=1800,IQ=e=>({"--orb":e});function LQ(e){let[t,n]=(0,m.useState)(0),r=e.join(`|`);return(0,m.useEffect)(()=>{if(n(0),e.length<2)return;let t=window.setInterval(()=>n(e=>e+1),FQ);return()=>window.clearInterval(t)},[r,e.length]),e.length?e[t%e.length]:void 0}function RQ({thought:e}){let t=(0,m.useMemo)(()=>NQ(e.text),[e.text]),[n,r]=(0,m.useState)(!1),i=n?0:Math.max(0,t.length-PQ),a=t.slice(i),o=UB(e.source);return(0,L.jsxs)(`li`,{className:`thought`,style:IQ(KB(e.source)),"data-live":e.live||void 0,"aria-label":`${o}${e.live?`, thinking`:``}`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(`span`,{className:`thought-label`,children:[(0,L.jsx)(VB,{source:e.source,strokeWidth:2.25,className:`size-3.5`}),o]}),(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.live?(0,L.jsxs)(`span`,{className:`thought-live`,children:[`thinking`,(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`thought-ellipsis`})]}):NO(Date.now()-e.at)}),t.length>1?(0,L.jsxs)(`span`,{className:`ml-auto text-xs text-muted-foreground tabular-nums`,children:[t.length,` steps`]}):null]}),i?(0,L.jsxs)(`button`,{type:`button`,"data-compact":!0,className:`thought-more`,onClick:()=>r(!0),children:[i,` earlier `,i===1?`step`:`steps`]}):null,(0,L.jsx)(`ol`,{className:`thought-steps`,"data-single":a.length===1||void 0,children:a.map((t,n)=>(0,L.jsxs)(`li`,{"data-current":e.live&&n===a.length-1||void 0,children:[t.title?(0,L.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:t.title}):null,t.text?(0,L.jsx)(XR,{text:t.text,className:`thought-text`}):null]},i+n))})]})}function zQ(e,t,n){(0,m.useEffect)(()=>{if(!e||!t)return;let r=e=>{e.defaultPrevented||e.isComposing||!DX(e,t)||e.target?.closest(`input, textarea, [contenteditable='true']`)||(e.preventDefault(),n())};return window.addEventListener(`keydown`,r),()=>window.removeEventListener(`keydown`,r)},[e,t,n])}function BQ(e){return[...e].sort((e,t)=>Number(t.live)-Number(e.live)||t.at-e.at||t.id-e.id)}function VQ({thoughts:e,collapsed:t,onToggle:n,shortcut:r,busy:i=[]}){let a=BQ(YB(e)),o=a.filter(e=>e.live).map(e=>e.source),s=LQ(o),c=s?KB(s):i.length?`var(--primary)`:`var(--orb-idle)`,l=s?`thinking`:i.length?`busy`:void 0,u=(0,m.useRef)(null),d=(0,m.useRef)(t);d.current=t,(0,m.useEffect)(()=>()=>{d.current||n()},[n]);let f=vD(!t,_D.sheet),p=bD();zQ(f,r,n);let h=a.length>0||i.length>0;return(0,L.jsxs)(L.Fragment,{children:[h&&(0,bv.createPortal)((0,L.jsx)(TQ,{ref:u,spotlight:s,thinking:o,busy:i,tone:c,expanded:!t,hidden:p,shortcut:r,onOpen:n}),document.body),(0,L.jsxs)(uD,{open:f,onOpenChange:e=>{!e&&!t&&n()},label:`Thinking`,className:q(`thought-pane max-w-xl`,l&&`thought-pane-live`),style:IQ(c),onCloseAutoFocus:e=>{e.preventDefault(),requestAnimationFrame(()=>{document.querySelector(`[role='dialog']`)||u.current?.focus()})},children:[(0,L.jsx)(`div`,{"aria-hidden":`true`,className:`thought-aura`,"data-working":l}),(0,L.jsx)(`div`,{className:`relative min-h-0 overflow-y-auto p-3 outline-none sm:p-4`,role:`log`,"aria-label":`Latest thoughts`,tabIndex:0,children:a.length?(0,L.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:a.map(e=>(0,L.jsx)(RQ,{thought:e},e.id))}):(0,L.jsx)(`p`,{className:`px-2 py-6 text-center text-sm text-muted-foreground`,children:`Thoughts from the oracle and every agent appear here, and only here.`})})]})]})}function HQ({status:e,lobby:t}){let[n,r]=wH(`lobby.thinking`),i=UD(`sessions.list`,{},[`sessions`]);if(!e||e.panels?.thinking===!1)return null;let a=uQ({oracleBusy:e.busy,runs:JB(t),activity:t?.activity??[],background:i.data?.background??[]}),o=e.keys.find(e=>e.action===`thinking`)?.label;return(0,L.jsx)(VQ,{thoughts:t?.thoughts??[],collapsed:n,onToggle:r,shortcut:o,busy:a})}var UQ=/\s*\(recommended\)\s*$/i,WQ=1200,GQ=`Type something.`;function KQ(e){return{text:e.replace(UQ,``),recommended:UQ.test(e)}}function qQ({label:e}){let{text:t,recommended:n}=KQ(e);return(0,L.jsxs)(`span`,{className:`leading-snug`,children:[t,n?(0,L.jsx)(`span`,{className:`ms-1 font-medium text-primary`,children:`(Recommended)`}):null]})}function JQ({multi:e,on:t}){return(0,L.jsxs)(`span`,{"aria-hidden":`true`,className:q(`relative mt-0.5 flex size-4 shrink-0 items-center justify-center border`,e?`rounded-lg`:`rounded-full`,t?`border-primary bg-primary text-primary-foreground`:`border-input`),children:[t?(0,L.jsx)(Op,{className:q(e?`size-3`:`hidden`)}):null,t&&!e?(0,L.jsx)(`span`,{className:`size-2 rounded-full bg-primary-foreground`}):null]})}function YQ({option:e,index:t,multi:n,name:r,selected:i,onToggle:a,onFocusOption:o}){return(0,L.jsxs)(`div`,{className:`grid gap-1`,children:[(0,L.jsxs)(`label`,{className:q(`flex min-h-9 cursor-pointer items-start gap-2.5 rounded-lg border px-3 py-2 text-start text-sm transition-[background-color,border-color,transform] duration-150 ease-snap active:scale-[0.99]`,i?`border-primary/50 bg-accent`:`border-input bg-background hover:bg-accent/60`,`has-[:focus-visible]:border-ring has-[:focus-visible]:ring-3 has-[:focus-visible]:ring-ring/30`),children:[(0,L.jsx)(`input`,{type:n?`checkbox`:`radio`,name:r,"data-nav":``,"data-option":t,className:`sr-only`,checked:i,onChange:a,onFocus:o}),(0,L.jsx)(JQ,{multi:n,on:i}),(0,L.jsx)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:(0,L.jsxs)(`span`,{className:`flex gap-1.5`,children:[(0,L.jsxs)(`span`,{"aria-hidden":`true`,className:`text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,L.jsx)(qQ,{label:e.label})]})})]}),e.description?(0,L.jsx)(XR,{text:e.description,className:`px-3 text-muted-foreground`}):null]})}function XQ({option:e,onExpand:t}){return!e||!iq(e)?null:(0,L.jsxs)(`div`,{className:`card-raised flex flex-col gap-2 rounded-lg border p-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`p`,{className:`min-w-0 truncate text-xs font-medium text-muted-foreground`,children:[`Preview · `,KQ(e.label).text]}),(0,L.jsxs)(J,{type:`button`,variant:`ghost`,size:`xs`,onClick:t,"aria-keyshortcuts":`E`,title:`Expand · E`,className:`-my-1 shrink-0`,children:[(0,L.jsx)(Bm,{"aria-hidden":`true`}),`Expand`]})]}),e.image?(0,L.jsx)(`img`,{src:Hf(e.image),alt:``,loading:`lazy`,className:`max-h-64 w-full rounded-lg border object-contain`}):null,e.htmlPreview?(0,L.jsx)(eq,{preview:e.htmlPreview,label:KQ(e.label).text,frameWidth:WQ,onOpen:t,className:`h-auto aspect-[3/2]`}):null,e.preview?(0,L.jsx)(XR,{text:e.preview,className:`text-xs`}):null]})}function ZQ({primary:e,primaryLabel:t,disabled:n,submitting:r,onCancel:i}){return(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(J,{type:`button`,variant:`ghost`,onClick:i,children:`Cancel`}),(0,L.jsx)(J,{type:e,disabled:n||r,children:r?`Sending…`:t})]})}function QQ(e,t,n,r){let i=e[r];if(!i)return;let a=n[r]?.trim();if(a)return{questionIndex:r,question:i.question,kind:`custom`,answer:a};let o=(t[r]??[]).map(e=>i.options[e]?.label).filter(e=>!!e);if(o.length!==0)return i.multiSelect?{questionIndex:r,question:i.question,kind:`multi`,answer:o.join(`, `),selected:o}:{questionIndex:r,question:i.question,kind:`option`,answer:o[0]??null}}function $Q({questions:e,picks:t,own:n,index:r,onGo:i}){return e.length===1?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e[0]?.header}):(0,L.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:e.map((e,a)=>{let o=!!n[a]?.trim()||(t[a]?.length??0)>0;return(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-description":`When focused, press Enter or Space to open this question.`,type:`button`,onClick:()=>i(a),"aria-current":a===r,className:q(`inline-flex min-h-8 items-center gap-1 rounded-lg border px-3 text-xs font-medium transition-colors`,a===r?`border-primary bg-primary/10 text-primary`:`border-border text-muted-foreground hover:bg-muted`),children:[a+1,` `,e.header,o?(0,L.jsx)(Op,{className:`size-3`,"aria-hidden":`true`}):null]},a)})})}function e$({questions:e,submitting:t,onAnswer:n,onCancel:r,expanded:i,onExpand:a}){let[o,s]=(0,m.useState)(0),[c,l]=(0,m.useState)(!1),u=i??c,d=e=>a?a(e):l(e),[f,p]=(0,m.useState)(0),h=(0,m.useRef)(0),g=(0,m.useRef)(!1),[_,v]=(0,m.useState)({}),[y,b]=(0,m.useState)({}),[x,S]=(0,m.useState)({}),C=(0,m.useRef)(null),w=e[o],T=_[o]??[],E=y[o]??``,D=w?.options[x[o]??T[0]??0],O=QQ(e,_,y,o),k=w?.multiSelect===!0;if((0,m.useEffect)(()=>{let e=C.current;e&&(e.querySelector(`[data-option="${_[o]?.[0]??0}"]`)??e.querySelector(`[data-nav]`))?.focus()},[o]),(0,m.useEffect)(()=>{let e=g.current&&!u;g.current=u,e&&(S(e=>({...e,[o]:h.current})),C.current?.querySelector(`[data-option="${h.current}"]`)?.focus())},[u]),!w)return null;let ee=w.options.some(iq);function te(e){p(Math.max(0,e)),h.current=Math.max(0,e),d(!0)}function ne(e){h.current=e,d(!1)}if(u&&ee)return(0,L.jsx)(oq,{options:w.options,start:f,title:w.header||w.question,picked:T,multi:k,onChoose:e=>{A(e),k||ne(e)},onClose:ne,onIndex:e=>{h.current=e}},o);function A(e){let t=k?T.includes(e)?T.filter(t=>t!==e):[...T,e]:[e];v({..._,[o]:t}),k||b({...y,[o]:``}),S({...x,[o]:e})}function re(t,r){if(QQ(e,t,r,o)){if(o<e.length-1){s(o+1);return}n({answers:e.map((n,i)=>QQ(e,t,r,i)).filter(e=>!!e),cancelled:!1})}}function ie(e){e.preventDefault(),t||re(_,y)}function j(t){t>=0&&t<e.length&&s(t)}function ae(e){let n=e.target,r=C.current;if(!r||e.altKey)return;if(e.key===`Enter`&&(e.ctrlKey||e.metaKey)){e.preventDefault(),t||re(_,y);return}if(n instanceof HTMLTextAreaElement){e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing?(e.preventDefault(),t||re(_,y)):e.key===`ArrowUp`&&n.selectionStart===0&&n.selectionEnd===0&&(e.preventDefault(),YD(r,n,-1));return}let i=ZD(e.key);if(i){e.preventDefault(),YD(r,n,i);return}if(e.key===`Home`||e.key===`End`){e.preventDefault(),YD(r,n,e.key===`Home`?`first`:`last`);return}let a=QD(e.key);if(a&&!(n instanceof HTMLButtonElement)){e.preventDefault(),j(o+a);return}let s=n instanceof HTMLInputElement&&n.dataset.option!==void 0?Number(n.dataset.option):-1;if(e.key===`Enter`&&s>=0){if(e.preventDefault(),k)T.length>0&&T.includes(s)?re(_,y):A(s);else{let e={..._,[o]:[s]},t={...y,[o]:``};v(e),b(t),re(e,t)}return}if(e.key===` `&&s>=0){e.preventDefault(),A(s);return}let c=Number(e.key);if(Number.isInteger(c)&&c>=1&&c<=w.options.length){e.preventDefault(),A(c-1),r.querySelector(`[data-option="${c-1}"]`)?.focus();return}e.key.toLowerCase()===`e`&&ee&&!e.ctrlKey&&!e.metaKey&&(e.preventDefault(),te(s>=0?s:x[o]??T[0]??0))}return(0,L.jsxs)(`form`,{ref:C,className:`flex flex-col gap-3`,onSubmit:ie,onKeyDown:ae,children:[(0,L.jsx)($Q,{questions:e,picks:_,own:y,index:o,onGo:s}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.length>1?`Question ${o+1} of ${e.length}`:`Question`}),(0,L.jsx)(XR,{text:w.question,className:`mt-1 text-base`})]}),(0,L.jsxs)(`div`,{className:q(`grid min-w-0 gap-4`,D?.preview||D?.image||D?.htmlPreview?`lg:grid-cols-[minmax(0,1.1fr)_minmax(0,1fr)]`:``),children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[w.options.map((e,t)=>(0,L.jsx)(YQ,{option:e,index:t,multi:k,name:`question-${o}`,selected:T.includes(t),onToggle:()=>A(t),onFocusOption:()=>S({...x,[o]:t})},t)),(0,L.jsxs)(`label`,{className:`flex min-h-9 flex-col gap-1 rounded-lg border border-input px-3 py-1.5 text-sm focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/30`,children:[(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:GQ}),(0,L.jsx)(OO,{"data-nav":``,value:E,onChange:e=>{b({...y,[o]:e.target.value}),e.target.value&&v({..._,[o]:[]})},placeholder:GQ,"aria-label":`Your own answer`,rows:2,className:`min-h-9 resize-none border-0 bg-transparent p-0 text-sm shadow-none focus-visible:ring-0 md:text-sm`})]})]}),(0,L.jsx)(XQ,{option:D,onExpand:()=>te(w.options.indexOf(D))})]}),(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{children:k?`Pick several`:`Pick one`}),(0,L.jsx)(lD,{chord:`↑↓`,children:`move`}),(0,L.jsx)(lD,{chord:k?`Space`:`Enter`,children:k?`pick`:`choose`}),k?(0,L.jsx)(lD,{chord:`Enter`,children:`next`}):null,e.length>1?(0,L.jsx)(lD,{chord:`←→`,children:`question`}):null,ee?(0,L.jsx)(lD,{chord:`E`,children:`expand mockups`}):null,(0,L.jsx)(lD,{chord:`Esc`,children:`later`})]}),(0,L.jsx)(ZQ,{primary:`submit`,primaryLabel:o<e.length-1?`Next`:`Answer`,disabled:!O,submitting:t,onCancel:r})]})}function t$(e,t,n){let r=e.currentTarget,i=e.target;if(e.altKey||XD(i))return;let a=ZD(e.key);if(a){e.preventDefault(),YD(r,i,a);return}let o=i instanceof HTMLInputElement&&i.dataset.option!==void 0?Number(i.dataset.option):-1;if((e.key===`Enter`||e.key===` `)&&o>=0){e.preventDefault(),n(o,e.key===`Enter`);return}let s=Number(e.key);Number.isInteger(s)&&s>=1&&s<=t&&(e.preventDefault(),n(s-1,!1),r.querySelector(`[data-option="${s-1}"]`)?.focus())}function n$({view:e,submitting:t,onAnswer:n,onCancel:r}){let[i,a]=(0,m.useState)(``),o=(0,m.useRef)(null);return(0,m.useEffect)(()=>{o.current?.querySelector(`[data-nav]`)?.focus()},[]),(0,L.jsxs)(`form`,{ref:o,className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),i&&n(i)},onKeyDown:r=>t$(r,e.options.length,(r,i)=>{let o=e.options[r];o!==void 0&&(a(o),i&&!t&&n(o))}),children:[(0,L.jsx)(XR,{text:e.title,className:`text-base`}),(0,L.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.options.map((e,t)=>(0,L.jsx)(YQ,{option:{label:e},index:t,multi:!1,name:`choice`,selected:i===e,onToggle:()=>a(e)},e))}),(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,L.jsx)(lD,{chord:`↑↓`,children:`move`}),(0,L.jsx)(lD,{chord:`Enter`,children:`choose`}),(0,L.jsx)(lD,{chord:`Esc`,children:`later`})]}),(0,L.jsx)(ZQ,{primary:`submit`,primaryLabel:`Choose`,disabled:!i,submitting:t,onCancel:r})]})}function r$({view:e,submitting:t,onAnswer:n}){let r=(0,m.useRef)(null);(0,m.useEffect)(()=>r.current?.focus(),[]);function i(e){if(e.altKey||e.ctrlKey||e.metaKey||t)return;let r=e.key.toLowerCase();r===`y`?n(!0):r===`n`&&n(!1)}return(0,L.jsxs)(`div`,{ref:r,tabIndex:-1,"data-autofocus":``,onKeyDown:i,className:`flex flex-col gap-3 outline-none`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(XR,{text:e.question,className:`text-base`}),e.detail?(0,L.jsx)(XR,{text:e.detail,className:`mt-1 text-muted-foreground`}):null]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`p`,{className:`flex items-center gap-x-4 text-xs text-muted-foreground`,children:[(0,L.jsx)(lD,{chord:`Y`,children:`yes`}),(0,L.jsx)(lD,{chord:`N`,children:`no`}),(0,L.jsx)(lD,{chord:`Esc`,children:`later`})]}),(0,L.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(J,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n(!1),children:`No`}),(0,L.jsx)(J,{type:`button`,disabled:t,onClick:()=>n(!0),children:t?`Sending…`:`Yes`})]})]})]})}function i$({view:e,submitting:t,onAnswer:n,onCancel:r}){let[i,a]=(0,m.useState)(``);return(0,L.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),i.trim()&&n(i.trim())},children:[(0,L.jsx)(XR,{text:e.question,className:`text-base`}),(0,L.jsx)(OO,{autoFocus:!0,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},value:i,onChange:e=>a(e.target.value),placeholder:e.placeholder??GQ,"aria-label":e.question,rows:3,className:`min-h-9 resize-none text-sm md:text-sm`}),(0,L.jsxs)(`p`,{className:`flex items-center gap-x-4 text-xs text-muted-foreground`,children:[(0,L.jsx)(lD,{chord:`Enter`,children:`answer`}),(0,L.jsx)(lD,{chord:`Shift+Enter`,children:`new line`}),(0,L.jsx)(lD,{chord:`Esc`,children:`later`})]}),(0,L.jsx)(ZQ,{primary:`submit`,primaryLabel:`Answer`,disabled:!i.trim(),submitting:t,onCancel:r})]})}function a$({dialog:e,submitting:t,onAnswer:n}){let[r,i]=(0,m.useState)(e.method===`editor`?e.prefill??``:``),[a,o]=(0,m.useState)(``),s=e.options??[],c=e.method===`select`?a!==``:r.trim()!==``,l=(0,m.useRef)(null);(0,m.useEffect)(()=>{l.current?.querySelector(`[data-nav], textarea`)?.focus()},[]);function u(t){t.preventDefault(),e.method===`select`?n({value:a}):e.method===`confirm`?n({confirmed:!0}):(e.method===`input`||e.method===`editor`)&&n({value:r.trim()})}return(0,L.jsxs)(`form`,{ref:l,className:`flex flex-col gap-3`,onSubmit:u,onKeyDown:r=>{e.method===`select`&&t$(r,s.length,(e,r)=>{let i=s[e];i!==void 0&&(o(i),r&&!t&&n({value:i}))})},children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.title}),e.message?(0,L.jsx)(XR,{text:e.message,className:`mt-1 text-base`}):null]}),e.method===`select`?(0,L.jsx)(`div`,{className:`flex flex-col gap-2`,children:s.map((e,t)=>(0,L.jsx)(YQ,{option:{label:e},index:t,multi:!1,name:`dialog`,selected:a===e,onToggle:()=>o(e)},e))}):null,e.method===`input`||e.method===`editor`?(0,L.jsx)(OO,{value:r,onChange:e=>i(e.target.value),placeholder:e.placeholder??GQ,"aria-label":e.title,rows:e.method===`editor`?4:2,className:`min-h-9 resize-none text-sm md:text-sm`}):null,(0,L.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,L.jsx)(J,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n({cancelled:!0}),children:`Cancel`}),e.method===`confirm`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(J,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n({confirmed:!1}),children:`No`}),(0,L.jsx)(J,{type:`button`,disabled:t,onClick:()=>n({confirmed:!0}),children:t?`Sending…`:`Yes`})]}):(0,L.jsx)(J,{type:`submit`,disabled:!c||t,children:t?`Sending…`:`Answer`})]})]})}function o$(e){let{view:t}=e;return t.kind===`questionnaire`?(0,L.jsx)(e$,{questions:t.questions,submitting:e.submitting,onAnswer:e.onAnswer,onCancel:e.onCancel,...e.onExpand?{expanded:e.expanded??!1,onExpand:e.onExpand}:{}}):t.kind===`choose`?(0,L.jsx)(n$,{...e,view:t}):t.kind===`confirm`?(0,L.jsx)(r$,{...e,view:t}):t.kind===`text`?(0,L.jsx)(i$,{...e,view:t}):(0,L.jsx)(a$,{...e,dialog:t.dialog})}function s$(e){return typeof e==`object`&&e?e:{}}function c$(e){return typeof e==`string`?e.trim():``}function l$(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function u$(e){let t=s$(e),n=c$(t.label);if(!n)return;let r=c$(t.description),i=c$(t.preview),a=c$(t.image),o=YK(t.htmlPreview);return{label:n,...r?{description:r}:{},...i?{preview:i}:{},...a?{image:a}:{},...o?{htmlPreview:o}:{}}}function d$(e){let t=s$(e),n=c$(t.question);if(!n)return;let r=(Array.isArray(t.options)?t.options:[]).map(u$).filter(e=>!!e);return{question:n,header:c$(t.header)||`Question`,options:r,...t.multiSelect===!0?{multiSelect:!0}:{}}}function f$(e){let t=s$(e),n=c$(t.method);if(n!==`select`&&n!==`confirm`&&n!==`input`&&n!==`editor`)return;let r=c$(t.message),i=l$(t.options),a=c$(t.placeholder),o=c$(t.prefill);return{id:c$(t.id),method:n,title:c$(t.title)||`Answer`,...r?{message:r}:{},...i.length>0?{options:i}:{},...a?{placeholder:a}:{},...o?{prefill:o}:{}}}function p$(e){let t=(Array.isArray(e.questions)?e.questions:[]).map(d$).filter(e=>!!e);return t.length>0?{kind:`questionnaire`,questions:t}:void 0}function m$(e){return{kind:`choose`,title:c$(e.title)||`Choose an option`,options:l$(e.options)}}function h$(e){let t=c$(e.question)||c$(e.title)||`Continue?`,n=c$(e.detail)||c$(e.message);return{kind:`confirm`,question:t,...n?{detail:n}:{}}}function g$(e){let t=c$(e.question)||c$(e.title)||`Type an answer`,n=c$(e.placeholder);return{kind:`text`,question:t,...n?{placeholder:n}:{}}}function _$(e){let t=s$(e.payload);if(e.kind===`questionnaire`)return p$(t);if(e.kind===`choose`)return m$(t);if(e.kind===`confirm`)return h$(t);if(e.kind===`text`)return g$(t);let n=f$(t.dialog);return n?{kind:`sessionDialog`,dialog:n}:void 0}function v$({submitting:e,onKeep:t,onLeave:n}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-4`,role:`alert`,children:[(0,L.jsx)(`p`,{className:`text-sm`,children:`Leave without answering? The oracle will not guess for you.`}),(0,L.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,L.jsx)(J,{type:`button`,variant:`outline`,onClick:t,children:`Keep answering`}),(0,L.jsx)(J,{type:`button`,disabled:e,onClick:n,children:e?`Leaving…`:`Leave`})]})]})}function y$({count:e,onOpen:t}){return(0,L.jsxs)(J,{type:`button`,variant:`soft`,onClick:t,"aria-label":`${e} question${e===1?``:`s`} waiting — open`,className:`gap-1.5 text-warning`,children:[(0,L.jsx)(Jp,{"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`tabular-nums`,children:e}),(0,L.jsx)(`span`,{className:`hidden sm:inline`,children:`waiting`})]})}function b$({prompts:e,answer:t,dismiss:n,minimized:r,onMinimize:i}){let[a,o]=(0,m.useState)(!1),[s,c]=(0,m.useState)(!1),[l,u]=(0,m.useState)(!1),d=e.length,f=e[0],p=f?_$(f):void 0,h=d>0&&!r,g=vD(h,_D.question);(0,m.useEffect)(()=>{d===0&&(o(!1),i(!1))},[d,i]);let _=f?.id;(0,m.useEffect)(()=>u(!1),[_]);async function v(e,t){c(!0);try{await e,o(!1)}catch(e){e instanceof Wf&&e.code===`question_withdrawn`?V(SD):V.error(e instanceof Error?e.message:t)}finally{c(!1)}}let y=f?.from?`${f.from} asks`:`A question`;return(0,L.jsx)(uD,{open:h&&g&&!!f,label:`Question from the lobby`,dismissOnBackdrop:!1,onOpenChange:e=>{e||(l?u(!1):a?o(!1):i(!0))},className:q(`max-w-3xl`,l&&`h-[min(92svh,60rem)] max-h-[min(92svh,60rem)] max-w-6xl`),children:f?(0,L.jsxs)(`section`,{"aria-label":`Question from the lobby`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,L.jsxs)(`header`,{className:q(`flex items-center gap-3 px-6 pt-5 pb-3`,l&&`hidden`),children:[(0,L.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-muted-foreground first-letter:uppercase`,children:[y,d>1?` · 1 of ${d}`:``]}),(0,L.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Later: put the question away`,title:`Later · Esc`,onClick:()=>i(!0),children:(0,L.jsx)(bg,{"aria-hidden":`true`})})]}),(0,L.jsx)(`div`,{className:l?`flex min-h-0 flex-1 flex-col`:`min-h-0 flex-1 overflow-y-auto px-6 pb-6`,children:p?a?(0,L.jsx)(v$,{submitting:s,onKeep:()=>o(!1),onLeave:()=>void v(n(f.id),`Could not leave the question`)}):(0,L.jsx)(o$,{view:p,submitting:s,onAnswer:e=>void v(t(f.id,e),`Could not send the answer`),onCancel:()=>o(!0),expanded:l,onExpand:u},f.id):(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This question cannot be shown here.`}),(0,L.jsx)(J,{type:`button`,disabled:s,onClick:()=>void v(n(f.id),`Could not dismiss the question`),children:`Dismiss`})]})})]}):null})}var x$=2;function S$(e){let t=globalThis.EventSource;if(!t)throw Error(`EventSource is not available in this environment`);return new t(e)}function C$(e){try{return JSON.parse(e)}catch{return}}function w$(e,t){switch(e.type){case`hello`:t.onHello?.(e.versions);return;case`changed`:t.onChanged?.(e.topic,e.version);return;case`feed`:t.onFeed?.({activity:e.activity,thoughts:e.thoughts,chat:e.chat});return;case`reply`:t.onReply?.(e.text);return;case`notice`:t.onNotice?.(e.text,e.level)}}function T$(e,t=S$){let n=t(Hf(`/api/events`));return e.onConnection?.(`connecting`),n.onopen=()=>e.onConnection?.(`live`),n.onerror=()=>e.onConnection?.(n.readyState===x$?`offline`:`connecting`),n.onmessage=t=>{let n=C$(t.data);n&&w$(n,e)},()=>n.close()}function E$(){let e=(0,m.useRef)(void 0),t=(0,m.useCallback)(()=>{e.current?.();try{Vf()}catch{Of.onStatus({connection:`offline`});return}e.current=T$({onHello:e=>Of.onHello(e),onChanged:(e,t)=>Of.onChanged(e,t),onFeed:e=>Of.onFeedDelta(e),onReply:e=>Of.onReplyDelta(e),onNotice:(e,t)=>V[t](e),onConnection:e=>Of.onStatus({connection:e})})},[]);return(0,m.useEffect)(()=>(t(),()=>e.current?.()),[t]),t}function D$(){let e=VD(`prompts`),t=(0,m.useCallback)(async(e,t)=>{await Kf(`prompts.answer`,{id:e,answer:t})},[]),n=(0,m.useCallback)(async e=>{await Kf(`prompts.dismiss`,{id:e})},[]);return{prompts:e.data?.prompts??[],loading:e.loading,error:e.error,answer:t,dismiss:n}}function O$(e,t,n,r){e===`search`?(document.querySelector(`#main input[type='search']`)??document.getElementById(`composer-text`))?.focus():e===`help`?n():e===`settings`?DD(`#/settings`):e===`sessions`?DD(`#/sessions`):e===`thinking`?CH(`lobby.thinking`):e===`activity`?t.kind===`tab`&&t.tab===`lobby`?CH(`lobby.activity`):DD(ED(`lobby`)):e===`nextTab`?r(1):e===`prevTab`?r(-1):e===`savePlan`&&t.kind===`tab`&&t.tab===`plan`&&H(`planner.save`,{})}function k$({connection:e,onRetry:t}){return e===`offline`?(0,L.jsx)(RD,{onRetry:t}):null}var A$={tick:0,route:0,focus:0};window.addEventListener(`hashchange`,()=>{A$.route=++A$.tick}),document.addEventListener(`focusin`,()=>{A$.focus=++A$.tick});var j$=()=>A$.focus>A$.route;function M$(e){return e.kind===`tab`?e.tab:e.kind}function N$(){let e=OD(),t=VD(`status`),n=VD(`lobby`),{prompts:r,answer:i,dismiss:a}=D$(),{connection:o,signedOut:s}=BD(),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),f=(0,m.useRef)(null),p=E$();WW();let h=t.data,g=h?.tabs??[],_=h?.keys??[],v=e.kind===`tab`?e.tab:void 0,y=(0,m.useCallback)(e=>DD(ED(e)),[]),b=(0,m.useCallback)(e=>{if(g.length===0)return;let t=Math.max(0,g.findIndex(e=>e.id===v)),n=g[(t+e+g.length)%g.length];n&&DD(ED(n.id))},[g,v]),x=(0,m.useCallback)(()=>l(e=>!e),[]),S=(0,m.useCallback)(t=>{(t!==`thinking`&&t!==`activity`||h?.panels?.[t]!==!1)&&O$(t,TD(window.location.hash)??e,x,b)},[e,x,b,h?.panels]),C=(0,m.useCallback)(()=>{let e=document.activeElement;return!e||e===document.body||f.current?.contains(e)===!0||e.closest(`.thinking-bubble`)?!0:e.closest(`[data-state='closed']`)!==null},[]);PX({enabled:!!h,keys:_,tabs:g,insideApp:C,onAction:S,onTab:y});let w=(0,m.useCallback)(()=>Of.onHello({}),[]),T=e.kind===`tab`?e.tab:e.kind,E=!!h;(0,m.useEffect)(()=>{if(!E)return;let e=oO.active&&oO.to===T;if(oO.active=!1,oO.to=void 0,e)return;let t=requestAnimationFrame(()=>{if(j$()||document.querySelector(`[role='dialog']:not([data-state='closed'])`))return;let e=document.getElementById(`composer-text`),t=typeof matchMedia==`function`&&matchMedia(`(pointer: coarse)`).matches;e&&!e.disabled&&!t?e.focus({preventScroll:!0}):document.activeElement?.id!==`composer-text`&&document.getElementById(`main`)?.focus({preventScroll:!0})});return()=>cancelAnimationFrame(t)},[T,E]);let D=Object.fromEntries(_.map(e=>[e.action,e.label])),O=(0,L.jsx)(CZ,{status:h,task:n.data?.task,connection:o,route:e,keys:D,onHelp:x,tabs:(0,L.jsx)(lQ,{tabs:g,activeId:v,onSelect:y}),extra:u&&r.length>0?(0,L.jsx)(y$,{count:r.length,onOpen:()=>d(!1)}):null});return s||!h?(0,L.jsxs)(`div`,{ref:f,className:`fixed inset-0 flex flex-col`,children:[O,(0,L.jsx)(`main`,{className:`surface mx-3 mb-3 flex min-h-0 flex-1 flex-col overflow-y-auto max-sm:mx-0 max-sm:mb-0`,children:s?(0,L.jsx)(TZ,{}):t.error?(0,L.jsx)(LD,{message:t.error,onRetry:w}):(0,L.jsx)(ID,{})})]}):(0,L.jsxs)(`div`,{ref:f,className:`fixed inset-0 flex flex-col`,children:[O,(0,L.jsx)(k$,{connection:o,onRetry:p}),(0,L.jsx)(`main`,{id:`main`,tabIndex:-1,onKeyDown:e=>{e.key!==`Escape`||e.defaultPrevented||XD(e.target)||e.target.closest(`[role='dialog'], [role='menu'], [role='listbox']`)||aO()&&e.preventDefault()},role:v?`tabpanel`:void 0,"aria-labelledby":v?`tab-${v}`:void 0,className:`surface mx-3 mb-3 flex min-h-0 flex-1 flex-col overflow-y-auto outline-none max-sm:mx-0 max-sm:mb-0`,children:(0,L.jsx)(B.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.18,ease:[.2,.8,.2,1]},className:`flex min-h-0 flex-1 flex-col`,children:xX(e)},M$(e))}),(0,L.jsx)(aZ,{route:e,keys:D,onHelp:x}),(0,L.jsx)(HQ,{status:h,lobby:n.data}),(0,L.jsx)(b$,{prompts:r,answer:i,dismiss:a,minimized:u,onMinimize:d}),(0,L.jsx)(GX,{open:c,onOpenChange:l,keys:_,tabs:g})]})}async function P$(e){switch(e){case`status`:return Kf(`status.get`,{});case`lobby`:return Kf(`lobby.snapshot`,{});case`prompts`:return Kf(`prompts.list`,{});default:return}}var F$=[`status`,`lobby`,`prompts`];function I$(){let[e,t]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{let e=!0;return(async()=>{await Jf(),e&&(Of.markUsed(F$,P$),t(!0))})(),()=>{e=!1}},[]),e}function L$(){return I$()?(0,L.jsx)(N$,{}):(0,L.jsx)(`div`,{className:`fixed inset-0 flex`,children:(0,L.jsx)(ID,{})})}var R$={info:Em,success:Hp,warning:og,error:Qp},z$={info:`text-primary`,success:`text-success`,warning:`text-warning`,error:`text-destructive`};function B$(){let{item:e,waiting:t}=Rf(),n=bD(),r=e&&!n;return(0,m.useEffect)(()=>{if(!e||n)return;let r=window.setTimeout(()=>If(e.id),t>0?Math.min(e.duration,1600):e.duration);return()=>window.clearTimeout(r)},[e,n,t]),(0,L.jsx)(`div`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`pointer-events-none fixed inset-x-0 z-40 flex justify-center px-4`,style:{bottom:`calc(var(--composer-h, 0px) + 0.25rem)`},children:(0,L.jsx)(tu,{mode:`wait`,children:r?(0,L.jsxs)(B.div,{initial:{opacity:0,scale:.55,y:18},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.92,y:6,transition:{duration:.14,ease:`easeIn`}},transition:{type:`spring`,stiffness:560,damping:15,mass:.8},className:`pointer-events-auto flex max-w-[min(32rem,100%)] items-center gap-3 rounded-xl border border-glass-border bg-popover/80 px-4 py-2.5 text-sm text-popover-foreground shadow-glass backdrop-blur-xs`,children:[(0,L.jsx)(V$,{kind:e.kind}),(0,L.jsx)(`span`,{className:`min-w-0 break-words`,children:e.message}),e.action?(0,L.jsx)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,className:`btn-raised -my-1.5 -mr-1 h-7 shrink-0 rounded-lg border bg-card px-2.5 font-medium text-primary transition-[box-shadow,translate] active:translate-y-px focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:outline-none`,onClick:()=>{e.action?.onClick(),If(e.id)},children:e.action.label}):null]},e.id):null})})}function V$({kind:e}){let t=R$[e];return(0,L.jsx)(t,{"aria-hidden":`true`,className:q(`size-5 shrink-0`,z$[e])})}(0,Cf.createRoot)(document.getElementById(`root`)).render((0,L.jsx)(m.StrictMode,{children:(0,L.jsx)(DG,{children:(0,L.jsx)(cu,{reducedMotion:`user`,children:(0,L.jsxs)(WD,{children:[(0,L.jsx)(L$,{}),(0,L.jsx)(B$,{})]})})})})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`,{updateViaCache:`none`}).catch(()=>void 0)});
|
|
108
|
+
`)});else for(let e of t)for(let t of ZQ(e))i.push({text:t})}return i}var $Q=4,e$=1800,t$=e=>({"--orb":e});function n$(e){let[t,n]=(0,m.useState)(0),r=e.join(`|`);return(0,m.useEffect)(()=>{if(n(0),e.length<2)return;let t=window.setInterval(()=>n(e=>e+1),e$);return()=>window.clearInterval(t)},[r,e.length]),e.length?e[t%e.length]:void 0}function r$({thought:e}){let t=(0,m.useMemo)(()=>QQ(e.text),[e.text]),[n,r]=(0,m.useState)(!1),i=n?0:Math.max(0,t.length-$Q),a=t.slice(i),o=iV(e.source);return(0,L.jsxs)(`li`,{className:`thought`,style:t$(sV(e.source)),"data-live":e.live||void 0,"aria-label":`${o}${e.live?`, thinking`:``}`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(`span`,{className:`thought-label`,children:[(0,L.jsx)(nV,{source:e.source,strokeWidth:2.25,className:`size-3.5`}),o]}),(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.live?(0,L.jsxs)(`span`,{className:`thought-live`,children:[`thinking`,(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`thought-ellipsis`})]}):NO(Date.now()-e.at)}),t.length>1?(0,L.jsxs)(`span`,{className:`ml-auto text-xs text-muted-foreground tabular-nums`,children:[t.length,` steps`]}):null]}),i?(0,L.jsxs)(`button`,{type:`button`,"data-compact":!0,className:`thought-more`,onClick:()=>r(!0),children:[i,` earlier `,i===1?`step`:`steps`]}):null,(0,L.jsx)(`ol`,{className:`thought-steps`,"data-single":a.length===1||void 0,children:a.map((t,n)=>(0,L.jsxs)(`li`,{"data-current":e.live&&n===a.length-1||void 0,children:[t.title?(0,L.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:t.title}):null,t.text?(0,L.jsx)(dz,{text:t.text,className:`thought-text`}):null]},i+n))})]})}function i$(e,t,n){(0,m.useEffect)(()=>{if(!e||!t)return;let r=e=>{e.defaultPrevented||e.isComposing||!KX(e,t)||e.target?.closest(`input, textarea, [contenteditable='true']`)||(e.preventDefault(),n())};return window.addEventListener(`keydown`,r),()=>window.removeEventListener(`keydown`,r)},[e,t,n])}function a$(e){return[...e].sort((e,t)=>Number(t.live)-Number(e.live)||t.at-e.at||t.id-e.id)}function o$({thoughts:e,collapsed:t,onToggle:n,shortcut:r,busy:i=[]}){let a=a$(uV(e)),o=a.filter(e=>e.live).map(e=>e.source),s=n$(o),c=s?sV(s):i.length?`var(--primary)`:`var(--orb-idle)`,l=s?`thinking`:i.length?`busy`:void 0,u=(0,m.useRef)(null),d=(0,m.useRef)(t);d.current=t,(0,m.useEffect)(()=>()=>{d.current||n()},[n]);let f=vD(!t,_D.sheet),p=bD();i$(f,r,n);let h=a.length>0||i.length>0;return(0,L.jsxs)(L.Fragment,{children:[h&&(0,bv.createPortal)((0,L.jsx)(WQ,{ref:u,spotlight:s,thinking:o,busy:i,tone:c,expanded:!t,hidden:p,shortcut:r,onOpen:n}),document.body),(0,L.jsxs)(uD,{open:f,onOpenChange:e=>{!e&&!t&&n()},label:`Thinking`,className:q(`thought-pane max-w-xl`,l&&`thought-pane-live`),style:t$(c),onCloseAutoFocus:e=>{e.preventDefault(),requestAnimationFrame(()=>{document.querySelector(`[role='dialog']`)||u.current?.focus()})},children:[(0,L.jsx)(`div`,{"aria-hidden":`true`,className:`thought-aura`,"data-working":l}),(0,L.jsx)(`div`,{className:`relative min-h-0 overflow-y-auto p-3 outline-none sm:p-4`,role:`log`,"aria-label":`Latest thoughts`,tabIndex:0,children:a.length?(0,L.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:a.map(e=>(0,L.jsx)(r$,{thought:e},e.id))}):(0,L.jsx)(`p`,{className:`px-2 py-6 text-center text-sm text-muted-foreground`,children:`Thoughts from the oracle and every agent appear here, and only here.`})})]})]})}function s$({status:e,lobby:t}){let[n,r]=zH(`lobby.thinking`),i=UD(`sessions.list`,{},[`sessions`]);if(!e||e.panels?.thinking===!1)return null;let a=kQ({oracleBusy:e.busy,runs:lV(t),activity:t?.activity??[],background:i.data?.background??[]}),o=e.keys.find(e=>e.action===`thinking`)?.label;return(0,L.jsx)(o$,{thoughts:t?.thoughts??[],collapsed:n,onToggle:r,shortcut:o,busy:a})}var c$=/\s*\(recommended\)\s*$/i,l$=1200,u$=`Type something.`;function d$(e){return{text:e.replace(c$,``),recommended:c$.test(e)}}function f$({label:e}){let{text:t,recommended:n}=d$(e);return(0,L.jsxs)(`span`,{className:`leading-snug`,children:[t,n?(0,L.jsx)(`span`,{className:`ms-1 font-medium text-primary`,children:`(Recommended)`}):null]})}function p$({multi:e,on:t}){return(0,L.jsxs)(`span`,{"aria-hidden":`true`,className:q(`relative mt-0.5 flex size-4 shrink-0 items-center justify-center border`,e?`rounded-lg`:`rounded-full`,t?`border-primary bg-primary text-primary-foreground`:`border-input`),children:[t?(0,L.jsx)(Op,{className:q(e?`size-3`:`hidden`)}):null,t&&!e?(0,L.jsx)(`span`,{className:`size-2 rounded-full bg-primary-foreground`}):null]})}function m$({option:e,index:t,multi:n,name:r,selected:i,onToggle:a,onFocusOption:o}){return(0,L.jsxs)(`div`,{className:`grid gap-1`,children:[(0,L.jsxs)(`label`,{className:q(`flex min-h-9 cursor-pointer items-start gap-2.5 rounded-lg border px-3 py-2 text-start text-sm transition-[background-color,border-color,transform] duration-150 ease-snap active:scale-[0.99]`,i?`border-primary/50 bg-accent`:`border-input bg-background hover:bg-accent/60`,`has-[:focus-visible]:border-ring has-[:focus-visible]:ring-3 has-[:focus-visible]:ring-ring/30`),children:[(0,L.jsx)(`input`,{type:n?`checkbox`:`radio`,name:r,"data-nav":``,"data-option":t,className:`sr-only`,checked:i,onChange:a,onFocus:o}),(0,L.jsx)(p$,{multi:n,on:i}),(0,L.jsx)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:(0,L.jsxs)(`span`,{className:`flex gap-1.5`,children:[(0,L.jsxs)(`span`,{"aria-hidden":`true`,className:`text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,L.jsx)(f$,{label:e.label})]})})]}),e.description?(0,L.jsx)(dz,{text:e.description,className:`px-3 text-muted-foreground`}):null]})}function h$({option:e,onExpand:t}){return!e||!yq(e)?null:(0,L.jsxs)(`div`,{className:`card-raised flex flex-col gap-2 rounded-lg border p-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`p`,{className:`min-w-0 truncate text-xs font-medium text-muted-foreground`,children:[`Preview · `,d$(e.label).text]}),(0,L.jsxs)(J,{type:`button`,variant:`ghost`,size:`xs`,onClick:t,"aria-keyshortcuts":`E`,title:`Expand · E`,className:`-my-1 shrink-0`,children:[(0,L.jsx)(Bm,{"aria-hidden":`true`}),`Expand`]})]}),e.image?(0,L.jsx)(`img`,{src:Uf(e.image),alt:``,loading:`lazy`,className:`max-h-64 w-full rounded-lg border object-contain`}):null,e.htmlPreview?(0,L.jsx)(hq,{preview:e.htmlPreview,label:d$(e.label).text,frameWidth:l$,onOpen:t,className:`h-auto aspect-[3/2]`}):null,e.preview?(0,L.jsx)(dz,{text:e.preview,className:`text-xs`}):null]})}function g$({primary:e,primaryLabel:t,disabled:n,submitting:r,onCancel:i}){return(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(J,{type:`button`,variant:`ghost`,onClick:i,children:`Cancel`}),(0,L.jsx)(J,{type:e,disabled:n||r,children:r?`Sending…`:t})]})}function _$(e,t,n,r){let i=e[r];if(!i)return;let a=n[r]?.trim();if(a)return{questionIndex:r,question:i.question,kind:`custom`,answer:a};let o=(t[r]??[]).map(e=>i.options[e]?.label).filter(e=>!!e);if(o.length!==0)return i.multiSelect?{questionIndex:r,question:i.question,kind:`multi`,answer:o.join(`, `),selected:o}:{questionIndex:r,question:i.question,kind:`option`,answer:o[0]??null}}function v$({questions:e,picks:t,own:n,index:r,onGo:i}){return e.length===1?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e[0]?.header}):(0,L.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:e.map((e,a)=>{let o=!!n[a]?.trim()||(t[a]?.length??0)>0;return(0,L.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-description":`When focused, press Enter or Space to open this question.`,type:`button`,onClick:()=>i(a),"aria-current":a===r,className:q(`inline-flex min-h-8 items-center gap-1 rounded-lg border px-3 text-xs font-medium transition-colors`,a===r?`border-primary bg-primary/10 text-primary`:`border-border text-muted-foreground hover:bg-muted`),children:[a+1,` `,e.header,o?(0,L.jsx)(Op,{className:`size-3`,"aria-hidden":`true`}):null]},a)})})}function y$({questions:e,submitting:t,onAnswer:n,onCancel:r,expanded:i,onExpand:a}){let[o,s]=(0,m.useState)(0),[c,l]=(0,m.useState)(!1),u=i??c,d=e=>a?a(e):l(e),[f,p]=(0,m.useState)(0),h=(0,m.useRef)(0),g=(0,m.useRef)(!1),[_,v]=(0,m.useState)({}),[y,b]=(0,m.useState)({}),[x,S]=(0,m.useState)({}),C=(0,m.useRef)(null),w=e[o],T=_[o]??[],E=y[o]??``,D=w?.options[x[o]??T[0]??0],O=_$(e,_,y,o),k=w?.multiSelect===!0;if((0,m.useEffect)(()=>{let e=C.current;e&&(e.querySelector(`[data-option="${_[o]?.[0]??0}"]`)??e.querySelector(`[data-nav]`))?.focus()},[o]),(0,m.useEffect)(()=>{let e=g.current&&!u;g.current=u,e&&(S(e=>({...e,[o]:h.current})),C.current?.querySelector(`[data-option="${h.current}"]`)?.focus())},[u]),!w)return null;let ee=w.options.some(yq);function te(e){p(Math.max(0,e)),h.current=Math.max(0,e),d(!0)}function ne(e){h.current=e,d(!1)}if(u&&ee)return(0,L.jsx)(xq,{options:w.options,start:f,title:w.header||w.question,picked:T,multi:k,onChoose:e=>{A(e),k||ne(e)},onClose:ne,onIndex:e=>{h.current=e}},o);function A(e){let t=k?T.includes(e)?T.filter(t=>t!==e):[...T,e]:[e];v({..._,[o]:t}),k||b({...y,[o]:``}),S({...x,[o]:e})}function re(t,r){if(_$(e,t,r,o)){if(o<e.length-1){s(o+1);return}n({answers:e.map((n,i)=>_$(e,t,r,i)).filter(e=>!!e),cancelled:!1})}}function ie(e){e.preventDefault(),t||re(_,y)}function j(t){t>=0&&t<e.length&&s(t)}function ae(e){let n=e.target,r=C.current;if(!r||e.altKey)return;if(e.key===`Enter`&&(e.ctrlKey||e.metaKey)){e.preventDefault(),t||re(_,y);return}if(n instanceof HTMLTextAreaElement){e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing?(e.preventDefault(),t||re(_,y)):e.key===`ArrowUp`&&n.selectionStart===0&&n.selectionEnd===0&&(e.preventDefault(),YD(r,n,-1));return}let i=ZD(e.key);if(i){e.preventDefault(),YD(r,n,i);return}if(e.key===`Home`||e.key===`End`){e.preventDefault(),YD(r,n,e.key===`Home`?`first`:`last`);return}let a=QD(e.key);if(a&&!(n instanceof HTMLButtonElement)){e.preventDefault(),j(o+a);return}let s=n instanceof HTMLInputElement&&n.dataset.option!==void 0?Number(n.dataset.option):-1;if(e.key===`Enter`&&s>=0){if(e.preventDefault(),k)T.length>0&&T.includes(s)?re(_,y):A(s);else{let e={..._,[o]:[s]},t={...y,[o]:``};v(e),b(t),re(e,t)}return}if(e.key===` `&&s>=0){e.preventDefault(),A(s);return}let c=Number(e.key);if(Number.isInteger(c)&&c>=1&&c<=w.options.length){e.preventDefault(),A(c-1),r.querySelector(`[data-option="${c-1}"]`)?.focus();return}e.key.toLowerCase()===`e`&&ee&&!e.ctrlKey&&!e.metaKey&&(e.preventDefault(),te(s>=0?s:x[o]??T[0]??0))}return(0,L.jsxs)(`form`,{ref:C,className:`flex flex-col gap-3`,onSubmit:ie,onKeyDown:ae,children:[(0,L.jsx)(v$,{questions:e,picks:_,own:y,index:o,onGo:s}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.length>1?`Question ${o+1} of ${e.length}`:`Question`}),(0,L.jsx)(dz,{text:w.question,className:`mt-1 text-base`})]}),(0,L.jsxs)(`div`,{className:q(`grid min-w-0 gap-4`,D?.preview||D?.image||D?.htmlPreview?`lg:grid-cols-[minmax(0,1.1fr)_minmax(0,1fr)]`:``),children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[w.options.map((e,t)=>(0,L.jsx)(m$,{option:e,index:t,multi:k,name:`question-${o}`,selected:T.includes(t),onToggle:()=>A(t),onFocusOption:()=>S({...x,[o]:t})},t)),(0,L.jsxs)(`label`,{className:`flex min-h-9 flex-col gap-1 rounded-lg border border-input px-3 py-1.5 text-sm focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/30`,children:[(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:u$}),(0,L.jsx)(OO,{"data-nav":``,value:E,onChange:e=>{b({...y,[o]:e.target.value}),e.target.value&&v({..._,[o]:[]})},placeholder:u$,"aria-label":`Your own answer`,rows:2,className:`min-h-9 resize-none border-0 bg-transparent p-0 text-sm shadow-none focus-visible:ring-0 md:text-sm`})]})]}),(0,L.jsx)(h$,{option:D,onExpand:()=>te(w.options.indexOf(D))})]}),(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{children:k?`Pick several`:`Pick one`}),(0,L.jsx)(lD,{chord:`↑↓`,children:`move`}),(0,L.jsx)(lD,{chord:k?`Space`:`Enter`,children:k?`pick`:`choose`}),k?(0,L.jsx)(lD,{chord:`Enter`,children:`next`}):null,e.length>1?(0,L.jsx)(lD,{chord:`←→`,children:`question`}):null,ee?(0,L.jsx)(lD,{chord:`E`,children:`expand mockups`}):null,(0,L.jsx)(lD,{chord:`Esc`,children:`later`})]}),(0,L.jsx)(g$,{primary:`submit`,primaryLabel:o<e.length-1?`Next`:`Answer`,disabled:!O,submitting:t,onCancel:r})]})}function b$(e,t,n){let r=e.currentTarget,i=e.target;if(e.altKey||XD(i))return;let a=ZD(e.key);if(a){e.preventDefault(),YD(r,i,a);return}let o=i instanceof HTMLInputElement&&i.dataset.option!==void 0?Number(i.dataset.option):-1;if((e.key===`Enter`||e.key===` `)&&o>=0){e.preventDefault(),n(o,e.key===`Enter`);return}let s=Number(e.key);Number.isInteger(s)&&s>=1&&s<=t&&(e.preventDefault(),n(s-1,!1),r.querySelector(`[data-option="${s-1}"]`)?.focus())}function x$({view:e,submitting:t,onAnswer:n,onCancel:r}){let[i,a]=(0,m.useState)(``),o=(0,m.useRef)(null);return(0,m.useEffect)(()=>{o.current?.querySelector(`[data-nav]`)?.focus()},[]),(0,L.jsxs)(`form`,{ref:o,className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),i&&n(i)},onKeyDown:r=>b$(r,e.options.length,(r,i)=>{let o=e.options[r];o!==void 0&&(a(o),i&&!t&&n(o))}),children:[(0,L.jsx)(dz,{text:e.title,className:`text-base`}),(0,L.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.options.map((e,t)=>(0,L.jsx)(m$,{option:{label:e},index:t,multi:!1,name:`choice`,selected:i===e,onToggle:()=>a(e)},e))}),(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,L.jsx)(lD,{chord:`↑↓`,children:`move`}),(0,L.jsx)(lD,{chord:`Enter`,children:`choose`}),(0,L.jsx)(lD,{chord:`Esc`,children:`later`})]}),(0,L.jsx)(g$,{primary:`submit`,primaryLabel:`Choose`,disabled:!i,submitting:t,onCancel:r})]})}function S$({view:e,submitting:t,onAnswer:n}){let r=(0,m.useRef)(null);(0,m.useEffect)(()=>r.current?.focus(),[]);function i(e){if(e.altKey||e.ctrlKey||e.metaKey||t)return;let r=e.key.toLowerCase();r===`y`?n(!0):r===`n`&&n(!1)}return(0,L.jsxs)(`div`,{ref:r,tabIndex:-1,"data-autofocus":``,onKeyDown:i,className:`flex flex-col gap-3 outline-none`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(dz,{text:e.question,className:`text-base`}),e.detail?(0,L.jsx)(dz,{text:e.detail,className:`mt-1 text-muted-foreground`}):null]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`p`,{className:`flex items-center gap-x-4 text-xs text-muted-foreground`,children:[(0,L.jsx)(lD,{chord:`Y`,children:`yes`}),(0,L.jsx)(lD,{chord:`N`,children:`no`}),(0,L.jsx)(lD,{chord:`Esc`,children:`later`})]}),(0,L.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(J,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n(!1),children:`No`}),(0,L.jsx)(J,{type:`button`,disabled:t,onClick:()=>n(!0),children:t?`Sending…`:`Yes`})]})]})]})}function C$({view:e,submitting:t,onAnswer:n,onCancel:r}){let[i,a]=(0,m.useState)(``);return(0,L.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),i.trim()&&n(i.trim())},children:[(0,L.jsx)(dz,{text:e.question,className:`text-base`}),(0,L.jsx)(OO,{autoFocus:!0,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},value:i,onChange:e=>a(e.target.value),placeholder:e.placeholder??u$,"aria-label":e.question,rows:3,className:`min-h-9 resize-none text-sm md:text-sm`}),(0,L.jsxs)(`p`,{className:`flex items-center gap-x-4 text-xs text-muted-foreground`,children:[(0,L.jsx)(lD,{chord:`Enter`,children:`answer`}),(0,L.jsx)(lD,{chord:`Shift+Enter`,children:`new line`}),(0,L.jsx)(lD,{chord:`Esc`,children:`later`})]}),(0,L.jsx)(g$,{primary:`submit`,primaryLabel:`Answer`,disabled:!i.trim(),submitting:t,onCancel:r})]})}function w$({dialog:e,submitting:t,onAnswer:n}){let[r,i]=(0,m.useState)(e.method===`editor`?e.prefill??``:``),[a,o]=(0,m.useState)(``),s=e.options??[],c=e.method===`select`?a!==``:r.trim()!==``,l=(0,m.useRef)(null);(0,m.useEffect)(()=>{l.current?.querySelector(`[data-nav], textarea`)?.focus()},[]);function u(t){t.preventDefault(),e.method===`select`?n({value:a}):e.method===`confirm`?n({confirmed:!0}):(e.method===`input`||e.method===`editor`)&&n({value:r.trim()})}return(0,L.jsxs)(`form`,{ref:l,className:`flex flex-col gap-3`,onSubmit:u,onKeyDown:r=>{e.method===`select`&&b$(r,s.length,(e,r)=>{let i=s[e];i!==void 0&&(o(i),r&&!t&&n({value:i}))})},children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.title}),e.message?(0,L.jsx)(dz,{text:e.message,className:`mt-1 text-base`}):null]}),e.method===`select`?(0,L.jsx)(`div`,{className:`flex flex-col gap-2`,children:s.map((e,t)=>(0,L.jsx)(m$,{option:{label:e},index:t,multi:!1,name:`dialog`,selected:a===e,onToggle:()=>o(e)},e))}):null,e.method===`input`||e.method===`editor`?(0,L.jsx)(OO,{value:r,onChange:e=>i(e.target.value),placeholder:e.placeholder??u$,"aria-label":e.title,rows:e.method===`editor`?4:2,className:`min-h-9 resize-none text-sm md:text-sm`}):null,(0,L.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,L.jsx)(J,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n({cancelled:!0}),children:`Cancel`}),e.method===`confirm`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(J,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n({confirmed:!1}),children:`No`}),(0,L.jsx)(J,{type:`button`,disabled:t,onClick:()=>n({confirmed:!0}),children:t?`Sending…`:`Yes`})]}):(0,L.jsx)(J,{type:`submit`,disabled:!c||t,children:t?`Sending…`:`Answer`})]})]})}function T$(e){let{view:t}=e;return t.kind===`questionnaire`?(0,L.jsx)(y$,{questions:t.questions,submitting:e.submitting,onAnswer:e.onAnswer,onCancel:e.onCancel,...e.onExpand?{expanded:e.expanded??!1,onExpand:e.onExpand}:{}}):t.kind===`choose`?(0,L.jsx)(x$,{...e,view:t}):t.kind===`confirm`?(0,L.jsx)(S$,{...e,view:t}):t.kind===`text`?(0,L.jsx)(C$,{...e,view:t}):(0,L.jsx)(w$,{...e,dialog:t.dialog})}function E$(e){return typeof e==`object`&&e?e:{}}function D$(e){return typeof e==`string`?e.trim():``}function O$(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function k$(e){let t=E$(e),n=D$(t.label);if(!n)return;let r=D$(t.description),i=D$(t.preview),a=D$(t.image),o=uq(t.htmlPreview);return{label:n,...r?{description:r}:{},...i?{preview:i}:{},...a?{image:a}:{},...o?{htmlPreview:o}:{}}}function A$(e){let t=E$(e),n=D$(t.question);if(!n)return;let r=(Array.isArray(t.options)?t.options:[]).map(k$).filter(e=>!!e);return{question:n,header:D$(t.header)||`Question`,options:r,...t.multiSelect===!0?{multiSelect:!0}:{}}}function j$(e){let t=E$(e),n=D$(t.method);if(n!==`select`&&n!==`confirm`&&n!==`input`&&n!==`editor`)return;let r=D$(t.message),i=O$(t.options),a=D$(t.placeholder),o=D$(t.prefill);return{id:D$(t.id),method:n,title:D$(t.title)||`Answer`,...r?{message:r}:{},...i.length>0?{options:i}:{},...a?{placeholder:a}:{},...o?{prefill:o}:{}}}function M$(e){let t=(Array.isArray(e.questions)?e.questions:[]).map(A$).filter(e=>!!e);return t.length>0?{kind:`questionnaire`,questions:t}:void 0}function N$(e){return{kind:`choose`,title:D$(e.title)||`Choose an option`,options:O$(e.options)}}function P$(e){let t=D$(e.question)||D$(e.title)||`Continue?`,n=D$(e.detail)||D$(e.message);return{kind:`confirm`,question:t,...n?{detail:n}:{}}}function F$(e){let t=D$(e.question)||D$(e.title)||`Type an answer`,n=D$(e.placeholder);return{kind:`text`,question:t,...n?{placeholder:n}:{}}}function I$(e){let t=E$(e.payload);if(e.kind===`questionnaire`)return M$(t);if(e.kind===`choose`)return N$(t);if(e.kind===`confirm`)return P$(t);if(e.kind===`text`)return F$(t);let n=j$(t.dialog);return n?{kind:`sessionDialog`,dialog:n}:void 0}function L$({submitting:e,onKeep:t,onLeave:n}){return(0,L.jsxs)(`div`,{className:`flex flex-col gap-4`,role:`alert`,children:[(0,L.jsx)(`p`,{className:`text-sm`,children:`Leave without answering? The oracle will not guess for you.`}),(0,L.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,L.jsx)(J,{type:`button`,variant:`outline`,onClick:t,children:`Keep answering`}),(0,L.jsx)(J,{type:`button`,disabled:e,onClick:n,children:e?`Leaving…`:`Leave`})]})]})}function R$({count:e,onOpen:t}){return(0,L.jsxs)(J,{type:`button`,variant:`soft`,onClick:t,"aria-label":`${e} question${e===1?``:`s`} waiting — open`,className:`gap-1.5 text-warning`,children:[(0,L.jsx)(Jp,{"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`tabular-nums`,children:e}),(0,L.jsx)(`span`,{className:`hidden sm:inline`,children:`waiting`})]})}function z$({prompts:e,answer:t,dismiss:n,minimized:r,onMinimize:i}){let[a,o]=(0,m.useState)(!1),[s,c]=(0,m.useState)(!1),[l,u]=(0,m.useState)(!1),d=e.length,f=e[0],p=f?I$(f):void 0,h=d>0&&!r,g=vD(h,_D.question);(0,m.useEffect)(()=>{d===0&&(o(!1),i(!1))},[d,i]);let _=f?.id;(0,m.useEffect)(()=>u(!1),[_]);async function v(e,t){c(!0);try{await e,o(!1)}catch(e){e instanceof Gf&&e.code===`question_withdrawn`?B(SD):B.error(e instanceof Error?e.message:t)}finally{c(!1)}}let y=f?.from?`${f.from} asks`:`A question`;return(0,L.jsx)(uD,{open:h&&g&&!!f,label:`Question from the lobby`,dismissOnBackdrop:!1,onOpenChange:e=>{e||(l?u(!1):a?o(!1):i(!0))},className:q(`max-w-3xl`,l&&`h-[min(92svh,60rem)] max-h-[min(92svh,60rem)] max-w-6xl`),children:f?(0,L.jsxs)(`section`,{"aria-label":`Question from the lobby`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,L.jsxs)(`header`,{className:q(`flex items-center gap-3 px-6 pt-5 pb-3`,l&&`hidden`),children:[(0,L.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-muted-foreground first-letter:uppercase`,children:[y,d>1?` · 1 of ${d}`:``]}),(0,L.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Later: put the question away`,title:`Later · Esc`,onClick:()=>i(!0),children:(0,L.jsx)(bg,{"aria-hidden":`true`})})]}),(0,L.jsx)(`div`,{className:l?`flex min-h-0 flex-1 flex-col`:`min-h-0 flex-1 overflow-y-auto px-6 pb-6`,children:p?a?(0,L.jsx)(L$,{submitting:s,onKeep:()=>o(!1),onLeave:()=>void v(n(f.id),`Could not leave the question`)}):(0,L.jsx)(T$,{view:p,submitting:s,onAnswer:e=>void v(t(f.id,e),`Could not send the answer`),onCancel:()=>o(!0),expanded:l,onExpand:u},f.id):(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This question cannot be shown here.`}),(0,L.jsx)(J,{type:`button`,disabled:s,onClick:()=>void v(n(f.id),`Could not dismiss the question`),children:`Dismiss`})]})})]}):null})}var B$=2;function V$(e){let t=globalThis.EventSource;if(!t)throw Error(`EventSource is not available in this environment`);return new t(e)}function H$(e){try{return JSON.parse(e)}catch{return}}function U$(e,t){switch(e.type){case`hello`:t.onHello?.(e.versions);return;case`changed`:t.onChanged?.(e.topic,e.version);return;case`feed`:t.onFeed?.({activity:e.activity,thoughts:e.thoughts,chat:e.chat});return;case`reply`:t.onReply?.(e.text);return;case`notice`:t.onNotice?.(e.text,e.level)}}function W$(e,t=V$){let n=t(Uf(`/api/events`));return e.onConnection?.(`connecting`),n.onopen=()=>e.onConnection?.(`live`),n.onerror=()=>e.onConnection?.(n.readyState===B$?`offline`:`connecting`),n.onmessage=t=>{let n=H$(t.data);n&&U$(n,e)},()=>n.close()}function G$(){let e=(0,m.useRef)(void 0),t=(0,m.useCallback)(()=>{e.current?.();try{Hf()}catch{kf.onStatus({connection:`offline`});return}e.current=W$({onHello:e=>kf.onHello(e),onChanged:(e,t)=>kf.onChanged(e,t),onFeed:e=>kf.onFeedDelta(e),onReply:e=>kf.onReplyDelta(e),onNotice:(e,t)=>B[t](e),onConnection:e=>kf.onStatus({connection:e})})},[]);return(0,m.useEffect)(()=>(t(),()=>e.current?.()),[t]),t}function K$(){let e=VD(`prompts`),t=(0,m.useCallback)(async(e,t)=>{await qf(`prompts.answer`,{id:e,answer:t})},[]),n=(0,m.useCallback)(async e=>{await qf(`prompts.dismiss`,{id:e})},[]);return{prompts:e.data?.prompts??[],loading:e.loading,error:e.error,answer:t,dismiss:n}}function q$(e,t,n,r){e===`search`?(document.querySelector(`#main input[type='search']`)??document.getElementById(`composer-text`))?.focus():e===`help`?n():e===`settings`?DD(`#/settings`):e===`sessions`?DD(`#/sessions`):e===`thinking`?RH(`lobby.thinking`):e===`activity`?t.kind===`tab`&&t.tab===`lobby`?RH(`lobby.activity`):DD(ED(`lobby`)):e===`nextTab`?r(1):e===`prevTab`?r(-1):e===`savePlan`&&t.kind===`tab`&&t.tab===`plan`&&V(`planner.save`,{})}function J$({connection:e,onRetry:t}){return e===`offline`?(0,L.jsx)(RD,{onRetry:t}):null}var Y$={tick:0,route:0,focus:0};window.addEventListener(`hashchange`,()=>{Y$.route=++Y$.tick}),document.addEventListener(`focusin`,()=>{Y$.focus=++Y$.tick});var X$=()=>Y$.focus>Y$.route;function Z$(e){return e.kind===`tab`?e.tab:e.kind}function Q$(){let e=OD(),t=VD(`status`),n=VD(`lobby`),{prompts:r,answer:i,dismiss:a}=K$(),{connection:o,signedOut:s}=BD(),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),f=(0,m.useRef)(null),p=G$();aG();let h=t.data,g=h?.tabs??[],_=h?.keys??[],v=e.kind===`tab`?e.tab:void 0,y=(0,m.useCallback)(e=>DD(ED(e)),[]),b=(0,m.useCallback)(e=>{if(g.length===0)return;let t=Math.max(0,g.findIndex(e=>e.id===v)),n=g[(t+e+g.length)%g.length];n&&DD(ED(n.id))},[g,v]),x=(0,m.useCallback)(()=>l(e=>!e),[]),S=(0,m.useCallback)(t=>{(t!==`thinking`&&t!==`activity`||h?.panels?.[t]!==!1)&&q$(t,TD(window.location.hash)??e,x,b)},[e,x,b,h?.panels]),C=(0,m.useCallback)(()=>{let e=document.activeElement;return!e||e===document.body||f.current?.contains(e)===!0||e.closest(`.thinking-bubble`)?!0:e.closest(`[data-state='closed']`)!==null},[]);$X({enabled:!!h,keys:_,tabs:g,insideApp:C,onAction:S,onTab:y});let w=(0,m.useCallback)(()=>kf.onHello({}),[]),T=e.kind===`tab`?e.tab:e.kind,E=!!h;(0,m.useEffect)(()=>{if(!E)return;let e=oO.active&&oO.to===T;if(oO.active=!1,oO.to=void 0,e)return;let t=requestAnimationFrame(()=>{if(X$()||document.querySelector(`[role='dialog']:not([data-state='closed'])`))return;let e=document.getElementById(`composer-text`),t=typeof matchMedia==`function`&&matchMedia(`(pointer: coarse)`).matches;e&&!e.disabled&&!t?e.focus({preventScroll:!0}):document.activeElement?.id!==`composer-text`&&document.getElementById(`main`)?.focus({preventScroll:!0})});return()=>cancelAnimationFrame(t)},[T,E]);let D=Object.fromEntries(_.map(e=>[e.action,e.label])),O=(0,L.jsx)(HZ,{status:h,task:n.data?.task,connection:o,route:e,keys:D,onHelp:x,tabs:(0,L.jsx)(OQ,{tabs:g,activeId:v,onSelect:y}),extra:u&&r.length>0?(0,L.jsx)(R$,{count:r.length,onOpen:()=>d(!1)}):null});return s||!h?(0,L.jsxs)(`div`,{ref:f,className:`fixed inset-0 flex flex-col`,children:[O,(0,L.jsx)(`main`,{className:`surface mx-3 mb-3 flex min-h-0 flex-1 flex-col overflow-y-auto max-sm:mx-0 max-sm:mb-0`,children:s?(0,L.jsx)(WZ,{}):t.error?(0,L.jsx)(LD,{message:t.error,onRetry:w}):(0,L.jsx)(ID,{})})]}):(0,L.jsxs)(`div`,{ref:f,className:`fixed inset-0 flex flex-col`,children:[O,(0,L.jsx)(J$,{connection:o,onRetry:p}),(0,L.jsx)(`main`,{id:`main`,tabIndex:-1,onKeyDown:e=>{e.key!==`Escape`||e.defaultPrevented||XD(e.target)||e.target.closest(`[role='dialog'], [role='menu'], [role='listbox']`)||aO()&&e.preventDefault()},role:v?`tabpanel`:void 0,"aria-labelledby":v?`tab-${v}`:void 0,className:`surface mx-3 mb-3 flex min-h-0 flex-1 flex-col overflow-y-auto outline-none max-sm:mx-0 max-sm:mb-0`,children:(0,L.jsx)(z.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.18,ease:[.2,.8,.2,1]},className:`flex min-h-0 flex-1 flex-col`,children:BX(e)},Z$(e))}),(0,L.jsx)(wZ,{route:e,keys:D,onHelp:x}),(0,L.jsx)(s$,{status:h,lobby:n.data}),(0,L.jsx)(z$,{prompts:r,answer:i,dismiss:a,minimized:u,onMinimize:d}),(0,L.jsx)(uZ,{open:c,onOpenChange:l,keys:_,tabs:g})]})}async function $$(e){switch(e){case`status`:return qf(`status.get`,{});case`lobby`:return qf(`lobby.snapshot`,{});case`prompts`:return qf(`prompts.list`,{});default:return}}var e1=[`status`,`lobby`,`prompts`];function t1(){let[e,t]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{let e=!0;return(async()=>{await Yf(),e&&(kf.markUsed(e1,$$),t(!0))})(),()=>{e=!1}},[]),e}function n1(){return t1()?(0,L.jsx)(Q$,{}):(0,L.jsx)(`div`,{className:`fixed inset-0 flex`,children:(0,L.jsx)(ID,{})})}var r1={info:Em,success:Hp,warning:og,error:Qp},i1={info:`text-primary`,success:`text-success`,warning:`text-warning`,error:`text-destructive`};function a1(){let{item:e,waiting:t}=zf(),n=bD(),r=e&&!n;return(0,m.useEffect)(()=>{if(!e||n)return;let r=window.setTimeout(()=>Lf(e.id),t>0?Math.min(e.duration,1600):e.duration);return()=>window.clearTimeout(r)},[e,n,t]),(0,L.jsx)(`div`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`pointer-events-none fixed inset-x-0 z-40 flex justify-center px-4`,style:{bottom:`calc(var(--composer-h, 0px) + 0.25rem)`},children:(0,L.jsx)(tu,{mode:`wait`,children:r?(0,L.jsxs)(z.div,{initial:{opacity:0,scale:.55,y:18},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.92,y:6,transition:{duration:.14,ease:`easeIn`}},transition:{type:`spring`,stiffness:560,damping:15,mass:.8},className:`pointer-events-auto flex max-w-[min(32rem,100%)] items-center gap-3 rounded-xl border border-glass-border bg-popover/80 px-4 py-2.5 text-sm text-popover-foreground shadow-glass backdrop-blur-xs`,children:[(0,L.jsx)(o1,{kind:e.kind}),(0,L.jsx)(`span`,{className:`min-w-0 break-words`,children:e.message}),e.action?(0,L.jsx)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,className:`btn-raised -my-1.5 -mr-1 h-7 shrink-0 rounded-lg border bg-card px-2.5 font-medium text-primary transition-[box-shadow,translate] active:translate-y-px focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:outline-none`,onClick:()=>{e.action?.onClick(),Lf(e.id)},children:e.action.label}):null]},e.id):null})})}function o1({kind:e}){let t=r1[e];return(0,L.jsx)(t,{"aria-hidden":`true`,className:q(`size-5 shrink-0`,i1[e])})}(0,wf.createRoot)(document.getElementById(`root`)).render((0,L.jsx)(m.StrictMode,{children:(0,L.jsx)(HG,{children:(0,L.jsx)(cu,{reducedMotion:`user`,children:(0,L.jsxs)(WD,{children:[(0,L.jsx)(n1,{}),(0,L.jsx)(a1,{})]})})})})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`,{updateViaCache:`none`}).catch(()=>void 0)});
|