@minimalcorp/tsunagi 0.1.17 → 0.1.18
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/.next/standalone/apps/web/.next/BUILD_ID +1 -1
- package/.next/standalone/apps/web/.next/build-manifest.json +3 -3
- package/.next/standalone/apps/web/.next/prerender-manifest.json +3 -3
- package/.next/standalone/apps/web/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/index.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/index.rsc +2 -2
- package/.next/standalone/apps/web/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/apps/web/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/standalone/apps/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.html +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.segments/_full.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.segments/_index.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/settings.segments/settings.segment.rsc +1 -1
- package/.next/standalone/apps/web/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__05isylw._.js +2 -2
- package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ro8-ey._.js +2 -2
- package/.next/standalone/apps/web/.next/server/chunks/ssr/_0g.cd6a._.js +1 -1
- package/.next/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_app_tasks_[id]_page_tsx_0jshsm2._.js +1 -1
- package/.next/standalone/apps/web/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/apps/web/.next/server/pages/404.html +1 -1
- package/.next/standalone/apps/web/.next/server/pages/500.html +1 -1
- package/.next/standalone/apps/web/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/apps/web/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/apps/web/.next/static/chunks/09ik3f_4bui.6.js +3 -0
- package/.next/standalone/apps/web/.next/static/chunks/{0zf.4.k6hxz~b.js → 0e9ktynfbcnuu.js} +2 -2
- package/.next/standalone/apps/web/.next/static/chunks/{03lw1.jf3nzsp.js → 10i6zv0moo8jf.js} +1 -1
- package/.next/standalone/apps/web/.next/static/chunks/{0jaki2nicisbt.js → 1145l.gbs9mp0.js} +2 -2
- package/dist/server/generated/prisma/internal/class.js +4 -4
- package/dist/server/generated/prisma/internal/prismaNamespace.d.ts +1 -0
- package/dist/server/generated/prisma/internal/prismaNamespace.js +1 -0
- package/dist/server/generated/prisma/internal/prismaNamespaceBrowser.d.ts +1 -0
- package/dist/server/generated/prisma/internal/prismaNamespaceBrowser.js +1 -0
- package/dist/server/generated/prisma/models/Tab.d.ts +36 -1
- package/dist/server/lib/repositories/task.d.ts +1 -1
- package/dist/server/lib/repositories/task.js +3 -1
- package/dist/server/routes/tasks.js +2 -1
- package/npm-shrinkwrap.json +20 -15
- package/package.json +1 -1
- package/prisma/migrations/20260629000000_add_tab_mode/migration.sql +4 -0
- package/prisma/schema.prisma +1 -0
- package/.next/standalone/apps/web/.next/static/chunks/0kpkmh5umvk_l.js +0 -3
- /package/.next/standalone/apps/web/.next/static/{Q7QTiWuO93GtNyS-DgVqZ → 36-cU0G0900-sCM9SPr1i}/_buildManifest.js +0 -0
- /package/.next/standalone/apps/web/.next/static/{Q7QTiWuO93GtNyS-DgVqZ → 36-cU0G0900-sCM9SPr1i}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/apps/web/.next/static/{Q7QTiWuO93GtNyS-DgVqZ → 36-cU0G0900-sCM9SPr1i}/_ssgManifest.js +0 -0
|
@@ -8,10 +8,10 @@ ${e.themeCSS}`),void 0!==e.fontFamily&&(r+=`
|
|
|
8
8
|
|
|
9
9
|
If you want to hide the \`${i.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
10
10
|
|
|
11
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${i.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ug=({contentRef:e,descriptionId:i})=>{let r=uf("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return m.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");i&&r&&(document.getElementById(i)||console.warn(n))},[n,e,i]),null},um=Symbol.for("react.lazy"),u_=m[" use ".trim().toString()];function uv(e){var i;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===um&&"_payload"in e&&"object"==typeof(i=e._payload)&&null!==i&&"then"in i}var uy=Symbol("radix.slottable");function ub(e){return m.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===uy}var uS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,i)=>{var r,n;let s,o,a,l=(n=r=`Primitive.${i}`,(s=m.forwardRef((e,i)=>{let{children:r,...n}=e;if(uv(r)&&"function"==typeof u_&&(r=u_(r._payload)),m.isValidElement(r)){var s;let e,o,a=(s=r,(o=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(o=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),l=function(e,i){let r={...i};for(let n in i){let s=e[n],o=i[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...e)=>{let i=o(...e);return s(...e),i}:s&&(r[n]=s):"style"===n?r[n]={...s,...o}:"className"===n&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==m.Fragment&&(l.ref=i?cB(i,a):a),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null})).displayName=`${n}.SlotClone`,o=s,(a=m.forwardRef((e,i)=>{let{children:r,...n}=e;uv(r)&&"function"==typeof u_&&(r=u_(r._payload));let s=m.Children.toArray(r),a=s.find(ub);if(a){let e=a.props.children,r=s.map(i=>i!==a?i:m.Children.count(e)>1?m.Children.only(null):m.isValidElement(e)?e.props.children:null);return(0,g.jsx)(o,{...n,ref:i,children:m.isValidElement(e)?m.cloneElement(e,void 0,r):null})}return(0,g.jsx)(o,{...n,ref:i,children:r})})).displayName=`${r}.Slot`,a),c=m.forwardRef((e,r)=>{let{asChild:n,...s}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(n?l:i,{...s,ref:r})});return c.displayName=`Primitive.${i}`,{...e,[i]:c}},{}),uw='[cmdk-group=""]',ux='[cmdk-group-items=""]',uC='[cmdk-item=""]',uk=`${uC}:not([aria-disabled="true"])`,uE="cmdk-item-select",uR="data-value",uT=(e,i,r)=>{var n;return n=e,function e(i,r,n,s,o,a,l){if(a===r.length)return o===i.length?1:.99;var c=`${o},${a}`;if(void 0!==l[c])return l[c];for(var h,u,d,f,p=s.charAt(a),g=n.indexOf(p,o),m=0;g>=0;)(h=e(i,r,n,s,g+1,a+1,l))>m&&(g===o?h*=1:cT.test(i.charAt(g-1))?(h*=.8,(d=i.slice(o,g-1).match(cD))&&o>0&&(h*=Math.pow(.999,d.length))):cL.test(i.charAt(g-1))?(h*=.9,(f=i.slice(o,g-1).match(cA))&&o>0&&(h*=Math.pow(.999,f.length))):(h*=.17,o>0&&(h*=Math.pow(.999,g-o))),i.charAt(g)!==r.charAt(a)&&(h*=.9999)),(h<.1&&n.charAt(g-1)===s.charAt(a+1)||s.charAt(a+1)===s.charAt(a)&&n.charAt(g-1)!==s.charAt(a))&&.1*(u=e(i,r,n,s,g+1,a+2,l))>h&&(h=.1*u),h>m&&(m=h),g=n.indexOf(p,g+1);return l[c]=m,m}(n=r&&r.length>0?`${n+" "+r.join(" ")}`:n,i,cM(n),cM(i),0,0,{})},uD=m.createContext(void 0),uL=m.createContext(void 0),uA=m.createContext(void 0),uM=m.forwardRef((e,i)=>{let r=uW(()=>{var i,r;return{search:"",value:null!=(r=null!=(i=e.value)?i:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=uW(()=>new Set),s=uW(()=>new Map),o=uW(()=>new Map),a=uW(()=>new Set),l=uH(e),{label:c,children:h,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=cH(),S=cH(),w=cH(),x=m.useRef(null),C=uq();uj(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,k.emit()}},[u]),uj(()=>{C(6,A)},[]);let k=m.useMemo(()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>r.current,setState:(e,i,n)=>{var s,o,a,c;if(!Object.is(r.current[e],i)){if(r.current[e]=i,"search"===e)L(),T(),C(1,D);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(s=document.getElementById(b))||s.focus()}if(C(7,()=>{var e;r.current.selectedItemId=null==(e=M())?void 0:e.id,k.emit()}),n||C(5,A),(null==(o=l.current)?void 0:o.value)!==void 0){null==(c=(a=l.current).onValueChange)||c.call(a,null!=i?i:"");return}}k.emit()}},emit:()=>{a.current.forEach(e=>e())}}),[]),E=m.useMemo(()=>({value:(e,i,n)=>{var s;i!==(null==(s=o.current.get(e))?void 0:s.value)&&(o.current.set(e,{value:i,keywords:n}),r.current.filtered.items.set(e,R(i,n)),C(2,()=>{T(),k.emit()}))},item:(e,i)=>(n.current.add(e),i&&(s.current.has(i)?s.current.get(i).add(e):s.current.set(i,new Set([e]))),C(3,()=>{L(),T(),r.current.value||D(),k.emit()}),()=>{o.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let i=M();C(4,()=>{L(),(null==i?void 0:i.getAttribute("id"))===e&&D(),k.emit()})}),group:e=>(s.current.has(e)||s.current.set(e,new Set),()=>{o.current.delete(e),s.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:S,listInnerRef:x}),[]);function R(e,i){var n,s;let o=null!=(s=null==(n=l.current)?void 0:n.filter)?s:uT;return e?o(e,r.current.search,i):0}function T(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,i=[];r.current.filtered.groups.forEach(r=>{let n=s.current.get(r),o=0;n.forEach(i=>{o=Math.max(e.get(i),o)}),i.push([r,o])});let n=x.current;P().sort((i,r)=>{var n,s;let o=i.getAttribute("id"),a=r.getAttribute("id");return(null!=(n=e.get(a))?n:0)-(null!=(s=e.get(o))?s:0)}).forEach(e=>{let i=e.closest(ux);i?i.appendChild(e.parentElement===i?e:e.closest(`${ux} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${ux} > *`))}),i.sort((e,i)=>i[1]-e[1]).forEach(e=>{var i;let r=null==(i=x.current)?void 0:i.querySelector(`${uw}[${uR}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function D(){let e=P().find(e=>"true"!==e.getAttribute("aria-disabled")),i=null==e?void 0:e.getAttribute(uR);k.setState("value",i||void 0)}function L(){var e,i,a,c;if(!r.current.search||!1===l.current.shouldFilter){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let h=0;for(let s of n.current){let n=R(null!=(i=null==(e=o.current.get(s))?void 0:e.value)?i:"",null!=(c=null==(a=o.current.get(s))?void 0:a.keywords)?c:[]);r.current.filtered.items.set(s,n),n>0&&h++}for(let[e,i]of s.current)for(let n of i)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=h}function A(){var e,i,r;let n=M();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(i=n.closest(uw))?void 0:i.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function M(){var e;return null==(e=x.current)?void 0:e.querySelector(`${uC}[aria-selected="true"]`)}function P(){var e;return Array.from((null==(e=x.current)?void 0:e.querySelectorAll(uk))||[])}function O(e){let i=P()[e];i&&k.setState("value",i.getAttribute(uR))}function B(e){var i;let r=M(),n=P(),s=n.findIndex(e=>e===r),o=n[s+e];null!=(i=l.current)&&i.loop&&(o=s+e<0?n[n.length-1]:s+e===n.length?n[0]:n[s+e]),o&&k.setState("value",o.getAttribute(uR))}function N(e){let i=M(),r=null==i?void 0:i.closest(uw),n;for(;r&&!n;)n=null==(r=e>0?function(e,i){let r=e.nextElementSibling;for(;r;){if(r.matches(i))return r;r=r.nextElementSibling}}(r,uw):function(e,i){let r=e.previousElementSibling;for(;r;){if(r.matches(i))return r;r=r.previousElementSibling}}(r,uw))?void 0:r.querySelector(uk);n?k.setState("value",n.getAttribute(uR)):B(e)}let I=()=>O(P().length-1),F=e=>{e.preventDefault(),e.metaKey?I():e.altKey?N(1):B(1)},z=e=>{e.preventDefault(),e.metaKey?O(0):e.altKey?N(-1):B(-1)};return m.createElement(uS.div,{ref:i,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var i;null==(i=y.onKeyDown)||i.call(y,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||r))switch(e.key){case"n":case"j":v&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":v&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),O(0);break;case"End":e.preventDefault(),I();break;case"Enter":{e.preventDefault();let i=M();if(i){let e=new Event(uE);i.dispatchEvent(e)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:uK},c),uV(e,e=>m.createElement(uL.Provider,{value:k},m.createElement(uD.Provider,{value:E},e))))}),uP=m.forwardRef((e,i)=>{var r,n;let s=cH(),o=m.useRef(null),a=m.useContext(uA),l=m.useContext(uD),c=uH(e),h=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==a?void 0:a.forceMount;uj(()=>{if(!h)return l.item(s,null==a?void 0:a.id)},[h]);let u=uU(s,o,[e.value,e.children,o],e.keywords),d=m.useContext(uL),f=u$(e=>e.value&&e.value===u.current),p=u$(e=>!!h||!1===l.filter()||!e.search||e.filtered.items.get(s)>0);function g(){var e,i;_(),null==(i=(e=c.current).onSelect)||i.call(e,u.current)}function _(){d.setState("value",u.current,!0)}if(m.useEffect(()=>{let i=o.current;if(!(!i||e.disabled))return i.addEventListener(uE,g),()=>i.removeEventListener(uE,g)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:y,onSelect:b,forceMount:S,keywords:w,...x}=e;return m.createElement(uS.div,{ref:cB(o,i),...x,id:s,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||l.getDisablePointerSelection()?void 0:_,onClick:v?void 0:g},e.children)}),uO=m.forwardRef((e,i)=>{let{heading:r,children:n,forceMount:s,...o}=e,a=cH(),l=m.useRef(null),c=m.useRef(null),h=cH(),u=m.useContext(uD),d=u$(e=>!!s||!1===u.filter()||!e.search||e.filtered.groups.has(a));uj(()=>u.group(a),[]),uU(a,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:a,forceMount:s}),[s]);return m.createElement(uS.div,{ref:cB(l,i),...o,"cmdk-group":"",role:"presentation",hidden:!d||void 0},r&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),uV(e,e=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},m.createElement(uA.Provider,{value:f},e))))}),uB=m.forwardRef((e,i)=>{let{alwaysRender:r,...n}=e,s=m.useRef(null),o=u$(e=>!e.search);return r||o?m.createElement(uS.div,{ref:cB(s,i),...n,"cmdk-separator":"",role:"separator"}):null}),uN=m.forwardRef((e,i)=>{let{onValueChange:r,...n}=e,s=null!=e.value,o=m.useContext(uL),a=u$(e=>e.search),l=u$(e=>e.selectedItemId),c=m.useContext(uD);return m.useEffect(()=>{null!=e.value&&o.setState("search",e.value)},[e.value]),m.createElement(uS.input,{ref:i,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:s?e.value:a,onChange:e=>{s||o.setState("search",e.target.value),null==r||r(e.target.value)}})}),uI=m.forwardRef((e,i)=>{let{children:r,label:n="Suggestions",...s}=e,o=m.useRef(null),a=m.useRef(null),l=u$(e=>e.selectedItemId),c=m.useContext(uD);return m.useEffect(()=>{if(a.current&&o.current){let e=a.current,i=o.current,r,n=new ResizeObserver(()=>{r=requestAnimationFrame(()=>{let r=e.offsetHeight;i.style.setProperty("--cmdk-list-height",r.toFixed(1)+"px")})});return n.observe(e),()=>{cancelAnimationFrame(r),n.unobserve(e)}}},[]),m.createElement(uS.div,{ref:cB(o,i),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:c.listId},uV(e,e=>m.createElement("div",{ref:cB(a,c.listInnerRef),"cmdk-list-sizer":""},e)))}),uF=m.forwardRef((e,i)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:o,container:a,...l}=e;return m.createElement(h2,{open:r,onOpenChange:n},m.createElement(h9,{container:a},m.createElement(h7,{"cmdk-overlay":"",className:s}),m.createElement(ur,{"aria-label":e.label,"cmdk-dialog":"",className:o},m.createElement(uM,{ref:i,...l}))))}),uz=Object.assign(uM,{List:uI,Item:uP,Input:uN,Group:uO,Separator:uB,Dialog:uF,Empty:m.forwardRef((e,i)=>u$(e=>0===e.filtered.count)?m.createElement(uS.div,{ref:i,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:m.forwardRef((e,i)=>{let{progress:r,children:n,label:s="Loading...",...o}=e;return m.createElement(uS.div,{ref:i,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},uV(e,e=>m.createElement("div",{"aria-hidden":!0},e)))})});function uH(e){let i=m.useRef(e);return uj(()=>{i.current=e}),i}var uj="u"<typeof window?m.useEffect:m.useLayoutEffect;function uW(e){let i=m.useRef();return void 0===i.current&&(i.current=e()),i}function u$(e){let i=m.useContext(uL),r=()=>e(i.snapshot());return m.useSyncExternalStore(i.subscribe,r,r)}function uU(e,i,r,n=[]){let s=m.useRef(),o=m.useContext(uD);return uj(()=>{var a;let l=(()=>{var e;for(let i of r){if("string"==typeof i)return i.trim();if("object"==typeof i&&"current"in i)return i.current?null==(e=i.current.textContent)?void 0:e.trim():s.current}})(),c=n.map(e=>e.trim());o.value(e,l,c),null==(a=i.current)||a.setAttribute(uR,l),s.current=l}),s}var uq=()=>{let[e,i]=m.useState(),r=uW(()=>new Map);return uj(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),i({})}};function uV({asChild:e,children:i},r){let n;return e&&m.isValidElement(i)?m.cloneElement("function"==typeof(n=i.type)?n(i.props):"render"in n?n.render(i.props):i,{ref:i.ref},r(i.props.children)):r(i)}var uK={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};e.i(69068);var uY=e.i(25913),uX=e.i(10012);function uG({className:e,...i}){return(0,g.jsx)("textarea",{"data-slot":"textarea",className:(0,cC.cn)("flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-input/20 px-2 py-2 text-sm transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...i})}function uJ({className:e,...i}){return(0,g.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,cC.cn)("group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...i})}let uZ=(0,uY.cva)("flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]","block-start":"order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function uQ({className:e,align:i="inline-start",...r}){return(0,g.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":i,className:(0,cC.cn)(uZ({align:i}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...r})}(0,uY.cva)("flex items-center gap-2 rounded-md text-xs/relaxed shadow-none",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"gap-1","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-7 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});let u0=(0,r0.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",0,u0],54943);var u1=e.i(78745);e.s(["CheckIcon",()=>u1.default],78784);var u1=u1;function u2({className:e,...i}){return(0,g.jsx)(uz,{"data-slot":"command",className:(0,cC.cn)("flex size-full flex-col overflow-hidden rounded-xl bg-popover p-1 text-popover-foreground",e),...i})}function u5({className:e,...i}){return(0,g.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,g.jsxs)(uJ,{className:"h-8! bg-input/20 dark:bg-input/30",children:[(0,g.jsx)(uz.Input,{"data-slot":"command-input",className:(0,cC.cn)("w-full text-xs/relaxed outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...i}),(0,g.jsx)(uQ,{children:(0,g.jsx)(u0,{className:"size-3.5 shrink-0 opacity-50"})})]})})}function u3({className:e,...i}){return(0,g.jsx)(uz.List,{"data-slot":"command-list",className:(0,cC.cn)("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...i})}function u4({className:e,...i}){return(0,g.jsx)(uz.Empty,{"data-slot":"command-empty",className:(0,cC.cn)("py-6 text-center text-xs/relaxed",e),...i})}function u6({className:e,...i}){return(0,g.jsx)(uz.Group,{"data-slot":"command-group",className:(0,cC.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2.5 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...i})}function u9({className:e,children:i,...r}){return(0,g.jsxs)(uz.Item,{"data-slot":"command-item",className:(0,cC.cn)("group/command-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2.5 py-1.5 text-xs/relaxed outline-hidden select-none in-data-[slot=dialog-content]:rounded-md data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-selected:*:[svg]:text-foreground",e),...r,children:[i,(0,g.jsx)(u1.default,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}function u8({options:e,value:i,onChange:r,placeholder:n="Select option",disabled:s=!1,className:o="",allowCustomValue:a=!1,multiple:l=!1,onClear:c,showClearButton:h=!1}){let[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(""),_=(0,m.useRef)(null),v=(0,m.useMemo)(()=>Array.isArray(i)?i:[i],[i]),y=(0,m.useMemo)(()=>{if(l){if(1===v.length&&"all"===v[0]){let i=e.find(e=>"all"===e.value);return i?.label||""}return v.filter(e=>"all"!==e).map(i=>e.find(e=>e.value===i)?.label).filter(Boolean).join(", ")}return v.map(i=>e.find(e=>e.value===i)?.label).filter(Boolean).join(", ")},[v,e,l]),b=(0,m.useMemo)(()=>{let i={};for(let r of e){let e=r.group||"Other";i[e]||(i[e]=[]),i[e].push(r)}return i},[e]),S=(0,m.useMemo)(()=>Object.keys(b).length>1||!b.Other,[b]),w=e=>{if(l){let i=[...v],n=i.indexOf(e);n>=0?i.splice(n,1):i.push(e),r(i.length>0?i:[])}else r(e),d(!1)},x=()=>{a&&f&&!l&&(r(f),d(!1))};return(0,g.jsxs)(ck,{open:u,onOpenChange:e=>{d(e),e||p("")},children:[(0,g.jsxs)("div",{className:`relative ${o}`,children:[(0,g.jsx)(cE,{ref:_,disabled:s,className:`flex h-9 w-full items-center justify-between pl-3 ${h?"pr-16":"pr-10"} border border-input rounded-md text-sm bg-input/20 dark:bg-input/30 text-foreground transition-colors outline-none hover:border-ring focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 data-[state=open]:border-ring data-[state=open]:ring-2 data-[state=open]:ring-ring/30 disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none cursor-pointer overflow-hidden text-ellipsis whitespace-nowrap text-left shadow-xs`,children:(0,g.jsx)("span",{className:"truncate",children:y||(0,g.jsx)("span",{className:"text-muted-foreground",children:n})})}),h&&c&&(0,g.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),c()},className:"absolute right-8 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors cursor-pointer z-10","aria-label":"Clear selection",children:(0,g.jsx)(ad.X,{className:"w-4 h-4"})}),(0,g.jsx)(au,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none"})]}),(0,g.jsx)(cR,{className:"w-[var(--anchor-width)] p-0",align:"start",sideOffset:4,children:(0,g.jsxs)(u2,{filter:(i,r)=>{let n=e.find(e=>e.value===i);return n?+!!`${n.label} ${n.group||""}`.toLowerCase().includes(r.toLowerCase()):0},children:[(0,g.jsx)(u5,{placeholder:"Search...",value:f,onValueChange:p,onKeyDown:e=>{"Enter"===e.key&&a&&x()}}),(0,g.jsxs)(u3,{children:[(0,g.jsx)(u4,{children:a&&f?(0,g.jsxs)("button",{type:"button",className:"w-full px-2 py-1.5 text-left text-xs cursor-pointer hover:bg-accent rounded",onClick:x,children:['Use "',f,'"']}):"No options found"}),S?Object.entries(b).map(([e,i])=>(0,g.jsx)(u6,{heading:e,children:i.map(e=>(0,g.jsx)(u9,{value:e.value,"data-checked":v.includes(e.value),onSelect:()=>w(e.value),children:(0,g.jsx)("span",{className:"truncate",children:e.label})},e.value))},e)):(0,g.jsx)(u6,{children:e.map(e=>(0,g.jsx)(u9,{value:e.value,"data-checked":v.includes(e.value),onSelect:()=>w(e.value),children:(0,g.jsx)("span",{className:"truncate",children:e.label})},e.value))})]})]})})]})}let u7=(0,r0.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var de=e.i(86536),dt=e.i(70935);function di({value:e,onChange:i,editorRef:r,theme:n,activeTab:s,onTabChange:o,disabled:a,onFocusChange:l}){let c=(0,m.useCallback)(e=>{i(e??"")},[i]),h=(0,g.jsx)("div",{className:"border border-border rounded overflow-hidden h-full",children:(0,g.jsx)(_.Editor,{height:"100%",defaultLanguage:"markdown",value:e,onChange:c,onMount:e=>{r.current=e,e.layout(),e.onDidFocusEditorText(()=>l?.(!0)),e.onDidBlurEditorText(()=>l?.(!1))},options:{minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",fontSize:13,scrollBeyondLastLine:!1,readOnly:a},theme:"dark"===n?"vs-dark":"vs-light"})}),u=(0,g.jsx)("div",{className:"border border-border rounded overflow-y-auto h-full p-4 prose prose-sm prose-slate dark:prose-invert max-w-none",children:e?(0,g.jsx)(iW,{remarkPlugins:[rQ],components:as,children:e}):(0,g.jsx)("p",{className:"text-muted-foreground italic",children:"No content"})});return(0,g.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,g.jsxs)("div",{className:"flex gap-1 mb-2 md:hidden flex-shrink-0",children:[(0,g.jsxs)(r3.Button,{type:"button",variant:"editor"===s?"default":"outline",size:"sm",onClick:()=>o("editor"),children:[(0,g.jsx)(u7,{className:"w-4 h-4 mr-1"}),"Editor"]}),(0,g.jsxs)(r3.Button,{type:"button",variant:"preview"===s?"default":"outline",size:"sm",onClick:()=>o("preview"),children:[(0,g.jsx)(de.Eye,{className:"w-4 h-4 mr-1"}),"Preview"]})]}),(0,g.jsxs)("div",{className:"hidden md:grid md:grid-cols-2 md:gap-4 flex-1 min-h-0",children:[h,u]}),(0,g.jsx)("div",{className:"md:hidden flex-1 min-h-0",children:"editor"===s?h:u})]})}e.s(["TaskDialog",0,function({mode:e,isOpen:i,onClose:r,repositories:n=[],task:s,onUpdate:o}){let a=ac(),[l,c]=(0,m.useState)(""),[h,u]=(0,m.useState)([]),[d,f]=(0,m.useState)(""),[p,_]=(0,m.useState)(!1),[v,y]=(0,m.useState)(""),[b,S]=(0,m.useState)({title:"",description:"",owner:"",repo:"",branch:"",baseBranch:"",status:"backlog",effort:void 0,order:void 0}),[w,x]=(0,m.useState)(!1),[C,k]=(0,m.useState)({}),[E,R]=(0,m.useState)("editor"),[T,D]=(0,m.useState)(!1),L=(0,m.useRef)(null),{effectiveTheme:A}=(0,ao.useTheme)();(0,m.useEffect)(()=>{"edit"===e&&s&&S({title:s.title,description:s.description,owner:s.owner,repo:s.repo,branch:s.branch,baseBranch:"",status:s.status,effort:s.effort,order:s.order})},[e,s,i]);let M=(0,m.useMemo)(()=>n.map(e=>({value:`${e.owner}/${e.repo}`,label:`${e.owner}/${e.repo}`})),[n]),P=(0,m.useMemo)(()=>h.map(e=>({value:e,label:e===d?`${e} (default)`:e})),[h,d]);(0,m.useEffect)(()=>{if("create"===e){if(!l){u([]),f(""),S(e=>({...e,baseBranch:""}));return}(async()=>{_(!0),y("");try{let[e,i]=l.split("/"),r=await fetch((0,dt.apiUrl)(`/api/repos/${e}/${i}/branches`));if(!r.ok)throw Error("Failed to fetch branches");let n=await r.json();u(n.data.branches),f(n.data.defaultBranch),S(e=>({...e,baseBranch:n.data.defaultBranch}))}catch(e){console.error("Failed to fetch branches:",e),y("Failed to load branches. Repository may not be initialized."),u([]),f("")}finally{_(!1)}})()}},[l,e]);let O=async i=>{if(i.preventDefault(),k({}),"create"===e){x(!0);try{let e=await fetch((0,dt.apiUrl)("/api/tasks/validate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:b.title,owner:b.owner,repo:b.repo,branch:b.branch})}),i=await e.json();if(!i.valid){let e={};i.errors.forEach(i=>{e[i.field]=i.message}),k(e),x(!1);return}let n={title:b.title,description:b.description,owner:b.owner,repo:b.repo,branch:b.branch,baseBranch:b.baseBranch};r(),c(""),S({title:"",description:"",owner:"",repo:"",branch:"",baseBranch:"",status:"backlog",effort:void 0,order:void 0}),x(!1);let s=a.loading("Creating task...",n.title);try{if(!(await fetch((0,dt.apiUrl)("/api/tasks"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).ok)throw Error("Failed to create task");a.dismiss(s)}catch(i){let e=i instanceof Error?i.message:"Unknown error";a.error(s,"Failed to create task",e)}}catch(i){x(!1);let e=i instanceof Error?i.message:"Validation failed";a.error(void 0,"Validation failed",e)}}else if("edit"===e&&o&&s){x(!0);try{let e=await o(s.id,{title:b.title,description:b.description,status:b.status,effort:b.effort,order:b.order});if(e.success)r();else if(e.errors){let i={};e.errors.forEach(e=>{i[e.field]=e.message}),k(i)}}catch(e){console.error("Failed to update task:",e),k({global:e instanceof Error?e.message:"Failed to update task. Please try again."})}finally{x(!1)}}},B="create"===e,N=B?"Add New Task":"Edit Task",I=B?"Create":"Save";return(0,g.jsxs)(ah.Dialog,{open:i,onOpenChange:e=>{e.open||w||r()},title:N,maxWidth:B?"2xl":"6xl",fullScreen:!B,showCloseButton:!w,dismissOnEsc:!T,children:[w&&(0,g.jsx)("div",{className:"absolute inset-0 bg-card bg-opacity-90 rounded-lg flex items-center justify-center z-10",children:(0,g.jsx)(aa.LoadingSpinner,{size:"lg",message:B?"Creating task...":"Saving task..."})}),C.global&&(0,g.jsx)("div",{className:"mb-4 p-3 bg-destructive/10 border border-destructive/50 rounded text-destructive text-sm",children:C.global}),(0,g.jsxs)("form",{onSubmit:O,className:B?"space-y-4":"flex flex-col gap-4 flex-1 min-h-0 overflow-hidden",children:[B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Repository *"}),(0,g.jsx)(u8,{options:M,value:l,onChange:e=>{let i=Array.isArray(e)?e[0]||"":e;if(c(i),i){let[e,r]=i.split("/");S(i=>({...i,owner:e,repo:r,baseBranch:""}))}else S(e=>({...e,owner:"",repo:"",baseBranch:""}))},placeholder:"Select repository",disabled:w})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Title *"}),(0,g.jsx)(uX.Input,{type:"text",required:!0,maxLength:200,value:b.title,onChange:e=>S({...b,title:e.target.value}),className:"w-full",disabled:w})]}),!B&&s&&(0,g.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 p-3 bg-muted/50 rounded-md text-sm",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Repository"}),(0,g.jsxs)("p",{className:"text-muted-foreground",children:[s.owner,"/",s.repo]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Branch"}),(0,g.jsx)("p",{className:"text-muted-foreground",children:s.branch})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Base Branch"}),(0,g.jsx)("p",{className:"text-muted-foreground",children:s.baseBranch||"N/A"})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Worktree"}),(0,g.jsx)("p",{className:"text-muted-foreground capitalize",children:s.worktreeStatus})]})]}),(0,g.jsxs)("div",{className:B?"":"flex flex-col flex-1 min-h-0",children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground flex-shrink-0",children:"Description"}),B?(0,g.jsx)(uG,{maxLength:5e3,value:b.description,onChange:e=>S({...b,description:e.target.value}),className:"min-h-24 w-full",disabled:w}):(0,g.jsx)(di,{value:b.description,onChange:e=>S(i=>({...i,description:e})),editorRef:L,theme:A,activeTab:E,onTabChange:R,disabled:w,onFocusChange:D})]}),!B&&(0,g.jsxs)("div",{className:"grid grid-cols-3 gap-4 flex-shrink-0",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Status"}),(0,g.jsxs)("select",{value:b.status,onChange:e=>S({...b,status:e.target.value}),className:"w-full h-9 pl-3 pr-10 py-1 rounded-md border border-input bg-transparent text-sm shadow-xs text-foreground",disabled:w,children:[(0,g.jsx)("option",{value:"backlog",children:"Backlog"}),(0,g.jsx)("option",{value:"planning",children:"Planning"}),(0,g.jsx)("option",{value:"tasking",children:"Tasking"}),(0,g.jsx)("option",{value:"coding",children:"Coding"}),(0,g.jsx)("option",{value:"reviewing",children:"Reviewing"}),(0,g.jsx)("option",{value:"done",children:"Done"})]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Effort (h)"}),(0,g.jsx)(uX.Input,{type:"number",step:"0.5",min:"0.5",max:"40",value:b.effort??"",onChange:e=>S({...b,effort:parseFloat(e.target.value)||void 0}),className:"w-full",placeholder:"2.5",disabled:w})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Order"}),(0,g.jsx)(uX.Input,{type:"number",min:"0",value:b.order??"",onChange:e=>S({...b,order:parseInt(e.target.value)||void 0}),className:"w-full",placeholder:"0",disabled:w})]})]}),B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Base Branch *"}),p?(0,g.jsxs)("div",{className:"w-full h-9 px-3 rounded-md border border-input bg-transparent text-muted-foreground flex items-center gap-2",children:[(0,g.jsx)(aa.LoadingSpinner,{size:"sm"}),(0,g.jsx)("span",{className:"text-xs",children:"Loading branches..."})]}):h.length>0?(0,g.jsx)(u8,{options:P,value:b.baseBranch,onChange:e=>{let i=Array.isArray(e)?e[0]||"":e;S({...b,baseBranch:i})},placeholder:"Select base branch",disabled:w}):(0,g.jsx)("div",{className:"w-full h-9 px-3 rounded-md border border-input bg-transparent text-sm text-muted-foreground flex items-center",children:v||"Select repository first"}),(0,g.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Your new branch will be created from this branch"})]}),B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"New Branch Name *"}),(0,g.jsx)(uX.Input,{type:"text",required:!0,maxLength:255,value:b.branch,onChange:e=>S({...b,branch:e.target.value}),className:`w-full ${C.branch?"border-destructive":""}`,placeholder:"feature/new-feature",disabled:w,"aria-invalid":!!C.branch}),C.branch&&(0,g.jsx)("p",{className:"text-xs text-destructive mt-1",children:C.branch}),!C.branch&&(0,g.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["Will be created from ",b.baseBranch||"base branch"]})]}),(0,g.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,g.jsx)(r3.Button,{type:"button",variant:"outline",size:"lg",onClick:r,className:"active:scale-95",disabled:w,children:"Cancel"}),(0,g.jsx)(r3.Button,{type:"submit",size:"lg",className:"active:scale-95",disabled:w||B&&p,children:I})]})]})]})}],10483)},96085,e=>{"use strict";let i,r,n,s=Object.create(null);s.open="0",s.close="1",s.ping="2",s.pong="3",s.message="4",s.upgrade="5",s.noop="6";let o=Object.create(null);Object.keys(s).forEach(e=>{o[s[e]]=e});let a={type:"error",data:"parser error"},l="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),c="function"==typeof ArrayBuffer,h=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,u=({type:e,data:i},r,n)=>{if(l&&i instanceof Blob)if(r)return n(i);else return d(i,n);if(c&&(i instanceof ArrayBuffer||h(i)))if(r)return n(i);else return d(new Blob([i]),n);return n(s[e]+(i||""))},d=(e,i)=>{let r=new FileReader;return r.onload=function(){i("b"+(r.result.split(",")[1]||""))},r.readAsDataURL(e)};function f(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g="u"<typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<p.length;e++)g[p.charCodeAt(e)]=e;let m="function"==typeof ArrayBuffer,_=(e,i)=>{if("string"!=typeof e)return{type:"message",data:y(e,i)};let r=e.charAt(0);return"b"===r?{type:"message",data:v(e.substring(1),i)}:o[r]?e.length>1?{type:o[r],data:e.substring(1)}:{type:o[r]}:a},v=(e,i)=>m?y((e=>{let i=.75*e.length,r=e.length,n,s=0,o,a,l,c;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);let h=new ArrayBuffer(i),u=new Uint8Array(h);for(n=0;n<r;n+=4)o=g[e.charCodeAt(n)],a=g[e.charCodeAt(n+1)],l=g[e.charCodeAt(n+2)],c=g[e.charCodeAt(n+3)],u[s++]=o<<2|a>>4,u[s++]=(15&a)<<4|l>>2,u[s++]=(3&l)<<6|63&c;return h})(e),i):{base64:!0,data:e},y=(e,i)=>"blob"===i?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer;function b(e){return e.reduce((e,i)=>e+i.length,0)}function S(e,i){if(e[0].length===i)return e.shift();let r=new Uint8Array(i),n=0;for(let s=0;s<i;s++)r[s]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}function w(e){if(e){var i=e;for(var r in w.prototype)i[r]=w.prototype[r];return i}}w.prototype.on=w.prototype.addEventListener=function(e,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(i),this},w.prototype.once=function(e,i){function r(){this.off(e,r),i.apply(this,arguments)}return r.fn=i,this.on(e,r),this},w.prototype.off=w.prototype.removeListener=w.prototype.removeAllListeners=w.prototype.removeEventListener=function(e,i){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<n.length;s++)if((r=n[s])===i||r.fn===i){n.splice(s,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},w.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var i=Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)i[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,s=r.length;n<s;++n)r[n].apply(this,i)}return this},w.prototype.emitReserved=w.prototype.emit,w.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},w.prototype.hasListeners=function(e){return!!this.listeners(e).length};let x="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,i)=>i(e,0),C="u">typeof self?self:"u">typeof window?window:Function("return this")();function k(e,...i){return i.reduce((i,r)=>(e.hasOwnProperty(r)&&(i[r]=e[r]),i),{})}let E=C.setTimeout,R=C.clearTimeout;function T(e,i){i.useNativeTimers?(e.setTimeoutFn=E.bind(C),e.clearTimeoutFn=R.bind(C)):(e.setTimeoutFn=C.setTimeout.bind(C),e.clearTimeoutFn=C.clearTimeout.bind(C))}function D(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class L extends Error{constructor(e,i,r){super(e),this.description=i,this.context=r,this.type="TransportError"}}class A extends w{constructor(e){super(),this.writable=!1,T(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,i,r){return super.emitReserved("error",new L(e,i,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let i=_(e,this.socket.binaryType);this.onPacket(i)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,i={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){let e=this.opts.hostname;return -1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&443!==Number(this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){let i=function(e){let i="";for(let r in e)e.hasOwnProperty(r)&&(i.length&&(i+="&"),i+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return i}(e);return i.length?"?"+i:""}}class M extends A{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let i=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||i()})),this.writable||(e++,this.once("drain",function(){--e||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let i=e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};((e,i)=>{let r=e.split("\x1e"),n=[];for(let e=0;e<r.length;e++){let s=_(r[e],i);if(n.push(s),"error"===s.type)break}return n})(e,this.socket.binaryType).forEach(i),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){var i;let r,n,s;this.writable=!1,i=e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})},n=Array(r=e.length),s=0,e.forEach((e,o)=>{u(e,!1,e=>{n[o]=e,++s===r&&i(n.join("\x1e"))})})}uri(){let e=this.opts.secure?"https":"http",i=this.query||{};return!1!==this.opts.timestampRequests&&(i[this.opts.timestampParam]=D()),this.supportsBinary||i.sid||(i.b64=1),this.createUri(e,i)}}let P=!1;try{P="u">typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}let O=P;function B(){}class N extends M{constructor(e){if(super(e),"u">typeof location){const i="https:"===location.protocol;let r=location.port;r||(r=i?"443":"80"),this.xd="u">typeof location&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,i){let r=this.request({method:"POST",data:e});r.on("success",i),r.on("error",(e,i)=>{this.onError("xhr post error",e,i)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e,i)=>{this.onError("xhr poll error",e,i)}),this.pollXhr=e}}class I extends w{constructor(e,i,r){super(),this.createRequest=e,T(this,r),this._opts=r,this._method=r.method||"GET",this._uri=i,this._data=void 0!==r.data?r.data:null,this._create()}_create(){var e;let i=k(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(i);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders)for(let e in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}catch(e){}if("POST"===this._method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{r.setRequestHeader("Accept","*/*")}catch(e){}null==(e=this._opts.cookieJar)||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;3===r.readyState&&(null==(e=this._opts.cookieJar)||e.parseCookies(r.getResponseHeader("set-cookie"))),4===r.readyState&&(200===r.status||1223===r.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof r.status?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}"u">typeof document&&(this._index=I.requestsCount++,I.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=B,e)try{this._xhr.abort()}catch(e){}"u">typeof document&&delete I.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}function F(){for(let e in I.requests)I.requests.hasOwnProperty(e)&&I.requests[e].abort()}I.requestsCount=0,I.requests={},"u">typeof document&&("function"==typeof attachEvent?attachEvent("onunload",F):"function"==typeof addEventListener&&addEventListener("onpagehide"in C?"pagehide":"unload",F,!1));let z=(n=H({xdomain:!1}))&&null!==n.responseType;function H(e){let i=e.xdomain;try{if("u">typeof XMLHttpRequest&&(!i||O))return new XMLHttpRequest}catch(e){}if(!i)try{return new C[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(e){}}let j="u">typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class W extends A{get name(){return"websocket"}doOpen(){let e=this.uri(),i=this.opts.protocols,r=j?{}:k(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,i,r)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let i=0;i<e.length;i++){let r=e[i],n=i===e.length-1;u(r,this.supportsBinary,e=>{try{this.doWrite(r,e)}catch(e){}n&&x(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=D()),this.supportsBinary||(i.b64=1),this.createUri(e,i)}}let $=C.WebSocket||C.MozWebSocket,U={websocket:class extends W{createSocket(e,i,r){return j?new $(e,i,r):i?new $(e,i):new $(e)}doWrite(e,i){this.ws.send(i)}},webtransport:class extends A{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{var n,s;let o,d,p,g,m=(n=Number.MAX_SAFE_INTEGER,s=this.socket.binaryType,r||(r=new TextDecoder),o=[],d=0,p=-1,g=!1,new TransformStream({transform(e,i){for(o.push(e);;){if(0===d){if(1>b(o))break;let e=S(o,1);g=(128&e[0])==128,d=(p=127&e[0])<126?3:126===p?1:2}else if(1===d){if(2>b(o))break;let e=S(o,2);p=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),d=3}else if(2===d){if(8>b(o))break;let e=S(o,8),r=new DataView(e.buffer,e.byteOffset,e.length),n=r.getUint32(0);if(n>2097151){i.enqueue(a);break}p=0x100000000*n+r.getUint32(4),d=3}else{if(b(o)<p)break;let e=S(o,p);i.enqueue(_(g?e:r.decode(e),s)),d=0}if(0===p||p>n){i.enqueue(a);break}}}})),v=e.readable.pipeThrough(m).getReader(),y=new TransformStream({transform(e,r){var n;n=i=>{let n,s=i.length;if(s<126)new DataView((n=new Uint8Array(1)).buffer).setUint8(0,s);else if(s<65536){let e=new DataView((n=new Uint8Array(3)).buffer);e.setUint8(0,126),e.setUint16(1,s)}else{let e=new DataView((n=new Uint8Array(9)).buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(s))}e.data&&"string"!=typeof e.data&&(n[0]|=128),r.enqueue(n),r.enqueue(i)},l&&e.data instanceof Blob?e.data.arrayBuffer().then(f).then(n):c&&(e.data instanceof ArrayBuffer||h(e.data))?n(f(e.data)):u(e,!1,e=>{i||(i=new TextEncoder),n(i.encode(e))})}});y.readable.pipeTo(e.writable),this._writer=y.writable.getWriter();let w=()=>{v.read().then(({done:e,value:i})=>{e||(this.onPacket(i),w())}).catch(e=>{})};w();let x={type:"open"};this.query.sid&&(x.data=`{"sid":"${this.query.sid}"}`),this._writer.write(x).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let i=0;i<e.length;i++){let r=e[i],n=i===e.length-1;this._writer.write(r).then(()=>{n&&x(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null==(e=this._transport)||e.close()}},polling:class extends N{constructor(e){super(e);const i=e&&e.forceBase64;this.supportsBinary=z&&!i}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new I(H,this.uri(),e)}}},q=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,V=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function K(e){var i,r;let n,s;if(e.length>8e3)throw"URI too long";let o=e,a=e.indexOf("["),l=e.indexOf("]");-1!=a&&-1!=l&&(e=e.substring(0,a)+e.substring(a,l).replace(/:/g,";")+e.substring(l,e.length));let c=q.exec(e||""),h={},u=14;for(;u--;)h[V[u]]=c[u]||"";return -1!=a&&-1!=l&&(h.source=o,h.host=h.host.substring(1,h.host.length-1).replace(/;/g,":"),h.authority=h.authority.replace("[","").replace("]","").replace(/;/g,":"),h.ipv6uri=!0),n=(i=h.path).replace(/\/{2,9}/g,"/").split("/"),("/"==i.slice(0,1)||0===i.length)&&n.splice(0,1),"/"==i.slice(-1)&&n.splice(n.length-1,1),h.pathNames=n,r=h.query,s={},r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,i,r){i&&(s[i]=r)}),h.queryKey=s,h}let Y="function"==typeof addEventListener&&"function"==typeof removeEventListener,X=[];Y&&addEventListener("offline",()=>{X.forEach(e=>e())},!1);class G extends w{constructor(e,i){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(i=e,e=null),e){const r=K(e);i.hostname=r.host,i.secure="https"===r.protocol||"wss"===r.protocol,i.port=r.port,r.query&&(i.query=r.query)}else i.host&&(i.hostname=K(i.host).host);T(this,i),this.secure=null!=i.secure?i.secure:"u">typeof location&&"https:"===location.protocol,i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||("u">typeof location?location.hostname:"localhost"),this.port=i.port||("u">typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(e=>{let i=e.prototype.name;this.transports.push(i),this._transportsByName[i]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let i={},r=e.split("&");for(let e=0,n=r.length;e<n;e++){let n=r[e].split("=");i[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return i}(this.opts.query)),Y&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},X.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let i=Object.assign({},this.opts.query);i.EIO=4,i.transport=e,this.id&&(i.sid=this.id);let r=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);let e=this.opts.rememberUpgrade&&G.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";let i=this.createTransport(e);i.open(),this.setTransport(i)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",G.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let i=Error("server error");i.code=e.data,this._onError(i);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let i=0;i<this.writeBuffer.length;i++){let r=this.writeBuffer[i].data;if(r&&(e+="string"==typeof r?function(e){let i=0,r=0;for(let n=0,s=e.length;n<s;n++)(i=e.charCodeAt(n))<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(n++,r+=4);return r}(r):Math.ceil(1.33*(r.byteLength||r.size))),i>0&&e>this._maxPayload)return this.writeBuffer.slice(0,i);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,x(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,i,r){return this._sendPacket("message",e,i,r),this}send(e,i,r){return this._sendPacket("message",e,i,r),this}_sendPacket(e,i,r,n){if("function"==typeof i&&(n=i,i=void 0),"function"==typeof r&&(n=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;let s={type:e,data:i,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),n&&this.once("flush",n),this.flush()}close(){let e=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),e()},r=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(G.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,i){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Y&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=X.indexOf(this._offlineEventListener);-1!==e&&X.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,i),this.writeBuffer=[],this._prevBufferLen=0}}}G.protocol=4;class J extends G{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let i=this.createTransport(e),r=!1;G.priorWebsocketSuccess=!1;let n=()=>{r||(i.send([{type:"ping",data:"probe"}]),i.once("packet",e=>{if(!r)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;G.priorWebsocketSuccess="websocket"===i.name,this.transport.pause(()=>{r||"closed"!==this.readyState&&(h(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{let e=Error("probe error");e.transport=i.name,this.emitReserved("upgradeError",e)}}))};function s(){r||(r=!0,h(),i.close(),i=null)}let o=e=>{let r=Error("probe error: "+e);r.transport=i.name,s(),this.emitReserved("upgradeError",r)};function a(){o("transport closed")}function l(){o("socket closed")}function c(e){i&&e.name!==i.name&&s()}let h=()=>{i.removeListener("open",n),i.removeListener("error",o),i.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};i.once("open",n),i.once("error",o),i.once("close",a),this.once("close",l),this.once("upgrading",c),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{r||i.open()},200):i.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let i=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&i.push(e[r]);return i}}class Z extends J{constructor(e,i={}){const r="object"==typeof e?e:i;(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(e=>U[e]).filter(e=>!!e)),super(e,r)}}Z.protocol;let Q="function"==typeof ArrayBuffer,ee=Object.prototype.toString,et="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===ee.call(Blob),ei="function"==typeof File||"u">typeof File&&"[object FileConstructor]"===ee.call(File);function er(e){return Q&&(e instanceof ArrayBuffer||("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer))||et&&e instanceof Blob||ei&&e instanceof File}let en=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];(ed=ef||(ef={}))[ed.CONNECT=0]="CONNECT",ed[ed.DISCONNECT=1]="DISCONNECT",ed[ed.EVENT=2]="EVENT",ed[ed.ACK=3]="ACK",ed[ed.CONNECT_ERROR=4]="CONNECT_ERROR",ed[ed.BINARY_EVENT=5]="BINARY_EVENT",ed[ed.BINARY_ACK=6]="BINARY_ACK";class es extends w{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},"function"==typeof e?{reviver:e}:e)}add(e){let i;if("string"==typeof e){if(this.reconstructor)throw Error("got plaintext data when reconstructing a packet");let r=(i=this.decodeString(e)).type===ef.BINARY_EVENT;r||i.type===ef.BINARY_ACK?(i.type=r?ef.EVENT:ef.ACK,this.reconstructor=new eo(i),0===i.attachments&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(er(e)||e.base64)if(this.reconstructor)(i=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw Error("got binary data when not reconstructing a packet");else throw Error("Unknown type: "+e)}decodeString(e){let i=0,r={type:Number(e.charAt(0))};if(void 0===ef[r.type])throw Error("unknown packet type "+r.type);if(r.type===ef.BINARY_EVENT||r.type===ef.BINARY_ACK){let n=i+1;for(;"-"!==e.charAt(++i)&&i!=e.length;);let s=e.substring(n,i);if(s!=Number(s)||"-"!==e.charAt(i))throw Error("Illegal attachments");let o=Number(s);if(!ea(o)||o<0)throw Error("Illegal attachments");if(o>this.opts.maxAttachments)throw Error("too many attachments");r.attachments=o}if("/"===e.charAt(i+1)){let n=i+1;for(;++i&&","!==e.charAt(i)&&i!==e.length;);r.nsp=e.substring(n,i)}else r.nsp="/";let n=e.charAt(i+1);if(""!==n&&Number(n)==n){let n=i+1;for(;++i;){let r=e.charAt(i);if(null==r||Number(r)!=r){--i;break}if(i===e.length)break}r.id=Number(e.substring(n,i+1))}if(e.charAt(++i)){let n=this.tryParse(e.substr(i));if(es.isPayloadValid(r.type,n))r.data=n;else throw Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch(e){return!1}}static isPayloadValid(e,i){switch(e){case ef.CONNECT:return el(i);case ef.DISCONNECT:return void 0===i;case ef.CONNECT_ERROR:return"string"==typeof i||el(i);case ef.EVENT:case ef.BINARY_EVENT:return Array.isArray(i)&&("number"==typeof i[0]||"string"==typeof i[0]&&-1===en.indexOf(i[0]));case ef.ACK:case ef.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class eo{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var i,r;let e=(i=this.reconPack,r=this.buffers,i.data=function e(i,r){if(!i)return i;if(i&&!0===i._placeholder){if("number"==typeof i.num&&i.num>=0&&i.num<r.length)return r[i.num];throw Error("illegal attachments")}if(Array.isArray(i))for(let n=0;n<i.length;n++)i[n]=e(i[n],r);else if("object"==typeof i)for(let n in i)Object.prototype.hasOwnProperty.call(i,n)&&(i[n]=e(i[n],r));return i}(i.data,r),delete i.attachments,i);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}let ea=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function el(e){return"[object Object]"===Object.prototype.toString.call(e)}function ec(e,i,r){return e.on(i,r),function(){e.off(i,r)}}e.s(["Decoder",0,es,"Encoder",0,class{constructor(e){this.replacer=e}encode(e){return(e.type===ef.EVENT||e.type===ef.ACK)&&function e(i,r){if(!i||"object"!=typeof i)return!1;if(Array.isArray(i)){for(let r=0,n=i.length;r<n;r++)if(e(i[r]))return!0;return!1}if(er(i))return!0;if(i.toJSON&&"function"==typeof i.toJSON&&1==arguments.length)return e(i.toJSON(),!0);for(let r in i)if(Object.prototype.hasOwnProperty.call(i,r)&&e(i[r]))return!0;return!1}(e)?this.encodeAsBinary({type:e.type===ef.EVENT?ef.BINARY_EVENT:ef.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let i=""+e.type;return(e.type===ef.BINARY_EVENT||e.type===ef.BINARY_ACK)&&(i+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(i+=e.nsp+","),null!=e.id&&(i+=e.id),null!=e.data&&(i+=JSON.stringify(e.data,this.replacer)),i}encodeAsBinary(e){let i,r,n=(i=[],r=e.data,e.data=function e(i,r){if(!i)return i;if(er(i)){let e={_placeholder:!0,num:r.length};return r.push(i),e}if(Array.isArray(i)){let n=Array(i.length);for(let s=0;s<i.length;s++)n[s]=e(i[s],r);return n}if("object"==typeof i&&!(i instanceof Date)){let n={};for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=e(i[s],r));return n}return i}(r,i),e.attachments=i.length,{packet:e,buffers:i}),s=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(s),o}},"PacketType",0,ef,"isPacketValid",0,function(e){var i;return"string"==typeof e.nsp&&(void 0===(i=e.id)||ea(i))&&function(e,i){switch(e){case ef.CONNECT:return void 0===i||el(i);case ef.DISCONNECT:return void 0===i;case ef.EVENT:return Array.isArray(i)&&("number"==typeof i[0]||"string"==typeof i[0]&&-1===en.indexOf(i[0]));case ef.ACK:return Array.isArray(i);case ef.CONNECT_ERROR:return"string"==typeof i||el(i);default:return!1}}(e.type,e.data)},"protocol",0,5],51890);let eh=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class eu extends w{constructor(e,i,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=i,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[ec(e,"open",this.onopen.bind(this)),ec(e,"packet",this.onpacket.bind(this)),ec(e,"error",this.onerror.bind(this)),ec(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...i){var r,n,s;if(eh.hasOwnProperty(e))throw Error('"'+e.toString()+'" is a reserved event name');if(i.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;let o={type:ef.EVENT,data:i};if(o.options={},o.options.compress=!1!==this.flags.compress,"function"==typeof i[i.length-1]){let e=this.ids++,r=i.pop();this._registerAckCallback(e,r),o.id=e}let a=null==(n=null==(r=this.io.engine)?void 0:r.transport)?void 0:n.writable,l=this.connected&&!(null==(s=this.io.engine)?void 0:s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,i){var r;let n=null!=(r=this.flags.timeout)?r:this._opts.ackTimeout;if(void 0===n){this.acks[e]=i;return}let s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let i=0;i<this.sendBuffer.length;i++)this.sendBuffer[i].id===e&&this.sendBuffer.splice(i,1);i.call(this,Error("operation has timed out"))},n),o=(...e)=>{this.io.clearTimeoutFn(s),i.apply(this,e)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...i){return new Promise((r,n)=>{let s=(e,i)=>e?n(e):r(i);s.withError=!0,i.push(s),this.emit(e,...i)})}_addToQueue(e){let i;"function"==typeof e[e.length-1]&&(i=e.pop());let r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...n)=>(this._queue[0],null!==e?r.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(e)):(this._queue.shift(),i&&i(null,...n)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;let i=this._queue[0];(!i.pending||e)&&(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:ef.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(i=>String(i.id)===e)){let i=this.acks[e];delete this.acks[e],i.withError&&i.call(this,Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case ef.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ef.EVENT:case ef.BINARY_EVENT:this.onevent(e);break;case ef.ACK:case ef.BINARY_ACK:this.onack(e);break;case ef.DISCONNECT:this.ondisconnect();break;case ef.CONNECT_ERROR:this.destroy();let i=Error(e.data.message);i.data=e.data.data,this.emitReserved("connect_error",i)}}onevent(e){let i=e.data||[];null!=e.id&&i.push(this.ack(e.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length)for(let i of this._anyListeners.slice())i.apply(this,e);super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){let i=this,r=!1;return function(...n){r||(r=!0,i.packet({type:ef.ACK,id:e,data:n}))}}onack(e){let i=this.acks[e.id];"function"==typeof i&&(delete this.acks[e.id],i.withError&&e.data.unshift(null),i.apply(this,e.data))}onconnect(e,i){this.id=e,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ef.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let i=this._anyListeners;for(let r=0;r<i.length;r++)if(e===i[r]){i.splice(r,1);break}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let i=this._anyOutgoingListeners;for(let r=0;r<i.length;r++)if(e===i[r]){i.splice(r,1);break}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(let i of this._anyOutgoingListeners.slice())i.apply(this,e.data)}}var ed,ef,ep=e.i(51890);function eg(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}eg.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),r=Math.floor(i*this.jitter*e);e=(1&Math.floor(10*i))==0?e-r:e+r}return 0|Math.min(e,this.max)},eg.prototype.reset=function(){this.attempts=0},eg.prototype.setMin=function(e){this.ms=e},eg.prototype.setMax=function(e){this.max=e},eg.prototype.setJitter=function(e){this.jitter=e};class em extends w{constructor(e,i){var r;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(i=e,e=void 0),(i=i||{}).path=i.path||"/socket.io",this.opts=i,T(this,i),this.reconnection(!1!==i.reconnection),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor(null!=(r=i.randomizationFactor)?r:.5),this.backoff=new eg({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==i.timeout?2e4:i.timeout),this._readyState="closed",this.uri=e;const n=i.parser||ep;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=!1!==i.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var i;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null==(i=this.backoff)||i.setMin(e),this)}randomizationFactor(e){var i;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null==(i=this.backoff)||i.setJitter(e),this)}reconnectionDelayMax(e){var i;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null==(i=this.backoff)||i.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Z(this.uri,this.opts);let i=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;let n=ec(i,"open",function(){r.onopen(),e&&e()}),s=i=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",i),e?e(i):this.maybeReconnectOnOpen()},o=ec(i,"error",s);if(!1!==this._timeout){let e=this._timeout,r=this.setTimeoutFn(()=>{n(),s(Error("timeout")),i.close()},e);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}return this.subs.push(n),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(ec(e,"ping",this.onping.bind(this)),ec(e,"data",this.ondata.bind(this)),ec(e,"error",this.onerror.bind(this)),ec(e,"close",this.onclose.bind(this)),ec(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){x(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,i){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new eu(this,e,i),this.nsps[e]=r),r}_destroy(e){for(let e of Object.keys(this.nsps))if(this.nsps[e].active)return;this._close()}_packet(e){let i=this.encoder.encode(e);for(let r=0;r<i.length;r++)this.engine.write(i[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,i){var r;this.cleanup(),null==(r=this.engine)||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let i=this.backoff.duration();this._reconnecting=!0;let r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},i);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}let e_={};function ev(e,i){let r;"object"==typeof e&&(i=e,e=void 0);let n=function(e,i="",r){let n=e;r=r||"u">typeof location&&location,null==e&&(e=r.protocol+"//"+r.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?r.protocol+e:r.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==r?r.protocol+"//"+e:"https://"+e),n=K(e)),!n.port&&(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";let s=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port+i,n.href=n.protocol+"://"+s+(r&&r.port===n.port?"":":"+n.port),n}(e,(i=i||{}).path||"/socket.io"),s=n.source,o=n.id,a=n.path,l=e_[o]&&a in e_[o].nsps;return i.forceNew||i["force new connection"]||!1===i.multiplex||l?r=new em(s,i):(e_[o]||(e_[o]=new em(s,i)),r=e_[o]),n.query&&!i.query&&(i.query=n.queryKey),r.socket(n.path,i)}Object.assign(ev,{Manager:em,Socket:eu,io:ev,connect:ev}),e.s(["io",0,ev],96085)},2576,e=>{"use strict";var i=e.i(71645),r=e.i(96085),n=e.i(70935);e.s(["useTaskEvents",0,function(e){let s=(0,i.useRef)(null),o=(0,i.useRef)(e);(0,i.useLayoutEffect)(()=>{o.current=e}),(0,i.useEffect)(()=>{let e=(0,r.io)((0,n.getServerUrl)(),{transports:["polling","websocket"]});return s.current=e,e.on("task:created",({task:e})=>{o.current.onTaskCreated(e)}),e.on("task:updated",({task:e})=>{o.current.onTaskUpdated(e)}),e.on("task:deleted",({taskId:e})=>{o.current.onTaskDeleted(e)}),()=>{e.disconnect(),s.current=null}},[])}])},48214,31245,e=>{"use strict";var i=e.i(75254);let r=(0,i.default)("circle-pause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);e.s(["CirclePause",0,r],48214);let n=(0,i.default)("bot",[["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"}]]);e.s(["Bot",0,n],31245)},57212,e=>{"use strict";let i=(0,e.i(75254).default)("wifi-off",[["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"}]]);e.s(["WifiOff",0,i],57212)},95468,73884,e=>{"use strict";var i=e.i(23287);e.s(["CheckCircle2",()=>i.default],95468);let r=(0,e.i(75254).default)("circle-x",[["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"}]]);e.s(["XCircle",0,r],73884)},86311,e=>{"use strict";let i=(0,e.i(75254).default)("message-square",[["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"}]]);e.s(["MessageSquare",0,i],86311)},30939,99894,93309,e=>{"use strict";let i,r,n,s,o,a,l,c,h,u,d,f;var p=e.i(18050),g=e.i(71645),m=e.i(37727),_=e.i(31278),v=e.i(48214),y=e.i(31245),b=e.i(68054),S=e.i(63209),w=e.i(57212),x=e.i(95468),C=e.i(73884),k=e.i(86311),E=e.i(68995),R=e.i(85902);function T({entry:e}){if(!e||"idle"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(v.CirclePause,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"idle"})]});if("connecting"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(_.Loader2,{className:"w-3 h-3 animate-spin"}),(0,p.jsx)("span",{children:"connecting"})]});if("error"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,p.jsx)(S.AlertCircle,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"error"})]});if("exited"===e.terminal||"paused"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(w.WifiOff,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:e.terminal})]});switch(e.claude){case"running":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-primary",children:[(0,p.jsx)(_.Loader2,{className:"w-3 h-3 animate-spin"}),(0,p.jsx)("span",{children:"running"})]});case"waiting":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-warning",children:[(0,p.jsx)(k.MessageSquare,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"waiting"})]});case"success":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-success",children:[(0,p.jsx)(x.CheckCircle2,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"success"})]});case"failure":case"error":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,p.jsx)(C.XCircle,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"failure"===e.claude?"failure":"error"})]});default:return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(v.CirclePause,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"idle"})]})}}e.s(["SessionTabs",0,function({tabs:e,activeTabId:i,onTabChange:r,onTabCreateTerminal:n,onTabCreateClaude:s,onTabDelete:o,tabStatusMap:a}){let l=(0,g.useRef)([]),[c,h]=(0,g.useState)({left:0,width:0}),[u,d]=(0,g.useState)(null);return(0,g.useEffect)(()=>{let r=e.findIndex(e=>e.tab_id===i);if(-1!==r&&l.current[r]){let e=l.current[r];e&&h({left:e.offsetLeft,width:e.offsetWidth})}},[i,e]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(E.ConfirmDialog,{open:null!==u,onOpenChange:e=>{e.open||d(null)},title:"Delete Tab",message:u?.isRunning?"This tab is running. Are you sure you want to delete it?":"Delete this tab?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{u&&o(u.tabId)},variant:"danger"}),(0,p.jsxs)("div",{className:"relative flex items-center gap-2 overflow-x-auto border-b border-border pb-1",children:[e.map((n,s)=>{let o=i===n.tab_id,c=a?.get(n.tab_id),h=(c?.claude==="running"||c?.claude==="waiting")&&c?.terminal==="connected";return(0,p.jsxs)("div",{ref:e=>{l.current[s]=e},onClick:()=>r(n.tab_id),className:`
|
|
11
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${i.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ug=({contentRef:e,descriptionId:i})=>{let r=uf("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return m.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");i&&r&&(document.getElementById(i)||console.warn(n))},[n,e,i]),null},um=Symbol.for("react.lazy"),u_=m[" use ".trim().toString()];function uv(e){var i;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===um&&"_payload"in e&&"object"==typeof(i=e._payload)&&null!==i&&"then"in i}var uy=Symbol("radix.slottable");function ub(e){return m.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===uy}var uS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,i)=>{var r,n;let s,o,a,l=(n=r=`Primitive.${i}`,(s=m.forwardRef((e,i)=>{let{children:r,...n}=e;if(uv(r)&&"function"==typeof u_&&(r=u_(r._payload)),m.isValidElement(r)){var s;let e,o,a=(s=r,(o=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(o=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),l=function(e,i){let r={...i};for(let n in i){let s=e[n],o=i[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...e)=>{let i=o(...e);return s(...e),i}:s&&(r[n]=s):"style"===n?r[n]={...s,...o}:"className"===n&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==m.Fragment&&(l.ref=i?cB(i,a):a),m.cloneElement(r,l)}return m.Children.count(r)>1?m.Children.only(null):null})).displayName=`${n}.SlotClone`,o=s,(a=m.forwardRef((e,i)=>{let{children:r,...n}=e;uv(r)&&"function"==typeof u_&&(r=u_(r._payload));let s=m.Children.toArray(r),a=s.find(ub);if(a){let e=a.props.children,r=s.map(i=>i!==a?i:m.Children.count(e)>1?m.Children.only(null):m.isValidElement(e)?e.props.children:null);return(0,g.jsx)(o,{...n,ref:i,children:m.isValidElement(e)?m.cloneElement(e,void 0,r):null})}return(0,g.jsx)(o,{...n,ref:i,children:r})})).displayName=`${r}.Slot`,a),c=m.forwardRef((e,r)=>{let{asChild:n,...s}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,g.jsx)(n?l:i,{...s,ref:r})});return c.displayName=`Primitive.${i}`,{...e,[i]:c}},{}),uw='[cmdk-group=""]',ux='[cmdk-group-items=""]',uC='[cmdk-item=""]',uk=`${uC}:not([aria-disabled="true"])`,uE="cmdk-item-select",uR="data-value",uT=(e,i,r)=>{var n;return n=e,function e(i,r,n,s,o,a,l){if(a===r.length)return o===i.length?1:.99;var c=`${o},${a}`;if(void 0!==l[c])return l[c];for(var h,u,d,f,p=s.charAt(a),g=n.indexOf(p,o),m=0;g>=0;)(h=e(i,r,n,s,g+1,a+1,l))>m&&(g===o?h*=1:cT.test(i.charAt(g-1))?(h*=.8,(d=i.slice(o,g-1).match(cD))&&o>0&&(h*=Math.pow(.999,d.length))):cL.test(i.charAt(g-1))?(h*=.9,(f=i.slice(o,g-1).match(cA))&&o>0&&(h*=Math.pow(.999,f.length))):(h*=.17,o>0&&(h*=Math.pow(.999,g-o))),i.charAt(g)!==r.charAt(a)&&(h*=.9999)),(h<.1&&n.charAt(g-1)===s.charAt(a+1)||s.charAt(a+1)===s.charAt(a)&&n.charAt(g-1)!==s.charAt(a))&&.1*(u=e(i,r,n,s,g+1,a+2,l))>h&&(h=.1*u),h>m&&(m=h),g=n.indexOf(p,g+1);return l[c]=m,m}(n=r&&r.length>0?`${n+" "+r.join(" ")}`:n,i,cM(n),cM(i),0,0,{})},uD=m.createContext(void 0),uL=m.createContext(void 0),uA=m.createContext(void 0),uM=m.forwardRef((e,i)=>{let r=uW(()=>{var i,r;return{search:"",value:null!=(r=null!=(i=e.value)?i:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=uW(()=>new Set),s=uW(()=>new Map),o=uW(()=>new Map),a=uW(()=>new Set),l=uH(e),{label:c,children:h,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:g,disablePointerSelection:_=!1,vimBindings:v=!0,...y}=e,b=cH(),S=cH(),w=cH(),x=m.useRef(null),C=uq();uj(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,k.emit()}},[u]),uj(()=>{C(6,A)},[]);let k=m.useMemo(()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>r.current,setState:(e,i,n)=>{var s,o,a,c;if(!Object.is(r.current[e],i)){if(r.current[e]=i,"search"===e)L(),T(),C(1,D);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(s=document.getElementById(b))||s.focus()}if(C(7,()=>{var e;r.current.selectedItemId=null==(e=M())?void 0:e.id,k.emit()}),n||C(5,A),(null==(o=l.current)?void 0:o.value)!==void 0){null==(c=(a=l.current).onValueChange)||c.call(a,null!=i?i:"");return}}k.emit()}},emit:()=>{a.current.forEach(e=>e())}}),[]),E=m.useMemo(()=>({value:(e,i,n)=>{var s;i!==(null==(s=o.current.get(e))?void 0:s.value)&&(o.current.set(e,{value:i,keywords:n}),r.current.filtered.items.set(e,R(i,n)),C(2,()=>{T(),k.emit()}))},item:(e,i)=>(n.current.add(e),i&&(s.current.has(i)?s.current.get(i).add(e):s.current.set(i,new Set([e]))),C(3,()=>{L(),T(),r.current.value||D(),k.emit()}),()=>{o.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let i=M();C(4,()=>{L(),(null==i?void 0:i.getAttribute("id"))===e&&D(),k.emit()})}),group:e=>(s.current.has(e)||s.current.set(e,new Set),()=>{o.current.delete(e),s.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:S,listInnerRef:x}),[]);function R(e,i){var n,s;let o=null!=(s=null==(n=l.current)?void 0:n.filter)?s:uT;return e?o(e,r.current.search,i):0}function T(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,i=[];r.current.filtered.groups.forEach(r=>{let n=s.current.get(r),o=0;n.forEach(i=>{o=Math.max(e.get(i),o)}),i.push([r,o])});let n=x.current;P().sort((i,r)=>{var n,s;let o=i.getAttribute("id"),a=r.getAttribute("id");return(null!=(n=e.get(a))?n:0)-(null!=(s=e.get(o))?s:0)}).forEach(e=>{let i=e.closest(ux);i?i.appendChild(e.parentElement===i?e:e.closest(`${ux} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${ux} > *`))}),i.sort((e,i)=>i[1]-e[1]).forEach(e=>{var i;let r=null==(i=x.current)?void 0:i.querySelector(`${uw}[${uR}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function D(){let e=P().find(e=>"true"!==e.getAttribute("aria-disabled")),i=null==e?void 0:e.getAttribute(uR);k.setState("value",i||void 0)}function L(){var e,i,a,c;if(!r.current.search||!1===l.current.shouldFilter){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let h=0;for(let s of n.current){let n=R(null!=(i=null==(e=o.current.get(s))?void 0:e.value)?i:"",null!=(c=null==(a=o.current.get(s))?void 0:a.keywords)?c:[]);r.current.filtered.items.set(s,n),n>0&&h++}for(let[e,i]of s.current)for(let n of i)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=h}function A(){var e,i,r;let n=M();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(i=n.closest(uw))?void 0:i.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function M(){var e;return null==(e=x.current)?void 0:e.querySelector(`${uC}[aria-selected="true"]`)}function P(){var e;return Array.from((null==(e=x.current)?void 0:e.querySelectorAll(uk))||[])}function O(e){let i=P()[e];i&&k.setState("value",i.getAttribute(uR))}function B(e){var i;let r=M(),n=P(),s=n.findIndex(e=>e===r),o=n[s+e];null!=(i=l.current)&&i.loop&&(o=s+e<0?n[n.length-1]:s+e===n.length?n[0]:n[s+e]),o&&k.setState("value",o.getAttribute(uR))}function N(e){let i=M(),r=null==i?void 0:i.closest(uw),n;for(;r&&!n;)n=null==(r=e>0?function(e,i){let r=e.nextElementSibling;for(;r;){if(r.matches(i))return r;r=r.nextElementSibling}}(r,uw):function(e,i){let r=e.previousElementSibling;for(;r;){if(r.matches(i))return r;r=r.previousElementSibling}}(r,uw))?void 0:r.querySelector(uk);n?k.setState("value",n.getAttribute(uR)):B(e)}let I=()=>O(P().length-1),F=e=>{e.preventDefault(),e.metaKey?I():e.altKey?N(1):B(1)},z=e=>{e.preventDefault(),e.metaKey?O(0):e.altKey?N(-1):B(-1)};return m.createElement(uS.div,{ref:i,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var i;null==(i=y.onKeyDown)||i.call(y,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||r))switch(e.key){case"n":case"j":v&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":v&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),O(0);break;case"End":e.preventDefault(),I();break;case"Enter":{e.preventDefault();let i=M();if(i){let e=new Event(uE);i.dispatchEvent(e)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:uK},c),uV(e,e=>m.createElement(uL.Provider,{value:k},m.createElement(uD.Provider,{value:E},e))))}),uP=m.forwardRef((e,i)=>{var r,n;let s=cH(),o=m.useRef(null),a=m.useContext(uA),l=m.useContext(uD),c=uH(e),h=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==a?void 0:a.forceMount;uj(()=>{if(!h)return l.item(s,null==a?void 0:a.id)},[h]);let u=uU(s,o,[e.value,e.children,o],e.keywords),d=m.useContext(uL),f=u$(e=>e.value&&e.value===u.current),p=u$(e=>!!h||!1===l.filter()||!e.search||e.filtered.items.get(s)>0);function g(){var e,i;_(),null==(i=(e=c.current).onSelect)||i.call(e,u.current)}function _(){d.setState("value",u.current,!0)}if(m.useEffect(()=>{let i=o.current;if(!(!i||e.disabled))return i.addEventListener(uE,g),()=>i.removeEventListener(uE,g)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:y,onSelect:b,forceMount:S,keywords:w,...x}=e;return m.createElement(uS.div,{ref:cB(o,i),...x,id:s,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||l.getDisablePointerSelection()?void 0:_,onClick:v?void 0:g},e.children)}),uO=m.forwardRef((e,i)=>{let{heading:r,children:n,forceMount:s,...o}=e,a=cH(),l=m.useRef(null),c=m.useRef(null),h=cH(),u=m.useContext(uD),d=u$(e=>!!s||!1===u.filter()||!e.search||e.filtered.groups.has(a));uj(()=>u.group(a),[]),uU(a,l,[e.value,e.heading,c]);let f=m.useMemo(()=>({id:a,forceMount:s}),[s]);return m.createElement(uS.div,{ref:cB(l,i),...o,"cmdk-group":"",role:"presentation",hidden:!d||void 0},r&&m.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),uV(e,e=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},m.createElement(uA.Provider,{value:f},e))))}),uB=m.forwardRef((e,i)=>{let{alwaysRender:r,...n}=e,s=m.useRef(null),o=u$(e=>!e.search);return r||o?m.createElement(uS.div,{ref:cB(s,i),...n,"cmdk-separator":"",role:"separator"}):null}),uN=m.forwardRef((e,i)=>{let{onValueChange:r,...n}=e,s=null!=e.value,o=m.useContext(uL),a=u$(e=>e.search),l=u$(e=>e.selectedItemId),c=m.useContext(uD);return m.useEffect(()=>{null!=e.value&&o.setState("search",e.value)},[e.value]),m.createElement(uS.input,{ref:i,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:s?e.value:a,onChange:e=>{s||o.setState("search",e.target.value),null==r||r(e.target.value)}})}),uI=m.forwardRef((e,i)=>{let{children:r,label:n="Suggestions",...s}=e,o=m.useRef(null),a=m.useRef(null),l=u$(e=>e.selectedItemId),c=m.useContext(uD);return m.useEffect(()=>{if(a.current&&o.current){let e=a.current,i=o.current,r,n=new ResizeObserver(()=>{r=requestAnimationFrame(()=>{let r=e.offsetHeight;i.style.setProperty("--cmdk-list-height",r.toFixed(1)+"px")})});return n.observe(e),()=>{cancelAnimationFrame(r),n.unobserve(e)}}},[]),m.createElement(uS.div,{ref:cB(o,i),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:c.listId},uV(e,e=>m.createElement("div",{ref:cB(a,c.listInnerRef),"cmdk-list-sizer":""},e)))}),uF=m.forwardRef((e,i)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:o,container:a,...l}=e;return m.createElement(h2,{open:r,onOpenChange:n},m.createElement(h9,{container:a},m.createElement(h7,{"cmdk-overlay":"",className:s}),m.createElement(ur,{"aria-label":e.label,"cmdk-dialog":"",className:o},m.createElement(uM,{ref:i,...l}))))}),uz=Object.assign(uM,{List:uI,Item:uP,Input:uN,Group:uO,Separator:uB,Dialog:uF,Empty:m.forwardRef((e,i)=>u$(e=>0===e.filtered.count)?m.createElement(uS.div,{ref:i,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:m.forwardRef((e,i)=>{let{progress:r,children:n,label:s="Loading...",...o}=e;return m.createElement(uS.div,{ref:i,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},uV(e,e=>m.createElement("div",{"aria-hidden":!0},e)))})});function uH(e){let i=m.useRef(e);return uj(()=>{i.current=e}),i}var uj="u"<typeof window?m.useEffect:m.useLayoutEffect;function uW(e){let i=m.useRef();return void 0===i.current&&(i.current=e()),i}function u$(e){let i=m.useContext(uL),r=()=>e(i.snapshot());return m.useSyncExternalStore(i.subscribe,r,r)}function uU(e,i,r,n=[]){let s=m.useRef(),o=m.useContext(uD);return uj(()=>{var a;let l=(()=>{var e;for(let i of r){if("string"==typeof i)return i.trim();if("object"==typeof i&&"current"in i)return i.current?null==(e=i.current.textContent)?void 0:e.trim():s.current}})(),c=n.map(e=>e.trim());o.value(e,l,c),null==(a=i.current)||a.setAttribute(uR,l),s.current=l}),s}var uq=()=>{let[e,i]=m.useState(),r=uW(()=>new Map);return uj(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),i({})}};function uV({asChild:e,children:i},r){let n;return e&&m.isValidElement(i)?m.cloneElement("function"==typeof(n=i.type)?n(i.props):"render"in n?n.render(i.props):i,{ref:i.ref},r(i.props.children)):r(i)}var uK={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};e.i(69068);var uY=e.i(25913),uX=e.i(10012);function uG({className:e,...i}){return(0,g.jsx)("textarea",{"data-slot":"textarea",className:(0,cC.cn)("flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-input/20 px-2 py-2 text-sm transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...i})}function uJ({className:e,...i}){return(0,g.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,cC.cn)("group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...i})}let uZ=(0,uY.cva)("flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]","block-start":"order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function uQ({className:e,align:i="inline-start",...r}){return(0,g.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":i,className:(0,cC.cn)(uZ({align:i}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...r})}(0,uY.cva)("flex items-center gap-2 rounded-md text-xs/relaxed shadow-none",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"gap-1","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-7 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});let u0=(0,r0.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["default",0,u0],54943);var u1=e.i(78745);e.s(["CheckIcon",()=>u1.default],78784);var u1=u1;function u2({className:e,...i}){return(0,g.jsx)(uz,{"data-slot":"command",className:(0,cC.cn)("flex size-full flex-col overflow-hidden rounded-xl bg-popover p-1 text-popover-foreground",e),...i})}function u5({className:e,...i}){return(0,g.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,g.jsxs)(uJ,{className:"h-8! bg-input/20 dark:bg-input/30",children:[(0,g.jsx)(uz.Input,{"data-slot":"command-input",className:(0,cC.cn)("w-full text-xs/relaxed outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...i}),(0,g.jsx)(uQ,{children:(0,g.jsx)(u0,{className:"size-3.5 shrink-0 opacity-50"})})]})})}function u3({className:e,...i}){return(0,g.jsx)(uz.List,{"data-slot":"command-list",className:(0,cC.cn)("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...i})}function u4({className:e,...i}){return(0,g.jsx)(uz.Empty,{"data-slot":"command-empty",className:(0,cC.cn)("py-6 text-center text-xs/relaxed",e),...i})}function u6({className:e,...i}){return(0,g.jsx)(uz.Group,{"data-slot":"command-group",className:(0,cC.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2.5 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...i})}function u9({className:e,children:i,...r}){return(0,g.jsxs)(uz.Item,{"data-slot":"command-item",className:(0,cC.cn)("group/command-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2.5 py-1.5 text-xs/relaxed outline-hidden select-none in-data-[slot=dialog-content]:rounded-md data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-selected:*:[svg]:text-foreground",e),...r,children:[i,(0,g.jsx)(u1.default,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}function u8({options:e,value:i,onChange:r,placeholder:n="Select option",disabled:s=!1,className:o="",allowCustomValue:a=!1,multiple:l=!1,onClear:c,showClearButton:h=!1}){let[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(""),_=(0,m.useRef)(null),v=(0,m.useMemo)(()=>Array.isArray(i)?i:[i],[i]),y=(0,m.useMemo)(()=>{if(l){if(1===v.length&&"all"===v[0]){let i=e.find(e=>"all"===e.value);return i?.label||""}return v.filter(e=>"all"!==e).map(i=>e.find(e=>e.value===i)?.label).filter(Boolean).join(", ")}return v.map(i=>e.find(e=>e.value===i)?.label).filter(Boolean).join(", ")},[v,e,l]),b=(0,m.useMemo)(()=>{let i={};for(let r of e){let e=r.group||"Other";i[e]||(i[e]=[]),i[e].push(r)}return i},[e]),S=(0,m.useMemo)(()=>Object.keys(b).length>1||!b.Other,[b]),w=e=>{if(l){let i=[...v],n=i.indexOf(e);n>=0?i.splice(n,1):i.push(e),r(i.length>0?i:[])}else r(e),d(!1)},x=()=>{a&&f&&!l&&(r(f),d(!1))};return(0,g.jsxs)(ck,{open:u,onOpenChange:e=>{d(e),e||p("")},children:[(0,g.jsxs)("div",{className:`relative ${o}`,children:[(0,g.jsx)(cE,{ref:_,disabled:s,className:`flex h-9 w-full items-center justify-between pl-3 ${h?"pr-16":"pr-10"} border border-input rounded-md text-sm bg-input/20 dark:bg-input/30 text-foreground transition-colors outline-none hover:border-ring focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 data-[state=open]:border-ring data-[state=open]:ring-2 data-[state=open]:ring-ring/30 disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none cursor-pointer overflow-hidden text-ellipsis whitespace-nowrap text-left shadow-xs`,children:(0,g.jsx)("span",{className:"truncate",children:y||(0,g.jsx)("span",{className:"text-muted-foreground",children:n})})}),h&&c&&(0,g.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),c()},className:"absolute right-8 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors cursor-pointer z-10","aria-label":"Clear selection",children:(0,g.jsx)(ad.X,{className:"w-4 h-4"})}),(0,g.jsx)(au,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground pointer-events-none"})]}),(0,g.jsx)(cR,{className:"w-[var(--anchor-width)] p-0",align:"start",sideOffset:4,children:(0,g.jsxs)(u2,{filter:(i,r)=>{let n=e.find(e=>e.value===i);return n?+!!`${n.label} ${n.group||""}`.toLowerCase().includes(r.toLowerCase()):0},children:[(0,g.jsx)(u5,{placeholder:"Search...",value:f,onValueChange:p,onKeyDown:e=>{"Enter"===e.key&&a&&x()}}),(0,g.jsxs)(u3,{children:[(0,g.jsx)(u4,{children:a&&f?(0,g.jsxs)("button",{type:"button",className:"w-full px-2 py-1.5 text-left text-xs cursor-pointer hover:bg-accent rounded",onClick:x,children:['Use "',f,'"']}):"No options found"}),S?Object.entries(b).map(([e,i])=>(0,g.jsx)(u6,{heading:e,children:i.map(e=>(0,g.jsx)(u9,{value:e.value,"data-checked":v.includes(e.value),onSelect:()=>w(e.value),children:(0,g.jsx)("span",{className:"truncate",children:e.label})},e.value))},e)):(0,g.jsx)(u6,{children:e.map(e=>(0,g.jsx)(u9,{value:e.value,"data-checked":v.includes(e.value),onSelect:()=>w(e.value),children:(0,g.jsx)("span",{className:"truncate",children:e.label})},e.value))})]})]})})]})}let u7=(0,r0.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var de=e.i(86536),dt=e.i(70935);function di({value:e,onChange:i,editorRef:r,theme:n,activeTab:s,onTabChange:o,disabled:a,onFocusChange:l}){let c=(0,m.useCallback)(e=>{i(e??"")},[i]),h=(0,g.jsx)("div",{className:"border border-border rounded overflow-hidden h-full",children:(0,g.jsx)(_.Editor,{height:"100%",defaultLanguage:"markdown",value:e,onChange:c,onMount:e=>{r.current=e,e.layout(),e.onDidFocusEditorText(()=>l?.(!0)),e.onDidBlurEditorText(()=>l?.(!1))},options:{minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",fontSize:13,scrollBeyondLastLine:!1,readOnly:a},theme:"dark"===n?"vs-dark":"vs-light"})}),u=(0,g.jsx)("div",{className:"border border-border rounded overflow-y-auto h-full p-4 prose prose-sm prose-slate dark:prose-invert max-w-none",children:e?(0,g.jsx)(iW,{remarkPlugins:[rQ],components:as,children:e}):(0,g.jsx)("p",{className:"text-muted-foreground italic",children:"No content"})});return(0,g.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,g.jsxs)("div",{className:"flex gap-1 mb-2 md:hidden flex-shrink-0",children:[(0,g.jsxs)(r3.Button,{type:"button",variant:"editor"===s?"default":"outline",size:"sm",onClick:()=>o("editor"),children:[(0,g.jsx)(u7,{className:"w-4 h-4 mr-1"}),"Editor"]}),(0,g.jsxs)(r3.Button,{type:"button",variant:"preview"===s?"default":"outline",size:"sm",onClick:()=>o("preview"),children:[(0,g.jsx)(de.Eye,{className:"w-4 h-4 mr-1"}),"Preview"]})]}),(0,g.jsxs)("div",{className:"hidden md:grid md:grid-cols-2 md:gap-4 flex-1 min-h-0",children:[h,u]}),(0,g.jsx)("div",{className:"md:hidden flex-1 min-h-0",children:"editor"===s?h:u})]})}e.s(["TaskDialog",0,function({mode:e,isOpen:i,onClose:r,repositories:n=[],task:s,onUpdate:o}){let a=ac(),[l,c]=(0,m.useState)(""),[h,u]=(0,m.useState)([]),[d,f]=(0,m.useState)(""),[p,_]=(0,m.useState)(!1),[v,y]=(0,m.useState)(""),[b,S]=(0,m.useState)({title:"",description:"",owner:"",repo:"",branch:"",baseBranch:"",status:"backlog",effort:void 0,order:void 0}),[w,x]=(0,m.useState)(!1),[C,k]=(0,m.useState)({}),[E,R]=(0,m.useState)("editor"),[T,D]=(0,m.useState)(!1),L=(0,m.useRef)(null),{effectiveTheme:A}=(0,ao.useTheme)();(0,m.useEffect)(()=>{"edit"===e&&s&&S({title:s.title,description:s.description,owner:s.owner,repo:s.repo,branch:s.branch,baseBranch:"",status:s.status,effort:s.effort,order:s.order})},[e,s,i]);let M=(0,m.useMemo)(()=>n.map(e=>({value:`${e.owner}/${e.repo}`,label:`${e.owner}/${e.repo}`})),[n]),P=(0,m.useMemo)(()=>h.map(e=>({value:e,label:e===d?`${e} (default)`:e})),[h,d]);(0,m.useEffect)(()=>{if("create"===e){if(!l){u([]),f(""),S(e=>({...e,baseBranch:""}));return}(async()=>{_(!0),y("");try{let[e,i]=l.split("/"),r=await fetch((0,dt.apiUrl)(`/api/repos/${e}/${i}/branches`));if(!r.ok)throw Error("Failed to fetch branches");let n=await r.json();u(n.data.branches),f(n.data.defaultBranch),S(e=>({...e,baseBranch:n.data.defaultBranch}))}catch(e){console.error("Failed to fetch branches:",e),y("Failed to load branches. Repository may not be initialized."),u([]),f("")}finally{_(!1)}})()}},[l,e]);let O=async i=>{if(i.preventDefault(),k({}),"create"===e){x(!0);try{let e=await fetch((0,dt.apiUrl)("/api/tasks/validate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:b.title,owner:b.owner,repo:b.repo,branch:b.branch})}),i=await e.json();if(!i.valid){let e={};i.errors.forEach(i=>{e[i.field]=i.message}),k(e),x(!1);return}let n={title:b.title,description:b.description,owner:b.owner,repo:b.repo,branch:b.branch,baseBranch:b.baseBranch};r(),c(""),S({title:"",description:"",owner:"",repo:"",branch:"",baseBranch:"",status:"backlog",effort:void 0,order:void 0}),x(!1);let s=a.loading("Creating task...",n.title);try{if(!(await fetch((0,dt.apiUrl)("/api/tasks"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).ok)throw Error("Failed to create task");a.dismiss(s)}catch(i){let e=i instanceof Error?i.message:"Unknown error";a.error(s,"Failed to create task",e)}}catch(i){x(!1);let e=i instanceof Error?i.message:"Validation failed";a.error(void 0,"Validation failed",e)}}else if("edit"===e&&o&&s){x(!0);try{let e=await o(s.id,{title:b.title,description:b.description,status:b.status,effort:b.effort,order:b.order});if(e.success)r();else if(e.errors){let i={};e.errors.forEach(e=>{i[e.field]=e.message}),k(i)}}catch(e){console.error("Failed to update task:",e),k({global:e instanceof Error?e.message:"Failed to update task. Please try again."})}finally{x(!1)}}},B="create"===e,N=B?"Add New Task":"Edit Task",I=B?"Create":"Save";return(0,g.jsxs)(ah.Dialog,{open:i,onOpenChange:e=>{e.open||w||r()},title:N,maxWidth:B?"2xl":"6xl",fullScreen:!B,showCloseButton:!w,dismissOnEsc:!T,children:[w&&(0,g.jsx)("div",{className:"absolute inset-0 bg-card bg-opacity-90 rounded-lg flex items-center justify-center z-10",children:(0,g.jsx)(aa.LoadingSpinner,{size:"lg",message:B?"Creating task...":"Saving task..."})}),C.global&&(0,g.jsx)("div",{className:"mb-4 p-3 bg-destructive/10 border border-destructive/50 rounded text-destructive text-sm",children:C.global}),(0,g.jsxs)("form",{onSubmit:O,className:B?"space-y-4":"flex flex-col gap-4 flex-1 min-h-0 overflow-hidden",children:[B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Repository *"}),(0,g.jsx)(u8,{options:M,value:l,onChange:e=>{let i=Array.isArray(e)?e[0]||"":e;if(c(i),i){let[e,r]=i.split("/");S(i=>({...i,owner:e,repo:r,baseBranch:""}))}else S(e=>({...e,owner:"",repo:"",baseBranch:""}))},placeholder:"Select repository",disabled:w})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Title *"}),(0,g.jsx)(uX.Input,{type:"text",required:!0,maxLength:200,value:b.title,onChange:e=>S({...b,title:e.target.value}),className:"w-full",disabled:w})]}),!B&&s&&(0,g.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 p-3 bg-muted/50 rounded-md text-sm",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Repository"}),(0,g.jsxs)("p",{className:"text-muted-foreground",children:[s.owner,"/",s.repo]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Branch"}),(0,g.jsx)("p",{className:"text-muted-foreground",children:s.branch})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Base Branch"}),(0,g.jsx)("p",{className:"text-muted-foreground",children:s.baseBranch||"N/A"})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("span",{className:"font-medium text-foreground",children:"Worktree"}),(0,g.jsx)("p",{className:"text-muted-foreground capitalize",children:s.worktreeStatus})]})]}),(0,g.jsxs)("div",{className:B?"":"flex flex-col flex-1 min-h-0",children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground flex-shrink-0",children:"Description"}),B?(0,g.jsx)(uG,{maxLength:5e3,value:b.description,onChange:e=>S({...b,description:e.target.value}),className:"min-h-24 w-full",disabled:w}):(0,g.jsx)(di,{value:b.description,onChange:e=>S(i=>({...i,description:e})),editorRef:L,theme:A,activeTab:E,onTabChange:R,disabled:w,onFocusChange:D})]}),!B&&(0,g.jsxs)("div",{className:"grid grid-cols-3 gap-4 flex-shrink-0",children:[(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Status"}),(0,g.jsxs)("select",{value:b.status,onChange:e=>S({...b,status:e.target.value}),className:"w-full h-9 pl-3 pr-10 py-1 rounded-md border border-input bg-transparent text-sm shadow-xs text-foreground",disabled:w,children:[(0,g.jsx)("option",{value:"backlog",children:"Backlog"}),(0,g.jsx)("option",{value:"planning",children:"Planning"}),(0,g.jsx)("option",{value:"tasking",children:"Tasking"}),(0,g.jsx)("option",{value:"coding",children:"Coding"}),(0,g.jsx)("option",{value:"reviewing",children:"Reviewing"}),(0,g.jsx)("option",{value:"done",children:"Done"})]})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Effort (h)"}),(0,g.jsx)(uX.Input,{type:"number",step:"0.5",min:"0.5",max:"40",value:b.effort??"",onChange:e=>S({...b,effort:parseFloat(e.target.value)||void 0}),className:"w-full",placeholder:"2.5",disabled:w})]}),(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Order"}),(0,g.jsx)(uX.Input,{type:"number",min:"0",value:b.order??"",onChange:e=>S({...b,order:parseInt(e.target.value)||void 0}),className:"w-full",placeholder:"0",disabled:w})]})]}),B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"Base Branch *"}),p?(0,g.jsxs)("div",{className:"w-full h-9 px-3 rounded-md border border-input bg-transparent text-muted-foreground flex items-center gap-2",children:[(0,g.jsx)(aa.LoadingSpinner,{size:"sm"}),(0,g.jsx)("span",{className:"text-xs",children:"Loading branches..."})]}):h.length>0?(0,g.jsx)(u8,{options:P,value:b.baseBranch,onChange:e=>{let i=Array.isArray(e)?e[0]||"":e;S({...b,baseBranch:i})},placeholder:"Select base branch",disabled:w}):(0,g.jsx)("div",{className:"w-full h-9 px-3 rounded-md border border-input bg-transparent text-sm text-muted-foreground flex items-center",children:v||"Select repository first"}),(0,g.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Your new branch will be created from this branch"})]}),B&&(0,g.jsxs)("div",{children:[(0,g.jsx)("label",{className:"block text-sm font-medium mb-1 text-foreground",children:"New Branch Name *"}),(0,g.jsx)(uX.Input,{type:"text",required:!0,maxLength:255,value:b.branch,onChange:e=>S({...b,branch:e.target.value}),className:`w-full ${C.branch?"border-destructive":""}`,placeholder:"feature/new-feature",disabled:w,"aria-invalid":!!C.branch}),C.branch&&(0,g.jsx)("p",{className:"text-xs text-destructive mt-1",children:C.branch}),!C.branch&&(0,g.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["Will be created from ",b.baseBranch||"base branch"]})]}),(0,g.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,g.jsx)(r3.Button,{type:"button",variant:"outline",size:"lg",onClick:r,className:"active:scale-95",disabled:w,children:"Cancel"}),(0,g.jsx)(r3.Button,{type:"submit",size:"lg",className:"active:scale-95",disabled:w||B&&p,children:I})]})]})]})}],10483)},96085,e=>{"use strict";let i,r,n,s=Object.create(null);s.open="0",s.close="1",s.ping="2",s.pong="3",s.message="4",s.upgrade="5",s.noop="6";let o=Object.create(null);Object.keys(s).forEach(e=>{o[s[e]]=e});let a={type:"error",data:"parser error"},l="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),c="function"==typeof ArrayBuffer,h=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,u=({type:e,data:i},r,n)=>{if(l&&i instanceof Blob)if(r)return n(i);else return d(i,n);if(c&&(i instanceof ArrayBuffer||h(i)))if(r)return n(i);else return d(new Blob([i]),n);return n(s[e]+(i||""))},d=(e,i)=>{let r=new FileReader;return r.onload=function(){i("b"+(r.result.split(",")[1]||""))},r.readAsDataURL(e)};function f(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g="u"<typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<p.length;e++)g[p.charCodeAt(e)]=e;let m="function"==typeof ArrayBuffer,_=(e,i)=>{if("string"!=typeof e)return{type:"message",data:y(e,i)};let r=e.charAt(0);return"b"===r?{type:"message",data:v(e.substring(1),i)}:o[r]?e.length>1?{type:o[r],data:e.substring(1)}:{type:o[r]}:a},v=(e,i)=>m?y((e=>{let i=.75*e.length,r=e.length,n,s=0,o,a,l,c;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);let h=new ArrayBuffer(i),u=new Uint8Array(h);for(n=0;n<r;n+=4)o=g[e.charCodeAt(n)],a=g[e.charCodeAt(n+1)],l=g[e.charCodeAt(n+2)],c=g[e.charCodeAt(n+3)],u[s++]=o<<2|a>>4,u[s++]=(15&a)<<4|l>>2,u[s++]=(3&l)<<6|63&c;return h})(e),i):{base64:!0,data:e},y=(e,i)=>"blob"===i?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer;function b(e){return e.reduce((e,i)=>e+i.length,0)}function S(e,i){if(e[0].length===i)return e.shift();let r=new Uint8Array(i),n=0;for(let s=0;s<i;s++)r[s]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}function w(e){if(e){var i=e;for(var r in w.prototype)i[r]=w.prototype[r];return i}}w.prototype.on=w.prototype.addEventListener=function(e,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(i),this},w.prototype.once=function(e,i){function r(){this.off(e,r),i.apply(this,arguments)}return r.fn=i,this.on(e,r),this},w.prototype.off=w.prototype.removeListener=w.prototype.removeAllListeners=w.prototype.removeEventListener=function(e,i){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<n.length;s++)if((r=n[s])===i||r.fn===i){n.splice(s,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},w.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var i=Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)i[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,s=r.length;n<s;++n)r[n].apply(this,i)}return this},w.prototype.emitReserved=w.prototype.emit,w.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},w.prototype.hasListeners=function(e){return!!this.listeners(e).length};let x="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,i)=>i(e,0),C="u">typeof self?self:"u">typeof window?window:Function("return this")();function k(e,...i){return i.reduce((i,r)=>(e.hasOwnProperty(r)&&(i[r]=e[r]),i),{})}let E=C.setTimeout,R=C.clearTimeout;function T(e,i){i.useNativeTimers?(e.setTimeoutFn=E.bind(C),e.clearTimeoutFn=R.bind(C)):(e.setTimeoutFn=C.setTimeout.bind(C),e.clearTimeoutFn=C.clearTimeout.bind(C))}function D(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class L extends Error{constructor(e,i,r){super(e),this.description=i,this.context=r,this.type="TransportError"}}class A extends w{constructor(e){super(),this.writable=!1,T(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,i,r){return super.emitReserved("error",new L(e,i,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let i=_(e,this.socket.binaryType);this.onPacket(i)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,i={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){let e=this.opts.hostname;return -1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&443!==Number(this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){let i=function(e){let i="";for(let r in e)e.hasOwnProperty(r)&&(i.length&&(i+="&"),i+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return i}(e);return i.length?"?"+i:""}}class M extends A{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let i=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||i()})),this.writable||(e++,this.once("drain",function(){--e||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let i=e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};((e,i)=>{let r=e.split("\x1e"),n=[];for(let e=0;e<r.length;e++){let s=_(r[e],i);if(n.push(s),"error"===s.type)break}return n})(e,this.socket.binaryType).forEach(i),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){var i;let r,n,s;this.writable=!1,i=e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})},n=Array(r=e.length),s=0,e.forEach((e,o)=>{u(e,!1,e=>{n[o]=e,++s===r&&i(n.join("\x1e"))})})}uri(){let e=this.opts.secure?"https":"http",i=this.query||{};return!1!==this.opts.timestampRequests&&(i[this.opts.timestampParam]=D()),this.supportsBinary||i.sid||(i.b64=1),this.createUri(e,i)}}let P=!1;try{P="u">typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}let O=P;function B(){}class N extends M{constructor(e){if(super(e),"u">typeof location){const i="https:"===location.protocol;let r=location.port;r||(r=i?"443":"80"),this.xd="u">typeof location&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,i){let r=this.request({method:"POST",data:e});r.on("success",i),r.on("error",(e,i)=>{this.onError("xhr post error",e,i)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e,i)=>{this.onError("xhr poll error",e,i)}),this.pollXhr=e}}class I extends w{constructor(e,i,r){super(),this.createRequest=e,T(this,r),this._opts=r,this._method=r.method||"GET",this._uri=i,this._data=void 0!==r.data?r.data:null,this._create()}_create(){var e;let i=k(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(i);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders)for(let e in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}catch(e){}if("POST"===this._method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{r.setRequestHeader("Accept","*/*")}catch(e){}null==(e=this._opts.cookieJar)||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;3===r.readyState&&(null==(e=this._opts.cookieJar)||e.parseCookies(r.getResponseHeader("set-cookie"))),4===r.readyState&&(200===r.status||1223===r.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof r.status?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}"u">typeof document&&(this._index=I.requestsCount++,I.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=B,e)try{this._xhr.abort()}catch(e){}"u">typeof document&&delete I.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}function F(){for(let e in I.requests)I.requests.hasOwnProperty(e)&&I.requests[e].abort()}I.requestsCount=0,I.requests={},"u">typeof document&&("function"==typeof attachEvent?attachEvent("onunload",F):"function"==typeof addEventListener&&addEventListener("onpagehide"in C?"pagehide":"unload",F,!1));let z=(n=H({xdomain:!1}))&&null!==n.responseType;function H(e){let i=e.xdomain;try{if("u">typeof XMLHttpRequest&&(!i||O))return new XMLHttpRequest}catch(e){}if(!i)try{return new C[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(e){}}let j="u">typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class W extends A{get name(){return"websocket"}doOpen(){let e=this.uri(),i=this.opts.protocols,r=j?{}:k(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,i,r)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let i=0;i<e.length;i++){let r=e[i],n=i===e.length-1;u(r,this.supportsBinary,e=>{try{this.doWrite(r,e)}catch(e){}n&&x(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=D()),this.supportsBinary||(i.b64=1),this.createUri(e,i)}}let $=C.WebSocket||C.MozWebSocket,U={websocket:class extends W{createSocket(e,i,r){return j?new $(e,i,r):i?new $(e,i):new $(e)}doWrite(e,i){this.ws.send(i)}},webtransport:class extends A{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{var n,s;let o,d,p,g,m=(n=Number.MAX_SAFE_INTEGER,s=this.socket.binaryType,r||(r=new TextDecoder),o=[],d=0,p=-1,g=!1,new TransformStream({transform(e,i){for(o.push(e);;){if(0===d){if(1>b(o))break;let e=S(o,1);g=(128&e[0])==128,d=(p=127&e[0])<126?3:126===p?1:2}else if(1===d){if(2>b(o))break;let e=S(o,2);p=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),d=3}else if(2===d){if(8>b(o))break;let e=S(o,8),r=new DataView(e.buffer,e.byteOffset,e.length),n=r.getUint32(0);if(n>2097151){i.enqueue(a);break}p=0x100000000*n+r.getUint32(4),d=3}else{if(b(o)<p)break;let e=S(o,p);i.enqueue(_(g?e:r.decode(e),s)),d=0}if(0===p||p>n){i.enqueue(a);break}}}})),v=e.readable.pipeThrough(m).getReader(),y=new TransformStream({transform(e,r){var n;n=i=>{let n,s=i.length;if(s<126)new DataView((n=new Uint8Array(1)).buffer).setUint8(0,s);else if(s<65536){let e=new DataView((n=new Uint8Array(3)).buffer);e.setUint8(0,126),e.setUint16(1,s)}else{let e=new DataView((n=new Uint8Array(9)).buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(s))}e.data&&"string"!=typeof e.data&&(n[0]|=128),r.enqueue(n),r.enqueue(i)},l&&e.data instanceof Blob?e.data.arrayBuffer().then(f).then(n):c&&(e.data instanceof ArrayBuffer||h(e.data))?n(f(e.data)):u(e,!1,e=>{i||(i=new TextEncoder),n(i.encode(e))})}});y.readable.pipeTo(e.writable),this._writer=y.writable.getWriter();let w=()=>{v.read().then(({done:e,value:i})=>{e||(this.onPacket(i),w())}).catch(e=>{})};w();let x={type:"open"};this.query.sid&&(x.data=`{"sid":"${this.query.sid}"}`),this._writer.write(x).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let i=0;i<e.length;i++){let r=e[i],n=i===e.length-1;this._writer.write(r).then(()=>{n&&x(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null==(e=this._transport)||e.close()}},polling:class extends N{constructor(e){super(e);const i=e&&e.forceBase64;this.supportsBinary=z&&!i}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new I(H,this.uri(),e)}}},q=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,V=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function K(e){var i,r;let n,s;if(e.length>8e3)throw"URI too long";let o=e,a=e.indexOf("["),l=e.indexOf("]");-1!=a&&-1!=l&&(e=e.substring(0,a)+e.substring(a,l).replace(/:/g,";")+e.substring(l,e.length));let c=q.exec(e||""),h={},u=14;for(;u--;)h[V[u]]=c[u]||"";return -1!=a&&-1!=l&&(h.source=o,h.host=h.host.substring(1,h.host.length-1).replace(/;/g,":"),h.authority=h.authority.replace("[","").replace("]","").replace(/;/g,":"),h.ipv6uri=!0),n=(i=h.path).replace(/\/{2,9}/g,"/").split("/"),("/"==i.slice(0,1)||0===i.length)&&n.splice(0,1),"/"==i.slice(-1)&&n.splice(n.length-1,1),h.pathNames=n,r=h.query,s={},r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,i,r){i&&(s[i]=r)}),h.queryKey=s,h}let Y="function"==typeof addEventListener&&"function"==typeof removeEventListener,X=[];Y&&addEventListener("offline",()=>{X.forEach(e=>e())},!1);class G extends w{constructor(e,i){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(i=e,e=null),e){const r=K(e);i.hostname=r.host,i.secure="https"===r.protocol||"wss"===r.protocol,i.port=r.port,r.query&&(i.query=r.query)}else i.host&&(i.hostname=K(i.host).host);T(this,i),this.secure=null!=i.secure?i.secure:"u">typeof location&&"https:"===location.protocol,i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||("u">typeof location?location.hostname:"localhost"),this.port=i.port||("u">typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(e=>{let i=e.prototype.name;this.transports.push(i),this._transportsByName[i]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let i={},r=e.split("&");for(let e=0,n=r.length;e<n;e++){let n=r[e].split("=");i[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return i}(this.opts.query)),Y&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},X.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let i=Object.assign({},this.opts.query);i.EIO=4,i.transport=e,this.id&&(i.sid=this.id);let r=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);let e=this.opts.rememberUpgrade&&G.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";let i=this.createTransport(e);i.open(),this.setTransport(i)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",G.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let i=Error("server error");i.code=e.data,this._onError(i);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let i=0;i<this.writeBuffer.length;i++){let r=this.writeBuffer[i].data;if(r&&(e+="string"==typeof r?function(e){let i=0,r=0;for(let n=0,s=e.length;n<s;n++)(i=e.charCodeAt(n))<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(n++,r+=4);return r}(r):Math.ceil(1.33*(r.byteLength||r.size))),i>0&&e>this._maxPayload)return this.writeBuffer.slice(0,i);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,x(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,i,r){return this._sendPacket("message",e,i,r),this}send(e,i,r){return this._sendPacket("message",e,i,r),this}_sendPacket(e,i,r,n){if("function"==typeof i&&(n=i,i=void 0),"function"==typeof r&&(n=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;let s={type:e,data:i,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),n&&this.once("flush",n),this.flush()}close(){let e=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),e()},r=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(G.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,i){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Y&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=X.indexOf(this._offlineEventListener);-1!==e&&X.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,i),this.writeBuffer=[],this._prevBufferLen=0}}}G.protocol=4;class J extends G{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let i=this.createTransport(e),r=!1;G.priorWebsocketSuccess=!1;let n=()=>{r||(i.send([{type:"ping",data:"probe"}]),i.once("packet",e=>{if(!r)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;G.priorWebsocketSuccess="websocket"===i.name,this.transport.pause(()=>{r||"closed"!==this.readyState&&(h(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{let e=Error("probe error");e.transport=i.name,this.emitReserved("upgradeError",e)}}))};function s(){r||(r=!0,h(),i.close(),i=null)}let o=e=>{let r=Error("probe error: "+e);r.transport=i.name,s(),this.emitReserved("upgradeError",r)};function a(){o("transport closed")}function l(){o("socket closed")}function c(e){i&&e.name!==i.name&&s()}let h=()=>{i.removeListener("open",n),i.removeListener("error",o),i.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};i.once("open",n),i.once("error",o),i.once("close",a),this.once("close",l),this.once("upgrading",c),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{r||i.open()},200):i.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let i=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&i.push(e[r]);return i}}class Z extends J{constructor(e,i={}){const r="object"==typeof e?e:i;(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(e=>U[e]).filter(e=>!!e)),super(e,r)}}Z.protocol;let Q="function"==typeof ArrayBuffer,ee=Object.prototype.toString,et="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===ee.call(Blob),ei="function"==typeof File||"u">typeof File&&"[object FileConstructor]"===ee.call(File);function er(e){return Q&&(e instanceof ArrayBuffer||("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer))||et&&e instanceof Blob||ei&&e instanceof File}let en=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];(ed=ef||(ef={}))[ed.CONNECT=0]="CONNECT",ed[ed.DISCONNECT=1]="DISCONNECT",ed[ed.EVENT=2]="EVENT",ed[ed.ACK=3]="ACK",ed[ed.CONNECT_ERROR=4]="CONNECT_ERROR",ed[ed.BINARY_EVENT=5]="BINARY_EVENT",ed[ed.BINARY_ACK=6]="BINARY_ACK";class es extends w{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},"function"==typeof e?{reviver:e}:e)}add(e){let i;if("string"==typeof e){if(this.reconstructor)throw Error("got plaintext data when reconstructing a packet");let r=(i=this.decodeString(e)).type===ef.BINARY_EVENT;r||i.type===ef.BINARY_ACK?(i.type=r?ef.EVENT:ef.ACK,this.reconstructor=new eo(i),0===i.attachments&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(er(e)||e.base64)if(this.reconstructor)(i=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw Error("got binary data when not reconstructing a packet");else throw Error("Unknown type: "+e)}decodeString(e){let i=0,r={type:Number(e.charAt(0))};if(void 0===ef[r.type])throw Error("unknown packet type "+r.type);if(r.type===ef.BINARY_EVENT||r.type===ef.BINARY_ACK){let n=i+1;for(;"-"!==e.charAt(++i)&&i!=e.length;);let s=e.substring(n,i);if(s!=Number(s)||"-"!==e.charAt(i))throw Error("Illegal attachments");let o=Number(s);if(!ea(o)||o<0)throw Error("Illegal attachments");if(o>this.opts.maxAttachments)throw Error("too many attachments");r.attachments=o}if("/"===e.charAt(i+1)){let n=i+1;for(;++i&&","!==e.charAt(i)&&i!==e.length;);r.nsp=e.substring(n,i)}else r.nsp="/";let n=e.charAt(i+1);if(""!==n&&Number(n)==n){let n=i+1;for(;++i;){let r=e.charAt(i);if(null==r||Number(r)!=r){--i;break}if(i===e.length)break}r.id=Number(e.substring(n,i+1))}if(e.charAt(++i)){let n=this.tryParse(e.substr(i));if(es.isPayloadValid(r.type,n))r.data=n;else throw Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch(e){return!1}}static isPayloadValid(e,i){switch(e){case ef.CONNECT:return el(i);case ef.DISCONNECT:return void 0===i;case ef.CONNECT_ERROR:return"string"==typeof i||el(i);case ef.EVENT:case ef.BINARY_EVENT:return Array.isArray(i)&&("number"==typeof i[0]||"string"==typeof i[0]&&-1===en.indexOf(i[0]));case ef.ACK:case ef.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class eo{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var i,r;let e=(i=this.reconPack,r=this.buffers,i.data=function e(i,r){if(!i)return i;if(i&&!0===i._placeholder){if("number"==typeof i.num&&i.num>=0&&i.num<r.length)return r[i.num];throw Error("illegal attachments")}if(Array.isArray(i))for(let n=0;n<i.length;n++)i[n]=e(i[n],r);else if("object"==typeof i)for(let n in i)Object.prototype.hasOwnProperty.call(i,n)&&(i[n]=e(i[n],r));return i}(i.data,r),delete i.attachments,i);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}let ea=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function el(e){return"[object Object]"===Object.prototype.toString.call(e)}function ec(e,i,r){return e.on(i,r),function(){e.off(i,r)}}e.s(["Decoder",0,es,"Encoder",0,class{constructor(e){this.replacer=e}encode(e){return(e.type===ef.EVENT||e.type===ef.ACK)&&function e(i,r){if(!i||"object"!=typeof i)return!1;if(Array.isArray(i)){for(let r=0,n=i.length;r<n;r++)if(e(i[r]))return!0;return!1}if(er(i))return!0;if(i.toJSON&&"function"==typeof i.toJSON&&1==arguments.length)return e(i.toJSON(),!0);for(let r in i)if(Object.prototype.hasOwnProperty.call(i,r)&&e(i[r]))return!0;return!1}(e)?this.encodeAsBinary({type:e.type===ef.EVENT?ef.BINARY_EVENT:ef.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let i=""+e.type;return(e.type===ef.BINARY_EVENT||e.type===ef.BINARY_ACK)&&(i+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(i+=e.nsp+","),null!=e.id&&(i+=e.id),null!=e.data&&(i+=JSON.stringify(e.data,this.replacer)),i}encodeAsBinary(e){let i,r,n=(i=[],r=e.data,e.data=function e(i,r){if(!i)return i;if(er(i)){let e={_placeholder:!0,num:r.length};return r.push(i),e}if(Array.isArray(i)){let n=Array(i.length);for(let s=0;s<i.length;s++)n[s]=e(i[s],r);return n}if("object"==typeof i&&!(i instanceof Date)){let n={};for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=e(i[s],r));return n}return i}(r,i),e.attachments=i.length,{packet:e,buffers:i}),s=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(s),o}},"PacketType",0,ef,"isPacketValid",0,function(e){var i;return"string"==typeof e.nsp&&(void 0===(i=e.id)||ea(i))&&function(e,i){switch(e){case ef.CONNECT:return void 0===i||el(i);case ef.DISCONNECT:return void 0===i;case ef.EVENT:return Array.isArray(i)&&("number"==typeof i[0]||"string"==typeof i[0]&&-1===en.indexOf(i[0]));case ef.ACK:return Array.isArray(i);case ef.CONNECT_ERROR:return"string"==typeof i||el(i);default:return!1}}(e.type,e.data)},"protocol",0,5],51890);let eh=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class eu extends w{constructor(e,i,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=i,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[ec(e,"open",this.onopen.bind(this)),ec(e,"packet",this.onpacket.bind(this)),ec(e,"error",this.onerror.bind(this)),ec(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...i){var r,n,s;if(eh.hasOwnProperty(e))throw Error('"'+e.toString()+'" is a reserved event name');if(i.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;let o={type:ef.EVENT,data:i};if(o.options={},o.options.compress=!1!==this.flags.compress,"function"==typeof i[i.length-1]){let e=this.ids++,r=i.pop();this._registerAckCallback(e,r),o.id=e}let a=null==(n=null==(r=this.io.engine)?void 0:r.transport)?void 0:n.writable,l=this.connected&&!(null==(s=this.io.engine)?void 0:s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,i){var r;let n=null!=(r=this.flags.timeout)?r:this._opts.ackTimeout;if(void 0===n){this.acks[e]=i;return}let s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let i=0;i<this.sendBuffer.length;i++)this.sendBuffer[i].id===e&&this.sendBuffer.splice(i,1);i.call(this,Error("operation has timed out"))},n),o=(...e)=>{this.io.clearTimeoutFn(s),i.apply(this,e)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...i){return new Promise((r,n)=>{let s=(e,i)=>e?n(e):r(i);s.withError=!0,i.push(s),this.emit(e,...i)})}_addToQueue(e){let i;"function"==typeof e[e.length-1]&&(i=e.pop());let r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...n)=>(this._queue[0],null!==e?r.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(e)):(this._queue.shift(),i&&i(null,...n)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;let i=this._queue[0];(!i.pending||e)&&(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:ef.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(i=>String(i.id)===e)){let i=this.acks[e];delete this.acks[e],i.withError&&i.call(this,Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case ef.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ef.EVENT:case ef.BINARY_EVENT:this.onevent(e);break;case ef.ACK:case ef.BINARY_ACK:this.onack(e);break;case ef.DISCONNECT:this.ondisconnect();break;case ef.CONNECT_ERROR:this.destroy();let i=Error(e.data.message);i.data=e.data.data,this.emitReserved("connect_error",i)}}onevent(e){let i=e.data||[];null!=e.id&&i.push(this.ack(e.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length)for(let i of this._anyListeners.slice())i.apply(this,e);super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){let i=this,r=!1;return function(...n){r||(r=!0,i.packet({type:ef.ACK,id:e,data:n}))}}onack(e){let i=this.acks[e.id];"function"==typeof i&&(delete this.acks[e.id],i.withError&&e.data.unshift(null),i.apply(this,e.data))}onconnect(e,i){this.id=e,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ef.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let i=this._anyListeners;for(let r=0;r<i.length;r++)if(e===i[r]){i.splice(r,1);break}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let i=this._anyOutgoingListeners;for(let r=0;r<i.length;r++)if(e===i[r]){i.splice(r,1);break}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(let i of this._anyOutgoingListeners.slice())i.apply(this,e.data)}}var ed,ef,ep=e.i(51890);function eg(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}eg.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),r=Math.floor(i*this.jitter*e);e=(1&Math.floor(10*i))==0?e-r:e+r}return 0|Math.min(e,this.max)},eg.prototype.reset=function(){this.attempts=0},eg.prototype.setMin=function(e){this.ms=e},eg.prototype.setMax=function(e){this.max=e},eg.prototype.setJitter=function(e){this.jitter=e};class em extends w{constructor(e,i){var r;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(i=e,e=void 0),(i=i||{}).path=i.path||"/socket.io",this.opts=i,T(this,i),this.reconnection(!1!==i.reconnection),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor(null!=(r=i.randomizationFactor)?r:.5),this.backoff=new eg({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==i.timeout?2e4:i.timeout),this._readyState="closed",this.uri=e;const n=i.parser||ep;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=!1!==i.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var i;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null==(i=this.backoff)||i.setMin(e),this)}randomizationFactor(e){var i;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null==(i=this.backoff)||i.setJitter(e),this)}reconnectionDelayMax(e){var i;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null==(i=this.backoff)||i.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Z(this.uri,this.opts);let i=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;let n=ec(i,"open",function(){r.onopen(),e&&e()}),s=i=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",i),e?e(i):this.maybeReconnectOnOpen()},o=ec(i,"error",s);if(!1!==this._timeout){let e=this._timeout,r=this.setTimeoutFn(()=>{n(),s(Error("timeout")),i.close()},e);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}return this.subs.push(n),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(ec(e,"ping",this.onping.bind(this)),ec(e,"data",this.ondata.bind(this)),ec(e,"error",this.onerror.bind(this)),ec(e,"close",this.onclose.bind(this)),ec(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){x(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,i){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new eu(this,e,i),this.nsps[e]=r),r}_destroy(e){for(let e of Object.keys(this.nsps))if(this.nsps[e].active)return;this._close()}_packet(e){let i=this.encoder.encode(e);for(let r=0;r<i.length;r++)this.engine.write(i[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,i){var r;this.cleanup(),null==(r=this.engine)||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let i=this.backoff.duration();this._reconnecting=!0;let r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},i);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}let e_={};function ev(e,i){let r;"object"==typeof e&&(i=e,e=void 0);let n=function(e,i="",r){let n=e;r=r||"u">typeof location&&location,null==e&&(e=r.protocol+"//"+r.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?r.protocol+e:r.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==r?r.protocol+"//"+e:"https://"+e),n=K(e)),!n.port&&(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";let s=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port+i,n.href=n.protocol+"://"+s+(r&&r.port===n.port?"":":"+n.port),n}(e,(i=i||{}).path||"/socket.io"),s=n.source,o=n.id,a=n.path,l=e_[o]&&a in e_[o].nsps;return i.forceNew||i["force new connection"]||!1===i.multiplex||l?r=new em(s,i):(e_[o]||(e_[o]=new em(s,i)),r=e_[o]),n.query&&!i.query&&(i.query=n.queryKey),r.socket(n.path,i)}Object.assign(ev,{Manager:em,Socket:eu,io:ev,connect:ev}),e.s(["io",0,ev],96085)},2576,e=>{"use strict";var i=e.i(71645),r=e.i(96085),n=e.i(70935);e.s(["useTaskEvents",0,function(e){let s=(0,i.useRef)(null),o=(0,i.useRef)(e);(0,i.useLayoutEffect)(()=>{o.current=e}),(0,i.useEffect)(()=>{let e=(0,r.io)((0,n.getServerUrl)(),{transports:["polling","websocket"]});return s.current=e,e.on("task:created",({task:e})=>{o.current.onTaskCreated(e)}),e.on("task:updated",({task:e})=>{o.current.onTaskUpdated(e)}),e.on("task:deleted",({taskId:e})=>{o.current.onTaskDeleted(e)}),()=>{e.disconnect(),s.current=null}},[])}])},48214,31245,e=>{"use strict";var i=e.i(75254);let r=(0,i.default)("circle-pause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);e.s(["CirclePause",0,r],48214);let n=(0,i.default)("bot",[["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"}]]);e.s(["Bot",0,n],31245)},57212,e=>{"use strict";let i=(0,e.i(75254).default)("wifi-off",[["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"}]]);e.s(["WifiOff",0,i],57212)},95468,73884,e=>{"use strict";var i=e.i(23287);e.s(["CheckCircle2",()=>i.default],95468);let r=(0,e.i(75254).default)("circle-x",[["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"}]]);e.s(["XCircle",0,r],73884)},86311,e=>{"use strict";let i=(0,e.i(75254).default)("message-square",[["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"}]]);e.s(["MessageSquare",0,i],86311)},30939,99894,93309,e=>{"use strict";let i,r,n,s,o,a,l,c,h,u,d,f;var p=e.i(18050),g=e.i(71645),m=e.i(37727),_=e.i(31278),v=e.i(48214),y=e.i(31245),b=e.i(68054),S=e.i(63209),w=e.i(57212),x=e.i(95468),C=e.i(73884),k=e.i(86311),E=e.i(68995),R=e.i(85902);function T({entry:e}){if(!e||"idle"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(v.CirclePause,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"idle"})]});if("connecting"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(_.Loader2,{className:"w-3 h-3 animate-spin"}),(0,p.jsx)("span",{children:"connecting"})]});if("error"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,p.jsx)(S.AlertCircle,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"error"})]});if("exited"===e.terminal||"paused"===e.terminal)return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(w.WifiOff,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:e.terminal})]});switch(e.claude){case"running":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-primary",children:[(0,p.jsx)(_.Loader2,{className:"w-3 h-3 animate-spin"}),(0,p.jsx)("span",{children:"running"})]});case"waiting":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-warning",children:[(0,p.jsx)(k.MessageSquare,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"waiting"})]});case"success":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-success",children:[(0,p.jsx)(x.CheckCircle2,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"success"})]});case"failure":case"error":return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-destructive",children:[(0,p.jsx)(C.XCircle,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"failure"===e.claude?"failure":"error"})]});default:return(0,p.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,p.jsx)(v.CirclePause,{className:"w-3 h-3"}),(0,p.jsx)("span",{children:"idle"})]})}}e.s(["SessionTabs",0,function({tabs:e,activeTabId:i,onTabChange:r,onTabCreateTerminal:n,onTabCreateClaude:s,onTabDelete:o,tabStatusMap:a}){let l=(0,g.useRef)([]),[c,h]=(0,g.useState)({left:0,width:0}),[u,d]=(0,g.useState)(null);(0,g.useEffect)(()=>{let r=e.findIndex(e=>e.tab_id===i);if(-1!==r&&l.current[r]){let e=l.current[r];e&&h({left:e.offsetLeft,width:e.offsetWidth})}},[i,e]);let f=new Map,_=0;for(let i of e)"terminal"===i.mode&&(_+=1,f.set(i.tab_id,_));return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(E.ConfirmDialog,{open:null!==u,onOpenChange:e=>{e.open||d(null)},title:"Delete Tab",message:u?.isRunning?"This tab is running. Are you sure you want to delete it?":"Delete this tab?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{u&&o(u.tabId)},variant:"danger"}),(0,p.jsxs)("div",{className:"relative flex items-center gap-2 overflow-x-auto border-b border-border pb-1",children:[e.map((n,s)=>{let o=i===n.tab_id,c=a?.get(n.tab_id),h=(c?.claude==="running"||c?.claude==="waiting")&&c?.terminal==="connected";return(0,p.jsxs)("div",{ref:e=>{l.current[s]=e},onClick:()=>r(n.tab_id),className:`
|
|
12
12
|
flex items-center gap-2 px-4 pt-1 pb-2 h-10 flex-shrink-0 transition-colors cursor-pointer
|
|
13
13
|
${o?"text-primary":h?"text-primary-light":"text-muted-foreground hover:text-foreground"}
|
|
14
|
-
`,children:[(0,p.jsx)("div",{className:"font-medium flex items-center gap-2",children:(0,p.jsx)(T,{entry:c})}),e.length>1&&(0,p.jsx)(R.Button,{variant:"ghost",size:"icon-xs",onClick:e=>{e.stopPropagation(),d({tabId:n.tab_id,isRunning:h})},children:(0,p.jsx)(m.X,{className:"w-4 h-4"})})]},n.tab_id)}),(0,p.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0 ml-auto",children:[(0,p.jsx)("div",{className:"w-px self-stretch bg-theme"}),n&&(0,p.jsx)(R.Button,{size:"icon",onClick:n,title:"Open terminal",children:(0,p.jsx)(b.Terminal,{className:"w-4 h-4"})}),(0,p.jsx)(R.Button,{size:"icon",onClick:s,title:"Open terminal with Claude",children:(0,p.jsx)(y.Bot,{className:"w-4 h-4"})})]}),(0,p.jsx)("div",{className:"absolute bottom-0 h-0.5 bg-primary transition-[left,width]",style:{left:`${c.left}px`,width:`${c.width}px`}})]})]})}],30939);var D=e.i(47167),L=Object.defineProperty,A=Object.getOwnPropertyDescriptor,M=(e,i,r,n)=>{for(var s,o=n>1?void 0:n?A(i,r):i,a=e.length-1;a>=0;a--)(s=e[a])&&(o=(n?s(i,r,o):s(o))||o);return n&&o&&L(i,r,o),o},P=(e,i)=>(r,n)=>i(r,n,e),O="Terminal input",B="Too much output to announce, navigate to rows manually to read";function N(e,i,r,n){var s;s=e=e.replace(/\r?\n/g,"\r"),e=r.decPrivateModes.bracketedPasteMode&&!0!==n.rawOptions.ignoreBracketedPasteMode?"\x1b[200~"+s+"\x1b[201~":s,r.triggerDataEvent(e,!0),i.value=""}function I(e,i,r){let n=r.getBoundingClientRect(),s=e.clientX-n.left-10,o=e.clientY-n.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${s}px`,i.style.top=`${o}px`,i.style.zIndex="1000",i.focus()}function F(e,i,r,n,s){I(e,i,r),s&&n.rightClickSelect(e),i.value=n.selectionText,i.select()}function z(e){return e>65535?String.fromCharCode(((e-=65536)>>10)+55296)+String.fromCharCode(e%1024+56320):String.fromCharCode(e)}function H(e,i=0,r=e.length){let n="";for(let s=i;s<r;++s){let i=e[s];i>65535?(i-=65536,n+=String.fromCharCode((i>>10)+55296)+String.fromCharCode(i%1024+56320)):n+=String.fromCharCode(i)}return n}var j=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let r=e.length;if(!r)return 0;let n=0,s=0;if(this._interim){let r=e.charCodeAt(s++);56320<=r&&r<=57343?i[n++]=(this._interim-55296)*1024+r-56320+65536:(i[n++]=this._interim,i[n++]=r),this._interim=0}for(let o=s;o<r;++o){let s=e.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=r)return this._interim=s,n;let a=e.charCodeAt(o);56320<=a&&a<=57343?i[n++]=(s-55296)*1024+a-56320+65536:(i[n++]=s,i[n++]=a);continue}65279!==s&&(i[n++]=s)}return n}},W=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let r=e.length;if(!r)return 0;let n=0,s,o,a,l,c=0,h=0;if(this.interim[0]){let s=!1,o=this.interim[0];o&=(224&o)==192?31:(240&o)==224?15:7;let a=0,l;for(;(l=63&this.interim[++a])&&a<4;)o<<=6,o|=l;let c=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,u=c-a;for(;h<u;){if(h>=r)return 0;if((192&(l=e[h++]))!=128){h--,s=!0;break}this.interim[a++]=l,o<<=6,o|=63&l}s||(2===c?o<128?h--:i[n++]=o:3===c?o<2048||o>=55296&&o<=57343||65279===o||(i[n++]=o):o<65536||o>1114111||(i[n++]=o)),this.interim.fill(0)}let u=r-4,d=h;for(;d<r;){for(;d<u&&!(128&(s=e[d]))&&!(128&(o=e[d+1]))&&!(128&(a=e[d+2]))&&!(128&(l=e[d+3]));)i[n++]=s,i[n++]=o,i[n++]=a,i[n++]=l,d+=4;if((s=e[d++])<128)i[n++]=s;else if((224&s)==192){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128||(c=(31&s)<<6|63&o)<128){d--;continue}i[n++]=c}else if((240&s)==224){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,n;if((192&(a=e[d++]))!=128){d--;continue}if((c=(15&s)<<12|(63&o)<<6|63&a)<2048||c>=55296&&c<=57343||65279===c)continue;i[n++]=c}else if((248&s)==240){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,n;if((192&(a=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,this.interim[2]=a,n;if((192&(l=e[d++]))!=128){d--;continue}if((c=(7&s)<<18|(63&o)<<12|(63&a)<<6|63&l)<65536||c>1114111)continue;i[n++]=c}}return n}},$=class e{constructor(){this.fg=0,this.bg=0,this.extended=new U}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let i=new e;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return 0x4000000&this.fg}isBold(){return 0x8000000&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:0x10000000&this.fg}isBlink(){return 0x20000000&this.fg}isInvisible(){return 0x40000000&this.fg}isItalic(){return 0x4000000&this.bg}isDim(){return 0x8000000&this.bg}isStrikethrough(){return 0x80000000&this.fg}isProtected(){return 0x20000000&this.bg}isOverline(){return 0x40000000&this.bg}getFgColorMode(){return 0x3000000&this.fg}getBgColorMode(){return 0x3000000&this.bg}isFgRGB(){return(0x3000000&this.fg)==0x3000000}isBgRGB(){return(0x3000000&this.bg)==0x3000000}isFgPalette(){return(0x3000000&this.fg)==0x1000000||(0x3000000&this.fg)==0x2000000}isBgPalette(){return(0x3000000&this.bg)==0x1000000||(0x3000000&this.bg)==0x2000000}isFgDefault(){return(0x3000000&this.fg)==0}isBgDefault(){return(0x3000000&this.bg)==0}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(0x3000000&this.fg){case 0x1000000:case 0x2000000:return 255&this.fg;case 0x3000000:return 0xffffff&this.fg;default:return -1}}getBgColor(){switch(0x3000000&this.bg){case 0x1000000:case 0x2000000:return 255&this.bg;case 0x3000000:return 0xffffff&this.bg;default:return -1}}hasExtendedAttrs(){return 0x10000000&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-0x10000001:this.bg|=0x10000000}getUnderlineColor(){if(0x10000000&this.bg&&~this.extended.underlineColor)switch(0x3000000&this.extended.underlineColor){case 0x1000000:case 0x2000000:return 255&this.extended.underlineColor;case 0x3000000:return 0xffffff&this.extended.underlineColor}return this.getFgColor()}getUnderlineColorMode(){return 0x10000000&this.bg&&~this.extended.underlineColor?0x3000000&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x3000000:this.isFgRGB()}isUnderlineColorPalette(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x1000000||(0x3000000&this.extended.underlineColor)==0x2000000:this.isFgPalette()}isUnderlineColorDefault(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 0x10000000&this.fg?0x10000000&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},U=class e{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?-0x1c000001&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(0x1c000000&this._ext)>>26}set underlineStyle(e){this._ext&=-0x1c000001,this._ext|=e<<26&0x1c000000}get underlineColor(){return 0x3ffffff&this._ext}set underlineColor(e){this._ext&=-0x4000000,this._ext|=0x3ffffff&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(0xe0000000&this._ext)>>29;return e<0?0xfffffff8^e:e}set underlineVariantOffset(e){this._ext&=0x1fffffff,this._ext|=e<<29&0xe0000000}clone(){return new e(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}},q=class e extends ${constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new U,this.combinedData=""}static fromCharData(i){let r=new e;return r.setFromCharData(i),r}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?z(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(2===e[1].length){let r=e[1].charCodeAt(0);if(55296<=r&&r<=56319){let n=e[1].charCodeAt(1);56320<=n&&n<=57343?this.content=(r-55296)*1024+n-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},V="di$target",K="di$dependencies",Y=new Map;function X(e){if(Y.has(e))return Y.get(e);let i=function(e,r,n){var s,o,a;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");s=i,o=e,a=n,o[V]===o?o[K].push({id:s,index:a}):(o[K]=[{id:s,index:a}],o[V]=o)};return i._id=e,Y.set(e,i),i}var G=X("BufferService"),J=X("CoreMouseService"),Z=X("CoreService"),Q=X("CharsetService"),ee=X("InstantiationService"),et=X("LogService"),ei=X("OptionsService"),er=X("OscLinkService"),en=X("UnicodeService"),es=X("DecorationService"),eo=class{constructor(e,i,r){this._bufferService=e,this._optionsService=i,this._oscLinkService=r}provideLinks(e,i){let r=this._bufferService.buffer.lines.get(e-1);if(!r)return void i(void 0);let n=[],s=this._optionsService.rawOptions.linkHandler,o=new q,a=r.getTrimmedLength(),l=-1,c=-1,h=!1;for(let i=0;i<a;i++)if(!(-1===c&&!r.hasContent(i))){if(r.loadCell(i,o),o.hasExtendedAttrs()&&o.extended.urlId)if(-1===c){c=i,l=o.extended.urlId;continue}else h=o.extended.urlId!==l;else -1!==c&&(h=!0);if(h||-1!==c&&i===a-1){let r=this._oscLinkService.getLinkData(l)?.uri;if(r){let o={start:{x:c+1,y:e},end:{x:i+ +(!h&&i===a-1),y:e}},l=!1;if(!s?.allowNonHttpProtocols)try{let e=new URL(r);["http:","https:"].includes(e.protocol)||(l=!0)}catch{l=!0}l||n.push({text:r,range:o,activate:(e,i)=>s?s.activate(e,i,o):function(e){if(confirm(`Do you want to navigate to ${e}?
|
|
14
|
+
`,children:[(0,p.jsx)("div",{className:"font-medium flex items-center gap-2",children:"terminal"===n.mode?(0,p.jsxs)("span",{className:"text-xs",children:["terminal ",f.get(n.tab_id)]}):(0,p.jsx)(T,{entry:c})}),e.length>1&&(0,p.jsx)(R.Button,{variant:"ghost",size:"icon-xs",onClick:e=>{e.stopPropagation(),d({tabId:n.tab_id,isRunning:h})},children:(0,p.jsx)(m.X,{className:"w-4 h-4"})})]},n.tab_id)}),(0,p.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0 ml-auto",children:[(0,p.jsx)("div",{className:"w-px self-stretch bg-theme"}),n&&(0,p.jsx)(R.Button,{size:"icon",onClick:n,title:"Open terminal",children:(0,p.jsx)(b.Terminal,{className:"w-4 h-4"})}),(0,p.jsx)(R.Button,{size:"icon",onClick:s,title:"Open terminal with Claude",children:(0,p.jsx)(y.Bot,{className:"w-4 h-4"})})]}),(0,p.jsx)("div",{className:"absolute bottom-0 h-0.5 bg-primary transition-[left,width]",style:{left:`${c.left}px`,width:`${c.width}px`}})]})]})}],30939);var D=e.i(47167),L=Object.defineProperty,A=Object.getOwnPropertyDescriptor,M=(e,i,r,n)=>{for(var s,o=n>1?void 0:n?A(i,r):i,a=e.length-1;a>=0;a--)(s=e[a])&&(o=(n?s(i,r,o):s(o))||o);return n&&o&&L(i,r,o),o},P=(e,i)=>(r,n)=>i(r,n,e),O="Terminal input",B="Too much output to announce, navigate to rows manually to read";function N(e,i,r,n){var s;s=e=e.replace(/\r?\n/g,"\r"),e=r.decPrivateModes.bracketedPasteMode&&!0!==n.rawOptions.ignoreBracketedPasteMode?"\x1b[200~"+s+"\x1b[201~":s,r.triggerDataEvent(e,!0),i.value=""}function I(e,i,r){let n=r.getBoundingClientRect(),s=e.clientX-n.left-10,o=e.clientY-n.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${s}px`,i.style.top=`${o}px`,i.style.zIndex="1000",i.focus()}function F(e,i,r,n,s){I(e,i,r),s&&n.rightClickSelect(e),i.value=n.selectionText,i.select()}function z(e){return e>65535?String.fromCharCode(((e-=65536)>>10)+55296)+String.fromCharCode(e%1024+56320):String.fromCharCode(e)}function H(e,i=0,r=e.length){let n="";for(let s=i;s<r;++s){let i=e[s];i>65535?(i-=65536,n+=String.fromCharCode((i>>10)+55296)+String.fromCharCode(i%1024+56320)):n+=String.fromCharCode(i)}return n}var j=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let r=e.length;if(!r)return 0;let n=0,s=0;if(this._interim){let r=e.charCodeAt(s++);56320<=r&&r<=57343?i[n++]=(this._interim-55296)*1024+r-56320+65536:(i[n++]=this._interim,i[n++]=r),this._interim=0}for(let o=s;o<r;++o){let s=e.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=r)return this._interim=s,n;let a=e.charCodeAt(o);56320<=a&&a<=57343?i[n++]=(s-55296)*1024+a-56320+65536:(i[n++]=s,i[n++]=a);continue}65279!==s&&(i[n++]=s)}return n}},W=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let r=e.length;if(!r)return 0;let n=0,s,o,a,l,c=0,h=0;if(this.interim[0]){let s=!1,o=this.interim[0];o&=(224&o)==192?31:(240&o)==224?15:7;let a=0,l;for(;(l=63&this.interim[++a])&&a<4;)o<<=6,o|=l;let c=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,u=c-a;for(;h<u;){if(h>=r)return 0;if((192&(l=e[h++]))!=128){h--,s=!0;break}this.interim[a++]=l,o<<=6,o|=63&l}s||(2===c?o<128?h--:i[n++]=o:3===c?o<2048||o>=55296&&o<=57343||65279===o||(i[n++]=o):o<65536||o>1114111||(i[n++]=o)),this.interim.fill(0)}let u=r-4,d=h;for(;d<r;){for(;d<u&&!(128&(s=e[d]))&&!(128&(o=e[d+1]))&&!(128&(a=e[d+2]))&&!(128&(l=e[d+3]));)i[n++]=s,i[n++]=o,i[n++]=a,i[n++]=l,d+=4;if((s=e[d++])<128)i[n++]=s;else if((224&s)==192){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128||(c=(31&s)<<6|63&o)<128){d--;continue}i[n++]=c}else if((240&s)==224){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,n;if((192&(a=e[d++]))!=128){d--;continue}if((c=(15&s)<<12|(63&o)<<6|63&a)<2048||c>=55296&&c<=57343||65279===c)continue;i[n++]=c}else if((248&s)==240){if(d>=r)return this.interim[0]=s,n;if((192&(o=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,n;if((192&(a=e[d++]))!=128){d--;continue}if(d>=r)return this.interim[0]=s,this.interim[1]=o,this.interim[2]=a,n;if((192&(l=e[d++]))!=128){d--;continue}if((c=(7&s)<<18|(63&o)<<12|(63&a)<<6|63&l)<65536||c>1114111)continue;i[n++]=c}}return n}},$=class e{constructor(){this.fg=0,this.bg=0,this.extended=new U}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let i=new e;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return 0x4000000&this.fg}isBold(){return 0x8000000&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:0x10000000&this.fg}isBlink(){return 0x20000000&this.fg}isInvisible(){return 0x40000000&this.fg}isItalic(){return 0x4000000&this.bg}isDim(){return 0x8000000&this.bg}isStrikethrough(){return 0x80000000&this.fg}isProtected(){return 0x20000000&this.bg}isOverline(){return 0x40000000&this.bg}getFgColorMode(){return 0x3000000&this.fg}getBgColorMode(){return 0x3000000&this.bg}isFgRGB(){return(0x3000000&this.fg)==0x3000000}isBgRGB(){return(0x3000000&this.bg)==0x3000000}isFgPalette(){return(0x3000000&this.fg)==0x1000000||(0x3000000&this.fg)==0x2000000}isBgPalette(){return(0x3000000&this.bg)==0x1000000||(0x3000000&this.bg)==0x2000000}isFgDefault(){return(0x3000000&this.fg)==0}isBgDefault(){return(0x3000000&this.bg)==0}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(0x3000000&this.fg){case 0x1000000:case 0x2000000:return 255&this.fg;case 0x3000000:return 0xffffff&this.fg;default:return -1}}getBgColor(){switch(0x3000000&this.bg){case 0x1000000:case 0x2000000:return 255&this.bg;case 0x3000000:return 0xffffff&this.bg;default:return -1}}hasExtendedAttrs(){return 0x10000000&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-0x10000001:this.bg|=0x10000000}getUnderlineColor(){if(0x10000000&this.bg&&~this.extended.underlineColor)switch(0x3000000&this.extended.underlineColor){case 0x1000000:case 0x2000000:return 255&this.extended.underlineColor;case 0x3000000:return 0xffffff&this.extended.underlineColor}return this.getFgColor()}getUnderlineColorMode(){return 0x10000000&this.bg&&~this.extended.underlineColor?0x3000000&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x3000000:this.isFgRGB()}isUnderlineColorPalette(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x1000000||(0x3000000&this.extended.underlineColor)==0x2000000:this.isFgPalette()}isUnderlineColorDefault(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 0x10000000&this.fg?0x10000000&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},U=class e{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?-0x1c000001&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(0x1c000000&this._ext)>>26}set underlineStyle(e){this._ext&=-0x1c000001,this._ext|=e<<26&0x1c000000}get underlineColor(){return 0x3ffffff&this._ext}set underlineColor(e){this._ext&=-0x4000000,this._ext|=0x3ffffff&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(0xe0000000&this._ext)>>29;return e<0?0xfffffff8^e:e}set underlineVariantOffset(e){this._ext&=0x1fffffff,this._ext|=e<<29&0xe0000000}clone(){return new e(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}},q=class e extends ${constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new U,this.combinedData=""}static fromCharData(i){let r=new e;return r.setFromCharData(i),r}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?z(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(2===e[1].length){let r=e[1].charCodeAt(0);if(55296<=r&&r<=56319){let n=e[1].charCodeAt(1);56320<=n&&n<=57343?this.content=(r-55296)*1024+n-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},V="di$target",K="di$dependencies",Y=new Map;function X(e){if(Y.has(e))return Y.get(e);let i=function(e,r,n){var s,o,a;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");s=i,o=e,a=n,o[V]===o?o[K].push({id:s,index:a}):(o[K]=[{id:s,index:a}],o[V]=o)};return i._id=e,Y.set(e,i),i}var G=X("BufferService"),J=X("CoreMouseService"),Z=X("CoreService"),Q=X("CharsetService"),ee=X("InstantiationService"),et=X("LogService"),ei=X("OptionsService"),er=X("OscLinkService"),en=X("UnicodeService"),es=X("DecorationService"),eo=class{constructor(e,i,r){this._bufferService=e,this._optionsService=i,this._oscLinkService=r}provideLinks(e,i){let r=this._bufferService.buffer.lines.get(e-1);if(!r)return void i(void 0);let n=[],s=this._optionsService.rawOptions.linkHandler,o=new q,a=r.getTrimmedLength(),l=-1,c=-1,h=!1;for(let i=0;i<a;i++)if(!(-1===c&&!r.hasContent(i))){if(r.loadCell(i,o),o.hasExtendedAttrs()&&o.extended.urlId)if(-1===c){c=i,l=o.extended.urlId;continue}else h=o.extended.urlId!==l;else -1!==c&&(h=!0);if(h||-1!==c&&i===a-1){let r=this._oscLinkService.getLinkData(l)?.uri;if(r){let o={start:{x:c+1,y:e},end:{x:i+ +(!h&&i===a-1),y:e}},l=!1;if(!s?.allowNonHttpProtocols)try{let e=new URL(r);["http:","https:"].includes(e.protocol)||(l=!0)}catch{l=!0}l||n.push({text:r,range:o,activate:(e,i)=>s?s.activate(e,i,o):function(e){if(confirm(`Do you want to navigate to ${e}?
|
|
15
15
|
|
|
16
16
|
WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}(i),hover:(e,i)=>s?.hover?.(e,i,o),leave:(e,i)=>s?.leave?.(e,i,o)})}h=!1,o.hasExtendedAttrs()&&o.extended.urlId?(c=i,l=o.extended.urlId):(c=-1,l=-1)}}i(n)}};eo=M([P(0,G),P(1,ei),P(2,er)],eo);var ea=X("CharSizeService"),el=X("CoreBrowserService"),ec=X("MouseService"),eh=X("RenderService"),eu=X("SelectionService"),ed=X("CharacterJoinerService"),ef=X("ThemeService"),ep=X("LinkProviderService"),eg=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?ey.isErrorNoTelemetry(e)?new ey(e.message+`
|
|
17
17
|
|