buddy-workbench 0.2.14 → 0.2.15

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.
@@ -493,7 +493,7 @@ html body {
493
493
  ${n}-eye,
494
494
  ${n}-download,
495
495
  ${n}-delete
496
- `]:{zIndex:10,width:r,margin:`0 ${me(e.marginXXS)}`,fontSize:r,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,color:a,"&:hover":{color:a},svg:{verticalAlign:"baseline"}}},[`${u}-thumbnail, ${u}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${u}-name`]:{display:"none",textAlign:"center"},[`${u}-file + ${u}-name`]:{position:"absolute",bottom:e.margin,display:"block",width:`calc(100% - ${me(o(e.paddingXS).mul(2).equal())})`},[`${u}-uploading`]:{[`&${u}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${n}-eye, ${n}-download, ${n}-delete`]:{display:"none"}},[`${u}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${me(o(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}}),[`${t}-wrapper${t}-picture-circle-wrapper`]:{[`${t}${t}-select`]:{borderRadius:"50%"}}}},spe=e=>{const{componentCls:t}=e;return{[`${t}-rtl`]:{direction:"rtl"}}},cpe=e=>{const{componentCls:t,colorTextDisabled:n}=e;return{[`${t}-wrapper`]:Object.assign(Object.assign({},On(e)),{[t]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${t}-select`]:{display:"inline-block"},[`${t}-hidden`]:{display:"none"},[`${t}-disabled`]:{color:n,cursor:"not-allowed"}})}},upe=e=>({actionsColor:e.colorIcon,pictureCardSize:e.controlHeightLG*2.55}),dpe=pn("Upload",e=>{const{fontSizeHeading3:t,fontHeight:n,lineWidth:r,pictureCardSize:a,calc:o}=e,s=sn(e,{uploadThumbnailSize:o(t).mul(2).equal(),uploadProgressOffset:o(o(n).div(2)).add(r).equal(),uploadPicCardSize:a});return[cpe(s),rpe(s),ipe(s),lpe(s),ape(s),ope(s),spe(s),Kh(s)]},upe);var fpe={icon:function(t,n){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:n}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:t}}]}},name:"file",theme:"twotone"},mpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:fpe}))},hpe=l.forwardRef(mpe),ppe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},gpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:ppe}))},vpe=l.forwardRef(gpe),ype={icon:function(t,n){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:t}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:n}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:n}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:n}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:t}}]}},name:"picture",theme:"twotone"},bpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:ype}))},xpe=l.forwardRef(bpe);function sv(e){return Object.assign(Object.assign({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function cv(e,t){const n=et(t),r=n.findIndex(({uid:a})=>a===e.uid);return r===-1?n.push(e):n[r]=e,n}function kC(e,t){const n=e.uid!==void 0?"uid":"name";return t.filter(r=>r[n]===e[n])[0]}function Cpe(e,t){const n=e.uid!==void 0?"uid":"name",r=t.filter(a=>a[n]!==e[n]);return r.length===t.length?null:r}const Spe=(e="")=>{const t=e.split("/"),r=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(r)||[""])[0]},N9=e=>e.indexOf("image/")===0,wpe=e=>{if(e.type&&!e.thumbUrl)return N9(e.type);const t=e.thumbUrl||e.url||"",n=Spe(t);return/^data:image\//.test(t)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(n)?!0:!(/^data:/.test(t)||n)},Ns=200;function $pe(e){return new Promise(t=>{if(!e.type||!N9(e.type)){t("");return}const n=document.createElement("canvas");n.width=Ns,n.height=Ns,n.style.cssText=`position: fixed; left: 0; top: 0; width: ${Ns}px; height: ${Ns}px; z-index: 9999; display: none;`,document.body.appendChild(n);const r=n.getContext("2d"),a=new Image;if(a.onload=()=>{const{width:o,height:s}=a;let u=Ns,f=Ns,m=0,h=0;o>s?(f=s*(Ns/o),h=-(f-u)/2):(u=o*(Ns/s),m=-(u-f)/2),r.drawImage(a,m,h,u,f);const p=n.toDataURL();document.body.removeChild(n),window.URL.revokeObjectURL(a.src),t(p)},a.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const o=new FileReader;o.onload=()=>{o.result&&typeof o.result=="string"&&(a.src=o.result)},o.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const o=new FileReader;o.onload=()=>{o.result&&t(o.result)},o.readAsDataURL(e)}else a.src=window.URL.createObjectURL(e)})}var Epe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},jpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Epe}))},ql=l.forwardRef(jpe);const Npe=l.forwardRef(({prefixCls:e,className:t,style:n,locale:r,listType:a,file:o,items:s,progress:u,iconRender:f,actionIconRender:m,itemRender:h,isImgUrl:p,showPreviewIcon:v,showRemoveIcon:y,showDownloadIcon:b,previewIcon:C,removeIcon:x,downloadIcon:w,extra:$,onPreview:E,onDownload:R,onClose:N},O)=>{var I,j;const{status:M}=o,[T,z]=l.useState(M);l.useEffect(()=>{M!=="removed"&&z(M)},[M]);const[P,B]=l.useState(!1);l.useEffect(()=>{const re=setTimeout(()=>{B(!0)},300);return()=>{clearTimeout(re)}},[]);const H=f(o);let A=l.createElement("div",{className:`${e}-icon`},H);if(a==="picture"||a==="picture-card"||a==="picture-circle")if(T==="uploading"||!o.thumbUrl&&!o.url){const re=ve(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:T!=="uploading"});A=l.createElement("div",{className:re},H)}else{const re=p!=null&&p(o)?l.createElement("img",{src:o.thumbUrl||o.url,alt:o.name,className:`${e}-list-item-image`,crossOrigin:o.crossOrigin}):H,oe=ve(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:p&&!p(o)});A=l.createElement("a",{className:oe,onClick:de=>E(o,de),href:o.url||o.thumbUrl,target:"_blank",rel:"noopener noreferrer"},re)}const L=ve(`${e}-list-item`,`${e}-list-item-${T}`),F=typeof o.linkProps=="string"?JSON.parse(o.linkProps):o.linkProps,U=(typeof y=="function"?y(o):y)?m((typeof x=="function"?x(o):x)||l.createElement(Fn,null),()=>N(o),e,r.removeFile,!0):null,q=(typeof b=="function"?b(o):b)&&T==="done"?m((typeof w=="function"?w(o):w)||l.createElement(ql,null),()=>R(o),e,r.downloadFile):null,_=a!=="picture-card"&&a!=="picture-circle"&&l.createElement("span",{key:"download-delete",className:ve(`${e}-list-item-actions`,{picture:a==="picture"})},q,U),K=typeof $=="function"?$(o):$,X=K&&l.createElement("span",{className:`${e}-list-item-extra`},K),V=ve(`${e}-list-item-name`),W=o.url?l.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:V,title:o.name},F,{href:o.url,onClick:re=>E(o,re)}),o.name,X):l.createElement("span",{key:"view",className:V,onClick:re=>E(o,re),title:o.name},o.name,X),G=(typeof v=="function"?v(o):v)&&(o.url||o.thumbUrl)?l.createElement("a",{href:o.url||o.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:re=>E(o,re),title:r.previewFile},typeof C=="function"?C(o):C||l.createElement(Ef,null)):null,Y=(a==="picture-card"||a==="picture-circle")&&T!=="uploading"&&l.createElement("span",{className:`${e}-list-item-actions`},G,T==="done"&&q,U),{getPrefixCls:te}=l.useContext(_t),ne=te(),ue=l.createElement("div",{className:L},A,W,_,Y,P&&l.createElement(ra,{motionName:`${ne}-fade`,visible:T==="uploading",motionDeadline:2e3},({className:re})=>{const oe="percent"in o?l.createElement(dp,Object.assign({type:"line",percent:o.percent,"aria-label":o["aria-label"],"aria-labelledby":o["aria-labelledby"]},u)):null;return l.createElement("div",{className:ve(`${e}-list-item-progress`,re)},oe)})),Z=o.response&&typeof o.response=="string"?o.response:((I=o.error)===null||I===void 0?void 0:I.statusText)||((j=o.error)===null||j===void 0?void 0:j.message)||r.uploadError,ee=T==="error"?l.createElement(yn,{title:Z,getPopupContainer:re=>re.parentNode},ue):ue;return l.createElement("div",{className:ve(`${e}-list-item-container`,t),style:n,ref:O},h?h(ee,o,s,{download:R.bind(null,o),preview:E.bind(null,o),remove:N.bind(null,o)}):ee)}),Ope=(e,t)=>{const{listType:n="text",previewFile:r=$pe,onPreview:a,onDownload:o,onRemove:s,locale:u,iconRender:f,isImageUrl:m=wpe,prefixCls:h,items:p=[],showPreviewIcon:v=!0,showRemoveIcon:y=!0,showDownloadIcon:b=!1,removeIcon:C,previewIcon:x,downloadIcon:w,extra:$,progress:E={size:[-1,2],showInfo:!1},appendAction:R,appendActionVisible:N=!0,itemRender:O,disabled:I}=e,[,j]=k2(),[M,T]=l.useState(!1),z=["picture-card","picture-circle"].includes(n);l.useEffect(()=>{n.startsWith("picture")&&(p||[]).forEach(V=>{!(V.originFileObj instanceof File||V.originFileObj instanceof Blob)||V.thumbUrl!==void 0||(V.thumbUrl="",r==null||r(V.originFileObj).then(W=>{V.thumbUrl=W||"",j()}))})},[n,p,r]),l.useEffect(()=>{T(!0)},[]);const P=(V,W)=>{if(a)return W==null||W.preventDefault(),a(V)},B=V=>{typeof o=="function"?o(V):V.url&&window.open(V.url)},H=V=>{s==null||s(V)},A=V=>{if(f)return f(V,n);const W=V.status==="uploading";if(n.startsWith("picture")){const G=n==="picture"?l.createElement(Vo,null):u.uploading,Y=m!=null&&m(V)?l.createElement(xpe,null):l.createElement(hpe,null);return W?G:Y}return W?l.createElement(Vo,null):l.createElement(vpe,null)},L=(V,W,G,Y,te)=>{const ne={type:"text",size:"small",title:Y,onClick:ue=>{var Z,ee;W(),l.isValidElement(V)&&((ee=(Z=V.props).onClick)===null||ee===void 0||ee.call(Z,ue))},className:`${G}-list-item-action`,disabled:te?I:!1};return l.isValidElement(V)?l.createElement(Oe,Object.assign({},ne,{icon:Qr(V,Object.assign(Object.assign({},V.props),{onClick:()=>{}}))})):l.createElement(Oe,Object.assign({},ne),l.createElement("span",null,V))};l.useImperativeHandle(t,()=>({handlePreview:P,handleDownload:B}));const{getPrefixCls:F}=l.useContext(_t),U=F("upload",h),q=F(),_=ve(`${U}-list`,`${U}-list-${n}`),K=l.useMemo(()=>Hn(tf(q),["onAppearEnd","onEnterEnd","onLeaveEnd"]),[q]),X=Object.assign(Object.assign({},z?{}:K),{motionDeadline:2e3,motionName:`${U}-${z?"animate-inline":"animate"}`,keys:et(p.map(V=>({key:V.uid,file:V}))),motionAppear:M});return l.createElement("div",{className:_},l.createElement(O2,Object.assign({},X,{component:!1}),({key:V,file:W,className:G,style:Y})=>l.createElement(Npe,{key:V,locale:u,prefixCls:U,className:G,style:Y,file:W,items:p,progress:E,listType:n,isImgUrl:m,showPreviewIcon:v,showRemoveIcon:y,showDownloadIcon:b,removeIcon:C,previewIcon:x,downloadIcon:w,extra:$,iconRender:A,actionIconRender:L,itemRender:O,onPreview:P,onDownload:B,onClose:H})),R&&l.createElement(ra,Object.assign({},X,{visible:N,forceRender:!0}),({className:V,style:W})=>Qr(R,G=>({className:ve(G.className,V),style:Object.assign(Object.assign(Object.assign({},W),{pointerEvents:V?"none":void 0}),G.style)}))))},Rpe=l.forwardRef(Ope);var Ipe=function(e,t,n,r){function a(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function u(h){try{m(r.next(h))}catch(p){s(p)}}function f(h){try{m(r.throw(h))}catch(p){s(p)}}function m(h){h.done?o(h.value):a(h.value).then(u,f)}m((r=r.apply(e,[])).next())})};const Xm=`__LIST_IGNORE_${Date.now()}__`,kpe=(e,t)=>{const n=pr("upload"),{fileList:r,defaultFileList:a,onRemove:o,showUploadList:s=!0,listType:u="text",onPreview:f,onDownload:m,onChange:h,onDrop:p,previewFile:v,disabled:y,locale:b,iconRender:C,isImageUrl:x,progress:w,prefixCls:$,className:E,type:R="select",children:N,style:O,itemRender:I,maxCount:j,data:M={},multiple:T=!1,hasControlInside:z=!0,action:P="",accept:B="",supportServerRender:H=!0,rootClassName:A}=e,L=l.useContext(va),F=y??L,U=e.customRequest||n.customRequest,[q,_]=kn(a||[],{value:r,postState:$e=>$e??[]}),[K,X]=l.useState("drop"),V=l.useRef(null),W=l.useRef(null);l.useMemo(()=>{const $e=Date.now();(r||[]).forEach((Ae,We)=>{!Ae.uid&&!Object.isFrozen(Ae)&&(Ae.uid=`__AUTO__${$e}_${We}__`)})},[r]);const G=($e,Ae,We)=>{let De=et(Ae),Je=!1;j===1?De=De.slice(-1):j&&(Je=De.length>j,De=De.slice(0,j)),fi.flushSync(()=>{_(De)});const Ye={file:$e,fileList:De};We&&(Ye.event=We),(!Je||$e.status==="removed"||De.some(Ge=>Ge.uid===$e.uid))&&fi.flushSync(()=>{h==null||h(Ye)})},Y=($e,Ae)=>Ipe(void 0,void 0,void 0,function*(){const{beforeUpload:We,transformFile:De}=e;let Je=$e;if(We){const Ye=yield We($e,Ae);if(Ye===!1)return!1;if(delete $e[Xm],Ye===Xm)return Object.defineProperty($e,Xm,{value:!0,configurable:!0}),!1;typeof Ye=="object"&&Ye&&(Je=Ye)}return De&&(Je=yield De(Je)),Je}),te=$e=>{const Ae=$e.filter(Je=>!Je.file[Xm]);if(!Ae.length)return;const We=Ae.map(Je=>sv(Je.file));let De=et(q);We.forEach(Je=>{De=cv(Je,De)}),We.forEach((Je,Ye)=>{let Ge=Je;if(Ae[Ye].parsedFile)Je.status="uploading";else{const{originFileObj:He}=Je;let nt;try{nt=new File([He],He.name,{type:He.type})}catch{nt=new Blob([He],{type:He.type}),nt.name=He.name,nt.lastModifiedDate=new Date,nt.lastModified=new Date().getTime()}nt.uid=Je.uid,Ge=nt}G(Ge,De)})},ne=($e,Ae,We)=>{try{typeof $e=="string"&&($e=JSON.parse($e))}catch{}if(!kC(Ae,q))return;const De=sv(Ae);De.status="done",De.percent=100,De.response=$e,De.xhr=We;const Je=cv(De,q);G(De,Je)},ue=($e,Ae)=>{if(!kC(Ae,q))return;const We=sv(Ae);We.status="uploading",We.percent=$e.percent;const De=cv(We,q);G(We,De,$e)},Z=($e,Ae,We)=>{if(!kC(We,q))return;const De=sv(We);De.error=$e,De.response=Ae,De.status="error";const Je=cv(De,q);G(De,Je)},ee=$e=>{let Ae;Promise.resolve(typeof o=="function"?o($e):o).then(We=>{var De;if(We===!1)return;const Je=Cpe($e,q);Je&&(Ae=Object.assign(Object.assign({},$e),{status:"removed"}),q==null||q.forEach(Ye=>{const Ge=Ae.uid!==void 0?"uid":"name";Ye[Ge]===Ae[Ge]&&!Object.isFrozen(Ye)&&(Ye.status="removed")}),(De=V.current)===null||De===void 0||De.abort(Ae),G(Ae,Je))})},re=$e=>{X($e.type),$e.type==="drop"&&(p==null||p($e))};l.useImperativeHandle(t,()=>({onBatchStart:te,onSuccess:ne,onProgress:ue,onError:Z,fileList:q,upload:V.current,nativeElement:W.current}));const{getPrefixCls:oe,direction:de,upload:be}=l.useContext(_t),J=oe("upload",$),ye=Object.assign(Object.assign({onBatchStart:te,onError:Z,onProgress:ue,onSuccess:ne},e),{customRequest:U,data:M,multiple:T,action:P,accept:B,supportServerRender:H,prefixCls:J,disabled:F,beforeUpload:Y,onChange:void 0,hasControlInside:z});delete ye.className,delete ye.style,(!N||F)&&delete ye.id;const xe=`${J}-wrapper`,[ze,he,ce]=dpe(J,xe),[se]=mo("Upload",pi.Upload),{showRemoveIcon:ae,showPreviewIcon:ge,showDownloadIcon:Re,removeIcon:_e,previewIcon:ie,downloadIcon:fe,extra:we}=typeof s=="boolean"?{}:s,ke=typeof ae>"u"?!F:ae,Pe=($e,Ae)=>s?l.createElement(Rpe,{prefixCls:J,listType:u,items:q,previewFile:v,onPreview:f,onDownload:m,onRemove:ee,showRemoveIcon:ke,showPreviewIcon:ge,showDownloadIcon:Re,removeIcon:_e,previewIcon:ie,downloadIcon:fe,iconRender:C,extra:we,locale:Object.assign(Object.assign({},se),b),isImageUrl:x,progress:w,appendAction:$e,appendActionVisible:Ae,itemRender:I,disabled:F}):$e,Ie=ve(xe,E,A,he,ce,be==null?void 0:be.className,{[`${J}-rtl`]:de==="rtl",[`${J}-picture-card-wrapper`]:u==="picture-card",[`${J}-picture-circle-wrapper`]:u==="picture-circle"}),Ve=Object.assign(Object.assign({},be==null?void 0:be.style),O);if(R==="drag"){const $e=ve(he,J,`${J}-drag`,{[`${J}-drag-uploading`]:q.some(Ae=>Ae.status==="uploading"),[`${J}-drag-hover`]:K==="dragover",[`${J}-disabled`]:F,[`${J}-rtl`]:de==="rtl"});return ze(l.createElement("span",{className:Ie,ref:W},l.createElement("div",{className:$e,style:Ve,onDrop:re,onDragOver:re,onDragLeave:re},l.createElement(Kw,Object.assign({},ye,{ref:V,className:`${J}-btn`}),l.createElement("div",{className:`${J}-drag-container`},N))),Pe()))}const Le=ve(J,`${J}-select`,{[`${J}-disabled`]:F,[`${J}-hidden`]:!N}),je=l.createElement("div",{className:Le,style:Ve},l.createElement(Kw,Object.assign({},ye,{ref:V})));return ze(u==="picture-card"||u==="picture-circle"?l.createElement("span",{className:Ie,ref:W},Pe(je,!!N)):l.createElement("span",{className:Ie,ref:W},je,Pe()))},O9=l.forwardRef(kpe);var Mpe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};const Tpe=l.forwardRef((e,t)=>{const{style:n,height:r,hasControlInside:a=!1,children:o}=e,s=Mpe(e,["style","height","hasControlInside","children"]),u=Object.assign(Object.assign({},n),{height:r});return l.createElement(O9,Object.assign({ref:t,hasControlInside:a},s,{style:u,type:"drag"}),o)}),hp=O9;hp.Dragger=Tpe;hp.LIST_IGNORE=Xm;var Ppe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M193 796c0 17.7 14.3 32 32 32h574c17.7 0 32-14.3 32-32V563c0-176.2-142.8-319-319-319S193 386.8 193 563v233zm72-233c0-136.4 110.6-247 247-247s247 110.6 247 247v193H404V585c0-5.5-4.5-10-10-10h-44c-5.5 0-10 4.5-10 10v171h-75V563zm-48.1-252.5l39.6-39.6c3.1-3.1 3.1-8.2 0-11.3l-67.9-67.9a8.03 8.03 0 00-11.3 0l-39.6 39.6a8.03 8.03 0 000 11.3l67.9 67.9c3.1 3.1 8.1 3.1 11.3 0zm669.6-79.2l-39.6-39.6a8.03 8.03 0 00-11.3 0l-67.9 67.9a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l67.9-67.9c3.1-3.2 3.1-8.2 0-11.3zM832 892H192c-17.7 0-32 14.3-32 32v24c0 4.4 3.6 8 8 8h688c4.4 0 8-3.6 8-8v-24c0-17.7-14.3-32-32-32zM484 180h56c4.4 0 8-3.6 8-8V76c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v96c0 4.4 3.6 8 8 8z"}}]},name:"alert",theme:"outlined"},Dpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Ppe}))},uf=l.forwardRef(Dpe),zpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908 640H804V488c0-4.4-3.6-8-8-8H548v-96h108c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16H368c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h108v96H228c-4.4 0-8 3.6-8 8v152H116c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h288c8.8 0 16-7.2 16-16V656c0-8.8-7.2-16-16-16H292v-88h440v88H620c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h288c8.8 0 16-7.2 16-16V656c0-8.8-7.2-16-16-16zm-564 76v168H176V716h168zm84-408V140h168v168H428zm420 576H680V716h168v168z"}}]},name:"apartment",theme:"outlined"},Ape=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:zpe}))},_pe=l.forwardRef(Ape),Lpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},Bpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Lpe}))},Hpe=l.forwardRef(Bpe),Fpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"},Vpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Fpe}))},R9=l.forwardRef(Vpe),Upe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]},name:"arrow-down",theme:"outlined"},Wpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Upe}))},I9=l.forwardRef(Wpe),qpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"},Kpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:qpe}))},ec=l.forwardRef(Kpe),Gpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 000-48.4z"}}]},name:"arrow-right",theme:"outlined"},Ype=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Gpe}))},Qc=l.forwardRef(Ype),Xpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 545.5L536.1 163a31.96 31.96 0 00-48.3 0L156 545.5a7.97 7.97 0 006 13.2h81c4.6 0 9-2 12.1-5.5L474 300.9V864c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V300.9l218.9 252.3c3 3.5 7.4 5.5 12.1 5.5h81c6.8 0 10.5-8 6-13.2z"}}]},name:"arrow-up",theme:"outlined"},Jpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Xpe}))},k9=l.forwardRef(Jpe),Qpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M816 768h-24V428c0-141.1-104.3-257.7-240-277.1V112c0-22.1-17.9-40-40-40s-40 17.9-40 40v38.9c-135.7 19.4-240 136-240 277.1v340h-24c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h216c0 61.8 50.2 112 112 112s112-50.2 112-112h216c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM512 888c-26.5 0-48-21.5-48-48h96c0 26.5-21.5 48-48 48zM304 768V428c0-55.6 21.6-107.8 60.9-147.1S456.4 220 512 220c55.6 0 107.8 21.6 147.1 60.9S720 372.4 720 428v340H304z"}}]},name:"bell",theme:"outlined"},Zpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Qpe}))},Kd=l.forwardRef(Zpe),ege={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M740 161c-61.8 0-112 50.2-112 112 0 50.1 33.1 92.6 78.5 106.9v95.9L320 602.4V318.1c44.2-15 76-56.9 76-106.1 0-61.8-50.2-112-112-112s-112 50.2-112 112c0 49.2 31.8 91 76 106.1V706c-44.2 15-76 56.9-76 106.1 0 61.8 50.2 112 112 112s112-50.2 112-112c0-49.2-31.8-91-76-106.1v-27.8l423.5-138.7a50.52 50.52 0 0034.9-48.2V378.2c42.9-15.8 73.6-57 73.6-105.2 0-61.8-50.2-112-112-112zm-504 51a48.01 48.01 0 0196 0 48.01 48.01 0 01-96 0zm96 600a48.01 48.01 0 01-96 0 48.01 48.01 0 0196 0zm408-491a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"branches",theme:"outlined"},tge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:ege}))},ou=l.forwardRef(tge),nge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M304 280h56c4.4 0 8-3.6 8-8 0-28.3 5.9-53.2 17.1-73.5 10.6-19.4 26-34.8 45.4-45.4C450.9 142 475.7 136 504 136h16c28.3 0 53.2 5.9 73.5 17.1 19.4 10.6 34.8 26 45.4 45.4C650 218.9 656 243.7 656 272c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-40-8.8-76.7-25.9-108.1a184.31 184.31 0 00-74-74C596.7 72.8 560 64 520 64h-16c-40 0-76.7 8.8-108.1 25.9a184.31 184.31 0 00-74 74C304.8 195.3 296 232 296 272c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M940 512H792V412c76.8 0 139-62.2 139-139 0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8a63 63 0 01-63 63H232a63 63 0 01-63-63c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 76.8 62.2 139 139 139v100H84c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h148v96c0 6.5.2 13 .7 19.3C164.1 728.6 116 796.7 116 876c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-44.2 23.9-82.9 59.6-103.7a273 273 0 0022.7 49c24.3 41.5 59 76.2 100.5 100.5S460.5 960 512 960s99.8-13.9 141.3-38.2a281.38 281.38 0 00123.2-149.5A120 120 0 01836 876c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-79.3-48.1-147.4-116.7-176.7.4-6.4.7-12.8.7-19.3v-96h148c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM716 680c0 36.8-9.7 72-27.8 102.9-17.7 30.3-43 55.6-73.3 73.3C584 874.3 548.8 884 512 884s-72-9.7-102.9-27.8c-30.3-17.7-55.6-43-73.3-73.3A202.75 202.75 0 01308 680V412h408v268z"}}]},name:"bug",theme:"outlined"},rge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:nge}))},Th=l.forwardRef(rge),age={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"},oge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:age}))},MC=l.forwardRef(oge),ige={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},lge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:ige}))},gi=l.forwardRef(lge),sge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M433.1 657.7a31.8 31.8 0 0051.7 0l210.6-292c3.8-5.3 0-12.7-6.5-12.7H642c-10.2 0-19.9 4.9-25.9 13.3L459 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H315c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"check-square",theme:"outlined"},cge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:sge}))},mu=l.forwardRef(cge),uge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 512.3v-.3c0-229.8-186.2-416-416-416S96 282.2 96 512v.4c0 229.8 186.2 416 416 416s416-186.2 416-416v-.3.2zm-6.7-74.6l.6 3.3-.6-3.3zM676.7 638.2c53.5-82.2 52.5-189.4-11.1-263.7l162.4-8.4c20.5 44.4 32 93.8 32 145.9 0 185.2-144.6 336.6-327.1 347.4l143.8-221.2zM512 652.3c-77.5 0-140.2-62.7-140.2-140.2 0-77.7 62.7-140.2 140.2-140.2S652.2 434.5 652.2 512 589.5 652.3 512 652.3zm369.2-331.7l-3-5.7 3 5.7zM512 164c121.3 0 228.2 62.1 290.4 156.2l-263.6-13.9c-97.5-5.7-190.2 49.2-222.3 141.1L227.8 311c63.1-88.9 166.9-147 284.2-147zM102.5 585.8c26 145 127.1 264 261.6 315.1C229.6 850 128.5 731 102.5 585.8zM164 512c0-55.9 13.2-108.7 36.6-155.5l119.7 235.4c44.1 86.7 137.4 139.7 234 121.6l-74 145.1C302.9 842.5 164 693.5 164 512zm324.7 415.4c4 .2 8 .4 12 .5-4-.2-8-.3-12-.5z"}}]},name:"chrome",theme:"outlined"},dge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:uge}))},fge=l.forwardRef(dge),mge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},hge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:mge}))},M9=l.forwardRef(hge),pge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm176.5 585.7l-28.6 39a7.99 7.99 0 01-11.2 1.7L483.3 569.8a7.92 7.92 0 01-3.3-6.5V288c0-4.4 3.6-8 8-8h48.1c4.4 0 8 3.6 8 8v247.5l142.6 103.1c3.6 2.5 4.4 7.5 1.8 11.1z"}}]},name:"clock-circle",theme:"filled"},gge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:pge}))},vge=l.forwardRef(gge),yge={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-circle",theme:"outlined"},bge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:yge}))},QR=l.forwardRef(bge),xge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M624 706.3h-74.1V464c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v242.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.7a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9z"}},{tag:"path",attrs:{d:"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z"}}]},name:"cloud-download",theme:"outlined"},Cge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:xge}))},Sge=l.forwardRef(Cge),wge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"},$ge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:wge}))},wa=l.forwardRef($ge),Ege={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M573 421c-23.1 0-41 17.9-41 40s17.9 40 41 40c21.1 0 39-17.9 39-40s-17.9-40-39-40zm-280 0c-23.1 0-41 17.9-41 40s17.9 40 41 40c21.1 0 39-17.9 39-40s-17.9-40-39-40z"}},{tag:"path",attrs:{d:"M894 345a343.92 343.92 0 00-189-130v.1c-17.1-19-36.4-36.5-58-52.1-163.7-119-393.5-82.7-513 81-96.3 133-92.2 311.9 6 439l.8 132.6c0 3.2.5 6.4 1.5 9.4a31.95 31.95 0 0040.1 20.9L309 806c33.5 11.9 68.1 18.7 102.5 20.6l-.5.4c89.1 64.9 205.9 84.4 313 49l127.1 41.4c3.2 1 6.5 1.6 9.9 1.6 17.7 0 32-14.3 32-32V753c88.1-119.6 90.4-284.9 1-408zM323 735l-12-5-99 31-1-104-8-9c-84.6-103.2-90.2-251.9-11-361 96.4-132.2 281.2-161.4 413-66 132.2 96.1 161.5 280.6 66 412-80.1 109.9-223.5 150.5-348 102zm505-17l-8 10 1 104-98-33-12 5c-56 20.8-115.7 22.5-171 7l-.2-.1A367.31 367.31 0 00729 676c76.4-105.3 88.8-237.6 44.4-350.4l.6.4c23 16.5 44.1 37.1 62 62 72.6 99.6 68.5 235.2-8 330z"}},{tag:"path",attrs:{d:"M433 421c-23.1 0-41 17.9-41 40s17.9 40 41 40c21.1 0 39-17.9 39-40s-17.9-40-39-40z"}}]},name:"comment",theme:"outlined"},jge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Ege}))},TC=l.forwardRef(jge),Nge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm198.4-588.1a32 32 0 00-24.5.5L414.9 415 296.4 686c-3.6 8.2-3.6 17.5 0 25.7 3.4 7.8 9.7 13.9 17.7 17 3.8 1.5 7.7 2.2 11.7 2.2 4.4 0 8.7-.9 12.8-2.7l271-118.6 118.5-271a32.06 32.06 0 00-17.7-42.7zM576.8 534.4l26.2 26.2-42.4 42.4-26.2-26.2L380 644.4 447.5 490 422 464.4l42.4-42.4 25.5 25.5L644.4 380l-67.6 154.4zM464.4 422L422 464.4l25.5 25.6 86.9 86.8 26.2 26.2 42.4-42.4-26.2-26.2-86.8-86.9z"}}]},name:"compass",theme:"outlined"},Oge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Nge}))},Rge=l.forwardRef(Oge),Ige={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M326 664H104c-8.8 0-16 7.2-16 16v48c0 8.8 7.2 16 16 16h174v176c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16V696c0-17.7-14.3-32-32-32zm16-576h-48c-8.8 0-16 7.2-16 16v176H104c-8.8 0-16 7.2-16 16v48c0 8.8 7.2 16 16 16h222c17.7 0 32-14.3 32-32V104c0-8.8-7.2-16-16-16zm578 576H698c-17.7 0-32 14.3-32 32v224c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16V744h174c8.8 0 16-7.2 16-16v-48c0-8.8-7.2-16-16-16zm0-384H746V104c0-8.8-7.2-16-16-16h-48c-8.8 0-16 7.2-16 16v224c0 17.7 14.3 32 32 32h222c8.8 0 16-7.2 16-16v-48c0-8.8-7.2-16-16-16z"}}]},name:"compress",theme:"outlined"},kge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Ige}))},Gw=l.forwardRef(kge),Mge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 128c-212.1 0-384 171.9-384 384v360c0 13.3 10.7 24 24 24h184c35.3 0 64-28.7 64-64V624c0-35.3-28.7-64-64-64H200v-48c0-172.3 139.7-312 312-312s312 139.7 312 312v48H688c-35.3 0-64 28.7-64 64v208c0 35.3 28.7 64 64 64h184c13.3 0 24-10.7 24-24V512c0-212.1-171.9-384-384-384zM328 632v192H200V632h128zm496 192H696V632h128v192z"}}]},name:"customer-service",theme:"outlined"},Tge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Mge}))},Pge=l.forwardRef(Tge),Dge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"},zge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Dge}))},Age=l.forwardRef(zge),_ge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 140H96c-17.7 0-32 14.3-32 32v496c0 17.7 14.3 32 32 32h380v112H304c-8.8 0-16 7.2-16 16v48c0 4.4 3.6 8 8 8h432c4.4 0 8-3.6 8-8v-48c0-8.8-7.2-16-16-16H548V700h380c17.7 0 32-14.3 32-32V172c0-17.7-14.3-32-32-32zm-40 488H136V212h752v416z"}}]},name:"desktop",theme:"outlined"},Lge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:_ge}))},Bge=l.forwardRef(Lge),Hge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.3 506.3L781.7 405.6a7.23 7.23 0 00-11.7 5.7V476H548V254h64.8c6 0 9.4-7 5.7-11.7L517.7 114.7a7.14 7.14 0 00-11.3 0L405.6 242.3a7.23 7.23 0 005.7 11.7H476v222H254v-64.8c0-6-7-9.4-11.7-5.7L114.7 506.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h222v222h-64.8c-6 0-9.4 7-5.7 11.7l100.8 127.5c2.9 3.7 8.5 3.7 11.3 0l100.8-127.5c3.7-4.7.4-11.7-5.7-11.7H548V548h222v64.8c0 6 7 9.4 11.7 5.7l127.5-100.8a7.3 7.3 0 00.1-11.4z"}}]},name:"drag",theme:"outlined"},Fge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Hge}))},ZR=l.forwardRef(Fge),Vge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 289.1a362.49 362.49 0 00-79.9-115.7 370.83 370.83 0 00-118.2-77.8C610.7 76.6 562.1 67 512 67c-50.1 0-98.7 9.6-144.5 28.5-44.3 18.3-84 44.5-118.2 77.8A363.6 363.6 0 00169.4 289c-19.5 45-29.4 92.8-29.4 142 0 70.6 16.9 140.9 50.1 208.7 26.7 54.5 64 107.6 111 158.1 80.3 86.2 164.5 138.9 188.4 153a43.9 43.9 0 0022.4 6.1c7.8 0 15.5-2 22.4-6.1 23.9-14.1 108.1-66.8 188.4-153 47-50.4 84.3-103.6 111-158.1C867.1 572 884 501.8 884 431.1c0-49.2-9.9-97-29.4-142zM512 880.2c-65.9-41.9-300-207.8-300-449.1 0-77.9 31.1-151.1 87.6-206.3C356.3 169.5 431.7 139 512 139s155.7 30.5 212.4 85.9C780.9 280 812 353.2 812 431.1c0 241.3-234.1 407.2-300 449.1zm0-617.2c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 551c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 439c0-29.9 11.7-58 32.8-79.2C454 338.6 482.1 327 512 327c29.9 0 58 11.6 79.2 32.8C612.4 381 624 409.1 624 439c0 29.9-11.6 58-32.8 79.2z"}}]},name:"environment",theme:"outlined"},Uge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Vge}))},Wge=l.forwardRef(Uge),qge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},Kge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:qge}))},Ph=l.forwardRef(Kge),Gge={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"},Yge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Gge}))},zy=l.forwardRef(Yge),Xge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M945 412H689c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h256c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM811 548H689c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h122c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM477.3 322.5H434c-6.2 0-11.2 5-11.2 11.2v248c0 3.6 1.7 6.9 4.6 9l148.9 108.6c5 3.6 12 2.6 15.6-2.4l25.7-35.1v-.1c3.6-5 2.5-12-2.5-15.6l-126.7-91.6V333.7c.1-6.2-5-11.2-11.1-11.2z"}},{tag:"path",attrs:{d:"M804.8 673.9H747c-5.6 0-10.9 2.9-13.9 7.7a321 321 0 01-44.5 55.7 317.17 317.17 0 01-101.3 68.3c-39.3 16.6-81 25-124 25-43.1 0-84.8-8.4-124-25-37.9-16-72-39-101.3-68.3s-52.3-63.4-68.3-101.3c-16.6-39.2-25-80.9-25-124 0-43.1 8.4-84.7 25-124 16-37.9 39-72 68.3-101.3 29.3-29.3 63.4-52.3 101.3-68.3 39.2-16.6 81-25 124-25 43.1 0 84.8 8.4 124 25 37.9 16 72 39 101.3 68.3a321 321 0 0144.5 55.7c3 4.8 8.3 7.7 13.9 7.7h57.8c6.9 0 11.3-7.2 8.2-13.3-65.2-129.7-197.4-214-345-215.7-216.1-2.7-395.6 174.2-396 390.1C71.6 727.5 246.9 903 463.2 903c149.5 0 283.9-84.6 349.8-215.8a9.18 9.18 0 00-8.2-13.3z"}}]},name:"field-time",theme:"outlined"},Jge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Xge}))},Jm=l.forwardRef(Jge),Qge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M553.1 509.1l-77.8 99.2-41.1-52.4a8 8 0 00-12.6 0l-99.8 127.2a7.98 7.98 0 006.3 12.9H696c6.7 0 10.4-7.7 6.3-12.9l-136.5-174a8.1 8.1 0 00-12.7 0zM360 442a40 40 0 1080 0 40 40 0 10-80 0zm494.6-153.4L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file-image",theme:"outlined"},Zge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Qge}))},Uv=l.forwardRef(Zge),eve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M688 312v-48c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8zm-392 88c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H296zm144 452H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h272c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm445.7 51.5l-93.3-93.3C814.7 780.7 828 743.9 828 704c0-97.2-78.8-176-176-176s-176 78.8-176 176 78.8 176 176 176c35.8 0 69-10.7 96.8-29l94.7 94.7c1.6 1.6 3.6 2.3 5.6 2.3s4.1-.8 5.6-2.3l31-31a7.9 7.9 0 000-11.2zM652 816c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"file-search",theme:"outlined"},tve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:eve}))},Ay=l.forwardRef(tve),nve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M296 392h64v64h-64zm0 190v160h128V582h-64v-62h-64v62zm80 48v64h-32v-64h32zm-16-302h64v64h-64zm-64-64h64v64h-64zm64 192h64v64h-64zm0-256h64v64h-64zm494.6 88.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h64v64h64v-64h174v216a42 42 0 0042 42h216v494z"}}]},name:"file-zip",theme:"outlined"},rve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:nve}))},eI=l.forwardRef(rve),ave={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"},ove=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:ave}))},ive=l.forwardRef(ove),lve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M484 443.1V528h-84.5c-4.1 0-7.5 3.1-7.5 7v42c0 3.8 3.4 7 7.5 7H484v84.9c0 3.9 3.2 7.1 7 7.1h42c3.9 0 7-3.2 7-7.1V584h84.5c4.1 0 7.5-3.2 7.5-7v-42c0-3.9-3.4-7-7.5-7H540v-84.9c0-3.9-3.1-7.1-7-7.1h-42c-3.8 0-7 3.2-7 7.1zm396-144.7H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder-add",theme:"outlined"},sve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:lve}))},cve=l.forwardRef(sve),uve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M840 192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3 0-24 10.7-24 24v272c0 13.3 10.7 24 24 24h592c13.3 0 24-10.7 24-24V256h32v200H465c-22.1 0-40 17.9-40 40v136h-44c-4.4 0-8 3.6-8 8v228c0 .6.1 1.3.2 1.9A83.99 83.99 0 00457 960c46.4 0 84-37.6 84-84 0-2.1-.1-4.1-.2-6.1.1-.6.2-1.2.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1 0 40-17.9 40-40V232c0-22.1-17.9-40-40-40zM720 352H208V160h512v192zM477 876c0 11-9 20-20 20s-20-9-20-20V696h40v180z"}}]},name:"format-painter",theme:"outlined"},dve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:uve}))},fve=l.forwardRef(dve),mve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 000 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 00391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 00-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"}}]},name:"fullscreen-exit",theme:"outlined"},hve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:mve}))},T9=l.forwardRef(hve),pve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M290 236.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0013.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 000 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 00-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"}}]},name:"fullscreen",theme:"outlined"},gve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:pve}))},P9=l.forwardRef(gve),vve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M312.1 591.5c3.1 3.1 8.2 3.1 11.3 0l101.8-101.8 86.1 86.2c3.1 3.1 8.2 3.1 11.3 0l226.3-226.5c3.1-3.1 3.1-8.2 0-11.3l-36.8-36.8a8.03 8.03 0 00-11.3 0L517 485.3l-86.1-86.2a8.03 8.03 0 00-11.3 0L275.3 543.4a8.03 8.03 0 000 11.3l36.8 36.8z"}},{tag:"path",attrs:{d:"M904 160H548V96c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H120c-17.7 0-32 14.3-32 32v520c0 17.7 14.3 32 32 32h356.4v32L311.6 884.1a7.92 7.92 0 00-2.3 11l30.3 47.2v.1c2.4 3.7 7.4 4.7 11.1 2.3L512 838.9l161.3 105.8c3.7 2.4 8.7 1.4 11.1-2.3v-.1l30.3-47.2a8 8 0 00-2.3-11L548 776.3V744h356c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 512H160V232h704v440z"}}]},name:"fund-projection-screen",theme:"outlined"},yve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:vve}))},bve=l.forwardRef(yve),xve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0138.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"}}]},name:"github",theme:"outlined"},Cve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:xve}))},Sve=l.forwardRef(Cve),wve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M913.9 552.2L805 181.4v-.1c-7.6-22.9-25.7-36.5-48.3-36.5-23.4 0-42.5 13.5-49.7 35.2l-71.4 213H388.8l-71.4-213c-7.2-21.7-26.3-35.2-49.7-35.2-23.1 0-42.5 14.8-48.4 36.6L110.5 552.2c-4.4 14.7 1.2 31.4 13.5 40.7l368.5 276.4c2.6 3.6 6.2 6.3 10.4 7.8l8.6 6.4 8.5-6.4c4.9-1.7 9-4.7 11.9-8.9l368.4-275.4c12.4-9.2 18-25.9 13.6-40.6zM751.7 193.4c1-1.8 2.9-1.9 3.5-1.9 1.1 0 2.5.3 3.4 3L818 394.3H684.5l67.2-200.9zm-487.4 1c.9-2.6 2.3-2.9 3.4-2.9 2.7 0 2.9.1 3.4 1.7l67.3 201.2H206.5l57.8-200zM158.8 558.7l28.2-97.3 202.4 270.2-230.6-172.9zm73.9-116.4h122.1l90.8 284.3-212.9-284.3zM512.9 776L405.7 442.3H620L512.9 776zm157.9-333.7h119.5L580 723.1l90.8-280.8zm-40.7 293.9l207.3-276.7 29.5 99.2-236.8 177.5z"}}]},name:"gitlab",theme:"outlined"},$ve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:wve}))},C0=l.forwardRef($ve),Eve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"},jve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Eve}))},kf=l.forwardRef(jve),Nve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM496 208H312c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 544h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H312c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm328 244a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"hdd",theme:"outlined"},Ove=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Nve}))},Rve=l.forwardRef(Ove),Ive={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M536.1 273H488c-4.4 0-8 3.6-8 8v275.3c0 2.6 1.2 5 3.3 6.5l165.3 120.7c3.6 2.6 8.6 1.9 11.2-1.7l28.6-39c2.7-3.7 1.9-8.7-1.7-11.2L544.1 528.5V281c0-4.4-3.6-8-8-8zm219.8 75.2l156.8 38.3c5 1.2 9.9-2.6 9.9-7.7l.8-161.5c0-6.7-7.7-10.5-12.9-6.3L752.9 334.1a8 8 0 003 14.1zm167.7 301.1l-56.7-19.5a8 8 0 00-10.1 4.8c-1.9 5.1-3.9 10.1-6 15.1-17.8 42.1-43.3 80-75.9 112.5a353 353 0 01-112.5 75.9 352.18 352.18 0 01-137.7 27.8c-47.8 0-94.1-9.3-137.7-27.8a353 353 0 01-112.5-75.9c-32.5-32.5-58-70.4-75.9-112.5A353.44 353.44 0 01171 512c0-47.8 9.3-94.2 27.8-137.8 17.8-42.1 43.3-80 75.9-112.5a353 353 0 01112.5-75.9C430.6 167.3 477 158 524.8 158s94.1 9.3 137.7 27.8A353 353 0 01775 261.7c10.2 10.3 19.8 21 28.6 32.3l59.8-46.8C784.7 146.6 662.2 81.9 524.6 82 285 82.1 92.6 276.7 95 516.4 97.4 751.9 288.9 942 524.8 942c185.5 0 343.5-117.6 403.7-282.3 1.5-4.2-.7-8.9-4.9-10.4z"}}]},name:"history",theme:"outlined"},kve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Ive}))},D9=l.forwardRef(kve),Mve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M946.5 505L560.1 118.8l-25.9-25.9a31.5 31.5 0 00-44.4 0L77.5 505a63.9 63.9 0 00-18.8 46c.4 35.2 29.7 63.3 64.9 63.3h42.5V940h691.8V614.3h43.4c17.1 0 33.2-6.7 45.3-18.8a63.6 63.6 0 0018.7-45.3c0-17-6.7-33.1-18.8-45.2zM568 868H456V664h112v204zm217.9-325.7V868H632V640c0-22.1-17.9-40-40-40H432c-22.1 0-40 17.9-40 40v228H238.1V542.3h-96l370-369.7 23.1 23.1L882 542.3h-96.1z"}}]},name:"home",theme:"outlined"},Tve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Mve}))},Dh=l.forwardRef(Tve),Pve={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"},Dve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Pve}))},X$=l.forwardRef(Dve),zve={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z"}}]},name:"inbox",theme:"outlined"},Ave=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:zve}))},zh=l.forwardRef(Ave),_ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"},Lve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:_ve}))},_y=l.forwardRef(Lve),Bve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5L255.8 713.6l-62.3-62.3a8.19 8.19 0 00-11.4 0l-39.8 39.8a8.19 8.19 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.19 8.19 0 00-11.4 0l-39.8 39.8a8.19 8.19 0 000 11.4l110.3 111.2c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.1 304.1 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112m161.2 465.2C726.2 620.3 668.9 644 608 644s-118.2-23.7-161.2-66.8C403.7 534.2 380 476.9 380 416s23.7-118.2 66.8-161.2c43-43.1 100.3-66.8 161.2-66.8s118.2 23.7 161.2 66.8c43.1 43 66.8 100.3 66.8 161.2s-23.7 118.2-66.8 161.2"}}]},name:"key",theme:"outlined"},Hve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Bve}))},Fve=l.forwardRef(Hve),Vve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"},Uve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Vve}))},ul=l.forwardRef(Uve),Wve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"}}]},name:"mail",theme:"outlined"},qve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Wve}))},Kve=l.forwardRef(qve),Gve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 000 13.8z"}}]},name:"menu-fold",theme:"outlined"},Yve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Gve}))},Xve=l.forwardRef(Yve),Jve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 000-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0014.4 7z"}}]},name:"menu-unfold",theme:"outlined"},Qve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Jve}))},Zve=l.forwardRef(Qve),e0e={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M489.5 111.66c30.65-1.8 45.98 36.44 22.58 56.33A243.35 243.35 0 00426 354c0 134.76 109.24 244 244 244 72.58 0 139.9-31.83 186.01-86.08 19.87-23.38 58.07-8.1 56.34 22.53C900.4 745.82 725.15 912 512.5 912 291.31 912 112 732.69 112 511.5c0-211.39 164.29-386.02 374.2-399.65l.2-.01zm-81.15 79.75l-4.11 1.36C271.1 237.94 176 364.09 176 511.5 176 697.34 326.66 848 512.5 848c148.28 0 274.94-96.2 319.45-230.41l.63-1.93-.11.07a307.06 307.06 0 01-159.73 46.26L670 662c-170.1 0-308-137.9-308-308 0-58.6 16.48-114.54 46.27-162.47z"}}]},name:"moon",theme:"outlined"},t0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:e0e}))},n0e=l.forwardRef(t0e),r0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"},a0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:r0e}))},Wv=l.forwardRef(a0e),o0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M843.5 737.4c-12.4-75.2-79.2-129.1-155.3-125.4S550.9 676 546 752c-153.5-4.8-208-40.7-199.1-113.7 3.3-27.3 19.8-41.9 50.1-49 18.4-4.3 38.8-4.9 57.3-3.2 1.7.2 3.5.3 5.2.5 11.3 2.7 22.8 5 34.3 6.8 34.1 5.6 68.8 8.4 101.8 6.6 92.8-5 156-45.9 159.2-132.7 3.1-84.1-54.7-143.7-147.9-183.6-29.9-12.8-61.6-22.7-93.3-30.2-14.3-3.4-26.3-5.7-35.2-7.2-7.9-75.9-71.5-133.8-147.8-134.4-76.3-.6-140.9 56.1-150.1 131.9s40 146.3 114.2 163.9c74.2 17.6 149.9-23.3 175.7-95.1 9.4 1.7 18.7 3.6 28 5.8 28.2 6.6 56.4 15.4 82.4 26.6 70.7 30.2 109.3 70.1 107.5 119.9-1.6 44.6-33.6 65.2-96.2 68.6-27.5 1.5-57.6-.9-87.3-5.8-8.3-1.4-15.9-2.8-22.6-4.3-3.9-.8-6.6-1.5-7.8-1.8l-3.1-.6c-2.2-.3-5.9-.8-10.7-1.3-25-2.3-52.1-1.5-78.5 4.6-55.2 12.9-93.9 47.2-101.1 105.8-15.7 126.2 78.6 184.7 276 188.9 29.1 70.4 106.4 107.9 179.6 87 73.3-20.9 119.3-93.4 106.9-168.6zM329.1 345.2a83.3 83.3 0 11.01-166.61 83.3 83.3 0 01-.01 166.61zM695.6 845a83.3 83.3 0 11.01-166.61A83.3 83.3 0 01695.6 845z"}}]},name:"node-index",theme:"outlined"},i0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:o0e}))},tI=l.forwardRef(i0e),l0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm-88-532h-48c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8zm224 0h-48c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8z"}}]},name:"pause-circle",theme:"outlined"},s0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:l0e}))},c0e=l.forwardRef(s0e),u0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}}]},name:"picture",theme:"outlined"},d0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:u0e}))},nI=l.forwardRef(d0e),f0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm144.1 454.9L437.7 677.8a8.02 8.02 0 01-12.7-6.5V353.7a8 8 0 0112.7-6.5L656.1 506a7.9 7.9 0 010 12.9z"}}]},name:"play-circle",theme:"filled"},m0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:f0e}))},h0e=l.forwardRef(m0e),p0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M719.4 499.1l-296.1-215A15.9 15.9 0 00398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 000-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z"}}]},name:"play-circle",theme:"outlined"},g0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:p0e}))},Kl=l.forwardRef(g0e),v0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M280 752h80c4.4 0 8-3.6 8-8V280c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8zm192-280h80c4.4 0 8-3.6 8-8V280c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8v184c0 4.4 3.6 8 8 8zm192 72h80c4.4 0 8-3.6 8-8V280c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8v256c0 4.4 3.6 8 8 8zm216-432H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"project",theme:"outlined"},y0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:v0e}))},Ah=l.forwardRef(y0e),b0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 161H699.2c-49.1 0-97.1 14.1-138.4 40.7L512 233l-48.8-31.3A255.2 255.2 0 00324.8 161H96c-17.7 0-32 14.3-32 32v568c0 17.7 14.3 32 32 32h228.8c49.1 0 97.1 14.1 138.4 40.7l44.4 28.6c1.3.8 2.8 1.3 4.3 1.3s3-.4 4.3-1.3l44.4-28.6C602 807.1 650.1 793 699.2 793H928c17.7 0 32-14.3 32-32V193c0-17.7-14.3-32-32-32zM324.8 721H136V233h188.8c35.4 0 69.8 10.1 99.5 29.2l48.8 31.3 6.9 4.5v462c-47.6-25.6-100.8-39-155.2-39zm563.2 0H699.2c-54.4 0-107.6 13.4-155.2 39V298l6.9-4.5 48.8-31.3c29.7-19.1 64.1-29.2 99.5-29.2H888v488zM396.9 361H211.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5zm223.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c0-4.1-3.2-7.5-7.1-7.5H627.1c-3.9 0-7.1 3.4-7.1 7.5zM396.9 501H211.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5zm416 0H627.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5z"}}]},name:"read",theme:"outlined"},x0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:b0e}))},C0e=l.forwardRef(x0e),S0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"}}]},name:"redo",theme:"outlined"},w0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:S0e}))},$0e=l.forwardRef(w0e),E0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},j0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:E0e}))},N0e=l.forwardRef(j0e),O0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 736c0-111.6-65.4-208-160-252.9V317.3c0-15.1-5.3-29.7-15.1-41.2L536.5 95.4C530.1 87.8 521 84 512 84s-18.1 3.8-24.5 11.4L335.1 276.1a63.97 63.97 0 00-15.1 41.2v165.8C225.4 528 160 624.4 160 736h156.5c-2.3 7.2-3.5 15-3.5 23.8 0 22.1 7.6 43.7 21.4 60.8a97.2 97.2 0 0043.1 30.6c23.1 54 75.6 88.8 134.5 88.8 29.1 0 57.3-8.6 81.4-24.8 23.6-15.8 41.9-37.9 53-64a97 97 0 0043.1-30.5 97.52 97.52 0 0021.4-60.8c0-8.4-1.1-16.4-3.1-23.8H864zM762.3 621.4c9.4 14.6 17 30.3 22.5 46.6H700V558.7a211.6 211.6 0 0162.3 62.7zM388 483.1V318.8l124-147 124 147V668H388V483.1zM239.2 668c5.5-16.3 13.1-32 22.5-46.6 16.3-25.2 37.5-46.5 62.3-62.7V668h-84.8zm388.9 116.2c-5.2 3-11.2 4.2-17.1 3.4l-19.5-2.4-2.8 19.4c-5.4 37.9-38.4 66.5-76.7 66.5-38.3 0-71.3-28.6-76.7-66.5l-2.8-19.5-19.5 2.5a27.7 27.7 0 01-17.1-3.5c-8.7-5-14.1-14.3-14.1-24.4 0-10.6 5.9-19.4 14.6-23.8h231.3c8.8 4.5 14.6 13.3 14.6 23.8-.1 10.2-5.5 19.6-14.2 24.5zM464 400a48 48 0 1096 0 48 48 0 10-96 0z"}}]},name:"rocket",theme:"outlined"},R0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:O0e}))},qo=l.forwardRef(R0e),I0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M866.9 169.9L527.1 54.1C523 52.7 517.5 52 512 52s-11 .7-15.1 2.1L157.1 169.9c-8.3 2.8-15.1 12.4-15.1 21.2v482.4c0 8.8 5.7 20.4 12.6 25.9L499.3 968c3.5 2.7 8 4.1 12.6 4.1s9.2-1.4 12.6-4.1l344.7-268.6c6.9-5.4 12.6-17 12.6-25.9V191.1c.2-8.8-6.6-18.3-14.9-21.2zM810 654.3L512 886.5 214 654.3V226.7l298-101.6 298 101.6v427.6zm-405.8-201c-3-4.1-7.8-6.6-13-6.6H336c-6.5 0-10.3 7.4-6.5 12.7l126.4 174a16.1 16.1 0 0026 0l212.6-292.7c3.8-5.3 0-12.7-6.5-12.7h-55.2c-5.1 0-10 2.5-13 6.6L468.9 542.4l-64.7-89.1z"}}]},name:"safety-certificate",theme:"outlined"},k0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:I0e}))},J$=l.forwardRef(k0e),M0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"},T0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:M0e}))},Q$=l.forwardRef(T0e),P0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M136 384h56c4.4 0 8-3.6 8-8V200h176c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H196c-37.6 0-68 30.4-68 68v180c0 4.4 3.6 8 8 8zm512-184h176v176c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V196c0-37.6-30.4-68-68-68H648c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM376 824H200V648c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v180c0 37.6 30.4 68 68 68h180c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm512-184h-56c-4.4 0-8 3.6-8 8v176H648c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h180c37.6 0 68-30.4 68-68V648c0-4.4-3.6-8-8-8zm16-164H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"scan",theme:"outlined"},D0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:P0e}))},rI=l.forwardRef(D0e),z0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}}]},name:"send",theme:"outlined"},A0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:z0e}))},hu=l.forwardRef(A0e),_0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},L0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:_0e}))},Gl=l.forwardRef(L0e),B0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"},H0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:B0e}))},F0e=l.forwardRef(H0e),V0e={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M548 818v126a16 16 0 01-16 16h-40a16 16 0 01-16-16V818c15.85 1.64 27.84 2.46 36 2.46 8.15 0 20.16-.82 36-2.46m205.25-115.66l89.1 89.1a16 16 0 010 22.62l-28.29 28.29a16 16 0 01-22.62 0l-89.1-89.1c12.37-10.04 21.43-17.95 27.2-23.71 5.76-5.77 13.67-14.84 23.71-27.2m-482.5 0c10.04 12.36 17.95 21.43 23.71 27.2 5.77 5.76 14.84 13.67 27.2 23.71l-89.1 89.1a16 16 0 01-22.62 0l-28.29-28.29a16 16 0 010-22.63zM512 278c129.24 0 234 104.77 234 234S641.24 746 512 746 278 641.24 278 512s104.77-234 234-234m0 72c-89.47 0-162 72.53-162 162s72.53 162 162 162 162-72.53 162-162-72.53-162-162-162M206 476c-1.64 15.85-2.46 27.84-2.46 36 0 8.15.82 20.16 2.46 36H80a16 16 0 01-16-16v-40a16 16 0 0116-16zm738 0a16 16 0 0116 16v40a16 16 0 01-16 16H818c1.64-15.85 2.46-27.84 2.46-36 0-8.15-.82-20.16-2.46-36zM814.06 180.65l28.29 28.29a16 16 0 010 22.63l-89.1 89.09c-10.04-12.37-17.95-21.43-23.71-27.2-5.77-5.76-14.84-13.67-27.2-23.71l89.1-89.1a16 16 0 0122.62 0m-581.5 0l89.1 89.1c-12.37 10.04-21.43 17.95-27.2 23.71-5.76 5.77-13.67 14.84-23.71 27.2l-89.1-89.1a16 16 0 010-22.62l28.29-28.29a16 16 0 0122.62 0M532 64a16 16 0 0116 16v126c-15.85-1.64-27.84-2.46-36-2.46-8.15 0-20.16.82-36 2.46V80a16 16 0 0116-16z"}}]},name:"sun",theme:"outlined"},U0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:V0e}))},aI=l.forwardRef(U0e),W0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M168 504.2c1-43.7 10-86.1 26.9-126 17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 01755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92 282.7 92 96.3 275.6 92 503.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8zm756 7.8h-60c-4.4 0-7.9 3.5-8 7.8-1 43.7-10 86.1-26.9 126-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 01512.1 856a342.24 342.24 0 01-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 00-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 00-8-8.2z"}}]},name:"sync",theme:"outlined"},q0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:W0e}))},_h=l.forwardRef(q0e),K0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M848 359.3H627.7L825.8 109c4.1-5.3.4-13-6.3-13H436c-2.8 0-5.5 1.5-6.9 4L170 547.5c-3.1 5.3.7 12 6.9 12h174.4l-89.4 357.6c-1.9 7.8 7.5 13.3 13.3 7.7L853.5 373c5.2-4.9 1.7-13.7-5.5-13.7zM378.2 732.5l60.3-241H281.1l189.6-327.4h224.6L487 427.4h211L378.2 732.5z"}}]},name:"thunderbolt",theme:"outlined"},G0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:K0e}))},Z$=l.forwardRef(G0e),Y0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M876.6 239.5c-.5-.9-1.2-1.8-2-2.5-5-5-13.1-5-18.1 0L684.2 409.3l-67.9-67.9L788.7 169c.8-.8 1.4-1.6 2-2.5 3.6-6.1 1.6-13.9-4.5-17.5-98.2-58-226.8-44.7-311.3 39.7-67 67-89.2 162-66.5 247.4l-293 293c-3 3-2.8 7.9.3 11l169.7 169.7c3.1 3.1 8.1 3.3 11 .3l292.9-292.9c85.5 22.8 180.5.7 247.6-66.4 84.4-84.5 97.7-213.1 39.7-311.3zM786 499.8c-58.1 58.1-145.3 69.3-214.6 33.6l-8.8 8.8-.1-.1-274 274.1-79.2-79.2 230.1-230.1s0 .1.1.1l52.8-52.8c-35.7-69.3-24.5-156.5 33.6-214.6a184.2 184.2 0 01144-53.5L537 318.9a32.05 32.05 0 000 45.3l124.5 124.5a32.05 32.05 0 0045.3 0l132.8-132.8c3.7 51.8-14.4 104.8-53.6 143.9z"}}]},name:"tool",theme:"outlined"},X0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Y0e}))},e4=l.forwardRef(X0e),J0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M511.4 124C290.5 124.3 112 303 112 523.9c0 128 60.2 242 153.8 315.2l-37.5 48c-4.1 5.3-.3 13 6.3 12.9l167-.8c5.2 0 9-4.9 7.7-9.9L369.8 727a8 8 0 00-14.1-3L315 776.1c-10.2-8-20-16.7-29.3-26a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-7.5 7.5-15.3 14.5-23.4 21.2a7.93 7.93 0 00-1.2 11.1l39.4 50.5c2.8 3.5 7.9 4.1 11.4 1.3C854.5 760.8 912 649.1 912 523.9c0-221.1-179.4-400.2-400.6-399.9z"}}]},name:"undo",theme:"outlined"},Q0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:J0e}))},z9=l.forwardRef(Q0e),Z0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},eye=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Z0e}))},S0=l.forwardRef(eye),tye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 302.3L784 376V224c0-35.3-28.7-64-64-64H128c-35.3 0-64 28.7-64 64v576c0 35.3 28.7 64 64 64h592c35.3 0 64-28.7 64-64V648l128 73.7c21.3 12.3 48-3.1 48-27.6V330c0-24.6-26.7-40-48-27.7zM712 792H136V232h576v560zm176-167l-104-59.8V458.9L888 399v226zM208 360h112c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H208c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}}]},name:"video-camera",theme:"outlined"},nye=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:tye}))},rye=l.forwardRef(nye),aye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}}]},name:"warning",theme:"outlined"},oye=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:aye}))},A9=l.forwardRef(oye);const iye="0.2.14",jd={version:iye};async function ot(e,t){const n=await fetch(e,t);if(!n.ok)throw new Error((await n.json().catch(()=>({}))).error||"Something went wrong. Please try again.");return n.status===204?null:n.json()}const Br={list:()=>ot("/api/launchers"),running:()=>ot("/api/launchers/running"),create:e=>ot("/api/launchers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/launchers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/launchers/${e}`,{method:"DELETE"}),start:e=>ot(`/api/launchers/${e}/start`,{method:"POST"}),openTerminal:e=>ot(`/api/launchers/${e}/open-terminal`,{method:"POST"}),run:(e,t)=>ot(`/api/launchers/${e}/scripts/${t}/run`,{method:"POST"}),runInstall:e=>ot(`/api/launchers/${e}/install/run`,{method:"POST"}),stop:async(e,t)=>{try{return await ot(`/api/launchers/${e}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scriptId:t})})}catch{return ot(`/api/launchers/${e}/scripts/${encodeURIComponent(t)}/stop`,{method:"POST"})}},logs:(e,t)=>ot(`/api/launchers/${e}/scripts/${t}/logs`),errorLogs:(e,t)=>ot(`/api/launchers/${e}/scripts/${t}/logs/error`),clearLogs:(e,t)=>ot(`/api/launchers/${e}/scripts/${encodeURIComponent(t)}/logs`,{method:"DELETE"}),packageScripts:e=>ot(`/api/launchers/${e}/package-scripts`),runPackageScript:(e,t)=>ot(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/run`,{method:"POST"}),packageScriptLogs:(e,t)=>ot(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/logs`),packageScriptErrorLogs:(e,t)=>ot(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/logs/error`),clearPackageScriptLogs:(e,t)=>ot(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/logs`,{method:"DELETE"})},Yw={get:()=>ot("/api/overview"),version:()=>ot("/api/overview/version"),notifications:()=>ot("/api/overview/notifications")},lye={list:()=>ot("/api/plugins")},rl={list:e=>ot(`/api/clipboard${e?`?date=${encodeURIComponent(e)}`:""}`),search:e=>ot(`/api/clipboard/search?q=${encodeURIComponent(e)}`),tagged:()=>ot("/api/clipboard/tagged"),remove:(e,t)=>ot(`/api/clipboard/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:"DELETE"}),uploadImage:e=>ot("/api/clipboard/image",{method:"POST",headers:{"Content-Type":e.type||"image/png"},body:e}),updateTags:(e,t,n)=>ot(`/api/clipboard/${encodeURIComponent(e)}/${encodeURIComponent(t)}/tags`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:n})}),copied:(e,t)=>ot(`/api/clipboard/${encodeURIComponent(e)}/${encodeURIComponent(t)}/copied`,{method:"POST"}),copyImage:(e,t)=>ot(`/api/clipboard/${encodeURIComponent(e)}/${encodeURIComponent(t)}/copy-image`,{method:"POST"})},Ei={list:()=>ot("/api/group-tasks"),catalog:()=>ot("/api/group-tasks/catalog"),create:e=>ot("/api/group-tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/group-tasks/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),reorder:e=>ot("/api/group-tasks/reorder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e})}),move:(e,t)=>ot(`/api/group-tasks/${e}/move`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({direction:t})}),remove:e=>ot(`/api/group-tasks/${e}`,{method:"DELETE"}),start:e=>ot(`/api/group-tasks/${e}/start`,{method:"POST"}),stop:e=>ot(`/api/group-tasks/${e}/stop`,{method:"POST"})},PC={list:()=>ot("/api/port-diagnostics"),get:e=>ot(`/api/port-diagnostics/${encodeURIComponent(e)}`),kill:(e,t)=>ot("/api/port-diagnostics/kill",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({port:e,pid:t})})},_9={open:e=>ot("/api/settings/open-url",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})}),openPath:(e,t="")=>ot("/api/settings/open-editor",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,location:t})}),openFolder:e=>ot("/api/settings/open-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})})},Wn={status:()=>ot("/api/settings"),devConfigurations:()=>ot("/api/settings/dev-configurations"),selectDirectory:()=>ot("/api/settings/select-directory",{method:"POST"}),selectFile:()=>ot("/api/settings/select-file",{method:"POST"}),openDataDir:()=>ot("/api/settings/open-data-dir",{method:"POST"}),openFolder:e=>ot("/api/settings/open-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),revealFolder:e=>ot("/api/settings/reveal-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),saveDomain:e=>ot("/api/settings/domain",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({domain:e})}),saveAiApiHost:e=>ot("/api/settings/ai-api-host",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({aiApiHost:e})}),saveJiraIssuePrefix:e=>ot("/api/settings/jira-issue-prefix",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({jiraIssuePrefix:e})}),saveMindMapNodeMaxWidth:e=>ot("/api/settings/mind-map-node-max-width",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({width:e})}),saveDefaultEditor:e=>ot("/api/settings/default-editor",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultEditor:e})}),saveDefaultBrowser:e=>ot("/api/settings/default-browser",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultBrowser:e})}),saveTheme:e=>ot("/api/settings/theme",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({theme:e})}),saveDevConfigurations:e=>ot("/api/settings/dev-configurations",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),saveAccessToken:(e,t)=>ot(`/api/settings/${encodeURIComponent(e)}-access-token`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t})}),saveClipboardEnabled:e=>ot("/api/settings/clipboard-enabled",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e})}),saveClipboardImageEnabled:e=>ot("/api/settings/clipboard-image-enabled",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e})}),saveClipboardDeduplicateMinutes:e=>ot("/api/settings/clipboard-deduplicate-minutes",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({minutes:e})})},oI={status:(e=!1)=>ot(`/api/updates${e?"?refresh=1":""}`),selfUpdate:(e="latest")=>ot("/api/updates/self-update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({version:e})})},sye={install:e=>ot("/api/settings/dev-configurations/nvm/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({version:e})})},qc={manage:(e,t)=>ot(`/api/settings/dev-configurations/npm/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({packageName:t})}),versions:e=>ot("/api/settings/dev-configurations/npm/versions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({packageName:e})}),useSuggestedPrefix:()=>ot("/api/settings/dev-configurations/npm/use-prefix-suggestion",{method:"POST"})};qc.search=e=>ot("/api/settings/dev-configurations/npm/search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e})});const DC={stats:()=>ot("/api/data-backup/stats"),export:async()=>{var r;const e=await fetch("/api/data-backup/export");if(!e.ok)throw new Error((await e.json().catch(()=>({}))).error||"Unable to export data backup.");const n=((r=(e.headers.get("Content-Disposition")||"").match(/filename="([^"]+)"/))==null?void 0:r[1])||"devbuddy-data-backup.tar.gz";return{blob:await e.blob(),filename:n}},import:e=>ot("/api/data-backup/import",{method:"POST",headers:{"Content-Type":"application/gzip"},body:e})},sh={get:()=>ot("/api/presentations"),save:e=>ot("/api/presentations",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({plans:e})}),setActive:e=>ot("/api/presentations/active",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({plan:e})})},Tc={check:e=>ot("/api/pr-review/check",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prLink:e})}),aiReview:e=>ot(`/api/pr-review/ai-review/${encodeURIComponent(e)}`),rules:()=>ot("/api/pr-review/rules"),saveRules:(e,t,n)=>ot("/api/pr-review/rules",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({rules:e,customRules:t,fileFilters:n})}),myPrs:()=>ot("/api/pr-review/my-prs"),reviewPrs:()=>ot("/api/pr-review/review-prs"),comment:e=>ot("/api/pr-review/comment",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},uv={load:e=>ot("/api/pr-conflicts/load",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prUrl:e})}),myConflicts:()=>ot("/api/pr-conflicts/my-conflicts"),resolve:e=>ot("/api/pr-conflicts/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),checkBranch:e=>ot("/api/pr-conflicts/check-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},Va={list:()=>ot("/api/jira-filters"),create:e=>ot("/api/jira-filters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/jira-filters/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/jira-filters/${e}`,{method:"DELETE"}),issues:e=>ot(`/api/jira-filters/${e}/issues`),cloneIssue:e=>ot("/api/jira-filters/issues/clone",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),templates:{list:()=>ot("/api/jira-filters/templates"),create:e=>ot("/api/jira-filters/templates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/jira-filters/templates/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/jira-filters/templates/${e}`,{method:"DELETE"})},recentlyCreated:()=>ot("/api/jira-filters/recently-created"),recentlyCommented:()=>ot("/api/jira-filters/recently-commented"),recentlyMentioned:()=>ot("/api/jira-filters/recently-mentioned"),recentlyUpdated:()=>ot("/api/jira-filters/recently-updated")},Wa={list:()=>ot("/api/todos"),create:e=>ot("/api/todos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/todos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/todos/${e}`,{method:"DELETE"}),archive:e=>ot(`/api/todos/${e}/archive`,{method:"POST"}),unarchive:e=>ot(`/api/todos/${e}/unarchive`,{method:"POST"}),batch:(e,t)=>ot("/api/todos/batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,ids:t})})},Td={list:()=>ot("/api/reminders"),create:e=>ot("/api/reminders",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/reminders/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),toggle:(e,t)=>ot(`/api/reminders/${e}/toggle`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:t})}),remove:e=>ot(`/api/reminders/${e}`,{method:"DELETE"}),claimDue:()=>ot("/api/reminders/claim-due",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({now:new Date().toISOString()})})},Pc={list:()=>ot("/api/cron-jobs"),catalog:()=>ot("/api/cron-jobs/catalog"),create:e=>ot("/api/cron-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/cron-jobs/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),toggle:(e,t)=>ot(`/api/cron-jobs/${e}/toggle`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:t})}),run:e=>ot(`/api/cron-jobs/${e}/run`,{method:"POST"}),remove:e=>ot(`/api/cron-jobs/${e}`,{method:"DELETE"})},Al={list:()=>ot("/api/memos"),listImages:()=>ot("/api/memos/images"),uploadImage:e=>ot("/api/memos/images",{method:"POST",headers:{"Content-Type":e.type||"image/png"},body:e}),create:e=>ot("/api/memos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/memos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/memos/${e}`,{method:"DELETE"}),removeImage:e=>ot(`/api/memos/images/${encodeURIComponent(e)}`,{method:"DELETE"})},sl={list:()=>ot("/api/mind-maps"),get:e=>ot(`/api/mind-maps/${encodeURIComponent(e)}`),resolveJiraIssue:e=>ot("/api/mind-maps/jira-issues/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:e})}),create:e=>ot("/api/mind-maps",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/mind-maps/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/mind-maps/${encodeURIComponent(e)}`,{method:"DELETE"})},Kc={list:()=>ot("/api/static-pages"),create:e=>ot("/api/static-pages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/static-pages/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/static-pages/${e}`,{method:"DELETE"})},Zc={list:()=>ot("/api/errors"),log:e=>ot("/api/errors",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),clear:()=>ot("/api/errors",{method:"DELETE"}),remove:e=>ot(`/api/errors/${e}`,{method:"DELETE"})},Os={getData:()=>ot("/api/postman"),importCollection:e=>ot("/api/postman/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collectionJson:e})}),createCollection:e=>ot("/api/postman/collections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),updateCollection:(e,t)=>ot(`/api/postman/collections/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),deleteCollection:e=>ot(`/api/postman/collections/${e}`,{method:"DELETE"}),saveEnvironments:e=>ot("/api/postman/environments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),sendRequest:e=>ot("/api/postman/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},zC={status:()=>ot("/api/bookmark-sync/status"),preview:e=>ot(`/api/bookmark-sync/preview?mode=${encodeURIComponent(e)}`),sync:e=>ot("/api/bookmark-sync/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e})})},Qm={scan:e=>ot("/api/file-organizer/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),execute:e=>ot("/api/file-organizer/execute",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),getHistory:()=>ot("/api/file-organizer/history"),undo:e=>ot("/api/file-organizer/undo",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e})}),browse:e=>ot("/api/file-organizer/browse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})})},Ml={listApps:()=>ot("/api/branch-sync/apps"),createApp:e=>ot("/api/branch-sync/apps",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),updateApp:(e,t)=>ot(`/api/branch-sync/apps/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),deleteApp:e=>ot(`/api/branch-sync/apps/${e}`,{method:"DELETE"}),check:e=>ot("/api/branch-sync/check",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app:e})}),createPr:e=>ot("/api/branch-sync/create-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),createBranch:e=>ot("/api/branch-sync/create-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),getBranches:e=>ot(`/api/branch-sync/branches?repo=${encodeURIComponent(e)}`)},Mm={repositories:e=>ot(`/api/branch-health/repositories?workspaceDir=${encodeURIComponent(e)}`),history:()=>ot("/api/branch-health/history"),scan:e=>ot("/api/branch-health/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder:e})}),preflight:(e,t)=>ot("/api/branch-health/preflight",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder:e,branch:t})}),remove:(e,t,n)=>ot("/api/branch-health/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder:e,branch:t,...n})})},So={config:()=>ot("/api/package-upgrade/config"),dependencyScan:()=>ot("/api/package-upgrade/dependency-scan"),dependencyRepositories:()=>ot("/api/package-upgrade/dependency-repositories"),saveDependencyRepositories:e=>ot("/api/package-upgrade/dependency-repositories",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({directories:e})}),saveConfig:e=>ot("/api/package-upgrade/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceDir:e})}),addRepo:e=>ot("/api/package-upgrade/repos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),packageNames:e=>ot("/api/package-upgrade/repos/packages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoIds:e})}),branches:e=>ot("/api/package-upgrade/repos/branches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoIds:e})}),cloneRepo:e=>ot(`/api/package-upgrade/repos/${e}/clone`,{method:"POST"}),removeRepo:e=>ot(`/api/package-upgrade/repos/${e}`,{method:"DELETE"}),createTask:e=>ot("/api/package-upgrade/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},cye="modulepreload",uye=function(e){return"/"+e},iI={},pu=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let s=function(m){return Promise.all(m.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),f=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));a=s(n.map(m=>{if(m=uye(m),m in iI)return;iI[m]=!0;const h=m.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${p}`))return;const v=document.createElement("link");if(v.rel=h?"stylesheet":cye,h||(v.as="script"),v.crossOrigin="",v.href=m,f&&v.setAttribute("nonce",f),document.head.appendChild(v),h)return new Promise((y,b)=>{v.addEventListener("load",y),v.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(s){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=s,window.dispatchEvent(u),!u.defaultPrevented)throw s}return a.then(s=>{for(const u of s||[])u.status==="rejected"&&o(u.reason);return t().catch(o)})};async function L9(e,t,n){const r=URL.createObjectURL(e);try{const a=await new Promise((m,h)=>{const p=new Image;p.onload=()=>m(p),p.onerror=()=>h(new Error("Unable to read this image. Please choose a valid image file.")),p.src=r}),o=document.createElement("canvas"),s=Math.max(a.naturalWidth,a.naturalHeight);let u=1;t&&(u=t/s),n!=null&&n>0&&n<=100&&(u=u*(n/100)),o.width=Math.max(1,Math.round(a.naturalWidth*u)),o.height=Math.max(1,Math.round(a.naturalHeight*u));const f=o.getContext("2d",{willReadFrequently:!0});return f.drawImage(a,0,0,o.width,o.height),{imageData:f.getImageData(0,0,o.width,o.height),width:o.width,height:o.height}}finally{URL.revokeObjectURL(r)}}async function dye(e,t={}){const{quality:n=75,progressive:r=!0,optimizeCoding:a=!0,autoSubsample:o=!0}=t,[{encode:s},{imageData:u}]=await Promise.all([pu(()=>import("./index-_vMuByUV.js"),[]),L9(e)]),f=await s(u,{quality:n,progressive:r,optimize_coding:a,auto_subsample:o}),m=new Blob([f],{type:"image/jpeg"}),h=(e.name||"clipboard-image.png").replace(/\.[^.]+$/,"")+".jpg";return new File([m],h,{type:"image/jpeg"})}const{Paragraph:fye,Text:mye,Title:hye}=xn;function Ur({actions:e,className:t="",copyClassName:n="",description:r,descriptionClassName:a="",eyebrow:o="WORKBENCH",title:s,titleClassName:u="",titlePrefix:f,titleSuffix:m,titleRowClassName:h=""}){const p=c.jsx(hye,{className:u||void 0,level:2,children:s});return c.jsxs("header",{className:["page-header","workspace-page-header",t].filter(Boolean).join(" "),children:[c.jsxs("div",{className:n||void 0,children:[c.jsx(mye,{className:"workspace-page-eyebrow",children:o}),f||m?c.jsxs("div",{className:h||void 0,children:[f,p,m]}):p,r?c.jsx(fye,{className:["workspace-page-description",a].filter(Boolean).join(" "),type:"secondary",children:r}):null]}),e||null]})}const lI=[{value:"chrome",label:"Google Chrome"},{value:"edge",label:"Microsoft Edge"},{value:"safari",label:"Safari"}];function pye(e=!0){return e?lI:lI.filter(t=>t.value!=="safari")}function hr(e){e&&_9.open(e).catch(()=>{window.open(e,"_blank")})}function Ly(e,t){if(!e||!t)return"";const n=e.replace(/^https?:\/\//,"").replace(/\/+$/,"");return`https://${n.startsWith("jira.")?n:`jira.${n}`}/browse/${t.toUpperCase()}`}function gye(e,t){if(!t)return"";if(!e)return`https://jira.example.com/issues/?filter=${encodeURIComponent(t)}`;const n=e.replace(/^https?:\/\//i,"").replace(/\/+$/,"");return`https://${n.includes("jira")||n.includes(".atlassian.net")?n:`jira.${n}`}/issues/?filter=${encodeURIComponent(t)}`}const{Text:al}=xn,Rs=()=>new Intl.DateTimeFormat("en-CA").format(new Date),vye=e=>{if(!Number.isFinite(e)||e<0)return"";if(e<1024)return`${e} B`;const t=["KB","MB","GB"];let n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(n>=10?0:1)} ${t[r]}`},yye=[{value:0,label:"No deduplication (0 min)"},{value:5,label:"5 minutes"},{value:15,label:"15 minutes"},{value:30,label:"30 minutes"},{value:60,label:"1 hour (Default)"},{value:120,label:"2 hours"},{value:360,label:"6 hours"},{value:720,label:"12 hours"},{value:1440,label:"24 hours"}];function bye({value:e,domain:t,jiraIssuePrefix:n}){const r=[],a=/\[[^\]]+\]\(https?:\/\/[^\s)]+\)|https?:\/\/[^\s]+/g;let o=0;const s=(n||"").split(/[\s,]+/).filter(Boolean).map(m=>m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),u=s.length>0&&t?new RegExp(`\\b(?:${s.join("|")})-[a-zA-Z0-9]{1,10}\\b`,"gi"):null,f=(m,h)=>{if(!u||!t)return m;const p=[];let v=0;u.lastIndex=0;for(const y of m.matchAll(u)){y.index>v&&p.push(m.slice(v,y.index));const b=y[0],C=Ly(t,b);p.push(c.jsx("a",{href:C,target:"_blank",rel:"noreferrer",onClick:x=>{x.preventDefault(),hr(C)},children:b},`${h}-${y.index}`)),v=y.index+b.length}return v<m.length&&p.push(m.slice(v)),p};for(const m of e.matchAll(a)){m.index>o&&r.push(...f(e.slice(o,m.index),`txt-${m.index}`));const h=m[0].match(/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/);if(h)r.push(c.jsx("a",{href:h[2],target:"_blank",rel:"noreferrer",onClick:p=>{p.preventDefault(),hr(h[2])},children:h[1]},m.index));else{const p=m[0].replace(/[),.;:!?]+$/,"");r.push(c.jsx("a",{href:p,target:"_blank",rel:"noreferrer",onClick:v=>{v.preventDefault(),hr(p)},children:p},m.index)),m[0].length>p.length&&r.push(m[0].slice(p.length))}o=m.index+m[0].length}return o<e.length&&r.push(...f(e.slice(o),"txt-end")),r}const sI=e=>e.text||e.preview||"",AC=e=>`/api/clipboard/image/${encodeURIComponent(e)}`;async function xye(e){if(e.type==="image/png")return e;const t=URL.createObjectURL(e);try{const n=await new Promise((o,s)=>{const u=new window.Image;u.onload=()=>o(u),u.onerror=()=>s(new Error("Unable to decode clipboard image.")),u.src=t}),r=document.createElement("canvas");r.width=n.naturalWidth,r.height=n.naturalHeight;const a=r.getContext("2d");if(!a)throw new Error("Image canvas is unavailable.");return a.drawImage(n,0,0),await new Promise((o,s)=>{r.toBlob(u=>{u?o(u):s(new Error("Unable to encode clipboard image as PNG."))},"image/png")})}finally{URL.revokeObjectURL(t)}}function Nd(e,t,n){const r=e.trim();if(!r)return!1;if(t==="account")return r.length<=20&&(/^[AT]\d+/i.test(r)||/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/i.test(r)||/\b(?:account|username|user\s*name|login|帐号|账号|用户名)\s*[:=]/i.test(r));if(t==="id")return/^[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$/i.test(r);if(t==="url")return/^https?:\/\/[^\s]+$/i.test(r);if(t==="json"){if(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]"))try{return JSON.parse(r),!0}catch{return!1}return!1}if(t==="jira"){const a=(n||"").split(/[\s,]+/).filter(Boolean).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"));return a.length>0?new RegExp(`\\b(?:${a.join("|")})-[a-zA-Z0-9]{1,10}\\b`,"i").test(r):/\b[A-Z]{2,10}-[a-zA-Z0-9]{1,10}\b/i.test(r)}return!0}function Cye({children:e}){const t=l.useRef(null),[n,r]=l.useState(!1);return l.useEffect(()=>{const a=t.current;if(!a)return;const o=()=>{r(a.scrollTop+a.clientHeight<a.scrollHeight-1)};o(),a.addEventListener("scroll",o,{passive:!0});const s=typeof ResizeObserver<"u"?new ResizeObserver(o):null;return s==null||s.observe(a),()=>{a.removeEventListener("scroll",o),s==null||s.disconnect()}},[e]),c.jsxs("div",{className:`clipboard-preview-wrap${n?" has-more":""}`,children:[c.jsx("pre",{ref:t,className:"clipboard-preview",children:e}),c.jsx("span",{className:"clipboard-preview-fade","aria-hidden":"true"})]})}function Sye(){const{message:e}=Pr.useApp(),[t,n]=l.useState(()=>{const ie=localStorage.getItem("buddy_clipboard_enabled");return ie!==null?ie==="true":!0}),[r,a]=l.useState(!0),[o,s]=l.useState([]),[u,f]=l.useState(Rs()),[m,h]=l.useState([]),[p,v]=l.useState([]),[y,b]=l.useState(null),[C,x]=l.useState(""),[w,$]=l.useState("all"),[E,R]=l.useState(null),[N,O]=l.useState(!1),[I,j]=l.useState(!1),M=l.useRef(null),[T,z]=l.useState(""),[P,B]=l.useState(""),[H,A]=l.useState([]),[L,F]=l.useState(!1),[U,q]=l.useState({}),_=l.useRef(new Set),[K,X]=l.useState(""),[V,W]=l.useState(""),[G,Y]=l.useState(60),[te,ne]=l.useState(!1),[ue,Z]=l.useState(!0);l.useEffect(()=>{const ie=[...m,...p,...H];for(const fe of ie){if(!fe.imageFile)continue;const ke=`${fe.date||u}-${fe.id}`;if(U[ke]||_.current.has(ke))continue;_.current.add(ke);const Pe=new window.Image;Pe.onload=()=>{q(Ie=>({...Ie,[ke]:{width:Pe.naturalWidth,height:Pe.naturalHeight}})),_.current.delete(ke)},Pe.onerror=()=>_.current.delete(ke),Pe.src=AC(fe.imageFile)}},[m,p,H,u,U]),l.useEffect(()=>{Wn.status().then(ie=>{if(ie){if(ie.isMac!==void 0&&ne(ie.isMac),ie.clipboardEnabled!==void 0){const fe=ie.clipboardEnabled!==!1;n(fe),localStorage.setItem("buddy_clipboard_enabled",String(fe))}ie.clipboardImageEnabled!==void 0&&Z(ie.clipboardImageEnabled!==!1),ie.clipboardDeduplicateMinutes!==void 0&&Y(ie.clipboardDeduplicateMinutes),ie.domain&&X(ie.domain),ie.jiraIssuePrefix&&W(ie.jiraIssuePrefix)}}).catch(()=>{}).finally(()=>a(!1))},[]);const ee=async ie=>{n(ie),localStorage.setItem("buddy_clipboard_enabled",String(ie));try{const we=(await Wn.saveClipboardEnabled(ie)).clipboardEnabled!==!1;n(we),localStorage.setItem("buddy_clipboard_enabled",String(we)),e.success(ie?"Clipboard history enabled":"Clipboard history disabled")}catch(fe){e.error(fe.message)}},re=async ie=>{Z(ie);try{const fe=await Wn.saveClipboardImageEnabled(ie);fe&&fe.clipboardImageEnabled!==void 0&&Z(fe.clipboardImageEnabled!==!1),e.success(ie?"Image clipboard monitoring enabled":"Image clipboard monitoring disabled")}catch(fe){e.error(fe.message)}},oe=async ie=>{Y(ie);try{await Wn.saveClipboardDeduplicateMinutes(ie),e.success("Duplicate filter window updated.")}catch(fe){e.error(fe.message)}};l.useEffect(()=>{const ie=P.trim();if(!ie){A([]),F(!1);return}let fe=!1,we=null;const ke=Date.now();F(!0);const Pe=setTimeout(async()=>{try{const Ie=await rl.search(ie);fe||A(Ie.items||[])}catch(Ie){fe||e.error(Ie.message)}finally{const Ie=Math.max(0,500-(Date.now()-ke));we=setTimeout(()=>{fe||F(!1)},Ie)}},250);return()=>{fe=!0,clearTimeout(Pe),we&&clearTimeout(we)}},[P]);const de=async ie=>{try{const[fe,we]=await Promise.all([rl.list(ie),rl.tagged().catch(()=>({items:[]}))]);s(fe.dates),h(fe.items),v(we.items||[])}catch(fe){e.error(fe.message)}},be=async(ie,fe)=>{const we=(fe||"").trim();if(!we)return;const ke=ie.tags||[];if(ke.includes(we)){b(null);return}const Pe=[...ke,we],Ie=ie.date||u;try{await rl.updateTags(Ie,ie.id,Pe),h(Ve=>Ve.map(Le=>Le.id===ie.id?{...Le,tags:Pe}:Le)),A(Ve=>Ve.map(Le=>Le.id===ie.id?{...Le,tags:Pe}:Le)),v(Ve=>Ve.some(je=>je.id===ie.id)?Ve.map(je=>je.id===ie.id?{...je,tags:Pe}:je):[{...ie,tags:Pe,date:Ie},...Ve]),e.success("Tag added")}catch(Ve){e.error(Ve.message)}finally{b(null),x("")}},J=async(ie,fe)=>{const ke=(ie.tags||[]).filter(Ie=>Ie!==fe),Pe=ie.date||u;try{await rl.updateTags(Pe,ie.id,ke),h(Ie=>Ie.map(Ve=>Ve.id===ie.id?{...Ve,tags:ke}:Ve)),A(Ie=>Ie.map(Ve=>Ve.id===ie.id?{...Ve,tags:ke}:Ve)),v(Ie=>ke.length===0?Ie.filter(Ve=>Ve.id!==ie.id):Ie.map(Ve=>Ve.id===ie.id?{...Ve,tags:ke}:Ve)),e.success("Tag removed")}catch(Ie){e.error(Ie.message)}},ye=l.useRef(Rs());l.useEffect(()=>{if(!t)return;const ie=()=>{const Pe=Rs();if(Pe!==ye.current){const Ie=ye.current;if(ye.current=Pe,u===Ie)return f(Pe),!0}return!1};ie()||de(u);const we=()=>{ie()||de(u)};window.addEventListener("visibilitychange",we),window.addEventListener("focus",we);let ke=null;return u===Rs()&&(ke=setInterval(()=>{document.visibilityState==="visible"&&de(u)},3e3)),()=>{window.removeEventListener("visibilitychange",we),window.removeEventListener("focus",we),ke&&clearInterval(ke)}},[u,t]);const xe=async ie=>{const fe=typeof ie=="object"?ie:{id:ie},we=fe.date||u;try{await rl.remove(we,fe.id),A(ke=>ke.filter(Pe=>Pe.id!==fe.id)),await de(u),e.success("Clipboard entry deleted.")}catch(ke){e.error(ke.message)}},ze=async ie=>{var we;const fe=ie.date||u;if(ie.imageFile)try{if(!((we=navigator.clipboard)!=null&&we.write)||typeof window.ClipboardItem>"u")throw new Error("Image clipboard is not supported by this browser.");await rl.copied(fe,ie.id);const ke=await fetch(AC(ie.imageFile));if(!ke.ok)throw new Error("Unable to load image.");const Pe=await xye(await ke.blob());try{await navigator.clipboard.write([new ClipboardItem({"image/png":Pe})])}catch(Ie){await rl.copyImage(fe,ie.id).catch(()=>{throw Ie})}R(ie.id),setTimeout(()=>{R(Ie=>Ie===ie.id?null:Ie)},1e3)}catch(ke){e.error("Failed to copy image: "+ke.message)}else try{const ke=await rl.copied(fe,ie.id);await navigator.clipboard.writeText(ke.copyText??ie.text??ie.preview??""),R(ie.id),setTimeout(()=>{R(Pe=>Pe===ie.id?null:Pe)},1e3),u===Rs()&&fe!==Rs()&&await de(u)}catch(ke){e.error("Failed to copy text: "+ke.message)}},he=l.useMemo(()=>[...new Set([Rs(),...o,u])],[o,u]);l.useEffect(()=>{if(!t)return;const ie=fe=>{const we=document.activeElement;if(we&&(we.tagName==="INPUT"||we.tagName==="TEXTAREA"||we.isContentEditable||we.closest(".clipboard-tabs")))return;const ke=[...he].sort(),Pe=ke.indexOf(u);fe.key==="ArrowLeft"?Pe>0&&f(ke[Pe-1]):fe.key==="ArrowRight"&&Pe<ke.length-1&&Pe!==-1&&f(ke[Pe+1])};return window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)},[he,u,t]),l.useEffect(()=>{if(!t)return;const ie=async fe=>{var Pe;const we=document.activeElement;if(we&&(we.tagName==="INPUT"||we.tagName==="TEXTAREA"||we.isContentEditable))return;const ke=(Pe=fe.clipboardData)==null?void 0:Pe.items;if(ke){for(const Ie of ke)if(Ie.type.startsWith("image/")){const Ve=Ie.getAsFile();if(Ve){try{e.loading({content:"Compressing and saving image from paste…",key:"paste-upload",duration:0});const Le=await dye(Ve);await rl.uploadImage(Le);const je=Rs();f(je),await de(je),e.success({content:"Image pasted and saved to history!",key:"paste-upload"})}catch(Le){e.error({content:"Failed to save pasted image: "+Le.message,key:"paste-upload"})}break}}}};return window.addEventListener("paste",ie),()=>window.removeEventListener("paste",ie)},[u,t]);const ce=he.reduce((ie,fe)=>{var Ie;const[we,ke,Pe]=fe.split("-");return ie[we]||(ie[we]={}),(Ie=ie[we])[ke]||(Ie[ke]=[]),ie[we][ke].includes(Pe)||ie[we][ke].push(Pe),ie},{}),se=Object.entries(ce).sort(([ie],[fe])=>fe.localeCompare(ie)).map(([ie,fe])=>({value:ie,label:ie,children:Object.entries(fe).sort(([we],[ke])=>ke.localeCompare(we)).map(([we,ke])=>({value:we,label:we,children:ke.sort().reverse().map(Pe=>({value:Pe,label:Pe}))}))})),ae=P.trim(),ge=l.useMemo(()=>w==="tagged"?p:w==="all"?m:w==="image"?m.filter(ie=>!!ie.imageFile):m.filter(ie=>!ie.imageFile&&Nd(sI(ie),w,V)),[w,m,p,V]),Re=l.useMemo(()=>{const ie={all:m.length,tagged:p.length,jira:0,account:0,id:0,url:0,json:0,image:0};for(const ke of m)if(ke.imageFile)ie.image++;else{const Pe=sI(ke);Nd(Pe,"jira",V)&&ie.jira++,Nd(Pe,"account")&&ie.account++,Nd(Pe,"id")&&ie.id++,Nd(Pe,"url")&&ie.url++,Nd(Pe,"json")&&ie.json++}const fe=(ke,Pe)=>({key:ke,label:c.jsxs("span",{className:"clipboard-tab-label",children:[c.jsx("span",{children:Pe}),c.jsxs("span",{className:"clipboard-tab-count",children:["(",ie[ke],")"]})]})}),we=[fe("all","All"),fe("tagged","Tagged"),fe("jira","Jira"),fe("account","Account"),fe("id","ID"),fe("url","Url"),fe("json","JSON")];return te&&we.push(fe("image","Img")),we},[m,p,V,te]);l.useEffect(()=>{!te&&w==="image"&&$("all")},[te,w]);const _e=(ie,fe=!1)=>{const we=ie.date||u,ke=U[`${we}-${ie.id}`],Pe=(ke==null?void 0:ke.width)>0&&(ke==null?void 0:ke.height)>0?ke.width/ke.height:null,Ie=Pe?Math.min(ke.width,300*Pe):null,Ve=`/api/clipboard/${encodeURIComponent(we)}/${encodeURIComponent(ie.id)}`,Le=new Date(ie.createdAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1});return c.jsxs(It,{size:"small",className:`clipboard-item${ie.imageFile?" clipboard-image-item":""}`,children:[c.jsxs("div",{children:[c.jsxs("div",{className:"clipboard-item-meta",children:[c.jsx(al,{type:"secondary",children:Le}),(fe||ie.date&&ie.date!==u)&&c.jsx($t,{style:{margin:0},children:we}),(ie.tags||[]).map(je=>c.jsx($t,{color:"purple",closable:!0,onClose:$e=>{$e.preventDefault(),J(ie,je)},style:{margin:0},children:je},je)),c.jsx(Z2,{content:c.jsxs(ct.Compact,{style:{width:200},children:[c.jsx(Ct,{size:"small",placeholder:"Tag name",value:C,onChange:je=>x(je.target.value),onPressEnter:()=>be(ie,C)}),c.jsx(Oe,{size:"small",type:"primary",onClick:()=>be(ie,C),children:"Add"})]}),title:"Add Tag",trigger:"click",open:y===ie.id,onOpenChange:je=>{b(je?ie.id:null),x("")},children:c.jsxs($t,{className:"clipboard-add-tag",children:[c.jsx(Xn,{})," Tag"]})})]}),ie.imageFile?c.jsx("div",{className:`clipboard-image-wrap${Pe?" has-dimensions":""}`,style:Ie?{width:`${Ie}px`,maxWidth:"100%",aspectRatio:`${ke.width} / ${ke.height}`}:void 0,children:c.jsx(P$,{src:AC(ie.imageFile),alt:"Clipboard entry",className:"clipboard-image",preview:!0,onError:()=>e.error("Unable to load clipboard image.")})}):c.jsxs(c.Fragment,{children:[c.jsx(Cye,{children:c.jsx(bye,{value:ie.preview||ie.text,domain:K,jiraIssuePrefix:V})}),ie.contentFile&&c.jsxs("span",{className:"clipboard-original",children:[c.jsx("a",{href:Ve,target:"_blank",rel:"noreferrer",children:"View original content"}),c.jsxs("a",{href:ie.editorUrl,children:["Open in ",ie.editorName||"editor"]})]})]})]}),c.jsxs("span",{className:"clipboard-actions",children:[U[`${we}-${ie.id}`]&&c.jsxs(al,{type:"secondary",className:"clipboard-image-dimensions",children:[U[`${we}-${ie.id}`].width," × ",U[`${we}-${ie.id}`].height," px"]}),U[`${we}-${ie.id}`]&&ie.imageFile&&Number.isFinite(ie.imageSize)&&c.jsx("span",{className:"clipboard-image-meta-separator","aria-hidden":"true",children:"·"}),ie.imageFile&&Number.isFinite(ie.imageSize)&&c.jsx(al,{type:"secondary",className:"clipboard-image-size",children:vye(ie.imageSize)}),c.jsx(Oe,{type:"text",icon:E===ie.id?c.jsx(Vl,{style:{color:"#52c41a"}}):c.jsx(fo,{}),onClick:()=>ze(ie)}),ie.imageFile?c.jsx(Gr,{title:"Delete this clipboard image?",okText:"Delete",cancelText:"Cancel",onConfirm:()=>xe(ie),children:c.jsx(Oe,{type:"text",danger:!0,icon:c.jsx(Fn,{})})}):c.jsx(Oe,{type:"text",danger:!0,icon:c.jsx(Fn,{}),onClick:()=>xe(ie)})]})]},`${we}-${ie.id}`)};return c.jsxs("div",{className:"clipboard-page",children:[c.jsx(Ur,{titleSuffix:c.jsx(Oe,{"aria-label":"Search clipboard history",disabled:!t||r,icon:c.jsx(jo,{}),onClick:()=>O(!0),type:"text"}),titleRowClassName:"clipboard-title-row",actions:c.jsx("div",{className:"clipboard-controls",children:c.jsxs(ct,{size:8,align:"center",children:[c.jsx(Jl,{allowClear:!1,className:"clipboard-picker",disabled:!t||r,options:se,value:u.split("-"),onChange:ie=>(ie==null?void 0:ie.length)===3&&f(ie.join("-")),placeholder:"Select date"}),c.jsx(Oe,{"aria-label":"Clipboard history settings",icon:c.jsx(Gl,{}),onClick:()=>j(!0),type:"text"})]})}),description:"Saved locally and archived by date.",title:"Clipboard History"}),t?c.jsxs(c.Fragment,{children:[c.jsx(Qa,{className:"clipboard-tabs",activeKey:w,onChange:ie=>{$(ie),requestAnimationFrame(()=>{var fe;return(fe=document.activeElement)==null?void 0:fe.blur()})},onKeyDown:ie=>{var fe;["ArrowLeft","ArrowRight"].includes(ie.key)&&(ie.preventDefault(),(fe=document.activeElement)==null||fe.blur())},items:Re}),ge.length?c.jsx("div",{className:"clipboard-list",children:ge.map(ie=>_e(ie))}):c.jsx(Xt,{description:`No ${w==="all"?"clipboard entries":`${w==="id"?"ID":w} entries`}${w==="tagged"?".":` for ${u}.`}`})]}):c.jsx(It,{className:"clipboard-disabled-card",children:c.jsx(Xt,{image:c.jsx(F0e,{style:{fontSize:48,color:"#9ca3af"}}),description:c.jsxs("div",{className:"clipboard-disabled-copy",children:[c.jsx(al,{strong:!0,className:"clipboard-disabled-title",children:"Clipboard history is disabled"}),c.jsx(al,{type:"secondary",children:"Open settings to turn on clipboard history and start capturing."})]})})}),c.jsx(bn,{className:"clipboard-settings-modal",open:I,title:"Clipboard History Settings",footer:null,width:480,onCancel:()=>j(!1),children:c.jsxs("div",{className:"clipboard-settings",children:[c.jsxs("div",{className:"clipboard-setting-row",children:[c.jsx(al,{type:"secondary",className:"clipboard-setting-label",children:"Clipboard history:"}),c.jsx(Ja,{loading:r,checked:t,onChange:ee,checkedChildren:"On",unCheckedChildren:"Off"})]}),c.jsxs("div",{className:"clipboard-setting-row",children:[c.jsx(al,{type:"secondary",className:"clipboard-setting-label",children:"Deduplicate filter:"}),c.jsx($n,{size:"small",disabled:!t||r,value:G,onChange:oe,className:"clipboard-deduplicate-select",options:yye})]}),te&&c.jsxs("div",{className:"clipboard-setting-row",children:[c.jsx(al,{type:"secondary",className:"clipboard-setting-label",children:"Monitor image clipboard:"}),c.jsx(Ja,{size:"small",disabled:!t||r,checked:ue,onChange:re,checkedChildren:"On",unCheckedChildren:"Off"})]})]})}),c.jsxs(bn,{open:N,afterOpenChange:ie=>{var fe;ie&&((fe=M.current)==null||fe.focus())},title:"Search Clipboard History",footer:null,width:760,onCancel:()=>O(!1),children:[c.jsxs("div",{className:"clipboard-search-control",children:[c.jsx(Ct,{ref:M,allowClear:!0,className:"clipboard-search-field",placeholder:"Search all clipboard history",value:T,onChange:ie=>{const fe=ie.target.value;z(fe),fe||(B(""),A([]))},onPressEnter:()=>{const ie=T.trim();ie!==ae&&A([]),B(ie)}}),c.jsx(Oe,{className:"clipboard-search-button",loading:L,onClick:()=>{const ie=T.trim();ie!==ae&&A([]),B(ie)},type:"primary",children:"Search"})]}),ae&&!L&&c.jsxs(al,{type:"secondary",className:"clipboard-search-summary",children:[H.length," result",H.length===1?"":"s"," for “",ae,"”"]}),ae?L?c.jsx(La,{active:!0,className:"clipboard-search-loading",paragraph:{rows:4}}):H.length?c.jsx("div",{className:"clipboard-search-results clipboard-list",children:H.map(ie=>_e(ie,!0))}):c.jsx(Xt,{className:"clipboard-search-empty",description:`No results for “${ae}”.`}):c.jsx(al,{type:"secondary",className:"clipboard-search-hint",children:"Search across all clipboard history."})]}),c.jsx(oc.BackTop,{visibilityHeight:240})]})}const{Text:Tl,Title:wye}=xn,B9=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],H9=[1,2,3,4,5,6,0],cI=[{value:"daily",label:"Every day"},{value:"weekdays",label:"Weekdays"},{value:"weekly",label:"Every week"},{value:"once",label:"One time"},{value:"cron",label:"Custom cron expression"}],uI=[{value:"custom",label:"Custom script",icon:c.jsx(wa,{})},{value:"quick-launch",label:"Quick Launch",icon:c.jsx(Z$,{})},{value:"launcher-script",label:"Launcher script",icon:c.jsx(Kl,{})}],dI=()=>({name:"",scheduleType:"daily",time:dr().hour(9).minute(0).second(0),weekday:1,scheduledAt:dr().add(1,"day").startOf("day").hour(9),cronExpression:"0 9 * * *",targetType:"custom",command:"",args:"",workingDirectory:"",launcherId:null,scriptId:null,quickLaunchId:null,enabled:!0});function qv(e){return e?new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date(e)):"—"}function $ye(e){return e.scheduleType==="once"?`One time · ${qv(e.scheduledAt)}`:e.scheduleType==="daily"?`Every day · ${e.time}`:e.scheduleType==="weekdays"?`Weekdays · ${e.time}`:e.scheduleType==="weekly"?`Every ${B9[H9.indexOf(e.weekday)]||"week"} · ${e.time}`:`Cron · ${e.cronExpression}`}function Eye(e){return{name:e.name,scheduleType:e.scheduleType,time:e.time?dr(`2000-01-01T${e.time}`):dr().hour(9).minute(0),weekday:e.weekday??1,scheduledAt:e.scheduledAt?dr(e.scheduledAt):dr().add(1,"day").startOf("day").hour(9),cronExpression:e.cronExpression||"0 9 * * *",targetType:e.targetType,command:e.command||"",args:e.args||"",workingDirectory:e.workingDirectory||"",launcherId:e.launcherId||null,scriptId:e.scriptId||null,quickLaunchId:e.quickLaunchId||null,enabled:e.enabled}}function jye(e,t){var a;if(e.targetType==="custom")return`${e.command} · ${e.workingDirectory}`;if(e.targetType==="quick-launch")return((a=t.quickLaunches.find(o=>o.id===e.quickLaunchId))==null?void 0:a.name)||"Quick Launch";const n=t.launchers.find(o=>o.id===e.launcherId),r=n==null?void 0:n.scripts.find(o=>o.id===e.scriptId);return n&&r?`${n.alias} · ${r.name}`:"Launcher script"}function Nye(){var M,T,z;const{message:e}=Pr.useApp(),[t,n]=l.useState([]),[r,a]=l.useState({launchers:[],quickLaunches:[]}),[o,s]=l.useState(dI),[u,f]=l.useState(null),[m,h]=l.useState(!0),[p,v]=l.useState(!1),[y,b]=l.useState(null),C=l.useCallback(async(P=!0)=>{P&&h(!0);try{const[B,H]=await Promise.all([Pc.list(),Pc.catalog()]);n(B),a(H)}catch(B){e.error(B.message)}finally{P&&h(!1)}},[e]);l.useEffect(()=>{C()},[C]);const x=l.useMemo(()=>r.launchers.find(P=>P.id===o.launcherId),[r.launchers,o.launcherId]),w=uI.find(P=>P.value===o.targetType),$=l.useMemo(()=>({total:t.length,active:t.filter(P=>P.enabled).length,failed:t.filter(P=>P.lastStatus==="failed").length}),[t]),E=()=>{f(null),s(dI())},R=(P,B)=>s(H=>({...H,[P]:B})),N=async()=>{var P,B;if(!o.name.trim()){e.warning("Enter a Cron Job name");return}if(o.scheduleType==="once"&&!((P=o.scheduledAt)!=null&&P.isValid())){e.warning("Choose a future date and time");return}if(!["once","cron"].includes(o.scheduleType)&&!((B=o.time)!=null&&B.isValid())){e.warning("Choose a run time");return}if(o.scheduleType==="cron"&&!o.cronExpression.trim()){e.warning("Enter a cron expression");return}if(o.targetType==="custom"&&(!o.command.trim()||!o.workingDirectory.trim())){e.warning("Enter a command and working directory");return}if(o.targetType==="quick-launch"&&!o.quickLaunchId){e.warning("Choose a Quick Launch");return}if(o.targetType==="launcher-script"&&(!o.launcherId||!o.scriptId)){e.warning("Choose a Launcher script");return}v(!0);try{const H={name:o.name,scheduleType:o.scheduleType,time:["once","cron"].includes(o.scheduleType)?void 0:o.time.format("HH:mm"),weekday:o.scheduleType==="weekly"?o.weekday:void 0,scheduledAt:o.scheduleType==="once"?o.scheduledAt.second(0).millisecond(0).toISOString():void 0,cronExpression:o.scheduleType==="cron"?o.cronExpression:void 0,targetType:o.targetType,args:o.args,command:o.targetType==="custom"?o.command:void 0,workingDirectory:o.targetType==="custom"?o.workingDirectory:void 0,launcherId:o.targetType==="launcher-script"?o.launcherId:void 0,scriptId:o.targetType==="launcher-script"?o.scriptId:void 0,quickLaunchId:o.targetType==="quick-launch"?o.quickLaunchId:void 0,enabled:o.enabled},A=u?await Pc.update(u,H):await Pc.create(H);n(L=>u?L.map(F=>F.id===A.id?A:F):[A,...L]),E(),e.success(u?"Cron Job updated":"Cron Job created")}catch(H){e.error(H.message)}finally{v(!1)}},O=async(P,B)=>{try{const H=await Pc.toggle(P.id,B);n(A=>A.map(L=>L.id===H.id?H:L))}catch(H){e.error(H.message)}},I=async P=>{b(P.id);try{await Pc.run(P.id),e.success(`Started ${P.name}`),await C(!1)}catch(B){e.error(B.message)}finally{b(null)}},j=async P=>{try{await Pc.remove(P),n(B=>B.filter(H=>H.id!==P)),u===P&&E(),e.success("Cron Job deleted")}catch(B){e.error(B.message)}};return c.jsxs("div",{className:"cron-jobs-page",children:[c.jsx(Ur,{eyebrow:"AUTOMATION",title:"Cron Jobs",description:"Run custom commands, Quick Launch groups, or Launcher scripts on a schedule.",actions:c.jsx(ct,{wrap:!0,children:c.jsx(Oe,{icon:c.jsx(Xa,{}),onClick:()=>C(!1),children:"Refresh"})})}),c.jsxs("div",{className:"cron-job-stats",children:[c.jsxs(It,{children:[c.jsx(Tl,{type:"secondary",children:"All jobs"}),c.jsx("strong",{children:$.total}),c.jsx("span",{children:"Saved schedules"})]}),c.jsxs(It,{className:"is-active",children:[c.jsx(Tl,{type:"secondary",children:"Active"}),c.jsx("strong",{children:$.active}),c.jsx("span",{children:"Waiting for the next run"})]}),c.jsxs(It,{className:$.failed?"is-failed":"",children:[c.jsx(Tl,{type:"secondary",children:"Recent failures"}),c.jsx("strong",{children:$.failed}),c.jsx("span",{children:"Jobs that failed to start"})]})]}),c.jsxs("div",{className:"cron-jobs-layout",children:[c.jsx(It,{className:"cron-job-editor",title:c.jsxs("span",{children:[c.jsx(Jm,{})," ",u?"Edit Cron Job":"New Cron Job"]}),extra:u&&c.jsx(Oe,{type:"link",onClick:E,children:"New"}),children:c.jsxs("div",{className:"cron-job-form",children:[c.jsxs("label",{children:["Job name",c.jsx(Ct,{value:o.name,maxLength:50,showCount:!0,placeholder:"For example: Start the local API",onChange:P=>R("name",P.target.value)})]}),c.jsxs("label",{children:["Schedule",c.jsx($n,{value:o.scheduleType,options:cI,onChange:P=>R("scheduleType",P)})]}),o.scheduleType==="once"&&c.jsxs("label",{children:["Date and time",c.jsx(vl,{className:"cron-wide-control",showTime:{format:"HH:mm",minuteStep:1},format:"YYYY-MM-DD HH:mm",value:o.scheduledAt,onChange:P=>R("scheduledAt",P&&P.second(0).millisecond(0))})]}),!["once","cron"].includes(o.scheduleType)&&c.jsxs("div",{className:"cron-form-row",children:[c.jsxs("label",{children:["Time",c.jsx(If,{className:"cron-wide-control",format:"HH:mm",minuteStep:1,value:o.time,onChange:P=>R("time",P&&P.second(0).millisecond(0))})]}),o.scheduleType==="weekly"&&c.jsxs("label",{children:["Day",c.jsx($n,{value:o.weekday,options:B9.map((P,B)=>({label:P,value:H9[B]})),onChange:P=>R("weekday",P)})]})]}),o.scheduleType==="cron"&&c.jsxs("label",{children:["Cron expression",c.jsx(Ct,{value:o.cronExpression,placeholder:"0 9 * * 1-5",onChange:P=>R("cronExpression",P.target.value)}),c.jsxs(Tl,{type:"secondary",className:"cron-help",children:["Five fields: minute hour day-of-month month day-of-week. Example: ",c.jsx("code",{children:"*/15 * * * *"})]})]}),c.jsx("div",{className:"cron-section-label",children:"Execution target"}),c.jsx("div",{className:"cron-target-options",children:uI.map(P=>c.jsx(Oe,{type:o.targetType===P.value?"primary":"default",icon:P.icon,onClick:()=>R("targetType",P.value),children:P.label},P.value))}),o.targetType==="custom"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Command",c.jsx(Ct.TextArea,{value:o.command,maxLength:2e3,showCount:!0,autoSize:{minRows:3,maxRows:6},placeholder:"npm run build",onChange:P=>R("command",P.target.value)})]}),c.jsxs("label",{children:["Working directory",c.jsx(Ct,{value:o.workingDirectory,placeholder:"/path/to/project",onChange:P=>R("workingDirectory",P.target.value)})]})]}),o.targetType==="quick-launch"&&c.jsxs("label",{children:["Quick Launch",c.jsx($n,{className:"cron-wide-control",placeholder:"Choose a Quick Launch",value:o.quickLaunchId,options:r.quickLaunches.map(P=>({value:P.id,label:`${P.name} · ${P.scriptCount} scripts`})),onChange:P=>R("quickLaunchId",P)})]}),o.targetType==="launcher-script"&&c.jsxs("div",{className:"cron-form-row",children:[c.jsxs("label",{children:["Launcher",c.jsx($n,{className:"cron-wide-control",placeholder:"Choose a Launcher",value:o.launcherId,options:r.launchers.map(P=>({value:P.id,label:P.alias})),onChange:P=>s(B=>({...B,launcherId:P,scriptId:null}))})]}),c.jsxs("label",{children:["Script",c.jsx($n,{className:"cron-wide-control",placeholder:"Choose a script",value:o.scriptId,options:((x==null?void 0:x.scripts)||[]).map(P=>({value:P.id,label:c.jsxs("span",{className:"cron-script-option",children:[c.jsx("span",{children:P.name}),c.jsxs("span",{className:"cron-script-source",children:["· ",P.source]})]})})),onChange:P=>R("scriptId",P)})]})]}),c.jsxs("label",{children:["Arguments",c.jsx(Ct,{value:o.args,maxLength:1e3,showCount:!0,placeholder:"--port 3000 --mode production",onChange:P=>R("args",P.target.value)}),c.jsx(Tl,{type:"secondary",className:"cron-help",children:"These arguments are appended to the selected command when it runs."})]}),c.jsxs("div",{className:"cron-enabled-row",children:[c.jsxs("div",{children:[c.jsx(Tl,{strong:!0,children:"Enable job"}),c.jsx(Tl,{type:"secondary",children:"Run automatically after saving"})]}),c.jsx(Ja,{checked:o.enabled,onChange:P=>R("enabled",P)})]}),c.jsxs("div",{className:"cron-preview",children:[c.jsxs("div",{children:[c.jsx("span",{children:"Schedule preview"}),c.jsx(jy,{})]}),c.jsx("strong",{children:o.scheduleType==="cron"?`Cron · ${o.cronExpression||"—"}`:o.scheduleType==="once"?`One time · ${o.scheduledAt?qv(o.scheduledAt.toISOString()):"—"}`:`${(M=cI.find(P=>P.value===o.scheduleType))==null?void 0:M.label} · ${((T=o.time)==null?void 0:T.format("HH:mm"))||"—"}`}),c.jsxs("p",{children:[w==null?void 0:w.label," · ",o.targetType==="custom"?o.command||"No command yet":o.targetType==="quick-launch"?((z=r.quickLaunches.find(P=>P.id===o.quickLaunchId))==null?void 0:z.name)||"No Quick Launch selected":(x==null?void 0:x.alias)||"No Launcher selected"]})]}),c.jsxs(ct,{className:"cron-form-actions",children:[c.jsx(Oe,{onClick:E,children:u?"Cancel":"Clear"}),c.jsx(Oe,{type:"primary",icon:c.jsx(Xn,{}),loading:p,onClick:N,children:u?"Save changes":"Create Cron Job"})]})]})}),c.jsx(It,{className:"cron-job-list-card",title:c.jsxs("span",{children:[c.jsx(Jm,{})," Scheduled jobs"]}),children:m?c.jsx("div",{className:"cron-list-state",children:"Loading Cron Jobs…"}):t.length===0?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No Cron Jobs yet. Create your first schedule."}):c.jsx("div",{className:"cron-job-list",children:t.map(P=>c.jsxs("article",{className:`cron-job-item ${P.enabled?"":"is-disabled"}`,children:[c.jsx("div",{className:"cron-job-icon",children:c.jsx(Jm,{})}),c.jsxs("div",{className:"cron-job-main",children:[c.jsxs("div",{className:"cron-job-heading",children:[c.jsx(wye,{level:4,children:P.name}),c.jsx($t,{color:P.enabled?"green":"default",children:P.enabled?"Active":"Paused"}),P.lastStatus==="failed"&&c.jsx($t,{color:"error",children:"Failed"})]}),c.jsx(Tl,{className:"cron-job-target",children:jye(P,r)}),c.jsxs("div",{className:"cron-job-meta",children:[c.jsx("span",{children:$ye(P)}),P.enabled&&P.nextRunAt&&c.jsxs("span",{children:["Next: ",qv(P.nextRunAt)]}),P.lastRunAt&&c.jsxs("span",{children:["Last: ",qv(P.lastRunAt)]})]}),P.lastError&&c.jsx(Tl,{type:"danger",className:"cron-job-error",children:P.lastError})]}),c.jsxs("div",{className:"cron-job-actions",children:[c.jsx(Ja,{size:"small",checked:P.enabled,onChange:B=>O(P,B)}),c.jsx(Oe,{type:"text",icon:c.jsx(Kl,{}),"aria-label":"Run Cron Job now",title:"Run now",loading:y===P.id,onClick:()=>I(P)}),c.jsx(Oe,{type:"text",icon:c.jsx(Wo,{}),"aria-label":"Edit Cron Job",onClick:()=>{f(P.id),s(Eye(P))}}),c.jsx(Gr,{title:"Delete this Cron Job?",okText:"Delete",cancelText:"Cancel",onConfirm:()=>j(P.id),children:c.jsx(Oe,{type:"text",danger:!0,icon:c.jsx(Fn,{}),"aria-label":"Delete Cron Job"})})]})]},P.id))})})]}),c.jsxs("div",{className:"cron-job-footnote",children:[c.jsx(Jm,{})," Cron Jobs run from the DevBuddy server, so the browser page does not need to stay on this screen. The DevBuddy server itself must remain running."]})]})}const F9=[{value:"vscode",label:"VS Code"},{value:"devin",label:"Devin"},{value:"idea",label:"IntelliJ IDEA"}];function V9(e="vscode"){const t=F9.find(n=>n.value===e);return t?t.label:"VS Code"}function U9(e="vscode",t="",n="",r={}){if(!t)return"";const a=typeof r=="boolean"?r:!!(r!=null&&r.newWindow);let o="",s="";if(n){const u=n.split(":").filter(Boolean);u[0]&&(o=u[0]),u[1]&&(s=u[1])}if(e==="idea"){let u=`idea://open?file=${encodeURIComponent(t)}`;return o&&(u+=`&line=${o}`),s&&(u+=`&column=${s}`),u}return e==="devin"?`devin://file${encodeURI(t)}${n}`:a?`vscode://vscode.open-folder${encodeURI(t)}?forceNewWindow=true`:`vscode://file${encodeURI(t)}${n}`}const{Text:dv}=xn;function Oye({tasks:e,running:t,onCreate:n,onEdit:r,onStart:a,onStop:o,onRemove:s,onReorder:u}){const[f,m]=l.useState(null),[h,p]=l.useState(null),v=()=>{m(null),p(null)},y=async(C,x)=>{x.preventDefault();const w=x.dataTransfer.getData("text/plain")||f;if(!w||w===C){v();return}const $=[...e],E=$.findIndex(O=>O.id===w),R=$.findIndex(O=>O.id===C);if(E<0||R<0){v();return}const[N]=$.splice(E,1);$.splice(R,0,N),v(),await u($.map(O=>O.id))},b=[{title:"",width:44,render:(C,x)=>c.jsx("span",{className:"group-task-drag-handle",draggable:!0,"aria-label":`Drag ${x.name} to reorder`,title:"Drag to reorder",onDragStart:w=>{w.dataTransfer.effectAllowed="move",w.dataTransfer.setData("text/plain",x.id),m(x.id)},onDragEnd:v,children:c.jsx(ZR,{})})},{title:"Name",dataIndex:"name",render:C=>c.jsx(dv,{strong:!0,children:C})},{title:"Scripts",dataIndex:"items",width:110,render:C=>c.jsxs(dv,{type:"secondary",children:[C.length," scripts"]})},{title:"Actions",width:230,render:(C,x)=>{const w=x.items.every($=>t.has(`${$.launcherId}:${$.scriptId}`));return c.jsxs(ct,{children:[c.jsx(Oe,{size:"small",className:w?"launcher-running-button":void 0,icon:w?c.jsx("span",{className:"launcher-stop-square"}):c.jsx(Kl,{}),onClick:()=>w?o(x):a(x),children:w?"Stop":"Start"}),c.jsx(Oe,{size:"small",onClick:()=>r(x),children:"Edit"}),c.jsx(Oe,{size:"small",danger:!0,icon:c.jsx(Fn,{}),onClick:()=>s(x),children:"Delete"})]})}}];return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"group-task-header",children:[c.jsxs("div",{className:"group-task-header-copy",children:[c.jsx(dv,{type:"secondary",children:"Start selected scripts across multiple services."}),c.jsxs(dv,{type:"secondary",className:"group-task-drag-hint",children:[c.jsx(ZR,{})," Drag the handle to reorder."]})]}),c.jsx(Oe,{type:"primary",icon:c.jsx(Xn,{}),onClick:n,children:"Add quick launch"})]}),e.length?c.jsx(ar,{className:"group-task-table",rowKey:"id",dataSource:e,columns:b,pagination:!1,size:"small",onRow:C=>({className:`${f===C.id?"is-dragging":""} ${h===C.id?"is-drag-over":""}`.trim(),onDragOver:x=>{x.preventDefault(),x.dataTransfer.dropEffect="move",f!==C.id&&p(C.id)},onDragLeave:()=>p(x=>x===C.id?null:x),onDrop:x=>{y(C.id,x)}})}):c.jsx(Xt,{description:"No quick launches yet.",className:"group-task-empty"})]})}function df({open:e,initialPath:t="~",onCancel:n,onSelect:r,title:a="Browse Directory",selectionType:o="directory"}){const{message:s}=Pr.useApp(),[u,f]=l.useState(t),[m,h]=l.useState(null),[p,v]=l.useState(!1),y=async b=>{v(!0);try{const C=await Qm.browse(b||"~");h(C),f(C.currentPath)}catch(C){s.error(C.message||"Failed to read directory")}finally{v(!1)}};return l.useEffect(()=>{e&&y(t||"~")},[e,t]),c.jsx(bn,{title:a,open:e,onCancel:n,footer:null,width:640,destroyOnClose:!0,children:c.jsxs(rr,{spinning:p,children:[c.jsx("div",{className:"file-browser-path-row",children:c.jsx(Ct,{value:u,onChange:b=>f(b.target.value),onPressEnter:()=>y(u),addonAfter:c.jsx(Oe,{size:"small",type:"text",onClick:()=>y(u),children:"Go"})})}),m&&c.jsxs("div",{children:[c.jsx("div",{className:"file-browser-parent-row",children:c.jsxs(Oe,{size:"small",onClick:()=>y(m.parentPath),disabled:m.currentPath===m.parentPath,children:[c.jsx(ec,{}),"Parent Directory"]})}),c.jsx("div",{className:"file-browser-list",children:m.subdirectories.length===0&&(o!=="file"||(m.files||[]).length===0)?c.jsx("div",{className:"file-browser-empty",children:"No items found"}):c.jsxs(c.Fragment,{children:[m.subdirectories.map(b=>c.jsxs("div",{className:"file-browser-item",onClick:()=>y(b.fullPath),children:[c.jsxs("span",{children:[c.jsx(Fr,{className:"file-browser-icon"}),b.name]}),o==="directory"&&c.jsx(Oe,{size:"small",type:"link",onClick:C=>{C.stopPropagation(),r(b.fullPath)},children:"Select Folder"})]},b.fullPath)),o==="file"&&(m.files||[]).map(b=>c.jsxs("div",{className:"file-browser-item",onClick:()=>r(b.fullPath),children:[c.jsxs("span",{children:[c.jsx(Zs,{className:"file-browser-icon"}),b.name]}),c.jsx(Oe,{size:"small",type:"link",onClick:C=>{C.stopPropagation(),r(b.fullPath)},children:"Select File"})]},b.fullPath))]})}),o==="directory"&&c.jsx("div",{className:"file-browser-confirm-row",children:c.jsxs(Oe,{type:"primary",onClick:()=>r(m.currentPath),children:["Confirm Path: ",m.currentPath]})})]})]})})}const{Text:Dc}=xn,Tm=(e,t)=>`${e}:${t}`,Rye=()=>c.jsx("div",{style:{width:"0.8em",height:"0.8em",backgroundColor:"rgba(0,0,0,0.88)"}});function Iye({form:e,editing:t,executor:n,running:r,errorCounts:a={},packageScripts:o,onRun:s,onRunInstall:u,onRunPackage:f,onStop:m,onLogs:h,onPackageLogs:p}){const v=!!(t&&[...r].some(C=>C.startsWith(`${t.id}:`))),[y,b]=l.useState(()=>v);return l.useEffect(()=>{v&&b(!0)},[t==null?void 0:t.id]),l.useEffect(()=>{v||b(!1)},[v]),c.jsx(wt.List,{name:"scripts",children:(C,{add:x,remove:w})=>{const $=["npm","pnpm","yarn"].includes(n)?{id:"install",name:"Install",command:`${n} install${n==="npm"?" --legacy-peer-deps":""}`}:null,E=[...C.map(O=>({...O,key:`custom-${O.key}`,kind:"custom"})),...$?[{key:"install",kind:"install",script:$}]:[],...(o||[]).map(O=>({key:`package-${O.id}`,kind:"package",script:O}))],R=y?E.filter(O=>{const I=O.kind==="custom"?e.getFieldValue(["scripts",O.name]):O.script;return t&&(I==null?void 0:I.id)&&r.has(Tm(t.id,I.id))}):E,N=[{title:"Source",width:100,render:(O,I)=>c.jsx($t,{color:I.kind==="package"?"purple":I.kind==="install"?"green":"default",children:I.kind==="package"?"Package":I.kind==="install"?"Executor":"Custom"})},{title:"Script name",width:200,render:(O,I)=>{var z;const j=I.kind==="custom"?e.getFieldValue(["scripts",I.name]):I.script,M=(j==null?void 0:j.name)===e.getFieldValue("startCommand"),T=t&&(j==null?void 0:j.id)&&r.has(Tm(t.id,j.id));return c.jsxs(ct,{direction:"vertical",size:1,style:{width:"100%"},children:[I.kind!=="custom"||T?c.jsxs(ct,{size:4,children:[c.jsx(Dc,{strong:!0,children:(j==null?void 0:j.name)||((z=I.script)==null?void 0:z.name)}),M&&c.jsx(qo,{className:"start-script-icon"})]}):c.jsx(wt.Item,{noStyle:!0,name:[I.name,"name"],rules:[{required:!0,message:"Required"}],children:c.jsx(Ct,{placeholder:"serve",allowClear:!0,suffix:M?c.jsx(qo,{className:"start-script-icon"}):null})}),T&&c.jsx(sa,{status:"success",text:c.jsx(Dc,{type:"secondary",style:{fontSize:11},children:"running"})})]})}},{title:"Command",render:(O,I)=>{const j=I.kind==="custom"?e.getFieldValue(["scripts",I.name]):I.script,M=t&&(j==null?void 0:j.id)&&r.has(Tm(t.id,j.id));return I.kind==="package"?c.jsxs(ct,{direction:"vertical",size:0,children:[c.jsxs(Dc,{code:!0,children:[n," run ",I.script.name]}),c.jsx(Dc,{type:"secondary",style:{fontSize:12},children:I.script.command})]}):I.kind==="install"?c.jsx(Dc,{code:!0,children:I.script.command}):M?c.jsx(Dc,{code:!0,children:j==null?void 0:j.command}):c.jsx(wt.Item,{noStyle:!0,name:[I.name,"command"],rules:[{required:!0,message:"Required"}],children:c.jsx(Ct,{placeholder:"npm run dev",allowClear:!0})})}},{title:"Actions",width:132,render:(O,I)=>{const j=I.kind==="custom"?e.getFieldValue(["scripts",I.name]):I.script,M=t&&(j==null?void 0:j.id)&&r.has(Tm(t.id,j.id)),T=t&&(j!=null&&j.id)&&a[Tm(t.id,j.id)]||0;return c.jsxs(ct,{size:2,children:[t&&c.jsx(yn,{title:M?"Stop":"Start",children:c.jsx(Oe,{type:"text",danger:M,icon:M?c.jsx(Rye,{}):c.jsx(h0e,{}),onClick:()=>M?m(j):I.kind==="package"?f(j):I.kind==="install"?u(j):s(j),disabled:!(j!=null&&j.id)})}),c.jsx(yn,{title:"Logs",children:c.jsx(sa,{count:T,size:"small",offset:[-2,2],children:c.jsx(Oe,{type:"text",icon:c.jsx(Ui,{}),onClick:()=>I.kind==="package"?p(j):h(j),disabled:!t||!(j!=null&&j.id)})})}),I.kind==="custom"&&c.jsx(yn,{title:"Remove",children:c.jsx(Oe,{type:"text",danger:!0,icon:c.jsx(Fn,{}),onClick:()=>w(I.name),disabled:!!M})})]})}}];return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"script-header",children:[c.jsx(lp,{orientation:"left",children:"Scripts"}),c.jsxs(ct,{size:"middle",align:"center",children:[c.jsxs("label",{className:"script-running-filter",children:[c.jsx(Ja,{size:"small",checked:y,onChange:b,disabled:!t}),c.jsx(Dc,{type:"secondary",className:"script-running-filter-label",children:"Show running only"})]}),c.jsx(Oe,{icon:c.jsx(Xn,{}),onClick:()=>{b(!1),x({name:"",command:""})},children:"Add script"})]})]}),c.jsx(ar,{size:"small",rowKey:"key",pagination:!1,loading:o===null,dataSource:R,columns:N})]})}})}const kye=e=>c.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor",style:{verticalAlign:"-0.125em",...e.style},...e,children:c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M.75 2.5a.75.75 0 01.742-.647h21.016a.75.75 0 01.742.853l-2.622 17.5a.75.75 0 01-.742.644H4.114a.75.75 0 01-.742-.644L.75 2.5zm13.1 11.2h-3.7l-.76-3.8h5.22l-.76 3.8z"})});function Mye(e){if(!e)return null;const t=e.toLowerCase();return t.includes("bitbucket")?c.jsx(kye,{style:{color:"#2584FF"}}):t.includes("github")?c.jsx(Sve,{style:{color:"#24292e"}}):t.includes("gitlab")?c.jsx(C0,{style:{color:"#fc6d26"}}):c.jsx(kf,{className:"repo-generic-icon"})}function W9({repoUrl:e,style:t}){if(!e)return null;const n=Mye(e);return n?c.jsx(yn,{title:"Open repository in browser",children:c.jsx(Oe,{className:"repo-icon-button",type:"text",size:"small",icon:n,onClick:r=>{r.preventDefault(),r.stopPropagation(),hr(e)},style:t})}):null}const Tye=()=>({alias:"",folder:"",groupName:"",executor:"npm",startCommand:void 0,scripts:[]});function Pye({open:e,editing:t,groups:n,running:r,errorCounts:a={},onCancel:o,onSave:s,onRun:u,onRunInstall:f,onRunPackage:m,onStop:h,onLogs:p,onDelete:v}){const{message:y,modal:b}=Pr.useApp(),[C]=wt.useForm(),[x,w]=l.useState(null),[$,E]=l.useState(!1),R=l.useRef(null),N=()=>{const T=document.querySelector(".service-modal.is-editing"),z=T==null?void 0:T.querySelector(".ant-modal-body"),P=T==null?void 0:T.closest(".ant-modal-wrap");R.current=[z,P].filter(Boolean).map(B=>({element:B,top:B.scrollTop}))};l.useLayoutEffect(()=>{const T=R.current;T&&(T.forEach(({element:z,top:P})=>{z.isConnected&&(z.scrollTop=P)}),R.current=null)},[x]);const O=T=>{if(T&&(C.setFieldValue("folder",T),!C.getFieldValue("alias"))){const P=T.split(/[/\\]/).filter(Boolean);P.length>0&&C.setFieldValue("alias",P[P.length-1])}E(!1)},I=async()=>{const T=String(C.getFieldValue("folder")||"").trim();if(!T){y.warning("Set a project folder first.");return}try{await Wn.openFolder(T)}catch(z){y.error(z.message)}},j=()=>{b.confirm({title:"Delete Service",content:`Are you sure you want to delete service "${t==null?void 0:t.alias}"?`,okText:"Delete",okButtonProps:{type:"primary",danger:!0},cancelText:"Cancel",onOk:async()=>{try{await v(t)}catch(T){y.error(T.message)}}})};l.useEffect(()=>{e&&(C.resetFields(),C.setFieldsValue(t?{...t,startCommand:t.startCommand||void 0,scripts:t.scripts}:Tye()),w(t?null:[]),t&&Br.packageScripts(t.id).then(T=>{N(),w(T.scripts)}).catch(()=>{N(),w([])}))},[e,t==null?void 0:t.id,C]);const M=async()=>{try{const T=(C.getFieldValue("scripts")||[]).filter(B=>{var H,A;return((H=B==null?void 0:B.name)==null?void 0:H.trim())||((A=B==null?void 0:B.command)==null?void 0:A.trim())});C.setFieldValue("scripts",T);const z=await C.validateFields(["alias","folder","groupName","startCommand"]),P={...C.getFieldsValue(!0),...z,scripts:T};await s(P)}catch(T){if(T!=null&&T.errorFields)return;y.error(T.message)}};return c.jsxs(bn,{className:`service-modal${t?" is-editing":""}`,title:t?c.jsxs(ct,{align:"center",size:6,children:[c.jsxs("span",{children:["Service details · ",t.alias]}),c.jsx(W9,{repoUrl:t.repoUrl})]}):"Add service",open:e,onCancel:o,onOk:M,okText:t?"Save":"Save service",width:860,destroyOnClose:!0,footer:c.jsxs("div",{className:"service-modal-footer",children:[t?c.jsx(Oe,{type:"primary",danger:!0,onClick:j,children:"Delete service"}):c.jsx("div",{}),c.jsxs(ct,{children:[c.jsx(Oe,{onClick:o,children:"Cancel"}),c.jsx(Oe,{type:"primary",onClick:M,children:t?"Save":"Save service"})]})]}),children:[c.jsxs(wt,{form:C,layout:"vertical",children:[c.jsx(J0,{className:"service-config",defaultActiveKey:t?[]:["configuration"],items:[{key:"configuration",label:"Service configuration",children:c.jsxs(Uo,{gutter:[16,0],children:[c.jsx(qn,{xs:24,sm:12,children:c.jsx(wt.Item,{label:"Name",name:"alias",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"Service name",allowClear:!0})})}),c.jsx(qn,{xs:24,sm:12,children:c.jsx(wt.Item,{label:"Project folder",name:"folder",rules:[{required:!0}],children:c.jsx(Ct,{prefix:c.jsx(Oe,{type:"text",htmlType:"button",icon:c.jsx(Fr,{}),onClick:I,"aria-label":"Open project folder",title:"Open project folder",style:{color:"#8c8c8c",padding:"0 4px"}}),suffix:c.jsx(Oe,{type:"text",size:"small",icon:c.jsx(Fr,{}),onClick:()=>E(!0),style:{fontSize:12,padding:"0 4px"},children:"Browse"}),placeholder:"Project folder path",allowClear:!0})})}),c.jsx(qn,{xs:24,sm:8,children:c.jsx(wt.Item,{label:"Group",name:"groupName",children:c.jsx(rf,{options:n.map(T=>({value:T})),placeholder:"Group name",allowClear:!0})})}),c.jsx(qn,{xs:24,sm:8,children:c.jsx(wt.Item,{label:"Executor",name:"executor",rules:[{required:!0}],children:c.jsx(rf,{options:["npm","pnpm","yarn"].map(T=>({value:T})),placeholder:"npm",allowClear:!0})})}),c.jsx(qn,{xs:24,sm:8,children:c.jsx(wt.Item,{noStyle:!0,shouldUpdate:(T,z)=>T.scripts!==z.scripts,children:()=>{const T=(C.getFieldValue("scripts")||[]).map(B=>B==null?void 0:B.name).filter(Boolean),z=(x||[]).map(B=>B.name),P=[...new Set([...T,...z])].map(B=>({label:B,value:B}));return c.jsx(wt.Item,{label:"Start script name",name:"startCommand",children:c.jsx($n,{placeholder:"Select start script",allowClear:!0,options:P})})}})})]})}]}),c.jsx(wt.Item,{noStyle:!0,shouldUpdate:(T,z)=>T.executor!==z.executor||T.startCommand!==z.startCommand||T.scripts!==z.scripts,children:()=>c.jsx(Iye,{form:C,editing:t,executor:C.getFieldValue("executor")||"npm",running:r,errorCounts:a,packageScripts:x,onRun:T=>u(t,T),onRunInstall:()=>f(t),onRunPackage:T=>m(t,T),onStop:T=>h(t,T.id),onLogs:T=>p(t,T),onPackageLogs:T=>p(t,T,!0)})})]}),c.jsx(df,{open:$,initialPath:C.getFieldValue("folder")||"~",onCancel:()=>E(!1),onSelect:O,title:"Select Project Directory"})]})}const{Text:Dye}=xn;function zye({open:e,editingGroupTask:t,groupCatalog:n,onCancel:r,onSave:a}){const{message:o}=Pr.useApp(),[s]=wt.useForm();l.useEffect(()=>{e&&(s.resetFields(),s.setFieldsValue({name:(t==null?void 0:t.name)||"",items:(t==null?void 0:t.items.map(m=>`${m.launcherId}|${m.scriptId}`))||[]}))},[e,t,s]);const u=l.useMemo(()=>Object.entries(n.reduce((m,h)=>{const p=h.groupName||"Ungrouped";return(m[p]||(m[p]=[])).push(h),m},{})).sort(([m],[h])=>m.localeCompare(h)).map(([m,h])=>({key:m,label:m,children:c.jsx("div",{className:"group-task-projects",children:h.map(p=>c.jsx(It,{size:"small",title:p.alias,children:c.jsx(ct,{direction:"vertical",children:p.scripts.map(v=>c.jsxs(tr,{value:`${p.id}|${v.id}`,children:[v.name," ",c.jsxs(Dye,{type:"secondary",children:["(",v.source,")"]})]},v.id))})},p.id))})})),[n]),f=async()=>{try{const m=await s.validateFields(),h={name:m.name,items:m.items.map(p=>{const[v,y]=p.split("|");return{launcherId:v,scriptId:y}})};await a(h)}catch(m){m!=null&&m.errorFields||o.error(m.message)}};return c.jsx(bn,{title:t?`Edit quick launch · ${t.name}`:"Add quick launch",open:e,onCancel:r,onOk:f,okText:t?"Save changes":"Save quick launch",width:760,destroyOnClose:!0,children:c.jsxs(wt,{form:s,layout:"vertical",children:[c.jsx(wt.Item,{label:"Name",name:"name",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"Start local stack",allowClear:!0})}),c.jsx(wt.Item,{label:"Scripts",name:"items",rules:[{required:!0,message:"Select at least one script."}],children:c.jsx(tr.Group,{className:"group-task-selector",children:c.jsx(Qa,{items:u})})})]})})}const fI={30:"ansi-black",31:"ansi-red",32:"ansi-green",33:"ansi-yellow",34:"ansi-blue",35:"ansi-magenta",36:"ansi-cyan",37:"ansi-white",90:"ansi-gray",91:"ansi-red",92:"ansi-green",93:"ansi-yellow",94:"ansi-blue",95:"ansi-magenta",96:"ansi-cyan",97:"ansi-white"},w0=()=>{const e=window.getSelection();return!e||e.isCollapsed||!e.toString()?!1:[e.anchorNode,e.focusNode].some(t=>{var r;const n=(t==null?void 0:t.nodeType)===Node.ELEMENT_NODE?t:t==null?void 0:t.parentElement;return(r=n==null?void 0:n.closest)==null?void 0:r.call(n,".log-output")})};function Xw({value:e,editor:t,className:n="",onScroll:r}){const[a,o]=l.useState(t||"vscode"),[s,u]=l.useState(""),[f,m]=l.useState("");l.useEffect(()=>{t&&o(t),Wn.status().then(C=>{C!=null&&C.defaultEditor&&!t&&o(C.defaultEditor),C!=null&&C.domain&&u(C.domain),C!=null&&C.jiraIssuePrefix&&m(C.jiraIssuePrefix)}).catch(()=>{})},[t]);const h=(f||"").split(/[\s,]+/).filter(Boolean).map(C=>C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),p=h.length>0&&s?new RegExp(`\\b(?:${h.join("|")})-[a-zA-Z0-9]{1,10}\\b`,"gi"):null,v=(C,x)=>{let w="";const $=(O,I)=>O.split(/(\u001b\[[0-9;]*m)/g).map((M,T)=>{const z=M.match(/^\u001b\[([0-9;]*)m$/);if(z){const B=z[1].split(";").map(Number);return w=B.includes(0)?"":fI[B.find(H=>fI[H])]||w,null}if(!M)return null;const P=w||(/\b(error|failed|fatal|exception|TS\d{4,5})\b/i.test(M)?"log-error":/\b(warn|warning)\b/i.test(M)?"log-warning":/\b(success|ready|started|listening)\b/i.test(M)?"log-success":"");return c.jsx("span",{className:P,children:M},`${I}-${T}`)}),E=/(https?:\/\/(?:[^\s<>'"`]|\u001b\[[0-9;]*m)+|\/(?:(?:[^\s:(),;!?]|\u001b\[[0-9;]*m)+\/)*(?:[^\s:(),;!?]|\u001b\[[0-9;]*m)+(?::(?:\d+|\u001b\[[0-9;]*m)+(?::(?:\d+|\u001b\[[0-9;]*m)+)?)?)/g,R=p&&p.test(C);return!C.includes("http")&&!C.includes("/")&&!R?$(C,`${x}-0`):C.split(E).map((O,I)=>{if(!O)return null;const j=`${x}-${I}`;if(/^https?:\/\//.test(O.replace(/\u001b\[[0-9;]*m/g,""))){const T=O.replace(/\u001b\[[0-9;]*m/g,""),z=T.replace(/[),.;:!?]+$/,""),P=T.slice(z.length);return c.jsxs("span",{children:[c.jsx("a",{className:"log-link",href:z,target:"_blank",rel:"noreferrer",onClick:B=>{B.preventDefault(),hr(z)},children:$(O.slice(0,O.length-P.length),`${j}-url`)}),P&&$(P,`${j}-suf`)]},j)}const M=O.replace(/\u001b\[[0-9;]*m/g,"");if(M.startsWith("/")){const[,T,z=""]=M.match(/^(.*?)(:\d+(?::\d+)?)?$/)||[];if(T){const P=U9(a,T,z);return c.jsx("a",{className:"log-link",href:P,target:"_blank",rel:"noreferrer",title:`Open in ${V9(a)}`,children:$(O,j)},j)}}if(p&&s&&(p.lastIndex=0,p.test(M))){const T=[];let z=0;p.lastIndex=0;for(const P of M.matchAll(p)){P.index>z&&T.push($(M.slice(z,P.index),`${j}-sub-${P.index}`));const B=P[0],H=Ly(s,B);T.push(c.jsx("a",{className:"log-link",href:H,target:"_blank",rel:"noreferrer",onClick:A=>{A.preventDefault(),hr(H)},children:B},`${j}-jira-${P.index}`)),z=P.index+B.length}return z<M.length&&T.push($(M.slice(z),`${j}-sub-end`)),c.jsx("span",{children:T},j)}return $(O,j)})},y=C=>{C.preventDefault(),C.stopPropagation()},b=C=>{C.metaKey||C.ctrlKey||C.altKey||["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown","Shift","Tab","Escape"].includes(C.key)||C.preventDefault()};return c.jsx("div",{className:`log-output ${n}`.trim(),role:"log",contentEditable:!0,suppressContentEditableWarning:!0,onBeforeInput:y,onPaste:y,onDrop:y,onKeyDown:b,onMouseDown:C=>C.stopPropagation(),onScroll:r,children:e.split(`
496
+ `]:{zIndex:10,width:r,margin:`0 ${me(e.marginXXS)}`,fontSize:r,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,color:a,"&:hover":{color:a},svg:{verticalAlign:"baseline"}}},[`${u}-thumbnail, ${u}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${u}-name`]:{display:"none",textAlign:"center"},[`${u}-file + ${u}-name`]:{position:"absolute",bottom:e.margin,display:"block",width:`calc(100% - ${me(o(e.paddingXS).mul(2).equal())})`},[`${u}-uploading`]:{[`&${u}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${n}-eye, ${n}-download, ${n}-delete`]:{display:"none"}},[`${u}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${me(o(e.paddingXS).mul(2).equal())})`,paddingInlineStart:0}}}),[`${t}-wrapper${t}-picture-circle-wrapper`]:{[`${t}${t}-select`]:{borderRadius:"50%"}}}},spe=e=>{const{componentCls:t}=e;return{[`${t}-rtl`]:{direction:"rtl"}}},cpe=e=>{const{componentCls:t,colorTextDisabled:n}=e;return{[`${t}-wrapper`]:Object.assign(Object.assign({},On(e)),{[t]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${t}-select`]:{display:"inline-block"},[`${t}-hidden`]:{display:"none"},[`${t}-disabled`]:{color:n,cursor:"not-allowed"}})}},upe=e=>({actionsColor:e.colorIcon,pictureCardSize:e.controlHeightLG*2.55}),dpe=pn("Upload",e=>{const{fontSizeHeading3:t,fontHeight:n,lineWidth:r,pictureCardSize:a,calc:o}=e,s=sn(e,{uploadThumbnailSize:o(t).mul(2).equal(),uploadProgressOffset:o(o(n).div(2)).add(r).equal(),uploadPicCardSize:a});return[cpe(s),rpe(s),ipe(s),lpe(s),ape(s),ope(s),spe(s),Kh(s)]},upe);var fpe={icon:function(t,n){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:n}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:t}}]}},name:"file",theme:"twotone"},mpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:fpe}))},hpe=l.forwardRef(mpe),ppe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},gpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:ppe}))},vpe=l.forwardRef(gpe),ype={icon:function(t,n){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:t}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:n}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:n}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:n}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:t}}]}},name:"picture",theme:"twotone"},bpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:ype}))},xpe=l.forwardRef(bpe);function sv(e){return Object.assign(Object.assign({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function cv(e,t){const n=et(t),r=n.findIndex(({uid:a})=>a===e.uid);return r===-1?n.push(e):n[r]=e,n}function kC(e,t){const n=e.uid!==void 0?"uid":"name";return t.filter(r=>r[n]===e[n])[0]}function Cpe(e,t){const n=e.uid!==void 0?"uid":"name",r=t.filter(a=>a[n]!==e[n]);return r.length===t.length?null:r}const Spe=(e="")=>{const t=e.split("/"),r=t[t.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(r)||[""])[0]},N9=e=>e.indexOf("image/")===0,wpe=e=>{if(e.type&&!e.thumbUrl)return N9(e.type);const t=e.thumbUrl||e.url||"",n=Spe(t);return/^data:image\//.test(t)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(n)?!0:!(/^data:/.test(t)||n)},Ns=200;function $pe(e){return new Promise(t=>{if(!e.type||!N9(e.type)){t("");return}const n=document.createElement("canvas");n.width=Ns,n.height=Ns,n.style.cssText=`position: fixed; left: 0; top: 0; width: ${Ns}px; height: ${Ns}px; z-index: 9999; display: none;`,document.body.appendChild(n);const r=n.getContext("2d"),a=new Image;if(a.onload=()=>{const{width:o,height:s}=a;let u=Ns,f=Ns,m=0,h=0;o>s?(f=s*(Ns/o),h=-(f-u)/2):(u=o*(Ns/s),m=-(u-f)/2),r.drawImage(a,m,h,u,f);const p=n.toDataURL();document.body.removeChild(n),window.URL.revokeObjectURL(a.src),t(p)},a.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const o=new FileReader;o.onload=()=>{o.result&&typeof o.result=="string"&&(a.src=o.result)},o.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const o=new FileReader;o.onload=()=>{o.result&&t(o.result)},o.readAsDataURL(e)}else a.src=window.URL.createObjectURL(e)})}var Epe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},jpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Epe}))},ql=l.forwardRef(jpe);const Npe=l.forwardRef(({prefixCls:e,className:t,style:n,locale:r,listType:a,file:o,items:s,progress:u,iconRender:f,actionIconRender:m,itemRender:h,isImgUrl:p,showPreviewIcon:v,showRemoveIcon:y,showDownloadIcon:b,previewIcon:C,removeIcon:x,downloadIcon:w,extra:$,onPreview:E,onDownload:R,onClose:N},O)=>{var I,j;const{status:M}=o,[T,z]=l.useState(M);l.useEffect(()=>{M!=="removed"&&z(M)},[M]);const[P,B]=l.useState(!1);l.useEffect(()=>{const re=setTimeout(()=>{B(!0)},300);return()=>{clearTimeout(re)}},[]);const H=f(o);let A=l.createElement("div",{className:`${e}-icon`},H);if(a==="picture"||a==="picture-card"||a==="picture-circle")if(T==="uploading"||!o.thumbUrl&&!o.url){const re=ve(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:T!=="uploading"});A=l.createElement("div",{className:re},H)}else{const re=p!=null&&p(o)?l.createElement("img",{src:o.thumbUrl||o.url,alt:o.name,className:`${e}-list-item-image`,crossOrigin:o.crossOrigin}):H,oe=ve(`${e}-list-item-thumbnail`,{[`${e}-list-item-file`]:p&&!p(o)});A=l.createElement("a",{className:oe,onClick:de=>E(o,de),href:o.url||o.thumbUrl,target:"_blank",rel:"noopener noreferrer"},re)}const L=ve(`${e}-list-item`,`${e}-list-item-${T}`),F=typeof o.linkProps=="string"?JSON.parse(o.linkProps):o.linkProps,U=(typeof y=="function"?y(o):y)?m((typeof x=="function"?x(o):x)||l.createElement(Fn,null),()=>N(o),e,r.removeFile,!0):null,q=(typeof b=="function"?b(o):b)&&T==="done"?m((typeof w=="function"?w(o):w)||l.createElement(ql,null),()=>R(o),e,r.downloadFile):null,_=a!=="picture-card"&&a!=="picture-circle"&&l.createElement("span",{key:"download-delete",className:ve(`${e}-list-item-actions`,{picture:a==="picture"})},q,U),K=typeof $=="function"?$(o):$,X=K&&l.createElement("span",{className:`${e}-list-item-extra`},K),V=ve(`${e}-list-item-name`),W=o.url?l.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:V,title:o.name},F,{href:o.url,onClick:re=>E(o,re)}),o.name,X):l.createElement("span",{key:"view",className:V,onClick:re=>E(o,re),title:o.name},o.name,X),G=(typeof v=="function"?v(o):v)&&(o.url||o.thumbUrl)?l.createElement("a",{href:o.url||o.thumbUrl,target:"_blank",rel:"noopener noreferrer",onClick:re=>E(o,re),title:r.previewFile},typeof C=="function"?C(o):C||l.createElement(Ef,null)):null,Y=(a==="picture-card"||a==="picture-circle")&&T!=="uploading"&&l.createElement("span",{className:`${e}-list-item-actions`},G,T==="done"&&q,U),{getPrefixCls:te}=l.useContext(_t),ne=te(),ue=l.createElement("div",{className:L},A,W,_,Y,P&&l.createElement(ra,{motionName:`${ne}-fade`,visible:T==="uploading",motionDeadline:2e3},({className:re})=>{const oe="percent"in o?l.createElement(dp,Object.assign({type:"line",percent:o.percent,"aria-label":o["aria-label"],"aria-labelledby":o["aria-labelledby"]},u)):null;return l.createElement("div",{className:ve(`${e}-list-item-progress`,re)},oe)})),Z=o.response&&typeof o.response=="string"?o.response:((I=o.error)===null||I===void 0?void 0:I.statusText)||((j=o.error)===null||j===void 0?void 0:j.message)||r.uploadError,ee=T==="error"?l.createElement(yn,{title:Z,getPopupContainer:re=>re.parentNode},ue):ue;return l.createElement("div",{className:ve(`${e}-list-item-container`,t),style:n,ref:O},h?h(ee,o,s,{download:R.bind(null,o),preview:E.bind(null,o),remove:N.bind(null,o)}):ee)}),Ope=(e,t)=>{const{listType:n="text",previewFile:r=$pe,onPreview:a,onDownload:o,onRemove:s,locale:u,iconRender:f,isImageUrl:m=wpe,prefixCls:h,items:p=[],showPreviewIcon:v=!0,showRemoveIcon:y=!0,showDownloadIcon:b=!1,removeIcon:C,previewIcon:x,downloadIcon:w,extra:$,progress:E={size:[-1,2],showInfo:!1},appendAction:R,appendActionVisible:N=!0,itemRender:O,disabled:I}=e,[,j]=k2(),[M,T]=l.useState(!1),z=["picture-card","picture-circle"].includes(n);l.useEffect(()=>{n.startsWith("picture")&&(p||[]).forEach(V=>{!(V.originFileObj instanceof File||V.originFileObj instanceof Blob)||V.thumbUrl!==void 0||(V.thumbUrl="",r==null||r(V.originFileObj).then(W=>{V.thumbUrl=W||"",j()}))})},[n,p,r]),l.useEffect(()=>{T(!0)},[]);const P=(V,W)=>{if(a)return W==null||W.preventDefault(),a(V)},B=V=>{typeof o=="function"?o(V):V.url&&window.open(V.url)},H=V=>{s==null||s(V)},A=V=>{if(f)return f(V,n);const W=V.status==="uploading";if(n.startsWith("picture")){const G=n==="picture"?l.createElement(Vo,null):u.uploading,Y=m!=null&&m(V)?l.createElement(xpe,null):l.createElement(hpe,null);return W?G:Y}return W?l.createElement(Vo,null):l.createElement(vpe,null)},L=(V,W,G,Y,te)=>{const ne={type:"text",size:"small",title:Y,onClick:ue=>{var Z,ee;W(),l.isValidElement(V)&&((ee=(Z=V.props).onClick)===null||ee===void 0||ee.call(Z,ue))},className:`${G}-list-item-action`,disabled:te?I:!1};return l.isValidElement(V)?l.createElement(Oe,Object.assign({},ne,{icon:Qr(V,Object.assign(Object.assign({},V.props),{onClick:()=>{}}))})):l.createElement(Oe,Object.assign({},ne),l.createElement("span",null,V))};l.useImperativeHandle(t,()=>({handlePreview:P,handleDownload:B}));const{getPrefixCls:F}=l.useContext(_t),U=F("upload",h),q=F(),_=ve(`${U}-list`,`${U}-list-${n}`),K=l.useMemo(()=>Hn(tf(q),["onAppearEnd","onEnterEnd","onLeaveEnd"]),[q]),X=Object.assign(Object.assign({},z?{}:K),{motionDeadline:2e3,motionName:`${U}-${z?"animate-inline":"animate"}`,keys:et(p.map(V=>({key:V.uid,file:V}))),motionAppear:M});return l.createElement("div",{className:_},l.createElement(O2,Object.assign({},X,{component:!1}),({key:V,file:W,className:G,style:Y})=>l.createElement(Npe,{key:V,locale:u,prefixCls:U,className:G,style:Y,file:W,items:p,progress:E,listType:n,isImgUrl:m,showPreviewIcon:v,showRemoveIcon:y,showDownloadIcon:b,removeIcon:C,previewIcon:x,downloadIcon:w,extra:$,iconRender:A,actionIconRender:L,itemRender:O,onPreview:P,onDownload:B,onClose:H})),R&&l.createElement(ra,Object.assign({},X,{visible:N,forceRender:!0}),({className:V,style:W})=>Qr(R,G=>({className:ve(G.className,V),style:Object.assign(Object.assign(Object.assign({},W),{pointerEvents:V?"none":void 0}),G.style)}))))},Rpe=l.forwardRef(Ope);var Ipe=function(e,t,n,r){function a(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function u(h){try{m(r.next(h))}catch(p){s(p)}}function f(h){try{m(r.throw(h))}catch(p){s(p)}}function m(h){h.done?o(h.value):a(h.value).then(u,f)}m((r=r.apply(e,[])).next())})};const Xm=`__LIST_IGNORE_${Date.now()}__`,kpe=(e,t)=>{const n=pr("upload"),{fileList:r,defaultFileList:a,onRemove:o,showUploadList:s=!0,listType:u="text",onPreview:f,onDownload:m,onChange:h,onDrop:p,previewFile:v,disabled:y,locale:b,iconRender:C,isImageUrl:x,progress:w,prefixCls:$,className:E,type:R="select",children:N,style:O,itemRender:I,maxCount:j,data:M={},multiple:T=!1,hasControlInside:z=!0,action:P="",accept:B="",supportServerRender:H=!0,rootClassName:A}=e,L=l.useContext(va),F=y??L,U=e.customRequest||n.customRequest,[q,_]=kn(a||[],{value:r,postState:$e=>$e??[]}),[K,X]=l.useState("drop"),V=l.useRef(null),W=l.useRef(null);l.useMemo(()=>{const $e=Date.now();(r||[]).forEach((Ae,We)=>{!Ae.uid&&!Object.isFrozen(Ae)&&(Ae.uid=`__AUTO__${$e}_${We}__`)})},[r]);const G=($e,Ae,We)=>{let De=et(Ae),Je=!1;j===1?De=De.slice(-1):j&&(Je=De.length>j,De=De.slice(0,j)),fi.flushSync(()=>{_(De)});const Ye={file:$e,fileList:De};We&&(Ye.event=We),(!Je||$e.status==="removed"||De.some(Ge=>Ge.uid===$e.uid))&&fi.flushSync(()=>{h==null||h(Ye)})},Y=($e,Ae)=>Ipe(void 0,void 0,void 0,function*(){const{beforeUpload:We,transformFile:De}=e;let Je=$e;if(We){const Ye=yield We($e,Ae);if(Ye===!1)return!1;if(delete $e[Xm],Ye===Xm)return Object.defineProperty($e,Xm,{value:!0,configurable:!0}),!1;typeof Ye=="object"&&Ye&&(Je=Ye)}return De&&(Je=yield De(Je)),Je}),te=$e=>{const Ae=$e.filter(Je=>!Je.file[Xm]);if(!Ae.length)return;const We=Ae.map(Je=>sv(Je.file));let De=et(q);We.forEach(Je=>{De=cv(Je,De)}),We.forEach((Je,Ye)=>{let Ge=Je;if(Ae[Ye].parsedFile)Je.status="uploading";else{const{originFileObj:He}=Je;let nt;try{nt=new File([He],He.name,{type:He.type})}catch{nt=new Blob([He],{type:He.type}),nt.name=He.name,nt.lastModifiedDate=new Date,nt.lastModified=new Date().getTime()}nt.uid=Je.uid,Ge=nt}G(Ge,De)})},ne=($e,Ae,We)=>{try{typeof $e=="string"&&($e=JSON.parse($e))}catch{}if(!kC(Ae,q))return;const De=sv(Ae);De.status="done",De.percent=100,De.response=$e,De.xhr=We;const Je=cv(De,q);G(De,Je)},ue=($e,Ae)=>{if(!kC(Ae,q))return;const We=sv(Ae);We.status="uploading",We.percent=$e.percent;const De=cv(We,q);G(We,De,$e)},Z=($e,Ae,We)=>{if(!kC(We,q))return;const De=sv(We);De.error=$e,De.response=Ae,De.status="error";const Je=cv(De,q);G(De,Je)},ee=$e=>{let Ae;Promise.resolve(typeof o=="function"?o($e):o).then(We=>{var De;if(We===!1)return;const Je=Cpe($e,q);Je&&(Ae=Object.assign(Object.assign({},$e),{status:"removed"}),q==null||q.forEach(Ye=>{const Ge=Ae.uid!==void 0?"uid":"name";Ye[Ge]===Ae[Ge]&&!Object.isFrozen(Ye)&&(Ye.status="removed")}),(De=V.current)===null||De===void 0||De.abort(Ae),G(Ae,Je))})},re=$e=>{X($e.type),$e.type==="drop"&&(p==null||p($e))};l.useImperativeHandle(t,()=>({onBatchStart:te,onSuccess:ne,onProgress:ue,onError:Z,fileList:q,upload:V.current,nativeElement:W.current}));const{getPrefixCls:oe,direction:de,upload:be}=l.useContext(_t),J=oe("upload",$),ye=Object.assign(Object.assign({onBatchStart:te,onError:Z,onProgress:ue,onSuccess:ne},e),{customRequest:U,data:M,multiple:T,action:P,accept:B,supportServerRender:H,prefixCls:J,disabled:F,beforeUpload:Y,onChange:void 0,hasControlInside:z});delete ye.className,delete ye.style,(!N||F)&&delete ye.id;const xe=`${J}-wrapper`,[ze,he,ce]=dpe(J,xe),[se]=mo("Upload",pi.Upload),{showRemoveIcon:ae,showPreviewIcon:ge,showDownloadIcon:Re,removeIcon:_e,previewIcon:ie,downloadIcon:fe,extra:we}=typeof s=="boolean"?{}:s,ke=typeof ae>"u"?!F:ae,Pe=($e,Ae)=>s?l.createElement(Rpe,{prefixCls:J,listType:u,items:q,previewFile:v,onPreview:f,onDownload:m,onRemove:ee,showRemoveIcon:ke,showPreviewIcon:ge,showDownloadIcon:Re,removeIcon:_e,previewIcon:ie,downloadIcon:fe,iconRender:C,extra:we,locale:Object.assign(Object.assign({},se),b),isImageUrl:x,progress:w,appendAction:$e,appendActionVisible:Ae,itemRender:I,disabled:F}):$e,Ie=ve(xe,E,A,he,ce,be==null?void 0:be.className,{[`${J}-rtl`]:de==="rtl",[`${J}-picture-card-wrapper`]:u==="picture-card",[`${J}-picture-circle-wrapper`]:u==="picture-circle"}),Ve=Object.assign(Object.assign({},be==null?void 0:be.style),O);if(R==="drag"){const $e=ve(he,J,`${J}-drag`,{[`${J}-drag-uploading`]:q.some(Ae=>Ae.status==="uploading"),[`${J}-drag-hover`]:K==="dragover",[`${J}-disabled`]:F,[`${J}-rtl`]:de==="rtl"});return ze(l.createElement("span",{className:Ie,ref:W},l.createElement("div",{className:$e,style:Ve,onDrop:re,onDragOver:re,onDragLeave:re},l.createElement(Kw,Object.assign({},ye,{ref:V,className:`${J}-btn`}),l.createElement("div",{className:`${J}-drag-container`},N))),Pe()))}const Le=ve(J,`${J}-select`,{[`${J}-disabled`]:F,[`${J}-hidden`]:!N}),je=l.createElement("div",{className:Le,style:Ve},l.createElement(Kw,Object.assign({},ye,{ref:V})));return ze(u==="picture-card"||u==="picture-circle"?l.createElement("span",{className:Ie,ref:W},Pe(je,!!N)):l.createElement("span",{className:Ie,ref:W},je,Pe()))},O9=l.forwardRef(kpe);var Mpe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};const Tpe=l.forwardRef((e,t)=>{const{style:n,height:r,hasControlInside:a=!1,children:o}=e,s=Mpe(e,["style","height","hasControlInside","children"]),u=Object.assign(Object.assign({},n),{height:r});return l.createElement(O9,Object.assign({ref:t,hasControlInside:a},s,{style:u,type:"drag"}),o)}),hp=O9;hp.Dragger=Tpe;hp.LIST_IGNORE=Xm;var Ppe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M193 796c0 17.7 14.3 32 32 32h574c17.7 0 32-14.3 32-32V563c0-176.2-142.8-319-319-319S193 386.8 193 563v233zm72-233c0-136.4 110.6-247 247-247s247 110.6 247 247v193H404V585c0-5.5-4.5-10-10-10h-44c-5.5 0-10 4.5-10 10v171h-75V563zm-48.1-252.5l39.6-39.6c3.1-3.1 3.1-8.2 0-11.3l-67.9-67.9a8.03 8.03 0 00-11.3 0l-39.6 39.6a8.03 8.03 0 000 11.3l67.9 67.9c3.1 3.1 8.1 3.1 11.3 0zm669.6-79.2l-39.6-39.6a8.03 8.03 0 00-11.3 0l-67.9 67.9a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l67.9-67.9c3.1-3.2 3.1-8.2 0-11.3zM832 892H192c-17.7 0-32 14.3-32 32v24c0 4.4 3.6 8 8 8h688c4.4 0 8-3.6 8-8v-24c0-17.7-14.3-32-32-32zM484 180h56c4.4 0 8-3.6 8-8V76c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v96c0 4.4 3.6 8 8 8z"}}]},name:"alert",theme:"outlined"},Dpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Ppe}))},uf=l.forwardRef(Dpe),zpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908 640H804V488c0-4.4-3.6-8-8-8H548v-96h108c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16H368c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h108v96H228c-4.4 0-8 3.6-8 8v152H116c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h288c8.8 0 16-7.2 16-16V656c0-8.8-7.2-16-16-16H292v-88h440v88H620c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h288c8.8 0 16-7.2 16-16V656c0-8.8-7.2-16-16-16zm-564 76v168H176V716h168zm84-408V140h168v168H428zm420 576H680V716h168v168z"}}]},name:"apartment",theme:"outlined"},Ape=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:zpe}))},_pe=l.forwardRef(Ape),Lpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},Bpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Lpe}))},Hpe=l.forwardRef(Bpe),Fpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"},Vpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Fpe}))},R9=l.forwardRef(Vpe),Upe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]},name:"arrow-down",theme:"outlined"},Wpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Upe}))},I9=l.forwardRef(Wpe),qpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"},Kpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:qpe}))},ec=l.forwardRef(Kpe),Gpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 000-48.4z"}}]},name:"arrow-right",theme:"outlined"},Ype=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Gpe}))},Qc=l.forwardRef(Ype),Xpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 545.5L536.1 163a31.96 31.96 0 00-48.3 0L156 545.5a7.97 7.97 0 006 13.2h81c4.6 0 9-2 12.1-5.5L474 300.9V864c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V300.9l218.9 252.3c3 3.5 7.4 5.5 12.1 5.5h81c6.8 0 10.5-8 6-13.2z"}}]},name:"arrow-up",theme:"outlined"},Jpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Xpe}))},k9=l.forwardRef(Jpe),Qpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M816 768h-24V428c0-141.1-104.3-257.7-240-277.1V112c0-22.1-17.9-40-40-40s-40 17.9-40 40v38.9c-135.7 19.4-240 136-240 277.1v340h-24c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h216c0 61.8 50.2 112 112 112s112-50.2 112-112h216c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM512 888c-26.5 0-48-21.5-48-48h96c0 26.5-21.5 48-48 48zM304 768V428c0-55.6 21.6-107.8 60.9-147.1S456.4 220 512 220c55.6 0 107.8 21.6 147.1 60.9S720 372.4 720 428v340H304z"}}]},name:"bell",theme:"outlined"},Zpe=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Qpe}))},Kd=l.forwardRef(Zpe),ege={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M740 161c-61.8 0-112 50.2-112 112 0 50.1 33.1 92.6 78.5 106.9v95.9L320 602.4V318.1c44.2-15 76-56.9 76-106.1 0-61.8-50.2-112-112-112s-112 50.2-112 112c0 49.2 31.8 91 76 106.1V706c-44.2 15-76 56.9-76 106.1 0 61.8 50.2 112 112 112s112-50.2 112-112c0-49.2-31.8-91-76-106.1v-27.8l423.5-138.7a50.52 50.52 0 0034.9-48.2V378.2c42.9-15.8 73.6-57 73.6-105.2 0-61.8-50.2-112-112-112zm-504 51a48.01 48.01 0 0196 0 48.01 48.01 0 01-96 0zm96 600a48.01 48.01 0 01-96 0 48.01 48.01 0 0196 0zm408-491a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"branches",theme:"outlined"},tge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:ege}))},ou=l.forwardRef(tge),nge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M304 280h56c4.4 0 8-3.6 8-8 0-28.3 5.9-53.2 17.1-73.5 10.6-19.4 26-34.8 45.4-45.4C450.9 142 475.7 136 504 136h16c28.3 0 53.2 5.9 73.5 17.1 19.4 10.6 34.8 26 45.4 45.4C650 218.9 656 243.7 656 272c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-40-8.8-76.7-25.9-108.1a184.31 184.31 0 00-74-74C596.7 72.8 560 64 520 64h-16c-40 0-76.7 8.8-108.1 25.9a184.31 184.31 0 00-74 74C304.8 195.3 296 232 296 272c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M940 512H792V412c76.8 0 139-62.2 139-139 0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8a63 63 0 01-63 63H232a63 63 0 01-63-63c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 76.8 62.2 139 139 139v100H84c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h148v96c0 6.5.2 13 .7 19.3C164.1 728.6 116 796.7 116 876c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-44.2 23.9-82.9 59.6-103.7a273 273 0 0022.7 49c24.3 41.5 59 76.2 100.5 100.5S460.5 960 512 960s99.8-13.9 141.3-38.2a281.38 281.38 0 00123.2-149.5A120 120 0 01836 876c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8 0-79.3-48.1-147.4-116.7-176.7.4-6.4.7-12.8.7-19.3v-96h148c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM716 680c0 36.8-9.7 72-27.8 102.9-17.7 30.3-43 55.6-73.3 73.3C584 874.3 548.8 884 512 884s-72-9.7-102.9-27.8c-30.3-17.7-55.6-43-73.3-73.3A202.75 202.75 0 01308 680V412h408v268z"}}]},name:"bug",theme:"outlined"},rge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:nge}))},Th=l.forwardRef(rge),age={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"},oge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:age}))},MC=l.forwardRef(oge),ige={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},lge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:ige}))},gi=l.forwardRef(lge),sge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M433.1 657.7a31.8 31.8 0 0051.7 0l210.6-292c3.8-5.3 0-12.7-6.5-12.7H642c-10.2 0-19.9 4.9-25.9 13.3L459 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H315c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"check-square",theme:"outlined"},cge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:sge}))},mu=l.forwardRef(cge),uge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 512.3v-.3c0-229.8-186.2-416-416-416S96 282.2 96 512v.4c0 229.8 186.2 416 416 416s416-186.2 416-416v-.3.2zm-6.7-74.6l.6 3.3-.6-3.3zM676.7 638.2c53.5-82.2 52.5-189.4-11.1-263.7l162.4-8.4c20.5 44.4 32 93.8 32 145.9 0 185.2-144.6 336.6-327.1 347.4l143.8-221.2zM512 652.3c-77.5 0-140.2-62.7-140.2-140.2 0-77.7 62.7-140.2 140.2-140.2S652.2 434.5 652.2 512 589.5 652.3 512 652.3zm369.2-331.7l-3-5.7 3 5.7zM512 164c121.3 0 228.2 62.1 290.4 156.2l-263.6-13.9c-97.5-5.7-190.2 49.2-222.3 141.1L227.8 311c63.1-88.9 166.9-147 284.2-147zM102.5 585.8c26 145 127.1 264 261.6 315.1C229.6 850 128.5 731 102.5 585.8zM164 512c0-55.9 13.2-108.7 36.6-155.5l119.7 235.4c44.1 86.7 137.4 139.7 234 121.6l-74 145.1C302.9 842.5 164 693.5 164 512zm324.7 415.4c4 .2 8 .4 12 .5-4-.2-8-.3-12-.5z"}}]},name:"chrome",theme:"outlined"},dge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:uge}))},fge=l.forwardRef(dge),mge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},hge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:mge}))},M9=l.forwardRef(hge),pge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm176.5 585.7l-28.6 39a7.99 7.99 0 01-11.2 1.7L483.3 569.8a7.92 7.92 0 01-3.3-6.5V288c0-4.4 3.6-8 8-8h48.1c4.4 0 8 3.6 8 8v247.5l142.6 103.1c3.6 2.5 4.4 7.5 1.8 11.1z"}}]},name:"clock-circle",theme:"filled"},gge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:pge}))},vge=l.forwardRef(gge),yge={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-circle",theme:"outlined"},bge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:yge}))},QR=l.forwardRef(bge),xge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M624 706.3h-74.1V464c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v242.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.7a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9z"}},{tag:"path",attrs:{d:"M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z"}}]},name:"cloud-download",theme:"outlined"},Cge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:xge}))},Sge=l.forwardRef(Cge),wge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"},$ge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:wge}))},wa=l.forwardRef($ge),Ege={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M573 421c-23.1 0-41 17.9-41 40s17.9 40 41 40c21.1 0 39-17.9 39-40s-17.9-40-39-40zm-280 0c-23.1 0-41 17.9-41 40s17.9 40 41 40c21.1 0 39-17.9 39-40s-17.9-40-39-40z"}},{tag:"path",attrs:{d:"M894 345a343.92 343.92 0 00-189-130v.1c-17.1-19-36.4-36.5-58-52.1-163.7-119-393.5-82.7-513 81-96.3 133-92.2 311.9 6 439l.8 132.6c0 3.2.5 6.4 1.5 9.4a31.95 31.95 0 0040.1 20.9L309 806c33.5 11.9 68.1 18.7 102.5 20.6l-.5.4c89.1 64.9 205.9 84.4 313 49l127.1 41.4c3.2 1 6.5 1.6 9.9 1.6 17.7 0 32-14.3 32-32V753c88.1-119.6 90.4-284.9 1-408zM323 735l-12-5-99 31-1-104-8-9c-84.6-103.2-90.2-251.9-11-361 96.4-132.2 281.2-161.4 413-66 132.2 96.1 161.5 280.6 66 412-80.1 109.9-223.5 150.5-348 102zm505-17l-8 10 1 104-98-33-12 5c-56 20.8-115.7 22.5-171 7l-.2-.1A367.31 367.31 0 00729 676c76.4-105.3 88.8-237.6 44.4-350.4l.6.4c23 16.5 44.1 37.1 62 62 72.6 99.6 68.5 235.2-8 330z"}},{tag:"path",attrs:{d:"M433 421c-23.1 0-41 17.9-41 40s17.9 40 41 40c21.1 0 39-17.9 39-40s-17.9-40-39-40z"}}]},name:"comment",theme:"outlined"},jge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Ege}))},TC=l.forwardRef(jge),Nge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm198.4-588.1a32 32 0 00-24.5.5L414.9 415 296.4 686c-3.6 8.2-3.6 17.5 0 25.7 3.4 7.8 9.7 13.9 17.7 17 3.8 1.5 7.7 2.2 11.7 2.2 4.4 0 8.7-.9 12.8-2.7l271-118.6 118.5-271a32.06 32.06 0 00-17.7-42.7zM576.8 534.4l26.2 26.2-42.4 42.4-26.2-26.2L380 644.4 447.5 490 422 464.4l42.4-42.4 25.5 25.5L644.4 380l-67.6 154.4zM464.4 422L422 464.4l25.5 25.6 86.9 86.8 26.2 26.2 42.4-42.4-26.2-26.2-86.8-86.9z"}}]},name:"compass",theme:"outlined"},Oge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Nge}))},Rge=l.forwardRef(Oge),Ige={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M326 664H104c-8.8 0-16 7.2-16 16v48c0 8.8 7.2 16 16 16h174v176c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16V696c0-17.7-14.3-32-32-32zm16-576h-48c-8.8 0-16 7.2-16 16v176H104c-8.8 0-16 7.2-16 16v48c0 8.8 7.2 16 16 16h222c17.7 0 32-14.3 32-32V104c0-8.8-7.2-16-16-16zm578 576H698c-17.7 0-32 14.3-32 32v224c0 8.8 7.2 16 16 16h48c8.8 0 16-7.2 16-16V744h174c8.8 0 16-7.2 16-16v-48c0-8.8-7.2-16-16-16zm0-384H746V104c0-8.8-7.2-16-16-16h-48c-8.8 0-16 7.2-16 16v224c0 17.7 14.3 32 32 32h222c8.8 0 16-7.2 16-16v-48c0-8.8-7.2-16-16-16z"}}]},name:"compress",theme:"outlined"},kge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Ige}))},Gw=l.forwardRef(kge),Mge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 128c-212.1 0-384 171.9-384 384v360c0 13.3 10.7 24 24 24h184c35.3 0 64-28.7 64-64V624c0-35.3-28.7-64-64-64H200v-48c0-172.3 139.7-312 312-312s312 139.7 312 312v48H688c-35.3 0-64 28.7-64 64v208c0 35.3 28.7 64 64 64h184c13.3 0 24-10.7 24-24V512c0-212.1-171.9-384-384-384zM328 632v192H200V632h128zm496 192H696V632h128v192z"}}]},name:"customer-service",theme:"outlined"},Tge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Mge}))},Pge=l.forwardRef(Tge),Dge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"},zge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Dge}))},Age=l.forwardRef(zge),_ge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 140H96c-17.7 0-32 14.3-32 32v496c0 17.7 14.3 32 32 32h380v112H304c-8.8 0-16 7.2-16 16v48c0 4.4 3.6 8 8 8h432c4.4 0 8-3.6 8-8v-48c0-8.8-7.2-16-16-16H548V700h380c17.7 0 32-14.3 32-32V172c0-17.7-14.3-32-32-32zm-40 488H136V212h752v416z"}}]},name:"desktop",theme:"outlined"},Lge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:_ge}))},Bge=l.forwardRef(Lge),Hge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.3 506.3L781.7 405.6a7.23 7.23 0 00-11.7 5.7V476H548V254h64.8c6 0 9.4-7 5.7-11.7L517.7 114.7a7.14 7.14 0 00-11.3 0L405.6 242.3a7.23 7.23 0 005.7 11.7H476v222H254v-64.8c0-6-7-9.4-11.7-5.7L114.7 506.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h222v222h-64.8c-6 0-9.4 7-5.7 11.7l100.8 127.5c2.9 3.7 8.5 3.7 11.3 0l100.8-127.5c3.7-4.7.4-11.7-5.7-11.7H548V548h222v64.8c0 6 7 9.4 11.7 5.7l127.5-100.8a7.3 7.3 0 00.1-11.4z"}}]},name:"drag",theme:"outlined"},Fge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Hge}))},ZR=l.forwardRef(Fge),Vge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 289.1a362.49 362.49 0 00-79.9-115.7 370.83 370.83 0 00-118.2-77.8C610.7 76.6 562.1 67 512 67c-50.1 0-98.7 9.6-144.5 28.5-44.3 18.3-84 44.5-118.2 77.8A363.6 363.6 0 00169.4 289c-19.5 45-29.4 92.8-29.4 142 0 70.6 16.9 140.9 50.1 208.7 26.7 54.5 64 107.6 111 158.1 80.3 86.2 164.5 138.9 188.4 153a43.9 43.9 0 0022.4 6.1c7.8 0 15.5-2 22.4-6.1 23.9-14.1 108.1-66.8 188.4-153 47-50.4 84.3-103.6 111-158.1C867.1 572 884 501.8 884 431.1c0-49.2-9.9-97-29.4-142zM512 880.2c-65.9-41.9-300-207.8-300-449.1 0-77.9 31.1-151.1 87.6-206.3C356.3 169.5 431.7 139 512 139s155.7 30.5 212.4 85.9C780.9 280 812 353.2 812 431.1c0 241.3-234.1 407.2-300 449.1zm0-617.2c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 551c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 439c0-29.9 11.7-58 32.8-79.2C454 338.6 482.1 327 512 327c29.9 0 58 11.6 79.2 32.8C612.4 381 624 409.1 624 439c0 29.9-11.6 58-32.8 79.2z"}}]},name:"environment",theme:"outlined"},Uge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Vge}))},Wge=l.forwardRef(Uge),qge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},Kge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:qge}))},Ph=l.forwardRef(Kge),Gge={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"},Yge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Gge}))},zy=l.forwardRef(Yge),Xge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M945 412H689c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h256c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM811 548H689c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h122c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM477.3 322.5H434c-6.2 0-11.2 5-11.2 11.2v248c0 3.6 1.7 6.9 4.6 9l148.9 108.6c5 3.6 12 2.6 15.6-2.4l25.7-35.1v-.1c3.6-5 2.5-12-2.5-15.6l-126.7-91.6V333.7c.1-6.2-5-11.2-11.1-11.2z"}},{tag:"path",attrs:{d:"M804.8 673.9H747c-5.6 0-10.9 2.9-13.9 7.7a321 321 0 01-44.5 55.7 317.17 317.17 0 01-101.3 68.3c-39.3 16.6-81 25-124 25-43.1 0-84.8-8.4-124-25-37.9-16-72-39-101.3-68.3s-52.3-63.4-68.3-101.3c-16.6-39.2-25-80.9-25-124 0-43.1 8.4-84.7 25-124 16-37.9 39-72 68.3-101.3 29.3-29.3 63.4-52.3 101.3-68.3 39.2-16.6 81-25 124-25 43.1 0 84.8 8.4 124 25 37.9 16 72 39 101.3 68.3a321 321 0 0144.5 55.7c3 4.8 8.3 7.7 13.9 7.7h57.8c6.9 0 11.3-7.2 8.2-13.3-65.2-129.7-197.4-214-345-215.7-216.1-2.7-395.6 174.2-396 390.1C71.6 727.5 246.9 903 463.2 903c149.5 0 283.9-84.6 349.8-215.8a9.18 9.18 0 00-8.2-13.3z"}}]},name:"field-time",theme:"outlined"},Jge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Xge}))},Jm=l.forwardRef(Jge),Qge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M553.1 509.1l-77.8 99.2-41.1-52.4a8 8 0 00-12.6 0l-99.8 127.2a7.98 7.98 0 006.3 12.9H696c6.7 0 10.4-7.7 6.3-12.9l-136.5-174a8.1 8.1 0 00-12.7 0zM360 442a40 40 0 1080 0 40 40 0 10-80 0zm494.6-153.4L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file-image",theme:"outlined"},Zge=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Qge}))},Uv=l.forwardRef(Zge),eve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M688 312v-48c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8zm-392 88c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H296zm144 452H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h272c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm445.7 51.5l-93.3-93.3C814.7 780.7 828 743.9 828 704c0-97.2-78.8-176-176-176s-176 78.8-176 176 78.8 176 176 176c35.8 0 69-10.7 96.8-29l94.7 94.7c1.6 1.6 3.6 2.3 5.6 2.3s4.1-.8 5.6-2.3l31-31a7.9 7.9 0 000-11.2zM652 816c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"file-search",theme:"outlined"},tve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:eve}))},Ay=l.forwardRef(tve),nve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M296 392h64v64h-64zm0 190v160h128V582h-64v-62h-64v62zm80 48v64h-32v-64h32zm-16-302h64v64h-64zm-64-64h64v64h-64zm64 192h64v64h-64zm0-256h64v64h-64zm494.6 88.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h64v64h64v-64h174v216a42 42 0 0042 42h216v494z"}}]},name:"file-zip",theme:"outlined"},rve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:nve}))},eI=l.forwardRef(rve),ave={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"},ove=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:ave}))},ive=l.forwardRef(ove),lve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M484 443.1V528h-84.5c-4.1 0-7.5 3.1-7.5 7v42c0 3.8 3.4 7 7.5 7H484v84.9c0 3.9 3.2 7.1 7 7.1h42c3.9 0 7-3.2 7-7.1V584h84.5c4.1 0 7.5-3.2 7.5-7v-42c0-3.9-3.4-7-7.5-7H540v-84.9c0-3.9-3.1-7.1-7-7.1h-42c-3.8 0-7 3.2-7 7.1zm396-144.7H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder-add",theme:"outlined"},sve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:lve}))},cve=l.forwardRef(sve),uve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M840 192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3 0-24 10.7-24 24v272c0 13.3 10.7 24 24 24h592c13.3 0 24-10.7 24-24V256h32v200H465c-22.1 0-40 17.9-40 40v136h-44c-4.4 0-8 3.6-8 8v228c0 .6.1 1.3.2 1.9A83.99 83.99 0 00457 960c46.4 0 84-37.6 84-84 0-2.1-.1-4.1-.2-6.1.1-.6.2-1.2.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1 0 40-17.9 40-40V232c0-22.1-17.9-40-40-40zM720 352H208V160h512v192zM477 876c0 11-9 20-20 20s-20-9-20-20V696h40v180z"}}]},name:"format-painter",theme:"outlined"},dve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:uve}))},fve=l.forwardRef(dve),mve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 000 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 00391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 00-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"}}]},name:"fullscreen-exit",theme:"outlined"},hve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:mve}))},T9=l.forwardRef(hve),pve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M290 236.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0013.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 000 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 00-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"}}]},name:"fullscreen",theme:"outlined"},gve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:pve}))},P9=l.forwardRef(gve),vve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M312.1 591.5c3.1 3.1 8.2 3.1 11.3 0l101.8-101.8 86.1 86.2c3.1 3.1 8.2 3.1 11.3 0l226.3-226.5c3.1-3.1 3.1-8.2 0-11.3l-36.8-36.8a8.03 8.03 0 00-11.3 0L517 485.3l-86.1-86.2a8.03 8.03 0 00-11.3 0L275.3 543.4a8.03 8.03 0 000 11.3l36.8 36.8z"}},{tag:"path",attrs:{d:"M904 160H548V96c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H120c-17.7 0-32 14.3-32 32v520c0 17.7 14.3 32 32 32h356.4v32L311.6 884.1a7.92 7.92 0 00-2.3 11l30.3 47.2v.1c2.4 3.7 7.4 4.7 11.1 2.3L512 838.9l161.3 105.8c3.7 2.4 8.7 1.4 11.1-2.3v-.1l30.3-47.2a8 8 0 00-2.3-11L548 776.3V744h356c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 512H160V232h704v440z"}}]},name:"fund-projection-screen",theme:"outlined"},yve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:vve}))},bve=l.forwardRef(yve),xve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0138.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"}}]},name:"github",theme:"outlined"},Cve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:xve}))},Sve=l.forwardRef(Cve),wve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M913.9 552.2L805 181.4v-.1c-7.6-22.9-25.7-36.5-48.3-36.5-23.4 0-42.5 13.5-49.7 35.2l-71.4 213H388.8l-71.4-213c-7.2-21.7-26.3-35.2-49.7-35.2-23.1 0-42.5 14.8-48.4 36.6L110.5 552.2c-4.4 14.7 1.2 31.4 13.5 40.7l368.5 276.4c2.6 3.6 6.2 6.3 10.4 7.8l8.6 6.4 8.5-6.4c4.9-1.7 9-4.7 11.9-8.9l368.4-275.4c12.4-9.2 18-25.9 13.6-40.6zM751.7 193.4c1-1.8 2.9-1.9 3.5-1.9 1.1 0 2.5.3 3.4 3L818 394.3H684.5l67.2-200.9zm-487.4 1c.9-2.6 2.3-2.9 3.4-2.9 2.7 0 2.9.1 3.4 1.7l67.3 201.2H206.5l57.8-200zM158.8 558.7l28.2-97.3 202.4 270.2-230.6-172.9zm73.9-116.4h122.1l90.8 284.3-212.9-284.3zM512.9 776L405.7 442.3H620L512.9 776zm157.9-333.7h119.5L580 723.1l90.8-280.8zm-40.7 293.9l207.3-276.7 29.5 99.2-236.8 177.5z"}}]},name:"gitlab",theme:"outlined"},$ve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:wve}))},C0=l.forwardRef($ve),Eve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"},jve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Eve}))},kf=l.forwardRef(jve),Nve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM496 208H312c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 544h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H312c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm328 244a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"hdd",theme:"outlined"},Ove=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Nve}))},Rve=l.forwardRef(Ove),Ive={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M536.1 273H488c-4.4 0-8 3.6-8 8v275.3c0 2.6 1.2 5 3.3 6.5l165.3 120.7c3.6 2.6 8.6 1.9 11.2-1.7l28.6-39c2.7-3.7 1.9-8.7-1.7-11.2L544.1 528.5V281c0-4.4-3.6-8-8-8zm219.8 75.2l156.8 38.3c5 1.2 9.9-2.6 9.9-7.7l.8-161.5c0-6.7-7.7-10.5-12.9-6.3L752.9 334.1a8 8 0 003 14.1zm167.7 301.1l-56.7-19.5a8 8 0 00-10.1 4.8c-1.9 5.1-3.9 10.1-6 15.1-17.8 42.1-43.3 80-75.9 112.5a353 353 0 01-112.5 75.9 352.18 352.18 0 01-137.7 27.8c-47.8 0-94.1-9.3-137.7-27.8a353 353 0 01-112.5-75.9c-32.5-32.5-58-70.4-75.9-112.5A353.44 353.44 0 01171 512c0-47.8 9.3-94.2 27.8-137.8 17.8-42.1 43.3-80 75.9-112.5a353 353 0 01112.5-75.9C430.6 167.3 477 158 524.8 158s94.1 9.3 137.7 27.8A353 353 0 01775 261.7c10.2 10.3 19.8 21 28.6 32.3l59.8-46.8C784.7 146.6 662.2 81.9 524.6 82 285 82.1 92.6 276.7 95 516.4 97.4 751.9 288.9 942 524.8 942c185.5 0 343.5-117.6 403.7-282.3 1.5-4.2-.7-8.9-4.9-10.4z"}}]},name:"history",theme:"outlined"},kve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Ive}))},D9=l.forwardRef(kve),Mve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M946.5 505L560.1 118.8l-25.9-25.9a31.5 31.5 0 00-44.4 0L77.5 505a63.9 63.9 0 00-18.8 46c.4 35.2 29.7 63.3 64.9 63.3h42.5V940h691.8V614.3h43.4c17.1 0 33.2-6.7 45.3-18.8a63.6 63.6 0 0018.7-45.3c0-17-6.7-33.1-18.8-45.2zM568 868H456V664h112v204zm217.9-325.7V868H632V640c0-22.1-17.9-40-40-40H432c-22.1 0-40 17.9-40 40v228H238.1V542.3h-96l370-369.7 23.1 23.1L882 542.3h-96.1z"}}]},name:"home",theme:"outlined"},Tve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Mve}))},Dh=l.forwardRef(Tve),Pve={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"},Dve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Pve}))},X$=l.forwardRef(Dve),zve={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M885.2 446.3l-.2-.8-112.2-285.1c-5-16.1-19.9-27.2-36.8-27.2H281.2c-17 0-32.1 11.3-36.9 27.6L139.4 443l-.3.7-.2.8c-1.3 4.9-1.7 9.9-1 14.8-.1 1.6-.2 3.2-.2 4.8V830a60.9 60.9 0 0060.8 60.8h627.2c33.5 0 60.8-27.3 60.9-60.8V464.1c0-1.3 0-2.6-.1-3.7.4-4.9 0-9.6-1.3-14.1zm-295.8-43l-.3 15.7c-.8 44.9-31.8 75.1-77.1 75.1-22.1 0-41.1-7.1-54.8-20.6S436 441.2 435.6 419l-.3-15.7H229.5L309 210h399.2l81.7 193.3H589.4zm-375 76.8h157.3c24.3 57.1 76 90.8 140.4 90.8 33.7 0 65-9.4 90.3-27.2 22.2-15.6 39.5-37.4 50.7-63.6h156.5V814H214.4V480.1z"}}]},name:"inbox",theme:"outlined"},Ave=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:zve}))},zh=l.forwardRef(Ave),_ve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"},Lve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:_ve}))},_y=l.forwardRef(Lve),Bve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5L255.8 713.6l-62.3-62.3a8.19 8.19 0 00-11.4 0l-39.8 39.8a8.19 8.19 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.19 8.19 0 00-11.4 0l-39.8 39.8a8.19 8.19 0 000 11.4l110.3 111.2c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.1 304.1 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112m161.2 465.2C726.2 620.3 668.9 644 608 644s-118.2-23.7-161.2-66.8C403.7 534.2 380 476.9 380 416s23.7-118.2 66.8-161.2c43-43.1 100.3-66.8 161.2-66.8s118.2 23.7 161.2 66.8c43.1 43 66.8 100.3 66.8 161.2s-23.7 118.2-66.8 161.2"}}]},name:"key",theme:"outlined"},Hve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Bve}))},Fve=l.forwardRef(Hve),Vve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"},Uve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Vve}))},ul=l.forwardRef(Uve),Wve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"}}]},name:"mail",theme:"outlined"},qve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Wve}))},Kve=l.forwardRef(qve),Gve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 000 13.8z"}}]},name:"menu-fold",theme:"outlined"},Yve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Gve}))},Xve=l.forwardRef(Yve),Jve={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 000-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0014.4 7z"}}]},name:"menu-unfold",theme:"outlined"},Qve=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Jve}))},Zve=l.forwardRef(Qve),e0e={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M489.5 111.66c30.65-1.8 45.98 36.44 22.58 56.33A243.35 243.35 0 00426 354c0 134.76 109.24 244 244 244 72.58 0 139.9-31.83 186.01-86.08 19.87-23.38 58.07-8.1 56.34 22.53C900.4 745.82 725.15 912 512.5 912 291.31 912 112 732.69 112 511.5c0-211.39 164.29-386.02 374.2-399.65l.2-.01zm-81.15 79.75l-4.11 1.36C271.1 237.94 176 364.09 176 511.5 176 697.34 326.66 848 512.5 848c148.28 0 274.94-96.2 319.45-230.41l.63-1.93-.11.07a307.06 307.06 0 01-159.73 46.26L670 662c-170.1 0-308-137.9-308-308 0-58.6 16.48-114.54 46.27-162.47z"}}]},name:"moon",theme:"outlined"},t0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:e0e}))},n0e=l.forwardRef(t0e),r0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"},a0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:r0e}))},Wv=l.forwardRef(a0e),o0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M843.5 737.4c-12.4-75.2-79.2-129.1-155.3-125.4S550.9 676 546 752c-153.5-4.8-208-40.7-199.1-113.7 3.3-27.3 19.8-41.9 50.1-49 18.4-4.3 38.8-4.9 57.3-3.2 1.7.2 3.5.3 5.2.5 11.3 2.7 22.8 5 34.3 6.8 34.1 5.6 68.8 8.4 101.8 6.6 92.8-5 156-45.9 159.2-132.7 3.1-84.1-54.7-143.7-147.9-183.6-29.9-12.8-61.6-22.7-93.3-30.2-14.3-3.4-26.3-5.7-35.2-7.2-7.9-75.9-71.5-133.8-147.8-134.4-76.3-.6-140.9 56.1-150.1 131.9s40 146.3 114.2 163.9c74.2 17.6 149.9-23.3 175.7-95.1 9.4 1.7 18.7 3.6 28 5.8 28.2 6.6 56.4 15.4 82.4 26.6 70.7 30.2 109.3 70.1 107.5 119.9-1.6 44.6-33.6 65.2-96.2 68.6-27.5 1.5-57.6-.9-87.3-5.8-8.3-1.4-15.9-2.8-22.6-4.3-3.9-.8-6.6-1.5-7.8-1.8l-3.1-.6c-2.2-.3-5.9-.8-10.7-1.3-25-2.3-52.1-1.5-78.5 4.6-55.2 12.9-93.9 47.2-101.1 105.8-15.7 126.2 78.6 184.7 276 188.9 29.1 70.4 106.4 107.9 179.6 87 73.3-20.9 119.3-93.4 106.9-168.6zM329.1 345.2a83.3 83.3 0 11.01-166.61 83.3 83.3 0 01-.01 166.61zM695.6 845a83.3 83.3 0 11.01-166.61A83.3 83.3 0 01695.6 845z"}}]},name:"node-index",theme:"outlined"},i0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:o0e}))},tI=l.forwardRef(i0e),l0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm-88-532h-48c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8zm224 0h-48c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8z"}}]},name:"pause-circle",theme:"outlined"},s0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:l0e}))},c0e=l.forwardRef(s0e),u0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}}]},name:"picture",theme:"outlined"},d0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:u0e}))},nI=l.forwardRef(d0e),f0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm144.1 454.9L437.7 677.8a8.02 8.02 0 01-12.7-6.5V353.7a8 8 0 0112.7-6.5L656.1 506a7.9 7.9 0 010 12.9z"}}]},name:"play-circle",theme:"filled"},m0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:f0e}))},h0e=l.forwardRef(m0e),p0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M719.4 499.1l-296.1-215A15.9 15.9 0 00398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 000-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z"}}]},name:"play-circle",theme:"outlined"},g0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:p0e}))},Kl=l.forwardRef(g0e),v0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M280 752h80c4.4 0 8-3.6 8-8V280c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8zm192-280h80c4.4 0 8-3.6 8-8V280c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8v184c0 4.4 3.6 8 8 8zm192 72h80c4.4 0 8-3.6 8-8V280c0-4.4-3.6-8-8-8h-80c-4.4 0-8 3.6-8 8v256c0 4.4 3.6 8 8 8zm216-432H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"project",theme:"outlined"},y0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:v0e}))},Ah=l.forwardRef(y0e),b0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 161H699.2c-49.1 0-97.1 14.1-138.4 40.7L512 233l-48.8-31.3A255.2 255.2 0 00324.8 161H96c-17.7 0-32 14.3-32 32v568c0 17.7 14.3 32 32 32h228.8c49.1 0 97.1 14.1 138.4 40.7l44.4 28.6c1.3.8 2.8 1.3 4.3 1.3s3-.4 4.3-1.3l44.4-28.6C602 807.1 650.1 793 699.2 793H928c17.7 0 32-14.3 32-32V193c0-17.7-14.3-32-32-32zM324.8 721H136V233h188.8c35.4 0 69.8 10.1 99.5 29.2l48.8 31.3 6.9 4.5v462c-47.6-25.6-100.8-39-155.2-39zm563.2 0H699.2c-54.4 0-107.6 13.4-155.2 39V298l6.9-4.5 48.8-31.3c29.7-19.1 64.1-29.2 99.5-29.2H888v488zM396.9 361H211.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5zm223.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c0-4.1-3.2-7.5-7.1-7.5H627.1c-3.9 0-7.1 3.4-7.1 7.5zM396.9 501H211.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5zm416 0H627.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5z"}}]},name:"read",theme:"outlined"},x0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:b0e}))},C0e=l.forwardRef(x0e),S0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"}}]},name:"redo",theme:"outlined"},w0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:S0e}))},$0e=l.forwardRef(w0e),E0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},j0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:E0e}))},N0e=l.forwardRef(j0e),O0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 736c0-111.6-65.4-208-160-252.9V317.3c0-15.1-5.3-29.7-15.1-41.2L536.5 95.4C530.1 87.8 521 84 512 84s-18.1 3.8-24.5 11.4L335.1 276.1a63.97 63.97 0 00-15.1 41.2v165.8C225.4 528 160 624.4 160 736h156.5c-2.3 7.2-3.5 15-3.5 23.8 0 22.1 7.6 43.7 21.4 60.8a97.2 97.2 0 0043.1 30.6c23.1 54 75.6 88.8 134.5 88.8 29.1 0 57.3-8.6 81.4-24.8 23.6-15.8 41.9-37.9 53-64a97 97 0 0043.1-30.5 97.52 97.52 0 0021.4-60.8c0-8.4-1.1-16.4-3.1-23.8H864zM762.3 621.4c9.4 14.6 17 30.3 22.5 46.6H700V558.7a211.6 211.6 0 0162.3 62.7zM388 483.1V318.8l124-147 124 147V668H388V483.1zM239.2 668c5.5-16.3 13.1-32 22.5-46.6 16.3-25.2 37.5-46.5 62.3-62.7V668h-84.8zm388.9 116.2c-5.2 3-11.2 4.2-17.1 3.4l-19.5-2.4-2.8 19.4c-5.4 37.9-38.4 66.5-76.7 66.5-38.3 0-71.3-28.6-76.7-66.5l-2.8-19.5-19.5 2.5a27.7 27.7 0 01-17.1-3.5c-8.7-5-14.1-14.3-14.1-24.4 0-10.6 5.9-19.4 14.6-23.8h231.3c8.8 4.5 14.6 13.3 14.6 23.8-.1 10.2-5.5 19.6-14.2 24.5zM464 400a48 48 0 1096 0 48 48 0 10-96 0z"}}]},name:"rocket",theme:"outlined"},R0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:O0e}))},qo=l.forwardRef(R0e),I0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M866.9 169.9L527.1 54.1C523 52.7 517.5 52 512 52s-11 .7-15.1 2.1L157.1 169.9c-8.3 2.8-15.1 12.4-15.1 21.2v482.4c0 8.8 5.7 20.4 12.6 25.9L499.3 968c3.5 2.7 8 4.1 12.6 4.1s9.2-1.4 12.6-4.1l344.7-268.6c6.9-5.4 12.6-17 12.6-25.9V191.1c.2-8.8-6.6-18.3-14.9-21.2zM810 654.3L512 886.5 214 654.3V226.7l298-101.6 298 101.6v427.6zm-405.8-201c-3-4.1-7.8-6.6-13-6.6H336c-6.5 0-10.3 7.4-6.5 12.7l126.4 174a16.1 16.1 0 0026 0l212.6-292.7c3.8-5.3 0-12.7-6.5-12.7h-55.2c-5.1 0-10 2.5-13 6.6L468.9 542.4l-64.7-89.1z"}}]},name:"safety-certificate",theme:"outlined"},k0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:I0e}))},J$=l.forwardRef(k0e),M0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"},T0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:M0e}))},Q$=l.forwardRef(T0e),P0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M136 384h56c4.4 0 8-3.6 8-8V200h176c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H196c-37.6 0-68 30.4-68 68v180c0 4.4 3.6 8 8 8zm512-184h176v176c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V196c0-37.6-30.4-68-68-68H648c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM376 824H200V648c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v180c0 37.6 30.4 68 68 68h180c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm512-184h-56c-4.4 0-8 3.6-8 8v176H648c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h180c37.6 0 68-30.4 68-68V648c0-4.4-3.6-8-8-8zm16-164H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"scan",theme:"outlined"},D0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:P0e}))},rI=l.forwardRef(D0e),z0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}}]},name:"send",theme:"outlined"},A0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:z0e}))},hu=l.forwardRef(A0e),_0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},L0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:_0e}))},Gl=l.forwardRef(L0e),B0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"},H0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:B0e}))},F0e=l.forwardRef(H0e),V0e={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M548 818v126a16 16 0 01-16 16h-40a16 16 0 01-16-16V818c15.85 1.64 27.84 2.46 36 2.46 8.15 0 20.16-.82 36-2.46m205.25-115.66l89.1 89.1a16 16 0 010 22.62l-28.29 28.29a16 16 0 01-22.62 0l-89.1-89.1c12.37-10.04 21.43-17.95 27.2-23.71 5.76-5.77 13.67-14.84 23.71-27.2m-482.5 0c10.04 12.36 17.95 21.43 23.71 27.2 5.77 5.76 14.84 13.67 27.2 23.71l-89.1 89.1a16 16 0 01-22.62 0l-28.29-28.29a16 16 0 010-22.63zM512 278c129.24 0 234 104.77 234 234S641.24 746 512 746 278 641.24 278 512s104.77-234 234-234m0 72c-89.47 0-162 72.53-162 162s72.53 162 162 162 162-72.53 162-162-72.53-162-162-162M206 476c-1.64 15.85-2.46 27.84-2.46 36 0 8.15.82 20.16 2.46 36H80a16 16 0 01-16-16v-40a16 16 0 0116-16zm738 0a16 16 0 0116 16v40a16 16 0 01-16 16H818c1.64-15.85 2.46-27.84 2.46-36 0-8.15-.82-20.16-2.46-36zM814.06 180.65l28.29 28.29a16 16 0 010 22.63l-89.1 89.09c-10.04-12.37-17.95-21.43-23.71-27.2-5.77-5.76-14.84-13.67-27.2-23.71l89.1-89.1a16 16 0 0122.62 0m-581.5 0l89.1 89.1c-12.37 10.04-21.43 17.95-27.2 23.71-5.76 5.77-13.67 14.84-23.71 27.2l-89.1-89.1a16 16 0 010-22.62l28.29-28.29a16 16 0 0122.62 0M532 64a16 16 0 0116 16v126c-15.85-1.64-27.84-2.46-36-2.46-8.15 0-20.16.82-36 2.46V80a16 16 0 0116-16z"}}]},name:"sun",theme:"outlined"},U0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:V0e}))},aI=l.forwardRef(U0e),W0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M168 504.2c1-43.7 10-86.1 26.9-126 17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 01755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92 282.7 92 96.3 275.6 92 503.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8zm756 7.8h-60c-4.4 0-7.9 3.5-8 7.8-1 43.7-10 86.1-26.9 126-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 01512.1 856a342.24 342.24 0 01-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 00-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 00-8-8.2z"}}]},name:"sync",theme:"outlined"},q0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:W0e}))},_h=l.forwardRef(q0e),K0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M848 359.3H627.7L825.8 109c4.1-5.3.4-13-6.3-13H436c-2.8 0-5.5 1.5-6.9 4L170 547.5c-3.1 5.3.7 12 6.9 12h174.4l-89.4 357.6c-1.9 7.8 7.5 13.3 13.3 7.7L853.5 373c5.2-4.9 1.7-13.7-5.5-13.7zM378.2 732.5l60.3-241H281.1l189.6-327.4h224.6L487 427.4h211L378.2 732.5z"}}]},name:"thunderbolt",theme:"outlined"},G0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:K0e}))},Z$=l.forwardRef(G0e),Y0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M876.6 239.5c-.5-.9-1.2-1.8-2-2.5-5-5-13.1-5-18.1 0L684.2 409.3l-67.9-67.9L788.7 169c.8-.8 1.4-1.6 2-2.5 3.6-6.1 1.6-13.9-4.5-17.5-98.2-58-226.8-44.7-311.3 39.7-67 67-89.2 162-66.5 247.4l-293 293c-3 3-2.8 7.9.3 11l169.7 169.7c3.1 3.1 8.1 3.3 11 .3l292.9-292.9c85.5 22.8 180.5.7 247.6-66.4 84.4-84.5 97.7-213.1 39.7-311.3zM786 499.8c-58.1 58.1-145.3 69.3-214.6 33.6l-8.8 8.8-.1-.1-274 274.1-79.2-79.2 230.1-230.1s0 .1.1.1l52.8-52.8c-35.7-69.3-24.5-156.5 33.6-214.6a184.2 184.2 0 01144-53.5L537 318.9a32.05 32.05 0 000 45.3l124.5 124.5a32.05 32.05 0 0045.3 0l132.8-132.8c3.7 51.8-14.4 104.8-53.6 143.9z"}}]},name:"tool",theme:"outlined"},X0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Y0e}))},e4=l.forwardRef(X0e),J0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M511.4 124C290.5 124.3 112 303 112 523.9c0 128 60.2 242 153.8 315.2l-37.5 48c-4.1 5.3-.3 13 6.3 12.9l167-.8c5.2 0 9-4.9 7.7-9.9L369.8 727a8 8 0 00-14.1-3L315 776.1c-10.2-8-20-16.7-29.3-26a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-7.5 7.5-15.3 14.5-23.4 21.2a7.93 7.93 0 00-1.2 11.1l39.4 50.5c2.8 3.5 7.9 4.1 11.4 1.3C854.5 760.8 912 649.1 912 523.9c0-221.1-179.4-400.2-400.6-399.9z"}}]},name:"undo",theme:"outlined"},Q0e=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:J0e}))},z9=l.forwardRef(Q0e),Z0e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},eye=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:Z0e}))},S0=l.forwardRef(eye),tye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 302.3L784 376V224c0-35.3-28.7-64-64-64H128c-35.3 0-64 28.7-64 64v576c0 35.3 28.7 64 64 64h592c35.3 0 64-28.7 64-64V648l128 73.7c21.3 12.3 48-3.1 48-27.6V330c0-24.6-26.7-40-48-27.7zM712 792H136V232h576v560zm176-167l-104-59.8V458.9L888 399v226zM208 360h112c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H208c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}}]},name:"video-camera",theme:"outlined"},nye=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:tye}))},rye=l.forwardRef(nye),aye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}}]},name:"warning",theme:"outlined"},oye=function(t,n){return l.createElement(ht,Te({},t,{ref:n,icon:aye}))},A9=l.forwardRef(oye);const iye="0.2.15",jd={version:iye};async function ot(e,t){const n=await fetch(e,t);if(!n.ok)throw new Error((await n.json().catch(()=>({}))).error||"Something went wrong. Please try again.");return n.status===204?null:n.json()}const Br={list:()=>ot("/api/launchers"),running:()=>ot("/api/launchers/running"),create:e=>ot("/api/launchers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/launchers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/launchers/${e}`,{method:"DELETE"}),start:e=>ot(`/api/launchers/${e}/start`,{method:"POST"}),openTerminal:e=>ot(`/api/launchers/${e}/open-terminal`,{method:"POST"}),run:(e,t)=>ot(`/api/launchers/${e}/scripts/${t}/run`,{method:"POST"}),runInstall:e=>ot(`/api/launchers/${e}/install/run`,{method:"POST"}),stop:async(e,t)=>{try{return await ot(`/api/launchers/${e}/stop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scriptId:t})})}catch{return ot(`/api/launchers/${e}/scripts/${encodeURIComponent(t)}/stop`,{method:"POST"})}},logs:(e,t)=>ot(`/api/launchers/${e}/scripts/${t}/logs`),errorLogs:(e,t)=>ot(`/api/launchers/${e}/scripts/${t}/logs/error`),clearLogs:(e,t)=>ot(`/api/launchers/${e}/scripts/${encodeURIComponent(t)}/logs`,{method:"DELETE"}),packageScripts:e=>ot(`/api/launchers/${e}/package-scripts`),runPackageScript:(e,t)=>ot(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/run`,{method:"POST"}),packageScriptLogs:(e,t)=>ot(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/logs`),packageScriptErrorLogs:(e,t)=>ot(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/logs/error`),clearPackageScriptLogs:(e,t)=>ot(`/api/launchers/${e}/package-scripts/${encodeURIComponent(t)}/logs`,{method:"DELETE"})},Yw={get:()=>ot("/api/overview"),version:()=>ot("/api/overview/version"),notifications:()=>ot("/api/overview/notifications")},lye={list:()=>ot("/api/plugins")},rl={list:e=>ot(`/api/clipboard${e?`?date=${encodeURIComponent(e)}`:""}`),search:e=>ot(`/api/clipboard/search?q=${encodeURIComponent(e)}`),tagged:()=>ot("/api/clipboard/tagged"),remove:(e,t)=>ot(`/api/clipboard/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:"DELETE"}),uploadImage:e=>ot("/api/clipboard/image",{method:"POST",headers:{"Content-Type":e.type||"image/png"},body:e}),updateTags:(e,t,n)=>ot(`/api/clipboard/${encodeURIComponent(e)}/${encodeURIComponent(t)}/tags`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:n})}),copied:(e,t)=>ot(`/api/clipboard/${encodeURIComponent(e)}/${encodeURIComponent(t)}/copied`,{method:"POST"}),copyImage:(e,t)=>ot(`/api/clipboard/${encodeURIComponent(e)}/${encodeURIComponent(t)}/copy-image`,{method:"POST"})},Ei={list:()=>ot("/api/group-tasks"),catalog:()=>ot("/api/group-tasks/catalog"),create:e=>ot("/api/group-tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/group-tasks/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),reorder:e=>ot("/api/group-tasks/reorder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e})}),move:(e,t)=>ot(`/api/group-tasks/${e}/move`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({direction:t})}),remove:e=>ot(`/api/group-tasks/${e}`,{method:"DELETE"}),start:e=>ot(`/api/group-tasks/${e}/start`,{method:"POST"}),stop:e=>ot(`/api/group-tasks/${e}/stop`,{method:"POST"})},PC={list:()=>ot("/api/port-diagnostics"),get:e=>ot(`/api/port-diagnostics/${encodeURIComponent(e)}`),kill:(e,t)=>ot("/api/port-diagnostics/kill",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({port:e,pid:t})})},_9={open:e=>ot("/api/settings/open-url",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})}),openPath:(e,t="")=>ot("/api/settings/open-editor",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,location:t})}),openFolder:e=>ot("/api/settings/open-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})})},Wn={status:()=>ot("/api/settings"),devConfigurations:()=>ot("/api/settings/dev-configurations"),selectDirectory:()=>ot("/api/settings/select-directory",{method:"POST"}),selectFile:()=>ot("/api/settings/select-file",{method:"POST"}),openDataDir:()=>ot("/api/settings/open-data-dir",{method:"POST"}),openFolder:e=>ot("/api/settings/open-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),revealFolder:e=>ot("/api/settings/reveal-folder",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),saveDomain:e=>ot("/api/settings/domain",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({domain:e})}),saveAiApiHost:e=>ot("/api/settings/ai-api-host",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({aiApiHost:e})}),saveJiraIssuePrefix:e=>ot("/api/settings/jira-issue-prefix",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({jiraIssuePrefix:e})}),saveMindMapNodeMaxWidth:e=>ot("/api/settings/mind-map-node-max-width",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({width:e})}),saveDefaultEditor:e=>ot("/api/settings/default-editor",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultEditor:e})}),saveDefaultBrowser:e=>ot("/api/settings/default-browser",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultBrowser:e})}),saveTheme:e=>ot("/api/settings/theme",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({theme:e})}),saveDevConfigurations:e=>ot("/api/settings/dev-configurations",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),saveAccessToken:(e,t)=>ot(`/api/settings/${encodeURIComponent(e)}-access-token`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t})}),saveClipboardEnabled:e=>ot("/api/settings/clipboard-enabled",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e})}),saveClipboardImageEnabled:e=>ot("/api/settings/clipboard-image-enabled",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e})}),saveClipboardDeduplicateMinutes:e=>ot("/api/settings/clipboard-deduplicate-minutes",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({minutes:e})})},oI={status:(e=!1)=>ot(`/api/updates${e?"?refresh=1":""}`),selfUpdate:(e="latest")=>ot("/api/updates/self-update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({version:e})})},sye={install:e=>ot("/api/settings/dev-configurations/nvm/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({version:e})})},qc={manage:(e,t)=>ot(`/api/settings/dev-configurations/npm/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({packageName:t})}),versions:e=>ot("/api/settings/dev-configurations/npm/versions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({packageName:e})}),useSuggestedPrefix:()=>ot("/api/settings/dev-configurations/npm/use-prefix-suggestion",{method:"POST"})};qc.search=e=>ot("/api/settings/dev-configurations/npm/search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e})});const DC={stats:()=>ot("/api/data-backup/stats"),export:async()=>{var r;const e=await fetch("/api/data-backup/export");if(!e.ok)throw new Error((await e.json().catch(()=>({}))).error||"Unable to export data backup.");const n=((r=(e.headers.get("Content-Disposition")||"").match(/filename="([^"]+)"/))==null?void 0:r[1])||"devbuddy-data-backup.tar.gz";return{blob:await e.blob(),filename:n}},import:e=>ot("/api/data-backup/import",{method:"POST",headers:{"Content-Type":"application/gzip"},body:e})},sh={get:()=>ot("/api/presentations"),save:e=>ot("/api/presentations",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({plans:e})}),setActive:e=>ot("/api/presentations/active",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({plan:e})})},Tc={check:e=>ot("/api/pr-review/check",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prLink:e})}),aiReview:e=>ot(`/api/pr-review/ai-review/${encodeURIComponent(e)}`),rules:()=>ot("/api/pr-review/rules"),saveRules:(e,t,n)=>ot("/api/pr-review/rules",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({rules:e,customRules:t,fileFilters:n})}),myPrs:()=>ot("/api/pr-review/my-prs"),reviewPrs:()=>ot("/api/pr-review/review-prs"),comment:e=>ot("/api/pr-review/comment",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},uv={load:e=>ot("/api/pr-conflicts/load",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prUrl:e})}),myConflicts:()=>ot("/api/pr-conflicts/my-conflicts"),resolve:e=>ot("/api/pr-conflicts/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),checkBranch:e=>ot("/api/pr-conflicts/check-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},Va={list:()=>ot("/api/jira-filters"),create:e=>ot("/api/jira-filters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/jira-filters/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/jira-filters/${e}`,{method:"DELETE"}),issues:e=>ot(`/api/jira-filters/${e}/issues`),cloneIssue:e=>ot("/api/jira-filters/issues/clone",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),templates:{list:()=>ot("/api/jira-filters/templates"),create:e=>ot("/api/jira-filters/templates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/jira-filters/templates/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/jira-filters/templates/${e}`,{method:"DELETE"})},recentlyCreated:()=>ot("/api/jira-filters/recently-created"),recentlyCommented:()=>ot("/api/jira-filters/recently-commented"),recentlyMentioned:()=>ot("/api/jira-filters/recently-mentioned"),recentlyUpdated:()=>ot("/api/jira-filters/recently-updated")},Wa={list:()=>ot("/api/todos"),create:e=>ot("/api/todos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/todos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/todos/${e}`,{method:"DELETE"}),archive:e=>ot(`/api/todos/${e}/archive`,{method:"POST"}),unarchive:e=>ot(`/api/todos/${e}/unarchive`,{method:"POST"}),batch:(e,t)=>ot("/api/todos/batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e,ids:t})})},Td={list:()=>ot("/api/reminders"),create:e=>ot("/api/reminders",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/reminders/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),toggle:(e,t)=>ot(`/api/reminders/${e}/toggle`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:t})}),remove:e=>ot(`/api/reminders/${e}`,{method:"DELETE"}),claimDue:()=>ot("/api/reminders/claim-due",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({now:new Date().toISOString()})})},Pc={list:()=>ot("/api/cron-jobs"),catalog:()=>ot("/api/cron-jobs/catalog"),create:e=>ot("/api/cron-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/cron-jobs/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),toggle:(e,t)=>ot(`/api/cron-jobs/${e}/toggle`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:t})}),run:e=>ot(`/api/cron-jobs/${e}/run`,{method:"POST"}),remove:e=>ot(`/api/cron-jobs/${e}`,{method:"DELETE"})},Al={list:()=>ot("/api/memos"),listImages:()=>ot("/api/memos/images"),uploadImage:e=>ot("/api/memos/images",{method:"POST",headers:{"Content-Type":e.type||"image/png"},body:e}),create:e=>ot("/api/memos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/memos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/memos/${e}`,{method:"DELETE"}),removeImage:e=>ot(`/api/memos/images/${encodeURIComponent(e)}`,{method:"DELETE"})},sl={list:()=>ot("/api/mind-maps"),get:e=>ot(`/api/mind-maps/${encodeURIComponent(e)}`),resolveJiraIssue:e=>ot("/api/mind-maps/jira-issues/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:e})}),create:e=>ot("/api/mind-maps",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/mind-maps/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/mind-maps/${encodeURIComponent(e)}`,{method:"DELETE"})},Kc={list:()=>ot("/api/static-pages"),create:e=>ot("/api/static-pages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),update:(e,t)=>ot(`/api/static-pages/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),remove:e=>ot(`/api/static-pages/${e}`,{method:"DELETE"})},Zc={list:()=>ot("/api/errors"),log:e=>ot("/api/errors",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),clear:()=>ot("/api/errors",{method:"DELETE"}),remove:e=>ot(`/api/errors/${e}`,{method:"DELETE"})},Os={getData:()=>ot("/api/postman"),importCollection:e=>ot("/api/postman/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collectionJson:e})}),createCollection:e=>ot("/api/postman/collections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),updateCollection:(e,t)=>ot(`/api/postman/collections/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),deleteCollection:e=>ot(`/api/postman/collections/${e}`,{method:"DELETE"}),saveEnvironments:e=>ot("/api/postman/environments",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),sendRequest:e=>ot("/api/postman/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},zC={status:()=>ot("/api/bookmark-sync/status"),preview:e=>ot(`/api/bookmark-sync/preview?mode=${encodeURIComponent(e)}`),sync:e=>ot("/api/bookmark-sync/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e})})},Qm={scan:e=>ot("/api/file-organizer/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),execute:e=>ot("/api/file-organizer/execute",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),getHistory:()=>ot("/api/file-organizer/history"),undo:e=>ot("/api/file-organizer/undo",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e})}),browse:e=>ot("/api/file-organizer/browse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})})},Ml={listApps:()=>ot("/api/branch-sync/apps"),createApp:e=>ot("/api/branch-sync/apps",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),updateApp:(e,t)=>ot(`/api/branch-sync/apps/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),deleteApp:e=>ot(`/api/branch-sync/apps/${e}`,{method:"DELETE"}),check:e=>ot("/api/branch-sync/check",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app:e})}),createPr:e=>ot("/api/branch-sync/create-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),createBranch:e=>ot("/api/branch-sync/create-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),getBranches:e=>ot(`/api/branch-sync/branches?repo=${encodeURIComponent(e)}`)},Mm={repositories:e=>ot(`/api/branch-health/repositories?workspaceDir=${encodeURIComponent(e)}`),history:()=>ot("/api/branch-health/history"),scan:e=>ot("/api/branch-health/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder:e})}),preflight:(e,t)=>ot("/api/branch-health/preflight",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder:e,branch:t})}),remove:(e,t,n)=>ot("/api/branch-health/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder:e,branch:t,...n})})},So={config:()=>ot("/api/package-upgrade/config"),dependencyScan:()=>ot("/api/package-upgrade/dependency-scan"),dependencyRepositories:()=>ot("/api/package-upgrade/dependency-repositories"),saveDependencyRepositories:e=>ot("/api/package-upgrade/dependency-repositories",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({directories:e})}),saveConfig:e=>ot("/api/package-upgrade/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspaceDir:e})}),addRepo:e=>ot("/api/package-upgrade/repos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),packageNames:e=>ot("/api/package-upgrade/repos/packages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoIds:e})}),branches:e=>ot("/api/package-upgrade/repos/branches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoIds:e})}),cloneRepo:e=>ot(`/api/package-upgrade/repos/${e}/clone`,{method:"POST"}),removeRepo:e=>ot(`/api/package-upgrade/repos/${e}`,{method:"DELETE"}),createTask:e=>ot("/api/package-upgrade/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})},cye="modulepreload",uye=function(e){return"/"+e},iI={},pu=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let s=function(m){return Promise.all(m.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),f=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));a=s(n.map(m=>{if(m=uye(m),m in iI)return;iI[m]=!0;const h=m.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${p}`))return;const v=document.createElement("link");if(v.rel=h?"stylesheet":cye,h||(v.as="script"),v.crossOrigin="",v.href=m,f&&v.setAttribute("nonce",f),document.head.appendChild(v),h)return new Promise((y,b)=>{v.addEventListener("load",y),v.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(s){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=s,window.dispatchEvent(u),!u.defaultPrevented)throw s}return a.then(s=>{for(const u of s||[])u.status==="rejected"&&o(u.reason);return t().catch(o)})};async function L9(e,t,n){const r=URL.createObjectURL(e);try{const a=await new Promise((m,h)=>{const p=new Image;p.onload=()=>m(p),p.onerror=()=>h(new Error("Unable to read this image. Please choose a valid image file.")),p.src=r}),o=document.createElement("canvas"),s=Math.max(a.naturalWidth,a.naturalHeight);let u=1;t&&(u=t/s),n!=null&&n>0&&n<=100&&(u=u*(n/100)),o.width=Math.max(1,Math.round(a.naturalWidth*u)),o.height=Math.max(1,Math.round(a.naturalHeight*u));const f=o.getContext("2d",{willReadFrequently:!0});return f.drawImage(a,0,0,o.width,o.height),{imageData:f.getImageData(0,0,o.width,o.height),width:o.width,height:o.height}}finally{URL.revokeObjectURL(r)}}async function dye(e,t={}){const{quality:n=75,progressive:r=!0,optimizeCoding:a=!0,autoSubsample:o=!0}=t,[{encode:s},{imageData:u}]=await Promise.all([pu(()=>import("./index-_vMuByUV.js"),[]),L9(e)]),f=await s(u,{quality:n,progressive:r,optimize_coding:a,auto_subsample:o}),m=new Blob([f],{type:"image/jpeg"}),h=(e.name||"clipboard-image.png").replace(/\.[^.]+$/,"")+".jpg";return new File([m],h,{type:"image/jpeg"})}const{Paragraph:fye,Text:mye,Title:hye}=xn;function Ur({actions:e,className:t="",copyClassName:n="",description:r,descriptionClassName:a="",eyebrow:o="WORKBENCH",title:s,titleClassName:u="",titlePrefix:f,titleSuffix:m,titleRowClassName:h=""}){const p=c.jsx(hye,{className:u||void 0,level:2,children:s});return c.jsxs("header",{className:["page-header","workspace-page-header",t].filter(Boolean).join(" "),children:[c.jsxs("div",{className:n||void 0,children:[c.jsx(mye,{className:"workspace-page-eyebrow",children:o}),f||m?c.jsxs("div",{className:h||void 0,children:[f,p,m]}):p,r?c.jsx(fye,{className:["workspace-page-description",a].filter(Boolean).join(" "),type:"secondary",children:r}):null]}),e||null]})}const lI=[{value:"chrome",label:"Google Chrome"},{value:"edge",label:"Microsoft Edge"},{value:"safari",label:"Safari"}];function pye(e=!0){return e?lI:lI.filter(t=>t.value!=="safari")}function hr(e){e&&_9.open(e).catch(()=>{window.open(e,"_blank")})}function Ly(e,t){if(!e||!t)return"";const n=e.replace(/^https?:\/\//,"").replace(/\/+$/,"");return`https://${n.startsWith("jira.")?n:`jira.${n}`}/browse/${t.toUpperCase()}`}function gye(e,t){if(!t)return"";if(!e)return`https://jira.example.com/issues/?filter=${encodeURIComponent(t)}`;const n=e.replace(/^https?:\/\//i,"").replace(/\/+$/,"");return`https://${n.includes("jira")||n.includes(".atlassian.net")?n:`jira.${n}`}/issues/?filter=${encodeURIComponent(t)}`}const{Text:al}=xn,Rs=()=>new Intl.DateTimeFormat("en-CA").format(new Date),vye=e=>{if(!Number.isFinite(e)||e<0)return"";if(e<1024)return`${e} B`;const t=["KB","MB","GB"];let n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(n>=10?0:1)} ${t[r]}`},yye=[{value:0,label:"No deduplication (0 min)"},{value:5,label:"5 minutes"},{value:15,label:"15 minutes"},{value:30,label:"30 minutes"},{value:60,label:"1 hour (Default)"},{value:120,label:"2 hours"},{value:360,label:"6 hours"},{value:720,label:"12 hours"},{value:1440,label:"24 hours"}];function bye({value:e,domain:t,jiraIssuePrefix:n}){const r=[],a=/\[[^\]]+\]\(https?:\/\/[^\s)]+\)|https?:\/\/[^\s]+/g;let o=0;const s=(n||"").split(/[\s,]+/).filter(Boolean).map(m=>m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),u=s.length>0&&t?new RegExp(`\\b(?:${s.join("|")})-[a-zA-Z0-9]{1,10}\\b`,"gi"):null,f=(m,h)=>{if(!u||!t)return m;const p=[];let v=0;u.lastIndex=0;for(const y of m.matchAll(u)){y.index>v&&p.push(m.slice(v,y.index));const b=y[0],C=Ly(t,b);p.push(c.jsx("a",{href:C,target:"_blank",rel:"noreferrer",onClick:x=>{x.preventDefault(),hr(C)},children:b},`${h}-${y.index}`)),v=y.index+b.length}return v<m.length&&p.push(m.slice(v)),p};for(const m of e.matchAll(a)){m.index>o&&r.push(...f(e.slice(o,m.index),`txt-${m.index}`));const h=m[0].match(/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/);if(h)r.push(c.jsx("a",{href:h[2],target:"_blank",rel:"noreferrer",onClick:p=>{p.preventDefault(),hr(h[2])},children:h[1]},m.index));else{const p=m[0].replace(/[),.;:!?]+$/,"");r.push(c.jsx("a",{href:p,target:"_blank",rel:"noreferrer",onClick:v=>{v.preventDefault(),hr(p)},children:p},m.index)),m[0].length>p.length&&r.push(m[0].slice(p.length))}o=m.index+m[0].length}return o<e.length&&r.push(...f(e.slice(o),"txt-end")),r}const sI=e=>e.text||e.preview||"",AC=e=>`/api/clipboard/image/${encodeURIComponent(e)}`;async function xye(e){if(e.type==="image/png")return e;const t=URL.createObjectURL(e);try{const n=await new Promise((o,s)=>{const u=new window.Image;u.onload=()=>o(u),u.onerror=()=>s(new Error("Unable to decode clipboard image.")),u.src=t}),r=document.createElement("canvas");r.width=n.naturalWidth,r.height=n.naturalHeight;const a=r.getContext("2d");if(!a)throw new Error("Image canvas is unavailable.");return a.drawImage(n,0,0),await new Promise((o,s)=>{r.toBlob(u=>{u?o(u):s(new Error("Unable to encode clipboard image as PNG."))},"image/png")})}finally{URL.revokeObjectURL(t)}}function Nd(e,t,n){const r=e.trim();if(!r)return!1;if(t==="account")return r.length<=20&&(/^[AT]\d+/i.test(r)||/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/i.test(r)||/\b(?:account|username|user\s*name|login|帐号|账号|用户名)\s*[:=]/i.test(r));if(t==="id")return/^[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$/i.test(r);if(t==="url")return/^https?:\/\/[^\s]+$/i.test(r);if(t==="json"){if(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]"))try{return JSON.parse(r),!0}catch{return!1}return!1}if(t==="jira"){const a=(n||"").split(/[\s,]+/).filter(Boolean).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"));return a.length>0?new RegExp(`\\b(?:${a.join("|")})-[a-zA-Z0-9]{1,10}\\b`,"i").test(r):/\b[A-Z]{2,10}-[a-zA-Z0-9]{1,10}\b/i.test(r)}return!0}function Cye({children:e}){const t=l.useRef(null),[n,r]=l.useState(!1);return l.useEffect(()=>{const a=t.current;if(!a)return;const o=()=>{r(a.scrollTop+a.clientHeight<a.scrollHeight-1)};o(),a.addEventListener("scroll",o,{passive:!0});const s=typeof ResizeObserver<"u"?new ResizeObserver(o):null;return s==null||s.observe(a),()=>{a.removeEventListener("scroll",o),s==null||s.disconnect()}},[e]),c.jsxs("div",{className:`clipboard-preview-wrap${n?" has-more":""}`,children:[c.jsx("pre",{ref:t,className:"clipboard-preview",children:e}),c.jsx("span",{className:"clipboard-preview-fade","aria-hidden":"true"})]})}function Sye(){const{message:e}=Pr.useApp(),[t,n]=l.useState(()=>{const ie=localStorage.getItem("buddy_clipboard_enabled");return ie!==null?ie==="true":!0}),[r,a]=l.useState(!0),[o,s]=l.useState([]),[u,f]=l.useState(Rs()),[m,h]=l.useState([]),[p,v]=l.useState([]),[y,b]=l.useState(null),[C,x]=l.useState(""),[w,$]=l.useState("all"),[E,R]=l.useState(null),[N,O]=l.useState(!1),[I,j]=l.useState(!1),M=l.useRef(null),[T,z]=l.useState(""),[P,B]=l.useState(""),[H,A]=l.useState([]),[L,F]=l.useState(!1),[U,q]=l.useState({}),_=l.useRef(new Set),[K,X]=l.useState(""),[V,W]=l.useState(""),[G,Y]=l.useState(60),[te,ne]=l.useState(!1),[ue,Z]=l.useState(!0);l.useEffect(()=>{const ie=[...m,...p,...H];for(const fe of ie){if(!fe.imageFile)continue;const ke=`${fe.date||u}-${fe.id}`;if(U[ke]||_.current.has(ke))continue;_.current.add(ke);const Pe=new window.Image;Pe.onload=()=>{q(Ie=>({...Ie,[ke]:{width:Pe.naturalWidth,height:Pe.naturalHeight}})),_.current.delete(ke)},Pe.onerror=()=>_.current.delete(ke),Pe.src=AC(fe.imageFile)}},[m,p,H,u,U]),l.useEffect(()=>{Wn.status().then(ie=>{if(ie){if(ie.isMac!==void 0&&ne(ie.isMac),ie.clipboardEnabled!==void 0){const fe=ie.clipboardEnabled!==!1;n(fe),localStorage.setItem("buddy_clipboard_enabled",String(fe))}ie.clipboardImageEnabled!==void 0&&Z(ie.clipboardImageEnabled!==!1),ie.clipboardDeduplicateMinutes!==void 0&&Y(ie.clipboardDeduplicateMinutes),ie.domain&&X(ie.domain),ie.jiraIssuePrefix&&W(ie.jiraIssuePrefix)}}).catch(()=>{}).finally(()=>a(!1))},[]);const ee=async ie=>{n(ie),localStorage.setItem("buddy_clipboard_enabled",String(ie));try{const we=(await Wn.saveClipboardEnabled(ie)).clipboardEnabled!==!1;n(we),localStorage.setItem("buddy_clipboard_enabled",String(we)),e.success(ie?"Clipboard history enabled":"Clipboard history disabled")}catch(fe){e.error(fe.message)}},re=async ie=>{Z(ie);try{const fe=await Wn.saveClipboardImageEnabled(ie);fe&&fe.clipboardImageEnabled!==void 0&&Z(fe.clipboardImageEnabled!==!1),e.success(ie?"Image clipboard monitoring enabled":"Image clipboard monitoring disabled")}catch(fe){e.error(fe.message)}},oe=async ie=>{Y(ie);try{await Wn.saveClipboardDeduplicateMinutes(ie),e.success("Duplicate filter window updated.")}catch(fe){e.error(fe.message)}};l.useEffect(()=>{const ie=P.trim();if(!ie){A([]),F(!1);return}let fe=!1,we=null;const ke=Date.now();F(!0);const Pe=setTimeout(async()=>{try{const Ie=await rl.search(ie);fe||A(Ie.items||[])}catch(Ie){fe||e.error(Ie.message)}finally{const Ie=Math.max(0,500-(Date.now()-ke));we=setTimeout(()=>{fe||F(!1)},Ie)}},250);return()=>{fe=!0,clearTimeout(Pe),we&&clearTimeout(we)}},[P]);const de=async ie=>{try{const[fe,we]=await Promise.all([rl.list(ie),rl.tagged().catch(()=>({items:[]}))]);s(fe.dates),h(fe.items),v(we.items||[])}catch(fe){e.error(fe.message)}},be=async(ie,fe)=>{const we=(fe||"").trim();if(!we)return;const ke=ie.tags||[];if(ke.includes(we)){b(null);return}const Pe=[...ke,we],Ie=ie.date||u;try{await rl.updateTags(Ie,ie.id,Pe),h(Ve=>Ve.map(Le=>Le.id===ie.id?{...Le,tags:Pe}:Le)),A(Ve=>Ve.map(Le=>Le.id===ie.id?{...Le,tags:Pe}:Le)),v(Ve=>Ve.some(je=>je.id===ie.id)?Ve.map(je=>je.id===ie.id?{...je,tags:Pe}:je):[{...ie,tags:Pe,date:Ie},...Ve]),e.success("Tag added")}catch(Ve){e.error(Ve.message)}finally{b(null),x("")}},J=async(ie,fe)=>{const ke=(ie.tags||[]).filter(Ie=>Ie!==fe),Pe=ie.date||u;try{await rl.updateTags(Pe,ie.id,ke),h(Ie=>Ie.map(Ve=>Ve.id===ie.id?{...Ve,tags:ke}:Ve)),A(Ie=>Ie.map(Ve=>Ve.id===ie.id?{...Ve,tags:ke}:Ve)),v(Ie=>ke.length===0?Ie.filter(Ve=>Ve.id!==ie.id):Ie.map(Ve=>Ve.id===ie.id?{...Ve,tags:ke}:Ve)),e.success("Tag removed")}catch(Ie){e.error(Ie.message)}},ye=l.useRef(Rs());l.useEffect(()=>{if(!t)return;const ie=()=>{const Pe=Rs();if(Pe!==ye.current){const Ie=ye.current;if(ye.current=Pe,u===Ie)return f(Pe),!0}return!1};ie()||de(u);const we=()=>{ie()||de(u)};window.addEventListener("visibilitychange",we),window.addEventListener("focus",we);let ke=null;return u===Rs()&&(ke=setInterval(()=>{document.visibilityState==="visible"&&de(u)},3e3)),()=>{window.removeEventListener("visibilitychange",we),window.removeEventListener("focus",we),ke&&clearInterval(ke)}},[u,t]);const xe=async ie=>{const fe=typeof ie=="object"?ie:{id:ie},we=fe.date||u;try{await rl.remove(we,fe.id),A(ke=>ke.filter(Pe=>Pe.id!==fe.id)),await de(u),e.success("Clipboard entry deleted.")}catch(ke){e.error(ke.message)}},ze=async ie=>{var we;const fe=ie.date||u;if(ie.imageFile)try{if(!((we=navigator.clipboard)!=null&&we.write)||typeof window.ClipboardItem>"u")throw new Error("Image clipboard is not supported by this browser.");await rl.copied(fe,ie.id);const ke=await fetch(AC(ie.imageFile));if(!ke.ok)throw new Error("Unable to load image.");const Pe=await xye(await ke.blob());try{await navigator.clipboard.write([new ClipboardItem({"image/png":Pe})])}catch(Ie){await rl.copyImage(fe,ie.id).catch(()=>{throw Ie})}R(ie.id),setTimeout(()=>{R(Ie=>Ie===ie.id?null:Ie)},1e3)}catch(ke){e.error("Failed to copy image: "+ke.message)}else try{const ke=await rl.copied(fe,ie.id);await navigator.clipboard.writeText(ke.copyText??ie.text??ie.preview??""),R(ie.id),setTimeout(()=>{R(Pe=>Pe===ie.id?null:Pe)},1e3),u===Rs()&&fe!==Rs()&&await de(u)}catch(ke){e.error("Failed to copy text: "+ke.message)}},he=l.useMemo(()=>[...new Set([Rs(),...o,u])],[o,u]);l.useEffect(()=>{if(!t)return;const ie=fe=>{const we=document.activeElement;if(we&&(we.tagName==="INPUT"||we.tagName==="TEXTAREA"||we.isContentEditable||we.closest(".clipboard-tabs")))return;const ke=[...he].sort(),Pe=ke.indexOf(u);fe.key==="ArrowLeft"?Pe>0&&f(ke[Pe-1]):fe.key==="ArrowRight"&&Pe<ke.length-1&&Pe!==-1&&f(ke[Pe+1])};return window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)},[he,u,t]),l.useEffect(()=>{if(!t)return;const ie=async fe=>{var Pe;const we=document.activeElement;if(we&&(we.tagName==="INPUT"||we.tagName==="TEXTAREA"||we.isContentEditable))return;const ke=(Pe=fe.clipboardData)==null?void 0:Pe.items;if(ke){for(const Ie of ke)if(Ie.type.startsWith("image/")){const Ve=Ie.getAsFile();if(Ve){try{e.loading({content:"Compressing and saving image from paste…",key:"paste-upload",duration:0});const Le=await dye(Ve);await rl.uploadImage(Le);const je=Rs();f(je),await de(je),e.success({content:"Image pasted and saved to history!",key:"paste-upload"})}catch(Le){e.error({content:"Failed to save pasted image: "+Le.message,key:"paste-upload"})}break}}}};return window.addEventListener("paste",ie),()=>window.removeEventListener("paste",ie)},[u,t]);const ce=he.reduce((ie,fe)=>{var Ie;const[we,ke,Pe]=fe.split("-");return ie[we]||(ie[we]={}),(Ie=ie[we])[ke]||(Ie[ke]=[]),ie[we][ke].includes(Pe)||ie[we][ke].push(Pe),ie},{}),se=Object.entries(ce).sort(([ie],[fe])=>fe.localeCompare(ie)).map(([ie,fe])=>({value:ie,label:ie,children:Object.entries(fe).sort(([we],[ke])=>ke.localeCompare(we)).map(([we,ke])=>({value:we,label:we,children:ke.sort().reverse().map(Pe=>({value:Pe,label:Pe}))}))})),ae=P.trim(),ge=l.useMemo(()=>w==="tagged"?p:w==="all"?m:w==="image"?m.filter(ie=>!!ie.imageFile):m.filter(ie=>!ie.imageFile&&Nd(sI(ie),w,V)),[w,m,p,V]),Re=l.useMemo(()=>{const ie={all:m.length,tagged:p.length,jira:0,account:0,id:0,url:0,json:0,image:0};for(const ke of m)if(ke.imageFile)ie.image++;else{const Pe=sI(ke);Nd(Pe,"jira",V)&&ie.jira++,Nd(Pe,"account")&&ie.account++,Nd(Pe,"id")&&ie.id++,Nd(Pe,"url")&&ie.url++,Nd(Pe,"json")&&ie.json++}const fe=(ke,Pe)=>({key:ke,label:c.jsxs("span",{className:"clipboard-tab-label",children:[c.jsx("span",{children:Pe}),c.jsxs("span",{className:"clipboard-tab-count",children:["(",ie[ke],")"]})]})}),we=[fe("all","All"),fe("tagged","Tagged"),fe("jira","Jira"),fe("account","Account"),fe("id","ID"),fe("url","Url"),fe("json","JSON")];return te&&we.push(fe("image","Img")),we},[m,p,V,te]);l.useEffect(()=>{!te&&w==="image"&&$("all")},[te,w]);const _e=(ie,fe=!1)=>{const we=ie.date||u,ke=U[`${we}-${ie.id}`],Pe=(ke==null?void 0:ke.width)>0&&(ke==null?void 0:ke.height)>0?ke.width/ke.height:null,Ie=Pe?Math.min(ke.width,300*Pe):null,Ve=`/api/clipboard/${encodeURIComponent(we)}/${encodeURIComponent(ie.id)}`,Le=new Date(ie.createdAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1});return c.jsxs(It,{size:"small",className:`clipboard-item${ie.imageFile?" clipboard-image-item":""}`,children:[c.jsxs("div",{children:[c.jsxs("div",{className:"clipboard-item-meta",children:[c.jsx(al,{type:"secondary",children:Le}),(fe||ie.date&&ie.date!==u)&&c.jsx($t,{style:{margin:0},children:we}),(ie.tags||[]).map(je=>c.jsx($t,{color:"purple",closable:!0,onClose:$e=>{$e.preventDefault(),J(ie,je)},style:{margin:0},children:je},je)),c.jsx(Z2,{content:c.jsxs(ct.Compact,{style:{width:200},children:[c.jsx(Ct,{size:"small",placeholder:"Tag name",value:C,onChange:je=>x(je.target.value),onPressEnter:()=>be(ie,C)}),c.jsx(Oe,{size:"small",type:"primary",onClick:()=>be(ie,C),children:"Add"})]}),title:"Add Tag",trigger:"click",open:y===ie.id,onOpenChange:je=>{b(je?ie.id:null),x("")},children:c.jsxs($t,{className:"clipboard-add-tag",children:[c.jsx(Xn,{})," Tag"]})})]}),ie.imageFile?c.jsx("div",{className:`clipboard-image-wrap${Pe?" has-dimensions":""}`,style:Ie?{width:`${Ie}px`,maxWidth:"100%",aspectRatio:`${ke.width} / ${ke.height}`}:void 0,children:c.jsx(P$,{src:AC(ie.imageFile),alt:"Clipboard entry",className:"clipboard-image",preview:!0,onError:()=>e.error("Unable to load clipboard image.")})}):c.jsxs(c.Fragment,{children:[c.jsx(Cye,{children:c.jsx(bye,{value:ie.preview||ie.text,domain:K,jiraIssuePrefix:V})}),ie.contentFile&&c.jsxs("span",{className:"clipboard-original",children:[c.jsx("a",{href:Ve,target:"_blank",rel:"noreferrer",children:"View original content"}),c.jsxs("a",{href:ie.editorUrl,children:["Open in ",ie.editorName||"editor"]})]})]})]}),c.jsxs("span",{className:"clipboard-actions",children:[U[`${we}-${ie.id}`]&&c.jsxs(al,{type:"secondary",className:"clipboard-image-dimensions",children:[U[`${we}-${ie.id}`].width," × ",U[`${we}-${ie.id}`].height," px"]}),U[`${we}-${ie.id}`]&&ie.imageFile&&Number.isFinite(ie.imageSize)&&c.jsx("span",{className:"clipboard-image-meta-separator","aria-hidden":"true",children:"·"}),ie.imageFile&&Number.isFinite(ie.imageSize)&&c.jsx(al,{type:"secondary",className:"clipboard-image-size",children:vye(ie.imageSize)}),c.jsx(Oe,{type:"text",icon:E===ie.id?c.jsx(Vl,{style:{color:"#52c41a"}}):c.jsx(fo,{}),onClick:()=>ze(ie)}),ie.imageFile?c.jsx(Gr,{title:"Delete this clipboard image?",okText:"Delete",cancelText:"Cancel",onConfirm:()=>xe(ie),children:c.jsx(Oe,{type:"text",danger:!0,icon:c.jsx(Fn,{})})}):c.jsx(Oe,{type:"text",danger:!0,icon:c.jsx(Fn,{}),onClick:()=>xe(ie)})]})]},`${we}-${ie.id}`)};return c.jsxs("div",{className:"clipboard-page",children:[c.jsx(Ur,{titleSuffix:c.jsx(Oe,{"aria-label":"Search clipboard history",disabled:!t||r,icon:c.jsx(jo,{}),onClick:()=>O(!0),type:"text"}),titleRowClassName:"clipboard-title-row",actions:c.jsx("div",{className:"clipboard-controls",children:c.jsxs(ct,{size:8,align:"center",children:[c.jsx(Jl,{allowClear:!1,className:"clipboard-picker",disabled:!t||r,options:se,value:u.split("-"),onChange:ie=>(ie==null?void 0:ie.length)===3&&f(ie.join("-")),placeholder:"Select date"}),c.jsx(Oe,{"aria-label":"Clipboard history settings",icon:c.jsx(Gl,{}),onClick:()=>j(!0),type:"text"})]})}),description:"Saved locally and archived by date.",title:"Clipboard History"}),t?c.jsxs(c.Fragment,{children:[c.jsx(Qa,{className:"clipboard-tabs",activeKey:w,onChange:ie=>{$(ie),requestAnimationFrame(()=>{var fe;return(fe=document.activeElement)==null?void 0:fe.blur()})},onKeyDown:ie=>{var fe;["ArrowLeft","ArrowRight"].includes(ie.key)&&(ie.preventDefault(),(fe=document.activeElement)==null||fe.blur())},items:Re}),ge.length?c.jsx("div",{className:"clipboard-list",children:ge.map(ie=>_e(ie))}):c.jsx(Xt,{description:`No ${w==="all"?"clipboard entries":`${w==="id"?"ID":w} entries`}${w==="tagged"?".":` for ${u}.`}`})]}):c.jsx(It,{className:"clipboard-disabled-card",children:c.jsx(Xt,{image:c.jsx(F0e,{style:{fontSize:48,color:"#9ca3af"}}),description:c.jsxs("div",{className:"clipboard-disabled-copy",children:[c.jsx(al,{strong:!0,className:"clipboard-disabled-title",children:"Clipboard history is disabled"}),c.jsx(al,{type:"secondary",children:"Open settings to turn on clipboard history and start capturing."})]})})}),c.jsx(bn,{className:"clipboard-settings-modal",open:I,title:"Clipboard History Settings",footer:null,width:480,onCancel:()=>j(!1),children:c.jsxs("div",{className:"clipboard-settings",children:[c.jsxs("div",{className:"clipboard-setting-row",children:[c.jsx(al,{type:"secondary",className:"clipboard-setting-label",children:"Clipboard history:"}),c.jsx(Ja,{loading:r,checked:t,onChange:ee,checkedChildren:"On",unCheckedChildren:"Off"})]}),c.jsxs("div",{className:"clipboard-setting-row",children:[c.jsx(al,{type:"secondary",className:"clipboard-setting-label",children:"Deduplicate filter:"}),c.jsx($n,{size:"small",disabled:!t||r,value:G,onChange:oe,className:"clipboard-deduplicate-select",options:yye})]}),te&&c.jsxs("div",{className:"clipboard-setting-row",children:[c.jsx(al,{type:"secondary",className:"clipboard-setting-label",children:"Monitor image clipboard:"}),c.jsx(Ja,{size:"small",disabled:!t||r,checked:ue,onChange:re,checkedChildren:"On",unCheckedChildren:"Off"})]})]})}),c.jsxs(bn,{open:N,afterOpenChange:ie=>{var fe;ie&&((fe=M.current)==null||fe.focus())},title:"Search Clipboard History",footer:null,width:760,onCancel:()=>O(!1),children:[c.jsxs("div",{className:"clipboard-search-control",children:[c.jsx(Ct,{ref:M,allowClear:!0,className:"clipboard-search-field",placeholder:"Search all clipboard history",value:T,onChange:ie=>{const fe=ie.target.value;z(fe),fe||(B(""),A([]))},onPressEnter:()=>{const ie=T.trim();ie!==ae&&A([]),B(ie)}}),c.jsx(Oe,{className:"clipboard-search-button",loading:L,onClick:()=>{const ie=T.trim();ie!==ae&&A([]),B(ie)},type:"primary",children:"Search"})]}),ae&&!L&&c.jsxs(al,{type:"secondary",className:"clipboard-search-summary",children:[H.length," result",H.length===1?"":"s"," for “",ae,"”"]}),ae?L?c.jsx(La,{active:!0,className:"clipboard-search-loading",paragraph:{rows:4}}):H.length?c.jsx("div",{className:"clipboard-search-results clipboard-list",children:H.map(ie=>_e(ie,!0))}):c.jsx(Xt,{className:"clipboard-search-empty",description:`No results for “${ae}”.`}):c.jsx(al,{type:"secondary",className:"clipboard-search-hint",children:"Search across all clipboard history."})]}),c.jsx(oc.BackTop,{visibilityHeight:240})]})}const{Text:Tl,Title:wye}=xn,B9=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],H9=[1,2,3,4,5,6,0],cI=[{value:"daily",label:"Every day"},{value:"weekdays",label:"Weekdays"},{value:"weekly",label:"Every week"},{value:"once",label:"One time"},{value:"cron",label:"Custom cron expression"}],uI=[{value:"custom",label:"Custom script",icon:c.jsx(wa,{})},{value:"quick-launch",label:"Quick Launch",icon:c.jsx(Z$,{})},{value:"launcher-script",label:"Launcher script",icon:c.jsx(Kl,{})}],dI=()=>({name:"",scheduleType:"daily",time:dr().hour(9).minute(0).second(0),weekday:1,scheduledAt:dr().add(1,"day").startOf("day").hour(9),cronExpression:"0 9 * * *",targetType:"custom",command:"",args:"",workingDirectory:"",launcherId:null,scriptId:null,quickLaunchId:null,enabled:!0});function qv(e){return e?new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date(e)):"—"}function $ye(e){return e.scheduleType==="once"?`One time · ${qv(e.scheduledAt)}`:e.scheduleType==="daily"?`Every day · ${e.time}`:e.scheduleType==="weekdays"?`Weekdays · ${e.time}`:e.scheduleType==="weekly"?`Every ${B9[H9.indexOf(e.weekday)]||"week"} · ${e.time}`:`Cron · ${e.cronExpression}`}function Eye(e){return{name:e.name,scheduleType:e.scheduleType,time:e.time?dr(`2000-01-01T${e.time}`):dr().hour(9).minute(0),weekday:e.weekday??1,scheduledAt:e.scheduledAt?dr(e.scheduledAt):dr().add(1,"day").startOf("day").hour(9),cronExpression:e.cronExpression||"0 9 * * *",targetType:e.targetType,command:e.command||"",args:e.args||"",workingDirectory:e.workingDirectory||"",launcherId:e.launcherId||null,scriptId:e.scriptId||null,quickLaunchId:e.quickLaunchId||null,enabled:e.enabled}}function jye(e,t){var a;if(e.targetType==="custom")return`${e.command} · ${e.workingDirectory}`;if(e.targetType==="quick-launch")return((a=t.quickLaunches.find(o=>o.id===e.quickLaunchId))==null?void 0:a.name)||"Quick Launch";const n=t.launchers.find(o=>o.id===e.launcherId),r=n==null?void 0:n.scripts.find(o=>o.id===e.scriptId);return n&&r?`${n.alias} · ${r.name}`:"Launcher script"}function Nye(){var M,T,z;const{message:e}=Pr.useApp(),[t,n]=l.useState([]),[r,a]=l.useState({launchers:[],quickLaunches:[]}),[o,s]=l.useState(dI),[u,f]=l.useState(null),[m,h]=l.useState(!0),[p,v]=l.useState(!1),[y,b]=l.useState(null),C=l.useCallback(async(P=!0)=>{P&&h(!0);try{const[B,H]=await Promise.all([Pc.list(),Pc.catalog()]);n(B),a(H)}catch(B){e.error(B.message)}finally{P&&h(!1)}},[e]);l.useEffect(()=>{C()},[C]);const x=l.useMemo(()=>r.launchers.find(P=>P.id===o.launcherId),[r.launchers,o.launcherId]),w=uI.find(P=>P.value===o.targetType),$=l.useMemo(()=>({total:t.length,active:t.filter(P=>P.enabled).length,failed:t.filter(P=>P.lastStatus==="failed").length}),[t]),E=()=>{f(null),s(dI())},R=(P,B)=>s(H=>({...H,[P]:B})),N=async()=>{var P,B;if(!o.name.trim()){e.warning("Enter a Cron Job name");return}if(o.scheduleType==="once"&&!((P=o.scheduledAt)!=null&&P.isValid())){e.warning("Choose a future date and time");return}if(!["once","cron"].includes(o.scheduleType)&&!((B=o.time)!=null&&B.isValid())){e.warning("Choose a run time");return}if(o.scheduleType==="cron"&&!o.cronExpression.trim()){e.warning("Enter a cron expression");return}if(o.targetType==="custom"&&(!o.command.trim()||!o.workingDirectory.trim())){e.warning("Enter a command and working directory");return}if(o.targetType==="quick-launch"&&!o.quickLaunchId){e.warning("Choose a Quick Launch");return}if(o.targetType==="launcher-script"&&(!o.launcherId||!o.scriptId)){e.warning("Choose a Launcher script");return}v(!0);try{const H={name:o.name,scheduleType:o.scheduleType,time:["once","cron"].includes(o.scheduleType)?void 0:o.time.format("HH:mm"),weekday:o.scheduleType==="weekly"?o.weekday:void 0,scheduledAt:o.scheduleType==="once"?o.scheduledAt.second(0).millisecond(0).toISOString():void 0,cronExpression:o.scheduleType==="cron"?o.cronExpression:void 0,targetType:o.targetType,args:o.args,command:o.targetType==="custom"?o.command:void 0,workingDirectory:o.targetType==="custom"?o.workingDirectory:void 0,launcherId:o.targetType==="launcher-script"?o.launcherId:void 0,scriptId:o.targetType==="launcher-script"?o.scriptId:void 0,quickLaunchId:o.targetType==="quick-launch"?o.quickLaunchId:void 0,enabled:o.enabled},A=u?await Pc.update(u,H):await Pc.create(H);n(L=>u?L.map(F=>F.id===A.id?A:F):[A,...L]),E(),e.success(u?"Cron Job updated":"Cron Job created")}catch(H){e.error(H.message)}finally{v(!1)}},O=async(P,B)=>{try{const H=await Pc.toggle(P.id,B);n(A=>A.map(L=>L.id===H.id?H:L))}catch(H){e.error(H.message)}},I=async P=>{b(P.id);try{await Pc.run(P.id),e.success(`Started ${P.name}`),await C(!1)}catch(B){e.error(B.message)}finally{b(null)}},j=async P=>{try{await Pc.remove(P),n(B=>B.filter(H=>H.id!==P)),u===P&&E(),e.success("Cron Job deleted")}catch(B){e.error(B.message)}};return c.jsxs("div",{className:"cron-jobs-page",children:[c.jsx(Ur,{eyebrow:"AUTOMATION",title:"Cron Jobs",description:"Run custom commands, Quick Launch groups, or Launcher scripts on a schedule.",actions:c.jsx(ct,{wrap:!0,children:c.jsx(Oe,{icon:c.jsx(Xa,{}),onClick:()=>C(!1),children:"Refresh"})})}),c.jsxs("div",{className:"cron-job-stats",children:[c.jsxs(It,{children:[c.jsx(Tl,{type:"secondary",children:"All jobs"}),c.jsx("strong",{children:$.total}),c.jsx("span",{children:"Saved schedules"})]}),c.jsxs(It,{className:"is-active",children:[c.jsx(Tl,{type:"secondary",children:"Active"}),c.jsx("strong",{children:$.active}),c.jsx("span",{children:"Waiting for the next run"})]}),c.jsxs(It,{className:$.failed?"is-failed":"",children:[c.jsx(Tl,{type:"secondary",children:"Recent failures"}),c.jsx("strong",{children:$.failed}),c.jsx("span",{children:"Jobs that failed to start"})]})]}),c.jsxs("div",{className:"cron-jobs-layout",children:[c.jsx(It,{className:"cron-job-editor",title:c.jsxs("span",{children:[c.jsx(Jm,{})," ",u?"Edit Cron Job":"New Cron Job"]}),extra:u&&c.jsx(Oe,{type:"link",onClick:E,children:"New"}),children:c.jsxs("div",{className:"cron-job-form",children:[c.jsxs("label",{children:["Job name",c.jsx(Ct,{value:o.name,maxLength:50,showCount:!0,placeholder:"For example: Start the local API",onChange:P=>R("name",P.target.value)})]}),c.jsxs("label",{children:["Schedule",c.jsx($n,{value:o.scheduleType,options:cI,onChange:P=>R("scheduleType",P)})]}),o.scheduleType==="once"&&c.jsxs("label",{children:["Date and time",c.jsx(vl,{className:"cron-wide-control",showTime:{format:"HH:mm",minuteStep:1},format:"YYYY-MM-DD HH:mm",value:o.scheduledAt,onChange:P=>R("scheduledAt",P&&P.second(0).millisecond(0))})]}),!["once","cron"].includes(o.scheduleType)&&c.jsxs("div",{className:"cron-form-row",children:[c.jsxs("label",{children:["Time",c.jsx(If,{className:"cron-wide-control",format:"HH:mm",minuteStep:1,value:o.time,onChange:P=>R("time",P&&P.second(0).millisecond(0))})]}),o.scheduleType==="weekly"&&c.jsxs("label",{children:["Day",c.jsx($n,{value:o.weekday,options:B9.map((P,B)=>({label:P,value:H9[B]})),onChange:P=>R("weekday",P)})]})]}),o.scheduleType==="cron"&&c.jsxs("label",{children:["Cron expression",c.jsx(Ct,{value:o.cronExpression,placeholder:"0 9 * * 1-5",onChange:P=>R("cronExpression",P.target.value)}),c.jsxs(Tl,{type:"secondary",className:"cron-help",children:["Five fields: minute hour day-of-month month day-of-week. Example: ",c.jsx("code",{children:"*/15 * * * *"})]})]}),c.jsx("div",{className:"cron-section-label",children:"Execution target"}),c.jsx("div",{className:"cron-target-options",children:uI.map(P=>c.jsx(Oe,{type:o.targetType===P.value?"primary":"default",icon:P.icon,onClick:()=>R("targetType",P.value),children:P.label},P.value))}),o.targetType==="custom"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{children:["Command",c.jsx(Ct.TextArea,{value:o.command,maxLength:2e3,showCount:!0,autoSize:{minRows:3,maxRows:6},placeholder:"npm run build",onChange:P=>R("command",P.target.value)})]}),c.jsxs("label",{children:["Working directory",c.jsx(Ct,{value:o.workingDirectory,placeholder:"/path/to/project",onChange:P=>R("workingDirectory",P.target.value)})]})]}),o.targetType==="quick-launch"&&c.jsxs("label",{children:["Quick Launch",c.jsx($n,{className:"cron-wide-control",placeholder:"Choose a Quick Launch",value:o.quickLaunchId,options:r.quickLaunches.map(P=>({value:P.id,label:`${P.name} · ${P.scriptCount} scripts`})),onChange:P=>R("quickLaunchId",P)})]}),o.targetType==="launcher-script"&&c.jsxs("div",{className:"cron-form-row",children:[c.jsxs("label",{children:["Launcher",c.jsx($n,{className:"cron-wide-control",placeholder:"Choose a Launcher",value:o.launcherId,options:r.launchers.map(P=>({value:P.id,label:P.alias})),onChange:P=>s(B=>({...B,launcherId:P,scriptId:null}))})]}),c.jsxs("label",{children:["Script",c.jsx($n,{className:"cron-wide-control",placeholder:"Choose a script",value:o.scriptId,options:((x==null?void 0:x.scripts)||[]).map(P=>({value:P.id,label:c.jsxs("span",{className:"cron-script-option",children:[c.jsx("span",{children:P.name}),c.jsxs("span",{className:"cron-script-source",children:["· ",P.source]})]})})),onChange:P=>R("scriptId",P)})]})]}),c.jsxs("label",{children:["Arguments",c.jsx(Ct,{value:o.args,maxLength:1e3,showCount:!0,placeholder:"--port 3000 --mode production",onChange:P=>R("args",P.target.value)}),c.jsx(Tl,{type:"secondary",className:"cron-help",children:"These arguments are appended to the selected command when it runs."})]}),c.jsxs("div",{className:"cron-enabled-row",children:[c.jsxs("div",{children:[c.jsx(Tl,{strong:!0,children:"Enable job"}),c.jsx(Tl,{type:"secondary",children:"Run automatically after saving"})]}),c.jsx(Ja,{checked:o.enabled,onChange:P=>R("enabled",P)})]}),c.jsxs("div",{className:"cron-preview",children:[c.jsxs("div",{children:[c.jsx("span",{children:"Schedule preview"}),c.jsx(jy,{})]}),c.jsx("strong",{children:o.scheduleType==="cron"?`Cron · ${o.cronExpression||"—"}`:o.scheduleType==="once"?`One time · ${o.scheduledAt?qv(o.scheduledAt.toISOString()):"—"}`:`${(M=cI.find(P=>P.value===o.scheduleType))==null?void 0:M.label} · ${((T=o.time)==null?void 0:T.format("HH:mm"))||"—"}`}),c.jsxs("p",{children:[w==null?void 0:w.label," · ",o.targetType==="custom"?o.command||"No command yet":o.targetType==="quick-launch"?((z=r.quickLaunches.find(P=>P.id===o.quickLaunchId))==null?void 0:z.name)||"No Quick Launch selected":(x==null?void 0:x.alias)||"No Launcher selected"]})]}),c.jsxs(ct,{className:"cron-form-actions",children:[c.jsx(Oe,{onClick:E,children:u?"Cancel":"Clear"}),c.jsx(Oe,{type:"primary",icon:c.jsx(Xn,{}),loading:p,onClick:N,children:u?"Save changes":"Create Cron Job"})]})]})}),c.jsx(It,{className:"cron-job-list-card",title:c.jsxs("span",{children:[c.jsx(Jm,{})," Scheduled jobs"]}),children:m?c.jsx("div",{className:"cron-list-state",children:"Loading Cron Jobs…"}):t.length===0?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No Cron Jobs yet. Create your first schedule."}):c.jsx("div",{className:"cron-job-list",children:t.map(P=>c.jsxs("article",{className:`cron-job-item ${P.enabled?"":"is-disabled"}`,children:[c.jsx("div",{className:"cron-job-icon",children:c.jsx(Jm,{})}),c.jsxs("div",{className:"cron-job-main",children:[c.jsxs("div",{className:"cron-job-heading",children:[c.jsx(wye,{level:4,children:P.name}),c.jsx($t,{color:P.enabled?"green":"default",children:P.enabled?"Active":"Paused"}),P.lastStatus==="failed"&&c.jsx($t,{color:"error",children:"Failed"})]}),c.jsx(Tl,{className:"cron-job-target",children:jye(P,r)}),c.jsxs("div",{className:"cron-job-meta",children:[c.jsx("span",{children:$ye(P)}),P.enabled&&P.nextRunAt&&c.jsxs("span",{children:["Next: ",qv(P.nextRunAt)]}),P.lastRunAt&&c.jsxs("span",{children:["Last: ",qv(P.lastRunAt)]})]}),P.lastError&&c.jsx(Tl,{type:"danger",className:"cron-job-error",children:P.lastError})]}),c.jsxs("div",{className:"cron-job-actions",children:[c.jsx(Ja,{size:"small",checked:P.enabled,onChange:B=>O(P,B)}),c.jsx(Oe,{type:"text",icon:c.jsx(Kl,{}),"aria-label":"Run Cron Job now",title:"Run now",loading:y===P.id,onClick:()=>I(P)}),c.jsx(Oe,{type:"text",icon:c.jsx(Wo,{}),"aria-label":"Edit Cron Job",onClick:()=>{f(P.id),s(Eye(P))}}),c.jsx(Gr,{title:"Delete this Cron Job?",okText:"Delete",cancelText:"Cancel",onConfirm:()=>j(P.id),children:c.jsx(Oe,{type:"text",danger:!0,icon:c.jsx(Fn,{}),"aria-label":"Delete Cron Job"})})]})]},P.id))})})]}),c.jsxs("div",{className:"cron-job-footnote",children:[c.jsx(Jm,{})," Cron Jobs run from the DevBuddy server, so the browser page does not need to stay on this screen. The DevBuddy server itself must remain running."]})]})}const F9=[{value:"vscode",label:"VS Code"},{value:"devin",label:"Devin"},{value:"idea",label:"IntelliJ IDEA"}];function V9(e="vscode"){const t=F9.find(n=>n.value===e);return t?t.label:"VS Code"}function U9(e="vscode",t="",n="",r={}){if(!t)return"";const a=typeof r=="boolean"?r:!!(r!=null&&r.newWindow);let o="",s="";if(n){const u=n.split(":").filter(Boolean);u[0]&&(o=u[0]),u[1]&&(s=u[1])}if(e==="idea"){let u=`idea://open?file=${encodeURIComponent(t)}`;return o&&(u+=`&line=${o}`),s&&(u+=`&column=${s}`),u}return e==="devin"?`devin://file${encodeURI(t)}${n}`:a?`vscode://vscode.open-folder${encodeURI(t)}?forceNewWindow=true`:`vscode://file${encodeURI(t)}${n}`}const{Text:dv}=xn;function Oye({tasks:e,running:t,onCreate:n,onEdit:r,onStart:a,onStop:o,onRemove:s,onReorder:u}){const[f,m]=l.useState(null),[h,p]=l.useState(null),v=()=>{m(null),p(null)},y=async(C,x)=>{x.preventDefault();const w=x.dataTransfer.getData("text/plain")||f;if(!w||w===C){v();return}const $=[...e],E=$.findIndex(O=>O.id===w),R=$.findIndex(O=>O.id===C);if(E<0||R<0){v();return}const[N]=$.splice(E,1);$.splice(R,0,N),v(),await u($.map(O=>O.id))},b=[{title:"",width:44,render:(C,x)=>c.jsx("span",{className:"group-task-drag-handle",draggable:!0,"aria-label":`Drag ${x.name} to reorder`,title:"Drag to reorder",onDragStart:w=>{w.dataTransfer.effectAllowed="move",w.dataTransfer.setData("text/plain",x.id),m(x.id)},onDragEnd:v,children:c.jsx(ZR,{})})},{title:"Name",dataIndex:"name",render:C=>c.jsx(dv,{strong:!0,children:C})},{title:"Scripts",dataIndex:"items",width:110,render:C=>c.jsxs(dv,{type:"secondary",children:[C.length," scripts"]})},{title:"Actions",width:230,render:(C,x)=>{const w=x.items.every($=>t.has(`${$.launcherId}:${$.scriptId}`));return c.jsxs(ct,{children:[c.jsx(Oe,{size:"small",className:w?"launcher-running-button":void 0,icon:w?c.jsx("span",{className:"launcher-stop-square"}):c.jsx(Kl,{}),onClick:()=>w?o(x):a(x),children:w?"Stop":"Start"}),c.jsx(Oe,{size:"small",onClick:()=>r(x),children:"Edit"}),c.jsx(Oe,{size:"small",danger:!0,icon:c.jsx(Fn,{}),onClick:()=>s(x),children:"Delete"})]})}}];return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"group-task-header",children:[c.jsxs("div",{className:"group-task-header-copy",children:[c.jsx(dv,{type:"secondary",children:"Start selected scripts across multiple services."}),c.jsxs(dv,{type:"secondary",className:"group-task-drag-hint",children:[c.jsx(ZR,{})," Drag the handle to reorder."]})]}),c.jsx(Oe,{type:"primary",icon:c.jsx(Xn,{}),onClick:n,children:"Add quick launch"})]}),e.length?c.jsx(ar,{className:"group-task-table",rowKey:"id",dataSource:e,columns:b,pagination:!1,size:"small",onRow:C=>({className:`${f===C.id?"is-dragging":""} ${h===C.id?"is-drag-over":""}`.trim(),onDragOver:x=>{x.preventDefault(),x.dataTransfer.dropEffect="move",f!==C.id&&p(C.id)},onDragLeave:()=>p(x=>x===C.id?null:x),onDrop:x=>{y(C.id,x)}})}):c.jsx(Xt,{description:"No quick launches yet.",className:"group-task-empty"})]})}function df({open:e,initialPath:t="~",onCancel:n,onSelect:r,title:a="Browse Directory",selectionType:o="directory"}){const{message:s}=Pr.useApp(),[u,f]=l.useState(t),[m,h]=l.useState(null),[p,v]=l.useState(!1),y=async b=>{v(!0);try{const C=await Qm.browse(b||"~");h(C),f(C.currentPath)}catch(C){s.error(C.message||"Failed to read directory")}finally{v(!1)}};return l.useEffect(()=>{e&&y(t||"~")},[e,t]),c.jsx(bn,{title:a,open:e,onCancel:n,footer:null,width:640,destroyOnClose:!0,children:c.jsxs(rr,{spinning:p,children:[c.jsx("div",{className:"file-browser-path-row",children:c.jsx(Ct,{value:u,onChange:b=>f(b.target.value),onPressEnter:()=>y(u),addonAfter:c.jsx(Oe,{size:"small",type:"text",onClick:()=>y(u),children:"Go"})})}),m&&c.jsxs("div",{children:[c.jsx("div",{className:"file-browser-parent-row",children:c.jsxs(Oe,{size:"small",onClick:()=>y(m.parentPath),disabled:m.currentPath===m.parentPath,children:[c.jsx(ec,{}),"Parent Directory"]})}),c.jsx("div",{className:"file-browser-list",children:m.subdirectories.length===0&&(o!=="file"||(m.files||[]).length===0)?c.jsx("div",{className:"file-browser-empty",children:"No items found"}):c.jsxs(c.Fragment,{children:[m.subdirectories.map(b=>c.jsxs("div",{className:"file-browser-item",onClick:()=>y(b.fullPath),children:[c.jsxs("span",{children:[c.jsx(Fr,{className:"file-browser-icon"}),b.name]}),o==="directory"&&c.jsx(Oe,{size:"small",type:"link",onClick:C=>{C.stopPropagation(),r(b.fullPath)},children:"Select Folder"})]},b.fullPath)),o==="file"&&(m.files||[]).map(b=>c.jsxs("div",{className:"file-browser-item",onClick:()=>r(b.fullPath),children:[c.jsxs("span",{children:[c.jsx(Zs,{className:"file-browser-icon"}),b.name]}),c.jsx(Oe,{size:"small",type:"link",onClick:C=>{C.stopPropagation(),r(b.fullPath)},children:"Select File"})]},b.fullPath))]})}),o==="directory"&&c.jsx("div",{className:"file-browser-confirm-row",children:c.jsxs(Oe,{type:"primary",onClick:()=>r(m.currentPath),children:["Confirm Path: ",m.currentPath]})})]})]})})}const{Text:Dc}=xn,Tm=(e,t)=>`${e}:${t}`,Rye=()=>c.jsx("div",{style:{width:"0.8em",height:"0.8em",backgroundColor:"rgba(0,0,0,0.88)"}});function Iye({form:e,editing:t,executor:n,running:r,errorCounts:a={},packageScripts:o,onRun:s,onRunInstall:u,onRunPackage:f,onStop:m,onLogs:h,onPackageLogs:p}){const v=!!(t&&[...r].some(C=>C.startsWith(`${t.id}:`))),[y,b]=l.useState(()=>v);return l.useEffect(()=>{v&&b(!0)},[t==null?void 0:t.id]),l.useEffect(()=>{v||b(!1)},[v]),c.jsx(wt.List,{name:"scripts",children:(C,{add:x,remove:w})=>{const $=["npm","pnpm","yarn"].includes(n)?{id:"install",name:"Install",command:`${n} install${n==="npm"?" --legacy-peer-deps":""}`}:null,E=[...C.map(O=>({...O,key:`custom-${O.key}`,kind:"custom"})),...$?[{key:"install",kind:"install",script:$}]:[],...(o||[]).map(O=>({key:`package-${O.id}`,kind:"package",script:O}))],R=y?E.filter(O=>{const I=O.kind==="custom"?e.getFieldValue(["scripts",O.name]):O.script;return t&&(I==null?void 0:I.id)&&r.has(Tm(t.id,I.id))}):E,N=[{title:"Source",width:100,render:(O,I)=>c.jsx($t,{color:I.kind==="package"?"purple":I.kind==="install"?"green":"default",children:I.kind==="package"?"Package":I.kind==="install"?"Executor":"Custom"})},{title:"Script name",width:200,render:(O,I)=>{var z;const j=I.kind==="custom"?e.getFieldValue(["scripts",I.name]):I.script,M=(j==null?void 0:j.name)===e.getFieldValue("startCommand"),T=t&&(j==null?void 0:j.id)&&r.has(Tm(t.id,j.id));return c.jsxs(ct,{direction:"vertical",size:1,style:{width:"100%"},children:[I.kind!=="custom"||T?c.jsxs(ct,{size:4,children:[c.jsx(Dc,{strong:!0,children:(j==null?void 0:j.name)||((z=I.script)==null?void 0:z.name)}),M&&c.jsx(qo,{className:"start-script-icon"})]}):c.jsx(wt.Item,{noStyle:!0,name:[I.name,"name"],rules:[{required:!0,message:"Required"}],children:c.jsx(Ct,{placeholder:"serve",allowClear:!0,suffix:M?c.jsx(qo,{className:"start-script-icon"}):null})}),T&&c.jsx(sa,{status:"success",text:c.jsx(Dc,{type:"secondary",style:{fontSize:11},children:"running"})})]})}},{title:"Command",render:(O,I)=>{const j=I.kind==="custom"?e.getFieldValue(["scripts",I.name]):I.script,M=t&&(j==null?void 0:j.id)&&r.has(Tm(t.id,j.id));return I.kind==="package"?c.jsxs(ct,{direction:"vertical",size:0,children:[c.jsxs(Dc,{code:!0,children:[n," run ",I.script.name]}),c.jsx(Dc,{type:"secondary",style:{fontSize:12},children:I.script.command})]}):I.kind==="install"?c.jsx(Dc,{code:!0,children:I.script.command}):M?c.jsx(Dc,{code:!0,children:j==null?void 0:j.command}):c.jsx(wt.Item,{noStyle:!0,name:[I.name,"command"],rules:[{required:!0,message:"Required"}],children:c.jsx(Ct,{placeholder:"npm run dev",allowClear:!0})})}},{title:"Actions",width:132,render:(O,I)=>{const j=I.kind==="custom"?e.getFieldValue(["scripts",I.name]):I.script,M=t&&(j==null?void 0:j.id)&&r.has(Tm(t.id,j.id)),T=t&&(j!=null&&j.id)&&a[Tm(t.id,j.id)]||0;return c.jsxs(ct,{size:2,children:[t&&c.jsx(yn,{title:M?"Stop":"Start",children:c.jsx(Oe,{type:"text",danger:M,icon:M?c.jsx(Rye,{}):c.jsx(h0e,{}),onClick:()=>M?m(j):I.kind==="package"?f(j):I.kind==="install"?u(j):s(j),disabled:!(j!=null&&j.id)})}),c.jsx(yn,{title:"Logs",children:c.jsx(sa,{count:T,size:"small",offset:[-2,2],children:c.jsx(Oe,{type:"text",icon:c.jsx(Ui,{}),onClick:()=>I.kind==="package"?p(j):h(j),disabled:!t||!(j!=null&&j.id)})})}),I.kind==="custom"&&c.jsx(yn,{title:"Remove",children:c.jsx(Oe,{type:"text",danger:!0,icon:c.jsx(Fn,{}),onClick:()=>w(I.name),disabled:!!M})})]})}}];return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"script-header",children:[c.jsx(lp,{orientation:"left",children:"Scripts"}),c.jsxs(ct,{size:"middle",align:"center",children:[c.jsxs("label",{className:"script-running-filter",children:[c.jsx(Ja,{size:"small",checked:y,onChange:b,disabled:!t}),c.jsx(Dc,{type:"secondary",className:"script-running-filter-label",children:"Show running only"})]}),c.jsx(Oe,{icon:c.jsx(Xn,{}),onClick:()=>{b(!1),x({name:"",command:""})},children:"Add script"})]})]}),c.jsx(ar,{size:"small",rowKey:"key",pagination:!1,loading:o===null,dataSource:R,columns:N})]})}})}const kye=e=>c.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor",style:{verticalAlign:"-0.125em",...e.style},...e,children:c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M.75 2.5a.75.75 0 01.742-.647h21.016a.75.75 0 01.742.853l-2.622 17.5a.75.75 0 01-.742.644H4.114a.75.75 0 01-.742-.644L.75 2.5zm13.1 11.2h-3.7l-.76-3.8h5.22l-.76 3.8z"})});function Mye(e){if(!e)return null;const t=e.toLowerCase();return t.includes("bitbucket")?c.jsx(kye,{style:{color:"#2584FF"}}):t.includes("github")?c.jsx(Sve,{style:{color:"#24292e"}}):t.includes("gitlab")?c.jsx(C0,{style:{color:"#fc6d26"}}):c.jsx(kf,{className:"repo-generic-icon"})}function W9({repoUrl:e,style:t}){if(!e)return null;const n=Mye(e);return n?c.jsx(yn,{title:"Open repository in browser",children:c.jsx(Oe,{className:"repo-icon-button",type:"text",size:"small",icon:n,onClick:r=>{r.preventDefault(),r.stopPropagation(),hr(e)},style:t})}):null}const Tye=()=>({alias:"",folder:"",groupName:"",executor:"npm",startCommand:void 0,scripts:[]});function Pye({open:e,editing:t,groups:n,running:r,errorCounts:a={},onCancel:o,onSave:s,onRun:u,onRunInstall:f,onRunPackage:m,onStop:h,onLogs:p,onDelete:v}){const{message:y,modal:b}=Pr.useApp(),[C]=wt.useForm(),[x,w]=l.useState(null),[$,E]=l.useState(!1),R=l.useRef(null),N=()=>{const T=document.querySelector(".service-modal.is-editing"),z=T==null?void 0:T.querySelector(".ant-modal-body"),P=T==null?void 0:T.closest(".ant-modal-wrap");R.current=[z,P].filter(Boolean).map(B=>({element:B,top:B.scrollTop}))};l.useLayoutEffect(()=>{const T=R.current;T&&(T.forEach(({element:z,top:P})=>{z.isConnected&&(z.scrollTop=P)}),R.current=null)},[x]);const O=T=>{if(T&&(C.setFieldValue("folder",T),!C.getFieldValue("alias"))){const P=T.split(/[/\\]/).filter(Boolean);P.length>0&&C.setFieldValue("alias",P[P.length-1])}E(!1)},I=async()=>{const T=String(C.getFieldValue("folder")||"").trim();if(!T){y.warning("Set a project folder first.");return}try{await Wn.openFolder(T)}catch(z){y.error(z.message)}},j=()=>{b.confirm({title:"Delete Service",content:`Are you sure you want to delete service "${t==null?void 0:t.alias}"?`,okText:"Delete",okButtonProps:{type:"primary",danger:!0},cancelText:"Cancel",onOk:async()=>{try{await v(t)}catch(T){y.error(T.message)}}})};l.useEffect(()=>{e&&(C.resetFields(),C.setFieldsValue(t?{...t,startCommand:t.startCommand||void 0,scripts:t.scripts}:Tye()),w(t?null:[]),t&&Br.packageScripts(t.id).then(T=>{N(),w(T.scripts)}).catch(()=>{N(),w([])}))},[e,t==null?void 0:t.id,C]);const M=async()=>{try{const T=(C.getFieldValue("scripts")||[]).filter(B=>{var H,A;return((H=B==null?void 0:B.name)==null?void 0:H.trim())||((A=B==null?void 0:B.command)==null?void 0:A.trim())});C.setFieldValue("scripts",T);const z=await C.validateFields(["alias","folder","groupName","startCommand"]),P={...C.getFieldsValue(!0),...z,scripts:T};await s(P)}catch(T){if(T!=null&&T.errorFields)return;y.error(T.message)}};return c.jsxs(bn,{className:`service-modal${t?" is-editing":""}`,title:t?c.jsxs(ct,{align:"center",size:6,children:[c.jsxs("span",{children:["Service details · ",t.alias]}),c.jsx(W9,{repoUrl:t.repoUrl})]}):"Add service",open:e,onCancel:o,onOk:M,okText:t?"Save":"Save service",width:860,destroyOnClose:!0,footer:c.jsxs("div",{className:"service-modal-footer",children:[t?c.jsx(Oe,{type:"primary",danger:!0,onClick:j,children:"Delete service"}):c.jsx("div",{}),c.jsxs(ct,{children:[c.jsx(Oe,{onClick:o,children:"Cancel"}),c.jsx(Oe,{type:"primary",onClick:M,children:t?"Save":"Save service"})]})]}),children:[c.jsxs(wt,{form:C,layout:"vertical",children:[c.jsx(J0,{className:"service-config",defaultActiveKey:t?[]:["configuration"],items:[{key:"configuration",label:"Service configuration",children:c.jsxs(Uo,{gutter:[16,0],children:[c.jsx(qn,{xs:24,sm:12,children:c.jsx(wt.Item,{label:"Name",name:"alias",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"Service name",allowClear:!0})})}),c.jsx(qn,{xs:24,sm:12,children:c.jsx(wt.Item,{label:"Project folder",name:"folder",rules:[{required:!0}],children:c.jsx(Ct,{prefix:c.jsx(Oe,{type:"text",htmlType:"button",icon:c.jsx(Fr,{}),onClick:I,"aria-label":"Open project folder",title:"Open project folder",style:{color:"#8c8c8c",padding:"0 4px"}}),suffix:c.jsx(Oe,{type:"text",size:"small",icon:c.jsx(Fr,{}),onClick:()=>E(!0),style:{fontSize:12,padding:"0 4px"},children:"Browse"}),placeholder:"Project folder path",allowClear:!0})})}),c.jsx(qn,{xs:24,sm:8,children:c.jsx(wt.Item,{label:"Group",name:"groupName",children:c.jsx(rf,{options:n.map(T=>({value:T})),placeholder:"Group name",allowClear:!0})})}),c.jsx(qn,{xs:24,sm:8,children:c.jsx(wt.Item,{label:"Executor",name:"executor",rules:[{required:!0}],children:c.jsx(rf,{options:["npm","pnpm","yarn"].map(T=>({value:T})),placeholder:"npm",allowClear:!0})})}),c.jsx(qn,{xs:24,sm:8,children:c.jsx(wt.Item,{noStyle:!0,shouldUpdate:(T,z)=>T.scripts!==z.scripts,children:()=>{const T=(C.getFieldValue("scripts")||[]).map(B=>B==null?void 0:B.name).filter(Boolean),z=(x||[]).map(B=>B.name),P=[...new Set([...T,...z])].map(B=>({label:B,value:B}));return c.jsx(wt.Item,{label:"Start script name",name:"startCommand",children:c.jsx($n,{placeholder:"Select start script",allowClear:!0,options:P})})}})})]})}]}),c.jsx(wt.Item,{noStyle:!0,shouldUpdate:(T,z)=>T.executor!==z.executor||T.startCommand!==z.startCommand||T.scripts!==z.scripts,children:()=>c.jsx(Iye,{form:C,editing:t,executor:C.getFieldValue("executor")||"npm",running:r,errorCounts:a,packageScripts:x,onRun:T=>u(t,T),onRunInstall:()=>f(t),onRunPackage:T=>m(t,T),onStop:T=>h(t,T.id),onLogs:T=>p(t,T),onPackageLogs:T=>p(t,T,!0)})})]}),c.jsx(df,{open:$,initialPath:C.getFieldValue("folder")||"~",onCancel:()=>E(!1),onSelect:O,title:"Select Project Directory"})]})}const{Text:Dye}=xn;function zye({open:e,editingGroupTask:t,groupCatalog:n,onCancel:r,onSave:a}){const{message:o}=Pr.useApp(),[s]=wt.useForm();l.useEffect(()=>{e&&(s.resetFields(),s.setFieldsValue({name:(t==null?void 0:t.name)||"",items:(t==null?void 0:t.items.map(m=>`${m.launcherId}|${m.scriptId}`))||[]}))},[e,t,s]);const u=l.useMemo(()=>Object.entries(n.reduce((m,h)=>{const p=h.groupName||"Ungrouped";return(m[p]||(m[p]=[])).push(h),m},{})).sort(([m],[h])=>m.localeCompare(h)).map(([m,h])=>({key:m,label:m,children:c.jsx("div",{className:"group-task-projects",children:h.map(p=>c.jsx(It,{size:"small",title:p.alias,children:c.jsx(ct,{direction:"vertical",children:p.scripts.map(v=>c.jsxs(tr,{value:`${p.id}|${v.id}`,children:[v.name," ",c.jsxs(Dye,{type:"secondary",children:["(",v.source,")"]})]},v.id))})},p.id))})})),[n]),f=async()=>{try{const m=await s.validateFields(),h={name:m.name,items:m.items.map(p=>{const[v,y]=p.split("|");return{launcherId:v,scriptId:y}})};await a(h)}catch(m){m!=null&&m.errorFields||o.error(m.message)}};return c.jsx(bn,{title:t?`Edit quick launch · ${t.name}`:"Add quick launch",open:e,onCancel:r,onOk:f,okText:t?"Save changes":"Save quick launch",width:760,destroyOnClose:!0,children:c.jsxs(wt,{form:s,layout:"vertical",children:[c.jsx(wt.Item,{label:"Name",name:"name",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"Start local stack",allowClear:!0})}),c.jsx(wt.Item,{label:"Scripts",name:"items",rules:[{required:!0,message:"Select at least one script."}],children:c.jsx(tr.Group,{className:"group-task-selector",children:c.jsx(Qa,{items:u})})})]})})}const fI={30:"ansi-black",31:"ansi-red",32:"ansi-green",33:"ansi-yellow",34:"ansi-blue",35:"ansi-magenta",36:"ansi-cyan",37:"ansi-white",90:"ansi-gray",91:"ansi-red",92:"ansi-green",93:"ansi-yellow",94:"ansi-blue",95:"ansi-magenta",96:"ansi-cyan",97:"ansi-white"},w0=()=>{const e=window.getSelection();return!e||e.isCollapsed||!e.toString()?!1:[e.anchorNode,e.focusNode].some(t=>{var r;const n=(t==null?void 0:t.nodeType)===Node.ELEMENT_NODE?t:t==null?void 0:t.parentElement;return(r=n==null?void 0:n.closest)==null?void 0:r.call(n,".log-output")})};function Xw({value:e,editor:t,className:n="",onScroll:r}){const[a,o]=l.useState(t||"vscode"),[s,u]=l.useState(""),[f,m]=l.useState("");l.useEffect(()=>{t&&o(t),Wn.status().then(C=>{C!=null&&C.defaultEditor&&!t&&o(C.defaultEditor),C!=null&&C.domain&&u(C.domain),C!=null&&C.jiraIssuePrefix&&m(C.jiraIssuePrefix)}).catch(()=>{})},[t]);const h=(f||"").split(/[\s,]+/).filter(Boolean).map(C=>C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),p=h.length>0&&s?new RegExp(`\\b(?:${h.join("|")})-[a-zA-Z0-9]{1,10}\\b`,"gi"):null,v=(C,x)=>{let w="";const $=(O,I)=>O.split(/(\u001b\[[0-9;]*m)/g).map((M,T)=>{const z=M.match(/^\u001b\[([0-9;]*)m$/);if(z){const B=z[1].split(";").map(Number);return w=B.includes(0)?"":fI[B.find(H=>fI[H])]||w,null}if(!M)return null;const P=w||(/\b(error|failed|fatal|exception|TS\d{4,5})\b/i.test(M)?"log-error":/\b(warn|warning)\b/i.test(M)?"log-warning":/\b(success|ready|started|listening)\b/i.test(M)?"log-success":"");return c.jsx("span",{className:P,children:M},`${I}-${T}`)}),E=/(https?:\/\/(?:[^\s<>'"`]|\u001b\[[0-9;]*m)+|\/(?:(?:[^\s:(),;!?]|\u001b\[[0-9;]*m)+\/)*(?:[^\s:(),;!?]|\u001b\[[0-9;]*m)+(?::(?:\d+|\u001b\[[0-9;]*m)+(?::(?:\d+|\u001b\[[0-9;]*m)+)?)?)/g,R=p&&p.test(C);return!C.includes("http")&&!C.includes("/")&&!R?$(C,`${x}-0`):C.split(E).map((O,I)=>{if(!O)return null;const j=`${x}-${I}`;if(/^https?:\/\//.test(O.replace(/\u001b\[[0-9;]*m/g,""))){const T=O.replace(/\u001b\[[0-9;]*m/g,""),z=T.replace(/[),.;:!?]+$/,""),P=T.slice(z.length);return c.jsxs("span",{children:[c.jsx("a",{className:"log-link",href:z,target:"_blank",rel:"noreferrer",onClick:B=>{B.preventDefault(),hr(z)},children:$(O.slice(0,O.length-P.length),`${j}-url`)}),P&&$(P,`${j}-suf`)]},j)}const M=O.replace(/\u001b\[[0-9;]*m/g,"");if(M.startsWith("/")){const[,T,z=""]=M.match(/^(.*?)(:\d+(?::\d+)?)?$/)||[];if(T){const P=U9(a,T,z);return c.jsx("a",{className:"log-link",href:P,target:"_blank",rel:"noreferrer",title:`Open in ${V9(a)}`,children:$(O,j)},j)}}if(p&&s&&(p.lastIndex=0,p.test(M))){const T=[];let z=0;p.lastIndex=0;for(const P of M.matchAll(p)){P.index>z&&T.push($(M.slice(z,P.index),`${j}-sub-${P.index}`));const B=P[0],H=Ly(s,B);T.push(c.jsx("a",{className:"log-link",href:H,target:"_blank",rel:"noreferrer",onClick:A=>{A.preventDefault(),hr(H)},children:B},`${j}-jira-${P.index}`)),z=P.index+B.length}return z<M.length&&T.push($(M.slice(z),`${j}-sub-end`)),c.jsx("span",{children:T},j)}return $(O,j)})},y=C=>{C.preventDefault(),C.stopPropagation()},b=C=>{C.metaKey||C.ctrlKey||C.altKey||["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown","Shift","Tab","Escape"].includes(C.key)||C.preventDefault()};return c.jsx("div",{className:`log-output ${n}`.trim(),role:"log",contentEditable:!0,suppressContentEditableWarning:!0,onBeforeInput:y,onPaste:y,onDrop:y,onKeyDown:b,onMouseDown:C=>C.stopPropagation(),onScroll:r,children:e.split(`
497
497
  `).map((C,x)=>c.jsx("div",{className:"log-line",children:c.jsx("code",{children:v(C,x)})},x))})}function Aye({open:e,logTarget:t,onCancel:n}){var v;const[r,a]=l.useState("output"),[o,s]=l.useState(""),[u,f]=l.useState(!0),m=l.useRef(0);l.useEffect(()=>{e&&(a("output"),s("Loading…"))},[e,t]),l.useEffect(()=>{if(!u)return;const y=document.querySelector(".logs-modal .ant-tabs-tabpane-active .log-output");if(y){const b=y.scrollHeight-y.clientHeight;m.current=b,y.scrollTop=b}},[o,r,u]);const h=y=>{const{scrollTop:b}=y.currentTarget;u&&b<m.current-1&&f(!1),m.current=b};l.useEffect(()=>{if(!e||!t)return;const y=async()=>{if(!w0())try{const C=t.package?r==="error"?await Br.packageScriptErrorLogs(t.launcher.id,t.script.name):await Br.packageScriptLogs(t.launcher.id,t.script.name):r==="error"?await Br.errorLogs(t.launcher.id,t.script.id):await Br.logs(t.launcher.id,t.script.id);w0()||s(C.log||(r==="error"?"No error logs yet.":"No logs yet."))}catch(C){s(C.message)}};y();const b=setInterval(y,1e3);return()=>clearInterval(b)},[e,t,r]);const p=async()=>{if(t)try{t.package?await Br.clearPackageScriptLogs(t.launcher.id,t.script.name):await Br.clearLogs(t.launcher.id,t.script.id),s(r==="error"?"No error logs yet.":"No logs yet.")}catch{}};return c.jsx(bn,{title:t?`${(v=t.launcher)!=null&&v.alias?`${t.launcher.alias} / `:""}${t.script.name} · Logs`:"Logs",open:e,onCancel:n,footer:null,width:1080,zIndex:1200,className:"logs-modal",maskClosable:!1,children:c.jsx(Qa,{activeKey:r,onChange:a,tabBarExtraContent:t&&c.jsxs(ct,{children:[c.jsx(tr,{checked:u,onChange:y=>f(y.target.checked),children:"Auto-scroll"}),c.jsx(Oe,{icon:c.jsx(M9,{}),onClick:p,children:"Clear log"}),c.jsx(Oe,{icon:c.jsx(kf,{}),onClick:()=>{const y=t.package?`#/logs/${t.launcher.id}/pkg/${encodeURIComponent(t.script.name)}`:`#/logs/${t.launcher.id}/${encodeURIComponent(t.script.id)}`;window.open(y,"_blank")},children:"Open in new tab"})]}),items:[{key:"output",label:"Logs",children:c.jsx(Xw,{value:o,onScroll:h})},{key:"error",label:"Error logs",children:c.jsx(Xw,{value:o,onScroll:h})}]})})}const{Text:mI}=xn,_ye=(e,t)=>{const n=e.scripts.find(r=>r.id===t);return n?n.name:t==="install"?"Install":t.startsWith("package:")?t.slice(8):t};function Lye({launchers:e,running:t,errorCounts:n={},refresh:r,loading:a,initialRunningOnly:o=!1,initialServiceId:s=null}){const{message:u}=Pr.useApp(),[f,m]=l.useState("all"),[h,p]=l.useState(o),v=ae=>{p(ae);const[ge,Re=""]=(window.location.hash||"#/launcher").slice(2).split("?"),_e=new URLSearchParams(Re);ae?_e.set("running","1"):_e.delete("running");const ie=_e.toString();window.location.hash=`#/${ge||"launcher"}${ie?`?${ie}`:""}`};l.useEffect(()=>{p(o)},[o]);const[y,b]=l.useState([]),[C,x]=l.useState([]),[w,$]=l.useState(!1),[E,R]=l.useState(!1),[N,O]=l.useState(null),[I,j]=l.useState(!1),[M,T]=l.useState(null),[z,P]=l.useState(!1),[B,H]=l.useState(null),[A,L]=l.useState("vscode"),F=l.useRef(null),U=l.useRef(null);l.useEffect(()=>{Ei.list().then(b).catch(ae=>u.error(ae.message)),Wn.status().then(ae=>{ae!=null&&ae.defaultEditor&&L(ae.defaultEditor)}).catch(()=>{})},[]);const q=l.useMemo(()=>[...new Set(e.map(ae=>ae.groupName).filter(Boolean))].sort((ae,ge)=>ae.localeCompare(ge)),[e]),_=ae=>[...t].some(ge=>ge.startsWith(`${ae.id}:`)),K=e.filter(ae=>(f==="all"||ae.groupName===f)&&(!h||_(ae)));l.useLayoutEffect(()=>{var ge;[...((ge=F.current)==null?void 0:ge.querySelectorAll("[tabindex]"))||[],...document.querySelectorAll(".launcher-table, .launcher-table [tabindex]")].forEach(Re=>{document.activeElement===Re&&Re.blur(),Re.tabIndex=-1})},[f,q,e.length]);const X=(ae=null)=>{T(ae),j(!0)};l.useEffect(()=>{if(!s){U.current=null;return}if(String(U.current)===String(s))return;const ae=e.find(ge=>String(ge.id)===String(s));ae&&(U.current=s,X(ae))},[s,e]);const V=()=>{j(!1);const[ae,ge=""]=(window.location.hash||"#/launcher").slice(2).split("?"),Re=new URLSearchParams(ge);if(!Re.has("service"))return;Re.delete("service");const _e=Re.toString();window.location.hash=`#/${ae||"launcher"}${_e?`?${_e}`:""}`},W=async ae=>{if(M){const ge=await Br.update(M.id,ae);T(ge)}else await Br.create(ae),j(!1);u.success("Saved"),await r()},G=async ae=>{try{const ge=[...t].filter(Re=>Re.startsWith(`${ae.id}:`));if(ge.length>0){const Re=ge.map(_e=>_e.slice(`${ae.id}:`.length));await Promise.all(Re.map(_e=>Br.stop(ae.id,_e)))}await Br.remove(ae.id),j(!1),u.success("Deleted"),await r()}catch(ge){u.error(ge.message)}},Y=async(ae,ge)=>{try{await Br.run(ae.id,ge.id),await r()}catch(Re){u.error(Re.message)}},te=async ae=>{try{await Br.runInstall(ae.id),await r()}catch(ge){u.error(ge.message)}},ne=async(ae,ge)=>{try{await Br.runPackageScript(ae.id,ge.name),await r()}catch(Re){u.error(Re.message)}},ue=(ae,ge,Re=!1)=>{H({launcher:ae,script:ge,package:Re}),P(!0)},Z=async ae=>{try{await Br.start(ae.id),await r()}catch(ge){u.warning(ge.message)}},ee=async ae=>{try{await Br.openTerminal(ae.id)}catch(ge){u.error(ge.message)}},re=async(ae,ge)=>{ae.stopPropagation();try{await navigator.clipboard.writeText(ge),u.success(`Copied branch: ${ge}`)}catch(Re){u.error(Re.message||"Could not copy branch name.")}},oe=async(ae,ge)=>{try{await Br.stop(ae.id,ge),await r()}catch(Re){await r(),u.error(Re.message)}},de=async(ae,ge)=>{try{await Promise.all(ge.map(Re=>Br.stop(ae.id,Re))),await r()}catch(Re){await r(),u.error(Re.message)}},be=async(ae=null)=>{if(O(ae),R(!0),!C.length)try{x(await Ei.catalog())}catch(ge){u.error(ge.message)}},J=async ae=>{N?await Ei.update(N.id,ae):await Ei.create(ae),R(!1),b(await Ei.list())},ye=async ae=>{const ge=`group-task-${ae.id}`;u.loading({content:`Starting ${ae.name}…`,key:ge,duration:0});try{const Re=await Ei.start(ae.id),_e=Re.results.filter(ie=>ie.error);_e.length?u.warning({content:`${Re.results.length-_e.length} started, ${_e.length} failed.`,key:ge}):u.success({content:`${Re.results.length} scripts started.`,key:ge}),await r()}catch(Re){u.error({content:Re.message,key:ge})}},xe=async ae=>{const ge=`group-task-${ae.id}`;u.loading({content:`Stopping ${ae.name}…`,key:ge,duration:0});try{const _e=(await Ei.stop(ae.id)).results.filter(ie=>ie.ok).length;u.success({content:`${_e} scripts stopped.`,key:ge}),await r()}catch(Re){u.error({content:Re.message,key:ge})}},ze=async ae=>{try{await Ei.remove(ae.id),b(await Ei.list())}catch(ge){u.error(ge.message)}},he=async(ae,ge)=>{try{b(await Ei.move(ae.id,ge))}catch(Re){u.error(Re.message)}},ce=async ae=>{try{b(await Ei.reorder(ae))}catch(ge){u.error(ge.message)}},se=[{title:"Service",dataIndex:"alias",render:(ae,ge)=>c.jsxs(ct,{size:8,align:"center",children:[c.jsx(Oe,{type:"text",size:"small",className:"launcher-terminal-button",icon:c.jsx(wa,{}),"aria-label":`Open terminal in ${ge.folder}`,title:`Open Terminal in ${ge.folder}`,onClick:Re=>{Re.stopPropagation(),ee(ge)}}),c.jsx("a",{href:U9(A,ge.folder,"",{newWindow:!0}),title:`Open ${ge.folder} in ${V9(A)}`,onClick:Re=>{Re.preventDefault(),Re.stopPropagation(),_9.openPath(ge.folder)},className:"launcher-service-link",children:ae}),c.jsx(W9,{repoUrl:ge.repoUrl}),ge.branch&&c.jsx("button",{type:"button",className:"launcher-branch-button",title:"Copy branch name","aria-label":`Copy branch name ${ge.branch}`,onClick:Re=>re(Re,ge.branch),children:c.jsx(mI,{code:!0,className:"launcher-branch",children:ge.branch})})]})},{title:"Scripts",width:170,align:"center",render:(ae,ge)=>{const Re=[...t].filter(ke=>ke.startsWith(`${ge.id}:`)),_e=Re.map(ke=>_ye(ge,ke.slice(`${ge.id}:`.length))),ie=ge.scripts.length+(ge.packageScriptCount||0),fe=Object.entries(n).filter(([ke])=>ke.startsWith(`${ge.id}:`)).reduce((ke,[,Pe])=>ke+(Pe||0),0),we=c.jsx(sa,{status:Re.length?"success":"default",text:`${Re.length} / ${ie} running`});return c.jsxs(ct,{size:8,children:[c.jsxs("span",{className:"launcher-running-status",children:[we,_e.length>0&&c.jsx("span",{className:"launcher-running-tooltip",children:_e.map((ke,Pe)=>c.jsxs("span",{children:["• ",ke]},`${ke}-${Pe}`))})]}),fe>0&&c.jsx(sa,{count:fe,overflowCount:999,style:{backgroundColor:"#ff4d4f"}})]})}},{title:"Action",width:108,align:"center",render:(ae,ge)=>{const Re=[...t].filter(ie=>ie.startsWith(`${ge.id}:`)),_e=Re.length>0;return c.jsx(Oe,{size:"small",type:_e?"default":"primary",className:`launcher-service-action${_e?" launcher-running-button":""}`,icon:_e?c.jsx("span",{className:"launcher-stop-square"}):c.jsx(Kl,{}),onClick:ie=>{ie.stopPropagation(),_e?de(ge,Re.map(fe=>fe.slice(`${ge.id}:`.length))):Z(ge)},children:_e?"Stop":"Start"})}}];return c.jsxs(c.Fragment,{children:[c.jsx(Ur,{actions:c.jsxs(ct,{children:[c.jsx(Oe,{onClick:()=>$(!0),children:"Quick Launch"}),c.jsx(Oe,{type:"primary",icon:c.jsx(Xn,{}),onClick:()=>X(),children:"Add service"})]}),description:"Manage and run local project scripts.",title:"Launcher"}),a?c.jsx("div",{className:"launcher-loading",children:c.jsx(rr,{size:"large"})}):e.length?c.jsxs(c.Fragment,{children:[y.length>0&&c.jsxs("div",{className:"quick-launch-bar",children:[c.jsx("span",{className:"quick-launch-label",children:"Quick Launch"}),c.jsx(ct,{wrap:!0,size:"middle",children:y.map(ae=>{const ge=ae.items.every(Re=>t.has(`${Re.launcherId}:${Re.scriptId}`));return c.jsx(Oe,{type:ge?"default":"primary",className:`quick-launch-button${ge?" launcher-running-button":""}`,icon:ge?c.jsx("span",{className:"launcher-stop-square quick-launch-stop-icon"}):c.jsx(Kl,{className:"quick-launch-play-icon"}),onClick:()=>ge?xe(ae):ye(ae),children:ae.name},ae.id)})})]}),c.jsxs("div",{className:"launcher-tabs-row",children:[c.jsx("div",{ref:F,className:"launcher-tabs-wrap",children:c.jsx(Qa,{activeKey:f,onChange:m,className:"group-tabs",items:[{key:"all",label:`All (${e.length})`},...q.map(ae=>({key:ae,label:`${ae} (${e.filter(ge=>ge.groupName===ae).length})`}))]})}),c.jsxs("label",{className:"script-running-filter",children:[c.jsx(Ja,{size:"small",checked:h,onChange:v}),c.jsx(mI,{type:"secondary",className:"script-running-filter-label",children:"Show running only"})]})]}),K.length?c.jsx(ar,{className:"launcher-table",rowKey:"id",dataSource:K,columns:se,pagination:!1,onRow:ae=>({onClick:()=>X(ae)})},f):c.jsx(Xt,{description:"No services in this group."})]}):c.jsx(Xt,{description:"No services yet"}),c.jsx(Pye,{open:I,editing:M,groups:q,running:t,errorCounts:n,onCancel:V,onSave:W,onRun:Y,onRunInstall:te,onRunPackage:ne,onStop:oe,onLogs:ue,onDelete:G}),c.jsx(bn,{title:"Quick Launch",open:w,onCancel:()=>$(!1),footer:null,width:760,destroyOnClose:!0,children:c.jsx(Oye,{tasks:y,running:t,onCreate:()=>be(),onEdit:be,onStart:ye,onStop:xe,onRemove:ze,onMove:he,onReorder:ce})}),c.jsx(zye,{open:E,editingGroupTask:N,groupCatalog:C,onCancel:()=>R(!1),onSave:J}),c.jsx(Aye,{open:z,logTarget:B,onCancel:()=>P(!1)})]})}const{Text:Pl}=xn;function Bye({refreshLaunchers:e}){const[t,n]=l.useState([]),[r,a]=l.useState(!1),[o,s]=l.useState(null),[u,f]=l.useState(!1),[m,h]=l.useState(!1),[p,v]=l.useState(null),y=async()=>{a(!0);try{n((await PC.list()).ports)}catch(w){an.error(w.message)}finally{a(!1)}};l.useEffect(()=>{y()},[]);const b=async()=>{if(o){f(!0);try{const w=(await PC.get(o)).process;v(w),h(!0)}catch(w){an.error(w.message)}finally{f(!1)}}},C=async({port:w,pid:$})=>{try{await PC.kill(w,$),an.success(`Process on port ${w} was killed.`),await y(),e&&await e()}catch(E){an.error(E.message)}},x=[{title:"Port",dataIndex:"port",width:100,align:"center",onHeaderCell:()=>({className:"port-diagnostic-header-center"}),render:w=>c.jsx(Pl,{code:!0,children:w})},{title:"Last used",dataIndex:"launcher",render:(w,$)=>c.jsxs(ct,{direction:"vertical",size:0,children:[c.jsx(Pl,{strong:!0,children:w}),c.jsx(Pl,{type:"secondary",children:$.script})]})},{title:"Process",dataIndex:"command",render:(w,$)=>c.jsxs(ct,{direction:"vertical",size:0,children:[c.jsx(Pl,{code:!0,children:$.currentCommand||w}),c.jsxs(Pl,{type:"secondary",children:["PID ",$.currentPid||$.pid]})]})},{title:"Status",width:170,align:"center",onHeaderCell:()=>({className:"port-diagnostic-header-center"}),render:(w,$)=>$.ghost?c.jsx($t,{color:"error",children:"Ghost process"}):$.listening?c.jsx($t,{color:"success",children:"Script running"}):$.reused?c.jsx($t,{color:"warning",children:"Port reused"}):c.jsx($t,{children:"Port released"})},{title:"Action",width:100,align:"center",onHeaderCell:()=>({className:"port-diagnostic-header-center"}),render:(w,$)=>$.listening||$.reused?c.jsx(Gr,{title:`Kill process on port ${$.port}?`,description:"The process currently listening on this port will be stopped.",okText:"Kill",okButtonProps:{danger:!0},onConfirm:()=>C({port:$.port,pid:$.currentPid}),children:c.jsx(Oe,{type:"primary",danger:!0,icon:c.jsx(Fn,{}),children:"Kill"})}):c.jsx(Oe,{type:"primary",danger:!0,disabled:!0,icon:c.jsx(Fn,{}),children:"Kill"})}];return c.jsxs("div",{className:"port-diagnostic-page",children:[c.jsx(Ur,{actions:c.jsx(Oe,{icon:c.jsx(Xa,{}),onClick:y,loading:r,children:"Refresh"}),description:"Every port observed while a recent Launcher script was running. Ghost processes still listen after their script has stopped.",title:"Port Diagnostic"}),c.jsxs(It,{className:"port-manual-query",size:"small",children:[c.jsxs(ct,{wrap:!0,children:[c.jsx(Pl,{strong:!0,children:"Query port"}),c.jsx(cf,{min:1,max:65535,controls:!1,value:o,onChange:s,onPressEnter:b,placeholder:"e.g. 3000"}),c.jsx(Oe,{type:"primary",onClick:b,loading:u,disabled:!o,children:"Query"})]}),m&&c.jsx("div",{className:"port-query-result",children:p?c.jsxs(ct,{wrap:!0,children:[c.jsx($t,{color:"success",children:"Listening"}),c.jsxs(Pl,{code:!0,children:["PID ",p.pid]}),c.jsx(Pl,{code:!0,children:p.command}),c.jsx(Gr,{title:`Kill process on port ${p.port}?`,description:"The process currently listening on this port will be stopped.",okText:"Kill",okButtonProps:{danger:!0},onConfirm:()=>C(p),children:c.jsx(Oe,{type:"primary",danger:!0,icon:c.jsx(Fn,{}),children:"Kill"})})]}):c.jsxs(Pl,{type:"secondary",children:["No process is listening on port ",o,"."]})})]}),c.jsx(ar,{className:"port-diagnostic-table",rowKey:w=>`${w.startedAt}-${w.port}-${w.pid}`,loading:r,dataSource:t,columns:x,pagination:!1,locale:{emptyText:c.jsx(Xt,{description:"No ports have been observed from Launcher scripts yet."})}})]})}const{Title:ji,Paragraph:Ni,Text:Ln}=xn,Kv=[{id:"bitbucket",label:"Bitbucket"},{id:"jira",label:"Jira"},{id:"confluence",label:"Confluence"}],Pm=(e=0)=>{if(e===0)return"0 B";const t=["B","KB","MB","GB","TB"],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1);return`${(e/1024**n).toFixed(n===0?0:1)} ${t[n]}`},hI=e=>{const t=String((e==null?void 0:e.url)||"").trim().replace(/\/+$/,"");return t==="/pages/welcome"||t==="/pages/welcome/index.html"},ch=["domain","aiApiHost","jiraIssuePrefix","defaultEditor","defaultBrowser",...Kv.map(({id:e})=>e)],_C=(e={})=>Object.fromEntries(ch.map(t=>[t,String(e[t]??"")])),Hye=(e,t)=>ch.filter(n=>String(e[n]??"")!==String(t[n]??"")).length;function Fye({theme:e,onThemeChange:t,onStaticPagesChange:n}){var Pe,Ie,Ve,Le;const[r]=wt.useForm(),[a]=wt.useForm(),[o,s]=l.useState({}),[u,f]=l.useState(!1),[m,h]=l.useState(!1),[p,v]=l.useState(0),[y,b]=l.useState(null),[C,x]=l.useState(!0),[w,$]=l.useState(!1),[E,R]=l.useState(!1),[N,O]=l.useState(!1),[I,j]=l.useState(null),[M,T]=l.useState(!1),[z,P]=l.useState(""),[B,H]=l.useState(!1),[A,L]=l.useState(!1),F=l.useRef(null),U=l.useRef({}),[q,_]=l.useState([]),[K,X]=l.useState(!1),[V,W]=l.useState(!1),[G,Y]=l.useState(null),[te,ne]=l.useState(!1),[ue,Z]=l.useState(null),ee=async()=>{try{await Wn.openDataDir()}catch(je){an.error(je.message)}},re=async()=>{if(z)try{await Wn.openFolder(z)}catch(je){an.error(je.message)}},oe=async je=>{const $e=String(je||"").trim();if($e){H(!0);try{const Ae=await So.saveConfig($e);P(Ae.workspaceDir||$e),L(!1),an.success("Workspace directory saved.")}catch(Ae){an.error(Ae.message)}finally{H(!1)}}},de=async je=>{t==null||t(je);try{const $e=await Wn.saveTheme(je);s(Ae=>({...Ae,...$e}))}catch($e){t==null||t(e),an.error($e.message)}},be=async()=>{x(!0);try{b(await DC.stats())}catch(je){an.error(je.message)}finally{x(!1)}},J=async()=>{R(!0);try{const{blob:je,filename:$e}=await DC.export(),Ae=URL.createObjectURL(je),We=document.createElement("a");We.href=Ae,We.download=$e,document.body.appendChild(We),We.click(),We.remove(),setTimeout(()=>URL.revokeObjectURL(Ae),1e3),an.success("Data backup exported.")}catch(je){an.error(je.message)}finally{R(!1)}},ye=je=>{const[$e]=je.target.files||[];je.target.value="",$e&&(T(!1),j($e))},xe=async()=>{if(I){O(!0);try{const je=await DC.import(I);b(je),T(!0)}catch(je){an.error(je.message)}finally{O(!1)}}},ze=async()=>{try{const je=await Kc.list();_(je)}catch(je){an.error(je.message)}finally{X(!0)}},he=()=>{v(Hye(r.getFieldsValue(ch),U.current)),h(!1)};l.useEffect(()=>{Wn.status().then(je=>{s(je);const $e={domain:je.domain,aiApiHost:je.aiApiHost||"",jiraIssuePrefix:je.jiraIssuePrefix||"",defaultEditor:je.defaultEditor||"vscode",defaultBrowser:je.defaultBrowser||"chrome"};r.setFieldsValue($e),U.current=_C($e),v(0)}).catch(je=>an.error(je.message)),So.config().then(je=>P(je.workspaceDir||"")).catch(()=>{}),ze(),be()},[r]);const ce=je=>o[`${je}TokenConfigured`],se=async()=>{try{await r.validateFields(["domain","aiApiHost"]),f(!0);const je=r.getFieldsValue();if(je.domain!=null){const $e=await Wn.saveDomain(je.domain);s(Ae=>({...Ae,...$e})),r.setFieldValue("domain",$e.domain)}if(je.aiApiHost!=null){const $e=await Wn.saveAiApiHost(je.aiApiHost);s(Ae=>({...Ae,...$e})),r.setFieldValue("aiApiHost",$e.aiApiHost)}if(je.jiraIssuePrefix!=null){const $e=await Wn.saveJiraIssuePrefix(je.jiraIssuePrefix);s(Ae=>({...Ae,...$e})),r.setFieldValue("jiraIssuePrefix",$e.jiraIssuePrefix)}if(je.defaultEditor!=null){const $e=await Wn.saveDefaultEditor(je.defaultEditor);s(Ae=>({...Ae,...$e})),r.setFieldValue("defaultEditor",$e.defaultEditor)}if(je.defaultBrowser!=null){const $e=await Wn.saveDefaultBrowser(je.defaultBrowser);s(Ae=>({...Ae,...$e})),r.setFieldValue("defaultBrowser",$e.defaultBrowser)}for(const{id:$e}of Kv)if(je[$e]){const Ae=await Wn.saveAccessToken($e,je[$e]);s(We=>({...We,...Ae})),r.resetFields([$e])}U.current=_C(r.getFieldsValue(ch)),v(0),f(!1),h(!0),setTimeout(()=>h(!1),1500)}catch(je){f(!1),je!=null&&je.errorFields||an.error(je.message)}},ae=async je=>{try{const $e=await Wn.saveAccessToken(je,"");s($e),r.resetFields([je]),U.current=_C(r.getFieldsValue(ch)),v(0),an.success(`${Kv.find(Ae=>Ae.id===je).label} Access Token removed.`)}catch($e){an.error($e.message)}},ge=()=>{Y(null),a.resetFields(),W(!0)},Re=async()=>{const je="/pages/welcome";if(q.some(hI)){an.info("The test demo page is already added.");return}try{await Kc.create({name:"Welcome Demo",url:je}),an.success("Test demo page added."),await ze(),n==null||n()}catch($e){an.error($e.message)}},_e=je=>{Y(je),a.setFieldsValue({name:je.name,url:je.url}),W(!0)},ie=async je=>{try{await Kc.remove(je),an.success("Static page deleted."),await ze(),n==null||n()}catch($e){an.error($e.message)}},fe=async()=>{try{const je=await a.validateFields();ne(!0),G?(await Kc.update(G.id,je),an.success("Static page updated.")):(await Kc.create(je),an.success("Static page created.")),ne(!1),W(!1),await ze(),n==null||n()}catch(je){ne(!1),je!=null&&je.errorFields||an.error(je.message)}},we=je=>{var Ae,We;const $e=je.target.closest('a[href^="#settings-"]');if($e){if(je.preventDefault(),$e.getAttribute("href")==="#settings-dev-configurations"){(Ae=document.querySelector(".page"))==null||Ae.scrollTo({top:0,behavior:"smooth"});return}(We=document.getElementById($e.getAttribute("href").slice(1)))==null||We.scrollIntoView({behavior:"smooth",block:"start"})}},ke=[{id:"settings-dev-configurations",label:"Dev Configurations"},{id:"settings-error-logs",label:"Error Logs"},{id:"settings-appearance",label:"Appearance"},{id:"settings-default-applications",label:"Default Applications"},{id:"settings-workspace-directory",label:"Workspace Directory"},{id:"settings-data-directory",label:"Data Directory"},{id:"settings-static-pages",label:"Static Pages"},{id:"settings-access-tokens",label:"Access Tokens & Domain"}];return c.jsxs("div",{className:"settings-page",children:[c.jsx(Ur,{actions:c.jsx(Oe,{type:"primary",color:m?"green":"primary",variant:"solid",icon:m?c.jsx(Vl,{}):null,disabled:!m&&(u||p===0),loading:!m&&u,onClick:se,children:m?"Saved":p?`Save (${p})`:"Save"}),className:"settings-page-header",description:"Customize DevBuddy, manage integrations, and maintain your workspace data.",title:"Settings"}),c.jsxs("div",{className:"settings-layout",children:[c.jsx("nav",{className:"settings-section-nav","aria-label":"Settings sections",onClick:we,children:ke.map((je,$e)=>{const Ae=ue==null?99:Math.abs($e-ue),We=ue==null?12:Math.max(12,52-Ae*10),De=ue===$e;return c.jsxs("a",{href:`#${je.id}`,"aria-label":je.label,className:De?"is-active":"",style:{"--nav-width":`${We}px`},onMouseEnter:()=>Z($e),onMouseLeave:()=>Z(null),onFocus:()=>Z($e),onBlur:()=>Z(null),children:[c.jsx("span",{className:`settings-section-nav-preview ${De?"is-visible":""}`,children:je.label}),je.label]},je.id)})}),c.jsxs("div",{className:"settings-content",children:[c.jsx(It,{id:"settings-dev-configurations",className:"settings-card settings-card-spaced settings-dev-config-entry",children:c.jsxs("div",{className:"settings-title settings-title-actions",children:[c.jsx("div",{className:"settings-icon-wrap",children:c.jsx(e4,{className:"settings-icon"})}),c.jsxs("div",{className:"settings-title-copy",children:[c.jsx(ji,{level:4,children:"Dev Configurations"}),c.jsx(Ni,{type:"secondary",children:"Read and update your system-level npm and Git configuration, including Git SSH key settings."})]}),c.jsx(Oe,{onClick:()=>{window.location.hash="#/dev-configurations"},children:"Open"})]})}),c.jsx(It,{id:"settings-error-logs",className:"settings-card settings-card-spaced settings-dev-config-entry",children:c.jsxs("div",{className:"settings-title settings-title-actions",children:[c.jsx("div",{className:"settings-icon-wrap",children:c.jsx(uf,{className:"settings-icon"})}),c.jsxs("div",{className:"settings-title-copy",children:[c.jsx(ji,{level:4,children:"Error Logs"}),c.jsx(Ni,{type:"secondary",children:"Review application, launcher, and frontend errors captured by DevBuddy."})]}),c.jsx(Oe,{onClick:()=>{window.location.hash="#/errors"},children:"Open"})]})}),c.jsxs(wt,{form:r,layout:"vertical",onValuesChange:he,children:[c.jsxs(It,{id:"settings-appearance",className:"settings-card settings-card-spaced",children:[c.jsxs("div",{className:"settings-title",children:[c.jsx("div",{className:"settings-icon-wrap",children:c.jsx(aI,{className:"settings-icon"})}),c.jsxs("div",{children:[c.jsx(ji,{level:4,children:"Appearance"}),c.jsx(Ni,{type:"secondary",children:"Choose how DevBuddy looks. Theme changes are applied and saved immediately."})]})]}),c.jsxs("div",{className:"settings-appearance-row",children:[c.jsxs("div",{children:[c.jsx(Ln,{strong:!0,children:"Theme"}),c.jsx(Ln,{type:"secondary",className:"settings-appearance-hint",children:"Use the original dark navigation or the new bright workspace."})]}),c.jsx(sp,{"aria-label":"Application theme",value:e,onChange:de,options:[{label:"Dark",value:"dark",icon:c.jsx(n0e,{})},{label:"Light",value:"light",icon:c.jsx(aI,{})}]})]})]}),c.jsxs(It,{id:"settings-default-applications",className:"settings-card settings-card-spaced",children:[c.jsxs("div",{className:"settings-title",children:[c.jsx("div",{className:"settings-icon-wrap",children:c.jsx(wa,{className:"settings-icon"})}),c.jsxs("div",{children:[c.jsx(ji,{level:4,children:"Default Applications"}),c.jsx(Ni,{type:"secondary",children:"Choose your preferred editor and browser to open files, folders, and links."})]})]}),c.jsxs("div",{className:"token-settings-form",children:[c.jsxs("div",{className:"token-row",children:[c.jsxs("div",{className:"token-row-info",children:[c.jsx(Ln,{strong:!0,className:"token-row-name",children:"Default Editor"}),c.jsx(Ln,{type:"secondary",className:"token-row-hint",children:"VS Code, Devin, or IntelliJ IDEA"})]}),c.jsx(wt.Item,{name:"defaultEditor",children:c.jsx($n,{options:F9,className:"settings-app-select"})})]}),c.jsxs("div",{className:"token-row",children:[c.jsxs("div",{className:"token-row-info",children:[c.jsx(Ln,{strong:!0,className:"token-row-name",children:"Default Browser"}),c.jsx(Ln,{type:"secondary",className:"token-row-hint",children:"Choose your default browser"})]}),c.jsx(wt.Item,{name:"defaultBrowser",className:"settings-form-item-flush",children:c.jsx($n,{options:pye(o.isMac!==!1),className:"settings-app-select"})})]})]})]}),c.jsxs(It,{id:"settings-workspace-directory",className:"settings-card settings-card-spaced",children:[c.jsxs("div",{className:"settings-title",children:[c.jsx("div",{className:"settings-icon-wrap",children:c.jsx(Fr,{className:"settings-icon"})}),c.jsxs("div",{children:[c.jsx(ji,{level:4,children:"Workspace Directory"}),c.jsx(Ni,{type:"secondary",children:"Local workspace used by Package Upgrade and repository workflows."})]})]}),c.jsxs("div",{className:"token-row",children:[c.jsxs("div",{className:"token-row-info",children:[c.jsx(Ln,{strong:!0,className:"token-row-name",children:"Workspace Path"}),c.jsx(Ln,{type:"secondary",className:"token-row-hint",children:"Choose the local directory that contains your repositories"})]}),c.jsx("div",{className:"settings-data-path",children:c.jsxs(ct.Compact,{className:"directory-path-control",children:[c.jsx(Ct,{value:z,readOnly:!0,placeholder:"Not configured",prefix:c.jsx(Oe,{type:"text",icon:c.jsx(Fr,{}),onClick:re,disabled:!z||B,"aria-label":"Open workspace directory",title:"Open workspace directory"})}),c.jsx(Oe,{onClick:()=>L(!0),loading:B,children:"Browse"})]})})]})]}),c.jsx(df,{open:A,initialPath:z||"~",onCancel:()=>L(!1),onSelect:oe,title:"Select Workspace Directory"}),c.jsxs(It,{id:"settings-data-directory",className:"settings-card settings-card-spaced",children:[c.jsxs("div",{className:"settings-title",children:[c.jsx("div",{className:"settings-icon-wrap",children:c.jsx(Fr,{className:"settings-icon"})}),c.jsxs("div",{children:[c.jsx(ji,{level:4,children:"Data Directory"}),c.jsx(Ni,{type:"secondary",children:"Local directory where settings, logs, and application data are stored."})]})]}),c.jsxs("div",{className:"token-settings-form",children:[c.jsxs("div",{className:"token-row",children:[c.jsxs("div",{className:"token-row-info",children:[c.jsx(Ln,{strong:!0,className:"token-row-name",children:"Data Storage Path"}),c.jsx(Ln,{type:"secondary",className:"token-row-hint",children:"Directory location on your file system"})]}),c.jsx("div",{className:"settings-data-path",children:c.jsx(ct.Compact,{className:"directory-path-control directory-path-control-readonly",children:c.jsx(Ct,{value:o.dataDir||"",readOnly:!0,prefix:c.jsx(Oe,{type:"text",icon:c.jsx(Fr,{}),onClick:ee,disabled:!o.dataDir,"aria-label":"Open data directory",title:"Open data directory"})})})})]}),c.jsxs("div",{className:"token-row",children:[c.jsxs("div",{className:"token-row-info",children:[c.jsx(Ln,{strong:!0,className:"token-row-name",children:"Storage Usage"}),c.jsx(Ln,{type:"secondary",className:"token-row-hint",children:"Total size and file count inside the data directory"})]}),c.jsxs("div",{className:"settings-data-usage",children:[c.jsx(Age,{}),c.jsx(Ln,{strong:!0,children:C?"Calculating…":Pm(y==null?void 0:y.sizeBytes)}),!C&&c.jsxs(Ln,{type:"secondary",children:["· ",(y==null?void 0:y.fileCount)||0," files"]}),c.jsx(Oe,{type:"link",size:"small",onClick:()=>$(!0),children:"Details"}),c.jsx(Oe,{type:"link",size:"small",onClick:be,loading:C,children:"Refresh"})]})]}),c.jsxs("div",{className:"token-row",children:[c.jsxs("div",{className:"token-row-info",children:[c.jsx(Ln,{strong:!0,className:"token-row-name",children:"Backup & Restore"}),c.jsx(Ln,{type:"secondary",className:"token-row-hint",children:"Includes settings, access tokens, logs, clipboard files, and other local data"})]}),c.jsxs("div",{className:"settings-backup-actions",children:[c.jsx(Oe,{icon:c.jsx(ql,{}),loading:E,onClick:J,children:"Export Backup"}),c.jsx(Oe,{icon:c.jsx(S0,{}),loading:N,onClick:()=>{var je;return(je=F.current)==null?void 0:je.click()},children:"Import Backup"}),c.jsx("input",{ref:F,className:"settings-backup-input",hidden:!0,type:"file",accept:".tar.gz,.tgz,application/gzip",onChange:ye})]})]})]})]}),c.jsx(bn,{title:M?"Backup restored":"Import data backup?",open:!!I,onCancel:()=>!N&&(j(null),T(!1)),onOk:()=>M?window.location.reload():xe(),okText:M?"Reload DevBuddy":"Import Backup",okButtonProps:{danger:!M,loading:N},cancelText:"Cancel",closable:!N,maskClosable:!N,children:c.jsx("div",{className:"settings-import-confirm",children:M?c.jsxs("div",{className:"settings-import-complete",children:[c.jsx(Vl,{className:"settings-import-complete-icon"}),c.jsx(ji,{level:4,children:"Import completed successfully"}),c.jsx(Ni,{children:"Backup data has been restored. Reload DevBuddy to apply the restored settings and files."}),c.jsxs(Ln,{type:"secondary",children:[(y==null?void 0:y.importedFiles)||0," files imported."]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"settings-import-file-summary",children:[c.jsx(Ln,{type:"secondary",children:"Selected file"}),c.jsx(Ln,{strong:!0,children:I==null?void 0:I.name}),c.jsx(Ln,{type:"secondary",children:Pm((I==null?void 0:I.size)||0)})]}),c.jsx(Ni,{children:"This backup will be restored into the data directory. Matching files will be overwritten, while other existing files will be kept."}),c.jsx(Ln,{type:"warning",children:"Restart DevBuddy after importing so all restored settings take effect."})]})})}),c.jsxs(It,{id:"settings-static-pages",className:"settings-card settings-card-spaced",children:[c.jsxs("div",{className:"settings-title settings-title-actions",children:[c.jsx("div",{className:"settings-icon-wrap",children:c.jsx(kf,{className:"settings-icon"})}),c.jsxs("div",{className:"settings-title-copy",children:[c.jsx(ji,{level:4,children:"Static Pages"}),c.jsxs(Ni,{type:"secondary",children:["Configure static pages (configuration saved in data/static-pages.json). Static page files can be placed in pages/ or data/pages/ directory or use external URLs."," ",K&&!q.some(hI)&&c.jsx("a",{href:"#add-test-demo",onClick:je=>{je.preventDefault(),Re()},children:"Add test demo"})]})]}),c.jsx(Oe,{type:"primary",icon:c.jsx(Xn,{}),onClick:ge,children:"Add Static Page"})]}),c.jsx(ar,{dataSource:q,rowKey:"id",pagination:!1,size:"middle",columns:[{title:"Page Name",dataIndex:"name",key:"name",width:200},{title:"URL",dataIndex:"url",key:"url",render:je=>c.jsx("a",{href:je,target:"_blank",rel:"noreferrer",children:je})},{title:c.jsx("div",{className:"settings-action-column-title",children:"Action"}),key:"action",width:140,align:"right",render:(je,$e)=>c.jsxs(ct,{children:[c.jsx(Oe,{type:"link",size:"small",icon:c.jsx(Wo,{}),onClick:()=>_e($e),children:"Edit"}),c.jsx(Gr,{title:"Delete static page?",description:"Are you sure you want to delete this page?",onConfirm:()=>ie($e.id),okText:"Yes",cancelText:"No",children:c.jsx(Oe,{type:"link",danger:!0,size:"small",icon:c.jsx(Fn,{}),children:"Delete"})})]})}]})]}),c.jsxs(It,{id:"settings-access-tokens",className:"settings-card",children:[c.jsxs("div",{className:"settings-title",children:[c.jsx("div",{className:"settings-icon-wrap",children:c.jsx(Fve,{className:"settings-icon"})}),c.jsxs("div",{children:[c.jsx(ji,{level:4,children:"Access Tokens & Domain"}),c.jsx(Ni,{type:"secondary",children:"Tokens are stored locally and are never shown again."})]})]}),c.jsxs("div",{className:"token-settings-form",children:[c.jsxs("div",{className:"token-row",children:[c.jsxs("div",{className:"token-row-info",children:[c.jsx(Ln,{strong:!0,className:"token-row-name",children:"Domain"}),c.jsx(Ln,{type:"secondary",className:"token-row-hint",children:"e.g. abc.com"})]}),c.jsx(wt.Item,{name:"domain",rules:[{pattern:/^([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,message:"Enter a valid domain, e.g. abc.com"}],children:c.jsx(Ct,{placeholder:"abc.com",allowClear:!0})})]}),c.jsxs("div",{className:"token-row",children:[c.jsxs("div",{className:"token-row-info",children:[c.jsx(Ln,{strong:!0,className:"token-row-name",children:"AI API Host"}),c.jsx(Ln,{type:"secondary",className:"token-row-hint",children:"e.g. https://api.openai.com/v1"})]}),c.jsx(wt.Item,{name:"aiApiHost",rules:[{validator:(je,$e)=>{if(!$e)return Promise.resolve();try{const Ae=new URL($e);if(!["http:","https:"].includes(Ae.protocol)||!Ae.host)throw new Error;return Promise.resolve()}catch{return Promise.reject(new Error("Enter a valid HTTP(S) API host."))}}}],children:c.jsx(Ct,{placeholder:"https://api.openai.com/v1",allowClear:!0})})]}),c.jsxs("div",{className:"token-row",children:[c.jsxs("div",{className:"token-row-info",children:[c.jsx(Ln,{strong:!0,className:"token-row-name",children:"Jira Issue Prefix"}),c.jsx(Ln,{type:"secondary",className:"token-row-hint",children:"e.g. PROJ"})]}),c.jsx(wt.Item,{name:"jiraIssuePrefix",children:c.jsx(Ct,{placeholder:"PROJ",allowClear:!0})})]}),Kv.map(({id:je,label:$e})=>c.jsxs("div",{className:`token-row ${ce(je)?"is-configured":""}`,children:[c.jsxs("div",{className:"token-row-info",children:[c.jsxs("div",{className:"token-row-name-line",children:[c.jsx(Ln,{strong:!0,className:"token-row-name",children:$e}),ce(je)&&c.jsx($t,{color:"success",closable:!0,onClose:Ae=>{Ae.preventDefault(),ae(je)},className:"token-row-tag",children:"Configured"})]}),c.jsxs(Ln,{type:"secondary",className:"token-row-hint",children:[$e," API access token"]})]}),c.jsx(wt.Item,{name:je,children:c.jsx(Ct.Password,{placeholder:ce(je)?"Enter new token to replace":"Paste access token",autoComplete:"off",allowClear:!0})})]},je))]})]})]})]})]}),c.jsxs(bn,{className:"settings-storage-modal",title:"Storage Usage Details",open:w,onCancel:()=>$(!1),width:760,footer:[c.jsx(Oe,{onClick:be,loading:C,children:"Refresh Analysis"},"refresh"),c.jsx(Oe,{type:"primary",onClick:()=>$(!1),children:"Close"},"close")],children:[c.jsx(Ni,{type:"secondary",className:"settings-storage-description",children:"Size analysis for the DevBuddy data directory, grouped by top-level folder."}),c.jsxs("div",{className:"settings-storage-summary",children:[c.jsxs("div",{children:[c.jsx(Ln,{type:"secondary",children:"Total size"}),c.jsx(Ln,{strong:!0,children:C?"—":Pm(y==null?void 0:y.sizeBytes)})]}),c.jsxs("div",{children:[c.jsx(Ln,{type:"secondary",children:"Files"}),c.jsx(Ln,{strong:!0,children:C?"—":((y==null?void 0:y.fileCount)||0).toLocaleString()})]}),c.jsxs("div",{children:[c.jsx(Ln,{type:"secondary",children:"Storage groups"}),c.jsx(Ln,{strong:!0,children:C?"—":(((Pe=y==null?void 0:y.breakdown)==null?void 0:Pe.length)||0).toLocaleString()})]})]}),c.jsx(ji,{level:5,className:"settings-storage-section-title",children:"Breakdown"}),!C&&!((Ie=y==null?void 0:y.breakdown)!=null&&Ie.length)?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"The data directory is empty"}):c.jsx(ar,{className:"settings-storage-table",dataSource:(y==null?void 0:y.breakdown)||[],rowKey:"path",loading:C,pagination:!1,size:"small",scroll:((Ve=y==null?void 0:y.breakdown)==null?void 0:Ve.length)>6?{y:260}:void 0,columns:[{title:"Location",dataIndex:"name",key:"name",render:(je,$e)=>c.jsxs("span",{className:"settings-storage-location",children:[$e.path==="."?c.jsx(Zs,{}):c.jsx(lh,{}),c.jsx(Ln,{strong:!0,children:je})]})},{title:"Usage",key:"usage",width:250,render:(je,$e)=>{const Ae=y!=null&&y.sizeBytes?$e.sizeBytes/y.sizeBytes*100:0;return c.jsxs("div",{className:"settings-storage-usage-cell",children:[c.jsx(dp,{percent:Ae,showInfo:!1,size:"small"}),c.jsxs(Ln,{type:"secondary",children:[Ae<.1&&Ae>0?"<0.1":Ae.toFixed(1),"%"]})]})}},{title:"Size",dataIndex:"sizeBytes",key:"sizeBytes",width:90,align:"right",render:Pm},{title:"Files",dataIndex:"fileCount",key:"fileCount",width:75,align:"right",render:je=>je.toLocaleString()}]}),!!((Le=y==null?void 0:y.largestFiles)!=null&&Le.length)&&c.jsxs(c.Fragment,{children:[c.jsx(ji,{level:5,className:"settings-storage-section-title",children:"Largest files"}),c.jsx("div",{className:"settings-largest-files",children:y.largestFiles.map(je=>c.jsxs("div",{className:"settings-largest-file",children:[c.jsxs("span",{children:[c.jsx(Zs,{}),c.jsx(Ln,{ellipsis:{tooltip:je.path},children:je.path})]}),c.jsx(Ln,{strong:!0,children:Pm(je.sizeBytes)})]},je.path))})]})]}),c.jsx(bn,{title:G?"Edit Static Page":"Add Static Page",open:V,onOk:fe,onCancel:()=>W(!1),okText:"Save",confirmLoading:te,destroyOnClose:!0,children:c.jsxs(wt,{form:a,layout:"vertical",className:"settings-page-modal-form",children:[c.jsx(wt.Item,{name:"name",label:"Page Name",rules:[{required:!0,message:"Please enter page name"}],children:c.jsx(Ct,{placeholder:"e.g. test name"})}),c.jsx(wt.Item,{name:"url",label:"URL",extra:"Local pages in pages/ or data/pages/ directory can be accessed via /pages/<path> or /data/pages/<path>",rules:[{required:!0,message:"Please enter page URL"}],children:c.jsx(Ct,{placeholder:"e.g. /pages/welcome/index.html or https://example.com"})})]})})]})}const{Paragraph:fv,Text:Jr}=xn,zc={npm:{prefix:"",registry:"https://registry.npmjs.org/",strictSsl:!0,cache:"",proxy:"",httpsProxy:""},git:{name:"",email:"",sshKey:""},nvm:{defaultVersion:""}};function Vye(e){const t=String(e||"").replace(/^v/,""),[n="",r=""]=t.split(".");return[n,`${n}.${r}`,e]}function Uye(e=[]){const t=new Map;return e.forEach(n=>{const r=typeof n=="string"?n:n.version,a=typeof n=="string"?"":n.publishedAt,[o="",s=""]=String(r).replace(/^v/,"").split(".");t.has(o)||t.set(o,new Map);const u=t.get(o),f=`${o}.${s}`;u.has(f)||u.set(f,[]),u.get(f).push({label:c.jsxs("span",{className:"npm-version-option",children:[c.jsx("span",{children:r}),a&&c.jsx("span",{className:"npm-version-published",children:new Date(a).toLocaleDateString()})]}),value:r})}),[...t.entries()].map(([n,r])=>({label:`v${n}`,value:n,children:[...r.entries()].map(([a,o])=>({label:a,value:a,children:o}))}))}function Wye(){var Ge;const{message:e}=Pr.useApp(),[t]=wt.useForm(),[n,r]=l.useState(!0),[a,o]=l.useState(!1),[s,u]=l.useState(!1),[f,m]=l.useState(!1),[h,p]=l.useState({nodeVersion:"",npmVersion:""}),[v,y]=l.useState({installed:!1,currentVersion:"",defaultVersion:"",nvmDir:"",nodeJsMirror:"",installedVersions:[]}),[b,C]=l.useState(""),[x,w]=l.useState(!1),[$,E]=l.useState([]),[R,N]=l.useState(!1),[O,I]=l.useState(!1),[j,M]=l.useState(""),[T,z]=l.useState(""),[P,B]=l.useState([]),[H,A]=l.useState(!1),[L,F]=l.useState(!1),[U,q]=l.useState(null),[_,K]=l.useState(""),[X,V]=l.useState([]),[W,G]=l.useState([]),[Y,te]=l.useState(!1),[ne,ue]=l.useState(""),[Z,ee]=l.useState(!1),[re,oe]=l.useState(null),[de,be]=l.useState("~"),[J,ye]=l.useState(!1),[xe,ze]=l.useState("npm");l.useEffect(()=>{Wn.devConfigurations().then(He=>{var nt,ft,vt,qe,Ee;y(He.nvm||zc.nvm),E(((nt=He.npm)==null?void 0:nt.globalPackages)||[]),p({nodeVersion:((ft=He.npm)==null?void 0:ft.nodeVersion)||"",npmVersion:((vt=He.npm)==null?void 0:vt.npmVersion)||""}),t.setFieldsValue({npm:{...zc.npm,...He.npm},git:{...zc.git,...He.git},nvm:{defaultVersion:((qe=He.nvm)==null?void 0:qe.defaultVersion)||"",nodeJsMirror:((Ee=He.nvm)==null?void 0:Ee.nodeJsMirror)||""}})}).catch(He=>an.error(He.message)).finally(()=>r(!1))},[t]);const he=async()=>{try{await t.validateFields();const nt=t.getFieldsValue(!0)[xe]||{},ft={section:xe,[xe]:{...zc[xe],...nt}};o(!0);const vt=await Wn.saveDevConfigurations(ft);t.setFieldsValue(vt),vt.nvm&&y(vt.nvm),m(!0),window.setTimeout(()=>m(!1),1500)}catch(He){He!=null&&He.errorFields||an.error(He.message)}finally{o(!1)}},ce=async()=>{if(b.trim()){w(!0);try{const He=await sye.install(b.trim());y(He),C(""),an.success(`Installed Node.js ${He.currentVersion||b.trim()}.`)}catch(He){an.error(He.message)}finally{w(!1)}}},se=async()=>{var He,nt,ft,vt,qe;N(!0);try{const Ee=await Wn.devConfigurations();E(((He=Ee.npm)==null?void 0:He.globalPackages)||[]),p({nodeVersion:((nt=Ee.npm)==null?void 0:nt.nodeVersion)||"",npmVersion:((ft=Ee.npm)==null?void 0:ft.npmVersion)||""}),Ee.nvm&&y(Ee.nvm),t.setFieldsValue({npm:{...zc.npm,...Ee.npm},git:{...zc.git,...Ee.git},nvm:{defaultVersion:((vt=Ee.nvm)==null?void 0:vt.defaultVersion)||"",nodeJsMirror:((qe=Ee.nvm)==null?void 0:qe.nodeJsMirror)||""}})}catch(Ee){an.error(Ee.message)}finally{N(!1)}},ae=async(He,nt)=>{M(`${He}:${nt}`);try{await qc.manage(He,nt),await se(),e.success(`${nt} ${He==="uninstall"?"uninstalled":"upgraded"}.`)}catch(ft){an.error(ft.message)}finally{M("")}},ge=async()=>{if(T.trim()){F(!0);try{B(await qc.search(T.trim())),A(!1)}catch(He){e.error(He.message||"Failed to search npm packages.")}finally{F(!1)}}},Re=async()=>{if(U){ee(!0);try{const He=_.trim()?`${U.name}@${_.trim()}`:U.name;await qc.manage("install",He),await se(),q(null),B([]),z(""),e.success(`${He} installed.`)}catch(He){an.error(He.message)}finally{ee(!1)}}},_e=async He=>{var nt;te(!0),ue(He.name);try{const ft=await qc.versions(He.name),vt=ft.length?ft:He.version?[{version:He.version,publishedAt:""}]:[],qe=He.version||((nt=vt[0])==null?void 0:nt.version)||"";G(vt),K(qe),V(Vye(qe)),q(He)}catch(ft){an.error(ft.message)}finally{te(!1),ue("")}},ie=He=>{be(t.getFieldValue(["npm",He])||"~"),oe(He)},fe=He=>{re&&t.setFieldValue(["npm",re],He),oe(null)},we=He=>{t.setFieldValue(["git","sshKey"],He),m(!1),ye(!1)},ke=async He=>{const nt=String(t.getFieldValue(["npm",He])||"").trim();if(!nt){e.info(`Select a ${He} directory first.`);return}try{await Wn.openFolder(nt)}catch(ft){e.error(ft.message)}},Pe=async()=>{u(!0);try{const He=await qc.useSuggestedPrefix();t.setFieldValue(["npm","prefix"],He.prefix),m(!1),e.success(`NPM prefix set to ${He.prefix}.`)}catch(He){e.error(He.message)}finally{u(!1)}},Ie=async He=>{const nt=String(He.directory||"").trim();if(!nt){e.error("Package directory is unavailable.");return}try{await Wn.revealFolder(nt)}catch(ft){e.error(ft.message)}},Ve=async He=>{try{await navigator.clipboard.writeText(He),e.success(`${He} copied.`)}catch(nt){e.error(nt.message||"Could not copy package name.")}},Le=He=>{t.setFieldValue(["npm",He],zc.npm[He]),m(!1)},je=(He,nt)=>c.jsxs("span",{className:"npm-field-label",children:[c.jsx("span",{children:He}),c.jsx(Oe,{type:"link",size:"small",htmlType:"button",className:"npm-reset-button",onClick:()=>Le(nt),children:"Reset"})]}),$e=[{title:"Package",dataIndex:"name",key:"name",render:(He,nt)=>c.jsxs(ct,{size:4,children:[c.jsx(Oe,{type:"text",className:"npm-package-name-button",title:"Copy package name","aria-label":`Copy ${He} package name`,onClick:()=>Ve(He),children:c.jsx(Jr,{code:!0,children:He})}),c.jsx(yn,{title:nt.directory?"Open package directory":"Package directory unavailable",children:c.jsx(Oe,{type:"text",className:"npm-package-folder-button",icon:c.jsx(Fr,{}),disabled:!nt.directory,"aria-label":`Open ${He} package directory`,onClick:()=>Ie(nt)})})]})},{title:"Version",dataIndex:"version",key:"version",render:He=>c.jsx($t,{children:He||"unknown"})},{title:"Actions",key:"actions",align:"right",render:(He,nt)=>c.jsx("div",{className:"npm-package-actions",children:c.jsx(Gr,{title:`Uninstall ${nt.name}?`,onConfirm:()=>ae("uninstall",nt.name),okText:"Uninstall",okButtonProps:{danger:!0},children:c.jsx(Oe,{type:"primary",danger:!0,size:"small",loading:j===`uninstall:${nt.name}`,children:"Uninstall"})})})}],Ae=c.jsxs(It,{className:"dev-config-card",bordered:!1,children:[c.jsxs("div",{className:"dev-config-section-heading",children:[c.jsx("div",{className:"dev-config-icon npm-icon",children:c.jsx(wa,{})}),c.jsxs("div",{children:[c.jsx(Jr,{strong:!0,children:"NPM configuration"}),c.jsx(fv,{type:"secondary",children:"Set the defaults used by npm when installing and publishing packages."})]})]}),c.jsxs("div",{className:"npm-runtime-status",children:[c.jsxs("div",{children:[c.jsx(Jr,{type:"secondary",children:"Current Node.js"}),c.jsx(Jr,{strong:!0,children:h.nodeVersion||"—"})]}),c.jsxs("div",{children:[c.jsx(Jr,{type:"secondary",children:"Current npm"}),c.jsx(Jr,{strong:!0,children:h.npmVersion||"—"})]})]}),c.jsxs("div",{className:"dev-config-grid",children:[c.jsx(wt.Item,{label:c.jsxs("span",{className:"npm-field-label",children:[c.jsx("span",{children:"Prefix"}),c.jsx(Oe,{type:"link",size:"small",htmlType:"button",className:"npm-reset-button",onClick:()=>Le("prefix"),children:"Reset"}),c.jsx(Oe,{type:"link",size:"small",htmlType:"button",className:"npm-reset-button",loading:s,onClick:Pe,children:"Use suggestion"})]}),name:["npm","prefix"],extra:"Global package installation directory.",children:c.jsx(Ct,{className:"npm-directory-input",prefix:c.jsx(Oe,{htmlType:"button",type:"text",className:"npm-directory-picker",icon:c.jsx(Fr,{}),onClick:()=>ke("prefix"),"aria-label":"Open Prefix Directory",title:"Open Prefix Directory"}),allowClear:!0,readOnly:!0,placeholder:"/usr/local",addonAfter:c.jsx(Oe,{htmlType:"button",type:"text",onClick:()=>ie("prefix"),children:"Browse"})})}),c.jsx(wt.Item,{label:je("Registry","registry"),name:["npm","registry"],rules:[{type:"url",warningOnly:!0}],children:c.jsx(Ct,{placeholder:"https://registry.npmjs.org/"})}),c.jsx(wt.Item,{label:je("Cache","cache"),name:["npm","cache"],extra:"Leave blank to use npm's default cache location.",children:c.jsx(Ct,{className:"npm-directory-input",prefix:c.jsx(Oe,{htmlType:"button",type:"text",className:"npm-directory-picker",icon:c.jsx(Fr,{}),onClick:()=>ke("cache"),"aria-label":"Open Cache Directory",title:"Open Cache Directory"}),allowClear:!0,readOnly:!0,placeholder:"~/.npm",addonAfter:c.jsx(Oe,{htmlType:"button",type:"text",onClick:()=>ie("cache"),children:"Browse"})})}),c.jsx(wt.Item,{label:je("Proxy","proxy"),name:["npm","proxy"],children:c.jsx(Ct,{placeholder:"http://proxy.example.com:8080"})}),c.jsx(wt.Item,{label:je("HTTPS Proxy","httpsProxy"),name:["npm","httpsProxy"],children:c.jsx(Ct,{placeholder:"http://proxy.example.com:8080"})}),c.jsx(wt.Item,{label:"Strict SSL",name:["npm","strictSsl"],valuePropName:"checked",extra:"Verify SSL certificates when connecting to the registry.",children:c.jsx(Ja,{})})]}),c.jsx("div",{className:"npm-global-packages",children:c.jsxs("div",{className:"npm-global-packages-heading",children:[c.jsxs("div",{children:[c.jsx(Jr,{strong:!0,children:"Global packages"}),c.jsx(fv,{type:"secondary",children:"Manage packages installed globally by the system npm."})]}),c.jsxs(Oe,{icon:c.jsx(Xa,{}),loading:R,onClick:()=>{I(!0),se()},children:["Manage (",$.length,")"]})]})})]}),We=c.jsxs(It,{className:"dev-config-card",bordered:!1,children:[c.jsxs("div",{className:"dev-config-section-heading",children:[c.jsx("div",{className:"dev-config-icon git-icon",children:c.jsx(C0,{})}),c.jsxs("div",{children:[c.jsx(Jr,{strong:!0,children:"GIT identity"}),c.jsx(fv,{type:"secondary",children:"Configure the author identity Git uses for new commits."})]})]}),c.jsxs("div",{className:"dev-config-grid git-grid",children:[c.jsx(wt.Item,{label:"Name",name:["git","name"],children:c.jsx(Ct,{placeholder:"Ada Lovelace"})}),c.jsx(wt.Item,{label:"Email",name:["git","email"],rules:[{type:"email",warningOnly:!0}],children:c.jsx(Ct,{placeholder:"ada@example.com"})}),c.jsx(wt.Item,{className:"git-ssh-key",label:"SSH Key",name:["git","sshKey"],extra:"Enter a path directly or choose a private key file.",children:c.jsx(Ct,{className:"npm-directory-input",placeholder:"~/.ssh/id_ed25519",prefix:c.jsx(Oe,{htmlType:"button",type:"text",className:"npm-directory-picker",icon:c.jsx(Zs,{}),"aria-label":"Select SSH Key File",onClick:()=>ye(!0)})})})]})]}),De=c.jsxs(It,{className:"dev-config-card",bordered:!1,children:[c.jsxs("div",{className:"dev-config-section-heading",children:[c.jsx("div",{className:"dev-config-icon nvm-icon",children:c.jsx(wa,{})}),c.jsxs("div",{children:[c.jsx(Jr,{strong:!0,children:"NVM configuration"}),c.jsx(fv,{type:"secondary",children:"Manage Node.js versions through the system NVM installation."})]})]}),c.jsxs("div",{className:"nvm-status-grid",children:[c.jsxs("div",{children:[c.jsx(Jr,{type:"secondary",children:"NVM version"}),c.jsx(Jr,{strong:!0,children:v.version||"—"})]}),c.jsxs("div",{children:[c.jsx(Jr,{type:"secondary",children:"Current using version"}),c.jsx(Jr,{strong:!0,children:v.currentVersion||"—"})]}),c.jsxs("div",{children:[c.jsx(Jr,{type:"secondary",children:"NVM directory"}),c.jsx(Jr,{strong:!0,children:v.nvmDir||"—"})]})]}),c.jsxs("div",{className:"dev-config-grid nvm-grid",children:[c.jsx(wt.Item,{label:"Node.js download mirror",name:["nvm","nodeJsMirror"],extra:"Saved as NVM_NODEJS_ORG_MIRROR in your shell profile.",children:c.jsx(Ct,{placeholder:"https://nodejs.org/dist"})}),c.jsx(wt.Item,{label:"Default Node.js version",name:["nvm","defaultVersion"],extra:"Applied through nvm alias default when you save.",children:c.jsx(Ct,{placeholder:"20"})}),c.jsx(wt.Item,{label:"Install Node.js version",extra:"Examples: 20, 20.11.1, lts/*",children:c.jsx(Ct,{value:b,onChange:He=>C(He.target.value),addonAfter:c.jsx(Oe,{type:"link",loading:x,onClick:ce,children:"Install"}),placeholder:"22"})})]}),c.jsxs("div",{className:"nvm-installed-versions",children:[c.jsx(Jr,{type:"secondary",children:"Installed versions"}),c.jsx("div",{children:(Ge=v.installedVersions)!=null&&Ge.length?v.installedVersions.map(He=>c.jsx($t,{children:He},He)):c.jsx(Jr,{type:"secondary",children:"None found"})})]})]}),Je=c.jsxs(bn,{title:"Global packages",open:O,onCancel:()=>!j&&!Z&&I(!1),footer:null,width:760,children:[c.jsxs("div",{className:"npm-install-row",children:[c.jsx(Ct,{value:T,onChange:He=>z(He.target.value),onPressEnter:ge,placeholder:"Search npm packages"}),c.jsx(Oe,{type:"primary",loading:L,disabled:!T.trim(),onClick:ge,children:"Search"}),c.jsx(Oe,{icon:c.jsx(Xa,{}),loading:R,onClick:se,children:"Refresh"})]}),P.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(Jr,{strong:!0,children:"Search results"}),c.jsx(ar,{className:"npm-search-results",rowKey:"name",size:"small",dataSource:H?P:P.slice(0,5),pagination:!1,columns:[{title:"Package",dataIndex:"name",render:He=>c.jsx(Jr,{code:!0,children:He})},{title:"Version",dataIndex:"version"},{title:"Description",dataIndex:"description",ellipsis:!0},{title:"",key:"install",align:"right",render:(He,nt)=>c.jsx(Oe,{size:"small",type:"primary",loading:Y&&nt.name===ne,onClick:()=>_e(nt),children:"Install"})}]}),P.length>5&&c.jsx(Oe,{className:"npm-show-more",type:"link",onClick:()=>A(He=>!He),children:H?"Show fewer":`Show more (${P.length-5})`}),c.jsx(lp,{})]}),c.jsx(ar,{className:"npm-global-package-table",rowKey:"name",size:"small",loading:R,dataSource:$,columns:$e,pagination:!1,locale:{emptyText:"No global packages found."}})]}),Ye=c.jsx(bn,{className:"npm-install-confirm-modal",width:560,title:"Install global package?",open:!!U,onCancel:()=>!Z&&q(null),onOk:Re,okText:Z?"Installing…":"Install",confirmLoading:Z,closable:!Z,maskClosable:!Z,children:Z?c.jsxs("div",{className:"npm-install-progress",children:[c.jsx(rr,{}),c.jsxs(Jr,{children:["Installing ",c.jsxs("strong",{children:[U==null?void 0:U.name,_?`@${_}`:""]})," globally with npm…"]}),c.jsx(Jr,{type:"secondary",children:"This may take a moment. The package list will refresh when it finishes."})]}):c.jsxs("div",{className:"npm-install-confirm",children:[c.jsx(Jr,{children:"Choose the version to install:"}),c.jsx(Jl,{className:"npm-version-select",popupClassName:"npm-version-picker",value:X,onChange:He=>{const nt=He||[];V(nt),K(nt.length?nt[nt.length-1]:"")},options:Uye(W),placeholder:"Select a version",expandTrigger:"hover",displayRender:He=>He.length?He[He.length-1]:""}),c.jsx(Jr,{type:"secondary",children:"Versions are grouped by major and minor release. Publish dates are shown on the patch version."})]})});return c.jsxs("div",{className:"dev-configurations-page",children:[c.jsx(Ur,{actions:c.jsx(Oe,{type:"primary",icon:f?c.jsx(Vl,{}):null,loading:!f&&a,onClick:he,children:f?"Saved":"Save"}),description:"Read and update the system-level npm and Git configuration used across your development workflow.",eyebrow:"DEVELOPMENT",title:"Dev Configurations"}),c.jsx(rr,{spinning:n,tip:"Loading system configuration…",children:c.jsx(wt,{form:t,layout:"vertical",children:c.jsx(Qa,{activeKey:xe,onChange:ze,items:[{key:"npm",label:"NPM",icon:c.jsx(wa,{}),children:c.jsxs(c.Fragment,{children:[Ae,Je,Ye]})},{key:"git",label:"GIT",icon:c.jsx(C0,{}),children:We},{key:"nvm",label:"NVM",icon:c.jsx(wa,{}),disabled:!v.installed,children:De}]})})}),c.jsx(df,{open:!!re,initialPath:de,onCancel:()=>oe(null),onSelect:fe,title:"Select Project Directory"}),c.jsx(df,{open:J,initialPath:"~",onCancel:()=>ye(!1),onSelect:we,selectionType:"file",title:"Select SSH Key File"})]})}const{Title:qye,Text:Ho,Paragraph:Kye}=xn,{Dragger:Gye}=hp,pI=(e=0)=>{if(!e)return"0 B";const t=["B","KB","MB","GB"],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1);return`${(e/1024**n).toFixed(n?1:0)} ${t[n]}`},Yye=e=>({file:e,name:e.name||"clipboard-image.png",url:URL.createObjectURL(e),size:e.size});function Xye(){const[e,t]=l.useState(null),[n,r]=l.useState(null),[a,o]=l.useState(75),[s,u]=l.useState(!0),[f,m]=l.useState(!0),[h,p]=l.useState(!0),[v,y]=l.useState(2),[b,C]=l.useState(!1),[x,w]=l.useState(null),[$,E]=l.useState(100),[R,N]=l.useState(!1),[O,I]=l.useState(!1),[j,M]=an.useMessage(),T=l.useRef(null),z=l.useRef(null),P=_=>{var K;(K=_.current)!=null&&K.url&&URL.revokeObjectURL(_.current.url)},B=_=>{var X;if(!((X=_==null?void 0:_.type)!=null&&X.startsWith("image/")))return j.error("Please choose an image file."),!1;P(T),P(z);const K=Yye(_);return T.current=K,z.current=null,t(K),r(null),F(_),!1},H=_=>{var K;return[...((K=_.dataTransfer)==null?void 0:K.types)||[]].includes("Files")},A=_=>{var X;_.preventDefault(),I(!1);const K=[...((X=_.dataTransfer)==null?void 0:X.files)||[]].find(V=>V.type.startsWith("image/"));K?B(K):j.error("Drop an image file to compress it.")};l.useEffect(()=>()=>{P(T),P(z)},[]),l.useEffect(()=>{const _=K=>{var W;const X=[...((W=K.clipboardData)==null?void 0:W.items)||[]].find(G=>G.type.startsWith("image/"));if(!X)return;K.preventDefault();const V=X.getAsFile();V&&(B(new File([V],`clipboard-${Date.now()}.${V.type.split("/")[1]||"png"}`,{type:V.type})),j.success("Image read from clipboard."))};return window.addEventListener("paste",_),()=>window.removeEventListener("paste",_)},[j]);const L=async()=>{var _;try{if(!((_=navigator.clipboard)!=null&&_.read))throw new Error("Direct clipboard reading is unavailable. Paste an image with ⌘ / Ctrl + V instead.");const K=await navigator.clipboard.read();for(const X of K){const V=X.types.find(W=>W.startsWith("image/"));if(V){const W=await X.getType(V);B(new File([W],`clipboard-${Date.now()}.${V.split("/")[1]||"png"}`,{type:V})),j.success("Image read from clipboard.");return}}throw new Error("No image was found in the clipboard.")}catch(K){j.warning(K.message||"Unable to read an image from the clipboard.")}},F=async(_=e==null?void 0:e.file)=>{if(_){N(!0);try{const[{encode:K},{imageData:X,width:V,height:W}]=await Promise.all([pu(()=>import("./index-_vMuByUV.js"),[]),L9(_,x,$)]),G=await K(X,{quality:a,progressive:s,optimize_coding:f,auto_subsample:h,chroma_subsample:v,trellis_multipass:b});P(z);const Y=new Blob([G],{type:"image/jpeg"}),te={url:URL.createObjectURL(Y),size:Y.size,width:V,height:W};z.current=te,r(te),j.success("MozJPEG compression complete.")}catch(K){j.error(K.message||"Image compression failed.")}finally{N(!1)}}},U=()=>{if(!n)return;const _=e.name.replace(/\.[^.]+$/,"")||"image",K=document.createElement("a");K.href=n.url,K.download=`${_}-mozjpeg.jpg`,K.click()},q=n&&e?Math.round((1-n.size/e.size)*100):null;return c.jsxs(c.Fragment,{children:[M,c.jsxs("div",{className:`squoosh-page ${O?"is-file-dragging":""}`,onDragOver:_=>{H(_)&&(_.preventDefault(),I(!0))},onDragLeave:_=>{_.currentTarget===_.target&&I(!1)},onDrop:A,children:[c.jsx(Ur,{actions:c.jsxs(ct,{children:[c.jsx(Oe,{icon:c.jsx(fo,{}),onClick:L,children:"Read clipboard"}),c.jsx(Oe,{type:"primary",icon:c.jsx(Gw,{}),onClick:()=>F(),disabled:!e,loading:R,children:"Compress"})]}),description:"Compress JPEG images locally while balancing visual quality and file size.",title:"Image compression"}),c.jsxs("div",{className:"squoosh-studio",children:[c.jsxs("div",{className:"squoosh-preview-area",children:[c.jsx(gI,{title:"Original",detail:e?`${pI(e.size)} · ${e.name}`:"Choose an image to begin",children:e?c.jsx(vI,{label:"Original image",image:e.url}):c.jsxs(Gye,{accept:"image/*",multiple:!1,showUploadList:!1,beforeUpload:B,className:"image-dropzone",children:[c.jsx("p",{className:"ant-upload-drag-icon",children:c.jsx(zh,{})}),c.jsx("p",{className:"ant-upload-text",children:"Drop an image or click to choose"}),c.jsx("p",{className:"ant-upload-hint",children:"Or paste an image with ⌘ / Ctrl + V."})]})}),c.jsx(gI,{title:"MozJPEG output",detail:n?`${pI(n.size)} · ${n.width} × ${n.height}`:"Waiting for compression",action:n&&c.jsx(Oe,{type:"primary",size:"small",icon:c.jsx(ql,{}),onClick:U,children:"Download"}),children:R?c.jsx("div",{className:"image-loading",children:c.jsx(rr,{tip:"Compressing…"})}):n?c.jsxs(c.Fragment,{children:[c.jsx(vI,{label:"Compressed JPEG",image:n.url}),q!==null&&c.jsx("div",{className:`compression-saving ${q>0?"is-saving":""}`,children:q>0?`${q}% smaller`:"No size reduction at current settings."})]}):c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"Compressed preview"})})]}),c.jsxs("aside",{className:"squoosh-settings",children:[c.jsxs("div",{className:"settings-heading",children:[c.jsx(Ho,{children:"ENCODER"}),c.jsx(qye,{level:4,children:"MozJPEG"}),c.jsx(Kye,{children:"Fine-tune output size and image quality."})]}),c.jsxs("div",{className:"option-row",children:[c.jsxs("div",{children:[c.jsx(Ho,{strong:!0,children:"Quality"}),c.jsx("br",{}),c.jsx(Ho,{type:"secondary",children:"Higher values preserve more detail."})]}),c.jsx($t,{color:"purple",children:a})]}),c.jsx(ioe,{min:1,max:100,value:a,onChange:o,tooltip:{formatter:_=>`${_}`}}),c.jsxs("div",{className:"option-select",children:[c.jsxs("div",{children:[c.jsx(Ho,{strong:!0,children:"Long edge"}),c.jsx("br",{}),c.jsx(Ho,{type:"secondary",children:"Scale the longest edge to this value. Never crops the image."})]}),c.jsx(cf,{min:1,max:16384,value:x,onChange:w,placeholder:"Original",addonAfter:"px"})]}),c.jsxs("div",{className:"option-select",children:[c.jsxs("div",{children:[c.jsx(Ho,{strong:!0,children:"Scale"}),c.jsx("br",{}),c.jsx(Ho,{type:"secondary",children:"Scale the image by percentage."})]}),c.jsx(cf,{min:1,max:100,value:$,onChange:E,placeholder:"100",addonAfter:"%",allowClear:!0})]}),c.jsx(mv,{label:"Progressive JPEG",description:"Display a low-detail preview while loading.",checked:s,onChange:u}),c.jsx(mv,{label:"Optimize coding",description:"Reduce size without changing image quality.",checked:f,onChange:m}),c.jsx(J0,{ghost:!0,className:"advanced-options",items:[{key:"advanced",label:"Advanced settings",children:c.jsxs(c.Fragment,{children:[c.jsx(mv,{label:"Automatic chroma subsampling",description:"Pick sampling based on the image content.",checked:h,onChange:p}),c.jsxs("div",{className:"option-select",children:[c.jsxs("div",{children:[c.jsx(Ho,{strong:!0,children:"Chroma subsampling"}),c.jsx("br",{}),c.jsx(Ho,{type:"secondary",children:"Enabled when automatic mode is off."})]}),c.jsx($n,{disabled:h,value:v,onChange:y,options:[{value:0,label:"4:4:4 (colour detail)"},{value:1,label:"4:2:2 (balanced)"},{value:2,label:"4:2:0 (smaller file)"}]})]}),c.jsx(mv,{label:"Trellis multi-pass",description:"Further size reduction with a longer encode time.",checked:b,onChange:C})]})}]}),c.jsx(Oe,{type:"primary",size:"large",block:!0,icon:c.jsx(Gw,{}),onClick:()=>F(),disabled:!e,loading:R,children:"Compress image"})]})]})]})]})}function gI({title:e,detail:t,action:n,children:r}){return c.jsxs("div",{className:"preview-pane",children:[c.jsxs("header",{children:[c.jsxs("div",{children:[c.jsx(Ho,{children:e}),c.jsx("span",{children:t})]}),n]}),c.jsx("div",{className:"preview-canvas",children:r})]})}function mv({label:e,description:t,checked:n,onChange:r}){return c.jsxs("div",{className:"option-switch",children:[c.jsxs("div",{children:[c.jsx(Ho,{strong:!0,children:e}),c.jsx("br",{}),c.jsx(Ho,{type:"secondary",children:t})]}),c.jsx(Ja,{checked:n,onChange:r})]})}function vI({label:e,image:t,metadata:n}){return c.jsxs("div",{className:"image-panel",children:[c.jsx("img",{src:t,alt:e}),n&&c.jsx("div",{className:"image-panel-meta",children:c.jsx(Ho,{type:"secondary",children:n})})]})}const{Paragraph:Jye,Text:wr}=xn;function Qye({prs:e,selectedPrKeys:t,onToggleSelectPr:n,onSelectPr:r}){return e.length===0?c.jsx(Xt,{className:"pr-review-empty",description:"No open pull requests found."}):c.jsx("div",{className:"pr-review-list",children:e.map(a=>{var f,m,h,p,v,y,b,C,x;const o=a.reviewUrl||"",s=a.reviewUrl||a.id,u=t.includes(s);return c.jsx(It,{size:"small",hoverable:!0,className:`pr-review-list-item ${u?"is-selected":""}`,onClick:w=>{w.target.closest('.ant-checkbox-wrapper, .ant-checkbox, input[type="checkbox"]')||o&&r(o)},children:c.jsxs("div",{className:"pr-review-list-row",children:[c.jsxs("div",{className:"pr-review-list-primary",children:[c.jsx(tr,{checked:u,onChange:w=>{w.stopPropagation(),n(s)},onClick:w=>w.stopPropagation()}),c.jsxs("div",{className:"pr-review-list-copy",children:[c.jsxs(ct,{size:8,wrap:!0,children:[c.jsxs(wr,{strong:!0,className:"pr-review-list-title",children:["#",a.id," ",a.title]}),a.draft&&c.jsx($t,{color:"gold",children:"Draft"})]}),c.jsxs("div",{className:"pr-review-list-meta",children:[c.jsxs(wr,{type:"secondary",style:{fontWeight:500},children:[(h=(m=(f=a.fromRef)==null?void 0:f.repository)==null?void 0:m.project)==null?void 0:h.key," / ",(v=(p=a.fromRef)==null?void 0:p.repository)==null?void 0:v.slug]}),c.jsx("span",{className:"pr-review-list-separator",children:"|"}),c.jsx($t,{size:"small",className:"pr-review-branch-tag",children:(y=a.fromRef)==null?void 0:y.displayId}),c.jsx(Qc,{style:{fontSize:"10px"}}),c.jsx($t,{size:"small",className:"pr-review-branch-tag",children:(b=a.toRef)==null?void 0:b.displayId}),c.jsx("span",{className:"pr-review-list-separator",children:"|"}),c.jsxs("span",{children:["Author: ",c.jsx("strong",{children:(x=(C=a.author)==null?void 0:C.user)==null?void 0:x.displayName})]}),c.jsx("span",{className:"pr-review-list-separator",children:"|"}),c.jsxs("span",{children:["Updated: ",new Date(a.updatedDate).toLocaleDateString()]})]})]})]}),c.jsxs(ct,{size:8,children:[c.jsx(Oe,{size:"small",icon:c.jsx(ul,{}),onClick:w=>{w.stopPropagation(),o&&hr(o)},children:"Open"}),c.jsx(Oe,{type:"primary",size:"small",onClick:w=>{w.stopPropagation(),o&&r(o)},children:"Review"})]})]})},s)})})}function yI(){const e=window.location.hash||"";if(e.includes("#/pr-review/detail")){const t=e.indexOf("?");if(t!==-1)return new URLSearchParams(e.slice(t)).get("url")||""}return""}function Zye(e){if(!e)return"";let t=String(e||"").trim();t=t.replace(/^```(?:markdown|md|json)?\s*/i,"").replace(/\s*```$/i,"").trim();const n=/^\{?\s*\\?"?summary\\?"?\s*:\s*\\?"?/i;n.test(t)&&(t=t.replace(n,""),t=t.replace(/\\?"\s*,?\s*\\?"?findings\\?"?\s*:\s*\[[\s\S]*$/i,""),t=t.replace(/\\?"\s*\}?\s*$/i,""),t=t.replace(/\\n/g,`
498
498
  `).replace(/\\"/g,'"').replace(/\\\\/g,"\\").trim());const r=w=>String(w).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),a=w=>r(w).replace(/`([^`]+)`/g,'<code class="pr-review-md-inline-code">$1</code>').replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/__([^_]+)__/g,"<strong>$1</strong>").replace(/(^|[^*])\*([^*]+)\*([^*]|$)/g,"$1<em>$2</em>$3").replace(/(^|[^_])_([^_]+)_([^_]|$)/g,"$1<em>$2</em>$3").replace(/~~([^~]+)~~/g,"<del>$1</del>").replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,'<a href="$2" target="_blank" rel="noreferrer">$1</a>'),o=e.split(/\r?\n/),s=[];let u=!1,f="",m=[],h=!1,p=!1,v=!1,y=[];const b=()=>{if(y.length===0)return;const[w,...$]=y;let E='<div class="pr-review-md-table-wrapper"><table class="pr-review-md-table">';w&&(E+=`<thead><tr>${w.map(R=>`<th>${R}</th>`).join("")}</tr></thead>`),$.length>0&&(E+=`<tbody>${$.map(R=>`<tr>${R.map(N=>`<td>${N}</td>`).join("")}</tr>`).join("")}</tbody>`),E+="</table></div>",s.push(E),y=[]},C=()=>{h&&(s.push("</ul>"),h=!1),p&&(s.push("</ol>"),p=!1)},x=()=>{v&&(s.push("</blockquote>"),v=!1)};for(let w=0;w<o.length;w++){const $=o[w],E=$.trim();if(E.startsWith("```")){u?(s.push(`<pre class="pr-review-md-code-block"><code class="language-${r(f)}">${m.map(r).join(`
499
499
  `)}</code></pre>`),u=!1,f="",m=[]):(C(),x(),b(),u=!0,f=E.slice(3).trim(),m=[]);continue}if(u){m.push($);continue}if(E.startsWith("|")&&E.endsWith("|")){if(C(),x(),/^\|[\s\-:|]+\|$/.test(E))continue;const O=E.slice(1,-1).split("|").map(I=>a(I.trim()));y.push(O);continue}else b();if(/^(?:---|\*\*\*|___)\s*$/.test(E)){C(),x(),s.push('<hr class="pr-review-md-hr" />');continue}if(/^#{1,6}\s+/.test(E)){C(),x();const O=E.match(/^(#{1,6})\s+/)[1].length,I=a(E.replace(/^#{1,6}\s+/,""));s.push(`<h${O} class="pr-review-md-heading pr-review-md-h${O}">${I}</h${O}>`);continue}if(E.startsWith(">")){C(),v||(s.push('<blockquote class="pr-review-md-blockquote">'),v=!0);const O=a(E.replace(/^>\s*/,""));s.push(`<p>${O}</p>`);continue}else x();const R=E.match(/^[-*]\s+(.*)$/);if(R){p&&(s.push("</ol>"),p=!1),h||(s.push('<ul class="pr-review-md-ul">'),h=!0),s.push(`<li>${a(R[1])}</li>`);continue}const N=E.match(/^(\d+)\.\s+(.*)$/);if(N){h&&(s.push("</ul>"),h=!1),p||(s.push('<ol class="pr-review-md-ol">'),p=!0),s.push(`<li>${a(N[2])}</li>`);continue}C(),E&&s.push(`<p class="pr-review-md-p">${a(E)}</p>`)}return u&&s.push(`<pre class="pr-review-md-code-block"><code>${m.map(r).join(`
@@ -534,7 +534,7 @@ ${Qe.error}
534
534
  `}}navigator.clipboard.writeText(Ze),h(!0),an.success("Markdown report copied to clipboard."),setTimeout(()=>h(!1),2e3)},Le=Ee=>Ee==="critical"?c.jsx($t,{color:"error",icon:c.jsx(Ph,{}),children:"Critical"}):Ee==="warning"?c.jsx($t,{color:"warning",icon:c.jsx(A9,{}),children:"Warning"}):c.jsx($t,{color:"purple",icon:c.jsx(_y,{}),children:"Suggestion"}),je=((vt=o==null?void 0:o.files)==null?void 0:vt.map(Ee=>{var Xe;const Be=(((Xe=o.aiReview)==null?void 0:Xe.findings)||[]).filter(Qe=>Qe.file===Ee.filePath).map((Qe,Ze)=>({severity:Qe.severity,line:Qe.line,rule:Qe.title||"AI Review",message:[Qe.explanation,Qe.recommendation?`Recommendation: ${Qe.recommendation}`:""].filter(Boolean).join(" "),code:"",key:`ai-${Ze}`,source:"ai"}));return{...Ee,issues:[...Ee.issues||[],...Be]}}))||[],$e=je.find(Ee=>Ee.filePath===V)||je[0],Ae=new Map;for(const Ee of($e==null?void 0:$e.issues)||[])if(Number.isInteger(Ee.line)&&Ee.line>0){const Be=Ae.get(Ee.line)||[];Ae.set(Ee.line,[...Be,Ee])}const We=(($e==null?void 0:$e.issues)||[]).filter(Ee=>!Number.isInteger(Ee.line)||Ee.line<1),De=new Map((($e==null?void 0:$e.diffLines)||[]).filter(Ee=>Number.isInteger(Ee.newLine)&&Ee.newLine>0).map(Ee=>[Ee.newLine,Ee])),Je=(($e==null?void 0:$e.content)||"").split(`
535
535
  `),Ye=(($e==null?void 0:$e.diffLines)||[]).filter(Ee=>["ADDED","REMOVED"].includes(Ee.type)&&Number.isInteger(Ee.newLine)&&Ee.newLine>0).map(Ee=>Ee.newLine),Ge=new Set;if(Ye.length>0)for(const Ee of Ye)for(let Be=Math.max(1,Ee-10);Be<=Math.min(Je.length,Ee+10);Be+=1)Ge.add(Be);const He=[];let nt=1;for(;nt<=Je.length;){if(Ye.length===0||Ge.has(nt)){He.push({type:"line",lineNumber:nt}),nt+=1;continue}const Ee=nt;for(;nt<=Je.length&&!Ge.has(nt);)nt+=1;const Be=nt-1,Xe=`${$e==null?void 0:$e.filePath}:${Ee}-${Be}`;if(G.has(Xe))for(let Qe=Ee;Qe<=Be;Qe+=1)He.push({type:"line",lineNumber:Qe});else He.push({type:"collapsed",start:Ee,end:Be,key:Xe})}l.useEffect(()=>{!te||!V||!ue.current||(ue.current.scrollIntoView({behavior:"smooth",block:"start"}),ne(!1))},[V,te]);const ft=Ee=>{W(Ee),ne(!0)};return c.jsxs("div",{className:"pr-review-page",children:[c.jsx(Ur,{description:"Analyze pull requests on Bitbucket for quality issues, leaks, and debug flags.",title:"PR Review",actions:c.jsx(Oe,{icon:c.jsx(Gl,{}),onClick:be,children:"Settings"})}),c.jsxs(bn,{title:c.jsxs(ct,{children:[c.jsx(Gl,{}),c.jsx("span",{children:"PR Review Settings"})]}),open:A,onCancel:()=>!re&&L(!1),onOk:he,okText:"Save rules",cancelText:"Cancel",confirmLoading:re,width:680,className:"pr-review-rules-modal",children:[c.jsx(wr,{type:"secondary",children:"Choose which checks run and how findings are prioritized. Changes apply to the next review."}),c.jsx(J0,{className:"pr-review-rules-collapse",defaultActiveKey:[],items:[{key:"built-in-rules",label:c.jsxs(ct,{children:["Built-in rules ",c.jsxs(wr,{type:"secondary",children:["(",F.length,")"]})]}),children:Z?c.jsx(Vo,{spin:!0}):c.jsx("div",{className:"pr-review-rules-list",children:F.map(Ee=>c.jsxs("div",{className:`pr-review-rule-row ${Ee.enabled?"":"is-disabled"}`,children:[c.jsx(tr,{checked:Ee.enabled,onChange:Be=>J(Ee.id,{enabled:Be.target.checked})}),c.jsxs("div",{className:"pr-review-rule-copy",children:[c.jsx(wr,{strong:!0,children:Ee.name}),c.jsx(wr,{type:"secondary",children:Ee.description}),c.jsx(Ct.TextArea,{className:"pr-review-built-in-pattern",readOnly:!0,autoSize:{minRows:1,maxRows:3},value:Ee.pattern||"Pattern is implemented by the built-in analyzer."})]}),c.jsx($n,{size:"small",value:Ee.severity,disabled:!Ee.enabled,onChange:Be=>J(Ee.id,{severity:Be}),options:[{value:"critical",label:"Critical"},{value:"warning",label:"Warning"},{value:"info",label:"Suggestion"}]})]},Ee.id))})}]}),c.jsxs("div",{className:"pr-review-custom-rules-heading",children:[c.jsxs("div",{children:[c.jsx(wr,{strong:!0,children:"Changed file filters"}),c.jsx(wr,{type:"secondary",children:" Gitignore-style glob patterns. Matching files are skipped entirely."})]}),c.jsx(Oe,{size:"small",icon:c.jsx(Xn,{}),onClick:ze,children:"Add filter"})]}),c.jsxs("div",{className:"pr-review-file-filters-list",children:[K.map((Ee,Be)=>c.jsxs("div",{className:"pr-review-file-filter",children:[c.jsx(Ct,{value:Ee,onChange:Xe=>X(Qe=>Qe.map((Ze,it)=>it===Be?Xe.target.value:Ze)),placeholder:"e.g. **/*.snap, dist/, *.generated.ts","aria-label":`Changed file filter ${Be+1}`}),c.jsx(Oe,{type:"text",danger:!0,icon:c.jsx(Fn,{}),onClick:()=>X(Xe=>Xe.filter((Qe,Ze)=>Ze!==Be)),children:"Delete"})]},Be)),K.length===0&&c.jsx(wr,{type:"secondary",children:"No file filters yet."})]}),c.jsxs("div",{className:"pr-review-custom-rules-heading",children:[c.jsxs("div",{children:[c.jsx(wr,{strong:!0,children:"Custom regex rules"}),c.jsx(wr,{type:"secondary",children:" Match added lines in the diff with JavaScript regular expressions."})]}),c.jsx(Oe,{size:"small",icon:c.jsx(Xn,{}),onClick:ye,children:"Add rule"})]}),c.jsxs("div",{className:"pr-review-custom-rules-list",children:[q.map(Ee=>c.jsxs("div",{className:"pr-review-custom-rule",children:[c.jsxs("div",{className:"pr-review-custom-rule-toolbar",children:[c.jsx(tr,{checked:Ee.enabled,onChange:Be=>xe(Ee.id,{enabled:Be.target.checked}),children:"Enabled"}),c.jsx(Oe,{type:"text",danger:!0,size:"small",icon:c.jsx(Fn,{}),onClick:()=>_(Be=>Be.filter(Xe=>Xe.id!==Ee.id)),children:"Delete"})]}),c.jsx(Ct,{value:Ee.name,onChange:Be=>xe(Ee.id,{name:Be.target.value}),placeholder:"Rule name"}),c.jsx(Ct,{value:Ee.pattern,onChange:Be=>xe(Ee.id,{pattern:Be.target.value}),placeholder:"Regular expression, e.g. TODO|FIXME",addonBefore:"/",addonAfter:"/g"}),c.jsx(Ct,{value:Ee.message,onChange:Be=>xe(Ee.id,{message:Be.target.value}),placeholder:"Finding message"}),c.jsx($n,{value:Ee.severity,onChange:Be=>xe(Ee.id,{severity:Be}),options:[{value:"critical",label:"Critical"},{value:"warning",label:"Warning"},{value:"info",label:"Suggestion"}]})]},Ee.id)),q.length===0&&c.jsx(wr,{type:"secondary",children:"No custom rules yet."})]})]}),!r&&c.jsx(mr,{className:"service-config",message:"Bitbucket Token Required",description:c.jsxs("span",{children:["Please configure your ",c.jsx("strong",{children:"Bitbucket Access Token"})," in the ",c.jsx("a",{href:"#/settings",children:"Settings"})," page to review internal PRs."]}),type:"warning",showIcon:!0,closable:!1}),c.jsx(It,{className:"service-config pr-review-input-card",children:c.jsx(wt,{form:e,layout:"vertical",onFinish:fe,children:c.jsx(wt.Item,{name:"prLink",label:c.jsxs("div",{className:"pr-review-form-label",children:[c.jsx("span",{children:"Pull Request URL"}),c.jsx(Oe,{type:"link",size:"small",onClick:()=>fe("https://bitbucket.example.com/projects/DEMO/repos/demo-repo/pull-requests/999"),className:"pr-review-demo-action",children:"Load Demo Sample Data"})]}),rules:[{required:!0,message:"Please enter a Bitbucket Pull Request link."}],children:c.jsx(Ct,{placeholder:"https://bitbucket.xxx.com/projects/PROJ/repos/repo/pull-requests/123",disabled:t,allowClear:!0,addonAfter:c.jsxs(ct,{size:8,children:[c.jsx(Oe,{className:"pr-review-inline-action",type:"link",size:"small",onClick:()=>e.submit(),disabled:t,children:"Review"}),c.jsx(lp,{className:"pr-review-inline-divider",type:"vertical"}),c.jsx(Oe,{type:"link",size:"small",icon:c.jsx(ul,{}),onClick:()=>{const Ee=e.getFieldValue("prLink");Ee&&Ee.trim()?hr(Ee.trim()):an.warning("Please enter a Pull Request URL first.")},disabled:t,className:"pr-review-inline-action",children:"Open"})]})})})})}),t&&c.jsx(It,{className:"pr-review-loading-card",children:c.jsxs(ct,{direction:"vertical",size:"middle",children:[c.jsx(Vo,{className:"pr-review-loading-icon",spin:!0}),c.jsx(wr,{type:"secondary",children:"Fetching diffs and reviewing code changes..."})]})}),!o&&!t&&r&&c.jsxs(It,{className:"pr-review-list-card",tabList:[{key:"review",tab:`Waiting for my Review (${y.length})`},{key:"mine",tab:`Authored by Me (${p.length})`}],activeTabKey:w,onTabChange:se,loading:C,children:[ce.length>0&&c.jsxs("div",{className:"pr-review-list-toolbar",children:[c.jsxs(ct,{size:12,children:[c.jsxs(tr,{checked:_e,indeterminate:ie,onChange:ge,children:["Select All (",ce.length,")"]}),E.length>0&&c.jsxs(wr,{type:"secondary",className:"pr-review-selection-count",children:[E.length," selected"]})]}),c.jsxs(Oe,{icon:c.jsx(fo,{}),disabled:E.length===0,onClick:Re,children:["Copy Selected URLs ",E.length>0?`(${E.length})`:""]})]}),c.jsx(Qye,{prs:ce,selectedPrKeys:E,onToggleSelectPr:ae,onSelectPr:fe})]}),o&&c.jsxs(ct,{direction:"vertical",size:"large",className:"pr-review-results",children:[c.jsx("div",{children:c.jsx(Oe,{onClick:we,children:"← Back to PR list"})}),c.jsx(It,{className:"pr-review-info-card",title:c.jsxs(ct,{children:[c.jsx(Ay,{}),c.jsx("span",{children:o.pr.title})]}),extra:c.jsx(Oe,{icon:c.jsx(fo,{}),onClick:Ve,children:m?"Copied":"Copy Report"}),children:c.jsxs(Uo,{className:"pr-review-info-grid",gutter:[16,16],children:[c.jsx(qn,{className:"pr-review-detail-item",xs:24,sm:12,md:6,children:c.jsxs(ct,{direction:"vertical",size:2,children:[c.jsx(wr,{type:"secondary",className:"pr-review-detail-label",children:"Author"}),c.jsx(wr,{strong:!0,children:o.pr.author})]})}),c.jsx(qn,{className:"pr-review-detail-item",xs:24,sm:12,md:6,children:c.jsxs(ct,{direction:"vertical",size:2,children:[c.jsx(wr,{type:"secondary",className:"pr-review-detail-label",children:"Repository"}),c.jsx(wr,{strong:!0,children:o.pr.repositorySlug})]})}),c.jsx(qn,{className:"pr-review-detail-item",xs:24,sm:12,md:6,children:c.jsxs(ct,{direction:"vertical",size:2,children:[c.jsx(wr,{type:"secondary",className:"pr-review-detail-label",children:"Source Branch"}),c.jsx($t,{className:"pr-review-branch-tag",children:o.pr.sourceBranch})]})}),c.jsx(qn,{className:"pr-review-detail-item",xs:24,sm:12,md:6,children:c.jsxs(ct,{direction:"vertical",size:2,children:[c.jsx(wr,{type:"secondary",className:"pr-review-detail-label",children:"Target Branch"}),c.jsx($t,{className:"pr-review-branch-tag",children:o.pr.targetBranch})]})})]})}),c.jsxs(Uo,{gutter:[16,16],children:[c.jsx(qn,{xs:12,md:6,children:c.jsx(It,{className:"pr-review-metric-card",size:"small",children:c.jsx(cl,{title:"Total Changed",value:o.stats.totalFilesChanged})})}),c.jsx(qn,{xs:12,md:6,children:c.jsx(It,{className:"pr-review-metric-card is-muted",size:"small",children:c.jsx(cl,{title:"Filtered (Ignored)",value:o.stats.filteredCount})})}),c.jsx(qn,{xs:12,md:6,children:c.jsx(It,{className:"pr-review-metric-card",size:"small",children:c.jsx(cl,{title:"Reviewed Files",value:o.stats.reviewedCount})})}),c.jsx(qn,{xs:12,md:6,children:c.jsx(It,{className:"pr-review-metric-card",size:"small",children:c.jsx(cl,{title:"Total Issues",value:o.stats.totalIssues,valueStyle:{color:o.stats.totalIssues>0?"#ff4d4f":"#52c41a"}})})})]}),((qe=o.aiReview)==null?void 0:qe.configured)&&c.jsx(It,{className:"pr-review-ai-card",title:c.jsxs(ct,{children:[c.jsx(N0e,{}),c.jsx("span",{children:"AI Review"})]}),size:"small",children:o.aiReview.status==="completed"?c.jsxs(c.Fragment,{children:[c.jsxs(wr,{type:"secondary",children:["AI reviewed the diff in ",o.aiReview.reviewedFiles||0," file(s)."]}),c.jsx("div",{className:"pr-review-ai-content",dangerouslySetInnerHTML:{__html:Zye(o.aiReview.summary||o.aiReview.content||"")}})]}):o.aiReview.status==="error"?c.jsx(mr,{type:"warning",showIcon:!0,message:o.aiReview.error||"AI review failed."}):c.jsxs(ct,{size:"small",children:[c.jsx(Vo,{spin:!0}),c.jsxs(wr,{type:"secondary",children:["AI is reviewing the diff in ",o.aiReview.reviewedFiles||0," file(s)..."]})]})}),c.jsx(It,{className:"pr-review-findings-card",title:"Review Findings",children:je.length===0?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:c.jsxs(ct,{direction:"vertical",size:"small",children:[c.jsxs(wr,{strong:!0,className:"pr-review-success",children:[c.jsx(gi,{})," LGTM! No issues found."]}),c.jsxs(wr,{type:"secondary",children:["Review completed on ",o.stats.reviewedCount," files (filtered out ",o.stats.filteredCount," build/test configs)."]})]})}):c.jsxs("div",{className:"pr-review-files-workspace",children:[c.jsxs("aside",{className:"pr-review-files-sidebar","aria-label":"Reviewed files",children:[c.jsx("div",{className:"pr-review-files-sidebar-title",children:"Reviewed files"}),je.map(Ee=>{const Be=Ee.issues.filter(Ze=>Ze.severity==="critical").length,Xe=Ee.issues.filter(Ze=>Ze.severity==="warning").length,Qe=Ee.issues.filter(Ze=>Ze.severity==="info").length;return c.jsxs("button",{type:"button",className:`pr-review-file-entry ${($e==null?void 0:$e.filePath)===Ee.filePath?"is-selected":""}`,onClick:()=>ft(Ee.filePath),children:[c.jsx("span",{className:"pr-review-file-entry-name",children:Ee.filePath}),c.jsxs("span",{className:"pr-review-file-entry-badges",children:[Be>0&&c.jsx(sa,{count:Be,style:{backgroundColor:"#ff4d4f"}}),Xe>0&&c.jsx(sa,{count:Xe,style:{backgroundColor:"#faad14"}}),Qe>0&&c.jsx(sa,{count:Qe,style:{backgroundColor:"#6555e8"}}),Ee.issues.length===0&&c.jsx($t,{color:"success",children:"OK"})]})]},Ee.filePath)})]}),$e&&c.jsxs("div",{className:"pr-review-code-panel",children:[c.jsxs("div",{className:"pr-review-code-panel-header",ref:ue,children:[c.jsx(wr,{strong:!0,children:$e.filePath}),c.jsx(wr,{type:"secondary",children:$e.issues.length?`${$e.issues.length} finding(s)`:"No findings"})]}),We.length>0&&c.jsx(mr,{className:"pr-review-file-level-alert",type:"warning",showIcon:!0,message:"Some findings do not have a precise line number.",description:We.map(Ee=>`${Ee.rule}: ${Ee.message}`).join(" ")}),c.jsx("div",{className:"pr-review-code-lines",children:He.map(Ee=>{if(Ee.type==="collapsed")return c.jsxs("button",{type:"button",className:"pr-review-code-collapsed",onClick:()=>Y(pt=>new Set([...pt,Ee.key])),children:[c.jsx("span",{children:"⋯"}),c.jsxs("span",{children:[Ee.end-Ee.start+1," lines hidden · Click to expand"]})]},Ee.key);const Be=Ee.lineNumber,Xe=Je[Be-1]||"",Qe=Ae.get(Be)||[],Ze=De.get(Be),it=(Ze==null?void 0:Ze.type)==="ADDED",ut=(Ze==null?void 0:Ze.type)==="REMOVED";return c.jsxs("div",{className:`pr-review-code-line-group ${Qe.length?"has-review":""} ${it?"is-added":""} ${ut?"is-removed":""}`,children:[c.jsxs("div",{className:"pr-review-code-line",children:[c.jsx(Oe,{className:"pr-review-line-comment-button",type:"text",size:"small",icon:c.jsx(TC,{}),"aria-label":`Comment on line ${Be}`,onClick:()=>Pe($e.filePath,Be,Xe)}),c.jsx("span",{className:"pr-review-code-line-marker",children:it?"+":ut?"-":""}),c.jsx("span",{className:"pr-review-code-line-number",children:it?"":(Ze==null?void 0:Ze.oldLine)||Be}),c.jsx("span",{className:"pr-review-code-line-number",children:ut?"":(Ze==null?void 0:Ze.newLine)||Be}),c.jsx("code",{children:Xe||" "})]}),Qe.map((pt,Lt)=>{const Pt=`${$e.filePath}:${pt.line}:${pt.rule}`,Qt=B.has(Pt);return c.jsxs("div",{className:`pr-review-inline-finding is-${pt.severity}`,children:[c.jsxs("div",{className:"pr-review-inline-finding-header",children:[c.jsxs(ct,{size:6,children:[Le(pt.severity),c.jsx(wr,{strong:!0,children:pt.rule})]}),pt.line&&(Qt?c.jsx($t,{color:"green",icon:c.jsx(gi,{}),children:"Commented"}):c.jsx(Oe,{size:"small",icon:c.jsx(TC,{}),onClick:()=>ke($e.filePath,pt),children:"Comment"}))]}),c.jsx(wr,{type:"secondary",children:pt.message})]},`${Pt}-${Lt}`)})]},`${$e.filePath}-${Be}`)})})]})]})}),o.filteredOut.length>0&&c.jsx(It,{title:`Ignored Files (${o.filteredOut.length})`,size:"small",children:c.jsx("div",{className:"pr-review-ignored-list",children:c.jsx(ct,{size:[4,8],wrap:!0,children:o.filteredOut.map(Ee=>c.jsx($t,{className:"pr-review-ignored-tag",children:Ee},Ee))})})}),c.jsx(bn,{title:c.jsxs(ct,{children:[c.jsx(TC,{}),c.jsx("span",{children:"Post Comment to Bitbucket PR"})]}),open:N,onCancel:()=>!z&&O(!1),onOk:Ie,okText:"Submit Comment",cancelText:"Cancel",confirmLoading:z,okButtonProps:{icon:c.jsx(hu,{})},width:600,children:I&&c.jsxs("div",{className:"pr-review-comment-body",children:[c.jsxs(Jye,{type:"secondary",className:"pr-review-comment-context",children:["File: ",c.jsx(wr,{code:!0,children:I.filePath})," (Line ",I.issue.line,")"]}),c.jsx(Ct.TextArea,{rows:6,value:M,onChange:Ee=>T(Ee.target.value),placeholder:"Write your review comment..."})]})})]})]})}const{Text:Fa,Title:tbe}=xn;function bI(){const e=window.location.hash||"",t=e.indexOf("?");return t===-1?"":new URLSearchParams(e.slice(t)).get("url")||""}function LC(){const e=window.location.hash||"",t=e.indexOf("?");return t!==-1&&new URLSearchParams(e.slice(t)).get("from")==="list"}function BC(e){if(e==null)return"";if(typeof e=="object"){if(Array.isArray(e.lines))return e.lines.map(t=>typeof t=="object"&&t!==null?t.text??"":String(t??"")).join(`
536
536
  `);if(typeof e.text=="string")return e.text}if(typeof e=="string"){const t=e.trim();if(t.startsWith("{")&&(t.includes('"lines"')||t.includes('"text"')))try{const n=JSON.parse(t);if(Array.isArray(n==null?void 0:n.lines))return n.lines.map(r=>typeof r=="object"&&r!==null?r.text??"":String(r??"")).join(`
537
- `);if(typeof(n==null?void 0:n.text)=="string")return n.text}catch{}}return String(e)}function nbe(e){if(typeof e=="string"){const t=e.trim();if(t.startsWith('{"text":')&&t.endsWith("}"))try{const n=JSON.parse(t);if(typeof n.text=="string")return n.text}catch{}}return e}function q9(e){const t=String(e||"").toUpperCase();return{ADD:"Added",ADDED:"Added",MODIFY:"Modified",MODIFIED:"Modified",DELETE:"Deleted",DELETED:"Deleted",COPY:"Copied",MOVE:"Moved",RENAME:"Renamed"}[t]||"Changed"}function rbe(e,t){const n=e.length,r=t.length,a=new Set,o=new Set;if(n*r>4e6){const v=Math.max(n,r);for(let y=0;y<v;y+=1)e[y]!==t[y]&&(y<n&&a.add(y),y<r&&o.add(y));return{sourceChanged:a,targetChanged:o}}const s=r+1,u=new Uint32Array((n+1)*s);for(let v=1;v<=n;v+=1)for(let y=1;y<=r;y+=1){const b=v*s+y;u[b]=e[v-1]===t[y-1]?u[(v-1)*s+y-1]+1:Math.max(u[(v-1)*s+y],u[v*s+y-1])}const f=new Set,m=new Set;let h=n,p=r;for(;h>0&&p>0;)e[h-1]===t[p-1]?(f.add(h-1),m.add(p-1),h-=1,p-=1):u[(h-1)*s+p]>=u[h*s+p-1]?h-=1:p-=1;for(let v=0;v<n;v+=1)f.has(v)||a.add(v);for(let v=0;v<r;v+=1)m.has(v)||o.add(v);return{sourceChanged:a,targetChanged:o}}function abe({file:e,choice:t,onChoice:n,sourceBranch:r,targetBranch:a}){if(!e)return c.jsx("div",{className:"pr-conflict-empty-editor",children:c.jsx(Xt,{description:"Select a conflicted file.",image:Xt.PRESENTED_IMAGE_SIMPLE})});const o=e.conflicted!==!1,s=q9(e.changeType),u=t||"target",f=u==="source"?e.sourceContent:e.targetContent,m=BC(f),h=BC(e.sourceContent).split(/\r?\n/),p=BC(e.targetContent).split(/\r?\n/),v=rbe(h,p)[u==="source"?"sourceChanged":"targetChanged"],y=m.split(/\r?\n/),b=r?`Use source (${r})`:"Use source",C=a?`Use target (${a})`:"Use target",x=u==="source"?r?`source branch (${r})`:"source branch":a?`target branch (${a})`:"target branch",w=m!=null&&(m!==""||y.length>1);return c.jsxs("div",{className:"pr-conflict-code-panel",children:[c.jsxs("div",{className:"pr-conflict-code-panel-header",children:[c.jsxs(ct,{size:8,wrap:!0,children:[c.jsx(Zs,{}),c.jsx(Fa,{strong:!0,className:"pr-conflict-file-path",children:e.path}),c.jsx($t,{color:o?"error":"default",children:o?"Conflict":s})]}),c.jsx(ct,{size:8,wrap:!0,children:o&&c.jsxs(er.Group,{value:u,onChange:$=>n($.target.value),optionType:"button",buttonStyle:"solid",size:"small",children:[c.jsx(er.Button,{value:"source",children:b}),c.jsx(er.Button,{value:"target",children:C})]})})]}),c.jsx("div",{className:"pr-conflict-file-meta",children:c.jsxs(ct,{size:8,wrap:!0,children:[c.jsx(Fa,{type:"secondary",children:"Current preview:"}),c.jsx($t,{color:o&&u==="target"?"purple":"blue",children:o?x:`Source branch ${s.toLowerCase()}`}),c.jsxs(Fa,{type:"secondary",children:["· ",y.length," lines"]})]})}),c.jsx("div",{className:"pr-conflict-code-lines",children:!w&&m===""&&y.length<=1&&!y[0]?c.jsx("div",{className:"pr-conflict-empty-lines",children:c.jsx(Fa,{type:"secondary",children:"(Empty file or no text content available in this branch)"})}):y.map(($,E)=>{const R=E+1,N=nbe($);return c.jsx("div",{className:`pr-conflict-code-line-group ${v.has(E)?"is-changed":""}`,children:c.jsxs("div",{className:"pr-conflict-code-line",children:[c.jsx("span",{className:"pr-conflict-code-line-number",children:R}),c.jsx("code",{children:N||" "})]})},R)})})]})}function xI({listOnly:e=!1}){var ge,Re,_e,ie;const[t]=wt.useForm(),[n,r]=l.useState(()=>bI()),[a,o]=l.useState(null),[s,u]=l.useState({}),[f,m]=l.useState(""),[h,p]=l.useState("Resolve PR conflicts"),[v,y]=l.useState([]),[b,C]=l.useState(!1),x=l.useRef(null),[w,$]=l.useState([]),[E,R]=l.useState(!1),[N,O]=l.useState(""),I=[...v,h.trim()].filter(Boolean).join(" "),j=async()=>{R(!0),O("");try{const fe=await Va.recentlyCreated();$(Array.isArray(fe)?fe:[])}catch(fe){O(fe.message||"Unable to load recently created Jira issues.")}finally{R(!1)}},M=l.useMemo(()=>Array.from(new Map(w.filter(fe=>fe.key).map(fe=>[fe.key,{value:fe.key,label:fe.key,summary:fe.summary||"No summary",searchText:`${fe.key} ${fe.summary||""}`.toLowerCase()}])).values()),[w]),[T,z]=l.useState(!1),[P,B]=l.useState(!1),[H,A]=l.useState(""),[L,F]=l.useState(!1),[U,q]=l.useState(!0),[_,K]=l.useState("resolve/pr-conflicts"),[X,V]=l.useState(""),[W,G]=l.useState(""),[Y,te]=l.useState([]),[ne,ue]=l.useState([]),[Z,ee]=l.useState("unresolved"),[re,oe]=l.useState(!1),[de,be]=l.useState(()=>LC()),J=fe=>{const we=v.length?`-${v.join("-")}`:"",ke=_.trim(),Ie=`${we&&ke.endsWith(we)?ke.slice(0,-we.length):ke}${fe.length?`-${fe.join("-")}`:""}`;y(fe),K(Ie),V(""),C(!1),requestAnimationFrame(()=>{var Ve,Le;return(Le=(Ve=x.current)==null?void 0:Ve.blur)==null?void 0:Le.call(Ve)})},ye=async(fe=_)=>{const we=fe.trim();if(!we||!U){V("");return}try{const ke=await uv.checkBranch({prUrl:n,branchName:we});ke!=null&&ke.exists?V(ke.error||`Branch already exists: ${we}`):V("")}catch{}},xe=async(fe=n)=>{var Pe,Ie;const we=fe.trim();if(!we)return;const ke=LC();window.location.hash=`#/pr-conflict?url=${encodeURIComponent(we)}${ke?"&from=list":""}`,z(!0),o(null),F(!1),G(""),A("");try{const Ve=await uv.load(we);o(Ve);const Le=Ve.files||[],je=Le.filter($e=>$e.conflicted!==!1);u(Object.fromEntries(je.map($e=>[$e.path,$e.defaultChoice||"target"]))),m(((Pe=je[0])==null?void 0:Pe.path)||((Ie=Le[0])==null?void 0:Ie.path)||"")}catch(Ve){an.error(Ve.message)}finally{z(!1)}},ze=async()=>{oe(!0);try{const fe=await uv.myConflicts();te(fe.unresolved||fe.values||[]),ue(fe.resolved||[])}catch(fe){an.error(fe.message)}finally{oe(!1)}};l.useEffect(()=>{const fe=()=>{const we=bI();be(LC()),r(we),t.setFieldValue("prUrl",we),!e&&we&&xe(we)};return window.addEventListener("hashchange",fe),e&&ze(),fe(),()=>window.removeEventListener("hashchange",fe)},[e]);const he=l.useMemo(()=>{var fe;return((fe=a==null?void 0:a.files)==null?void 0:fe.filter(we=>we.conflicted!==!1))||[]},[a]),ce=l.useMemo(()=>Object.keys(s).length,[s]),se=l.useMemo(()=>{var fe,we;return((fe=a==null?void 0:a.files)==null?void 0:fe.find(ke=>ke.path===f))||((we=a==null?void 0:a.files)==null?void 0:we[0])},[a,f]),ae=async()=>{var fe;if((fe=a==null?void 0:a.files)!=null&&fe.length){B(!0),A("");try{const we=await uv.resolve({prUrl:n,choices:s,commitMessage:I,createNewBranch:U,newBranchName:_.trim(),files:he.map(ke=>({path:ke.path}))});if(we!=null&&we.error){A(we.error),an.error(we.error,6);return}F(!0),we!=null&&we.prUrl?(G(we.prUrl),an.success("Resolution commit created and Pull Request opened successfully.")):an.success((we==null?void 0:we.message)||"Resolution commit created successfully."),we!=null&&we.commitUrl&&hr(we.commitUrl)}catch(we){const ke=(we==null?void 0:we.message)||"Unable to create resolution commit. Please try again.";A(ke),an.error(ke,6)}finally{B(!1)}}};return c.jsxs("div",{className:"pr-conflict-page",children:[c.jsx(Ur,{eyebrow:"BITBUCKET WORKFLOW",title:"Resolve PR conflicts",description:"Choose a version for each conflicted file, checkout from target, merge source, and resolve conflicts.",actions:c.jsx(Oe,{icon:c.jsx(ec,{}),onClick:()=>{window.location.hash=de?"#/pr-conflicts":"#/pr-review"},children:de?"Back to Resolve Conflicts":"Back to PR Review"})}),!e&&c.jsx(It,{className:"pr-conflict-input-card",children:c.jsx(wt,{form:t,layout:"vertical",onFinish:fe=>{r(fe.prUrl),xe(fe.prUrl)},children:c.jsx(wt.Item,{name:"prUrl",label:c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"},children:[c.jsx("span",{children:"Pull Request URL"}),c.jsx(Oe,{type:"link",size:"small",onClick:()=>{const fe="https://bitbucket.example.com/projects/DEMO/repos/demo-repo/pull-requests/999";t.setFieldValue("prUrl",fe),r(fe),xe(fe)},style:{height:"auto",marginLeft:8,padding:0,fontSize:"12px"},children:"Load Demo Sample Data"})]}),rules:[{required:!0,message:"Please enter a Bitbucket Pull Request URL."}],children:c.jsx(Ct,{size:"large",placeholder:"https://bitbucket.example.com/projects/PROJ/repos/repo/pull-requests/123",addonAfter:c.jsxs(ct,{size:4,split:c.jsx(lp,{type:"vertical"}),children:[c.jsx(Oe,{type:"link",icon:c.jsx(ul,{}),htmlType:"submit",children:"Load"}),c.jsx(Oe,{type:"link",icon:c.jsx(ul,{}),htmlType:"button",onClick:()=>{var we;const fe=(we=t.getFieldValue("prUrl"))==null?void 0:we.trim();fe?hr(fe):an.warning("Please enter a Pull Request URL first.")},children:"Open"})]})})})})}),!e&&T&&c.jsxs(It,{className:"pr-conflict-loading",children:[c.jsx(rr,{size:"large"}),c.jsx(Fa,{type:"secondary",children:"Loading pull request and conflict files…"})]}),e&&c.jsxs(It,{className:"pr-conflict-my-list-card",title:"My Pull Requests with conflicts",extra:c.jsx(Oe,{type:"link",size:"small",onClick:()=>{window.location.hash="#/pr-conflict?url=https%3A%2F%2Fbitbucket.example.com%2Fprojects%2FDEMO%2Frepos%2Fdemo-repo%2Fpull-requests%2F999&from=list"},children:"Load Demo Sample Data"}),loading:re,children:[c.jsx(Qa,{activeKey:Z,onChange:ee,items:[{key:"unresolved",label:`Unresolved (${Y.length})`},{key:"resolved",label:`Resolved (${ne.length})`}]}),(Z==="unresolved"?Y:ne).length===0?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:Z==="resolved"?"No resolved Pull Requests.":"No authored Pull Requests with conflicts."}):c.jsx(Ra,{dataSource:Z==="unresolved"?Y:ne,rowKey:fe=>`${fe.id}-${fe.resolutionPrId||"unresolved"}`,renderItem:fe=>c.jsx(Ra.Item,{actions:[c.jsx(Oe,{type:"link",icon:c.jsx(ul,{}),onClick:()=>hr(fe.url),children:"Open"},"open"),Z==="resolved"?c.jsx(Oe,{type:"link",icon:c.jsx(ul,{}),onClick:()=>hr(fe.resolutionPrUrl),children:"Open resolved PR"},"resolved-pr"):c.jsx(Oe,{type:"primary",icon:c.jsx(hu,{}),onClick:()=>{window.location.hash=`#/pr-conflict?url=${encodeURIComponent(fe.url)}&from=list`},children:"Resolve"},"resolve")],children:c.jsx(Ra.Item.Meta,{title:c.jsxs(ct,{wrap:!0,children:[c.jsxs(Fa,{strong:!0,children:["#",fe.id," ",fe.title]}),c.jsx($t,{color:"geekblue",children:fe.repositoryName}),c.jsx($t,{color:Z==="resolved"?"success":"error",children:Z==="resolved"?"Resolved":"Conflict"})]}),description:c.jsxs(ct,{wrap:!0,children:[c.jsx($t,{color:"blue",children:fe.sourceBranch}),c.jsx("span",{children:"→"}),c.jsx($t,{color:"purple",children:fe.targetBranch}),Z==="resolved"&&c.jsxs("a",{href:fe.resolutionPrUrl,target:"_blank",rel:"noreferrer",children:["Resolved PR #",fe.resolutionPrId]})]})})})})]}),!e&&!T&&a&&c.jsxs(ct,{direction:"vertical",size:16,className:"pr-conflict-content",children:[c.jsxs(It,{className:"pr-conflict-summary",children:[c.jsxs(Uo,{gutter:[20,16],align:"middle",children:[c.jsx(qn,{flex:"auto",children:c.jsxs(ct,{direction:"vertical",size:4,children:[c.jsx(tbe,{level:4,children:a.pr.title}),c.jsxs(ct,{wrap:!0,children:[c.jsx($t,{color:"blue",children:a.pr.sourceBranch}),c.jsx("span",{children:"→"}),c.jsx($t,{color:"purple",children:a.pr.targetBranch}),c.jsxs(Fa,{type:"secondary",children:[he.length," conflicted file",he.length===1?"":"s"," · ",a.files.length," changed"]})]})]})}),c.jsx(qn,{children:c.jsx(ct,{size:16,wrap:!0,children:c.jsx(Oe,{type:"primary",icon:c.jsx(hu,{}),loading:P,disabled:L||ce!==he.length||!h.trim()||U&&(!_.trim()||!!X),onClick:ae,children:L?"Committed":"Create resolution commit"})})})]}),c.jsxs("div",{className:"pr-conflict-commit-message",children:[c.jsx(Fa,{strong:!0,children:"Commit message"}),c.jsx(Ct,{value:h,onChange:fe=>p(fe.target.value),placeholder:"Describe why these conflicts were resolved",maxLength:200})]}),c.jsxs("div",{className:"pr-conflict-jira-tags",children:[c.jsx(Fa,{strong:!0,children:"Jira No"}),c.jsx($n,{mode:"multiple","aria-label":"Jira issues from Recently Created",open:b,onOpenChange:C,ref:x,placeholder:"Add Jira tags from Recently Created",value:v,onChange:J,autoClearSearchValue:!0,options:M,loading:E,allowClear:!0,showSearch:!0,onDropdownVisibleChange:fe=>{fe&&j()},filterOption:(fe,we)=>we.searchText.includes(fe.trim().toLowerCase()),optionRender:fe=>c.jsxs("div",{className:"pr-conflict-jira-option",children:[c.jsx(Fa,{strong:!0,children:fe.value}),c.jsx(Fa,{type:"secondary",children:fe.data.summary})]}),notFoundContent:E?c.jsx(rr,{size:"small"}):N||"No recently created Jira issues found."})]}),N&&c.jsx(Fa,{type:"danger",children:N}),v.length>0&&c.jsxs("div",{className:"pr-conflict-commit-preview",children:[c.jsx(Fa,{type:"secondary",children:"Commit preview: "}),c.jsx(Fa,{children:I})]}),c.jsxs("div",{className:"pr-conflict-branch-option",children:[c.jsx(tr,{checked:U,onChange:fe=>{q(fe.target.checked),fe.target.checked||V("")},children:"Create new branch to resolve"}),U&&c.jsxs("div",{className:"pr-conflict-branch-input-wrapper",children:[c.jsx(Ct,{status:X?"error":void 0,value:_,onChange:fe=>{K(fe.target.value),X&&V("")},onBlur:()=>ye(_),placeholder:"resolve/pr-123-conflicts",maxLength:200}),X&&c.jsx("div",{className:"pr-conflict-branch-error",children:c.jsx(Fa,{type:"danger",children:X})})]})]}),W&&c.jsx(mr,{className:"pr-conflict-resolution-pr",type:"success",showIcon:!0,message:"Resolution Pull Request created successfully.",description:c.jsx("a",{href:W,target:"_blank",rel:"noreferrer",children:"Open Pull Request"})}),H&&c.jsx(mr,{className:"pr-conflict-resolution-error",type:"error",showIcon:!0,message:"Unable to create resolution commit",description:H,closable:!0,onClose:()=>A("")})]}),a.files.length===0?c.jsx(It,{children:c.jsx(Xt,{description:"No conflicted files were returned by Bitbucket."})}):c.jsxs(It,{className:"pr-conflict-workspace",bodyStyle:{padding:0},children:[c.jsxs("aside",{className:"pr-conflict-file-list",children:[c.jsxs("div",{className:"pr-conflict-file-list-title",children:[c.jsxs(Fa,{strong:!0,children:[he.length," conflicted · ",a.files.length," changed files"]}),c.jsxs(ct,{size:4,wrap:!0,children:[c.jsx(Oe,{type:"link",size:"small",className:"pr-conflict-bulk-action",onClick:()=>u(Object.fromEntries(he.map(fe=>[fe.path,"source"]))),children:(ge=a.pr)!=null&&ge.sourceBranch?`Use source (${a.pr.sourceBranch}) for all`:"Use source for all"}),c.jsx(Oe,{type:"link",size:"small",className:"pr-conflict-bulk-action",onClick:()=>u(Object.fromEntries(he.map(fe=>[fe.path,"target"]))),children:(Re=a.pr)!=null&&Re.targetBranch?`Use target (${a.pr.targetBranch}) for all`:"Use target for all"})]})]}),a.files.map(fe=>{var Le,je;const we=fe.path===(se==null?void 0:se.path),ke=fe.conflicted!==!1,Pe=q9(fe.changeType),Ie=s[fe.path]||"source",Ve=Ie==="source"?(Le=a.pr)!=null&&Le.sourceBranch?`Source (${a.pr.sourceBranch})`:"Source":(je=a.pr)!=null&&je.targetBranch?`Target (${a.pr.targetBranch})`:"Target";return c.jsxs("button",{type:"button",className:`pr-conflict-file-list-item ${we?"is-selected":""}`,onClick:()=>m(fe.path),title:ke?`${fe.path} - ${Ve}`:`${fe.path} - ${Pe} file`,children:[c.jsx(Zs,{}),c.jsx("span",{className:"pr-conflict-file-list-path",children:fe.path}),ke?c.jsx("span",{className:`pr-conflict-file-list-choice is-${Ie}`,title:Ve,children:Ie==="source"?"S":"T"}):c.jsx($t,{className:"pr-conflict-file-list-status",children:Pe})]},fe.path)})]}),c.jsx("section",{className:"pr-conflict-editor-pane",children:c.jsx(abe,{file:se,choice:s[se==null?void 0:se.path],sourceBranch:(_e=a.pr)==null?void 0:_e.sourceBranch,targetBranch:(ie=a.pr)==null?void 0:ie.targetBranch,onChoice:fe=>u(we=>({...we,[se.path]:fe}))})})]})]})]})}const{Text:CI}=xn;function obe({open:e,filters:t,templates:n,onCancel:r,onFilterSave:a,onDelete:o,onTemplateSave:s,onTemplateDelete:u}){const[f,m]=l.useState(""),[h,p]=l.useState("filters"),[v,y]=l.useState(null),[b,C]=l.useState(null),[x]=wt.useForm(),[w]=wt.useForm();l.useEffect(()=>{e&&Wn.status().then(O=>{m(O.domain||"")}).catch(()=>{})},[e]),l.useEffect(()=>{v?x.setFieldsValue(v):x.resetFields()},[v,x]),l.useEffect(()=>{b?w.setFieldsValue(b):w.resetFields()},[b,w]);const $=async()=>{try{const O=await x.validateFields();await a(O,v),y(null),x.resetFields()}catch{}},E=async()=>{try{const O=await w.validateFields();await s(O,b),C(null),w.resetFields()}catch{}},R=[{title:"Filter Name",dataIndex:"name",key:"name",render:(O,I)=>{const j=gye(f,I.filterId);return c.jsxs(ct,{size:4,children:[c.jsx("a",{style:{fontWeight:600},onClick:M=>{M.preventDefault(),hr(j)},title:"Open filter in Jira",children:O}),c.jsx(zy,{className:"jira-filter-external-icon",onClick:()=>hr(j),title:"Open filter in Jira"})]})}},{title:"Filter ID",dataIndex:"filterId",key:"filterId",width:150,render:O=>c.jsx(CI,{code:!0,children:O})},{title:"Action",key:"action",width:130,align:"right",render:(O,I)=>c.jsxs(ct,{size:"small",children:[c.jsx(Oe,{type:"text",icon:c.jsx(Wo,{}),onClick:()=>y(I)}),c.jsx(Gr,{title:"Delete filter?",description:"Are you sure you want to delete this filter?",onConfirm:()=>o(I.id),okText:"Yes",cancelText:"No",children:c.jsx(Oe,{type:"text",danger:!0,icon:c.jsx(Fn,{})})})]})}],N=[{title:"Name",dataIndex:"name",key:"name",render:(O,I)=>c.jsxs(ct,{size:4,children:[c.jsx("span",{children:O}),I.summary&&c.jsx(yn,{title:I.summary,children:c.jsx(_y,{className:"jira-filter-external-icon"})})]})},{title:"Jira No",dataIndex:"jiraNo",key:"jiraNo",width:150,render:O=>c.jsx("a",{onClick:()=>hr(Ly(f,O)),children:c.jsx(CI,{code:!0,children:O})})},{title:"Action",key:"action",width:130,align:"right",render:(O,I)=>c.jsxs(ct,{size:"small",children:[c.jsx(Oe,{type:"text",icon:c.jsx(Wo,{}),onClick:()=>C(I)}),c.jsx(Gr,{title:"Delete template?",onConfirm:()=>u(I.id),okText:"Yes",cancelText:"No",children:c.jsx(Oe,{type:"text",danger:!0,icon:c.jsx(Fn,{})})})]})}];return c.jsx(bn,{className:"jira-filter-modal",title:"Settings",open:e,onCancel:r,footer:null,width:640,children:c.jsx(Qa,{activeKey:h,onChange:p,items:[{key:"filters",label:"Filter List",children:c.jsxs(c.Fragment,{children:[c.jsx(ar,{rowKey:"id",dataSource:t,columns:R,pagination:!1,size:"small"}),c.jsxs(wt,{form:x,layout:"vertical",style:{marginTop:20},children:[c.jsx(wt.Item,{name:"name",label:"Filter Name",rules:[{required:!0,message:"Please enter filter name"}],children:c.jsx(Ct,{placeholder:"e.g. My Sprint Issues"})}),c.jsx(wt.Item,{name:"filterId",label:"Filter ID",rules:[{required:!0,message:"Please enter Jira Filter ID"}],children:c.jsx(Ct,{placeholder:"e.g. 12345"})}),c.jsxs(ct,{children:[c.jsx(Oe,{type:"primary",icon:c.jsx(Xn,{}),onClick:$,children:v!=null&&v.id?"Save Filter":"Add Filter"}),v&&c.jsx(Oe,{onClick:()=>y(null),children:"Cancel"})]})]})]})},{key:"templates",label:"Template List",children:c.jsxs(c.Fragment,{children:[c.jsx(ar,{rowKey:"id",dataSource:n,columns:N,pagination:!1,size:"small"}),c.jsxs(wt,{form:w,layout:"vertical",style:{marginTop:20},children:[c.jsx(wt.Item,{name:"name",label:"Name",rules:[{required:!0,message:"Please enter template name"}],children:c.jsx(Ct,{placeholder:"e.g. Bug template"})}),c.jsx(wt.Item,{name:"jiraNo",label:"Jira No",rules:[{required:!0,message:"Please enter Jira No"}],children:c.jsx(Ct,{placeholder:"e.g. PROJ-123"})}),c.jsxs(ct,{children:[c.jsx(Oe,{type:"primary",icon:c.jsx(Xn,{}),onClick:E,children:b!=null&&b.id?"Save Template":"Add Template"}),b&&c.jsx(Oe,{onClick:()=>C(null),children:"Cancel"})]})]})]})}]})})}const{Text:SI}=xn;function ibe({open:e,confirmLoading:t,issue:n,onCancel:r,onClone:a}){const[o]=wt.useForm();l.useEffect(()=>{e&&n?o.setFieldsValue({summary:n.summary||""}):o.resetFields()},[e,n,o]);const s=async()=>{try{const u=await o.validateFields();await a(u)}catch{}};return c.jsx(bn,{title:n?`Clone Ticket (${n.key})`:"Clone Ticket",open:e,onCancel:r,onOk:s,confirmLoading:t,destroyOnClose:!0,okText:"Clone",children:c.jsxs(wt,{form:o,layout:"vertical",style:{marginTop:16},children:[c.jsxs(wt.Item,{label:"Original Ticket",children:[c.jsx(SI,{code:!0,children:n==null?void 0:n.key})," ",c.jsx(SI,{type:"secondary",children:n==null?void 0:n.summary})]}),c.jsx(wt.Item,{name:"summary",label:"Clone Ticket Summary",rules:[{required:!0,message:"Please enter clone ticket summary"}],children:c.jsx(Ct,{placeholder:"Enter summary for the cloned ticket"})})]})})}function lbe({open:e,confirmLoading:t,templates:n,onCancel:r,onCreate:a}){const[o]=wt.useForm(),s=wt.useWatch("templateId",o);l.useEffect(()=>{e&&(o.resetFields(),n!=null&&n.length&&o.setFieldsValue({templateId:n[0].id,summary:n[0].summary||n[0].name}))},[e,n,o]),l.useEffect(()=>{const f=n==null?void 0:n.find(m=>m.id===s);f&&o.setFieldValue("summary",f.summary||f.name)},[s,n,o]);const u=async()=>{try{await a(await o.validateFields())}catch{}};return c.jsx(bn,{title:"Create Jira",open:e,onCancel:r,onOk:u,confirmLoading:t,okText:"Create",destroyOnClose:!0,children:c.jsxs(wt,{form:o,layout:"vertical",style:{marginTop:16},children:[c.jsx(wt.Item,{name:"templateId",label:"Template",rules:[{required:!0,message:"Please select a template"}],children:c.jsx($n,{placeholder:"Select a template",options:(n||[]).map(f=>({value:f.id,label:`${f.name} (${f.jiraNo})`}))})}),c.jsx(wt.Item,{name:"summary",label:"Summary",rules:[{required:!0,message:"Please enter summary"}],children:c.jsx(Ct,{placeholder:"Enter new Jira summary"})})]})})}const{Text:Od}=xn,hv=e=>{if(!e)return"—";const t=new Date(e);return isNaN(t.getTime())?"—":new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(t)},HC=e=>{if(!e)return"default";const t=(typeof e=="string"?e:e.name||"").toLowerCase();return t.includes("blocker")||t.includes("highest")||t.includes("p0")||t.includes("urgent")?"red":t.includes("critical")||t.includes("high")||t.includes("p1")?"volcano":t.includes("major")||t.includes("medium")||t.includes("normal")||t.includes("p2")?"orange":t.includes("minor")||t.includes("low")||t.includes("p3")?"blue":t.includes("trivial")||t.includes("lowest")||t.includes("p4")?"cyan":"default"},Gv=(e,t)=>String(e||"").localeCompare(String(t||""),void 0,{sensitivity:"base",numeric:!0}),wI=e=>{const t=String(e||"").toLowerCase();return t.includes("blocker")||t.includes("highest")||t.includes("p0")||t.includes("urgent")?0:t.includes("critical")||t.includes("high")||t.includes("p1")?1:t.includes("major")||t.includes("medium")||t.includes("normal")||t.includes("p2")?2:t.includes("minor")||t.includes("low")||t.includes("p3")?3:t.includes("trivial")||t.includes("lowest")||t.includes("p4")?4:5},FC=(e,t)=>wI(e)-wI(t)||Gv(e,t);function sbe({open:e,onCancel:t}){const[n,r]=l.useState("created"),[a,o]=l.useState(""),[s,u]=l.useState(!1),[f,m]=l.useState(""),[h,p]=l.useState({created:[],commented:[],mentioned:[],updated:[]}),v=l.useRef(new Set),y=l.useCallback(async(j,M=!1)=>{if(!(!M&&v.current.has(j))){u(!0),m("");try{let T=[];j==="created"?T=await Va.recentlyCreated():j==="commented"?T=await Va.recentlyCommented():j==="mentioned"?T=await Va.recentlyMentioned():j==="updated"&&(T=await Va.recentlyUpdated()),p(z=>({...z,[j]:Array.isArray(T)?T:[]})),v.current.add(j)}catch(T){m((T==null?void 0:T.message)||`Failed to load ${j} issues.`),v.current.add(j)}finally{u(!1)}}},[]);l.useEffect(()=>{e&&y(n)},[e,n,y]);const b=j=>{r(j),o(""),m("")},C=()=>{y(n,!0)},x=l.useMemo(()=>{const j=h[n]||[];if(!a.trim())return j;const M=a.trim().toLowerCase();return j.filter(T=>{const z=String(T.key||"").toLowerCase(),P=String(T.summary||"").toLowerCase(),B=String(T.author||T.commentAuthor||T.mentionedBy||T.assignee||"").toLowerCase(),H=String(T.commentSnippet||T.mentionSnippet||"").toLowerCase(),A=String(T.templateName||"").toLowerCase();return z.includes(M)||P.includes(M)||B.includes(M)||H.includes(M)||A.includes(M)})},[h,n,a]),N={created:[{title:"Jira No",dataIndex:"key",key:"key",width:120,render:(j,M)=>c.jsx("a",{onClick:()=>hr(M.url),children:j})},{title:"Summary",dataIndex:"summary",key:"summary",render:j=>c.jsx("div",{className:"jira-recent-summary",title:j,children:j})},{title:"Template",dataIndex:"templateName",key:"templateName",width:180,render:j=>c.jsx(Od,{type:"secondary",children:j||"—"})},{title:"Created",dataIndex:"createdAt",key:"createdAt",width:160,align:"center",render:j=>c.jsx(Od,{type:"secondary",children:hv(j)})}],commented:[{title:"Jira No",dataIndex:"key",key:"key",width:120,render:(j,M)=>c.jsx("a",{onClick:()=>hr(M.url),children:j})},{title:"Summary",dataIndex:"summary",key:"summary",width:280,render:j=>c.jsx("div",{className:"jira-recent-summary",title:j,children:j})},{title:"My Comment",dataIndex:"commentSnippet",key:"commentSnippet",render:j=>c.jsx("div",{className:"jira-recent-snippet",title:j,children:j||"—"})},{title:"Status",dataIndex:"status",key:"status",width:110,sorter:(j,M)=>Gv(j.status,M.status),render:j=>j?c.jsx($t,{children:j}):"—"},{title:"Priority",dataIndex:"priority",key:"priority",width:100,sorter:(j,M)=>FC(j.priority,M.priority),render:j=>j?c.jsx($t,{color:HC(j),children:j}):"—"},{title:"Commented",dataIndex:"commentedAt",key:"commentedAt",width:160,align:"center",render:j=>c.jsx(Od,{type:"secondary",children:hv(j)})}],mentioned:[{title:"Jira No",dataIndex:"key",key:"key",width:120,render:(j,M)=>c.jsx("a",{onClick:()=>hr(M.url),children:j})},{title:"Summary",dataIndex:"summary",key:"summary",width:260,render:j=>c.jsx("div",{className:"jira-recent-summary",title:j,children:j})},{title:"Mentioned By",dataIndex:"mentionedBy",key:"mentionedBy",width:140,render:j=>c.jsx(Od,{strong:!0,children:j||"—"})},{title:"Mention Snippet",dataIndex:"mentionSnippet",key:"mentionSnippet",render:j=>c.jsx("div",{className:"jira-recent-snippet",title:j,children:j||"—"})},{title:"Status",dataIndex:"status",key:"status",width:110,sorter:(j,M)=>Gv(j.status,M.status),render:j=>j?c.jsx($t,{children:j}):"—"},{title:"Priority",dataIndex:"priority",key:"priority",width:100,sorter:(j,M)=>FC(j.priority,M.priority),render:j=>j?c.jsx($t,{color:HC(j),children:j}):"—"},{title:"Mentioned",dataIndex:"mentionedAt",key:"mentionedAt",width:160,align:"center",render:j=>c.jsx(Od,{type:"secondary",children:hv(j)})}],updated:[{title:"Jira No",dataIndex:"key",key:"key",width:120,render:(j,M)=>c.jsx("a",{onClick:()=>hr(M.url),children:j})},{title:"Summary",dataIndex:"summary",key:"summary",render:j=>c.jsx("div",{className:"jira-recent-summary",title:j,children:j})},{title:"Status",dataIndex:"status",key:"status",width:110,sorter:(j,M)=>Gv(j.status,M.status),render:j=>j?c.jsx($t,{children:j}):"—"},{title:"Priority",dataIndex:"priority",key:"priority",width:100,sorter:(j,M)=>FC(j.priority,M.priority),render:j=>j?c.jsx($t,{color:HC(j),children:j}):"—"},{title:"Updated",dataIndex:"updatedAt",key:"updatedAt",width:160,align:"center",render:j=>c.jsx(Od,{type:"secondary",children:hv(j)})}]},O={created:"No Jira created via +Jira yet.",commented:"No recently commented issues found.",mentioned:"No recently mentioned issues found.",updated:"No recently updated issues found."},I=[{key:"created",label:`Created${h.created.length?` (${h.created.length})`:""}`},{key:"commented",label:`Commented${h.commented.length?` (${h.commented.length})`:""}`},{key:"mentioned",label:`Mentioned${h.mentioned.length?` (${h.mentioned.length})`:""}`},{key:"updated",label:`Updated${h.updated.length?` (${h.updated.length})`:""}`}];return c.jsxs(bn,{title:"Recently",open:e,onCancel:t,footer:null,width:1100,className:"jira-recently-modal",children:[c.jsx(Qa,{activeKey:n,onChange:b,items:I,tabBarExtraContent:c.jsxs(ct,{size:8,children:[c.jsx(Ct,{placeholder:"Search in tab...",prefix:c.jsx(jo,{}),allowClear:!0,value:a,onChange:j=>o(j.target.value),style:{width:190}}),c.jsx(Oe,{icon:c.jsx(Xa,{}),loading:s,onClick:C,children:"Refresh"})]}),style:{marginBottom:12}}),f?c.jsx(mr,{type:"error",showIcon:!0,message:f,action:c.jsx(Oe,{size:"small",danger:!0,onClick:C,children:"Retry"}),style:{marginBottom:12}}):null,c.jsx(ar,{rowKey:"id",dataSource:x,columns:N[n],loading:s,pagination:{pageSize:30,showSizeChanger:!1,hideOnSinglePage:!0},size:"small",locale:{emptyText:c.jsx(Xt,{description:a?"No matching issues found.":O[n],image:Xt.PRESENTED_IMAGE_SIMPLE})}})]})}const{Text:Dm}=xn,cbe=e=>{if(!e)return"default";const t=(typeof e=="string"?e:e.name||"").toLowerCase();return t.includes("blocker")||t.includes("highest")||t.includes("p0")||t.includes("urgent")?"red":t.includes("critical")||t.includes("high")||t.includes("p1")?"volcano":t.includes("major")||t.includes("medium")||t.includes("normal")||t.includes("p2")?"orange":t.includes("minor")||t.includes("low")||t.includes("p3")?"blue":t.includes("trivial")||t.includes("lowest")||t.includes("p4")?"cyan":"default"},$I=e=>e?typeof e=="string"?e:e.name||"—":"—",EI=e=>{if(!e)return 0;const t=(typeof e=="string"?e:e.name||"").toLowerCase();return t.includes("blocker")||t.includes("highest")||t.includes("p0")||t.includes("urgent")?50:t.includes("critical")||t.includes("high")||t.includes("p1")?40:t.includes("major")||t.includes("medium")||t.includes("normal")||t.includes("p2")?30:t.includes("minor")||t.includes("low")||t.includes("p3")?20:t.includes("trivial")||t.includes("lowest")||t.includes("p4")?10:0},K9=(e,t,n)=>{if(!t||!Array.isArray(e))return null;const r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b${r}\\b`,"i"),o=e.find(s=>{const u=a.test(s.title||""),f=a.test(s.description||""),m=!!(n&&s.description&&s.description.includes(n));return u||f||m});return o?{isAdded:!0,completed:!!o.completed,todoItem:o}:null},jI=(e,t,n)=>!!K9(e,t,n);function ube(){const{message:e}=Pr.useApp(),[t,n]=l.useState([]),[r,a]=l.useState(null),[o,s]=l.useState({}),[u,f]=l.useState(!0),[m,h]=l.useState(!1),[p,v]=l.useState(""),[y,b]=l.useState([]),[C,x]=l.useState(!1),[w,$]=l.useState([]),[E,R]=l.useState(!1),[N,O]=l.useState(!1),[I,j]=l.useState(!1),[M,T]=l.useState(!1),[z,P]=l.useState(!1),[B,H]=l.useState(null),[A,L]=l.useState({open:!1,x:0,y:0,record:null}),F=l.useCallback(async()=>{try{const Z=await Wa.list();b(Z)}catch{}},[]),U=l.useCallback(async()=>{try{const Z=await Va.list();n(Z),Z.length>0?(!r||!Z.some(ee=>ee.id===r))&&a(Z[0].id):(a(null),s({}))}catch(Z){e.error(Z.message)}finally{f(!1)}},[r,e]),q=l.useCallback(async()=>{try{$(await Va.templates.list())}catch(Z){e.error(Z.message)}},[e]),_=l.useCallback(async Z=>{if(Z){h(!0),v("");try{const ee=await Va.issues(Z);s(re=>({...re,[Z]:ee.issues||[]}))}catch(ee){v(ee.message),s(re=>{const oe={...re};return delete oe[Z],oe})}finally{h(!1)}}},[]);l.useEffect(()=>{U(),F(),q()},[U,F,q]),l.useEffect(()=>{r&&_(r)},[r,_]),l.useEffect(()=>{if(!A.open)return;const Z=()=>{L(ee=>({...ee,open:!1}))};return window.addEventListener("click",Z),window.addEventListener("contextmenu",Z),()=>{window.removeEventListener("click",Z),window.removeEventListener("contextmenu",Z)}},[A.open]);const K=async(Z,ee)=>{try{if(ee)await Va.update(ee.id,Z),e.success("Filter updated");else{const re=await Va.create(Z);e.success("Filter created"),a(re.id)}await U()}catch(re){throw e.error(re.message),re}},X=async Z=>{var ee;if(!(!B||!r)){P(!0);try{const re=await Va.cloneIssue({filterId:r,issueKey:B.key,issueType:B.issueType,summary:Z.summary});e.success(`Cloned issue [${((ee=re.issue)==null?void 0:ee.key)||B.key}] successfully`),T(!1),H(null),_(r)}catch(re){e.error(re.message||"Failed to clone ticket")}finally{P(!1)}}},V=async Z=>{var re;const ee=w.find(oe=>oe.id===Z.templateId);if(!(ee!=null&&ee.jiraNo)){e.error("Selected template does not have a valid source Jira issue number.");return}j(!0);try{const oe=await Va.cloneIssue({issueKey:ee.jiraNo,summary:Z.summary,templateName:ee.name,trackRecent:!0});e.success(`Created Jira [${((re=oe.issue)==null?void 0:re.key)||ee.jiraNo}] successfully`),R(!1),r&&_(r)}catch(oe){e.error(oe.message||"Failed to create Jira")}finally{j(!1)}},W=async(Z,ee)=>{try{ee!=null&&ee.id?await Va.templates.update(ee.id,Z):await Va.templates.create(Z),e.success(ee!=null&&ee.id?"Template updated":"Template created"),await q()}catch(re){throw e.error(re.message),re}},G=async Z=>{try{await Va.templates.remove(Z),e.success("Template deleted"),await q()}catch(ee){e.error(ee.message)}},Y=async Z=>{try{await Va.remove(Z),e.success("Filter deleted"),await U()}catch(ee){e.error(ee.message)}},te=async Z=>{if(!(!Z||!Z.key))try{const ee=await Wa.list();if(jI(ee,Z.key,Z.url)){e.info(`Task [${Z.key}] is already in the Todo list`);return}const oe=$I(Z.priority).toLowerCase();let de="medium";oe.includes("blocker")||oe.includes("highest")||oe.includes("critical")||oe.includes("high")||oe.includes("p0")||oe.includes("p1")?de="high":(oe.includes("minor")||oe.includes("low")||oe.includes("trivial")||oe.includes("lowest")||oe.includes("p3")||oe.includes("p4"))&&(de="low");const be={title:`[${Z.key}] ${Z.summary}`,description:Z.url?`[${Z.key}](${Z.url}) - ${Z.summary}`:Z.summary,priority:de,category:"work",dueDate:Z.dueDate||null,completed:!1,archived:!1};await Wa.create(be),e.success(`Added [${Z.key}] to Todo list`),F()}catch(ee){e.error(ee.message||"Failed to add to Todo list")}},ne=[{title:"Summary",dataIndex:"summary",key:"summary",width:480,sorter:(Z,ee)=>(Z.summary||"").localeCompare(ee.summary||""),render:(Z,ee)=>{const re=K9(y,ee.key,ee.url);return c.jsxs("div",{className:"jira-issue-summary",children:[re&&(re.completed?c.jsx(yn,{title:"Todo: Completed (已完成)",children:c.jsx(Hi,{className:"jira-todo-complete",style:{fontSize:15,flexShrink:0}})}):c.jsx(yn,{title:"Todo: Pending (待处理)",children:c.jsx(vge,{className:"jira-todo-pending",style:{fontSize:15,flexShrink:0}})})),c.jsx(Dm,{code:!0,style:{fontSize:12,flexShrink:0,whiteSpace:"nowrap",cursor:"pointer",marginTop:1},onClick:oe=>{oe.preventDefault(),oe.stopPropagation(),ee.key&&(navigator.clipboard.writeText(ee.key),e.success(`Copied ${ee.key}`))},title:"Click to copy Jira Key",children:ee.key}),c.jsx("a",{className:"jira-issue-link",title:Z,onClick:oe=>{oe.preventDefault(),hr(ee.url)},children:Z})]})}},{title:"Status",dataIndex:"status",key:"status",width:125,align:"center",sorter:(Z,ee)=>(Z.status||"").localeCompare(ee.status||""),render:Z=>Z?c.jsx($t,{style:{whiteSpace:"nowrap"},children:Z}):c.jsx(Dm,{type:"secondary",children:"—"})},{title:"Priority",dataIndex:"priority",key:"priority",width:100,align:"center",sorter:(Z,ee)=>EI(Z.priority)-EI(ee.priority),render:Z=>{const ee=$I(Z),re=cbe(Z);return c.jsx($t,{color:re,style:{whiteSpace:"nowrap"},children:ee})}},{title:"Due Date",dataIndex:"dueDate",key:"dueDate",width:90,align:"center",sorter:(Z,ee)=>(Z.dueDate||"").localeCompare(ee.dueDate||""),render:Z=>Z?c.jsx(Dm,{type:"secondary",style:{whiteSpace:"nowrap"},children:Z}):c.jsx(Dm,{type:"secondary",children:"—"})}],ue=A.record?jI(y,A.record.key,A.record.url):!1;return c.jsxs("div",{className:"jira-filters-page",children:[c.jsx(Ur,{actions:c.jsxs(ct,{wrap:!0,children:[c.jsx(Oe,{onClick:()=>x(!0),children:"Settings"}),c.jsx(Oe,{onClick:()=>O(!0),children:"Recently"}),c.jsx(Oe,{type:"primary",icon:c.jsx(Xn,{}),onClick:()=>R(!0),disabled:!w.length,children:"Jira"})]}),description:"Track issues across configured Jira filters.",title:"Jira Workspace"}),u?c.jsx("div",{className:"jira-filter-loading",children:c.jsx(rr,{size:"large"})}):t.length?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"jira-filter-tabs-bar",children:[c.jsx("div",{className:"jira-filter-tabs",children:c.jsx(Qa,{activeKey:r,onChange:a,items:t.map(Z=>{var oe;const ee=Z.id in o,re=(oe=o[Z.id])==null?void 0:oe.length;return{key:Z.id,label:ee?`${Z.name} (${re})`:Z.name}})})}),r&&c.jsx(Oe,{className:"jira-filter-refresh",icon:c.jsx(Xa,{}),loading:m,onClick:()=>_(r),children:"Refresh"})]}),m&&!(r in o)?c.jsx("div",{className:"jira-filter-loading",children:c.jsx(rr,{size:"large"})}):p&&!(r in o)?c.jsxs("div",{className:"jira-filter-error",children:[c.jsx(Dm,{danger:!0,children:p}),c.jsx("div",{style:{marginTop:12},children:c.jsx(Oe,{size:"small",icon:c.jsx(Xa,{}),onClick:()=>_(r),children:"Retry"})})]}):c.jsx(ar,{className:"jira-filters-table",tableLayout:"fixed",rowKey:"id",dataSource:o[r]||[],columns:ne,pagination:!1,scroll:{x:"max-content"},onRow:Z=>({onContextMenu:ee=>{ee.preventDefault(),ee.stopPropagation(),F(),L({open:!0,x:ee.clientX,y:ee.clientY,record:Z})}})})]}):c.jsx(Xt,{className:"jira-filter-empty",description:"No Jira filters configured yet."}),A.open&&c.jsx(Bl,{trigger:["click"],menu:{items:[{key:"add-todo",disabled:ue,icon:c.jsx(mu,{style:ue?{color:"#52c41a"}:void 0}),label:ue?"Already in To-Do":"Add to To-Do",onClick:()=>{A.record&&!ue&&te(A.record),L(Z=>({...Z,open:!1}))}},{key:"clone-issue",icon:c.jsx(fo,{}),label:"Clone Ticket",onClick:()=>{A.record&&(H(A.record),T(!0)),L(Z=>({...Z,open:!1}))}},{key:"open-jira",icon:c.jsx(zy,{}),label:"Open in Jira",onClick:()=>{var Z;(Z=A.record)!=null&&Z.url&&hr(A.record.url),L(ee=>({...ee,open:!1}))}}]},open:A.open,onOpenChange:Z=>{Z||L(ee=>({...ee,open:!1}))},children:c.jsx("div",{style:{position:"fixed",left:A.x,top:A.y,width:1,height:1,zIndex:9999}})}),c.jsx(obe,{open:C,filters:t,templates:w,onCancel:()=>x(!1),onFilterSave:K,onDelete:Y,onTemplateSave:W,onTemplateDelete:G}),c.jsx(lbe,{open:E,confirmLoading:I,templates:w,onCancel:()=>{I||R(!1)},onCreate:V}),c.jsx(sbe,{open:N,onCancel:()=>O(!1)}),c.jsx(ibe,{open:M,confirmLoading:z,issue:B,onCancel:()=>{z||(T(!1),H(null))},onClone:X})]})}const{TextArea:dbe}=Ct;function fbe({open:e,editingTodo:t,onCancel:n,onSave:r}){const[a]=wt.useForm();l.useEffect(()=>{e&&(t?a.setFieldsValue({title:t.title||"",description:t.description||"",priority:t.priority||"medium",category:t.category||"work",dueDate:t.dueDate?dr(t.dueDate):null}):(a.resetFields(),a.setFieldsValue({priority:"medium",category:"work"})))},[e,t,a]);const o=async()=>{try{const s=await a.validateFields();r({...s,dueDate:s.dueDate?s.dueDate.format("YYYY-MM-DD"):null})}catch{}};return c.jsx(bn,{title:t?"Edit Task":"New Task",open:e,onOk:o,onCancel:n,destroyOnClose:!0,okText:t?"Save":"Create",cancelText:"Cancel",children:c.jsxs(wt,{className:"todo-modal-form",form:a,layout:"vertical",children:[c.jsx(wt.Item,{name:"title",label:"Task Title",rules:[{required:!0,message:"Please enter task title"}],children:c.jsx(Ct,{placeholder:"Enter task title...",maxLength:100,showCount:!0})}),c.jsx(wt.Item,{name:"description",label:"Description / Notes",children:c.jsx(dbe,{rows:6,placeholder:"Add relevant details, background, or notes...",maxLength:500,showCount:!0})}),c.jsxs("div",{className:"todo-modal-grid",children:[c.jsx(wt.Item,{name:"priority",label:"Priority",children:c.jsx($n,{options:[{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}]})}),c.jsx(wt.Item,{name:"category",label:"Category",children:c.jsx($n,{options:[{value:"work",label:c.jsxs(ct,{size:4,children:[c.jsx(Ah,{className:"todo-tone-icon is-brand"}),c.jsx("span",{children:"Work"})]})},{value:"dev",label:c.jsxs(ct,{size:4,children:[c.jsx(wa,{className:"todo-tone-icon is-purple"}),c.jsx("span",{children:"Dev"})]})},{value:"bug",label:c.jsxs(ct,{size:4,children:[c.jsx(Th,{className:"todo-tone-icon is-danger"}),c.jsx("span",{children:"Bug"})]})},{value:"feature",label:c.jsxs(ct,{size:4,children:[c.jsx(qo,{className:"todo-tone-icon is-success"}),c.jsx("span",{children:"Feature"})]})},{value:"personal",label:c.jsxs(ct,{size:4,children:[c.jsx(Dh,{className:"todo-tone-icon is-orange"}),c.jsx("span",{children:"Personal"})]})}]})}),c.jsx(wt.Item,{name:"dueDate",label:"Due Date",children:c.jsx(vl,{className:"todo-modal-date",placeholder:"Select date"})})]})]})})}function $0({text:e,domain:t,jiraIssuePrefix:n,style:r,className:a}){if(!e)return null;const o=[],s=/\[[^\]]+\]\(https?:\/\/[^\s)]+\)|https?:\/\/[^\s]+/g;let u=0;const f=(n||"").split(/[\s,]+/).filter(Boolean).map(p=>p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),m=f.length>0?new RegExp(`\\b(?:${f.join("|")})-[a-zA-Z0-9]{1,10}\\b`,"gi"):/\b[A-Z]{2,10}-\d+\b/g,h=(p,v)=>{const y=[];let b=0;m.lastIndex=0;for(const C of p.matchAll(m)){C.index>b&&y.push(p.slice(b,C.index));const x=C[0],w=t?Ly(t,x):null;w?y.push(c.jsx("a",{href:w,target:"_blank",rel:"noreferrer",onClick:$=>{$.preventDefault(),$.stopPropagation(),hr(w)},className:"todo-link is-jira",children:x},`${v}-${C.index}`)):y.push(x),b=C.index+x.length}return b<p.length&&y.push(p.slice(b)),y};for(const p of e.matchAll(s)){p.index>u&&o.push(...h(e.slice(u,p.index),`txt-${p.index}`));const v=p[0].match(/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/);if(v)o.push(c.jsx("a",{href:v[2],target:"_blank",rel:"noreferrer",onClick:y=>{y.preventDefault(),y.stopPropagation(),hr(v[2])},className:"todo-link",children:v[1]},p.index));else{const y=p[0].replace(/[),.;:!?]+$/,"");o.push(c.jsx("a",{href:y,target:"_blank",rel:"noreferrer",onClick:b=>{b.preventDefault(),b.stopPropagation(),hr(y)},className:"todo-link",children:y},p.index)),p[0].length>y.length&&o.push(p[0].slice(y.length))}u=p.index+p[0].length}return u<e.length&&o.push(...h(e.slice(u),"txt-end")),c.jsx("span",{style:r,className:a,children:o})}const{Text:Oi}=xn,mbe={work:{label:"Work",icon:c.jsx(Ah,{}),color:"purple"},dev:{label:"Dev",icon:c.jsx(wa,{}),color:"purple"},bug:{label:"Bug",icon:c.jsx(Th,{}),color:"red"},feature:{label:"Feature",icon:c.jsx(qo,{}),color:"green"},personal:{label:"Personal",icon:c.jsx(Dh,{}),color:"orange"}},hbe={high:{label:"High",color:"error"},medium:{label:"Medium",color:"warning"},low:{label:"Low",color:"default"}},NI={high:3,medium:2,low:1},E0=e=>{const t=Date.parse(e.createdAt||"");return Number.isNaN(t)?0:t},G9=(e,t)=>E0(t)-E0(e),uh=(e,t,n)=>e||G9(t,n)||String(t.title||"").localeCompare(String(n.title||""))||String(t.id||"").localeCompare(String(n.id||"")),OI=(e,t,n)=>{const r=!!e.dueDate,a=!!t.dueDate;if(r!==a)return r?-1:1;if(!r)return uh(0,e,t);const o=e.dueDate.localeCompare(t.dueDate)*n;return uh(o,e,t)},pbe=(e,t,n)=>{if(n==="createdAsc")return uh(E0(e)-E0(t),e,t);if(n==="dueAsc")return OI(e,t,1);if(n==="dueDesc")return OI(e,t,-1);if(n==="priorityDesc"||n==="priorityAsc"){const r=n==="priorityDesc"?-1:1,a=((NI[e.priority]||0)-(NI[t.priority]||0))*r;return uh(a,e,t)}return uh(G9(e,t),e,t)};function VC({label:e,direction:t,onClick:n}){const r=t==="asc"?"ascending":t==="desc"?"descending":"not sorted";return c.jsxs("button",{type:"button",className:`todo-sort-header-button ${t?"is-active":""}`,"aria-label":`${e}, ${r}. Click to change sorting.`,onClick:n,children:[c.jsx("span",{children:e}),c.jsx("span",{className:`todo-sort-header-icon ${t?"is-single":""}`,"aria-hidden":"true",children:t==="asc"?c.jsx(Uw,{}):t==="desc"?c.jsx(Vw,{}):c.jsxs(c.Fragment,{children:[c.jsx(Uw,{}),c.jsx(Vw,{})]})})]})}function gbe(){const{message:e}=Pr.useApp(),[t,n]=l.useState([]),[r,a]=l.useState(!0),[o,s]=l.useState(""),[u,f]=l.useState("all"),[m,h]=l.useState("all"),[p,v]=l.useState("all"),[y,b]=l.useState("none"),[C,x]=l.useState(""),[w,$]=l.useState("medium"),[E,R]=l.useState("work"),[N,O]=l.useState(!1),[I,j]=l.useState([]),[M,T]=l.useState({domain:"",jiraIssuePrefix:""}),[z,P]=l.useState(!1),[B,H]=l.useState(null),A=()=>{O(!1),j([])},L=J=>{!N||J.target.closest(".todo-item-card, .todo-select-all-checkbox, .todo-select-mode-icon, .todo-batch-bar")||A()};l.useEffect(()=>{if(!N)return;const J=xe=>{xe.key!=="Escape"||z||(xe.preventDefault(),A())},ye=xe=>{z||!(xe.target instanceof Element)||xe.target.closest(".todo-item-card, .todo-select-all-checkbox, .todo-select-mode-icon, .todo-batch-bar")||A()};return window.addEventListener("keydown",J),document.addEventListener("click",ye),()=>{window.removeEventListener("keydown",J),document.removeEventListener("click",ye)}},[N,z]);const F=l.useCallback(async()=>{a(!0);try{const J=await Wa.list();n(J)}catch(J){e.error(J.message)}finally{a(!1)}},[e]);l.useEffect(()=>{F(),Wn.status().then(J=>{J&&T(J)}).catch(()=>{})},[F]);const U=l.useMemo(()=>t.filter(J=>!J.archived),[t]),q=l.useMemo(()=>t.filter(J=>J.archived).length,[t]),_=l.useMemo(()=>{const J=U.length,ye=U.filter(ce=>ce.completed).length,xe=J-ye,ze=J>0?Math.round(ye/J*100):0,he=U.filter(ce=>!ce.completed&&ce.priority==="high").length;return{total:J,completed:ye,active:xe,rate:ze,highPriorityCount:he}},[U]),K=async()=>{const J=C.trim();if(J)try{const ye=await Wa.create({title:J,priority:w,category:E,completed:!1});n(xe=>[ye,...xe]),x(""),e.success("Task added")}catch(ye){e.error(ye.message)}},X=async J=>{try{if(B){const ye=await Wa.update(B.id,J);n(xe=>xe.map(ze=>ze.id===ye.id?ye:ze)),e.success("Task updated")}else{const ye=await Wa.create(J);n(xe=>[ye,...xe]),e.success("Task created")}P(!1)}catch(ye){e.error(ye.message)}},V=async J=>{try{const ye=await Wa.update(J.id,{...J,completed:!J.completed});n(xe=>xe.map(ze=>ze.id===ye.id?ye:ze))}catch(ye){e.error(ye.message)}},W=async J=>{try{await Wa.archive(J),n(ye=>ye.map(xe=>xe.id===J?{...xe,archived:!0,archivedAt:new Date().toISOString()}:xe)),e.success("Task archived")}catch(ye){e.error(ye.message)}},G=async J=>{try{await Wa.remove(J),n(ye=>ye.filter(xe=>xe.id!==J)),j(ye=>ye.filter(xe=>xe!==J)),e.success("Task deleted")}catch(ye){e.error(ye.message)}},Y=async J=>{if(J==="clearCompleted"){try{const ye=await Wa.batch("clearCompleted");n(ye),j([]),e.success("Completed tasks cleared")}catch(ye){e.error(ye.message)}return}if(I.length)try{const ye=await Wa.batch(J,I);n(ye),j([]),e.success("Batch action succeeded")}catch(ye){e.error(ye.message)}},te=l.useMemo(()=>{let J=U;if(o.trim()){const xe=o.toLowerCase().trim();J=J.filter(ze=>ze.title.toLowerCase().includes(xe)||(ze.description||"").toLowerCase().includes(xe))}u==="active"?J=J.filter(xe=>!xe.completed):u==="completed"&&(J=J.filter(xe=>xe.completed)),m!=="all"&&(J=J.filter(xe=>xe.priority===m)),p!=="all"&&(J=J.filter(xe=>xe.category===p));const ye=y==="none"?[...J]:[...J].sort((xe,ze)=>pbe(xe,ze,y));return[...ye.filter(xe=>!xe.completed),...ye.filter(xe=>xe.completed)]},[U,o,u,m,p,y]),ne=l.useMemo(()=>te.map(J=>J.id),[te]),ue=ne.length>0&&ne.every(J=>I.includes(J)),Z=I.length>0,ee=J=>{J.target.checked?j(ne):j([])},re=J=>{j(ye=>ye.includes(J)?ye.filter(xe=>xe!==J):[...ye,J])},oe=J=>{const ye={created:["createdDesc","createdAsc"],priority:["priorityDesc","priorityAsc"],due:["dueAsc","dueDesc"]},[xe,ze]=ye[J];b(he=>he===xe?ze:he===ze?"none":xe)},de=J=>y.startsWith(J)?y.endsWith("Asc")?"asc":"desc":null,be=dr().format("YYYY-MM-DD");return c.jsxs("div",{className:`todo-page ${N?"is-select-mode":""}`,onClick:L,children:[c.jsx(Ur,{actions:c.jsx("div",{className:"todo-header-actions",children:c.jsxs(ct,{className:"todo-header-button-group",wrap:!0,children:[c.jsxs(Oe,{className:"todo-archive-link",icon:c.jsx(zh,{}),onClick:()=>{window.location.hash="#/todo-list/archived"},children:["Archived (",q,")"]}),c.jsx(Oe,{icon:c.jsx(Xa,{}),onClick:F,loading:r,children:"Refresh"}),c.jsx(Oe,{type:"primary",icon:c.jsx(Xn,{}),onClick:()=>{H(null),P(!0)},children:"New Task"})]})}),className:"todo-page-header",copyClassName:"todo-header-copy",description:"Manage and track development tasks, bug fixes, and feature items efficiently.",descriptionClassName:"todo-page-description",title:"To-Do",titleClassName:"todo-page-title"}),c.jsxs("div",{className:"todo-stats-grid",children:[c.jsxs(It,{className:"todo-stat-card is-total",size:"small",children:[c.jsxs("div",{className:"todo-stat-head",children:[c.jsx(Oi,{className:"todo-stat-label",children:"Total Tasks"}),c.jsx("span",{className:"todo-stat-icon",children:c.jsx(mu,{})})]}),c.jsx("div",{className:"todo-stat-value",children:_.total})]}),c.jsxs(It,{className:"todo-stat-card is-pending",size:"small",children:[c.jsxs("div",{className:"todo-stat-head",children:[c.jsx(Oi,{className:"todo-stat-label",children:"Active (Pending)"}),c.jsx("span",{className:"todo-stat-icon",children:c.jsx(Wl,{})})]}),c.jsxs("div",{className:`todo-stat-value ${_.active>0?"is-active":""}`,children:[_.active,_.highPriorityCount>0&&c.jsxs("span",{className:"todo-stat-warning",children:["(",_.highPriorityCount," high priority)"]})]})]}),c.jsxs(It,{className:"todo-stat-card is-completed",size:"small",children:[c.jsxs("div",{className:"todo-stat-head",children:[c.jsx(Oi,{className:"todo-stat-label",children:"Completed"}),c.jsx("span",{className:"todo-stat-icon",children:c.jsx(gi,{})})]}),c.jsx("div",{className:"todo-stat-value is-complete",children:_.completed})]}),c.jsxs(It,{className:"todo-stat-card is-rate",size:"small",children:[c.jsxs("div",{className:"todo-stat-rate",children:[c.jsx(Oi,{className:"todo-stat-label",children:"Completion Rate"}),c.jsxs(Oi,{className:"todo-stat-percentage",strong:!0,children:[_.rate,"%"]})]}),c.jsx(dp,{className:"todo-stat-progress",percent:_.rate,showInfo:!1,size:"small"})]})]}),c.jsxs(It,{className:"todo-quick-add-card",size:"small",children:[c.jsxs("div",{className:"todo-quick-add-header",children:[c.jsx("span",{className:"todo-quick-add-icon",children:c.jsx(Xn,{})}),c.jsxs("div",{children:[c.jsx(Oi,{className:"todo-quick-add-title",children:"Quick add"}),c.jsx(Oi,{className:"todo-quick-add-hint",children:"Capture a task now and add the details later."})]})]}),c.jsxs("div",{className:"todo-quick-add-row",children:[c.jsx(Ct,{className:"todo-quick-title",placeholder:"Quickly add a task... (Press Enter to submit)",value:C,onChange:J=>x(J.target.value),onPressEnter:K,size:"large"}),c.jsx($n,{className:"todo-quick-select",value:w,onChange:$,size:"large",options:[{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}]}),c.jsx($n,{className:"todo-quick-select",value:E,onChange:R,size:"large",options:[{value:"work",label:c.jsxs(ct,{size:4,children:[c.jsx(Ah,{className:"todo-tone-icon is-brand"}),c.jsx("span",{children:"Work"})]})},{value:"dev",label:c.jsxs(ct,{size:4,children:[c.jsx(wa,{className:"todo-tone-icon is-purple"}),c.jsx("span",{children:"Dev"})]})},{value:"bug",label:c.jsxs(ct,{size:4,children:[c.jsx(Th,{className:"todo-tone-icon is-danger"}),c.jsx("span",{children:"Bug"})]})},{value:"feature",label:c.jsxs(ct,{size:4,children:[c.jsx(qo,{className:"todo-tone-icon is-success"}),c.jsx("span",{children:"Feature"})]})},{value:"personal",label:c.jsxs(ct,{size:4,children:[c.jsx(Dh,{className:"todo-tone-icon is-orange"}),c.jsx("span",{children:"Personal"})]})}]}),c.jsx(Oe,{type:"primary",size:"large",icon:c.jsx(Xn,{}),onClick:K,children:"Add"})]})]}),c.jsx(It,{className:"todo-filter-card",size:"small",children:c.jsxs("div",{className:"todo-filter-row",children:[c.jsxs(er.Group,{className:"todo-status-filter",value:u,onChange:J=>f(J.target.value),optionType:"button",buttonStyle:"solid",children:[c.jsxs(er.Button,{value:"all",children:["All (",_.total,")"]}),c.jsxs(er.Button,{value:"active",children:["Active (",_.active,")"]}),c.jsxs(er.Button,{value:"completed",children:["Completed (",_.completed,")"]})]}),c.jsxs("div",{className:"todo-filter-tools",children:[c.jsx(Ct,{className:"todo-search-input",prefix:c.jsx(jo,{}),placeholder:"Search tasks...",value:o,onChange:J=>s(J.target.value),allowClear:!0}),c.jsx($n,{className:"todo-filter-select",value:p,onChange:v,options:[{value:"all",label:"All categories"},{value:"work",label:c.jsxs(ct,{size:4,children:[c.jsx(Ah,{className:"todo-tone-icon is-brand"}),c.jsx("span",{children:"Work"})]})},{value:"dev",label:c.jsxs(ct,{size:4,children:[c.jsx(wa,{className:"todo-tone-icon is-purple"}),c.jsx("span",{children:"Dev"})]})},{value:"bug",label:c.jsxs(ct,{size:4,children:[c.jsx(Th,{className:"todo-tone-icon is-danger"}),c.jsx("span",{children:"Bug"})]})},{value:"feature",label:c.jsxs(ct,{size:4,children:[c.jsx(qo,{className:"todo-tone-icon is-success"}),c.jsx("span",{children:"Feature"})]})},{value:"personal",label:c.jsxs(ct,{size:4,children:[c.jsx(Dh,{className:"todo-tone-icon is-orange"}),c.jsx("span",{children:"Personal"})]})}]}),c.jsx($n,{className:"todo-filter-select",value:m,onChange:h,options:[{value:"all",label:"All priorities"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}]}),c.jsx($n,{className:"todo-mobile-sort-select","aria-label":"Sort tasks",value:y,onChange:b,options:[{value:"none",label:"Default order"},{value:"createdDesc",label:"Created: Newest"},{value:"createdAsc",label:"Created: Oldest"},{value:"dueAsc",label:"Due: Earliest"},{value:"dueDesc",label:"Due: Latest"},{value:"priorityDesc",label:"Priority: High"},{value:"priorityAsc",label:"Priority: Low"}]})]})]})}),N&&c.jsxs("div",{className:"todo-batch-bar",role:"toolbar","aria-label":"Selected task actions",children:[c.jsxs(Oi,{className:"todo-batch-count",children:[c.jsx("strong",{children:I.length})," items selected"]}),c.jsxs(ct,{wrap:!0,children:[c.jsx(Oe,{size:"small",icon:c.jsx(gi,{}),disabled:!I.length,onClick:()=>Y("markCompleted"),children:"Mark Completed"}),c.jsx(Oe,{size:"small",icon:c.jsx(Wl,{}),disabled:!I.length,onClick:()=>Y("markPending"),children:"Mark Active"}),c.jsx(Gr,{title:"Are you sure you want to delete selected tasks?",onConfirm:()=>Y("delete"),okText:"Delete",cancelText:"Cancel",disabled:!I.length,children:c.jsx(Oe,{size:"small",danger:!0,icon:c.jsx(Fn,{}),disabled:!I.length,children:"Delete Selected"})}),c.jsx(Oe,{size:"small",type:"link",onClick:()=>{A()},children:"Exit Select Mode"})]})]}),!r&&te.length>0&&c.jsxs("div",{className:"todo-table-header",children:[c.jsx("div",{className:"todo-item-check",children:c.jsxs("div",{className:"todo-select-control",children:[c.jsx(yn,{title:ue?"Deselect all tasks":"Select all tasks",children:c.jsx(tr,{className:`todo-select-control-option todo-select-all-checkbox ${N?"":"is-hidden"}`,"aria-hidden":!N,"aria-label":ue?"Deselect all tasks":"Select all tasks",checked:ue,indeterminate:Z&&!ue,tabIndex:N?0:-1,onChange:ee})}),c.jsx(yn,{title:"Enter Select Mode",children:c.jsx(mu,{className:`todo-select-control-option todo-select-mode-icon ${N?"is-hidden":""}`,"aria-hidden":N,onClick:()=>O(!0)})})]})}),c.jsx("div",{className:"todo-table-title",children:"Task Content"}),c.jsx("div",{className:"todo-table-created",role:"columnheader","aria-sort":de("created")==="asc"?"ascending":de("created")==="desc"?"descending":"none",children:c.jsx(VC,{label:"Created",direction:de("created"),onClick:()=>oe("created")})}),c.jsx("div",{className:"todo-table-filter",children:"Category"}),c.jsx("div",{className:"todo-table-filter",role:"columnheader","aria-sort":de("priority")==="asc"?"ascending":de("priority")==="desc"?"descending":"none",children:c.jsx(VC,{label:"Priority",direction:de("priority"),onClick:()=>oe("priority")})}),c.jsx("div",{className:"todo-table-date",role:"columnheader","aria-sort":de("due")==="asc"?"ascending":de("due")==="desc"?"descending":"none",children:c.jsx(VC,{label:"Due Date",direction:de("due"),onClick:()=>oe("due")})}),c.jsx("div",{className:"todo-table-actions",children:"Actions"})]}),r?c.jsxs("div",{className:"todo-loading-state",children:[c.jsx(rr,{size:"large"}),c.jsx(Oi,{type:"secondary",children:"Loading tasks…"})]}):te.length===0?c.jsx("div",{className:"todo-state-card",children:c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:U.length===0?"No tasks yet. Create your first task!":"No matching tasks found.",children:U.length===0&&c.jsx(Oe,{type:"primary",icon:c.jsx(Xn,{}),onClick:()=>{H(null),P(!0)},children:"New Task"})})}):c.jsx("div",{className:"todo-list-items",children:te.map(J=>{var se;const ye=mbe[J.category]||{label:J.category,color:"default"},xe=hbe[J.priority]||{label:J.priority,color:"default"},ze=J.dueDate&&J.dueDate<be&&!J.completed,he=dr(J.createdAt),ce=J.createdAt&&he.isValid()?he.format("YYYY-MM-DD HH:mm:ss"):"Created time unavailable";return c.jsx(It,{size:"small",className:`todo-item-card priority-${J.priority||"none"} ${I.includes(J.id)?"is-selected":""} ${J.completed?"is-completed":""}`,children:c.jsxs("div",{className:"todo-list-row",children:[c.jsx("div",{className:"todo-item-check",children:N?c.jsx(tr,{checked:I.includes(J.id),onChange:()=>re(J.id)}):c.jsx(yn,{title:J.completed?"Mark as active":"Mark as completed",children:c.jsx(tr,{className:"todo-item-checkbox",checked:J.completed,onChange:()=>V(J)})})}),c.jsxs("div",{className:"todo-item-copy",children:[c.jsx("div",{className:"todo-item-title",children:c.jsx($0,{text:J.title,domain:M.domain,jiraIssuePrefix:M.jiraIssuePrefix})}),!!((se=J.description)!=null&&se.trim())&&c.jsx("div",{className:"todo-item-description",children:c.jsx($0,{text:J.description.trim(),domain:M.domain,jiraIssuePrefix:M.jiraIssuePrefix})})]}),c.jsx("div",{className:"todo-item-created","data-label":"Created",children:c.jsx(yn,{title:ce,children:c.jsx("span",{className:"todo-created-icon",tabIndex:0,"aria-label":ce==="Created time unavailable"?ce:`Created ${ce}`,children:c.jsx(jy,{})})})}),c.jsx("div",{className:"todo-item-meta","data-label":"Category",children:c.jsx($t,{className:"todo-item-tag",color:ye.color,icon:ye.icon,children:ye.label})}),c.jsx("div",{className:"todo-item-meta","data-label":"Priority",children:c.jsx($t,{className:"todo-item-tag",color:xe.color,children:xe.label})}),c.jsx("div",{className:"todo-item-date","data-label":"Due",children:J.dueDate?c.jsxs(Oi,{className:`todo-due-text ${ze?"is-overdue":""}`,children:[J.dueDate,ze&&c.jsx("span",{className:"todo-overdue-status",children:"(Overdue)"})]}):c.jsx(Oi,{className:"todo-empty-value",type:"secondary",children:"—"})}),c.jsx("div",{className:"todo-item-actions",children:c.jsxs(ct,{size:"small",children:[J.completed&&c.jsx(yn,{title:"Archive task",children:c.jsx(Oe,{className:"todo-action-button is-archive",type:"text",size:"small",icon:c.jsx(cve,{}),onClick:()=>W(J.id)})}),c.jsx(Oe,{className:"todo-action-button",type:"text",size:"small",icon:c.jsx(Wo,{}),onClick:()=>{H(J),P(!0)}}),c.jsx(Gr,{title:"Are you sure you want to delete this task?",onConfirm:()=>G(J.id),okText:"Delete",cancelText:"Cancel",children:c.jsx(Oe,{className:"todo-action-button",type:"text",danger:!0,size:"small",icon:c.jsx(Fn,{})})})]})})]})},J.id)})}),u==="completed"&&_.completed>0&&c.jsx("div",{className:"todo-page-footer",children:c.jsx(Gr,{title:`Are you sure you want to clear all ${_.completed} completed tasks?`,onConfirm:()=>Y("clearCompleted"),okText:"Clear",cancelText:"Cancel",children:c.jsxs(Oe,{type:"dashed",danger:!0,icon:c.jsx(Fn,{}),children:["Clear all completed tasks (",_.completed,")"]})})}),c.jsx(fbe,{open:z,editingTodo:B,onCancel:()=>P(!1),onSave:X})]})}const{Text:RI}=xn,vbe={work:{label:"Work",icon:c.jsx(Ah,{}),color:"purple"},dev:{label:"Dev",icon:c.jsx(wa,{}),color:"purple"},bug:{label:"Bug",icon:c.jsx(Th,{}),color:"red"},feature:{label:"Feature",icon:c.jsx(qo,{}),color:"green"},personal:{label:"Personal",icon:c.jsx(Dh,{}),color:"orange"}},ybe={high:{label:"High",color:"error"},medium:{label:"Medium",color:"warning"},low:{label:"Low",color:"default"}};function bbe(){const{message:e}=Pr.useApp(),[t,n]=l.useState([]),[r,a]=l.useState(!0),[o,s]=l.useState(""),[u,f]=l.useState({domain:"",jiraIssuePrefix:""}),m=l.useCallback(async()=>{a(!0);try{const b=await Wa.list();n(b)}catch(b){e.error(b.message)}finally{a(!1)}},[e]);l.useEffect(()=>{m(),Wn.status().then(b=>{b&&f(b)}).catch(()=>{})},[m]);const h=l.useMemo(()=>{let b=t.filter(C=>C.archived);if(o.trim()){const C=o.toLowerCase().trim();b=b.filter(x=>x.title.toLowerCase().includes(C)||(x.description||"").toLowerCase().includes(C))}return b.sort((C,x)=>new Date(x.archivedAt||0)-new Date(C.archivedAt||0))},[t,o]),p=async b=>{try{await Wa.unarchive(b),n(C=>C.map(x=>x.id===b?{...x,archived:!1,archivedAt:null}:x)),e.success("Task restored to To-Do")}catch(C){e.error(C.message)}},v=async b=>{try{await Wa.remove(b),n(C=>C.filter(x=>x.id!==b)),e.success("Task permanently deleted")}catch(C){e.error(C.message)}},y=async()=>{try{const b=await Wa.batch("clearArchived");n(b),e.success("All archived tasks cleared")}catch(b){e.error(b.message)}};return c.jsxs("div",{className:"todo-archive-page",children:[c.jsx(Ur,{actions:c.jsxs(ct,{className:"todo-archive-header-actions",wrap:!0,children:[c.jsx(Oe,{icon:c.jsx(ec,{}),onClick:()=>{window.location.hash="#/todo-list"},children:"Back to To-Do"}),c.jsx(Oe,{icon:c.jsx(Xa,{}),onClick:m,loading:r,children:"Refresh"})]}),className:"todo-page-header",copyClassName:"todo-header-copy",description:"View and manage archived tasks. Archived items can be restored back to your active To-Do.",descriptionClassName:"todo-page-description",title:c.jsxs(c.Fragment,{children:[c.jsx(zh,{className:"todo-brand-text todo-title-icon"}),"Archived Tasks"]}),titleClassName:"todo-page-title"}),c.jsx(It,{className:"todo-archive-toolbar",size:"small",children:c.jsxs("div",{className:"todo-archive-toolbar-row",children:[c.jsxs(RI,{type:"secondary",children:["Total Archived: ",c.jsx("strong",{className:"todo-brand-text",children:h.length})," items"]}),c.jsx(Ct,{className:"todo-archive-search",prefix:c.jsx(jo,{}),placeholder:"Search archived tasks...",value:o,onChange:b=>s(b.target.value),allowClear:!0})]})}),h.length>0&&c.jsxs("div",{className:"todo-table-header todo-archive-table-header",children:[c.jsx("span",{className:"todo-table-title",children:"Task Content"}),c.jsx("div",{className:"todo-archive-column-meta",children:"Category"}),c.jsx("div",{className:"todo-archive-column-meta",children:"Priority"}),c.jsx("div",{className:"todo-archive-column-date",children:"Archived At"}),c.jsx("div",{className:"todo-archive-column-actions",children:"Actions"})]}),r?c.jsxs("div",{className:"todo-loading-state",children:[c.jsx(rr,{size:"large"}),c.jsx(RI,{type:"secondary",children:"Loading archived tasks…"})]}):h.length===0?c.jsx("div",{className:"todo-state-card",children:c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No archived tasks found.",children:c.jsx(Oe,{icon:c.jsx(ec,{}),onClick:()=>{window.location.hash="#/todo-list"},children:"Back to To-Do"})})}):c.jsx("div",{className:"todo-archive-list",children:h.map(b=>{var $;const C=vbe[b.category]||{label:b.category,color:"default"},x=ybe[b.priority]||{label:b.priority,color:"default"},w=b.archivedAt?dr(b.archivedAt).format("YYYY-MM-DD HH:mm"):"—";return c.jsx(It,{size:"small",className:`todo-archive-card priority-${b.priority||"none"} ${b.completed?"is-completed":""}`,children:c.jsxs("div",{className:"todo-archive-row",children:[c.jsxs("div",{className:"todo-item-copy",children:[c.jsx("div",{className:"todo-item-title",children:c.jsx($0,{text:b.title,domain:u.domain,jiraIssuePrefix:u.jiraIssuePrefix})}),!!(($=b.description)!=null&&$.trim())&&c.jsx("div",{className:"todo-item-description",children:c.jsx($0,{text:b.description.trim(),domain:u.domain,jiraIssuePrefix:u.jiraIssuePrefix})})]}),c.jsx("div",{className:"todo-archive-column-meta","data-label":"Category",children:c.jsx($t,{className:"todo-item-tag",color:C.color,icon:C.icon,children:C.label})}),c.jsx("div",{className:"todo-archive-column-meta","data-label":"Priority",children:c.jsx($t,{className:"todo-item-tag",color:x.color,children:x.label})}),c.jsx("div",{className:"todo-archive-column-date","data-label":"Archived",children:c.jsxs($t,{className:"todo-item-tag",color:"default",children:[c.jsx(Wl,{className:"todo-inline-icon"}),w]})}),c.jsx("div",{className:"todo-archive-column-actions",children:c.jsxs(ct,{size:"small",children:[c.jsx(yn,{title:"Restore to To-Do",children:c.jsx(Oe,{className:"todo-action-button",type:"text",size:"small",icon:c.jsx(z9,{className:"todo-restore-icon"}),onClick:()=>p(b.id)})}),c.jsx(Gr,{title:"Permanently delete this archived task?",onConfirm:()=>v(b.id),okText:"Delete",cancelText:"Cancel",children:c.jsx(Oe,{className:"todo-action-button",type:"text",danger:!0,size:"small",icon:c.jsx(Fn,{})})})]})})]})},b.id)})}),h.length>0&&c.jsx("div",{className:"todo-page-footer",children:c.jsx(Gr,{title:`Are you sure you want to permanently delete all ${h.length} archived tasks?`,onConfirm:y,okText:"Delete All",cancelText:"Cancel",children:c.jsxs(Oe,{type:"dashed",danger:!0,icon:c.jsx(Fn,{}),children:["Clear all archived tasks (",h.length,")"]})})})]})}const{Title:xbe}=xn,Cbe=()=>{const n=(window.location.hash||"").slice(2).split("/");if(n[0]==="logs"){const r=n[1]||"",a=n[2]==="pkg",o=a?n[3]:n[2];return{launcherId:r,isPackage:a,scriptIdOrName:o}}return{launcherId:null,isPackage:!1,scriptIdOrName:null}};function Sbe(){const{message:e}=Pr.useApp(),{launcherId:t,isPackage:n,scriptIdOrName:r}=Cbe(),[a,o]=l.useState("output"),[s,u]=l.useState(""),[f,m]=l.useState(!0),[h,p]=l.useState(!1),[v,y]=l.useState(""),[b,C]=l.useState(r),x=l.useRef(null);l.useEffect(()=>{t&&Br.list().then(E=>{var N;const R=E.find(O=>O.id===t);if(R&&(R.alias&&y(R.alias),!n&&r))if(r==="install")C("Install");else{const O=(N=R.scripts)==null?void 0:N.find(I=>I.id===r);O!=null&&O.name&&C(O.name)}}).catch(()=>{})},[t,n,r]),l.useEffect(()=>{const E=v?`${v} · `:"",R=b||r||"Logs";return document.title=`${E}${R} · DevBuddy`,()=>{document.title="DevBuddy · Workbench"}},[v,b,r]),l.useEffect(()=>{if(!t||!r)return;const E=async()=>{if(!w0())try{const N=n?a==="error"?await Br.packageScriptErrorLogs(t,r):await Br.packageScriptLogs(t,r):a==="error"?await Br.errorLogs(t,r):await Br.logs(t,r);w0()||u(N.log||(a==="error"?"No error logs yet.":"No logs yet."))}catch(N){u(N.message)}finally{m(!1)}};E();const R=setInterval(E,1e3);return()=>clearInterval(R)},[t,n,r,a]),l.useEffect(()=>{if(x.current){const E=x.current.querySelector(".log-output");E&&(E.scrollTop=E.scrollHeight)}},[s]);const w=async()=>{try{await navigator.clipboard.writeText(window.location.href),p(!0),e.success("URL copied to clipboard"),setTimeout(()=>p(!1),2e3)}catch{e.error("Failed to copy URL")}},$=()=>{window.close()};return!t||!r?c.jsx("div",{className:"standalone-log-container standalone-log-invalid",children:c.jsx("div",{children:"Invalid log target specified in URL."})}):c.jsxs("div",{className:"standalone-log-container",ref:x,children:[c.jsxs("header",{className:"standalone-log-header",children:[c.jsxs("div",{className:"standalone-log-title-row",children:[c.jsxs(xbe,{level:4,className:"standalone-log-title",children:[v||t," ",c.jsx("span",{className:"standalone-log-separator",children:"/"})," ",b||r]}),f&&c.jsx(rr,{size:"small"})]}),c.jsxs("div",{className:"standalone-log-actions",children:[c.jsxs(er.Group,{value:a,onChange:E=>o(E.target.value),size:"small",buttonStyle:"solid",children:[c.jsx(er.Button,{value:"output",children:"Output"}),c.jsx(er.Button,{value:"error",children:"Errors"})]}),c.jsx(Oe,{size:"small",icon:h?c.jsx(Vl,{}):c.jsx(fo,{}),onClick:w,children:h?"Copied":"Copy URL"}),c.jsx(Oe,{type:"text",icon:c.jsx(Xo,{}),onClick:$,className:"standalone-log-close",title:"Close Tab"})]})]}),c.jsx("div",{className:"standalone-log-body",children:c.jsx(Xw,{value:s,className:"standalone-log-output"})})]})}const{Text:pv}=xn;function wbe(){const{message:e}=Pr.useApp(),[t,n]=l.useState([]),[r,a]=l.useState(!0),[o,s]=l.useState(""),[u,f]=l.useState("All"),[m,h]=l.useState(new Set),[p,v]=l.useState(null),y=async()=>{a(!0);try{const O=await Zc.list();n(O||[])}catch(O){e.error(O.message)}finally{a(!1)}};l.useEffect(()=>{y()},[]);const b=async()=>{try{await Zc.clear(),n([]),e.success("All error records cleared")}catch(O){e.error(O.message)}},C=async O=>{try{await Zc.remove(O),n(I=>I.filter(j=>j.id!==O)),e.success("Error record deleted")}catch(I){e.error(I.message)}},x=O=>{const I=`[${O.timestamp}] [${O.source}] ${O.message}
537
+ `);if(typeof(n==null?void 0:n.text)=="string")return n.text}catch{}}return String(e)}function nbe(e){if(typeof e=="string"){const t=e.trim();if(t.startsWith('{"text":')&&t.endsWith("}"))try{const n=JSON.parse(t);if(typeof n.text=="string")return n.text}catch{}}return e}function q9(e){const t=String(e||"").toUpperCase();return{ADD:"Added",ADDED:"Added",MODIFY:"Modified",MODIFIED:"Modified",DELETE:"Deleted",DELETED:"Deleted",COPY:"Copied",MOVE:"Moved",RENAME:"Renamed"}[t]||"Changed"}function rbe(e,t){const n=e.length,r=t.length,a=new Set,o=new Set;if(n*r>4e6){const v=Math.max(n,r);for(let y=0;y<v;y+=1)e[y]!==t[y]&&(y<n&&a.add(y),y<r&&o.add(y));return{sourceChanged:a,targetChanged:o}}const s=r+1,u=new Uint32Array((n+1)*s);for(let v=1;v<=n;v+=1)for(let y=1;y<=r;y+=1){const b=v*s+y;u[b]=e[v-1]===t[y-1]?u[(v-1)*s+y-1]+1:Math.max(u[(v-1)*s+y],u[v*s+y-1])}const f=new Set,m=new Set;let h=n,p=r;for(;h>0&&p>0;)e[h-1]===t[p-1]?(f.add(h-1),m.add(p-1),h-=1,p-=1):u[(h-1)*s+p]>=u[h*s+p-1]?h-=1:p-=1;for(let v=0;v<n;v+=1)f.has(v)||a.add(v);for(let v=0;v<r;v+=1)m.has(v)||o.add(v);return{sourceChanged:a,targetChanged:o}}function abe({file:e,choice:t,onChoice:n,sourceBranch:r,targetBranch:a}){if(!e)return c.jsx("div",{className:"pr-conflict-empty-editor",children:c.jsx(Xt,{description:"Select a conflicted file.",image:Xt.PRESENTED_IMAGE_SIMPLE})});const o=e.conflicted!==!1,s=q9(e.changeType),u=t||"target",f=u==="source"?e.sourceContent:e.targetContent,m=BC(f),h=BC(e.sourceContent).split(/\r?\n/),p=BC(e.targetContent).split(/\r?\n/),v=rbe(h,p)[u==="source"?"sourceChanged":"targetChanged"],y=m.split(/\r?\n/),b=r?`Use source (${r})`:"Use source",C=a?`Use target (${a})`:"Use target",x=u==="source"?r?`source branch (${r})`:"source branch":a?`target branch (${a})`:"target branch",w=m!=null&&(m!==""||y.length>1);return c.jsxs("div",{className:"pr-conflict-code-panel",children:[c.jsxs("div",{className:"pr-conflict-code-panel-header",children:[c.jsxs(ct,{size:8,wrap:!0,children:[c.jsx(Zs,{}),c.jsx(Fa,{strong:!0,className:"pr-conflict-file-path",children:e.path}),c.jsx($t,{color:o?"error":"default",children:o?"Conflict":s})]}),c.jsx(ct,{size:8,wrap:!0,children:o&&c.jsxs(er.Group,{value:u,onChange:$=>n($.target.value),optionType:"button",buttonStyle:"solid",size:"small",children:[c.jsx(er.Button,{value:"source",children:b}),c.jsx(er.Button,{value:"target",children:C})]})})]}),c.jsx("div",{className:"pr-conflict-file-meta",children:c.jsxs(ct,{size:8,wrap:!0,children:[c.jsx(Fa,{type:"secondary",children:"Current preview:"}),c.jsx($t,{color:o&&u==="target"?"purple":"blue",children:o?x:`Source branch ${s.toLowerCase()}`}),c.jsxs(Fa,{type:"secondary",children:["· ",y.length," lines"]})]})}),c.jsx("div",{className:"pr-conflict-code-lines",children:!w&&m===""&&y.length<=1&&!y[0]?c.jsx("div",{className:"pr-conflict-empty-lines",children:c.jsx(Fa,{type:"secondary",children:"(Empty file or no text content available in this branch)"})}):y.map(($,E)=>{const R=E+1,N=nbe($);return c.jsx("div",{className:`pr-conflict-code-line-group ${v.has(E)?"is-changed":""}`,children:c.jsxs("div",{className:"pr-conflict-code-line",children:[c.jsx("span",{className:"pr-conflict-code-line-number",children:R}),c.jsx("code",{children:N||" "})]})},R)})})]})}function xI({listOnly:e=!1}){var ge,Re,_e,ie;const[t]=wt.useForm(),[n,r]=l.useState(()=>bI()),[a,o]=l.useState(null),[s,u]=l.useState({}),[f,m]=l.useState(""),[h,p]=l.useState("Resolve PR conflicts"),[v,y]=l.useState([]),[b,C]=l.useState(!1),x=l.useRef(null),[w,$]=l.useState([]),[E,R]=l.useState(!1),[N,O]=l.useState(""),I=[...v,h.trim()].filter(Boolean).join(" "),j=async()=>{R(!0),O("");try{const fe=await Va.recentlyCreated();$(Array.isArray(fe)?fe:[])}catch(fe){O(fe.message||"Unable to load recently created Jira issues.")}finally{R(!1)}},M=l.useMemo(()=>Array.from(new Map(w.filter(fe=>fe.key).map(fe=>[fe.key,{value:fe.key,label:fe.key,summary:fe.summary||"No summary",searchText:`${fe.key} ${fe.summary||""}`.toLowerCase()}])).values()),[w]),[T,z]=l.useState(!1),[P,B]=l.useState(!1),[H,A]=l.useState(""),[L,F]=l.useState(!1),[U,q]=l.useState(!0),[_,K]=l.useState("resolve/pr-conflicts"),[X,V]=l.useState(""),[W,G]=l.useState(""),[Y,te]=l.useState([]),[ne,ue]=l.useState([]),[Z,ee]=l.useState("unresolved"),[re,oe]=l.useState(!1),[de,be]=l.useState(()=>LC()),J=fe=>{const we=v.length?`-${v.join("-")}`:"",ke=_.trim(),Ie=`${we&&ke.endsWith(we)?ke.slice(0,-we.length):ke}${fe.length?`-${fe.join("-")}`:""}`;y(fe),K(Ie),V(""),C(!1),requestAnimationFrame(()=>{var Ve,Le;return(Le=(Ve=x.current)==null?void 0:Ve.blur)==null?void 0:Le.call(Ve)})},ye=async(fe=_)=>{const we=fe.trim();if(!we||!U){V("");return}try{const ke=await uv.checkBranch({prUrl:n,branchName:we});ke!=null&&ke.exists?V(ke.error||`Branch already exists: ${we}`):V("")}catch{}},xe=async(fe=n)=>{var Pe,Ie;const we=fe.trim();if(!we)return;const ke=LC();window.location.hash=`#/pr-conflict?url=${encodeURIComponent(we)}${ke?"&from=list":""}`,z(!0),o(null),F(!1),G(""),A("");try{const Ve=await uv.load(we);o(Ve);const Le=Ve.files||[],je=Le.filter($e=>$e.conflicted!==!1);u(Object.fromEntries(je.map($e=>[$e.path,$e.defaultChoice||"target"]))),m(((Pe=je[0])==null?void 0:Pe.path)||((Ie=Le[0])==null?void 0:Ie.path)||"")}catch(Ve){an.error(Ve.message)}finally{z(!1)}},ze=async()=>{oe(!0);try{const fe=await uv.myConflicts();te(fe.unresolved||fe.values||[]),ue(fe.resolved||[])}catch(fe){an.error(fe.message)}finally{oe(!1)}};l.useEffect(()=>{const fe=()=>{const we=bI();be(LC()),r(we),t.setFieldValue("prUrl",we),!e&&we&&xe(we)};return window.addEventListener("hashchange",fe),e&&ze(),fe(),()=>window.removeEventListener("hashchange",fe)},[e]);const he=l.useMemo(()=>{var fe;return((fe=a==null?void 0:a.files)==null?void 0:fe.filter(we=>we.conflicted!==!1))||[]},[a]),ce=l.useMemo(()=>Object.keys(s).length,[s]),se=l.useMemo(()=>{var fe,we;return((fe=a==null?void 0:a.files)==null?void 0:fe.find(ke=>ke.path===f))||((we=a==null?void 0:a.files)==null?void 0:we[0])},[a,f]),ae=async()=>{var fe;if((fe=a==null?void 0:a.files)!=null&&fe.length){B(!0),A("");try{const we=await uv.resolve({prUrl:n,choices:s,commitMessage:I,createNewBranch:U,newBranchName:_.trim(),files:he.map(ke=>({path:ke.path}))});if(we!=null&&we.error){A(we.error),an.error(we.error,6);return}F(!0),we!=null&&we.prUrl?(G(we.prUrl),an.success("Resolution commit created and Pull Request opened successfully.")):an.success((we==null?void 0:we.message)||"Resolution commit created successfully."),we!=null&&we.commitUrl&&hr(we.commitUrl)}catch(we){const ke=(we==null?void 0:we.message)||"Unable to create resolution commit. Please try again.";A(ke),an.error(ke,6)}finally{B(!1)}}};return c.jsxs("div",{className:"pr-conflict-page",children:[c.jsx(Ur,{eyebrow:"BITBUCKET WORKFLOW",title:"Resolve PR conflicts",description:"Choose a version for each conflicted file, checkout from target, merge source, and resolve conflicts.",actions:c.jsx(Oe,{icon:c.jsx(ec,{}),onClick:()=>{window.location.hash=de?"#/pr-conflicts":"#/pr-review"},children:de?"Back to Resolve Conflicts":"Back to PR Review"})}),!e&&c.jsx(It,{className:"pr-conflict-input-card",children:c.jsx(wt,{form:t,layout:"vertical",onFinish:fe=>{r(fe.prUrl),xe(fe.prUrl)},children:c.jsx(wt.Item,{name:"prUrl",label:c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"},children:[c.jsx("span",{children:"Pull Request URL"}),c.jsx(Oe,{type:"link",size:"small",onClick:()=>{const fe="https://bitbucket.example.com/projects/DEMO/repos/demo-repo/pull-requests/999";t.setFieldValue("prUrl",fe),r(fe),xe(fe)},style:{height:"auto",marginLeft:8,padding:0,fontSize:"12px"},children:"Load Demo Sample Data"})]}),rules:[{required:!0,message:"Please enter a Bitbucket Pull Request URL."}],children:c.jsx(Ct,{size:"large",placeholder:"https://bitbucket.example.com/projects/PROJ/repos/repo/pull-requests/123",addonAfter:c.jsxs(ct,{size:4,split:c.jsx(lp,{type:"vertical"}),children:[c.jsx(Oe,{type:"link",icon:c.jsx(ul,{}),htmlType:"submit",children:"Load"}),c.jsx(Oe,{type:"link",icon:c.jsx(ul,{}),htmlType:"button",onClick:()=>{var we;const fe=(we=t.getFieldValue("prUrl"))==null?void 0:we.trim();fe?hr(fe):an.warning("Please enter a Pull Request URL first.")},children:"Open"})]})})})})}),!e&&T&&c.jsxs(It,{className:"pr-conflict-loading",children:[c.jsx(rr,{size:"large"}),c.jsx(Fa,{type:"secondary",children:"Loading pull request and conflict files…"})]}),e&&c.jsxs(It,{className:"pr-conflict-my-list-card",title:"My Pull Requests with conflicts",extra:c.jsx(Oe,{type:"link",size:"small",onClick:()=>{window.location.hash="#/pr-conflict?url=https%3A%2F%2Fbitbucket.example.com%2Fprojects%2FDEMO%2Frepos%2Fdemo-repo%2Fpull-requests%2F999&from=list"},children:"Load Demo Sample Data"}),loading:re,children:[c.jsx(Qa,{activeKey:Z,onChange:ee,items:[{key:"unresolved",label:`Unresolved (${Y.length})`},{key:"resolved",label:`Resolved (${ne.length})`}]}),(Z==="unresolved"?Y:ne).length===0?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:Z==="resolved"?"No resolved Pull Requests.":"No authored Pull Requests with conflicts."}):c.jsx(Ra,{dataSource:Z==="unresolved"?Y:ne,rowKey:fe=>`${fe.id}-${fe.resolutionPrId||"unresolved"}`,renderItem:fe=>c.jsx(Ra.Item,{actions:[c.jsx(Oe,{type:"link",icon:c.jsx(ul,{}),onClick:()=>hr(fe.url),children:"Open"},"open"),Z==="resolved"?c.jsx(Oe,{type:"link",icon:c.jsx(ul,{}),onClick:()=>hr(fe.resolutionPrUrl),children:"Open resolved PR"},"resolved-pr"):c.jsx(Oe,{type:"primary",icon:c.jsx(hu,{}),onClick:()=>{window.location.hash=`#/pr-conflict?url=${encodeURIComponent(fe.url)}&from=list`},children:"Resolve"},"resolve")],children:c.jsx(Ra.Item.Meta,{title:c.jsxs(ct,{wrap:!0,children:[c.jsxs(Fa,{strong:!0,children:["#",fe.id," ",fe.title]}),c.jsx($t,{color:"geekblue",children:fe.repositoryName}),c.jsx($t,{color:Z==="resolved"?"success":"error",children:Z==="resolved"?"Resolved":"Conflict"})]}),description:c.jsxs(ct,{wrap:!0,children:[c.jsx($t,{color:"blue",children:fe.sourceBranch}),c.jsx("span",{children:"→"}),c.jsx($t,{color:"purple",children:fe.targetBranch}),Z==="resolved"&&c.jsxs("a",{href:fe.resolutionPrUrl,target:"_blank",rel:"noreferrer",children:["Resolved PR #",fe.resolutionPrId]})]})})})})]}),!e&&!T&&a&&c.jsxs(ct,{direction:"vertical",size:16,className:"pr-conflict-content",children:[c.jsxs(It,{className:"pr-conflict-summary",children:[c.jsxs(Uo,{gutter:[20,16],align:"middle",children:[c.jsx(qn,{flex:"auto",children:c.jsxs(ct,{direction:"vertical",size:4,children:[c.jsx(tbe,{level:4,children:a.pr.title}),c.jsxs(ct,{wrap:!0,children:[c.jsx($t,{color:"blue",children:a.pr.sourceBranch}),c.jsx("span",{children:"→"}),c.jsx($t,{color:"purple",children:a.pr.targetBranch}),c.jsxs(Fa,{type:"secondary",children:[he.length," conflicted file",he.length===1?"":"s"," · ",a.files.length," changed"]})]})]})}),c.jsx(qn,{children:c.jsx(ct,{size:16,wrap:!0,children:c.jsx(Oe,{type:"primary",icon:c.jsx(hu,{}),loading:P,disabled:L||ce!==he.length||!h.trim()||U&&(!_.trim()||!!X),onClick:ae,children:L?"Committed":"Create resolution commit"})})})]}),c.jsxs("div",{className:"pr-conflict-commit-message",children:[c.jsx(Fa,{strong:!0,children:"Commit message"}),c.jsx(Ct,{value:h,onChange:fe=>p(fe.target.value),placeholder:"Describe why these conflicts were resolved",maxLength:200})]}),c.jsxs("div",{className:"pr-conflict-jira-tags",children:[c.jsx(Fa,{strong:!0,children:"Jira No"}),c.jsx($n,{mode:"multiple","aria-label":"Jira issues from Recently Created",open:b,onOpenChange:fe=>{C(fe),fe&&j()},ref:x,placeholder:"Add Jira tags from Recently Created",value:v,onChange:J,autoClearSearchValue:!0,options:M,loading:E,allowClear:!0,showSearch:!0,filterOption:(fe,we)=>we.searchText.includes(fe.trim().toLowerCase()),optionRender:fe=>c.jsxs("div",{className:"pr-conflict-jira-option",children:[c.jsx(Fa,{strong:!0,children:fe.value}),c.jsx(Fa,{type:"secondary",children:fe.data.summary})]}),notFoundContent:E?c.jsx(rr,{size:"small"}):N||"No recently created Jira issues found."})]}),N&&c.jsx(Fa,{type:"danger",children:N}),v.length>0&&c.jsxs("div",{className:"pr-conflict-commit-preview",children:[c.jsx(Fa,{type:"secondary",children:"Commit preview: "}),c.jsx(Fa,{children:I})]}),c.jsxs("div",{className:"pr-conflict-branch-option",children:[c.jsx(tr,{checked:U,onChange:fe=>{q(fe.target.checked),fe.target.checked||V("")},children:"Create new branch to resolve"}),U&&c.jsxs("div",{className:"pr-conflict-branch-input-wrapper",children:[c.jsx(Ct,{status:X?"error":void 0,value:_,onChange:fe=>{K(fe.target.value),X&&V("")},onBlur:()=>ye(_),placeholder:"resolve/pr-123-conflicts",maxLength:200}),X&&c.jsx("div",{className:"pr-conflict-branch-error",children:c.jsx(Fa,{type:"danger",children:X})})]})]}),W&&c.jsx(mr,{className:"pr-conflict-resolution-pr",type:"success",showIcon:!0,message:"Resolution Pull Request created successfully.",description:c.jsx("a",{href:W,target:"_blank",rel:"noreferrer",children:"Open Pull Request"})}),H&&c.jsx(mr,{className:"pr-conflict-resolution-error",type:"error",showIcon:!0,message:"Unable to create resolution commit",description:H,closable:!0,onClose:()=>A("")})]}),a.files.length===0?c.jsx(It,{children:c.jsx(Xt,{description:"No conflicted files were returned by Bitbucket."})}):c.jsxs(It,{className:"pr-conflict-workspace",bodyStyle:{padding:0},children:[c.jsxs("aside",{className:"pr-conflict-file-list",children:[c.jsxs("div",{className:"pr-conflict-file-list-title",children:[c.jsxs(Fa,{strong:!0,children:[he.length," conflicted · ",a.files.length," changed files"]}),c.jsxs(ct,{size:4,wrap:!0,children:[c.jsx(Oe,{type:"link",size:"small",className:"pr-conflict-bulk-action",onClick:()=>u(Object.fromEntries(he.map(fe=>[fe.path,"source"]))),children:(ge=a.pr)!=null&&ge.sourceBranch?`Use source (${a.pr.sourceBranch}) for all`:"Use source for all"}),c.jsx(Oe,{type:"link",size:"small",className:"pr-conflict-bulk-action",onClick:()=>u(Object.fromEntries(he.map(fe=>[fe.path,"target"]))),children:(Re=a.pr)!=null&&Re.targetBranch?`Use target (${a.pr.targetBranch}) for all`:"Use target for all"})]})]}),a.files.map(fe=>{var Le,je;const we=fe.path===(se==null?void 0:se.path),ke=fe.conflicted!==!1,Pe=q9(fe.changeType),Ie=s[fe.path]||"source",Ve=Ie==="source"?(Le=a.pr)!=null&&Le.sourceBranch?`Source (${a.pr.sourceBranch})`:"Source":(je=a.pr)!=null&&je.targetBranch?`Target (${a.pr.targetBranch})`:"Target";return c.jsxs("button",{type:"button",className:`pr-conflict-file-list-item ${we?"is-selected":""}`,onClick:()=>m(fe.path),title:ke?`${fe.path} - ${Ve}`:`${fe.path} - ${Pe} file`,children:[c.jsx(Zs,{}),c.jsx("span",{className:"pr-conflict-file-list-path",children:fe.path}),ke?c.jsx("span",{className:`pr-conflict-file-list-choice is-${Ie}`,title:Ve,children:Ie==="source"?"S":"T"}):c.jsx($t,{className:"pr-conflict-file-list-status",children:Pe})]},fe.path)})]}),c.jsx("section",{className:"pr-conflict-editor-pane",children:c.jsx(abe,{file:se,choice:s[se==null?void 0:se.path],sourceBranch:(_e=a.pr)==null?void 0:_e.sourceBranch,targetBranch:(ie=a.pr)==null?void 0:ie.targetBranch,onChoice:fe=>u(we=>({...we,[se.path]:fe}))})})]})]})]})}const{Text:CI}=xn;function obe({open:e,filters:t,templates:n,onCancel:r,onFilterSave:a,onDelete:o,onTemplateSave:s,onTemplateDelete:u}){const[f,m]=l.useState(""),[h,p]=l.useState("filters"),[v,y]=l.useState(null),[b,C]=l.useState(null),[x]=wt.useForm(),[w]=wt.useForm();l.useEffect(()=>{e&&Wn.status().then(O=>{m(O.domain||"")}).catch(()=>{})},[e]),l.useEffect(()=>{v?x.setFieldsValue(v):x.resetFields()},[v,x]),l.useEffect(()=>{b?w.setFieldsValue(b):w.resetFields()},[b,w]);const $=async()=>{try{const O=await x.validateFields();await a(O,v),y(null),x.resetFields()}catch{}},E=async()=>{try{const O=await w.validateFields();await s(O,b),C(null),w.resetFields()}catch{}},R=[{title:"Filter Name",dataIndex:"name",key:"name",render:(O,I)=>{const j=gye(f,I.filterId);return c.jsxs(ct,{size:4,children:[c.jsx("a",{style:{fontWeight:600},onClick:M=>{M.preventDefault(),hr(j)},title:"Open filter in Jira",children:O}),c.jsx(zy,{className:"jira-filter-external-icon",onClick:()=>hr(j),title:"Open filter in Jira"})]})}},{title:"Filter ID",dataIndex:"filterId",key:"filterId",width:150,render:O=>c.jsx(CI,{code:!0,children:O})},{title:"Action",key:"action",width:130,align:"right",render:(O,I)=>c.jsxs(ct,{size:"small",children:[c.jsx(Oe,{type:"text",icon:c.jsx(Wo,{}),onClick:()=>y(I)}),c.jsx(Gr,{title:"Delete filter?",description:"Are you sure you want to delete this filter?",onConfirm:()=>o(I.id),okText:"Yes",cancelText:"No",children:c.jsx(Oe,{type:"text",danger:!0,icon:c.jsx(Fn,{})})})]})}],N=[{title:"Name",dataIndex:"name",key:"name",render:(O,I)=>c.jsxs(ct,{size:4,children:[c.jsx("span",{children:O}),I.summary&&c.jsx(yn,{title:I.summary,children:c.jsx(_y,{className:"jira-filter-external-icon"})})]})},{title:"Jira No",dataIndex:"jiraNo",key:"jiraNo",width:150,render:O=>c.jsx("a",{onClick:()=>hr(Ly(f,O)),children:c.jsx(CI,{code:!0,children:O})})},{title:"Action",key:"action",width:130,align:"right",render:(O,I)=>c.jsxs(ct,{size:"small",children:[c.jsx(Oe,{type:"text",icon:c.jsx(Wo,{}),onClick:()=>C(I)}),c.jsx(Gr,{title:"Delete template?",onConfirm:()=>u(I.id),okText:"Yes",cancelText:"No",children:c.jsx(Oe,{type:"text",danger:!0,icon:c.jsx(Fn,{})})})]})}];return c.jsx(bn,{className:"jira-filter-modal",title:"Settings",open:e,onCancel:r,footer:null,width:640,children:c.jsx(Qa,{activeKey:h,onChange:p,items:[{key:"filters",label:"Filter List",children:c.jsxs(c.Fragment,{children:[c.jsx(ar,{rowKey:"id",dataSource:t,columns:R,pagination:!1,size:"small"}),c.jsxs(wt,{form:x,layout:"vertical",style:{marginTop:20},children:[c.jsx(wt.Item,{name:"name",label:"Filter Name",rules:[{required:!0,message:"Please enter filter name"}],children:c.jsx(Ct,{placeholder:"e.g. My Sprint Issues"})}),c.jsx(wt.Item,{name:"filterId",label:"Filter ID",rules:[{required:!0,message:"Please enter Jira Filter ID"}],children:c.jsx(Ct,{placeholder:"e.g. 12345"})}),c.jsxs(ct,{children:[c.jsx(Oe,{type:"primary",icon:c.jsx(Xn,{}),onClick:$,children:v!=null&&v.id?"Save Filter":"Add Filter"}),v&&c.jsx(Oe,{onClick:()=>y(null),children:"Cancel"})]})]})]})},{key:"templates",label:"Template List",children:c.jsxs(c.Fragment,{children:[c.jsx(ar,{rowKey:"id",dataSource:n,columns:N,pagination:!1,size:"small"}),c.jsxs(wt,{form:w,layout:"vertical",style:{marginTop:20},children:[c.jsx(wt.Item,{name:"name",label:"Name",rules:[{required:!0,message:"Please enter template name"}],children:c.jsx(Ct,{placeholder:"e.g. Bug template"})}),c.jsx(wt.Item,{name:"jiraNo",label:"Jira No",rules:[{required:!0,message:"Please enter Jira No"}],children:c.jsx(Ct,{placeholder:"e.g. PROJ-123"})}),c.jsxs(ct,{children:[c.jsx(Oe,{type:"primary",icon:c.jsx(Xn,{}),onClick:E,children:b!=null&&b.id?"Save Template":"Add Template"}),b&&c.jsx(Oe,{onClick:()=>C(null),children:"Cancel"})]})]})]})}]})})}const{Text:SI}=xn;function ibe({open:e,confirmLoading:t,issue:n,onCancel:r,onClone:a}){const[o]=wt.useForm();l.useEffect(()=>{e&&n?o.setFieldsValue({summary:n.summary||""}):o.resetFields()},[e,n,o]);const s=async()=>{try{const u=await o.validateFields();await a(u)}catch{}};return c.jsx(bn,{title:n?`Clone Ticket (${n.key})`:"Clone Ticket",open:e,onCancel:r,onOk:s,confirmLoading:t,destroyOnClose:!0,okText:"Clone",children:c.jsxs(wt,{form:o,layout:"vertical",style:{marginTop:16},children:[c.jsxs(wt.Item,{label:"Original Ticket",children:[c.jsx(SI,{code:!0,children:n==null?void 0:n.key})," ",c.jsx(SI,{type:"secondary",children:n==null?void 0:n.summary})]}),c.jsx(wt.Item,{name:"summary",label:"Clone Ticket Summary",rules:[{required:!0,message:"Please enter clone ticket summary"}],children:c.jsx(Ct,{placeholder:"Enter summary for the cloned ticket"})})]})})}function lbe({open:e,confirmLoading:t,templates:n,onCancel:r,onCreate:a}){const[o]=wt.useForm(),s=wt.useWatch("templateId",o);l.useEffect(()=>{e&&(o.resetFields(),n!=null&&n.length&&o.setFieldsValue({templateId:n[0].id,summary:n[0].summary||n[0].name}))},[e,n,o]),l.useEffect(()=>{const f=n==null?void 0:n.find(m=>m.id===s);f&&o.setFieldValue("summary",f.summary||f.name)},[s,n,o]);const u=async()=>{try{await a(await o.validateFields())}catch{}};return c.jsx(bn,{title:"Create Jira",open:e,onCancel:r,onOk:u,confirmLoading:t,okText:"Create",destroyOnClose:!0,children:c.jsxs(wt,{form:o,layout:"vertical",style:{marginTop:16},children:[c.jsx(wt.Item,{name:"templateId",label:"Template",rules:[{required:!0,message:"Please select a template"}],children:c.jsx($n,{placeholder:"Select a template",options:(n||[]).map(f=>({value:f.id,label:`${f.name} (${f.jiraNo})`}))})}),c.jsx(wt.Item,{name:"summary",label:"Summary",rules:[{required:!0,message:"Please enter summary"}],children:c.jsx(Ct,{placeholder:"Enter new Jira summary"})})]})})}const{Text:Od}=xn,hv=e=>{if(!e)return"—";const t=new Date(e);return isNaN(t.getTime())?"—":new Intl.DateTimeFormat(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(t)},HC=e=>{if(!e)return"default";const t=(typeof e=="string"?e:e.name||"").toLowerCase();return t.includes("blocker")||t.includes("highest")||t.includes("p0")||t.includes("urgent")?"red":t.includes("critical")||t.includes("high")||t.includes("p1")?"volcano":t.includes("major")||t.includes("medium")||t.includes("normal")||t.includes("p2")?"orange":t.includes("minor")||t.includes("low")||t.includes("p3")?"blue":t.includes("trivial")||t.includes("lowest")||t.includes("p4")?"cyan":"default"},Gv=(e,t)=>String(e||"").localeCompare(String(t||""),void 0,{sensitivity:"base",numeric:!0}),wI=e=>{const t=String(e||"").toLowerCase();return t.includes("blocker")||t.includes("highest")||t.includes("p0")||t.includes("urgent")?0:t.includes("critical")||t.includes("high")||t.includes("p1")?1:t.includes("major")||t.includes("medium")||t.includes("normal")||t.includes("p2")?2:t.includes("minor")||t.includes("low")||t.includes("p3")?3:t.includes("trivial")||t.includes("lowest")||t.includes("p4")?4:5},FC=(e,t)=>wI(e)-wI(t)||Gv(e,t);function sbe({open:e,onCancel:t}){const[n,r]=l.useState("created"),[a,o]=l.useState(""),[s,u]=l.useState(!1),[f,m]=l.useState(""),[h,p]=l.useState({created:[],commented:[],mentioned:[],updated:[]}),v=l.useRef(new Set),y=l.useCallback(async(j,M=!1)=>{if(!(!M&&v.current.has(j))){u(!0),m("");try{let T=[];j==="created"?T=await Va.recentlyCreated():j==="commented"?T=await Va.recentlyCommented():j==="mentioned"?T=await Va.recentlyMentioned():j==="updated"&&(T=await Va.recentlyUpdated()),p(z=>({...z,[j]:Array.isArray(T)?T:[]})),v.current.add(j)}catch(T){m((T==null?void 0:T.message)||`Failed to load ${j} issues.`),v.current.add(j)}finally{u(!1)}}},[]);l.useEffect(()=>{e&&y(n)},[e,n,y]);const b=j=>{r(j),o(""),m("")},C=()=>{y(n,!0)},x=l.useMemo(()=>{const j=h[n]||[];if(!a.trim())return j;const M=a.trim().toLowerCase();return j.filter(T=>{const z=String(T.key||"").toLowerCase(),P=String(T.summary||"").toLowerCase(),B=String(T.author||T.commentAuthor||T.mentionedBy||T.assignee||"").toLowerCase(),H=String(T.commentSnippet||T.mentionSnippet||"").toLowerCase(),A=String(T.templateName||"").toLowerCase();return z.includes(M)||P.includes(M)||B.includes(M)||H.includes(M)||A.includes(M)})},[h,n,a]),N={created:[{title:"Jira No",dataIndex:"key",key:"key",width:120,render:(j,M)=>c.jsx("a",{onClick:()=>hr(M.url),children:j})},{title:"Summary",dataIndex:"summary",key:"summary",render:j=>c.jsx("div",{className:"jira-recent-summary",title:j,children:j})},{title:"Template",dataIndex:"templateName",key:"templateName",width:180,render:j=>c.jsx(Od,{type:"secondary",children:j||"—"})},{title:"Created",dataIndex:"createdAt",key:"createdAt",width:160,align:"center",render:j=>c.jsx(Od,{type:"secondary",children:hv(j)})}],commented:[{title:"Jira No",dataIndex:"key",key:"key",width:120,render:(j,M)=>c.jsx("a",{onClick:()=>hr(M.url),children:j})},{title:"Summary",dataIndex:"summary",key:"summary",width:280,render:j=>c.jsx("div",{className:"jira-recent-summary",title:j,children:j})},{title:"My Comment",dataIndex:"commentSnippet",key:"commentSnippet",render:j=>c.jsx("div",{className:"jira-recent-snippet",title:j,children:j||"—"})},{title:"Status",dataIndex:"status",key:"status",width:110,sorter:(j,M)=>Gv(j.status,M.status),render:j=>j?c.jsx($t,{children:j}):"—"},{title:"Priority",dataIndex:"priority",key:"priority",width:100,sorter:(j,M)=>FC(j.priority,M.priority),render:j=>j?c.jsx($t,{color:HC(j),children:j}):"—"},{title:"Commented",dataIndex:"commentedAt",key:"commentedAt",width:160,align:"center",render:j=>c.jsx(Od,{type:"secondary",children:hv(j)})}],mentioned:[{title:"Jira No",dataIndex:"key",key:"key",width:120,render:(j,M)=>c.jsx("a",{onClick:()=>hr(M.url),children:j})},{title:"Summary",dataIndex:"summary",key:"summary",width:260,render:j=>c.jsx("div",{className:"jira-recent-summary",title:j,children:j})},{title:"Mentioned By",dataIndex:"mentionedBy",key:"mentionedBy",width:140,render:j=>c.jsx(Od,{strong:!0,children:j||"—"})},{title:"Mention Snippet",dataIndex:"mentionSnippet",key:"mentionSnippet",render:j=>c.jsx("div",{className:"jira-recent-snippet",title:j,children:j||"—"})},{title:"Status",dataIndex:"status",key:"status",width:110,sorter:(j,M)=>Gv(j.status,M.status),render:j=>j?c.jsx($t,{children:j}):"—"},{title:"Priority",dataIndex:"priority",key:"priority",width:100,sorter:(j,M)=>FC(j.priority,M.priority),render:j=>j?c.jsx($t,{color:HC(j),children:j}):"—"},{title:"Mentioned",dataIndex:"mentionedAt",key:"mentionedAt",width:160,align:"center",render:j=>c.jsx(Od,{type:"secondary",children:hv(j)})}],updated:[{title:"Jira No",dataIndex:"key",key:"key",width:120,render:(j,M)=>c.jsx("a",{onClick:()=>hr(M.url),children:j})},{title:"Summary",dataIndex:"summary",key:"summary",render:j=>c.jsx("div",{className:"jira-recent-summary",title:j,children:j})},{title:"Status",dataIndex:"status",key:"status",width:110,sorter:(j,M)=>Gv(j.status,M.status),render:j=>j?c.jsx($t,{children:j}):"—"},{title:"Priority",dataIndex:"priority",key:"priority",width:100,sorter:(j,M)=>FC(j.priority,M.priority),render:j=>j?c.jsx($t,{color:HC(j),children:j}):"—"},{title:"Updated",dataIndex:"updatedAt",key:"updatedAt",width:160,align:"center",render:j=>c.jsx(Od,{type:"secondary",children:hv(j)})}]},O={created:"No Jira created via +Jira yet.",commented:"No recently commented issues found.",mentioned:"No recently mentioned issues found.",updated:"No recently updated issues found."},I=[{key:"created",label:`Created${h.created.length?` (${h.created.length})`:""}`},{key:"commented",label:`Commented${h.commented.length?` (${h.commented.length})`:""}`},{key:"mentioned",label:`Mentioned${h.mentioned.length?` (${h.mentioned.length})`:""}`},{key:"updated",label:`Updated${h.updated.length?` (${h.updated.length})`:""}`}];return c.jsxs(bn,{title:"Recently",open:e,onCancel:t,footer:null,width:1100,className:"jira-recently-modal",children:[c.jsx(Qa,{activeKey:n,onChange:b,items:I,tabBarExtraContent:c.jsxs(ct,{size:8,children:[c.jsx(Ct,{placeholder:"Search in tab...",prefix:c.jsx(jo,{}),allowClear:!0,value:a,onChange:j=>o(j.target.value),style:{width:190}}),c.jsx(Oe,{icon:c.jsx(Xa,{}),loading:s,onClick:C,children:"Refresh"})]}),style:{marginBottom:12}}),f?c.jsx(mr,{type:"error",showIcon:!0,message:f,action:c.jsx(Oe,{size:"small",danger:!0,onClick:C,children:"Retry"}),style:{marginBottom:12}}):null,c.jsx(ar,{rowKey:"id",dataSource:x,columns:N[n],loading:s,pagination:{pageSize:30,showSizeChanger:!1,hideOnSinglePage:!0},size:"small",locale:{emptyText:c.jsx(Xt,{description:a?"No matching issues found.":O[n],image:Xt.PRESENTED_IMAGE_SIMPLE})}})]})}const{Text:Dm}=xn,cbe=e=>{if(!e)return"default";const t=(typeof e=="string"?e:e.name||"").toLowerCase();return t.includes("blocker")||t.includes("highest")||t.includes("p0")||t.includes("urgent")?"red":t.includes("critical")||t.includes("high")||t.includes("p1")?"volcano":t.includes("major")||t.includes("medium")||t.includes("normal")||t.includes("p2")?"orange":t.includes("minor")||t.includes("low")||t.includes("p3")?"blue":t.includes("trivial")||t.includes("lowest")||t.includes("p4")?"cyan":"default"},$I=e=>e?typeof e=="string"?e:e.name||"—":"—",EI=e=>{if(!e)return 0;const t=(typeof e=="string"?e:e.name||"").toLowerCase();return t.includes("blocker")||t.includes("highest")||t.includes("p0")||t.includes("urgent")?50:t.includes("critical")||t.includes("high")||t.includes("p1")?40:t.includes("major")||t.includes("medium")||t.includes("normal")||t.includes("p2")?30:t.includes("minor")||t.includes("low")||t.includes("p3")?20:t.includes("trivial")||t.includes("lowest")||t.includes("p4")?10:0},K9=(e,t,n)=>{if(!t||!Array.isArray(e))return null;const r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b${r}\\b`,"i"),o=e.find(s=>{const u=a.test(s.title||""),f=a.test(s.description||""),m=!!(n&&s.description&&s.description.includes(n));return u||f||m});return o?{isAdded:!0,completed:!!o.completed,todoItem:o}:null},jI=(e,t,n)=>!!K9(e,t,n);function ube(){const{message:e}=Pr.useApp(),[t,n]=l.useState([]),[r,a]=l.useState(null),[o,s]=l.useState({}),[u,f]=l.useState(!0),[m,h]=l.useState(!1),[p,v]=l.useState(""),[y,b]=l.useState([]),[C,x]=l.useState(!1),[w,$]=l.useState([]),[E,R]=l.useState(!1),[N,O]=l.useState(!1),[I,j]=l.useState(!1),[M,T]=l.useState(!1),[z,P]=l.useState(!1),[B,H]=l.useState(null),[A,L]=l.useState({open:!1,x:0,y:0,record:null}),F=l.useCallback(async()=>{try{const Z=await Wa.list();b(Z)}catch{}},[]),U=l.useCallback(async()=>{try{const Z=await Va.list();n(Z),Z.length>0?(!r||!Z.some(ee=>ee.id===r))&&a(Z[0].id):(a(null),s({}))}catch(Z){e.error(Z.message)}finally{f(!1)}},[r,e]),q=l.useCallback(async()=>{try{$(await Va.templates.list())}catch(Z){e.error(Z.message)}},[e]),_=l.useCallback(async Z=>{if(Z){h(!0),v("");try{const ee=await Va.issues(Z);s(re=>({...re,[Z]:ee.issues||[]}))}catch(ee){v(ee.message),s(re=>{const oe={...re};return delete oe[Z],oe})}finally{h(!1)}}},[]);l.useEffect(()=>{U(),F(),q()},[U,F,q]),l.useEffect(()=>{r&&_(r)},[r,_]),l.useEffect(()=>{if(!A.open)return;const Z=()=>{L(ee=>({...ee,open:!1}))};return window.addEventListener("click",Z),window.addEventListener("contextmenu",Z),()=>{window.removeEventListener("click",Z),window.removeEventListener("contextmenu",Z)}},[A.open]);const K=async(Z,ee)=>{try{if(ee)await Va.update(ee.id,Z),e.success("Filter updated");else{const re=await Va.create(Z);e.success("Filter created"),a(re.id)}await U()}catch(re){throw e.error(re.message),re}},X=async Z=>{var ee;if(!(!B||!r)){P(!0);try{const re=await Va.cloneIssue({filterId:r,issueKey:B.key,issueType:B.issueType,summary:Z.summary});e.success(`Cloned issue [${((ee=re.issue)==null?void 0:ee.key)||B.key}] successfully`),T(!1),H(null),_(r)}catch(re){e.error(re.message||"Failed to clone ticket")}finally{P(!1)}}},V=async Z=>{var re;const ee=w.find(oe=>oe.id===Z.templateId);if(!(ee!=null&&ee.jiraNo)){e.error("Selected template does not have a valid source Jira issue number.");return}j(!0);try{const oe=await Va.cloneIssue({issueKey:ee.jiraNo,summary:Z.summary,templateName:ee.name,trackRecent:!0});e.success(`Created Jira [${((re=oe.issue)==null?void 0:re.key)||ee.jiraNo}] successfully`),R(!1),r&&_(r)}catch(oe){e.error(oe.message||"Failed to create Jira")}finally{j(!1)}},W=async(Z,ee)=>{try{ee!=null&&ee.id?await Va.templates.update(ee.id,Z):await Va.templates.create(Z),e.success(ee!=null&&ee.id?"Template updated":"Template created"),await q()}catch(re){throw e.error(re.message),re}},G=async Z=>{try{await Va.templates.remove(Z),e.success("Template deleted"),await q()}catch(ee){e.error(ee.message)}},Y=async Z=>{try{await Va.remove(Z),e.success("Filter deleted"),await U()}catch(ee){e.error(ee.message)}},te=async Z=>{if(!(!Z||!Z.key))try{const ee=await Wa.list();if(jI(ee,Z.key,Z.url)){e.info(`Task [${Z.key}] is already in the Todo list`);return}const oe=$I(Z.priority).toLowerCase();let de="medium";oe.includes("blocker")||oe.includes("highest")||oe.includes("critical")||oe.includes("high")||oe.includes("p0")||oe.includes("p1")?de="high":(oe.includes("minor")||oe.includes("low")||oe.includes("trivial")||oe.includes("lowest")||oe.includes("p3")||oe.includes("p4"))&&(de="low");const be={title:`[${Z.key}] ${Z.summary}`,description:Z.url?`[${Z.key}](${Z.url}) - ${Z.summary}`:Z.summary,priority:de,category:"work",dueDate:Z.dueDate||null,completed:!1,archived:!1};await Wa.create(be),e.success(`Added [${Z.key}] to Todo list`),F()}catch(ee){e.error(ee.message||"Failed to add to Todo list")}},ne=[{title:"Summary",dataIndex:"summary",key:"summary",width:480,sorter:(Z,ee)=>(Z.summary||"").localeCompare(ee.summary||""),render:(Z,ee)=>{const re=K9(y,ee.key,ee.url);return c.jsxs("div",{className:"jira-issue-summary",children:[re&&(re.completed?c.jsx(yn,{title:"Todo: Completed (已完成)",children:c.jsx(Hi,{className:"jira-todo-complete",style:{fontSize:15,flexShrink:0}})}):c.jsx(yn,{title:"Todo: Pending (待处理)",children:c.jsx(vge,{className:"jira-todo-pending",style:{fontSize:15,flexShrink:0}})})),c.jsx(Dm,{code:!0,style:{fontSize:12,flexShrink:0,whiteSpace:"nowrap",cursor:"pointer",marginTop:1},onClick:oe=>{oe.preventDefault(),oe.stopPropagation(),ee.key&&(navigator.clipboard.writeText(ee.key),e.success(`Copied ${ee.key}`))},title:"Click to copy Jira Key",children:ee.key}),c.jsx("a",{className:"jira-issue-link",title:Z,onClick:oe=>{oe.preventDefault(),hr(ee.url)},children:Z})]})}},{title:"Status",dataIndex:"status",key:"status",width:125,align:"center",sorter:(Z,ee)=>(Z.status||"").localeCompare(ee.status||""),render:Z=>Z?c.jsx($t,{style:{whiteSpace:"nowrap"},children:Z}):c.jsx(Dm,{type:"secondary",children:"—"})},{title:"Priority",dataIndex:"priority",key:"priority",width:100,align:"center",sorter:(Z,ee)=>EI(Z.priority)-EI(ee.priority),render:Z=>{const ee=$I(Z),re=cbe(Z);return c.jsx($t,{color:re,style:{whiteSpace:"nowrap"},children:ee})}},{title:"Due Date",dataIndex:"dueDate",key:"dueDate",width:90,align:"center",sorter:(Z,ee)=>(Z.dueDate||"").localeCompare(ee.dueDate||""),render:Z=>Z?c.jsx(Dm,{type:"secondary",style:{whiteSpace:"nowrap"},children:Z}):c.jsx(Dm,{type:"secondary",children:"—"})}],ue=A.record?jI(y,A.record.key,A.record.url):!1;return c.jsxs("div",{className:"jira-filters-page",children:[c.jsx(Ur,{actions:c.jsxs(ct,{wrap:!0,children:[c.jsx(Oe,{onClick:()=>x(!0),children:"Settings"}),c.jsx(Oe,{onClick:()=>O(!0),children:"Recently"}),c.jsx(Oe,{type:"primary",icon:c.jsx(Xn,{}),onClick:()=>R(!0),disabled:!w.length,children:"Jira"})]}),description:"Track issues across configured Jira filters.",title:"Jira Workspace"}),u?c.jsx("div",{className:"jira-filter-loading",children:c.jsx(rr,{size:"large"})}):t.length?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"jira-filter-tabs-bar",children:[c.jsx("div",{className:"jira-filter-tabs",children:c.jsx(Qa,{activeKey:r,onChange:a,items:t.map(Z=>{var oe;const ee=Z.id in o,re=(oe=o[Z.id])==null?void 0:oe.length;return{key:Z.id,label:ee?`${Z.name} (${re})`:Z.name}})})}),r&&c.jsx(Oe,{className:"jira-filter-refresh",icon:c.jsx(Xa,{}),loading:m,onClick:()=>_(r),children:"Refresh"})]}),m&&!(r in o)?c.jsx("div",{className:"jira-filter-loading",children:c.jsx(rr,{size:"large"})}):p&&!(r in o)?c.jsxs("div",{className:"jira-filter-error",children:[c.jsx(Dm,{danger:!0,children:p}),c.jsx("div",{style:{marginTop:12},children:c.jsx(Oe,{size:"small",icon:c.jsx(Xa,{}),onClick:()=>_(r),children:"Retry"})})]}):c.jsx(ar,{className:"jira-filters-table",tableLayout:"fixed",rowKey:"id",dataSource:o[r]||[],columns:ne,pagination:!1,scroll:{x:"max-content"},onRow:Z=>({onContextMenu:ee=>{ee.preventDefault(),ee.stopPropagation(),F(),L({open:!0,x:ee.clientX,y:ee.clientY,record:Z})}})})]}):c.jsx(Xt,{className:"jira-filter-empty",description:"No Jira filters configured yet."}),A.open&&c.jsx(Bl,{trigger:["click"],menu:{items:[{key:"add-todo",disabled:ue,icon:c.jsx(mu,{style:ue?{color:"#52c41a"}:void 0}),label:ue?"Already in To-Do":"Add to To-Do",onClick:()=>{A.record&&!ue&&te(A.record),L(Z=>({...Z,open:!1}))}},{key:"clone-issue",icon:c.jsx(fo,{}),label:"Clone Ticket",onClick:()=>{A.record&&(H(A.record),T(!0)),L(Z=>({...Z,open:!1}))}},{key:"open-jira",icon:c.jsx(zy,{}),label:"Open in Jira",onClick:()=>{var Z;(Z=A.record)!=null&&Z.url&&hr(A.record.url),L(ee=>({...ee,open:!1}))}}]},open:A.open,onOpenChange:Z=>{Z||L(ee=>({...ee,open:!1}))},children:c.jsx("div",{style:{position:"fixed",left:A.x,top:A.y,width:1,height:1,zIndex:9999}})}),c.jsx(obe,{open:C,filters:t,templates:w,onCancel:()=>x(!1),onFilterSave:K,onDelete:Y,onTemplateSave:W,onTemplateDelete:G}),c.jsx(lbe,{open:E,confirmLoading:I,templates:w,onCancel:()=>{I||R(!1)},onCreate:V}),c.jsx(sbe,{open:N,onCancel:()=>O(!1)}),c.jsx(ibe,{open:M,confirmLoading:z,issue:B,onCancel:()=>{z||(T(!1),H(null))},onClone:X})]})}const{TextArea:dbe}=Ct;function fbe({open:e,editingTodo:t,onCancel:n,onSave:r}){const[a]=wt.useForm();l.useEffect(()=>{e&&(t?a.setFieldsValue({title:t.title||"",description:t.description||"",priority:t.priority||"medium",category:t.category||"work",dueDate:t.dueDate?dr(t.dueDate):null}):(a.resetFields(),a.setFieldsValue({priority:"medium",category:"work"})))},[e,t,a]);const o=async()=>{try{const s=await a.validateFields();r({...s,dueDate:s.dueDate?s.dueDate.format("YYYY-MM-DD"):null})}catch{}};return c.jsx(bn,{title:t?"Edit Task":"New Task",open:e,onOk:o,onCancel:n,destroyOnClose:!0,okText:t?"Save":"Create",cancelText:"Cancel",children:c.jsxs(wt,{className:"todo-modal-form",form:a,layout:"vertical",children:[c.jsx(wt.Item,{name:"title",label:"Task Title",rules:[{required:!0,message:"Please enter task title"}],children:c.jsx(Ct,{placeholder:"Enter task title...",maxLength:100,showCount:!0})}),c.jsx(wt.Item,{name:"description",label:"Description / Notes",children:c.jsx(dbe,{rows:6,placeholder:"Add relevant details, background, or notes...",maxLength:500,showCount:!0})}),c.jsxs("div",{className:"todo-modal-grid",children:[c.jsx(wt.Item,{name:"priority",label:"Priority",children:c.jsx($n,{options:[{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}]})}),c.jsx(wt.Item,{name:"category",label:"Category",children:c.jsx($n,{options:[{value:"work",label:c.jsxs(ct,{size:4,children:[c.jsx(Ah,{className:"todo-tone-icon is-brand"}),c.jsx("span",{children:"Work"})]})},{value:"dev",label:c.jsxs(ct,{size:4,children:[c.jsx(wa,{className:"todo-tone-icon is-purple"}),c.jsx("span",{children:"Dev"})]})},{value:"bug",label:c.jsxs(ct,{size:4,children:[c.jsx(Th,{className:"todo-tone-icon is-danger"}),c.jsx("span",{children:"Bug"})]})},{value:"feature",label:c.jsxs(ct,{size:4,children:[c.jsx(qo,{className:"todo-tone-icon is-success"}),c.jsx("span",{children:"Feature"})]})},{value:"personal",label:c.jsxs(ct,{size:4,children:[c.jsx(Dh,{className:"todo-tone-icon is-orange"}),c.jsx("span",{children:"Personal"})]})}]})}),c.jsx(wt.Item,{name:"dueDate",label:"Due Date",children:c.jsx(vl,{className:"todo-modal-date",placeholder:"Select date"})})]})]})})}function $0({text:e,domain:t,jiraIssuePrefix:n,style:r,className:a}){if(!e)return null;const o=[],s=/\[[^\]]+\]\(https?:\/\/[^\s)]+\)|https?:\/\/[^\s]+/g;let u=0;const f=(n||"").split(/[\s,]+/).filter(Boolean).map(p=>p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),m=f.length>0?new RegExp(`\\b(?:${f.join("|")})-[a-zA-Z0-9]{1,10}\\b`,"gi"):/\b[A-Z]{2,10}-\d+\b/g,h=(p,v)=>{const y=[];let b=0;m.lastIndex=0;for(const C of p.matchAll(m)){C.index>b&&y.push(p.slice(b,C.index));const x=C[0],w=t?Ly(t,x):null;w?y.push(c.jsx("a",{href:w,target:"_blank",rel:"noreferrer",onClick:$=>{$.preventDefault(),$.stopPropagation(),hr(w)},className:"todo-link is-jira",children:x},`${v}-${C.index}`)):y.push(x),b=C.index+x.length}return b<p.length&&y.push(p.slice(b)),y};for(const p of e.matchAll(s)){p.index>u&&o.push(...h(e.slice(u,p.index),`txt-${p.index}`));const v=p[0].match(/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/);if(v)o.push(c.jsx("a",{href:v[2],target:"_blank",rel:"noreferrer",onClick:y=>{y.preventDefault(),y.stopPropagation(),hr(v[2])},className:"todo-link",children:v[1]},p.index));else{const y=p[0].replace(/[),.;:!?]+$/,"");o.push(c.jsx("a",{href:y,target:"_blank",rel:"noreferrer",onClick:b=>{b.preventDefault(),b.stopPropagation(),hr(y)},className:"todo-link",children:y},p.index)),p[0].length>y.length&&o.push(p[0].slice(y.length))}u=p.index+p[0].length}return u<e.length&&o.push(...h(e.slice(u),"txt-end")),c.jsx("span",{style:r,className:a,children:o})}const{Text:Oi}=xn,mbe={work:{label:"Work",icon:c.jsx(Ah,{}),color:"purple"},dev:{label:"Dev",icon:c.jsx(wa,{}),color:"purple"},bug:{label:"Bug",icon:c.jsx(Th,{}),color:"red"},feature:{label:"Feature",icon:c.jsx(qo,{}),color:"green"},personal:{label:"Personal",icon:c.jsx(Dh,{}),color:"orange"}},hbe={high:{label:"High",color:"error"},medium:{label:"Medium",color:"warning"},low:{label:"Low",color:"default"}},NI={high:3,medium:2,low:1},E0=e=>{const t=Date.parse(e.createdAt||"");return Number.isNaN(t)?0:t},G9=(e,t)=>E0(t)-E0(e),uh=(e,t,n)=>e||G9(t,n)||String(t.title||"").localeCompare(String(n.title||""))||String(t.id||"").localeCompare(String(n.id||"")),OI=(e,t,n)=>{const r=!!e.dueDate,a=!!t.dueDate;if(r!==a)return r?-1:1;if(!r)return uh(0,e,t);const o=e.dueDate.localeCompare(t.dueDate)*n;return uh(o,e,t)},pbe=(e,t,n)=>{if(n==="createdAsc")return uh(E0(e)-E0(t),e,t);if(n==="dueAsc")return OI(e,t,1);if(n==="dueDesc")return OI(e,t,-1);if(n==="priorityDesc"||n==="priorityAsc"){const r=n==="priorityDesc"?-1:1,a=((NI[e.priority]||0)-(NI[t.priority]||0))*r;return uh(a,e,t)}return uh(G9(e,t),e,t)};function VC({label:e,direction:t,onClick:n}){const r=t==="asc"?"ascending":t==="desc"?"descending":"not sorted";return c.jsxs("button",{type:"button",className:`todo-sort-header-button ${t?"is-active":""}`,"aria-label":`${e}, ${r}. Click to change sorting.`,onClick:n,children:[c.jsx("span",{children:e}),c.jsx("span",{className:`todo-sort-header-icon ${t?"is-single":""}`,"aria-hidden":"true",children:t==="asc"?c.jsx(Uw,{}):t==="desc"?c.jsx(Vw,{}):c.jsxs(c.Fragment,{children:[c.jsx(Uw,{}),c.jsx(Vw,{})]})})]})}function gbe(){const{message:e}=Pr.useApp(),[t,n]=l.useState([]),[r,a]=l.useState(!0),[o,s]=l.useState(""),[u,f]=l.useState("all"),[m,h]=l.useState("all"),[p,v]=l.useState("all"),[y,b]=l.useState("none"),[C,x]=l.useState(""),[w,$]=l.useState("medium"),[E,R]=l.useState("work"),[N,O]=l.useState(!1),[I,j]=l.useState([]),[M,T]=l.useState({domain:"",jiraIssuePrefix:""}),[z,P]=l.useState(!1),[B,H]=l.useState(null),A=()=>{O(!1),j([])},L=J=>{!N||J.target.closest(".todo-item-card, .todo-select-all-checkbox, .todo-select-mode-icon, .todo-batch-bar")||A()};l.useEffect(()=>{if(!N)return;const J=xe=>{xe.key!=="Escape"||z||(xe.preventDefault(),A())},ye=xe=>{z||!(xe.target instanceof Element)||xe.target.closest(".todo-item-card, .todo-select-all-checkbox, .todo-select-mode-icon, .todo-batch-bar")||A()};return window.addEventListener("keydown",J),document.addEventListener("click",ye),()=>{window.removeEventListener("keydown",J),document.removeEventListener("click",ye)}},[N,z]);const F=l.useCallback(async()=>{a(!0);try{const J=await Wa.list();n(J)}catch(J){e.error(J.message)}finally{a(!1)}},[e]);l.useEffect(()=>{F(),Wn.status().then(J=>{J&&T(J)}).catch(()=>{})},[F]);const U=l.useMemo(()=>t.filter(J=>!J.archived),[t]),q=l.useMemo(()=>t.filter(J=>J.archived).length,[t]),_=l.useMemo(()=>{const J=U.length,ye=U.filter(ce=>ce.completed).length,xe=J-ye,ze=J>0?Math.round(ye/J*100):0,he=U.filter(ce=>!ce.completed&&ce.priority==="high").length;return{total:J,completed:ye,active:xe,rate:ze,highPriorityCount:he}},[U]),K=async()=>{const J=C.trim();if(J)try{const ye=await Wa.create({title:J,priority:w,category:E,completed:!1});n(xe=>[ye,...xe]),x(""),e.success("Task added")}catch(ye){e.error(ye.message)}},X=async J=>{try{if(B){const ye=await Wa.update(B.id,J);n(xe=>xe.map(ze=>ze.id===ye.id?ye:ze)),e.success("Task updated")}else{const ye=await Wa.create(J);n(xe=>[ye,...xe]),e.success("Task created")}P(!1)}catch(ye){e.error(ye.message)}},V=async J=>{try{const ye=await Wa.update(J.id,{...J,completed:!J.completed});n(xe=>xe.map(ze=>ze.id===ye.id?ye:ze))}catch(ye){e.error(ye.message)}},W=async J=>{try{await Wa.archive(J),n(ye=>ye.map(xe=>xe.id===J?{...xe,archived:!0,archivedAt:new Date().toISOString()}:xe)),e.success("Task archived")}catch(ye){e.error(ye.message)}},G=async J=>{try{await Wa.remove(J),n(ye=>ye.filter(xe=>xe.id!==J)),j(ye=>ye.filter(xe=>xe!==J)),e.success("Task deleted")}catch(ye){e.error(ye.message)}},Y=async J=>{if(J==="clearCompleted"){try{const ye=await Wa.batch("clearCompleted");n(ye),j([]),e.success("Completed tasks cleared")}catch(ye){e.error(ye.message)}return}if(I.length)try{const ye=await Wa.batch(J,I);n(ye),j([]),e.success("Batch action succeeded")}catch(ye){e.error(ye.message)}},te=l.useMemo(()=>{let J=U;if(o.trim()){const xe=o.toLowerCase().trim();J=J.filter(ze=>ze.title.toLowerCase().includes(xe)||(ze.description||"").toLowerCase().includes(xe))}u==="active"?J=J.filter(xe=>!xe.completed):u==="completed"&&(J=J.filter(xe=>xe.completed)),m!=="all"&&(J=J.filter(xe=>xe.priority===m)),p!=="all"&&(J=J.filter(xe=>xe.category===p));const ye=y==="none"?[...J]:[...J].sort((xe,ze)=>pbe(xe,ze,y));return[...ye.filter(xe=>!xe.completed),...ye.filter(xe=>xe.completed)]},[U,o,u,m,p,y]),ne=l.useMemo(()=>te.map(J=>J.id),[te]),ue=ne.length>0&&ne.every(J=>I.includes(J)),Z=I.length>0,ee=J=>{J.target.checked?j(ne):j([])},re=J=>{j(ye=>ye.includes(J)?ye.filter(xe=>xe!==J):[...ye,J])},oe=J=>{const ye={created:["createdDesc","createdAsc"],priority:["priorityDesc","priorityAsc"],due:["dueAsc","dueDesc"]},[xe,ze]=ye[J];b(he=>he===xe?ze:he===ze?"none":xe)},de=J=>y.startsWith(J)?y.endsWith("Asc")?"asc":"desc":null,be=dr().format("YYYY-MM-DD");return c.jsxs("div",{className:`todo-page ${N?"is-select-mode":""}`,onClick:L,children:[c.jsx(Ur,{actions:c.jsx("div",{className:"todo-header-actions",children:c.jsxs(ct,{className:"todo-header-button-group",wrap:!0,children:[c.jsxs(Oe,{className:"todo-archive-link",icon:c.jsx(zh,{}),onClick:()=>{window.location.hash="#/todo-list/archived"},children:["Archived (",q,")"]}),c.jsx(Oe,{icon:c.jsx(Xa,{}),onClick:F,loading:r,children:"Refresh"}),c.jsx(Oe,{type:"primary",icon:c.jsx(Xn,{}),onClick:()=>{H(null),P(!0)},children:"New Task"})]})}),className:"todo-page-header",copyClassName:"todo-header-copy",description:"Manage and track development tasks, bug fixes, and feature items efficiently.",descriptionClassName:"todo-page-description",title:"To-Do",titleClassName:"todo-page-title"}),c.jsxs("div",{className:"todo-stats-grid",children:[c.jsxs(It,{className:"todo-stat-card is-total",size:"small",children:[c.jsxs("div",{className:"todo-stat-head",children:[c.jsx(Oi,{className:"todo-stat-label",children:"Total Tasks"}),c.jsx("span",{className:"todo-stat-icon",children:c.jsx(mu,{})})]}),c.jsx("div",{className:"todo-stat-value",children:_.total})]}),c.jsxs(It,{className:"todo-stat-card is-pending",size:"small",children:[c.jsxs("div",{className:"todo-stat-head",children:[c.jsx(Oi,{className:"todo-stat-label",children:"Active (Pending)"}),c.jsx("span",{className:"todo-stat-icon",children:c.jsx(Wl,{})})]}),c.jsxs("div",{className:`todo-stat-value ${_.active>0?"is-active":""}`,children:[_.active,_.highPriorityCount>0&&c.jsxs("span",{className:"todo-stat-warning",children:["(",_.highPriorityCount," high priority)"]})]})]}),c.jsxs(It,{className:"todo-stat-card is-completed",size:"small",children:[c.jsxs("div",{className:"todo-stat-head",children:[c.jsx(Oi,{className:"todo-stat-label",children:"Completed"}),c.jsx("span",{className:"todo-stat-icon",children:c.jsx(gi,{})})]}),c.jsx("div",{className:"todo-stat-value is-complete",children:_.completed})]}),c.jsxs(It,{className:"todo-stat-card is-rate",size:"small",children:[c.jsxs("div",{className:"todo-stat-rate",children:[c.jsx(Oi,{className:"todo-stat-label",children:"Completion Rate"}),c.jsxs(Oi,{className:"todo-stat-percentage",strong:!0,children:[_.rate,"%"]})]}),c.jsx(dp,{className:"todo-stat-progress",percent:_.rate,showInfo:!1,size:"small"})]})]}),c.jsxs(It,{className:"todo-quick-add-card",size:"small",children:[c.jsxs("div",{className:"todo-quick-add-header",children:[c.jsx("span",{className:"todo-quick-add-icon",children:c.jsx(Xn,{})}),c.jsxs("div",{children:[c.jsx(Oi,{className:"todo-quick-add-title",children:"Quick add"}),c.jsx(Oi,{className:"todo-quick-add-hint",children:"Capture a task now and add the details later."})]})]}),c.jsxs("div",{className:"todo-quick-add-row",children:[c.jsx(Ct,{className:"todo-quick-title",placeholder:"Quickly add a task... (Press Enter to submit)",value:C,onChange:J=>x(J.target.value),onPressEnter:K,size:"large"}),c.jsx($n,{className:"todo-quick-select",value:w,onChange:$,size:"large",options:[{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}]}),c.jsx($n,{className:"todo-quick-select",value:E,onChange:R,size:"large",options:[{value:"work",label:c.jsxs(ct,{size:4,children:[c.jsx(Ah,{className:"todo-tone-icon is-brand"}),c.jsx("span",{children:"Work"})]})},{value:"dev",label:c.jsxs(ct,{size:4,children:[c.jsx(wa,{className:"todo-tone-icon is-purple"}),c.jsx("span",{children:"Dev"})]})},{value:"bug",label:c.jsxs(ct,{size:4,children:[c.jsx(Th,{className:"todo-tone-icon is-danger"}),c.jsx("span",{children:"Bug"})]})},{value:"feature",label:c.jsxs(ct,{size:4,children:[c.jsx(qo,{className:"todo-tone-icon is-success"}),c.jsx("span",{children:"Feature"})]})},{value:"personal",label:c.jsxs(ct,{size:4,children:[c.jsx(Dh,{className:"todo-tone-icon is-orange"}),c.jsx("span",{children:"Personal"})]})}]}),c.jsx(Oe,{type:"primary",size:"large",icon:c.jsx(Xn,{}),onClick:K,children:"Add"})]})]}),c.jsx(It,{className:"todo-filter-card",size:"small",children:c.jsxs("div",{className:"todo-filter-row",children:[c.jsxs(er.Group,{className:"todo-status-filter",value:u,onChange:J=>f(J.target.value),optionType:"button",buttonStyle:"solid",children:[c.jsxs(er.Button,{value:"all",children:["All (",_.total,")"]}),c.jsxs(er.Button,{value:"active",children:["Active (",_.active,")"]}),c.jsxs(er.Button,{value:"completed",children:["Completed (",_.completed,")"]})]}),c.jsxs("div",{className:"todo-filter-tools",children:[c.jsx(Ct,{className:"todo-search-input",prefix:c.jsx(jo,{}),placeholder:"Search tasks...",value:o,onChange:J=>s(J.target.value),allowClear:!0}),c.jsx($n,{className:"todo-filter-select",value:p,onChange:v,options:[{value:"all",label:"All categories"},{value:"work",label:c.jsxs(ct,{size:4,children:[c.jsx(Ah,{className:"todo-tone-icon is-brand"}),c.jsx("span",{children:"Work"})]})},{value:"dev",label:c.jsxs(ct,{size:4,children:[c.jsx(wa,{className:"todo-tone-icon is-purple"}),c.jsx("span",{children:"Dev"})]})},{value:"bug",label:c.jsxs(ct,{size:4,children:[c.jsx(Th,{className:"todo-tone-icon is-danger"}),c.jsx("span",{children:"Bug"})]})},{value:"feature",label:c.jsxs(ct,{size:4,children:[c.jsx(qo,{className:"todo-tone-icon is-success"}),c.jsx("span",{children:"Feature"})]})},{value:"personal",label:c.jsxs(ct,{size:4,children:[c.jsx(Dh,{className:"todo-tone-icon is-orange"}),c.jsx("span",{children:"Personal"})]})}]}),c.jsx($n,{className:"todo-filter-select",value:m,onChange:h,options:[{value:"all",label:"All priorities"},{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"low",label:"Low"}]}),c.jsx($n,{className:"todo-mobile-sort-select","aria-label":"Sort tasks",value:y,onChange:b,options:[{value:"none",label:"Default order"},{value:"createdDesc",label:"Created: Newest"},{value:"createdAsc",label:"Created: Oldest"},{value:"dueAsc",label:"Due: Earliest"},{value:"dueDesc",label:"Due: Latest"},{value:"priorityDesc",label:"Priority: High"},{value:"priorityAsc",label:"Priority: Low"}]})]})]})}),N&&c.jsxs("div",{className:"todo-batch-bar",role:"toolbar","aria-label":"Selected task actions",children:[c.jsxs(Oi,{className:"todo-batch-count",children:[c.jsx("strong",{children:I.length})," items selected"]}),c.jsxs(ct,{wrap:!0,children:[c.jsx(Oe,{size:"small",icon:c.jsx(gi,{}),disabled:!I.length,onClick:()=>Y("markCompleted"),children:"Mark Completed"}),c.jsx(Oe,{size:"small",icon:c.jsx(Wl,{}),disabled:!I.length,onClick:()=>Y("markPending"),children:"Mark Active"}),c.jsx(Gr,{title:"Are you sure you want to delete selected tasks?",onConfirm:()=>Y("delete"),okText:"Delete",cancelText:"Cancel",disabled:!I.length,children:c.jsx(Oe,{size:"small",danger:!0,icon:c.jsx(Fn,{}),disabled:!I.length,children:"Delete Selected"})}),c.jsx(Oe,{size:"small",type:"link",onClick:()=>{A()},children:"Exit Select Mode"})]})]}),!r&&te.length>0&&c.jsxs("div",{className:"todo-table-header",children:[c.jsx("div",{className:"todo-item-check",children:c.jsxs("div",{className:"todo-select-control",children:[c.jsx(yn,{title:ue?"Deselect all tasks":"Select all tasks",children:c.jsx(tr,{className:`todo-select-control-option todo-select-all-checkbox ${N?"":"is-hidden"}`,"aria-hidden":!N,"aria-label":ue?"Deselect all tasks":"Select all tasks",checked:ue,indeterminate:Z&&!ue,tabIndex:N?0:-1,onChange:ee})}),c.jsx(yn,{title:"Enter Select Mode",children:c.jsx(mu,{className:`todo-select-control-option todo-select-mode-icon ${N?"is-hidden":""}`,"aria-hidden":N,onClick:()=>O(!0)})})]})}),c.jsx("div",{className:"todo-table-title",children:"Task Content"}),c.jsx("div",{className:"todo-table-created",role:"columnheader","aria-sort":de("created")==="asc"?"ascending":de("created")==="desc"?"descending":"none",children:c.jsx(VC,{label:"Created",direction:de("created"),onClick:()=>oe("created")})}),c.jsx("div",{className:"todo-table-filter",children:"Category"}),c.jsx("div",{className:"todo-table-filter",role:"columnheader","aria-sort":de("priority")==="asc"?"ascending":de("priority")==="desc"?"descending":"none",children:c.jsx(VC,{label:"Priority",direction:de("priority"),onClick:()=>oe("priority")})}),c.jsx("div",{className:"todo-table-date",role:"columnheader","aria-sort":de("due")==="asc"?"ascending":de("due")==="desc"?"descending":"none",children:c.jsx(VC,{label:"Due Date",direction:de("due"),onClick:()=>oe("due")})}),c.jsx("div",{className:"todo-table-actions",children:"Actions"})]}),r?c.jsxs("div",{className:"todo-loading-state",children:[c.jsx(rr,{size:"large"}),c.jsx(Oi,{type:"secondary",children:"Loading tasks…"})]}):te.length===0?c.jsx("div",{className:"todo-state-card",children:c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:U.length===0?"No tasks yet. Create your first task!":"No matching tasks found.",children:U.length===0&&c.jsx(Oe,{type:"primary",icon:c.jsx(Xn,{}),onClick:()=>{H(null),P(!0)},children:"New Task"})})}):c.jsx("div",{className:"todo-list-items",children:te.map(J=>{var se;const ye=mbe[J.category]||{label:J.category,color:"default"},xe=hbe[J.priority]||{label:J.priority,color:"default"},ze=J.dueDate&&J.dueDate<be&&!J.completed,he=dr(J.createdAt),ce=J.createdAt&&he.isValid()?he.format("YYYY-MM-DD HH:mm:ss"):"Created time unavailable";return c.jsx(It,{size:"small",className:`todo-item-card priority-${J.priority||"none"} ${I.includes(J.id)?"is-selected":""} ${J.completed?"is-completed":""}`,children:c.jsxs("div",{className:"todo-list-row",children:[c.jsx("div",{className:"todo-item-check",children:N?c.jsx(tr,{checked:I.includes(J.id),onChange:()=>re(J.id)}):c.jsx(yn,{title:J.completed?"Mark as active":"Mark as completed",children:c.jsx(tr,{className:"todo-item-checkbox",checked:J.completed,onChange:()=>V(J)})})}),c.jsxs("div",{className:"todo-item-copy",children:[c.jsx("div",{className:"todo-item-title",children:c.jsx($0,{text:J.title,domain:M.domain,jiraIssuePrefix:M.jiraIssuePrefix})}),!!((se=J.description)!=null&&se.trim())&&c.jsx("div",{className:"todo-item-description",children:c.jsx($0,{text:J.description.trim(),domain:M.domain,jiraIssuePrefix:M.jiraIssuePrefix})})]}),c.jsx("div",{className:"todo-item-created","data-label":"Created",children:c.jsx(yn,{title:ce,children:c.jsx("span",{className:"todo-created-icon",tabIndex:0,"aria-label":ce==="Created time unavailable"?ce:`Created ${ce}`,children:c.jsx(jy,{})})})}),c.jsx("div",{className:"todo-item-meta","data-label":"Category",children:c.jsx($t,{className:"todo-item-tag",color:ye.color,icon:ye.icon,children:ye.label})}),c.jsx("div",{className:"todo-item-meta","data-label":"Priority",children:c.jsx($t,{className:"todo-item-tag",color:xe.color,children:xe.label})}),c.jsx("div",{className:"todo-item-date","data-label":"Due",children:J.dueDate?c.jsxs(Oi,{className:`todo-due-text ${ze?"is-overdue":""}`,children:[J.dueDate,ze&&c.jsx("span",{className:"todo-overdue-status",children:"(Overdue)"})]}):c.jsx(Oi,{className:"todo-empty-value",type:"secondary",children:"—"})}),c.jsx("div",{className:"todo-item-actions",children:c.jsxs(ct,{size:"small",children:[J.completed&&c.jsx(yn,{title:"Archive task",children:c.jsx(Oe,{className:"todo-action-button is-archive",type:"text",size:"small",icon:c.jsx(cve,{}),onClick:()=>W(J.id)})}),c.jsx(Oe,{className:"todo-action-button",type:"text",size:"small",icon:c.jsx(Wo,{}),onClick:()=>{H(J),P(!0)}}),c.jsx(Gr,{title:"Are you sure you want to delete this task?",onConfirm:()=>G(J.id),okText:"Delete",cancelText:"Cancel",children:c.jsx(Oe,{className:"todo-action-button",type:"text",danger:!0,size:"small",icon:c.jsx(Fn,{})})})]})})]})},J.id)})}),u==="completed"&&_.completed>0&&c.jsx("div",{className:"todo-page-footer",children:c.jsx(Gr,{title:`Are you sure you want to clear all ${_.completed} completed tasks?`,onConfirm:()=>Y("clearCompleted"),okText:"Clear",cancelText:"Cancel",children:c.jsxs(Oe,{type:"dashed",danger:!0,icon:c.jsx(Fn,{}),children:["Clear all completed tasks (",_.completed,")"]})})}),c.jsx(fbe,{open:z,editingTodo:B,onCancel:()=>P(!1),onSave:X})]})}const{Text:RI}=xn,vbe={work:{label:"Work",icon:c.jsx(Ah,{}),color:"purple"},dev:{label:"Dev",icon:c.jsx(wa,{}),color:"purple"},bug:{label:"Bug",icon:c.jsx(Th,{}),color:"red"},feature:{label:"Feature",icon:c.jsx(qo,{}),color:"green"},personal:{label:"Personal",icon:c.jsx(Dh,{}),color:"orange"}},ybe={high:{label:"High",color:"error"},medium:{label:"Medium",color:"warning"},low:{label:"Low",color:"default"}};function bbe(){const{message:e}=Pr.useApp(),[t,n]=l.useState([]),[r,a]=l.useState(!0),[o,s]=l.useState(""),[u,f]=l.useState({domain:"",jiraIssuePrefix:""}),m=l.useCallback(async()=>{a(!0);try{const b=await Wa.list();n(b)}catch(b){e.error(b.message)}finally{a(!1)}},[e]);l.useEffect(()=>{m(),Wn.status().then(b=>{b&&f(b)}).catch(()=>{})},[m]);const h=l.useMemo(()=>{let b=t.filter(C=>C.archived);if(o.trim()){const C=o.toLowerCase().trim();b=b.filter(x=>x.title.toLowerCase().includes(C)||(x.description||"").toLowerCase().includes(C))}return b.sort((C,x)=>new Date(x.archivedAt||0)-new Date(C.archivedAt||0))},[t,o]),p=async b=>{try{await Wa.unarchive(b),n(C=>C.map(x=>x.id===b?{...x,archived:!1,archivedAt:null}:x)),e.success("Task restored to To-Do")}catch(C){e.error(C.message)}},v=async b=>{try{await Wa.remove(b),n(C=>C.filter(x=>x.id!==b)),e.success("Task permanently deleted")}catch(C){e.error(C.message)}},y=async()=>{try{const b=await Wa.batch("clearArchived");n(b),e.success("All archived tasks cleared")}catch(b){e.error(b.message)}};return c.jsxs("div",{className:"todo-archive-page",children:[c.jsx(Ur,{actions:c.jsxs(ct,{className:"todo-archive-header-actions",wrap:!0,children:[c.jsx(Oe,{icon:c.jsx(ec,{}),onClick:()=>{window.location.hash="#/todo-list"},children:"Back to To-Do"}),c.jsx(Oe,{icon:c.jsx(Xa,{}),onClick:m,loading:r,children:"Refresh"})]}),className:"todo-page-header",copyClassName:"todo-header-copy",description:"View and manage archived tasks. Archived items can be restored back to your active To-Do.",descriptionClassName:"todo-page-description",title:c.jsxs(c.Fragment,{children:[c.jsx(zh,{className:"todo-brand-text todo-title-icon"}),"Archived Tasks"]}),titleClassName:"todo-page-title"}),c.jsx(It,{className:"todo-archive-toolbar",size:"small",children:c.jsxs("div",{className:"todo-archive-toolbar-row",children:[c.jsxs(RI,{type:"secondary",children:["Total Archived: ",c.jsx("strong",{className:"todo-brand-text",children:h.length})," items"]}),c.jsx(Ct,{className:"todo-archive-search",prefix:c.jsx(jo,{}),placeholder:"Search archived tasks...",value:o,onChange:b=>s(b.target.value),allowClear:!0})]})}),h.length>0&&c.jsxs("div",{className:"todo-table-header todo-archive-table-header",children:[c.jsx("span",{className:"todo-table-title",children:"Task Content"}),c.jsx("div",{className:"todo-archive-column-meta",children:"Category"}),c.jsx("div",{className:"todo-archive-column-meta",children:"Priority"}),c.jsx("div",{className:"todo-archive-column-date",children:"Archived At"}),c.jsx("div",{className:"todo-archive-column-actions",children:"Actions"})]}),r?c.jsxs("div",{className:"todo-loading-state",children:[c.jsx(rr,{size:"large"}),c.jsx(RI,{type:"secondary",children:"Loading archived tasks…"})]}):h.length===0?c.jsx("div",{className:"todo-state-card",children:c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No archived tasks found.",children:c.jsx(Oe,{icon:c.jsx(ec,{}),onClick:()=>{window.location.hash="#/todo-list"},children:"Back to To-Do"})})}):c.jsx("div",{className:"todo-archive-list",children:h.map(b=>{var $;const C=vbe[b.category]||{label:b.category,color:"default"},x=ybe[b.priority]||{label:b.priority,color:"default"},w=b.archivedAt?dr(b.archivedAt).format("YYYY-MM-DD HH:mm"):"—";return c.jsx(It,{size:"small",className:`todo-archive-card priority-${b.priority||"none"} ${b.completed?"is-completed":""}`,children:c.jsxs("div",{className:"todo-archive-row",children:[c.jsxs("div",{className:"todo-item-copy",children:[c.jsx("div",{className:"todo-item-title",children:c.jsx($0,{text:b.title,domain:u.domain,jiraIssuePrefix:u.jiraIssuePrefix})}),!!(($=b.description)!=null&&$.trim())&&c.jsx("div",{className:"todo-item-description",children:c.jsx($0,{text:b.description.trim(),domain:u.domain,jiraIssuePrefix:u.jiraIssuePrefix})})]}),c.jsx("div",{className:"todo-archive-column-meta","data-label":"Category",children:c.jsx($t,{className:"todo-item-tag",color:C.color,icon:C.icon,children:C.label})}),c.jsx("div",{className:"todo-archive-column-meta","data-label":"Priority",children:c.jsx($t,{className:"todo-item-tag",color:x.color,children:x.label})}),c.jsx("div",{className:"todo-archive-column-date","data-label":"Archived",children:c.jsxs($t,{className:"todo-item-tag",color:"default",children:[c.jsx(Wl,{className:"todo-inline-icon"}),w]})}),c.jsx("div",{className:"todo-archive-column-actions",children:c.jsxs(ct,{size:"small",children:[c.jsx(yn,{title:"Restore to To-Do",children:c.jsx(Oe,{className:"todo-action-button",type:"text",size:"small",icon:c.jsx(z9,{className:"todo-restore-icon"}),onClick:()=>p(b.id)})}),c.jsx(Gr,{title:"Permanently delete this archived task?",onConfirm:()=>v(b.id),okText:"Delete",cancelText:"Cancel",children:c.jsx(Oe,{className:"todo-action-button",type:"text",danger:!0,size:"small",icon:c.jsx(Fn,{})})})]})})]})},b.id)})}),h.length>0&&c.jsx("div",{className:"todo-page-footer",children:c.jsx(Gr,{title:`Are you sure you want to permanently delete all ${h.length} archived tasks?`,onConfirm:y,okText:"Delete All",cancelText:"Cancel",children:c.jsxs(Oe,{type:"dashed",danger:!0,icon:c.jsx(Fn,{}),children:["Clear all archived tasks (",h.length,")"]})})})]})}const{Title:xbe}=xn,Cbe=()=>{const n=(window.location.hash||"").slice(2).split("/");if(n[0]==="logs"){const r=n[1]||"",a=n[2]==="pkg",o=a?n[3]:n[2];return{launcherId:r,isPackage:a,scriptIdOrName:o}}return{launcherId:null,isPackage:!1,scriptIdOrName:null}};function Sbe(){const{message:e}=Pr.useApp(),{launcherId:t,isPackage:n,scriptIdOrName:r}=Cbe(),[a,o]=l.useState("output"),[s,u]=l.useState(""),[f,m]=l.useState(!0),[h,p]=l.useState(!1),[v,y]=l.useState(""),[b,C]=l.useState(r),x=l.useRef(null);l.useEffect(()=>{t&&Br.list().then(E=>{var N;const R=E.find(O=>O.id===t);if(R&&(R.alias&&y(R.alias),!n&&r))if(r==="install")C("Install");else{const O=(N=R.scripts)==null?void 0:N.find(I=>I.id===r);O!=null&&O.name&&C(O.name)}}).catch(()=>{})},[t,n,r]),l.useEffect(()=>{const E=v?`${v} · `:"",R=b||r||"Logs";return document.title=`${E}${R} · DevBuddy`,()=>{document.title="DevBuddy · Workbench"}},[v,b,r]),l.useEffect(()=>{if(!t||!r)return;const E=async()=>{if(!w0())try{const N=n?a==="error"?await Br.packageScriptErrorLogs(t,r):await Br.packageScriptLogs(t,r):a==="error"?await Br.errorLogs(t,r):await Br.logs(t,r);w0()||u(N.log||(a==="error"?"No error logs yet.":"No logs yet."))}catch(N){u(N.message)}finally{m(!1)}};E();const R=setInterval(E,1e3);return()=>clearInterval(R)},[t,n,r,a]),l.useEffect(()=>{if(x.current){const E=x.current.querySelector(".log-output");E&&(E.scrollTop=E.scrollHeight)}},[s]);const w=async()=>{try{await navigator.clipboard.writeText(window.location.href),p(!0),e.success("URL copied to clipboard"),setTimeout(()=>p(!1),2e3)}catch{e.error("Failed to copy URL")}},$=()=>{window.close()};return!t||!r?c.jsx("div",{className:"standalone-log-container standalone-log-invalid",children:c.jsx("div",{children:"Invalid log target specified in URL."})}):c.jsxs("div",{className:"standalone-log-container",ref:x,children:[c.jsxs("header",{className:"standalone-log-header",children:[c.jsxs("div",{className:"standalone-log-title-row",children:[c.jsxs(xbe,{level:4,className:"standalone-log-title",children:[v||t," ",c.jsx("span",{className:"standalone-log-separator",children:"/"})," ",b||r]}),f&&c.jsx(rr,{size:"small"})]}),c.jsxs("div",{className:"standalone-log-actions",children:[c.jsxs(er.Group,{value:a,onChange:E=>o(E.target.value),size:"small",buttonStyle:"solid",children:[c.jsx(er.Button,{value:"output",children:"Output"}),c.jsx(er.Button,{value:"error",children:"Errors"})]}),c.jsx(Oe,{size:"small",icon:h?c.jsx(Vl,{}):c.jsx(fo,{}),onClick:w,children:h?"Copied":"Copy URL"}),c.jsx(Oe,{type:"text",icon:c.jsx(Xo,{}),onClick:$,className:"standalone-log-close",title:"Close Tab"})]})]}),c.jsx("div",{className:"standalone-log-body",children:c.jsx(Xw,{value:s,className:"standalone-log-output"})})]})}const{Text:pv}=xn;function wbe(){const{message:e}=Pr.useApp(),[t,n]=l.useState([]),[r,a]=l.useState(!0),[o,s]=l.useState(""),[u,f]=l.useState("All"),[m,h]=l.useState(new Set),[p,v]=l.useState(null),y=async()=>{a(!0);try{const O=await Zc.list();n(O||[])}catch(O){e.error(O.message)}finally{a(!1)}};l.useEffect(()=>{y()},[]);const b=async()=>{try{await Zc.clear(),n([]),e.success("All error records cleared")}catch(O){e.error(O.message)}},C=async O=>{try{await Zc.remove(O),n(I=>I.filter(j=>j.id!==O)),e.success("Error record deleted")}catch(I){e.error(I.message)}},x=O=>{const I=`[${O.timestamp}] [${O.source}] ${O.message}
538
538
 
539
539
  ${O.details||""}`;navigator.clipboard.writeText(I),v(O.id),setTimeout(()=>{v(j=>j===O.id?null:j)},1200)},w=O=>{h(I=>{const j=new Set(I);return j.has(O)?j.delete(O):j.add(O),j})},$=l.useMemo(()=>{const O=new Set;for(const I of t)I.source&&(I.source.startsWith("Launcher")?O.add("Launcher"):I.source.startsWith("Backend")?O.add("Backend API"):I.source.startsWith("Frontend")?O.add("Frontend"):O.add(I.source));return["All",...Array.from(O)]},[t]),E=l.useMemo(()=>t.filter(O=>{var I,j,M;if(u!=="All"&&(u==="Launcher"&&!((I=O.source)!=null&&I.startsWith("Launcher"))||u==="Backend API"&&!((j=O.source)!=null&&j.startsWith("Backend"))||u==="Frontend"&&!((M=O.source)!=null&&M.startsWith("Frontend"))||!["Launcher","Backend API","Frontend"].includes(u)&&O.source!==u))return!1;if(o.trim()){const T=o.toLowerCase(),z=(O.message||"").toLowerCase(),P=(O.source||"").toLowerCase(),B=(O.details||"").toLowerCase();return z.includes(T)||P.includes(T)||B.includes(T)}return!0}),[t,u,o]),R=(O="")=>O.startsWith("Launcher")?"orange":O.startsWith("Backend")?"purple":O.startsWith("Frontend")?"magenta":"default",N=O=>{if(!O)return"";try{return new Date(O).toLocaleString("sv-SE").replace(" "," ")}catch{return O}};return c.jsxs("div",{className:"error-logs-page",children:[c.jsx(Ur,{actions:c.jsxs(ct,{size:12,align:"center",children:[c.jsx(Oe,{icon:c.jsx(Xa,{}),loading:r,onClick:y,children:"Refresh"}),c.jsx(Gr,{title:"Clear all error logs?",description:"This action will permanently delete all stored error records.",onConfirm:b,okText:"Yes, clear",cancelText:"Cancel",okButtonProps:{danger:!0},children:c.jsxs(Oe,{danger:!0,icon:c.jsx(Fn,{}),disabled:t.length===0,children:["Clear All (",t.length,")"]})})]}),description:"Captures the 100 most recent errors from launchers, backend APIs, and frontend execution.",title:"Error history"}),c.jsxs("div",{className:"error-logs-toolbar",children:[c.jsx(sp,{options:$.map(O=>{const I=O==="All"?t.length:t.filter(j=>{var M,T,z;return O==="Launcher"?(M=j.source)==null?void 0:M.startsWith("Launcher"):O==="Backend API"?(T=j.source)==null?void 0:T.startsWith("Backend"):O==="Frontend"?(z=j.source)==null?void 0:z.startsWith("Frontend"):j.source===O}).length;return{label:`${O} (${I})`,value:O}}),value:u,onChange:f}),c.jsx(Ct,{placeholder:"Search error message or details...",prefix:c.jsx(jo,{className:"error-logs-search-icon"}),allowClear:!0,value:o,onChange:O=>s(O.target.value),className:"error-logs-search"})]}),E.length>0?c.jsx("div",{className:"error-logs-list",children:E.map(O=>{const I=m.has(O.id);return c.jsxs(It,{size:"small",className:"error-log-item",children:[c.jsxs("div",{className:"error-log-summary",children:[c.jsxs("div",{className:"error-log-copy",children:[c.jsxs("div",{className:"error-log-meta",children:[c.jsxs($t,{color:"error",className:"error-log-tag",children:[c.jsx(uf,{})," ERROR"]}),c.jsx($t,{color:R(O.source),className:"error-log-tag",children:O.source}),c.jsx(pv,{type:"secondary",className:"error-log-timestamp",children:N(O.timestamp)})]}),c.jsx(pv,{strong:!0,className:"error-log-message",children:O.message})]}),c.jsxs(ct,{size:4,className:"error-log-actions",children:[O.details&&c.jsx(Oe,{type:"text",size:"small",icon:I?c.jsx(Cu,{}):c.jsx(Ko,{}),onClick:()=>w(O.id),children:I?"Hide Details":"Details"}),c.jsx(yn,{title:p===O.id?"Copied!":"Copy error",children:c.jsx(Oe,{type:"text",size:"small",icon:p===O.id?c.jsx(Vl,{className:"error-log-copy-success"}):c.jsx(fo,{}),"aria-label":"Copy error",onClick:()=>x(O)})}),c.jsx(yn,{title:"Delete entry",children:c.jsx(Oe,{type:"text",size:"small",danger:!0,icon:c.jsx(Fn,{}),"aria-label":"Delete error",onClick:()=>C(O.id)})})]})]}),O.details&&I&&c.jsx("div",{className:"error-log-details",children:c.jsx("pre",{className:"log-output error-log-output",children:c.jsx("code",{children:O.details})})})]},O.id)})}):c.jsx(It,{className:"error-logs-empty-card",children:c.jsx(Xt,{image:c.jsx(gi,{className:"error-logs-empty-icon"}),description:c.jsxs("div",{className:"error-logs-empty-copy",children:[c.jsx(pv,{strong:!0,className:"error-logs-empty-title",children:t.length===0?"No error records":"No matching error records"}),c.jsx(pv,{type:"secondary",children:t.length===0?"Recent error events (up to 100) will be automatically captured and listed here.":"Try clearing your search query or switching filters."})]})})}),c.jsx(oc.BackTop,{visibilityHeight:240})]})}const{Text:Ac}=xn,$be={GET:"green",POST:"gold",PUT:"blue",DELETE:"red",PATCH:"purple",HEAD:"cyan",OPTIONS:"volcano"};function Ebe({collections:e=[],activeCollectionId:t=null,activeRequestId:n=null,onSelectRequest:r,onOpenImportModal:a,onOpenEnvModal:o,onCreateCollection:s,onUpdateCollection:u,onDeleteCollection:f}){const[m,h]=l.useState(""),[p,v]=l.useState(new Set),[y,b]=l.useState(new Set),[C,x]=l.useState(!1),[w,$]=l.useState(null),[E,R]=l.useState(""),N=B=>{b(H=>{const A=new Set(H);return A.has(B)?A.delete(B):A.add(B),A})},O=B=>{v(H=>{const A=new Set(H);return A.has(B)?A.delete(B):A.add(B),A})},I=(B,H,A,L)=>{$({type:B,collectionId:H,itemId:A,currentName:L}),R(L||""),x(!0)},j=()=>{if(!w||!E.trim())return;const{type:B,collectionId:H,itemId:A}=w,L=E.trim();if(B==="collection")u(H,{name:L});else if(B==="item"){const F=e.find(U=>U.id===H);if(F){const U=(F.items||[]).map(q=>q.id===A?{...q,name:L}:q);u(H,{items:U})}}x(!1),$(null)},M=(B,H=null)=>{const A=e.find(q=>q.id===B);if(!A)return;b(q=>{if(q.has(B)){const _=new Set(q);return _.delete(B),_}return q}),H&&v(q=>new Set(q).add(H));const L=`req_${Date.now()}`,F={id:L,name:"New Request",parentId:H,isFolder:!1,method:"GET",url:"https://jsonplaceholder.typicode.com/todos/1",params:[{key:"",value:"",enabled:!0}],headers:[],body:{mode:"none",raw:"",json:"",formdata:[],urlencoded:[]},auth:{type:"none"}},U=[...A.items||[],F];u(B,{items:U}),r(B,L)},T=(B,H=null)=>{const A=e.find(U=>U.id===B);if(!A)return;b(U=>{if(U.has(B)){const q=new Set(U);return q.delete(B),q}return U}),H&&v(U=>new Set(U).add(H));const L={id:`folder_${Date.now()}`,name:"New Folder",parentId:H,isFolder:!0},F=[...A.items||[],L];u(B,{items:F})},z=(B,H)=>{const A=e.find(q=>q.id===B);if(!A)return;const L=new Set([H]);let F=!0;for(;F;)F=!1,A.items.forEach(q=>{q.parentId&&L.has(q.parentId)&&!L.has(q.id)&&(L.add(q.id),F=!0)});const U=A.items.filter(q=>!L.has(q.id));u(B,{items:U})},P=(B,H=null,A=1)=>(B.items||[]).filter(F=>(F.parentId||null)===H).map(F=>{var q,_;if(m){const K=(q=F.name)==null?void 0:q.toLowerCase().includes(m.toLowerCase()),X=(_=F.url)==null?void 0:_.toLowerCase().includes(m.toLowerCase());if(!F.isFolder&&!K&&!X)return null}if(F.isFolder){const K=p.has(F.id)||!!m;return c.jsxs("div",{className:"tree-folder-node",children:[c.jsxs("div",{className:"tree-node-row folder-row",style:{paddingLeft:A*14},onClick:()=>O(F.id),onKeyDown:X=>{X.target===X.currentTarget&&(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),O(F.id))},role:"treeitem",tabIndex:0,"aria-expanded":K,children:[c.jsx("span",{className:"node-icon",children:K?c.jsx(Fr,{style:{color:"#faad14"}}):c.jsx(lh,{style:{color:"#faad14"}})}),c.jsx(Ac,{className:"node-title",ellipsis:!0,children:F.name}),c.jsx("div",{className:"node-actions",onClick:X=>X.stopPropagation(),children:c.jsx(Bl,{menu:{items:[{key:"rename-folder",label:"Rename Folder",icon:c.jsx(Wo,{}),onClick:()=>I("item",B.id,F.id,F.name)},{key:"add-req",label:"Add Request",icon:c.jsx(Xn,{}),onClick:()=>M(B.id,F.id)},{key:"add-folder",label:"Add Subfolder",icon:c.jsx(lh,{}),onClick:()=>T(B.id,F.id)},{key:"delete",label:"Delete",icon:c.jsx(Fn,{}),danger:!0,onClick:()=>z(B.id,F.id)}]},trigger:["click"],children:c.jsx(Oe,{type:"text",size:"small",icon:c.jsx(Wv,{}),"aria-label":`Actions for folder ${F.name}`})})})]}),K&&c.jsx("div",{className:"tree-folder-children",children:P(B,F.id,A+1)})]},F.id)}const U=n===F.id;return c.jsxs("div",{className:`tree-node-row request-row ${U?"is-active":""}`,style:{paddingLeft:A*14},onClick:()=>r(B.id,F.id),onKeyDown:K=>{K.target===K.currentTarget&&(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),r(B.id,F.id))},role:"treeitem",tabIndex:0,"aria-selected":U,children:[c.jsx($t,{color:$be[F.method]||"default",style:{marginRight:6,fontSize:"10px",padding:"0 4px",fontWeight:"bold"},children:F.method}),c.jsx(Ac,{className:"node-title",ellipsis:!0,children:F.name}),c.jsx("div",{className:"node-actions",onClick:K=>K.stopPropagation(),children:c.jsx(Bl,{menu:{items:[{key:"rename-req",label:"Rename Request",icon:c.jsx(Wo,{}),onClick:()=>I("item",B.id,F.id,F.name)},{key:"delete",label:"Delete",icon:c.jsx(Fn,{}),danger:!0,onClick:()=>z(B.id,F.id)}]},trigger:["click"],children:c.jsx(Oe,{type:"text",size:"small",icon:c.jsx(Wv,{}),"aria-label":`Actions for request ${F.name}`})})})]},F.id)});return c.jsxs("div",{className:"postman-sidebar",children:[c.jsxs("div",{className:"sidebar-header",children:[c.jsxs("div",{className:"sidebar-title-row",children:[c.jsx(Ac,{strong:!0,className:"postman-sidebar-title",children:"Collections"}),c.jsxs(ct,{size:2,children:[c.jsx(yn,{title:"Open in new browser tab",children:c.jsx(Oe,{type:"text",size:"small",icon:c.jsx(zy,{}),"aria-label":"Open Postman in a new browser tab",onClick:()=>{const B=`${window.location.origin}/#/postman`;window.open(B,"_blank")}})}),c.jsx(yn,{title:"Open in default browser",children:c.jsx(Oe,{type:"text",size:"small",icon:c.jsx(kf,{}),"aria-label":"Open Postman in the default browser",onClick:()=>{const B=`${window.location.origin}/#/postman`;hr(B)}})})]})]}),c.jsxs("div",{className:"sidebar-toolbar",children:[c.jsx(Oe,{size:"small",type:"primary",icon:c.jsx(Xn,{}),onClick:s,className:"postman-toolbar-action",children:"New"}),c.jsx(Oe,{size:"small",icon:c.jsx(X$,{}),onClick:a,className:"postman-toolbar-action",children:"Import"}),c.jsx(yn,{title:"Manage Environments",children:c.jsx(Oe,{size:"small",icon:c.jsx(Gl,{}),"aria-label":"Manage environments",onClick:o})})]}),c.jsx("div",{className:"sidebar-search-row",children:c.jsx(Ct,{prefix:c.jsx(jo,{style:{color:"#a0a6b1"}}),placeholder:"Filter collections & requests…","aria-label":"Filter collections and requests",size:"small",value:m,onChange:B=>h(B.target.value),allowClear:!0})})]}),c.jsx("div",{className:"sidebar-content",role:"tree","aria-label":"API collections and requests",children:e.length===0?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:c.jsxs("div",{className:"postman-empty-copy",children:["No Collections yet.",c.jsx("br",{}),"Click ",c.jsx(Ac,{strong:!0,className:"postman-empty-emphasis",children:"+"})," to create or ",c.jsx(Ac,{strong:!0,className:"postman-empty-emphasis",children:"Import"})," to load Postman / cURL."]}),className:"postman-empty"}):e.map(B=>{const H=!y.has(B.id)||!!m,A=(B.items||[]).filter(L=>!L.isFolder).length;return c.jsxs("div",{className:"collection-group",role:"group",children:[c.jsxs("div",{className:"collection-header",onClick:()=>N(B.id),onKeyDown:L=>{L.target===L.currentTarget&&(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),N(B.id))},role:"treeitem",tabIndex:0,"aria-expanded":H,children:[c.jsxs("span",{className:"collection-title-wrap",children:[c.jsx("span",{className:"node-icon collection-caret",children:H?c.jsx(Cu,{}):c.jsx(Ko,{})}),c.jsx(Ac,{strong:!0,ellipsis:!0,className:"collection-name",children:B.name}),c.jsxs(Ac,{type:"secondary",className:"collection-count",children:["(",A,")"]})]}),c.jsx("div",{className:"collection-actions",onClick:L=>L.stopPropagation(),children:c.jsx(Bl,{menu:{items:[{key:"rename-col",label:"Rename Collection",icon:c.jsx(Wo,{}),onClick:()=>I("collection",B.id,null,B.name)},{key:"add-req",label:"Add Request",icon:c.jsx(Xn,{}),onClick:()=>M(B.id)},{key:"add-folder",label:"Add Folder",icon:c.jsx(lh,{}),onClick:()=>T(B.id)},{key:"delete-col",label:"Delete Collection",icon:c.jsx(Fn,{}),danger:!0,onClick:()=>f(B.id)}]},trigger:["click"],children:c.jsx(Oe,{type:"text",size:"small",icon:c.jsx(Wv,{}),"aria-label":`Actions for collection ${B.name}`})})})]}),H&&c.jsx("div",{className:"collection-tree-body",children:P(B,null,1)})]},B.id)})}),c.jsx(bn,{title:`Rename ${(w==null?void 0:w.type)==="collection"?"Collection":"Item"}`,open:C,onCancel:()=>x(!1),onOk:j,destroyOnClose:!0,width:420,children:c.jsx(Ct,{value:E,onChange:B=>R(B.target.value),onPressEnter:j,placeholder:"Enter new name",autoFocus:!0,className:"postman-rename-input"})})]})}const{Option:zm}=$n,{TextArea:jbe}=Ct,{Text:Dl}=xn,Nbe=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"];function Obe({request:e=null,environments:t=[],activeEnvironmentId:n=null,onSelectEnvironment:r,onSend:a,onSave:o,sending:s,collectionPath:u=[]}){const[f,m]=l.useState("GET"),[h,p]=l.useState(""),[v,y]=l.useState([]),[b,C]=l.useState([]),[x,w]=l.useState({mode:"none",raw:"",json:"",formdata:[],urlencoded:[]}),[$,E]=l.useState({type:"none",token:"",username:"",password:""}),[R,N]=l.useState(!1),[O,I]=l.useState(""),[j,M]=l.useState("params"),[T,z]=l.useState(!1);if(l.useEffect(()=>{e&&(m(e.method||"GET"),p(e.url||""),y(e.params||[]),C(e.headers||[]),w(e.body||{mode:"none",raw:"",json:"",formdata:[],urlencoded:[]}),E(e.auth||{type:"none",token:"",username:"",password:""}),N(e.allowSelfSigned===!0),I(e.name||"Untitled Request"),z(!1))},[e==null?void 0:e.id]),!e)return c.jsx("div",{className:"request-editor-empty",children:c.jsx(Dl,{type:"secondary",children:'Select a request from the sidebar or click "Import" to load a collection.'})});const P=()=>{a({method:f,url:h,params:v,headers:b,body:x,auth:$,allowSelfSigned:R})},B=()=>z(!0),H=()=>{o({...e,name:O,method:f,url:h,params:v,headers:b,body:x,auth:$,allowSelfSigned:R}),z(!1)},A=()=>{y([...v,{key:"",value:"",enabled:!0}]),B()},L=(V,W,G)=>{const Y=[...v];Y[V]={...Y[V],[W]:G},y(Y),B()},F=V=>{y(v.filter((W,G)=>G!==V)),B()},U=()=>{C([...b,{key:"",value:"",enabled:!0}]),B()},q=(V,W,G)=>{const Y=[...b];Y[V]={...Y[V],[W]:G},C(Y),B()},_=V=>{C(b.filter((W,G)=>G!==V)),B()},K=[{title:"",dataIndex:"enabled",width:40,render:(V,W,G)=>c.jsx(tr,{checked:V!==!1,"aria-label":`Enable query parameter ${G+1}`,onChange:Y=>L(G,"enabled",Y.target.checked)})},{title:"Key",dataIndex:"key",width:"40%",render:(V,W,G)=>c.jsx(Ct,{placeholder:"Parameter Key","aria-label":`Query parameter ${G+1} key`,value:V,onChange:Y=>L(G,"key",Y.target.value),size:"small"})},{title:"Value",dataIndex:"value",width:"50%",render:(V,W,G)=>c.jsx(Ct,{placeholder:"Parameter Value","aria-label":`Query parameter ${G+1} value`,value:V,onChange:Y=>L(G,"value",Y.target.value),size:"small"})},{title:"",key:"actions",width:40,render:(V,W,G)=>c.jsx(Oe,{type:"text",danger:!0,size:"small",icon:c.jsx(Fn,{}),"aria-label":`Delete query parameter ${G+1}`,onClick:()=>F(G)})}],X=[{title:"",dataIndex:"enabled",width:40,render:(V,W,G)=>c.jsx(tr,{checked:V!==!1,"aria-label":`Enable header ${G+1}`,onChange:Y=>q(G,"enabled",Y.target.checked)})},{title:"Header",dataIndex:"key",width:"40%",render:(V,W,G)=>c.jsx(Ct,{placeholder:"Header (e.g. Content-Type)","aria-label":`Header ${G+1} name`,value:V,onChange:Y=>q(G,"key",Y.target.value),size:"small"})},{title:"Value",dataIndex:"value",width:"50%",render:(V,W,G)=>c.jsx(Ct,{placeholder:"Header Value","aria-label":`Header ${G+1} value`,value:V,onChange:Y=>q(G,"value",Y.target.value),size:"small"})},{title:"",key:"actions",width:40,render:(V,W,G)=>c.jsx(Oe,{type:"text",danger:!0,size:"small",icon:c.jsx(Fn,{}),"aria-label":`Delete header ${G+1}`,onClick:()=>_(G)})}];return c.jsxs("div",{className:"request-editor",children:[c.jsxs("div",{className:"request-bar",children:[c.jsxs("div",{className:"request-context",children:[c.jsx(Dl,{type:"secondary",ellipsis:!0,children:u.length>0?u.join(" / "):"Collection"}),T&&c.jsx(Dl,{type:"warning",className:"request-dirty",children:"Unsaved"})]}),c.jsx(Ct,{value:O,onChange:V=>{I(V.target.value),B()},className:"request-name-input",placeholder:"Request Name","aria-label":"Request name"}),c.jsxs("div",{className:"request-url-row",children:[c.jsx($n,{value:f,onChange:V=>{m(V),B()},className:`method-select method-${f.toLowerCase()}`,"aria-label":"HTTP method",children:Nbe.map(V=>c.jsx(zm,{value:V,children:V},V))}),c.jsx(Ct,{value:h,onChange:V=>{p(V.target.value),B()},placeholder:"Enter request URL or {{variable}}",className:"url-input","aria-label":"Request URL",onPressEnter:P}),c.jsx($n,{value:n,onChange:V=>{r(V),B()},placeholder:"Environment","aria-label":"Request environment",allowClear:!0,className:"environment-select",suffixIcon:c.jsx(Wge,{}),children:t.map(V=>c.jsx(zm,{value:V.id,children:V.name},V.id))}),c.jsx(Oe,{type:"primary",icon:c.jsx(hu,{}),loading:s,onClick:P,className:"send-btn",children:"Send"}),c.jsx(Oe,{icon:c.jsx(Q$,{}),onClick:H,children:"Save"})]}),c.jsx("div",{className:"request-options",children:c.jsx(tr,{checked:R,onChange:V=>{N(V.target.checked),B()},children:"Allow self-signed HTTPS certificates"})})]}),c.jsx("div",{className:"request-tabs-wrap",children:c.jsx(Qa,{activeKey:j,onChange:M,size:"small",items:[{key:"params",label:`Params (${v.filter(V=>V.key).length})`,children:c.jsxs("div",{className:"tab-pane-content",children:[c.jsx(ar,{dataSource:v,columns:K,rowKey:(V,W)=>`param_${W}`,pagination:!1,size:"small",locale:{emptyText:"No data"}}),c.jsx(Oe,{type:"dashed",size:"small",icon:c.jsx(Xn,{}),onClick:A,className:"postman-add-row",children:"Add Query Parameter"})]})},{key:"headers",label:`Headers (${b.filter(V=>V.key).length})`,children:c.jsxs("div",{className:"tab-pane-content",children:[c.jsx(ar,{dataSource:b,columns:X,rowKey:(V,W)=>`hdr_${W}`,pagination:!1,size:"small",locale:{emptyText:"No data"}}),c.jsx(Oe,{type:"dashed",size:"small",icon:c.jsx(Xn,{}),onClick:U,className:"postman-add-row",children:"Add Header"})]})},{key:"body",label:`Body (${x.mode})`,children:c.jsxs("div",{className:"tab-pane-content",children:[c.jsx("div",{className:"request-body-mode",children:c.jsxs(er.Group,{value:x.mode||"none",onChange:V=>{w({...x,mode:V.target.value}),B()},size:"small",children:[c.jsx(er.Button,{value:"none",children:"none"}),c.jsx(er.Button,{value:"json",children:"json"}),c.jsx(er.Button,{value:"raw",children:"raw"}),c.jsx(er.Button,{value:"urlencoded",children:"x-www-form-urlencoded"})]})}),x.mode==="json"||x.mode==="raw"?c.jsx(jbe,{rows:8,value:x.raw||x.json||"",onChange:V=>{w({...x,raw:V.target.value,json:V.target.value}),B()},placeholder:'{\\n "key": "value"\\n}',className:"postman-code-input"}):x.mode==="urlencoded"?c.jsx(Dl,{type:"secondary",children:"x-www-form-urlencoded parameters configured via Headers / Params."}):c.jsx(Dl,{type:"secondary",children:"This request does not have a body."})]})},{key:"auth",label:`Auth (${$.type||"none"})`,children:c.jsxs("div",{className:"tab-pane-content auth-pane",children:[c.jsxs("div",{className:"auth-field",children:[c.jsx(Dl,{strong:!0,className:"auth-field-label",children:"Type:"}),c.jsxs($n,{value:$.type||"none",onChange:V=>{E({...$,type:V}),B()},className:"auth-field-control",size:"middle",children:[c.jsx(zm,{value:"none",children:"No Auth"}),c.jsx(zm,{value:"bearer",children:"Bearer Token"}),c.jsx(zm,{value:"basic",children:"Basic Auth"})]})]}),$.type==="bearer"&&c.jsxs("div",{className:"auth-field",children:[c.jsx(Dl,{strong:!0,className:"auth-field-label",children:"Token:"}),c.jsx(Ct,{value:$.token||"",onChange:V=>{E({...$,token:V.target.value}),B()},placeholder:"Bearer token or {{token}}",size:"middle",className:"auth-field-control"})]}),$.type==="basic"&&c.jsxs(ct,{direction:"vertical",className:"auth-field-stack",size:"small",children:[c.jsxs("div",{className:"auth-field is-compact",children:[c.jsx(Dl,{strong:!0,className:"auth-field-label",children:"Username:"}),c.jsx(Ct,{value:$.username||"",onChange:V=>{E({...$,username:V.target.value}),B()},size:"middle",className:"auth-field-control"})]}),c.jsxs("div",{className:"auth-field",children:[c.jsx(Dl,{strong:!0,className:"auth-field-label",children:"Password:"}),c.jsx(Ct.Password,{value:$.password||"",onChange:V=>{E({...$,password:V.target.value}),B()},size:"middle",className:"auth-field-control"})]})]})]})}]})})]})}const{Text:II}=xn;function Rbe({response:e,loading:t}){const[n,r]=l.useState("pretty");if(t)return c.jsx("div",{className:"response-panel loading-state",role:"status","aria-live":"polite","aria-busy":"true",children:c.jsxs("div",{className:"loading-spinner",children:[c.jsx(Wl,{spin:!0,className:"postman-loading-icon"}),c.jsx(II,{type:"secondary",children:"Sending HTTP Request…"})]})});if(!e)return c.jsx("div",{className:"response-panel empty-state",role:"status",children:c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"Enter URL and click 'Send' to get response"})});const{status:a,statusText:o,headers:s={},data:u,durationMs:f,sizeBytes:m,contentType:h,error:p,resolvedUrl:v}=e,b=a>=200&&a<300?"success":a>=300&&a<400?"warning":"error",C=E=>!E||isNaN(E)?"0 B":E<1024?`${E} B`:E<1024*1024?`${(E/1024).toFixed(2)} KB`:`${(E/(1024*1024)).toFixed(2)} MB`,x=()=>{if(p)return typeof p=="string"?p:JSON.stringify(p,null,2);if(typeof u=="object")return JSON.stringify(u,null,2);if(typeof u=="string")try{const E=JSON.parse(u);return JSON.stringify(E,null,2)}catch{return u}return String(u||"")},w=()=>{navigator.clipboard.writeText(x()),an.success("Response body copied to clipboard!")},$=Object.entries(s).map(([E,R],N)=>({key:N,keyName:E,value:String(R)}));return c.jsxs("div",{className:"response-panel",role:"region","aria-label":"HTTP response",children:[c.jsxs("div",{className:"response-header-bar","aria-live":"polite",children:[c.jsxs("div",{className:"response-status-group",children:[p?c.jsx($t,{color:"error",children:"Error"}):c.jsxs($t,{color:b,className:"response-status-tag",children:[a," ",o]}),f!==void 0&&c.jsxs("span",{className:"response-meta-item",children:[c.jsx(Wl,{})," ",f," ms"]}),m!==void 0&&c.jsxs("span",{className:"response-meta-item",children:[c.jsx(Rve,{})," ",C(m)]})]}),c.jsx(yn,{title:"Copy Response",children:c.jsx(Oe,{size:"small",icon:c.jsx(fo,{}),onClick:w,children:"Copy"})})]}),c.jsx("div",{className:"response-body-wrap",children:c.jsx(Qa,{activeKey:n,onChange:r,size:"small",items:[{key:"pretty",label:"Pretty",children:c.jsx("pre",{className:"code-viewer",children:c.jsx("code",{children:x()})})},{key:"raw",label:"Raw",children:c.jsx("pre",{className:"code-viewer raw",children:c.jsx("code",{children:typeof u=="string"?u:JSON.stringify(u)})})},{key:"headers",label:`Headers (${Object.keys(s).length})`,children:c.jsx(ar,{dataSource:$,columns:[{title:"Header",dataIndex:"keyName",width:"30%",render:E=>c.jsx(II,{strong:!0,children:E})},{title:"Value",dataIndex:"value"}],size:"small",pagination:!1,className:"response-headers-table"})}]})})]})}const{Dragger:Ibe}=hp,{TextArea:kI}=Ct,{Text:MI}=xn;function kbe({open:e,onClose:t,onImport:n}){const[r,a]=l.useState("file"),[o,s]=l.useState(""),[u,f]=l.useState(""),[m,h]=l.useState(!1),p=async y=>{if(!y||!y.trim()){an.warning("Please select a file or paste content to import");return}try{h(!0),await n(y.trim()),an.success("Imported successfully!"),s(""),f(""),t()}catch(b){an.error(`Import failed: ${b.message}`)}finally{h(!1)}},v={name:"file",multiple:!1,accept:".json",showUploadList:!1,beforeUpload(y){if(!(y.type==="application/json"||y.name.endsWith(".json")))return an.error("Please upload a valid .json file!"),!1;const C=new FileReader;return C.onload=x=>{const w=x.target.result;p(w)},C.readAsText(y),!1}};return c.jsx(bn,{title:"Import Postman Collection / cURL",open:e,onCancel:t,footer:[c.jsx(Oe,{onClick:t,children:"Cancel"},"cancel"),(r==="text"||r==="curl")&&c.jsx(Oe,{type:"primary",loading:m,onClick:()=>p(r==="text"?o:u),children:"Import"},"submit")].filter(Boolean),width:640,destroyOnClose:!0,children:c.jsx(Qa,{activeKey:r,onChange:a,items:[{key:"file",label:c.jsxs("span",{children:[c.jsx(zh,{})," Upload JSON File"]}),children:c.jsx("div",{className:"postman-import-pane",children:c.jsxs(Ibe,{...v,children:[c.jsx("p",{className:"ant-upload-drag-icon",children:c.jsx(zh,{className:"postman-import-icon"})}),c.jsx("p",{className:"ant-upload-text",children:"Click or drag Postman Collection JSON file to this area"}),c.jsx("p",{className:"ant-upload-hint",children:"Supports Postman Collection v2.0 and v2.1 JSON files."})]})})},{key:"text",label:c.jsxs("span",{children:[c.jsx(Ui,{})," Raw Collection JSON"]}),children:c.jsxs("div",{className:"postman-import-pane is-text",children:[c.jsx(MI,{type:"secondary",className:"postman-field-hint",children:"Paste raw Postman Collection JSON content:"}),c.jsx(kI,{rows:10,value:o,onChange:y=>s(y.target.value),placeholder:'{ "info": { "name": "Sample Collection" }, "item": [...] }',className:"postman-code-input"})]})},{key:"curl",label:c.jsxs("span",{children:[c.jsx(wa,{})," cURL Command"]}),children:c.jsxs("div",{className:"postman-import-pane is-text",children:[c.jsx(MI,{type:"secondary",className:"postman-field-hint",children:"Paste a raw cURL command to import as a request:"}),c.jsx(kI,{rows:10,value:u,onChange:y=>f(y.target.value),placeholder:`curl -X POST "https://api.example.com/v1/users" \\
540
540
  -H "Authorization: Bearer token123" \\
@@ -545,7 +545,7 @@ ${O.details||""}`;navigator.clipboard.writeText(I),v(O.id),setTimeout(()=>{v(j=>
545
545
  "repo": "http://bitbucket.abc.com/scm/PROJ/sub-app1.git",
546
546
  "branch": "feature/custom-sub-branch"
547
547
  }
548
- ]`})})]})}),c.jsx(bn,{title:"App List Configurations",open:m,onCancel:()=>h(!1),footer:[c.jsx(Oe,{onClick:()=>h(!1),children:"Close"},"close")],width:950,children:c.jsx("div",{className:"branch-sync-modal-body",children:t.length===0?c.jsx(Xt,{description:"No apps configured."}):c.jsx(ar,{dataSource:t.map(se=>({...se,key:se.id})),pagination:!1,size:"small",columns:[{title:"Name",dataIndex:"name",key:"name",render:se=>c.jsx(Ca,{strong:!0,children:se})},{title:"Branches",key:"branches",render:(se,ae)=>c.jsxs(ct,{direction:"vertical",size:4,className:"branch-sync-branches-col",children:[c.jsxs("div",{className:"branch-sync-branch-line",children:[c.jsx(Ca,{type:"secondary",className:"branch-sync-branch-label",children:"Release:"}),c.jsx($t,{className:"branch-sync-branch-tag",children:ae.lastReleaseBranch})]}),c.jsxs("div",{className:"branch-sync-branch-line",children:[c.jsx(Ca,{type:"secondary",className:"branch-sync-branch-label",children:"Active:"}),c.jsx($t,{className:"branch-sync-branch-tag",children:ae.activeBranch})]})]})},{title:"Sub-Apps",key:"subAppsCount",render:(se,ae)=>c.jsx(sa,{count:ae.subApps?ae.subApps.length:0,showZero:!0,color:"#64748b"})},{title:"Action",key:"action",render:(se,ae)=>c.jsxs(ct,{size:8,children:[c.jsx(Oe,{size:"small",icon:c.jsx(Wo,{}),onClick:()=>ue(ae),children:"Edit"}),c.jsx(Gr,{title:"Delete this app config?",onConfirm:()=>ee(ae.id),okText:"Yes",cancelText:"No",children:c.jsx(Oe,{size:"small",danger:!0,icon:c.jsx(Fn,{}),children:"Delete"})})]})}]})})}),c.jsx(bn,{title:`Edit App Config: ${(p==null?void 0:p.name)||""}`,open:y,onOk:Z,onCancel:()=>{b(!1),v(null)},okText:"Save Changes",width:800,destroyOnClose:!0,children:c.jsxs(wt,{className:"branch-sync-modal-form",form:O,layout:"vertical",children:[c.jsx(wt.Item,{name:"name",label:"Name",rules:[{required:!0,message:"Please enter application name"}],children:c.jsx(Ct,{})}),c.jsx(wt.Item,{name:"repo",label:"Repository",rules:[{required:!0,message:"Please enter repository URL"}],children:c.jsx(Ct,{onChange:se=>W(se.target.value),onBlur:se=>G(se.target.value)})}),c.jsxs(Uo,{gutter:16,children:[c.jsx(qn,{span:12,children:c.jsx(wt.Item,{name:"activeBranch",label:"Active Branch",rules:[{required:!0,message:"Please select or enter active branch"}],children:c.jsx($n,{showSearch:!0,allowClear:!0,mode:"combobox",placeholder:"Select or enter active branch",loading:ne(V),options:te(V),onFocus:()=>G(V)})})}),c.jsx(qn,{span:12,children:c.jsx(wt.Item,{name:"lastReleaseBranch",label:"Last Release Branch",rules:[{required:!0,message:"Please select or enter last release branch"}],children:c.jsx($n,{showSearch:!0,allowClear:!0,mode:"combobox",placeholder:"Select or enter last release branch",loading:ne(V),options:te(V),onFocus:()=>G(V)})})})]}),c.jsx(wt.Item,{name:"subApps",label:"subApps (JSON Array)",extra:'JSON structure: [ { "name": "sub-app1", "repo": "bitbucket@abc.com/xxx.git", "branch": "custom-branch" } ]. If "branch" is omitted, inherits parent active branch.',children:c.jsx(Ct.TextArea,{rows:4})})]})}),c.jsxs(bn,{title:`Create Branch for ${(w==null?void 0:w.name)||"App"}`,open:C,onCancel:()=>{E.creating||(x(!1),$(null))},footer:[c.jsx(Oe,{disabled:E.creating,onClick:()=>{x(!1),$(null)},children:E.completed?"Close":"Cancel"},"cancel"),c.jsx(Oe,{type:"primary",icon:c.jsx(ou,{}),loading:E.creating,onClick:be,children:"Create Branch"},"submit")],width:850,destroyOnClose:!0,children:[c.jsx(wt,{className:"branch-sync-modal-form",form:I,layout:"vertical",children:c.jsxs(Uo,{gutter:16,children:[c.jsx(qn,{span:12,children:c.jsx(wt.Item,{name:"sourceBranch",label:"Source Branch",rules:[{required:!0,message:"Please select or enter source branch"}],children:c.jsx($n,{showSearch:!0,allowClear:!0,mode:"combobox",placeholder:"Select or enter source branch",loading:ne(w==null?void 0:w.repo),options:Array.from(new Map([...w!=null&&w.activeBranch?[{label:`Active Branch (${w.activeBranch})`,value:w.activeBranch}]:[],...w!=null&&w.lastReleaseBranch?[{label:`Last Release Branch (${w.lastReleaseBranch})`,value:w.lastReleaseBranch}]:[],...((he=q[(ze=w==null?void 0:w.repo)==null?void 0:ze.trim()])==null?void 0:he.options)||[],...zI].map(se=>[se.value,se])).values()),onFocus:()=>G(w==null?void 0:w.repo)})})}),c.jsx(qn,{span:12,children:c.jsx(wt.Item,{name:"targetBranch",label:"Target Branch Name",rules:[{required:!0,message:"Please enter target branch name"}],children:c.jsx(Ct,{placeholder:"e.g. feature/v1.2.0"})})})]})}),c.jsxs("div",{className:"branch-sync-create-preview",children:[c.jsxs(Ca,{strong:!0,className:"branch-sync-create-preview-title",children:["Target Repositories (",1+(((ce=w==null?void 0:w.subApps)==null?void 0:ce.length)||0),")"]}),E.results.length===0?c.jsx(It,{className:"branch-sync-preview-card",size:"small",children:c.jsxs("div",{className:"branch-sync-preview-repos",children:[c.jsxs("div",{children:[c.jsx($t,{color:"purple",children:"Parent App"})," ",c.jsx(Ca,{strong:!0,children:w==null?void 0:w.name})," (",w==null?void 0:w.repo,")"]}),((w==null?void 0:w.subApps)||[]).map((se,ae)=>c.jsxs("div",{className:"branch-sync-preview-subitem",children:[c.jsx($t,{className:"branch-sync-branch-tag",children:"Sub-App"})," ",c.jsx(Ca,{strong:!0,children:se.name||se.directory||""})," (",se.repo,")"]},ae))]})}):c.jsx(Ra,{className:"branch-sync-result-list",size:"small",bordered:!0,dataSource:E.results,renderItem:se=>c.jsxs(Ra.Item,{className:"branch-sync-result-item",children:[c.jsxs("div",{className:"branch-sync-result-row",children:[c.jsxs(ct,{size:8,children:[c.jsx($t,{color:se.isParent?"purple":"cyan",children:se.isParent?"Parent App":"Sub-App"}),c.jsx(Ca,{strong:!0,className:"branch-sync-result-name",children:se.name}),c.jsxs(Ca,{type:"secondary",className:"branch-sync-result-repo",children:["(",se.repo,")"]})]}),c.jsx("div",{children:se.status==="creating"?c.jsx($t,{icon:c.jsx(rr,{size:"small"}),color:"purple",children:"Creating..."}):se.success?c.jsx($t,{icon:c.jsx(gi,{}),color:"success",children:"Created"}):c.jsx($t,{icon:c.jsx(QR,{}),color:"error",children:"Failed"})})]}),se.error&&c.jsx(mr,{className:"branch-sync-result-error",type:"error",message:`Creation Error: ${se.error}`,showIcon:!0})]})})]})]})]})}const{Text:In,Paragraph:Bbe}=xn,Jw={safe:{color:"success",icon:c.jsx(gi,{}),label:"Safe to delete"},review:{color:"warning",icon:c.jsx(Ph,{}),label:"Review"},keep:{color:"default",icon:c.jsx(Wl,{}),label:"Keep"},blocked:{color:"error",icon:c.jsx(A9,{}),label:"Blocked"}};function Yv(e,t="Unknown"){if(!e)return t;const n=new Date(e);return Number.isNaN(n.getTime())?t:n.toLocaleString([],{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Hbe(e){if(!e)return{date:"Unknown",time:""};const t=new Date(e);return Number.isNaN(t.getTime())?{date:"Unknown",time:""}:{date:t.toLocaleDateString(),time:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}}function WC(e){return e==null?"Unknown":e===0?"Today":e===1?"1 day ago":`${e} days ago`}function qC(e){const t=Jw[e==null?void 0:e.status]||Jw.keep;return c.jsx($t,{color:t.color,icon:t.icon,children:t.label})}function Am({label:e,value:t,color:n}){return c.jsx(It,{className:"branch-health-stat-card",children:c.jsx(cl,{title:e,value:t,valueStyle:n?{color:n}:void 0})})}function Fbe(e){const t=new Map;return(e||[]).forEach(n=>{var o;const r=((o=n.repository)==null?void 0:o.name)||"Unknown repository",a=t.get(r)||{name:r,records:[]};a.records.push(n),t.set(r,a)}),[...t.values()]}function Vbe({open:e,loading:t,records:n,onClose:r}){const a=Fbe(n),[o,s]=l.useState(()=>new Set),u=f=>{s(m=>{const h=new Set(m);return h.has(f)?h.delete(f):h.add(f),h})};return c.jsx(bn,{className:"branch-health-history-modal",title:"Operation history",open:e,onCancel:r,footer:null,width:700,destroyOnClose:!0,children:t?c.jsx("div",{className:"branch-health-history-loading",children:c.jsx(rr,{})}):a.length===0?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No branches have been deleted from this page yet."}):c.jsx("div",{className:"branch-health-history-groups",children:a.map(f=>c.jsxs("section",{className:`branch-health-history-group${o.has(f.name)?" is-collapsed":""}`,children:[c.jsxs("button",{type:"button",className:"branch-health-history-group-header","aria-expanded":!o.has(f.name),onClick:()=>u(f.name),children:[c.jsxs("div",{className:"branch-health-history-repository-name",children:[c.jsx("span",{className:"branch-health-history-repository-icon",children:c.jsx(Fr,{})}),c.jsxs("div",{className:"branch-health-history-repository-copy",children:[c.jsx(In,{className:"branch-health-history-repository-label",children:"Repository"}),c.jsx(In,{strong:!0,ellipsis:{tooltip:f.name},children:f.name})]})]}),c.jsxs("span",{className:"branch-health-history-group-controls",children:[c.jsxs(In,{type:"secondary",className:"branch-health-history-count",children:[f.records.length," ",f.records.length===1?"operation":"operations"]}),c.jsx(Cu,{className:`branch-health-history-collapse-icon${o.has(f.name)?" is-collapsed":""}`})]})]}),!o.has(f.name)&&c.jsx(Ra,{size:"small",dataSource:f.records,renderItem:m=>c.jsx(Ra.Item,{children:c.jsxs("div",{className:"branch-health-history-record",children:[c.jsxs("div",{className:"branch-health-history-branch",children:[c.jsx(ou,{className:"branch-health-history-branch-icon"}),c.jsx(In,{code:!0,ellipsis:{tooltip:m.branch},children:m.branch})]}),c.jsxs(In,{type:"secondary",className:"branch-health-history-record-meta",children:[c.jsx("span",{className:"branch-health-history-action",children:"Deleted"}),c.jsx("span",{children:Yv(m.deletedAt)})]})]})})})]},f.name))})})}function Ube(){var fe,we,ke,Pe,Ie,Ve,Le,je,$e,Ae,We,De,Je,Ye,Ge,He,nt,ft,vt;const{message:e}=Pr.useApp(),[t,n]=l.useState(""),[r,a]=l.useState([]),[o,s]=l.useState(""),[u,f]=l.useState(null),[m,h]=l.useState(!1),[p,v]=l.useState(!1),[y,b]=l.useState(!1),[C,x]=l.useState(""),[w,$]=l.useState(!1),[E,R]=l.useState("all"),[N,O]=l.useState("all"),[I,j]=l.useState(void 0),[M,T]=l.useState(null),[z,P]=l.useState(!1),[B,H]=l.useState(null),[A,L]=l.useState(null),[F,U]=l.useState(!1),[q,_]=l.useState(!1),[K,X]=l.useState(""),[V,W]=l.useState(!1),[G,Y]=l.useState(!1),[te,ne]=l.useState(!1),[ue,Z]=l.useState([]),[ee,re]=l.useState(!1),oe=async(qe,Ee="")=>{var Be;if(qe){h(!0);try{const Xe=await Mm.repositories(qe),Qe=Xe.repositories||[];n(Xe.workspaceDir||qe),a(Qe);const Ze=Ee&&Qe.some(it=>it.path===Ee)?Ee:((Be=Qe[0])==null?void 0:Be.path)||"";s(Ze),j(void 0),f(null),Ze&&await de(Ze)}catch(Xe){a([]),s(""),f(null),e.error(Xe.message||"Unable to find Git repositories.")}finally{h(!1)}}},de=async(qe=o)=>{if(qe){v(!0);try{f(await Mm.scan(qe)),T(null)}catch(Ee){e.error(Ee.message||"Unable to scan branches.")}finally{v(!1)}}},be=async qe=>{var Ee;H(qe),L(null),X(""),U(!!qe.hasLocal),_(!1),P(!0),W(!0);try{const Be=await Mm.preflight(o,qe.name);L(Be),U(!!((Ee=Be.checks)!=null&&Ee.localDeletionAllowed)),_(!1)}catch(Be){e.error(Be.message||"Unable to check whether this branch can be deleted.")}finally{W(!1)}},J=(qe=!1)=>{G&&!qe||(P(!1),H(null),L(null))},ye=async()=>{if(!(!B||!o)){Y(!0);try{const qe=await Mm.remove(o,B.name,{deleteLocal:F,deleteRemote:q,confirmName:K});f(qe),T(null),J(!0),qe.success?e.success(`${B.name} deleted.`):e.warning("The branch was only partially deleted. Check the result details.")}catch(qe){e.error(qe.message||"Unable to delete branch."),qe!=null&&qe.checks&&L({checks:qe.checks,branch:qe.branch})}finally{Y(!1)}}},xe=async()=>{re(!0);try{const qe=await Mm.history();Z(qe.history||[])}catch(qe){e.error(qe.message||"Unable to load branch operation history.")}finally{re(!1)}},ze=()=>{ne(!0),xe()};l.useEffect(()=>{let qe=!0;return So.config().then(Ee=>{if(!(!qe||!Ee.workspaceDir))return n(Ee.workspaceDir),oe(Ee.workspaceDir)}).catch(()=>{}),()=>{qe=!1}},[]);const he=(u==null?void 0:u.branches)||[],ce=l.useMemo(()=>{const qe=new Map;return he.forEach(Ee=>{var Qe,Ze;const Be=String(((Qe=Ee.creator)==null?void 0:Qe.name)||((Ze=Ee.creator)==null?void 0:Ze.email)||"Unknown").trim()||"Unknown",Xe=Be.toLocaleLowerCase();qe.has(Xe)||qe.set(Xe,{value:Xe,label:Be})}),[...qe.values()].sort((Ee,Be)=>Ee.label.localeCompare(Be.label))},[he]),se=l.useMemo(()=>{if(!w||!C.trim())return null;try{return new RegExp(C.trim(),"i")}catch{return}},[C,w]),ae=l.useMemo(()=>{const qe=C.trim().toLowerCase();return w&&qe&&!se?[]:he.filter(Ee=>{var Qe,Ze,it,ut,pt;if(E!=="all"&&((Qe=Ee.health)==null?void 0:Qe.status)!==E||N==="merged"&&!Ee.merged||N==="unmerged"&&Ee.merged)return!1;const Be=String(((Ze=Ee.creator)==null?void 0:Ze.name)||((it=Ee.creator)==null?void 0:it.email)||"Unknown").trim().toLocaleLowerCase()||"unknown";if(I&&Be!==I)return!1;if(!qe)return!0;const Xe=[Ee.name,(ut=Ee.creator)==null?void 0:ut.name,(pt=Ee.lastCommit)==null?void 0:pt.subject,Ee.mergedInto].filter(Boolean).join(" ");return w?se.test(Xe):Xe.toLowerCase().includes(qe)})},[he,I,N,C,w,se,E]),ge=l.useMemo(()=>({all:he.length,safe:he.filter(qe=>{var Ee;return((Ee=qe.health)==null?void 0:Ee.status)==="safe"}).length,merged:he.filter(qe=>qe.merged).length,stale:he.filter(qe=>qe.ageDays>=90).length,blocked:he.filter(qe=>{var Ee;return((Ee=qe.health)==null?void 0:Ee.status)==="blocked"}).length}),[he]),Re=[{title:"Branch",dataIndex:"name",key:"name",width:230,sorter:(qe,Ee)=>qe.name.localeCompare(Ee.name),render:(qe,Ee)=>c.jsxs("div",{className:"branch-health-branch-cell",children:[c.jsxs(ct,{size:6,wrap:!0,children:[c.jsx(ou,{className:"branch-health-branch-icon"}),c.jsx(In,{strong:!0,ellipsis:{tooltip:qe},children:qe})]}),c.jsxs("div",{className:"branch-health-inline-meta",children:[c.jsx($t,{children:Ee.source}),Ee.current&&c.jsx($t,{color:"blue",children:"Current"}),Ee.protected&&c.jsx($t,{color:"red",children:"Protected"})]})]})},{title:"Health",key:"health",width:150,sorter:(qe,Ee)=>{var Be,Xe;return(((Be=Ee.health)==null?void 0:Be.score)||0)-(((Xe=qe.health)==null?void 0:Xe.score)||0)},defaultSortOrder:"descend",render:(qe,Ee)=>{var Be;return c.jsxs("div",{className:"branch-health-health-cell",children:[qC(Ee.health),c.jsxs(In,{type:"secondary",children:["Priority ",((Be=Ee.health)==null?void 0:Be.score)||0]})]})}},{title:"Created",key:"createdAt",width:190,sorter:(qe,Ee)=>(Date.parse(qe.createdAt||"")||0)-(Date.parse(Ee.createdAt||"")||0),render:(qe,Ee)=>{const Be=Hbe(Ee.createdAt);return c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx(In,{children:Be.date}),Be.time&&c.jsx(In,{children:Be.time}),c.jsx(In,{type:"secondary",children:Ee.createdAtSource})]})}},{title:"Creator",key:"creator",width:150,render:(qe,Ee)=>{var Be,Xe;return c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx(In,{ellipsis:{tooltip:((Be=Ee.creator)==null?void 0:Be.name)||"Unknown"},children:((Xe=Ee.creator)==null?void 0:Xe.name)||"Unknown"}),c.jsx(In,{type:"secondary",children:"First commit author"})]})}},{title:"Last commit",key:"lastCommit",width:290,sorter:(qe,Ee)=>{var Be,Xe;return(Date.parse(((Be=qe.lastCommit)==null?void 0:Be.committedAt)||"")||0)-(Date.parse(((Xe=Ee.lastCommit)==null?void 0:Xe.committedAt)||"")||0)},render:(qe,Ee)=>{var Be,Xe,Qe,Ze,it;return c.jsxs("div",{className:"branch-health-commit-cell",children:[c.jsx(In,{ellipsis:{tooltip:(Be=Ee.lastCommit)==null?void 0:Be.subject},children:((Xe=Ee.lastCommit)==null?void 0:Xe.subject)||"Unknown commit"}),c.jsxs(ct,{size:6,children:[c.jsx(In,{code:!0,children:(Qe=Ee.lastCommit)==null?void 0:Qe.shortHash}),c.jsx(In,{type:"secondary",children:WC(Ee.ageDays)})]}),c.jsxs(In,{type:"secondary",children:["by ",((it=(Ze=Ee.lastCommit)==null?void 0:Ze.author)==null?void 0:it.name)||"Unknown"]})]})}},{title:"Last merged into",key:"mergedInto",width:190,render:(qe,Ee)=>Ee.mergedInto?c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx($t,{color:"green",children:Ee.mergedInto}),c.jsx(In,{type:"secondary",children:Ee.mergeSource})]}):c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx(In,{type:"secondary",children:"Not found"}),c.jsx(In,{type:"secondary",children:"No containing local ref"})]})},{title:"Relation",key:"relation",width:130,render:(qe,Ee)=>c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx(In,{children:Ee.ahead==null?"Not analyzed":`${Ee.ahead} ahead`}),c.jsx(In,{children:Ee.behind==null?"Not analyzed":`${Ee.behind} behind`}),c.jsx(In,{type:"secondary",children:Ee.commitCount==null?"Not analyzed":`${Ee.commitCount} commits`})]})},{title:"Details",key:"details",fixed:"right",width:88,render:(qe,Ee)=>c.jsx(Oe,{type:"link",onClick:()=>T(Ee),children:"View"})}],_e=async qe=>{b(!1),n(qe),await oe(qe)},ie=async()=>{if(t)try{await Wn.openFolder(t)}catch(qe){e.error(qe.message||"Unable to open the workspace directory.")}};return c.jsxs("div",{className:"branch-health-page",children:[c.jsx(Ur,{title:"Branch Health",description:"Find stale or already merged branches before deciding what to clean up.",actions:c.jsxs(ct,{wrap:!0,children:[c.jsx(Oe,{icon:c.jsx(D9,{}),onClick:ze,children:"Operation history"}),c.jsx(Oe,{icon:c.jsx(Fr,{}),onClick:()=>b(!0),children:"Browse workspace"}),c.jsx(Oe,{icon:c.jsx(Xa,{}),onClick:()=>de(),loading:p,disabled:!o,children:"Refresh"})]})}),c.jsxs(It,{className:"branch-health-repository-card",children:[c.jsxs(ct,{size:"large",className:"branch-health-summary",children:[c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Workspace"}),c.jsxs("div",{className:"workspace-summary-path",children:[c.jsx(Oe,{type:"text",icon:c.jsx(Fr,{}),onClick:ie,disabled:!t,"aria-label":"Open workspace directory",title:"Open workspace directory"}),c.jsx(In,{ellipsis:{tooltip:t||"Not configured"},children:t||"Not configured"})]})]}),c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Repositories"}),c.jsx("div",{className:"summary-value",children:r.length})]})]}),c.jsx("div",{className:"branch-health-repository-row",children:c.jsxs("div",{className:"branch-health-repository-picker",children:[c.jsx(In,{type:"secondary",children:"Repository"}),c.jsx($n,{className:"branch-health-repository-select",showSearch:!0,value:o||void 0,placeholder:"Select a Git repository",loading:m,options:r.map(qe=>({label:qe.name,value:qe.path})),optionFilterProp:"label",onChange:qe=>{s(qe),j(void 0),de(qe)},notFoundContent:m?c.jsx(rr,{size:"small"}):"No Git repositories found"})]})})]}),u&&c.jsxs(c.Fragment,{children:[c.jsxs(Uo,{gutter:[12,12],className:"branch-health-stat-row",children:[c.jsx(qn,{xs:12,sm:8,lg:4,children:c.jsx(Am,{label:"All branches",value:ge.all})}),c.jsx(qn,{xs:12,sm:8,lg:5,children:c.jsx(Am,{label:"Recommended cleanup",value:ge.safe,color:"#389e0d"})}),c.jsx(qn,{xs:12,sm:8,lg:5,children:c.jsx(Am,{label:"Already merged",value:ge.merged,color:"#1677ff"})}),c.jsx(qn,{xs:12,sm:8,lg:5,children:c.jsx(Am,{label:"Stale > 90 days",value:ge.stale,color:"#d48806"})}),c.jsx(qn,{xs:12,sm:8,lg:5,children:c.jsx(Am,{label:"Protected / blocked",value:ge.blocked,color:"#cf1322"})})]}),c.jsxs(It,{className:"branch-health-table-card",children:[c.jsxs("div",{className:"branch-health-toolbar",children:[c.jsx(Ct,{allowClear:!0,prefix:c.jsx(jo,{}),placeholder:w?"Regex: e.g. ^feature/.*$":"Search branch, creator, commit...",value:C,status:w&&C.trim()&&!se?"error":void 0,onChange:qe=>x(qe.target.value)}),c.jsx(tr,{checked:w,onChange:qe=>$(qe.target.checked),children:"Regex"}),w&&C.trim()&&!se&&c.jsx(In,{type:"danger",children:"Invalid regular expression"}),c.jsx($n,{value:E,onChange:R,options:[{value:"all",label:"All health states"},...Object.entries(Jw).map(([qe,Ee])=>({value:qe,label:Ee.label}))]}),c.jsx($n,{value:N,onChange:O,options:[{value:"all",label:"All merge states"},{value:"merged",label:"Merged"},{value:"unmerged",label:"Not merged"}]}),c.jsx($n,{className:"branch-health-creator-filter",allowClear:!0,showSearch:!0,value:I,onChange:j,placeholder:"Filter by creator",options:ce,optionFilterProp:"label",filterOption:(qe,Ee)=>`${(Ee==null?void 0:Ee.label)||""} ${(Ee==null?void 0:Ee.value)||""}`.toLowerCase().includes(qe.toLowerCase())}),c.jsxs(In,{type:"secondary",className:"branch-health-result-count",children:[ae.length," shown"]})]}),c.jsx(ar,{rowKey:"id",size:"small",columns:Re,dataSource:ae,loading:p,pagination:{pageSize:20,showSizeChanger:!1,hideOnSinglePage:!0},scroll:{x:1440},locale:{emptyText:c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No branches match these filters."})}}),c.jsx("div",{className:"branch-health-mobile-list",children:ae.length?ae.map(qe=>{var Ee,Be,Xe,Qe,Ze;return c.jsxs(It,{size:"small",className:"branch-health-mobile-card",children:[c.jsxs("div",{className:"branch-health-mobile-card-header",children:[c.jsxs("div",{className:"branch-health-mobile-branch",children:[c.jsx(ou,{className:"branch-health-branch-icon"}),c.jsx(In,{strong:!0,ellipsis:{tooltip:qe.name},children:qe.name})]}),qC(qe.health)]}),c.jsxs("div",{className:"branch-health-mobile-source",children:[c.jsx($t,{children:qe.source}),qe.current&&c.jsx($t,{color:"blue",children:"Current"}),qe.protected&&c.jsx($t,{color:"red",children:"Protected"})]}),c.jsxs("div",{className:"branch-health-mobile-commit",children:[c.jsx(In,{ellipsis:{tooltip:(Ee=qe.lastCommit)==null?void 0:Ee.subject},children:((Be=qe.lastCommit)==null?void 0:Be.subject)||"Unknown commit"}),c.jsxs(ct,{size:6,children:[c.jsx(In,{code:!0,children:(Xe=qe.lastCommit)==null?void 0:Xe.shortHash}),c.jsx(In,{type:"secondary",children:WC(qe.ageDays)})]})]}),c.jsxs("div",{className:"branch-health-mobile-grid",children:[c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Created"}),c.jsx(In,{children:Yv(qe.createdAt)})]}),c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Creator"}),c.jsx(In,{ellipsis:{tooltip:(Qe=qe.creator)==null?void 0:Qe.name},children:((Ze=qe.creator)==null?void 0:Ze.name)||"Unknown"})]}),c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Merged into"}),c.jsx(In,{children:qe.mergedInto||"Not found"})]}),c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Relation"}),c.jsxs(In,{children:[qe.ahead," ahead"]}),c.jsxs(In,{children:[qe.behind," behind"]})]})]}),c.jsx(Oe,{block:!0,type:"link",onClick:()=>T(qe),children:"View details"})]},qe.id)}):c.jsx(Xt,{className:"branch-health-mobile-empty",image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No branches match these filters."})})]})]}),!u&&!m&&!p&&c.jsx(It,{className:"branch-health-empty-card",children:c.jsx(Xt,{description:r.length?"Select a repository to scan its branches.":"Select a workspace folder containing Git repositories.",children:c.jsx(Oe,{type:"primary",icon:c.jsx(Fr,{}),onClick:()=>b(!0),children:"Choose workspace"})})}),c.jsx(I$,{title:(M==null?void 0:M.name)||"Branch details",width:540,open:!!M,onClose:()=>T(null),children:M&&c.jsxs("div",{className:"branch-health-detail",children:[c.jsxs("div",{className:"branch-health-detail-status",children:[qC(M.health),c.jsxs(In,{type:"secondary",children:["Priority ",((fe=M.health)==null?void 0:fe.score)||0]})]}),c.jsx(Bbe,{type:"secondary",children:((we=M.reasons)==null?void 0:we.join(" · "))||"No additional recommendation details."}),c.jsxs(Lo,{column:1,size:"small",bordered:!0,children:[c.jsx(Lo.Item,{label:"Source",children:M.source}),c.jsxs(Lo.Item,{label:"Created",children:[Yv(M.createdAt)," (",M.createdAtSource,")"]}),c.jsxs(Lo.Item,{label:"Creator",children:[((ke=M.creator)==null?void 0:ke.name)||"Unknown"," ",c.jsxs(In,{type:"secondary",children:["(",((Pe=M.creator)==null?void 0:Pe.email)||"no email",")"]})]}),c.jsx(Lo.Item,{label:"Current branch",children:M.current?"Yes — deletion blocked":"No"}),c.jsx(Lo.Item,{label:"Protected pattern",children:M.protected?"Yes — deletion blocked":"No"}),c.jsxs(Lo.Item,{label:"Last commit",children:[(Ie=M.lastCommit)==null?void 0:Ie.shortHash," · ",(Ve=M.lastCommit)==null?void 0:Ve.subject]}),c.jsx(Lo.Item,{label:"Commit author",children:((je=(Le=M.lastCommit)==null?void 0:Le.author)==null?void 0:je.name)||"Unknown"}),c.jsxs(Lo.Item,{label:"Last updated",children:[Yv(($e=M.lastCommit)==null?void 0:$e.committedAt)," (",WC(M.ageDays),")"]}),c.jsx(Lo.Item,{label:"Last merged into",children:M.analysisSkipped?"Not analyzed":M.mergedInto||"Not found in local refs"}),c.jsx(Lo.Item,{label:"Merge evidence",children:M.mergeSource}),c.jsx(Lo.Item,{label:"Relation to default",children:M.analysisSkipped?"Not analyzed (last commit older than one year)":`${M.ahead} ahead · ${M.behind} behind`})]}),c.jsx(mr,{className:"branch-health-detail-alert",type:((Ae=M.health)==null?void 0:Ae.status)==="safe"?"success":"info",showIcon:!0,icon:c.jsx(J$,{}),message:"Deletion requires a fresh safety check",description:"Branch deletion will re-check merge state and checkout state on the server before changing any refs."}),c.jsxs("div",{className:"branch-health-detail-actions",children:[c.jsx(Oe,{danger:!0,disabled:((We=M.name)==null?void 0:We.toLowerCase())==="master",onClick:()=>be(M),children:"Delete branch"}),((De=M.name)==null?void 0:De.toLowerCase())==="master"&&c.jsx(In,{type:"secondary",children:"The master branch cannot be deleted."})]})]})}),c.jsx(bn,{title:`Delete ${(B==null?void 0:B.name)||"branch"}?`,open:z,onCancel:J,onOk:ye,okText:"Delete branch",okButtonProps:{danger:!0,disabled:V||!(A!=null&&A.canDelete)||!F&&!q||K!==(B==null?void 0:B.name)},confirmLoading:G,destroyOnClose:!0,children:V?c.jsx("div",{className:"branch-health-delete-loading",children:c.jsx(rr,{})}):A&&B?c.jsxs("div",{className:"branch-health-delete-dialog",children:[(Ye=(Je=A.checks)==null?void 0:Je.blockers)!=null&&Ye.length?c.jsx(mr,{type:"error",showIcon:!0,message:"Deletion blocked",description:A.checks.blockers.join(" ")}):c.jsx(mr,{type:((Ge=B.health)==null?void 0:Ge.status)==="safe"?"success":"warning",showIcon:!0,message:((He=B.health)==null?void 0:He.status)==="safe"?"This branch passed the safety check.":"This branch passed the hard safety checks, but review the evidence first.",description:`${B.mergedInto?`Merged into ${B.mergedInto}. `:""}${B.ahead} commits ahead of the default branch.`}),c.jsxs("div",{className:"branch-health-delete-targets",children:[c.jsx(In,{strong:!0,children:"Delete targets"}),c.jsx(tr,{checked:F,disabled:!((nt=A.checks)!=null&&nt.localDeletionAllowed),onChange:qe=>U(qe.target.checked),children:"Local branch"}),c.jsx(tr,{checked:q,disabled:!((ft=A.checks)!=null&&ft.remoteDeletionAllowed),onChange:qe=>_(qe.target.checked),children:"Remote origin branch"})]}),c.jsxs("div",{className:"branch-health-delete-confirm",children:[c.jsx(In,{strong:!0,children:"Type the exact branch name to confirm"}),c.jsx(Ct,{value:K,onChange:qe=>X(qe.target.value),placeholder:B.name,autoComplete:"off"})]}),((vt=A.results)==null?void 0:vt.length)>0&&c.jsx(mr,{type:"warning",showIcon:!0,message:"Previous attempt result",description:A.results.map(qe=>`${qe.target}: ${qe.success?"deleted":qe.error}`).join(" · ")})]}):c.jsx(Xt,{description:"Safety check unavailable."})}),c.jsx(Vbe,{open:te,loading:ee,records:ue,onClose:()=>ne(!1)}),c.jsx(df,{open:y,initialPath:t||"~",onCancel:()=>b(!1),onSelect:_e,title:"Choose workspace folder"})]})}const{Text:oo}=xn,KC={running:["processing","Running"],queued:["default","Queued"],success:["success","Success"],failed:["error","Failed"],completed:["success","Completed"]};function Wbe(e=[]){const t=new Map;return e.forEach(n=>{const r=typeof n=="string"?n:n.version,a=typeof n=="string"?"":n.publishedAt,[o="",s=""]=String(r).replace(/^v/,"").split(".");if(!o)return;t.has(o)||t.set(o,new Map);const u=t.get(o),f=`${o}.${s}`;u.has(f)||u.set(f,[]),u.get(f).push({label:c.jsxs("span",{className:"package-upgrade-version-option",children:[c.jsx("span",{children:r}),a&&c.jsx("span",{className:"package-upgrade-version-published",children:new Date(a).toLocaleDateString()})]}),value:r})}),[...t.entries()].map(([n,r])=>({label:`v${n}`,value:n,children:[...r.entries()].map(([a,o])=>({label:a,value:a,children:o}))}))}function qbe(){const{message:e}=Pr.useApp(),[t,n]=l.useState({workspaceDir:"",repos:[],tasks:[]}),[r,a]=l.useState(!1),[o,s]=l.useState(!1),[u,f]=l.useState(null),[m,h]=l.useState(!1),[p,v]=l.useState(null),[y]=wt.useForm(),[b]=wt.useForm(),[C,x]=l.useState([]),[w,$]=l.useState(!1),[E,R]=l.useState([]),[N,O]=l.useState(!1),[I,j]=l.useState([]),[M,T]=l.useState([]),[z,P]=l.useState(!1),B=async()=>{try{const W=await So.config();n(W),f(G=>G?W.tasks.find(Y=>Y.id===G.id)||G:null)}catch(W){e.error(W.message)}};l.useEffect(()=>{if(r||o||m)return;B();const W=setInterval(B,2500);return()=>clearInterval(W)},[r,o,m]),l.useEffect(()=>{if(!(u!=null&&u.id)||["completed","failed","success"].includes(u.status))return;let W=!0;const G=async()=>{try{const te=await So.config();if(!W)return;n(te);const ne=te.tasks.find(ue=>ue.id===u.id);ne&&f(ne)}catch{}};G();const Y=setInterval(G,1e3);return()=>{W=!1,clearInterval(Y)}},[u==null?void 0:u.id,u==null?void 0:u.status]);const H=l.useMemo(()=>[...new Set(t.tasks.map(W=>W.packageName).filter(Boolean))],[t.tasks]),A=wt.useWatch("packageName",y),L=wt.useWatch("version",y),F=wt.useWatch("repoIds",y)||[],U=F.length?C:H;l.useEffect(()=>{A&&L&&y.setFieldValue("commitMessage",`upgrade ${A} to ${L}`)},[A,L]),l.useEffect(()=>{if(!F.length){x([]);return}let W=!0;return $(!0),So.packageNames(F).then(G=>{W&&x(G)}).catch(()=>{W&&x([])}).finally(()=>{W&&$(!1)}),()=>{W=!1}},[F.join("|")]),l.useEffect(()=>{if(!F.length){T([]),y.setFieldValue("targetBranch","");return}let W=!0;return P(!0),So.branches(F).then(G=>{if(!W)return;T(G);const Y=y.getFieldValue("targetBranch");Y&&!G.some(te=>te.name===Y)&&y.setFieldValue("targetBranch","")}).catch(()=>{W&&T([])}).finally(()=>{W&&P(!1)}),()=>{W=!1}},[F.join("|")]),l.useEffect(()=>{const W=String(A||"").trim();if(!W){R([]);return}let G=!0;const Y=setTimeout(async()=>{O(!0);try{const te=await qc.versions(W);G&&R(te.filter(ne=>typeof ne=="string"?ne:ne.version))}catch{G&&R([])}finally{G&&O(!1)}},350);return()=>{G=!1,clearTimeout(Y)}},[A]);const q=async()=>{if(t.workspaceDir)try{await Wn.openFolder(t.workspaceDir)}catch(W){e.error(W.message)}},_=async W=>{try{await So.addRepo(W),b.resetFields(),h(!1),B()}catch(G){e.error(G.message)}},K=async W=>{v(W.id);try{await So.cloneRepo(W.id),e.success(`${W.name} cloned`),await B()}catch(G){e.error(G.message)}finally{v(null)}},X=async W=>{try{const G=await So.createTask(W);s(!1),y.resetFields(),f(G),await B(),e.success("Task started")}catch(G){e.error(G.message)}},V=[{title:"Repository",dataIndex:"name",render:(W,G)=>c.jsxs(ct,{direction:"vertical",size:0,children:[c.jsx(oo,{strong:!0,children:G.name}),c.jsx(oo,{type:"secondary",children:G.message||""})]})},{title:"Status",dataIndex:"status",render:W=>{const[G,Y]=KC[W]||["default",W];return c.jsx($t,{color:G,children:Y})}},{title:"PR",dataIndex:"prUrl",render:W=>W?c.jsx("a",{href:W,target:"_blank",rel:"noreferrer",children:"Open PR"}):"—"}];return c.jsxs("div",{className:"package-upgrade-page",children:[c.jsx(Ur,{title:"Package Upgrade",description:"Upgrade one package across multiple repositories and open Bitbucket pull requests.",actions:c.jsxs(ct,{children:[c.jsx(Oe,{icon:c.jsx(Gl,{}),onClick:()=>a(!0),children:"Repository list"}),c.jsx(Oe,{type:"primary",icon:c.jsx(Z$,{}),onClick:()=>s(!0),disabled:!t.repos.length,children:"Create task"})]})}),c.jsx(It,{className:"package-upgrade-summary",children:c.jsxs(ct,{size:"large",children:[c.jsxs("div",{children:[c.jsx(oo,{type:"secondary",children:"Workspace"}),c.jsxs("div",{className:"workspace-summary-path",children:[c.jsx(Oe,{type:"text",icon:c.jsx(Fr,{}),onClick:q,disabled:!t.workspaceDir,"aria-label":"Open workspace directory",title:"Open workspace directory"}),c.jsx(oo,{ellipsis:{tooltip:t.workspaceDir||"Not configured"},children:t.workspaceDir||"Not configured"})]})]}),c.jsxs("div",{children:[c.jsx(oo,{type:"secondary",children:"Repositories"}),c.jsx("div",{className:"summary-value",children:t.repos.length})]}),c.jsxs("div",{children:[c.jsx(oo,{type:"secondary",children:"Task history"}),c.jsx("div",{className:"summary-value",children:t.tasks.length})]})]})}),c.jsx(It,{title:"Operation history",className:"package-upgrade-card",children:t.tasks.length?c.jsx(Ra,{dataSource:t.tasks,renderItem:W=>{var G;return c.jsxs(Ra.Item,{children:[c.jsx(Ra.Item.Meta,{title:c.jsxs(ct,{children:[c.jsxs(oo,{strong:!0,children:[W.packageName," → ",W.version]}),c.jsx($t,{color:W.status==="failed"?"error":W.status==="running"?"processing":"success",children:W.status})]}),description:c.jsxs(oo,{type:"secondary",children:[W.sourceBranch," → ",W.targetBranch," · ",((G=W.repos)==null?void 0:G.length)||W.repoIds.length," repositories · ",new Date(W.createdAt).toLocaleString()]})}),c.jsx(Oe,{onClick:()=>f(W),children:"Details"})]})}}):c.jsx(oo,{type:"secondary",children:"No package upgrade tasks yet."})}),c.jsxs(bn,{title:"Repository list",open:r,onCancel:()=>a(!1),footer:null,width:760,children:[c.jsxs("div",{className:"package-upgrade-workspace-readonly",children:[c.jsxs("div",{children:[c.jsx(oo,{strong:!0,children:"Workspace directory"}),c.jsx(oo,{type:"secondary",children:"Read-only path used for local repositories"})]}),c.jsx(ct.Compact,{className:"directory-path-control directory-path-control-readonly package-upgrade-workspace-path-control",children:c.jsx(Ct,{value:t.workspaceDir||"",placeholder:"Not configured",readOnly:!0,prefix:c.jsx(Oe,{type:"text",icon:c.jsx(Fr,{}),onClick:q,disabled:!t.workspaceDir,"aria-label":"Open workspace directory",title:"Open workspace directory"})})})]}),c.jsxs("div",{className:"repo-list-header",children:[c.jsx(oo,{strong:!0,children:"Repository list"}),c.jsx(Oe,{size:"small",icon:c.jsx(Xn,{}),onClick:()=>h(!0),children:"Add repo"})]}),c.jsx(Ra,{className:"package-upgrade-repo-list",size:"small",dataSource:t.repos,renderItem:W=>c.jsxs(Ra.Item,{children:[c.jsx(Ra.Item.Meta,{title:c.jsxs(ct,{size:10,children:[c.jsx("span",{children:W.name}),c.jsx($t,{color:W.cloned?"success":"default",children:W.cloned?"Cloned":"Not cloned"})]}),description:W.url}),c.jsxs("div",{className:"package-upgrade-repo-actions",children:[c.jsx("span",{className:"package-upgrade-clone-slot",children:!W.cloned&&c.jsx(Oe,{type:"link",icon:c.jsx(Sge,{}),loading:p===W.id,onClick:()=>K(W),"aria-label":"Clone repository",title:"Clone repository"})}),c.jsx(Gr,{title:"Remove repository?",onConfirm:async()=>{await So.removeRepo(W.id),B()},children:c.jsx(Oe,{type:"text",danger:!0,icon:c.jsx(Fn,{}),"aria-label":"Delete repository",title:"Delete repository"})})]})]})})]}),c.jsx(bn,{title:"Add repository",open:m,onCancel:()=>h(!1),footer:null,children:c.jsxs(wt,{form:b,layout:"vertical",onFinish:_,children:[c.jsx(wt.Item,{name:"url",label:"Repository URL",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"ssh://git@bitbucket.example/scm/PROJ/repo.git"})}),c.jsx(wt.Item,{name:"name",label:"Display name",children:c.jsx(Ct,{placeholder:"Optional"})}),c.jsx(wt.Item,{name:"directory",label:"Local directory name",children:c.jsx(Ct,{placeholder:"Defaults to repository name"})}),c.jsx(Oe,{type:"primary",htmlType:"submit",children:"Add repo"})]})}),c.jsx(bn,{title:"Task details",open:!!u,onCancel:()=>f(null),footer:null,width:760,children:u&&(()=>{var ne,ue;const W=u.repos||[],G=W.filter(Z=>["success","failed"].includes(Z.status)).length,Y=W.length?Math.round(G/W.length*100):0,te=W.some(Z=>Z.status==="failed")||u.status==="failed";return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"package-upgrade-task-progress",children:c.jsxs(ct,{direction:"vertical",size:4,style:{width:"100%"},children:[c.jsxs(ct,{children:[c.jsxs(oo,{strong:!0,children:[u.packageName," → ",u.version]}),c.jsx($t,{color:((ne=KC[u.status])==null?void 0:ne[0])||"default",children:((ue=KC[u.status])==null?void 0:ue[1])||u.status})]}),c.jsxs(oo,{type:"secondary",children:[G," / ",W.length," repositories completed"]}),c.jsx(dp,{percent:Y,status:te?"exception":u.status==="completed"?"success":"active"})]})}),c.jsx(ar,{size:"small",rowKey:"repoId",pagination:!1,columns:V,dataSource:W})]})})()}),c.jsx(bn,{title:"Create package upgrade task",open:o,onCancel:()=>s(!1),onOk:()=>y.submit(),okText:"Confirm",cancelText:"Cancel",width:620,children:c.jsxs(wt,{form:y,layout:"vertical",onFinish:X,children:[c.jsxs("div",{className:"package-upgrade-form-row",children:[c.jsx(wt.Item,{name:"sourceBranch",label:"Work branch",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"upgrade/package-name"})}),c.jsx(wt.Item,{name:"targetBranch",label:"Target branch",rules:[{required:!0}],children:c.jsx(rf,{allowClear:!0,options:M.map(W=>({label:W.name,value:W.name})),filterOption:(W,G)=>{var Y;return(Y=G==null?void 0:G.value)==null?void 0:Y.toLowerCase().includes(W.toLowerCase())},loading:z,placeholder:F.length?"Select or enter a branch":"Select repositories first",notFoundContent:z?"Loading branches…":"No common branches found",disabled:!F.length})})]}),c.jsxs("div",{className:"package-upgrade-form-row",children:[c.jsx(wt.Item,{name:"packageName",label:"Package name",rules:[{required:!0}],children:c.jsx(rf,{allowClear:!0,options:U.map(W=>({label:W,value:W})),loading:w,placeholder:"@scope/package"})}),c.jsx(wt.Item,{name:"version",label:"Target version",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"1.2.3",onChange:()=>j([]),addonAfter:c.jsx(Jl,{className:"package-upgrade-version-cascader",popupClassName:"package-upgrade-version-picker",placement:"bottomRight",value:I,options:Wbe(E),loading:N,placeholder:"Select",expandTrigger:"hover",displayRender:()=>"Select",onChange:W=>{const G=W||[];j(G),y.setFieldValue("version",G.length?G[G.length-1]:"")}})})})]}),c.jsx(wt.Item,{name:"commitMessage",label:"Commit message",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"upgrade xxx to xxx"})}),c.jsx(wt.Item,{name:"repoIds",label:"Repositories",rules:[{required:!0,message:"Select at least one repository"}],children:c.jsx(tr.Group,{style:{width:"100%"},children:c.jsx(ct,{direction:"vertical",children:t.repos.map(W=>c.jsxs(tr,{value:W.id,children:[W.name," ",c.jsxs(oo,{type:"secondary",children:["(",W.cloned?"cloned":"clone on task start",")"]})]},W.id))})})})]})})]})}const{Text:xo}=xn,_I=["#7c5cff","#16a085","#e67e22","#d94f70","#1982c4","#7a9e2a","#c44536","#8e5ea2"];function Kbe(e,t){return _I[Math.max(0,t.indexOf(e))%_I.length]}function Gbe(){var j;const{message:e}=Pr.useApp(),[t,n]=l.useState(null),[r,a]=l.useState(!1),[o,s]=l.useState(""),[u,f]=l.useState(!0),[m,h]=l.useState(!1),[p,v]=l.useState([]),[y,b]=l.useState([]),[C,x]=l.useState(!1),[w,$]=l.useState(!1),E=async()=>{a(!0);try{const[M]=await Promise.all([So.dependencyScan(),new Promise(T=>setTimeout(T,500))]);n(M),e.success("Scan complete")}catch(M){n(null),e.error(M.message)}finally{a(!1)}},R=l.useMemo(()=>((t==null?void 0:t.packages)||[]).filter(M=>M.name.toLowerCase().includes(o.trim().toLowerCase())&&(!u||M.repositoryCount>1)),[t,o,u]),N=async()=>{if(t!=null&&t.workspaceDir)try{await Wn.openFolder(t.workspaceDir)}catch(M){e.error(M.message)}},O=async()=>{h(!0),x(!0);try{const M=await So.dependencyRepositories();v(M.repositories||[]),b((M.repositories||[]).filter(T=>T.selected).map(T=>T.directory))}catch(M){e.error(M.message)}finally{x(!1)}},I=async()=>{$(!0);try{await So.saveDependencyRepositories(y),h(!1),n(null),e.success("Repository settings saved")}catch(M){e.error(M.message)}finally{$(!1)}};return c.jsxs("div",{className:"package-versions-page",children:[c.jsx(Ur,{title:"Package Versions",description:"Scan every repository in the configured workspace and compare dependency versions at a glance. Matching versions share a color within each package.",actions:c.jsxs(ct,{children:[c.jsx(Oe,{icon:c.jsx(Gl,{}),onClick:O,children:"Repositories"}),c.jsx(Oe,{icon:c.jsx(Xa,{}),loading:r,onClick:E,children:t?"Scan again":"Scan"})]})}),r&&!t?c.jsxs("div",{className:"package-versions-loading",children:[c.jsx(rr,{size:"large"}),c.jsx(xo,{type:"secondary",children:"Scanning package.json files…"})]}):t?c.jsxs(c.Fragment,{children:[c.jsxs(It,{className:"package-versions-summary",children:[c.jsxs("div",{children:[c.jsx(xo,{type:"secondary",children:"Workspace"}),c.jsxs("div",{className:"package-versions-path",children:[c.jsx(Oe,{type:"text",icon:c.jsx(Fr,{}),onClick:N,"aria-label":"Open workspace directory"}),c.jsx(yn,{title:t.workspaceDir,children:c.jsx(xo,{ellipsis:!0,children:t.workspaceDir})})]})]}),c.jsxs("div",{children:[c.jsx(xo,{type:"secondary",children:"Repositories"}),c.jsx("div",{className:"package-versions-stat",children:t.repositories.length})]}),c.jsxs("div",{children:[c.jsx(xo,{type:"secondary",children:"Packages"}),c.jsx("div",{className:"package-versions-stat",children:t.packages.length})]}),c.jsxs("div",{children:[c.jsx(xo,{type:"secondary",children:"Shared packages"}),c.jsx("div",{className:"package-versions-stat",children:t.packages.filter(M=>M.repositoryCount>1).length})]})]}),((j=t.errors)==null?void 0:j.length)>0&&c.jsx(mr,{className:"package-versions-alert",type:"warning",showIcon:!0,message:`${t.errors.length} repository could not be read`,description:t.errors.map(M=>`${M.repository}: ${M.message}`).join(" · ")}),c.jsx(It,{className:"package-versions-card",title:c.jsxs("span",{children:["Dependency matrix ",c.jsxs(xo,{type:"secondary",children:["· ",R.length," shown"]})]}),extra:c.jsxs(ct,{children:[c.jsx(Ct,{allowClear:!0,prefix:c.jsx(jo,{}),placeholder:"Filter packages",value:o,onChange:M=>s(M.target.value)}),c.jsx(Ja,{checked:u,onChange:f,checkedChildren:"Shared",unCheckedChildren:"All"})]}),children:R.length?c.jsx(J0,{className:"package-versions-list",items:R.map(M=>{const T=M.versions.map(z=>z.version);return{key:M.name,label:c.jsxs("div",{className:"package-version-name",children:[c.jsx(xo,{strong:!0,children:M.name}),c.jsxs(xo,{type:"secondary",children:[M.repositoryCount," repos · ",M.versions.length," versions"]})]}),children:c.jsx("div",{className:"package-version-groups",children:M.versions.map(z=>c.jsxs("div",{className:"package-version-group",children:[c.jsx($t,{className:"package-version-tag",style:{"--version-color":Kbe(z.version,T)},children:z.version}),c.jsx("div",{className:"package-version-repos",children:z.repositories.map(P=>c.jsx(yn,{title:`${P.repository} · ${P.sections.join(", ")}`,children:c.jsx("span",{className:"package-version-repo",children:P.repository})},P.directory))})]},z.version))})}})}):c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:o?"No matching packages":u?"No package is shared by more than one repository":"No dependencies found"})}),c.jsxs(xo,{className:"package-versions-updated",type:"secondary",children:["Last scanned ",new Date(t.scannedAt).toLocaleString()]})]}):c.jsx(It,{children:c.jsx(Xt,{description:"Click Scan to inspect package versions in the configured workspace."})}),c.jsxs(bn,{title:"Repositories to scan",open:m,onCancel:()=>h(!1),onOk:I,okButtonProps:{disabled:!y.length},okText:"Save",confirmLoading:w,width:620,children:[c.jsx(xo,{type:"secondary",children:"Select which repositories in the workspace should be included in the next scan."}),c.jsxs("div",{className:"package-versions-repository-toolbar",children:[c.jsx(tr,{checked:p.length>0&&y.length===p.length,indeterminate:y.length>0&&y.length<p.length,onChange:M=>b(M.target.checked?p.map(T=>T.directory):[]),children:"Select all"}),c.jsxs(xo,{type:"secondary",children:[y.length," / ",p.length," selected"]})]}),C?c.jsx("div",{className:"package-versions-settings-loading",children:c.jsx(rr,{})}):c.jsx(tr.Group,{value:y,onChange:b,className:"package-versions-repository-options",children:c.jsx(Ra,{size:"small",dataSource:p,locale:{emptyText:"No repositories found in this workspace."},renderItem:M=>c.jsx(Ra.Item,{children:c.jsx(tr,{value:M.directory,children:c.jsxs(ct,{direction:"vertical",size:0,children:[c.jsx(xo,{children:M.name}),c.jsx(xo,{type:"secondary",children:M.directory})]})})})})})]})]})}const{Paragraph:Y9,Text:Zn,Title:Bd}=xn,Ybe=[{key:"launcher",label:"Service Launcher",description:"Start, stop, and inspect local project scripts.",icon:c.jsx(qo,{})},{key:"pr-review",label:"PR Review",description:"Turn pull request changes into a focused review.",icon:c.jsx(Ay,{})},{key:"todo-list",label:"To-Do",description:"Keep development tasks visible and moving.",icon:c.jsx(mu,{})},{key:"postman",label:"API Workspace",description:"Build, organize, and send HTTP requests.",icon:c.jsx(hu,{})},{key:"ports",label:"Port Diagnostic",description:"Find listeners and resolve local port conflicts.",icon:c.jsx(e4,{})},{key:"errors",label:"Error Logs",description:"Review recent launcher and application errors.",icon:c.jsx(uf,{})}],Id=e=>Array.isArray(e)?e:[],Xbe=e=>e instanceof Set?e:new Set(Array.isArray(e)?e:[]),Jbe=e=>e instanceof Map?[...e.entries()]:!e||typeof e!="object"?[]:Object.entries(e),Qbe=e=>e.reduce((t,[,n])=>t+Math.max(0,Number(n)||0),0),Zbe=(e,t)=>e.alias||e.name||e.folder||`Service ${t+1}`,e1e=e=>e.groupName||e.branch||e.folder||"Local service",Is=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,LI=e=>typeof e=="string"?e:(e==null?void 0:e.message)||"DevBuddy could not load service and runtime data.",t1e=[{key:"activity",title:"Recent activity",description:"Jira & Confluence mentions.",icon:c.jsx(uf,{}),route:"jira-filters"},{key:"jiraDueToday",title:"Jira due today",description:"Unresolved issues due today.",icon:c.jsx(mu,{}),route:"jira-filters"},{key:"assignedTodos",title:"Assigned to-dos",description:"Your open local tasks.",icon:c.jsx(mu,{}),route:"todo-list"},{key:"authoredPrs",title:"Your open PRs",description:"Created by you and not merged.",icon:c.jsx(hu,{}),route:"pr-review"}];let GC=null;const X9=e=>{if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleDateString(void 0,{month:"short",day:"numeric"})},n1e=e=>r1e(e).filter(t=>!t.read).length,r1e=e=>{const t=(e==null?void 0:e.notifications)||{};return[...Array.isArray(t.jira)?t.jira:[],...Array.isArray(t.confluence)?t.confluence:[]]};function a1e({config:e,items:t,open:n,onClose:r,onNavigate:a}){const[o,s]=l.useState(""),[u,f]=l.useState("all"),m=l.useMemo(()=>{let C=t||[];if(u!=="all"&&(C=C.filter(x=>(x.sourceType||x.source||"").toLowerCase()===u.toLowerCase())),o.trim()){const x=o.trim().toLowerCase();C=C.filter(w=>{const $=String(w.title||w.summary||w.name||"").toLowerCase(),E=String(w.key||w.repository||"").toLowerCase(),R=String(w.author||"").toLowerCase(),N=String(w.activityType||w.status||"").toLowerCase();return $.includes(x)||E.includes(x)||R.includes(x)||N.includes(x)})}return C},[t,o,u]),h=(t||[]).some(C=>C.source==="Jira"||C.sourceType==="jira")&&(t||[]).some(C=>C.source==="Confluence"||C.sourceType==="confluence"),p=(t||[]).filter(C=>(C.sourceType||C.source)==="Jira"||(C.sourceType||C.source)==="jira").length,v=(t||[]).filter(C=>(C.sourceType||C.source)==="Confluence"||(C.sourceType||C.source)==="confluence").length,y=C=>{if(C!=null&&C.url&&/^https?:\/\//i.test(C.url)){window.open(C.url,"_blank","noopener,noreferrer");return}if(C!=null&&C.url&&C.url.startsWith("#/")){window.location.hash=C.url;return}e!=null&&e.route&&typeof a=="function"&&a(e.route)},b=C=>{const x=C.source||C.sourceType;return x==="Jira"||x==="jira"?c.jsx($t,{color:"blue",children:"Jira"}):x==="Confluence"||x==="confluence"?c.jsx($t,{color:"cyan",children:"Confluence"}):C.repository?c.jsx($t,{color:"purple",children:"PR"}):C.completed!==void 0?c.jsx($t,{color:"green",children:"To-Do"}):null};return c.jsxs(bn,{title:c.jsxs(ct,{size:8,children:[c.jsx("span",{className:"overview-insight-modal-icon",children:e==null?void 0:e.icon}),c.jsx("span",{children:e==null?void 0:e.title}),c.jsx(sa,{count:t.length,style:{backgroundColor:"var(--db-primary)"}})]}),open:n,onCancel:r,footer:null,width:880,className:"overview-insights-modal",children:[c.jsxs("div",{className:"overview-insights-modal-header",children:[c.jsx(Zn,{type:"secondary",children:e==null?void 0:e.description}),c.jsxs(ct,{size:12,className:"overview-insights-modal-filters",wrap:!0,children:[c.jsx(Ct,{placeholder:"Search items...",prefix:c.jsx(jo,{}),allowClear:!0,value:o,onChange:C=>s(C.target.value),style:{width:220}}),h&&c.jsxs(er.Group,{value:u,onChange:C=>f(C.target.value),size:"small",optionType:"button",buttonStyle:"solid",children:[c.jsxs(er.Button,{value:"all",children:["All (",t.length,")"]}),c.jsxs(er.Button,{value:"jira",children:["Jira (",p,")"]}),c.jsxs(er.Button,{value:"confluence",children:["Confluence (",v,")"]})]})]})]}),c.jsx("div",{className:"overview-insights-modal-list",children:m.length===0?c.jsx(Xt,{description:o?"No matching items found.":"No items.",image:Xt.PRESENTED_IMAGE_SIMPLE}):m.map((C,x)=>c.jsxs("div",{className:"overview-insights-modal-item",onClick:()=>y(C),children:[c.jsxs("div",{className:"overview-insights-modal-item-body",children:[c.jsxs("div",{className:"overview-insights-modal-item-top",children:[b(C),C.key&&c.jsx(Zn,{strong:!0,className:"overview-insights-modal-item-key",children:C.key}),c.jsx(Zn,{className:"overview-insights-modal-item-title",title:C.title||C.summary||C.name||C.branch,children:C.title||C.summary||C.name||C.branch})]}),c.jsxs("div",{className:"overview-insights-modal-item-meta",children:[C.author&&c.jsxs(Zn,{type:"secondary",className:"overview-insights-modal-item-author",title:`By ${C.author}`,children:["By ",C.author]}),C.activityType&&c.jsxs(Zn,{type:"secondary",className:"overview-insights-modal-item-meta-item",title:C.activityType,children:["· ",C.activityType]}),C.status&&c.jsx($t,{size:"small",children:C.status}),C.priority&&c.jsxs(Zn,{type:"secondary",className:"overview-insights-modal-item-meta-item",children:["· Priority: ",C.priority]}),C.repository&&c.jsxs(Zn,{type:"secondary",className:"overview-insights-modal-item-meta-item",title:C.repository,children:["· Repo: ",C.repository]})]})]}),c.jsx("div",{className:"overview-insights-modal-item-extra",children:c.jsx("span",{className:"overview-insights-modal-item-date",children:C.activityAt||C.updated||C.dueDate||C.date?new Date(C.activityAt||C.updated||C.dueDate||C.date).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):""})})]},C.id||C.key||`item-${x}`))})]})}function o1e({data:e,open:t,onClose:n,onRefresh:r}){var y;const[a,o]=l.useState(!1),[s,u]=l.useState(""),f=async()=>{o(!0);try{await r(),u("")}catch(b){u(b.message||"Unable to load notifications.")}finally{o(!1)}};l.useEffect(()=>{t&&f()},[t]);const m=(b,C)=>c.jsx("div",{className:"overview-notifications-list",children:b.length===0?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:`No ${C} notifications.`}):b.map((x,w)=>{const $=()=>{x.url&&/^https?:\/\//i.test(x.url)&&window.open(x.url,"_blank","noopener,noreferrer")};return c.jsxs("div",{className:`overview-notification-item${x.read?"":" is-unread"}${x.url?" is-link":""}`,role:x.url?"button":void 0,tabIndex:x.url?0:void 0,onClick:x.url?$:void 0,onKeyDown:x.url?E=>{(E.key==="Enter"||E.key===" ")&&$()}:void 0,children:[c.jsxs("div",{className:"overview-notification-item-main",children:[c.jsxs("div",{className:"overview-notification-item-title-row",children:[!x.read&&c.jsx(sa,{status:"processing"}),c.jsx(Zn,{strong:!0,children:x.title})]}),x.summary&&c.jsx(Zn,{type:"secondary",className:"overview-notification-item-summary",children:x.summary})]}),c.jsx(Zn,{type:"secondary",className:"overview-notification-item-date",children:X9(x.activityAt||x.updated)})]},x.id||`${C}-${w}`)})}),h=e.notifications||{},p=Array.isArray(h.jira)?h.jira:[],v=Array.isArray(h.confluence)?h.confluence:[];return c.jsxs(bn,{title:c.jsxs(ct,{children:[c.jsx(Kd,{}),c.jsx("span",{children:"Jira & Confluence Notifications"})]}),open:t,onCancel:n,footer:null,width:760,className:"overview-notifications-modal",children:[c.jsxs("div",{className:"overview-notifications-toolbar",children:[c.jsx(Zn,{type:"secondary",children:"View the latest notifications from your connected work systems."}),c.jsx(Oe,{icon:c.jsx(Xa,{}),loading:a,onClick:f,children:"Refresh"})]}),s&&c.jsx(mr,{type:"warning",showIcon:!0,message:s,className:"overview-notifications-alert"}),((y=e.errors)==null?void 0:y.length)>0&&c.jsx(mr,{type:"warning",showIcon:!0,message:"Some notifications could not be loaded",description:e.errors.join(" · "),className:"overview-notifications-alert"}),c.jsx(Qa,{items:[{key:"jira",label:`Jira (${p.length})`,children:m(p,"Jira")},{key:"confluence",label:`Confluence (${v.length})`,children:m(v,"Confluence")}]})]})}function i1e({onNavigate:e}){var I;const[t,n]=l.useState(()=>GC),[r,a]=l.useState(()=>!GC),[o,s]=l.useState(null),[u,f]=l.useState(null),[m,h]=l.useState(!1),[p,v]=l.useState({notifications:{jira:[],confluence:[]},errors:[]}),[y,b]=l.useState({jiraTokenConfigured:!1,bitbucketTokenConfigured:!1}),C=async()=>{const j=await Yw.notifications();return v(j),j},x=async()=>{try{const j=await Wn.status();b(j)}catch{b({jiraTokenConfigured:!1,bitbucketTokenConfigured:!1})}},w=async()=>{a(!0);try{const j=await Yw.get();GC=j,n(j),s(null)}catch(j){s(j.message||"Unable to load work insights.")}finally{a(!1)}};l.useEffect(()=>{w(),x()},[]);const $=(j,M)=>{if(j!=null&&j.url&&/^https?:\/\//i.test(j.url)){window.open(j.url,"_blank","noopener,noreferrer");return}if(j!=null&&j.url&&j.url.startsWith("#/")){window.location.hash=j.url;return}typeof e=="function"&&e(M)};if(r&&!t)return c.jsx(It,{className:"overview-panel overview-insights-card",children:c.jsx(La,{active:!0,title:{width:"30%"},paragraph:{rows:3}})});if(o&&!t)return c.jsx(It,{className:"overview-panel overview-insights-card",children:c.jsx(mr,{type:"warning",showIcon:!0,message:"Work insights unavailable",description:o,action:c.jsx(Oe,{size:"small",onClick:w,children:"Retry"})})});const E=n1e(p),R=j=>c.jsx(sa,{count:E,overflowCount:99,offset:[2,-2],children:c.jsx(Oe,{type:j,icon:c.jsx(Kd,{}),onClick:()=>h(!0),children:"Notifications"})}),N=!!(y.jiraTokenConfigured&&y.confluenceTokenConfigured);if(!(t!=null&&t.configured))return c.jsx(It,{className:"overview-panel overview-insights-card",children:c.jsxs("div",{className:"overview-section-header",children:[c.jsxs("div",{children:[c.jsx(Zn,{className:"overview-eyebrow",children:"WORK INSIGHTS"}),c.jsx(Bd,{level:3,className:"overview-section-title",children:"Connect your work systems"}),c.jsx(Zn,{type:"secondary",children:"Configure Jira and Bitbucket access tokens to see your daily work here."})]}),c.jsxs(ct,{children:[N&&R(),c.jsx(Oe,{type:"primary",onClick:()=>e==null?void 0:e("settings"),children:"Open Settings"})]})]})});const O=t.categories||{};return c.jsxs(It,{className:"overview-panel overview-insights-card",children:[c.jsxs("div",{className:"overview-section-header",children:[c.jsx("div",{children:c.jsx(Zn,{className:"overview-eyebrow",children:"WORK INSIGHTS"})}),c.jsxs("div",{className:"overview-insights-actions",children:[r&&c.jsx(rr,{size:"small","aria-label":"Refreshing work insights"}),N&&R("text"),c.jsx(Oe,{type:"text",onClick:w,children:"Refresh"})]})]}),o&&c.jsx(mr,{className:"overview-insights-warning",type:"warning",showIcon:!0,message:"Refresh failed; showing the last result",description:o}),((I=t.errors)==null?void 0:I.length)>0&&c.jsx(mr,{className:"overview-insights-warning",type:"warning",showIcon:!0,message:"Some work data could not be loaded",description:t.errors.join(" · ")}),c.jsx("div",{className:"overview-insights-grid",children:t1e.map(j=>{const M=Array.isArray(O[j.key])?O[j.key]:[];return c.jsxs("section",{className:`overview-insight-tile${M.length?" has-items":""}`,"aria-labelledby":`overview-insight-${j.key}`,children:[c.jsxs("div",{className:"overview-insight-heading",children:[c.jsx("span",{className:"overview-insight-icon","aria-hidden":"true",children:j.icon}),c.jsxs("div",{children:[c.jsx(Zn,{strong:!0,id:`overview-insight-${j.key}`,children:j.title}),c.jsx(Zn,{type:"secondary",children:j.description})]}),c.jsx(sa,{count:M.length,showZero:!0,overflowCount:99})]}),M.length===0?c.jsx(Zn,{type:"secondary",className:"overview-insight-empty",children:"Nothing needs attention."}):c.jsxs("div",{className:"overview-insight-items",children:[M.slice(0,3).map((T,z)=>c.jsxs("button",{type:"button",className:"overview-insight-item",onClick:()=>$(T,j.route),children:[c.jsxs("span",{className:"overview-insight-item-main",children:[c.jsx("span",{className:"overview-insight-item-title",title:T.title||T.summary||T.name||T.branch,children:T.title||T.summary||T.name||T.branch}),c.jsx("span",{className:"overview-insight-item-meta",title:T.key||T.repository||T.build||T.activityType||T.priority||T.summary||"",children:T.key||T.repository||T.build||T.activityType||T.priority||T.summary||""})]}),c.jsx("span",{className:"overview-insight-item-date",children:X9(T.dueDate||T.updated||T.activityAt||T.date)})]},T.id||T.key||`${j.key}-${z}`)),M.length>3&&c.jsxs(Oe,{type:"link",className:"overview-insight-more",onClick:()=>f({config:j,items:M}),children:["View all ",M.length]})]})]},j.key)})}),c.jsx(a1e,{config:u==null?void 0:u.config,items:(u==null?void 0:u.items)||[],open:!!u,onClose:()=>f(null),onNavigate:e}),c.jsx(o1e,{data:p,open:m,onClose:()=>h(!1),onRefresh:C})]})}function l1e(){const[e,t]=l.useState("");return l.useEffect(()=>{let n=!0;return Yw.version().then(({version:r})=>{n&&r&&r!=="0.2.14"&&t(r)}).catch(()=>{}),()=>{n=!1}},[]),e?c.jsx(mr,{showIcon:!0,type:"warning",message:"A newer UI version is available. Reload to update.",action:c.jsx(Oe,{size:"small",type:"primary",onClick:()=>window.location.reload(),children:"Reload"}),style:{marginBottom:16}}):null}function s1e(){return c.jsxs("div",{className:"overview-page",role:"status","aria-live":"polite","aria-busy":"true","aria-label":"Loading workspace overview",children:[c.jsxs("section",{className:"overview-hero",children:[c.jsxs("div",{className:"overview-hero-content",children:[c.jsx(Zn,{className:"overview-eyebrow",children:"LOADING WORKSPACE"}),c.jsx(Bd,{level:1,className:"overview-hero-title",children:"Getting your development workspace ready…"}),c.jsx(Y9,{type:"secondary",className:"overview-hero-copy overview-hero-description",children:"Checking services, runtime status, and recent errors."}),c.jsxs("div",{className:"overview-hero-actions",children:[c.jsx(La.Button,{active:!0,style:{width:176,height:42,borderRadius:10}}),c.jsx(La.Button,{active:!0,style:{width:196,height:42,borderRadius:10}})]})]}),c.jsx("div",{className:"overview-hero-mark","aria-hidden":"true",children:c.jsx(qo,{})})]}),c.jsx("section",{className:"overview-metrics","aria-hidden":"true",children:["services","running","errors","extensions"].map(e=>c.jsx(It,{className:"overview-metric-card",children:c.jsx(La,{active:!0,title:{width:"48%"},paragraph:{rows:1,width:"72%"}})},e))}),c.jsxs("div",{className:"overview-content-grid overview-grid","aria-hidden":"true",children:[c.jsx("section",{className:"overview-shortcuts-section",children:c.jsx(La,{active:!0,title:{width:"34%"},paragraph:{rows:4}})}),c.jsx(It,{className:"overview-panel overview-setup-card",children:c.jsx(La,{active:!0,title:{width:"46%"},paragraph:{rows:4}})})]}),c.jsx(It,{className:"overview-panel overview-health-card","aria-hidden":"true",children:c.jsx(La,{active:!0,title:{width:"24%"},paragraph:{rows:3}})})]})}function c1e({launchers:e=[],running:t=new Set,errorCounts:n={},errorLogs:r=[],plugins:a=[],staticPages:o=[],loading:s=!1,error:u=null,hasLoaded:f=!1,onRetry:m,onNavigate:h}){const p=Id(e),v=Id(a),y=Id(o),b=Xbe(t),C=Id(r),x=f||p.length>0;if(s&&!x)return c.jsx(s1e,{});if(u&&!x)return c.jsx("div",{className:"overview-page",role:"alert",children:c.jsx(It,{className:"overview-panel",children:c.jsx(ky,{status:"error",title:"Unable to load your workspace",subTitle:LI(u),extra:typeof m=="function"?c.jsx(Oe,{type:"primary",icon:c.jsx(qo,{}),onClick:m,children:"Retry"}):null})})});const w=Jbe(n),$=v.length+y.length,E=C.length,R=p.reduce((P,B)=>P+Id(B.scripts).length+Math.max(0,Number(B.packageScriptCount)||0),0),N=p.map((P,B)=>{const H=`${P.id}:`,A=[...b].filter(_=>String(_).startsWith(H)).length,L=Qbe(w.filter(([_])=>String(_).startsWith(H))),F=C.filter(_=>String(_.source||"").startsWith(`Launcher: ${P.alias||P.name||""}`)).length,U=Id(P.scripts).length+Math.max(0,Number(P.packageScriptCount)||0),q=L>0?{badge:"error",label:"Needs attention",priority:2}:A>0?{badge:"success",label:"Running",priority:1}:{badge:"default",label:"Idle",priority:0};return{service:P,name:Zbe(P,B),meta:e1e(P),activeCount:A,serviceErrors:Math.max(L,F),scriptCount:U,health:q,order:B}}).sort((P,B)=>B.health.priority-P.health.priority||P.order-B.order),O=N.filter(P=>P.activeCount>0).length,I=N.filter(P=>P.serviceErrors>0).length,j=[{key:"service",title:"Add your first service",description:"Connect a local project and choose the scripts you use most.",complete:p.length>0,action:"Add service",route:"launcher"},{key:"run",title:"Start a development script",description:"Launch a configured script and keep its status within reach.",complete:b.size>0,action:"Open Launcher",route:"launcher"},{key:"extend",title:"Personalize your workspace",description:"Add a plugin or static page for the tools your team already uses.",complete:$>0,action:"Open Settings",route:"settings"}],M=j.filter(P=>P.complete).length,T=N.slice(0,5),z=P=>{typeof h=="function"&&h(P)};return c.jsxs("div",{className:"overview-page",children:[u&&c.jsx(mr,{type:"warning",showIcon:!0,message:"Live service status may be out of date",description:LI(u),action:typeof m=="function"?c.jsx(Oe,{size:"small",loading:s,onClick:m,children:"Retry"}):null,className:"overview-data-warning"}),c.jsxs("section",{className:"overview-hero","aria-labelledby":"overview-title",children:[c.jsxs("div",{className:"overview-hero-content",children:[c.jsx(Zn,{className:"overview-eyebrow",children:"DEVBUDDY OVERVIEW"}),c.jsx(Bd,{id:"overview-title",level:1,className:"overview-hero-title",children:"Your development day, in one calm workspace."}),c.jsx(Y9,{type:"secondary",className:"overview-hero-copy overview-hero-description",children:"Start local services, spot issues, and jump into everyday tools without losing your flow."}),c.jsxs("div",{className:"overview-hero-actions",children:[c.jsx(Oe,{type:"primary",size:"large",icon:p.length>0?c.jsx(qo,{}):c.jsx(Xn,{}),onClick:()=>z("launcher"),children:p.length>0?"Open Launcher":"Add your first service"}),c.jsx(Oe,{size:"large",icon:c.jsx(Ay,{}),onClick:()=>z("pr-review"),children:"Review a pull request"})]})]}),c.jsx("div",{className:"overview-hero-mark","aria-hidden":"true",children:c.jsx(qo,{})})]}),c.jsxs("section",{className:"overview-metrics","aria-label":"Workspace status",children:[c.jsxs(It,{className:"overview-metric-card overview-metric-card-clickable",role:"button",tabIndex:0,"aria-label":`Open Launcher, ${p.length} services`,onClick:()=>h==null?void 0:h("launcher"),onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),h==null||h("launcher"))},children:[c.jsx("span",{className:"overview-metric-icon","aria-hidden":"true",children:c.jsx(Hpe,{})}),c.jsxs("div",{className:"overview-metric-content overview-metric-copy",children:[c.jsx(Zn,{className:"overview-metric-label",children:"Services"}),c.jsx("strong",{className:"overview-metric-value",children:p.length}),c.jsx(Zn,{type:"secondary",className:"overview-metric-note",children:Is(R,"configured script")})]})]}),c.jsxs(It,{className:`overview-metric-card overview-metric-card-clickable${b.size>0?" is-success":""}`,role:"button",tabIndex:0,"aria-label":`Open Launcher, ${b.size} running scripts`,onClick:()=>h==null?void 0:h("launcher?running=1"),onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),h==null||h("launcher?running=1"))},children:[c.jsx("span",{className:"overview-metric-icon","aria-hidden":"true",children:c.jsx(Kl,{})}),c.jsxs("div",{className:"overview-metric-content overview-metric-copy",children:[c.jsx(Zn,{className:"overview-metric-label",children:"Running"}),c.jsx("strong",{className:"overview-metric-value",children:b.size}),c.jsx(Zn,{type:"secondary",className:"overview-metric-note",children:Is(O,"active service")})]})]}),c.jsxs(It,{className:`overview-metric-card overview-metric-card-clickable${E>0?" is-danger":" is-neutral"}`,role:"button",tabIndex:0,"aria-label":`Open Error Logs, ${E} errors`,onClick:()=>h==null?void 0:h("errors"),onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),h==null||h("errors"))},children:[c.jsx("span",{className:"overview-metric-icon","aria-hidden":"true",children:c.jsx(uf,{})}),c.jsxs("div",{className:"overview-metric-content overview-metric-copy",children:[c.jsx(Zn,{className:"overview-metric-label",children:"Errors"}),c.jsx("strong",{className:"overview-metric-value",children:E}),c.jsx(Zn,{type:"secondary",className:"overview-metric-note",children:I>0?`Across ${Is(I,"service")}`:"No services need attention"})]})]}),c.jsxs(It,{className:"overview-metric-card",children:[c.jsx("span",{className:"overview-metric-icon","aria-hidden":"true",children:c.jsx(R9,{})}),c.jsxs("div",{className:"overview-metric-content overview-metric-copy",children:[c.jsx(Zn,{className:"overview-metric-label",children:"Extensions"}),c.jsx("strong",{className:"overview-metric-value",children:$}),c.jsxs(Zn,{type:"secondary",className:"overview-metric-note",children:[Is(v.length,"plugin")," · ",Is(y.length,"page")]})]})]})]}),c.jsx(l1e,{}),c.jsx(i1e,{onNavigate:z}),c.jsxs("div",{className:"overview-content-grid overview-grid",children:[c.jsxs("section",{className:"overview-shortcuts-section","aria-labelledby":"overview-shortcuts-title",children:[c.jsx("div",{className:"overview-section-header",children:c.jsxs("div",{children:[c.jsx(Bd,{level:3,id:"overview-shortcuts-title",className:"overview-section-title",children:"Jump back into your flow"}),c.jsx(Zn,{type:"secondary",className:"overview-section-description",children:"Your most-used developer tools, one click away."})]})}),c.jsx("div",{className:"overview-shortcuts overview-quick-grid",children:Ybe.map(P=>c.jsxs("button",{type:"button",className:"overview-shortcut overview-quick-card","aria-label":`${P.label}: ${P.description}`,onClick:()=>z(P.key),children:[c.jsx("span",{className:"overview-shortcut-icon overview-quick-card-icon","aria-hidden":"true",children:P.icon}),c.jsxs("span",{className:"overview-shortcut-copy overview-quick-card-copy",children:[c.jsx("span",{className:"overview-shortcut-title overview-quick-card-title",children:P.label}),c.jsx("span",{className:"overview-shortcut-description overview-quick-card-description",children:P.description})]}),c.jsx(Qc,{className:"overview-shortcut-arrow","aria-hidden":"true"})]},P.key))})]}),c.jsx(It,{className:"overview-panel overview-setup-card",children:c.jsxs("section",{className:"overview-setup","aria-labelledby":"overview-setup-title",children:[c.jsxs("div",{className:"overview-section-header",children:[c.jsxs("div",{children:[c.jsx(Zn,{className:"overview-eyebrow",children:"GET STARTED"}),c.jsx(Bd,{level:3,id:"overview-setup-title",className:"overview-section-title",children:"Set up your workspace"})]}),c.jsxs(Zn,{type:"secondary",className:"overview-setup-progress",children:[M," of ",j.length]})]}),c.jsx("ol",{className:"overview-setup-list overview-checklist",children:j.map((P,B)=>c.jsxs("li",{className:`overview-setup-step overview-checklist-item${P.complete?" is-complete":""}`,children:[c.jsx("span",{className:"overview-setup-step-marker overview-checklist-marker","aria-hidden":"true",children:P.complete?c.jsx(Hi,{}):B+1}),c.jsxs("div",{className:"overview-setup-step-copy overview-checklist-copy",children:[c.jsx(Zn,{strong:!0,className:"overview-setup-step-title overview-checklist-title",children:P.title}),c.jsx(Zn,{type:"secondary",className:"overview-setup-step-description overview-checklist-description",children:P.description}),!P.complete&&c.jsx(Oe,{type:"link",className:"overview-setup-step-action",onClick:()=>z(P.route),children:P.action})]})]},P.key))})]})})]}),c.jsx(It,{className:"overview-panel overview-health-card",children:c.jsxs("section",{className:"overview-health","aria-labelledby":"overview-health-title",children:[c.jsxs("div",{className:"overview-section-header",children:[c.jsxs("div",{children:[c.jsx(Bd,{level:3,id:"overview-health-title",className:"overview-section-title",children:"Service health"}),c.jsx(Zn,{type:"secondary",className:"overview-section-description",children:"Running scripts and recent errors across your local projects."})]}),p.length>0&&c.jsxs(Oe,{type:"text",className:"overview-section-link",onClick:()=>z("launcher"),children:["View all services ",c.jsx(Qc,{})]})]}),T.length===0?c.jsx(Xt,{className:"overview-empty",image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No services configured yet",children:c.jsx(Oe,{type:"primary",icon:c.jsx(Xn,{}),onClick:()=>z("launcher"),children:"Add your first service"})}):c.jsx("div",{className:"overview-service-list",children:T.map(P=>c.jsxs("button",{type:"button",className:`overview-service-row ${P.health.badge==="error"?"is-error":P.health.badge==="success"?"is-running":"is-idle"}`,"aria-label":`${P.name}: ${P.health.label}, ${Is(P.activeCount,"script")} running, ${Is(P.serviceErrors,"error")}`,onClick:()=>z(`launcher?service=${encodeURIComponent(P.service.id)}`),children:[c.jsxs("span",{className:"overview-service-primary",children:[c.jsxs("span",{className:"overview-service-name-line",children:[c.jsx("span",{className:"overview-service-name",children:P.name}),c.jsx(sa,{status:P.health.badge,text:P.health.label})]}),c.jsx("span",{className:"overview-service-meta overview-service-detail",children:P.meta})]}),c.jsxs("span",{className:"overview-service-stats",children:[c.jsxs("span",{className:"overview-service-stat",children:[c.jsx(Kl,{"aria-hidden":"true"}),P.activeCount," / ",P.scriptCount," running"]}),c.jsxs("span",{className:`overview-service-stat${P.serviceErrors>0?" has-errors":""}`,children:[c.jsx(uf,{"aria-hidden":"true"}),Is(P.serviceErrors,"error")]}),c.jsx(Qc,{className:"overview-service-arrow","aria-hidden":"true"})]})]},P.service.id))}),N.length>T.length&&c.jsxs(Oe,{type:"text",className:"overview-more-services",onClick:()=>z("launcher"),children:["View ",N.length-T.length," more services",c.jsx(Qc,{})]})]})}),c.jsxs("footer",{className:"overview-footer",children:[c.jsx(kf,{"aria-hidden":"true"}),c.jsx(Zn,{type:"secondary",children:"DevBuddy keeps your workspace local and your daily tools close."}),c.jsx(Oe,{type:"link",icon:c.jsx(Gl,{}),onClick:()=>z("settings"),children:"Workspace settings"})]})]})}const{Paragraph:Qw,Text:Vs,Title:J9}=xn,{TextArea:j0}=Ct,u1e="devbuddy.presentation-plan.v1",d1e="devbuddy.presentation-plans.v1",Q9="devbuddy-presentation-plan",Lh=()=>{var e,t;return((t=(e=globalThis.crypto)==null?void 0:e.randomUUID)==null?void 0:t.call(e))||`section-${Date.now()}-${Math.random().toString(16).slice(2)}`},Z9=e=>{if(!e)return"";const t=new Date(`${e}T00:00:00`);return Number.isNaN(t.getTime())?"":`Planned ${t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}`},f1e=e=>{const t=[`# ${e.title.trim()||"Untitled presentation"}`];e.subtitle.trim()&&t.push("",`> ${e.subtitle.trim()}`);const n=[];return e.presenter.trim()&&n.push(`**Presenter:** ${e.presenter.trim()}`),e.plannedDate&&n.push(`**Planned date:** ${e.plannedDate}`),n.length>0&&t.push("",...n),e.sections.forEach((r,a)=>{const o=String(a+1).padStart(2,"0"),s=e.showTimeBoxes?` · ${r.duration} min`:"";t.push("","---","",`## ${o}. ${r.title.trim()||`Section ${a+1}`}${s}`),r.summary.trim()&&t.push("",r.summary.trim())}),e.quickNotes.length>0&&(t.push("","---","","## Quick capture",""),[...e.quickNotes].sort((r,a)=>(r.createdAt||0)-(a.createdAt||0)).forEach(r=>{const a=r.sectionIndex===null?"Step not recorded":`Step ${String(r.sectionIndex+1).padStart(2,"0")} — ${r.sectionTitle||"Untitled section"}`,o=String(r.text||"").trim().replace(/\r?\n/g,`
548
+ ]`})})]})}),c.jsx(bn,{title:"App List Configurations",open:m,onCancel:()=>h(!1),footer:[c.jsx(Oe,{onClick:()=>h(!1),children:"Close"},"close")],width:950,children:c.jsx("div",{className:"branch-sync-modal-body",children:t.length===0?c.jsx(Xt,{description:"No apps configured."}):c.jsx(ar,{dataSource:t.map(se=>({...se,key:se.id})),pagination:!1,size:"small",columns:[{title:"Name",dataIndex:"name",key:"name",render:se=>c.jsx(Ca,{strong:!0,children:se})},{title:"Branches",key:"branches",render:(se,ae)=>c.jsxs(ct,{direction:"vertical",size:4,className:"branch-sync-branches-col",children:[c.jsxs("div",{className:"branch-sync-branch-line",children:[c.jsx(Ca,{type:"secondary",className:"branch-sync-branch-label",children:"Release:"}),c.jsx($t,{className:"branch-sync-branch-tag",children:ae.lastReleaseBranch})]}),c.jsxs("div",{className:"branch-sync-branch-line",children:[c.jsx(Ca,{type:"secondary",className:"branch-sync-branch-label",children:"Active:"}),c.jsx($t,{className:"branch-sync-branch-tag",children:ae.activeBranch})]})]})},{title:"Sub-Apps",key:"subAppsCount",render:(se,ae)=>c.jsx(sa,{count:ae.subApps?ae.subApps.length:0,showZero:!0,color:"#64748b"})},{title:"Action",key:"action",render:(se,ae)=>c.jsxs(ct,{size:8,children:[c.jsx(Oe,{size:"small",icon:c.jsx(Wo,{}),onClick:()=>ue(ae),children:"Edit"}),c.jsx(Gr,{title:"Delete this app config?",onConfirm:()=>ee(ae.id),okText:"Yes",cancelText:"No",children:c.jsx(Oe,{size:"small",danger:!0,icon:c.jsx(Fn,{}),children:"Delete"})})]})}]})})}),c.jsx(bn,{title:`Edit App Config: ${(p==null?void 0:p.name)||""}`,open:y,onOk:Z,onCancel:()=>{b(!1),v(null)},okText:"Save Changes",width:800,destroyOnClose:!0,children:c.jsxs(wt,{className:"branch-sync-modal-form",form:O,layout:"vertical",children:[c.jsx(wt.Item,{name:"name",label:"Name",rules:[{required:!0,message:"Please enter application name"}],children:c.jsx(Ct,{})}),c.jsx(wt.Item,{name:"repo",label:"Repository",rules:[{required:!0,message:"Please enter repository URL"}],children:c.jsx(Ct,{onChange:se=>W(se.target.value),onBlur:se=>G(se.target.value)})}),c.jsxs(Uo,{gutter:16,children:[c.jsx(qn,{span:12,children:c.jsx(wt.Item,{name:"activeBranch",label:"Active Branch",rules:[{required:!0,message:"Please select or enter active branch"}],children:c.jsx($n,{showSearch:!0,allowClear:!0,mode:"combobox",placeholder:"Select or enter active branch",loading:ne(V),options:te(V),onFocus:()=>G(V)})})}),c.jsx(qn,{span:12,children:c.jsx(wt.Item,{name:"lastReleaseBranch",label:"Last Release Branch",rules:[{required:!0,message:"Please select or enter last release branch"}],children:c.jsx($n,{showSearch:!0,allowClear:!0,mode:"combobox",placeholder:"Select or enter last release branch",loading:ne(V),options:te(V),onFocus:()=>G(V)})})})]}),c.jsx(wt.Item,{name:"subApps",label:"subApps (JSON Array)",extra:'JSON structure: [ { "name": "sub-app1", "repo": "bitbucket@abc.com/xxx.git", "branch": "custom-branch" } ]. If "branch" is omitted, inherits parent active branch.',children:c.jsx(Ct.TextArea,{rows:4})})]})}),c.jsxs(bn,{title:`Create Branch for ${(w==null?void 0:w.name)||"App"}`,open:C,onCancel:()=>{E.creating||(x(!1),$(null))},footer:[c.jsx(Oe,{disabled:E.creating,onClick:()=>{x(!1),$(null)},children:E.completed?"Close":"Cancel"},"cancel"),c.jsx(Oe,{type:"primary",icon:c.jsx(ou,{}),loading:E.creating,onClick:be,children:"Create Branch"},"submit")],width:850,destroyOnClose:!0,children:[c.jsx(wt,{className:"branch-sync-modal-form",form:I,layout:"vertical",children:c.jsxs(Uo,{gutter:16,children:[c.jsx(qn,{span:12,children:c.jsx(wt.Item,{name:"sourceBranch",label:"Source Branch",rules:[{required:!0,message:"Please select or enter source branch"}],children:c.jsx($n,{showSearch:!0,allowClear:!0,mode:"combobox",placeholder:"Select or enter source branch",loading:ne(w==null?void 0:w.repo),options:Array.from(new Map([...w!=null&&w.activeBranch?[{label:`Active Branch (${w.activeBranch})`,value:w.activeBranch}]:[],...w!=null&&w.lastReleaseBranch?[{label:`Last Release Branch (${w.lastReleaseBranch})`,value:w.lastReleaseBranch}]:[],...((he=q[(ze=w==null?void 0:w.repo)==null?void 0:ze.trim()])==null?void 0:he.options)||[],...zI].map(se=>[se.value,se])).values()),onFocus:()=>G(w==null?void 0:w.repo)})})}),c.jsx(qn,{span:12,children:c.jsx(wt.Item,{name:"targetBranch",label:"Target Branch Name",rules:[{required:!0,message:"Please enter target branch name"}],children:c.jsx(Ct,{placeholder:"e.g. feature/v1.2.0"})})})]})}),c.jsxs("div",{className:"branch-sync-create-preview",children:[c.jsxs(Ca,{strong:!0,className:"branch-sync-create-preview-title",children:["Target Repositories (",1+(((ce=w==null?void 0:w.subApps)==null?void 0:ce.length)||0),")"]}),E.results.length===0?c.jsx(It,{className:"branch-sync-preview-card",size:"small",children:c.jsxs("div",{className:"branch-sync-preview-repos",children:[c.jsxs("div",{children:[c.jsx($t,{color:"purple",children:"Parent App"})," ",c.jsx(Ca,{strong:!0,children:w==null?void 0:w.name})," (",w==null?void 0:w.repo,")"]}),((w==null?void 0:w.subApps)||[]).map((se,ae)=>c.jsxs("div",{className:"branch-sync-preview-subitem",children:[c.jsx($t,{className:"branch-sync-branch-tag",children:"Sub-App"})," ",c.jsx(Ca,{strong:!0,children:se.name||se.directory||""})," (",se.repo,")"]},ae))]})}):c.jsx(Ra,{className:"branch-sync-result-list",size:"small",bordered:!0,dataSource:E.results,renderItem:se=>c.jsxs(Ra.Item,{className:"branch-sync-result-item",children:[c.jsxs("div",{className:"branch-sync-result-row",children:[c.jsxs(ct,{size:8,children:[c.jsx($t,{color:se.isParent?"purple":"cyan",children:se.isParent?"Parent App":"Sub-App"}),c.jsx(Ca,{strong:!0,className:"branch-sync-result-name",children:se.name}),c.jsxs(Ca,{type:"secondary",className:"branch-sync-result-repo",children:["(",se.repo,")"]})]}),c.jsx("div",{children:se.status==="creating"?c.jsx($t,{icon:c.jsx(rr,{size:"small"}),color:"purple",children:"Creating..."}):se.success?c.jsx($t,{icon:c.jsx(gi,{}),color:"success",children:"Created"}):c.jsx($t,{icon:c.jsx(QR,{}),color:"error",children:"Failed"})})]}),se.error&&c.jsx(mr,{className:"branch-sync-result-error",type:"error",message:`Creation Error: ${se.error}`,showIcon:!0})]})})]})]})]})}const{Text:In,Paragraph:Bbe}=xn,Jw={safe:{color:"success",icon:c.jsx(gi,{}),label:"Safe to delete"},review:{color:"warning",icon:c.jsx(Ph,{}),label:"Review"},keep:{color:"default",icon:c.jsx(Wl,{}),label:"Keep"},blocked:{color:"error",icon:c.jsx(A9,{}),label:"Blocked"}};function Yv(e,t="Unknown"){if(!e)return t;const n=new Date(e);return Number.isNaN(n.getTime())?t:n.toLocaleString([],{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Hbe(e){if(!e)return{date:"Unknown",time:""};const t=new Date(e);return Number.isNaN(t.getTime())?{date:"Unknown",time:""}:{date:t.toLocaleDateString(),time:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}}function WC(e){return e==null?"Unknown":e===0?"Today":e===1?"1 day ago":`${e} days ago`}function qC(e){const t=Jw[e==null?void 0:e.status]||Jw.keep;return c.jsx($t,{color:t.color,icon:t.icon,children:t.label})}function Am({label:e,value:t,color:n}){return c.jsx(It,{className:"branch-health-stat-card",children:c.jsx(cl,{title:e,value:t,valueStyle:n?{color:n}:void 0})})}function Fbe(e){const t=new Map;return(e||[]).forEach(n=>{var o;const r=((o=n.repository)==null?void 0:o.name)||"Unknown repository",a=t.get(r)||{name:r,records:[]};a.records.push(n),t.set(r,a)}),[...t.values()]}function Vbe({open:e,loading:t,records:n,onClose:r}){const a=Fbe(n),[o,s]=l.useState(()=>new Set),u=f=>{s(m=>{const h=new Set(m);return h.has(f)?h.delete(f):h.add(f),h})};return c.jsx(bn,{className:"branch-health-history-modal",title:"Operation history",open:e,onCancel:r,footer:null,width:700,destroyOnClose:!0,children:t?c.jsx("div",{className:"branch-health-history-loading",children:c.jsx(rr,{})}):a.length===0?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No branches have been deleted from this page yet."}):c.jsx("div",{className:"branch-health-history-groups",children:a.map(f=>c.jsxs("section",{className:`branch-health-history-group${o.has(f.name)?" is-collapsed":""}`,children:[c.jsxs("button",{type:"button",className:"branch-health-history-group-header","aria-expanded":!o.has(f.name),onClick:()=>u(f.name),children:[c.jsxs("div",{className:"branch-health-history-repository-name",children:[c.jsx("span",{className:"branch-health-history-repository-icon",children:c.jsx(Fr,{})}),c.jsxs("div",{className:"branch-health-history-repository-copy",children:[c.jsx(In,{className:"branch-health-history-repository-label",children:"Repository"}),c.jsx(In,{strong:!0,ellipsis:{tooltip:f.name},children:f.name})]})]}),c.jsxs("span",{className:"branch-health-history-group-controls",children:[c.jsxs(In,{type:"secondary",className:"branch-health-history-count",children:[f.records.length," ",f.records.length===1?"operation":"operations"]}),c.jsx(Cu,{className:`branch-health-history-collapse-icon${o.has(f.name)?" is-collapsed":""}`})]})]}),!o.has(f.name)&&c.jsx(Ra,{size:"small",dataSource:f.records,renderItem:m=>c.jsx(Ra.Item,{children:c.jsxs("div",{className:"branch-health-history-record",children:[c.jsxs("div",{className:"branch-health-history-branch",children:[c.jsx(ou,{className:"branch-health-history-branch-icon"}),c.jsx(In,{code:!0,ellipsis:{tooltip:m.branch},children:m.branch})]}),c.jsxs(In,{type:"secondary",className:"branch-health-history-record-meta",children:[c.jsx("span",{className:"branch-health-history-action",children:"Deleted"}),c.jsx("span",{children:Yv(m.deletedAt)})]})]})})})]},f.name))})})}function Ube(){var fe,we,ke,Pe,Ie,Ve,Le,je,$e,Ae,We,De,Je,Ye,Ge,He,nt,ft,vt;const{message:e}=Pr.useApp(),[t,n]=l.useState(""),[r,a]=l.useState([]),[o,s]=l.useState(""),[u,f]=l.useState(null),[m,h]=l.useState(!1),[p,v]=l.useState(!1),[y,b]=l.useState(!1),[C,x]=l.useState(""),[w,$]=l.useState(!1),[E,R]=l.useState("all"),[N,O]=l.useState("all"),[I,j]=l.useState(void 0),[M,T]=l.useState(null),[z,P]=l.useState(!1),[B,H]=l.useState(null),[A,L]=l.useState(null),[F,U]=l.useState(!1),[q,_]=l.useState(!1),[K,X]=l.useState(""),[V,W]=l.useState(!1),[G,Y]=l.useState(!1),[te,ne]=l.useState(!1),[ue,Z]=l.useState([]),[ee,re]=l.useState(!1),oe=async(qe,Ee="")=>{var Be;if(qe){h(!0);try{const Xe=await Mm.repositories(qe),Qe=Xe.repositories||[];n(Xe.workspaceDir||qe),a(Qe);const Ze=Ee&&Qe.some(it=>it.path===Ee)?Ee:((Be=Qe[0])==null?void 0:Be.path)||"";s(Ze),j(void 0),f(null),Ze&&await de(Ze)}catch(Xe){a([]),s(""),f(null),e.error(Xe.message||"Unable to find Git repositories.")}finally{h(!1)}}},de=async(qe=o)=>{if(qe){v(!0);try{f(await Mm.scan(qe)),T(null)}catch(Ee){e.error(Ee.message||"Unable to scan branches.")}finally{v(!1)}}},be=async qe=>{var Ee;H(qe),L(null),X(""),U(!!qe.hasLocal),_(!1),P(!0),W(!0);try{const Be=await Mm.preflight(o,qe.name);L(Be),U(!!((Ee=Be.checks)!=null&&Ee.localDeletionAllowed)),_(!1)}catch(Be){e.error(Be.message||"Unable to check whether this branch can be deleted.")}finally{W(!1)}},J=(qe=!1)=>{G&&!qe||(P(!1),H(null),L(null))},ye=async()=>{if(!(!B||!o)){Y(!0);try{const qe=await Mm.remove(o,B.name,{deleteLocal:F,deleteRemote:q,confirmName:K});f(qe),T(null),J(!0),qe.success?e.success(`${B.name} deleted.`):e.warning("The branch was only partially deleted. Check the result details.")}catch(qe){e.error(qe.message||"Unable to delete branch."),qe!=null&&qe.checks&&L({checks:qe.checks,branch:qe.branch})}finally{Y(!1)}}},xe=async()=>{re(!0);try{const qe=await Mm.history();Z(qe.history||[])}catch(qe){e.error(qe.message||"Unable to load branch operation history.")}finally{re(!1)}},ze=()=>{ne(!0),xe()};l.useEffect(()=>{let qe=!0;return So.config().then(Ee=>{if(!(!qe||!Ee.workspaceDir))return n(Ee.workspaceDir),oe(Ee.workspaceDir)}).catch(()=>{}),()=>{qe=!1}},[]);const he=(u==null?void 0:u.branches)||[],ce=l.useMemo(()=>{const qe=new Map;return he.forEach(Ee=>{var Qe,Ze;const Be=String(((Qe=Ee.creator)==null?void 0:Qe.name)||((Ze=Ee.creator)==null?void 0:Ze.email)||"Unknown").trim()||"Unknown",Xe=Be.toLocaleLowerCase();qe.has(Xe)||qe.set(Xe,{value:Xe,label:Be})}),[...qe.values()].sort((Ee,Be)=>Ee.label.localeCompare(Be.label))},[he]),se=l.useMemo(()=>{if(!w||!C.trim())return null;try{return new RegExp(C.trim(),"i")}catch{return}},[C,w]),ae=l.useMemo(()=>{const qe=C.trim().toLowerCase();return w&&qe&&!se?[]:he.filter(Ee=>{var Qe,Ze,it,ut,pt;if(E!=="all"&&((Qe=Ee.health)==null?void 0:Qe.status)!==E||N==="merged"&&!Ee.merged||N==="unmerged"&&Ee.merged)return!1;const Be=String(((Ze=Ee.creator)==null?void 0:Ze.name)||((it=Ee.creator)==null?void 0:it.email)||"Unknown").trim().toLocaleLowerCase()||"unknown";if(I&&Be!==I)return!1;if(!qe)return!0;const Xe=[Ee.name,(ut=Ee.creator)==null?void 0:ut.name,(pt=Ee.lastCommit)==null?void 0:pt.subject,Ee.mergedInto].filter(Boolean).join(" ");return w?se.test(Xe):Xe.toLowerCase().includes(qe)})},[he,I,N,C,w,se,E]),ge=l.useMemo(()=>({all:he.length,safe:he.filter(qe=>{var Ee;return((Ee=qe.health)==null?void 0:Ee.status)==="safe"}).length,merged:he.filter(qe=>qe.merged).length,stale:he.filter(qe=>qe.ageDays>=90).length,blocked:he.filter(qe=>{var Ee;return((Ee=qe.health)==null?void 0:Ee.status)==="blocked"}).length}),[he]),Re=[{title:"Branch",dataIndex:"name",key:"name",width:230,sorter:(qe,Ee)=>qe.name.localeCompare(Ee.name),render:(qe,Ee)=>c.jsxs("div",{className:"branch-health-branch-cell",children:[c.jsxs(ct,{size:6,wrap:!0,children:[c.jsx(ou,{className:"branch-health-branch-icon"}),c.jsx(In,{strong:!0,ellipsis:{tooltip:qe},children:qe})]}),c.jsxs("div",{className:"branch-health-inline-meta",children:[c.jsx($t,{children:Ee.source}),Ee.current&&c.jsx($t,{color:"blue",children:"Current"}),Ee.protected&&c.jsx($t,{color:"red",children:"Protected"})]})]})},{title:"Health",key:"health",width:150,sorter:(qe,Ee)=>{var Be,Xe;return(((Be=Ee.health)==null?void 0:Be.score)||0)-(((Xe=qe.health)==null?void 0:Xe.score)||0)},defaultSortOrder:"descend",render:(qe,Ee)=>{var Be;return c.jsxs("div",{className:"branch-health-health-cell",children:[qC(Ee.health),c.jsxs(In,{type:"secondary",children:["Priority ",((Be=Ee.health)==null?void 0:Be.score)||0]})]})}},{title:"Created",key:"createdAt",width:190,sorter:(qe,Ee)=>(Date.parse(qe.createdAt||"")||0)-(Date.parse(Ee.createdAt||"")||0),render:(qe,Ee)=>{const Be=Hbe(Ee.createdAt);return c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx(In,{children:Be.date}),Be.time&&c.jsx(In,{children:Be.time}),c.jsx(In,{type:"secondary",children:Ee.createdAtSource})]})}},{title:"Creator",key:"creator",width:150,render:(qe,Ee)=>{var Be,Xe;return c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx(In,{ellipsis:{tooltip:((Be=Ee.creator)==null?void 0:Be.name)||"Unknown"},children:((Xe=Ee.creator)==null?void 0:Xe.name)||"Unknown"}),c.jsx(In,{type:"secondary",children:"First commit author"})]})}},{title:"Last commit",key:"lastCommit",width:290,sorter:(qe,Ee)=>{var Be,Xe;return(Date.parse(((Be=qe.lastCommit)==null?void 0:Be.committedAt)||"")||0)-(Date.parse(((Xe=Ee.lastCommit)==null?void 0:Xe.committedAt)||"")||0)},render:(qe,Ee)=>{var Be,Xe,Qe,Ze,it;return c.jsxs("div",{className:"branch-health-commit-cell",children:[c.jsx(In,{ellipsis:{tooltip:(Be=Ee.lastCommit)==null?void 0:Be.subject},children:((Xe=Ee.lastCommit)==null?void 0:Xe.subject)||"Unknown commit"}),c.jsxs(ct,{size:6,children:[c.jsx(In,{code:!0,children:(Qe=Ee.lastCommit)==null?void 0:Qe.shortHash}),c.jsx(In,{type:"secondary",children:WC(Ee.ageDays)})]}),c.jsxs(In,{type:"secondary",children:["by ",((it=(Ze=Ee.lastCommit)==null?void 0:Ze.author)==null?void 0:it.name)||"Unknown"]})]})}},{title:"Last merged into",key:"mergedInto",width:190,render:(qe,Ee)=>Ee.mergedInto?c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx($t,{color:"green",children:Ee.mergedInto}),c.jsx(In,{type:"secondary",children:Ee.mergeSource})]}):c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx(In,{type:"secondary",children:"Not found"}),c.jsx(In,{type:"secondary",children:"No containing local ref"})]})},{title:"Relation",key:"relation",width:130,render:(qe,Ee)=>c.jsxs("div",{className:"branch-health-date-cell",children:[c.jsx(In,{children:Ee.ahead==null?"Not analyzed":`${Ee.ahead} ahead`}),c.jsx(In,{children:Ee.behind==null?"Not analyzed":`${Ee.behind} behind`}),c.jsx(In,{type:"secondary",children:Ee.commitCount==null?"Not analyzed":`${Ee.commitCount} commits`})]})},{title:"Details",key:"details",fixed:"right",width:88,render:(qe,Ee)=>c.jsx(Oe,{type:"link",onClick:()=>T(Ee),children:"View"})}],_e=async qe=>{b(!1),n(qe),await oe(qe)},ie=async()=>{if(t)try{await Wn.openFolder(t)}catch(qe){e.error(qe.message||"Unable to open the workspace directory.")}};return c.jsxs("div",{className:"branch-health-page",children:[c.jsx(Ur,{title:"Branch Health",description:"Find stale or already merged branches before deciding what to clean up.",actions:c.jsxs(ct,{wrap:!0,children:[c.jsx(Oe,{icon:c.jsx(D9,{}),onClick:ze,children:"Operation history"}),c.jsx(Oe,{icon:c.jsx(Fr,{}),onClick:()=>b(!0),children:"Browse workspace"}),c.jsx(Oe,{icon:c.jsx(Xa,{}),onClick:()=>de(),loading:p,disabled:!o,children:"Refresh"})]})}),c.jsxs(It,{className:"branch-health-repository-card",children:[c.jsxs(ct,{size:"large",className:"branch-health-summary",children:[c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Workspace"}),c.jsxs("div",{className:"workspace-summary-path",children:[c.jsx(Oe,{type:"text",icon:c.jsx(Fr,{}),onClick:ie,disabled:!t,"aria-label":"Open workspace directory",title:"Open workspace directory"}),c.jsx(In,{ellipsis:{tooltip:t||"Not configured"},children:t||"Not configured"})]})]}),c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Repositories"}),c.jsx("div",{className:"summary-value",children:r.length})]})]}),c.jsx("div",{className:"branch-health-repository-row",children:c.jsxs("div",{className:"branch-health-repository-picker",children:[c.jsx(In,{type:"secondary",children:"Repository"}),c.jsx($n,{className:"branch-health-repository-select",showSearch:!0,value:o||void 0,placeholder:"Select a Git repository",loading:m,options:r.map(qe=>({label:qe.name,value:qe.path})),optionFilterProp:"label",onChange:qe=>{s(qe),j(void 0),de(qe)},notFoundContent:m?c.jsx(rr,{size:"small"}):"No Git repositories found"})]})})]}),u&&c.jsxs(c.Fragment,{children:[c.jsxs(Uo,{gutter:[12,12],className:"branch-health-stat-row",children:[c.jsx(qn,{xs:12,sm:8,lg:4,children:c.jsx(Am,{label:"All branches",value:ge.all})}),c.jsx(qn,{xs:12,sm:8,lg:5,children:c.jsx(Am,{label:"Recommended cleanup",value:ge.safe,color:"#389e0d"})}),c.jsx(qn,{xs:12,sm:8,lg:5,children:c.jsx(Am,{label:"Already merged",value:ge.merged,color:"#1677ff"})}),c.jsx(qn,{xs:12,sm:8,lg:5,children:c.jsx(Am,{label:"Stale > 90 days",value:ge.stale,color:"#d48806"})}),c.jsx(qn,{xs:12,sm:8,lg:5,children:c.jsx(Am,{label:"Protected / blocked",value:ge.blocked,color:"#cf1322"})})]}),c.jsxs(It,{className:"branch-health-table-card",children:[c.jsxs("div",{className:"branch-health-toolbar",children:[c.jsx(Ct,{allowClear:!0,prefix:c.jsx(jo,{}),placeholder:w?"Regex: e.g. ^feature/.*$":"Search branch, creator, commit...",value:C,status:w&&C.trim()&&!se?"error":void 0,onChange:qe=>x(qe.target.value)}),c.jsx(tr,{checked:w,onChange:qe=>$(qe.target.checked),children:"Regex"}),w&&C.trim()&&!se&&c.jsx(In,{type:"danger",children:"Invalid regular expression"}),c.jsx($n,{value:E,onChange:R,options:[{value:"all",label:"All health states"},...Object.entries(Jw).map(([qe,Ee])=>({value:qe,label:Ee.label}))]}),c.jsx($n,{value:N,onChange:O,options:[{value:"all",label:"All merge states"},{value:"merged",label:"Merged"},{value:"unmerged",label:"Not merged"}]}),c.jsx($n,{className:"branch-health-creator-filter",allowClear:!0,showSearch:!0,value:I,onChange:j,placeholder:"Filter by creator",options:ce,optionFilterProp:"label",filterOption:(qe,Ee)=>`${(Ee==null?void 0:Ee.label)||""} ${(Ee==null?void 0:Ee.value)||""}`.toLowerCase().includes(qe.toLowerCase())}),c.jsxs(In,{type:"secondary",className:"branch-health-result-count",children:[ae.length," shown"]})]}),c.jsx(ar,{rowKey:"id",size:"small",columns:Re,dataSource:ae,loading:p,pagination:{pageSize:20,showSizeChanger:!1,hideOnSinglePage:!0},scroll:{x:1440},locale:{emptyText:c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No branches match these filters."})}}),c.jsx("div",{className:"branch-health-mobile-list",children:ae.length?ae.map(qe=>{var Ee,Be,Xe,Qe,Ze;return c.jsxs(It,{size:"small",className:"branch-health-mobile-card",children:[c.jsxs("div",{className:"branch-health-mobile-card-header",children:[c.jsxs("div",{className:"branch-health-mobile-branch",children:[c.jsx(ou,{className:"branch-health-branch-icon"}),c.jsx(In,{strong:!0,ellipsis:{tooltip:qe.name},children:qe.name})]}),qC(qe.health)]}),c.jsxs("div",{className:"branch-health-mobile-source",children:[c.jsx($t,{children:qe.source}),qe.current&&c.jsx($t,{color:"blue",children:"Current"}),qe.protected&&c.jsx($t,{color:"red",children:"Protected"})]}),c.jsxs("div",{className:"branch-health-mobile-commit",children:[c.jsx(In,{ellipsis:{tooltip:(Ee=qe.lastCommit)==null?void 0:Ee.subject},children:((Be=qe.lastCommit)==null?void 0:Be.subject)||"Unknown commit"}),c.jsxs(ct,{size:6,children:[c.jsx(In,{code:!0,children:(Xe=qe.lastCommit)==null?void 0:Xe.shortHash}),c.jsx(In,{type:"secondary",children:WC(qe.ageDays)})]})]}),c.jsxs("div",{className:"branch-health-mobile-grid",children:[c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Created"}),c.jsx(In,{children:Yv(qe.createdAt)})]}),c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Creator"}),c.jsx(In,{ellipsis:{tooltip:(Qe=qe.creator)==null?void 0:Qe.name},children:((Ze=qe.creator)==null?void 0:Ze.name)||"Unknown"})]}),c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Merged into"}),c.jsx(In,{children:qe.mergedInto||"Not found"})]}),c.jsxs("div",{children:[c.jsx(In,{type:"secondary",children:"Relation"}),c.jsxs(In,{children:[qe.ahead," ahead"]}),c.jsxs(In,{children:[qe.behind," behind"]})]})]}),c.jsx(Oe,{block:!0,type:"link",onClick:()=>T(qe),children:"View details"})]},qe.id)}):c.jsx(Xt,{className:"branch-health-mobile-empty",image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No branches match these filters."})})]})]}),!u&&!m&&!p&&c.jsx(It,{className:"branch-health-empty-card",children:c.jsx(Xt,{description:r.length?"Select a repository to scan its branches.":"Select a workspace folder containing Git repositories.",children:c.jsx(Oe,{type:"primary",icon:c.jsx(Fr,{}),onClick:()=>b(!0),children:"Choose workspace"})})}),c.jsx(I$,{title:(M==null?void 0:M.name)||"Branch details",width:540,open:!!M,onClose:()=>T(null),children:M&&c.jsxs("div",{className:"branch-health-detail",children:[c.jsxs("div",{className:"branch-health-detail-status",children:[qC(M.health),c.jsxs(In,{type:"secondary",children:["Priority ",((fe=M.health)==null?void 0:fe.score)||0]})]}),c.jsx(Bbe,{type:"secondary",children:((we=M.reasons)==null?void 0:we.join(" · "))||"No additional recommendation details."}),c.jsxs(Lo,{column:1,size:"small",bordered:!0,children:[c.jsx(Lo.Item,{label:"Source",children:M.source}),c.jsxs(Lo.Item,{label:"Created",children:[Yv(M.createdAt)," (",M.createdAtSource,")"]}),c.jsxs(Lo.Item,{label:"Creator",children:[((ke=M.creator)==null?void 0:ke.name)||"Unknown"," ",c.jsxs(In,{type:"secondary",children:["(",((Pe=M.creator)==null?void 0:Pe.email)||"no email",")"]})]}),c.jsx(Lo.Item,{label:"Current branch",children:M.current?"Yes — deletion blocked":"No"}),c.jsx(Lo.Item,{label:"Protected pattern",children:M.protected?"Yes — deletion blocked":"No"}),c.jsxs(Lo.Item,{label:"Last commit",children:[(Ie=M.lastCommit)==null?void 0:Ie.shortHash," · ",(Ve=M.lastCommit)==null?void 0:Ve.subject]}),c.jsx(Lo.Item,{label:"Commit author",children:((je=(Le=M.lastCommit)==null?void 0:Le.author)==null?void 0:je.name)||"Unknown"}),c.jsxs(Lo.Item,{label:"Last updated",children:[Yv(($e=M.lastCommit)==null?void 0:$e.committedAt)," (",WC(M.ageDays),")"]}),c.jsx(Lo.Item,{label:"Last merged into",children:M.analysisSkipped?"Not analyzed":M.mergedInto||"Not found in local refs"}),c.jsx(Lo.Item,{label:"Merge evidence",children:M.mergeSource}),c.jsx(Lo.Item,{label:"Relation to default",children:M.analysisSkipped?"Not analyzed (last commit older than one year)":`${M.ahead} ahead · ${M.behind} behind`})]}),c.jsx(mr,{className:"branch-health-detail-alert",type:((Ae=M.health)==null?void 0:Ae.status)==="safe"?"success":"info",showIcon:!0,icon:c.jsx(J$,{}),message:"Deletion requires a fresh safety check",description:"Branch deletion will re-check merge state and checkout state on the server before changing any refs."}),c.jsxs("div",{className:"branch-health-detail-actions",children:[c.jsx(Oe,{danger:!0,disabled:((We=M.name)==null?void 0:We.toLowerCase())==="master",onClick:()=>be(M),children:"Delete branch"}),((De=M.name)==null?void 0:De.toLowerCase())==="master"&&c.jsx(In,{type:"secondary",children:"The master branch cannot be deleted."})]})]})}),c.jsx(bn,{title:`Delete ${(B==null?void 0:B.name)||"branch"}?`,open:z,onCancel:J,onOk:ye,okText:"Delete branch",okButtonProps:{danger:!0,disabled:V||!(A!=null&&A.canDelete)||!F&&!q||K!==(B==null?void 0:B.name)},confirmLoading:G,destroyOnClose:!0,children:V?c.jsx("div",{className:"branch-health-delete-loading",children:c.jsx(rr,{})}):A&&B?c.jsxs("div",{className:"branch-health-delete-dialog",children:[(Ye=(Je=A.checks)==null?void 0:Je.blockers)!=null&&Ye.length?c.jsx(mr,{type:"error",showIcon:!0,message:"Deletion blocked",description:A.checks.blockers.join(" ")}):c.jsx(mr,{type:((Ge=B.health)==null?void 0:Ge.status)==="safe"?"success":"warning",showIcon:!0,message:((He=B.health)==null?void 0:He.status)==="safe"?"This branch passed the safety check.":"This branch passed the hard safety checks, but review the evidence first.",description:`${B.mergedInto?`Merged into ${B.mergedInto}. `:""}${B.ahead} commits ahead of the default branch.`}),c.jsxs("div",{className:"branch-health-delete-targets",children:[c.jsx(In,{strong:!0,children:"Delete targets"}),c.jsx(tr,{checked:F,disabled:!((nt=A.checks)!=null&&nt.localDeletionAllowed),onChange:qe=>U(qe.target.checked),children:"Local branch"}),c.jsx(tr,{checked:q,disabled:!((ft=A.checks)!=null&&ft.remoteDeletionAllowed),onChange:qe=>_(qe.target.checked),children:"Remote origin branch"})]}),c.jsxs("div",{className:"branch-health-delete-confirm",children:[c.jsx(In,{strong:!0,children:"Type the exact branch name to confirm"}),c.jsx(Ct,{value:K,onChange:qe=>X(qe.target.value),placeholder:B.name,autoComplete:"off"})]}),((vt=A.results)==null?void 0:vt.length)>0&&c.jsx(mr,{type:"warning",showIcon:!0,message:"Previous attempt result",description:A.results.map(qe=>`${qe.target}: ${qe.success?"deleted":qe.error}`).join(" · ")})]}):c.jsx(Xt,{description:"Safety check unavailable."})}),c.jsx(Vbe,{open:te,loading:ee,records:ue,onClose:()=>ne(!1)}),c.jsx(df,{open:y,initialPath:t||"~",onCancel:()=>b(!1),onSelect:_e,title:"Choose workspace folder"})]})}const{Text:oo}=xn,KC={running:["processing","Running"],queued:["default","Queued"],success:["success","Success"],failed:["error","Failed"],completed:["success","Completed"]};function Wbe(e=[]){const t=new Map;return e.forEach(n=>{const r=typeof n=="string"?n:n.version,a=typeof n=="string"?"":n.publishedAt,[o="",s=""]=String(r).replace(/^v/,"").split(".");if(!o)return;t.has(o)||t.set(o,new Map);const u=t.get(o),f=`${o}.${s}`;u.has(f)||u.set(f,[]),u.get(f).push({label:c.jsxs("span",{className:"package-upgrade-version-option",children:[c.jsx("span",{children:r}),a&&c.jsx("span",{className:"package-upgrade-version-published",children:new Date(a).toLocaleDateString()})]}),value:r})}),[...t.entries()].map(([n,r])=>({label:`v${n}`,value:n,children:[...r.entries()].map(([a,o])=>({label:a,value:a,children:o}))}))}function qbe(){const{message:e}=Pr.useApp(),[t,n]=l.useState({workspaceDir:"",repos:[],tasks:[]}),[r,a]=l.useState(!1),[o,s]=l.useState(!1),[u,f]=l.useState(null),[m,h]=l.useState(!1),[p,v]=l.useState(null),[y]=wt.useForm(),[b]=wt.useForm(),[C,x]=l.useState([]),[w,$]=l.useState(!1),[E,R]=l.useState([]),[N,O]=l.useState(!1),[I,j]=l.useState([]),[M,T]=l.useState([]),[z,P]=l.useState(!1),B=async()=>{try{const W=await So.config();n(W),f(G=>G?W.tasks.find(Y=>Y.id===G.id)||G:null)}catch(W){e.error(W.message)}};l.useEffect(()=>{if(r||o||m)return;B();const W=setInterval(B,2500);return()=>clearInterval(W)},[r,o,m]),l.useEffect(()=>{if(!(u!=null&&u.id)||["completed","failed","success"].includes(u.status))return;let W=!0;const G=async()=>{try{const te=await So.config();if(!W)return;n(te);const ne=te.tasks.find(ue=>ue.id===u.id);ne&&f(ne)}catch{}};G();const Y=setInterval(G,1e3);return()=>{W=!1,clearInterval(Y)}},[u==null?void 0:u.id,u==null?void 0:u.status]);const H=l.useMemo(()=>[...new Set(t.tasks.map(W=>W.packageName).filter(Boolean))],[t.tasks]),A=wt.useWatch("packageName",y),L=wt.useWatch("version",y),F=wt.useWatch("repoIds",y)||[],U=F.length?C:H;l.useEffect(()=>{A&&L&&y.setFieldValue("commitMessage",`upgrade ${A} to ${L}`)},[A,L]),l.useEffect(()=>{if(!F.length){x([]);return}let W=!0;return $(!0),So.packageNames(F).then(G=>{W&&x(G)}).catch(()=>{W&&x([])}).finally(()=>{W&&$(!1)}),()=>{W=!1}},[F.join("|")]),l.useEffect(()=>{if(!F.length){T([]),y.setFieldValue("targetBranch","");return}let W=!0;return P(!0),So.branches(F).then(G=>{if(!W)return;T(G);const Y=y.getFieldValue("targetBranch");Y&&!G.some(te=>te.name===Y)&&y.setFieldValue("targetBranch","")}).catch(()=>{W&&T([])}).finally(()=>{W&&P(!1)}),()=>{W=!1}},[F.join("|")]),l.useEffect(()=>{const W=String(A||"").trim();if(!W){R([]);return}let G=!0;const Y=setTimeout(async()=>{O(!0);try{const te=await qc.versions(W);G&&R(te.filter(ne=>typeof ne=="string"?ne:ne.version))}catch{G&&R([])}finally{G&&O(!1)}},350);return()=>{G=!1,clearTimeout(Y)}},[A]);const q=async()=>{if(t.workspaceDir)try{await Wn.openFolder(t.workspaceDir)}catch(W){e.error(W.message)}},_=async W=>{try{await So.addRepo(W),b.resetFields(),h(!1),B()}catch(G){e.error(G.message)}},K=async W=>{v(W.id);try{await So.cloneRepo(W.id),e.success(`${W.name} cloned`),await B()}catch(G){e.error(G.message)}finally{v(null)}},X=async W=>{try{const G=await So.createTask(W);s(!1),y.resetFields(),f(G),await B(),e.success("Task started")}catch(G){e.error(G.message)}},V=[{title:"Repository",dataIndex:"name",render:(W,G)=>c.jsxs(ct,{direction:"vertical",size:0,children:[c.jsx(oo,{strong:!0,children:G.name}),c.jsx(oo,{type:"secondary",children:G.message||""})]})},{title:"Status",dataIndex:"status",render:W=>{const[G,Y]=KC[W]||["default",W];return c.jsx($t,{color:G,children:Y})}},{title:"PR",dataIndex:"prUrl",render:W=>W?c.jsx("a",{href:W,target:"_blank",rel:"noreferrer",children:"Open PR"}):"—"}];return c.jsxs("div",{className:"package-upgrade-page",children:[c.jsx(Ur,{title:"Package Upgrade",description:"Upgrade one package across multiple repositories and open Bitbucket pull requests.",actions:c.jsxs(ct,{children:[c.jsx(Oe,{icon:c.jsx(Gl,{}),onClick:()=>a(!0),children:"Repository list"}),c.jsx(Oe,{type:"primary",icon:c.jsx(Z$,{}),onClick:()=>s(!0),disabled:!t.repos.length,children:"Create task"})]})}),c.jsx(It,{className:"package-upgrade-summary",children:c.jsxs(ct,{size:"large",children:[c.jsxs("div",{children:[c.jsx(oo,{type:"secondary",children:"Workspace"}),c.jsxs("div",{className:"workspace-summary-path",children:[c.jsx(Oe,{type:"text",icon:c.jsx(Fr,{}),onClick:q,disabled:!t.workspaceDir,"aria-label":"Open workspace directory",title:"Open workspace directory"}),c.jsx(oo,{ellipsis:{tooltip:t.workspaceDir||"Not configured"},children:t.workspaceDir||"Not configured"})]})]}),c.jsxs("div",{children:[c.jsx(oo,{type:"secondary",children:"Repositories"}),c.jsx("div",{className:"summary-value",children:t.repos.length})]}),c.jsxs("div",{children:[c.jsx(oo,{type:"secondary",children:"Task history"}),c.jsx("div",{className:"summary-value",children:t.tasks.length})]})]})}),c.jsx(It,{title:"Operation history",className:"package-upgrade-card",children:t.tasks.length?c.jsx(Ra,{dataSource:t.tasks,renderItem:W=>{var G;return c.jsxs(Ra.Item,{children:[c.jsx(Ra.Item.Meta,{title:c.jsxs(ct,{children:[c.jsxs(oo,{strong:!0,children:[W.packageName," → ",W.version]}),c.jsx($t,{color:W.status==="failed"?"error":W.status==="running"?"processing":"success",children:W.status})]}),description:c.jsxs(oo,{type:"secondary",children:[W.sourceBranch," → ",W.targetBranch," · ",((G=W.repos)==null?void 0:G.length)||W.repoIds.length," repositories · ",new Date(W.createdAt).toLocaleString()]})}),c.jsx(Oe,{onClick:()=>f(W),children:"Details"})]})}}):c.jsx(oo,{type:"secondary",children:"No package upgrade tasks yet."})}),c.jsxs(bn,{title:"Repository list",open:r,onCancel:()=>a(!1),footer:null,width:760,children:[c.jsxs("div",{className:"package-upgrade-workspace-readonly",children:[c.jsxs("div",{children:[c.jsx(oo,{strong:!0,children:"Workspace directory"}),c.jsx(oo,{type:"secondary",children:"Read-only path used for local repositories"})]}),c.jsx(ct.Compact,{className:"directory-path-control directory-path-control-readonly package-upgrade-workspace-path-control",children:c.jsx(Ct,{value:t.workspaceDir||"",placeholder:"Not configured",readOnly:!0,prefix:c.jsx(Oe,{type:"text",icon:c.jsx(Fr,{}),onClick:q,disabled:!t.workspaceDir,"aria-label":"Open workspace directory",title:"Open workspace directory"})})})]}),c.jsxs("div",{className:"repo-list-header",children:[c.jsx(oo,{strong:!0,children:"Repository list"}),c.jsx(Oe,{size:"small",icon:c.jsx(Xn,{}),onClick:()=>h(!0),children:"Add repo"})]}),c.jsx(Ra,{className:"package-upgrade-repo-list",size:"small",dataSource:t.repos,renderItem:W=>c.jsxs(Ra.Item,{children:[c.jsx(Ra.Item.Meta,{title:c.jsxs(ct,{size:10,children:[c.jsx("span",{children:W.name}),c.jsx($t,{color:W.cloned?"success":"default",children:W.cloned?"Cloned":"Not cloned"})]}),description:W.url}),c.jsxs("div",{className:"package-upgrade-repo-actions",children:[c.jsx("span",{className:"package-upgrade-clone-slot",children:!W.cloned&&c.jsx(Oe,{type:"link",icon:c.jsx(Sge,{}),loading:p===W.id,onClick:()=>K(W),"aria-label":"Clone repository",title:"Clone repository"})}),c.jsx(Gr,{title:"Remove repository?",onConfirm:async()=>{await So.removeRepo(W.id),B()},children:c.jsx(Oe,{type:"text",danger:!0,icon:c.jsx(Fn,{}),"aria-label":"Delete repository",title:"Delete repository"})})]})]})})]}),c.jsx(bn,{title:"Add repository",open:m,onCancel:()=>h(!1),footer:null,children:c.jsxs(wt,{form:b,layout:"vertical",onFinish:_,children:[c.jsx(wt.Item,{name:"url",label:"Repository URL",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"ssh://git@bitbucket.example/scm/PROJ/repo.git"})}),c.jsx(wt.Item,{name:"name",label:"Display name",children:c.jsx(Ct,{placeholder:"Optional"})}),c.jsx(wt.Item,{name:"directory",label:"Local directory name",children:c.jsx(Ct,{placeholder:"Defaults to repository name"})}),c.jsx(Oe,{type:"primary",htmlType:"submit",children:"Add repo"})]})}),c.jsx(bn,{title:"Task details",open:!!u,onCancel:()=>f(null),footer:null,width:760,children:u&&(()=>{var ne,ue;const W=u.repos||[],G=W.filter(Z=>["success","failed"].includes(Z.status)).length,Y=W.length?Math.round(G/W.length*100):0,te=W.some(Z=>Z.status==="failed")||u.status==="failed";return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"package-upgrade-task-progress",children:c.jsxs(ct,{direction:"vertical",size:4,style:{width:"100%"},children:[c.jsxs(ct,{children:[c.jsxs(oo,{strong:!0,children:[u.packageName," → ",u.version]}),c.jsx($t,{color:((ne=KC[u.status])==null?void 0:ne[0])||"default",children:((ue=KC[u.status])==null?void 0:ue[1])||u.status})]}),c.jsxs(oo,{type:"secondary",children:[G," / ",W.length," repositories completed"]}),c.jsx(dp,{percent:Y,status:te?"exception":u.status==="completed"?"success":"active"})]})}),c.jsx(ar,{size:"small",rowKey:"repoId",pagination:!1,columns:V,dataSource:W})]})})()}),c.jsx(bn,{title:"Create package upgrade task",open:o,onCancel:()=>s(!1),onOk:()=>y.submit(),okText:"Confirm",cancelText:"Cancel",width:620,children:c.jsxs(wt,{form:y,layout:"vertical",onFinish:X,children:[c.jsxs("div",{className:"package-upgrade-form-row",children:[c.jsx(wt.Item,{name:"sourceBranch",label:"Work branch",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"upgrade/package-name"})}),c.jsx(wt.Item,{name:"targetBranch",label:"Target branch",rules:[{required:!0}],children:c.jsx(rf,{allowClear:!0,options:M.map(W=>({label:W.name,value:W.name})),filterOption:(W,G)=>{var Y;return(Y=G==null?void 0:G.value)==null?void 0:Y.toLowerCase().includes(W.toLowerCase())},loading:z,placeholder:F.length?"Select or enter a branch":"Select repositories first",notFoundContent:z?"Loading branches…":"No common branches found",disabled:!F.length})})]}),c.jsxs("div",{className:"package-upgrade-form-row",children:[c.jsx(wt.Item,{name:"packageName",label:"Package name",rules:[{required:!0}],children:c.jsx(rf,{allowClear:!0,options:U.map(W=>({label:W,value:W})),loading:w,placeholder:"@scope/package"})}),c.jsx(wt.Item,{name:"version",label:"Target version",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"1.2.3",onChange:()=>j([]),addonAfter:c.jsx(Jl,{className:"package-upgrade-version-cascader",popupClassName:"package-upgrade-version-picker",placement:"bottomRight",value:I,options:Wbe(E),loading:N,placeholder:"Select",expandTrigger:"hover",displayRender:()=>"Select",onChange:W=>{const G=W||[];j(G),y.setFieldValue("version",G.length?G[G.length-1]:"")}})})})]}),c.jsx(wt.Item,{name:"commitMessage",label:"Commit message",rules:[{required:!0}],children:c.jsx(Ct,{placeholder:"upgrade xxx to xxx"})}),c.jsx(wt.Item,{name:"repoIds",label:"Repositories",rules:[{required:!0,message:"Select at least one repository"}],children:c.jsx(tr.Group,{style:{width:"100%"},children:c.jsx(ct,{direction:"vertical",children:t.repos.map(W=>c.jsxs(tr,{value:W.id,children:[W.name," ",c.jsxs(oo,{type:"secondary",children:["(",W.cloned?"cloned":"clone on task start",")"]})]},W.id))})})})]})})]})}const{Text:xo}=xn,_I=["#7c5cff","#16a085","#e67e22","#d94f70","#1982c4","#7a9e2a","#c44536","#8e5ea2"];function Kbe(e,t){return _I[Math.max(0,t.indexOf(e))%_I.length]}function Gbe(){var j;const{message:e}=Pr.useApp(),[t,n]=l.useState(null),[r,a]=l.useState(!1),[o,s]=l.useState(""),[u,f]=l.useState(!0),[m,h]=l.useState(!1),[p,v]=l.useState([]),[y,b]=l.useState([]),[C,x]=l.useState(!1),[w,$]=l.useState(!1),E=async()=>{a(!0);try{const[M]=await Promise.all([So.dependencyScan(),new Promise(T=>setTimeout(T,500))]);n(M),e.success("Scan complete")}catch(M){n(null),e.error(M.message)}finally{a(!1)}},R=l.useMemo(()=>((t==null?void 0:t.packages)||[]).filter(M=>M.name.toLowerCase().includes(o.trim().toLowerCase())&&(!u||M.repositoryCount>1)),[t,o,u]),N=async()=>{if(t!=null&&t.workspaceDir)try{await Wn.openFolder(t.workspaceDir)}catch(M){e.error(M.message)}},O=async()=>{h(!0),x(!0);try{const M=await So.dependencyRepositories();v(M.repositories||[]),b((M.repositories||[]).filter(T=>T.selected).map(T=>T.directory))}catch(M){e.error(M.message)}finally{x(!1)}},I=async()=>{$(!0);try{await So.saveDependencyRepositories(y),h(!1),n(null),e.success("Repository settings saved")}catch(M){e.error(M.message)}finally{$(!1)}};return c.jsxs("div",{className:"package-versions-page",children:[c.jsx(Ur,{title:"Package Versions",description:"Scan every repository in the configured workspace and compare dependency versions at a glance. Matching versions share a color within each package.",actions:c.jsxs(ct,{children:[c.jsx(Oe,{icon:c.jsx(Gl,{}),onClick:O,children:"Repositories"}),c.jsx(Oe,{icon:c.jsx(Xa,{}),loading:r,onClick:E,children:t?"Scan again":"Scan"})]})}),r&&!t?c.jsxs("div",{className:"package-versions-loading",children:[c.jsx(rr,{size:"large"}),c.jsx(xo,{type:"secondary",children:"Scanning package.json files…"})]}):t?c.jsxs(c.Fragment,{children:[c.jsxs(It,{className:"package-versions-summary",children:[c.jsxs("div",{children:[c.jsx(xo,{type:"secondary",children:"Workspace"}),c.jsxs("div",{className:"package-versions-path",children:[c.jsx(Oe,{type:"text",icon:c.jsx(Fr,{}),onClick:N,"aria-label":"Open workspace directory"}),c.jsx(yn,{title:t.workspaceDir,children:c.jsx(xo,{ellipsis:!0,children:t.workspaceDir})})]})]}),c.jsxs("div",{children:[c.jsx(xo,{type:"secondary",children:"Repositories"}),c.jsx("div",{className:"package-versions-stat",children:t.repositories.length})]}),c.jsxs("div",{children:[c.jsx(xo,{type:"secondary",children:"Packages"}),c.jsx("div",{className:"package-versions-stat",children:t.packages.length})]}),c.jsxs("div",{children:[c.jsx(xo,{type:"secondary",children:"Shared packages"}),c.jsx("div",{className:"package-versions-stat",children:t.packages.filter(M=>M.repositoryCount>1).length})]})]}),((j=t.errors)==null?void 0:j.length)>0&&c.jsx(mr,{className:"package-versions-alert",type:"warning",showIcon:!0,message:`${t.errors.length} repository could not be read`,description:t.errors.map(M=>`${M.repository}: ${M.message}`).join(" · ")}),c.jsx(It,{className:"package-versions-card",title:c.jsxs("span",{children:["Dependency matrix ",c.jsxs(xo,{type:"secondary",children:["· ",R.length," shown"]})]}),extra:c.jsxs(ct,{children:[c.jsx(Ct,{allowClear:!0,prefix:c.jsx(jo,{}),placeholder:"Filter packages",value:o,onChange:M=>s(M.target.value)}),c.jsx(Ja,{checked:u,onChange:f,checkedChildren:"Shared",unCheckedChildren:"All"})]}),children:R.length?c.jsx(J0,{className:"package-versions-list",items:R.map(M=>{const T=M.versions.map(z=>z.version);return{key:M.name,label:c.jsxs("div",{className:"package-version-name",children:[c.jsx(xo,{strong:!0,children:M.name}),c.jsxs(xo,{type:"secondary",children:[M.repositoryCount," repos · ",M.versions.length," versions"]})]}),children:c.jsx("div",{className:"package-version-groups",children:M.versions.map(z=>c.jsxs("div",{className:"package-version-group",children:[c.jsx($t,{className:"package-version-tag",style:{"--version-color":Kbe(z.version,T)},children:z.version}),c.jsx("div",{className:"package-version-repos",children:z.repositories.map(P=>c.jsx(yn,{title:`${P.repository} · ${P.sections.join(", ")}`,children:c.jsx("span",{className:"package-version-repo",children:P.repository})},P.directory))})]},z.version))})}})}):c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:o?"No matching packages":u?"No package is shared by more than one repository":"No dependencies found"})}),c.jsxs(xo,{className:"package-versions-updated",type:"secondary",children:["Last scanned ",new Date(t.scannedAt).toLocaleString()]})]}):c.jsx(It,{children:c.jsx(Xt,{description:"Click Scan to inspect package versions in the configured workspace."})}),c.jsxs(bn,{title:"Repositories to scan",open:m,onCancel:()=>h(!1),onOk:I,okButtonProps:{disabled:!y.length},okText:"Save",confirmLoading:w,width:620,children:[c.jsx(xo,{type:"secondary",children:"Select which repositories in the workspace should be included in the next scan."}),c.jsxs("div",{className:"package-versions-repository-toolbar",children:[c.jsx(tr,{checked:p.length>0&&y.length===p.length,indeterminate:y.length>0&&y.length<p.length,onChange:M=>b(M.target.checked?p.map(T=>T.directory):[]),children:"Select all"}),c.jsxs(xo,{type:"secondary",children:[y.length," / ",p.length," selected"]})]}),C?c.jsx("div",{className:"package-versions-settings-loading",children:c.jsx(rr,{})}):c.jsx(tr.Group,{value:y,onChange:b,className:"package-versions-repository-options",children:c.jsx(Ra,{size:"small",dataSource:p,locale:{emptyText:"No repositories found in this workspace."},renderItem:M=>c.jsx(Ra.Item,{children:c.jsx(tr,{value:M.directory,children:c.jsxs(ct,{direction:"vertical",size:0,children:[c.jsx(xo,{children:M.name}),c.jsx(xo,{type:"secondary",children:M.directory})]})})})})})]})]})}const{Paragraph:Y9,Text:Zn,Title:Bd}=xn,Ybe=[{key:"launcher",label:"Service Launcher",description:"Start, stop, and inspect local project scripts.",icon:c.jsx(qo,{})},{key:"pr-review",label:"PR Review",description:"Turn pull request changes into a focused review.",icon:c.jsx(Ay,{})},{key:"todo-list",label:"To-Do",description:"Keep development tasks visible and moving.",icon:c.jsx(mu,{})},{key:"postman",label:"API Workspace",description:"Build, organize, and send HTTP requests.",icon:c.jsx(hu,{})},{key:"ports",label:"Port Diagnostic",description:"Find listeners and resolve local port conflicts.",icon:c.jsx(e4,{})},{key:"errors",label:"Error Logs",description:"Review recent launcher and application errors.",icon:c.jsx(uf,{})}],Id=e=>Array.isArray(e)?e:[],Xbe=e=>e instanceof Set?e:new Set(Array.isArray(e)?e:[]),Jbe=e=>e instanceof Map?[...e.entries()]:!e||typeof e!="object"?[]:Object.entries(e),Qbe=e=>e.reduce((t,[,n])=>t+Math.max(0,Number(n)||0),0),Zbe=(e,t)=>e.alias||e.name||e.folder||`Service ${t+1}`,e1e=e=>e.groupName||e.branch||e.folder||"Local service",Is=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,LI=e=>typeof e=="string"?e:(e==null?void 0:e.message)||"DevBuddy could not load service and runtime data.",t1e=[{key:"activity",title:"Recent activity",description:"Jira & Confluence mentions.",icon:c.jsx(uf,{}),route:"jira-filters"},{key:"jiraDueToday",title:"Jira due today",description:"Unresolved issues due today.",icon:c.jsx(mu,{}),route:"jira-filters"},{key:"assignedTodos",title:"Assigned to-dos",description:"Your open local tasks.",icon:c.jsx(mu,{}),route:"todo-list"},{key:"authoredPrs",title:"Your open PRs",description:"Created by you and not merged.",icon:c.jsx(hu,{}),route:"pr-review"}];let GC=null;const X9=e=>{if(!e)return"";const t=new Date(e);return Number.isNaN(t.getTime())?"":t.toLocaleDateString(void 0,{month:"short",day:"numeric"})},n1e=e=>r1e(e).filter(t=>!t.read).length,r1e=e=>{const t=(e==null?void 0:e.notifications)||{};return[...Array.isArray(t.jira)?t.jira:[],...Array.isArray(t.confluence)?t.confluence:[]]};function a1e({config:e,items:t,open:n,onClose:r,onNavigate:a}){const[o,s]=l.useState(""),[u,f]=l.useState("all"),m=l.useMemo(()=>{let C=t||[];if(u!=="all"&&(C=C.filter(x=>(x.sourceType||x.source||"").toLowerCase()===u.toLowerCase())),o.trim()){const x=o.trim().toLowerCase();C=C.filter(w=>{const $=String(w.title||w.summary||w.name||"").toLowerCase(),E=String(w.key||w.repository||"").toLowerCase(),R=String(w.author||"").toLowerCase(),N=String(w.activityType||w.status||"").toLowerCase();return $.includes(x)||E.includes(x)||R.includes(x)||N.includes(x)})}return C},[t,o,u]),h=(t||[]).some(C=>C.source==="Jira"||C.sourceType==="jira")&&(t||[]).some(C=>C.source==="Confluence"||C.sourceType==="confluence"),p=(t||[]).filter(C=>(C.sourceType||C.source)==="Jira"||(C.sourceType||C.source)==="jira").length,v=(t||[]).filter(C=>(C.sourceType||C.source)==="Confluence"||(C.sourceType||C.source)==="confluence").length,y=C=>{if(C!=null&&C.url&&/^https?:\/\//i.test(C.url)){window.open(C.url,"_blank","noopener,noreferrer");return}if(C!=null&&C.url&&C.url.startsWith("#/")){window.location.hash=C.url;return}e!=null&&e.route&&typeof a=="function"&&a(e.route)},b=C=>{const x=C.source||C.sourceType;return x==="Jira"||x==="jira"?c.jsx($t,{color:"blue",children:"Jira"}):x==="Confluence"||x==="confluence"?c.jsx($t,{color:"cyan",children:"Confluence"}):C.repository?c.jsx($t,{color:"purple",children:"PR"}):C.completed!==void 0?c.jsx($t,{color:"green",children:"To-Do"}):null};return c.jsxs(bn,{title:c.jsxs(ct,{size:8,children:[c.jsx("span",{className:"overview-insight-modal-icon",children:e==null?void 0:e.icon}),c.jsx("span",{children:e==null?void 0:e.title}),c.jsx(sa,{count:t.length,style:{backgroundColor:"var(--db-primary)"}})]}),open:n,onCancel:r,footer:null,width:880,className:"overview-insights-modal",children:[c.jsxs("div",{className:"overview-insights-modal-header",children:[c.jsx(Zn,{type:"secondary",children:e==null?void 0:e.description}),c.jsxs(ct,{size:12,className:"overview-insights-modal-filters",wrap:!0,children:[c.jsx(Ct,{placeholder:"Search items...",prefix:c.jsx(jo,{}),allowClear:!0,value:o,onChange:C=>s(C.target.value),style:{width:220}}),h&&c.jsxs(er.Group,{value:u,onChange:C=>f(C.target.value),size:"small",optionType:"button",buttonStyle:"solid",children:[c.jsxs(er.Button,{value:"all",children:["All (",t.length,")"]}),c.jsxs(er.Button,{value:"jira",children:["Jira (",p,")"]}),c.jsxs(er.Button,{value:"confluence",children:["Confluence (",v,")"]})]})]})]}),c.jsx("div",{className:"overview-insights-modal-list",children:m.length===0?c.jsx(Xt,{description:o?"No matching items found.":"No items.",image:Xt.PRESENTED_IMAGE_SIMPLE}):m.map((C,x)=>c.jsxs("div",{className:"overview-insights-modal-item",onClick:()=>y(C),children:[c.jsxs("div",{className:"overview-insights-modal-item-body",children:[c.jsxs("div",{className:"overview-insights-modal-item-top",children:[b(C),C.key&&c.jsx(Zn,{strong:!0,className:"overview-insights-modal-item-key",children:C.key}),c.jsx(Zn,{className:"overview-insights-modal-item-title",title:C.title||C.summary||C.name||C.branch,children:C.title||C.summary||C.name||C.branch})]}),c.jsxs("div",{className:"overview-insights-modal-item-meta",children:[C.author&&c.jsxs(Zn,{type:"secondary",className:"overview-insights-modal-item-author",title:`By ${C.author}`,children:["By ",C.author]}),C.activityType&&c.jsxs(Zn,{type:"secondary",className:"overview-insights-modal-item-meta-item",title:C.activityType,children:["· ",C.activityType]}),C.status&&c.jsx($t,{size:"small",children:C.status}),C.priority&&c.jsxs(Zn,{type:"secondary",className:"overview-insights-modal-item-meta-item",children:["· Priority: ",C.priority]}),C.repository&&c.jsxs(Zn,{type:"secondary",className:"overview-insights-modal-item-meta-item",title:C.repository,children:["· Repo: ",C.repository]})]})]}),c.jsx("div",{className:"overview-insights-modal-item-extra",children:c.jsx("span",{className:"overview-insights-modal-item-date",children:C.activityAt||C.updated||C.dueDate||C.date?new Date(C.activityAt||C.updated||C.dueDate||C.date).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):""})})]},C.id||C.key||`item-${x}`))})]})}function o1e({data:e,open:t,onClose:n,onRefresh:r}){var y;const[a,o]=l.useState(!1),[s,u]=l.useState(""),f=async()=>{o(!0);try{await r(),u("")}catch(b){u(b.message||"Unable to load notifications.")}finally{o(!1)}};l.useEffect(()=>{t&&f()},[t]);const m=(b,C)=>c.jsx("div",{className:"overview-notifications-list",children:b.length===0?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:`No ${C} notifications.`}):b.map((x,w)=>{const $=()=>{x.url&&/^https?:\/\//i.test(x.url)&&window.open(x.url,"_blank","noopener,noreferrer")};return c.jsxs("div",{className:`overview-notification-item${x.read?"":" is-unread"}${x.url?" is-link":""}`,role:x.url?"button":void 0,tabIndex:x.url?0:void 0,onClick:x.url?$:void 0,onKeyDown:x.url?E=>{(E.key==="Enter"||E.key===" ")&&$()}:void 0,children:[c.jsxs("div",{className:"overview-notification-item-main",children:[c.jsxs("div",{className:"overview-notification-item-title-row",children:[!x.read&&c.jsx(sa,{status:"processing"}),c.jsx(Zn,{strong:!0,children:x.title})]}),x.summary&&c.jsx(Zn,{type:"secondary",className:"overview-notification-item-summary",children:x.summary})]}),c.jsx(Zn,{type:"secondary",className:"overview-notification-item-date",children:X9(x.activityAt||x.updated)})]},x.id||`${C}-${w}`)})}),h=e.notifications||{},p=Array.isArray(h.jira)?h.jira:[],v=Array.isArray(h.confluence)?h.confluence:[];return c.jsxs(bn,{title:c.jsxs(ct,{children:[c.jsx(Kd,{}),c.jsx("span",{children:"Jira & Confluence Notifications"})]}),open:t,onCancel:n,footer:null,width:760,className:"overview-notifications-modal",children:[c.jsxs("div",{className:"overview-notifications-toolbar",children:[c.jsx(Zn,{type:"secondary",children:"View the latest notifications from your connected work systems."}),c.jsx(Oe,{icon:c.jsx(Xa,{}),loading:a,onClick:f,children:"Refresh"})]}),s&&c.jsx(mr,{type:"warning",showIcon:!0,message:s,className:"overview-notifications-alert"}),((y=e.errors)==null?void 0:y.length)>0&&c.jsx(mr,{type:"warning",showIcon:!0,message:"Some notifications could not be loaded",description:e.errors.join(" · "),className:"overview-notifications-alert"}),c.jsx(Qa,{items:[{key:"jira",label:`Jira (${p.length})`,children:m(p,"Jira")},{key:"confluence",label:`Confluence (${v.length})`,children:m(v,"Confluence")}]})]})}function i1e({onNavigate:e}){var I;const[t,n]=l.useState(()=>GC),[r,a]=l.useState(()=>!GC),[o,s]=l.useState(null),[u,f]=l.useState(null),[m,h]=l.useState(!1),[p,v]=l.useState({notifications:{jira:[],confluence:[]},errors:[]}),[y,b]=l.useState({jiraTokenConfigured:!1,bitbucketTokenConfigured:!1}),C=async()=>{const j=await Yw.notifications();return v(j),j},x=async()=>{try{const j=await Wn.status();b(j)}catch{b({jiraTokenConfigured:!1,bitbucketTokenConfigured:!1})}},w=async()=>{a(!0);try{const j=await Yw.get();GC=j,n(j),s(null)}catch(j){s(j.message||"Unable to load work insights.")}finally{a(!1)}};l.useEffect(()=>{w(),x()},[]);const $=(j,M)=>{if(j!=null&&j.url&&/^https?:\/\//i.test(j.url)){window.open(j.url,"_blank","noopener,noreferrer");return}if(j!=null&&j.url&&j.url.startsWith("#/")){window.location.hash=j.url;return}typeof e=="function"&&e(M)};if(r&&!t)return c.jsx(It,{className:"overview-panel overview-insights-card",children:c.jsx(La,{active:!0,title:{width:"30%"},paragraph:{rows:3}})});if(o&&!t)return c.jsx(It,{className:"overview-panel overview-insights-card",children:c.jsx(mr,{type:"warning",showIcon:!0,message:"Work insights unavailable",description:o,action:c.jsx(Oe,{size:"small",onClick:w,children:"Retry"})})});const E=n1e(p),R=j=>c.jsx(sa,{count:E,overflowCount:99,offset:[2,-2],children:c.jsx(Oe,{type:j,icon:c.jsx(Kd,{}),onClick:()=>h(!0),children:"Notifications"})}),N=!!(y.jiraTokenConfigured&&y.confluenceTokenConfigured);if(!(t!=null&&t.configured))return c.jsx(It,{className:"overview-panel overview-insights-card",children:c.jsxs("div",{className:"overview-section-header",children:[c.jsxs("div",{children:[c.jsx(Zn,{className:"overview-eyebrow",children:"WORK INSIGHTS"}),c.jsx(Bd,{level:3,className:"overview-section-title",children:"Connect your work systems"}),c.jsx(Zn,{type:"secondary",children:"Configure Jira and Bitbucket access tokens to see your daily work here."})]}),c.jsxs(ct,{children:[N&&R(),c.jsx(Oe,{type:"primary",onClick:()=>e==null?void 0:e("settings"),children:"Open Settings"})]})]})});const O=t.categories||{};return c.jsxs(It,{className:"overview-panel overview-insights-card",children:[c.jsxs("div",{className:"overview-section-header",children:[c.jsx("div",{children:c.jsx(Zn,{className:"overview-eyebrow",children:"WORK INSIGHTS"})}),c.jsxs("div",{className:"overview-insights-actions",children:[r&&c.jsx(rr,{size:"small","aria-label":"Refreshing work insights"}),N&&R("text"),c.jsx(Oe,{type:"text",onClick:w,children:"Refresh"})]})]}),o&&c.jsx(mr,{className:"overview-insights-warning",type:"warning",showIcon:!0,message:"Refresh failed; showing the last result",description:o}),((I=t.errors)==null?void 0:I.length)>0&&c.jsx(mr,{className:"overview-insights-warning",type:"warning",showIcon:!0,message:"Some work data could not be loaded",description:t.errors.join(" · ")}),c.jsx("div",{className:"overview-insights-grid",children:t1e.map(j=>{const M=Array.isArray(O[j.key])?O[j.key]:[];return c.jsxs("section",{className:`overview-insight-tile${M.length?" has-items":""}`,"aria-labelledby":`overview-insight-${j.key}`,children:[c.jsxs("div",{className:"overview-insight-heading",children:[c.jsx("span",{className:"overview-insight-icon","aria-hidden":"true",children:j.icon}),c.jsxs("div",{children:[c.jsx(Zn,{strong:!0,id:`overview-insight-${j.key}`,children:j.title}),c.jsx(Zn,{type:"secondary",children:j.description})]}),c.jsx(sa,{count:M.length,showZero:!0,overflowCount:99})]}),M.length===0?c.jsx(Zn,{type:"secondary",className:"overview-insight-empty",children:"Nothing needs attention."}):c.jsxs("div",{className:"overview-insight-items",children:[M.slice(0,3).map((T,z)=>c.jsxs("button",{type:"button",className:"overview-insight-item",onClick:()=>$(T,j.route),children:[c.jsxs("span",{className:"overview-insight-item-main",children:[c.jsx("span",{className:"overview-insight-item-title",title:T.title||T.summary||T.name||T.branch,children:T.title||T.summary||T.name||T.branch}),c.jsx("span",{className:"overview-insight-item-meta",title:T.key||T.repository||T.build||T.activityType||T.priority||T.summary||"",children:T.key||T.repository||T.build||T.activityType||T.priority||T.summary||""})]}),c.jsx("span",{className:"overview-insight-item-date",children:X9(T.dueDate||T.updated||T.activityAt||T.date)})]},T.id||T.key||`${j.key}-${z}`)),M.length>3&&c.jsxs(Oe,{type:"link",className:"overview-insight-more",onClick:()=>f({config:j,items:M}),children:["View all ",M.length]})]})]},j.key)})}),c.jsx(a1e,{config:u==null?void 0:u.config,items:(u==null?void 0:u.items)||[],open:!!u,onClose:()=>f(null),onNavigate:e}),c.jsx(o1e,{data:p,open:m,onClose:()=>h(!1),onRefresh:C})]})}function l1e(){const[e,t]=l.useState("");return l.useEffect(()=>{let n=!0;return Yw.version().then(({version:r})=>{n&&r&&r!=="0.2.15"&&t(r)}).catch(()=>{}),()=>{n=!1}},[]),e?c.jsx(mr,{showIcon:!0,type:"warning",message:"A newer UI version is available. Reload to update.",action:c.jsx(Oe,{size:"small",type:"primary",onClick:()=>window.location.reload(),children:"Reload"}),style:{marginBottom:16}}):null}function s1e(){return c.jsxs("div",{className:"overview-page",role:"status","aria-live":"polite","aria-busy":"true","aria-label":"Loading workspace overview",children:[c.jsxs("section",{className:"overview-hero",children:[c.jsxs("div",{className:"overview-hero-content",children:[c.jsx(Zn,{className:"overview-eyebrow",children:"LOADING WORKSPACE"}),c.jsx(Bd,{level:1,className:"overview-hero-title",children:"Getting your development workspace ready…"}),c.jsx(Y9,{type:"secondary",className:"overview-hero-copy overview-hero-description",children:"Checking services, runtime status, and recent errors."}),c.jsxs("div",{className:"overview-hero-actions",children:[c.jsx(La.Button,{active:!0,style:{width:176,height:42,borderRadius:10}}),c.jsx(La.Button,{active:!0,style:{width:196,height:42,borderRadius:10}})]})]}),c.jsx("div",{className:"overview-hero-mark","aria-hidden":"true",children:c.jsx(qo,{})})]}),c.jsx("section",{className:"overview-metrics","aria-hidden":"true",children:["services","running","errors","extensions"].map(e=>c.jsx(It,{className:"overview-metric-card",children:c.jsx(La,{active:!0,title:{width:"48%"},paragraph:{rows:1,width:"72%"}})},e))}),c.jsxs("div",{className:"overview-content-grid overview-grid","aria-hidden":"true",children:[c.jsx("section",{className:"overview-shortcuts-section",children:c.jsx(La,{active:!0,title:{width:"34%"},paragraph:{rows:4}})}),c.jsx(It,{className:"overview-panel overview-setup-card",children:c.jsx(La,{active:!0,title:{width:"46%"},paragraph:{rows:4}})})]}),c.jsx(It,{className:"overview-panel overview-health-card","aria-hidden":"true",children:c.jsx(La,{active:!0,title:{width:"24%"},paragraph:{rows:3}})})]})}function c1e({launchers:e=[],running:t=new Set,errorCounts:n={},errorLogs:r=[],plugins:a=[],staticPages:o=[],loading:s=!1,error:u=null,hasLoaded:f=!1,onRetry:m,onNavigate:h}){const p=Id(e),v=Id(a),y=Id(o),b=Xbe(t),C=Id(r),x=f||p.length>0;if(s&&!x)return c.jsx(s1e,{});if(u&&!x)return c.jsx("div",{className:"overview-page",role:"alert",children:c.jsx(It,{className:"overview-panel",children:c.jsx(ky,{status:"error",title:"Unable to load your workspace",subTitle:LI(u),extra:typeof m=="function"?c.jsx(Oe,{type:"primary",icon:c.jsx(qo,{}),onClick:m,children:"Retry"}):null})})});const w=Jbe(n),$=v.length+y.length,E=C.length,R=p.reduce((P,B)=>P+Id(B.scripts).length+Math.max(0,Number(B.packageScriptCount)||0),0),N=p.map((P,B)=>{const H=`${P.id}:`,A=[...b].filter(_=>String(_).startsWith(H)).length,L=Qbe(w.filter(([_])=>String(_).startsWith(H))),F=C.filter(_=>String(_.source||"").startsWith(`Launcher: ${P.alias||P.name||""}`)).length,U=Id(P.scripts).length+Math.max(0,Number(P.packageScriptCount)||0),q=L>0?{badge:"error",label:"Needs attention",priority:2}:A>0?{badge:"success",label:"Running",priority:1}:{badge:"default",label:"Idle",priority:0};return{service:P,name:Zbe(P,B),meta:e1e(P),activeCount:A,serviceErrors:Math.max(L,F),scriptCount:U,health:q,order:B}}).sort((P,B)=>B.health.priority-P.health.priority||P.order-B.order),O=N.filter(P=>P.activeCount>0).length,I=N.filter(P=>P.serviceErrors>0).length,j=[{key:"service",title:"Add your first service",description:"Connect a local project and choose the scripts you use most.",complete:p.length>0,action:"Add service",route:"launcher"},{key:"run",title:"Start a development script",description:"Launch a configured script and keep its status within reach.",complete:b.size>0,action:"Open Launcher",route:"launcher"},{key:"extend",title:"Personalize your workspace",description:"Add a plugin or static page for the tools your team already uses.",complete:$>0,action:"Open Settings",route:"settings"}],M=j.filter(P=>P.complete).length,T=N.slice(0,5),z=P=>{typeof h=="function"&&h(P)};return c.jsxs("div",{className:"overview-page",children:[u&&c.jsx(mr,{type:"warning",showIcon:!0,message:"Live service status may be out of date",description:LI(u),action:typeof m=="function"?c.jsx(Oe,{size:"small",loading:s,onClick:m,children:"Retry"}):null,className:"overview-data-warning"}),c.jsxs("section",{className:"overview-hero","aria-labelledby":"overview-title",children:[c.jsxs("div",{className:"overview-hero-content",children:[c.jsx(Zn,{className:"overview-eyebrow",children:"DEVBUDDY OVERVIEW"}),c.jsx(Bd,{id:"overview-title",level:1,className:"overview-hero-title",children:"Your development day, in one calm workspace."}),c.jsx(Y9,{type:"secondary",className:"overview-hero-copy overview-hero-description",children:"Start local services, spot issues, and jump into everyday tools without losing your flow."}),c.jsxs("div",{className:"overview-hero-actions",children:[c.jsx(Oe,{type:"primary",size:"large",icon:p.length>0?c.jsx(qo,{}):c.jsx(Xn,{}),onClick:()=>z("launcher"),children:p.length>0?"Open Launcher":"Add your first service"}),c.jsx(Oe,{size:"large",icon:c.jsx(Ay,{}),onClick:()=>z("pr-review"),children:"Review a pull request"})]})]}),c.jsx("div",{className:"overview-hero-mark","aria-hidden":"true",children:c.jsx(qo,{})})]}),c.jsxs("section",{className:"overview-metrics","aria-label":"Workspace status",children:[c.jsxs(It,{className:"overview-metric-card overview-metric-card-clickable",role:"button",tabIndex:0,"aria-label":`Open Launcher, ${p.length} services`,onClick:()=>h==null?void 0:h("launcher"),onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),h==null||h("launcher"))},children:[c.jsx("span",{className:"overview-metric-icon","aria-hidden":"true",children:c.jsx(Hpe,{})}),c.jsxs("div",{className:"overview-metric-content overview-metric-copy",children:[c.jsx(Zn,{className:"overview-metric-label",children:"Services"}),c.jsx("strong",{className:"overview-metric-value",children:p.length}),c.jsx(Zn,{type:"secondary",className:"overview-metric-note",children:Is(R,"configured script")})]})]}),c.jsxs(It,{className:`overview-metric-card overview-metric-card-clickable${b.size>0?" is-success":""}`,role:"button",tabIndex:0,"aria-label":`Open Launcher, ${b.size} running scripts`,onClick:()=>h==null?void 0:h("launcher?running=1"),onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),h==null||h("launcher?running=1"))},children:[c.jsx("span",{className:"overview-metric-icon","aria-hidden":"true",children:c.jsx(Kl,{})}),c.jsxs("div",{className:"overview-metric-content overview-metric-copy",children:[c.jsx(Zn,{className:"overview-metric-label",children:"Running"}),c.jsx("strong",{className:"overview-metric-value",children:b.size}),c.jsx(Zn,{type:"secondary",className:"overview-metric-note",children:Is(O,"active service")})]})]}),c.jsxs(It,{className:`overview-metric-card overview-metric-card-clickable${E>0?" is-danger":" is-neutral"}`,role:"button",tabIndex:0,"aria-label":`Open Error Logs, ${E} errors`,onClick:()=>h==null?void 0:h("errors"),onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),h==null||h("errors"))},children:[c.jsx("span",{className:"overview-metric-icon","aria-hidden":"true",children:c.jsx(uf,{})}),c.jsxs("div",{className:"overview-metric-content overview-metric-copy",children:[c.jsx(Zn,{className:"overview-metric-label",children:"Errors"}),c.jsx("strong",{className:"overview-metric-value",children:E}),c.jsx(Zn,{type:"secondary",className:"overview-metric-note",children:I>0?`Across ${Is(I,"service")}`:"No services need attention"})]})]}),c.jsxs(It,{className:"overview-metric-card",children:[c.jsx("span",{className:"overview-metric-icon","aria-hidden":"true",children:c.jsx(R9,{})}),c.jsxs("div",{className:"overview-metric-content overview-metric-copy",children:[c.jsx(Zn,{className:"overview-metric-label",children:"Extensions"}),c.jsx("strong",{className:"overview-metric-value",children:$}),c.jsxs(Zn,{type:"secondary",className:"overview-metric-note",children:[Is(v.length,"plugin")," · ",Is(y.length,"page")]})]})]})]}),c.jsx(l1e,{}),c.jsx(i1e,{onNavigate:z}),c.jsxs("div",{className:"overview-content-grid overview-grid",children:[c.jsxs("section",{className:"overview-shortcuts-section","aria-labelledby":"overview-shortcuts-title",children:[c.jsx("div",{className:"overview-section-header",children:c.jsxs("div",{children:[c.jsx(Bd,{level:3,id:"overview-shortcuts-title",className:"overview-section-title",children:"Jump back into your flow"}),c.jsx(Zn,{type:"secondary",className:"overview-section-description",children:"Your most-used developer tools, one click away."})]})}),c.jsx("div",{className:"overview-shortcuts overview-quick-grid",children:Ybe.map(P=>c.jsxs("button",{type:"button",className:"overview-shortcut overview-quick-card","aria-label":`${P.label}: ${P.description}`,onClick:()=>z(P.key),children:[c.jsx("span",{className:"overview-shortcut-icon overview-quick-card-icon","aria-hidden":"true",children:P.icon}),c.jsxs("span",{className:"overview-shortcut-copy overview-quick-card-copy",children:[c.jsx("span",{className:"overview-shortcut-title overview-quick-card-title",children:P.label}),c.jsx("span",{className:"overview-shortcut-description overview-quick-card-description",children:P.description})]}),c.jsx(Qc,{className:"overview-shortcut-arrow","aria-hidden":"true"})]},P.key))})]}),c.jsx(It,{className:"overview-panel overview-setup-card",children:c.jsxs("section",{className:"overview-setup","aria-labelledby":"overview-setup-title",children:[c.jsxs("div",{className:"overview-section-header",children:[c.jsxs("div",{children:[c.jsx(Zn,{className:"overview-eyebrow",children:"GET STARTED"}),c.jsx(Bd,{level:3,id:"overview-setup-title",className:"overview-section-title",children:"Set up your workspace"})]}),c.jsxs(Zn,{type:"secondary",className:"overview-setup-progress",children:[M," of ",j.length]})]}),c.jsx("ol",{className:"overview-setup-list overview-checklist",children:j.map((P,B)=>c.jsxs("li",{className:`overview-setup-step overview-checklist-item${P.complete?" is-complete":""}`,children:[c.jsx("span",{className:"overview-setup-step-marker overview-checklist-marker","aria-hidden":"true",children:P.complete?c.jsx(Hi,{}):B+1}),c.jsxs("div",{className:"overview-setup-step-copy overview-checklist-copy",children:[c.jsx(Zn,{strong:!0,className:"overview-setup-step-title overview-checklist-title",children:P.title}),c.jsx(Zn,{type:"secondary",className:"overview-setup-step-description overview-checklist-description",children:P.description}),!P.complete&&c.jsx(Oe,{type:"link",className:"overview-setup-step-action",onClick:()=>z(P.route),children:P.action})]})]},P.key))})]})})]}),c.jsx(It,{className:"overview-panel overview-health-card",children:c.jsxs("section",{className:"overview-health","aria-labelledby":"overview-health-title",children:[c.jsxs("div",{className:"overview-section-header",children:[c.jsxs("div",{children:[c.jsx(Bd,{level:3,id:"overview-health-title",className:"overview-section-title",children:"Service health"}),c.jsx(Zn,{type:"secondary",className:"overview-section-description",children:"Running scripts and recent errors across your local projects."})]}),p.length>0&&c.jsxs(Oe,{type:"text",className:"overview-section-link",onClick:()=>z("launcher"),children:["View all services ",c.jsx(Qc,{})]})]}),T.length===0?c.jsx(Xt,{className:"overview-empty",image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No services configured yet",children:c.jsx(Oe,{type:"primary",icon:c.jsx(Xn,{}),onClick:()=>z("launcher"),children:"Add your first service"})}):c.jsx("div",{className:"overview-service-list",children:T.map(P=>c.jsxs("button",{type:"button",className:`overview-service-row ${P.health.badge==="error"?"is-error":P.health.badge==="success"?"is-running":"is-idle"}`,"aria-label":`${P.name}: ${P.health.label}, ${Is(P.activeCount,"script")} running, ${Is(P.serviceErrors,"error")}`,onClick:()=>z(`launcher?service=${encodeURIComponent(P.service.id)}`),children:[c.jsxs("span",{className:"overview-service-primary",children:[c.jsxs("span",{className:"overview-service-name-line",children:[c.jsx("span",{className:"overview-service-name",children:P.name}),c.jsx(sa,{status:P.health.badge,text:P.health.label})]}),c.jsx("span",{className:"overview-service-meta overview-service-detail",children:P.meta})]}),c.jsxs("span",{className:"overview-service-stats",children:[c.jsxs("span",{className:"overview-service-stat",children:[c.jsx(Kl,{"aria-hidden":"true"}),P.activeCount," / ",P.scriptCount," running"]}),c.jsxs("span",{className:`overview-service-stat${P.serviceErrors>0?" has-errors":""}`,children:[c.jsx(uf,{"aria-hidden":"true"}),Is(P.serviceErrors,"error")]}),c.jsx(Qc,{className:"overview-service-arrow","aria-hidden":"true"})]})]},P.service.id))}),N.length>T.length&&c.jsxs(Oe,{type:"text",className:"overview-more-services",onClick:()=>z("launcher"),children:["View ",N.length-T.length," more services",c.jsx(Qc,{})]})]})}),c.jsxs("footer",{className:"overview-footer",children:[c.jsx(kf,{"aria-hidden":"true"}),c.jsx(Zn,{type:"secondary",children:"DevBuddy keeps your workspace local and your daily tools close."}),c.jsx(Oe,{type:"link",icon:c.jsx(Gl,{}),onClick:()=>z("settings"),children:"Workspace settings"})]})]})}const{Paragraph:Qw,Text:Vs,Title:J9}=xn,{TextArea:j0}=Ct,u1e="devbuddy.presentation-plan.v1",d1e="devbuddy.presentation-plans.v1",Q9="devbuddy-presentation-plan",Lh=()=>{var e,t;return((t=(e=globalThis.crypto)==null?void 0:e.randomUUID)==null?void 0:t.call(e))||`section-${Date.now()}-${Math.random().toString(16).slice(2)}`},Z9=e=>{if(!e)return"";const t=new Date(`${e}T00:00:00`);return Number.isNaN(t.getTime())?"":`Planned ${t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}`},f1e=e=>{const t=[`# ${e.title.trim()||"Untitled presentation"}`];e.subtitle.trim()&&t.push("",`> ${e.subtitle.trim()}`);const n=[];return e.presenter.trim()&&n.push(`**Presenter:** ${e.presenter.trim()}`),e.plannedDate&&n.push(`**Planned date:** ${e.plannedDate}`),n.length>0&&t.push("",...n),e.sections.forEach((r,a)=>{const o=String(a+1).padStart(2,"0"),s=e.showTimeBoxes?` · ${r.duration} min`:"";t.push("","---","",`## ${o}. ${r.title.trim()||`Section ${a+1}`}${s}`),r.summary.trim()&&t.push("",r.summary.trim())}),e.quickNotes.length>0&&(t.push("","---","","## Quick capture",""),[...e.quickNotes].sort((r,a)=>(r.createdAt||0)-(a.createdAt||0)).forEach(r=>{const a=r.sectionIndex===null?"Step not recorded":`Step ${String(r.sectionIndex+1).padStart(2,"0")} — ${r.sectionTitle||"Untitled section"}`,o=String(r.text||"").trim().replace(/\r?\n/g,`
549
549
  `);t.push(`- **${a}:** ${o}`)})),`${t.join(`
550
550
  `).trim()}
551
551
  `},m1e=(e,t)=>{var b;const n=String(e||"").replace(/^\uFEFF/,"").replace(/\r\n?/g,`
@@ -618,6 +618,6 @@ ${m.join(`
618
618
 
619
619
  `:"",ke=`${fe}${he}${we}`,Pe=`${_e}${ke}${ie}`;s(je=>({...je,content:Pe}));const Ie=ge+ke.length;F.current={start:Ie,end:Ie},requestAnimationFrame(()=>{var $e,Ae;const je=(Ae=($e=A.current)==null?void 0:$e.resizableTextArea)==null?void 0:Ae.textArea;je==null||je.focus(),je==null||je.setSelectionRange(Ie,Ie)})},oe=async he=>{var se;if(!((se=he==null?void 0:he.type)!=null&&se.startsWith("image/")))return;if(he.size>10*1024*1024){e.error("Images must be 10 MB or smaller.");return}const ce="memo-image-upload";e.loading({content:"Uploading image…",key:ce,duration:0});try{const ae=await createImageBitmap(he),ge=await Al.uploadImage(he),Re=(he.name||"Image").replace(/\.[^.]+$/,"").replace(/[\[\]\r\n]/g," ").trim()||"Image";re(Mk(Re,ge.url,{width:ae.width,height:ae.height})),ae.close(),w&&_(),e.success({content:"Image inserted",key:ce})}catch(ae){e.error({content:ae.message,key:ce})}},de=async he=>{var ce;if((ce=he==null?void 0:he.type)!=null&&ce.startsWith("image/")){if(he.size>10*1024*1024){e.error("Images must be 10 MB or smaller.");return}j(!0);try{await Al.uploadImage(he),await _(!1),e.success("Image uploaded")}catch(se){e.error(se.message)}finally{j(!1)}}},be=he=>{const[ce]=he.target.files||[];he.target.value="",oe(ce)},J=he=>{var se;const ce=[...((se=he.clipboardData)==null?void 0:se.files)||[]].find(ae=>{var ge;return(ge=ae.type)==null?void 0:ge.startsWith("image/")});ce&&(he.preventDefault(),oe(ce))},ye=async he=>{try{await navigator.clipboard.writeText(Mk(he.filename,he.url,M[he.filename])),e.success("Image Markdown copied")}catch(ce){e.error(ce.message||"Could not copy image Markdown.")}},xe=async he=>{P(he.filename);try{await Al.removeImage(he.filename),R(ce=>ce.filter(se=>se.filename!==he.filename)),T(ce=>{const se={...ce};return delete se[he.filename],se}),e.success("Deleted successfully")}catch(ce){e.error(ce.message)}finally{P("")}};l.useEffect(()=>{if(p!=="edit")return;const he=setInterval(()=>{Fm(o)!==U.current&&te(!0)},3e3);return()=>clearInterval(he)},[p,o,r]);async function ze(){if(r){if(r===Ms){n(he=>he.filter(ce=>ce.id!==Ms)),Y();return}try{await Al.remove(r);const he=t.filter(ce=>ce.id!==r);n(he),he[0]?G(he[0]):Y(),e.success("Memo deleted")}catch(he){e.error(he.message)}}}return y?c.jsx("div",{className:"memos-loading",children:c.jsx(rr,{})}):c.jsxs("div",{className:"memos-page",children:[c.jsx(Ur,{actions:c.jsx(Oe,{icon:c.jsx(Uv,{}),onClick:K,children:"Image library"}),description:"Capture ideas and keep your thinking light.",eyebrow:"PERSONAL KNOWLEDGE",title:"Memos"}),c.jsxs("div",{className:"memos-shell",children:[c.jsxs("aside",{className:"memos-list-panel",children:[c.jsxs("div",{className:"memos-list-title",children:[c.jsxs("span",{children:["All notes ",c.jsx("b",{children:t.length})]}),c.jsx(Oe,{type:"text",icon:c.jsx(Xn,{}),onClick:Y})]}),c.jsx(Ct,{allowClear:!0,prefix:c.jsx(jo,{}),placeholder:"Search memos...",value:u,onChange:he=>f(he.target.value)}),c.jsxs("div",{className:"memo-tags",children:[c.jsx("button",{className:m==="all"?"active":"",onClick:()=>h("all"),children:"All notes"}),V.map(he=>c.jsxs("button",{className:m===he?"active":"",onClick:()=>h(he),children:["#",he]},he))]}),c.jsx("div",{className:"memo-items",children:W.length?W.map(he=>c.jsxs("button",{className:`memo-item ${he.id===r?"selected":""}`,onClick:()=>G(he),children:[c.jsx("strong",{children:he.title||"Untitled memo"}),c.jsx("span",{children:o4e(he.content)||"No content yet"}),c.jsx("small",{children:m2(he.updatedAt)})]},he.id)):c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No memos found"})})]}),c.jsxs("main",{className:"memo-editor-panel",children:[c.jsxs("div",{className:"memo-toolbar",children:[c.jsx(sp,{className:"memo-mode","aria-label":"Memo view mode",value:p,onChange:v,options:[{value:"edit",label:c.jsx(Wo,{"aria-label":"Edit"})},{value:"preview",label:c.jsx(Ef,{"aria-label":"Preview"})},{value:"split",label:c.jsx("span",{"aria-label":"Split",children:"↔"})}]}),c.jsxs("div",{className:"memo-toolbar-actions",children:[c.jsx("input",{ref:L,className:"memo-image-input",type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",onChange:be}),p!=="preview"&&c.jsx(yn,{title:"Insert image",children:c.jsx(Oe,{"aria-label":"Insert image",type:"text",icon:c.jsx(Uv,{}),onClick:()=>{var he;return(he=L.current)==null?void 0:he.click()}})}),c.jsx(yn,{title:"Open reading view in a new window",children:c.jsx(Oe,{"aria-label":"Open reading view in a new window",type:"text",icon:c.jsx(C0e,{}),disabled:!r,onClick:ne})}),c.jsx(Gr,{title:"Delete this memo?",onConfirm:ze,disabled:!r,children:c.jsx(Oe,{danger:!0,type:"text",icon:c.jsx(Fn,{}),disabled:!r})}),c.jsxs(Oe,{type:"primary",icon:c.jsx(Q$,{}),loading:C,onClick:te,children:["Save ",c.jsx("span",{className:"save-hint",children:"⌘S"})]})]})]}),c.jsxs("div",{className:`memo-workspace view-${p}`,children:[c.jsxs("section",{className:"memo-edit",children:[c.jsx(Ct,{ref:H,className:"memo-title-input",bordered:!1,placeholder:"Memo title",value:o.title,onChange:he=>s({...o,title:he.target.value})}),c.jsx(Ct.TextArea,{ref:A,className:"memo-content-input",bordered:!1,placeholder:"Start writing in Markdown...",value:o.content,onChange:he=>s({...o,content:he.target.value}),onKeyDown:ee,onSelect:ue,onClick:ue,onKeyUp:ue,onPaste:J,autoSize:{minRows:18}})]}),c.jsx("section",{className:"memo-preview",children:c.jsx(aA,{title:o.title,content:o.content,onCopyCode:Z})})]}),c.jsxs("div",{className:"memo-footer",children:[c.jsx("span",{children:"Markdown supported · Paste or insert images"}),c.jsxs("span",{children:[o.content.length," characters"]}),c.jsx($n,{className:"memo-footer-tags",mode:"tags",bordered:!1,open:!1,suffixIcon:null,prefix:"#",placeholder:"Add tags",tokenSeparators:[","],value:o.tags||[],onChange:he=>s({...o,tags:he.map(ce=>ce.trim().toLowerCase()).filter(Boolean)})})]})]}),c.jsx(bn,{className:"memo-image-library-modal",title:c.jsxs(ct,{size:8,children:[c.jsx(Uv,{}),c.jsx("span",{children:"Uploaded images"}),c.jsx($t,{children:E.length}),c.jsx(hp,{accept:"image/png,image/jpeg,image/gif,image/webp",beforeUpload:he=>(de(he),!1),showUploadList:!1,children:c.jsx(Oe,{size:"small",icon:c.jsx(S0,{}),loading:I,children:"Upload image"})})]}),open:w,onCancel:()=>$(!1),footer:null,width:780,children:N?c.jsx("div",{className:"memo-image-library-loading",children:c.jsx(rr,{})}):E.length?c.jsx("div",{className:"memo-image-grid",children:E.map(he=>{const ce=M[he.filename];return c.jsxs("div",{className:"memo-image-card",children:[c.jsx(P$,{src:he.url,alt:he.filename,preview:{mask:c.jsx("span",{children:"Preview"})}}),c.jsxs("div",{className:"memo-image-card-copy",children:[c.jsx(xn.Text,{ellipsis:{tooltip:he.filename},title:he.filename,children:he.filename}),c.jsxs(xn.Text,{type:"secondary",children:[l4e(he.size)," · ",m2(he.updatedAt)]}),c.jsxs("div",{className:"memo-image-card-usage",children:[ce&&c.jsxs(xn.Text,{type:"secondary",children:[ce.width," × ",ce.height," px"]}),c.jsx(xn.Text,{type:"secondary",children:he.usedBy.length?`Used in ${he.usedBy.length} memo${he.usedBy.length>1?"s":""}`:"Not used"})]}),c.jsxs(ct,{size:4,children:[c.jsx(Oe,{size:"small",type:"text",icon:c.jsx(fo,{}),onClick:()=>ye(he),children:"Copy Markdown"}),c.jsx(Gr,{title:"Delete this image?",description:he.usedBy.length?"This image is still used by a memo.":void 0,disabled:!!he.usedBy.length||z===he.filename,onConfirm:()=>xe(he),children:c.jsx(Oe,{size:"small",type:"text",danger:!0,icon:c.jsx(Fn,{}),disabled:!!he.usedBy.length,loading:z===he.filename,children:"Delete"})})]})]})]},he.filename)})}):c.jsx(Xt,{description:"No uploaded images yet"})})]})]})}const{Text:Md,Title:h4e}=xn,oA=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],iA=[1,2,3,4,5,6,0],p4e=[{value:"once",label:"One-time reminder"},{value:"daily",label:"Every day"},{value:"weekdays",label:"Weekdays"},{value:"weekly",label:"Every week"}],Tk=()=>({title:"",content:"",scheduleType:"once",scheduledAt:dr().add(1,"hour").startOf("hour"),time:dr().hour(9).minute(0),weekday:1,enabled:!0});function lA(e){return e?new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date(e)):"—"}function g4e(e){return e.scheduleType==="once"?`One-time · ${lA(e.scheduledAt)}`:e.scheduleType==="daily"?`Every day · ${e.time}`:e.scheduleType==="weekdays"?`Weekdays · ${e.time}`:`Every ${oA[iA.indexOf(e.weekday)]||"week"} · ${e.time}`}function v4e(e){return{title:e.title,content:e.content,scheduleType:e.scheduleType,scheduledAt:e.scheduledAt?dr(e.scheduledAt):dr().add(1,"hour").startOf("hour"),time:e.time?dr(`2000-01-01T${e.time}`):dr().hour(9).minute(0),weekday:e.weekday??1,enabled:e.enabled}}function y4e(){const{message:e}=Pr.useApp(),[t,n]=l.useState([]),[r,a]=l.useState(Tk),[o,s]=l.useState(null),[u,f]=l.useState(!0),[m,h]=l.useState(!1),[p,v]=l.useState(()=>"Notification"in window?Notification.permission:"unsupported"),y=l.useCallback(async(N=!0)=>{N&&f(!0);try{n(await Td.list())}catch(O){e.error(O.message)}finally{N&&f(!1)}},[e]);l.useEffect(()=>{y()},[y]);const b=async()=>{if(!("Notification"in window)){e.warning("This browser does not support desktop notifications.");return}const N=await Notification.requestPermission();v(N),N==="granted"?e.success("Desktop notifications enabled"):N==="denied"&&e.warning("Notification permission was denied. Re-enable it in your browser settings.")},C=l.useMemo(()=>({total:t.length,active:t.filter(N=>N.enabled).length,repeating:t.filter(N=>N.scheduleType!=="once").length}),[t]),x=()=>{s(null),a(Tk())},w=async()=>{if(!r.title.trim()){e.warning("Enter a reminder title");return}if(!r.content.trim()){e.warning("Enter notification content");return}if(r.scheduleType==="once"&&(!r.scheduledAt||!r.scheduledAt.isValid())){e.warning("Choose a reminder date and time");return}if(r.scheduleType!=="once"&&(!r.time||!r.time.isValid())){e.warning("Choose a reminder time");return}p==="default"&&await b(),h(!0);try{const N={title:r.title,content:r.content,scheduleType:r.scheduleType,scheduledAt:r.scheduleType==="once"?r.scheduledAt.toISOString():void 0,time:r.scheduleType==="once"?void 0:r.time.format("HH:mm"),weekday:r.scheduleType==="weekly"?r.weekday:void 0,enabled:r.enabled},O=o?await Td.update(o,N):await Td.create(N);n(I=>o?I.map(j=>j.id===O.id?O:j):[O,...I]),x(),e.success(o?"Reminder updated":"Reminder created")}catch(N){e.error(N.message)}finally{h(!1)}},$=async(N,O)=>{try{const I=await Td.toggle(N.id,O);n(j=>j.map(M=>M.id===I.id?I:M))}catch(I){e.error(I.message)}},E=async N=>{try{await Td.remove(N),n(O=>O.filter(I=>I.id!==N)),o===N&&x(),e.success("Reminder deleted")}catch(O){e.error(O.message)}},R=(N,O)=>a(I=>({...I,[N]:O}));return c.jsxs("div",{className:"reminders-page",children:[c.jsx(Ur,{eyebrow:"PLAN & REVIEW",title:"Reminders",description:"Schedule one-time or recurring reminders and receive custom notifications at the right time.",actions:c.jsxs(ct,{wrap:!0,children:[c.jsx(Oe,{icon:c.jsx(Xa,{}),onClick:()=>y(!1),children:"Refresh"}),p!=="granted"&&p!=="unsupported"&&c.jsx(Oe,{type:"primary",icon:c.jsx(Kd,{}),onClick:b,children:"Enable desktop notifications"})]})}),p==="denied"&&c.jsx(mr,{className:"reminders-alert",type:"warning",showIcon:!0,message:"Desktop notifications are disabled",description:"Reminders will still be saved, but system notifications cannot appear until browser permission is enabled."}),p==="unsupported"&&c.jsx(mr,{className:"reminders-alert",type:"info",showIcon:!0,message:"Desktop notifications are not supported",description:"You can still use the reminder list, but system alerts require a browser with Notification API support."}),c.jsxs("div",{className:"reminder-stats",children:[c.jsxs(It,{children:[c.jsx(Md,{type:"secondary",children:"All reminders"}),c.jsx("strong",{children:C.total}),c.jsx("span",{children:"Saved reminders"})]}),c.jsxs(It,{className:"is-active",children:[c.jsx(Md,{type:"secondary",children:"Active"}),c.jsx("strong",{children:C.active}),c.jsx("span",{children:"Running on schedule"})]}),c.jsxs(It,{className:"is-repeat",children:[c.jsx(Md,{type:"secondary",children:"Recurring"}),c.jsx("strong",{children:C.repeating}),c.jsx("span",{children:"Daily, weekday, or weekly"})]})]}),c.jsxs("div",{className:"reminders-layout",children:[c.jsx(It,{className:"reminder-editor",title:c.jsxs("span",{children:[c.jsx(jy,{})," ",o?"Edit reminder":"New reminder"]}),extra:o&&c.jsx(Oe,{type:"link",onClick:x,children:"New"}),children:c.jsxs("div",{className:"reminder-form",children:[c.jsxs("label",{children:["Reminder title",c.jsx(Ct,{value:r.title,maxLength:50,showCount:!0,placeholder:"For example: Take a stretch break",onChange:N=>R("title",N.target.value)})]}),c.jsxs("label",{children:["Notification content",c.jsx(Ct.TextArea,{value:r.content,maxLength:100,showCount:!0,autoSize:{minRows:4,maxRows:7},placeholder:"The message shown when the reminder fires",onChange:N=>R("content",N.target.value)})]}),c.jsxs("label",{children:["Repeat",c.jsx($n,{value:r.scheduleType,options:p4e,onChange:N=>R("scheduleType",N)})]}),r.scheduleType==="once"?c.jsxs("label",{children:["Date and time",c.jsx(vl,{className:"reminder-wide-control",showTime:{format:"HH:mm",minuteStep:1},format:"YYYY-MM-DD HH:mm",value:r.scheduledAt,onChange:N=>R("scheduledAt",N&&N.second(0).millisecond(0))})]}):c.jsxs("div",{className:"reminder-form-row",children:[c.jsxs("label",{children:["Time",c.jsx(If,{className:"reminder-wide-control",format:"HH:mm",minuteStep:5,value:r.time,onChange:N=>R("time",N)})]}),r.scheduleType==="weekly"&&c.jsxs("label",{children:["Day",c.jsx($n,{value:r.weekday,options:oA.map((N,O)=>({label:N,value:iA[O]})),onChange:N=>R("weekday",N)})]})]}),c.jsxs("div",{className:"reminder-enabled-row",children:[c.jsxs("div",{children:[c.jsx(Md,{strong:!0,children:"Enable reminder"}),c.jsx(Md,{type:"secondary",children:"Run on schedule as soon as it is saved"})]}),c.jsx(Ja,{checked:r.enabled,onChange:N=>R("enabled",N)})]}),c.jsxs("div",{className:"reminder-preview",children:[c.jsxs("div",{children:[c.jsx("span",{children:"Notification preview"}),c.jsx(Kd,{})]}),c.jsx("strong",{children:r.title.trim()||"Reminder title"}),c.jsx("p",{children:r.content.trim()||"Your custom notification content will appear here."})]}),c.jsxs(ct,{className:"reminder-form-actions",children:[c.jsx(Oe,{onClick:x,children:o?"Cancel":"Clear"}),c.jsx(Oe,{type:"primary",icon:c.jsx(gi,{}),loading:m,onClick:w,children:o?"Save changes":"Create reminder"})]})]})}),c.jsx(It,{className:"reminder-list-card",title:c.jsxs("span",{children:[c.jsx(Wl,{})," My reminders"]}),children:u?c.jsx("div",{className:"reminder-list-state",children:"Loading reminders…"}):t.length===0?c.jsx(Xt,{image:Xt.PRESENTED_IMAGE_SIMPLE,description:"No reminders yet. Create your first one."}):c.jsx("div",{className:"reminder-list",children:t.map(N=>c.jsxs("article",{className:`reminder-item ${N.enabled?"":"is-disabled"}`,children:[c.jsx("div",{className:"reminder-item-icon",children:c.jsx(Kd,{})}),c.jsxs("div",{className:"reminder-item-main",children:[c.jsxs("div",{className:"reminder-item-heading",children:[c.jsx(h4e,{level:4,children:N.title}),c.jsx($t,{color:N.enabled?"green":"default",children:N.enabled?"Active":"Paused"})]}),c.jsx(Md,{className:"reminder-item-content",children:N.content}),c.jsxs("div",{className:"reminder-item-meta",children:[c.jsx("span",{children:g4e(N)}),N.enabled&&N.nextRunAt&&c.jsxs("span",{children:["Next: ",lA(N.nextRunAt)]})]})]}),c.jsxs("div",{className:"reminder-item-actions",children:[c.jsx(Ja,{size:"small",checked:N.enabled,onChange:O=>$(N,O)}),c.jsx(Oe,{type:"text",icon:c.jsx(Wo,{}),"aria-label":"Edit reminder",onClick:()=>{s(N.id),a(v4e(N))}}),c.jsx(Gr,{title:"Delete this reminder?",okText:"Delete",cancelText:"Cancel",onConfirm:()=>E(N.id),children:c.jsx(Oe,{type:"text",danger:!0,icon:c.jsx(Fn,{}),"aria-label":"Delete reminder"})})]})]},N.id))})})]}),c.jsxs("div",{className:"reminder-footnote",children:[c.jsx(Xn,{})," Reminders are saved locally. Keep DevBuddy open to check schedules and show notifications, even while using another workspace."]})]})}const Us=(e="node")=>`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,sA=(e,t="Untitled idea")=>{const n=String((e==null?void 0:e.edgeLabel)||"").trim();return{id:String((e==null?void 0:e.id)||Us()),text:String((e==null?void 0:e.text)??(e==null?void 0:e.label)??t),edgeLabel:n||void 0,color:(e==null?void 0:e.color)||void 0,autoWidth:(e==null?void 0:e.autoWidth)!==!1,collapsed:!!(e!=null&&e.collapsed),tested:!!(e!=null&&e.tested),notes:e!=null&&e.notes?String(e.notes):void 0,jiraKeys:Array.isArray(e==null?void 0:e.jiraKeys)?[...new Set(e.jiraKeys.map(r=>String(r).trim().toUpperCase()).filter(Boolean))]:void 0,position:e!=null&&e.position&&Number.isFinite(Number(e.position.x))&&Number.isFinite(Number(e.position.y))?{x:Number(e.position.x),y:Number(e.position.y)}:void 0,children:Array.isArray(e==null?void 0:e.children)?e.children.map(r=>sA(r)):[]}},$4=(e,t="Untitled mind map")=>{var s;const n=(e==null?void 0:e.root)||((s=e==null?void 0:e.data)==null?void 0:s.root)||e,r=String((e==null?void 0:e.title)||(n==null?void 0:n.text)||t).trim()||t,a=sA(n,r),o=new Date().toISOString();return{id:String((e==null?void 0:e.id)||Us("map")),title:r,layout:"left-to-right",createdAt:(e==null?void 0:e.createdAt)||new Date().toISOString(),updatedAt:(e==null?void 0:e.updatedAt)||o,jiraIssues:Array.isArray(e==null?void 0:e.jiraIssues)?e.jiraIssues.map(u=>({id:String((u==null?void 0:u.id)||(u==null?void 0:u.key)||"").trim(),key:String((u==null?void 0:u.key)||"").trim().toUpperCase(),summary:String((u==null?void 0:u.summary)||"").trim(),url:typeof(u==null?void 0:u.url)=="string"?u.url.trim():""})).filter(u=>u.id&&u.key):[],root:{...a,text:a.text||r}}},b4e=e=>{const t=String(e||"").trim();if(!t)return null;const n=t.match(/(?:\/browse\/|\b)([A-Z][A-Z0-9_]*-\d+)\b/i);if(!n)return null;const r=n[1].toUpperCase(),a=/^https?:\/\//i.test(t);return{key:r,url:a?t:""}},x4e=(e="Untitled mind map")=>{const t=new Date().toISOString();return{id:Us("map"),title:e,layout:"left-to-right",createdAt:t,updatedAt:t,root:{id:Us(),text:e,color:"#6555e8",children:[{id:Us(),text:"First idea",color:"#4f8edb",children:[]},{id:Us(),text:"Second idea",color:"#36a269",children:[]}]}}},E4=e=>1+(e.children||[]).reduce((t,n)=>t+E4(n),0),Gd=(e,t)=>{if(!e)return null;if(e.id===t)return e;for(const n of e.children||[]){const r=Gd(n,t);if(r)return r}return null},Hh=(e,t)=>{var n;if(!((n=e==null?void 0:e.children)!=null&&n.length))return null;if(e.children.some(r=>r.id===t))return e;for(const r of e.children){const a=Hh(r,t);if(a)return a}return null},eu=(e,t,n)=>e.id===t?n(e):{...e,children:(e.children||[]).map(r=>eu(r,t,n))},Wy=(e,t)=>({...e,children:(e.children||[]).filter(n=>n.id!==t).map(n=>Wy(n,t))}),C4e=(e,t,n)=>{let r=!1;const a=o=>{if(r)return o;const s=o.children||[],u=s.findIndex(f=>f.id===t);return u>=0?(r=!0,{...o,children:[...s.slice(0,u+1),n,...s.slice(u+1)]}):{...o,children:s.map(a)}};return a(e)},S4e=(e,t)=>{var s;const n=Hh(e,t),r=n?Hh(e,n.id):null,a=(s=n==null?void 0:n.children)==null?void 0:s.find(u=>u.id===t);if(!n||!r||!a)return e;const o=Wy(e,t);return eu(o,r.id,u=>{const f=(u.children||[]).findIndex(m=>m.id===n.id);return f<0?u:{...u,children:[...u.children.slice(0,f+1),a,...u.children.slice(f+1)]}})},Pk=(e,t,n)=>{const r=Gd(e,t);if(!r||!Gd(e,n)||t===n||Gd(r,n))return e;const a=Wy(e,t);return eu(a,n,o=>({...o,children:[...o.children||[],r]}))},cA=e=>{const t=[`# ${e.title}`],n=(r,a)=>{r.id!==e.root.id&&t.push(`${"#".repeat(Math.min(a+1,6))} ${r.text}`),(r.children||[]).forEach(o=>n(o,a+1))};return n(e.root,0),`${t.join(`
620
620
  `)}
621
- `},uA=(e,t="Imported mind map")=>{var u,f,m;const r=e.split(/\r?\n/).filter(h=>h.trim()).map(h=>({line:h,match:h.match(/^(#{1,6})\s+(.+?)\s*$/)})).filter(({match:h})=>h),a=((m=(f=(u=r[0])==null?void 0:u.match)==null?void 0:f[2])==null?void 0:m.trim())||t,o={id:Us(),text:a,children:[]},s=[{depth:0,node:o}];return r.slice(1).forEach(({match:h})=>{var b;const p=h[1].length,v={id:Us(),text:h[2].trim(),children:[]};for(;s.length&&s[s.length-1].depth>=p;)s.pop();(((b=s[s.length-1])==null?void 0:b.node)||o).children.push(v),s.push({depth:p,node:v})}),$4({title:a,root:o})},tu=(e,t,n="application/json")=>{const r=typeof Blob<"u"&&t instanceof Blob?t:new Blob([t],{type:n}),a=URL.createObjectURL(r),o=document.createElement("a");o.href=a,o.download=e,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(a)},w4e=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?"Recently updated":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric"}).format(t)},{Title:dA,Text:fA}=xn,Cv=e=>e.replace(/\.(xmind|json|md|markdown|txt)$/i,"").replace(/[-_]+/g," ").trim()||"Imported mind map";function $4e({map:e}){const t=["#6555e8","#4f8edb","#36a269","#d98a34"];return c.jsxs("div",{className:"mind-map-mini-preview","aria-hidden":"true",children:[c.jsx("div",{className:"mind-map-mini-root",style:{background:e.root.color||t[0]},children:c.jsx("span",{className:"mind-map-mini-root-text",children:e.root.text})}),c.jsx("div",{className:"mind-map-mini-branches",children:(e.root.children||[]).slice(0,4).map((n,r)=>c.jsxs("div",{className:"mind-map-mini-branch",children:[c.jsx("span",{className:"mind-map-mini-line"}),c.jsx("span",{className:"mind-map-mini-node",style:{borderColor:n.color||t[r%t.length]},children:n.text})]},n.id))})]})}function E4e({map:e,index:t,onOpen:n,onDelete:r,onExport:a}){const o=[{key:"xmind",icon:c.jsx(ql,{}),label:"Export XMind"},{key:"json",icon:c.jsx(ql,{}),label:"Export JSON"},{key:"markdown",icon:c.jsx(Ui,{}),label:"Export Markdown"},{type:"divider"},{key:"delete",danger:!0,icon:c.jsx(Fn,{}),label:"Delete map"}],s=({key:u,domEvent:f})=>{f==null||f.stopPropagation(),u==="delete"&&r(e),(u==="xmind"||u==="json"||u==="markdown")&&a(e,u)};return c.jsxs(It,{className:`mind-map-card ${t===0?"is-featured":""}`,hoverable:!0,onClick:()=>n(e.id),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n(e.id))},role:"button",tabIndex:0,children:[c.jsxs("div",{className:"mind-map-card-topline",children:[c.jsx($t,{className:"mind-map-card-type",children:"MIND MAP"}),c.jsx(Bl,{menu:{items:o,onClick:s},trigger:["click"],children:c.jsx(Oe,{"aria-label":`Actions for ${e.title}`,className:"mind-map-card-menu",icon:c.jsx(Wv,{}),onClick:u=>u.stopPropagation(),type:"text"})})]}),c.jsx($4e,{map:e}),c.jsxs("div",{className:"mind-map-card-content",children:[c.jsx("div",{className:"mind-map-card-title-row",children:c.jsx(dA,{ellipsis:{rows:1,tooltip:e.title},level:3,children:e.title})}),c.jsxs("div",{className:"mind-map-card-meta-row",children:[c.jsxs(fA,{className:"mind-map-card-meta",children:[E4(e.root)," nodes ",c.jsx("span",{children:"·"})," Updated ",w4e(e.updatedAt)]}),c.jsxs("span",{className:"mind-map-card-open",children:["Open map ",c.jsx("span",{"aria-hidden":"true",children:"→"})]})]})]})]})}function j4e({onNavigate:e}){const{message:t,modal:n}=Pr.useApp(),[r,a]=l.useState([]),[o,s]=l.useState(!0),[u,f]=l.useState(""),m=l.useRef(null),h=async()=>{try{a(await sl.list())}catch($){t.error(`Could not load mind maps: ${$.message||"unknown error"}`)}finally{s(!1)}};l.useEffect(()=>{h()},[]);const p=l.useMemo(()=>{const $=u.trim().toLowerCase();return $?r.filter(E=>`${E.title} ${E.root.text}`.toLowerCase().includes($)):r},[r,u]),v=()=>h(),y=$=>e(`mind-maps/${encodeURIComponent($)}`),b=async()=>{try{const $=await sl.create(x4e());a(E=>[$,...E]),y($.id)}catch($){t.error(`Could not create mind map: ${$.message||"unknown error"}`)}},C=async($,E)=>{try{if(E==="xmind"){const{mindMapToXmindBlob:R}=await pu(async()=>{const{mindMapToXmindBlob:O}=await import("./xmindAdapter-CLCxNrZn.js");return{mindMapToXmindBlob:O}},[]),N=await R($);tu(`${$.title||"mind-map"}.xmind`,N,"application/octet-stream"),t.success("XMind exported");return}if(E==="markdown"){tu(`${$.title||"mind-map"}.md`,cA($),"text/markdown;charset=utf-8"),t.success("Markdown exported");return}tu(`${$.title||"mind-map"}.json`,`${JSON.stringify($,null,2)}
622
- `,"application/json;charset=utf-8"),t.success("JSON exported")}catch(R){t.error(`Could not export this map: ${R.message||"unknown error"}`)}},x=$=>{n.confirm({title:"Delete this mind map?",content:`“${$.title}” will be removed from workspace data.`,okText:"Delete",okButtonProps:{danger:!0},cancelText:"Cancel",onOk:async()=>{await sl.remove($.id),await v(),t.success("Mind map deleted")}})},w=async $=>{var R;const E=(R=$.target.files)==null?void 0:R[0];if($.target.value="",!!E)try{const N=E.name.toLowerCase().endsWith(".xmind"),O=N?null:await E.text(),I=E.name.toLowerCase().endsWith(".json"),j=N?await(async()=>{const{xmindBlobToMindMap:T}=await pu(async()=>{const{xmindBlobToMindMap:z}=await import("./xmindAdapter-CLCxNrZn.js");return{xmindBlobToMindMap:z}},[]);return T(await E.arrayBuffer(),Cv(E.name))})():I?$4(JSON.parse(O),Cv(E.name)):uA(O,Cv(E.name)),M=await sl.create({...j,title:j.title||Cv(E.name)});a(T=>[M,...T]),t.success(`${N?"XMind":I?"JSON":"Markdown"} imported`),y(M.id)}catch(N){t.error(`Could not import this file: ${N.message||"invalid format"}`)}};return c.jsxs("div",{className:"mind-map-page",children:[c.jsx(Ur,{actions:c.jsxs(ct,{className:"mind-map-page-actions",size:10,children:[c.jsx("input",{ref:m,accept:".xmind,.json,.md,.markdown,.txt",className:"mind-map-hidden-input",onChange:w,type:"file"}),c.jsx(Oe,{icon:c.jsx(S0,{}),onClick:()=>{var $;return($=m.current)==null?void 0:$.click()},children:"Import"}),c.jsx(Oe,{icon:c.jsx(Xn,{}),onClick:b,type:"primary",children:"New mind map"})]}),description:"Turn scattered thoughts into a clear visual plan.",eyebrow:"PLAN & REVIEW",title:"Mind maps"}),c.jsxs("div",{className:"mind-map-list-summary",children:[c.jsxs("div",{children:[c.jsx(dA,{level:2,children:"Your workspace"}),c.jsxs(fA,{type:"secondary",children:[r.length," ",r.length===1?"map":"maps"," saved locally"]})]}),c.jsx(Ct,{allowClear:!0,className:"mind-map-search",onChange:$=>f($.target.value),placeholder:"Search maps...",prefix:c.jsx(jo,{}),value:u})]}),o?c.jsx("div",{className:"mind-map-loading",children:c.jsx("span",{children:"Loading mind maps..."})}):p.length?c.jsx("div",{className:"mind-map-card-grid",children:p.map(($,E)=>c.jsx(E4e,{index:E,map:$,onDelete:x,onExport:C,onOpen:y},$.id))}):c.jsx(It,{className:"mind-map-empty-card",children:c.jsx(Xt,{description:u?"No maps match your search.":"No mind maps yet.",children:!u&&c.jsx(Oe,{icon:c.jsx(Xn,{}),onClick:b,type:"primary",children:"Create your first map"})})}),c.jsxs("div",{className:"mind-map-import-hint",children:[c.jsx(S0,{})," ",c.jsx("span",{children:"Import XMind, JSON, or Markdown. Export XMind to continue editing in XMind."})]})]})}const Sv=40,N4e=8192,Dk=e=>String(e??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;"),Gc=(e,t)=>{const n=e.getBoundingClientRect();return{left:n.left-t.left,top:n.top-t.top,right:n.right-t.left,bottom:n.bottom-t.top,width:n.width,height:n.height}},hh=(e,t=0)=>{const n=Number.parseFloat(e);return Number.isFinite(n)?n:t},O4e=(e,t)=>{const n=e.nodeValue||"",r=new Map;let a=0;for(const o of n){const s=o.length;t.setStart(e,a),t.setEnd(e,a+s),a+=s;const u=t.getBoundingClientRect();if(!u.height)continue;const f=Math.round(u.top*2)/2,m=r.get(f)||{top:f,x:u.left,text:""};m.x=Math.min(m.x,u.left),m.text+=o,r.set(f,m)}return[...r.values()].sort((o,s)=>o.top-s.top)},R4e=(e,t)=>{var u;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),r=document.createRange(),a=document.createElement("canvas").getContext("2d"),o=[];let s=n.nextNode();for(;s;){const f=s.parentElement;if(!(f!=null&&f.closest(".mind-map-collapse"))&&((u=s.nodeValue)!=null&&u.trim())){const m=getComputedStyle(f),h=O4e(s,r),p=hh(m.fontSize,12),v=m.lineHeight==="normal"?p*1.2:hh(m.lineHeight,p*1.2),y=`${m.fontStyle} ${m.fontWeight} ${p}px ${m.fontFamily}`;a.font=y;const b=a.measureText("Mg"),C=b.fontBoundingBoxAscent||b.actualBoundingBoxAscent||p*.8,x=b.fontBoundingBoxDescent||b.actualBoundingBoxDescent||p*.2,w=Math.max(0,(v-C-x)/2)+C,$=Gc(f,t),E=getComputedStyle(f),R=["hidden","clip"].includes(E.overflowX)||["hidden","clip"].includes(E.overflowY)||E.textOverflow==="ellipsis";h.forEach(N=>{N.text&&o.push({text:N.text,x:N.x-t.left,y:N.top-t.top+w,font:`${m.fontStyle} ${m.fontWeight} ${p}px ${m.fontFamily}`,color:m.color,letterSpacing:m.letterSpacing,opacity:hh(m.opacity,1),clip:R?$:null})})}s=n.nextNode()}return o},I4e=(e,t)=>{const n=Gc(e,t),r=getComputedStyle(e),a=r.backgroundColor==="rgba(0, 0, 0, 0)"?"none":r.backgroundColor,o=hh(r.borderTopWidth),s=r.borderTopStyle==="none"||o===0?"none":r.borderTopColor,u=Math.min(hh(r.borderTopLeftRadius),n.width/2,n.height/2);return`<rect x="${n.left}" y="${n.top}" width="${n.width}" height="${n.height}" rx="${u}" fill="${Dk(a)}" stroke="${Dk(s)}" stroke-width="${o}"/>`},k4e=e=>{const t=e.getBoundingClientRect(),n=[],r=(o,s,u,f,m)=>{n.push(`<line x1="${o}" y1="${s}" x2="${u}" y2="${f}" stroke="${m}" stroke-width="1.5" stroke-linecap="round"/>`)};return[...e.querySelectorAll(".mind-map-ltr-children")].forEach(o=>{const s=Gc(o,t),f=[...o.children].filter(y=>y.classList.contains("mind-map-ltr-branch")).map(y=>({branch:y,row:y.querySelector(":scope > .mind-map-ltr-node-row"),node:y.querySelector(":scope > .mind-map-ltr-node-row > [data-mind-map-node]")})).filter(({row:y,node:b})=>y&&b);if(!f.length)return;const m=s.left,p=f.map(({row:y})=>Gc(y,t)).map(y=>y.top+y.height/2),v=o.classList.contains("is-comment-children")?"#9da9b6":"#c6cada";if(p.length>1&&r(m,p[0],m,p[p.length-1],v),f.forEach(({branch:y,node:b},C)=>{const x=Gc(b,t),w=y.classList.contains("is-comment-branch")?"#9da9b6":v;r(m,p[C],x.left,p[C],w)}),o.classList.contains("mind-map-ltr-root-children")){const y=e.querySelector(".mind-map-ltr-root-column > [data-mind-map-node]");if(y){const b=Gc(y,t);r(b.right,b.top+b.height/2,m,b.top+b.height/2,v)}}else{const y=o.parentElement,b=y==null?void 0:y.querySelector(":scope > .mind-map-ltr-node-row > [data-mind-map-node]");if(b){const C=Gc(b,t),x=y.classList.contains("is-comment-branch")?"#9da9b6":v;r(C.right,C.top+C.height/2,m,C.top+C.height/2,x)}}}),n.join("")},M4e=(e,t)=>{const n=e.getBoundingClientRect(),r=Math.floor(t.left-n.left-Sv),a=Math.floor(t.top-n.top-Sv),o=Math.ceil(t.right-t.left+Sv*2),s=Math.ceil(t.bottom-t.top+Sv*2),u=[...e.querySelectorAll(".mind-map-root-node, .mind-map-node, .mind-map-node-jira-tag")].map(h=>I4e(h,n)).join(""),f=R4e(e,n);return{svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${s}" viewBox="${r} ${a} ${o} ${s}"><rect x="${r}" y="${a}" width="${o}" height="${s}" fill="#ffffff"/>${k4e(e)}${u}</svg>`,width:o,height:s,left:r,top:a,text:f}},T4e=async e=>{var p;if(!e)throw new Error("Mind map canvas is not ready.");const t=[...e.querySelectorAll("[data-mind-map-node], .mind-map-canvas-empty")];if(!t.length)throw new Error("Mind map canvas is empty.");(p=document.fonts)!=null&&p.ready&&await document.fonts.ready;const n=t.reduce((v,y)=>{const b=y.getBoundingClientRect();return{left:Math.min(v.left,b.left),top:Math.min(v.top,b.top),right:Math.max(v.right,b.right),bottom:Math.max(v.bottom,b.bottom)}},{left:1/0,top:1/0,right:-1/0,bottom:-1/0}),{svg:r,width:a,height:o,left:s,top:u,text:f}=M4e(e,n),m=new Image,h=URL.createObjectURL(new Blob([r],{type:"image/svg+xml;charset=utf-8"}));try{await new Promise((w,$)=>{m.onload=w,m.onerror=()=>$(new Error("Could not render the mind map image.")),m.src=h});const v=Math.min(2,N4e/Math.max(a,o)),y=document.createElement("canvas");y.width=Math.max(1,Math.round(a*v)),y.height=Math.max(1,Math.round(o*v));const b=y.getContext("2d");if(!b)throw new Error("Canvas is unavailable.");b.fillStyle="#ffffff",b.fillRect(0,0,y.width,y.height),b.drawImage(m,0,0,y.width,y.height),b.save(),b.scale(v,v),f.forEach(w=>{b.save(),b.font=w.font,b.fillStyle=w.color,b.globalAlpha=w.opacity,"letterSpacing"in b&&w.letterSpacing&&w.letterSpacing!=="normal"&&(b.letterSpacing=w.letterSpacing),w.clip&&(b.beginPath(),b.rect(w.clip.left-s,w.clip.top-u,w.clip.width,w.clip.height),b.clip()),b.textBaseline="alphabetic",b.fillText(w.text,w.x-s,w.y-u),b.restore()}),b.restore();const{encode:C}=await pu(async()=>{const{encode:w}=await import("./index-_vMuByUV.js");return{encode:w}},[]),x=await C(b.getImageData(0,0,y.width,y.height),{quality:75,progressive:!0,optimize_coding:!0,auto_subsample:!0});return new Blob([x],{type:"image/jpeg"})}finally{URL.revokeObjectURL(h)}},{Text:io,Title:zk}=xn,T0=["#4f8edb","#36a269","#d98a34","#c05a83","#8a70c5"],P4e=3200,D4e=2200,Ts=1600,z4e=380,qy=e=>String((e==null?void 0:e.text)||"").trimStart().startsWith("#"),A4e=e=>{var n;const t=e instanceof HTMLElement?e:null;return!!(t!=null&&t.isContentEditable||(n=t==null?void 0:t.closest)!=null&&n.call(t,'input, textarea, select, [contenteditable="true"]'))},mA=e=>e.reduce((t,n)=>{const r=String(n.edgeLabel||"").trim();return r?Math.max(t,Math.min(160,Math.max(72,r.length*7+16))):t},16),h2=(e,t,n=!1)=>({...e,collapsed:n?!1:t,children:(e.children||[]).map(r=>h2(r,t))}),hA=(e,t,n=!1)=>{const r=n||qy(e);return{...e,tested:r?!1:t,children:(e.children||[]).map(a=>hA(a,t,r))}},pA=(e,t)=>({...e,jiraKeys:(e.jiraKeys||[]).filter(n=>n!==t),children:(e.children||[]).map(n=>pA(n,t))}),gA=(e,t)=>{t.add(e.id),(e.children||[]).forEach(n=>gA(n,t))},vA=(e,t)=>t.has(e.id)?null:{label:e.text||"Untitled idea",value:e.id,children:(e.children||[]).map(n=>vA(n,t)).filter(Boolean)},yA=(e,t,n=[])=>{const r=[...n,e.id];if(e.id===t)return r;for(const a of e.children||[]){const o=yA(a,t,r);if(o)return o}return null},hS=e=>e.replace(/\.(xmind|json|md|markdown|txt)$/i,"").replace(/[-_]+/g," ").trim()||"Imported mind map",bA=(e,t,n=!1)=>{if(!e)return!1;const r=n||qy(e);return e.id===t?r:(e.children||[]).some(a=>bA(a,t,r))};function xA({node:e,jiraIssues:t}){const n=(e.jiraKeys||[]).map(r=>t.find(a=>a.key===r)||{key:r});return n.length?c.jsx("span",{className:"mind-map-node-jira-tags","aria-label":"Jira tags",children:n.map(r=>c.jsx("span",{className:"mind-map-node-jira-tag",title:r.summary||r.key,children:r.key},r.key))}):null}function CA({node:e,depth:t=0,selectedId:n,onSelect:r,onToggle:a,jiraIssues:o,commented:s=!1}){const u=e.color||T0[t%T0.length],f=e.children||[],m=qy(e),h=s||m,p=mA(f);return c.jsxs("div",{className:`mind-map-ltr-branch depth-${Math.min(t,4)}${h?" is-comment-branch":""}${m?" is-comment-marker":""}`,children:[c.jsxs("div",{className:"mind-map-ltr-node-row",children:[e.edgeLabel&&c.jsx("span",{className:"mind-map-ltr-edge-label",title:e.edgeLabel,children:e.edgeLabel}),c.jsxs("button",{className:`mind-map-node ${n===e.id?"is-selected":""} ${e.tested&&!h?"is-tested":""}${e.autoWidth===!1?" is-auto-width-disabled":""}${h?" is-comment":""}${m?" is-comment-marker":""}`,onClick:()=>r(e.id),"data-mind-map-node":e.id,style:{"--node-color":u},type:"button",children:[c.jsxs("span",{className:"mind-map-node-main",children:[c.jsx("span",{className:"mind-map-node-text",children:e.text||"Untitled idea"}),f.length>0&&c.jsx("span",{className:"mind-map-node-count",children:f.length})]}),c.jsx(xA,{jiraIssues:o,node:e})]}),f.length>0&&c.jsxs("button",{"aria-label":e.collapsed?"Expand branch":"Collapse branch",className:"mind-map-collapse",onClick:()=>a(e.id),type:"button",children:[c.jsx("span",{className:`mind-map-collapse-symbol ${e.collapsed?"is-visible":""}`,children:"+"}),c.jsx("span",{className:`mind-map-collapse-symbol ${e.collapsed?"":"is-visible"}`,children:"−"})]})]}),!e.collapsed&&f.length>0&&c.jsx("div",{className:`mind-map-ltr-children${h?" is-comment-children":""}`,style:{"--mind-map-ltr-node-inset":`${p}px`},children:f.map(v=>c.jsx(CA,{depth:t+1,node:v,onSelect:r,onToggle:a,selectedId:n,jiraIssues:o,commented:h},v.id))})]})}const SA=l.forwardRef(function({map:t,selectedId:n,onSelect:r,onToggle:a,jiraIssues:o,nodeMaxWidth:s,fitContent:u=!1},f){const m=t.root,h=m.children||[],p=m.color||"#6555e8",v=qy(m);return c.jsxs("div",{className:"mind-map-ltr-diagram",ref:f,style:{...u?{minWidth:0,minHeight:0,margin:0}:{},...Number.isInteger(s)?{"--mind-map-node-max-width":`${s}px`}:{}},children:[c.jsx("div",{className:"mind-map-ltr-root-column",children:c.jsxs("button",{className:`mind-map-root-node ${n===m.id?"is-selected":""} ${m.tested&&!v?"is-tested":""}${m.autoWidth===!1?" is-auto-width-disabled":""}${v?" is-comment is-comment-marker":""}`,"data-mind-map-node":m.id,onClick:()=>r(m.id),style:{"--node-color":p},type:"button",children:[c.jsx("span",{className:"mind-map-root-text",children:m.text||"Untitled idea"}),c.jsxs("span",{className:"mind-map-root-count",children:[E4(m)-1," connected ideas"]}),c.jsx(xA,{jiraIssues:o,node:m})]})}),!m.collapsed&&h.length>0&&c.jsx("div",{className:`mind-map-ltr-children mind-map-ltr-root-children${v?" is-comment-children":""}`,style:{"--mind-map-ltr-node-inset":`${mA(h)}px`},children:h.map(y=>c.jsx(CA,{node:y,onSelect:r,onToggle:a,selectedId:n,jiraIssues:o,commented:v},y.id))}),!h.length&&c.jsx("div",{className:"mind-map-canvas-empty",children:c.jsx(io,{type:"secondary",children:"Add a branch from the inspector to start mapping this idea."})})]})}),_4e=l.forwardRef(function({map:t,nodeMaxWidth:n},r){const a=l.useRef(null);return l.useLayoutEffect(()=>{const o=a.current;if(!o)return;const s=1;o.querySelectorAll(".mind-map-ltr-children").forEach(u=>{const f=[...u.children].map(b=>b.querySelector(":scope > .mind-map-ltr-node-row")).filter(Boolean);if(!f.length)return;const m=u.getBoundingClientRect(),h=f[0].getBoundingClientRect(),p=f[f.length-1].getBoundingClientRect(),v=(h.top+h.bottom)/2,y=(p.top+p.bottom)/2;u.style.setProperty("--mind-map-connector-top",`${Math.max(0,(v-m.top)/s)}px`),u.style.setProperty("--mind-map-connector-height",`${Math.max(0,(y-v)/s)}px`)})},[t]),c.jsx("div",{"aria-hidden":"true",className:"mind-map-export-offscreen",inert:"",children:c.jsx("div",{className:"mind-map-canvas-stage is-left-to-right mind-map-export-render",ref:r,style:{width:"max-content",height:"auto",padding:0,margin:0,zoom:1},children:c.jsx(SA,{fitContent:!0,jiraIssues:t.jiraIssues||[],map:t,nodeMaxWidth:n,onSelect:()=>{},onToggle:()=>{},ref:a,selectedId:null})})})}),L4e=l.forwardRef(function({map:t,selectedId:n,zoom:r,resetViewToken:a,recenterLayoutToken:o,isPanning:s,onCanvasPointerDown:u,onCanvasPointerMove:f,onCanvasPointerUp:m,onSelect:h,onToggle:p,onZoomChange:v,jiraIssues:y,nodeMaxWidth:b},C){const x=l.useRef(null),w=l.useRef(null),$=l.useRef(r),E=l.useRef({meta:!1,ctrl:!1}),R=l.useRef(new Map),N=l.useRef(0),O=l.useRef(0),I=l.useRef(!1),j=l.useRef(o);$.current=r;const M=(A,L,F,U)=>{const q=A.querySelector(".mind-map-canvas-stage"),_=A.getBoundingClientRect(),K=q==null?void 0:q.getBoundingClientRect();return{fromZoom:L,toZoom:null,x:F,y:U,stageX:K?(_.left+F-K.left)/L:null,stageY:K?(_.top+U-K.top)/L:null}};l.useImperativeHandle(C,()=>({zoomAt(A){const L=x.current,F=$.current;!L||A===F||(w.current=M(L,F,L.clientWidth/2,L.clientHeight/2),w.current.toZoom=A,$.current=A,v(A))}}),[v]);const T=A=>{const L=A.target instanceof Element?A.target:null,F=L==null?void 0:L.closest("button[data-mind-map-node]");L!=null&&L.closest("button")&&!F||u(A,(F==null?void 0:F.dataset.mindMapNode)||null)},z=(A=null)=>{const L=x.current;if(!L)return;const F=[...L.querySelectorAll("[data-mind-map-node]")],U=L.querySelector(".mind-map-root-node");if(!F.length||!U)return;const q=L.getBoundingClientRect(),_=F.reduce((J,ye)=>{const xe=(A==null?void 0:A.get(ye.dataset.mindMapNode))||ye.getBoundingClientRect();return{left:Math.min(J.left,xe.left),top:Math.min(J.top,xe.top),right:Math.max(J.right,xe.right),bottom:Math.max(J.bottom,xe.bottom)}},{left:1/0,top:1/0,right:-1/0,bottom:-1/0}),K=(_.left+_.right)/2,X=(_.top+_.bottom)/2,V=(A==null?void 0:A.get(U.dataset.mindMapNode))||U.getBoundingClientRect();let W=L.scrollLeft+K-q.left-L.clientWidth/2,G=L.scrollTop+X-q.top-L.clientHeight/2;const Y=W-L.scrollLeft,te=G-L.scrollTop,ne=V.left-Y,ue=V.right-Y,Z=V.top-te,ee=V.bottom-te,re=q.left+24,oe=q.right-24,de=q.top+24,be=q.bottom-24;ue<re&&(W+=ue-re),ne>oe&&(W+=ne-oe),ee<de&&(G+=ee-de),Z>be&&(G+=Z-be),L.scrollLeft=Math.max(0,Math.min(W,L.scrollWidth-L.clientWidth)),L.scrollTop=Math.max(0,Math.min(G,L.scrollHeight-L.clientHeight))},P=()=>{const A=x.current;if(!A)return;const L=$.current||1;A.querySelectorAll(".mind-map-ltr-children").forEach(F=>{const U=[...F.children].map(W=>W.querySelector(":scope > .mind-map-ltr-node-row")).filter(Boolean);if(!U.length)return;const q=F.getBoundingClientRect(),_=U[0].getBoundingClientRect(),K=U[U.length-1].getBoundingClientRect(),X=(_.top+_.bottom)/2,V=(K.top+K.bottom)/2;F.style.setProperty("--mind-map-connector-top",`${Math.max(0,(X-q.top)/L)}px`),F.style.setProperty("--mind-map-connector-height",`${Math.max(0,(V-X)/L)}px`)})},B=()=>{const A=x.current;!A||I.current||(R.current=new Map([...A.querySelectorAll("[data-mind-map-node]")].map(L=>[L.dataset.mindMapNode,L.getBoundingClientRect()])))};l.useLayoutEffect(()=>{P()},[t,r,b]),l.useLayoutEffect(()=>{z()},[t.id]),l.useLayoutEffect(()=>{const A=x.current;if(!A)return;const L=o!==j.current;j.current=o;const F=[...A.querySelectorAll("[data-mind-map-node]")],U=new Map(F.map(Y=>[Y.dataset.mindMapNode,Y.getBoundingClientRect()])),q=R.current,_=new Map(F.map(Y=>{const te=Y.dataset.mindMapNode;return[te,Y.style.transform?U.get(te):q.get(te)||U.get(te)]}));cancelAnimationFrame(N.current),N.current=0,window.clearTimeout(O.current),O.current=0,I.current=!1,F.forEach(Y=>{Y.style.transition="none",Y.style.transform="",Y.style.opacity=""}),A.offsetHeight;const K=new Map(F.map(Y=>[Y.dataset.mindMapNode,Y.getBoundingClientRect()]));let X=K;if(L&&(I.current=!0,z(K),X=new Map(F.map(Y=>[Y.dataset.mindMapNode,Y.getBoundingClientRect()]))),!q.size){I.current=!1,R.current=X;return}const V=new Map(F.map(Y=>{const te=Y.dataset.mindMapNode,ne=_.get(te),ue=K.get(te);return[te,ne&&ue?{x:(ne.left-ue.left)/($.current||1),y:(ne.top-ue.top)/($.current||1)}:null]})),W=[...V.values()].filter(Y=>Y&&(Math.abs(Y.x)>=1||Math.abs(Y.y)>=1));if(!(W.length<=40&&W.every(Y=>Math.max(Math.abs(Y.x),Math.abs(Y.y))<=900))){I.current=!1,R.current=X;return}return I.current=W.length>0,F.forEach(Y=>{const te=_.get(Y.dataset.mindMapNode),ne=K.get(Y.dataset.mindMapNode);if(!te||!ne){Y.style.opacity="1";return}const ue=V.get(Y.dataset.mindMapNode),Z=ue.x,ee=ue.y;Math.abs(Z)<1&&Math.abs(ee)<1||(Y.style.transition="none",Y.style.transform=`translate(${Z}px, ${ee}px)`)}),F.forEach(Y=>void Y.offsetWidth),N.current=requestAnimationFrame(()=>{F.forEach(Y=>{const te=_.get(Y.dataset.mindMapNode);Y.style.transition="transform 380ms cubic-bezier(.22, 1, .36, 1), opacity 220ms ease",Y.style.transform="",te||(Y.style.opacity="1")}),N.current=0,O.current=window.setTimeout(()=>{I.current=!1,B(),O.current=0},z4e+16)}),R.current=X,()=>{cancelAnimationFrame(N.current),N.current=0,window.clearTimeout(O.current),O.current=0,I.current=!1}},[t,b,o]),l.useLayoutEffect(()=>{const A=x.current,L=w.current;if(!A||!L||L.toZoom!==r)return;const F=A.getBoundingClientRect(),U=A.querySelector(".mind-map-canvas-stage"),q=U==null?void 0:U.getBoundingClientRect(),_=L.stageX===null||!q?Ts+(L.x+A.scrollLeft-Ts)*(r/L.fromZoom)-L.x:A.scrollLeft+q.left+L.stageX*r-(F.left+L.x),K=L.stageY===null||!q?Ts+(L.y+A.scrollTop-Ts)*(r/L.fromZoom)-L.y:A.scrollTop+q.top+L.stageY*r-(F.top+L.y);A.scrollLeft=Math.max(0,Math.min(_,A.scrollWidth-A.clientWidth)),A.scrollTop=Math.max(0,Math.min(K,A.scrollHeight-A.clientHeight)),w.current=null},[r]),l.useLayoutEffect(()=>{if(a===0)return;const A=requestAnimationFrame(()=>z());return()=>cancelAnimationFrame(A)},[a]),l.useEffect(()=>{const A=U=>{U.key==="Meta"&&(E.current.meta=!0),U.key==="Control"&&(E.current.ctrl=!0)},L=U=>{U.key==="Meta"&&(E.current.meta=!1),U.key==="Control"&&(E.current.ctrl=!1)},F=()=>{E.current={meta:!1,ctrl:!1}};return window.addEventListener("keydown",A),window.addEventListener("keyup",L),window.addEventListener("blur",F),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",L),window.removeEventListener("blur",F)}},[]);const H=l.useCallback(A=>{var W,G;const L=x.current;if(!L||!L.contains(A.target))return;const F=A.metaKey||((W=A.getModifierState)==null?void 0:W.call(A,"Meta"))||E.current.meta,U=A.ctrlKey||((G=A.getModifierState)==null?void 0:G.call(A,"Control"))||E.current.ctrl;if(!F&&!U||!A.deltaY)return;A.preventDefault(),A.returnValue=!1,A.stopPropagation();const q=L.getBoundingClientRect(),_=$.current,K=A.deltaMode===1?A.deltaY*16:A.deltaY,X=Math.min(Math.abs(K),48)*Math.sign(K),V=Math.max(.5,Math.min(2,Number((_*Math.pow(1.1,-X/24)).toFixed(3))));V!==_&&(w.current=M(L,_,A.clientX-q.left,A.clientY-q.top),w.current.toZoom=V,$.current=V,v(V))},[v]);return l.useEffect(()=>(window.addEventListener("wheel",H,{capture:!0,passive:!1}),()=>window.removeEventListener("wheel",H,{capture:!0})),[H]),c.jsx("div",{className:`mind-map-canvas-scroll ${s?"is-panning":""}`,ref:x,onPointerCancel:m,onPointerDown:T,onPointerMove:f,onPointerUp:m,onScroll:B,children:c.jsx("div",{className:"mind-map-canvas-world",style:{height:`${D4e*r+Ts*2}px`,width:`${P4e*r+Ts*2}px`},children:c.jsx("div",{className:"mind-map-canvas-stage is-left-to-right",style:{marginLeft:`${Ts}px`,marginTop:`${Ts}px`,zoom:r},children:c.jsx(SA,{jiraIssues:y,map:t,nodeMaxWidth:b,onSelect:h,onToggle:p,selectedId:n})})})})});function B4e({mindMapId:e,onNavigate:t}){var Qt,kt;const{message:n}=Pr.useApp(),r=l.useRef(null),[a,o]=l.useState(null),[s,u]=l.useState(null),[f,m]=l.useState(null),[h,p]=l.useState(""),[v,y]=l.useState(!0),[b,C]=l.useState(1),[x,w]=l.useState(0),[$,E]=l.useState(0),[R,N]=l.useState(!1),[O,I]=l.useState(!1),[j,M]=l.useState(null),[T,z]=l.useState(null),[P,B]=l.useState(!1),[H,A]=l.useState(!1),[L,F]=l.useState(""),[U,q]=l.useState(!1),[_,K]=l.useState(""),[X,V]=l.useState(!1),[W,G]=l.useState(!1),[Y,te]=l.useState([]),[ne,ue]=l.useState(!1),[Z,ee]=l.useState(!1),[re,oe]=l.useState(!1),de=l.useRef(null),be=l.useRef(null),J=l.useRef(null),ye=l.useRef(null),xe=l.useRef(!1),ze=l.useRef(null),he=l.useRef(Promise.resolve());l.useEffect(()=>{let Me=!0;return Wn.status().then(Ue=>{if(!Me)return;const mt=Number.isInteger(Ue.mindMapNodeMaxWidth)?Ue.mindMapNodeMaxWidth:null;M(mt),z(mt),B(!0)}).catch(Ue=>{Me&&(B(!0),n.error(`Could not load mind map settings: ${Ue.message||"unknown error"}`))}),()=>{Me=!1}},[]),l.useEffect(()=>{P&&E(Me=>Me+1)},[j,P]),l.useEffect(()=>{let Me=!0;return y(!0),o(null),m(null),ue(!1),sl.get(e).then(Ue=>{Me&&(o(Ue),p(Ue.title||""),C(1),w(0),N(!1),de.current=null)}).catch(Ue=>{Me&&n.error(`Could not load mind map: ${Ue.message||"unknown error"}`)}).finally(()=>{Me&&y(!1)}),()=>{Me=!1}},[e]),l.useEffect(()=>{a&&f&&!Gd(a.root,f)&&m(null)},[a,f]),l.useEffect(()=>{var Me,Ue;xe.current&&(xe.current=!1,(Ue=(Me=ye.current)==null?void 0:Me.focus)==null||Ue.call(Me))},[f]),l.useEffect(()=>{var Me;oe(!!((Me=ce==null?void 0:ce.notes)!=null&&Me.trim()))},[f]),l.useEffect(()=>{if(!Z)return;const Me=Ue=>{Ue.key==="Escape"&&ee(!1)};return window.addEventListener("keydown",Me),()=>window.removeEventListener("keydown",Me)},[Z]);const ce=l.useMemo(()=>f?Gd(a==null?void 0:a.root,f):null,[a,f]),se=l.useMemo(()=>bA(a==null?void 0:a.root,f),[a,f]),ae=l.useMemo(()=>Hh(a==null?void 0:a.root,f),[a,f]),ge=((Qt=ae==null?void 0:ae.children)==null?void 0:Qt.findIndex(Me=>Me.id===f))??-1,Re=(a==null?void 0:a.jiraIssues)||[],_e=l.useMemo(()=>{const Me=new Set,Ue=mt=>{((mt==null?void 0:mt.jiraKeys)||[]).forEach(qt=>Me.add(qt)),((mt==null?void 0:mt.children)||[]).forEach(Ue)};return Ue(a==null?void 0:a.root),Me},[a]),ie=l.useMemo(()=>((ce==null?void 0:ce.jiraKeys)||[]).map(Me=>Re.find(Ue=>Ue.key===Me)||{key:Me,summary:"Summary unavailable",url:""}),[Re,ce]),fe=l.useMemo(()=>{if(!a||!ce||!ae)return[];const Me=new Set;gA(ce,Me);const Ue=vA(a.root,Me);return Ue?[Ue]:[]},[a,ce,ae]),we=Me=>{if(!a)return;const Ue={...Me(a),updatedAt:new Date().toISOString()};o(Ue),he.current=he.current.catch(()=>{}).then(()=>sl.update(Ue.id,Ue)).catch(()=>new Promise((mt,qt)=>{window.setTimeout(()=>{sl.update(Ue.id,Ue).then(mt).catch(qt)},120)})).catch(mt=>n.error(`Could not save mind map: ${mt.message||"unknown error"}`))},ke=()=>{const Me=h.trim()||"Untitled mind map";p(Me),we(Ue=>({...Ue,title:Me,root:Ue.root.text===Ue.title?{...Ue.root,text:Me}:Ue.root}))},Pe=Me=>{ce&&we(Ue=>({...Ue,root:eu(Ue.root,ce.id,mt=>({...mt,...Me}))}))},Ie=()=>{if(!ce||se)return;const Me=!ce.tested;we(Ue=>({...Ue,root:eu(Ue.root,ce.id,mt=>hA(mt,Me))}))},Ve=(Me=0)=>({id:`node-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`,text:"New idea",color:T0[Me%T0.length],tested:!1,children:[]}),Le=()=>{if(!ce)return;const Me=Ve((ce.children||[]).length);Pe({children:[...ce.children||[],Me],collapsed:!1}),xe.current=!0,m(Me.id)},je=()=>{if(!ce||!ae){Le();return}const Me=Ve(ae.children.findIndex(Ue=>Ue.id===ce.id)+1);we(Ue=>({...Ue,root:C4e(Ue.root,ce.id,Me)})),xe.current=!0,m(Me.id)},$e=Me=>{if(!ae||ge<0)return;const Ue=ae.id,mt=ge+Me;mt<0||mt>=ae.children.length||we(qt=>({...qt,root:eu(qt.root,Ue,Yt=>{const cn=[...Yt.children||[]],nn=cn.findIndex(Mt=>Mt.id===f),gn=nn+Me;if(nn<0||gn<0||gn>=cn.length)return Yt;const[St]=cn.splice(nn,1);return cn.splice(gn,0,St),{...Yt,children:cn}})}))},Ae=()=>{!ce||!ae||!Hh(a==null?void 0:a.root,ae.id)||we(Me=>({...Me,root:S4e(Me.root,ce.id)}))};l.useEffect(()=>{const Me=Ue=>{if(!(!a||!ce||Ue.defaultPrevented||Ue.isComposing||Ue.repeat)&&!(Ue.altKey||Ue.ctrlKey||Ue.metaKey)&&!(Ue.key!=="Enter"&&Ue.key!=="Tab")&&!(Ue.key==="Enter"&&A4e(Ue.target))){if(Ue.key==="Tab"){const mt=document.querySelector(".mind-map-inspector-card"),qt=(mt==null?void 0:mt.matches(":hover"))||!1,Yt=Ue.target instanceof Element&&!!Ue.target.closest(".mind-map-inspector-card");if(qt&&!Yt)return}if(Ue.preventDefault(),Ue.key==="Tab"){Ue.shiftKey?Ae():Le();return}je()}};return window.addEventListener("keydown",Me),()=>window.removeEventListener("keydown",Me)},[a,ce,ae]);const We=()=>{if(!ce||!ae)return;const Me=ae.id;we(Ue=>({...Ue,root:Wy(Ue.root,ce.id)})),m(Me),n.success("Idea removed")},De=()=>{ae&&(te(yA(a.root,ae.id)||[]),G(!0))},Je=()=>{const Me=Y[Y.length-1];if(!ce||!ae||!Me)return;if(Pk(a.root,ce.id,Me)===a.root){n.error("Please choose another valid parent node.");return}we(mt=>({...mt,root:Pk(mt.root,ce.id,Me)})),G(!1),n.success(`Moved “${ce.text||"idea"}” successfully.`)},Ye=()=>{I(!0)},Ge=async()=>{A(!0);try{const Me=await Wn.saveMindMapNodeMaxWidth(T),Ue=Number.isInteger(Me.mindMapNodeMaxWidth)?Me.mindMapNodeMaxWidth:null;M(Ue),z(Ue),n.success(Ue?"Mind map node width saved":"Using default mind map node widths")}catch(Me){n.error(`Could not save node width: ${Me.message||"unknown error"}`)}finally{A(!1)}},He=async()=>{const Me=b4e(L);if(!Me){n.error("Enter a Jira No such as PROJ-123 or a Jira issue link.");return}q(!0);try{const Ue=await sl.resolveJiraIssue(L);if(Re.some(mt=>mt.key===Ue.key)){n.info(`${Ue.key} is already in this map.`);return}we(mt=>({...mt,jiraIssues:[...mt.jiraIssues||[],Ue]})),F(""),n.success(`${Ue.key} added to this map.`)}catch(Ue){n.error(Ue.message||`Could not load ${Me.key} from Jira.`)}finally{q(!1)}},nt=Me=>{we(Ue=>({...Ue,jiraIssues:(Ue.jiraIssues||[]).filter(mt=>mt.key!==Me),root:pA(Ue.root,Me)}))},ft=async Me=>{K(Me.key);try{const Ue=await sl.resolveJiraIssue(Me.key);we(mt=>({...mt,jiraIssues:(mt.jiraIssues||[]).map(qt=>qt.key===Me.key?{...qt,summary:Ue.summary,url:Ue.url||qt.url}:qt)})),n.success(`${Me.key} summary refreshed`)}catch(Ue){n.error(Ue.message||`Could not refresh ${Me.key}.`)}finally{K("")}},vt=Me=>{Pe({jiraKeys:((ce==null?void 0:ce.jiraKeys)||[]).filter(Ue=>Ue!==Me)})},qe=Me=>{Me&&(m(Me),ue(!0))},Ee=(Me,Ue)=>{var qt;if(Me.button!==0)return;const mt=Me.currentTarget;mt&&(Me.preventDefault(),(qt=mt.setPointerCapture)==null||qt.call(mt,Me.pointerId),de.current={canvas:mt,pointerId:Me.pointerId,startX:Me.clientX,startY:Me.clientY,startScrollLeft:mt.scrollLeft,startScrollTop:mt.scrollTop,nodeId:Ue,moved:!1},Ue&&qe(Ue),N(!0))},Be=Me=>{const Ue=de.current;if(!Ue||Ue.pointerId!==Me.pointerId)return;const mt=Ue.canvas||Me.currentTarget;!Ue.moved&&Math.hypot(Me.clientX-Ue.startX,Me.clientY-Ue.startY)<3||(Ue.moved=!0,mt.scrollLeft=Ue.startScrollLeft-(Me.clientX-Ue.startX),mt.scrollTop=Ue.startScrollTop-(Me.clientY-Ue.startY))},Xe=Me=>{var mt,qt,Yt,cn;const Ue=de.current;!Ue||Me.pointerId!==void 0&&Ue.pointerId!==Me.pointerId||(!Ue.moved&&!Ue.nodeId&&ue(!1),(qt=(mt=Ue.canvas)==null?void 0:mt.releasePointerCapture)==null||qt.call(mt,Ue.pointerId),(cn=(Yt=Me.currentTarget)==null?void 0:Yt.releasePointerCapture)==null||cn.call(Yt,Ue.pointerId),de.current=null,N(!1))};l.useEffect(()=>{const Me=Ue=>Xe(Ue);return window.addEventListener("pointerup",Me),window.addEventListener("pointercancel",Me),window.addEventListener("blur",Me),()=>{window.removeEventListener("pointerup",Me),window.removeEventListener("pointercancel",Me),window.removeEventListener("blur",Me)}},[]);const Qe=Me=>{we(Ue=>({...Ue,root:eu(Ue.root,Me,mt=>({...mt,collapsed:!mt.collapsed}))}))},Ze=(Me,Ue=!1)=>{we(mt=>({...mt,root:h2(mt.root,Me,!0)})),Ue&&E(mt=>mt+1)},it=async Me=>{var Ue;if(a)try{if(Me==="xmind"){const{mindMapToXmindBlob:mt}=await pu(async()=>{const{mindMapToXmindBlob:Yt}=await import("./xmindAdapter-CLCxNrZn.js");return{mindMapToXmindBlob:Yt}},[]),qt=await mt(a);tu(`${a.title||"mind-map"}.xmind`,qt,"application/octet-stream"),n.success("XMind exported");return}if(Me==="markdown"){tu(`${a.title||"mind-map"}.md`,cA(a),"text/markdown;charset=utf-8"),n.success("Markdown exported");return}if(Me==="jpg"){(Ue=document.fonts)!=null&&Ue.ready&&await document.fonts.ready,u({...a,root:h2(a.root,!1,!0)}),await new Promise(mt=>requestAnimationFrame(()=>requestAnimationFrame(mt)));try{const mt=await T4e(J.current);tu(`${a.title||"mind-map"}.jpg`,mt,"image/jpeg"),n.success("JPG exported")}finally{u(null)}return}tu(`${a.title||"mind-map"}.json`,`${JSON.stringify(a,null,2)}
623
- `,"application/json;charset=utf-8"),n.success("JSON exported")}catch(mt){n.error(`Could not export this map: ${mt.message||"unknown error"}`)}},ut=async Me=>{var mt;const Ue=(mt=Me.target.files)==null?void 0:mt[0];if(Me.target.value="",!(!Ue||!a))try{const qt=Ue.name.toLowerCase().endsWith(".xmind"),Yt=qt?null:await Ue.text(),cn=Ue.name.toLowerCase().endsWith(".json"),nn=qt?await(async()=>{const{xmindBlobToMindMap:Mt}=await pu(async()=>{const{xmindBlobToMindMap:Rt}=await import("./xmindAdapter-CLCxNrZn.js");return{xmindBlobToMindMap:Rt}},[]);return Mt(await Ue.arrayBuffer(),hS(Ue.name))})():cn?$4(JSON.parse(Yt),hS(Ue.name)):uA(Yt,hS(Ue.name)),gn={...nn,id:a.id,title:nn.title||a.title,createdAt:a.createdAt,updatedAt:new Date().toISOString()};await he.current.catch(()=>{});const St=await sl.update(a.id,gn);o(St),qe(gn.root.id),p(St.title),n.success(`${qt?"XMind":cn?"JSON":"Markdown"} imported into this map`)}catch(qt){n.error(`Could not import this file: ${qt.message||"invalid format"}`)}},pt=async()=>{if(a!=null&&a.filePath)try{await Wn.openFolder(a.filePath)}catch(Me){n.error(`Could not open map folder: ${Me.message||"unknown error"}`)}},Lt=async()=>{if(a!=null&&a.filePath)try{await navigator.clipboard.writeText(a.filePath),n.success("Mind map file path copied")}catch(Me){n.error(`Could not copy file path: ${Me.message||"clipboard unavailable"}`)}};if(v)return c.jsx("div",{className:"mind-map-missing",children:c.jsx(rr,{tip:"Loading mind map..."})});if(!a)return c.jsxs("div",{className:"mind-map-missing",children:[c.jsx(Xt,{description:"This mind map could not be found."}),c.jsx(Oe,{onClick:()=>t("mind-maps"),children:"Back to mind maps"})]});const Pt=ne&&!!f;return c.jsxs("div",{className:`mind-map-detail-page${Z?" is-canvas-fullscreen":""}`,children:[c.jsxs("div",{className:"mind-map-detail-toolbar",children:[c.jsxs("div",{className:"mind-map-detail-heading",children:[c.jsx(Oe,{"aria-label":"Back to mind maps",className:"mind-map-back-button",icon:c.jsx(ec,{}),onClick:()=>t("mind-maps"),type:"text"}),c.jsx("div",{className:"mind-map-breadcrumbs",children:c.jsx("button",{onClick:()=>t("mind-maps"),type:"button",children:"Mind maps"})}),c.jsx(Ct,{"aria-label":"Mind map title",className:"mind-map-title-input",onBlur:ke,onChange:Me=>p(Me.target.value),onPressEnter:Me=>Me.currentTarget.blur(),value:h})]}),c.jsxs(ct,{className:"mind-map-detail-actions",size:8,children:[c.jsx("input",{ref:r,accept:".xmind,.json,.md,.markdown,.txt",className:"mind-map-hidden-input",onChange:ut,type:"file"}),c.jsx(Oe,{icon:c.jsx(X$,{}),onClick:()=>{var Me;return(Me=r.current)==null?void 0:Me.click()},children:"Import"}),c.jsx(Bl,{menu:{items:[{key:"xmind",icon:c.jsx(tI,{}),label:"Export XMind"},{key:"jpg",icon:c.jsx(Uv,{}),label:"Export JPG"},{key:"json",icon:c.jsx(wa,{}),label:"Export JSON"},{key:"markdown",icon:c.jsx(Ui,{}),label:"Export Markdown"}],onClick:({key:Me})=>it(Me)},trigger:["click"],children:c.jsx(Oe,{icon:c.jsx(ql,{}),children:"Export"})}),c.jsx(Oe,{"aria-label":"Mind map settings",icon:c.jsx(Gl,{}),onClick:Ye,children:"Settings"}),c.jsx(Oe,{icon:c.jsx(Q$,{}),onClick:()=>n.success("All changes saved to the data file"),children:"Save"})]})]}),c.jsxs("div",{className:`mind-map-detail-layout${Pt?"":" is-inspector-collapsed"}`,children:[c.jsxs(It,{className:"mind-map-canvas-card",styles:{body:{padding:0}},children:[c.jsxs("div",{className:"mind-map-canvas-header",children:[c.jsxs("div",{className:"mind-map-canvas-heading",children:[c.jsx(io,{className:"mind-map-eyebrow",children:"CANVAS"}),c.jsxs("div",{className:"mind-map-canvas-title-row",children:[c.jsx(zk,{level:3,children:"Map canvas"}),c.jsx(io,{className:"mind-map-canvas-tip",type:"secondary",children:"Tip: keep each branch short and concrete."})]})]}),c.jsxs(ct,{className:"mind-map-canvas-controls",size:12,children:[c.jsx(Oe,{"aria-label":Z?"Exit canvas full screen":"Enter canvas full screen",icon:Z?c.jsx(T9,{}):c.jsx(P9,{}),onClick:()=>{ee(Me=>!Me),w(Me=>Me+1)},type:"text"}),c.jsx(Oe,{"aria-label":Pt?"Collapse inspector":"Show inspector",className:"mind-map-inspector-control",icon:Pt?c.jsx(Xve,{}):c.jsx(Zve,{}),onClick:()=>ue(Me=>!Me),type:"text"}),c.jsxs(ct,{className:"mind-map-tree-actions",size:4,children:[c.jsx(Oe,{icon:c.jsx(h9,{}),onClick:()=>Ze(!1),children:"Expand all"}),c.jsx(Oe,{icon:c.jsx(m9,{}),onClick:()=>Ze(!0,!0),children:"Collapse all"})]}),c.jsxs(ct,{className:"mind-map-zoom-control",size:4,children:[c.jsx(Oe,{"aria-label":"Zoom out",disabled:b<=.5,icon:c.jsx(RD,{}),onClick:()=>{var Me;return(Me=be.current)==null?void 0:Me.zoomAt(Math.max(.5,Number((b-.1).toFixed(2))))},type:"text"}),c.jsxs("button",{"aria-label":"Reset canvas view",className:"mind-map-zoom-label",onClick:()=>{C(1),w(Me=>Me+1)},type:"button",children:[Math.round(b*100),"%"]}),c.jsx(Oe,{"aria-label":"Zoom in",disabled:b>=2,icon:c.jsx(OD,{}),onClick:()=>{var Me;return(Me=be.current)==null?void 0:Me.zoomAt(Math.min(2,Number((b+.1).toFixed(2))))},type:"text"})]})]})]}),c.jsx(L4e,{ref:be,isPanning:R,map:a,onCanvasPointerDown:Ee,onCanvasPointerMove:Be,onCanvasPointerUp:Xe,onSelect:qe,onToggle:Qe,onZoomChange:C,recenterLayoutToken:$,resetViewToken:x,selectedId:f,zoom:b,jiraIssues:Re,nodeMaxWidth:j}),c.jsx("div",{className:"mind-map-canvas-footer",children:c.jsxs(io,{type:"secondary",children:[c.jsx("span",{className:"mind-map-key",children:"⌘"})," Click to select ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," ",c.jsx("span",{className:"mind-map-key",children:"Enter"})," sibling ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," ",c.jsx("span",{className:"mind-map-key",children:"Tab"})," child ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," Drag canvas to pan ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," ⌘ + Scroll to zoom ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," Changes save automatically"]})})]}),c.jsx(It,{className:"mind-map-inspector-card",children:c.jsxs("div",{className:"mind-map-inspector-shell",children:[c.jsxs("div",{className:"mind-map-inspector-header",children:[c.jsxs("div",{children:[c.jsx(io,{className:"mind-map-eyebrow",children:"INSPECTOR"}),c.jsxs("div",{className:"mind-map-inspector-title-row",children:[c.jsx(zk,{level:3,children:"Selected idea"}),(ce==null?void 0:ce.id)===a.root.id?c.jsx($t,{color:"purple",children:"Root"}):null,se?c.jsx($t,{className:"mind-map-comment-tag",children:"Comment"}):null]})]}),(ce==null?void 0:ce.id)!==a.root.id&&c.jsxs("div",{className:"mind-map-inspector-header-actions",children:[ae&&c.jsxs("div",{className:"mind-map-sibling-order-actions",children:[c.jsx(yn,{title:"Move idea up",children:c.jsx(Oe,{"aria-label":"Move idea up",disabled:ge<=0,icon:c.jsx(k9,{}),onClick:()=>$e(-1)})}),c.jsx(yn,{title:"Move idea down",children:c.jsx(Oe,{"aria-label":"Move idea down",disabled:ge<0||ge>=ae.children.length-1,icon:c.jsx(I9,{}),onClick:()=>$e(1)})})]}),c.jsx(Gr,{cancelText:"Cancel",description:"This will also remove all child ideas.",okButtonProps:{danger:!0},okText:"Delete",onConfirm:We,placement:"topRight",title:"Delete this idea?",children:c.jsx(Oe,{"aria-label":"Delete selected idea",className:"mind-map-inline-delete",danger:!0,icon:c.jsx(Fn,{}),type:"text"})})]})]}),c.jsx("div",{className:"mind-map-inspector-content",children:ce&&c.jsxs("div",{className:"mind-map-inspector-fields",children:[c.jsxs("section",{className:"mind-map-inspector-section",children:[c.jsx("div",{className:"mind-map-inspector-section-title",children:"Content"}),c.jsxs("div",{className:"mind-map-idea-label-row",children:[c.jsx("label",{className:"mind-map-field-label",htmlFor:"mind-map-node-text",children:"Idea"}),c.jsxs("div",{className:"mind-map-auto-width-field",children:[c.jsx(yn,{title:"When off, text wraps only at manual line breaks.",placement:"top",children:c.jsx("span",{className:"mind-map-auto-width-label",children:"Auto width"})}),c.jsx(Ja,{"aria-label":"Auto width",checked:ce.autoWidth!==!1,onChange:Me=>Pe({autoWidth:Me}),size:"small"})]})]}),c.jsx(Ct.TextArea,{autoSize:{minRows:2,maxRows:8},className:"mind-map-idea-input",id:"mind-map-node-text",onChange:Me=>Pe({text:Me.target.value}),placeholder:"Name this idea",ref:ye,value:ce.text}),ae&&c.jsxs(c.Fragment,{children:[c.jsx("label",{className:"mind-map-field-label",htmlFor:"mind-map-node-edge-label",children:"Line label"}),c.jsx(Ct,{id:"mind-map-node-edge-label",onChange:Me=>Pe({edgeLabel:Me.target.value||void 0}),placeholder:"Label this connection",value:ce.edgeLabel||""})]}),c.jsxs("div",{className:"mind-map-notes-label-row",children:[c.jsx("label",{className:"mind-map-field-label",htmlFor:"mind-map-node-notes",children:"Notes"}),c.jsx(Oe,{className:"mind-map-notes-toggle",onClick:()=>oe(Me=>!Me),size:"small",type:"text",children:re?"Hide notes":(kt=ce.notes)!=null&&kt.trim()?"Edit notes":"Add note"})]}),re&&c.jsx(Ct.TextArea,{autoSize:{minRows:4,maxRows:8},id:"mind-map-node-notes",onChange:Me=>Pe({notes:Me.target.value}),placeholder:"Add a note or a prompt...",value:ce.notes||""})]}),!se&&c.jsxs("section",{className:"mind-map-inspector-section",children:[c.jsx("div",{className:"mind-map-inspector-section-title",children:"Test status"}),c.jsxs("div",{className:"mind-map-tested-field",children:[c.jsxs("div",{children:[c.jsx("span",{className:"mind-map-field-label",children:"Tested"}),c.jsx(io,{type:"secondary",children:"Updates this node and all child nodes."})]}),c.jsxs("div",{className:"mind-map-tested-control",children:[c.jsx("span",{className:"mind-map-tested-state",children:ce.tested?"Tested":"Pending"}),c.jsx(Ja,{checked:!!ce.tested,onChange:Ie,size:"small"})]})]})]}),c.jsxs("section",{className:"mind-map-inspector-section",children:[c.jsx("div",{className:"mind-map-inspector-section-title",children:"Jira"}),ie.length>0&&c.jsx("div",{"aria-label":"Selected Jira issues",className:"mind-map-selected-jira-list",children:ie.map(Me=>c.jsxs("div",{className:"mind-map-selected-jira-item",children:[c.jsxs("button",{className:"mind-map-selected-jira-open",disabled:!Me.url,onClick:()=>hr(Me.url),title:Me.url?"Open in Jira":"Jira link unavailable",type:"button",children:[c.jsx($t,{color:"blue",children:Me.key}),c.jsx("span",{className:"mind-map-selected-jira-summary",children:Me.summary||"Summary unavailable"}),Me.url&&c.jsx(ul,{})]}),c.jsx("button",{"aria-label":`Untag ${Me.key}`,className:"mind-map-selected-jira-untag",onClick:()=>vt(Me.key),title:`Untag ${Me.key}`,type:"button",children:c.jsx(Xo,{})})]},Me.key))}),c.jsx($n,{allowClear:!0,"aria-label":"Jira tags",className:"mind-map-node-jira-select",filterOption:(Me,Ue)=>`${(Ue==null?void 0:Ue.value)||""} ${(Ue==null?void 0:Ue.summary)||""}`.toLowerCase().includes(Me.toLowerCase()),id:"mind-map-node-jira",mode:"multiple",onChange:Me=>{Pe({jiraKeys:Me}),V(!1),requestAnimationFrame(()=>{var Ue,mt;return(mt=(Ue=ze.current)==null?void 0:Ue.blur)==null?void 0:mt.call(Ue)})},options:Re.map(Me=>({label:c.jsxs("div",{className:"mind-map-jira-select-option",children:[c.jsx("span",{className:"mind-map-jira-select-option-key",children:Me.key}),c.jsx("span",{className:"mind-map-jira-select-option-summary",children:Me.summary||"Summary unavailable"})]}),summary:Me.summary||"",value:Me.key})),maxTagCount:0,maxTagPlaceholder:"Select Jira issues",onOpenChange:V,placeholder:Re.length?"Select Jira issues":"Add Jira issues in Settings",showSearch:!0,open:X,ref:ze,value:ce.jiraKeys||[]})]})]})}),c.jsxs("div",{className:"mind-map-inspector-actions",children:[c.jsx(yn,{title:"Add a child idea (Tab)",children:c.jsx(Oe,{block:!0,className:"mind-map-add-child",icon:c.jsx(Xn,{}),onClick:Le,type:"primary",children:"Add child idea"})}),ae&&c.jsx(Oe,{block:!0,className:"mind-map-move-button",icon:c.jsx(tI,{}),onClick:De,children:"Move idea"})]})]})})]}),c.jsxs(I$,{className:"mind-map-settings-drawer",onClose:()=>I(!1),open:O,title:"Mind map settings",width:520,children:[c.jsxs("div",{className:"mind-map-settings-section",children:[c.jsx(io,{className:"mind-map-settings-section-title",children:"Node width"}),c.jsx(io,{className:"mind-map-settings-description",children:"Set a maximum width for regular nodes. Leave empty to keep the current default (255px)."}),c.jsxs("div",{className:"mind-map-node-width-control",children:[c.jsx(cf,{"aria-label":"Maximum node width",className:"mind-map-node-width-input",max:800,min:120,onChange:Me=>z(Me??null),placeholder:"Default",step:10,value:T??void 0}),c.jsx(Oe,{disabled:!P||T===j,loading:H,onClick:Ge,type:"primary",children:"Save"})]})]}),c.jsxs("div",{className:"mind-map-settings-section",children:[c.jsx(io,{className:"mind-map-settings-section-title",children:"File location"}),c.jsx(io,{className:"mind-map-settings-description",children:"This mind map is stored locally in the following file."}),c.jsxs(ct.Compact,{block:!0,className:"mind-map-file-location-row",children:[c.jsxs("div",{className:`mind-map-file-location-display${a.filePath?"":" is-unavailable"}`,title:a.filePath||"File location unavailable",children:[c.jsx(Oe,{"aria-label":"Open mind map folder",className:"mind-map-file-location-folder",disabled:!a.filePath,icon:c.jsx(Fr,{}),onClick:pt,type:"text"}),c.jsx(io,{className:"mind-map-file-location-path",children:a.filePath||"File location unavailable"})]}),c.jsx(Oe,{disabled:!a.filePath,icon:c.jsx(fo,{}),onClick:Lt,children:"Copy"})]})]}),c.jsxs("div",{className:"mind-map-settings-section",children:[c.jsx(io,{className:"mind-map-settings-section-title",children:"Jira issues"}),c.jsx(io,{className:"mind-map-settings-description",children:"Add issues to this map by Jira No or a Jira issue link, then tag them from the selected node inspector."}),c.jsxs(ct.Compact,{block:!0,className:"mind-map-jira-add-row",children:[c.jsx(Ct,{onChange:Me=>F(Me.target.value),onPressEnter:He,placeholder:"PROJ-123 or https://.../browse/PROJ-123",value:L}),c.jsx(Oe,{loading:U,onClick:He,type:"primary",children:"Add"})]}),c.jsx("div",{className:"mind-map-jira-list",children:Re.length?Re.map(Me=>c.jsxs("div",{className:`mind-map-jira-list-item ${Me.url?"is-clickable":""} ${_e.has(Me.key)?"is-tagged":""}`,onClick:()=>Me.url&&hr(Me.url),onKeyDown:Ue=>{Ue.target!==Ue.currentTarget||!Me.url||(Ue.key==="Enter"||Ue.key===" ")&&(Ue.preventDefault(),hr(Me.url))},role:Me.url?"link":void 0,tabIndex:Me.url?0:void 0,children:[c.jsx("div",{className:"mind-map-jira-list-item-main",children:c.jsxs("div",{className:"mind-map-jira-list-item-title",children:[c.jsx($t,{color:"blue",children:Me.key}),c.jsx(io,{ellipsis:{tooltip:!0},children:Me.summary||"Summary unavailable"})]})}),c.jsxs("div",{className:"mind-map-jira-list-item-delete",onClick:Ue=>Ue.stopPropagation(),children:[c.jsx(Oe,{"aria-label":`Refresh summary for ${Me.key}`,className:"mind-map-jira-refresh",disabled:!!_,icon:c.jsx(Xa,{spin:_===Me.key}),onClick:()=>void ft(Me),title:`Refresh summary for ${Me.key}`,type:"text"}),c.jsx(Gr,{cancelText:"Cancel",description:"Existing node tags for this issue will also be removed.",okButtonProps:{danger:!0},okText:"Remove",onConfirm:()=>nt(Me.key),placement:"left",title:`Remove ${Me.key}?`,children:c.jsx(Oe,{"aria-label":`Remove ${Me.key}`,danger:!0,icon:c.jsx(Fn,{}),type:"text"})})]})]},Me.id||Me.key)):c.jsx(Xt,{className:"mind-map-jira-empty",description:"No Jira issues added yet.",image:Xt.PRESENTED_IMAGE_SIMPLE})})]})]}),c.jsxs(bn,{cancelText:"Cancel",okText:"Move",onCancel:()=>G(!1),onOk:Je,open:W,title:`Move “${(ce==null?void 0:ce.text)||"idea"}”`,children:[c.jsx(io,{type:"secondary",children:"Choose the node that should become the new parent. The entire subtree will move with it."}),c.jsx(Jl,{changeOnSelect:!0,className:"mind-map-move-select",onChange:te,options:fe,placeholder:"Select a parent node",showSearch:!0,value:Y})]}),s&&c.jsx(_4e,{map:s,nodeMaxWidth:j,ref:J})]})}async function Ak(e,t={}){if(typeof window>"u"||!("Notification"in window)||Notification.permission!=="granted")return!1;const n={body:"",icon:"/devbuddy-192.png",tag:`devbuddy-notification-${Date.now()}`,...t};try{if("serviceWorker"in navigator){const r=await navigator.serviceWorker.ready;if(r.active)return r.active.postMessage({type:"SHOW_NOTIFICATION",title:e,...n}),!0}return new Notification(e,n),!0}catch{return!1}}const{Content:H4e,Sider:F4e}=Js,{Title:_k,Text:Bc}=xn,Lk={dark:"#171c2b",light:"#dbeafe"},V4e="var(--db-font-sans)",U4e=(e,t)=>{var r;const n=(r=e==null?void 0:e.scripts)==null?void 0:r.find(a=>a.id===t);return n?n.name:t==="install"?"Install":t.startsWith("package:")?t.slice(8):t},W4e=(e,t)=>{const[n,...r]=String(t).split(":"),a=r.join(":"),o=e.find(s=>String(s.id)===n);return`${(o==null?void 0:o.alias)||(o==null?void 0:o.folder)||"Launcher"} · ${U4e(o,a)}`},wA=["overview","launcher","cron-jobs","clipboard","ports","image-compress","json-to-typescript","jira-filters","todo-list","reminders","memos","mind-maps","postman","bookmark-sync","file-organizer","branch-sync","branch-health","package-upgrade","package-versions","presentation-plan","presentation-view","settings","dev-configurations","errors"],q4e={overview:"Overview",launcher:"Launcher","cron-jobs":"Cron Jobs",clipboard:"Clipboard",ports:"Port Diagnostic","todo-list":"To-Do","todo-archived":"Archived Tasks",reminders:"Reminders",memos:"Memos","mind-maps":"Mind Maps","pr-review":"PR Review","pr-conflicts":"Resolve Conflicts","pr-conflict":"Resolve Conflicts","jira-filters":"Jira Workspace","presentation-plan":"Presentations","presentation-view":"Presentation","memo-reader":"Reading","branch-sync":"Branch Sync","branch-health":"Branch Health","package-upgrade":"Package Upgrade","package-versions":"Package Versions",postman:"Postman","image-compress":"Image compression","json-to-typescript":"JSON to TypeScript","bookmark-sync":"Bookmark Sync","file-organizer":"Folder Organizer",settings:"Settings","dev-configurations":"Dev Configurations",errors:"Error Logs"},$A=e=>{if(e==="mind-maps"||e==="mind-maps/")return{page:"mind-maps",mindMapId:null};if(e.startsWith("mind-maps/")){const t=e.slice(10).split("?")[0];return t?{page:"mind-maps",mindMapId:decodeURIComponent(t)}:null}return null},K4e=()=>{const t=(window.location.hash||"#/overview").slice(2),n=$A(t);if(n)return n;if(t==="memo-reader"||t.startsWith("memo-reader?"))return{page:"memo-reader",memoId:new URLSearchParams(t.split("?")[1]||"").get("id")||null};if(t.startsWith("plugin:"))return{page:"plugin",pluginId:t.slice(7)};if(t.startsWith("static:"))return{page:"static-page",staticId:t.slice(7)};if(t.startsWith("logs/"))return{page:"logs",pluginId:null};if(["todo-list/archived","todo-archived"].includes(t))return{page:"todo-archived",pluginId:null};if(t.startsWith("pr-review"))return{page:"pr-review",pluginId:null};if(t==="pr-conflicts"||t.startsWith("pr-conflicts?"))return{page:"pr-conflicts",pluginId:null};if(t.startsWith("pr-conflict"))return{page:"pr-conflict",pluginId:null};if(t.startsWith("branch-sync"))return{page:"branch-sync",pluginId:null};if(t.startsWith("branch-health"))return{page:"branch-health",pluginId:null};if(t==="launcher"||t.startsWith("launcher?")){const r=new URLSearchParams(t.split("?")[1]||"");return{page:"launcher",pluginId:null,launcherRunningOnly:r.get("running")==="1",launcherServiceId:r.get("service")||null}}return t==="home"?{page:"overview",pluginId:null}:wA.includes(t)?{page:t,pluginId:null}:{page:"overview",pluginId:null}};function G4e({theme:e,onThemeChange:t}){var We;const{message:n}=Pr.useApp(),r=K4e(),[a,o]=l.useState([]),[s,u]=l.useState(new Set),[f,m]=l.useState({}),[h,p]=l.useState([]),[v,y]=l.useState(!0),[b,C]=l.useState(null),[x,w]=l.useState(!1),[$,E]=l.useState(!1),[R,N]=l.useState([]),[O,I]=l.useState([]),[j,M]=l.useState(r.page),[T,z]=l.useState(r.launcherRunningOnly||!1),[P,B]=l.useState(r.launcherServiceId||null),[H,A]=l.useState(r.mindMapId||null),[L,F]=l.useState(r.memoId||null),[U,q]=l.useState(()=>{var De;return((De=window.matchMedia)==null?void 0:De.call(window,"(max-width: 991.98px)").matches)??!1}),[_,K]=l.useState(null),[X,V]=l.useState(!1),[W,G]=l.useState(!1),[Y,te]=l.useState(""),[ne,ue]=l.useState(null),[Z,ee]=l.useState(!1),[re,oe]=l.useState(null),de=l.useRef(null),be=l.useRef(new Map),J=l.useRef(null),ye=l.useCallback((De,Je)=>{De.preventDefault(),De.stopPropagation(),oe({key:Je,left:Math.min(De.clientX,Math.max(8,window.innerWidth-220)),top:Math.min(De.clientY,Math.max(8,window.innerHeight-58))})},[]),xe=l.useCallback(De=>{var Ge,He,nt;const Je=(He=(Ge=De.target).closest)==null?void 0:He.call(Ge,".ant-menu-item"),Ye=(nt=Je==null?void 0:Je.querySelector("[data-sidebar-key]"))==null?void 0:nt.dataset.sidebarKey;Ye&&ye(De,Ye)},[ye]),ze=l.useCallback(()=>{if(!(re!=null&&re.key))return;const De=new URL(window.location.href);De.hash=`#/${re.key}`,window.open(De.toString(),"_blank","noopener,noreferrer"),oe(null)},[re]),[he,ce]=l.useState(r.pluginId?{id:r.pluginId,name:"Plugin"}:null),[se,ae]=l.useState(null),[ge,Re]=l.useState(""),_e=async({showLoading:De=!1}={})=>{De&&y(!0);try{const[Je,Ye,Ge]=await Promise.all([Br.list(),Br.running(),Zc.list().catch(()=>[])]);o(Je),p(Array.isArray(Ge)?Ge:[]),Array.isArray(Ye)?(u(new Set(Ye)),m({})):(u(new Set((Ye==null?void 0:Ye.running)||[])),m((Ye==null?void 0:Ye.errorCounts)||{})),w(!0),C(null),E(!0)}catch(Je){C((Je==null?void 0:Je.message)||"Unable to load service and runtime data."),E(!1)}finally{De&&y(!1)}};l.useEffect(()=>{const De=async()=>{try{const[Ye,Ge]=await Promise.all([Br.running(),Zc.list().catch(()=>[])]);Array.isArray(Ye)?(u(new Set(Ye)),m({})):(u(new Set((Ye==null?void 0:Ye.running)||[])),m((Ye==null?void 0:Ye.errorCounts)||{})),Array.isArray(Ge)&&p(Ge)}catch{}},Je=setInterval(()=>{De()},5e3);return()=>clearInterval(Je)},[]),l.useEffect(()=>{if(!x)return;const De=Object.fromEntries(Object.entries(f).map(([Xe,Qe])=>[Xe,Number(Qe)||0])),Je=(Array.isArray(h)?h:[]).filter(Xe=>{var Qe;return(Qe=Xe==null?void 0:Xe.source)==null?void 0:Qe.startsWith("Launcher")}),Ye=new Set(Je.map(Xe=>Xe.id).filter(Boolean)),Ge=de.current;if(!Ge){de.current={counts:De,ids:Ye};return}const He=Object.entries(De).filter(([Xe,Qe])=>Qe>(Ge.counts[Xe]||0)).map(([Xe,Qe])=>({key:Xe,delta:Qe-(Ge.counts[Xe]||0),count:Qe})),nt=Je.filter(Xe=>Xe.id&&!Ge.ids.has(Xe.id));de.current={counts:De,ids:Ye};const ft=[...He.map(Xe=>({dedupeKey:Xe.key,label:W4e(a,Xe.key),count:Xe.delta})),...nt.map(Xe=>({dedupeKey:Xe.source,label:`${Xe.source.replace(/^Launcher:\s*/,"")} · ${Xe.message||"Script error"}`,count:1}))],vt=Date.now(),qe=ft.filter(Xe=>{const Qe=be.current.get(Xe.dedupeKey)||0;return vt-Qe<1e4?!1:(be.current.set(Xe.dedupeKey,vt),!0)});if(qe.length===0)return;const Ee=qe.reduce((Xe,Qe)=>Xe+Qe.count,0),Be=qe.slice(0,3).map(Xe=>Xe.label).join(";");Ak(Ee===1?"Launcher script error":`Launcher: ${Ee} new script errors`,{body:Be||"A Launcher script reported a new error."})},[f,h,x,a]),l.useEffect(()=>{let De=!1;const Je=async()=>{var Ge;try{const He=await Td.claimDue();if(De||!((Ge=He==null?void 0:He.due)!=null&&Ge.length))return;await Promise.all(He.due.map(async nt=>{await Ak(nt.title,{body:nt.content,tag:`devbuddy-reminder-${nt.id}`})||n.info({content:`${nt.title}:${nt.content}`,duration:8})}))}catch{}};Je();const Ye=window.setInterval(()=>{Je()},1e4);return()=>{De=!0,window.clearInterval(Ye)}},[n]);const ie=async(De=!1)=>{V(!0);try{K(await oI.status(De))}catch{K(Je=>Je||{currentVersion:jd.version,latestVersion:jd.version,updateAvailable:!1,releases:[],sourceUnavailable:!0})}finally{V(!1)}},fe=()=>_e({showLoading:!0}),we=()=>{ue(null),ee(!0)},ke=()=>{const De=ne==null?void 0:ne.success;ee(!1),De&&window.location.reload()},Pe=async(De="latest")=>{G(!0),te(De),ue(null);try{const Je=await oI.selfUpdate(De);ue({success:!0,message:Je.message}),K(Ye=>Ye&&{...Ye,currentVersion:De==="latest"?Ye.latestVersion:De,updateAvailable:De==="latest"?!1:De!==Ye.latestVersion})}catch(Je){ue({success:!1,message:Je.message||"DevBuddy could not be updated."})}finally{G(!1)}},Ie=async De=>{if(De){Re("Loading plugin…");try{Re(De.view?await(await fetch(De.view)).text():"This plugin does not provide a view yet.")}catch{Re("Failed to load the plugin view.")}}};l.useEffect(()=>{Promise.all([_e({showLoading:!0}),lye.list().then(N),Kc.list().then(I)]).catch(De=>n.error(De.message)),ie()},[]),l.useEffect(()=>{const De=()=>{const Ye=(window.location.hash||"#/overview").slice(2),Ge=$A(Ye);if(Ge){ce(null),ae(null),M("mind-maps"),A(Ge.mindMapId);return}if(Ye==="memo-reader"||Ye.startsWith("memo-reader?")){const He=new URLSearchParams(Ye.split("?")[1]||"");ce(null),ae(null),M("memo-reader"),A(null),F(He.get("id")||null);return}if(Ye.startsWith("plugin:")){const He=Ye.slice(7),nt=R.find(ft=>ft.id===He);nt?(ae(null),M("plugin"),A(null),ce(nt),Ie(nt)):R.length>0&&(window.location.hash="#/overview")}else if(Ye.startsWith("static:")){const He=Ye.slice(7),nt=O.find(ft=>String(ft.id)===String(He));nt?(ce(null),M("static-page"),A(null),ae(nt)):O.length>0&&(window.location.hash="#/overview")}else if(Ye.startsWith("logs/"))ce(null),ae(null),M("logs"),A(null);else if(["todo-list/archived","todo-archived"].includes(Ye))ce(null),ae(null),M("todo-archived"),A(null);else if(Ye.startsWith("pr-review"))ce(null),ae(null),M("pr-review"),A(null);else if(Ye==="pr-conflicts"||Ye.startsWith("pr-conflicts?"))ce(null),ae(null),M("pr-conflicts"),A(null);else if(Ye.startsWith("pr-conflict"))ce(null),ae(null),M("pr-conflict"),A(null);else if(Ye.startsWith("branch-sync"))ce(null),ae(null),M("branch-sync"),A(null);else if(Ye.startsWith("branch-health"))ce(null),ae(null),M("branch-health"),A(null);else if(Ye==="launcher"||Ye.startsWith("launcher?")){const He=new URLSearchParams(Ye.split("?")[1]||"");ce(null),ae(null),M("launcher"),A(null),z(He.get("running")==="1"),B(He.get("service")||null)}else Ye==="home"||wA.includes(Ye)?(ce(null),ae(null),M(Ye==="home"?"overview":Ye),A(null),Ye==="launcher"&&z(!1)):window.location.hash="#/overview"};return window.addEventListener("hashchange",De),window.location.hash?De():window.location.hash="#/overview",()=>window.removeEventListener("hashchange",De)},[R,O]),l.useEffect(()=>{if(!re)return;const De=()=>oe(null),Je=Ge=>{var He,nt;Ge.button!==0||(nt=(He=Ge.target).closest)!=null&&nt.call(He,".sidebar-context-menu")||De()},Ye=Ge=>{Ge.key==="Escape"&&De()};return document.addEventListener("pointerdown",Je),document.addEventListener("contextmenu",De),window.addEventListener("blur",De),window.addEventListener("keydown",Ye),()=>{document.removeEventListener("pointerdown",Je),document.removeEventListener("contextmenu",De),window.removeEventListener("blur",De),window.removeEventListener("keydown",Ye)}},[re]),l.useEffect(()=>{const De=Ye=>{var Ge;(Ye.error||Ye.message)&&Zc.log({source:"Frontend",message:Ye.message||"Uncaught JavaScript Error",details:((Ge=Ye.error)==null?void 0:Ge.stack)||`${Ye.filename}:${Ye.lineno}:${Ye.colno}`}).catch(()=>{})},Je=Ye=>{var Ge,He;Zc.log({source:"Frontend (Promise)",message:((Ge=Ye.reason)==null?void 0:Ge.message)||String(Ye.reason||"Unhandled Promise Rejection"),details:((He=Ye.reason)==null?void 0:He.stack)||String(Ye.reason)}).catch(()=>{})};return window.addEventListener("error",De),window.addEventListener("unhandledrejection",Je),()=>{window.removeEventListener("error",De),window.removeEventListener("unhandledrejection",Je)}},[]),l.useLayoutEffect(()=>{var De;(De=document.querySelector(".page"))==null||De.scrollTo({top:0,left:0,behavior:"auto"}),j==="overview"&&J.current&&(J.current.scrollTop=0,J.current.scrollLeft=0)},[j,H,he==null?void 0:he.id,se==null?void 0:se.id]),l.useEffect(()=>{if(j==="logs")return;const De=j==="plugin"?(he==null?void 0:he.name)||(he==null?void 0:he.id):j==="static-page"?se==null?void 0:se.name:q4e[j];document.title=De?`${De} · DevBuddy`:"DevBuddy · Workbench"},[j,he==null?void 0:he.name,he==null?void 0:he.id,se==null?void 0:se.name]);const Ve=()=>{J.current&&(J.current.scrollTop=0,J.current.scrollLeft=0)};l.useEffect(()=>{const De=Je=>{(Je.metaKey||Je.ctrlKey)&&Je.shiftKey&&(Je.key==="r"||Je.key==="R"||Je.code==="KeyR")&&(Je.preventDefault(),Je.stopPropagation())};return window.addEventListener("keydown",De,!0),()=>window.removeEventListener("keydown",De,!0)},[]),l.useEffect(()=>{if(v||!["overview","launcher","ports"].includes(j))return;const De=setInterval(()=>{_e()},2e3);return()=>clearInterval(De)},[j,v]);const Le=l.useMemo(()=>{const De=Ye=>Ye.map(Ge=>Ge.children?{...Ge,children:De(Ge.children)}:Ge.key?{...Ge,icon:Ge.icon?c.jsx("span",{className:"sidebar-context-icon","data-sidebar-key":Ge.key,children:Ge.icon}):Ge.icon,label:c.jsx("span",{className:"sidebar-context-label","data-sidebar-key":Ge.key,children:Ge.label})}:Ge),Je=[...R.map(Ye=>({key:`plugin:${Ye.id}`,icon:c.jsx("span",{"aria-hidden":"true",children:Ye.icon||"✦"}),label:Ye.name||Ye.id})),...O.map(Ye=>({key:`static:${Ye.id}`,icon:c.jsx(kf,{}),label:Ye.name}))];return De([{type:"group",label:"Run & Observe",children:[{key:"launcher",icon:c.jsx(qo,{}),label:"Launcher"},{key:"cron-jobs",icon:c.jsx(Jm,{}),label:"Cron Jobs"},{key:"clipboard",icon:c.jsx(fo,{}),label:"Clipboard"},{key:"ports",icon:c.jsx(e4,{}),label:"Port Diagnostic"}]},{type:"group",label:"Plan & Review",children:[{key:"todo-list",icon:c.jsx(mu,{}),label:"To-Do"},{key:"reminders",icon:c.jsx(Kd,{}),label:"Reminders"},{key:"memos",icon:c.jsx(Ui,{}),label:"Memos"},{key:"mind-maps",icon:c.jsx(MC,{}),label:"Mind Maps"},{key:"pr-review",icon:c.jsx(Ay,{}),label:"PR Review"},{key:"pr-conflicts",icon:c.jsx(C0,{}),label:"Resolve Conflicts"},{key:"jira-filters",icon:c.jsx(ive,{}),label:"Jira Workspace"},{key:"presentation-plan",icon:c.jsx(bve,{}),label:"Presentations"},{key:"branch-sync",icon:c.jsx(ou,{}),label:"Branch Sync"},{key:"branch-health",icon:c.jsx(J$,{}),label:"Branch Health"},{key:"package-upgrade",icon:c.jsx(Z$,{}),label:"Package Upgrade"},{key:"package-versions",icon:c.jsx(_pe,{}),label:"Package Versions"}]},{type:"group",label:"Utilities",children:[{key:"postman",icon:c.jsx(hu,{}),label:"Postman"},{key:"image-compress",icon:c.jsx(Gw,{}),label:"Image compression"},{key:"json-to-typescript",icon:c.jsx(wa,{}),label:"JSON to TypeScript"},{key:"bookmark-sync",icon:c.jsx(_h,{}),label:"Bookmark Sync"},{key:"file-organizer",icon:c.jsx(Fr,{}),label:"Folder Organizer"}]},...Je.length>0?[{type:"group",label:"Extensions",children:Je}]:[]])},[ye,R,O]),je=({key:De})=>{window.location.hash=`#/${De}`},$e=he?`plugin:${he.id}`:se?`static:${se.id}`:j==="todo-archived"?"todo-list":["pr-conflicts","pr-conflict"].includes(j)?"pr-conflicts":j,Ae=b&&!(v&&!x)?c.jsx(mr,{type:x?"warning":"error",showIcon:!0,message:x?"Service status may be out of date":"Unable to load services",description:b,action:c.jsx(Oe,{size:"small",loading:v,onClick:fe,children:"Retry"}),className:"launcher-data-notice"}):null;return j==="memo-reader"?c.jsx(f4e,{memoId:L}):j==="logs"?c.jsx(Sbe,{}):j==="presentation-view"?c.jsx(w1e,{}):c.jsxs(Js,{className:"workbench",children:[c.jsxs(F4e,{"aria-label":"DevBuddy navigation",breakpoint:"lg",className:"sidebar",collapsed:U,collapsedWidth:64,collapsible:!0,onBreakpoint:q,onCollapse:q,width:240,children:[c.jsxs("div",{className:"brand-row",children:[c.jsxs("a",{className:"brand",href:"#/overview","aria-current":j==="overview"?"page":void 0,"aria-label":`Go to Overview — DevBuddy version ${jd.version}`,onClick:Ve,children:[c.jsx("span",{className:`brand-mark ${$?"":"is-offline"}`,"aria-hidden":"true",children:"✦"}),c.jsx("span",{className:"brand-name",children:"DevBuddy"}),c.jsxs("span",{className:"brand-version",children:["v",jd.version]})]}),!U&&c.jsx(yn,{title:_!=null&&_.updateAvailable?`Update available: v${_.latestVersion}`:"View Change Log",children:c.jsx(sa,{dot:!!(_!=null&&_.updateAvailable),color:"#f5b942",offset:[-2,3],children:c.jsx(Oe,{"aria-label":_!=null&&_.updateAvailable?`Update available: version ${_.latestVersion}`:"View Change Log",className:`sidebar-update-button ${_!=null&&_.updateAvailable?"has-update":""}`,icon:c.jsx(MC,{}),loading:X&&!_,onClick:we,type:"text"})})})]}),c.jsx("nav",{ref:J,className:"sidebar-nav","aria-label":"Main navigation",onContextMenu:xe,children:c.jsx(Xs,{theme:e==="light"?"light":"dark",mode:"inline",tabIndex:-1,selectedKeys:[$e],items:Le,onClick:je})}),c.jsx("div",{className:"sidebar-bottom",children:c.jsx("div",{className:"sidebar-bottom-inner",children:c.jsx("nav",{"aria-label":"Settings navigation",onContextMenu:xe,children:c.jsx(Xs,{className:"sidebar-settings-menu",theme:e==="light"?"light":"dark",mode:"inline",tabIndex:-1,selectedKeys:["settings","errors"].includes(j)?[j]:[],items:[{key:"settings",icon:c.jsx("span",{className:"sidebar-context-icon","data-sidebar-key":"settings",children:c.jsx(Gl,{})}),label:c.jsx("span",{className:"sidebar-context-label","data-sidebar-key":"settings",children:"Settings"})}],onClick:je})})})})]}),c.jsx(Js,{children:c.jsx(H4e,{className:`page ${j==="overview"?"is-overview-page":""} ${["static-page","postman"].includes(j)?"is-static-page":""} ${["overview","postman","static-page"].includes(j)?"":"is-workspace-content"} ${j==="mind-maps"&&H?"is-mind-map-detail":""} ${j==="presentation-plan"?"is-presentation-plan":""} ${j==="json-to-typescript"?"is-json-to-typescript":""} ${j==="memos"?"is-memos":""}`,children:he?c.jsxs(c.Fragment,{children:[c.jsx(Bc,{type:"secondary",children:"PLUGIN"}),c.jsx(_k,{level:2,children:he.name}),c.jsx(It,{children:c.jsx("div",{dangerouslySetInnerHTML:{__html:ge}})})]}):j==="static-page"&&se?c.jsx("div",{className:"static-page-container",children:c.jsx("iframe",{src:se.url,title:se.name,className:"static-page-iframe"})}):j==="image-compress"?c.jsx(Xye,{}):j==="json-to-typescript"?c.jsx(R1e,{}):j==="mind-maps"?H?c.jsx(B4e,{mindMapId:H,onNavigate:De=>{window.location.hash=`#/${De}`}}):c.jsx(j4e,{onNavigate:De=>{window.location.hash=`#/${De}`}}):j==="overview"?c.jsx(c1e,{launchers:a,running:s,errorCounts:f,errorLogs:h,plugins:R,staticPages:O,loading:v,error:b,hasLoaded:x,onRetry:fe,onNavigate:De=>{window.location.hash=`#/${De}`}}):j==="clipboard"?c.jsx(Sye,{}):j==="cron-jobs"?c.jsx(Nye,{}):j==="ports"?c.jsx(Bye,{refreshLaunchers:_e}):j==="pr-review"?c.jsx(ebe,{}):j==="pr-conflicts"?c.jsx(xI,{listOnly:!0},"pr-conflicts"):j==="pr-conflict"?c.jsx(xI,{},"pr-conflict"):j==="jira-filters"?c.jsx(ube,{}):j==="todo-list"?c.jsx(gbe,{}):j==="reminders"?c.jsx(y4e,{}):j==="memos"?c.jsx(m4e,{}):j==="todo-archived"?c.jsx(bbe,{}):j==="presentation-plan"?c.jsx(S1e,{}):j==="postman"?c.jsx(Dbe,{}):j==="bookmark-sync"?c.jsx(zbe,{}):j==="file-organizer"?c.jsx(_be,{}):j==="branch-sync"?c.jsx(Lbe,{}):j==="branch-health"?c.jsx(Ube,{}):j==="package-upgrade"?c.jsx(qbe,{}):j==="package-versions"?c.jsx(Gbe,{}):j==="errors"?c.jsx(wbe,{}):j==="settings"?c.jsx(Fye,{theme:e,onThemeChange:t,onStaticPagesChange:()=>Kc.list().then(I)}):j==="dev-configurations"?c.jsx(Wye,{}):c.jsxs(c.Fragment,{children:[Ae,(v||x||!b)&&c.jsx(Lye,{launchers:a,running:s,errorCounts:f,refresh:_e,loading:v&&!x,initialRunningOnly:T,initialServiceId:P})]})})}),re&&c.jsx("div",{className:"sidebar-context-menu",role:"menu",style:{left:re.left,top:re.top},onClick:De=>De.stopPropagation(),onContextMenu:De=>De.preventDefault(),children:c.jsx("button",{type:"button",role:"menuitem",onClick:ze,children:"Open in new window"})}),c.jsx(bn,{className:"changelog-modal",footer:[(_==null?void 0:_.updateAvailable)&&!(ne!=null&&ne.success)&&c.jsx(Oe,{type:"primary",loading:W&&Y===(_==null?void 0:_.latestVersion),onClick:()=>Pe(_==null?void 0:_.latestVersion),children:"Update now"},"update"),c.jsx(Oe,{disabled:W,loading:X,onClick:()=>ie(!0),children:"Check again"},"refresh"),c.jsx(Oe,{type:"primary",disabled:W,onClick:ke,children:ne!=null&&ne.success?"Close & reload":"Close"},"close")],onCancel:ke,closable:!W,maskClosable:!W,open:Z,title:c.jsxs("div",{className:"changelog-title",children:[c.jsx("span",{className:`changelog-bulb ${_!=null&&_.updateAvailable?"has-update":""}`,children:c.jsx(MC,{})}),c.jsx("span",{children:"Updates"})]}),width:680,children:X&&!_?c.jsx("div",{className:"changelog-loading",children:c.jsx(rr,{})}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"changelog-version-row",children:[c.jsxs("div",{children:[c.jsx(Bc,{type:"secondary",children:"Installed"}),c.jsxs(Bc,{strong:!0,children:["v",(_==null?void 0:_.currentVersion)||jd.version]})]}),c.jsxs("div",{children:[c.jsx(Bc,{type:"secondary",children:"Latest"}),c.jsxs(Bc,{strong:!0,children:["v",(_==null?void 0:_.latestVersion)||jd.version]})]}),c.jsx($t,{color:_!=null&&_.updateAvailable?"gold":"green",children:_!=null&&_.updateAvailable?"Update available":"Up to date"})]}),(_==null?void 0:_.sourceUnavailable)&&c.jsx(mr,{className:"changelog-source-alert",message:"Could not reach the configured npm registry. Showing locally available release notes.",showIcon:!0,type:"info"}),ne&&c.jsx(mr,{className:"changelog-source-alert",description:ne.message,message:ne.success?"DevBuddy updated successfully":"DevBuddy update failed",showIcon:!0,type:ne.success?"success":"error"}),c.jsx("div",{className:"changelog-release-list",children:(We=_==null?void 0:_.releases)!=null&&We.length?_.releases.slice(0,5).map(De=>c.jsxs("section",{className:"changelog-release",children:[c.jsxs("div",{className:"changelog-release-heading",children:[c.jsxs("div",{className:"changelog-release-title",children:[c.jsxs($t,{className:"changelog-release-version",children:["v",De.version]}),c.jsx(_k,{level:4,children:De.name})]}),c.jsxs("div",{className:"changelog-release-actions",children:[De.publishedAt&&c.jsx(Bc,{type:"secondary",children:new Date(De.publishedAt).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}),c.jsx(Oe,{size:"small",type:De.version===(_==null?void 0:_.latestVersion)?"primary":"default",disabled:W||De.version===(_==null?void 0:_.currentVersion),loading:W&&Y===De.version,onClick:()=>Pe(De.version),children:De.version===(_==null?void 0:_.currentVersion)?"Installed":"Install"})]})]}),c.jsx(Bc,{className:"changelog-release-notes",children:De.notes||"Published to the configured npm registry."})]},`${De.version}-${De.publishedAt||""}`)):c.jsx(Xt,{description:"No published release notes yet.",image:Xt.PRESENTED_IMAGE_SIMPLE})})]})})]})}function Y4e(){const[e,t]=l.useState(()=>document.documentElement.dataset.theme||localStorage.getItem("devbuddy-theme")||"dark");return l.useEffect(()=>{let n=!1;try{n=["dark","light"].includes(localStorage.getItem("devbuddy-theme"))}catch{}n||Wn.status().then(r=>{const a=r.theme==="light"?"light":"dark";t(a),localStorage.setItem("devbuddy-theme",a)}).catch(()=>{})},[]),l.useLayoutEffect(()=>{var n;document.documentElement.dataset.theme=e,localStorage.setItem("devbuddy-theme",e),(n=document.querySelector('meta[name="theme-color"]'))==null||n.setAttribute("content",Lk[e]||Lk.dark)},[e]),l.useLayoutEffect(()=>{const n=()=>{document.querySelectorAll('[role="tab"], [role="tabpanel"]').forEach(o=>{document.activeElement===o&&o.blur(),o.tabIndex!==-1&&(o.tabIndex=-1)})};n();const r=new MutationObserver(n),a=o=>{var s,u;(u=(s=o.target).matches)!=null&&u.call(s,'[role="tab"], [role="tabpanel"]')&&o.target.blur()};return document.addEventListener("focusin",a,!0),r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["tabindex"]}),()=>{r.disconnect(),document.removeEventListener("focusin",a,!0)}},[]),c.jsx(yi,{theme:{token:{fontFamily:V4e,borderRadius:10,colorBgLayout:e==="light"?"#f7f8fc":"#f4f5fa",colorInfo:e==="light"?"#2e83d2":"#6555e8",colorLink:e==="light"?"#2e83d2":"#5b4cc4",colorLinkActive:e==="light"?"#2474bd":"#5143c2",colorLinkHover:e==="light"?"#4593d8":"#7669ee",colorPrimary:e==="light"?"#2e83d2":"#5d63a8",colorPrimaryActive:e==="light"?"#2474bd":"#505690",colorPrimaryHover:e==="light"?"#4593d8":"#6c72b8",controlOutline:e==="light"?"rgba(46, 131, 210, .2)":"rgba(93, 99, 168, .24)",colorTextSecondary:"#667085"},components:{Layout:{bodyBg:e==="light"?"#f7f8fc":"#f4f5fa",siderBg:e==="light"?"#ffffff":"#171c2b",triggerBg:e==="light"?"#f8f9fc":"#101522",triggerColor:e==="light"?"#667085":"#c9ced8"},Menu:{darkItemBg:"#171c2b",darkItemSelectedBg:"#3f476e",darkItemSelectedColor:"#f0f1ff",darkSubMenuItemBg:"#171c2b",itemSelectedBg:"#eeecff",itemSelectedColor:"#5143c2"}}},children:c.jsx(Pr,{children:c.jsx(G4e,{theme:e,onThemeChange:t})})})}const X4e=/Macintosh|Mac OS X|iPhone|iPad/i.test(navigator.userAgent);document.documentElement.dataset.platform=X4e?"mac":"other";const Bk='input, textarea, [contenteditable="true"]',EA=e=>{var t,n;(t=e.matches)!=null&&t.call(e,Bk)&&(e.setAttribute("spellcheck","false"),e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","none")),(n=e.querySelectorAll)==null||n.call(e,Bk).forEach(r=>{r.setAttribute("spellcheck","false"),r.setAttribute("autocorrect","off"),r.setAttribute("autocapitalize","none")})};EA(document);const J4e=new MutationObserver(e=>{e.forEach(({addedNodes:t})=>{t.forEach(n=>{n.nodeType===Node.ELEMENT_NODE&&EA(n)})})});J4e.observe(document.body,{childList:!0,subtree:!0});const Q4e=uB.createRoot(document.getElementById("app"));Q4e.render(c.jsx(Y4e,{}));"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js",{updateViaCache:"none"}).catch(e=>{console.warn("DevBuddy service worker registration failed:",e)})});requestAnimationFrame(()=>{requestAnimationFrame(()=>{window.setTimeout(()=>{const e=document.getElementById("app-splash");e&&(e.classList.add("is-hidden"),window.setTimeout(()=>e.remove(),700))},700)})});export{Go as g,$4 as n};
621
+ `},uA=(e,t="Imported mind map")=>{var u,f,m;const r=e.split(/\r?\n/).filter(h=>h.trim()).map(h=>({line:h,match:h.match(/^(#{1,6})\s+(.+?)\s*$/)})).filter(({match:h})=>h),a=((m=(f=(u=r[0])==null?void 0:u.match)==null?void 0:f[2])==null?void 0:m.trim())||t,o={id:Us(),text:a,children:[]},s=[{depth:0,node:o}];return r.slice(1).forEach(({match:h})=>{var b;const p=h[1].length,v={id:Us(),text:h[2].trim(),children:[]};for(;s.length&&s[s.length-1].depth>=p;)s.pop();(((b=s[s.length-1])==null?void 0:b.node)||o).children.push(v),s.push({depth:p,node:v})}),$4({title:a,root:o})},tu=(e,t,n="application/json")=>{const r=typeof Blob<"u"&&t instanceof Blob?t:new Blob([t],{type:n}),a=URL.createObjectURL(r),o=document.createElement("a");o.href=a,o.download=e,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(a)},w4e=e=>{const t=new Date(e);return Number.isNaN(t.getTime())?"Recently updated":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric"}).format(t)},{Title:dA,Text:fA}=xn,Cv=e=>e.replace(/\.(xmind|json|md|markdown|txt)$/i,"").replace(/[-_]+/g," ").trim()||"Imported mind map";function $4e({map:e}){const t=["#6555e8","#4f8edb","#36a269","#d98a34"];return c.jsxs("div",{className:"mind-map-mini-preview","aria-hidden":"true",children:[c.jsx("div",{className:"mind-map-mini-root",style:{background:e.root.color||t[0]},children:c.jsx("span",{className:"mind-map-mini-root-text",children:e.root.text})}),c.jsx("div",{className:"mind-map-mini-branches",children:(e.root.children||[]).slice(0,4).map((n,r)=>c.jsxs("div",{className:"mind-map-mini-branch",children:[c.jsx("span",{className:"mind-map-mini-line"}),c.jsx("span",{className:"mind-map-mini-node",style:{borderColor:n.color||t[r%t.length]},children:n.text})]},n.id))})]})}function E4e({map:e,index:t,onOpen:n,onDelete:r,onExport:a}){const o=[{key:"xmind",icon:c.jsx(ql,{}),label:"Export XMind"},{key:"json",icon:c.jsx(ql,{}),label:"Export JSON"},{key:"markdown",icon:c.jsx(Ui,{}),label:"Export Markdown"},{type:"divider"},{key:"delete",danger:!0,icon:c.jsx(Fn,{}),label:"Delete map"}],s=({key:u,domEvent:f})=>{f==null||f.stopPropagation(),u==="delete"&&r(e),(u==="xmind"||u==="json"||u==="markdown")&&a(e,u)};return c.jsxs(It,{className:`mind-map-card ${t===0?"is-featured":""}`,hoverable:!0,onClick:()=>n(e.id),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n(e.id))},role:"button",tabIndex:0,children:[c.jsxs("div",{className:"mind-map-card-topline",children:[c.jsx($t,{className:"mind-map-card-type",children:"MIND MAP"}),c.jsx(Bl,{menu:{items:o,onClick:s},trigger:["click"],children:c.jsx(Oe,{"aria-label":`Actions for ${e.title}`,className:"mind-map-card-menu",icon:c.jsx(Wv,{}),onClick:u=>u.stopPropagation(),type:"text"})})]}),c.jsx($4e,{map:e}),c.jsxs("div",{className:"mind-map-card-content",children:[c.jsx("div",{className:"mind-map-card-title-row",children:c.jsx(dA,{ellipsis:{rows:1,tooltip:e.title},level:3,children:e.title})}),c.jsxs("div",{className:"mind-map-card-meta-row",children:[c.jsxs(fA,{className:"mind-map-card-meta",children:[E4(e.root)," nodes ",c.jsx("span",{children:"·"})," Updated ",w4e(e.updatedAt)]}),c.jsxs("span",{className:"mind-map-card-open",children:["Open map ",c.jsx("span",{"aria-hidden":"true",children:"→"})]})]})]})]})}function j4e({onNavigate:e}){const{message:t,modal:n}=Pr.useApp(),[r,a]=l.useState([]),[o,s]=l.useState(!0),[u,f]=l.useState(""),m=l.useRef(null),h=async()=>{try{a(await sl.list())}catch($){t.error(`Could not load mind maps: ${$.message||"unknown error"}`)}finally{s(!1)}};l.useEffect(()=>{h()},[]);const p=l.useMemo(()=>{const $=u.trim().toLowerCase();return $?r.filter(E=>`${E.title} ${E.root.text}`.toLowerCase().includes($)):r},[r,u]),v=()=>h(),y=$=>e(`mind-maps/${encodeURIComponent($)}`),b=async()=>{try{const $=await sl.create(x4e());a(E=>[$,...E]),y($.id)}catch($){t.error(`Could not create mind map: ${$.message||"unknown error"}`)}},C=async($,E)=>{try{if(E==="xmind"){const{mindMapToXmindBlob:R}=await pu(async()=>{const{mindMapToXmindBlob:O}=await import("./xmindAdapter-R4YZlQ1Y.js");return{mindMapToXmindBlob:O}},[]),N=await R($);tu(`${$.title||"mind-map"}.xmind`,N,"application/octet-stream"),t.success("XMind exported");return}if(E==="markdown"){tu(`${$.title||"mind-map"}.md`,cA($),"text/markdown;charset=utf-8"),t.success("Markdown exported");return}tu(`${$.title||"mind-map"}.json`,`${JSON.stringify($,null,2)}
622
+ `,"application/json;charset=utf-8"),t.success("JSON exported")}catch(R){t.error(`Could not export this map: ${R.message||"unknown error"}`)}},x=$=>{n.confirm({title:"Delete this mind map?",content:`“${$.title}” will be removed from workspace data.`,okText:"Delete",okButtonProps:{danger:!0},cancelText:"Cancel",onOk:async()=>{await sl.remove($.id),await v(),t.success("Mind map deleted")}})},w=async $=>{var R;const E=(R=$.target.files)==null?void 0:R[0];if($.target.value="",!!E)try{const N=E.name.toLowerCase().endsWith(".xmind"),O=N?null:await E.text(),I=E.name.toLowerCase().endsWith(".json"),j=N?await(async()=>{const{xmindBlobToMindMap:T}=await pu(async()=>{const{xmindBlobToMindMap:z}=await import("./xmindAdapter-R4YZlQ1Y.js");return{xmindBlobToMindMap:z}},[]);return T(await E.arrayBuffer(),Cv(E.name))})():I?$4(JSON.parse(O),Cv(E.name)):uA(O,Cv(E.name)),M=await sl.create({...j,title:j.title||Cv(E.name)});a(T=>[M,...T]),t.success(`${N?"XMind":I?"JSON":"Markdown"} imported`),y(M.id)}catch(N){t.error(`Could not import this file: ${N.message||"invalid format"}`)}};return c.jsxs("div",{className:"mind-map-page",children:[c.jsx(Ur,{actions:c.jsxs(ct,{className:"mind-map-page-actions",size:10,children:[c.jsx("input",{ref:m,accept:".xmind,.json,.md,.markdown,.txt",className:"mind-map-hidden-input",onChange:w,type:"file"}),c.jsx(Oe,{icon:c.jsx(S0,{}),onClick:()=>{var $;return($=m.current)==null?void 0:$.click()},children:"Import"}),c.jsx(Oe,{icon:c.jsx(Xn,{}),onClick:b,type:"primary",children:"New mind map"})]}),description:"Turn scattered thoughts into a clear visual plan.",eyebrow:"PLAN & REVIEW",title:"Mind maps"}),c.jsxs("div",{className:"mind-map-list-summary",children:[c.jsxs("div",{children:[c.jsx(dA,{level:2,children:"Your workspace"}),c.jsxs(fA,{type:"secondary",children:[r.length," ",r.length===1?"map":"maps"," saved locally"]})]}),c.jsx(Ct,{allowClear:!0,className:"mind-map-search",onChange:$=>f($.target.value),placeholder:"Search maps...",prefix:c.jsx(jo,{}),value:u})]}),o?c.jsx("div",{className:"mind-map-loading",children:c.jsx("span",{children:"Loading mind maps..."})}):p.length?c.jsx("div",{className:"mind-map-card-grid",children:p.map(($,E)=>c.jsx(E4e,{index:E,map:$,onDelete:x,onExport:C,onOpen:y},$.id))}):c.jsx(It,{className:"mind-map-empty-card",children:c.jsx(Xt,{description:u?"No maps match your search.":"No mind maps yet.",children:!u&&c.jsx(Oe,{icon:c.jsx(Xn,{}),onClick:b,type:"primary",children:"Create your first map"})})}),c.jsxs("div",{className:"mind-map-import-hint",children:[c.jsx(S0,{})," ",c.jsx("span",{children:"Import XMind, JSON, or Markdown. Export XMind to continue editing in XMind."})]})]})}const Sv=40,N4e=8192,Dk=e=>String(e??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&apos;"),Gc=(e,t)=>{const n=e.getBoundingClientRect();return{left:n.left-t.left,top:n.top-t.top,right:n.right-t.left,bottom:n.bottom-t.top,width:n.width,height:n.height}},hh=(e,t=0)=>{const n=Number.parseFloat(e);return Number.isFinite(n)?n:t},O4e=(e,t)=>{const n=e.nodeValue||"",r=new Map;let a=0;for(const o of n){const s=o.length;t.setStart(e,a),t.setEnd(e,a+s),a+=s;const u=t.getBoundingClientRect();if(!u.height)continue;const f=Math.round(u.top*2)/2,m=r.get(f)||{top:f,x:u.left,text:""};m.x=Math.min(m.x,u.left),m.text+=o,r.set(f,m)}return[...r.values()].sort((o,s)=>o.top-s.top)},R4e=(e,t)=>{var u;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),r=document.createRange(),a=document.createElement("canvas").getContext("2d"),o=[];let s=n.nextNode();for(;s;){const f=s.parentElement;if(!(f!=null&&f.closest(".mind-map-collapse"))&&((u=s.nodeValue)!=null&&u.trim())){const m=getComputedStyle(f),h=O4e(s,r),p=hh(m.fontSize,12),v=m.lineHeight==="normal"?p*1.2:hh(m.lineHeight,p*1.2),y=`${m.fontStyle} ${m.fontWeight} ${p}px ${m.fontFamily}`;a.font=y;const b=a.measureText("Mg"),C=b.fontBoundingBoxAscent||b.actualBoundingBoxAscent||p*.8,x=b.fontBoundingBoxDescent||b.actualBoundingBoxDescent||p*.2,w=Math.max(0,(v-C-x)/2)+C,$=Gc(f,t),E=getComputedStyle(f),R=["hidden","clip"].includes(E.overflowX)||["hidden","clip"].includes(E.overflowY)||E.textOverflow==="ellipsis";h.forEach(N=>{N.text&&o.push({text:N.text,x:N.x-t.left,y:N.top-t.top+w,font:`${m.fontStyle} ${m.fontWeight} ${p}px ${m.fontFamily}`,color:m.color,letterSpacing:m.letterSpacing,opacity:hh(m.opacity,1),clip:R?$:null})})}s=n.nextNode()}return o},I4e=(e,t)=>{const n=Gc(e,t),r=getComputedStyle(e),a=r.backgroundColor==="rgba(0, 0, 0, 0)"?"none":r.backgroundColor,o=hh(r.borderTopWidth),s=r.borderTopStyle==="none"||o===0?"none":r.borderTopColor,u=Math.min(hh(r.borderTopLeftRadius),n.width/2,n.height/2);return`<rect x="${n.left}" y="${n.top}" width="${n.width}" height="${n.height}" rx="${u}" fill="${Dk(a)}" stroke="${Dk(s)}" stroke-width="${o}"/>`},k4e=e=>{const t=e.getBoundingClientRect(),n=[],r=(o,s,u,f,m)=>{n.push(`<line x1="${o}" y1="${s}" x2="${u}" y2="${f}" stroke="${m}" stroke-width="1.5" stroke-linecap="round"/>`)};return[...e.querySelectorAll(".mind-map-ltr-children")].forEach(o=>{const s=Gc(o,t),f=[...o.children].filter(y=>y.classList.contains("mind-map-ltr-branch")).map(y=>({branch:y,row:y.querySelector(":scope > .mind-map-ltr-node-row"),node:y.querySelector(":scope > .mind-map-ltr-node-row > [data-mind-map-node]")})).filter(({row:y,node:b})=>y&&b);if(!f.length)return;const m=s.left,p=f.map(({row:y})=>Gc(y,t)).map(y=>y.top+y.height/2),v=o.classList.contains("is-comment-children")?"#9da9b6":"#c6cada";if(p.length>1&&r(m,p[0],m,p[p.length-1],v),f.forEach(({branch:y,node:b},C)=>{const x=Gc(b,t),w=y.classList.contains("is-comment-branch")?"#9da9b6":v;r(m,p[C],x.left,p[C],w)}),o.classList.contains("mind-map-ltr-root-children")){const y=e.querySelector(".mind-map-ltr-root-column > [data-mind-map-node]");if(y){const b=Gc(y,t);r(b.right,b.top+b.height/2,m,b.top+b.height/2,v)}}else{const y=o.parentElement,b=y==null?void 0:y.querySelector(":scope > .mind-map-ltr-node-row > [data-mind-map-node]");if(b){const C=Gc(b,t),x=y.classList.contains("is-comment-branch")?"#9da9b6":v;r(C.right,C.top+C.height/2,m,C.top+C.height/2,x)}}}),n.join("")},M4e=(e,t)=>{const n=e.getBoundingClientRect(),r=Math.floor(t.left-n.left-Sv),a=Math.floor(t.top-n.top-Sv),o=Math.ceil(t.right-t.left+Sv*2),s=Math.ceil(t.bottom-t.top+Sv*2),u=[...e.querySelectorAll(".mind-map-root-node, .mind-map-node, .mind-map-node-jira-tag")].map(h=>I4e(h,n)).join(""),f=R4e(e,n);return{svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${s}" viewBox="${r} ${a} ${o} ${s}"><rect x="${r}" y="${a}" width="${o}" height="${s}" fill="#ffffff"/>${k4e(e)}${u}</svg>`,width:o,height:s,left:r,top:a,text:f}},T4e=async e=>{var p;if(!e)throw new Error("Mind map canvas is not ready.");const t=[...e.querySelectorAll("[data-mind-map-node], .mind-map-canvas-empty")];if(!t.length)throw new Error("Mind map canvas is empty.");(p=document.fonts)!=null&&p.ready&&await document.fonts.ready;const n=t.reduce((v,y)=>{const b=y.getBoundingClientRect();return{left:Math.min(v.left,b.left),top:Math.min(v.top,b.top),right:Math.max(v.right,b.right),bottom:Math.max(v.bottom,b.bottom)}},{left:1/0,top:1/0,right:-1/0,bottom:-1/0}),{svg:r,width:a,height:o,left:s,top:u,text:f}=M4e(e,n),m=new Image,h=URL.createObjectURL(new Blob([r],{type:"image/svg+xml;charset=utf-8"}));try{await new Promise((w,$)=>{m.onload=w,m.onerror=()=>$(new Error("Could not render the mind map image.")),m.src=h});const v=Math.min(2,N4e/Math.max(a,o)),y=document.createElement("canvas");y.width=Math.max(1,Math.round(a*v)),y.height=Math.max(1,Math.round(o*v));const b=y.getContext("2d");if(!b)throw new Error("Canvas is unavailable.");b.fillStyle="#ffffff",b.fillRect(0,0,y.width,y.height),b.drawImage(m,0,0,y.width,y.height),b.save(),b.scale(v,v),f.forEach(w=>{b.save(),b.font=w.font,b.fillStyle=w.color,b.globalAlpha=w.opacity,"letterSpacing"in b&&w.letterSpacing&&w.letterSpacing!=="normal"&&(b.letterSpacing=w.letterSpacing),w.clip&&(b.beginPath(),b.rect(w.clip.left-s,w.clip.top-u,w.clip.width,w.clip.height),b.clip()),b.textBaseline="alphabetic",b.fillText(w.text,w.x-s,w.y-u),b.restore()}),b.restore();const{encode:C}=await pu(async()=>{const{encode:w}=await import("./index-_vMuByUV.js");return{encode:w}},[]),x=await C(b.getImageData(0,0,y.width,y.height),{quality:75,progressive:!0,optimize_coding:!0,auto_subsample:!0});return new Blob([x],{type:"image/jpeg"})}finally{URL.revokeObjectURL(h)}},{Text:io,Title:zk}=xn,T0=["#4f8edb","#36a269","#d98a34","#c05a83","#8a70c5"],P4e=3200,D4e=2200,Ts=1600,z4e=380,qy=e=>String((e==null?void 0:e.text)||"").trimStart().startsWith("#"),A4e=e=>{var n;const t=e instanceof HTMLElement?e:null;return!!(t!=null&&t.isContentEditable||(n=t==null?void 0:t.closest)!=null&&n.call(t,'input, textarea, select, [contenteditable="true"]'))},mA=e=>e.reduce((t,n)=>{const r=String(n.edgeLabel||"").trim();return r?Math.max(t,Math.min(160,Math.max(72,r.length*7+16))):t},16),h2=(e,t,n=!1)=>({...e,collapsed:n?!1:t,children:(e.children||[]).map(r=>h2(r,t))}),hA=(e,t,n=!1)=>{const r=n||qy(e);return{...e,tested:r?!1:t,children:(e.children||[]).map(a=>hA(a,t,r))}},pA=(e,t)=>({...e,jiraKeys:(e.jiraKeys||[]).filter(n=>n!==t),children:(e.children||[]).map(n=>pA(n,t))}),gA=(e,t)=>{t.add(e.id),(e.children||[]).forEach(n=>gA(n,t))},vA=(e,t)=>t.has(e.id)?null:{label:e.text||"Untitled idea",value:e.id,children:(e.children||[]).map(n=>vA(n,t)).filter(Boolean)},yA=(e,t,n=[])=>{const r=[...n,e.id];if(e.id===t)return r;for(const a of e.children||[]){const o=yA(a,t,r);if(o)return o}return null},hS=e=>e.replace(/\.(xmind|json|md|markdown|txt)$/i,"").replace(/[-_]+/g," ").trim()||"Imported mind map",bA=(e,t,n=!1)=>{if(!e)return!1;const r=n||qy(e);return e.id===t?r:(e.children||[]).some(a=>bA(a,t,r))};function xA({node:e,jiraIssues:t}){const n=(e.jiraKeys||[]).map(r=>t.find(a=>a.key===r)||{key:r});return n.length?c.jsx("span",{className:"mind-map-node-jira-tags","aria-label":"Jira tags",children:n.map(r=>c.jsx("span",{className:"mind-map-node-jira-tag",title:r.summary||r.key,children:r.key},r.key))}):null}function CA({node:e,depth:t=0,selectedId:n,onSelect:r,onToggle:a,jiraIssues:o,commented:s=!1}){const u=e.color||T0[t%T0.length],f=e.children||[],m=qy(e),h=s||m,p=mA(f);return c.jsxs("div",{className:`mind-map-ltr-branch depth-${Math.min(t,4)}${h?" is-comment-branch":""}${m?" is-comment-marker":""}`,children:[c.jsxs("div",{className:"mind-map-ltr-node-row",children:[e.edgeLabel&&c.jsx("span",{className:"mind-map-ltr-edge-label",title:e.edgeLabel,children:e.edgeLabel}),c.jsxs("button",{className:`mind-map-node ${n===e.id?"is-selected":""} ${e.tested&&!h?"is-tested":""}${e.autoWidth===!1?" is-auto-width-disabled":""}${h?" is-comment":""}${m?" is-comment-marker":""}`,onClick:()=>r(e.id),"data-mind-map-node":e.id,style:{"--node-color":u},type:"button",children:[c.jsxs("span",{className:"mind-map-node-main",children:[c.jsx("span",{className:"mind-map-node-text",children:e.text||"Untitled idea"}),f.length>0&&c.jsx("span",{className:"mind-map-node-count",children:f.length})]}),c.jsx(xA,{jiraIssues:o,node:e})]}),f.length>0&&c.jsxs("button",{"aria-label":e.collapsed?"Expand branch":"Collapse branch",className:"mind-map-collapse",onClick:()=>a(e.id),type:"button",children:[c.jsx("span",{className:`mind-map-collapse-symbol ${e.collapsed?"is-visible":""}`,children:"+"}),c.jsx("span",{className:`mind-map-collapse-symbol ${e.collapsed?"":"is-visible"}`,children:"−"})]})]}),!e.collapsed&&f.length>0&&c.jsx("div",{className:`mind-map-ltr-children${h?" is-comment-children":""}`,style:{"--mind-map-ltr-node-inset":`${p}px`},children:f.map(v=>c.jsx(CA,{depth:t+1,node:v,onSelect:r,onToggle:a,selectedId:n,jiraIssues:o,commented:h},v.id))})]})}const SA=l.forwardRef(function({map:t,selectedId:n,onSelect:r,onToggle:a,jiraIssues:o,nodeMaxWidth:s,fitContent:u=!1},f){const m=t.root,h=m.children||[],p=m.color||"#6555e8",v=qy(m);return c.jsxs("div",{className:"mind-map-ltr-diagram",ref:f,style:{...u?{minWidth:0,minHeight:0,margin:0}:{},...Number.isInteger(s)?{"--mind-map-node-max-width":`${s}px`}:{}},children:[c.jsx("div",{className:"mind-map-ltr-root-column",children:c.jsxs("button",{className:`mind-map-root-node ${n===m.id?"is-selected":""} ${m.tested&&!v?"is-tested":""}${m.autoWidth===!1?" is-auto-width-disabled":""}${v?" is-comment is-comment-marker":""}`,"data-mind-map-node":m.id,onClick:()=>r(m.id),style:{"--node-color":p},type:"button",children:[c.jsx("span",{className:"mind-map-root-text",children:m.text||"Untitled idea"}),c.jsxs("span",{className:"mind-map-root-count",children:[E4(m)-1," connected ideas"]}),c.jsx(xA,{jiraIssues:o,node:m})]})}),!m.collapsed&&h.length>0&&c.jsx("div",{className:`mind-map-ltr-children mind-map-ltr-root-children${v?" is-comment-children":""}`,style:{"--mind-map-ltr-node-inset":`${mA(h)}px`},children:h.map(y=>c.jsx(CA,{node:y,onSelect:r,onToggle:a,selectedId:n,jiraIssues:o,commented:v},y.id))}),!h.length&&c.jsx("div",{className:"mind-map-canvas-empty",children:c.jsx(io,{type:"secondary",children:"Add a branch from the inspector to start mapping this idea."})})]})}),_4e=l.forwardRef(function({map:t,nodeMaxWidth:n},r){const a=l.useRef(null);return l.useLayoutEffect(()=>{const o=a.current;if(!o)return;const s=1;o.querySelectorAll(".mind-map-ltr-children").forEach(u=>{const f=[...u.children].map(b=>b.querySelector(":scope > .mind-map-ltr-node-row")).filter(Boolean);if(!f.length)return;const m=u.getBoundingClientRect(),h=f[0].getBoundingClientRect(),p=f[f.length-1].getBoundingClientRect(),v=(h.top+h.bottom)/2,y=(p.top+p.bottom)/2;u.style.setProperty("--mind-map-connector-top",`${Math.max(0,(v-m.top)/s)}px`),u.style.setProperty("--mind-map-connector-height",`${Math.max(0,(y-v)/s)}px`)})},[t]),c.jsx("div",{"aria-hidden":"true",className:"mind-map-export-offscreen",inert:"",children:c.jsx("div",{className:"mind-map-canvas-stage is-left-to-right mind-map-export-render",ref:r,style:{width:"max-content",height:"auto",padding:0,margin:0,zoom:1},children:c.jsx(SA,{fitContent:!0,jiraIssues:t.jiraIssues||[],map:t,nodeMaxWidth:n,onSelect:()=>{},onToggle:()=>{},ref:a,selectedId:null})})})}),L4e=l.forwardRef(function({map:t,selectedId:n,zoom:r,resetViewToken:a,recenterLayoutToken:o,isPanning:s,onCanvasPointerDown:u,onCanvasPointerMove:f,onCanvasPointerUp:m,onSelect:h,onToggle:p,onZoomChange:v,jiraIssues:y,nodeMaxWidth:b},C){const x=l.useRef(null),w=l.useRef(null),$=l.useRef(r),E=l.useRef({meta:!1,ctrl:!1}),R=l.useRef(new Map),N=l.useRef(0),O=l.useRef(0),I=l.useRef(!1),j=l.useRef(o);$.current=r;const M=(A,L,F,U)=>{const q=A.querySelector(".mind-map-canvas-stage"),_=A.getBoundingClientRect(),K=q==null?void 0:q.getBoundingClientRect();return{fromZoom:L,toZoom:null,x:F,y:U,stageX:K?(_.left+F-K.left)/L:null,stageY:K?(_.top+U-K.top)/L:null}};l.useImperativeHandle(C,()=>({zoomAt(A){const L=x.current,F=$.current;!L||A===F||(w.current=M(L,F,L.clientWidth/2,L.clientHeight/2),w.current.toZoom=A,$.current=A,v(A))}}),[v]);const T=A=>{const L=A.target instanceof Element?A.target:null,F=L==null?void 0:L.closest("button[data-mind-map-node]");L!=null&&L.closest("button")&&!F||u(A,(F==null?void 0:F.dataset.mindMapNode)||null)},z=(A=null)=>{const L=x.current;if(!L)return;const F=[...L.querySelectorAll("[data-mind-map-node]")],U=L.querySelector(".mind-map-root-node");if(!F.length||!U)return;const q=L.getBoundingClientRect(),_=F.reduce((J,ye)=>{const xe=(A==null?void 0:A.get(ye.dataset.mindMapNode))||ye.getBoundingClientRect();return{left:Math.min(J.left,xe.left),top:Math.min(J.top,xe.top),right:Math.max(J.right,xe.right),bottom:Math.max(J.bottom,xe.bottom)}},{left:1/0,top:1/0,right:-1/0,bottom:-1/0}),K=(_.left+_.right)/2,X=(_.top+_.bottom)/2,V=(A==null?void 0:A.get(U.dataset.mindMapNode))||U.getBoundingClientRect();let W=L.scrollLeft+K-q.left-L.clientWidth/2,G=L.scrollTop+X-q.top-L.clientHeight/2;const Y=W-L.scrollLeft,te=G-L.scrollTop,ne=V.left-Y,ue=V.right-Y,Z=V.top-te,ee=V.bottom-te,re=q.left+24,oe=q.right-24,de=q.top+24,be=q.bottom-24;ue<re&&(W+=ue-re),ne>oe&&(W+=ne-oe),ee<de&&(G+=ee-de),Z>be&&(G+=Z-be),L.scrollLeft=Math.max(0,Math.min(W,L.scrollWidth-L.clientWidth)),L.scrollTop=Math.max(0,Math.min(G,L.scrollHeight-L.clientHeight))},P=()=>{const A=x.current;if(!A)return;const L=$.current||1;A.querySelectorAll(".mind-map-ltr-children").forEach(F=>{const U=[...F.children].map(W=>W.querySelector(":scope > .mind-map-ltr-node-row")).filter(Boolean);if(!U.length)return;const q=F.getBoundingClientRect(),_=U[0].getBoundingClientRect(),K=U[U.length-1].getBoundingClientRect(),X=(_.top+_.bottom)/2,V=(K.top+K.bottom)/2;F.style.setProperty("--mind-map-connector-top",`${Math.max(0,(X-q.top)/L)}px`),F.style.setProperty("--mind-map-connector-height",`${Math.max(0,(V-X)/L)}px`)})},B=()=>{const A=x.current;!A||I.current||(R.current=new Map([...A.querySelectorAll("[data-mind-map-node]")].map(L=>[L.dataset.mindMapNode,L.getBoundingClientRect()])))};l.useLayoutEffect(()=>{P()},[t,r,b]),l.useLayoutEffect(()=>{z()},[t.id]),l.useLayoutEffect(()=>{const A=x.current;if(!A)return;const L=o!==j.current;j.current=o;const F=[...A.querySelectorAll("[data-mind-map-node]")],U=new Map(F.map(Y=>[Y.dataset.mindMapNode,Y.getBoundingClientRect()])),q=R.current,_=new Map(F.map(Y=>{const te=Y.dataset.mindMapNode;return[te,Y.style.transform?U.get(te):q.get(te)||U.get(te)]}));cancelAnimationFrame(N.current),N.current=0,window.clearTimeout(O.current),O.current=0,I.current=!1,F.forEach(Y=>{Y.style.transition="none",Y.style.transform="",Y.style.opacity=""}),A.offsetHeight;const K=new Map(F.map(Y=>[Y.dataset.mindMapNode,Y.getBoundingClientRect()]));let X=K;if(L&&(I.current=!0,z(K),X=new Map(F.map(Y=>[Y.dataset.mindMapNode,Y.getBoundingClientRect()]))),!q.size){I.current=!1,R.current=X;return}const V=new Map(F.map(Y=>{const te=Y.dataset.mindMapNode,ne=_.get(te),ue=K.get(te);return[te,ne&&ue?{x:(ne.left-ue.left)/($.current||1),y:(ne.top-ue.top)/($.current||1)}:null]})),W=[...V.values()].filter(Y=>Y&&(Math.abs(Y.x)>=1||Math.abs(Y.y)>=1));if(!(W.length<=40&&W.every(Y=>Math.max(Math.abs(Y.x),Math.abs(Y.y))<=900))){I.current=!1,R.current=X;return}return I.current=W.length>0,F.forEach(Y=>{const te=_.get(Y.dataset.mindMapNode),ne=K.get(Y.dataset.mindMapNode);if(!te||!ne){Y.style.opacity="1";return}const ue=V.get(Y.dataset.mindMapNode),Z=ue.x,ee=ue.y;Math.abs(Z)<1&&Math.abs(ee)<1||(Y.style.transition="none",Y.style.transform=`translate(${Z}px, ${ee}px)`)}),F.forEach(Y=>void Y.offsetWidth),N.current=requestAnimationFrame(()=>{F.forEach(Y=>{const te=_.get(Y.dataset.mindMapNode);Y.style.transition="transform 380ms cubic-bezier(.22, 1, .36, 1), opacity 220ms ease",Y.style.transform="",te||(Y.style.opacity="1")}),N.current=0,O.current=window.setTimeout(()=>{I.current=!1,B(),O.current=0},z4e+16)}),R.current=X,()=>{cancelAnimationFrame(N.current),N.current=0,window.clearTimeout(O.current),O.current=0,I.current=!1}},[t,b,o]),l.useLayoutEffect(()=>{const A=x.current,L=w.current;if(!A||!L||L.toZoom!==r)return;const F=A.getBoundingClientRect(),U=A.querySelector(".mind-map-canvas-stage"),q=U==null?void 0:U.getBoundingClientRect(),_=L.stageX===null||!q?Ts+(L.x+A.scrollLeft-Ts)*(r/L.fromZoom)-L.x:A.scrollLeft+q.left+L.stageX*r-(F.left+L.x),K=L.stageY===null||!q?Ts+(L.y+A.scrollTop-Ts)*(r/L.fromZoom)-L.y:A.scrollTop+q.top+L.stageY*r-(F.top+L.y);A.scrollLeft=Math.max(0,Math.min(_,A.scrollWidth-A.clientWidth)),A.scrollTop=Math.max(0,Math.min(K,A.scrollHeight-A.clientHeight)),w.current=null},[r]),l.useLayoutEffect(()=>{if(a===0)return;const A=requestAnimationFrame(()=>z());return()=>cancelAnimationFrame(A)},[a]),l.useEffect(()=>{const A=U=>{U.key==="Meta"&&(E.current.meta=!0),U.key==="Control"&&(E.current.ctrl=!0)},L=U=>{U.key==="Meta"&&(E.current.meta=!1),U.key==="Control"&&(E.current.ctrl=!1)},F=()=>{E.current={meta:!1,ctrl:!1}};return window.addEventListener("keydown",A),window.addEventListener("keyup",L),window.addEventListener("blur",F),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",L),window.removeEventListener("blur",F)}},[]);const H=l.useCallback(A=>{var W,G;const L=x.current;if(!L||!L.contains(A.target))return;const F=A.metaKey||((W=A.getModifierState)==null?void 0:W.call(A,"Meta"))||E.current.meta,U=A.ctrlKey||((G=A.getModifierState)==null?void 0:G.call(A,"Control"))||E.current.ctrl;if(!F&&!U||!A.deltaY)return;A.preventDefault(),A.returnValue=!1,A.stopPropagation();const q=L.getBoundingClientRect(),_=$.current,K=A.deltaMode===1?A.deltaY*16:A.deltaY,X=Math.min(Math.abs(K),48)*Math.sign(K),V=Math.max(.5,Math.min(2,Number((_*Math.pow(1.1,-X/24)).toFixed(3))));V!==_&&(w.current=M(L,_,A.clientX-q.left,A.clientY-q.top),w.current.toZoom=V,$.current=V,v(V))},[v]);return l.useEffect(()=>(window.addEventListener("wheel",H,{capture:!0,passive:!1}),()=>window.removeEventListener("wheel",H,{capture:!0})),[H]),c.jsx("div",{className:`mind-map-canvas-scroll ${s?"is-panning":""}`,ref:x,onPointerCancel:m,onPointerDown:T,onPointerMove:f,onPointerUp:m,onScroll:B,children:c.jsx("div",{className:"mind-map-canvas-world",style:{height:`${D4e*r+Ts*2}px`,width:`${P4e*r+Ts*2}px`},children:c.jsx("div",{className:"mind-map-canvas-stage is-left-to-right",style:{marginLeft:`${Ts}px`,marginTop:`${Ts}px`,zoom:r},children:c.jsx(SA,{jiraIssues:y,map:t,nodeMaxWidth:b,onSelect:h,onToggle:p,selectedId:n})})})})});function B4e({mindMapId:e,onNavigate:t}){var Qt,kt;const{message:n}=Pr.useApp(),r=l.useRef(null),[a,o]=l.useState(null),[s,u]=l.useState(null),[f,m]=l.useState(null),[h,p]=l.useState(""),[v,y]=l.useState(!0),[b,C]=l.useState(1),[x,w]=l.useState(0),[$,E]=l.useState(0),[R,N]=l.useState(!1),[O,I]=l.useState(!1),[j,M]=l.useState(null),[T,z]=l.useState(null),[P,B]=l.useState(!1),[H,A]=l.useState(!1),[L,F]=l.useState(""),[U,q]=l.useState(!1),[_,K]=l.useState(""),[X,V]=l.useState(!1),[W,G]=l.useState(!1),[Y,te]=l.useState([]),[ne,ue]=l.useState(!1),[Z,ee]=l.useState(!1),[re,oe]=l.useState(!1),de=l.useRef(null),be=l.useRef(null),J=l.useRef(null),ye=l.useRef(null),xe=l.useRef(!1),ze=l.useRef(null),he=l.useRef(Promise.resolve());l.useEffect(()=>{let Me=!0;return Wn.status().then(Ue=>{if(!Me)return;const mt=Number.isInteger(Ue.mindMapNodeMaxWidth)?Ue.mindMapNodeMaxWidth:null;M(mt),z(mt),B(!0)}).catch(Ue=>{Me&&(B(!0),n.error(`Could not load mind map settings: ${Ue.message||"unknown error"}`))}),()=>{Me=!1}},[]),l.useEffect(()=>{P&&E(Me=>Me+1)},[j,P]),l.useEffect(()=>{let Me=!0;return y(!0),o(null),m(null),ue(!1),sl.get(e).then(Ue=>{Me&&(o(Ue),p(Ue.title||""),C(1),w(0),N(!1),de.current=null)}).catch(Ue=>{Me&&n.error(`Could not load mind map: ${Ue.message||"unknown error"}`)}).finally(()=>{Me&&y(!1)}),()=>{Me=!1}},[e]),l.useEffect(()=>{a&&f&&!Gd(a.root,f)&&m(null)},[a,f]),l.useEffect(()=>{var Me,Ue;xe.current&&(xe.current=!1,(Ue=(Me=ye.current)==null?void 0:Me.focus)==null||Ue.call(Me))},[f]),l.useEffect(()=>{var Me;oe(!!((Me=ce==null?void 0:ce.notes)!=null&&Me.trim()))},[f]),l.useEffect(()=>{if(!Z)return;const Me=Ue=>{Ue.key==="Escape"&&ee(!1)};return window.addEventListener("keydown",Me),()=>window.removeEventListener("keydown",Me)},[Z]);const ce=l.useMemo(()=>f?Gd(a==null?void 0:a.root,f):null,[a,f]),se=l.useMemo(()=>bA(a==null?void 0:a.root,f),[a,f]),ae=l.useMemo(()=>Hh(a==null?void 0:a.root,f),[a,f]),ge=((Qt=ae==null?void 0:ae.children)==null?void 0:Qt.findIndex(Me=>Me.id===f))??-1,Re=(a==null?void 0:a.jiraIssues)||[],_e=l.useMemo(()=>{const Me=new Set,Ue=mt=>{((mt==null?void 0:mt.jiraKeys)||[]).forEach(qt=>Me.add(qt)),((mt==null?void 0:mt.children)||[]).forEach(Ue)};return Ue(a==null?void 0:a.root),Me},[a]),ie=l.useMemo(()=>((ce==null?void 0:ce.jiraKeys)||[]).map(Me=>Re.find(Ue=>Ue.key===Me)||{key:Me,summary:"Summary unavailable",url:""}),[Re,ce]),fe=l.useMemo(()=>{if(!a||!ce||!ae)return[];const Me=new Set;gA(ce,Me);const Ue=vA(a.root,Me);return Ue?[Ue]:[]},[a,ce,ae]),we=Me=>{if(!a)return;const Ue={...Me(a),updatedAt:new Date().toISOString()};o(Ue),he.current=he.current.catch(()=>{}).then(()=>sl.update(Ue.id,Ue)).catch(()=>new Promise((mt,qt)=>{window.setTimeout(()=>{sl.update(Ue.id,Ue).then(mt).catch(qt)},120)})).catch(mt=>n.error(`Could not save mind map: ${mt.message||"unknown error"}`))},ke=()=>{const Me=h.trim()||"Untitled mind map";p(Me),we(Ue=>({...Ue,title:Me,root:Ue.root.text===Ue.title?{...Ue.root,text:Me}:Ue.root}))},Pe=Me=>{ce&&we(Ue=>({...Ue,root:eu(Ue.root,ce.id,mt=>({...mt,...Me}))}))},Ie=()=>{if(!ce||se)return;const Me=!ce.tested;we(Ue=>({...Ue,root:eu(Ue.root,ce.id,mt=>hA(mt,Me))}))},Ve=(Me=0)=>({id:`node-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`,text:"New idea",color:T0[Me%T0.length],tested:!1,children:[]}),Le=()=>{if(!ce)return;const Me=Ve((ce.children||[]).length);Pe({children:[...ce.children||[],Me],collapsed:!1}),xe.current=!0,m(Me.id)},je=()=>{if(!ce||!ae){Le();return}const Me=Ve(ae.children.findIndex(Ue=>Ue.id===ce.id)+1);we(Ue=>({...Ue,root:C4e(Ue.root,ce.id,Me)})),xe.current=!0,m(Me.id)},$e=Me=>{if(!ae||ge<0)return;const Ue=ae.id,mt=ge+Me;mt<0||mt>=ae.children.length||we(qt=>({...qt,root:eu(qt.root,Ue,Yt=>{const cn=[...Yt.children||[]],nn=cn.findIndex(Mt=>Mt.id===f),gn=nn+Me;if(nn<0||gn<0||gn>=cn.length)return Yt;const[St]=cn.splice(nn,1);return cn.splice(gn,0,St),{...Yt,children:cn}})}))},Ae=()=>{!ce||!ae||!Hh(a==null?void 0:a.root,ae.id)||we(Me=>({...Me,root:S4e(Me.root,ce.id)}))};l.useEffect(()=>{const Me=Ue=>{if(!(!a||!ce||Ue.defaultPrevented||Ue.isComposing||Ue.repeat)&&!(Ue.altKey||Ue.ctrlKey||Ue.metaKey)&&!(Ue.key!=="Enter"&&Ue.key!=="Tab")&&!(Ue.key==="Enter"&&A4e(Ue.target))){if(Ue.key==="Tab"){const mt=document.querySelector(".mind-map-inspector-card"),qt=(mt==null?void 0:mt.matches(":hover"))||!1,Yt=Ue.target instanceof Element&&!!Ue.target.closest(".mind-map-inspector-card");if(qt&&!Yt)return}if(Ue.preventDefault(),Ue.key==="Tab"){Ue.shiftKey?Ae():Le();return}je()}};return window.addEventListener("keydown",Me),()=>window.removeEventListener("keydown",Me)},[a,ce,ae]);const We=()=>{if(!ce||!ae)return;const Me=ae.id;we(Ue=>({...Ue,root:Wy(Ue.root,ce.id)})),m(Me),n.success("Idea removed")},De=()=>{ae&&(te(yA(a.root,ae.id)||[]),G(!0))},Je=()=>{const Me=Y[Y.length-1];if(!ce||!ae||!Me)return;if(Pk(a.root,ce.id,Me)===a.root){n.error("Please choose another valid parent node.");return}we(mt=>({...mt,root:Pk(mt.root,ce.id,Me)})),G(!1),n.success(`Moved “${ce.text||"idea"}” successfully.`)},Ye=()=>{I(!0)},Ge=async()=>{A(!0);try{const Me=await Wn.saveMindMapNodeMaxWidth(T),Ue=Number.isInteger(Me.mindMapNodeMaxWidth)?Me.mindMapNodeMaxWidth:null;M(Ue),z(Ue),n.success(Ue?"Mind map node width saved":"Using default mind map node widths")}catch(Me){n.error(`Could not save node width: ${Me.message||"unknown error"}`)}finally{A(!1)}},He=async()=>{const Me=b4e(L);if(!Me){n.error("Enter a Jira No such as PROJ-123 or a Jira issue link.");return}q(!0);try{const Ue=await sl.resolveJiraIssue(L);if(Re.some(mt=>mt.key===Ue.key)){n.info(`${Ue.key} is already in this map.`);return}we(mt=>({...mt,jiraIssues:[...mt.jiraIssues||[],Ue]})),F(""),n.success(`${Ue.key} added to this map.`)}catch(Ue){n.error(Ue.message||`Could not load ${Me.key} from Jira.`)}finally{q(!1)}},nt=Me=>{we(Ue=>({...Ue,jiraIssues:(Ue.jiraIssues||[]).filter(mt=>mt.key!==Me),root:pA(Ue.root,Me)}))},ft=async Me=>{K(Me.key);try{const Ue=await sl.resolveJiraIssue(Me.key);we(mt=>({...mt,jiraIssues:(mt.jiraIssues||[]).map(qt=>qt.key===Me.key?{...qt,summary:Ue.summary,url:Ue.url||qt.url}:qt)})),n.success(`${Me.key} summary refreshed`)}catch(Ue){n.error(Ue.message||`Could not refresh ${Me.key}.`)}finally{K("")}},vt=Me=>{Pe({jiraKeys:((ce==null?void 0:ce.jiraKeys)||[]).filter(Ue=>Ue!==Me)})},qe=Me=>{Me&&(m(Me),ue(!0))},Ee=(Me,Ue)=>{var qt;if(Me.button!==0)return;const mt=Me.currentTarget;mt&&(Me.preventDefault(),(qt=mt.setPointerCapture)==null||qt.call(mt,Me.pointerId),de.current={canvas:mt,pointerId:Me.pointerId,startX:Me.clientX,startY:Me.clientY,startScrollLeft:mt.scrollLeft,startScrollTop:mt.scrollTop,nodeId:Ue,moved:!1},Ue&&qe(Ue),N(!0))},Be=Me=>{const Ue=de.current;if(!Ue||Ue.pointerId!==Me.pointerId)return;const mt=Ue.canvas||Me.currentTarget;!Ue.moved&&Math.hypot(Me.clientX-Ue.startX,Me.clientY-Ue.startY)<3||(Ue.moved=!0,mt.scrollLeft=Ue.startScrollLeft-(Me.clientX-Ue.startX),mt.scrollTop=Ue.startScrollTop-(Me.clientY-Ue.startY))},Xe=Me=>{var mt,qt,Yt,cn;const Ue=de.current;!Ue||Me.pointerId!==void 0&&Ue.pointerId!==Me.pointerId||(!Ue.moved&&!Ue.nodeId&&ue(!1),(qt=(mt=Ue.canvas)==null?void 0:mt.releasePointerCapture)==null||qt.call(mt,Ue.pointerId),(cn=(Yt=Me.currentTarget)==null?void 0:Yt.releasePointerCapture)==null||cn.call(Yt,Ue.pointerId),de.current=null,N(!1))};l.useEffect(()=>{const Me=Ue=>Xe(Ue);return window.addEventListener("pointerup",Me),window.addEventListener("pointercancel",Me),window.addEventListener("blur",Me),()=>{window.removeEventListener("pointerup",Me),window.removeEventListener("pointercancel",Me),window.removeEventListener("blur",Me)}},[]);const Qe=Me=>{we(Ue=>({...Ue,root:eu(Ue.root,Me,mt=>({...mt,collapsed:!mt.collapsed}))}))},Ze=(Me,Ue=!1)=>{we(mt=>({...mt,root:h2(mt.root,Me,!0)})),Ue&&E(mt=>mt+1)},it=async Me=>{var Ue;if(a)try{if(Me==="xmind"){const{mindMapToXmindBlob:mt}=await pu(async()=>{const{mindMapToXmindBlob:Yt}=await import("./xmindAdapter-R4YZlQ1Y.js");return{mindMapToXmindBlob:Yt}},[]),qt=await mt(a);tu(`${a.title||"mind-map"}.xmind`,qt,"application/octet-stream"),n.success("XMind exported");return}if(Me==="markdown"){tu(`${a.title||"mind-map"}.md`,cA(a),"text/markdown;charset=utf-8"),n.success("Markdown exported");return}if(Me==="jpg"){(Ue=document.fonts)!=null&&Ue.ready&&await document.fonts.ready,u({...a,root:h2(a.root,!1,!0)}),await new Promise(mt=>requestAnimationFrame(()=>requestAnimationFrame(mt)));try{const mt=await T4e(J.current);tu(`${a.title||"mind-map"}.jpg`,mt,"image/jpeg"),n.success("JPG exported")}finally{u(null)}return}tu(`${a.title||"mind-map"}.json`,`${JSON.stringify(a,null,2)}
623
+ `,"application/json;charset=utf-8"),n.success("JSON exported")}catch(mt){n.error(`Could not export this map: ${mt.message||"unknown error"}`)}},ut=async Me=>{var mt;const Ue=(mt=Me.target.files)==null?void 0:mt[0];if(Me.target.value="",!(!Ue||!a))try{const qt=Ue.name.toLowerCase().endsWith(".xmind"),Yt=qt?null:await Ue.text(),cn=Ue.name.toLowerCase().endsWith(".json"),nn=qt?await(async()=>{const{xmindBlobToMindMap:Mt}=await pu(async()=>{const{xmindBlobToMindMap:Rt}=await import("./xmindAdapter-R4YZlQ1Y.js");return{xmindBlobToMindMap:Rt}},[]);return Mt(await Ue.arrayBuffer(),hS(Ue.name))})():cn?$4(JSON.parse(Yt),hS(Ue.name)):uA(Yt,hS(Ue.name)),gn={...nn,id:a.id,title:nn.title||a.title,createdAt:a.createdAt,updatedAt:new Date().toISOString()};await he.current.catch(()=>{});const St=await sl.update(a.id,gn);o(St),qe(gn.root.id),p(St.title),n.success(`${qt?"XMind":cn?"JSON":"Markdown"} imported into this map`)}catch(qt){n.error(`Could not import this file: ${qt.message||"invalid format"}`)}},pt=async()=>{if(a!=null&&a.filePath)try{await Wn.openFolder(a.filePath)}catch(Me){n.error(`Could not open map folder: ${Me.message||"unknown error"}`)}},Lt=async()=>{if(a!=null&&a.filePath)try{await navigator.clipboard.writeText(a.filePath),n.success("Mind map file path copied")}catch(Me){n.error(`Could not copy file path: ${Me.message||"clipboard unavailable"}`)}};if(v)return c.jsx("div",{className:"mind-map-missing",children:c.jsx(rr,{tip:"Loading mind map..."})});if(!a)return c.jsxs("div",{className:"mind-map-missing",children:[c.jsx(Xt,{description:"This mind map could not be found."}),c.jsx(Oe,{onClick:()=>t("mind-maps"),children:"Back to mind maps"})]});const Pt=ne&&!!f;return c.jsxs("div",{className:`mind-map-detail-page${Z?" is-canvas-fullscreen":""}`,children:[c.jsxs("div",{className:"mind-map-detail-toolbar",children:[c.jsxs("div",{className:"mind-map-detail-heading",children:[c.jsx(Oe,{"aria-label":"Back to mind maps",className:"mind-map-back-button",icon:c.jsx(ec,{}),onClick:()=>t("mind-maps"),type:"text"}),c.jsx("div",{className:"mind-map-breadcrumbs",children:c.jsx("button",{onClick:()=>t("mind-maps"),type:"button",children:"Mind maps"})}),c.jsx(Ct,{"aria-label":"Mind map title",className:"mind-map-title-input",onBlur:ke,onChange:Me=>p(Me.target.value),onPressEnter:Me=>Me.currentTarget.blur(),value:h})]}),c.jsxs(ct,{className:"mind-map-detail-actions",size:8,children:[c.jsx("input",{ref:r,accept:".xmind,.json,.md,.markdown,.txt",className:"mind-map-hidden-input",onChange:ut,type:"file"}),c.jsx(Oe,{icon:c.jsx(X$,{}),onClick:()=>{var Me;return(Me=r.current)==null?void 0:Me.click()},children:"Import"}),c.jsx(Bl,{menu:{items:[{key:"xmind",icon:c.jsx(tI,{}),label:"Export XMind"},{key:"jpg",icon:c.jsx(Uv,{}),label:"Export JPG"},{key:"json",icon:c.jsx(wa,{}),label:"Export JSON"},{key:"markdown",icon:c.jsx(Ui,{}),label:"Export Markdown"}],onClick:({key:Me})=>it(Me)},trigger:["click"],children:c.jsx(Oe,{icon:c.jsx(ql,{}),children:"Export"})}),c.jsx(Oe,{"aria-label":"Mind map settings",icon:c.jsx(Gl,{}),onClick:Ye,children:"Settings"}),c.jsx(Oe,{icon:c.jsx(Q$,{}),onClick:()=>n.success("All changes saved to the data file"),children:"Save"})]})]}),c.jsxs("div",{className:`mind-map-detail-layout${Pt?"":" is-inspector-collapsed"}`,children:[c.jsxs(It,{className:"mind-map-canvas-card",styles:{body:{padding:0}},children:[c.jsxs("div",{className:"mind-map-canvas-header",children:[c.jsxs("div",{className:"mind-map-canvas-heading",children:[c.jsx(io,{className:"mind-map-eyebrow",children:"CANVAS"}),c.jsxs("div",{className:"mind-map-canvas-title-row",children:[c.jsx(zk,{level:3,children:"Map canvas"}),c.jsx(io,{className:"mind-map-canvas-tip",type:"secondary",children:"Tip: keep each branch short and concrete."})]})]}),c.jsxs(ct,{className:"mind-map-canvas-controls",size:12,children:[c.jsx(Oe,{"aria-label":Z?"Exit canvas full screen":"Enter canvas full screen",icon:Z?c.jsx(T9,{}):c.jsx(P9,{}),onClick:()=>{ee(Me=>!Me),w(Me=>Me+1)},type:"text"}),c.jsx(Oe,{"aria-label":Pt?"Collapse inspector":"Show inspector",className:"mind-map-inspector-control",icon:Pt?c.jsx(Xve,{}):c.jsx(Zve,{}),onClick:()=>ue(Me=>!Me),type:"text"}),c.jsxs(ct,{className:"mind-map-tree-actions",size:4,children:[c.jsx(Oe,{icon:c.jsx(h9,{}),onClick:()=>Ze(!1),children:"Expand all"}),c.jsx(Oe,{icon:c.jsx(m9,{}),onClick:()=>Ze(!0,!0),children:"Collapse all"})]}),c.jsxs(ct,{className:"mind-map-zoom-control",size:4,children:[c.jsx(Oe,{"aria-label":"Zoom out",disabled:b<=.5,icon:c.jsx(RD,{}),onClick:()=>{var Me;return(Me=be.current)==null?void 0:Me.zoomAt(Math.max(.5,Number((b-.1).toFixed(2))))},type:"text"}),c.jsxs("button",{"aria-label":"Reset canvas view",className:"mind-map-zoom-label",onClick:()=>{C(1),w(Me=>Me+1)},type:"button",children:[Math.round(b*100),"%"]}),c.jsx(Oe,{"aria-label":"Zoom in",disabled:b>=2,icon:c.jsx(OD,{}),onClick:()=>{var Me;return(Me=be.current)==null?void 0:Me.zoomAt(Math.min(2,Number((b+.1).toFixed(2))))},type:"text"})]})]})]}),c.jsx(L4e,{ref:be,isPanning:R,map:a,onCanvasPointerDown:Ee,onCanvasPointerMove:Be,onCanvasPointerUp:Xe,onSelect:qe,onToggle:Qe,onZoomChange:C,recenterLayoutToken:$,resetViewToken:x,selectedId:f,zoom:b,jiraIssues:Re,nodeMaxWidth:j}),c.jsx("div",{className:"mind-map-canvas-footer",children:c.jsxs(io,{type:"secondary",children:[c.jsx("span",{className:"mind-map-key",children:"⌘"})," Click to select ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," ",c.jsx("span",{className:"mind-map-key",children:"Enter"})," sibling ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," ",c.jsx("span",{className:"mind-map-key",children:"Tab"})," child ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," Drag canvas to pan ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," ⌘ + Scroll to zoom ",c.jsx("span",{className:"mind-map-footer-dot",children:"·"})," Changes save automatically"]})})]}),c.jsx(It,{className:"mind-map-inspector-card",children:c.jsxs("div",{className:"mind-map-inspector-shell",children:[c.jsxs("div",{className:"mind-map-inspector-header",children:[c.jsxs("div",{children:[c.jsx(io,{className:"mind-map-eyebrow",children:"INSPECTOR"}),c.jsxs("div",{className:"mind-map-inspector-title-row",children:[c.jsx(zk,{level:3,children:"Selected idea"}),(ce==null?void 0:ce.id)===a.root.id?c.jsx($t,{color:"purple",children:"Root"}):null,se?c.jsx($t,{className:"mind-map-comment-tag",children:"Comment"}):null]})]}),(ce==null?void 0:ce.id)!==a.root.id&&c.jsxs("div",{className:"mind-map-inspector-header-actions",children:[ae&&c.jsxs("div",{className:"mind-map-sibling-order-actions",children:[c.jsx(yn,{title:"Move idea up",children:c.jsx(Oe,{"aria-label":"Move idea up",disabled:ge<=0,icon:c.jsx(k9,{}),onClick:()=>$e(-1)})}),c.jsx(yn,{title:"Move idea down",children:c.jsx(Oe,{"aria-label":"Move idea down",disabled:ge<0||ge>=ae.children.length-1,icon:c.jsx(I9,{}),onClick:()=>$e(1)})})]}),c.jsx(Gr,{cancelText:"Cancel",description:"This will also remove all child ideas.",okButtonProps:{danger:!0},okText:"Delete",onConfirm:We,placement:"topRight",title:"Delete this idea?",children:c.jsx(Oe,{"aria-label":"Delete selected idea",className:"mind-map-inline-delete",danger:!0,icon:c.jsx(Fn,{}),type:"text"})})]})]}),c.jsx("div",{className:"mind-map-inspector-content",children:ce&&c.jsxs("div",{className:"mind-map-inspector-fields",children:[c.jsxs("section",{className:"mind-map-inspector-section",children:[c.jsx("div",{className:"mind-map-inspector-section-title",children:"Content"}),c.jsxs("div",{className:"mind-map-idea-label-row",children:[c.jsx("label",{className:"mind-map-field-label",htmlFor:"mind-map-node-text",children:"Idea"}),c.jsxs("div",{className:"mind-map-auto-width-field",children:[c.jsx(yn,{title:"When off, text wraps only at manual line breaks.",placement:"top",children:c.jsx("span",{className:"mind-map-auto-width-label",children:"Auto width"})}),c.jsx(Ja,{"aria-label":"Auto width",checked:ce.autoWidth!==!1,onChange:Me=>Pe({autoWidth:Me}),size:"small"})]})]}),c.jsx(Ct.TextArea,{autoSize:{minRows:2,maxRows:8},className:"mind-map-idea-input",id:"mind-map-node-text",onChange:Me=>Pe({text:Me.target.value}),placeholder:"Name this idea",ref:ye,value:ce.text}),ae&&c.jsxs(c.Fragment,{children:[c.jsx("label",{className:"mind-map-field-label",htmlFor:"mind-map-node-edge-label",children:"Line label"}),c.jsx(Ct,{id:"mind-map-node-edge-label",onChange:Me=>Pe({edgeLabel:Me.target.value||void 0}),placeholder:"Label this connection",value:ce.edgeLabel||""})]}),c.jsxs("div",{className:"mind-map-notes-label-row",children:[c.jsx("label",{className:"mind-map-field-label",htmlFor:"mind-map-node-notes",children:"Notes"}),c.jsx(Oe,{className:"mind-map-notes-toggle",onClick:()=>oe(Me=>!Me),size:"small",type:"text",children:re?"Hide notes":(kt=ce.notes)!=null&&kt.trim()?"Edit notes":"Add note"})]}),re&&c.jsx(Ct.TextArea,{autoSize:{minRows:4,maxRows:8},id:"mind-map-node-notes",onChange:Me=>Pe({notes:Me.target.value}),placeholder:"Add a note or a prompt...",value:ce.notes||""})]}),!se&&c.jsxs("section",{className:"mind-map-inspector-section",children:[c.jsx("div",{className:"mind-map-inspector-section-title",children:"Test status"}),c.jsxs("div",{className:"mind-map-tested-field",children:[c.jsxs("div",{children:[c.jsx("span",{className:"mind-map-field-label",children:"Tested"}),c.jsx(io,{type:"secondary",children:"Updates this node and all child nodes."})]}),c.jsxs("div",{className:"mind-map-tested-control",children:[c.jsx("span",{className:"mind-map-tested-state",children:ce.tested?"Tested":"Pending"}),c.jsx(Ja,{checked:!!ce.tested,onChange:Ie,size:"small"})]})]})]}),c.jsxs("section",{className:"mind-map-inspector-section",children:[c.jsx("div",{className:"mind-map-inspector-section-title",children:"Jira"}),ie.length>0&&c.jsx("div",{"aria-label":"Selected Jira issues",className:"mind-map-selected-jira-list",children:ie.map(Me=>c.jsxs("div",{className:"mind-map-selected-jira-item",children:[c.jsxs("button",{className:"mind-map-selected-jira-open",disabled:!Me.url,onClick:()=>hr(Me.url),title:Me.url?"Open in Jira":"Jira link unavailable",type:"button",children:[c.jsx($t,{color:"blue",children:Me.key}),c.jsx("span",{className:"mind-map-selected-jira-summary",children:Me.summary||"Summary unavailable"}),Me.url&&c.jsx(ul,{})]}),c.jsx("button",{"aria-label":`Untag ${Me.key}`,className:"mind-map-selected-jira-untag",onClick:()=>vt(Me.key),title:`Untag ${Me.key}`,type:"button",children:c.jsx(Xo,{})})]},Me.key))}),c.jsx($n,{allowClear:!0,"aria-label":"Jira tags",className:"mind-map-node-jira-select",filterOption:(Me,Ue)=>`${(Ue==null?void 0:Ue.value)||""} ${(Ue==null?void 0:Ue.summary)||""}`.toLowerCase().includes(Me.toLowerCase()),id:"mind-map-node-jira",mode:"multiple",onChange:Me=>{Pe({jiraKeys:Me}),V(!1),requestAnimationFrame(()=>{var Ue,mt;return(mt=(Ue=ze.current)==null?void 0:Ue.blur)==null?void 0:mt.call(Ue)})},options:Re.map(Me=>({label:c.jsxs("div",{className:"mind-map-jira-select-option",children:[c.jsx("span",{className:"mind-map-jira-select-option-key",children:Me.key}),c.jsx("span",{className:"mind-map-jira-select-option-summary",children:Me.summary||"Summary unavailable"})]}),summary:Me.summary||"",value:Me.key})),maxTagCount:0,maxTagPlaceholder:"Select Jira issues",onOpenChange:V,placeholder:Re.length?"Select Jira issues":"Add Jira issues in Settings",showSearch:!0,open:X,ref:ze,value:ce.jiraKeys||[]})]})]})}),c.jsxs("div",{className:"mind-map-inspector-actions",children:[c.jsx(yn,{title:"Add a child idea (Tab)",children:c.jsx(Oe,{block:!0,className:"mind-map-add-child",icon:c.jsx(Xn,{}),onClick:Le,type:"primary",children:"Add child idea"})}),ae&&c.jsx(Oe,{block:!0,className:"mind-map-move-button",icon:c.jsx(tI,{}),onClick:De,children:"Move idea"})]})]})})]}),c.jsxs(I$,{className:"mind-map-settings-drawer",onClose:()=>I(!1),open:O,title:"Mind map settings",width:520,children:[c.jsxs("div",{className:"mind-map-settings-section",children:[c.jsx(io,{className:"mind-map-settings-section-title",children:"Node width"}),c.jsx(io,{className:"mind-map-settings-description",children:"Set a maximum width for regular nodes. Leave empty to keep the current default (255px)."}),c.jsxs("div",{className:"mind-map-node-width-control",children:[c.jsx(cf,{"aria-label":"Maximum node width",className:"mind-map-node-width-input",max:800,min:120,onChange:Me=>z(Me??null),placeholder:"Default",step:10,value:T??void 0}),c.jsx(Oe,{disabled:!P||T===j,loading:H,onClick:Ge,type:"primary",children:"Save"})]})]}),c.jsxs("div",{className:"mind-map-settings-section",children:[c.jsx(io,{className:"mind-map-settings-section-title",children:"File location"}),c.jsx(io,{className:"mind-map-settings-description",children:"This mind map is stored locally in the following file."}),c.jsxs(ct.Compact,{block:!0,className:"mind-map-file-location-row",children:[c.jsxs("div",{className:`mind-map-file-location-display${a.filePath?"":" is-unavailable"}`,title:a.filePath||"File location unavailable",children:[c.jsx(Oe,{"aria-label":"Open mind map folder",className:"mind-map-file-location-folder",disabled:!a.filePath,icon:c.jsx(Fr,{}),onClick:pt,type:"text"}),c.jsx(io,{className:"mind-map-file-location-path",children:a.filePath||"File location unavailable"})]}),c.jsx(Oe,{disabled:!a.filePath,icon:c.jsx(fo,{}),onClick:Lt,children:"Copy"})]})]}),c.jsxs("div",{className:"mind-map-settings-section",children:[c.jsx(io,{className:"mind-map-settings-section-title",children:"Jira issues"}),c.jsx(io,{className:"mind-map-settings-description",children:"Add issues to this map by Jira No or a Jira issue link, then tag them from the selected node inspector."}),c.jsxs(ct.Compact,{block:!0,className:"mind-map-jira-add-row",children:[c.jsx(Ct,{onChange:Me=>F(Me.target.value),onPressEnter:He,placeholder:"PROJ-123 or https://.../browse/PROJ-123",value:L}),c.jsx(Oe,{loading:U,onClick:He,type:"primary",children:"Add"})]}),c.jsx("div",{className:"mind-map-jira-list",children:Re.length?Re.map(Me=>c.jsxs("div",{className:`mind-map-jira-list-item ${Me.url?"is-clickable":""} ${_e.has(Me.key)?"is-tagged":""}`,onClick:()=>Me.url&&hr(Me.url),onKeyDown:Ue=>{Ue.target!==Ue.currentTarget||!Me.url||(Ue.key==="Enter"||Ue.key===" ")&&(Ue.preventDefault(),hr(Me.url))},role:Me.url?"link":void 0,tabIndex:Me.url?0:void 0,children:[c.jsx("div",{className:"mind-map-jira-list-item-main",children:c.jsxs("div",{className:"mind-map-jira-list-item-title",children:[c.jsx($t,{color:"blue",children:Me.key}),c.jsx(io,{ellipsis:{tooltip:!0},children:Me.summary||"Summary unavailable"})]})}),c.jsxs("div",{className:"mind-map-jira-list-item-delete",onClick:Ue=>Ue.stopPropagation(),children:[c.jsx(Oe,{"aria-label":`Refresh summary for ${Me.key}`,className:"mind-map-jira-refresh",disabled:!!_,icon:c.jsx(Xa,{spin:_===Me.key}),onClick:()=>void ft(Me),title:`Refresh summary for ${Me.key}`,type:"text"}),c.jsx(Gr,{cancelText:"Cancel",description:"Existing node tags for this issue will also be removed.",okButtonProps:{danger:!0},okText:"Remove",onConfirm:()=>nt(Me.key),placement:"left",title:`Remove ${Me.key}?`,children:c.jsx(Oe,{"aria-label":`Remove ${Me.key}`,danger:!0,icon:c.jsx(Fn,{}),type:"text"})})]})]},Me.id||Me.key)):c.jsx(Xt,{className:"mind-map-jira-empty",description:"No Jira issues added yet.",image:Xt.PRESENTED_IMAGE_SIMPLE})})]})]}),c.jsxs(bn,{cancelText:"Cancel",okText:"Move",onCancel:()=>G(!1),onOk:Je,open:W,title:`Move “${(ce==null?void 0:ce.text)||"idea"}”`,children:[c.jsx(io,{type:"secondary",children:"Choose the node that should become the new parent. The entire subtree will move with it."}),c.jsx(Jl,{changeOnSelect:!0,className:"mind-map-move-select",onChange:te,options:fe,placeholder:"Select a parent node",showSearch:!0,value:Y})]}),s&&c.jsx(_4e,{map:s,nodeMaxWidth:j,ref:J})]})}async function Ak(e,t={}){if(typeof window>"u"||!("Notification"in window)||Notification.permission!=="granted")return!1;const n={body:"",icon:"/devbuddy-192.png",tag:`devbuddy-notification-${Date.now()}`,...t};try{if("serviceWorker"in navigator){const r=await navigator.serviceWorker.ready;if(r.active)return r.active.postMessage({type:"SHOW_NOTIFICATION",title:e,...n}),!0}return new Notification(e,n),!0}catch{return!1}}const{Content:H4e,Sider:F4e}=Js,{Title:_k,Text:Bc}=xn,Lk={dark:"#171c2b",light:"#dbeafe"},V4e="var(--db-font-sans)",U4e=(e,t)=>{var r;const n=(r=e==null?void 0:e.scripts)==null?void 0:r.find(a=>a.id===t);return n?n.name:t==="install"?"Install":t.startsWith("package:")?t.slice(8):t},W4e=(e,t)=>{const[n,...r]=String(t).split(":"),a=r.join(":"),o=e.find(s=>String(s.id)===n);return`${(o==null?void 0:o.alias)||(o==null?void 0:o.folder)||"Launcher"} · ${U4e(o,a)}`},wA=["overview","launcher","cron-jobs","clipboard","ports","image-compress","json-to-typescript","jira-filters","todo-list","reminders","memos","mind-maps","postman","bookmark-sync","file-organizer","branch-sync","branch-health","package-upgrade","package-versions","presentation-plan","presentation-view","settings","dev-configurations","errors"],q4e={overview:"Overview",launcher:"Launcher","cron-jobs":"Cron Jobs",clipboard:"Clipboard",ports:"Port Diagnostic","todo-list":"To-Do","todo-archived":"Archived Tasks",reminders:"Reminders",memos:"Memos","mind-maps":"Mind Maps","pr-review":"PR Review","pr-conflicts":"Resolve Conflicts","pr-conflict":"Resolve Conflicts","jira-filters":"Jira Workspace","presentation-plan":"Presentations","presentation-view":"Presentation","memo-reader":"Reading","branch-sync":"Branch Sync","branch-health":"Branch Health","package-upgrade":"Package Upgrade","package-versions":"Package Versions",postman:"Postman","image-compress":"Image compression","json-to-typescript":"JSON to TypeScript","bookmark-sync":"Bookmark Sync","file-organizer":"Folder Organizer",settings:"Settings","dev-configurations":"Dev Configurations",errors:"Error Logs"},$A=e=>{if(e==="mind-maps"||e==="mind-maps/")return{page:"mind-maps",mindMapId:null};if(e.startsWith("mind-maps/")){const t=e.slice(10).split("?")[0];return t?{page:"mind-maps",mindMapId:decodeURIComponent(t)}:null}return null},K4e=()=>{const t=(window.location.hash||"#/overview").slice(2),n=$A(t);if(n)return n;if(t==="memo-reader"||t.startsWith("memo-reader?"))return{page:"memo-reader",memoId:new URLSearchParams(t.split("?")[1]||"").get("id")||null};if(t.startsWith("plugin:"))return{page:"plugin",pluginId:t.slice(7)};if(t.startsWith("static:"))return{page:"static-page",staticId:t.slice(7)};if(t.startsWith("logs/"))return{page:"logs",pluginId:null};if(["todo-list/archived","todo-archived"].includes(t))return{page:"todo-archived",pluginId:null};if(t.startsWith("pr-review"))return{page:"pr-review",pluginId:null};if(t==="pr-conflicts"||t.startsWith("pr-conflicts?"))return{page:"pr-conflicts",pluginId:null};if(t.startsWith("pr-conflict"))return{page:"pr-conflict",pluginId:null};if(t.startsWith("branch-sync"))return{page:"branch-sync",pluginId:null};if(t.startsWith("branch-health"))return{page:"branch-health",pluginId:null};if(t==="launcher"||t.startsWith("launcher?")){const r=new URLSearchParams(t.split("?")[1]||"");return{page:"launcher",pluginId:null,launcherRunningOnly:r.get("running")==="1",launcherServiceId:r.get("service")||null}}return t==="home"?{page:"overview",pluginId:null}:wA.includes(t)?{page:t,pluginId:null}:{page:"overview",pluginId:null}};function G4e({theme:e,onThemeChange:t}){var We;const{message:n}=Pr.useApp(),r=K4e(),[a,o]=l.useState([]),[s,u]=l.useState(new Set),[f,m]=l.useState({}),[h,p]=l.useState([]),[v,y]=l.useState(!0),[b,C]=l.useState(null),[x,w]=l.useState(!1),[$,E]=l.useState(!1),[R,N]=l.useState([]),[O,I]=l.useState([]),[j,M]=l.useState(r.page),[T,z]=l.useState(r.launcherRunningOnly||!1),[P,B]=l.useState(r.launcherServiceId||null),[H,A]=l.useState(r.mindMapId||null),[L,F]=l.useState(r.memoId||null),[U,q]=l.useState(()=>{var De;return((De=window.matchMedia)==null?void 0:De.call(window,"(max-width: 991.98px)").matches)??!1}),[_,K]=l.useState(null),[X,V]=l.useState(!1),[W,G]=l.useState(!1),[Y,te]=l.useState(""),[ne,ue]=l.useState(null),[Z,ee]=l.useState(!1),[re,oe]=l.useState(null),de=l.useRef(null),be=l.useRef(new Map),J=l.useRef(null),ye=l.useCallback((De,Je)=>{De.preventDefault(),De.stopPropagation(),oe({key:Je,left:Math.min(De.clientX,Math.max(8,window.innerWidth-220)),top:Math.min(De.clientY,Math.max(8,window.innerHeight-58))})},[]),xe=l.useCallback(De=>{var Ge,He,nt;const Je=(He=(Ge=De.target).closest)==null?void 0:He.call(Ge,".ant-menu-item"),Ye=(nt=Je==null?void 0:Je.querySelector("[data-sidebar-key]"))==null?void 0:nt.dataset.sidebarKey;Ye&&ye(De,Ye)},[ye]),ze=l.useCallback(()=>{if(!(re!=null&&re.key))return;const De=new URL(window.location.href);De.hash=`#/${re.key}`,window.open(De.toString(),"_blank","noopener,noreferrer"),oe(null)},[re]),[he,ce]=l.useState(r.pluginId?{id:r.pluginId,name:"Plugin"}:null),[se,ae]=l.useState(null),[ge,Re]=l.useState(""),_e=async({showLoading:De=!1}={})=>{De&&y(!0);try{const[Je,Ye,Ge]=await Promise.all([Br.list(),Br.running(),Zc.list().catch(()=>[])]);o(Je),p(Array.isArray(Ge)?Ge:[]),Array.isArray(Ye)?(u(new Set(Ye)),m({})):(u(new Set((Ye==null?void 0:Ye.running)||[])),m((Ye==null?void 0:Ye.errorCounts)||{})),w(!0),C(null),E(!0)}catch(Je){C((Je==null?void 0:Je.message)||"Unable to load service and runtime data."),E(!1)}finally{De&&y(!1)}};l.useEffect(()=>{const De=async()=>{try{const[Ye,Ge]=await Promise.all([Br.running(),Zc.list().catch(()=>[])]);Array.isArray(Ye)?(u(new Set(Ye)),m({})):(u(new Set((Ye==null?void 0:Ye.running)||[])),m((Ye==null?void 0:Ye.errorCounts)||{})),Array.isArray(Ge)&&p(Ge)}catch{}},Je=setInterval(()=>{De()},5e3);return()=>clearInterval(Je)},[]),l.useEffect(()=>{if(!x)return;const De=Object.fromEntries(Object.entries(f).map(([Xe,Qe])=>[Xe,Number(Qe)||0])),Je=(Array.isArray(h)?h:[]).filter(Xe=>{var Qe;return(Qe=Xe==null?void 0:Xe.source)==null?void 0:Qe.startsWith("Launcher")}),Ye=new Set(Je.map(Xe=>Xe.id).filter(Boolean)),Ge=de.current;if(!Ge){de.current={counts:De,ids:Ye};return}const He=Object.entries(De).filter(([Xe,Qe])=>Qe>(Ge.counts[Xe]||0)).map(([Xe,Qe])=>({key:Xe,delta:Qe-(Ge.counts[Xe]||0),count:Qe})),nt=Je.filter(Xe=>Xe.id&&!Ge.ids.has(Xe.id));de.current={counts:De,ids:Ye};const ft=[...He.map(Xe=>({dedupeKey:Xe.key,label:W4e(a,Xe.key),count:Xe.delta})),...nt.map(Xe=>({dedupeKey:Xe.source,label:`${Xe.source.replace(/^Launcher:\s*/,"")} · ${Xe.message||"Script error"}`,count:1}))],vt=Date.now(),qe=ft.filter(Xe=>{const Qe=be.current.get(Xe.dedupeKey)||0;return vt-Qe<1e4?!1:(be.current.set(Xe.dedupeKey,vt),!0)});if(qe.length===0)return;const Ee=qe.reduce((Xe,Qe)=>Xe+Qe.count,0),Be=qe.slice(0,3).map(Xe=>Xe.label).join(";");Ak(Ee===1?"Launcher script error":`Launcher: ${Ee} new script errors`,{body:Be||"A Launcher script reported a new error."})},[f,h,x,a]),l.useEffect(()=>{let De=!1;const Je=async()=>{var Ge;try{const He=await Td.claimDue();if(De||!((Ge=He==null?void 0:He.due)!=null&&Ge.length))return;await Promise.all(He.due.map(async nt=>{await Ak(nt.title,{body:nt.content,tag:`devbuddy-reminder-${nt.id}`})||n.info({content:`${nt.title}:${nt.content}`,duration:8})}))}catch{}};Je();const Ye=window.setInterval(()=>{Je()},1e4);return()=>{De=!0,window.clearInterval(Ye)}},[n]);const ie=async(De=!1)=>{V(!0);try{K(await oI.status(De))}catch{K(Je=>Je||{currentVersion:jd.version,latestVersion:jd.version,updateAvailable:!1,releases:[],sourceUnavailable:!0})}finally{V(!1)}},fe=()=>_e({showLoading:!0}),we=()=>{ue(null),ee(!0)},ke=()=>{const De=ne==null?void 0:ne.success;ee(!1),De&&window.location.reload()},Pe=async(De="latest")=>{G(!0),te(De),ue(null);try{const Je=await oI.selfUpdate(De);ue({success:!0,message:Je.message}),K(Ye=>Ye&&{...Ye,currentVersion:De==="latest"?Ye.latestVersion:De,updateAvailable:De==="latest"?!1:De!==Ye.latestVersion})}catch(Je){ue({success:!1,message:Je.message||"DevBuddy could not be updated."})}finally{G(!1)}},Ie=async De=>{if(De){Re("Loading plugin…");try{Re(De.view?await(await fetch(De.view)).text():"This plugin does not provide a view yet.")}catch{Re("Failed to load the plugin view.")}}};l.useEffect(()=>{Promise.all([_e({showLoading:!0}),lye.list().then(N),Kc.list().then(I)]).catch(De=>n.error(De.message)),ie()},[]),l.useEffect(()=>{const De=()=>{const Ye=(window.location.hash||"#/overview").slice(2),Ge=$A(Ye);if(Ge){ce(null),ae(null),M("mind-maps"),A(Ge.mindMapId);return}if(Ye==="memo-reader"||Ye.startsWith("memo-reader?")){const He=new URLSearchParams(Ye.split("?")[1]||"");ce(null),ae(null),M("memo-reader"),A(null),F(He.get("id")||null);return}if(Ye.startsWith("plugin:")){const He=Ye.slice(7),nt=R.find(ft=>ft.id===He);nt?(ae(null),M("plugin"),A(null),ce(nt),Ie(nt)):R.length>0&&(window.location.hash="#/overview")}else if(Ye.startsWith("static:")){const He=Ye.slice(7),nt=O.find(ft=>String(ft.id)===String(He));nt?(ce(null),M("static-page"),A(null),ae(nt)):O.length>0&&(window.location.hash="#/overview")}else if(Ye.startsWith("logs/"))ce(null),ae(null),M("logs"),A(null);else if(["todo-list/archived","todo-archived"].includes(Ye))ce(null),ae(null),M("todo-archived"),A(null);else if(Ye.startsWith("pr-review"))ce(null),ae(null),M("pr-review"),A(null);else if(Ye==="pr-conflicts"||Ye.startsWith("pr-conflicts?"))ce(null),ae(null),M("pr-conflicts"),A(null);else if(Ye.startsWith("pr-conflict"))ce(null),ae(null),M("pr-conflict"),A(null);else if(Ye.startsWith("branch-sync"))ce(null),ae(null),M("branch-sync"),A(null);else if(Ye.startsWith("branch-health"))ce(null),ae(null),M("branch-health"),A(null);else if(Ye==="launcher"||Ye.startsWith("launcher?")){const He=new URLSearchParams(Ye.split("?")[1]||"");ce(null),ae(null),M("launcher"),A(null),z(He.get("running")==="1"),B(He.get("service")||null)}else Ye==="home"||wA.includes(Ye)?(ce(null),ae(null),M(Ye==="home"?"overview":Ye),A(null),Ye==="launcher"&&z(!1)):window.location.hash="#/overview"};return window.addEventListener("hashchange",De),window.location.hash?De():window.location.hash="#/overview",()=>window.removeEventListener("hashchange",De)},[R,O]),l.useEffect(()=>{if(!re)return;const De=()=>oe(null),Je=Ge=>{var He,nt;Ge.button!==0||(nt=(He=Ge.target).closest)!=null&&nt.call(He,".sidebar-context-menu")||De()},Ye=Ge=>{Ge.key==="Escape"&&De()};return document.addEventListener("pointerdown",Je),document.addEventListener("contextmenu",De),window.addEventListener("blur",De),window.addEventListener("keydown",Ye),()=>{document.removeEventListener("pointerdown",Je),document.removeEventListener("contextmenu",De),window.removeEventListener("blur",De),window.removeEventListener("keydown",Ye)}},[re]),l.useEffect(()=>{const De=Ye=>{var Ge;(Ye.error||Ye.message)&&Zc.log({source:"Frontend",message:Ye.message||"Uncaught JavaScript Error",details:((Ge=Ye.error)==null?void 0:Ge.stack)||`${Ye.filename}:${Ye.lineno}:${Ye.colno}`}).catch(()=>{})},Je=Ye=>{var Ge,He;Zc.log({source:"Frontend (Promise)",message:((Ge=Ye.reason)==null?void 0:Ge.message)||String(Ye.reason||"Unhandled Promise Rejection"),details:((He=Ye.reason)==null?void 0:He.stack)||String(Ye.reason)}).catch(()=>{})};return window.addEventListener("error",De),window.addEventListener("unhandledrejection",Je),()=>{window.removeEventListener("error",De),window.removeEventListener("unhandledrejection",Je)}},[]),l.useLayoutEffect(()=>{var De;(De=document.querySelector(".page"))==null||De.scrollTo({top:0,left:0,behavior:"auto"}),j==="overview"&&J.current&&(J.current.scrollTop=0,J.current.scrollLeft=0)},[j,H,he==null?void 0:he.id,se==null?void 0:se.id]),l.useEffect(()=>{if(j==="logs")return;const De=j==="plugin"?(he==null?void 0:he.name)||(he==null?void 0:he.id):j==="static-page"?se==null?void 0:se.name:q4e[j];document.title=De?`${De} · DevBuddy`:"DevBuddy · Workbench"},[j,he==null?void 0:he.name,he==null?void 0:he.id,se==null?void 0:se.name]);const Ve=()=>{J.current&&(J.current.scrollTop=0,J.current.scrollLeft=0)};l.useEffect(()=>{const De=Je=>{(Je.metaKey||Je.ctrlKey)&&Je.shiftKey&&(Je.key==="r"||Je.key==="R"||Je.code==="KeyR")&&(Je.preventDefault(),Je.stopPropagation())};return window.addEventListener("keydown",De,!0),()=>window.removeEventListener("keydown",De,!0)},[]),l.useEffect(()=>{if(v||!["overview","launcher","ports"].includes(j))return;const De=setInterval(()=>{_e()},2e3);return()=>clearInterval(De)},[j,v]);const Le=l.useMemo(()=>{const De=Ye=>Ye.map(Ge=>Ge.children?{...Ge,children:De(Ge.children)}:Ge.key?{...Ge,icon:Ge.icon?c.jsx("span",{className:"sidebar-context-icon","data-sidebar-key":Ge.key,children:Ge.icon}):Ge.icon,label:c.jsx("span",{className:"sidebar-context-label","data-sidebar-key":Ge.key,children:Ge.label})}:Ge),Je=[...R.map(Ye=>({key:`plugin:${Ye.id}`,icon:c.jsx("span",{"aria-hidden":"true",children:Ye.icon||"✦"}),label:Ye.name||Ye.id})),...O.map(Ye=>({key:`static:${Ye.id}`,icon:c.jsx(kf,{}),label:Ye.name}))];return De([{type:"group",label:"Run & Observe",children:[{key:"launcher",icon:c.jsx(qo,{}),label:"Launcher"},{key:"cron-jobs",icon:c.jsx(Jm,{}),label:"Cron Jobs"},{key:"clipboard",icon:c.jsx(fo,{}),label:"Clipboard"},{key:"ports",icon:c.jsx(e4,{}),label:"Port Diagnostic"}]},{type:"group",label:"Plan & Review",children:[{key:"todo-list",icon:c.jsx(mu,{}),label:"To-Do"},{key:"reminders",icon:c.jsx(Kd,{}),label:"Reminders"},{key:"memos",icon:c.jsx(Ui,{}),label:"Memos"},{key:"mind-maps",icon:c.jsx(MC,{}),label:"Mind Maps"},{key:"pr-review",icon:c.jsx(Ay,{}),label:"PR Review"},{key:"pr-conflicts",icon:c.jsx(C0,{}),label:"Resolve Conflicts"},{key:"jira-filters",icon:c.jsx(ive,{}),label:"Jira Workspace"},{key:"presentation-plan",icon:c.jsx(bve,{}),label:"Presentations"},{key:"branch-sync",icon:c.jsx(ou,{}),label:"Branch Sync"},{key:"branch-health",icon:c.jsx(J$,{}),label:"Branch Health"},{key:"package-upgrade",icon:c.jsx(Z$,{}),label:"Package Upgrade"},{key:"package-versions",icon:c.jsx(_pe,{}),label:"Package Versions"}]},{type:"group",label:"Utilities",children:[{key:"postman",icon:c.jsx(hu,{}),label:"Postman"},{key:"image-compress",icon:c.jsx(Gw,{}),label:"Image compression"},{key:"json-to-typescript",icon:c.jsx(wa,{}),label:"JSON to TypeScript"},{key:"bookmark-sync",icon:c.jsx(_h,{}),label:"Bookmark Sync"},{key:"file-organizer",icon:c.jsx(Fr,{}),label:"Folder Organizer"}]},...Je.length>0?[{type:"group",label:"Extensions",children:Je}]:[]])},[ye,R,O]),je=({key:De})=>{window.location.hash=`#/${De}`},$e=he?`plugin:${he.id}`:se?`static:${se.id}`:j==="todo-archived"?"todo-list":["pr-conflicts","pr-conflict"].includes(j)?"pr-conflicts":j,Ae=b&&!(v&&!x)?c.jsx(mr,{type:x?"warning":"error",showIcon:!0,message:x?"Service status may be out of date":"Unable to load services",description:b,action:c.jsx(Oe,{size:"small",loading:v,onClick:fe,children:"Retry"}),className:"launcher-data-notice"}):null;return j==="memo-reader"?c.jsx(f4e,{memoId:L}):j==="logs"?c.jsx(Sbe,{}):j==="presentation-view"?c.jsx(w1e,{}):c.jsxs(Js,{className:"workbench",children:[c.jsxs(F4e,{"aria-label":"DevBuddy navigation",breakpoint:"lg",className:"sidebar",collapsed:U,collapsedWidth:64,collapsible:!0,onBreakpoint:q,onCollapse:q,width:240,children:[c.jsxs("div",{className:"brand-row",children:[c.jsxs("a",{className:"brand",href:"#/overview","aria-current":j==="overview"?"page":void 0,"aria-label":`Go to Overview — DevBuddy version ${jd.version}`,onClick:Ve,children:[c.jsx("span",{className:`brand-mark ${$?"":"is-offline"}`,"aria-hidden":"true",children:"✦"}),c.jsx("span",{className:"brand-name",children:"DevBuddy"}),c.jsxs("span",{className:"brand-version",children:["v",jd.version]})]}),!U&&c.jsx(yn,{title:_!=null&&_.updateAvailable?`Update available: v${_.latestVersion}`:"View Change Log",children:c.jsx(sa,{dot:!!(_!=null&&_.updateAvailable),color:"#f5b942",offset:[-2,3],children:c.jsx(Oe,{"aria-label":_!=null&&_.updateAvailable?`Update available: version ${_.latestVersion}`:"View Change Log",className:`sidebar-update-button ${_!=null&&_.updateAvailable?"has-update":""}`,icon:c.jsx(MC,{}),loading:X&&!_,onClick:we,type:"text"})})})]}),c.jsx("nav",{ref:J,className:"sidebar-nav","aria-label":"Main navigation",onContextMenu:xe,children:c.jsx(Xs,{theme:e==="light"?"light":"dark",mode:"inline",tabIndex:-1,selectedKeys:[$e],items:Le,onClick:je})}),c.jsx("div",{className:"sidebar-bottom",children:c.jsx("div",{className:"sidebar-bottom-inner",children:c.jsx("nav",{"aria-label":"Settings navigation",onContextMenu:xe,children:c.jsx(Xs,{className:"sidebar-settings-menu",theme:e==="light"?"light":"dark",mode:"inline",tabIndex:-1,selectedKeys:["settings","errors"].includes(j)?[j]:[],items:[{key:"settings",icon:c.jsx("span",{className:"sidebar-context-icon","data-sidebar-key":"settings",children:c.jsx(Gl,{})}),label:c.jsx("span",{className:"sidebar-context-label","data-sidebar-key":"settings",children:"Settings"})}],onClick:je})})})})]}),c.jsx(Js,{children:c.jsx(H4e,{className:`page ${j==="overview"?"is-overview-page":""} ${["static-page","postman"].includes(j)?"is-static-page":""} ${["overview","postman","static-page"].includes(j)?"":"is-workspace-content"} ${j==="mind-maps"&&H?"is-mind-map-detail":""} ${j==="presentation-plan"?"is-presentation-plan":""} ${j==="json-to-typescript"?"is-json-to-typescript":""} ${j==="memos"?"is-memos":""}`,children:he?c.jsxs(c.Fragment,{children:[c.jsx(Bc,{type:"secondary",children:"PLUGIN"}),c.jsx(_k,{level:2,children:he.name}),c.jsx(It,{children:c.jsx("div",{dangerouslySetInnerHTML:{__html:ge}})})]}):j==="static-page"&&se?c.jsx("div",{className:"static-page-container",children:c.jsx("iframe",{src:se.url,title:se.name,className:"static-page-iframe"})}):j==="image-compress"?c.jsx(Xye,{}):j==="json-to-typescript"?c.jsx(R1e,{}):j==="mind-maps"?H?c.jsx(B4e,{mindMapId:H,onNavigate:De=>{window.location.hash=`#/${De}`}}):c.jsx(j4e,{onNavigate:De=>{window.location.hash=`#/${De}`}}):j==="overview"?c.jsx(c1e,{launchers:a,running:s,errorCounts:f,errorLogs:h,plugins:R,staticPages:O,loading:v,error:b,hasLoaded:x,onRetry:fe,onNavigate:De=>{window.location.hash=`#/${De}`}}):j==="clipboard"?c.jsx(Sye,{}):j==="cron-jobs"?c.jsx(Nye,{}):j==="ports"?c.jsx(Bye,{refreshLaunchers:_e}):j==="pr-review"?c.jsx(ebe,{}):j==="pr-conflicts"?c.jsx(xI,{listOnly:!0},"pr-conflicts"):j==="pr-conflict"?c.jsx(xI,{},"pr-conflict"):j==="jira-filters"?c.jsx(ube,{}):j==="todo-list"?c.jsx(gbe,{}):j==="reminders"?c.jsx(y4e,{}):j==="memos"?c.jsx(m4e,{}):j==="todo-archived"?c.jsx(bbe,{}):j==="presentation-plan"?c.jsx(S1e,{}):j==="postman"?c.jsx(Dbe,{}):j==="bookmark-sync"?c.jsx(zbe,{}):j==="file-organizer"?c.jsx(_be,{}):j==="branch-sync"?c.jsx(Lbe,{}):j==="branch-health"?c.jsx(Ube,{}):j==="package-upgrade"?c.jsx(qbe,{}):j==="package-versions"?c.jsx(Gbe,{}):j==="errors"?c.jsx(wbe,{}):j==="settings"?c.jsx(Fye,{theme:e,onThemeChange:t,onStaticPagesChange:()=>Kc.list().then(I)}):j==="dev-configurations"?c.jsx(Wye,{}):c.jsxs(c.Fragment,{children:[Ae,(v||x||!b)&&c.jsx(Lye,{launchers:a,running:s,errorCounts:f,refresh:_e,loading:v&&!x,initialRunningOnly:T,initialServiceId:P})]})})}),re&&c.jsx("div",{className:"sidebar-context-menu",role:"menu",style:{left:re.left,top:re.top},onClick:De=>De.stopPropagation(),onContextMenu:De=>De.preventDefault(),children:c.jsx("button",{type:"button",role:"menuitem",onClick:ze,children:"Open in new window"})}),c.jsx(bn,{className:"changelog-modal",footer:[(_==null?void 0:_.updateAvailable)&&!(ne!=null&&ne.success)&&c.jsx(Oe,{type:"primary",loading:W&&Y===(_==null?void 0:_.latestVersion),onClick:()=>Pe(_==null?void 0:_.latestVersion),children:"Update now"},"update"),c.jsx(Oe,{disabled:W,loading:X,onClick:()=>ie(!0),children:"Check again"},"refresh"),c.jsx(Oe,{type:"primary",disabled:W,onClick:ke,children:ne!=null&&ne.success?"Close & reload":"Close"},"close")],onCancel:ke,closable:!W,maskClosable:!W,open:Z,title:c.jsxs("div",{className:"changelog-title",children:[c.jsx("span",{className:`changelog-bulb ${_!=null&&_.updateAvailable?"has-update":""}`,children:c.jsx(MC,{})}),c.jsx("span",{children:"Updates"})]}),width:680,children:X&&!_?c.jsx("div",{className:"changelog-loading",children:c.jsx(rr,{})}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"changelog-version-row",children:[c.jsxs("div",{children:[c.jsx(Bc,{type:"secondary",children:"Installed"}),c.jsxs(Bc,{strong:!0,children:["v",(_==null?void 0:_.currentVersion)||jd.version]})]}),c.jsxs("div",{children:[c.jsx(Bc,{type:"secondary",children:"Latest"}),c.jsxs(Bc,{strong:!0,children:["v",(_==null?void 0:_.latestVersion)||jd.version]})]}),c.jsx($t,{color:_!=null&&_.updateAvailable?"gold":"green",children:_!=null&&_.updateAvailable?"Update available":"Up to date"})]}),(_==null?void 0:_.sourceUnavailable)&&c.jsx(mr,{className:"changelog-source-alert",message:"Could not reach the configured npm registry. Showing locally available release notes.",showIcon:!0,type:"info"}),ne&&c.jsx(mr,{className:"changelog-source-alert",description:ne.message,message:ne.success?"DevBuddy updated successfully":"DevBuddy update failed",showIcon:!0,type:ne.success?"success":"error"}),c.jsx("div",{className:"changelog-release-list",children:(We=_==null?void 0:_.releases)!=null&&We.length?_.releases.slice(0,5).map(De=>c.jsxs("section",{className:"changelog-release",children:[c.jsxs("div",{className:"changelog-release-heading",children:[c.jsxs("div",{className:"changelog-release-title",children:[c.jsxs($t,{className:"changelog-release-version",children:["v",De.version]}),c.jsx(_k,{level:4,children:De.name})]}),c.jsxs("div",{className:"changelog-release-actions",children:[De.publishedAt&&c.jsx(Bc,{type:"secondary",children:new Date(De.publishedAt).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}),c.jsx(Oe,{size:"small",type:De.version===(_==null?void 0:_.latestVersion)?"primary":"default",disabled:W||De.version===(_==null?void 0:_.currentVersion),loading:W&&Y===De.version,onClick:()=>Pe(De.version),children:De.version===(_==null?void 0:_.currentVersion)?"Installed":"Install"})]})]}),c.jsx(Bc,{className:"changelog-release-notes",children:De.notes||"Published to the configured npm registry."})]},`${De.version}-${De.publishedAt||""}`)):c.jsx(Xt,{description:"No published release notes yet.",image:Xt.PRESENTED_IMAGE_SIMPLE})})]})})]})}function Y4e(){const[e,t]=l.useState(()=>document.documentElement.dataset.theme||localStorage.getItem("devbuddy-theme")||"dark");return l.useEffect(()=>{let n=!1;try{n=["dark","light"].includes(localStorage.getItem("devbuddy-theme"))}catch{}n||Wn.status().then(r=>{const a=r.theme==="light"?"light":"dark";t(a),localStorage.setItem("devbuddy-theme",a)}).catch(()=>{})},[]),l.useLayoutEffect(()=>{var n;document.documentElement.dataset.theme=e,localStorage.setItem("devbuddy-theme",e),(n=document.querySelector('meta[name="theme-color"]'))==null||n.setAttribute("content",Lk[e]||Lk.dark)},[e]),l.useLayoutEffect(()=>{const n=()=>{document.querySelectorAll('[role="tab"], [role="tabpanel"]').forEach(o=>{document.activeElement===o&&o.blur(),o.tabIndex!==-1&&(o.tabIndex=-1)})};n();const r=new MutationObserver(n),a=o=>{var s,u;(u=(s=o.target).matches)!=null&&u.call(s,'[role="tab"], [role="tabpanel"]')&&o.target.blur()};return document.addEventListener("focusin",a,!0),r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["tabindex"]}),()=>{r.disconnect(),document.removeEventListener("focusin",a,!0)}},[]),c.jsx(yi,{theme:{token:{fontFamily:V4e,borderRadius:10,colorBgLayout:e==="light"?"#f7f8fc":"#f4f5fa",colorInfo:e==="light"?"#2e83d2":"#6555e8",colorLink:e==="light"?"#2e83d2":"#5b4cc4",colorLinkActive:e==="light"?"#2474bd":"#5143c2",colorLinkHover:e==="light"?"#4593d8":"#7669ee",colorPrimary:e==="light"?"#2e83d2":"#5d63a8",colorPrimaryActive:e==="light"?"#2474bd":"#505690",colorPrimaryHover:e==="light"?"#4593d8":"#6c72b8",controlOutline:e==="light"?"rgba(46, 131, 210, .2)":"rgba(93, 99, 168, .24)",colorTextSecondary:"#667085"},components:{Layout:{bodyBg:e==="light"?"#f7f8fc":"#f4f5fa",siderBg:e==="light"?"#ffffff":"#171c2b",triggerBg:e==="light"?"#f8f9fc":"#101522",triggerColor:e==="light"?"#667085":"#c9ced8"},Menu:{darkItemBg:"#171c2b",darkItemSelectedBg:"#3f476e",darkItemSelectedColor:"#f0f1ff",darkSubMenuItemBg:"#171c2b",itemSelectedBg:"#eeecff",itemSelectedColor:"#5143c2"}}},children:c.jsx(Pr,{children:c.jsx(G4e,{theme:e,onThemeChange:t})})})}const X4e=/Macintosh|Mac OS X|iPhone|iPad/i.test(navigator.userAgent);document.documentElement.dataset.platform=X4e?"mac":"other";const Bk='input, textarea, [contenteditable="true"]',EA=e=>{var t,n;(t=e.matches)!=null&&t.call(e,Bk)&&(e.setAttribute("spellcheck","false"),e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","none")),(n=e.querySelectorAll)==null||n.call(e,Bk).forEach(r=>{r.setAttribute("spellcheck","false"),r.setAttribute("autocorrect","off"),r.setAttribute("autocapitalize","none")})};EA(document);const J4e=new MutationObserver(e=>{e.forEach(({addedNodes:t})=>{t.forEach(n=>{n.nodeType===Node.ELEMENT_NODE&&EA(n)})})});J4e.observe(document.body,{childList:!0,subtree:!0});const Q4e=uB.createRoot(document.getElementById("app"));Q4e.render(c.jsx(Y4e,{}));"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js",{updateViaCache:"none"}).catch(e=>{console.warn("DevBuddy service worker registration failed:",e)})});requestAnimationFrame(()=>{requestAnimationFrame(()=>{window.setTimeout(()=>{const e=document.getElementById("app-splash");e&&(e.classList.add("is-hidden"),window.setTimeout(()=>e.remove(),700))},700)})});export{Go as g,$4 as n};