diff --git a/deploy/install.sh b/deploy/install.sh index 9eb004449..7b17345c9 100755 --- a/deploy/install.sh +++ b/deploy/install.sh @@ -79,7 +79,7 @@ docker compose run --rm migrator echo "==> Generating frontend Enterprise patches..." if [ -f "${INSTALL_DIR}/patches/patch_frontend.py" ]; then - python3 "${INSTALL_DIR}/patches/patch_frontend.py" "${INSTALL_DIR}/patches" + python3 "${INSTALL_DIR}/patches/patch_frontend.py" "${INSTALL_DIR}/patches" || true fi echo "==> [5/6] Starting Plane containers without touching other host services..." diff --git a/deploy/patches/layout-C0Zt7niA.js b/deploy/patches/layout-C0Zt7niA.js new file mode 100644 index 000000000..7bc34d5ea --- /dev/null +++ b/deploy/patches/layout-C0Zt7niA.js @@ -0,0 +1 @@ +import{F as e,V as t,j as n,o as r}from"./chunk-KS7C4IRE-CMpS5gbI.js";import{t as i}from"./client-vOn8M9g-.js";import{t as a}from"./jsx-runtime-noaePsda.js";import{Dt as o,Gn as s,Gr as c,Hn as l,Jr as u,Kt as d,Ti as f,Yr as p,Zn as m,c as h,ct as g,hr as _,k as v,lr as y,mn as b,nn as x,qr as S,ur as C,vt as w,wt as T,yt as E}from"./issue.service-CTC2rMYd.js";import{At as D,Ht as O,I as ee,J as k,V as A,Vt as j,an as te,fr as ne,gr as re,on as M,st as ie}from"./store-context-C83lXiWw.js";import{Fn as N,Ln as ae,N as P,P as F,T as oe,Ut as se,V as I,h as L,k as ce,m as le,qt as R,s as ue,v as de,w as fe,y as z}from"./dist-B3GnvwXu.js";import{L as pe,S as me,i as he,k as ge}from"./emoji-icon-picker-CPloArK5.js";import{Ft as _e,H as ve,I as B,K as ye,Nt as V,Pt as be,Q as xe,T as Se,U as Ce,a as we,dt as Te,ft as Ee,g as De,ht as Oe,i as ke,it as Ae,k as je,nt as Me,ot as Ne,r as Pe,yt as Fe}from"./icons-B2YERF5a.js";import{t as Ie}from"./circle-x-BlqwyLvA.js";import{t as Le}from"./grip-vertical-CB4Mjv2d.js";import{n as Re,t as ze}from"./projects-app-provider-CmCLNEDt.js";import{a as Be,c as Ve,i as He,n as Ue,o as We,r as Ge,s as Ke,t as qe}from"./use-navigation-items-dMIr66Br.js";import{t as Je}from"./settings-AioDdadH.js";import{t as Ye}from"./share-2-DAaaUX8c.js";import{t as Xe}from"./modal-V-B77nTb.js";import{t as Ze}from"./star-Ccdcwjto.js";import{a as Qe,i as H,t as U}from"./toast-Dy5Nzl5H.js";import{n as $e,r as et,t as W}from"./navigation-CbK9S4cm.js";import{n as tt,t as nt}from"./button-DrwsAH69-BTPMslkc.js";import"./button-BYpq06q8.js";import{t as G}from"./mobxreact.esm-CAsEUKPK.js";import{i as rt,n as it,r as K}from"./dist-CzGbdSAN.js";import{t as at}from"./tabs-bABa7Xfr.js";import{t as ot}from"./link-DLf3lvYy.js";import{i as st,t as q}from"./user-NVe3rMCN.js";import{i as ct,t as lt}from"./index.esm-BD707ayL.js";import{t as ut}from"./use-local-storage-DsCzcp4L.js";import{i as dt,n as ft,r as pt}from"./use-navigation-preferences-DXfdqfoG.js";import{t as mt}from"./use-issue-detail-BSf89SHe.js";import{t as J}from"./use-project-DNexXh3I.js";import{t as ht}from"./scrollarea-Bg1bks4F.js";import{n as gt,t as _t}from"./use-module-1Z0ORgGy.js";import{n as vt,t as yt}from"./store-D8SA7Ukl.js";import{t as bt}from"./use-command-palette-CPQfZI_M.js";import{t as xt}from"./use-project-view-DyOnFotg.js";import{t as St}from"./empty-state-6KcvBXrb.js";import{t as Ct}from"./package-Cqh-6bHg.js";import{t as Y}from"./use-app-theme-BwWGliq5.js";import{t as wt}from"./use-favorite-BrNJ0-Xh.js";import{t as Tt}from"./use-platform-os-ToyVFevK.js";import{I as Et,g as Dt,k as Ot}from"./filters-DdfyTJpC.js";import{n as kt,t as At}from"./tree-item-D2zUc4QI.js";import{l as X,n as jt,t as Mt}from"./adapter-IUU1t76B.js";import{t as Nt}from"./element-y2ui39nu.js";import{t as Pt}from"./icon-button-BAL-SdPp.js";import{t as Ft}from"./upgrade-badge-BxAQzHXC.js";import{t as It}from"./use-window-size-BKR5DQoX.js";import{t as Lt}from"./discount-info-t73U_blP.js";import{t as Rt}from"./sidebar-toggle-button-CcW1D-WV.js";import{n as zt,t as Bt}from"./set-custom-native-drag-preview-C6Hc88Wt.js";var Z=t(e()),Q=a();function Vt({showPeek:e=!1,togglePeek:t,peekDuration:n=500,isCollapsed:r=!1,toggleCollapsed:i,onCollapsedChange:a,width:o,setWidth:s,onWidthChange:c,minWidth:l=236,maxWidth:u=350,className:d=``,children:f,extendedSidebar:p,isAnyExtendedSidebarExpanded:m=!1,isAnySidebarDropdownOpen:h=!1}){let[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(!1),b=(0,Z.useRef)(),x=(0,Z.useRef)(0),S=(0,Z.useRef)(0),{isMobile:C}=rt(),w=(0,Z.useCallback)(e=>{t(e)},[t]),T=(0,Z.useCallback)(e=>{if(!g)return;let t=e.clientX-S.current;s(Math.min(Math.max(x.current+t,l),u))},[g,l,u,s]),E=(0,Z.useCallback)(e=>{_(!0),x.current=o,S.current=e.clientX},[o]),D=(0,Z.useCallback)(()=>{_(!1)},[]),O=(0,Z.useCallback)(()=>{i(),w(!1),y(!1),b.current&&clearTimeout(b.current)},[i,w]),ee=(0,Z.useCallback)(()=>{r&&e&&b.current&&clearTimeout(b.current)},[r,e]),k=(0,Z.useCallback)(()=>{r&&!m&&!h&&(b.current=setTimeout(()=>{w(!1)},n))},[r,n,w,m,h]);return(0,Z.useEffect)(()=>(g&&(document.addEventListener(`mousemove`,T),document.addEventListener(`mouseup`,D),document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`),()=>{document.removeEventListener(`mousemove`,T),document.removeEventListener(`mouseup`,D),document.body.style.cursor=``,document.body.style.userSelect=``}),[g,T,D]),(0,Z.useEffect)(()=>()=>{b.current&&clearTimeout(b.current)},[]),(0,Z.useEffect)(()=>{!h&&r&&v&&k()},[h]),(0,Z.useEffect)(()=>{!m&&r&&v&&k()},[m]),(0,Z.useEffect)(()=>{r||(w(!1),y(!1),b.current&&clearTimeout(b.current))},[r,w]),(0,Z.useEffect)(()=>{c?.(o)},[o,c]),(0,Z.useEffect)(()=>{a?.(r)},[r,a]),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{id:`main-sidebar`,className:A(`z-20 h-full border-r border-subtle bg-surface-1`,!g&&`transition-all duration-300 ease-in-out`,r?`w-0 translate-x-[-100%] opacity-0`:`translate-x-0 opacity-100`,C&&`absolute`,d),style:{width:`${r?0:o}px`,minWidth:`${r?0:o}px`,maxWidth:`${r?0:o}px`},role:`complementary`,"aria-label":`Main sidebar`,"data-prevent-outside-click":C,children:(0,Q.jsxs)(`aside`,{className:A(`group/sidebar relative flex h-full w-full flex-col overflow-hidden bg-surface-1 pt-3`,m&&`rounded-none`),children:[f,(0,Q.jsx)(`div`,{className:A(`absolute z-[20] h-full w-1 cursor-ew-resize transition-all duration-200`,!g&&`hover:bg-surface-2`,g&&`w-1.5 bg-layer-1`,`top-0 right-0`),onDoubleClick:()=>O(),onMouseDown:e=>E(e),role:`separator`,"aria-label":`Resize sidebar`})]})}),(0,Q.jsx)(`div`,{className:A(`shadow-sm absolute left-0 z-20 h-full bg-surface-1`,!g&&`transition-all duration-300 ease-in-out`,r&&e?`translate-x-0 opacity-100`:`translate-x-[-100%] opacity-0`,`pointer-events-none`,r&&e&&`pointer-events-auto`,e?`w-full`:`w-0`),style:{width:`${o}px`},onMouseEnter:ee,onMouseLeave:k,role:`complementary`,"aria-label":`Sidebar peek view`,children:(0,Q.jsxs)(`aside`,{className:A(`group/sidebar relative z-20 flex h-full w-full flex-col overflow-hidden bg-surface-1 pt-4`,`self-center rounded-md rounded-tl-none rounded-bl-none border-r border-subtle`,m&&`rounded-none`),children:[f,(0,Q.jsx)(`div`,{className:A(`absolute z-[20] h-full w-1 cursor-ew-resize transition-all duration-200`,!g&&`hover:bg-surface-2`,g&&`bg-layer-1`,`top-0 right-0`),onDoubleClick:()=>O(),onMouseDown:e=>E(e),role:`separator`,"aria-label":`Resize sidebar`})]})}),p&&p]})}function Ht(e){let{className:t,isActive:n,children:r}=e;return(0,Q.jsx)(`div`,{className:A(`group relative flex w-full cursor-pointer items-center justify-between gap-1.5 rounded-md px-2 py-1 outline-none`,{"!bg-layer-transparent-active text-primary":n,"text-secondary hover:bg-layer-transparent-hover active:bg-layer-transparent-active":!n},t),children:r})}var Ut=(e,t=``)=>{switch(e){case`home`:return(0,Q.jsx)(ve,{className:A(`size-4 flex-shrink-0`,t)});case`inbox`:return(0,Q.jsx)(Ce,{className:A(`size-4 flex-shrink-0`,t)});case`projects`:return(0,Q.jsx)(Oe,{className:A(`size-4 flex-shrink-0`,t)});case`views`:return(0,Q.jsx)(V,{className:A(`size-4 flex-shrink-0`,t)});case`active_cycles`:return(0,Q.jsx)(Se,{className:A(`size-4 flex-shrink-0`,t)});case`analytics`:return(0,Q.jsx)(ke,{className:A(`size-4 flex-shrink-0`,t)});case`your_work`:return(0,Q.jsx)(_e,{className:A(`size-4 flex-shrink-0`,t)});case`drafts`:return(0,Q.jsx)(je,{className:A(`size-4 flex-shrink-0`,t)});case`archives`:return(0,Q.jsx)(we,{className:A(`size-4 flex-shrink-0`,t)});case`stickies`:return(0,Q.jsx)(Ae,{className:A(`size-4 flex-shrink-0`,t)})}},Wt=G(function(e){let{item:t,handleOnNavigationItemDrop:n,disableDrag:r=!1,disableDrop:i=!1,isLastChild:a}=e,{t:o}=h(),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(void 0),d=(0,Z.useRef)(null),f=(0,Z.useRef)(null),p=$e(),{workspaceSlug:m}=W(),{toggleExtendedSidebar:g}=Y(),{data:_}=st(),{allowPermissions:v}=q(),{preferences:y,toggleWorkspaceItem:b}=dt(),x=y.items[t.key]?.is_pinned??!1,S=()=>g(!0);(0,Z.useEffect)(()=>{let e=d.current,o=f.current;if(e)return X(Mt({element:e,canDrag:()=>!r,dragHandle:o??void 0,getInitialData:()=>({id:t.key,dragInstanceId:`NAVIGATION`}),onDragStart:()=>{c(!0)},onDrop:()=>{c(!1)}}),jt({element:e,canDrop:({source:e})=>!i&&e?.data?.id!==t.key&&e?.data?.dragInstanceId===`NAVIGATION`,getData:({input:e,element:n})=>At({id:t.key},{input:e,element:n,currentLevel:0,indentPerLevel:0,mode:a?`last-in-group`:`standard`}),onDrag:({self:e})=>{let t=kt(e?.data)?.type;u(t?t===`reorder-below`&&a?`DRAG_BELOW`:`DRAG_OVER`:void 0)},onDragLeave:()=>{u(void 0)},onDrop:({self:e,source:t})=>{u(void 0);let r=kt(e?.data)?.type,i=r?r===`reorder-below`&&a?`DRAG_BELOW`:`DRAG_OVER`:void 0;if(!i)return;let o=t?.data?.id,s=e?.data?.id;n&&n(o,s,i===`DRAG_BELOW`)}}))},[a,n,r,i,t.key]);let C=t.key===`your_work`?`/${m.toString()}${t.href}${_?.id}`:`/${m.toString()}${t.href}`,w=C===p,T=e=>{b(e,!0)},D=e=>{b(e,!1)},O=Ut(t.key);return v(t.access,E.WORKSPACE,m.toString())?(0,Q.jsxs)(`div`,{id:`sidebar-${t.key}`,className:A(`relative`,{"bg-layer-1 opacity-60":s}),ref:d,children:[(0,Q.jsx)(z,{classNames:`absolute top-0`,isVisible:l===`DRAG_OVER`}),(0,Q.jsxs)(`div`,{className:A(`group/project-item relative flex w-full items-center rounded-md text-primary hover:bg-surface-2`),id:`${t.key}`,children:[!r&&(0,Q.jsx)(N,{tooltipContent:o(`drag_to_rearrange`),position:`top-start`,disabled:s,children:(0,Q.jsx)(`button`,{type:`button`,className:A(`absolute top-1/2 -left-3 flex -translate-y-1/2 cursor-grab items-center justify-center rounded text-placeholder opacity-0 group-hover/project-item:opacity-100`,{"cursor-grabbing":s,"opacity-100":s}),ref:f,children:(0,Q.jsx)(de,{className:`bg-transparent`})})}),(0,Q.jsxs)(Ht,{isActive:w,children:[(0,Q.jsx)(ot,{href:C,onClick:()=>S(),className:`group flex-grow`,children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5 py-[1px]`,children:[O,(0,Q.jsx)(`p`,{className:`text-13 leading-5 font-medium`,children:o(t.labelTranslationKey)})]})}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t.key===`active_cycles`&&(0,Q.jsx)(`div`,{className:`flex-shrink-0`,children:(0,Q.jsx)(Ft,{})}),x?(0,Q.jsx)(N,{tooltipContent:`Unpin`,children:(0,Q.jsx)(Ve,{className:`size-3.5 flex-shrink-0 text-placeholder outline-none hover:text-tertiary`,onClick:()=>D(t.key)})}):(0,Q.jsx)(N,{tooltipContent:`Pin`,children:(0,Q.jsx)(Ke,{className:`size-3.5 flex-shrink-0 text-placeholder outline-none hover:text-tertiary`,onClick:()=>T(t.key)})})]})]})]}),a&&(0,Q.jsx)(z,{isVisible:l===`DRAG_BELOW`})]}):null}),Gt=(e,t,n)=>{let r=(0,Z.useCallback)(r=>{if(r.target instanceof HTMLElement&&e.current&&!e.current.contains(r.target)){if(r.target.closest(`[data-prevent-outside-click]`))return;let e=r.target;for(;e;){if(e.id===n)return;e=e.parentElement}if(r.target.closest(`[data-delay-outside-click]`)){setTimeout(()=>{t()},0);return}t()}},[e,t,n]);(0,Z.useEffect)(()=>(document.addEventListener(`mousedown`,r),()=>{document.removeEventListener(`mousedown`,r)}),[r])},Kt=G(function(e){let{className:t,children:n,extendedSidebarRef:r,isExtendedSidebarOpened:i,handleClose:a,excludedElementId:o}=e,{sidebarCollapsed:s}=Y(),{storedValue:c}=it(`sidebarWidth`,250);return Gt(r,a,o),(0,Z.useEffect)(()=>{s&&a()},[s,a]),(0,Q.jsx)(`div`,{id:o,ref:r,className:A(`shadow-sm absolute z-[21] flex h-full transform flex-col border-r border-subtle bg-surface-1 p-4 py-2 transition-all duration-300 ease-in-out`,{"opacity-100":i,"hidden opacity-0":!i},t),style:{left:`${c??250}px`,width:`300px`},children:n})}),qt=G(function(){let e=(0,Z.useRef)(null),{workspaceSlug:t}=W(),{isExtendedSidebarOpened:n,toggleExtendedSidebar:r}=Y(),{allowPermissions:i}=q(),{preferences:a,updateWorkspaceItemSortOrder:o}=dt(),s=a.items,l=(0,Z.useMemo)(()=>{let e=t.toString();return c.filter(t=>i(t.access,E.WORKSPACE,e)).map(e=>{let t=s?.[e.key];return{...e,sort_order:t?.sort_order??0,is_pinned:t?.is_pinned??!1}}).sort((e,t)=>e.is_pinned===t.is_pinned?e.sort_order-t.sort_order:t.is_pinned?1:-1)},[t,s,i]),u=l.map(e=>e.key),d=(e,t,n)=>{if(e<0||t<0||n.length<=0)return;let r,i=1e4;return r=t===0?(n[t].sort_order||0)-i:t===n.length?(n[t-1].sort_order||0)+i:((n[t-1].sort_order||0)+(n[t].sort_order||0))/2,r},f=(e,n,r)=>{if(!e||!n||!t||e===n)return;let i=d(u.indexOf(e),r?u.length:u.indexOf(n),l);i!=null&&o(e,i)},p=(0,Z.useCallback)(()=>r(!1),[r]);return(0,Q.jsx)(Kt,{isExtendedSidebarOpened:!!n,extendedSidebarRef:e,handleClose:p,excludedElementId:`extended-sidebar-toggle`,children:l.map((e,t)=>(0,Q.jsx)(Wt,{item:e,isLastChild:t===l.length-1,handleOnNavigationItemDrop:f},e.key))})}),Jt=[{key:`stickies`,labelTranslationKey:`sidebar.stickies`},{key:`your_work`,labelTranslationKey:`sidebar.your_work`},{key:`drafts`,labelTranslationKey:`drafts`}],Yt=G(function(e){let{isOpen:t,onClose:n}=e,{t:r}=h(),{workspaceSlug:i}=W(),{allowPermissions:a}=q(),{preferences:o,togglePersonalItem:s,updatePersonalItemOrder:l}=ft(),{preferences:u,updateNavigationMode:d,updateShowLimitedProjects:f,updateLimitedProjectsCount:p}=pt(),{preferences:m,toggleWorkspaceItem:g,updateWorkspaceItemOrder:_}=dt(),[v,y]=(0,Z.useState)(u.limitedProjectsCount.toString()),b=Jt,x=(0,Z.useMemo)(()=>c.filter(e=>a(e.access,E.WORKSPACE,i?.toString()||``)).map(e=>{let t=m.items[e.key],n=t?.is_pinned??!1,r=t?.sort_order??0;return{key:e.key,labelTranslationKey:e.labelTranslationKey,isPinned:n,sortOrder:r}}).sort((e,t)=>e.sortOrder-t.sortOrder),[i,a,m]),S=(0,Z.useCallback)((e,t)=>{g(e,t)},[g]),C=(0,Z.useCallback)(e=>{_(e.map((e,t)=>({key:e.key,sortOrder:t})))},[_]),w=(0,Z.useCallback)(e=>{l(e.map((e,t)=>({key:e.key,sortOrder:t})))},[l]),T=(0,Z.useMemo)(()=>b.map(e=>{let t=o.items[e.key],n=typeof t==`boolean`?t:t?.enabled??!0,r=typeof t==`boolean`?0:t?.sort_order??0;return{...e,isEnabled:n,sortOrder:r}}).sort((e,t)=>e.sortOrder-t.sortOrder),[o,b]),D=e=>{[`e`,`E`,`+`,`-`,`.`].includes(e.key)&&e.preventDefault()},O=e=>{let t=e.replace(/\D/g,``);y(t);let n=parseInt(t,10);isNaN(n)||p(Math.max(1,n))};return(0,Q.jsx)(F,{isOpen:t,handleClose:n,position:fe.CENTER,width:oe.XXL,children:(0,Q.jsxs)(`div`,{className:`flex max-h-[90vh] flex-col rounded-lg bg-surface-1`,children:[(0,Q.jsxs)(`div`,{className:`flex justify-between px-6 pt-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{className:`text-18 font-semibold text-primary`,children:r(`customize_navigation`)}),(0,Q.jsx)(`p`,{className:`mt-1 text-13 text-tertiary`,children:`Selected items will always stay visible in your sidebar. You can still find the others anytime from the More menu. These changes are personal to you and won't affect anyone else on your workspace.`})]}),(0,Q.jsx)(`button`,{onClick:n,className:`flex size-5 flex-shrink-0 items-center justify-center rounded-sm text-placeholder hover:bg-layer-1`,"aria-label":r(`close`),children:(0,Q.jsx)(Qe,{className:`size-4`})})]}),(0,Q.jsxs)(`div`,{className:`flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-13 font-semibold text-placeholder`,children:r(`personal`)}),(0,Q.jsx)(`div`,{className:`rounded-md border border-subtle bg-surface-2 py-2`,children:(0,Q.jsx)(I,{data:T,onChange:w,keyExtractor:e=>e.key,id:`personal-enabled-items`,render:e=>(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md px-2 py-1.5 transition-all duration-200 hover:bg-surface-2`,children:[(0,Q.jsx)(Le,{className:`size-4 cursor-grab text-placeholder transition-colors active:cursor-grabbing`}),(0,Q.jsx)(ue,{checked:!!o.items[e.key]?.enabled,onChange:t=>s(e.key,t.target.checked)}),(0,Q.jsxs)(`div`,{className:`flex flex-1 items-center gap-2`,children:[Ut(e.key),(0,Q.jsx)(`label`,{className:`flex-1 cursor-pointer text-13 text-primary`,children:r(e.labelTranslationKey)})]})]})})})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-13 font-semibold text-placeholder`,children:r(`common.workspace`)}),(0,Q.jsx)(`div`,{className:`rounded-md border border-subtle bg-surface-2 py-2`,children:(0,Q.jsx)(I,{data:x,onChange:C,keyExtractor:e=>e.key,id:`workspace-pinned-items`,render:e=>{let t=Ut(e.key);return(0,Q.jsxs)(`div`,{className:`group flex items-center gap-2 rounded-md px-2 py-1.5 transition-all duration-200 hover:bg-surface-2`,children:[(0,Q.jsx)(Le,{className:`size-4 cursor-grab text-placeholder transition-colors active:cursor-grabbing`}),(0,Q.jsx)(ue,{checked:!!m.items[e.key]?.is_pinned,onChange:t=>S(e.key,t.target.checked)}),(0,Q.jsxs)(`div`,{className:`flex flex-1 items-center gap-2`,children:[t,(0,Q.jsx)(`span`,{className:`text-13 text-primary`,children:r(e.labelTranslationKey)})]})]})}})})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-13 font-semibold text-placeholder`,children:r(`projects`)}),(0,Q.jsx)(`div`,{className:`rounded-md border border-subtle bg-surface-2 px-2 py-2`,children:(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`label`,{className:`flex cursor-pointer gap-2 rounded-md px-2 py-1.5 hover:bg-surface-2`,children:[(0,Q.jsx)(`input`,{type:`radio`,name:`navigation-mode`,value:`ACCORDION`,checked:u.navigationMode===`ACCORDION`,onChange:()=>d(`ACCORDION`),className:`mt-1 size-4 text-accent-primary focus:ring-accent-strong`}),(0,Q.jsxs)(`div`,{className:`flex-1`,children:[(0,Q.jsx)(`div`,{className:`text-13 text-primary`,children:r(`accordion_navigation_control`)}),(0,Q.jsx)(`div`,{className:`text-11 text-secondary`,children:`Feature tabs will appear as nested items under project and acts as accordion.`})]})]}),(0,Q.jsxs)(`label`,{className:`flex cursor-pointer gap-2 rounded-md px-2 py-1.5 hover:bg-surface-2`,children:[(0,Q.jsx)(`input`,{type:`radio`,name:`navigation-mode`,value:`TABBED`,checked:u.navigationMode===`TABBED`,onChange:()=>d(`TABBED`),className:`mt-1 size-4 text-accent-primary focus:ring-accent-strong`}),(0,Q.jsxs)(`div`,{className:`flex-1`,children:[(0,Q.jsx)(`div`,{className:`text-13 text-primary`,children:r(`horizontal_navigation_bar`)}),(0,Q.jsx)(`div`,{className:`text-11 text-secondary`,children:`Feature tabs will appear as horizontal tabs inside a project.`})]})]})]}),(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 hover:bg-surface-2`,children:[(0,Q.jsx)(ue,{checked:u.showLimitedProjects,onChange:e=>f(e.target.checked)}),(0,Q.jsx)(`span`,{className:`text-13 text-primary`,children:r(`show_limited_projects_on_sidebar`)})]}),u.showLimitedProjects&&(0,Q.jsx)(`div`,{className:`pl-8`,children:(0,Q.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,Q.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-1.5`,children:[(0,Q.jsx)(`label`,{className:`w-full text-11 text-secondary`,children:r(`enter_number_of_projects`)}),(0,Q.jsx)(`input`,{type:`number`,min:`1`,step:`1`,value:v,onKeyDown:D,onChange:e=>O(e.target.value),className:A(`w-full rounded-md px-2 py-1 text-13`,`border bg-surface-2`,`text-secondary`,parseInt(v)>=1?`border-strong focus:border-accent-strong focus:ring-1 focus:ring-accent-strong`:`border-danger-strong focus:border-danger-strong focus:ring-1 focus:ring-danger-strong`)})]}),parseInt(v)<1&&v!==``&&(0,Q.jsx)(`span`,{className:`pl-0.5 text-11 text-danger-primary`,children:`Minimum value is 1`})]})})]})]})})]})]})]})})}),Xt=G(function(e){let{planVariant:t,features:n,prices:r,verticalFeatureList:i=!1,extraFeatures:a,renderPriceContent:o,renderActionButton:s}=e,[c,l]=(0,Z.useState)(`month`),u=ie(t),d=j(t);return(0,Q.jsx)(`div`,{className:`flex flex-col rounded-xl border border-subtle bg-layer-2 px-3 py-6`,children:(0,Q.jsxs)(at.Group,{selectedIndex:c===`month`?0:1,children:[(0,Q.jsx)(`div`,{className:`flex h-9 w-full justify-center`,children:(0,Q.jsx)(at.List,{className:`flex w-60 space-x-1 rounded-md bg-layer-3 p-0.5`,children:r.map(e=>(0,Q.jsx)(at,{className:({selected:e})=>A(`w-full rounded-sm py-1 text-caption-md-medium leading-5`,e?`border border-subtle-1 bg-layer-2 text-primary shadow-raised-100`:`text-tertiary hover:text-secondary`),onClick:()=>l(e.recurring),children:o(e)},e.key))})}),(0,Q.jsx)(at.Panels,{children:r.map(e=>(0,Q.jsxs)(at.Panel,{children:[(0,Q.jsxs)(`div`,{className:`pt-6 text-center`,children:[(0,Q.jsxs)(`div`,{className:`text-h4-medium`,children:[`Plane `,d]}),s(e)]}),(0,Q.jsxs)(`div`,{className:`px-2 pt-6 pb-2`,children:[(0,Q.jsx)(`div`,{className:`p-2 text-caption-md-semibold`,children:`Everything in ${u} +`}),(0,Q.jsx)(`ul`,{className:`grid grid-cols-12 gap-x-4`,children:n.map(e=>(0,Q.jsx)(`li`,{className:A(`relative col-span-12 flex rounded-md p-2`,{"sm:col-span-6":!i}),children:(0,Q.jsxs)(`p`,{className:`line-clamp-1 flex w-full items-center text-caption-md-medium leading-5`,children:[(0,Q.jsx)(pe,{className:`mr-2 size-4 flex-shrink-0 text-tertiary`}),(0,Q.jsx)(`span`,{className:`truncate text-secondary`,children:e})]})},e))}),a&&(0,Q.jsx)(`div`,{children:a})]})]},e.key))})]})})}),Zt=G(function(e){let{isOnFreePlan:t}=e;return(0,Q.jsxs)(`div`,{className:`rounded-xl bg-layer-1 px-2 py-4`,children:[t&&(0,Q.jsx)(`div`,{className:`px-3 py-2`,children:(0,Q.jsx)(`span`,{className:`rounded-sm border border-subtle-1 bg-layer-2 px-2 py-1 text-caption-md-medium text-tertiary`,children:`Your plan`})}),(0,Q.jsxs)(`div`,{className:`px-4 py-2 font-semibold`,children:[(0,Q.jsx)(`div`,{className:`text-20`,children:`Free`}),(0,Q.jsx)(`div`,{className:`text-caption-md text-tertiary`,children:`$0 per user per month`})]}),(0,Q.jsx)(`div`,{className:`px-2 pt-2 pb-3`,children:(0,Q.jsx)(`ul`,{className:`grid w-full grid-cols-12 gap-x-4`,children:o.map(e=>(0,Q.jsx)(`li`,{className:A(`relative col-span-12 flex rounded-md p-2`),children:(0,Q.jsxs)(`p`,{className:`flex w-full items-center text-caption-md-medium leading-5`,children:[(0,Q.jsx)(Ie,{className:`mr-2 size-4 flex-shrink-0 text-danger-secondary`}),(0,Q.jsx)(`span`,{className:`truncate text-secondary`,children:e})]})},e))})})]})}),Qt=G(function(e){let{planVariant:t,href:n,features:r,product:i,prices:a,isLoading:o,verticalFeatureList:s=!1,extraFeatures:c,upgradeLoaderType:l,isSelfHosted:u,isTrialAllowed:d,renderTrialButton:f}=e;return(0,Q.jsx)(Xt,{planVariant:t,features:r,prices:a,upgradeLoaderType:l,verticalFeatureList:s,extraFeatures:c,renderPriceContent:e=>(0,Q.jsxs)(Q.Fragment,{children:[e.recurring===`month`&&`Monthly`,e.recurring===`year`&&`Yearly`]}),renderActionButton:e=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`pb-4 text-center`,children:[(0,Q.jsx)(`div`,{className:`flex h-9 items-center justify-center text-20 font-semibold`,children:o?(0,Q.jsx)(P,{className:`flex flex-col items-center justify-center`,children:(0,Q.jsx)(P.Item,{height:`36px`,width:`4rem`})}):(0,Q.jsx)(Q.Fragment,{children:`Quote on request`})}),(0,Q.jsx)(`div`,{className:`text-caption-md-medium text-tertiary`,children:`per user per month`})]}),o?(0,Q.jsx)(P,{className:`flex flex-col items-center justify-center`,children:(0,Q.jsx)(P.Item,{height:`38px`,width:`14rem`})}):(0,Q.jsxs)(`div`,{className:`flex w-full flex-col items-center justify-center`,children:[(0,Q.jsx)(`a`,{href:n,target:`_blank`,className:A(tt(`primary`,`lg`),`w-56`),rel:`noreferrer`,children:`Talk to Sales`}),d&&!u&&(0,Q.jsx)(`div`,{className:`mt-4 h-4`,children:f&&f({productId:i?.id,priceId:e.id})})]})]})})}),$t=G(function(e){let{planeName:t,planVariant:n,isLoading:r,product:i,price:a,upgradeCTA:o,upgradeLoaderType:s,renderTrialButton:c,handleCheckout:l,isSelfHosted:u,isTrialAllowed:d}=e;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`pb-4 text-center`,children:[(0,Q.jsx)(`div`,{className:`h-9 text-20 font-semibold`,children:r?(0,Q.jsx)(P,{className:`flex flex-col items-center justify-center`,children:(0,Q.jsx)(P.Item,{height:`36px`,width:`4rem`})}):(0,Q.jsx)(Lt,{currency:a.currency,frequency:a.recurring,price:a.price,subscriptionType:n,className:`mr-1.5`})}),(0,Q.jsx)(`div`,{className:`text-caption-md-medium text-tertiary`,children:`per user per month`})]}),r?(0,Q.jsx)(P,{className:`flex flex-col items-center justify-center`,children:(0,Q.jsx)(P.Item,{height:`38px`,width:`14rem`})}):(0,Q.jsxs)(`div`,{className:`flex w-full flex-col items-center justify-center space-y-4`,children:[(0,Q.jsx)(nt,{variant:`primary`,size:`lg`,className:`w-56`,onClick:()=>{i&&a.id&&l({planVariant:n,productId:i.id,priceId:a.id})},disabled:!!s,children:s===n?`Redirecting to Stripe`:o??`Upgrade to ${t}`}),d&&!u&&(0,Q.jsx)(`div`,{className:`mt-1 h-3`,children:c&&c({productId:i?.id,priceId:a.id})})]})]})}),en=G(function(e){let{planVariant:t,features:n,isLoading:r,product:i,upgradeCTA:a,verticalFeatureList:o=!1,extraFeatures:s,upgradeLoaderType:c,renderTrialButton:l,handleCheckout:u,isSelfHosted:d,isTrialAllowed:f}=e,p=j(t),{monthlyPriceDetails:m,yearlyPriceDetails:h}=O(i),g=ee(m.price,h.price),v=[m,h];return i?.is_active?(0,Q.jsx)(Xt,{planVariant:t,features:n,prices:v,upgradeLoaderType:c,verticalFeatureList:o,extraFeatures:s,renderPriceContent:e=>(0,Q.jsxs)(Q.Fragment,{children:[e.recurring===`month`&&`Monthly`,e.recurring===`year`&&(0,Q.jsxs)(Q.Fragment,{children:[`Yearly`,g>0&&(0,Q.jsxs)(`span`,{className:`text-caption-sm ml-1 rounded-full bg-accent-primary px-1.5 py-0.5 text-on-color`,children:[`-`,g,`%`]})]})]}),renderActionButton:e=>(0,Q.jsx)($t,{planeName:p,planVariant:t,isLoading:r,product:i,price:e,upgradeCTA:a,upgradeLoaderType:c,renderTrialButton:l,handleCheckout:u,isSelfHosted:d,isTrialAllowed:f})}):(0,Q.jsx)(Qt,{planVariant:t,href:_,isLoading:r,features:n,product:i,prices:v,upgradeLoaderType:c,verticalFeatureList:o,extraFeatures:s,isSelfHosted:d,isTrialAllowed:f,renderTrialButton:l})}),tn=`flex flex-col w-full h-full justify-end col-span-12 sm:col-span-6 xl:col-span-3`,nn=`pt-2 text-center text-caption-md-medium text-accent-primary hover:underline`,rn=G(function(e){let{isOpen:t,handleClose:n}=e,r=({planVariant:e,priceId:t})=>{let n=b[e].prices.find(e=>e.id===t)?.recurring??`year`,r=y[e][n]??`https://plane.so/talk-to-sales`;window.open(r,`_blank`)};return(0,Q.jsx)(F,{isOpen:t,handleClose:n,width:oe.VIIXL,className:`rounded-2xl`,children:(0,Q.jsx)(`div`,{className:`max-h-[90vh] overflow-auto p-10`,children:(0,Q.jsxs)(`div`,{className:`grid h-full grid-cols-12 gap-6`,children:[(0,Q.jsxs)(`div`,{className:A(tn),children:[(0,Q.jsx)(`div`,{className:`flex text-24 leading-8 font-bold`,children:`Upgrade to a paid plan and unlock missing features.`}),(0,Q.jsx)(`div`,{className:`mt-4 mb-2`,children:(0,Q.jsx)(`p`,{className:`mb-4 pr-8 text-13 text-primary`,children:`Dashboards, Workflows, Approvals, Time Management, and other superpowers are just a click away. Upgrade today to unlock features your teams need yesterday.`})}),(0,Q.jsx)(Zt,{isOnFreePlan:!0})]}),(0,Q.jsx)(`div`,{className:A(tn),children:(0,Q.jsx)(en,{planVariant:f.PRO,product:b[f.PRO],features:s,verticalFeatureList:!0,extraFeatures:(0,Q.jsx)(`p`,{className:nn,children:(0,Q.jsx)(`a`,{href:C[f.PRO],target:`_blank`,rel:`noreferrer`,children:`See full features list`})}),handleCheckout:r,isSelfHosted:!0,isTrialAllowed:!1})}),(0,Q.jsx)(`div`,{className:A(tn),children:(0,Q.jsx)(en,{planVariant:f.BUSINESS,product:b[f.BUSINESS],features:v,verticalFeatureList:!0,extraFeatures:(0,Q.jsx)(`p`,{className:nn,children:(0,Q.jsx)(`a`,{href:C[f.BUSINESS],target:`_blank`,rel:`noreferrer`,children:`See full features list`})}),handleCheckout:r,isSelfHosted:!0,isTrialAllowed:!1})}),(0,Q.jsx)(`div`,{className:A(tn),children:(0,Q.jsx)(en,{planVariant:f.ENTERPRISE,product:b[f.ENTERPRISE],features:g,verticalFeatureList:!0,extraFeatures:(0,Q.jsx)(`p`,{className:nn,children:(0,Q.jsx)(`a`,{href:C[f.ENTERPRISE],target:`_blank`,rel:`noreferrer`,children:`See full features list`})}),handleCheckout:r,isSelfHosted:!0,isTrialAllowed:!1})})]})})})}),an=G(function(){let[e,t]=(0,Z.useState)(!1),{t:n}=h(),{isMobile:r}=Tt();return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(rn,{isOpen:e,handleClose:()=>t(!1)}),(0,Q.jsx)(N,{tooltipContent:`Version: v${Ct.version}`,isMobile:r,children:(0,Q.jsx)(nt,{variant:`tertiary`,size:`lg`,onClick:()=>{},"aria-label":n(`aria_labels.projects_sidebar.edition_badge`),children:`Enterprise`})})]})}),on=G(function(e){let{title:t,children:n,quickActions:r}=e,[i,a]=(0,Z.useState)(!1),{toggleSidebar:o,sidebarCollapsed:s}=Y(),c=It(),l=(0,Z.useRef)(null);return K(l,()=>{s===!1&&window.innerWidth<768&&o()}),(0,Z.useEffect)(()=>{c[0]<768&&!s&&o()},[c]),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Yt,{isOpen:i,onClose:()=>a(!1)}),(0,Q.jsxs)(`div`,{ref:l,className:`flex h-full w-full animate-fade-in flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 px-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2`,children:[(0,Q.jsx)(`span`,{className:`pt-1 text-16 font-medium text-primary`,children:t}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t===`Projects`&&(0,Q.jsx)(Pt,{size:`base`,variant:`ghost`,icon:Ee,onClick:()=>a(!0)}),(0,Q.jsx)(Rt,{})]})]}),r]}),(0,Q.jsx)(ht,{orientation:`vertical`,scrollType:`hover`,size:`sm`,rootClassName:`size-full overflow-x-hidden overflow-y-auto`,viewportClassName:`flex flex-col gap-3 overflow-x-hidden h-full w-full overflow-y-auto px-3 pt-3 pb-0.5`,children:n}),(0,Q.jsx)(`div`,{className:`flex h-12 items-center justify-between border-t border-subtle bg-surface-1 p-3`,children:(0,Q.jsx)(an,{})})]})]})}),sn=i(),cn=G(function(e){let{sort_order:t,isDragging:n}=e,{isMobile:r}=Tt();return(0,Q.jsx)(N,{isMobile:r,tooltipContent:t===null?`Join the project to rearrange`:`Drag to rearrange`,position:`top-end`,disabled:n,children:(0,Q.jsx)(`div`,{className:A(`absolute top-1/2 -left-3 hidden -translate-y-1/2 cursor-grab items-center justify-center rounded-sm text-placeholder group-hover/project-item:flex`,{"cursor-not-allowed opacity-60":t===null,"cursor-grabbing":n}),children:(0,Q.jsx)(de,{className:`bg-transparent`})})})}),ln={page:Ne,project:Oe,view:V,module:Me,cycle:Se,folder:B},$=({type:e,logo:t})=>{let n=ln[e]??Ne;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`hidden size-5 items-center justify-center group-hover:flex`,children:(0,Q.jsx)(n,{className:`m-auto size-4 flex-shrink-0 stroke-[1.5]`})}),(0,Q.jsx)(`div`,{className:`flex size-5 items-center justify-center group-hover:hidden`,children:t?.in_use?(0,Q.jsx)(he,{logo:t,size:16,type:e===`project`?`material`:`lucide`}):(0,Q.jsx)(n,{className:`m-auto size-4 flex-shrink-0 stroke-[1.5]`})})]})},un=G(function(e){let{ref:t,isMenuActive:n,onChange:r,handleRemoveFromFavorites:i,favorite:a}=e,{t:o}=h();return(0,Q.jsx)(L,{customButton:(0,Q.jsx)(`span`,{ref:t,className:`grid place-items-center rounded-sm p-0.5 text-placeholder hover:bg-layer-1`,children:(0,Q.jsx)(ae,{className:`size-4`})}),menuButtonOnClick:()=>r(!n),className:A(`pointer-events-none flex-shrink-0 opacity-0 group-hover/project-item:pointer-events-auto group-hover/project-item:opacity-100`,{"pointer-events-auto opacity-100":n}),customButtonClassName:`grid place-items-center`,placement:`bottom-start`,ariaLabel:o(`aria_labels.projects_sidebar.toggle_quick_actions_menu`),children:(0,Q.jsx)(L.MenuItem,{onClick:()=>i(a),children:(0,Q.jsxs)(`span`,{className:`flex items-center justify-start gap-2`,children:[(0,Q.jsx)(Ze,{className:`fill-yellow-500 stroke-yellow-500 h-3.5 w-3.5 flex-shrink-0`}),(0,Q.jsx)(`span`,{children:`Remove from favorites`})]})})})});function dn(e){let{children:t,elementRef:n,isMenuActive:r=!1}=e;return(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(`div`,{ref:n,className:A(`group/project-item relative flex w-full items-center rounded-md px-2 py-1.5 text-primary hover:bg-layer-transparent-hover`,{"bg-surface-2":r}),children:t})})}var fn=G(function(e){let{href:t,title:n,icon:r}=e,{toggleSidebar:i}=Y(),{isMobile:a}=Tt();return(0,Q.jsx)(N,{tooltipContent:n,isMobile:a,position:`right`,className:`ml-8`,children:(0,Q.jsxs)(ot,{href:t,className:`flex w-full items-center gap-1.5 truncate`,draggable:!0,onClick:()=>{a&&i()},children:[(0,Q.jsx)(`span`,{className:`flex size-5 items-center justify-center`,children:r}),(0,Q.jsx)(`span`,{className:`flex-1 truncate text-13 leading-5 font-medium`,children:n})]})})}),pn=(e,t)=>{let n=T[t.entity_type];return n?n.itemLevel===`workspace`?`/${e}/${n.getLink(t)}`:n.itemLevel===`project`?`/${e}/projects/${t.project_id}/${n.getLink(t)}`:`/${e}`:(console.error(`Unrecognized favorite entity type: ${t.entity_type}`),`/${e}`)},mn=(e,t)=>{let{entity_type:n}=t,r=t?.entity_data?.name||t?.name,i,a;switch(n){default:a=r,i=(0,Q.jsx)($,{type:n,logo:t.entity_data?.logo_props});break}return{itemIcon:i,itemTitle:a}},hn=()=>({getAdditionalFavoriteItemDetails:mn}),gn=(e,t)=>{let{entity_identifier:n,entity_data:{logo_props:r},entity_type:i}=t,a=t?.entity_data?.name||t?.name,{getViewById:o}=xt(),{getProjectById:s}=J(),{getCycleById:c}=gt(),{getModuleById:l}=_t(),{getAdditionalFavoriteItemDetails:u}=hn(),d=yt({pageId:n??``,storeType:vt.PROJECT}),f=o(n??``),p=c(n??``),m=l(n??``),h=s(t.project_id??``),g,_,v=pn(e.toString(),t);switch(i){case`project`:_=h?.name??a,g=(0,Q.jsx)($,{type:`project`,logo:h?.logo_props||r});break;case`page`:_=D(d?.name??a),g=(0,Q.jsx)($,{type:`page`,logo:d?.logo_props??r});break;case`view`:_=f?.name??a,g=(0,Q.jsx)($,{type:`view`,logo:f?.logo_props||r});break;case`cycle`:_=p?.name??a,g=(0,Q.jsx)($,{type:`cycle`});break;case`module`:_=m?.name??a,g=(0,Q.jsx)($,{type:`module`});break;default:{let n=u(e,t);_=n.itemTitle,g=n.itemIcon;break}}return{itemIcon:g,itemTitle:_,itemLink:v}},_n=(e,t,n)=>{let r=e?.data,i=t?.data;if(n?.current?.dropTargets?.length>1&&r?.isGroup)return`make-child`;if(!r||!i)return;let a=kt(r)?.type;return a===`instruction-blocked`&&(a=r.isChild?`reorder-above`:`make-child`),a===`make-child`&&i.isGroup&&(a=`reorder-above`),a},vn=(e,t,n)=>{let r=e?.data;return!(!r||r.id===t?.id||n&&r.isGroup)},yn=G(function(e){let{isLastChild:t,parentId:n,workspaceSlug:r,favorite:i,handleRemoveFromFavorites:a,handleDrop:o}=e,{itemLink:s,itemIcon:c,itemTitle:l}=gn(r,i),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(void 0),g=(0,Z.useRef)(null),_=(0,Z.useRef)(null);return(0,Z.useEffect)(()=>{let e=g.current;if(!e)return;let r={id:i.id,isGroup:!1,isChild:!!n,parentId:n};return X(Mt({element:e,dragHandle:g.current,getInitialData:()=>r,onDragStart:()=>{d(!0)},onDrop:()=>{d(!1)},onGenerateDragPreview:({nativeSetDragImage:e})=>{Bt({getOffset:zt({x:`0px`,y:`0px`}),render:({container:e})=>{let t=(0,sn.createRoot)(e);return t.render((0,Q.jsx)(`div`,{className:`rounded-sm bg-surface-1 p-1 pr-2 text-13`,children:(0,Q.jsx)(fn,{href:s,icon:c,title:l})})),()=>t.unmount()},nativeSetDragImage:e})}}),jt({element:e,canDrop:({source:e})=>vn(e,i,!!n),onDragStart:()=>{d(!0)},getData:({input:e,element:n})=>{let i=[`make-child`];return t||i.push(`reorder-below`),At(r,{input:e,element:n,currentLevel:1,indentPerLevel:0,mode:t?`last-in-group`:`standard`,block:i})},onDrag:({self:e,source:t,location:n})=>{h(_n(e,t,n))},onDragLeave:()=>{h(void 0)},onDrop:({self:e,source:t,location:n})=>{h(void 0),o(e,t,n)}}))},[g?.current,u,t,i.id]),K(_,()=>p(!1)),(0,Q.jsxs)(Q.Fragment,{children:[u&&(0,Q.jsx)(z,{isVisible:m===`reorder-above`}),(0,Q.jsxs)(dn,{elementRef:g,isMenuActive:f,children:[(0,Q.jsx)(cn,{isDragging:u,sort_order:i.sort_order}),(0,Q.jsx)(fn,{href:s,icon:c,title:l}),(0,Q.jsx)(un,{favorite:i,ref:_,isMenuActive:f,onChange:e=>p(e),handleRemoveFromFavorites:a})]}),t&&(0,Q.jsx)(z,{isVisible:m===`reorder-below`})]})}),bn=G(function(e){let{setCreateNewFolder:t,actionType:n,defaultName:r,favoriteId:i}=e,{t:a}=h(),{workspaceSlug:o}=W(),{addFavorite:s,updateFavorite:c,existingFolders:l}=wt(),u=(0,Z.useRef)(null),{handleSubmit:d,control:f,setValue:p,setFocus:m}=ct({reValidateMode:`onChange`,defaultValues:{name:r}});return(0,Z.useEffect)(()=>{m(`name`)},[]),K(u,()=>{t(!1)}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-[1px]`,ref:u,children:[(0,Q.jsx)(B,{className:`size-4`}),(0,Q.jsx)(`form`,{onSubmit:d(n===`create`?e=>{if(l.includes(e.name))return H({type:U.ERROR,title:a(`error`),message:a(`folder_already_exists`)});if(e={entity_type:`folder`,is_folder:!0,name:e.name.trim(),parent:null,project_id:null},e.name===``)return H({type:U.ERROR,title:a(`error`),message:a(`folder_name_cannot_be_empty`)});s(o.toString(),e).then(()=>{H({type:U.SUCCESS,title:a(`success`),message:a(`favorite_created_successfully`)})}).catch(()=>{H({type:U.ERROR,title:a(`error`),message:a(`something_went_wrong`)})}),t(!1),p(`name`,``)}:e=>{if(!i)return;if(l.includes(e.name))return H({type:U.ERROR,title:a(`error`),message:a(`folder_already_exists`)});let n={name:e.name.trim()};if(e.name.trim()===``)return H({type:U.ERROR,title:a(`error`),message:a(`folder_name_cannot_be_empty`)});c(o.toString(),i,n).then(()=>{H({type:U.SUCCESS,title:a(`success`),message:a(`favorite_updated_successfully`)})}).catch(()=>{H({type:U.ERROR,title:a(`error`),message:a(`something_went_wrong`)})}),t(!1),p(`name`,``)}),children:(0,Q.jsx)(lt,{name:`name`,control:f,rules:{required:!0},render:({field:e})=>(0,Q.jsx)(ce,{className:`w-full`,placeholder:a(`new_folder`),"aria-label":a(`aria_labels.projects_sidebar.enter_folder_name`),...e})})})]})});function xn(e){let{favorite:t,handleRemoveFromFavorites:n,isLastChild:r,handleDrop:i}=e,{fetchGroupedFavorites:a}=wt(),{isMobile:o}=Tt(),{workspaceSlug:s}=W(),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(null),[m,g]=(0,Z.useState)(void 0),_=(0,Z.useRef)(null),v=(0,Z.useRef)(null),{t:y}=h();return(0,Z.useEffect)(()=>{t.children===void 0&&s&&a(s.toString(),t.id)},[t.id,t.children,s,a]),(0,Z.useEffect)(()=>{let e=v.current;if(!e)return;let n={id:t.id,isGroup:!0,isChild:!1};return X(Mt({element:e,getInitialData:()=>n,onDragStart:()=>d(!0),onGenerateDragPreview:({nativeSetDragImage:e})=>{Bt({getOffset:zt({x:`0px`,y:`0px`}),render:({container:e})=>{let n=(0,sn.createRoot)(e);return n.render((0,Q.jsxs)(`div`,{className:`flex gap-1 rounded-sm bg-surface-1 p-1 pr-2 text-13`,children:[(0,Q.jsx)(`div`,{className:`grid size-5 flex-shrink-0 place-items-center`,children:(0,Q.jsx)(B,{})}),(0,Q.jsx)(`p`,{className:`truncate text-13 font-medium text-secondary`,children:t.name})]})),()=>n.unmount()},nativeSetDragImage:e})},onDrop:()=>{d(!1)}}),jt({element:e,canDrop:({source:e})=>vn(e,t,!1),getData:({input:e,element:t})=>{let i=[];return r||i.push(`reorder-below`),At(n,{input:e,element:t,currentLevel:0,indentPerLevel:0,mode:r?`last-in-group`:`standard`,block:i})},onDrag:({source:e,self:t,location:n})=>{g(_n(t,e,n))},onDragLeave:()=>{g(void 0)},onDrop:({self:e,source:t,location:n})=>{g(void 0),i(e,t,n)}}))},[u,t.id,r,t.id]),K(_,()=>l(!1)),f?(0,Q.jsx)(bn,{setCreateNewFolder:p,actionType:`rename`,defaultName:t.name,favoriteId:t.id}):(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(R,{ref:v,defaultOpen:!1,children:({open:e})=>(0,Q.jsxs)(`div`,{className:A(`relative`,{"bg-layer-1 opacity-60":u,"border-[2px] border-accent-strong":m===`make-child`}),children:[(0,Q.jsx)(z,{isVisible:m===`reorder-above`}),(0,Q.jsxs)(`div`,{className:A(`group/project-item relative flex w-full items-center rounded-md px-2 py-1.5 text-primary hover:bg-layer-1-hover`,{"bg-surface-2":c}),children:[(0,Q.jsx)(`div`,{className:`absolute left-0 hidden h-3 w-3 flex-shrink-0 cursor-pointer items-center justify-center rounded-xs bg-surface-2 text-secondary transition-colors group-hover:flex hover:text-primary`,children:(0,Q.jsx)(Le,{className:`h-3 w-3`})}),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(N,{tooltipContent:`${t.name}`,position:`right`,className:`ml-8`,isMobile:o,children:(0,Q.jsx)(`div`,{className:`flex flex-grow truncate`,children:(0,Q.jsxs)(R.Button,{as:`button`,type:`button`,className:`flex w-full flex-grow items-center gap-1.5 text-left select-none`,children:[(0,Q.jsx)(N,{isMobile:o,tooltipContent:t.sort_order===null?`Join the project to rearrange`:`Drag to rearrange`,position:`top-end`,disabled:u,children:(0,Q.jsx)(`button`,{type:`button`,className:A(`absolute top-1/2 -left-3 hidden -translate-y-1/2 cursor-grab items-center justify-center rounded-sm text-placeholder group-hover/project-item:flex`,{"cursor-not-allowed opacity-60":t.sort_order===null,"cursor-grabbing":u}),children:(0,Q.jsx)(de,{className:`bg-transparent`})})}),(0,Q.jsx)(`div`,{className:`grid size-5 flex-shrink-0 place-items-center`,children:(0,Q.jsx)(B,{})}),(0,Q.jsx)(`p`,{className:`truncate text-13 font-medium text-secondary`,children:t.name})]})})}),(0,Q.jsxs)(L,{customButton:(0,Q.jsx)(`span`,{ref:_,className:`grid place-items-center rounded-sm p-0.5 text-placeholder hover:bg-layer-1`,children:(0,Q.jsx)(ae,{className:`size-3`})}),menuButtonOnClick:()=>l(!c),className:A(`pointer-events-none flex-shrink-0 opacity-0 group-hover/project-item:pointer-events-auto group-hover/project-item:opacity-100`,{"pointer-events-auto opacity-100":c}),customButtonClassName:`grid place-items-center`,placement:`bottom-start`,ariaLabel:y(`aria_labels.projects_sidebar.toggle_quick_actions_menu`),children:[(0,Q.jsx)(L.MenuItem,{onClick:()=>n(t),children:(0,Q.jsxs)(`span`,{className:`flex items-center justify-start gap-2`,children:[(0,Q.jsx)(Ze,{className:`fill-yellow-500 stroke-yellow-500 h-3.5 w-3.5`}),(0,Q.jsx)(`span`,{children:`Remove from favorites`})]})}),(0,Q.jsx)(L.MenuItem,{onClick:()=>p(t.id),children:(0,Q.jsxs)(`div`,{className:`flex items-center justify-start gap-2`,children:[(0,Q.jsx)(je,{className:`h-3.5 w-3.5 stroke-[1.5] text-tertiary`}),(0,Q.jsx)(`span`,{children:`Rename Folder`})]})})]}),(0,Q.jsx)(R.Button,{as:`button`,type:`button`,className:A(`hidden rounded-sm p-0.5 group-hover/project-item:inline-block hover:bg-layer-1`,{"inline-block":c}),"aria-label":y(e?`aria_labels.projects_sidebar.close_folder`:`aria_labels.projects_sidebar.open_folder`),children:(0,Q.jsx)(De,{className:A(`size-3 flex-shrink-0 text-placeholder transition-transform`,{"rotate-90":e})})})]})]}),t.children&&t.children.length>0&&(0,Q.jsx)(se,{enter:`transition duration-100 ease-out`,enterFrom:`transform scale-95 opacity-0`,enterTo:`transform scale-100 opacity-100`,leave:`transition duration-75 ease-out`,leaveFrom:`transform scale-100 opacity-100`,leaveTo:`transform scale-95 opacity-0`,children:(0,Q.jsx)(R.Panel,{as:`div`,className:`mt-1 flex flex-col gap-0.5 px-2`,children:ne(t.children,`sequence`,`desc`).map((e,r)=>(0,Q.jsx)(yn,{workspaceSlug:s.toString(),favorite:e,isLastChild:r===t.children.length-1,parentId:t.id,handleRemoveFromFavorites:n,handleDrop:i},e.id))})}),r&&(0,Q.jsx)(z,{isVisible:m===`reorder-below`})]})},`${t.id}`)})}var Sn=G(function(){let[e,t]=(0,Z.useState)(null),[n,r]=(0,Z.useState)(!1),{workspaceSlug:i}=W(),{groupedFavorites:a,deleteFavorite:o,removeFromFavoriteFolder:s,reOrderFavorite:c,moveFavoriteToFolder:l}=wt(),{t:u}=h(),{setValue:f,storedValue:p}=ut(d,!1),m=!!p,g=(0,Z.useRef)(null),_=(0,Z.useRef)(null),v=(e,t)=>{l(i.toString(),e,{parent:t}).catch(()=>{H({type:U.ERROR,title:u(`error`),message:u(`failed_to_move_favorite`)})})},y=(e,t,n)=>{let r=e.data?.isGroup,i=n?.current?.dropTargets??[];if(!i||i.length<=0)return;let a=i.length>1?i.find(e=>e?.data?.isChild):i[0],o=a?.data;if(!a||!o)return;let s=_n(a,t,n),c=s===`make-child`?o.id:o.parentId,l=s===`make-child`?void 0:o.id,u=t.data;u.id&&(r?(c&&c!==u.parentId&&v(u.id,c),l&&s!=`make-child`&&S(u.id,l,s)):l&&S(u.id,l,s),!c&&u.isChild&&x(u.id))},b=e=>{o(i.toString(),e.id).then(()=>{H({type:U.SUCCESS,title:u(`success`),message:u(`favorite_removed_successfully`)})}).catch(()=>{H({type:U.ERROR,title:u(`error`),message:u(`something_went_wrong`)})})},x=e=>{s(i.toString(),e).catch(()=>{H({type:U.ERROR,title:u(`error`),message:u(`failed_to_move_favorite`)})})},S=(0,Z.useCallback)((e,t,n)=>{c(i.toString(),e,t,n).catch(()=>{H({type:U.ERROR,title:u(`error`),message:u(`failed_to_reorder_favorite`)})})},[i,c,u]);return(0,Z.useEffect)(()=>{let e=_.current;if(e)return X(jt({element:e,onDragEnter:()=>{r(!0)},onDragLeave:()=>{r(!1)},onDragStart:()=>{r(!0)},onDrop:({source:e})=>{r(!1);let t=e?.data?.id;console.log({sourceId:t}),!t||a[t].parent}}))},[_.current,n]),(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsxs)(R,{as:`div`,defaultOpen:!0,ref:g,children:[(0,Q.jsxs)(`div`,{ref:_,className:A(`group/favorites-button flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-placeholder hover:bg-layer-transparent-hover`),children:[(0,Q.jsx)(R.Button,{as:`button`,type:`button`,className:A(`flex w-full items-center gap-1 text-left text-13 font-semibold whitespace-nowrap text-placeholder`,{"bg-layer-1 opacity-60":n}),onClick:()=>f(!m),"aria-label":u(m?`aria_labels.projects_sidebar.close_favorites_menu`:`aria_labels.projects_sidebar.open_favorites_menu`),children:(0,Q.jsx)(`span`,{className:`text-13 font-semibold`,children:u(`favorites`)})}),(0,Q.jsxs)(`div`,{className:`pointer-events-none flex items-center opacity-0 group-hover/favorites-button:pointer-events-auto group-hover/favorites-button:opacity-100`,children:[(0,Q.jsx)(N,{tooltipHeading:u(`create_folder`),tooltipContent:``,children:(0,Q.jsx)(Pt,{variant:`ghost`,size:`sm`,onClick:()=>{t(!0),m||f(!m)},"aria-label":u(`aria_labels.projects_sidebar.create_favorites_folder`),icon:ge})}),(0,Q.jsx)(R.Button,{as:`button`,type:`button`,className:`grid flex-shrink-0 place-items-center rounded-sm p-0.5 hover:bg-layer-transparent-hover`,onClick:()=>f(!m),"aria-label":u(m?`aria_labels.projects_sidebar.close_favorites_menu`:`aria_labels.projects_sidebar.open_favorites_menu`),children:(0,Q.jsx)(De,{className:A(`size-3 flex-shrink-0 transition-all`,{"rotate-90":m})})})]})]}),(0,Q.jsx)(se,{show:m,enter:`transition duration-100 ease-out`,enterFrom:`transform scale-95 opacity-0`,enterTo:`transform scale-100 opacity-100`,leave:`transition duration-75 ease-out`,leaveFrom:`transform scale-100 opacity-100`,leaveTo:`transform scale-95 opacity-0`,children:m&&(0,Q.jsxs)(R.Panel,{as:`div`,className:`mt-0.5 flex flex-col gap-0.5`,static:!0,children:[e&&(0,Q.jsx)(bn,{setCreateNewFolder:t,actionType:`create`}),Object.keys(a).length===0?(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(`span`,{className:`px-8 py-1.5 text-11 font-medium text-placeholder`,children:u(`no_favorites_yet`)})}):ne(Object.values(a),`sequence`,`desc`).filter(e=>!e.parent).map((e,t,{length:n})=>(0,Q.jsx)(Q.Fragment,{children:e?.is_folder?(0,Q.jsx)(xn,{favorite:e,isLastChild:t===n-1,handleRemoveFromFavorites:b,handleRemoveFromFavoritesFolder:x,handleDrop:y}):(0,Q.jsx)(yn,{workspaceSlug:i.toString(),favorite:e,isLastChild:t===n-1,parentId:void 0,handleRemoveFromFavorites:b,handleDrop:y})}))]})})]})})}),Cn=G(function(e){let{workspaceSlug:t,projectId:n,additionalNavigationItems:r}=e,{workItem:i}=W(),{t:a}=h(),{isExtendedProjectSidebarOpened:o,toggleExtendedProjectSidebar:s,toggleSidebar:c}=Y(),{getPartialProjectById:l}=J(),{allowPermissions:u}=q(),{issue:{getIssueIdByIdentifier:d,getIssueById:f}}=mt(),p=$e(),m=i?d(i?.toString()):void 0,g=m?f(m):void 0,_=l(n),v=()=>{window.innerWidth<768&&c(),o&&s(!1)},y=(0,Z.useCallback)((e,t)=>[{i18n_key:`sidebar.work_items`,key:`work_items`,name:`Work items`,href:`/${e}/projects/${t}/issues`,icon:be,access:[w.ADMIN,w.MEMBER,w.GUEST],shouldRender:!0,sortOrder:1},{i18n_key:`sidebar.cycles`,key:`cycles`,name:`Cycles`,href:`/${e}/projects/${t}/cycles`,icon:Se,access:[w.ADMIN,w.MEMBER],shouldRender:_?.cycle_view??!1,sortOrder:2},{i18n_key:`sidebar.modules`,key:`modules`,name:`Modules`,href:`/${e}/projects/${t}/modules`,icon:Me,access:[w.ADMIN,w.MEMBER],shouldRender:_?.module_view??!1,sortOrder:3},{i18n_key:`sidebar.views`,key:`views`,name:`Views`,href:`/${e}/projects/${t}/views`,icon:V,access:[w.ADMIN,w.MEMBER,w.GUEST],shouldRender:_?.issue_views_view??!1,sortOrder:4},{i18n_key:`sidebar.pages`,key:`pages`,name:`Pages`,href:`/${e}/projects/${t}/pages`,icon:Ne,access:[w.ADMIN,w.MEMBER,w.GUEST],shouldRender:_?.page_view??!1,sortOrder:5},{i18n_key:`sidebar.intake`,key:`intake`,name:`Intake`,href:`/${e}/projects/${t}/intake`,icon:ye,access:[w.ADMIN,w.MEMBER,w.GUEST],shouldRender:_?.inbox_view??!1,sortOrder:6}],[_]),b=(0,Z.useMemo)(()=>((e,t)=>{let n=y(e,t);return r&&n.push(...r(e,t)),n})(t,n).sort((e,t)=>(e.sortOrder||0)-(t.sortOrder||0)),[t,n,y,r]),x=(0,Z.useCallback)(e=>{let t=m&&g&&!g?.is_epic&&g?.project_id===n,r=m&&g&&g?.is_epic&&g?.project_id===n,i=e.key===`work_items`&&t,a=e.key===`epics`&&r,o=p.includes(e.href);return i||a||o},[p,g,m,n]);return _?(0,Q.jsx)(Q.Fragment,{children:b.map(e=>{if(!e.shouldRender)return;if(!u(e.access,E.PROJECT,t,_.id))return null;let n=e.key===`intake`&&(_.intake_count??0)>0;return(0,Q.jsx)(ot,{href:e.href,onClick:v,children:(0,Q.jsx)(Ht,{isActive:!!x(e),children:(0,Q.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-1.5 py-[1px]`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(e.icon,{className:`size-4 flex-shrink-0 ${e.name===`Intake`?`stroke-1`:`stroke-[1.5]`}`}),(0,Q.jsx)(`span`,{className:`text-11 font-medium`,children:a(e.i18n_key)})]}),n&&(0,Q.jsx)(`span`,{className:`text-11 font-medium text-tertiary`,children:_.intake_count})]})})},e.key)})}):null}),wn=G(function(e){let{projectId:t,handleCopyText:n,disableDrag:r,disableDrop:i,isLastChild:a,handleOnProjectDrop:o,projectListType:s,renderInExtendedSidebar:c=!1}=e,{t:l}=h(),{getPartialProjectById:u}=J(),{isMobile:d}=Tt(),{allowPermissions:f}=q(),{getIsProjectListOpen:p,toggleProjectListOpen:m}=bt(),{preferences:g}=pt(),{isExtendedProjectSidebarOpened:_,toggleExtendedProjectSidebar:v,toggleAnySidebarDropdown:y}=Y(),[b,S]=(0,Z.useState)(!1),[C,T]=(0,Z.useState)(!1),[D,O]=(0,Z.useState)(!1),[ee,k]=(0,Z.useState)(!1),j=p(t),[te,ne]=(0,Z.useState)(void 0),re=(0,Z.useRef)(null),M=(0,Z.useRef)(null),ie=(0,Z.useRef)(null),{workspaceSlug:P,projectId:F}=W(),oe=et(),I=u(t),ce=qe({workspaceSlug:P.toString(),projectId:t,project:I,allowPermissions:f}).map(e=>e.key),{tabPreferences:ue}=Ue(P.toString(),t),fe=ue.defaultTab,pe=ce.includes(fe)?fe:Ge,ge=I?He(P.toString(),I.id,pe):``,_e=(0,Z.useCallback)(e=>m(t,e),[t,m]),ve=f([w.ADMIN],E.PROJECT,P.toString(),I?.id),B=f([w.ADMIN,w.MEMBER],E.PROJECT,P.toString(),I?.id),ye=()=>{S(!0)};if((0,Z.useEffect)(()=>{let e=M.current,n=ie.current;if(e)return X(Mt({element:e,canDrag:()=>!r,dragHandle:n??void 0,getInitialData:()=>({id:t,dragInstanceId:`PROJECTS`}),onDragStart:()=>{k(!0)},onDrop:()=>{k(!1)},onGenerateDragPreview:({nativeSetDragImage:e})=>{Bt({getOffset:zt({x:`0px`,y:`0px`}),render:({container:e})=>{let t=(0,sn.createRoot)(e);return t.render((0,Q.jsxs)(`div`,{className:`flex items-center rounded-sm bg-surface-1 p-1 pr-2 text-13`,children:[(0,Q.jsx)(`div`,{className:`grid size-4 flex-shrink-0 place-items-center`,children:I&&(0,Q.jsx)(he,{logo:I?.logo_props})}),(0,Q.jsx)(`p`,{className:`truncate text-secondary`,children:I?.name})]})),()=>t.unmount()},nativeSetDragImage:e})}}),jt({element:e,canDrop:({source:e})=>!i&&e?.data?.id!==t&&e?.data?.dragInstanceId===`PROJECTS`,getData:({input:e,element:n})=>At({id:t},{input:e,element:n,currentLevel:0,indentPerLevel:0,mode:a?`last-in-group`:`standard`}),onDrag:({self:e})=>{let t=kt(e?.data)?.type;ne(t?t===`reorder-below`&&a?`DRAG_BELOW`:`DRAG_OVER`:void 0)},onDragLeave:()=>{ne(void 0)},onDrop:({self:e,source:t})=>{ne(void 0);let n=kt(e?.data)?.type,r=n?n===`reorder-below`&&a?`DRAG_BELOW`:`DRAG_OVER`:void 0;if(!r)return;let i=t?.data?.id,c=e?.data?.id;o?.(i,c,r===`DRAG_BELOW`),Ot(`sidebar-${i}-${s}`)}}))},[t,a,s,o]),(0,Z.useEffect)(()=>{y(!!D)},[D,y]),K(re,()=>O(!1)),K(M,()=>M?.current?.classList?.remove(Dt)),(0,Z.useEffect)(()=>{let e;return F===I?.id&&(_e(!0),M.current&&(e=setTimeout(()=>{M.current&&Et(M.current,{behavior:`smooth`,block:`center`,scrollMode:`if-needed`})},200))),()=>{e&&clearTimeout(e)}},[F,I?.id,_e]),!I)return null;let V=g.navigationMode===`ACCORDION`,be=()=>{g.navigationMode===`ACCORDION`?_e(!j):oe.push(ge),_&&!V&&v(!1)},Se=F===I?.id&&g.navigationMode!==`ACCORDION`;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Be,{isOpen:C,projectId:t,onClose:()=>T(!1)}),(0,Q.jsx)(We,{project:I,isOpen:b,onClose:()=>S(!1)}),(0,Q.jsx)(R,{defaultOpen:j,as:`div`,children:(0,Q.jsxs)(`div`,{id:`sidebar-${t}-${s}`,className:A(`relative`,{"bg-layer-1 opacity-60":ee}),ref:M,children:[(0,Q.jsx)(z,{classNames:`absolute top-0`,isVisible:te===`DRAG_OVER`}),(0,Q.jsxs)(`div`,{className:A(`group/project-item relative flex w-full items-center rounded-md px-2 py-1.5 text-primary hover:bg-layer-transparent-hover`,{"bg-surface-2":D,"bg-layer-transparent-active":Se}),id:`${I?.id}`,children:[!r&&(0,Q.jsx)(N,{isMobile:d,tooltipContent:I.sort_order===null?l(`join_the_project_to_rearrange`):l(`drag_to_rearrange`),position:`top-end`,disabled:ee,children:(0,Q.jsx)(`button`,{type:`button`,className:A(`absolute top-1/2 -left-3 hidden -translate-y-1/2 cursor-grab items-center justify-center rounded-sm text-placeholder group-hover/project-item:flex`,{"cursor-not-allowed opacity-60":I.sort_order===null,"cursor-grabbing":ee,flex:D||c}),ref:ie,children:(0,Q.jsx)(de,{className:`bg-transparent`})})}),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(le,{href:ge,className:`flex flex-grow truncate`,onClick:be,children:V?(0,Q.jsxs)(R.Button,{as:`button`,type:`button`,className:A(`flex w-full flex-grow items-center gap-1.5 text-left select-none`,{}),"aria-label":l(j?`aria_labels.projects_sidebar.close_project_menu`:`aria_labels.projects_sidebar.open_project_menu`),children:[(0,Q.jsx)(`div`,{className:`grid size-4 flex-shrink-0 place-items-center`,children:(0,Q.jsx)(he,{logo:I.logo_props,size:16})}),(0,Q.jsx)(`p`,{className:`truncate text-13 font-medium text-secondary`,children:I.name})]}):(0,Q.jsxs)(`div`,{className:`flex w-full flex-grow items-center gap-1.5 text-left select-none`,children:[(0,Q.jsx)(`div`,{className:`grid size-4 flex-shrink-0 place-items-center`,children:(0,Q.jsx)(he,{logo:I.logo_props,size:16})}),(0,Q.jsx)(`p`,{className:`truncate text-13 font-medium text-secondary`,children:I.name})]})}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Q.jsxs)(L,{customButton:(0,Q.jsx)(Pt,{ref:re,variant:`ghost`,size:`sm`,icon:ae,onClick:()=>O(!D),className:`text-placeholder`}),className:A(`pointer-events-none flex-shrink-0 opacity-0 group-hover/project-item:pointer-events-auto group-hover/project-item:opacity-100`,{"pointer-events-auto opacity-100":D}),customButtonClassName:`grid place-items-center`,placement:`bottom-start`,ariaLabel:l(`aria_labels.projects_sidebar.toggle_quick_actions_menu`),useCaptureForOutsideClick:!0,closeOnSelect:!0,onMenuClose:()=>O(!1),children:[ve&&(0,Q.jsx)(L.MenuItem,{onClick:()=>T(!0),children:(0,Q.jsxs)(`div`,{className:`relative flex flex-shrink-0 items-center justify-start gap-2`,children:[(0,Q.jsx)(`div`,{className:`flex h-4 w-4 cursor-pointer items-center justify-center rounded-sm text-secondary transition-all duration-300 hover:bg-layer-1`,children:(0,Q.jsx)(Ye,{className:`h-3.5 w-3.5 stroke-[1.5]`})}),(0,Q.jsx)(`div`,{children:l(`publish_project`)})]})}),(0,Q.jsx)(L.MenuItem,{onClick:n,children:(0,Q.jsxs)(`span`,{className:`flex items-center justify-start gap-2`,children:[(0,Q.jsx)(xe,{className:`h-3.5 w-3.5 stroke-[1.5]`}),(0,Q.jsx)(`span`,{children:l(`copy_link`)})]})}),B&&(0,Q.jsx)(L.MenuItem,{onClick:()=>{oe.push(`/${P}/projects/${I?.id}/archives/issues`)},children:(0,Q.jsxs)(`div`,{className:`flex cursor-pointer items-center justify-start gap-2`,children:[(0,Q.jsx)(we,{className:`h-3.5 w-3.5 stroke-[1.5]`}),(0,Q.jsx)(`span`,{children:l(`archives`)})]})}),(0,Q.jsx)(L.MenuItem,{onClick:()=>{oe.push(`/${P}/settings/projects/${I?.id}`)},children:(0,Q.jsxs)(`div`,{className:`flex cursor-pointer items-center justify-start gap-2`,children:[(0,Q.jsx)(Je,{className:`h-3.5 w-3.5 stroke-[1.5]`}),(0,Q.jsx)(`span`,{children:l(`settings`)})]})}),!B&&(0,Q.jsx)(L.MenuItem,{onClick:ye,"data-ph-element":x.SIDEBAR_PROJECT_QUICK_ACTIONS,children:(0,Q.jsxs)(`div`,{className:`flex items-center justify-start gap-2`,children:[(0,Q.jsx)(me,{className:`h-3.5 w-3.5 stroke-[1.5]`}),(0,Q.jsx)(`span`,{children:l(`leave_project`)})]})})]}),V&&(0,Q.jsx)(Pt,{variant:`ghost`,size:`sm`,icon:De,onClick:()=>_e(!j),className:A(`hidden text-placeholder group-hover/project-item:inline-flex`,{"inline-flex":D}),iconClassName:A(`transition-transform`,{"rotate-90":j}),"aria-label":l(j?`aria_labels.projects_sidebar.close_project_menu`:`aria_labels.projects_sidebar.open_project_menu`)})]})]})]}),V&&(0,Q.jsx)(se,{show:j,enter:`transition duration-100 ease-out`,enterFrom:`transform scale-95 opacity-0`,enterTo:`transform scale-100 opacity-100`,leave:`transition duration-75 ease-out`,leaveFrom:`transform scale-100 opacity-100`,leaveTo:`transform scale-95 opacity-0`,children:j&&(0,Q.jsxs)(R.Panel,{as:`div`,className:`relative mt-1 mb-1.5 flex flex-col gap-0.5 pl-6`,children:[(0,Q.jsx)(`div`,{className:`absolute top-0 bottom-1 left-[15px] w-[1px] bg-layer-3`}),(0,Q.jsx)(Cn,{workspaceSlug:P.toString(),projectId:t.toString()})]})}),a&&(0,Q.jsx)(z,{isVisible:te===`DRAG_BELOW`})]})},`${I.id}_${F}`)]})}),Tn=G(function(){let[e,t]=(0,Z.useState)(!0),[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(!1),o=(0,Z.useRef)(null),{t:s}=h(),{toggleCreateProjectModal:c}=bt(),{allowPermissions:u}=q(),{preferences:d}=pt(),{isExtendedProjectSidebarOpened:f,toggleExtendedProjectSidebar:p}=Y(),{loader:m,getPartialProjectById:g,joinedProjectIds:_,updateProjectView:v}=J(),{workspaceSlug:y}=W(),b=$e(),x=u([w.ADMIN,w.MEMBER],E.WORKSPACE),S=d.showLimitedProjects?_.slice(0,d.limitedProjectsCount):_,C=d.showLimitedProjects&&_.length>d.limitedProjectsCount,T=e=>{k(`${y}/projects/${e}/issues`).then(()=>{H({type:U.SUCCESS,title:s(`link_copied`),message:s(`project_link_copied_to_clipboard`)})})},D=(e,t,n)=>{if(!e||!t||!y||e===t)return;let r=[];_.map(e=>{let t=g(e);t&&r.push(t)});let i=_.indexOf(e),a=n?_.length:_.indexOf(t);if(r.length<=0)return;let o=M(i,a,e,r);o!=null&&v(y.toString(),e,{sort_order:o}).catch(()=>{H({type:U.ERROR,title:s(`error`),message:s(`something_went_wrong`)})})};(0,Z.useEffect)(()=>{let e=()=>{if(o.current){let e=o.current.scrollTop;a(e>0)}},t=o.current;return t&&t.addEventListener(`scroll`,e),()=>{t&&t.removeEventListener(`scroll`,e)}},[o]),(0,Z.useEffect)(()=>{let e=o.current;if(e)return X(Nt({element:e,canScroll:({source:e})=>e?.data?.dragInstanceId===`PROJECTS`,getAllowedAxis:()=>`vertical`}))},[o]);let O=e=>{t(e),localStorage.setItem(`isAllProjectsListOpen`,e.toString())};return(0,Z.useEffect)(()=>{b.includes(`projects`)&&(t(!0),localStorage.setItem(`isAllProjectsListOpen`,`true`))},[b]),(0,Q.jsxs)(Q.Fragment,{children:[y&&(0,Q.jsx)(Re,{isOpen:n,onClose:()=>r(!1),setToFavorite:!1,workspaceSlug:y.toString()}),(0,Q.jsxs)(`div`,{ref:o,className:A({"border-t border-strong":i}),children:[(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsxs)(R,{as:`div`,className:`flex flex-col`,defaultOpen:e,children:[(0,Q.jsxs)(`div`,{className:`group flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-placeholder hover:bg-layer-transparent-hover`,children:[(0,Q.jsx)(R.Button,{as:`button`,type:`button`,className:`flex w-full items-center gap-1 text-left text-13 font-semibold whitespace-nowrap text-placeholder`,onClick:()=>O(!e),"aria-label":s(e?`aria_labels.projects_sidebar.close_projects_menu`:`aria_labels.projects_sidebar.open_projects_menu`),children:(0,Q.jsx)(`span`,{className:`text-13 font-semibold`,children:s(`projects`)})}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[x&&(0,Q.jsx)(N,{tooltipHeading:s(`create_project`),tooltipContent:``,children:(0,Q.jsx)(Pt,{variant:`ghost`,size:`sm`,icon:Te,onClick:()=>{r(!0)},"data-ph-element":l.SIDEBAR_CREATE_PROJECT_TOOLTIP,className:`hidden text-placeholder group-hover:inline-flex`,"aria-label":s(`aria_labels.projects_sidebar.create_new_project`)})}),(0,Q.jsx)(Pt,{variant:`ghost`,size:`sm`,icon:De,onClick:()=>O(!e),className:`text-placeholder`,iconClassName:A(`transition-transform`,{"rotate-90":e}),"aria-label":s(e?`aria_labels.projects_sidebar.close_projects_menu`:`aria_labels.projects_sidebar.open_projects_menu`)})]})]}),(0,Q.jsxs)(se,{show:e,enter:`transition duration-100 ease-out`,enterFrom:`transform scale-95 opacity-0`,enterTo:`transform scale-100 opacity-100`,leave:`transition duration-75 ease-out`,leaveFrom:`transform scale-100 opacity-100`,leaveTo:`transform scale-95 opacity-0`,children:[m===`init-loader`&&(0,Q.jsx)(P,{className:`w-full space-y-1.5`,children:Array.from({length:4}).map((e,t)=>(0,Q.jsx)(P.Item,{height:`28px`},t))}),e&&(0,Q.jsx)(R.Panel,{as:`div`,className:`flex flex-col gap-0.5`,static:!0,children:(0,Q.jsxs)(Q.Fragment,{children:[S.map((e,t)=>(0,Q.jsx)(wn,{projectId:e,handleCopyText:()=>T(e),projectListType:`JOINED`,disableDrag:!1,disableDrop:!1,isLastChild:t===S.length-1,handleOnProjectDrop:D},e)),C&&(0,Q.jsx)(Ht,{children:(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>p(),className:`flex flex-grow items-center gap-1.5 text-13 font-medium text-tertiary`,id:`extended-project-sidebar-toggle`,"aria-label":s(f?`aria_labels.app_sidebar.close_extended_sidebar`:`aria_labels.app_sidebar.open_extended_sidebar`),children:[(0,Q.jsx)(ae,{className:`size-4 flex-shrink-0`}),(0,Q.jsx)(`span`,{children:f?`Hide`:`More`})]})})]})})]})]})}),x&&_?.length===0&&(0,Q.jsx)(`button`,{type:`button`,"data-ph-element":l.SIDEBAR_CREATE_PROJECT_BUTTON,className:`flex w-full items-center gap-1.5 rounded-md px-2 py-1.5 text-13 leading-5 font-medium text-secondary hover:bg-surface-2`,onClick:()=>{c(!0)},children:s(`add_project`)})]})]})});function En(e){let{label:t,onClick:n,disabled:r,...i}=e;return(0,Q.jsx)(nt,{variant:`secondary`,size:`xl`,className:`w-full justify-start`,onClick:n,disabled:r,...i,children:t})}var Dn=G(function(){let{t:e}=h(),[t,n]=(0,Z.useState)(!1),[r,i]=(0,Z.useState)(!1),a=(0,Z.useRef)(),{workspaceSlug:o}=W(),s=o?.toString(),{toggleCreateIssueModal:c}=bt(),{joinedProjectIds:l}=J(),{allowPermissions:u}=q(),{storedValue:d,setValue:f}=ut(`draftedIssue`,{}),p=u([w.ADMIN,w.MEMBER],E.WORKSPACE),g=l.length===0||!p,_=s?d?.[s]??void 0:void 0,v=()=>{a?.current&&clearTimeout(a.current),i(!0)},y=()=>{a.current=setTimeout(()=>{i(!1)},300)},b=()=>{let e=d??{};return s&&e[s]&&delete e[s],f(e),Promise.resolve()};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Xe,{isOpen:t,onClose:()=>n(!1),data:_??{},onSubmit:()=>b(),fetchIssueDetails:!1,isDraft:!0}),(0,Q.jsx)(`div`,{className:`flex cursor-pointer items-center justify-between gap-2`,children:(0,Q.jsx)(En,{label:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Pe,{className:`size-4`}),(0,Q.jsx)(`span`,{className:`max-w-[145px] truncate text-13 font-medium`,children:e(`sidebar.new_work_item`)})]}),onClick:()=>c(!0),disabled:g,onMouseEnter:v,onMouseLeave:y,"data-ph-element":m.CREATE_WORK_ITEM_BUTTON})})]})}),On=G(function({item:e,additionalRender:t,additionalStaticItems:n}){let{t:r}=h(),i=$e(),{workspaceSlug:a}=W(),{allowPermissions:o}=q(),{isWorkspaceItemPinned:s}=dt(),{data:c}=st(),{toggleSidebar:l,isExtendedSidebarOpened:u,toggleExtendedSidebar:d}=Y(),f=()=>{window.innerWidth<768&&l(),u&&d(!1)},p=[`home`,`pi_chat`,`projects`,`your_work`,`stickies`,`drafts`,...n||[]],m=a?.toString()||``;if(!o(e.access,E.WORKSPACE,m)||!s(e.key)&&!p.includes(e.key))return null;let g=e.key===`your_work`&&c?.id?te(m,e.href,c?.id):te(m,e.href),_=Ut(e.key);return(0,Q.jsx)(ot,{href:g,onClick:f,children:(0,Q.jsxs)(Ht,{isActive:e.highlight(i,g),children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5 py-[1px]`,children:[_,(0,Q.jsx)(`p`,{className:`text-13 leading-5 font-medium`,children:r(e.labelTranslationKey)})]}),t?.(e.key,m)]})})}),kn=G(function(){let{setValue:e,storedValue:t}=ut(`is_workspace_menu_open`,!0),{isExtendedSidebarOpened:n,toggleExtendedSidebar:r}=Y(),{preferences:i}=ft(),{preferences:a}=dt(),{t:o}=h(),s=t=>{e(t)},l=(0,Z.useMemo)(()=>{let e=[...u],t=[],n=S.stickies;return i.items.stickies?.enabled&&n&&t.push({...n,sort_order:i.items.stickies.sort_order}),i.items.your_work?.enabled&&S[`your-work`]&&t.push({...S[`your-work`],sort_order:i.items.your_work.sort_order}),i.items.drafts?.enabled&&S.drafts&&t.push({...S.drafts,sort_order:i.items.drafts.sort_order}),t.sort((e,t)=>e.sort_order-t.sort_order),[...e,...t]},[i]),d=(0,Z.useMemo)(()=>c.map(e=>{let t=a.items[e.key];return{...e,sort_order:t?t.sort_order:0}}).sort((e,t)=>e.sort_order-t.sort_order),[a]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:l.map((e,t)=>(0,Q.jsx)(On,{item:e},`static_${t}`))}),(0,Q.jsxs)(R,{as:`div`,className:`flex flex-col`,defaultOpen:!!t,children:[(0,Q.jsxs)(`div`,{className:`group flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-placeholder hover:bg-layer-transparent-hover`,children:[(0,Q.jsx)(R.Button,{as:`button`,type:`button`,className:`flex w-full items-center gap-1 text-left text-13 font-semibold whitespace-nowrap text-placeholder`,onClick:()=>s(!t),"aria-label":o(t?`aria_labels.app_sidebar.close_workspace_menu`:`aria_labels.app_sidebar.open_workspace_menu`),children:(0,Q.jsx)(`span`,{className:`text-13 font-semibold`,children:o(`common.workspace`)})}),(0,Q.jsx)(`div`,{className:`pointer-events-none flex items-center opacity-0 group-hover:pointer-events-auto group-hover:opacity-100`,children:(0,Q.jsx)(R.Button,{as:`button`,type:`button`,className:`flex-shrink-0 rounded-sm p-0.5 hover:bg-layer-1`,onClick:()=>s(!t),"aria-label":o(t?`aria_labels.app_sidebar.close_workspace_menu`:`aria_labels.app_sidebar.open_workspace_menu`),children:(0,Q.jsx)(De,{className:A(`size-3 flex-shrink-0 transition-all`,{"rotate-90":t})})})})]}),(0,Q.jsx)(se,{show:!!t,enter:`transition duration-100 ease-out`,enterFrom:`transform scale-95 opacity-0`,enterTo:`transform scale-100 opacity-100`,leave:`transition duration-75 ease-out`,leaveFrom:`transform scale-100 opacity-100`,leaveTo:`transform scale-95 opacity-0`,children:t&&(0,Q.jsx)(R.Panel,{as:`div`,className:`flex flex-col gap-0.5`,static:!0,children:(0,Q.jsxs)(Q.Fragment,{children:[p.map((e,t)=>(0,Q.jsx)(On,{item:e},`static_${t}`)),d.map((e,t)=>(0,Q.jsx)(On,{item:e},`dynamic_${t}`)),(0,Q.jsx)(Ht,{children:(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>r(),className:`flex flex-grow items-center gap-1.5 text-13 font-medium text-tertiary`,id:`extended-sidebar-toggle`,"aria-label":o(n?`aria_labels.app_sidebar.close_extended_sidebar`:`aria_labels.app_sidebar.open_extended_sidebar`),children:[(0,Q.jsx)(ae,{className:`size-4 flex-shrink-0`}),(0,Q.jsx)(`span`,{children:n?`Hide`:`More`})]})})]})})})]})]})}),An=G(function(){let{allowPermissions:e}=q(),{groupedFavorites:t}=wt(),n=e([w.ADMIN,w.MEMBER],E.WORKSPACE),r=re(t);return(0,Q.jsxs)(on,{title:`Projects`,quickActions:(0,Q.jsx)(Dn,{}),children:[(0,Q.jsx)(kn,{}),n&&!r&&(0,Q.jsx)(Sn,{}),(0,Q.jsx)(Tn,{})]})}),jn=G(function(){let{sidebarCollapsed:e,toggleSidebar:t,sidebarPeek:n,toggleSidebarPeek:r,isExtendedSidebarOpened:i,isAnySidebarDropdownOpen:a}=Y(),{storedValue:o,setValue:s}=it(`sidebarWidth`,250),[c,l]=(0,Z.useState)(o??250),{workspaceSlug:u}=W(),d=$e(),f=i;return d.includes(`/${u}/notifications`)?null:(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(Vt,{showPeek:n,defaultWidth:o??250,width:c,setWidth:l,defaultCollapsed:e,peekDuration:1500,onWidthChange:e=>s(e),onCollapsedChange:t,isCollapsed:e,toggleCollapsed:t,togglePeek:r,extendedSidebar:(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(qt,{})}),isAnyExtendedSidebarExpanded:f,isAnySidebarDropdownOpen:a,children:(0,Q.jsx)(An,{})})})}),Mn=G(function(){let e=(0,Z.useRef)(null),[t,n]=(0,Z.useState)(``),[r,i]=(0,Z.useState)(!1),{workspaceSlug:a}=W(),{t:o}=h(),{isExtendedProjectSidebarOpened:s,toggleExtendedProjectSidebar:c}=Y(),{getPartialProjectById:u,joinedProjectIds:d,updateProjectView:f}=J(),{allowPermissions:p}=q(),m=(e,t,n)=>{if(!e||!t||!a||e===t)return;let r=[];d.map(e=>{let t=u(e);t&&r.push(t)});let i=d.indexOf(e),s=n?d.length:d.indexOf(t);if(r.length<=0)return;let c=M(i,s,e,r);c!=null&&f(a.toString(),e,{sort_order:c}).catch(()=>{H({type:U.ERROR,title:o(`error`),message:o(`something_went_wrong`)})})},g=d.filter(e=>{let n=u(e);return n?n.name.toLowerCase().includes(t.toLowerCase())||n.identifier.includes(t):!1}),_=p([w.ADMIN,w.MEMBER],E.WORKSPACE),v=(0,Z.useCallback)(()=>c(!1),[c]),y=e=>{k(`${a}/projects/${e}/issues`).then(()=>{H({type:U.SUCCESS,title:o(`link_copied`),message:o(`project_link_copied_to_clipboard`)})})};return(0,Q.jsxs)(Q.Fragment,{children:[a&&(0,Q.jsx)(Re,{isOpen:r,onClose:()=>i(!1),setToFavorite:!1,workspaceSlug:a.toString()}),(0,Q.jsxs)(Kt,{isExtendedSidebarOpened:!!s,extendedSidebarRef:e,handleClose:v,excludedElementId:`extended-project-sidebar-toggle`,className:`px-0`,children:[(0,Q.jsxs)(`div`,{className:`sticky top-4 flex w-full flex-col gap-1 px-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsx)(`span`,{className:`py-1.5 text-13 font-semibold text-tertiary`,children:`Projects`}),_&&(0,Q.jsx)(N,{tooltipHeading:o(`create_project`),tooltipContent:``,children:(0,Q.jsx)(`button`,{type:`button`,"data-ph-element":l.EXTENDED_SIDEBAR_ADD_BUTTON,className:`flex-shrink-0 rounded-sm p-0.5 text-tertiary transition-colors hover:bg-layer-1 hover:text-secondary`,onClick:()=>{i(!0)},children:(0,Q.jsx)(Te,{className:`size-3`})})})]}),(0,Q.jsxs)(`div`,{className:`ml-auto flex w-full items-center gap-1.5 rounded-md border border-subtle bg-surface-1 px-2.5 py-1`,children:[(0,Q.jsx)(Fe,{className:`h-3.5 w-3.5 text-placeholder`}),(0,Q.jsx)(`input`,{className:`w-full max-w-[234px] border-none bg-transparent text-13 outline-none placeholder:text-placeholder`,placeholder:o(`search`),value:t,autoFocus:!0,onChange:e=>n(e.target.value)})]})]}),g.length===0?(0,Q.jsx)(`div`,{className:`mt-4 flex flex-col items-center p-10`,children:(0,Q.jsx)(St,{title:o(`common_empty_state.search.title`),description:o(`common_empty_state.search.description`),assetKey:`search`,assetClassName:`size-20`,align:`center`})}):(0,Q.jsx)(`div`,{className:`vertical-scrollbar mt-4 flex scrollbar-sm flex-grow flex-col gap-0.5 overflow-x-hidden overflow-y-auto pr-2 pl-9`,children:g.map((e,t)=>(0,Q.jsx)(wn,{projectId:e,handleCopyText:()=>y(e),projectListType:`JOINED`,disableDrag:!1,disableDrop:!1,isLastChild:t===g.length-1,handleOnProjectDrop:m,renderInExtendedSidebar:!0},e))})]})]})});function Nn(){return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ze,{}),(0,Q.jsxs)(`div`,{className:`relative flex h-full w-full flex-col overflow-hidden rounded-lg border border-subtle`,children:[(0,Q.jsx)(`div`,{id:`full-screen-portal`,className:`absolute inset-0 w-full`}),(0,Q.jsxs)(`div`,{className:`relative flex size-full overflow-hidden`,children:[(0,Q.jsx)(jn,{}),(0,Q.jsx)(Mn,{}),(0,Q.jsx)(`main`,{className:`relative flex h-full w-full flex-col overflow-hidden bg-surface-1`,children:(0,Q.jsx)(r,{})})]})]})]})}var Pn=n(G(Nn));export{Pn as default}; \ No newline at end of file diff --git a/deploy/patches/page-BEQX0L4U.js b/deploy/patches/page-BEQX0L4U.js new file mode 100644 index 000000000..c7aa8dabb --- /dev/null +++ b/deploy/patches/page-BEQX0L4U.js @@ -0,0 +1,74 @@ +import{F as e,V as t,j as n}from"./chunk-KS7C4IRE-CMpS5gbI.js";import{t as r}from"./jsx-runtime-noaePsda.js";import{Br as i,J as a,Ti as o,c as s,dr as c,lr as l,vt as u,yt as d}from"./issue.service-CTC2rMYd.js";import{I as f,V as p,Vt as m,jn as h}from"./store-context-C83lXiWw.js";import{a as g}from"./dist-B3GnvwXu.js";import{a as _,i as v,n as y,r as b,t as x}from"./minus-BpQOnDpY.js";import{t as S}from"./item-icon-Cbeg99eb.js";import{t as C}from"./circle-check-ixOmpmsy.js";import{t as w}from"./message-square-C_OV-WER.js";import{t as T}from"./button-DrwsAH69-BTPMslkc.js";import"./button-BYpq06q8.js";import{t as E}from"./mobxreact.esm-CAsEUKPK.js";import{t as D}from"./page-title-CHr-UyVa.js";import{t as O}from"./use-workspace-Djnbfdo5.js";import{t as k}from"./user-NVe3rMCN.js";import{t as A}from"./boxed-control-item-CaQeQjDm.js";import{t as j}from"./heading-NrAC1MPz.js";import{t as M}from"./discount-info-t73U_blP.js";import{t as N}from"./breadcrumb-link-XZ0a1zCq.js";import{t as P}from"./not-authorized-view-BL2zvqmA.js";import{n as F,t as I}from"./page-header-5H3k3FUd.js";var L=r(),R=E(function(){let{t:e}=s(),t=i[`billing-and-plans`],n=S[`billing-and-plans`];return(0,L.jsx)(I,{leftItem:(0,L.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,L.jsx)(g,{children:(0,L.jsx)(g.Item,{component:(0,L.jsx)(N,{label:e(t.i18n_label),icon:(0,L.jsx)(n,{className:`size-4 text-tertiary`})})})})})})}),z=t(e(),1);function B({className:e}){return(0,L.jsx)(w,{className:p(e,`size-5 text-secondary`)})}function V({className:e}){return(0,L.jsx)(`span`,{className:p(`w-fit rounded-sm bg-accent-primary px-1.5 py-0.5 text-9 font-semibold whitespace-nowrap text-on-color`,e),children:`COMING SOON`})}var H=[`free`,`one`,`pro`,`business`,`enterprise`],U=[{id:`project-work-tracking`,title:`Project + work tracking`,features:[{title:`Projects`,description:`Add projects to house work items, cycles, and modules.`,cloud:{free:!0,one:!0,pro:!0,business:!0,enterprise:!0}},{title:`Work items`,description:`Add work via work items, set properties for tracking, and add to +cycles or modules.`,cloud:{free:!0,one:!0,pro:!0,business:!0,enterprise:!0}},{title:`Comments`,description:`Respond to work items, @mention members, and brainstorm +together without leaving Plane.`,cloud:{free:!0,one:!0,pro:!0,business:!0,enterprise:!0}},{title:`Cycles`,description:`Track work in timeboxes with differing frequency.`,cloud:{free:!0,one:!0,pro:!0,business:!0,enterprise:!0}},{title:`Modules`,description:`Group replicable work in modules with their own +leads.`,cloud:{free:!0,one:!0,pro:!0,business:!0,enterprise:!0}},{title:`Intake`,description:`See suggestions and feedback from viewers and +guests before you decide to add them to your +project.`,cloud:{free:!0,one:!0,pro:!0,business:!0,enterprise:!0}},{title:`Estimates`,description:`Measure effort in points in a system that works for +you.`,cloud:{free:`Basic`,one:`Basic`,pro:`Advanced`,business:`Advanced`,enterprise:`Advanced`}}]},{id:`project-work-management`,title:`Project + work management`,features:[{title:`Bulk Ops`,description:`Add several work items to cycles or modules, transfer +them, or edit their properties.`,cloud:{free:!1,one:`Limited props`,pro:`All props`,business:(0,L.jsxs)(`span`,{className:`flex flex-col items-end gap-1 lg:items-center`,children:[(0,L.jsx)(V,{}),`Work item transfers and conversions`]}),enterprise:(0,L.jsxs)(`span`,{className:`flex flex-col items-end gap-1 lg:items-center`,children:[(0,L.jsx)(V,{}),`Work item transfers and conversions`]})}},{title:`Time Tracking + Worklogs`,description:`Track time per work item, see aggregated reports, and +filter by need.`,cloud:{free:!1,one:`Basic`,pro:`Historical timesheets`,business:`Historical timesheets +and approvals`,enterprise:`Historical timesheets +and approvals`}},{title:`Active Cycles`,description:`See all running cycles across all projects, or soon, in +a single project.`,cloud:{free:!1,one:!0,pro:!0,business:!0,enterprise:!0}},{title:`Work item Types`,description:`Create your own work item types with your own +properties.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Custom Properties`,description:`Create your own properties and apply them to your +workspace or project.`,cloud:{free:!1,one:!1,pro:`Project-level +custom properties`,business:`Workspace-level +properties and roll-ups`,enterprise:`Workspace-level +properties and roll-ups`}},{title:`Dependencies in Gantt`,description:`Adjust timelines for dependent work items visually on +our Gantt layout.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Work item Transfers`,description:`Move a work item from a project or a cycle to +another.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Auto-transfer Cycle Work items`,description:`Transfer incomplete work items from a completed cycle +to the next cycle or to the default project state. `,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Epics`,description:`Organize long-term work in epics that house work items, +cycles, and modules.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Initiatives`,description:`Create initiatives to roll up several epics.`,comingSoon:!0,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Checkpoints`,description:`Add markers to Projects, Epics and Initiatives to keep your +team on track and report on progress.`,comingSoon:!0,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Module Overview`,description:`Like Cycle Overviews, see relevant details and +progress charts for each module.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Auto-assignment In Modules`,description:`Choose assignment rules for work items in a +module including Linear, Round Robin, or Capacity.`,cloud:{free:!1,one:!1,pro:`Linear`,business:`Round-robin and Capacity`,enterprise:`Round-robin and Capacity`}},{title:`Public, Private, and Secret projects`,description:`Public projects are visible and accessible to +everyone. Private ones are visible but need approval +to join. Secret projects aren't visible or accessible.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`State Of Projects`,description:`See all projects laid across states that highlight +those that need attention and those on track.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Pre-defined work item Templates`,description:`Choose from our available work item templates that +customize work item types and properties for several +use cases.`,comingSoon:!0,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Teamspace Cycles`,description:`See multiple cycles in multiple projects at once.`,cloud:{free:!1,one:!1,pro:!1,business:!0,enterprise:!0}},{title:`Project Templates`,description:`Save states, workflows, automation, and other project +settings into templates.`,cloud:{free:!1,one:!1,pro:!1,business:!0,enterprise:!0}},{title:`Baselines And Deviations`,description:`Declare baselines for how your projects progress +and zoom in on deviations.`,cloud:{free:!1,one:!1,pro:!1,business:!0,enterprise:!0}},{title:`Scheduled Comms`,description:`Schedule reports, notifications, and messages to +third-party tools.`,cloud:{free:!1,one:!1,pro:!1,business:!0,enterprise:!0}},{title:`Intake Assignees`,description:`Assign approved Intake work items to a member by +default.`,cloud:{free:!1,one:!1,pro:!1,business:!0,enterprise:!0}},{title:`Custom SLAs`,description:`Set SLA matrices for time-sensitive work items.`,cloud:{free:!1,one:!1,pro:!1,business:!0,enterprise:!0}},{title:`Intake Forms`,description:`Take Intake work items from externally accessible web +forms.`,cloud:{free:!1,one:!1,pro:!1,business:!0,enterprise:!0}},{title:`Emails For Intake`,description:`Get an email address for reporting work items +directly into a project's Intake.`,comingSoon:!0,cloud:{free:!1,one:!1,pro:!1,business:!0,enterprise:!0}}]},{id:`visualization`,title:`Visualization`,features:[{title:`Layouts`,description:`Choose from the List, the Board, the Calendar, the +Gantt, or the Spreadsheet layout for your work items.`,cloud:{free:!0,one:!0,pro:!0,business:!0,enterprise:!0}},{title:`Views`,description:`Save sort, filter, and display options on a layout to a +view.`,cloud:{free:!0,one:!0,pro:!0,business:!0,enterprise:!0}},{title:`Shared Views`,description:`Choose a few members to share a view with.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Publish Views`,description:`Put a view on the Internet and let your customers +interact with them.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Dashboards and Widgets`,description:`Create your own dashboards with custom widgets +and data types.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}}]},{id:`analytics-reports`,title:`Analytics + reports`,features:[{title:`Progress Charts`,description:`Track progress in cycles, modules, and overviews +throughout Plane without switching to dashboards +or Analytics.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Cycle Reports`,description:`Get on-demand cycle reports during and after a +cycle. Revisit reports anytime from permalinks.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Insights`,description:`Hindsight, On-demand insights, Foresights.`,comingSoon:!0,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Advanced Pages Analytics`,description:`See who's viewing, sharing, and commenting on +your pages along with other useful info.`,comingSoon:!0,cloud:{free:!1,one:!1,pro:!1,business:!0,enterprise:!0}},{title:`Custom Reports`,description:`Generate reports by any dimension and metric +across your project or workspace.`,comingSoon:!0,cloud:{free:!1,one:!1,pro:!1,business:!0,enterprise:!0}}]},{id:`navigation`,title:`Navigation`,features:[{title:`Power K`,description:`Access a keyboard-first gateway to almost anything +in Plane.`,cloud:{free:!0,one:!0,pro:!0,business:!0,enterprise:!0}},{title:`PQL`,description:`Write Plane Query Language in search with support +for Boolean operators. Soon, you can write natural +language queries.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}}]},{id:`workspace-user-management`,title:`Workspace and user management`,features:[{title:`Member limit`,description:`Number of seats that can use project and work management features`,selfHostedDescription:`Number of users that our standard infra supports +Increase infra to get more users`,cloud:{free:`12`,one:``,pro:`Unlimited`,business:`Unlimited`,enterprise:`Unlimited`},"self-hosted":{free:`~50`,one:`~50`,pro:`~200`,business:`~200`,enterprise:`Unlimited`}},{title:`Roles`,description:`Choose from one of four pre-defined roles or create +custom ones with RBAC.`,cloud:{free:`Basic`,one:`Basic`,pro:`Pre-defined roles`,business:`RBAC`,enterprise:`GAC`}},{title:`Guests`,description:`Let some users see everything or just their work items in +a project.`,cloud:{free:!1,one:`5 per paid member`,pro:`5 per paid member`,business:`5 per paid member`,enterprise:`5 per paid member`}},{title:`Approvals`,description:`Set workspace, project, and work item type approvals to +designated admins.`,comingSoon:!0,cloud:{free:!1,one:!1,pro:!1,business:!0,enterprise:!0}},{title:`Admin Interface`,description:`Get an admin overview to manage workspace and +project settings.`,cloud:{free:!1,one:!1,pro:!1,business:!0,enterprise:!0}},{title:`Workspace Activity Logs`,description:`See filterable activity logs for your entire +workspace.`,cloud:{free:!1,one:!1,pro:!1,business:!0,enterprise:!0}},{title:`API-enabled Audit Logs`,description:`See a full-workspace audit log and use APIs to flag +Plane activity in compliance systems.`,comingSoon:!0,cloud:{free:!1,one:!1,pro:!1,business:!0,enterprise:!0}}]},{id:`automations-workflows`,title:`Automations and workflows`,features:[{title:`Trigger And Action`,description:`Choose a trigger and a corresponding action per +automation flow.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Decisions And Loops Automation`,description:`Use actions as triggers indefinitely in an +automation flow.`,comingSoon:!0,cloud:{free:!1,one:!1,pro:!1,business:!0,enterprise:!0}},{title:`Number of automations`,description:`Total number of automation flows in your +workspace`,cloud:{free:!1,one:!1,pro:`5,000`,business:`10,000`,enterprise:`Unlimited`}}]},{id:`knowledge-management`,title:`Knowledge management`,features:[{title:`Pages`,description:`Build knowledge bases for your teams which are +accessible & shareable.`,cloud:{free:!0,one:!0,pro:!0,business:!0,enterprise:!0}},{title:`Real-time Collab`,description:`Edit a page together with members in your project, +team, or workspace.`,cloud:{free:!1,one:!0,pro:!0,business:!0,enterprise:!0}},{title:`Work item Embeds`,description:`Embed work items from any project you are a member +of.`,cloud:{free:!1,one:!0,pro:!0,business:!0,enterprise:!0}},{title:`Link-to-work items`,description:`Link pages in work items in a separate section in work item +details.`,cloud:{free:!1,one:!0,pro:!0,business:!0,enterprise:!0}},{title:`Publish`,description:`Put your pages on the web for external users and let +them comment without signing into your workspace.`,cloud:{free:!1,one:!0,pro:!0,business:!0,enterprise:!0}},{title:`Wiki`,description:`Create company-wide wikis or knowledge bases +without creating a project.`,cloud:{free:!1,one:!0,pro:!0,business:!0,enterprise:!0}},{title:`Exports`,description:`Export page content into PDFs or Word-compatible +docs.`,cloud:{free:!1,one:!1,pro:`One download +at a time`,business:`Queued downloads`,enterprise:`Queued downloads`}},{title:`Templates`,description:`Use pages as templates for your project, team, or +workspace.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Versions`,description:`See restorable version of edits to your pages.`,cloud:{free:!1,one:!1,pro:`2 days`,business:`3 months`,enterprise:`Unlimited`}},{title:`Databases + Formulas`,description:`Put databases and formulas into a page without +worrying about losing text, images, or other content +types.`,comingSoon:!0,cloud:{free:!1,one:!1,pro:!1,business:!0,enterprise:!0}},{title:`Nested Pages`,description:`Pages inside a page, organize your pages +as you see fit for the progressive +disclosure.`,comingSoon:!0,cloud:{free:!1,one:!1,pro:!1,business:`Word-compatible + other format downloads`,enterprise:`Word-compatible + other format downloads`}}]},{id:`importers`,title:`Importers`,features:[{title:`Jira`,description:`Import your work items and members from Jira.`,cloud:{free:`Without custom props`,one:`Without custom props`,pro:`With custom props`,business:`With custom props`,enterprise:`With custom props`}},{title:`GitHub`,description:`Import your work items and members from GitHub.`,cloud:{free:`Without custom props`,one:`Without custom props`,pro:`With custom props`,business:`With custom props`,enterprise:`With custom props`}}]},{id:`integrations`,title:`Integrations`,comingSoon:!0,features:[{title:`GitHub`,description:`Sync Plane work items and states to GitHub work items and +states. Update GitHub automatically with activity +from Plane and vice-versa.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Slack`,description:`Get Plane activity in Slack and use / commands in +Slack to make changes in Plane.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Zapier`,description:`Run if-then-else automations using Zapier.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Zendesk`,description:`Create Plane work items from Zendesk tickets.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}},{title:`Freshdesk`,description:`Create Plane work items from Freshdesk tickets.`,cloud:{free:!1,one:!1,pro:!0,business:!0,enterprise:!0}}]},{id:`storage`,title:`Storage`,cloudOnly:!0,features:[{title:`Space`,description:`Total storage allowed per workspace`,cloud:{free:`5GB`,one:!1,pro:`1 TB`,business:`5 TB`,enterprise:`Custom`}},{title:`Max file size`,description:`Limit for uploads to your workspace`,cloud:{free:`5 MB`,one:!1,pro:`100 MB`,business:`200 MB`,enterprise:`Custom`}}]},{id:`security`,title:`Security`,features:[{title:`SAML`,description:`Get the officially supported SAML implementation +and make Plane secure with any IdP.`,cloud:{free:!1,one:!0,pro:!0,business:!0,enterprise:!0}},{title:`OIDC`,description:`Get the officiall \ No newline at end of file diff --git a/deploy/patches/patch_frontend.py b/deploy/patches/patch_frontend.py index 01c48f82f..65fa926b0 100644 --- a/deploy/patches/patch_frontend.py +++ b/deploy/patches/patch_frontend.py @@ -5,6 +5,10 @@ import sys import urllib.request def extract_or_fetch(filename, out_path, image="makeplane/plane-frontend:stable"): + if os.path.exists(out_path) and os.path.getsize(out_path) > 50: + print(f"Using existing {filename} on host ({os.path.getsize(out_path)} bytes)") + return True + for base_dir in ["/usr/share/caddy/html/assets", "/usr/share/nginx/html/assets"]: src_container_path = f"{base_dir}/{filename}" try: @@ -18,64 +22,92 @@ def extract_or_fetch(filename, out_path, image="makeplane/plane-frontend:stable" with open(out_path, "wb") as f: f.write(res.stdout) print(f"Extracted {filename} from {image} ({len(res.stdout)} bytes)") - return + return True except Exception: continue url = f"https://jira.tradhox.com/assets/{filename}" - urllib.request.urlretrieve(url, out_path) - print(f"Fetched {filename} from {url}") + try: + req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"}) + with urllib.request.urlopen(req, timeout=15) as resp: + content = resp.read() + if len(content) > 50: + with open(out_path, "wb") as f: + f.write(content) + print(f"Fetched {filename} from {url} ({len(content)} bytes)") + return True + except Exception as e: + print(f"Notice: Could not fetch {filename} from {url}: {e}") + + # Fallback stub to satisfy docker-compose volume mounts if needed + with open(out_path, "w", encoding="utf-8") as f: + f.write("// frontend patch stub\n") + print(f"Created fallback stub for {filename}") + return False def patch_page(file_path): - with open(file_path, "r", encoding="utf-8") as f: - code = f.read() + if not os.path.exists(file_path): + return + try: + with open(file_path, "r", encoding="utf-8") as f: + code = f.read() - # 1. Replace Community with Enterprise in top box - old_box = "(0,L.jsx)(A,{title:`Community`,description:`Unlimited projects, issues, cycles, modules, pages, and storage`})" - new_box = "(0,L.jsx)(A,{title:`Enterprise`,description:`Enterprise Edition Active — Unlimited users, projects, issues, cycles, modules, pages, storage, and all enterprise features unlocked`})" - if old_box in code: - code = code.replace(old_box, new_box) + # 1. Replace Community with Enterprise in top box + old_box = "(0,L.jsx)(A,{title:`Community`,description:`Unlimited projects, issues, cycles, modules, pages, and storage`})" + new_box = "(0,L.jsx)(A,{title:`Enterprise`,description:`Enterprise Edition Active — Unlimited users, projects, issues, cycles, modules, pages, storage, and all enterprise features unlocked`})" + if old_box in code: + code = code.replace(old_box, new_box) - # 2. Update W for enterprise - old_ent = "enterprise:{id:o.ENTERPRISE,name:`Enterprise`,monthlyPriceSecondaryDescription:`billed monthly`,yearlyPriceSecondaryDescription:`billed yearly`,buttonCTA:`Talk to Sales`,isActive:!1}" - new_ent = "enterprise:{id:o.ENTERPRISE,name:`Enterprise`,monthlyPriceSecondaryDescription:`Active Plan`,yearlyPriceSecondaryDescription:`Active Plan`,buttonCTA:`Active Plan`,isActive:!0}" - if old_ent in code: - code = code.replace(old_ent, new_ent) + # 2. Update W for enterprise + old_ent = "enterprise:{id:o.ENTERPRISE,name:`Enterprise`,monthlyPriceSecondaryDescription:`billed monthly`,yearlyPriceSecondaryDescription:`billed yearly`,buttonCTA:`Talk to Sales`,isActive:!1}" + new_ent = "enterprise:{id:o.ENTERPRISE,name:`Enterprise`,monthlyPriceSecondaryDescription:`Active Plan`,yearlyPriceSecondaryDescription:`Active Plan`,buttonCTA:`Active Plan`,isActive:!0}" + if old_ent in code: + code = code.replace(old_ent, new_ent) - # 3. Update Y pricing descriptions and button - old_ph = "p=d?`a user per month`:`Quote on request`,h=r===`month`?n.monthlyPriceSecondaryDescription:n.yearlyPriceSecondaryDescription;" - new_ph = "p=t===o.ENTERPRISE?`Active Lifetime License`:d?`a user per month`:`Quote on request`,h=t===o.ENTERPRISE?`All features unlocked`:r===`month`?n.monthlyPriceSecondaryDescription:n.yearlyPriceSecondaryDescription;" - if old_ph in code: - code = code.replace(old_ph, new_ph) + # 3. Update Y pricing descriptions and button + old_ph = "p=d?`a user per month`:`Quote on request`,h=r===`month`?n.monthlyPriceSecondaryDescription:n.yearlyPriceSecondaryDescription;" + new_ph = "p=t===o.ENTERPRISE?`Active Lifetime License`:d?`a user per month`:`Quote on request`,h=t===o.ENTERPRISE?`All features unlocked`:r===`month`?n.monthlyPriceSecondaryDescription:n.yearlyPriceSecondaryDescription;" + if old_ph in code: + code = code.replace(old_ph, new_ph) - old_btn = "(0,L.jsx)(T,{variant:`primary`,size:`lg`,onClick:()=>{let e=r??`year`,n=l[t][e]??`https://plane.so/talk-to-sales`;window.open(n,`_blank`)},className:`w-full`,children:d?`Upgrade to ${u}`:a(`common.upgrade_cta.talk_to_sales`)})" - new_btn = "(0,L.jsx)(T,{variant:t===o.ENTERPRISE?`primary`:`secondary`,size:`lg`,disabled:!0,className:t===o.ENTERPRISE?`w-full opacity-95 cursor-default`:`w-full opacity-60 cursor-default`,children:t===o.ENTERPRISE?`Current Plan (Active)`:`Included in Enterprise`})" - if old_btn in code: - code = code.replace(old_btn, new_btn) + old_btn = "(0,L.jsx)(T,{variant:`primary`,size:`lg`,onClick:()=>{let e=r??`year`,n=l[t][e]??`https://plane.so/talk-to-sales`;window.open(n,`_blank`)},className:`w-full`,children:d?`Upgrade to ${u}`:a(`common.upgrade_cta.talk_to_sales`)})" + new_btn = "(0,L.jsx)(T,{variant:t===o.ENTERPRISE?`primary`:`secondary`,size:`lg`,disabled:!0,className:t===o.ENTERPRISE?`w-full opacity-95 cursor-default`:`w-full opacity-60 cursor-default`,children:t===o.ENTERPRISE?`Current Plan (Active)`:`Included in Enterprise`})" + if old_btn in code: + code = code.replace(old_btn, new_btn) - with open(file_path, "w", encoding="utf-8") as f: - f.write(code) - print(f"Patched page successfully: {file_path} ({len(code)} bytes)") + with open(file_path, "w", encoding="utf-8") as f: + f.write(code) + print(f"Patched page successfully: {file_path} ({len(code)} bytes)") + except Exception as e: + print(f"Notice: Could not patch page {file_path}: {e}") def patch_layout(file_path): - with open(file_path, "r", encoding="utf-8") as f: - code = f.read() + if not os.path.exists(file_path): + return + try: + with open(file_path, "r", encoding="utf-8") as f: + code = f.read() - old_badge = 'onClick:()=>t(!0),"aria-haspopup":`dialog`,"aria-label":n(`aria_labels.projects_sidebar.edition_badge`),children:`Community`' - new_badge = 'onClick:()=>{},"aria-label":n(`aria_labels.projects_sidebar.edition_badge`),children:`Enterprise`' - if old_badge in code: - code = code.replace(old_badge, new_badge) + old_badge = 'onClick:()=>t(!0),"aria-haspopup":`dialog`,"aria-label":n(`aria_labels.projects_sidebar.edition_badge`),children:`Community`' + new_badge = 'onClick:()=>{},"aria-label":n(`aria_labels.projects_sidebar.edition_badge`),children:`Enterprise`' + if old_badge in code: + code = code.replace(old_badge, new_badge) - with open(file_path, "w", encoding="utf-8") as f: - f.write(code) - print(f"Patched layout successfully: {file_path} ({len(code)} bytes)") + with open(file_path, "w", encoding="utf-8") as f: + f.write(code) + print(f"Patched layout successfully: {file_path} ({len(code)} bytes)") + except Exception as e: + print(f"Notice: Could not patch layout {file_path}: {e}") def patch_badge(file_path): - # The upgrade badge returns null so no "Pro" badges render anywhere - new_code = 'import{t as e}from"./jsx-runtime-noaePsda.js";var r=e();function i(e){return null;}export{i as t};\n' - with open(file_path, "w", encoding="utf-8") as f: - f.write(new_code) - print(f"Patched badge successfully: {file_path} ({len(new_code)} bytes)") + try: + # The upgrade badge returns null so no "Pro" badges render anywhere + new_code = 'import{t as e}from"./jsx-runtime-noaePsda.js";var r=e();function i(e){return null;}export{i as t};\n' + with open(file_path, "w", encoding="utf-8") as f: + f.write(new_code) + print(f"Patched badge successfully: {file_path} ({len(new_code)} bytes)") + except Exception as e: + print(f"Notice: Could not patch badge {file_path}: {e}") def main(): target_dir = sys.argv[1] if len(sys.argv) > 1 else os.path.dirname(os.path.abspath(__file__)) diff --git a/deploy/patches/upgrade-badge-BxAQzHXC.js b/deploy/patches/upgrade-badge-BxAQzHXC.js new file mode 100644 index 000000000..f3a1463fa --- /dev/null +++ b/deploy/patches/upgrade-badge-BxAQzHXC.js @@ -0,0 +1 @@ +import{t as e}from"./jsx-runtime-noaePsda.js";var r=e();function i(e){return null;}export{i as t};