@zeniai/web-components 4.0.34 → 4.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./SessionTimeoutPopup-ByoKAsFb.cjs"),o=require("./vendor-.pnpm-Cs9JUim_.cjs"),u=require("react"),s=require("@emotion/styled"),Ze=require("@liveblocks/react"),ee=require("@zeniai/client-epic-state"),Cs=require("@liveblocks/react-ui"),we=require("@emotion/react"),ds=require("react-dom"),mt=require("@liveblocks/react-ui/primitives"),ai=require("@liveblocks/react/suspense");function ga(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const le=ga(u),Sa=({inboxNotification:e,onNotificationClick:n})=>{const r=Ze.useInboxNotificationThread(e.id),i=r.metadata.entityType.split("."),a=r.metadata.isGlobalComment&&i.length===2;return o.jsxRuntimeExports.jsx(ya,{isClickable:a,isUnRead:e.readAt==null,onClick:()=>{n(r.metadata,r.id)},children:o.jsxRuntimeExports.jsx(Cs.InboxNotification,{inboxNotification:e,kinds:{thread:d=>o.jsxRuntimeExports.jsx(Cs.InboxNotification.Thread,{...d,showRoomName:!0})}})})},ya=s.div`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./SessionTimeoutPopup-Ca6GtGg-.cjs"),o=require("./vendor-.pnpm-Cs9JUim_.cjs"),u=require("react"),s=require("@emotion/styled"),Ze=require("@liveblocks/react"),J=require("@zeniai/client-epic-state"),Cs=require("@liveblocks/react-ui"),we=require("@emotion/react"),cs=require("react-dom"),mt=require("@liveblocks/react-ui/primitives"),ii=require("@liveblocks/react/suspense");function ga(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const le=ga(u),Sa=({inboxNotification:e,onNotificationClick:n})=>{const r=Ze.useInboxNotificationThread(e.id),i=r.metadata.entityType.split("."),a=r.metadata.isGlobalComment&&i.length===2;return o.jsxRuntimeExports.jsx(ya,{isClickable:a,isUnRead:e.readAt==null,onClick:()=>{n(r.metadata,r.id)},children:o.jsxRuntimeExports.jsx(Cs.InboxNotification,{inboxNotification:e,kinds:{thread:d=>o.jsxRuntimeExports.jsx(Cs.InboxNotification.Thread,{...d,showRoomName:!0})}})})},ya=s.div`
2
2
  display: flex;
3
3
  width: 100%;
4
4
  cursor: ${e=>e.isClickable?"pointer":"initial"};
@@ -14,7 +14,7 @@
14
14
  &:hover {
15
15
  border: 1px solid ${e=>e.theme.colors.grey1};
16
16
  }
17
- `,{common:{headers:{notifications:fa}},commentsAndNotifications:{notifications:{texts:Ca}},timeFormat:{hmmADashDDMMMCommaYYYY:js}}=t.appLocale.getLocalizedStrings(),ja=e=>{const{inboxNotifications:n,isLoading:r,isFetchingMore:i,hasFetchedAll:a,fetchMore:d}=Ze.useInboxNotifications();u.useEffect(()=>{const g=setTimeout(()=>d?.(),0);return()=>clearTimeout(g)});const l=r||i===!0||a!==!0,c=Ze.useMarkInboxNotificationAsRead(),[p,m]=u.useState(!1),{isDrawerOpen:h,application:S,onNotificationClick:x,onCloseAllInboxNotificationsDrawer:C}=e,b=u.useMemo(()=>{if(!n)return[];const g=[...n];return g.sort((j,y)=>{const $=ee.zeniDate(j.notifiedAt.toDateString(),js),w=ee.zeniDate(y.notifiedAt.toDateString(),js);return $.isSame(w,"day")?0:$.isSameOrBefore(w,"day")?-1:1}),g.filter(j=>j.roomId?.includes(S)===!0)},[S,n]),f=u.useCallback(()=>{m(!0);const g=b.filter(j=>j.readAt==null);g.length===0?m(!1):g.forEach((j,y)=>{c(j.id),y===g.length-1&&setTimeout(()=>{m(!1)},1e3)})},[c,b]);return o.jsxRuntimeExports.jsx(o.Drawer,{anchor:"right",open:h,style:{display:"flex",justifyContent:"space-between"},onClose:C,transitionDuration:250,children:o.jsxRuntimeExports.jsx(ba,{children:o.jsxRuntimeExports.jsxs(Ra,{children:[o.jsxRuntimeExports.jsxs(ka,{children:[o.jsxRuntimeExports.jsx(La,{}),o.jsxRuntimeExports.jsx(Ia,{onClick:C,children:o.jsxRuntimeExports.jsx(Da,{})})]}),o.jsxRuntimeExports.jsxs($a,{children:[o.jsxRuntimeExports.jsxs(Ta,{children:[o.jsxRuntimeExports.jsx(Pa,{children:fa}),o.jsxRuntimeExports.jsx(Ea,{variant:"ghost",size:"small",label:Ca.markAllAsRead,onClick:f,prefixIcon:l||p?o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Small",start:!0}):o.jsxRuntimeExports.jsx(wa,{className:"mark-as-read"}),disabled:l||p,textStyle:{...t.textStyles.standardRegular.cssObject},style:{borderRadius:t.Space.sp1,border:"none",backgroundColor:"transparent",flexShrink:0,padding:t.Space.sp0,cursor:l||p?"default":"pointer"}})]}),r===!0?o.jsxRuntimeExports.jsx(Aa,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Standard",style:{color:"inherit"},start:!0})}):o.jsxRuntimeExports.jsx(va,{children:b.map(g=>o.jsxRuntimeExports.jsx(Sa,{inboxNotification:g,onNotificationClick:(j,y)=>x(j,y)},g.id))})]})]})})})},ba=s.div`
17
+ `,{common:{headers:{notifications:fa}},commentsAndNotifications:{notifications:{texts:Ca}},timeFormat:{hmmADashDDMMMCommaYYYY:js}}=t.appLocale.getLocalizedStrings(),ja=e=>{const{inboxNotifications:n,isLoading:r,isFetchingMore:i,hasFetchedAll:a,fetchMore:d}=Ze.useInboxNotifications();u.useEffect(()=>{const g=setTimeout(()=>d?.(),0);return()=>clearTimeout(g)});const l=r||i===!0||a!==!0,c=Ze.useMarkInboxNotificationAsRead(),[p,m]=u.useState(!1),{isDrawerOpen:h,application:S,onNotificationClick:x,onCloseAllInboxNotificationsDrawer:C}=e,b=u.useMemo(()=>{if(!n)return[];const g=[...n];return g.sort((j,y)=>{const $=J.zeniDate(j.notifiedAt.toDateString(),js),w=J.zeniDate(y.notifiedAt.toDateString(),js);return $.isSame(w,"day")?0:$.isSameOrBefore(w,"day")?-1:1}),g.filter(j=>j.roomId?.includes(S)===!0)},[S,n]),f=u.useCallback(()=>{m(!0);const g=b.filter(j=>j.readAt==null);g.length===0?m(!1):g.forEach((j,y)=>{c(j.id),y===g.length-1&&setTimeout(()=>{m(!1)},1e3)})},[c,b]);return o.jsxRuntimeExports.jsx(o.Drawer,{anchor:"right",open:h,style:{display:"flex",justifyContent:"space-between"},onClose:C,transitionDuration:250,children:o.jsxRuntimeExports.jsx(ba,{children:o.jsxRuntimeExports.jsxs(Ra,{children:[o.jsxRuntimeExports.jsxs(ka,{children:[o.jsxRuntimeExports.jsx(La,{}),o.jsxRuntimeExports.jsx(Ia,{onClick:C,children:o.jsxRuntimeExports.jsx(Da,{})})]}),o.jsxRuntimeExports.jsxs($a,{children:[o.jsxRuntimeExports.jsxs(Ta,{children:[o.jsxRuntimeExports.jsx(Pa,{children:fa}),o.jsxRuntimeExports.jsx(Ea,{variant:"ghost",size:"small",label:Ca.markAllAsRead,onClick:f,prefixIcon:l||p?o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Small",start:!0}):o.jsxRuntimeExports.jsx(wa,{className:"mark-as-read"}),disabled:l||p,textStyle:{...t.textStyles.standardRegular.cssObject},style:{borderRadius:t.Space.sp1,border:"none",backgroundColor:"transparent",flexShrink:0,padding:t.Space.sp0,cursor:l||p?"default":"pointer"}})]}),r===!0?o.jsxRuntimeExports.jsx(Aa,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Standard",style:{color:"inherit"},start:!0})}):o.jsxRuntimeExports.jsx(va,{children:b.map(g=>o.jsxRuntimeExports.jsx(Sa,{inboxNotification:g,onNotificationClick:(j,y)=>x(j,y)},g.id))})]})]})})})},ba=s.div`
18
18
  height: 100%; // Drawer header height
19
19
  `,Ra=s.div`
20
20
  width: 400px;
@@ -121,7 +121,7 @@
121
121
  justify-content: center;
122
122
  align-items: center;
123
123
  background-color: inherit;
124
- `;function Oa(e){if(e.tabsFileType!=null)return{locale_id:t.appLocale.getAppLocaleID(),tabs_file_type:e.tabsFileType,tabs:e.tabs,filter_by_tabs:e.filterByTabs,time_zone:e.timezone}}function Na(e){const{tabs:n,filterByTabs:r,tabsFileType:i,timezone:a}=e.defaultOptions;return{tabsFileType:i,tabs:n,filterByTabs:r,timezone:a}}function Ma(e){const n=Na(e);return za(e.downloadParams.cockpitEndPoint,e.downloadParams.authParams,n)}async function za(e,n,r){const i=`${e}?query=${encodeURIComponent(JSON.stringify(Oa(r)))}`,{cockpit:a,download:d}=t.appLocale.getLocalizedStrings();try{if(r.tabsFileType==null)throw new Error(d.errorMessages.unsupportedFileType);const l=await t.fetchRequest({urlEndPoint:i,authParams:n,fileType:r.tabsFileType});if(l.ok){const c=t.getFileNameFromResponseHeaders(l.headers,a.defaultFileName),p=await l.arrayBuffer();o.fileDownload(p,c)}else console.error(`${d.errorMessages.fileDownloadError.replace("__feature__",a.cockpitHeader)} ${l.statusText}`)}catch(l){console.error(`${d.errorMessages.fileDownloadError.replace("__feature__",a.cockpitHeader)} ${JSON.stringify(l)}`)}}const Ie=88,Nt=58,Mt=1,zt=55,Fa=10,Wa=5,xt=["management","subscription","portfolio","onboarding","audit","healthMonitor","taskManager","aiAccountant"],li=[{value:"controllerUserIds",multiple:!0,type:"user"},{value:"customerSuccessManagerUserIds",multiple:!0,type:"user"},{value:"preparerUserIds",multiple:!0,type:"user"},{value:"reviewerUserIds",multiple:!0,type:"user"},{value:"apAnalystUserIds",multiple:!0,type:"user"},{value:"taxLeadUserIds",multiple:!0,type:"user"},{value:"plans",multiple:!0},{value:"companyGroupId"},{value:"taxStatusCode"},{value:"statusCode"},{value:"annualRecurringRevenue"},{value:"monthlyRecurringRevenue"},{value:"customerSatisfaction",type:"rating"},{value:"zeniSatisfaction",type:"rating"}],ci=[{value:"controllerUserIds",multiple:!0,type:"user"},{value:"statusCode"},{value:"recommendedActionCode"},{value:"monthlyRecurringRevenue"},{value:"subscriptionPlans",multiple:!0},{value:"subscriptionAddOns",multiple:!0},{value:"avg2MonthExpenses"},{value:"slabLowerLimit"},{value:"slabUpperLimit"}],di=[{value:"netBurnOrIncome"},{value:"cashPosition"},{value:"expenses"},{value:"income"},{value:"runway",type:"runway"}],pi=[{value:"controller",multiple:!0,type:"user"},{value:"customerSuccessManager",multiple:!0,type:"user"},{value:"churnProbabilityPercentage",type:"dropdownRange"},{value:"runway",type:"runway"},{value:"netPromoterScore",type:"dropdownRange"},{value:"customerSatisfactionScore",type:"dropdownRange"},{value:"lastReportSent",type:"dateRange"},{value:"subscriptionRenewalDate",type:"dateRange"},{value:"subscriptionStartDate",type:"dateRange"},{value:"verticalProductServices"},{value:"monthlyRecurringRevenue"},{value:"companyGroupId"},{value:"externalProductServiceExposure"},{value:"companyEngagementMetricsUpdatedAt",type:"dateRange"}],Ba=[{label:"< 200K",value:"0<->200000"},{label:"75K to 100K",value:"75000<->100000"},{label:"25K to 75K",value:"25000<->75000"},{label:"< 25K",value:"0<->25000"}],ps=[{label:"< 10K",value:"0<->10000"},{label:"5K to 8K",value:"5000<->8000"},{label:"2K to 5K",value:"2000<->5000"},{label:"< 2K",value:"0<->2000"}],_a=[{label:"< 60K",value:"0<->60000"},{label:"60K to 200K",value:"60000<->200000"},{label:"200K to 500K",value:"200000<->500000"},{label:"500K to 800K",value:"500000<->800000"},{label:"800K to 1M",value:"800000<->1000000"},{label:"> 1M",value:"1000000-10000000000"}],Va=[{label:"< 100K",value:"0<->100000"},{label:"100K to 500K",value:"100000<->500000"},{label:"500K to 1M",value:"500000<->1000000"},{label:"> 1M",value:"1000000<->10000000000"}],Ua=[{label:"< -500K",value:"-10000000000<->-500000"},{label:"-500K to -100K",value:"-500000<->-100000"},{label:"-100K to 0",value:"-100000<->0"},{label:"0 to 100K",value:"0<->100000"},{label:"> 100K",value:"100000<->10000000000"}],Ha=[{label:"< 10K",value:"-10000000000<->10000"},{label:"10K to 100K",value:"10000<->100000"},{label:"100K to 500K",value:"100000<->500000"},{label:"500K to 2M",value:"500000<->2000000"},{label:"2M to 5M",value:"2000000<->5000000"},{label:"5M to 25M",value:"5000000<->25000000"},{label:"> 25M",value:"25000000<->10000000000"}],Ka=[{label:"< 10K",value:"0<->10000"},{label:"10K to 50K",value:"10000<->50000"},{label:"50K to 100K",value:"50000<->100000"},{label:"100K to 300K",value:"100000<->300000"},{label:"300K to 500K",value:"300000<->500000"},{label:"500K to 1M",value:"500000<->1000000"},{label:"> 1M",value:"1000000<->10000000000"}],Ga=[{label:"< 5K",value:"-10000000000<->5000"},{label:"5K to 25K",value:"5000<->25000"},{label:"25K to 100K",value:"25000<->100000"},{label:"100K to 500K",value:"100000<->500000"},{label:"> 500K",value:"500000<->10000000000"}],Ya=[{label:"<= 3 months",value:"0<->3",iconColor:t.Colors.runwayRed},{label:"<= 1 year",value:"4<->12",iconColor:t.Colors.runwayYellow},{label:"> 1 year",value:"13<->1000000",iconColor:t.Colors.runwayGreen}],Za=[{label:"ZBP",value:"billpay"},{label:"ZA",value:"accounts"},{label:"ZR",value:"reimbursement"},{label:"ZC",value:"cards"},{label:"Tax",value:"zeni_tax_plan"},{label:"Payroll",value:"payroll_manager_service_plan"},{label:"CFO",value:"cfo_plan"}],Xa=[{label:"0",value:"0"},{label:"10",value:"10"},{label:"20",value:"20"},{label:"30",value:"30"},{label:"40",value:"40"},{label:"50",value:"50"},{label:"60",value:"60"},{label:"70",value:"70"},{label:"80",value:"80"},{label:"90",value:"90"},{label:"100",value:"100"}],qa=[{label:"1",value:"1"},{label:"2",value:"2"},{label:"3",value:"3"},{label:"4",value:"4"},{label:"5",value:"5"},{label:"6",value:"6"},{label:"7",value:"7"},{label:"8",value:"8"},{label:"9",value:"9"},{label:"10",value:"10"}],Qa=[{label:"1",value:"1"},{label:"2",value:"2"},{label:"3",value:"3"},{label:"4",value:"4"},{label:"5",value:"5"}],Ja=[{label:"<= 1 month",value:"0<->1"},{label:"1 to 3 months",value:"1<->3"},{label:"3 to 6 months",value:"3<->6"},{label:"6 to 12 months",value:"6<->12"},{label:"1 to 5 years",value:"12<->60"},{label:"5 to 10 years",value:"60<->120"},{label:"> 10 year",value:"121<->1000000"}],ui=[1,2,3,4,5,6,7,8,9,10],mi=[1,2,3,4,5],el=e=>{const{cockpit:{titles:n}}=t.appLocale.getLocalizedStrings();switch(e){case"management":case"subscription":case"portfolio":case"onboarding":case"audit":return e;case"aiAccountant":return n.aiAccountant;default:return n.healthMonitor}},tl=e=>{switch(e){case"management":return"Cockpit - Management";case"subscription":return"Cockpit - Subscription";case"portfolio":return"Cockpit - Portfolio";case"onboarding":return"Cockpit - Onboarding";case"audit":return"Cockpit - Audit";case"aiAccountant":return"Cockpit - AI Accountant";default:return"Cockpit - Health Monitor"}},ol=[{value:"enrollmentStatus",multiple:!0}],nl=({downloadCockpitOptions:e})=>o.jsxRuntimeExports.jsx(t.SimpleDownloadMenuButton,{downloadMenuItems:e.downloadMenu.simpleMenuItems,onDownloadClick:e.downloadMenu.onDownloadClick});function sl(e){const[n,r]=u.useState(!1),{analytics:i,updateDownloadStateHandler:a,downloadState:d,currentCockpitTab:l}=e;return u.useEffect(()=>{async function c(){await Ma({...e}),a("Completed"),i.trackDownload(tl(l),"months","excel",!1)}n&&e.downloadState!=="In-Progress"&&(r(!1),a("In-Progress"),c())},[d,n,a,i,e,l]),o.jsxRuntimeExports.jsx(rl,{"data-testid":t.generateDataTestId("cockpit-download-button"),children:o.jsxRuntimeExports.jsx(nl,{downloadCockpitOptions:{type:"simple_menu",downloadMenu:{simpleMenuItems:[{type:"excel",isDownloading:e.downloadState==="In-Progress"}],onDownloadClick:async c=>{if(c==="excel"){if(e.downloadState==="In-Progress")return;r(!0)}}}}})})}const rl=s.div``,bs=s.div`
124
+ `;function Oa(e){if(e.tabsFileType!=null)return{locale_id:t.appLocale.getAppLocaleID(),tabs_file_type:e.tabsFileType,tabs:e.tabs,filter_by_tabs:e.filterByTabs,time_zone:e.timezone}}function Na(e){const{tabs:n,filterByTabs:r,tabsFileType:i,timezone:a}=e.defaultOptions;return{tabsFileType:i,tabs:n,filterByTabs:r,timezone:a}}function Ma(e){const n=Na(e);return za(e.downloadParams.cockpitEndPoint,e.downloadParams.authParams,n)}async function za(e,n,r){const i=`${e}?query=${encodeURIComponent(JSON.stringify(Oa(r)))}`,{cockpit:a,download:d}=t.appLocale.getLocalizedStrings();try{if(r.tabsFileType==null)throw new Error(d.errorMessages.unsupportedFileType);const l=await t.fetchRequest({urlEndPoint:i,authParams:n,fileType:r.tabsFileType});if(l.ok){const c=t.getFileNameFromResponseHeaders(l.headers,a.defaultFileName),p=await l.arrayBuffer();o.fileDownload(p,c)}else console.error(`${d.errorMessages.fileDownloadError.replace("__feature__",a.cockpitHeader)} ${l.statusText}`)}catch(l){console.error(`${d.errorMessages.fileDownloadError.replace("__feature__",a.cockpitHeader)} ${JSON.stringify(l)}`)}}const Ie=88,Nt=58,Mt=1,zt=55,Fa=10,Wa=5,xt=["management","subscription","portfolio","onboarding","audit","healthMonitor","taskManager","aiAccountant"],ai=[{value:"controllerUserIds",multiple:!0,type:"user"},{value:"customerSuccessManagerUserIds",multiple:!0,type:"user"},{value:"preparerUserIds",multiple:!0,type:"user"},{value:"reviewerUserIds",multiple:!0,type:"user"},{value:"apAnalystUserIds",multiple:!0,type:"user"},{value:"taxLeadUserIds",multiple:!0,type:"user"},{value:"plans",multiple:!0},{value:"companyGroupId"},{value:"taxStatusCode"},{value:"statusCode"},{value:"annualRecurringRevenue"},{value:"monthlyRecurringRevenue"},{value:"customerSatisfaction",type:"rating"},{value:"zeniSatisfaction",type:"rating"}],li=[{value:"controllerUserIds",multiple:!0,type:"user"},{value:"statusCode"},{value:"recommendedActionCode"},{value:"monthlyRecurringRevenue"},{value:"subscriptionPlans",multiple:!0},{value:"subscriptionAddOns",multiple:!0},{value:"avg2MonthExpenses"},{value:"slabLowerLimit"},{value:"slabUpperLimit"}],ci=[{value:"netBurnOrIncome"},{value:"cashPosition"},{value:"expenses"},{value:"income"},{value:"runway",type:"runway"}],di=[{value:"controller",multiple:!0,type:"user"},{value:"customerSuccessManager",multiple:!0,type:"user"},{value:"churnProbabilityPercentage",type:"dropdownRange"},{value:"runway",type:"runway"},{value:"netPromoterScore",type:"dropdownRange"},{value:"customerSatisfactionScore",type:"dropdownRange"},{value:"lastReportSent",type:"dateRange"},{value:"subscriptionRenewalDate",type:"dateRange"},{value:"subscriptionStartDate",type:"dateRange"},{value:"verticalProductServices"},{value:"monthlyRecurringRevenue"},{value:"companyGroupId"},{value:"externalProductServiceExposure"},{value:"companyEngagementMetricsUpdatedAt",type:"dateRange"}],Ba=[{label:"< 200K",value:"0<->200000"},{label:"75K to 100K",value:"75000<->100000"},{label:"25K to 75K",value:"25000<->75000"},{label:"< 25K",value:"0<->25000"}],ds=[{label:"< 10K",value:"0<->10000"},{label:"5K to 8K",value:"5000<->8000"},{label:"2K to 5K",value:"2000<->5000"},{label:"< 2K",value:"0<->2000"}],_a=[{label:"< 60K",value:"0<->60000"},{label:"60K to 200K",value:"60000<->200000"},{label:"200K to 500K",value:"200000<->500000"},{label:"500K to 800K",value:"500000<->800000"},{label:"800K to 1M",value:"800000<->1000000"},{label:"> 1M",value:"1000000-10000000000"}],Va=[{label:"< 100K",value:"0<->100000"},{label:"100K to 500K",value:"100000<->500000"},{label:"500K to 1M",value:"500000<->1000000"},{label:"> 1M",value:"1000000<->10000000000"}],Ua=[{label:"< -500K",value:"-10000000000<->-500000"},{label:"-500K to -100K",value:"-500000<->-100000"},{label:"-100K to 0",value:"-100000<->0"},{label:"0 to 100K",value:"0<->100000"},{label:"> 100K",value:"100000<->10000000000"}],Ha=[{label:"< 10K",value:"-10000000000<->10000"},{label:"10K to 100K",value:"10000<->100000"},{label:"100K to 500K",value:"100000<->500000"},{label:"500K to 2M",value:"500000<->2000000"},{label:"2M to 5M",value:"2000000<->5000000"},{label:"5M to 25M",value:"5000000<->25000000"},{label:"> 25M",value:"25000000<->10000000000"}],Ka=[{label:"< 10K",value:"0<->10000"},{label:"10K to 50K",value:"10000<->50000"},{label:"50K to 100K",value:"50000<->100000"},{label:"100K to 300K",value:"100000<->300000"},{label:"300K to 500K",value:"300000<->500000"},{label:"500K to 1M",value:"500000<->1000000"},{label:"> 1M",value:"1000000<->10000000000"}],Ga=[{label:"< 5K",value:"-10000000000<->5000"},{label:"5K to 25K",value:"5000<->25000"},{label:"25K to 100K",value:"25000<->100000"},{label:"100K to 500K",value:"100000<->500000"},{label:"> 500K",value:"500000<->10000000000"}],Ya=[{label:"<= 3 months",value:"0<->3",iconColor:t.Colors.runwayRed},{label:"<= 1 year",value:"4<->12",iconColor:t.Colors.runwayYellow},{label:"> 1 year",value:"13<->1000000",iconColor:t.Colors.runwayGreen}],Za=[{label:"ZBP",value:"billpay"},{label:"ZA",value:"accounts"},{label:"ZR",value:"reimbursement"},{label:"ZC",value:"cards"},{label:"Tax",value:"zeni_tax_plan"},{label:"Payroll",value:"payroll_manager_service_plan"},{label:"CFO",value:"cfo_plan"}],Xa=[{label:"0",value:"0"},{label:"10",value:"10"},{label:"20",value:"20"},{label:"30",value:"30"},{label:"40",value:"40"},{label:"50",value:"50"},{label:"60",value:"60"},{label:"70",value:"70"},{label:"80",value:"80"},{label:"90",value:"90"},{label:"100",value:"100"}],qa=[{label:"1",value:"1"},{label:"2",value:"2"},{label:"3",value:"3"},{label:"4",value:"4"},{label:"5",value:"5"},{label:"6",value:"6"},{label:"7",value:"7"},{label:"8",value:"8"},{label:"9",value:"9"},{label:"10",value:"10"}],Qa=[{label:"1",value:"1"},{label:"2",value:"2"},{label:"3",value:"3"},{label:"4",value:"4"},{label:"5",value:"5"}],Ja=[{label:"<= 1 month",value:"0<->1"},{label:"1 to 3 months",value:"1<->3"},{label:"3 to 6 months",value:"3<->6"},{label:"6 to 12 months",value:"6<->12"},{label:"1 to 5 years",value:"12<->60"},{label:"5 to 10 years",value:"60<->120"},{label:"> 10 year",value:"121<->1000000"}],pi=[1,2,3,4,5,6,7,8,9,10],ui=[1,2,3,4,5],el=e=>{const{cockpit:{titles:n}}=t.appLocale.getLocalizedStrings();switch(e){case"management":case"subscription":case"portfolio":case"onboarding":case"audit":return e;case"aiAccountant":return n.aiAccountant;default:return n.healthMonitor}},tl=e=>{switch(e){case"management":return"Cockpit - Management";case"subscription":return"Cockpit - Subscription";case"portfolio":return"Cockpit - Portfolio";case"onboarding":return"Cockpit - Onboarding";case"audit":return"Cockpit - Audit";case"aiAccountant":return"Cockpit - AI Accountant";default:return"Cockpit - Health Monitor"}},ol=[{value:"enrollmentStatus",multiple:!0}],nl=({downloadCockpitOptions:e})=>o.jsxRuntimeExports.jsx(t.SimpleDownloadMenuButton,{downloadMenuItems:e.downloadMenu.simpleMenuItems,onDownloadClick:e.downloadMenu.onDownloadClick});function sl(e){const[n,r]=u.useState(!1),{analytics:i,updateDownloadStateHandler:a,downloadState:d,currentCockpitTab:l}=e;return u.useEffect(()=>{async function c(){await Ma({...e}),a("Completed"),i.trackDownload(tl(l),"months","excel",!1)}n&&e.downloadState!=="In-Progress"&&(r(!1),a("In-Progress"),c())},[d,n,a,i,e,l]),o.jsxRuntimeExports.jsx(rl,{"data-testid":t.generateDataTestId("cockpit-download-button"),children:o.jsxRuntimeExports.jsx(nl,{downloadCockpitOptions:{type:"simple_menu",downloadMenu:{simpleMenuItems:[{type:"excel",isDownloading:e.downloadState==="In-Progress"}],onDownloadClick:async c=>{if(c==="excel"){if(e.downloadState==="In-Progress")return;r(!0)}}}}})})}const rl=s.div``,bs=s.div`
125
125
  width: 100%;
126
126
  flex-direction: column;
127
127
  display: flex;
@@ -190,7 +190,7 @@
190
190
  height: ${t.Space.sp3};
191
191
  align-items: center;
192
192
  justify-content: center;
193
- `,ml=s.div``,{cockpit:mn,common:xl}=t.appLocale.getLocalizedStrings();function hl({defaultOptions:e,downloadState:n,downloadParams:r,signedInUser:i,cockpitHeader:a,analytics:d,currentTab:l,updateDownloadStateHandler:c,onZeniLogoClick:p,onLogOutClick:m,onThreadClick:h,onNotificationClick:S,onNewCustomerClick:x}){const C=t.useWindowSizeContext(),[b,f]=u.useState(!1),[g,j]=u.useState(!1),{inboxNotifications:y,isLoading:$,isFetchingMore:w,hasFetchedAll:O,fetchMore:A}=Ze.useInboxNotifications(),{threads:v,isLoading:T}=t.useFilteredThreads({application:"cockpit",isGlobalComment:!0},"both",!0),I=u.useMemo(()=>v.filter(D=>D.resolved===!1),[v]).length,{setOpenThread:K,setRequestToOpenThread:M,openThread:Y}=u.useContext(t.ThreadsContext);u.useEffect(()=>{const D=setTimeout(()=>A?.(),0);return()=>clearTimeout(D)});const G=$||w===!0||O!==!0,E=y?.filter(D=>D.readAt==null&&D.roomId?.includes("cockpit")===!0).length,P=el(l),W=u.useCallback((D,z)=>{const{companyId:Z,entityType:ie}=D;Y===z?K(null):(f(!1),M({threadId:z,companyId:Z,entityType:ie}))},[Y,K,M]),k=u.useCallback((D,z)=>{const{companyId:Z,entityType:ie}=D;Y===z?K(null):(j(!1),M({threadId:z,companyId:Z,entityType:ie}))},[Y,K,M]);return C!=="small"?o.jsxRuntimeExports.jsxs(bs,{children:[o.jsxRuntimeExports.jsxs(Rs,{children:[o.jsxRuntimeExports.jsx(cl,{children:o.jsxRuntimeExports.jsx(ll,{"data-testid":t.generateDataTestId("zeni-logo-cockpit-nav-bar"),onClick:p})}),o.jsxRuntimeExports.jsx(il,{children:a??mn.cockpitHeader}),o.jsxRuntimeExports.jsxs(dl,{children:[o.jsxRuntimeExports.jsxs($s,{isDisabled:T,onClick:T?()=>null:()=>f(!0),children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:T?void 0:I,isLoading:T,style:{left:"12px"}}),o.jsxRuntimeExports.jsx(pl,{})]}),o.jsxRuntimeExports.jsxs($s,{isDisabled:G,onClick:G?()=>null:()=>j(!0),children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:E,isLoading:G,style:{left:"12px"}}),o.jsxRuntimeExports.jsx(ul,{})]}),o.jsxRuntimeExports.jsx(sl,{defaultOptions:e,downloadParams:r,downloadState:n,analytics:d,currentCockpitTab:P,updateDownloadStateHandler:c}),o.jsxRuntimeExports.jsx(t.Button,{variant:"primary",size:"small",style:{whiteSpace:"nowrap"},label:mn.newCustomer,onClick:x}),o.jsxRuntimeExports.jsx(al,{children:o.jsxRuntimeExports.jsx(t.LogoutButton,{signedInUser:i,pageName:"Cockpit",onLogOutClick:m})})]})]}),o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:b,filter:{application:"cockpit",isGlobalComment:!0},autoExpand:!0,autoFocus:!1,drawerTitle:xl.headers.comments,onCloseAllThreadsDrawer:()=>f(!1),onThreadClick:(D,z)=>{h(D,z,W)},style:{cursor:"pointer"},showReactions:!0,showActions:!0,allowExpand:!0,threads:v,isLoading:T,allowComposer:!1,textOverrides:{},withRoomProvider:!0}),o.jsxRuntimeExports.jsx(ja,{application:"cockpit",isDrawerOpen:g,onNotificationClick:(D,z)=>{S(D,z,k)},onCloseAllInboxNotificationsDrawer:()=>j(!1)})]}):o.jsxRuntimeExports.jsx(bs,{className:"mobileHeader",children:o.jsxRuntimeExports.jsxs(Rs,{className:"mobileTitle",children:[o.jsxRuntimeExports.jsx(t.Button,{variant:"primary",size:"small",style:{whiteSpace:"nowrap"},label:mn.newCustomer,onClick:x}),o.jsxRuntimeExports.jsx(ml,{children:o.jsxRuntimeExports.jsx(t.LogoutButton,{signedInUser:i,pageName:"Cockpit",onLogOutClick:m})})]})})}const us=["management","subscription","portfolio","onboarding","audit","healthMonitor","taskManager","aiAccountant"],Ct=e=>ee.stringToUnion(e,us),gl=e=>ee.stringToUnionStrict(e,us),Sl=(e,n)=>e in n,xi=e=>{switch(e){case"management":return li;case"subscription":return ci;case"portfolio":return di;case"healthMonitor":return pi;case"aiAccountant":return ol;default:return[]}},es=(e,n)=>{const{cockpit:{filters:{filterCategories:r}}}=t.appLocale.getLocalizedStrings();switch(e){case"management":return r.management[n];case"portfolio":return r.portfolio[n];case"subscription":return r.subscription[n];case"aiAccountant":return r.aiAccountant[n];case"healthMonitor":default:return r.healthMonitor[n]}},yl=s.div`
193
+ `,ml=s.div``,{cockpit:un,common:xl}=t.appLocale.getLocalizedStrings();function hl({defaultOptions:e,downloadState:n,downloadParams:r,signedInUser:i,cockpitHeader:a,analytics:d,currentTab:l,updateDownloadStateHandler:c,onZeniLogoClick:p,onLogOutClick:m,onThreadClick:h,onNotificationClick:S,onNewCustomerClick:x}){const C=t.useWindowSizeContext(),[b,f]=u.useState(!1),[g,j]=u.useState(!1),{inboxNotifications:y,isLoading:$,isFetchingMore:w,hasFetchedAll:O,fetchMore:A}=Ze.useInboxNotifications(),{threads:v,isLoading:T}=t.useFilteredThreads({application:"cockpit",isGlobalComment:!0},"both",!0),I=u.useMemo(()=>v.filter(D=>D.resolved===!1),[v]).length,{setOpenThread:K,setRequestToOpenThread:M,openThread:Y}=u.useContext(t.ThreadsContext);u.useEffect(()=>{const D=setTimeout(()=>A?.(),0);return()=>clearTimeout(D)});const G=$||w===!0||O!==!0,E=y?.filter(D=>D.readAt==null&&D.roomId?.includes("cockpit")===!0).length,P=el(l),W=u.useCallback((D,z)=>{const{companyId:Z,entityType:ie}=D;Y===z?K(null):(f(!1),M({threadId:z,companyId:Z,entityType:ie}))},[Y,K,M]),k=u.useCallback((D,z)=>{const{companyId:Z,entityType:ie}=D;Y===z?K(null):(j(!1),M({threadId:z,companyId:Z,entityType:ie}))},[Y,K,M]);return C!=="small"?o.jsxRuntimeExports.jsxs(bs,{children:[o.jsxRuntimeExports.jsxs(Rs,{children:[o.jsxRuntimeExports.jsx(cl,{children:o.jsxRuntimeExports.jsx(ll,{"data-testid":t.generateDataTestId("zeni-logo-cockpit-nav-bar"),onClick:p})}),o.jsxRuntimeExports.jsx(il,{children:a??un.cockpitHeader}),o.jsxRuntimeExports.jsxs(dl,{children:[o.jsxRuntimeExports.jsxs($s,{isDisabled:T,onClick:T?()=>null:()=>f(!0),children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:T?void 0:I,isLoading:T,style:{left:"12px"}}),o.jsxRuntimeExports.jsx(pl,{})]}),o.jsxRuntimeExports.jsxs($s,{isDisabled:G,onClick:G?()=>null:()=>j(!0),children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:E,isLoading:G,style:{left:"12px"}}),o.jsxRuntimeExports.jsx(ul,{})]}),o.jsxRuntimeExports.jsx(sl,{defaultOptions:e,downloadParams:r,downloadState:n,analytics:d,currentCockpitTab:P,updateDownloadStateHandler:c}),o.jsxRuntimeExports.jsx(t.Button,{variant:"primary",size:"small",style:{whiteSpace:"nowrap"},label:un.newCustomer,onClick:x}),o.jsxRuntimeExports.jsx(al,{children:o.jsxRuntimeExports.jsx(t.LogoutButton,{signedInUser:i,pageName:"Cockpit",onLogOutClick:m})})]})]}),o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:b,filter:{application:"cockpit",isGlobalComment:!0},autoExpand:!0,autoFocus:!1,drawerTitle:xl.headers.comments,onCloseAllThreadsDrawer:()=>f(!1),onThreadClick:(D,z)=>{h(D,z,W)},style:{cursor:"pointer"},showReactions:!0,showActions:!0,allowExpand:!0,threads:v,isLoading:T,allowComposer:!1,textOverrides:{},withRoomProvider:!0}),o.jsxRuntimeExports.jsx(ja,{application:"cockpit",isDrawerOpen:g,onNotificationClick:(D,z)=>{S(D,z,k)},onCloseAllInboxNotificationsDrawer:()=>j(!1)})]}):o.jsxRuntimeExports.jsx(bs,{className:"mobileHeader",children:o.jsxRuntimeExports.jsxs(Rs,{className:"mobileTitle",children:[o.jsxRuntimeExports.jsx(t.Button,{variant:"primary",size:"small",style:{whiteSpace:"nowrap"},label:un.newCustomer,onClick:x}),o.jsxRuntimeExports.jsx(ml,{children:o.jsxRuntimeExports.jsx(t.LogoutButton,{signedInUser:i,pageName:"Cockpit",onLogOutClick:m})})]})})}const ps=["management","subscription","portfolio","onboarding","audit","healthMonitor","taskManager","aiAccountant"],jt=e=>J.stringToUnion(e,ps),gl=e=>J.stringToUnionStrict(e,ps),Sl=(e,n)=>e in n,mi=e=>{switch(e){case"management":return ai;case"subscription":return li;case"portfolio":return ci;case"healthMonitor":return di;case"aiAccountant":return ol;default:return[]}},Jn=(e,n)=>{const{cockpit:{filters:{filterCategories:r}}}=t.appLocale.getLocalizedStrings();switch(e){case"management":return r.management[n];case"portfolio":return r.portfolio[n];case"subscription":return r.subscription[n];case"aiAccountant":return r.aiAccountant[n];case"healthMonitor":default:return r.healthMonitor[n]}},yl=s.div`
194
194
  display: flex;
195
195
  justify-content: space-between;
196
196
  align-items: center;
@@ -198,7 +198,7 @@
198
198
  color: ${e=>e.theme.colors.primary};
199
199
  width: ${t.Space.sp4};
200
200
  height: ${t.Space.sp4};
201
- `,Es=({onChange:e,value:n,categoryIndex:r,defaultMenuIsOpen:i=!1,selectedCockpitOption:a})=>{const d=o.useTheme(),l=u.useRef(null),c=t.getDropdownStyles(d),p=xi(a),m=p.find(x=>x.value===n);u.useEffect(()=>{const x=setTimeout(()=>{l.current!=null&&i&&l.current.focus()},300);return()=>{clearTimeout(x)}},[i]);const h=x=>{const C=es(a,x.data.value);return o.jsxRuntimeExports.jsx(o.components.SingleValue,{...x,children:o.jsxRuntimeExports.jsx(t.StandardRegularSp,{children:C})})},S=x=>{const{isSelected:C}=x,b=es(a,x.data.value);return o.jsxRuntimeExports.jsx(o.components.Option,{...x,children:o.jsxRuntimeExports.jsxs(yl,{"data-testid":t.generateDataTestId("cockpit-filters-category-option",typeof x.data.value=="string"?x.data.value:x.data.value?.code??x.data.value?.id??x.label),children:[o.jsxRuntimeExports.jsx(t.StandardRegular,{children:b}),C&&o.jsxRuntimeExports.jsx(fl,{})]})})};return o.jsxRuntimeExports.jsx(Cl,{"data-testid":t.generateDataTestId("cockpit-filters-category-select"),children:o.jsxRuntimeExports.jsx(o.StateManagedSelect$1,{ref:l,isMulti:!1,value:m,onChange:x=>{e(x,r)},placeholder:t.appLocale.getLocalizedStrings().cockpit.filters.categoryPlaceholder,options:p,styles:c,menuPosition:"fixed",openMenuOnFocus:!0,components:{Option:S,SingleValue:h}})})},Cl=s.div``,jl=({selectedRanges:e,options:n,onNumericRangeChange:r})=>{const i=t.useWindowSizeContext(),a=o.useTheme(),d=e.start,l=e.end,[c,p]=u.useState(d),[m,h]=u.useState(l),[S,x]=u.useState(n);u.useEffect(()=>{c!=null&&m!=null&&(r({start:c,end:m}),c>m&&h(c)),c!=null?x(n.filter(g=>g>=c)):x(n)},[c,m]);const C=g=>{p(g)},b=g=>{h(g)},f=t.appLocale.getLocalizedStrings().spendManagement.filters;return o.jsxRuntimeExports.jsxs(bl,{size:i,children:[o.jsxRuntimeExports.jsx(ws,{children:o.jsxRuntimeExports.jsx(t.SingleSelectNumeric,{onSelectedValueChanged:C,placeholder:f.from,defaultValue:{allOptions:n,selectedOption:c},hasError:!1,customStyleConfig:{input:()=>({input:{textAlign:"left"}}),control:()=>({backgroundColor:a.colors.background})}})}),o.jsxRuntimeExports.jsx(Rl,{children:f.enDash}),o.jsxRuntimeExports.jsx(ws,{children:o.jsxRuntimeExports.jsx(t.SingleSelectNumeric,{onSelectedValueChanged:b,placeholder:f.to,defaultValue:{allOptions:S,selectedOption:m},hasError:!1,customStyleConfig:{input:()=>({input:{textAlign:"left"}}),control:()=>({backgroundColor:a.colors.background})}})})]})},bl=s.div`
201
+ `,Es=({onChange:e,value:n,categoryIndex:r,defaultMenuIsOpen:i=!1,selectedCockpitOption:a})=>{const d=o.useTheme(),l=u.useRef(null),c=t.getDropdownStyles(d),p=mi(a),m=p.find(x=>x.value===n);u.useEffect(()=>{const x=setTimeout(()=>{l.current!=null&&i&&l.current.focus()},300);return()=>{clearTimeout(x)}},[i]);const h=x=>{const C=Jn(a,x.data.value);return o.jsxRuntimeExports.jsx(o.components.SingleValue,{...x,children:o.jsxRuntimeExports.jsx(t.StandardRegularSp,{children:C})})},S=x=>{const{isSelected:C}=x,b=Jn(a,x.data.value);return o.jsxRuntimeExports.jsx(o.components.Option,{...x,children:o.jsxRuntimeExports.jsxs(yl,{"data-testid":t.generateDataTestId("cockpit-filters-category-option",typeof x.data.value=="string"?x.data.value:x.data.value?.code??x.data.value?.id??x.label),children:[o.jsxRuntimeExports.jsx(t.StandardRegular,{children:b}),C&&o.jsxRuntimeExports.jsx(fl,{})]})})};return o.jsxRuntimeExports.jsx(Cl,{"data-testid":t.generateDataTestId("cockpit-filters-category-select"),children:o.jsxRuntimeExports.jsx(o.StateManagedSelect$1,{ref:l,isMulti:!1,value:m,onChange:x=>{e(x,r)},placeholder:t.appLocale.getLocalizedStrings().cockpit.filters.categoryPlaceholder,options:p,styles:c,menuPosition:"fixed",openMenuOnFocus:!0,components:{Option:S,SingleValue:h}})})},Cl=s.div``,jl=({selectedRanges:e,options:n,onNumericRangeChange:r})=>{const i=t.useWindowSizeContext(),a=o.useTheme(),d=e.start,l=e.end,[c,p]=u.useState(d),[m,h]=u.useState(l),[S,x]=u.useState(n);u.useEffect(()=>{c!=null&&m!=null&&(r({start:c,end:m}),c>m&&h(c)),c!=null?x(n.filter(g=>g>=c)):x(n)},[c,m]);const C=g=>{p(g)},b=g=>{h(g)},f=t.appLocale.getLocalizedStrings().spendManagement.filters;return o.jsxRuntimeExports.jsxs(bl,{size:i,children:[o.jsxRuntimeExports.jsx(ws,{children:o.jsxRuntimeExports.jsx(t.SingleSelectNumeric,{onSelectedValueChanged:C,placeholder:f.from,defaultValue:{allOptions:n,selectedOption:c},hasError:!1,customStyleConfig:{input:()=>({input:{textAlign:"left"}}),control:()=>({backgroundColor:a.colors.background})}})}),o.jsxRuntimeExports.jsx(Rl,{children:f.enDash}),o.jsxRuntimeExports.jsx(ws,{children:o.jsxRuntimeExports.jsx(t.SingleSelectNumeric,{onSelectedValueChanged:b,placeholder:f.to,defaultValue:{allOptions:S,selectedOption:m},hasError:!1,customStyleConfig:{input:()=>({input:{textAlign:"left"}}),control:()=>({backgroundColor:a.colors.background})}})})]})},bl=s.div`
202
202
  display: flex;
203
203
  align-items: center;
204
204
  column-gap: ${t.Space.sp3};
@@ -350,14 +350,14 @@
350
350
  align-items: flex-start;
351
351
  column-gap: ${t.Space.sp3};
352
352
  animation: ${Zl} 0.4s;
353
- `,hi=u.forwardRef(({filters:e,onFiltersChange:n,filterValues:r,selectedCockpitOption:i},a)=>{const d=u.useCallback((f,g)=>{const j=t.getUpdatedFiltersOnCategoryChange({currentFilters:e,selectedOption:f,categoryIndex:g});n(j)},[e,n]),l=u.useCallback((f,g)=>{const j=t.getUpdatedFiltersOnMatchingOperatorChange({currentFilters:e,selectedOption:f,categoryIndex:g});n(j)},[e,n]),c=u.useCallback((f,g)=>{if(e.categories==null)return;const j={...e,categories:e.categories.map((y,$)=>$!=g?y:{...y,valuesCombinationOperator:f.value})};n(j)},[e,n]),p=u.useCallback(f=>{if(e!=null){const g={...e,categoryCombinationOperator:f};n(g)}},[e,n]),m=u.useCallback(f=>{if(f===0&&e.categories!=null&&e.categories.length===1){n({});return}if(e.categories!=null){if([...e.categories.slice(0,f),...e.categories.slice(f+1)].filter(j=>j.field!=null).length){const j={...e,categories:[...e.categories.slice(0,f),...e.categories.slice(f+1)]};n(j);return}n({})}},[n,e]),h=()=>{e.categories!=null&&n({...e,categories:[...e.categories,{...t.NEW_CATEGORY_BODY}]})},S=()=>{n({})},x=u.useCallback((f,g)=>{const j=t.getUpdatedFiltersOnValueChange({currentFilters:e,selectedOptions:f,categoryIndex:g});n(j)},[e,n]),C=()=>e.categories!=null?o.jsxRuntimeExports.jsxs(Ul,{children:[o.jsxRuntimeExports.jsxs(Is,{onClick:h,"data-testid":t.generateDataTestId("cockpit-filters-add-button"),children:[o.jsxRuntimeExports.jsx(Bl,{}),o.jsxRuntimeExports.jsx(t.StandardRegular,{children:t.appLocale.getLocalizedStrings().cockpit.filters.addFilterBtnText})]}),o.jsxRuntimeExports.jsxs(Is,{onClick:S,"data-testid":t.generateDataTestId("cockpit-filters-clear-all-button"),children:[o.jsxRuntimeExports.jsx(_l,{}),o.jsxRuntimeExports.jsx(t.StandardRegular,{children:t.appLocale.getLocalizedStrings().cockpit.filters.clearAllBtnText})]})]}):null,b=()=>e.categories==null?o.jsxRuntimeExports.jsx(ks,{"data-testid":t.generateDataTestId("cockpit-filters-empty-state"),children:o.jsxRuntimeExports.jsx(Ts,{children:o.jsxRuntimeExports.jsxs(As,{children:[o.jsxRuntimeExports.jsx(Ls,{children:o.jsxRuntimeExports.jsx(Ds,{children:t.appLocale.getLocalizedStrings().cockpit.filters.filterByLabel})}),o.jsxRuntimeExports.jsx(Ps,{children:o.jsxRuntimeExports.jsx(Es,{defaultMenuIsOpen:!0,onChange:d,selectedCockpitOption:i})})]})})}):o.jsxRuntimeExports.jsx(u.Fragment,{children:e.categories.map((f,g)=>{const y=xi(i).find(v=>v.value===f.field),$=y?.multiple,w=y?.type,O=y!=null?es(i,y?.value):"",A=f.field??`${g}`;return o.jsxRuntimeExports.jsxs(Ts,{"data-testid":t.generateDataTestId("cockpit-filters-row",A),children:[o.jsxRuntimeExports.jsxs(As,{children:[o.jsxRuntimeExports.jsxs(Ls,{children:[g===0&&o.jsxRuntimeExports.jsx(Ds,{children:t.appLocale.getLocalizedStrings().cockpit.filters.filterByLabel}),g!==0?o.jsxRuntimeExports.jsx(Xl,{"data-testid":t.generateDataTestId("cockpit-filters-combination-operator",A),children:o.jsxRuntimeExports.jsx(t.CombinationOperatorButton,{categoryCombinationOperator:e.categoryCombinationOperator,onChange:p,buttonsDisabled:g>1})}):null]}),o.jsxRuntimeExports.jsx(Ps,{"data-testid":t.generateDataTestId("cockpit-filters-category-dropdown",A),children:o.jsxRuntimeExports.jsx(Es,{categoryIndex:g,value:f.field,onChange:d,selectedCockpitOption:i})})]}),f.field&&o.jsxRuntimeExports.jsxs(ql,{children:[o.jsxRuntimeExports.jsx(Vl,{"data-testid":t.generateDataTestId("cockpit-filters-matching-operator",A),children:o.jsxRuntimeExports.jsx(t.MatchingOperatorDropdown,{categoryIndex:g,value:f.matchingOperator,onChange:l})}),o.jsxRuntimeExports.jsxs(Gl,{children:[o.jsxRuntimeExports.jsx(Yl,{categoryType:w,"data-testid":t.generateDataTestId("cockpit-filters-values-dropdown",A),children:o.jsxRuntimeExports.jsx(Ml,{options:r[f.field]!=null?r[f.field]:[],value:f.values,categoryIndex:g,categoryType:w,categoryLabel:O,showAnyAll:$??!1,onChange:x,valuesCombinationOperator:f.valuesCombinationOperator,onValuesCombinationOperatorChange:c})}),o.jsxRuntimeExports.jsx(Hl,{onClick:()=>m(g),"data-testid":t.generateDataTestId("cockpit-filters-delete-row",A),children:o.jsxRuntimeExports.jsx(Kl,{})})]})]})]},f.field?f.field+g:g)})});return o.jsxRuntimeExports.jsxs(ks,{ref:a,"data-testid":t.generateDataTestId("cockpit-filters-selection-container"),children:[b(),C()]})});hi.displayName="FiltersSelection";const Ql=s.div`
353
+ `,xi=u.forwardRef(({filters:e,onFiltersChange:n,filterValues:r,selectedCockpitOption:i},a)=>{const d=u.useCallback((f,g)=>{const j=t.getUpdatedFiltersOnCategoryChange({currentFilters:e,selectedOption:f,categoryIndex:g});n(j)},[e,n]),l=u.useCallback((f,g)=>{const j=t.getUpdatedFiltersOnMatchingOperatorChange({currentFilters:e,selectedOption:f,categoryIndex:g});n(j)},[e,n]),c=u.useCallback((f,g)=>{if(e.categories==null)return;const j={...e,categories:e.categories.map((y,$)=>$!=g?y:{...y,valuesCombinationOperator:f.value})};n(j)},[e,n]),p=u.useCallback(f=>{if(e!=null){const g={...e,categoryCombinationOperator:f};n(g)}},[e,n]),m=u.useCallback(f=>{if(f===0&&e.categories!=null&&e.categories.length===1){n({});return}if(e.categories!=null){if([...e.categories.slice(0,f),...e.categories.slice(f+1)].filter(j=>j.field!=null).length){const j={...e,categories:[...e.categories.slice(0,f),...e.categories.slice(f+1)]};n(j);return}n({})}},[n,e]),h=()=>{e.categories!=null&&n({...e,categories:[...e.categories,{...t.NEW_CATEGORY_BODY}]})},S=()=>{n({})},x=u.useCallback((f,g)=>{const j=t.getUpdatedFiltersOnValueChange({currentFilters:e,selectedOptions:f,categoryIndex:g});n(j)},[e,n]),C=()=>e.categories!=null?o.jsxRuntimeExports.jsxs(Ul,{children:[o.jsxRuntimeExports.jsxs(Is,{onClick:h,"data-testid":t.generateDataTestId("cockpit-filters-add-button"),children:[o.jsxRuntimeExports.jsx(Bl,{}),o.jsxRuntimeExports.jsx(t.StandardRegular,{children:t.appLocale.getLocalizedStrings().cockpit.filters.addFilterBtnText})]}),o.jsxRuntimeExports.jsxs(Is,{onClick:S,"data-testid":t.generateDataTestId("cockpit-filters-clear-all-button"),children:[o.jsxRuntimeExports.jsx(_l,{}),o.jsxRuntimeExports.jsx(t.StandardRegular,{children:t.appLocale.getLocalizedStrings().cockpit.filters.clearAllBtnText})]})]}):null,b=()=>e.categories==null?o.jsxRuntimeExports.jsx(ks,{"data-testid":t.generateDataTestId("cockpit-filters-empty-state"),children:o.jsxRuntimeExports.jsx(Ts,{children:o.jsxRuntimeExports.jsxs(As,{children:[o.jsxRuntimeExports.jsx(Ls,{children:o.jsxRuntimeExports.jsx(Ds,{children:t.appLocale.getLocalizedStrings().cockpit.filters.filterByLabel})}),o.jsxRuntimeExports.jsx(Ps,{children:o.jsxRuntimeExports.jsx(Es,{defaultMenuIsOpen:!0,onChange:d,selectedCockpitOption:i})})]})})}):o.jsxRuntimeExports.jsx(u.Fragment,{children:e.categories.map((f,g)=>{const y=mi(i).find(v=>v.value===f.field),$=y?.multiple,w=y?.type,O=y!=null?Jn(i,y?.value):"",A=f.field??`${g}`;return o.jsxRuntimeExports.jsxs(Ts,{"data-testid":t.generateDataTestId("cockpit-filters-row",A),children:[o.jsxRuntimeExports.jsxs(As,{children:[o.jsxRuntimeExports.jsxs(Ls,{children:[g===0&&o.jsxRuntimeExports.jsx(Ds,{children:t.appLocale.getLocalizedStrings().cockpit.filters.filterByLabel}),g!==0?o.jsxRuntimeExports.jsx(Xl,{"data-testid":t.generateDataTestId("cockpit-filters-combination-operator",A),children:o.jsxRuntimeExports.jsx(t.CombinationOperatorButton,{categoryCombinationOperator:e.categoryCombinationOperator,onChange:p,buttonsDisabled:g>1})}):null]}),o.jsxRuntimeExports.jsx(Ps,{"data-testid":t.generateDataTestId("cockpit-filters-category-dropdown",A),children:o.jsxRuntimeExports.jsx(Es,{categoryIndex:g,value:f.field,onChange:d,selectedCockpitOption:i})})]}),f.field&&o.jsxRuntimeExports.jsxs(ql,{children:[o.jsxRuntimeExports.jsx(Vl,{"data-testid":t.generateDataTestId("cockpit-filters-matching-operator",A),children:o.jsxRuntimeExports.jsx(t.MatchingOperatorDropdown,{categoryIndex:g,value:f.matchingOperator,onChange:l})}),o.jsxRuntimeExports.jsxs(Gl,{children:[o.jsxRuntimeExports.jsx(Yl,{categoryType:w,"data-testid":t.generateDataTestId("cockpit-filters-values-dropdown",A),children:o.jsxRuntimeExports.jsx(Ml,{options:r[f.field]!=null?r[f.field]:[],value:f.values,categoryIndex:g,categoryType:w,categoryLabel:O,showAnyAll:$??!1,onChange:x,valuesCombinationOperator:f.valuesCombinationOperator,onValuesCombinationOperatorChange:c})}),o.jsxRuntimeExports.jsx(Hl,{onClick:()=>m(g),"data-testid":t.generateDataTestId("cockpit-filters-delete-row",A),children:o.jsxRuntimeExports.jsx(Kl,{})})]})]})]},f.field?f.field+g:g)})});return o.jsxRuntimeExports.jsxs(ks,{ref:a,"data-testid":t.generateDataTestId("cockpit-filters-selection-container"),children:[b(),C()]})});xi.displayName="FiltersSelection";const Ql=s.div`
354
354
  padding: ${t.Space.sp4};
355
355
  box-sizing: border-box;
356
356
  height: ${e=>`${typeof e.height=="number"?e.height+"px":e.height}`};
357
357
  background: ${e=>e.theme.colors.grey5};
358
358
  max-height: 650px;
359
359
  overflow: ${e=>e.height>"650"?"scroll":"visible"};
360
- `,Jl=({selectedCockpitOption:e,filters:n,disableFilters:r=!1,onFiltersChange:i,onSearchTextChanged:a,getCategoryWiseOptions:d,companiesLoaded:l=!0,filterText:c})=>{const p=u.useRef(null),[m,h]=u.useState(!1),S=u.useRef(!1),[x,C]=u.useState({management:{},portfolio:{},subscription:{},onboarding:{},audit:{},healthMonitor:{},taskManager:{},aiAccountant:{}}),[b,f]=u.useState(136),g=u.useRef(null),j=t.useWindowSizeContext(),y=u.useCallback(()=>{h(!1)},[]),$=u.useCallback(()=>{r===!1&&h(!0)},[r]);u.useEffect(()=>{d&&Object.keys(x[e]).length===0&&l&&C(v=>({...v,[e]:d()}))},[e,x,l]);const w=u.useCallback(()=>{if(n?.categories==null)return Ie;const v=g.current,T=v!=null?v.clientHeight:0;return t.sp[7]+(T>0?T:Ie)},[n]);u.useEffect(()=>{if(m!==S.current){f("auto");return}f(w())},[w,m]),u.useEffect(()=>{S.current=m},[m]),u.useEffect(()=>{b==="auto"&&f(w())},[b,w]);const O=()=>o.jsxRuntimeExports.jsx(t.FiltersPopover,{anchorEl:p.current,open:m,onClose:y,paperStyle:{overflow:"visible"},children:o.jsxRuntimeExports.jsx(Ql,{height:b,windowSize:j,"data-testid":t.generateDataTestId("cockpit-filters-selection-wrapper"),children:n&&o.jsxRuntimeExports.jsx(tc,{"data-testid":t.generateDataTestId("cockpit-filters-selection"),children:o.jsxRuntimeExports.jsx(hi,{filters:n,onFiltersChange:i,filterValues:x[e],selectedCockpitOption:e,ref:g})})})},n?.categories==null||n.categories.length===0?"smallBox":"largeBox"),A=n?.categories==null||n.categories.length===0?0:n.categories.filter(v=>v.field!=null&&v.values.length>0).length;return o.jsxRuntimeExports.jsxs(u.Fragment,{children:[o.jsxRuntimeExports.jsx(ec,{"data-testid":t.generateDataTestId("cockpit-filters-search-box"),children:o.jsxRuntimeExports.jsx(t.SearchBoxWithFilterButton,{isFilterBtnActive:m||A>0,searchPlaceholder:t.appLocale.getLocalizedStrings().cockpit.searchplaceholder,ref:p,isFilterDisabled:r,onSearchTextChanged:a,onFilterButtonClick:$,filtersCount:A,filterText:c})}),r!=!0&&O()]})},ec=s.div``,tc=s.div``,{common:{numbers:oc,strings:nc}}=t.appLocale.getLocalizedStrings(),sc=({onTabChange:e,allTabOptions:n,selectedOption:r,tabCounterDetails:i,getTitle:a})=>{const d=(c,p)=>{e(p)},l=c=>{let p=0;if(i?.forEach(m=>{m.tab===c&&(p=m.count)}),p!==0)return p<100?`${p}`:`${oc.maximumCount}${nc.plus}`};return o.jsxRuntimeExports.jsx(ic,{"data-testid":t.generateDataTestId("cockpit-nav-switcher"),children:o.jsxRuntimeExports.jsx(rc,{value:r,onChange:d,centered:!0,"data-testid":t.generateDataTestId("cockpit-nav-switcher-tabs"),children:n.map(c=>o.jsxRuntimeExports.jsx(ac,{count:l(c),label:a(c),disableRipple:!0,"data-testid":t.generateDataTestId("cockpit-nav-switcher-tab",c)},c))})})},rc=s(o.Tabs)`
360
+ `,Jl=({selectedCockpitOption:e,filters:n,disableFilters:r=!1,onFiltersChange:i,onSearchTextChanged:a,getCategoryWiseOptions:d,companiesLoaded:l=!0,filterText:c})=>{const p=u.useRef(null),[m,h]=u.useState(!1),S=u.useRef(!1),[x,C]=u.useState({management:{},portfolio:{},subscription:{},onboarding:{},audit:{},healthMonitor:{},taskManager:{},aiAccountant:{}}),[b,f]=u.useState(136),g=u.useRef(null),j=t.useWindowSizeContext(),y=u.useCallback(()=>{h(!1)},[]),$=u.useCallback(()=>{r===!1&&h(!0)},[r]);u.useEffect(()=>{d&&Object.keys(x[e]).length===0&&l&&C(v=>({...v,[e]:d()}))},[e,x,l]);const w=u.useCallback(()=>{if(n?.categories==null)return Ie;const v=g.current,T=v!=null?v.clientHeight:0;return t.sp[7]+(T>0?T:Ie)},[n]);u.useEffect(()=>{if(m!==S.current){f("auto");return}f(w())},[w,m]),u.useEffect(()=>{S.current=m},[m]),u.useEffect(()=>{b==="auto"&&f(w())},[b,w]);const O=()=>o.jsxRuntimeExports.jsx(t.FiltersPopover,{anchorEl:p.current,open:m,onClose:y,paperStyle:{overflow:"visible"},children:o.jsxRuntimeExports.jsx(Ql,{height:b,windowSize:j,"data-testid":t.generateDataTestId("cockpit-filters-selection-wrapper"),children:n&&o.jsxRuntimeExports.jsx(tc,{"data-testid":t.generateDataTestId("cockpit-filters-selection"),children:o.jsxRuntimeExports.jsx(xi,{filters:n,onFiltersChange:i,filterValues:x[e],selectedCockpitOption:e,ref:g})})})},n?.categories==null||n.categories.length===0?"smallBox":"largeBox"),A=n?.categories==null||n.categories.length===0?0:n.categories.filter(v=>v.field!=null&&v.values.length>0).length;return o.jsxRuntimeExports.jsxs(u.Fragment,{children:[o.jsxRuntimeExports.jsx(ec,{"data-testid":t.generateDataTestId("cockpit-filters-search-box"),children:o.jsxRuntimeExports.jsx(t.SearchBoxWithFilterButton,{isFilterBtnActive:m||A>0,searchPlaceholder:t.appLocale.getLocalizedStrings().cockpit.searchplaceholder,ref:p,isFilterDisabled:r,onSearchTextChanged:a,onFilterButtonClick:$,filtersCount:A,filterText:c})}),r!=!0&&O()]})},ec=s.div``,tc=s.div``,{common:{numbers:oc,strings:nc}}=t.appLocale.getLocalizedStrings(),sc=({onTabChange:e,allTabOptions:n,selectedOption:r,tabCounterDetails:i,getTitle:a})=>{const d=(c,p)=>{e(p)},l=c=>{let p=0;if(i?.forEach(m=>{m.tab===c&&(p=m.count)}),p!==0)return p<100?`${p}`:`${oc.maximumCount}${nc.plus}`};return o.jsxRuntimeExports.jsx(ic,{"data-testid":t.generateDataTestId("cockpit-nav-switcher"),children:o.jsxRuntimeExports.jsx(rc,{value:r,onChange:d,centered:!0,"data-testid":t.generateDataTestId("cockpit-nav-switcher-tabs"),children:n.map(c=>o.jsxRuntimeExports.jsx(ac,{count:l(c),label:a(c),disableRipple:!0,"data-testid":t.generateDataTestId("cockpit-nav-switcher-tab",c)},c))})})},rc=s(o.Tabs)`
361
361
  .MuiTabs-indicator {
362
362
  background-color: ${e=>e.theme.colors.primary};
363
363
  width: calc(100% - 20px);
@@ -395,7 +395,7 @@
395
395
  border-radius: ${t.Space.sp12};
396
396
  margin-left: 2px;
397
397
  }
398
- `,ht=({headerData:e,headerActions:n})=>{const{filterData:r,showBackButton:i=!1,allTabOptions:a,selectedTabOption:d,companiesLoaded:l,tabCounterDetails:c}=e,{onNavigateBack:p,onTabChange:m,filterActions:h}=n,S=h?.onFilterTextChanged,x=h?.onFiltersChange,C=y=>{let $="";return us.forEach(w=>{w===y&&($=t.appLocale.getLocalizedStrings().cockpit.titles[y])}),$.length!=0,$};let b=-1;a?.forEach((y,$)=>{y===d&&(b=$)}),b===-1&&d!=null&&console.warn("Selected unsupported tab option");const f=u.useCallback(y=>{d&&S?.(d,y)},[S,d]),g=u.useCallback(y=>{x&&d&&x(d,y)},[x,d]),j=y=>{const $=a?.[y];$!=null&&m?.($)};return o.jsxRuntimeExports.jsxs(xc,{"data-testid":t.generateDataTestId("cockpit-nav-header"),children:[o.jsxRuntimeExports.jsx(pc,{"data-testid":t.generateDataTestId("cockpit-nav-header-back-button"),onClick:()=>{p&&p()},children:i===!0&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(dc,{}),o.jsxRuntimeExports.jsx(cc,{children:t.appLocale.getLocalizedStrings().cockpit.cockpitHeaderBackButton})]})}),a&&b!==-1&&a!=null&&m&&o.jsxRuntimeExports.jsx(uc,{"data-testid":t.generateDataTestId("cockpit-nav-header-tab-switcher"),children:o.jsxRuntimeExports.jsx(sc,{tabCounterDetails:c,onTabChange:j,allTabOptions:a,selectedOption:b,getTitle:C})}),o.jsxRuntimeExports.jsx(lc,{"data-testid":t.generateDataTestId("cockpit-nav-header-search-wrapper"),children:r&&h&&o.jsxRuntimeExports.jsx(mc,{"data-testid":t.generateDataTestId("cockpit-nav-header-filters"),children:o.jsxRuntimeExports.jsx(Jl,{selectedCockpitOption:d,filters:r.filters,disableFilters:r.disableFilters,getCategoryWiseOptions:h.getCategoryWiseOptions,onSearchTextChanged:f,onFiltersChange:g,companiesLoaded:l,filterText:r.filterText})})})]})},lc=s.div`
398
+ `,ht=({headerData:e,headerActions:n})=>{const{filterData:r,showBackButton:i=!1,allTabOptions:a,selectedTabOption:d,companiesLoaded:l,tabCounterDetails:c}=e,{onNavigateBack:p,onTabChange:m,filterActions:h}=n,S=h?.onFilterTextChanged,x=h?.onFiltersChange,C=y=>{let $="";return ps.forEach(w=>{w===y&&($=t.appLocale.getLocalizedStrings().cockpit.titles[y])}),$.length!=0,$};let b=-1;a?.forEach((y,$)=>{y===d&&(b=$)}),b===-1&&d!=null&&console.warn("Selected unsupported tab option");const f=u.useCallback(y=>{d&&S?.(d,y)},[S,d]),g=u.useCallback(y=>{x&&d&&x(d,y)},[x,d]),j=y=>{const $=a?.[y];$!=null&&m?.($)};return o.jsxRuntimeExports.jsxs(xc,{"data-testid":t.generateDataTestId("cockpit-nav-header"),children:[o.jsxRuntimeExports.jsx(pc,{"data-testid":t.generateDataTestId("cockpit-nav-header-back-button"),onClick:()=>{p&&p()},children:i===!0&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(dc,{}),o.jsxRuntimeExports.jsx(cc,{children:t.appLocale.getLocalizedStrings().cockpit.cockpitHeaderBackButton})]})}),a&&b!==-1&&a!=null&&m&&o.jsxRuntimeExports.jsx(uc,{"data-testid":t.generateDataTestId("cockpit-nav-header-tab-switcher"),children:o.jsxRuntimeExports.jsx(sc,{tabCounterDetails:c,onTabChange:j,allTabOptions:a,selectedOption:b,getTitle:C})}),o.jsxRuntimeExports.jsx(lc,{"data-testid":t.generateDataTestId("cockpit-nav-header-search-wrapper"),children:r&&h&&o.jsxRuntimeExports.jsx(mc,{"data-testid":t.generateDataTestId("cockpit-nav-header-filters"),children:o.jsxRuntimeExports.jsx(Jl,{selectedCockpitOption:d,filters:r.filters,disableFilters:r.disableFilters,getCategoryWiseOptions:h.getCategoryWiseOptions,onSearchTextChanged:f,onFiltersChange:g,companiesLoaded:l,filterText:r.filterText})})})]})},lc=s.div`
399
399
  min-width: 250px;
400
400
  display: flex;
401
401
  justify-content: flex-end;
@@ -441,7 +441,7 @@
441
441
  height: ${t.Space.sp8};
442
442
  color: ${e=>e.theme.colors.hero};
443
443
  margin-bottom: ${t.Space.sp4};
444
- `,jt=({selectedCockpitOption:e,reloadMsg:n,onCockpitReloadData:r})=>{const i=n??t.appLocale.getLocalizedStrings().card.failedText,a=t.useWindowSizeContext();return o.jsxRuntimeExports.jsxs(gc,{onClick:()=>r(e),windowSize:a,"data-testid":t.generateDataTestId("cockpit-reload-container"),children:[o.jsxRuntimeExports.jsx(yc,{"data-testid":t.generateDataTestId("cockpit-reload-icon")}),o.jsxRuntimeExports.jsx(Sc,{"data-testid":t.generateDataTestId("cockpit-reload-message"),children:i})]})},{common:{strings:{dot:Os}}}=t.appLocale.getLocalizedStrings(),oe="cockpitCommentsContainer",Ft=(e,n,r,i,a)=>({companyName:i,companyId:r,entityId:a??r,entityType:`${e}.${n}`,isGlobalComment:!0,application:"cockpit",tab:e,url:window.location.href}),Le=(e,n,r)=>`${t.toCollaborationEntityType({tab:e,key:n})}${Os}${r}${Os}${t.NEW_THREAD_SUFFIX}`,ms=(e,n)=>{for(;e&&!e.classList.contains(n);)e=e.parentElement;return e},fc=({open:e,anchorEl:n,children:r,onClose:i})=>{const a=o.useTheme();return o.jsxRuntimeExports.jsx(o.Popover,{transitionDuration:0,anchorEl:n,open:e,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},PaperProps:{style:{marginTop:"6px",background:a.colors.grey5,boxShadow:`${t.Space.sp0} 2px ${t.Space.sp1} ${a.colors.dropShadowNormal}`,width:"284px",padding:t.Space.sp1,border:`1px solid ${a.colors.grey3}`,borderRadius:t.Space.sp2}},"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-popover"),onClose:i,children:r})},Cc=({companyId:e,companyName:n,parentInfo:r,subsidiaryInfo:i,onViewDetailsLinkClicked:a})=>{const d=r?r.subsidiaries:i?i.siblings:[],l=()=>d.map(m=>o.jsxRuntimeExports.jsx(Ns,{isHighlighted:!1,"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-item",m.companyId),children:o.jsxRuntimeExports.jsx(Ms,{children:m.name})},m.companyId)),c=i?i.parentCompanyId:e,p=r!=null?n:i?.parentCompanyName;return o.jsxRuntimeExports.jsxs(bc,{"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-content"),children:[o.jsxRuntimeExports.jsxs(Rc,{isHighlighted:r!=null,children:[o.jsxRuntimeExports.jsx($c,{isHighlighted:r!=null,"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-parent-name"),children:p}),o.jsxRuntimeExports.jsxs(Ec,{"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-view-details"),onClick:()=>{a&&a(c)},children:[t.appLocale.getLocalizedStrings().cockpit.parentSubsidiary.viewDetailsLink,o.jsxRuntimeExports.jsx(jc,{})]})]}),o.jsxRuntimeExports.jsxs(wc,{"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-list"),children:[i&&o.jsxRuntimeExports.jsx(Ns,{isHighlighted:!0,"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-current-company"),children:o.jsxRuntimeExports.jsx(Ms,{children:n})}),l()]})]})},jc=s(t.SvgArrowRight)`
444
+ `,bt=({selectedCockpitOption:e,reloadMsg:n,onCockpitReloadData:r})=>{const i=n??t.appLocale.getLocalizedStrings().card.failedText,a=t.useWindowSizeContext();return o.jsxRuntimeExports.jsxs(gc,{onClick:()=>r(e),windowSize:a,"data-testid":t.generateDataTestId("cockpit-reload-container"),children:[o.jsxRuntimeExports.jsx(yc,{"data-testid":t.generateDataTestId("cockpit-reload-icon")}),o.jsxRuntimeExports.jsx(Sc,{"data-testid":t.generateDataTestId("cockpit-reload-message"),children:i})]})},{common:{strings:{dot:Os}}}=t.appLocale.getLocalizedStrings(),oe="cockpitCommentsContainer",Ft=(e,n,r,i,a)=>({companyName:i,companyId:r,entityId:a??r,entityType:`${e}.${n}`,isGlobalComment:!0,application:"cockpit",tab:e,url:window.location.href}),Le=(e,n,r)=>`${t.toCollaborationEntityType({tab:e,key:n})}${Os}${r}${Os}${t.NEW_THREAD_SUFFIX}`,us=(e,n)=>{for(;e&&!e.classList.contains(n);)e=e.parentElement;return e},fc=({open:e,anchorEl:n,children:r,onClose:i})=>{const a=o.useTheme();return o.jsxRuntimeExports.jsx(o.Popover,{transitionDuration:0,anchorEl:n,open:e,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},PaperProps:{style:{marginTop:"6px",background:a.colors.grey5,boxShadow:`${t.Space.sp0} 2px ${t.Space.sp1} ${a.colors.dropShadowNormal}`,width:"284px",padding:t.Space.sp1,border:`1px solid ${a.colors.grey3}`,borderRadius:t.Space.sp2}},"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-popover"),onClose:i,children:r})},Cc=({companyId:e,companyName:n,parentInfo:r,subsidiaryInfo:i,onViewDetailsLinkClicked:a})=>{const d=r?r.subsidiaries:i?i.siblings:[],l=()=>d.map(m=>o.jsxRuntimeExports.jsx(Ns,{isHighlighted:!1,"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-item",m.companyId),children:o.jsxRuntimeExports.jsx(Ms,{children:m.name})},m.companyId)),c=i?i.parentCompanyId:e,p=r!=null?n:i?.parentCompanyName;return o.jsxRuntimeExports.jsxs(bc,{"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-content"),children:[o.jsxRuntimeExports.jsxs(Rc,{isHighlighted:r!=null,children:[o.jsxRuntimeExports.jsx($c,{isHighlighted:r!=null,"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-parent-name"),children:p}),o.jsxRuntimeExports.jsxs(Ec,{"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-view-details"),onClick:()=>{a&&a(c)},children:[t.appLocale.getLocalizedStrings().cockpit.parentSubsidiary.viewDetailsLink,o.jsxRuntimeExports.jsx(jc,{})]})]}),o.jsxRuntimeExports.jsxs(wc,{"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-list"),children:[i&&o.jsxRuntimeExports.jsx(Ns,{isHighlighted:!0,"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-current-company"),children:o.jsxRuntimeExports.jsx(Ms,{children:n})}),l()]})]})},jc=s(t.SvgArrowRight)`
445
445
  padding-left: ${t.Space.sp1};
446
446
  transform: translateY(1px);
447
447
  height: 10px;
@@ -524,7 +524,7 @@
524
524
  align-items: center;
525
525
  justify-content: flex-start;
526
526
  width: 100%;
527
- `;function xs({allowedValues:e,pickerStyles:{optionBackgroundColor:n,backgroundColor:r,selectedOptionBackgroundColor:i,optionTextStyle:a,titleTextAlignment:d,selectedOptionColor:l,titleTextStyle:c}={},onSelectedValueChanged:p,selectedValue:m,customization:{placeholderLabel:h}={}}){const S=e.map(w=>({...w.value,...w.options,label:w.value.name,value:ee.isAllowedValueWithCode(w.value)?w.value.code:w.value.id})),x=S.find(w=>w.name===m?.value.name),C=o.useTheme(),b=n??C.colors.grey5,f=r??C.colors.grey5,g=i??C.colors.grey3,j=a??t.textStyles.standardRegular.cssObject,y=c??t.textStyles.smallRegular.cssObject,$={control:(w,{selectProps:O})=>({...w,border:0,height:"100%",backgroundColor:f,fill:O.menuIsOpen===!0?C.colors.primary:C.colors.grey1,boxShadow:f,":active":{backgroundColor:f},":hover":{fill:C.colors.primary},width:"auto",minHeight:"auto",cursor:"pointer"}),container:w=>({...w,backgroundColor:f,width:"100%",height:"100%"}),singleValue:(w,{data:O})=>({...w,display:"flex",flexDirection:"row",alignItems:"center",padding:"1px 6px",margin:`${t.Space.sp0}`,height:"20px",color:O.color?.toString()??C.colors.hero,background:O.bgColor?.toString()??C.colors.grey3,border:`1px solid ${O.borderColor?.toString()??C.colors.hero}`,borderRadius:t.sp[1]}),valueContainer:w=>({...w,maxWidth:"100%",height:"100%",cursor:"pointer",...y,overflow:"visible",minWidth:"auto",padding:0,display:"flex",justifyContent:d??"flex-start",alignItems:"center",flexWrap:"nowrap"}),menu:w=>({...w,backgroundColor:b,borderRadius:t.sp[1],boxShadow:`${t.Space.sp0} 2px ${t.Space.sp2} ${C.colors.dropShadowHover}`,whiteSpace:"nowrap",minWidth:"fit-content",zIndex:20,width:156,margin:0}),menuList:w=>({...w,borderRadius:t.sp[1]}),placeholder:(w,{isFocused:O})=>({...w,width:"100%",margin:0,color:O?C.colors.primary:"currentColor"}),option:(w,{isSelected:O,isFocused:A,isDisabled:v,data:T})=>({...w,...j,height:t.sp[6],color:O?l??C.colors.champion:C.colors.hero,backgroundColor:O?g:A?C.colors.background:b,cursor:v?"not-allowed":"pointer",borderTop:T.topBorder===!0?`1px solid ${C.colors.grey3}`:"none",":hover":{backgroundColor:C.colors.background,color:C.colors.primary},"& label":{paddingRight:"10px",cursor:v?"not-allowed":O?"default":"pointer"},">div>div>div:first-of-type":{display:"flex"}}),input:()=>({display:"inline-grid",color:C.colors.primary,overflow:"hidden",zIndex:2,minWidth:"auto",maxWidth:"100%",height:t.sp[4],input:{...t.textStyles.standardBold.cssObject}}),indicatorSeparator:()=>({}),dropdownIndicator:()=>({})};return o.jsxRuntimeExports.jsx(Lc,{onClick:w=>w.stopPropagation(),"data-testid":t.generateDataTestId("cockpit-single-value-picker"),children:o.jsxRuntimeExports.jsx(o.StateManagedSelect$1,{onChange:w=>{if(w){const O=e.find(A=>A.value.name===w.name);p(O)}},menuPlacement:"auto",minMenuHeight:208,defaultValue:x,value:x,menuShouldScrollIntoView:!1,components:{Option:Mc,DropdownIndicator:Pc,IndicatorSeparator:Ic,SingleValue:zc},hideSelectedOptions:!1,closeMenuOnSelect:!1,styles:$,options:S,isClearable:!1,isSearchable:!1,placeholder:o.jsxRuntimeExports.jsxs(Dc,{"data-testid":t.generateDataTestId("cockpit-single-value-picker-placeholder"),children:[o.jsxRuntimeExports.jsx(Ac,{children:o.jsxRuntimeExports.jsx(Oc,{})}),o.jsxRuntimeExports.jsx(Nc,{children:h??"Select..."})]})})})}const Pc=()=>null,Ic=()=>null,Dc=s.div`
527
+ `;function ms({allowedValues:e,pickerStyles:{optionBackgroundColor:n,backgroundColor:r,selectedOptionBackgroundColor:i,optionTextStyle:a,titleTextAlignment:d,selectedOptionColor:l,titleTextStyle:c}={},onSelectedValueChanged:p,selectedValue:m,customization:{placeholderLabel:h}={}}){const S=e.map(w=>({...w.value,...w.options,label:w.value.name,value:J.isAllowedValueWithCode(w.value)?w.value.code:w.value.id})),x=S.find(w=>w.name===m?.value.name),C=o.useTheme(),b=n??C.colors.grey5,f=r??C.colors.grey5,g=i??C.colors.grey3,j=a??t.textStyles.standardRegular.cssObject,y=c??t.textStyles.smallRegular.cssObject,$={control:(w,{selectProps:O})=>({...w,border:0,height:"100%",backgroundColor:f,fill:O.menuIsOpen===!0?C.colors.primary:C.colors.grey1,boxShadow:f,":active":{backgroundColor:f},":hover":{fill:C.colors.primary},width:"auto",minHeight:"auto",cursor:"pointer"}),container:w=>({...w,backgroundColor:f,width:"100%",height:"100%"}),singleValue:(w,{data:O})=>({...w,display:"flex",flexDirection:"row",alignItems:"center",padding:"1px 6px",margin:`${t.Space.sp0}`,height:"20px",color:O.color?.toString()??C.colors.hero,background:O.bgColor?.toString()??C.colors.grey3,border:`1px solid ${O.borderColor?.toString()??C.colors.hero}`,borderRadius:t.sp[1]}),valueContainer:w=>({...w,maxWidth:"100%",height:"100%",cursor:"pointer",...y,overflow:"visible",minWidth:"auto",padding:0,display:"flex",justifyContent:d??"flex-start",alignItems:"center",flexWrap:"nowrap"}),menu:w=>({...w,backgroundColor:b,borderRadius:t.sp[1],boxShadow:`${t.Space.sp0} 2px ${t.Space.sp2} ${C.colors.dropShadowHover}`,whiteSpace:"nowrap",minWidth:"fit-content",zIndex:20,width:156,margin:0}),menuList:w=>({...w,borderRadius:t.sp[1]}),placeholder:(w,{isFocused:O})=>({...w,width:"100%",margin:0,color:O?C.colors.primary:"currentColor"}),option:(w,{isSelected:O,isFocused:A,isDisabled:v,data:T})=>({...w,...j,height:t.sp[6],color:O?l??C.colors.champion:C.colors.hero,backgroundColor:O?g:A?C.colors.background:b,cursor:v?"not-allowed":"pointer",borderTop:T.topBorder===!0?`1px solid ${C.colors.grey3}`:"none",":hover":{backgroundColor:C.colors.background,color:C.colors.primary},"& label":{paddingRight:"10px",cursor:v?"not-allowed":O?"default":"pointer"},">div>div>div:first-of-type":{display:"flex"}}),input:()=>({display:"inline-grid",color:C.colors.primary,overflow:"hidden",zIndex:2,minWidth:"auto",maxWidth:"100%",height:t.sp[4],input:{...t.textStyles.standardBold.cssObject}}),indicatorSeparator:()=>({}),dropdownIndicator:()=>({})};return o.jsxRuntimeExports.jsx(Lc,{onClick:w=>w.stopPropagation(),"data-testid":t.generateDataTestId("cockpit-single-value-picker"),children:o.jsxRuntimeExports.jsx(o.StateManagedSelect$1,{onChange:w=>{if(w){const O=e.find(A=>A.value.name===w.name);p(O)}},menuPlacement:"auto",minMenuHeight:208,defaultValue:x,value:x,menuShouldScrollIntoView:!1,components:{Option:Mc,DropdownIndicator:Pc,IndicatorSeparator:Ic,SingleValue:zc},hideSelectedOptions:!1,closeMenuOnSelect:!1,styles:$,options:S,isClearable:!1,isSearchable:!1,placeholder:o.jsxRuntimeExports.jsxs(Dc,{"data-testid":t.generateDataTestId("cockpit-single-value-picker-placeholder"),children:[o.jsxRuntimeExports.jsx(Ac,{children:o.jsxRuntimeExports.jsx(Oc,{})}),o.jsxRuntimeExports.jsx(Nc,{children:h??"Select..."})]})})})}const Pc=()=>null,Ic=()=>null,Dc=s.div`
528
528
  display: flex;
529
529
  align-items: center;
530
530
  color: ${e=>e.theme.colors.grey1};
@@ -544,7 +544,7 @@
544
544
  display: flex;
545
545
  align-items: center;
546
546
  justify-content: space-between;
547
- `,Wc={live:{bgColor:new o.Color(t.Colors.infoLight),color:new o.Color(t.Colors.info),borderColor:new o.Color(t.Colors.info)},onboarding:{bgColor:new o.Color(t.Colors.successLight),color:new o.Color(t.Colors.successDark),borderColor:new o.Color(t.Colors.successDark)},stalled:{bgColor:new o.Color(t.Colors.alertLight),color:new o.Color(t.Colors.alertDark),borderColor:new o.Color(t.Colors.alertDark)},terminated:{bgColor:new o.Color(t.Colors.importantLight),color:new o.Color(t.Colors.important),borderColor:new o.Color(t.Colors.important)},archive:{bgColor:new o.Color(t.lightColors.grey3),color:new o.Color(t.lightColors.hero),borderColor:new o.Color(t.lightColors.hero),topBorder:!0,selectedLabel:"ARCHIVED"}},Bc=e=>e.map(n=>({value:n,options:Wc[n.code]})),_c=({onSelectionChanged:e,selectedStatusIndex:n,allStatuses:r})=>{const i=Bc(r);return o.jsxRuntimeExports.jsx(Vc,{"data-testid":t.generateDataTestId("cockpit-status-picker"),children:o.jsxRuntimeExports.jsx(xs,{customization:{placeholderLabel:t.appLocale.getLocalizedStrings().cockpit.management.placeholder.status},onSelectedValueChanged:a=>{const d=i.findIndex(l=>l.value.code===(a?.value).code);e(d,a?.value)},allowedValues:i,selectedValue:n!=null?i[n]:void 0})})},Vc=s.div``,Uc=({name:e,registerOptions:n,value:r})=>{const{control:i}=o.useFormContext();return o.jsxRuntimeExports.jsx(Hc,{"data-testid":t.generateDataTestId("cockpit-status-picker-field"),children:o.jsxRuntimeExports.jsx(o.Controller,{name:e,control:i,defaultValue:r,rules:n,render:({field:{value:a,onChange:d}})=>o.jsxRuntimeExports.jsx(_c,{onSelectionChanged:l=>d({allGroups:r.allStatuses,selectedValue:r.allStatuses[l]}),selectedStatusIndex:r.allStatuses.findIndex(l=>l.code===a.selectedValue?.code),allStatuses:r.allStatuses})})})},Hc=s.div``,Kc=s.div`
547
+ `,Wc={live:{bgColor:new o.Color(t.Colors.infoLight),color:new o.Color(t.Colors.info),borderColor:new o.Color(t.Colors.info)},onboarding:{bgColor:new o.Color(t.Colors.successLight),color:new o.Color(t.Colors.successDark),borderColor:new o.Color(t.Colors.successDark)},stalled:{bgColor:new o.Color(t.Colors.alertLight),color:new o.Color(t.Colors.alertDark),borderColor:new o.Color(t.Colors.alertDark)},terminated:{bgColor:new o.Color(t.Colors.importantLight),color:new o.Color(t.Colors.important),borderColor:new o.Color(t.Colors.important)},archive:{bgColor:new o.Color(t.lightColors.grey3),color:new o.Color(t.lightColors.hero),borderColor:new o.Color(t.lightColors.hero),topBorder:!0,selectedLabel:"ARCHIVED"}},Bc=e=>e.map(n=>({value:n,options:Wc[n.code]})),_c=({onSelectionChanged:e,selectedStatusIndex:n,allStatuses:r})=>{const i=Bc(r);return o.jsxRuntimeExports.jsx(Vc,{"data-testid":t.generateDataTestId("cockpit-status-picker"),children:o.jsxRuntimeExports.jsx(ms,{customization:{placeholderLabel:t.appLocale.getLocalizedStrings().cockpit.management.placeholder.status},onSelectedValueChanged:a=>{const d=i.findIndex(l=>l.value.code===(a?.value).code);e(d,a?.value)},allowedValues:i,selectedValue:n!=null?i[n]:void 0})})},Vc=s.div``,Uc=({name:e,registerOptions:n,value:r})=>{const{control:i}=o.useFormContext();return o.jsxRuntimeExports.jsx(Hc,{"data-testid":t.generateDataTestId("cockpit-status-picker-field"),children:o.jsxRuntimeExports.jsx(o.Controller,{name:e,control:i,defaultValue:r,rules:n,render:({field:{value:a,onChange:d}})=>o.jsxRuntimeExports.jsx(_c,{onSelectionChanged:l=>d({allGroups:r.allStatuses,selectedValue:r.allStatuses[l]}),selectedStatusIndex:r.allStatuses.findIndex(l=>l.code===a.selectedValue?.code),allStatuses:r.allStatuses})})})},Hc=s.div``,Kc=s.div`
548
548
  position: fixed;
549
549
  top: 0;
550
550
  left: 0;
@@ -643,9 +643,9 @@
643
643
  align-items: center;
644
644
  color: ${e=>e.theme.colors.grey1};
645
645
  fill: ${e=>e.theme.colors.grey1};
646
- `,cd=({chips:e})=>o.jsxRuntimeExports.jsx(id,{children:e.length>0?e.map((n,r)=>o.jsxRuntimeExports.jsx(ad,{color:n.color,children:n.label},`${n.label}_${r}`)):o.jsxRuntimeExports.jsx(ld,{children:"-"})}),xn=[t.lightColors.graphColor34,t.lightColors.graphColor08,t.lightColors.graphColor11,t.lightColors.graphColor13,t.lightColors.graphColor19,t.lightColors.graphColor20,t.lightColors.graphColor14,t.lightColors.graphColor35,t.lightColors.graphColor32,t.lightColors.graphColor02,t.lightColors.graphColor06,t.lightColors.graphColor04,t.lightColors.graphColor10,t.lightColors.graphColor12,t.lightColors.graphColor15,t.lightColors.graphColor18],dd=e=>{const n=String.prototype.concat(...new Set(e));let r=0;for(let i=0;i<n.length;++i)r=r+n.charCodeAt(i);return r};function pd(e,n=0){const r=dd(e)+n*n*n;return xn[Math.floor(r/xn.length)%xn.length]}const ud=e=>e.map(n=>({label:n,color:pd(n,n.length)})),gi={z1:{bgColor:new o.Color(t.lightColors.primary),color:new o.Color(t.darkColors.primary),borderColor:new o.Color(t.lightColors.primary)},z2:{bgColor:new o.Color(t.lightColors.champion),color:new o.Color(t.darkColors.primary),borderColor:new o.Color(t.lightColors.champion)},z3:{bgColor:new o.Color(t.lightColors.hero),color:new o.Color(t.darkColors.primary),borderColor:new o.Color(t.lightColors.hero)},z4:{bgColor:new o.Color(t.lightColors.grey1),color:new o.Color(t.darkColors.primary),borderColor:new o.Color(t.lightColors.grey1)},z5:{bgColor:new o.Color(t.lightColors.grey2),color:new o.Color(t.darkColors.primary),borderColor:new o.Color(t.lightColors.grey2)},enterprise:{bgColor:new o.Color(t.lightColors.primary),color:new o.Color(t.darkColors.primary),borderColor:new o.Color(t.lightColors.primary)},growth:{bgColor:new o.Color(t.lightColors.champion),color:new o.Color(t.darkColors.primary),borderColor:new o.Color(t.lightColors.champion)},starter:{bgColor:new o.Color(t.lightColors.hero),color:new o.Color(t.darkColors.primary),borderColor:new o.Color(t.lightColors.hero)}},md=e=>e.map(n=>({value:n,options:gi[n.id]})),xd=({onSelectionChanged:e,selectedGroupIndex:n,allGroups:r})=>{const i=md(r);return o.jsxRuntimeExports.jsx(hd,{children:o.jsxRuntimeExports.jsx(xs,{customization:{placeholderLabel:t.appLocale.getLocalizedStrings().cockpit.management.placeholder.group},onSelectedValueChanged:a=>{const d=i.findIndex(l=>l.value.id===(a?.value).id);e(d,a?.value)},allowedValues:i,selectedValue:n!=null?i[n]:void 0})})},hd=s.div`
646
+ `,cd=({chips:e})=>o.jsxRuntimeExports.jsx(id,{children:e.length>0?e.map((n,r)=>o.jsxRuntimeExports.jsx(ad,{color:n.color,children:n.label},`${n.label}_${r}`)):o.jsxRuntimeExports.jsx(ld,{children:"-"})}),mn=[t.lightColors.graphColor34,t.lightColors.graphColor08,t.lightColors.graphColor11,t.lightColors.graphColor13,t.lightColors.graphColor19,t.lightColors.graphColor20,t.lightColors.graphColor14,t.lightColors.graphColor35,t.lightColors.graphColor32,t.lightColors.graphColor02,t.lightColors.graphColor06,t.lightColors.graphColor04,t.lightColors.graphColor10,t.lightColors.graphColor12,t.lightColors.graphColor15,t.lightColors.graphColor18],dd=e=>{const n=String.prototype.concat(...new Set(e));let r=0;for(let i=0;i<n.length;++i)r=r+n.charCodeAt(i);return r};function pd(e,n=0){const r=dd(e)+n*n*n;return mn[Math.floor(r/mn.length)%mn.length]}const ud=e=>e.map(n=>({label:n,color:pd(n,n.length)})),hi={z1:{bgColor:new o.Color(t.lightColors.primary),color:new o.Color(t.darkColors.primary),borderColor:new o.Color(t.lightColors.primary)},z2:{bgColor:new o.Color(t.lightColors.champion),color:new o.Color(t.darkColors.primary),borderColor:new o.Color(t.lightColors.champion)},z3:{bgColor:new o.Color(t.lightColors.hero),color:new o.Color(t.darkColors.primary),borderColor:new o.Color(t.lightColors.hero)},z4:{bgColor:new o.Color(t.lightColors.grey1),color:new o.Color(t.darkColors.primary),borderColor:new o.Color(t.lightColors.grey1)},z5:{bgColor:new o.Color(t.lightColors.grey2),color:new o.Color(t.darkColors.primary),borderColor:new o.Color(t.lightColors.grey2)},enterprise:{bgColor:new o.Color(t.lightColors.primary),color:new o.Color(t.darkColors.primary),borderColor:new o.Color(t.lightColors.primary)},growth:{bgColor:new o.Color(t.lightColors.champion),color:new o.Color(t.darkColors.primary),borderColor:new o.Color(t.lightColors.champion)},starter:{bgColor:new o.Color(t.lightColors.hero),color:new o.Color(t.darkColors.primary),borderColor:new o.Color(t.lightColors.hero)}},md=e=>e.map(n=>({value:n,options:hi[n.id]})),xd=({onSelectionChanged:e,selectedGroupIndex:n,allGroups:r})=>{const i=md(r);return o.jsxRuntimeExports.jsx(hd,{children:o.jsxRuntimeExports.jsx(ms,{customization:{placeholderLabel:t.appLocale.getLocalizedStrings().cockpit.management.placeholder.group},onSelectedValueChanged:a=>{const d=i.findIndex(l=>l.value.id===(a?.value).id);e(d,a?.value)},allowedValues:i,selectedValue:n!=null?i[n]:void 0})})},hd=s.div`
647
647
  width: 70%;
648
- `,gd=({registerOptions:e,name:n,value:r})=>{const{control:i}=o.useFormContext();return o.jsxRuntimeExports.jsx(o.Controller,{name:n,control:i,defaultValue:r,rules:e,render:({field:{value:a,onChange:d}})=>o.jsxRuntimeExports.jsx(xd,{onSelectionChanged:l=>d({allGroups:r.allGroups,selectedValue:r.allGroups[l]}),selectedGroupIndex:r.allGroups.findIndex(l=>l.id===a.selectedValue?.id),allGroups:r.allGroups})})},We=t.appLocale.getLocalizedStrings().cockpit.management.header,St=[{key:"companyName",value:We.name,sortOrder:"ascending",width:new t.ResponsiveSized(392,392),isThreadAllowed:!0},{key:"task",value:We.task,sortOrder:"ascending",width:new t.ResponsiveSized(117,117),isThreadAllowed:!0},{key:"status",value:We.status,sortOrder:"ascending",width:new t.ResponsiveSized(148,148),isThreadAllowed:!0},{key:"group",value:We.group,sortOrder:"ascending",width:new t.ResponsiveSized(148,148),isThreadAllowed:!0},{key:"plans",value:We.plans,sortOrder:"ascending",width:new t.ResponsiveSized(275,275),isThreadAllowed:!0},{key:"satisfaction",value:We.satisfaction,sortOrder:"ascending",width:new t.ResponsiveSized(149,149),isThreadAllowed:!0},{key:"bookCloseDate",value:We.bookCloseDate,sortOrder:"ascending",width:new t.ResponsiveSized(148,148),isThreadAllowed:!0},{key:"reportSent",value:We.reportSent,sortOrder:"ascending",width:new t.ResponsiveSized(380,380),isThreadAllowed:!0},{key:"controller",value:We.controller,sortOrder:"ascending",width:new t.ResponsiveSized(232,232),isThreadAllowed:!0},{key:"customerSuccessManager",value:We.customerSuccessManager,sortOrder:"ascending",width:new t.ResponsiveSized(232,232),isThreadAllowed:!0},{key:"preparer",value:We.preparer,sortOrder:"ascending",width:new t.ResponsiveSized(232,232),isThreadAllowed:!0},{key:"reviewer",value:We.reviewer,sortOrder:"ascending",width:new t.ResponsiveSized(216,216),isThreadAllowed:!0},{key:"apAnalyst",value:We.apAnalyst,sortOrder:"ascending",width:new t.ResponsiveSized(216,216),isThreadAllowed:!0},{key:"taxStatus",value:We.taxStatus,sortOrder:"ascending",width:new t.ResponsiveSized(282,282),isThreadAllowed:!0},{key:"taxLead",value:We.taxLead,sortOrder:"ascending",width:new t.ResponsiveSized(232,232),isThreadAllowed:!0},{key:"monthlyRecurringRevenue",value:We.monthlyRecurringRevenue,sortOrder:"ascending",width:new t.ResponsiveSized(196,196),isThreadAllowed:!0},{key:"annualRecurringRevenue",value:We.annualRecurringRevenue,sortOrder:"ascending",width:new t.ResponsiveSized(196,196),isThreadAllowed:!0}];St.map(e=>e.key);var Ae=(e=>(e.CUSTOMER="customer",e.TEAM="team",e))(Ae||{});const Sd=({activeEntity:e,teamNote:n,customerNote:r})=>e===Ae.CUSTOMER?r:e===Ae.TEAM?n:"",yd=({activeEntity:e,teamRating:n,customerRating:r})=>{if(e===Ae.CUSTOMER)return r;if(e===Ae.TEAM)return n},fd=({activeEntity:e,teamRatingLastUpdatedBy:n,customerRatingLastUpdatedBy:r})=>{if(e===Ae.CUSTOMER)return r;if(e===Ae.TEAM)return n},Cd=({activeEntity:e,customerRatingLastUpdatedDate:n,teamRatingLastUpdatedDate:r})=>{if(e===Ae.CUSTOMER)return n;if(e===Ae.TEAM)return r},ts=({teamRating:e,teamNote:n,customerRating:r,customerNote:i,activeEntity:a})=>{const d=yd({activeEntity:a,teamRating:e,customerRating:r}),l=Sd({activeEntity:a,teamNote:n,customerNote:i});return{savedOption:d,savedNote:l}},jd=({teamRating:e,customerRating:n,teamNote:r,customerNote:i,activeEntity:a,selectedOption:d,noteValue:l})=>{if(a!=null){const{savedOption:c,savedNote:p}=ts({teamRating:e,teamNote:r,customerRating:n,customerNote:i,activeEntity:a});return l.trim().length===0||c===d&&l===p||c!==d&&l===Si(p)}return!0},Si=e=>`
648
+ `,gd=({registerOptions:e,name:n,value:r})=>{const{control:i}=o.useFormContext();return o.jsxRuntimeExports.jsx(o.Controller,{name:n,control:i,defaultValue:r,rules:e,render:({field:{value:a,onChange:d}})=>o.jsxRuntimeExports.jsx(xd,{onSelectionChanged:l=>d({allGroups:r.allGroups,selectedValue:r.allGroups[l]}),selectedGroupIndex:r.allGroups.findIndex(l=>l.id===a.selectedValue?.id),allGroups:r.allGroups})})},We=t.appLocale.getLocalizedStrings().cockpit.management.header,yt=[{key:"companyName",value:We.name,sortOrder:"ascending",width:new t.ResponsiveSized(392,392),isThreadAllowed:!0},{key:"task",value:We.task,sortOrder:"ascending",width:new t.ResponsiveSized(117,117),isThreadAllowed:!0},{key:"status",value:We.status,sortOrder:"ascending",width:new t.ResponsiveSized(148,148),isThreadAllowed:!0},{key:"group",value:We.group,sortOrder:"ascending",width:new t.ResponsiveSized(148,148),isThreadAllowed:!0},{key:"plans",value:We.plans,sortOrder:"ascending",width:new t.ResponsiveSized(275,275),isThreadAllowed:!0},{key:"satisfaction",value:We.satisfaction,sortOrder:"ascending",width:new t.ResponsiveSized(149,149),isThreadAllowed:!0},{key:"bookCloseDate",value:We.bookCloseDate,sortOrder:"ascending",width:new t.ResponsiveSized(148,148),isThreadAllowed:!0},{key:"reportSent",value:We.reportSent,sortOrder:"ascending",width:new t.ResponsiveSized(380,380),isThreadAllowed:!0},{key:"controller",value:We.controller,sortOrder:"ascending",width:new t.ResponsiveSized(232,232),isThreadAllowed:!0},{key:"customerSuccessManager",value:We.customerSuccessManager,sortOrder:"ascending",width:new t.ResponsiveSized(232,232),isThreadAllowed:!0},{key:"preparer",value:We.preparer,sortOrder:"ascending",width:new t.ResponsiveSized(232,232),isThreadAllowed:!0},{key:"reviewer",value:We.reviewer,sortOrder:"ascending",width:new t.ResponsiveSized(216,216),isThreadAllowed:!0},{key:"apAnalyst",value:We.apAnalyst,sortOrder:"ascending",width:new t.ResponsiveSized(216,216),isThreadAllowed:!0},{key:"taxStatus",value:We.taxStatus,sortOrder:"ascending",width:new t.ResponsiveSized(282,282),isThreadAllowed:!0},{key:"taxLead",value:We.taxLead,sortOrder:"ascending",width:new t.ResponsiveSized(232,232),isThreadAllowed:!0},{key:"monthlyRecurringRevenue",value:We.monthlyRecurringRevenue,sortOrder:"ascending",width:new t.ResponsiveSized(196,196),isThreadAllowed:!0},{key:"annualRecurringRevenue",value:We.annualRecurringRevenue,sortOrder:"ascending",width:new t.ResponsiveSized(196,196),isThreadAllowed:!0}];yt.map(e=>e.key);var Ae=(e=>(e.CUSTOMER="customer",e.TEAM="team",e))(Ae||{});const Sd=({activeEntity:e,teamNote:n,customerNote:r})=>e===Ae.CUSTOMER?r:e===Ae.TEAM?n:"",yd=({activeEntity:e,teamRating:n,customerRating:r})=>{if(e===Ae.CUSTOMER)return r;if(e===Ae.TEAM)return n},fd=({activeEntity:e,teamRatingLastUpdatedBy:n,customerRatingLastUpdatedBy:r})=>{if(e===Ae.CUSTOMER)return r;if(e===Ae.TEAM)return n},Cd=({activeEntity:e,customerRatingLastUpdatedDate:n,teamRatingLastUpdatedDate:r})=>{if(e===Ae.CUSTOMER)return n;if(e===Ae.TEAM)return r},es=({teamRating:e,teamNote:n,customerRating:r,customerNote:i,activeEntity:a})=>{const d=yd({activeEntity:a,teamRating:e,customerRating:r}),l=Sd({activeEntity:a,teamNote:n,customerNote:i});return{savedOption:d,savedNote:l}},jd=({teamRating:e,customerRating:n,teamNote:r,customerNote:i,activeEntity:a,selectedOption:d,noteValue:l})=>{if(a!=null){const{savedOption:c,savedNote:p}=es({teamRating:e,teamNote:r,customerRating:n,customerNote:i,activeEntity:a});return l.trim().length===0||c===d&&l===p||c!==d&&l===gi(p)}return!0},gi=e=>`
649
649
  ---------------
650
650
  ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("circle",{cx:17,cy:22,r:16,stroke:"currentColor",strokeWidth:1.5,strokeDasharray:"3 3"}),le.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.5 16H16V21H11V22.5H16V28H17.5V22.5H23V21H17.5V16Z",fill:"currentColor"}),le.createElement("rect",{x:20,width:18,height:18,rx:9,fill:"currentColor"}),le.createElement("path",{d:"M30.9863 10.2227H32.4512C32.4043 10.7812 32.248 11.2793 31.9824 11.7168C31.7168 12.1504 31.3438 12.4922 30.8633 12.7422C30.3828 12.9922 29.7988 13.1172 29.1113 13.1172C28.584 13.1172 28.1094 13.0234 27.6875 12.8359C27.2656 12.6445 26.9043 12.375 26.6035 12.0273C26.3027 11.6758 26.0723 11.252 25.9121 10.7559C25.7559 10.2598 25.6777 9.70508 25.6777 9.0918V8.38281C25.6777 7.76953 25.7578 7.21484 25.918 6.71875C26.082 6.22266 26.3164 5.79883 26.6211 5.44727C26.9258 5.0918 27.291 4.82031 27.7168 4.63281C28.1465 4.44531 28.6289 4.35156 29.1641 4.35156C29.8438 4.35156 30.418 4.47656 30.8867 4.72656C31.3555 4.97656 31.7188 5.32227 31.9766 5.76367C32.2383 6.20508 32.3984 6.71094 32.457 7.28125H30.9922C30.9531 6.91406 30.8672 6.59961 30.7344 6.33789C30.6055 6.07617 30.4141 5.87695 30.1602 5.74023C29.9062 5.59961 29.5742 5.5293 29.1641 5.5293C28.8281 5.5293 28.5352 5.5918 28.2852 5.7168C28.0352 5.8418 27.8262 6.02539 27.6582 6.26758C27.4902 6.50977 27.3633 6.80859 27.2773 7.16406C27.1953 7.51562 27.1543 7.91797 27.1543 8.37109V9.0918C27.1543 9.52148 27.1914 9.91211 27.2656 10.2637C27.3438 10.6113 27.4609 10.9102 27.6172 11.1602C27.7773 11.4102 27.9805 11.6035 28.2266 11.7402C28.4727 11.877 28.7676 11.9453 29.1113 11.9453C29.5293 11.9453 29.8672 11.8789 30.125 11.7461C30.3867 11.6133 30.584 11.4199 30.7168 11.166C30.8535 10.9082 30.9434 10.5938 30.9863 10.2227Z"})),Rd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("circle",{cx:17,cy:22,r:16,stroke:"currentColor",strokeWidth:1.5,strokeDasharray:"3 3"}),le.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.5 16H16V21H11V22.5H16V28H17.5V22.5H23V21H17.5V16Z",fill:"currentColor"}),le.createElement("rect",{x:20,width:18,height:18,rx:9,fill:"currentColor"}),le.createElement("path",{d:"M32.2109 11.834V13H26.2871V11.834H32.2109ZM32.0762 5.37695L26.832 13H25.8477V12.0684L31.1094 4.46875H32.0762V5.37695ZM31.5312 4.46875V5.64062H25.8828V4.46875H31.5312Z"})),zs=s.button`
651
651
  background: none;
@@ -667,7 +667,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
667
667
  color: ${e=>e.theme.colors.primary};
668
668
  }
669
669
  }
670
- `,os=u.forwardRef(({entityType:e,onClick:n,isActive:r,savedRating:i},a)=>{const[d,l]=u.useState(!1),c=e===Ae.CUSTOMER?bd:Rd,p={onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),ref:a,onClick:m=>n(e,m)};return i!=null?o.jsxRuntimeExports.jsx(t.Tooltip,{display:"flex",placement:"bottom-start",style:{marginTop:"6px"},enterDelay:600,title:o.jsxRuntimeExports.jsx($d,{children:e===Ae.CUSTOMER?$o[i].name:qt[i].name}),children:o.jsxRuntimeExports.jsx(zs,{...p,children:o.jsxRuntimeExports.jsx(tn,{iconName:e===Ae.CUSTOMER?$o[i].iconName:qt[i].iconName,stopAnimation:!d})})}):o.jsxRuntimeExports.jsx(zs,{...p,children:o.jsxRuntimeExports.jsx(Ed,{active:r,children:o.jsxRuntimeExports.jsx(c,{})})})});os.displayName="RatingButton";const wd=s.div`
670
+ `,ts=u.forwardRef(({entityType:e,onClick:n,isActive:r,savedRating:i},a)=>{const[d,l]=u.useState(!1),c=e===Ae.CUSTOMER?bd:Rd,p={onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),ref:a,onClick:m=>n(e,m)};return i!=null?o.jsxRuntimeExports.jsx(t.Tooltip,{display:"flex",placement:"bottom-start",style:{marginTop:"6px"},enterDelay:600,title:o.jsxRuntimeExports.jsx($d,{children:e===Ae.CUSTOMER?$o[i].name:qt[i].name}),children:o.jsxRuntimeExports.jsx(zs,{...p,children:o.jsxRuntimeExports.jsx(tn,{iconName:e===Ae.CUSTOMER?$o[i].iconName:qt[i].iconName,stopAnimation:!d})})}):o.jsxRuntimeExports.jsx(zs,{...p,children:o.jsxRuntimeExports.jsx(Ed,{active:r,children:o.jsxRuntimeExports.jsx(c,{})})})});ts.displayName="RatingButton";const wd=s.div`
671
671
  padding: ${t.Space.sp3};
672
672
  cursor: pointer;
673
673
  display: flex;
@@ -754,7 +754,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
754
754
  height: ${t.Space.sp1};
755
755
  background-color: ${e=>e.theme.colors.grey1};
756
756
  order: 2;
757
- `,yi=({time:e,user:n})=>{const{cockpit:r,dateFormat:{visual:i},timeFormat:a}=t.appLocale.getLocalizedStrings();return o.jsxRuntimeExports.jsxs(Hd,{children:[!!n&&o.jsxRuntimeExports.jsx(Bd,{children:n?.photo!==void 0?o.jsxRuntimeExports.jsx(Kd,{src:n?.photo.href,alt:r.userProfileAltText,onError:({currentTarget:d})=>{d.onerror=null,d.src=t.AvatarSVG},loading:"lazy"}):o.jsxRuntimeExports.jsx(t.EntityAvatarWithInitials,{firstName:n?.firstName??"",lastName:n?.lastName??""})}),o.jsxRuntimeExports.jsxs(Ud,{children:[n&&o.jsxRuntimeExports.jsx(Vd,{children:`${n.firstName} ${n.lastName}`}),!!e&&o.jsxRuntimeExports.jsxs(_d,{children:[e!=null&&o.jsxRuntimeExports.jsxs(Fd,{children:[o.jsxRuntimeExports.jsx(t.SvgClock,{width:t.Space.sp3,height:t.Space.sp3}),ee.zeniDate(e.toISOString()).format(e.year()===ee.dateNow().year()?i.MMMDFormat:i.MMMDCommaYYYYformat)]}),o.jsxRuntimeExports.jsx(Gd,{}),e!=null&&o.jsxRuntimeExports.jsx(Wd,{children:ee.zeniDate(e.toISOString()).format(a.hhmmAFormat)})]})]})]})},Yd=s.div`
757
+ `,Si=({time:e,user:n})=>{const{cockpit:r,dateFormat:{visual:i},timeFormat:a}=t.appLocale.getLocalizedStrings();return o.jsxRuntimeExports.jsxs(Hd,{children:[!!n&&o.jsxRuntimeExports.jsx(Bd,{children:n?.photo!==void 0?o.jsxRuntimeExports.jsx(Kd,{src:n?.photo.href,alt:r.userProfileAltText,onError:({currentTarget:d})=>{d.onerror=null,d.src=t.AvatarSVG},loading:"lazy"}):o.jsxRuntimeExports.jsx(t.EntityAvatarWithInitials,{firstName:n?.firstName??"",lastName:n?.lastName??""})}),o.jsxRuntimeExports.jsxs(Ud,{children:[n&&o.jsxRuntimeExports.jsx(Vd,{children:`${n.firstName} ${n.lastName}`}),!!e&&o.jsxRuntimeExports.jsxs(_d,{children:[e!=null&&o.jsxRuntimeExports.jsxs(Fd,{children:[o.jsxRuntimeExports.jsx(t.SvgClock,{width:t.Space.sp3,height:t.Space.sp3}),J.zeniDate(e.toISOString()).format(e.year()===J.dateNow().year()?i.MMMDFormat:i.MMMDCommaYYYYformat)]}),o.jsxRuntimeExports.jsx(Gd,{}),e!=null&&o.jsxRuntimeExports.jsx(Wd,{children:J.zeniDate(e.toISOString()).format(a.hhmmAFormat)})]})]})]})},Yd=s.div`
758
758
  display: flex;
759
759
  flex-direction: column;
760
760
  `,Zd=s.div`
@@ -773,11 +773,11 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
773
773
  justify-content: flex-end;
774
774
  column-gap: ${t.Space.sp3};
775
775
  flex: 1;
776
- `,Jd=({customerSatisfactionOptions:e,noteValue:n,selectedOption:r,savedOption:i,lastUpdatedBy:a,lastUpdatedTime:d,saveBtnDisabled:l,onCancel:c,onSave:p,onOptionChange:m,onNoteChange:h})=>{const S=()=>o.jsxRuntimeExports.jsx(Zd,{selectedOption:r,children:o.jsxRuntimeExports.jsx(Ad,{onChange:m,value:r,customerSatisfactionOptions:e})}),x=b=>{h&&h(b)},C=()=>{if(r==null)return null;const b=i==null?t.appLocale.getLocalizedStrings().cockpit.management.customerSatisfaction.noteLabel:i==r?"":t.appLocale.getLocalizedStrings().cockpit.management.customerSatisfaction.updateNoteLabel;return o.jsxRuntimeExports.jsxs(Xd,{children:[o.jsxRuntimeExports.jsx(zd,{label:b,onChange:x,value:n}),o.jsxRuntimeExports.jsxs(qd,{children:[a&&d&&o.jsxRuntimeExports.jsx(yi,{time:d,user:a}),o.jsxRuntimeExports.jsxs(Qd,{children:[o.jsxRuntimeExports.jsx(t.Button,{size:"small",label:"Cancel",onClick:c}),o.jsxRuntimeExports.jsx(t.Button,{label:"Save",disabled:l,variant:"primary",onClick:p,size:"small"})]})]})]})};return o.jsxRuntimeExports.jsxs(Yd,{children:[S(),C()]})},ep=({open:e,onClose:n,anchorEl:r,children:i})=>{const a=o.useTheme();return o.jsxRuntimeExports.jsx(o.Popover,{anchorEl:r,open:e,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},PaperProps:{style:{width:"416px",marginTop:"6px",background:a.colors.grey5}},onClose:n,children:i})},tp=s.div`
776
+ `,Jd=({customerSatisfactionOptions:e,noteValue:n,selectedOption:r,savedOption:i,lastUpdatedBy:a,lastUpdatedTime:d,saveBtnDisabled:l,onCancel:c,onSave:p,onOptionChange:m,onNoteChange:h})=>{const S=()=>o.jsxRuntimeExports.jsx(Zd,{selectedOption:r,children:o.jsxRuntimeExports.jsx(Ad,{onChange:m,value:r,customerSatisfactionOptions:e})}),x=b=>{h&&h(b)},C=()=>{if(r==null)return null;const b=i==null?t.appLocale.getLocalizedStrings().cockpit.management.customerSatisfaction.noteLabel:i==r?"":t.appLocale.getLocalizedStrings().cockpit.management.customerSatisfaction.updateNoteLabel;return o.jsxRuntimeExports.jsxs(Xd,{children:[o.jsxRuntimeExports.jsx(zd,{label:b,onChange:x,value:n}),o.jsxRuntimeExports.jsxs(qd,{children:[a&&d&&o.jsxRuntimeExports.jsx(Si,{time:d,user:a}),o.jsxRuntimeExports.jsxs(Qd,{children:[o.jsxRuntimeExports.jsx(t.Button,{size:"small",label:"Cancel",onClick:c}),o.jsxRuntimeExports.jsx(t.Button,{label:"Save",disabled:l,variant:"primary",onClick:p,size:"small"})]})]})]})};return o.jsxRuntimeExports.jsxs(Yd,{children:[S(),C()]})},ep=({open:e,onClose:n,anchorEl:r,children:i})=>{const a=o.useTheme();return o.jsxRuntimeExports.jsx(o.Popover,{anchorEl:r,open:e,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},PaperProps:{style:{width:"416px",marginTop:"6px",background:a.colors.grey5}},onClose:n,children:i})},tp=s.div`
777
777
  display: flex;
778
778
  column-gap: ${t.Space.sp3};
779
779
  align-items: center;
780
- `,op=({customerSatisfaction:e,onSave:n})=>{const[r,i]=u.useState(),[a,d]=u.useState(),[l,c]=u.useState(""),p=u.useRef(null),m=u.useRef(null),h=u.useCallback($=>{const{savedOption:w,savedNote:O}=ts({...e,activeEntity:$});d(w),c(O)},[e]),S=u.useCallback($=>{if($!==a&&r!=null){const{savedOption:w,savedNote:O}=ts({...e,activeEntity:r});if(d($),w!=null){if($===w){c(O);return}c(Si(O));return}c("")}},[a,r,e]),x=u.useCallback($=>{c($.target.value)},[]),C=u.useCallback(($,w)=>{w.preventDefault(),i($),h($)},[h]),b=u.useCallback(()=>{i(void 0),d(void 0),c("")},[]),f=u.useCallback(()=>{const $={...e};$.customerSatisfactionId=e.customerSatisfactionId,r===Ae.CUSTOMER&&($.customerRating=a,$.customerNote=l),r===Ae.TEAM&&($.teamRating=a,$.teamNote=l),i(void 0),n($)},[a,l,r,e,n]),g=r===Ae.CUSTOMER?$o:r===Ae.TEAM?qt:{},j=jd({...e,activeEntity:r,selectedOption:a,noteValue:l}),y=()=>{const $=r===Ae.CUSTOMER?p.current:m.current;return o.jsxRuntimeExports.jsx(ep,{onClose:b,anchorEl:$,open:!!r,children:o.jsxRuntimeExports.jsx(Jd,{customerSatisfactionOptions:g,selectedOption:a,noteValue:l,lastUpdatedBy:fd({...e,activeEntity:r}),lastUpdatedTime:Cd({...e,activeEntity:r}),savedOption:r===Ae.CUSTOMER?e.customerRating:e.teamRating,saveBtnDisabled:j,onCancel:b,onSave:f,onOptionChange:S,onNoteChange:x})})};return o.jsxRuntimeExports.jsxs(tp,{children:[o.jsxRuntimeExports.jsx(os,{ref:p,savedRating:e.customerRating,isActive:r===Ae.CUSTOMER,entityType:Ae.CUSTOMER,onClick:C}),o.jsxRuntimeExports.jsx(os,{ref:m,savedRating:e.teamRating,isActive:r===Ae.TEAM,entityType:Ae.TEAM,onClick:C}),y()]})},np=({name:e,value:n,registerOptions:r})=>{const{control:i}=o.useFormContext();return o.jsxRuntimeExports.jsx(o.Controller,{name:e,control:i,defaultValue:n,rules:r,render:({field:{onChange:a}})=>o.jsxRuntimeExports.jsx(op,{customerSatisfaction:n,onSave:a})})},sp={blocked:{bgColor:new o.Color(t.Colors.importantLight),color:new o.Color(t.Colors.important),borderColor:new o.Color(t.Colors.important)},missing_info:{bgColor:new o.Color(t.Colors.importantLight),color:new o.Color(t.Colors.important),borderColor:new o.Color(t.Colors.important)},in_progress:{bgColor:new o.Color(t.Colors.alertLight),color:new o.Color(t.Colors.alertDark),borderColor:new o.Color(t.Colors.alertDark)},awaiting_client_approval:{bgColor:new o.Color(t.Colors.infoLight),color:new o.Color(t.Colors.infoDark),borderColor:new o.Color(t.Colors.infoDark)},no_info_received:{bgColor:new o.Color(t.lightColors.grey3),color:new o.Color(t.lightColors.hero),borderColor:new o.Color(t.lightColors.hero)},extension_filed:{bgColor:new o.Color(t.Colors.successLight),color:new o.Color(t.Colors.successDark),borderColor:new o.Color(t.Colors.successDark)},return_filed:{bgColor:new o.Color(t.Colors.successLight),color:new o.Color(t.Colors.successDark),borderColor:new o.Color(t.Colors.successDark)}},rp=e=>e.map(n=>({value:n,options:sp[n.code]})),ip=({onSelectionChanged:e,selectedTaxStatusIndex:n,allTaxStatuses:r})=>{const i=rp(r);return o.jsxRuntimeExports.jsx(xs,{customization:{placeholderLabel:t.appLocale.getLocalizedStrings().cockpit.management.placeholder.taxStatus},onSelectedValueChanged:a=>{const d=i.findIndex(l=>l.value.code===(a?.value).code);e(d,a?.value)},allowedValues:i,selectedValue:n!=null?i[n]:void 0})},ap=({value:e,registerOptions:n,name:r})=>{const{control:i}=o.useFormContext();return o.jsxRuntimeExports.jsx(o.Controller,{name:r,control:i,defaultValue:e,rules:n,render:({field:{value:a,onChange:d}})=>o.jsxRuntimeExports.jsx(ip,{onSelectionChanged:l=>d({allGroups:e.allTaxStatuses,selectedValue:e.allTaxStatuses[l]}),selectedTaxStatusIndex:e.allTaxStatuses.findIndex(l=>l.code===a.selectedValue?.code),allTaxStatuses:e.allTaxStatuses})})},Wt=e=>le.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M6 8H10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M6 6H10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M9.5 14.5C9.62209 14.5 9.73252 14.4545 9.81934 14.3818C9.83066 14.3724 9.843 14.364 9.85352 14.3535L13.3535 10.8535C13.4221 10.7849 13.4706 10.6965 13.4902 10.5977C13.4966 10.5657 13.5 10.533 13.5 10.5V2.5C13.5 2.23479 13.3946 1.98051 13.207 1.79297C13.0195 1.60543 12.7652 1.5 12.5 1.5H3.5C3.23478 1.5 2.98051 1.60543 2.79297 1.79297C2.60543 1.98051 2.5 2.23478 2.5 2.5V13.5C2.5 13.7652 2.60543 14.0195 2.79297 14.207C2.9805 14.3946 3.23478 14.5 3.5 14.5H9.5ZM3.5 2.5H12.5V10H9.5C9.22386 10 9 10.2239 9 10.5V13.5H3.5V2.5ZM10 11H11.793L10 12.793V11Z",fill:"currentColor"})),fi=e=>le.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M11 14.9629H2V3.86499",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M10.0559 8.31177H11.7836",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M10.0559 5.7395H11.7836",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M6.52014 5.73978L7.163 6.38264L8.44871 5.09692",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M6.52014 8.31107L7.163 8.95393L8.44871 7.66821",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M13.5591 1.02539H4.74212C4.49865 1.02539 4.30127 1.36118 4.30127 1.77539V12.2754C4.30127 12.6896 4.49865 13.0254 4.74212 13.0254H13.5591C13.8026 13.0254 14 12.6896 14 12.2754V1.77539C14 1.36118 13.8026 1.02539 13.5591 1.02539Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{cockpit:{management:{placeholder:Fs,editMonthInsight:lp,createMonthInsight:cp,monthInsightSent:dp,monthInsightNotReady:pp,monthInsightsCanBeSentFromDashboard:up,sendMonthInsightsFromDashboardWhenReady:mp,monthInsightsCanBeEditedFromDashboard:xp,monthEndHistoryUnavailable:hp}},dateFormat:Ci,common:fo}=t.appLocale.getLocalizedStrings(),gp=["status","group","reportSent","taxStatus","customerSatisfaction"],Sp=({reportSent:e,hasMonthEndEmailHistory:n,onReportSentClick:r})=>{if(e.date==null)return o.jsxRuntimeExports.jsx(hn,{children:fo.strings.hyphen});const i=`${fo.datePicker.businessDay} ${e.businessDay??fo.strings.empty}${fo.strings.colon} ${e.date.format(Ci.visual.DMMMFormat)}`;return n?o.jsxRuntimeExports.jsx(hn,{onClick:r,children:i}):o.jsxRuntimeExports.jsx(t.Tooltip,{placement:"bottom-end",variant:"small-description",data:hp,style:{color:t.Colors.championDark,marginTop:t.Space.sp2},display:"flex",children:o.jsxRuntimeExports.jsx(hn,{children:i})})},yp=({companyView:e,hasMonthEndEmailHistory:n,companiesExcludedFromMonthEndReport:r,showDetailsPageLink:i,allUsers:a,loggedInUserRole:d,companyNameSticky:l,totalHeight:c,isExpenseAutomationEnabledForUser:p,addThreadRequestThreadId:m,targetElementFromNavigation:h,resetTargetElementFromNavigation:S,setNoteData:x,setElementRef:C,setAddThreadRequestThreadId:b,changeHandlers:f,onCompanyNameClicked:g,onPassportIconClicked:j,onTaskIconClicked:y,onViewDetailsLinkClicked:$,onMonthEndReportPageClick:w,showMonthEndReportHistoricData:O})=>{const[A,v]=u.useState(null),T=t.useWindowSizeContext(),F=o.useForm({mode:"all"}),[I,K]=u.useState(!1),{companyId:M,name:Y}=e.company.company.companyInfo,G=["companyData.status","companyData.group","companyData.controller","companyData.customerSuccessManager","companyData.preparer","companyData.reviewer","companyData.apAnalyst","companyData.reportSent","companyData.taxStatus","companyData.taxLead","companyData.customerSatisfaction"],E=`cockpit_${M}`,P="management.notes",{threads:W,isLoading:k}=t.useFilteredThreads({entityType:P,companyId:M},!1),{openThread:D,threads:z,addThread:Z,removeThread:ie,setOpenThread:N}=u.useContext(t.ThreadsContext),H=D!==null?z.get(D):null,L=D?.includes(M)===!0,Q=D!=null&&z.get(D)==null&&L,se=m!=null&&z.get(m)?.metadata.companyId===M,X=(B,pe)=>{G.includes(B)&&f(M,pe)};u.useEffect(()=>{const B=F.watch((pe,{name:ye})=>{ye!=null&&pe.companyData!=null&&o.defer(()=>X(ye,Np(pe.companyData,ye)))});return()=>{B.unsubscribe()}});const re=Op(e,a),te=()=>{e.company.schema.status.length===0?K(!0):g(e)},he=()=>{w?.(e)},fe=d?.userRoles?.includes("admin"),be=e.company.company.configInfo.isMonthEndReportInDraft,_=ee.canSendMonthEndEmailReport(e,r),J=ee.shouldEnableCalendarPickerForLastReportSent(e,r),ge=e.company.company.companyInfo.bookCloseDate,ve=e.company.company.managementInfo.lastReportSentDate,Re=e.taskSummary?.count??0,R=u.useCallback(()=>{D?.includes(t.NEW_THREAD_SUFFIX)===!0&&ie(D),m!=null&&b(void 0)},[m,D,ie,b]),Ce=u.useCallback(B=>{if(B===D)N(null);else if(z.has(B))N(B);else if(B.includes(t.NEW_THREAD_SUFFIX)){const[pe,ye]=B.replace(t.NEW_THREAD_SUFFIX,"").split("."),ke=Ft(Ct(pe),ee.toManagementSortKeyType(ye),M,Y);Z(B,{type:"thread",id:B,roomId:E,createdAt:new Date,updatedAt:new Date,comments:[],metadata:ke,resolved:!1}),N(B)}},[M,Y,D,z,Z,N,E]),ae=u.useCallback((B,pe,ye=!1)=>{const ke=St.find(ue=>ue.key===pe);if(S(),ke!=null&&(B.type==="contextmenu"||ye===!0)){if(ke.isThreadAllowed===!1)return;R(),B.preventDefault(),B.stopPropagation();const ue=t.toCollaborationEntityType({tab:"management",key:ke.key});if(B.target instanceof HTMLElement||B.target instanceof SVGElement)if(ye===!0&&B.target instanceof HTMLElement)v(B.target.parentElement);else if(B.target instanceof HTMLElement){const Pe=ms(B.target,oe);v(Pe||B.target)}else{const Pe=B.target.closest(`.${oe}`);Pe instanceof HTMLElement&&v(Pe)}const U=[...t.getFilteredThreads(z,{entityType:ue,companyId:M},"both")],Oe=U.length>0&&U[0].length>0?U[0][0]:Le("management",ke.key,M);z.has(Oe)?Ce(Oe):m===Oe?b(void 0):(b(Oe),N(null))}},[z,M,m,Ce,b,N,S,R]),ce=u.useCallback((B,pe)=>{B.stopPropagation();const ye=Le("management",pe,M);b(void 0),Ce(ye)},[M,b,Ce]),$e=()=>{re.reportSent.date!=null&&O(M,re.reportSent.date)},V=B=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:B.isElementThreadOpen??!1,isElementThreadPresent:B.isElementThreadPresent??!1,itemKey:B.itemKey,elementThreadId:B.elementThreadId??"",roomId:E,addThreadRequestThreadId:m,openThreadId:D,threadStyle:B.threadStyle,openThreadMetadata:H?.metadata??null,onElementClick:ae,onAddThreadClick:ce,targetElement:h??A});return o.jsxRuntimeExports.jsxs(o.FormProvider,{...F,children:[I===!0?o.jsxRuntimeExports.jsx(rd,{companyDomain:e.company.company.companyInfo.primaryEmailDomain,hasAdminRole:fe,onCancelClick:()=>K(!1),onConnectClick:()=>g(e)}):null,o.jsxRuntimeExports.jsx("form",{style:{height:"100%"},children:o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{S(),m!=null&&(b(void 0),m.includes(t.NEW_THREAD_SUFFIX)&&ie(m))},children:o.jsxRuntimeExports.jsx(fp,{windowSize:T,hoverParentSubsidiaryTag:i??!1,isThreadOpen:L||se,totalHeight:c,isCreationInProgress:Q,children:St.map((B,pe)=>{const ye=t.toCollaborationEntityType({tab:"management",key:B.key}),ke=St.length-2<=pe,ue=[...t.getFilteredThreads(z,{entityType:ye,companyId:M},"both")],U=ue.length>0&&ue[0].length>0?ue[0][0]:Le("management",B.key,M),Oe=z.get(U),Pe=Oe!=null&&Oe.resolved===!1,Fe=U===D,me=m===U;switch(B.key){case"companyName":return o.jsxRuntimeExports.jsxs($p,{companyNameSticky:l,columnWidth:B.width,windowSize:T,isThreadOpen:Fe||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),ref:q=>{C(M,B.key,q)},children:[o.jsxRuntimeExports.jsxs(bp,{children:[o.jsxRuntimeExports.jsx(Rp,{className:"company-name",onClick:q=>{q.preventDefault(),q.stopPropagation(),te()},children:re.companyName}),re.parentSubsidiaryInfo&&o.jsxRuntimeExports.jsx(vc,{companyId:re.companyId,isEnabled:i,onViewDetailsLinkClicked:$,companyName:re.companyName,parentSubsidiaryRelationship:re.parentSubsidiaryInfo}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:Fe,targetElement:h??A,roomId:E,openThreadId:D,openThreadMetadata:H?.metadata??null})]}),o.jsxRuntimeExports.jsxs(Ep,{children:[o.jsxRuntimeExports.jsxs(kp,{onClick:q=>{q.preventDefault(),x({roomId:E,companyId:M,companyName:Y,entityType:P})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:W.length,isLoading:k}),o.jsxRuntimeExports.jsx(Tp,{})]}),o.jsxRuntimeExports.jsx(wp,{onClick:q=>{q.preventDefault(),j(e)},children:o.jsxRuntimeExports.jsx(vp,{className:"passportIcon"})})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:Pe,itemKey:B.key,style:{left:t.Space.sp4},onElementClick:ae}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("management",B.key,M),addThreadRequestThreadId:m,itemKey:B.key,onAddThreadClick:ce})]},U);case"task":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[o.jsxRuntimeExports.jsxs(Lp,{onClick:q=>{q.preventDefault(),y?.(e)},children:[o.jsxRuntimeExports.jsx(Pp,{}),Re>0?o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{isLoading:!1,count:Re}):null]}),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"status":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[o.jsxRuntimeExports.jsx(Uc,{name:"companyData.status",value:re.status}),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"group":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[o.jsxRuntimeExports.jsx(gd,{name:"companyData.group",value:re.group}),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"plans":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[o.jsxRuntimeExports.jsx(cd,{chips:re.plansAndAddons}),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"satisfaction":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},windowSize:T,columnWidth:B.width,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[o.jsxRuntimeExports.jsx(np,{name:"companyData.customerSatisfaction",value:re.customerSatisfaction}),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"bookCloseDate":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[ge?.format(Ci.visual.MMMDCommaYYYYformat)??fo.strings.hyphen,V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"reportSent":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),style:{alignItems:"center"},children:[J&&o.jsxRuntimeExports.jsx(jp,{children:o.jsxRuntimeExports.jsx(t.ZeniDatePickerField,{name:"companyData.reportSent",defaultValue:re.reportSent})}),!J&&o.jsxRuntimeExports.jsx(Sp,{reportSent:re.reportSent,onReportSentClick:$e,hasMonthEndEmailHistory:n}),o.jsxRuntimeExports.jsx(Cp,{children:p?o.jsxRuntimeExports.jsx(Fp,{isMonthEndReportInDraft:be,bookCloseDate:ge,lastReportSentDate:ve,enableCompanyMonthEndReportBtn:_,handleMonthEndReportPageClick:he}):o.jsxRuntimeExports.jsx(ns,{isMonthEndReportInDraft:be,bookCloseDate:ge,lastReportSentDate:ve,enableCompanyMonthEndReportBtn:_,isExpenseAutomationEnabledForUser:p,handleMonthEndReportPageClick:he})}),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"customerSuccessManager":case"preparer":case"reviewer":case"apAnalyst":case"controller":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:`companyData.${B.key}`,value:re[B.key],placeholderLabel:Fs[B.key],pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"taxStatus":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[o.jsxRuntimeExports.jsx(ap,{name:"companyData.taxStatus",value:re.taxStatus}),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"taxLead":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:"companyData.taxLead",value:re.taxLead,placeholderLabel:Fs.taxLead,pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"monthlyRecurringRevenue":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[t.amountToString("0,0",re.monthlyRecurringRevenue),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"annualRecurringRevenue":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[t.amountToString("0,0",re.annualRecurringRevenue),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);default:return null}})})})})]})},ns=({enableCompanyMonthEndReportBtn:e,isMonthEndReportInDraft:n,isExpenseAutomationEnabledForUser:r,bookCloseDate:i,lastReportSentDate:a,handleMonthEndReportPageClick:d})=>o.jsxRuntimeExports.jsx(t.Button,{size:"small",onClick:d,variant:"primary",label:zp(e,n,i,a),disabled:!e||r,style:e?{}:{background:"transparent"},prefixIcon:e&&n?o.jsxRuntimeExports.jsx(Ip,{}):void 0}),fp=s.div`
780
+ `,op=({customerSatisfaction:e,onSave:n})=>{const[r,i]=u.useState(),[a,d]=u.useState(),[l,c]=u.useState(""),p=u.useRef(null),m=u.useRef(null),h=u.useCallback($=>{const{savedOption:w,savedNote:O}=es({...e,activeEntity:$});d(w),c(O)},[e]),S=u.useCallback($=>{if($!==a&&r!=null){const{savedOption:w,savedNote:O}=es({...e,activeEntity:r});if(d($),w!=null){if($===w){c(O);return}c(gi(O));return}c("")}},[a,r,e]),x=u.useCallback($=>{c($.target.value)},[]),C=u.useCallback(($,w)=>{w.preventDefault(),i($),h($)},[h]),b=u.useCallback(()=>{i(void 0),d(void 0),c("")},[]),f=u.useCallback(()=>{const $={...e};$.customerSatisfactionId=e.customerSatisfactionId,r===Ae.CUSTOMER&&($.customerRating=a,$.customerNote=l),r===Ae.TEAM&&($.teamRating=a,$.teamNote=l),i(void 0),n($)},[a,l,r,e,n]),g=r===Ae.CUSTOMER?$o:r===Ae.TEAM?qt:{},j=jd({...e,activeEntity:r,selectedOption:a,noteValue:l}),y=()=>{const $=r===Ae.CUSTOMER?p.current:m.current;return o.jsxRuntimeExports.jsx(ep,{onClose:b,anchorEl:$,open:!!r,children:o.jsxRuntimeExports.jsx(Jd,{customerSatisfactionOptions:g,selectedOption:a,noteValue:l,lastUpdatedBy:fd({...e,activeEntity:r}),lastUpdatedTime:Cd({...e,activeEntity:r}),savedOption:r===Ae.CUSTOMER?e.customerRating:e.teamRating,saveBtnDisabled:j,onCancel:b,onSave:f,onOptionChange:S,onNoteChange:x})})};return o.jsxRuntimeExports.jsxs(tp,{children:[o.jsxRuntimeExports.jsx(ts,{ref:p,savedRating:e.customerRating,isActive:r===Ae.CUSTOMER,entityType:Ae.CUSTOMER,onClick:C}),o.jsxRuntimeExports.jsx(ts,{ref:m,savedRating:e.teamRating,isActive:r===Ae.TEAM,entityType:Ae.TEAM,onClick:C}),y()]})},np=({name:e,value:n,registerOptions:r})=>{const{control:i}=o.useFormContext();return o.jsxRuntimeExports.jsx(o.Controller,{name:e,control:i,defaultValue:n,rules:r,render:({field:{onChange:a}})=>o.jsxRuntimeExports.jsx(op,{customerSatisfaction:n,onSave:a})})},sp={blocked:{bgColor:new o.Color(t.Colors.importantLight),color:new o.Color(t.Colors.important),borderColor:new o.Color(t.Colors.important)},missing_info:{bgColor:new o.Color(t.Colors.importantLight),color:new o.Color(t.Colors.important),borderColor:new o.Color(t.Colors.important)},in_progress:{bgColor:new o.Color(t.Colors.alertLight),color:new o.Color(t.Colors.alertDark),borderColor:new o.Color(t.Colors.alertDark)},awaiting_client_approval:{bgColor:new o.Color(t.Colors.infoLight),color:new o.Color(t.Colors.infoDark),borderColor:new o.Color(t.Colors.infoDark)},no_info_received:{bgColor:new o.Color(t.lightColors.grey3),color:new o.Color(t.lightColors.hero),borderColor:new o.Color(t.lightColors.hero)},extension_filed:{bgColor:new o.Color(t.Colors.successLight),color:new o.Color(t.Colors.successDark),borderColor:new o.Color(t.Colors.successDark)},return_filed:{bgColor:new o.Color(t.Colors.successLight),color:new o.Color(t.Colors.successDark),borderColor:new o.Color(t.Colors.successDark)}},rp=e=>e.map(n=>({value:n,options:sp[n.code]})),ip=({onSelectionChanged:e,selectedTaxStatusIndex:n,allTaxStatuses:r})=>{const i=rp(r);return o.jsxRuntimeExports.jsx(ms,{customization:{placeholderLabel:t.appLocale.getLocalizedStrings().cockpit.management.placeholder.taxStatus},onSelectedValueChanged:a=>{const d=i.findIndex(l=>l.value.code===(a?.value).code);e(d,a?.value)},allowedValues:i,selectedValue:n!=null?i[n]:void 0})},ap=({value:e,registerOptions:n,name:r})=>{const{control:i}=o.useFormContext();return o.jsxRuntimeExports.jsx(o.Controller,{name:r,control:i,defaultValue:e,rules:n,render:({field:{value:a,onChange:d}})=>o.jsxRuntimeExports.jsx(ip,{onSelectionChanged:l=>d({allGroups:e.allTaxStatuses,selectedValue:e.allTaxStatuses[l]}),selectedTaxStatusIndex:e.allTaxStatuses.findIndex(l=>l.code===a.selectedValue?.code),allTaxStatuses:e.allTaxStatuses})})},Wt=e=>le.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M6 8H10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M6 6H10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M9.5 14.5C9.62209 14.5 9.73252 14.4545 9.81934 14.3818C9.83066 14.3724 9.843 14.364 9.85352 14.3535L13.3535 10.8535C13.4221 10.7849 13.4706 10.6965 13.4902 10.5977C13.4966 10.5657 13.5 10.533 13.5 10.5V2.5C13.5 2.23479 13.3946 1.98051 13.207 1.79297C13.0195 1.60543 12.7652 1.5 12.5 1.5H3.5C3.23478 1.5 2.98051 1.60543 2.79297 1.79297C2.60543 1.98051 2.5 2.23478 2.5 2.5V13.5C2.5 13.7652 2.60543 14.0195 2.79297 14.207C2.9805 14.3946 3.23478 14.5 3.5 14.5H9.5ZM3.5 2.5H12.5V10H9.5C9.22386 10 9 10.2239 9 10.5V13.5H3.5V2.5ZM10 11H11.793L10 12.793V11Z",fill:"currentColor"})),yi=e=>le.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M11 14.9629H2V3.86499",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M10.0559 8.31177H11.7836",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M10.0559 5.7395H11.7836",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M6.52014 5.73978L7.163 6.38264L8.44871 5.09692",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M6.52014 8.31107L7.163 8.95393L8.44871 7.66821",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M13.5591 1.02539H4.74212C4.49865 1.02539 4.30127 1.36118 4.30127 1.77539V12.2754C4.30127 12.6896 4.49865 13.0254 4.74212 13.0254H13.5591C13.8026 13.0254 14 12.6896 14 12.2754V1.77539C14 1.36118 13.8026 1.02539 13.5591 1.02539Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{cockpit:{management:{placeholder:Fs,editMonthInsight:lp,createMonthInsight:cp,monthInsightSent:dp,monthInsightNotReady:pp,monthInsightsCanBeSentFromDashboard:up,sendMonthInsightsFromDashboardWhenReady:mp,monthInsightsCanBeEditedFromDashboard:xp,monthEndHistoryUnavailable:hp}},dateFormat:fi,common:fo}=t.appLocale.getLocalizedStrings(),gp=["status","group","reportSent","taxStatus","customerSatisfaction"],Sp=({reportSent:e,hasMonthEndEmailHistory:n,onReportSentClick:r})=>{if(e.date==null)return o.jsxRuntimeExports.jsx(xn,{children:fo.strings.hyphen});const i=`${fo.datePicker.businessDay} ${e.businessDay??fo.strings.empty}${fo.strings.colon} ${e.date.format(fi.visual.DMMMFormat)}`;return n?o.jsxRuntimeExports.jsx(xn,{onClick:r,children:i}):o.jsxRuntimeExports.jsx(t.Tooltip,{placement:"bottom-end",variant:"small-description",data:hp,style:{color:t.Colors.championDark,marginTop:t.Space.sp2},display:"flex",children:o.jsxRuntimeExports.jsx(xn,{children:i})})},yp=({companyView:e,hasMonthEndEmailHistory:n,companiesExcludedFromMonthEndReport:r,showDetailsPageLink:i,allUsers:a,loggedInUserRole:d,companyNameSticky:l,totalHeight:c,isExpenseAutomationEnabledForUser:p,addThreadRequestThreadId:m,targetElementFromNavigation:h,resetTargetElementFromNavigation:S,setNoteData:x,setElementRef:C,setAddThreadRequestThreadId:b,changeHandlers:f,onCompanyNameClicked:g,onPassportIconClicked:j,onTaskIconClicked:y,onViewDetailsLinkClicked:$,onMonthEndReportPageClick:w,showMonthEndReportHistoricData:O})=>{const[A,v]=u.useState(null),T=t.useWindowSizeContext(),F=o.useForm({mode:"all"}),[I,K]=u.useState(!1),{companyId:M,name:Y}=e.company.company.companyInfo,G=["companyData.status","companyData.group","companyData.controller","companyData.customerSuccessManager","companyData.preparer","companyData.reviewer","companyData.apAnalyst","companyData.reportSent","companyData.taxStatus","companyData.taxLead","companyData.customerSatisfaction"],E=`cockpit_${M}`,P="management.notes",{threads:W,isLoading:k}=t.useFilteredThreads({entityType:P,companyId:M},!1),{openThread:D,threads:z,addThread:Z,removeThread:ie,setOpenThread:N}=u.useContext(t.ThreadsContext),H=D!==null?z.get(D):null,L=D?.includes(M)===!0,Q=D!=null&&z.get(D)==null&&L,se=m!=null&&z.get(m)?.metadata.companyId===M,X=(B,pe)=>{G.includes(B)&&f(M,pe)};u.useEffect(()=>{const B=F.watch((pe,{name:ye})=>{ye!=null&&pe.companyData!=null&&o.defer(()=>X(ye,Np(pe.companyData,ye)))});return()=>{B.unsubscribe()}});const re=Op(e,a),te=()=>{e.company.schema.status.length===0?K(!0):g(e)},he=()=>{w?.(e)},fe=d?.userRoles?.includes("admin"),be=e.company.company.configInfo.isMonthEndReportInDraft,_=J.canSendMonthEndEmailReport(e,r),ee=J.shouldEnableCalendarPickerForLastReportSent(e,r),ge=e.company.company.companyInfo.bookCloseDate,ve=e.company.company.managementInfo.lastReportSentDate,Re=e.taskSummary?.count??0,R=u.useCallback(()=>{D?.includes(t.NEW_THREAD_SUFFIX)===!0&&ie(D),m!=null&&b(void 0)},[m,D,ie,b]),Ce=u.useCallback(B=>{if(B===D)N(null);else if(z.has(B))N(B);else if(B.includes(t.NEW_THREAD_SUFFIX)){const[pe,ye]=B.replace(t.NEW_THREAD_SUFFIX,"").split("."),ke=Ft(jt(pe),J.toManagementSortKeyType(ye),M,Y);Z(B,{type:"thread",id:B,roomId:E,createdAt:new Date,updatedAt:new Date,comments:[],metadata:ke,resolved:!1}),N(B)}},[M,Y,D,z,Z,N,E]),ae=u.useCallback((B,pe,ye=!1)=>{const ke=yt.find(ue=>ue.key===pe);if(S(),ke!=null&&(B.type==="contextmenu"||ye===!0)){if(ke.isThreadAllowed===!1)return;R(),B.preventDefault(),B.stopPropagation();const ue=t.toCollaborationEntityType({tab:"management",key:ke.key});if(B.target instanceof HTMLElement||B.target instanceof SVGElement)if(ye===!0&&B.target instanceof HTMLElement)v(B.target.parentElement);else if(B.target instanceof HTMLElement){const Pe=us(B.target,oe);v(Pe||B.target)}else{const Pe=B.target.closest(`.${oe}`);Pe instanceof HTMLElement&&v(Pe)}const U=[...t.getFilteredThreads(z,{entityType:ue,companyId:M},"both")],Oe=U.length>0&&U[0].length>0?U[0][0]:Le("management",ke.key,M);z.has(Oe)?Ce(Oe):m===Oe?b(void 0):(b(Oe),N(null))}},[z,M,m,Ce,b,N,S,R]),ce=u.useCallback((B,pe)=>{B.stopPropagation();const ye=Le("management",pe,M);b(void 0),Ce(ye)},[M,b,Ce]),$e=()=>{re.reportSent.date!=null&&O(M,re.reportSent.date)},V=B=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:B.isElementThreadOpen??!1,isElementThreadPresent:B.isElementThreadPresent??!1,itemKey:B.itemKey,elementThreadId:B.elementThreadId??"",roomId:E,addThreadRequestThreadId:m,openThreadId:D,threadStyle:B.threadStyle,openThreadMetadata:H?.metadata??null,onElementClick:ae,onAddThreadClick:ce,targetElement:h??A});return o.jsxRuntimeExports.jsxs(o.FormProvider,{...F,children:[I===!0?o.jsxRuntimeExports.jsx(rd,{companyDomain:e.company.company.companyInfo.primaryEmailDomain,hasAdminRole:fe,onCancelClick:()=>K(!1),onConnectClick:()=>g(e)}):null,o.jsxRuntimeExports.jsx("form",{style:{height:"100%"},children:o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{S(),m!=null&&(b(void 0),m.includes(t.NEW_THREAD_SUFFIX)&&ie(m))},children:o.jsxRuntimeExports.jsx(fp,{windowSize:T,hoverParentSubsidiaryTag:i??!1,isThreadOpen:L||se,totalHeight:c,isCreationInProgress:Q,children:yt.map((B,pe)=>{const ye=t.toCollaborationEntityType({tab:"management",key:B.key}),ke=yt.length-2<=pe,ue=[...t.getFilteredThreads(z,{entityType:ye,companyId:M},"both")],U=ue.length>0&&ue[0].length>0?ue[0][0]:Le("management",B.key,M),Oe=z.get(U),Pe=Oe!=null&&Oe.resolved===!1,Fe=U===D,me=m===U;switch(B.key){case"companyName":return o.jsxRuntimeExports.jsxs($p,{companyNameSticky:l,columnWidth:B.width,windowSize:T,isThreadOpen:Fe||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),ref:q=>{C(M,B.key,q)},children:[o.jsxRuntimeExports.jsxs(bp,{children:[o.jsxRuntimeExports.jsx(Rp,{className:"company-name",onClick:q=>{q.preventDefault(),q.stopPropagation(),te()},children:re.companyName}),re.parentSubsidiaryInfo&&o.jsxRuntimeExports.jsx(vc,{companyId:re.companyId,isEnabled:i,onViewDetailsLinkClicked:$,companyName:re.companyName,parentSubsidiaryRelationship:re.parentSubsidiaryInfo}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:Fe,targetElement:h??A,roomId:E,openThreadId:D,openThreadMetadata:H?.metadata??null})]}),o.jsxRuntimeExports.jsxs(Ep,{children:[o.jsxRuntimeExports.jsxs(kp,{onClick:q=>{q.preventDefault(),x({roomId:E,companyId:M,companyName:Y,entityType:P})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:W.length,isLoading:k}),o.jsxRuntimeExports.jsx(Tp,{})]}),o.jsxRuntimeExports.jsx(wp,{onClick:q=>{q.preventDefault(),j(e)},children:o.jsxRuntimeExports.jsx(vp,{className:"passportIcon"})})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:Pe,itemKey:B.key,style:{left:t.Space.sp4},onElementClick:ae}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("management",B.key,M),addThreadRequestThreadId:m,itemKey:B.key,onAddThreadClick:ce})]},U);case"task":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[o.jsxRuntimeExports.jsxs(Lp,{onClick:q=>{q.preventDefault(),y?.(e)},children:[o.jsxRuntimeExports.jsx(Pp,{}),Re>0?o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{isLoading:!1,count:Re}):null]}),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"status":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[o.jsxRuntimeExports.jsx(Uc,{name:"companyData.status",value:re.status}),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"group":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[o.jsxRuntimeExports.jsx(gd,{name:"companyData.group",value:re.group}),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"plans":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[o.jsxRuntimeExports.jsx(cd,{chips:re.plansAndAddons}),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"satisfaction":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},windowSize:T,columnWidth:B.width,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[o.jsxRuntimeExports.jsx(np,{name:"companyData.customerSatisfaction",value:re.customerSatisfaction}),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"bookCloseDate":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[ge?.format(fi.visual.MMMDCommaYYYYformat)??fo.strings.hyphen,V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"reportSent":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),style:{alignItems:"center"},children:[ee&&o.jsxRuntimeExports.jsx(jp,{children:o.jsxRuntimeExports.jsx(t.ZeniDatePickerField,{name:"companyData.reportSent",defaultValue:re.reportSent})}),!ee&&o.jsxRuntimeExports.jsx(Sp,{reportSent:re.reportSent,onReportSentClick:$e,hasMonthEndEmailHistory:n}),o.jsxRuntimeExports.jsx(Cp,{children:p?o.jsxRuntimeExports.jsx(Fp,{isMonthEndReportInDraft:be,bookCloseDate:ge,lastReportSentDate:ve,enableCompanyMonthEndReportBtn:_,handleMonthEndReportPageClick:he}):o.jsxRuntimeExports.jsx(os,{isMonthEndReportInDraft:be,bookCloseDate:ge,lastReportSentDate:ve,enableCompanyMonthEndReportBtn:_,isExpenseAutomationEnabledForUser:p,handleMonthEndReportPageClick:he})}),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"customerSuccessManager":case"preparer":case"reviewer":case"apAnalyst":case"controller":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:`companyData.${B.key}`,value:re[B.key],placeholderLabel:Fs[B.key],pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"taxStatus":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[o.jsxRuntimeExports.jsx(ap,{name:"companyData.taxStatus",value:re.taxStatus}),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"taxLead":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:"companyData.taxLead",value:re.taxLead,placeholderLabel:Fs.taxLead,pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"monthlyRecurringRevenue":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[t.amountToString("0,0",re.monthlyRecurringRevenue),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);case"annualRecurringRevenue":return o.jsxRuntimeExports.jsxs(et,{ref:q=>{C(M,B.key,q)},columnWidth:B.width,windowSize:T,isThreadOpen:L||me,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:q=>ae(q,B.key),children:[t.amountToString("0,0",re.annualRecurringRevenue),V({isElementThreadOpen:Fe,isElementThreadPresent:Pe,itemKey:B.key,elementThreadId:U,threadStyle:ke?{right:t.Space.sp0}:void 0})]},U);default:return null}})})})})]})},os=({enableCompanyMonthEndReportBtn:e,isMonthEndReportInDraft:n,isExpenseAutomationEnabledForUser:r,bookCloseDate:i,lastReportSentDate:a,handleMonthEndReportPageClick:d})=>o.jsxRuntimeExports.jsx(t.Button,{size:"small",onClick:d,variant:"primary",label:zp(e,n,i,a),disabled:!e||r,style:e?{}:{background:"transparent"},prefixIcon:e&&n?o.jsxRuntimeExports.jsx(Ip,{}):void 0}),fp=s.div`
781
781
  display: flex;
782
782
  flex-direction: row;
783
783
  align-items: center;
@@ -848,7 +848,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
848
848
  z-index: auto;
849
849
  cursor: ${e=>e.isThreadAllowed?"pointer":"initial"};
850
850
  position: relative;
851
- `,hn=s(t.LargeRegularSp)`
851
+ `,xn=s(t.LargeRegularSp)`
852
852
  width: 110px;
853
853
  color: ${e=>e.theme.colors.hero};
854
854
  text-align: center;
@@ -918,7 +918,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
918
918
  `,Lp=s.div`
919
919
  display: flex;
920
920
  position: relative;
921
- `,Pp=s(fi)`
921
+ `,Pp=s(yi)`
922
922
  height: ${t.Space.sp4};
923
923
  width: ${t.Space.sp4};
924
924
  color: ${e=>e.theme.colors.hero};
@@ -930,7 +930,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
930
930
  width: 12px;
931
931
  height: 12px;
932
932
  color: ${e=>e.theme.colors.grey5};
933
- `,Dp=e=>{const n=[];return e.subscriptions.forEach(r=>{r.plan&&n.push(r.plan.plan.zeniSku)}),n},Ap=e=>{const n=[];return e.subscriptions.forEach(r=>{r.addOns.forEach(i=>{i.addOn.zeniSku!=null&&n.push(i.addOn.zeniSku)})}),n};function Op(e,n){return{companyName:e.company.company.companyInfo.name,companyId:e.company.company.companyInfo.companyId,parentSubsidiaryInfo:e.company.company.parentSubsidiaryInfo,status:{allStatuses:e.company.schema.status,selectedValue:e.company.schema.status.find(r=>r.code===e.company.company.managementInfo.statusCode)},group:{allGroups:e.company.schema.companyGroup,selectedValue:e.company.schema.companyGroup.find(r=>r.id===e.company.company.managementInfo.companyGroupId)},plansAndAddons:ud([...new Set(Dp(e).concat(Ap(e)))]),controller:{allUsers:n,selectedUsers:e.controllers.map(r=>r.user)},customerSuccessManager:{allUsers:n,selectedUsers:e.customerSuccessManagers.map(r=>r.user)},preparer:{allUsers:n,selectedUsers:e.preparers.map(r=>r.user)},reviewer:{allUsers:n,selectedUsers:e.reviewers.map(r=>r.user)},apAnalyst:{allUsers:n,selectedUsers:e.apAnalysts.map(r=>r.user)},reportSent:{showBusinessDay:!0,maxDate:ee.dateNow(),date:e.company.company.managementInfo.lastReportSentDate,businessDay:e.company.company.managementInfo.lastReportSentBusinessDay},taxStatus:{allTaxStatuses:e.company.schema.taxStatus,selectedValue:e.company.schema.taxStatus.find(r=>r.code===e.company.company.managementInfo.taxStatusCode)},taxLead:{allUsers:n,selectedUsers:e.taxLeads.map(r=>r.user)},monthlyRecurringRevenue:e.primarySubscription?.summary?.summary.monthlyRecurringRevenue,annualRecurringRevenue:e.primarySubscription?.summary?.summary.annualRecurringRevenue,customerSatisfaction:e.company.company.managementInfo.customerSatisfaction??{customerNote:"",teamNote:""}}}function Np(e,n){const r={};r.users=[];const i=n.split(".")[1];if(Mp(i))return{[i]:e[i]};{const{selectedUsers:a,deSelectedUsers:d}=e[i];return d==null||d?.length==0?a.forEach(l=>{l.isUserSelectionUpdated===!0&&r.users?.push(Ws(i,l.userId,l.isRoleSelected))}):d.forEach(l=>{r.users?.push(Ws(i,l.userId,l.isRoleSelected))}),{users:r.users}}}const Mp=e=>gp.includes(e);function Ws(e,n,r){switch(e){case"apAnalyst":return{isZeni:!0,role:ee.toUserRoleType("ap_analyst"),userId:n,isSelected:r};case"taxLead":return{isZeni:!0,role:ee.toUserRoleType("tax_lead"),userId:n,isSelected:r};case"customerSuccessManager":return{isZeni:!0,role:ee.toUserRoleType("customer_success_manager"),userId:n,isSelected:r};case"controller":case"reviewer":case"preparer":default:return{isZeni:!0,role:e,userId:n,isSelected:r}}}const zp=(e,n,r,i)=>{const a=t.appLocale.getLocalizedStrings().dateFormat.visual.MMMMFormat,d=ee.dateNow().subtract(1,"month").format(a),l=ee.dateNow().startOf("month").subtract(1,"day"),c=r?.isSame(l)===!0&&i?.isAfter(r);return e?n?lp.replace("__month__",d):cp.replace("__month__",d):c===!0?dp.replace("__month__",d):pp.replace("__month__",d)},Fp=({enableCompanyMonthEndReportBtn:e,isMonthEndReportInDraft:n,bookCloseDate:r,lastReportSentDate:i,handleMonthEndReportPageClick:a})=>{const d=ee.dateNow().startOf("month").subtract(1,"day"),l=r?.isSame(d)===!0&&i?.isAfter(r),c=e?n?xp:up:l===!0?null:mp;return c!=null?o.jsxRuntimeExports.jsx(t.Tooltip,{display:"block",placement:"bottom",maxWidth:"250",title:c,enterDelay:600,children:o.jsxRuntimeExports.jsx(ns,{isMonthEndReportInDraft:n,bookCloseDate:r,lastReportSentDate:i,enableCompanyMonthEndReportBtn:e,isExpenseAutomationEnabledForUser:!0,handleMonthEndReportPageClick:a})}):o.jsxRuntimeExports.jsx(ns,{isMonthEndReportInDraft:n,bookCloseDate:r,lastReportSentDate:i,enableCompanyMonthEndReportBtn:e,isExpenseAutomationEnabledForUser:!0,handleMonthEndReportPageClick:a})};function Wp({companyNameSticky:e,sortConfig:n,onColumnSortConfigChanged:r}){const i=t.useWindowSizeContext(),[a,d]=u.useState(o.cloneDeep(St));u.useEffect(()=>{const c=[...a];for(const p of c)p.key===n.sortKey?p.sortOrder=n.sortOrder:p.sortOrder="ascending";d(c)},[n.sortKey,n.sortOrder]);const l=(c,p)=>{let m=p;n.sortKey===c&&(m=p==="ascending"?"descending":"ascending"),r(c,m)};return o.jsxRuntimeExports.jsx(Vp,{height:Nt,children:a.map(c=>o.jsxRuntimeExports.jsxs(Up,{companyNameSticky:e&&c.key==="companyName",sortDataValue:n.sortKey,actualDataValue:c.key,wrapperWidth:c.width,windowSize:i,children:[o.jsxRuntimeExports.jsxs(Gp,{onClick:()=>l(ee.toManagementSortKeyType(c.key),c.sortOrder),children:[o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:c.value}),o.jsxRuntimeExports.jsx(_p,{sortDataValue:n.sortKey,headerdata:c,children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:12,height:12})})]}),o.jsxRuntimeExports.jsx(Kp,{isVisible:n.sortKey===c.key&&c.key!=="status",children:o.jsxRuntimeExports.jsx(Hp,{onClick:()=>l("status","ascending")})})]},c.key))})}const Bp=u.memo(Wp),_p=s.div`
933
+ `,Dp=e=>{const n=[];return e.subscriptions.forEach(r=>{r.plan&&n.push(r.plan.plan.zeniSku)}),n},Ap=e=>{const n=[];return e.subscriptions.forEach(r=>{r.addOns.forEach(i=>{i.addOn.zeniSku!=null&&n.push(i.addOn.zeniSku)})}),n};function Op(e,n){return{companyName:e.company.company.companyInfo.name,companyId:e.company.company.companyInfo.companyId,parentSubsidiaryInfo:e.company.company.parentSubsidiaryInfo,status:{allStatuses:e.company.schema.status,selectedValue:e.company.schema.status.find(r=>r.code===e.company.company.managementInfo.statusCode)},group:{allGroups:e.company.schema.companyGroup,selectedValue:e.company.schema.companyGroup.find(r=>r.id===e.company.company.managementInfo.companyGroupId)},plansAndAddons:ud([...new Set(Dp(e).concat(Ap(e)))]),controller:{allUsers:n,selectedUsers:e.controllers.map(r=>r.user)},customerSuccessManager:{allUsers:n,selectedUsers:e.customerSuccessManagers.map(r=>r.user)},preparer:{allUsers:n,selectedUsers:e.preparers.map(r=>r.user)},reviewer:{allUsers:n,selectedUsers:e.reviewers.map(r=>r.user)},apAnalyst:{allUsers:n,selectedUsers:e.apAnalysts.map(r=>r.user)},reportSent:{showBusinessDay:!0,maxDate:J.dateNow(),date:e.company.company.managementInfo.lastReportSentDate,businessDay:e.company.company.managementInfo.lastReportSentBusinessDay},taxStatus:{allTaxStatuses:e.company.schema.taxStatus,selectedValue:e.company.schema.taxStatus.find(r=>r.code===e.company.company.managementInfo.taxStatusCode)},taxLead:{allUsers:n,selectedUsers:e.taxLeads.map(r=>r.user)},monthlyRecurringRevenue:e.primarySubscription?.summary?.summary.monthlyRecurringRevenue,annualRecurringRevenue:e.primarySubscription?.summary?.summary.annualRecurringRevenue,customerSatisfaction:e.company.company.managementInfo.customerSatisfaction??{customerNote:"",teamNote:""}}}function Np(e,n){const r={};r.users=[];const i=n.split(".")[1];if(Mp(i))return{[i]:e[i]};{const{selectedUsers:a,deSelectedUsers:d}=e[i];return d==null||d?.length==0?a.forEach(l=>{l.isUserSelectionUpdated===!0&&r.users?.push(Ws(i,l.userId,l.isRoleSelected))}):d.forEach(l=>{r.users?.push(Ws(i,l.userId,l.isRoleSelected))}),{users:r.users}}}const Mp=e=>gp.includes(e);function Ws(e,n,r){switch(e){case"apAnalyst":return{isZeni:!0,role:J.toUserRoleType("ap_analyst"),userId:n,isSelected:r};case"taxLead":return{isZeni:!0,role:J.toUserRoleType("tax_lead"),userId:n,isSelected:r};case"customerSuccessManager":return{isZeni:!0,role:J.toUserRoleType("customer_success_manager"),userId:n,isSelected:r};case"controller":case"reviewer":case"preparer":default:return{isZeni:!0,role:e,userId:n,isSelected:r}}}const zp=(e,n,r,i)=>{const a=t.appLocale.getLocalizedStrings().dateFormat.visual.MMMMFormat,d=J.dateNow().subtract(1,"month").format(a),l=J.dateNow().startOf("month").subtract(1,"day"),c=r?.isSame(l)===!0&&i?.isAfter(r);return e?n?lp.replace("__month__",d):cp.replace("__month__",d):c===!0?dp.replace("__month__",d):pp.replace("__month__",d)},Fp=({enableCompanyMonthEndReportBtn:e,isMonthEndReportInDraft:n,bookCloseDate:r,lastReportSentDate:i,handleMonthEndReportPageClick:a})=>{const d=J.dateNow().startOf("month").subtract(1,"day"),l=r?.isSame(d)===!0&&i?.isAfter(r),c=e?n?xp:up:l===!0?null:mp;return c!=null?o.jsxRuntimeExports.jsx(t.Tooltip,{display:"block",placement:"bottom",maxWidth:"250",title:c,enterDelay:600,children:o.jsxRuntimeExports.jsx(os,{isMonthEndReportInDraft:n,bookCloseDate:r,lastReportSentDate:i,enableCompanyMonthEndReportBtn:e,isExpenseAutomationEnabledForUser:!0,handleMonthEndReportPageClick:a})}):o.jsxRuntimeExports.jsx(os,{isMonthEndReportInDraft:n,bookCloseDate:r,lastReportSentDate:i,enableCompanyMonthEndReportBtn:e,isExpenseAutomationEnabledForUser:!0,handleMonthEndReportPageClick:a})};function Wp({companyNameSticky:e,sortConfig:n,onColumnSortConfigChanged:r}){const i=t.useWindowSizeContext(),[a,d]=u.useState(o.cloneDeep(yt));u.useEffect(()=>{const c=[...a];for(const p of c)p.key===n.sortKey?p.sortOrder=n.sortOrder:p.sortOrder="ascending";d(c)},[n.sortKey,n.sortOrder]);const l=(c,p)=>{let m=p;n.sortKey===c&&(m=p==="ascending"?"descending":"ascending"),r(c,m)};return o.jsxRuntimeExports.jsx(Vp,{height:Nt,children:a.map(c=>o.jsxRuntimeExports.jsxs(Up,{companyNameSticky:e&&c.key==="companyName",sortDataValue:n.sortKey,actualDataValue:c.key,wrapperWidth:c.width,windowSize:i,children:[o.jsxRuntimeExports.jsxs(Gp,{onClick:()=>l(J.toManagementSortKeyType(c.key),c.sortOrder),children:[o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:c.value}),o.jsxRuntimeExports.jsx(_p,{sortDataValue:n.sortKey,headerdata:c,children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:12,height:12})})]}),o.jsxRuntimeExports.jsx(Kp,{isVisible:n.sortKey===c.key&&c.key!=="status",children:o.jsxRuntimeExports.jsx(Hp,{onClick:()=>l("status","ascending")})})]},c.key))})}const Bp=u.memo(Wp),_p=s.div`
934
934
  display: flex;
935
935
  align-items: center;
936
936
  transform: ${e=>e.sortDataValue===e.headerdata.key&&e.headerdata.sortOrder==="descending"?"rotate(180deg)":"rotate(0deg)"};
@@ -977,7 +977,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
977
977
  &:hover {
978
978
  color: ${e=>e.theme.colors.primary};
979
979
  }
980
- `,Yp=({companyNameSticky:e,totalMRRAmount:n,totalARRAmount:r})=>{const i=t.useWindowSizeContext(),a=St;return o.jsxRuntimeExports.jsxs(Zp,{className:"totalMRR",children:[o.jsxRuntimeExports.jsx(Xp,{companyNameSticky:e,width:a[0].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[1].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[2].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[3].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[4].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[5].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[6].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[7].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[8].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[9].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[10].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[11].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[12].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[13].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[14].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[15].width,windowSize:i,children:o.jsxRuntimeExports.jsx(t.LargeMedium,{children:n})}),o.jsxRuntimeExports.jsx(Ve,{width:a[16].width,windowSize:i,children:o.jsxRuntimeExports.jsx(t.LargeMedium,{children:r})})]})},Zp=s(t.LargeMedium)`
980
+ `,Yp=({companyNameSticky:e,totalMRRAmount:n,totalARRAmount:r})=>{const i=t.useWindowSizeContext(),a=yt;return o.jsxRuntimeExports.jsxs(Zp,{className:"totalMRR",children:[o.jsxRuntimeExports.jsx(Xp,{companyNameSticky:e,width:a[0].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[1].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[2].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[3].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[4].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[5].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[6].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[7].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[8].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[9].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[10].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[11].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[12].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[13].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[14].width,windowSize:i}),o.jsxRuntimeExports.jsx(Ve,{width:a[15].width,windowSize:i,children:o.jsxRuntimeExports.jsx(t.LargeMedium,{children:n})}),o.jsxRuntimeExports.jsx(Ve,{width:a[16].width,windowSize:i,children:o.jsxRuntimeExports.jsx(t.LargeMedium,{children:r})})]})},Zp=s(t.LargeMedium)`
981
981
  display: flex;
982
982
  padding: 15px ${t.Space.sp4} 15px ${t.Space.sp0};
983
983
  align-items: center;
@@ -1003,7 +1003,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1003
1003
  width: ${e=>e.width.valuePx(e.windowSize)};
1004
1004
  display: flex;
1005
1005
  justify-content: start;
1006
- `,qp={managementRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{common:{headers:{comments:Qp}},collaboration:{threads:{placeholder:{addANewComment:Jp,replyAComment:eu},tooltip:{resolveComment:tu,unResolveComment:ou}}},dateFormat:{analytics:{YYYYDashMMDashDDFormat:Bs}}}=t.appLocale.getLocalizedStrings(),nu=({managementView:e,companiesExcludedFromMonthEndReport:n,showDetailsPageLink:r=!0,loggedInUser:i,loggedInUserRole:a,expenseAutomationEnabledCompanies:d,onColumnSortConfigChanged:l,changeHandlers:c,onCompanyNameClicked:p,onTaskIconClicked:m,onPassportIconClicked:h,onScroll:S,onViewDetailsLinkClicked:x,onMonthEndReportPageClick:C,showMonthEndReportHistoricData:b,initialOpenThreadRequest:f})=>{const g=t.useWindowSizeContext(),j=u.useRef(null),[y,$]=u.useState(null),[w,O]=u.useState(null),{setOpenThread:A,setRequestToOpenThread:v,requestToOpenThread:T,isLoading:F}=u.useContext(t.ThreadsContext);u.useEffect(()=>{f!=null&&e.fetchState==="Completed"&&F===!1&&v(f)},[f,e.fetchState,F,v]);const[I,K]=u.useState(void 0),M=u.useRef(null),Y=u.useRef([]),G=!(g==="small"||g==="medium-compact"),{uiState:E,totalAnnualRecurringRevenue:P,totalMonthlyRecurringRevenue:W}=e,k=E.scrollYOffset??0,D=u.useCallback((N,H,L)=>{const Q=e.companies.findIndex(X=>X.company.company.companyInfo.companyId===N),se=St.findIndex(X=>X.key===H);Q!==-1&&se!==-1&&(Y.current[Q]==null?Y.current[Q]=[L]:Y.current[Q][se]=L)},[e.companies]),z=u.useCallback(N=>{let H=e.companies[N].company.company.companyInfo.name.length;const L=e.companies[N].company.company.parentSubsidiaryInfo;return L.parentInfo?H+=10:L.subsidiaryInfo&&(H+=15),H>zt?Ie+32:Ie},[e.companies]),Z=u.useCallback(()=>{M.current=null,v(null)},[v]);u.useEffect(()=>{j.current&&j.current.resetAfterIndex(0)},[e]),u.useEffect(()=>{if(T!=null&&y!=null){const{companyId:N,entityType:H}=T,[L,Q]=H.split("."),se=e.companies.findIndex(he=>he.company.company.companyInfo.companyId===N),X=St.findIndex(he=>he.key===Q);se!==-1&&!(y.visibleStartIndex<=se&&y.visibleStopIndex>=se)&&j.current?.scrollToItem(se,"center"),setTimeout(()=>{const fe=Y.current[se]?.[X];fe!=null&&(M.current={companyId:N,target:fe});const be=Y.current[se]?.[0]?.getBoundingClientRect().bottom,_=Y.current[se]?.[0]?.getBoundingClientRect().top;if(be!=null&&_!=null&&(window.innerHeight>=be&&window.innerHeight>=_||_<0)){const J=Y.current[se][X];J!=null&&(M.current={companyId:N,target:J}),Y.current[se][X]?.scrollIntoView({block:"center",behavior:"auto"})}},0);const te=setInterval(()=>{const he=Y.current[se]?.[X]?.getBoundingClientRect().left,fe=Y.current[se]?.[X]?.getBoundingClientRect().right,be=Y.current[se]?.[X]?.offsetWidth;if(M.current?.companyId===N&&he!=null&&be!=null&&fe!=null&&(he<window.innerWidth-be||fe<window.innerWidth)){clearInterval(te);const _=T.threadId,J=T.onThreadShownCallback;_&&(v(null),A(T.threadId),J?.())}},500);setTimeout(()=>{clearInterval(te),v(null)},2e3)}},[T,y,A,v]);const ie=u.useMemo(()=>({makeCompanyNameSticky:G,uiState:E,totalAnnualRecurringRevenue:P,totalMonthlyRecurringRevenue:W,onColumnSortConfigChanged:l}),[G,E,P,W,l]);return o.jsxRuntimeExports.jsx(ru,{children:o.jsxRuntimeExports.jsxs(ji.Provider,{value:ie,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:N,width:H})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:N,innerElementType:bi,itemCount:e.companies.length,itemSize:z,onItemsRendered:L=>$(L),itemData:{managementView:e,loggedInUser:i,loggedInUserRole:a,showDetailsPageLink:r,makeCompanyNameSticky:G,companiesExcludedFromMonthEndReport:n,addThreadRequestThreadId:I,expenseAutomationEnabledCompanies:d,targetElement:M.current?.target,resetTargetElementFromNavigation:Z,setElementRef:D,onCompanyNameClicked:p,onPassportIconClicked:h,onTaskIconClicked:m,onMonthEndReportPageClick:C,setAddThreadRequestThreadId:K,changeHandlers:c,setNoteData:O,onViewDetailsLinkClicked:x,showMonthEndReportHistoricData:b},width:H,ref:j,overscanCount:Mt,onScroll:({scrollOffset:L})=>{S?.(L)},initialScrollOffset:k??0,children:su})}),w!=null?o.jsxRuntimeExports.jsx(Ze.RoomProvider,{id:w.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${w.companyName} ${Qp}`,filter:{application:"cockpit",companyId:w.companyId,entityType:w.entityType,isGlobalComment:!1,tab:"management"},isLoading:!1,threadMetadata:{companyName:w.companyName,companyId:w.companyId,entityId:w.companyId,entityType:w.entityType,isGlobalComment:!1,application:"cockpit",tab:"management",url:window.location.href},textOverrides:{composerPlaceholder:Jp,replyComposerPlaceholder:eu,threadResolve:tu,threadUnResolve:ou},onThreadClick:N=>null,onCloseAllThreadsDrawer:()=>O(null)})}):null]})})},ji=u.createContext(void 0),su=({index:e,style:n,data:r})=>{const i=t.useWindowSizeContext(),{loggedInUserRole:a,showDetailsPageLink:d,addThreadRequestThreadId:l,targetElement:c,setNoteData:p,managementView:m,resetTargetElementFromNavigation:h,setElementRef:S,companiesExcludedFromMonthEndReport:x,makeCompanyNameSticky:C,changeHandlers:b,expenseAutomationEnabledCompanies:f,onCompanyNameClicked:g,onPassportIconClicked:j,onTaskIconClicked:y,onMonthEndReportPageClick:$,onViewDetailsLinkClicked:w,setAddThreadRequestThreadId:O,showMonthEndReportHistoricData:A}=r,v=m.companies[e],{companyId:T}=v.company.company.companyInfo,F=f.includes(T);return o.jsxRuntimeExports.jsx(au,{style:{...n,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${qp.managementRightPadding.valuePx(i)} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(yp,{onViewDetailsLinkClicked:w,showDetailsPageLink:d,loggedInUserRole:a,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:h,setNoteData:p,setElementRef:S,isExpenseAutomationEnabledForUser:F,totalHeight:typeof n.height=="number"?n.height:Ie,changeHandlers:b,companyView:m.companies[e],hasMonthEndEmailHistory:m.companies[e].hasMonthEndEmailHistory,allUsers:m.zeniUsers.values,companyNameSticky:C,onCompanyNameClicked:g,onPassportIconClicked:j,onTaskIconClicked:y,onMonthEndReportPageClick:$,setAddThreadRequestThreadId:O,companiesExcludedFromMonthEndReport:x,showMonthEndReportHistoricData:A})},T)},bi=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,totalAnnualRecurringRevenue:c,totalMonthlyRecurringRevenue:p,onColumnSortConfigChanged:m}=u.useContext(ji);return o.jsxRuntimeExports.jsxs(iu,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(Bp,{companyNameSticky:d,onColumnSortConfigChanged:m,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(lu,{children:r}),o.jsxRuntimeExports.jsx(Yp,{companyNameSticky:d,totalMRRAmount:t.amountToString("0,0",p),totalARRAmount:t.amountToString("0,0",c)})]})});bi.displayName="Management list view inner element type";const ru=s.div`
1006
+ `,qp={managementRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{common:{headers:{comments:Qp}},collaboration:{threads:{placeholder:{addANewComment:Jp,replyAComment:eu},tooltip:{resolveComment:tu,unResolveComment:ou}}},dateFormat:{analytics:{YYYYDashMMDashDDFormat:Bs}}}=t.appLocale.getLocalizedStrings(),nu=({managementView:e,companiesExcludedFromMonthEndReport:n,showDetailsPageLink:r=!0,loggedInUser:i,loggedInUserRole:a,expenseAutomationEnabledCompanies:d,onColumnSortConfigChanged:l,changeHandlers:c,onCompanyNameClicked:p,onTaskIconClicked:m,onPassportIconClicked:h,onScroll:S,onViewDetailsLinkClicked:x,onMonthEndReportPageClick:C,showMonthEndReportHistoricData:b,initialOpenThreadRequest:f})=>{const g=t.useWindowSizeContext(),j=u.useRef(null),[y,$]=u.useState(null),[w,O]=u.useState(null),{setOpenThread:A,setRequestToOpenThread:v,requestToOpenThread:T,isLoading:F}=u.useContext(t.ThreadsContext);u.useEffect(()=>{f!=null&&e.fetchState==="Completed"&&F===!1&&v(f)},[f,e.fetchState,F,v]);const[I,K]=u.useState(void 0),M=u.useRef(null),Y=u.useRef([]),G=!(g==="small"||g==="medium-compact"),{uiState:E,totalAnnualRecurringRevenue:P,totalMonthlyRecurringRevenue:W}=e,k=E.scrollYOffset??0,D=u.useCallback((N,H,L)=>{const Q=e.companies.findIndex(X=>X.company.company.companyInfo.companyId===N),se=yt.findIndex(X=>X.key===H);Q!==-1&&se!==-1&&(Y.current[Q]==null?Y.current[Q]=[L]:Y.current[Q][se]=L)},[e.companies]),z=u.useCallback(N=>{let H=e.companies[N].company.company.companyInfo.name.length;const L=e.companies[N].company.company.parentSubsidiaryInfo;return L.parentInfo?H+=10:L.subsidiaryInfo&&(H+=15),H>zt?Ie+32:Ie},[e.companies]),Z=u.useCallback(()=>{M.current=null,v(null)},[v]);u.useEffect(()=>{j.current&&j.current.resetAfterIndex(0)},[e]),u.useEffect(()=>{if(T!=null&&y!=null){const{companyId:N,entityType:H}=T,[L,Q]=H.split("."),se=e.companies.findIndex(he=>he.company.company.companyInfo.companyId===N),X=yt.findIndex(he=>he.key===Q);se!==-1&&!(y.visibleStartIndex<=se&&y.visibleStopIndex>=se)&&j.current?.scrollToItem(se,"center"),setTimeout(()=>{const fe=Y.current[se]?.[X];fe!=null&&(M.current={companyId:N,target:fe});const be=Y.current[se]?.[0]?.getBoundingClientRect().bottom,_=Y.current[se]?.[0]?.getBoundingClientRect().top;if(be!=null&&_!=null&&(window.innerHeight>=be&&window.innerHeight>=_||_<0)){const ee=Y.current[se][X];ee!=null&&(M.current={companyId:N,target:ee}),Y.current[se][X]?.scrollIntoView({block:"center",behavior:"auto"})}},0);const te=setInterval(()=>{const he=Y.current[se]?.[X]?.getBoundingClientRect().left,fe=Y.current[se]?.[X]?.getBoundingClientRect().right,be=Y.current[se]?.[X]?.offsetWidth;if(M.current?.companyId===N&&he!=null&&be!=null&&fe!=null&&(he<window.innerWidth-be||fe<window.innerWidth)){clearInterval(te);const _=T.threadId,ee=T.onThreadShownCallback;_&&(v(null),A(T.threadId),ee?.())}},500);setTimeout(()=>{clearInterval(te),v(null)},2e3)}},[T,y,A,v]);const ie=u.useMemo(()=>({makeCompanyNameSticky:G,uiState:E,totalAnnualRecurringRevenue:P,totalMonthlyRecurringRevenue:W,onColumnSortConfigChanged:l}),[G,E,P,W,l]);return o.jsxRuntimeExports.jsx(ru,{children:o.jsxRuntimeExports.jsxs(Ci.Provider,{value:ie,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:N,width:H})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:N,innerElementType:ji,itemCount:e.companies.length,itemSize:z,onItemsRendered:L=>$(L),itemData:{managementView:e,loggedInUser:i,loggedInUserRole:a,showDetailsPageLink:r,makeCompanyNameSticky:G,companiesExcludedFromMonthEndReport:n,addThreadRequestThreadId:I,expenseAutomationEnabledCompanies:d,targetElement:M.current?.target,resetTargetElementFromNavigation:Z,setElementRef:D,onCompanyNameClicked:p,onPassportIconClicked:h,onTaskIconClicked:m,onMonthEndReportPageClick:C,setAddThreadRequestThreadId:K,changeHandlers:c,setNoteData:O,onViewDetailsLinkClicked:x,showMonthEndReportHistoricData:b},width:H,ref:j,overscanCount:Mt,onScroll:({scrollOffset:L})=>{S?.(L)},initialScrollOffset:k??0,children:su})}),w!=null?o.jsxRuntimeExports.jsx(Ze.RoomProvider,{id:w.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${w.companyName} ${Qp}`,filter:{application:"cockpit",companyId:w.companyId,entityType:w.entityType,isGlobalComment:!1,tab:"management"},isLoading:!1,threadMetadata:{companyName:w.companyName,companyId:w.companyId,entityId:w.companyId,entityType:w.entityType,isGlobalComment:!1,application:"cockpit",tab:"management",url:window.location.href},textOverrides:{composerPlaceholder:Jp,replyComposerPlaceholder:eu,threadResolve:tu,threadUnResolve:ou},onThreadClick:N=>null,onCloseAllThreadsDrawer:()=>O(null)})}):null]})})},Ci=u.createContext(void 0),su=({index:e,style:n,data:r})=>{const i=t.useWindowSizeContext(),{loggedInUserRole:a,showDetailsPageLink:d,addThreadRequestThreadId:l,targetElement:c,setNoteData:p,managementView:m,resetTargetElementFromNavigation:h,setElementRef:S,companiesExcludedFromMonthEndReport:x,makeCompanyNameSticky:C,changeHandlers:b,expenseAutomationEnabledCompanies:f,onCompanyNameClicked:g,onPassportIconClicked:j,onTaskIconClicked:y,onMonthEndReportPageClick:$,onViewDetailsLinkClicked:w,setAddThreadRequestThreadId:O,showMonthEndReportHistoricData:A}=r,v=m.companies[e],{companyId:T}=v.company.company.companyInfo,F=f.includes(T);return o.jsxRuntimeExports.jsx(au,{style:{...n,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${qp.managementRightPadding.valuePx(i)} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(yp,{onViewDetailsLinkClicked:w,showDetailsPageLink:d,loggedInUserRole:a,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:h,setNoteData:p,setElementRef:S,isExpenseAutomationEnabledForUser:F,totalHeight:typeof n.height=="number"?n.height:Ie,changeHandlers:b,companyView:m.companies[e],hasMonthEndEmailHistory:m.companies[e].hasMonthEndEmailHistory,allUsers:m.zeniUsers.values,companyNameSticky:C,onCompanyNameClicked:g,onPassportIconClicked:j,onTaskIconClicked:y,onMonthEndReportPageClick:$,setAddThreadRequestThreadId:O,companiesExcludedFromMonthEndReport:x,showMonthEndReportHistoricData:A})},T)},ji=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,totalAnnualRecurringRevenue:c,totalMonthlyRecurringRevenue:p,onColumnSortConfigChanged:m}=u.useContext(Ci);return o.jsxRuntimeExports.jsxs(iu,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(Bp,{companyNameSticky:d,onColumnSortConfigChanged:m,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(lu,{children:r}),o.jsxRuntimeExports.jsx(Yp,{companyNameSticky:d,totalMRRAmount:t.amountToString("0,0",p),totalARRAmount:t.amountToString("0,0",c)})]})});ji.displayName="Management list view inner element type";const ru=s.div`
1007
1007
  /** Subtract top so list can occupy remaining available height */
1008
1008
  height: calc(100vh - 110px);
1009
1009
  max-width: 99.9%;
@@ -1033,7 +1033,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1033
1033
  height: calc(100vh - 45px);
1034
1034
  overflow-y: hidden;
1035
1035
  background-color: ${e=>e.theme.colors.grey4};
1036
- `,hu=({companiesExcludedFromMonthEndReport:e,headerData:n,headerActions:r,managementPageActions:i,managementPageData:a,expenseAutomationEnabledCompanies:d,initialOpenThreadRequest:l})=>{const{managementView:c,loggedInUser:p,loggedInUserRole:m,showDetailsPageLink:h}=a,{onColumnSortConfigChanged:S,changeHandlers:x,onScroll:C,onViewDetailsLinkClicked:b,onCockpitReloadData:f,onCompanyNameClicked:g,onPassportIconClicked:j,onTaskIconClicked:y,onFiltersChange:$,onMonthEndReportPageClick:w,showMonthEndReportHistoricData:O}=i,A=c.uiState.filterText,v=c.uiState.filters,T=c.fetchState==="Completed"&&c.zeniUsers.fetchState==="Completed";return r.filterActions&&(r.filterActions.getCategoryWiseOptions=()=>Su(c)),o.jsxRuntimeExports.jsxs(xu,{children:[o.jsxRuntimeExports.jsx(ht,{headerActions:{...r},headerData:{...n,filterData:{filterText:A,filters:v},companiesLoaded:T,selectedTabOption:"management",allTabOptions:h===void 0?xt:void 0}}),o.jsxRuntimeExports.jsx(gu,{changeHandlers:x,companiesExcludedFromMonthEndReport:e,expenseAutomationEnabledCompanies:d,initialOpenThreadRequest:l,isFilterApplied:v?.categories!=null,loggedInUser:p,loggedInUserRole:m,managementView:c,onClearFilter:()=>$?.("management",{}),onCockpitReloadData:f,onColumnSortConfigChanged:S,onCompanyNameClicked:g,onMonthEndReportPageClick:w,onPassportIconClicked:j,onScroll:C,onTaskIconClicked:y,onViewDetailsLinkClicked:b,showMonthEndReportHistoricData:O})]})},gu=({managementView:e,showDetailsPageLink:n=!0,loggedInUser:r,companiesExcludedFromMonthEndReport:i,expenseAutomationEnabledCompanies:a,initialOpenThreadRequest:d,isFilterApplied:l,loggedInUserRole:c,onColumnSortConfigChanged:p,changeHandlers:m,onScroll:h,onViewDetailsLinkClicked:S,onCockpitReloadData:x,onCompanyNameClicked:C,onTaskIconClicked:b,onPassportIconClicked:f,onClearFilter:g,onMonthEndReportPageClick:j,showMonthEndReportHistoricData:y})=>{const $=t.useWindowSizeContext();return e.fetchState==="Error"||e.zeniUsers.fetchState==="Error"?o.jsxRuntimeExports.jsx(jt,{onCockpitReloadData:x,selectedCockpitOption:"management"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"||e.zeniUsers.fetchState==="In-Progress"||e.zeniUsers.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(uu,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.companies.length===0?l?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchOnFilters,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine,filtersApplied:!0,onClearFilter:g}):o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextFirstLine,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine}):o.jsxRuntimeExports.jsx(mu,{windowSize:$,children:o.jsxRuntimeExports.jsx(pu,{showDetailsPageLink:n,onColumnSortConfigChanged:p,changeHandlers:m,onScroll:h,onViewDetailsLinkClicked:S,managementView:e,loggedInUser:r,loggedInUserRole:c,expenseAutomationEnabledCompanies:a,onCompanyNameClicked:C,onTaskIconClicked:b,onPassportIconClicked:f,onMonthEndReportPageClick:j,companiesExcludedFromMonthEndReport:i,showMonthEndReportHistoricData:y,initialOpenThreadRequest:d})})},Su=e=>{const n=e.zeniUsers.values,r=li,{companies:i}=e;return r.reduce((a,d)=>{switch(d.value){case"companyGroupId":{if(i.length===0)return{...a,[d.value]:[]};const l=i[0].company.schema.companyGroup.map(c=>{const p=c;return{label:p.name,value:p.id}});return{...a,[d.value]:l}}case"statusCode":{if(i.length===0)return{...a,[d.value]:[]};const l=i[0].company.schema.status.map(c=>{const p=c;return{label:p.name,value:p.code}});return{...a,[d.value]:l}}case"taxStatusCode":{if(i.length===0)return{...a,[d.value]:[]};const l=i[0].company.schema.taxStatus.map(c=>{const p=c;return{label:p.name,value:p.code,avatar:""}});return{...a,[d.value]:l}}case"controllerUserIds":case"apAnalystUserIds":case"preparerUserIds":case"reviewerUserIds":case"taxLeadUserIds":case"customerSuccessManagerUserIds":{const l=n.map(c=>({label:c.firstName||c.lastName?`${c.firstName} ${c.lastName}`:c.email,value:c.userId,photo:c.photo,email:c.email}));return{...a,[d.value]:l}}case"plans":{const l=e.subscriptionPlansZeniSkus.map(c=>({label:c,value:c})).sort((c,p)=>c.label.localeCompare(p.label));return{...a,[d.value]:l}}case"annualRecurringRevenue":return{...a,[d.value]:Ba};case"monthlyRecurringRevenue":return{...a,[d.value]:ps};case"customerSatisfaction":{const l=Object.values($o).map(c=>({label:c.name,value:c.id}));return{...a,[d.value]:l}}case"zeniSatisfaction":{const l=Object.values(qt).map(c=>({label:c.name,value:c.id}));return{...a,[d.value]:l}}default:return{...a,[d.value]:[]}}},{})},_s=t.appLocale.getLocalizedStrings().cockpit.taskManager.header,{common:_t}=t.appLocale.getLocalizedStrings(),It=[{key:"name",value:_t.texts.name,sortOrder:"ascending",width:new t.ResponsiveSized(176,176),isThreadAllowed:!0},{key:"taskName",value:_s.taskName,sortOrder:"ascending",width:new t.ResponsiveSized(320,320),isThreadAllowed:!0},{key:"status",value:_t.texts.status,sortOrder:"ascending",width:new t.ResponsiveSized(100,100),isThreadAllowed:!0},{key:"priority",value:_t.texts.priority,sortOrder:"ascending",width:new t.ResponsiveSized(90,90),isThreadAllowed:!0},{key:"dueDate",value:_t.texts.dueDate,sortOrder:"ascending",width:new t.ResponsiveSized(100,100),isThreadAllowed:!0},{key:"assignee",value:_t.texts.assignee,sortOrder:"ascending",width:new t.ResponsiveSized(220,220),isThreadAllowed:!0},{key:"tags",value:_s.tags,sortOrder:"ascending",width:new t.ResponsiveSized(115,115),isThreadAllowed:!0},{key:"createdBy",value:_t.texts.createdBy,sortOrder:"ascending",width:new t.ResponsiveSized(140,140),isThreadAllowed:!0}];It.map(e=>e.key);function yu({sortConfig:e,onColumnSortConfigChanged:n}){const r=t.useWindowSizeContext(),[i,a]=u.useState(o.cloneDeep(It));u.useEffect(()=>{const l=[...i];for(const c of l)c.key===e.sortKey?c.sortOrder=e.sortOrder:c.sortOrder="ascending";a(l)},[e.sortKey,e.sortOrder]);const d=(l,c)=>{let p=c;e.sortKey===l&&(p=c==="ascending"?"descending":"ascending"),n(l,p)};return o.jsxRuntimeExports.jsx(Cu,{height:Nt,children:i.map(l=>o.jsxRuntimeExports.jsxs(ju,{sortDataValue:e.sortKey,actualDataValue:l.key,wrapperWidth:l.width,windowSize:r,children:[o.jsxRuntimeExports.jsxs($u,{onClick:()=>d(ee.toTaskManagerSortKeyType(l.key),l.sortOrder),children:[o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:l.value}),o.jsxRuntimeExports.jsx(fu,{sortDataValue:e.sortKey,headerdata:l,children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:12,height:12})})]}),o.jsxRuntimeExports.jsx(Ru,{isVisible:e.sortKey===l.key&&l.key!=="dueDate",children:o.jsxRuntimeExports.jsx(bu,{onClick:()=>d("dueDate","ascending")})})]},l.key))})}const fu=s.div`
1036
+ `,hu=({companiesExcludedFromMonthEndReport:e,headerData:n,headerActions:r,managementPageActions:i,managementPageData:a,expenseAutomationEnabledCompanies:d,initialOpenThreadRequest:l})=>{const{managementView:c,loggedInUser:p,loggedInUserRole:m,showDetailsPageLink:h}=a,{onColumnSortConfigChanged:S,changeHandlers:x,onScroll:C,onViewDetailsLinkClicked:b,onCockpitReloadData:f,onCompanyNameClicked:g,onPassportIconClicked:j,onTaskIconClicked:y,onFiltersChange:$,onMonthEndReportPageClick:w,showMonthEndReportHistoricData:O}=i,A=c.uiState.filterText,v=c.uiState.filters,T=c.fetchState==="Completed"&&c.zeniUsers.fetchState==="Completed";return r.filterActions&&(r.filterActions.getCategoryWiseOptions=()=>Su(c)),o.jsxRuntimeExports.jsxs(xu,{children:[o.jsxRuntimeExports.jsx(ht,{headerActions:{...r},headerData:{...n,filterData:{filterText:A,filters:v},companiesLoaded:T,selectedTabOption:"management",allTabOptions:h===void 0?xt:void 0}}),o.jsxRuntimeExports.jsx(gu,{changeHandlers:x,companiesExcludedFromMonthEndReport:e,expenseAutomationEnabledCompanies:d,initialOpenThreadRequest:l,isFilterApplied:v?.categories!=null,loggedInUser:p,loggedInUserRole:m,managementView:c,onClearFilter:()=>$?.("management",{}),onCockpitReloadData:f,onColumnSortConfigChanged:S,onCompanyNameClicked:g,onMonthEndReportPageClick:w,onPassportIconClicked:j,onScroll:C,onTaskIconClicked:y,onViewDetailsLinkClicked:b,showMonthEndReportHistoricData:O})]})},gu=({managementView:e,showDetailsPageLink:n=!0,loggedInUser:r,companiesExcludedFromMonthEndReport:i,expenseAutomationEnabledCompanies:a,initialOpenThreadRequest:d,isFilterApplied:l,loggedInUserRole:c,onColumnSortConfigChanged:p,changeHandlers:m,onScroll:h,onViewDetailsLinkClicked:S,onCockpitReloadData:x,onCompanyNameClicked:C,onTaskIconClicked:b,onPassportIconClicked:f,onClearFilter:g,onMonthEndReportPageClick:j,showMonthEndReportHistoricData:y})=>{const $=t.useWindowSizeContext();return e.fetchState==="Error"||e.zeniUsers.fetchState==="Error"?o.jsxRuntimeExports.jsx(bt,{onCockpitReloadData:x,selectedCockpitOption:"management"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"||e.zeniUsers.fetchState==="In-Progress"||e.zeniUsers.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(uu,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.companies.length===0?l?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchOnFilters,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine,filtersApplied:!0,onClearFilter:g}):o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextFirstLine,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine}):o.jsxRuntimeExports.jsx(mu,{windowSize:$,children:o.jsxRuntimeExports.jsx(pu,{showDetailsPageLink:n,onColumnSortConfigChanged:p,changeHandlers:m,onScroll:h,onViewDetailsLinkClicked:S,managementView:e,loggedInUser:r,loggedInUserRole:c,expenseAutomationEnabledCompanies:a,onCompanyNameClicked:C,onTaskIconClicked:b,onPassportIconClicked:f,onMonthEndReportPageClick:j,companiesExcludedFromMonthEndReport:i,showMonthEndReportHistoricData:y,initialOpenThreadRequest:d})})},Su=e=>{const n=e.zeniUsers.values,r=ai,{companies:i}=e;return r.reduce((a,d)=>{switch(d.value){case"companyGroupId":{if(i.length===0)return{...a,[d.value]:[]};const l=i[0].company.schema.companyGroup.map(c=>{const p=c;return{label:p.name,value:p.id}});return{...a,[d.value]:l}}case"statusCode":{if(i.length===0)return{...a,[d.value]:[]};const l=i[0].company.schema.status.map(c=>{const p=c;return{label:p.name,value:p.code}});return{...a,[d.value]:l}}case"taxStatusCode":{if(i.length===0)return{...a,[d.value]:[]};const l=i[0].company.schema.taxStatus.map(c=>{const p=c;return{label:p.name,value:p.code,avatar:""}});return{...a,[d.value]:l}}case"controllerUserIds":case"apAnalystUserIds":case"preparerUserIds":case"reviewerUserIds":case"taxLeadUserIds":case"customerSuccessManagerUserIds":{const l=n.map(c=>({label:c.firstName||c.lastName?`${c.firstName} ${c.lastName}`:c.email,value:c.userId,photo:c.photo,email:c.email}));return{...a,[d.value]:l}}case"plans":{const l=e.subscriptionPlansZeniSkus.map(c=>({label:c,value:c})).sort((c,p)=>c.label.localeCompare(p.label));return{...a,[d.value]:l}}case"annualRecurringRevenue":return{...a,[d.value]:Ba};case"monthlyRecurringRevenue":return{...a,[d.value]:ds};case"customerSatisfaction":{const l=Object.values($o).map(c=>({label:c.name,value:c.id}));return{...a,[d.value]:l}}case"zeniSatisfaction":{const l=Object.values(qt).map(c=>({label:c.name,value:c.id}));return{...a,[d.value]:l}}default:return{...a,[d.value]:[]}}},{})},_s=t.appLocale.getLocalizedStrings().cockpit.taskManager.header,{common:_t}=t.appLocale.getLocalizedStrings(),It=[{key:"name",value:_t.texts.name,sortOrder:"ascending",width:new t.ResponsiveSized(176,176),isThreadAllowed:!0},{key:"taskName",value:_s.taskName,sortOrder:"ascending",width:new t.ResponsiveSized(320,320),isThreadAllowed:!0},{key:"status",value:_t.texts.status,sortOrder:"ascending",width:new t.ResponsiveSized(100,100),isThreadAllowed:!0},{key:"priority",value:_t.texts.priority,sortOrder:"ascending",width:new t.ResponsiveSized(90,90),isThreadAllowed:!0},{key:"dueDate",value:_t.texts.dueDate,sortOrder:"ascending",width:new t.ResponsiveSized(100,100),isThreadAllowed:!0},{key:"assignee",value:_t.texts.assignee,sortOrder:"ascending",width:new t.ResponsiveSized(220,220),isThreadAllowed:!0},{key:"tags",value:_s.tags,sortOrder:"ascending",width:new t.ResponsiveSized(115,115),isThreadAllowed:!0},{key:"createdBy",value:_t.texts.createdBy,sortOrder:"ascending",width:new t.ResponsiveSized(140,140),isThreadAllowed:!0}];It.map(e=>e.key);function yu({sortConfig:e,onColumnSortConfigChanged:n}){const r=t.useWindowSizeContext(),[i,a]=u.useState(o.cloneDeep(It));u.useEffect(()=>{const l=[...i];for(const c of l)c.key===e.sortKey?c.sortOrder=e.sortOrder:c.sortOrder="ascending";a(l)},[e.sortKey,e.sortOrder]);const d=(l,c)=>{let p=c;e.sortKey===l&&(p=c==="ascending"?"descending":"ascending"),n(l,p)};return o.jsxRuntimeExports.jsx(Cu,{height:Nt,children:i.map(l=>o.jsxRuntimeExports.jsxs(ju,{sortDataValue:e.sortKey,actualDataValue:l.key,wrapperWidth:l.width,windowSize:r,children:[o.jsxRuntimeExports.jsxs($u,{onClick:()=>d(J.toTaskManagerSortKeyType(l.key),l.sortOrder),children:[o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:l.value}),o.jsxRuntimeExports.jsx(fu,{sortDataValue:e.sortKey,headerdata:l,children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:12,height:12})})]}),o.jsxRuntimeExports.jsx(Ru,{isVisible:e.sortKey===l.key&&l.key!=="dueDate",children:o.jsxRuntimeExports.jsx(bu,{onClick:()=>d("dueDate","ascending")})})]},l.key))})}const fu=s.div`
1037
1037
  display: flex;
1038
1038
  align-items: center;
1039
1039
  transform: ${e=>e.sortDataValue===e.headerdata.key&&e.headerdata.sortOrder==="descending"?"rotate(180deg)":"rotate(0deg)"};
@@ -1090,7 +1090,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1090
1090
  &:hover {
1091
1091
  color: ${e=>e.theme.colors.primary};
1092
1092
  }
1093
- `,{dateFormat:Eu,common:{strings:{empty:gn,hyphen:wu,plus:wo}}}=t.appLocale.getLocalizedStrings(),vu=({totalHeight:e,task:n,addThreadRequestThreadId:r,setElementRef:i,setAddThreadRequestThreadId:a,onRowClick:d})=>{const l=t.useWindowSizeContext(),c=o.useTheme(),p=n.assignees.length>0?n.assignees[0]:void 0,m=p?.firstName!=null&&p?.lastName!=null?`${p.firstName} ${p.lastName}`:p?.email??gn,{companyId:h,name:S}=n.company.companyInfo,x=n.createdByUser?.firstName!==null&&n.createdByUser?.lastName!=null?`${n.createdByUser.firstName} ${n.createdByUser.lastName}`:n.createdByUser?.email??gn,C=n.assignees.length,b=n.task.id,{openThread:f,threads:g,addThread:j,removeThread:y,setOpenThread:$,setRequestToOpenThread:w}=u.useContext(t.ThreadsContext),O=f!==null?g.get(f):null,A=f?.includes(h)===!0,v=f!=null&&g.get(f)==null&&A,T=r!=null&&g.get(r)?.metadata.companyId===h,F=`cockpit_${h}`,I=u.useCallback(()=>{f?.includes(t.NEW_THREAD_SUFFIX)===!0&&y(f),r!=null&&a(void 0)},[r,f,y,a]),K=E=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:E.isElementThreadOpen??!1,isElementThreadPresent:E.isElementThreadPresent??!1,itemKey:E.itemKey,elementThreadId:E.elementThreadId??"",roomId:F,addThreadRequestThreadId:r,openThreadId:f,threadStyle:E.threadStyle,openThreadMetadata:O?.metadata??null,onElementClick:Y,onAddThreadClick:G}),M=u.useCallback(E=>{if(E===f)$(null);else if(g.has(E))$(E);else if(E.includes(t.NEW_THREAD_SUFFIX)){const[P,W]=E.replace(t.NEW_THREAD_SUFFIX,"").split("."),k=Ft(Ct(P),ee.toTaskManagerSortKeyType(W),h,S,b);j(E,{type:"thread",id:E,roomId:F,createdAt:new Date,updatedAt:new Date,comments:[],metadata:k,resolved:!1}),$(E)}},[f,g,$,h,S,b,j,F]),Y=u.useCallback((E,P,W=!1)=>{const k=It.find(D=>D.key===P);if(w(null),k!=null&&(E.type==="contextmenu"||W===!0)){if(k.isThreadAllowed===!1)return;I(),E.preventDefault(),E.stopPropagation();const D=t.toCollaborationEntityType({tab:"taskManager",key:k.key}),z=[...t.getFilteredThreads(g,{entityType:D,entityId:b,companyId:h},"both")],Z=z.length>0&&z[0].length>0?z[0][0]:Le("taskManager",k.key,h+wo+b);g.has(Z)?M(Z):r===Z?a(void 0):(a(Z),$(null))}},[g,b,h,r,M,a,$,w,I]),G=u.useCallback((E,P)=>{E.stopPropagation();const W=Le("taskManager",P,h+wo+b);a(void 0),M(W)},[h,b,a,M]);return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{w(null),r!=null&&(a(void 0),r.includes(t.NEW_THREAD_SUFFIX)&&y(r))},children:o.jsxRuntimeExports.jsx(ku,{onClick:()=>d(n.company.companyInfo.primaryEmailDomain,n.task.id),windowSize:l,isThreadOpen:A||T,totalHeight:e,isCreationInProgress:v,children:It.map((E,P)=>{const W=t.toCollaborationEntityType({tab:"taskManager",key:E.key}),k=It.length-2<=P,D=[...t.getFilteredThreads(g,{entityType:W,entityId:b,companyId:h},"both")],z=D.length>0&&D[0].length>0?D[0][0]:Le("taskManager",E.key,h+wo+b),Z=g.get(z),ie=Z!=null&&Z.resolved===!1,N=z===f,H=L=>ee.allTaskPriority.find(Q=>Q.code===L)?.name??gn;switch(E.key){case"name":return o.jsxRuntimeExports.jsxs(gt,{ref:L=>{i(h,E.key,L)},columnWidth:E.width,windowSize:l,isThreadAllowed:E.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,E.key),children:[o.jsxRuntimeExports.jsx(Tu,{children:n.company.companyInfo.name}),K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:E.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"taskName":return o.jsxRuntimeExports.jsxs(gt,{ref:L=>{i(h,E.key,L)},columnWidth:E.width,windowSize:l,isThreadAllowed:E.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,E.key),children:[o.jsxRuntimeExports.jsx(t.StandardRegular,{children:n.task.name}),K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:E.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"status":return o.jsxRuntimeExports.jsxs(gt,{ref:L=>{i(h,E.key,L)},columnWidth:E.width,windowSize:l,isThreadAllowed:E.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,E.key),children:[t.getRichLabel(n.task.status.code,c),K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:E.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"priority":return o.jsxRuntimeExports.jsxs(gt,{ref:L=>{i(h,E.key,L)},columnWidth:E.width,windowSize:l,isThreadAllowed:E.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,E.key),children:[o.jsxRuntimeExports.jsxs(Pu,{children:[o.jsxRuntimeExports.jsx(Iu,{color:t.getLabelColor(n.task.priority.code,c)}),o.jsxRuntimeExports.jsx(t.StandardRegular,{children:H(n.task.priority.code)})]}),K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:E.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"dueDate":return o.jsxRuntimeExports.jsxs(gt,{ref:L=>{i(h,E.key,L)},columnWidth:E.width,windowSize:l,isThreadAllowed:E.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,E.key),children:[o.jsxRuntimeExports.jsx(t.StandardRegular,{children:n.task.dueDate!=null?n.task.dueDate.format(Eu.visual.MMMDCommaYYYYformat):wu}),K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:E.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"assignee":return o.jsxRuntimeExports.jsxs(gt,{ref:L=>{i(h,E.key,L)},columnWidth:E.width,windowSize:l,isThreadAllowed:E.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,E.key),children:[o.jsxRuntimeExports.jsx(t.ZeniAvatar,{personBasic:p,styles:{width:t.Space.sp4,height:t.Space.sp4}}),o.jsxRuntimeExports.jsx(Vs,{children:m}),C>1?o.jsxRuntimeExports.jsx(Lu,{children:o.jsxRuntimeExports.jsx(t.SmallRegular,{children:`${wo}${C-1}`})}):null,K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:E.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"tags":return o.jsxRuntimeExports.jsxs(gt,{ref:L=>{i(h,E.key,L)},columnWidth:E.width,windowSize:l,isThreadAllowed:E.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,E.key),children:[n.task.tagIds.length>0?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:t.getTagLabel(n.task.tagIds,n.tags)}):null,K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:E.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"createdBy":return o.jsxRuntimeExports.jsxs(gt,{ref:L=>{i(h,E.key,L)},columnWidth:E.width,windowSize:l,isThreadAllowed:E.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,E.key),children:[o.jsxRuntimeExports.jsx(t.ZeniAvatar,{personBasic:n.createdByUser,styles:{width:t.Space.sp4,height:t.Space.sp4}}),o.jsxRuntimeExports.jsx(Vs,{children:x}),K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:E.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);default:return null}})})})},ku=s.div`
1093
+ `,{dateFormat:Eu,common:{strings:{empty:hn,hyphen:wu,plus:wo}}}=t.appLocale.getLocalizedStrings(),vu=({totalHeight:e,task:n,addThreadRequestThreadId:r,setElementRef:i,setAddThreadRequestThreadId:a,onRowClick:d})=>{const l=t.useWindowSizeContext(),c=o.useTheme(),p=n.assignees.length>0?n.assignees[0]:void 0,m=p?.firstName!=null&&p?.lastName!=null?`${p.firstName} ${p.lastName}`:p?.email??hn,{companyId:h,name:S}=n.company.companyInfo,x=n.createdByUser?.firstName!==null&&n.createdByUser?.lastName!=null?`${n.createdByUser.firstName} ${n.createdByUser.lastName}`:n.createdByUser?.email??hn,C=n.assignees.length,b=n.task.id,{openThread:f,threads:g,addThread:j,removeThread:y,setOpenThread:$,setRequestToOpenThread:w}=u.useContext(t.ThreadsContext),O=f!==null?g.get(f):null,A=f?.includes(h)===!0,v=f!=null&&g.get(f)==null&&A,T=r!=null&&g.get(r)?.metadata.companyId===h,F=`cockpit_${h}`,I=u.useCallback(()=>{f?.includes(t.NEW_THREAD_SUFFIX)===!0&&y(f),r!=null&&a(void 0)},[r,f,y,a]),K=E=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:E.isElementThreadOpen??!1,isElementThreadPresent:E.isElementThreadPresent??!1,itemKey:E.itemKey,elementThreadId:E.elementThreadId??"",roomId:F,addThreadRequestThreadId:r,openThreadId:f,threadStyle:E.threadStyle,openThreadMetadata:O?.metadata??null,onElementClick:Y,onAddThreadClick:G}),M=u.useCallback(E=>{if(E===f)$(null);else if(g.has(E))$(E);else if(E.includes(t.NEW_THREAD_SUFFIX)){const[P,W]=E.replace(t.NEW_THREAD_SUFFIX,"").split("."),k=Ft(jt(P),J.toTaskManagerSortKeyType(W),h,S,b);j(E,{type:"thread",id:E,roomId:F,createdAt:new Date,updatedAt:new Date,comments:[],metadata:k,resolved:!1}),$(E)}},[f,g,$,h,S,b,j,F]),Y=u.useCallback((E,P,W=!1)=>{const k=It.find(D=>D.key===P);if(w(null),k!=null&&(E.type==="contextmenu"||W===!0)){if(k.isThreadAllowed===!1)return;I(),E.preventDefault(),E.stopPropagation();const D=t.toCollaborationEntityType({tab:"taskManager",key:k.key}),z=[...t.getFilteredThreads(g,{entityType:D,entityId:b,companyId:h},"both")],Z=z.length>0&&z[0].length>0?z[0][0]:Le("taskManager",k.key,h+wo+b);g.has(Z)?M(Z):r===Z?a(void 0):(a(Z),$(null))}},[g,b,h,r,M,a,$,w,I]),G=u.useCallback((E,P)=>{E.stopPropagation();const W=Le("taskManager",P,h+wo+b);a(void 0),M(W)},[h,b,a,M]);return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{w(null),r!=null&&(a(void 0),r.includes(t.NEW_THREAD_SUFFIX)&&y(r))},children:o.jsxRuntimeExports.jsx(ku,{onClick:()=>d(n.company.companyInfo.primaryEmailDomain,n.task.id),windowSize:l,isThreadOpen:A||T,totalHeight:e,isCreationInProgress:v,children:It.map((E,P)=>{const W=t.toCollaborationEntityType({tab:"taskManager",key:E.key}),k=It.length-2<=P,D=[...t.getFilteredThreads(g,{entityType:W,entityId:b,companyId:h},"both")],z=D.length>0&&D[0].length>0?D[0][0]:Le("taskManager",E.key,h+wo+b),Z=g.get(z),ie=Z!=null&&Z.resolved===!1,N=z===f,H=L=>J.allTaskPriority.find(Q=>Q.code===L)?.name??hn;switch(E.key){case"name":return o.jsxRuntimeExports.jsxs(gt,{ref:L=>{i(h,E.key,L)},columnWidth:E.width,windowSize:l,isThreadAllowed:E.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,E.key),children:[o.jsxRuntimeExports.jsx(Tu,{children:n.company.companyInfo.name}),K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:E.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"taskName":return o.jsxRuntimeExports.jsxs(gt,{ref:L=>{i(h,E.key,L)},columnWidth:E.width,windowSize:l,isThreadAllowed:E.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,E.key),children:[o.jsxRuntimeExports.jsx(t.StandardRegular,{children:n.task.name}),K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:E.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"status":return o.jsxRuntimeExports.jsxs(gt,{ref:L=>{i(h,E.key,L)},columnWidth:E.width,windowSize:l,isThreadAllowed:E.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,E.key),children:[t.getRichLabel(n.task.status.code,c),K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:E.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"priority":return o.jsxRuntimeExports.jsxs(gt,{ref:L=>{i(h,E.key,L)},columnWidth:E.width,windowSize:l,isThreadAllowed:E.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,E.key),children:[o.jsxRuntimeExports.jsxs(Pu,{children:[o.jsxRuntimeExports.jsx(Iu,{color:t.getLabelColor(n.task.priority.code,c)}),o.jsxRuntimeExports.jsx(t.StandardRegular,{children:H(n.task.priority.code)})]}),K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:E.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"dueDate":return o.jsxRuntimeExports.jsxs(gt,{ref:L=>{i(h,E.key,L)},columnWidth:E.width,windowSize:l,isThreadAllowed:E.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,E.key),children:[o.jsxRuntimeExports.jsx(t.StandardRegular,{children:n.task.dueDate!=null?n.task.dueDate.format(Eu.visual.MMMDCommaYYYYformat):wu}),K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:E.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"assignee":return o.jsxRuntimeExports.jsxs(gt,{ref:L=>{i(h,E.key,L)},columnWidth:E.width,windowSize:l,isThreadAllowed:E.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,E.key),children:[o.jsxRuntimeExports.jsx(t.ZeniAvatar,{personBasic:p,styles:{width:t.Space.sp4,height:t.Space.sp4}}),o.jsxRuntimeExports.jsx(Vs,{children:m}),C>1?o.jsxRuntimeExports.jsx(Lu,{children:o.jsxRuntimeExports.jsx(t.SmallRegular,{children:`${wo}${C-1}`})}):null,K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:E.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"tags":return o.jsxRuntimeExports.jsxs(gt,{ref:L=>{i(h,E.key,L)},columnWidth:E.width,windowSize:l,isThreadAllowed:E.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,E.key),children:[n.task.tagIds.length>0?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:t.getTagLabel(n.task.tagIds,n.tags)}):null,K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:E.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);case"createdBy":return o.jsxRuntimeExports.jsxs(gt,{ref:L=>{i(h,E.key,L)},columnWidth:E.width,windowSize:l,isThreadAllowed:E.isThreadAllowed,className:oe,onContextMenu:L=>Y(L,E.key),children:[o.jsxRuntimeExports.jsx(t.ZeniAvatar,{personBasic:n.createdByUser,styles:{width:t.Space.sp4,height:t.Space.sp4}}),o.jsxRuntimeExports.jsx(Vs,{children:x}),K({isElementThreadOpen:N,isElementThreadPresent:ie,itemKey:E.key,elementThreadId:z,threadStyle:k?{right:t.Space.sp0}:void 0})]},z);default:return null}})})})},ku=s.div`
1094
1094
  display: flex;
1095
1095
  min-width: 100%;
1096
1096
  flex-direction: row;
@@ -1177,7 +1177,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1177
1177
  height: ${t.Space.sp3};
1178
1178
  color: ${e=>e.color};
1179
1179
  margin-right: ${t.Space.sp2};
1180
- `,Ri=u.createContext(void 0),$i=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{uiState:d,onColumnSortConfigChanged:l}=u.useContext(Ri);return o.jsxRuntimeExports.jsxs(Ei,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(yu,{onColumnSortConfigChanged:l,sortConfig:{sortKey:d.sortKey,sortOrder:d.sortOrder}}),o.jsxRuntimeExports.jsx(Ou,{children:r})]})});$i.displayName="Task manager list view inner element type";const Du=({companyTaskManagerView:e,fetchNextItemsOnScroll:n,onColumnSortConfigChanged:r,onRowClick:i,initialOpenThreadRequest:a})=>{const{uiState:d,fetchState:l}=e,c=u.useRef(null),[p,m]=u.useState(null),h=u.useMemo(()=>({uiState:e.uiState,onColumnSortConfigChanged:r}),[e.uiState,r]),{setOpenThread:S,setRequestToOpenThread:x,requestToOpenThread:C,isLoading:b}=u.useContext(t.ThreadsContext);u.useEffect(()=>{a!=null&&e.fetchState==="Completed"&&b===!1&&x(a)},[a,e.fetchState,b,x]);const[f,g]=u.useState(void 0),j=u.useRef([]),y=u.useCallback(A=>e.tasksList[A].company.companyInfo.name.length>zt?Ie+32:Ie,[e.tasksList]),$=u.useCallback(A=>A<e.tasksList.length,[e.tasksList.length]),w=u.useCallback(()=>{d.pageToken!=null&&l==="Completed"&&n()},[n,l,d.pageToken]);u.useEffect(()=>{c.current&&c.current.resetAfterIndex(0)},[e]);const O=u.useCallback((A,v,T)=>{const F=e.tasksList.findIndex(K=>K.company.companyInfo.companyId===A),I=It.findIndex(K=>K.key===v);F!==-1&&I!==-1&&(j.current[F]==null?j.current[F]=[T]:j.current[F][I]=T)},[e.tasksList]);return u.useEffect(()=>{if(C!=null&&p!=null){const{companyId:A,entityType:v}=C,[T,F]=v.split("."),I=e.tasksList.findIndex(G=>G.company.companyInfo.companyId===A),K=It.findIndex(G=>G.key===F);I!==-1&&!(p.visibleStartIndex<=I&&p.visibleStopIndex>=I)&&c.current?.scrollToItem(I,"center"),setTimeout(()=>{const G=j.current[I]?.[0]?.getBoundingClientRect().bottom,E=j.current[I]?.[0]?.getBoundingClientRect().top;G!=null&&E!=null&&(window.innerHeight>=G&&window.innerHeight>=E||E<0)&&j.current[I][K]?.scrollIntoView({block:"center",behavior:"auto"})},0);const Y=setInterval(()=>{const G=j.current[I]?.[K]?.getBoundingClientRect().left,E=j.current[I]?.[K]?.getBoundingClientRect().right,P=j.current[I]?.[K]?.offsetWidth;if(G!=null&&P!=null&&E!=null&&(G<window.innerWidth-P||E<window.innerWidth)){clearInterval(Y);const W=C.threadId,k=C.onThreadShownCallback;W&&(x(null),S(C.threadId),k?.())}},500);setTimeout(()=>{clearInterval(Y),x(null)},2e3)}},[C,p,S,x]),o.jsxRuntimeExports.jsx(Mu,{children:o.jsxRuntimeExports.jsx(Ri.Provider,{value:h,children:o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:A,width:v})=>o.jsxRuntimeExports.jsx(Ei,{style:{height:A,width:v},children:o.jsxRuntimeExports.jsx(o.InfiniteLoader,{isItemLoaded:$,itemCount:e.tasksList.length+1,loadMoreItems:w,children:({onItemsRendered:T})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:A,innerElementType:$i,itemCount:e.tasksList.length,itemSize:y,itemData:{companyTaskManagerView:e,addThreadRequestThreadId:f,setElementRef:O,setAddThreadRequestThreadId:g,onRowClick:i},width:v,ref:c,onItemsRendered:F=>{m(F),T(F)},overscanCount:Mt,children:Au})})})})})})},Au=({index:e,style:n,data:r})=>{const i=r.companyTaskManagerView,{addThreadRequestThreadId:a,setElementRef:d,setAddThreadRequestThreadId:l,onRowClick:c}=r,p=i.tasksList[e];return o.jsxRuntimeExports.jsx(Nu,{style:{...n,width:"fit-content",minWidth:"100%"},children:o.jsxRuntimeExports.jsx(vu,{totalHeight:typeof n.height=="number"?n.height:Ie,addThreadRequestThreadId:a,setElementRef:d,setAddThreadRequestThreadId:l,task:p,onRowClick:c})},p.task.id)},Ei=s.div``,Ou=s.div`
1180
+ `,bi=u.createContext(void 0),Ri=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{uiState:d,onColumnSortConfigChanged:l}=u.useContext(bi);return o.jsxRuntimeExports.jsxs($i,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(yu,{onColumnSortConfigChanged:l,sortConfig:{sortKey:d.sortKey,sortOrder:d.sortOrder}}),o.jsxRuntimeExports.jsx(Ou,{children:r})]})});Ri.displayName="Task manager list view inner element type";const Du=({companyTaskManagerView:e,fetchNextItemsOnScroll:n,onColumnSortConfigChanged:r,onRowClick:i,initialOpenThreadRequest:a})=>{const{uiState:d,fetchState:l}=e,c=u.useRef(null),[p,m]=u.useState(null),h=u.useMemo(()=>({uiState:e.uiState,onColumnSortConfigChanged:r}),[e.uiState,r]),{setOpenThread:S,setRequestToOpenThread:x,requestToOpenThread:C,isLoading:b}=u.useContext(t.ThreadsContext);u.useEffect(()=>{a!=null&&e.fetchState==="Completed"&&b===!1&&x(a)},[a,e.fetchState,b,x]);const[f,g]=u.useState(void 0),j=u.useRef([]),y=u.useCallback(A=>e.tasksList[A].company.companyInfo.name.length>zt?Ie+32:Ie,[e.tasksList]),$=u.useCallback(A=>A<e.tasksList.length,[e.tasksList.length]),w=u.useCallback(()=>{d.pageToken!=null&&l==="Completed"&&n()},[n,l,d.pageToken]);u.useEffect(()=>{c.current&&c.current.resetAfterIndex(0)},[e]);const O=u.useCallback((A,v,T)=>{const F=e.tasksList.findIndex(K=>K.company.companyInfo.companyId===A),I=It.findIndex(K=>K.key===v);F!==-1&&I!==-1&&(j.current[F]==null?j.current[F]=[T]:j.current[F][I]=T)},[e.tasksList]);return u.useEffect(()=>{if(C!=null&&p!=null){const{companyId:A,entityType:v}=C,[T,F]=v.split("."),I=e.tasksList.findIndex(G=>G.company.companyInfo.companyId===A),K=It.findIndex(G=>G.key===F);I!==-1&&!(p.visibleStartIndex<=I&&p.visibleStopIndex>=I)&&c.current?.scrollToItem(I,"center"),setTimeout(()=>{const G=j.current[I]?.[0]?.getBoundingClientRect().bottom,E=j.current[I]?.[0]?.getBoundingClientRect().top;G!=null&&E!=null&&(window.innerHeight>=G&&window.innerHeight>=E||E<0)&&j.current[I][K]?.scrollIntoView({block:"center",behavior:"auto"})},0);const Y=setInterval(()=>{const G=j.current[I]?.[K]?.getBoundingClientRect().left,E=j.current[I]?.[K]?.getBoundingClientRect().right,P=j.current[I]?.[K]?.offsetWidth;if(G!=null&&P!=null&&E!=null&&(G<window.innerWidth-P||E<window.innerWidth)){clearInterval(Y);const W=C.threadId,k=C.onThreadShownCallback;W&&(x(null),S(C.threadId),k?.())}},500);setTimeout(()=>{clearInterval(Y),x(null)},2e3)}},[C,p,S,x]),o.jsxRuntimeExports.jsx(Mu,{children:o.jsxRuntimeExports.jsx(bi.Provider,{value:h,children:o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:A,width:v})=>o.jsxRuntimeExports.jsx($i,{style:{height:A,width:v},children:o.jsxRuntimeExports.jsx(o.InfiniteLoader,{isItemLoaded:$,itemCount:e.tasksList.length+1,loadMoreItems:w,children:({onItemsRendered:T})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:A,innerElementType:Ri,itemCount:e.tasksList.length,itemSize:y,itemData:{companyTaskManagerView:e,addThreadRequestThreadId:f,setElementRef:O,setAddThreadRequestThreadId:g,onRowClick:i},width:v,ref:c,onItemsRendered:F=>{m(F),T(F)},overscanCount:Mt,children:Au})})})})})})},Au=({index:e,style:n,data:r})=>{const i=r.companyTaskManagerView,{addThreadRequestThreadId:a,setElementRef:d,setAddThreadRequestThreadId:l,onRowClick:c}=r,p=i.tasksList[e];return o.jsxRuntimeExports.jsx(Nu,{style:{...n,width:"fit-content",minWidth:"100%"},children:o.jsxRuntimeExports.jsx(vu,{totalHeight:typeof n.height=="number"?n.height:Ie,addThreadRequestThreadId:a,setElementRef:d,setAddThreadRequestThreadId:l,task:p,onRowClick:c})},p.task.id)},$i=s.div``,Ou=s.div`
1181
1181
  position: relative;
1182
1182
  width: auto;
1183
1183
  height: 100%;
@@ -1191,7 +1191,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1191
1191
  min-height: 100%;
1192
1192
  flex-direction: column;
1193
1193
  width: 100%;
1194
- `,{cockpit:ss}=t.appLocale.getLocalizedStrings(),zu=({headerActions:e,headerData:n,isBirdsEyeViewEnabled:r,initialOpenThreadRequest:i,taskManagerPageData:a,taskManagerPageActions:d})=>{const{companyTaskManagerView:l}=a,{uiState:c}=l,{onCockpitReloadData:p,onFetchTaskManagerView:m,onRowClick:h}=d,[S,x]=u.useState(""),C=l.fetchState==="Completed",b=()=>{m(c.pageToken,c.sortKey,c.sortOrder,!0,c.filterText)},f=(y,$)=>{m(null,y,$,!1,c.filterText)},g=u.useRef(o.debounce(y=>m(null,"dueDate","descending",!1,y),500,{trailing:!0})).current,j=(y,$)=>{x($),$.trim().length>=2?g($):$.trim().length==0&&g("")};return o.jsxRuntimeExports.jsxs(Wu,{children:[o.jsxRuntimeExports.jsx(ht,{headerActions:{...e,filterActions:{...e.filterActions,onFilterTextChanged:j}},headerData:{...n,allTabOptions:xt,selectedTabOption:"taskManager",companiesLoaded:C,filterData:{filterText:S,disableFilters:!0}}}),r?o.jsxRuntimeExports.jsx(Vu,{metrics:l.metrics}):null,o.jsxRuntimeExports.jsx(Fu,{companyTaskManagerView:l,fetchNextItemsOnScroll:b,initialOpenThreadRequest:i,onCockpitReloadData:p,onColumnSortConfigChanged:f,onRowClick:h})]})},Fu=({companyTaskManagerView:e,fetchNextItemsOnScroll:n,initialOpenThreadRequest:r,onCockpitReloadData:i,onColumnSortConfigChanged:a,onRowClick:d})=>{const l=t.useWindowSizeContext();return e.fetchState==="Error"&&e.tasksList.length===0?o.jsxRuntimeExports.jsx(jt,{selectedCockpitOption:"taskManager",onCockpitReloadData:i}):e.fetchState==="Not-Started"||e.fetchState==="In-Progress"&&e.tasksList.length===0?o.jsxRuntimeExports.jsx(Bu,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.fetchState==="Completed"&&e.tasksList.length===0?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:ss.emptySearchTextFirstLine,emptySearchTextSecondLine:ss.emptySearchTextSecondLine,filtersApplied:!1}):o.jsxRuntimeExports.jsx(_u,{windowSize:l,children:o.jsxRuntimeExports.jsx(Du,{companyTaskManagerView:e,fetchNextItemsOnScroll:n,initialOpenThreadRequest:r,onColumnSortConfigChanged:a,onRowClick:d})})},Wu=s.div`
1194
+ `,{cockpit:ns}=t.appLocale.getLocalizedStrings(),zu=({headerActions:e,headerData:n,isBirdsEyeViewEnabled:r,initialOpenThreadRequest:i,taskManagerPageData:a,taskManagerPageActions:d})=>{const{companyTaskManagerView:l}=a,{uiState:c}=l,{onCockpitReloadData:p,onFetchTaskManagerView:m,onRowClick:h}=d,[S,x]=u.useState(""),C=l.fetchState==="Completed",b=()=>{m(c.pageToken,c.sortKey,c.sortOrder,!0,c.filterText)},f=(y,$)=>{m(null,y,$,!1,c.filterText)},g=u.useRef(o.debounce(y=>m(null,"dueDate","descending",!1,y),500,{trailing:!0})).current,j=(y,$)=>{x($),$.trim().length>=2?g($):$.trim().length==0&&g("")};return o.jsxRuntimeExports.jsxs(Wu,{children:[o.jsxRuntimeExports.jsx(ht,{headerActions:{...e,filterActions:{...e.filterActions,onFilterTextChanged:j}},headerData:{...n,allTabOptions:xt,selectedTabOption:"taskManager",companiesLoaded:C,filterData:{filterText:S,disableFilters:!0}}}),r?o.jsxRuntimeExports.jsx(Vu,{metrics:l.metrics}):null,o.jsxRuntimeExports.jsx(Fu,{companyTaskManagerView:l,fetchNextItemsOnScroll:b,initialOpenThreadRequest:i,onCockpitReloadData:p,onColumnSortConfigChanged:f,onRowClick:h})]})},Fu=({companyTaskManagerView:e,fetchNextItemsOnScroll:n,initialOpenThreadRequest:r,onCockpitReloadData:i,onColumnSortConfigChanged:a,onRowClick:d})=>{const l=t.useWindowSizeContext();return e.fetchState==="Error"&&e.tasksList.length===0?o.jsxRuntimeExports.jsx(bt,{selectedCockpitOption:"taskManager",onCockpitReloadData:i}):e.fetchState==="Not-Started"||e.fetchState==="In-Progress"&&e.tasksList.length===0?o.jsxRuntimeExports.jsx(Bu,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.fetchState==="Completed"&&e.tasksList.length===0?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:ns.emptySearchTextFirstLine,emptySearchTextSecondLine:ns.emptySearchTextSecondLine,filtersApplied:!1}):o.jsxRuntimeExports.jsx(_u,{windowSize:l,children:o.jsxRuntimeExports.jsx(Du,{companyTaskManagerView:e,fetchNextItemsOnScroll:n,initialOpenThreadRequest:r,onColumnSortConfigChanged:a,onRowClick:d})})},Wu=s.div`
1195
1195
  height: calc(100vh - 60px);
1196
1196
  overflow-y: hidden;
1197
1197
  display: flex;
@@ -1211,7 +1211,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1211
1211
  flex: 1;
1212
1212
  overflow: hidden;
1213
1213
  padding: ${e=>`${t.Space.sp0} ${Xe.cockpitRightPadding.valuePx(e.windowSize)} ${t.Space.sp0} ${Xe.cockpitLeftPadding.valuePx(e.windowSize)}`};
1214
- `,vo=ss.taskManager.metrics,Vu=({metrics:e})=>{const n=t.useWindowSizeContext();return o.jsxRuntimeExports.jsxs(Uu,{windowSize:n,children:[o.jsxRuntimeExports.jsxs(ko,{children:[o.jsxRuntimeExports.jsxs(To,{children:[o.jsxRuntimeExports.jsx(Lo,{children:vo.totalTasks}),o.jsxRuntimeExports.jsx(Po,{as:fi})]}),o.jsxRuntimeExports.jsx(Io,{children:e.total})]}),o.jsxRuntimeExports.jsxs(ko,{children:[o.jsxRuntimeExports.jsxs(To,{children:[o.jsxRuntimeExports.jsx(Lo,{children:vo.openTasks}),o.jsxRuntimeExports.jsx(Po,{as:t.SvgClock})]}),o.jsxRuntimeExports.jsx(Io,{children:e.open})]}),o.jsxRuntimeExports.jsxs(ko,{children:[o.jsxRuntimeExports.jsxs(To,{children:[o.jsxRuntimeExports.jsx(Lo,{children:vo.overdueTasks}),o.jsxRuntimeExports.jsx(Po,{as:t.SvgWarning})]}),o.jsxRuntimeExports.jsx(Io,{children:e.overdue})]}),o.jsxRuntimeExports.jsxs(ko,{children:[o.jsxRuntimeExports.jsxs(To,{children:[o.jsxRuntimeExports.jsx(Lo,{children:vo.closedTasks}),o.jsxRuntimeExports.jsx(Po,{as:t.SvgTickRoundFill})]}),o.jsxRuntimeExports.jsx(Io,{children:e.closed})]})]})},Uu=s.div`
1214
+ `,vo=ns.taskManager.metrics,Vu=({metrics:e})=>{const n=t.useWindowSizeContext();return o.jsxRuntimeExports.jsxs(Uu,{windowSize:n,children:[o.jsxRuntimeExports.jsxs(ko,{children:[o.jsxRuntimeExports.jsxs(To,{children:[o.jsxRuntimeExports.jsx(Lo,{children:vo.totalTasks}),o.jsxRuntimeExports.jsx(Po,{as:yi})]}),o.jsxRuntimeExports.jsx(Io,{children:e.total})]}),o.jsxRuntimeExports.jsxs(ko,{children:[o.jsxRuntimeExports.jsxs(To,{children:[o.jsxRuntimeExports.jsx(Lo,{children:vo.openTasks}),o.jsxRuntimeExports.jsx(Po,{as:t.SvgClock})]}),o.jsxRuntimeExports.jsx(Io,{children:e.open})]}),o.jsxRuntimeExports.jsxs(ko,{children:[o.jsxRuntimeExports.jsxs(To,{children:[o.jsxRuntimeExports.jsx(Lo,{children:vo.overdueTasks}),o.jsxRuntimeExports.jsx(Po,{as:t.SvgWarning})]}),o.jsxRuntimeExports.jsx(Io,{children:e.overdue})]}),o.jsxRuntimeExports.jsxs(ko,{children:[o.jsxRuntimeExports.jsxs(To,{children:[o.jsxRuntimeExports.jsx(Lo,{children:vo.closedTasks}),o.jsxRuntimeExports.jsx(Po,{as:t.SvgTickRoundFill})]}),o.jsxRuntimeExports.jsx(Io,{children:e.closed})]})]})},Uu=s.div`
1215
1215
  display: flex;
1216
1216
  flex-direction: row;
1217
1217
  gap: ${t.Space.sp4};
@@ -1236,7 +1236,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1236
1236
  color: ${e=>e.theme.colors.grey2};
1237
1237
  `,Io=s(t.H5Regular)`
1238
1238
  color: ${e=>e.theme.colors.hero};
1239
- `,Hu={},Ku={width:"auto",outline:"none",background:"transparent"},{common:{texts:{anonymousUser:hs},strings:{atTheRate:Gu}}}=t.appLocale.getLocalizedStrings(),Yu=({roomId:e,threadMetadata:n,composerPlaceholder:r,isSubmitComment:i=!1,createThreadCallback:a,composerFormStyle:d={},composerEditorStyle:l={}})=>{const c=Ze.useCreateThread(),p=o.useTheme(),m=u.useCallback(({body:h},S)=>{S.preventDefault(),S.stopPropagation();try{c({body:h,metadata:n}),a()}catch(x){console.log(x)}},[c,a,n]);return o.jsxRuntimeExports.jsx(Ze.RoomProvider,{id:e,children:o.jsxRuntimeExports.jsx(tm,{children:o.jsxRuntimeExports.jsxs(mt.Composer.Form,{onComposerSubmit:m,style:{...Hu,...d},className:"customThreadComposer",children:[o.jsxRuntimeExports.jsx(mt.Composer.Editor,{placeholder:r,style:{...t.textStyles.standardRegular,...Ku,color:p.colors.primary,...l},components:{Mention:Zu,MentionSuggestions:Xu,Link:Ju}}),o.jsxRuntimeExports.jsx(mt.Composer.Submit,{asChild:!0,children:o.jsxRuntimeExports.jsx(em,{isSubmitComment:i})})]})})})};function Zu({userId:e}){const{user:n}=ai.useUser(e);return o.jsxRuntimeExports.jsx(mt.Composer.Mention,{asChild:!0,children:o.jsxRuntimeExports.jsxs(sm,{children:[Gu,n?.name||hs]})})}function Xu({userIds:e,selectedUserId:n}){return e.length===0?null:o.jsxRuntimeExports.jsx(mt.Composer.Suggestions,{asChild:!0,children:o.jsxRuntimeExports.jsx(om,{children:o.jsxRuntimeExports.jsx(mt.Composer.SuggestionsList,{asChild:!0,children:o.jsxRuntimeExports.jsx(nm,{children:e.map(r=>o.jsxRuntimeExports.jsx(u.Suspense,{fallback:o.jsxRuntimeExports.jsx(qu,{}),children:o.jsxRuntimeExports.jsx(Qu,{userId:r},r)},r))})})})})}function qu(){return o.jsxRuntimeExports.jsxs(wi,{children:[o.jsxRuntimeExports.jsx(vi,{}),o.jsxRuntimeExports.jsx("span",{children:hs})]})}function Qu({userId:e}){const{user:n}=ai.useUser(e);return o.jsxRuntimeExports.jsx(mt.Composer.SuggestionsListItem,{asChild:!0,value:n.userId,children:o.jsxRuntimeExports.jsxs(wi,{children:[n.avatar?o.jsxRuntimeExports.jsx(im,{src:n.avatar,alt:""}):o.jsxRuntimeExports.jsx(vi,{}),o.jsxRuntimeExports.jsx("span",{children:n.name||n.email||hs})]})},n.userId)}function Ju({href:e,children:n}){return o.jsxRuntimeExports.jsx(mt.Composer.Link,{href:e,asChild:!0,children:o.jsxRuntimeExports.jsx(rm,{children:n})})}const em=({isSubmitComment:e=!1})=>{const{isEmpty:n,submit:r}=mt.useComposer();return u.useEffect(()=>{e&&!n&&r()},[e,n,r]),o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{})},tm=s.div`
1239
+ `,Hu={},Ku={width:"auto",outline:"none",background:"transparent"},{common:{texts:{anonymousUser:xs},strings:{atTheRate:Gu}}}=t.appLocale.getLocalizedStrings(),Yu=({roomId:e,threadMetadata:n,composerPlaceholder:r,isSubmitComment:i=!1,createThreadCallback:a,composerFormStyle:d={},composerEditorStyle:l={}})=>{const c=Ze.useCreateThread(),p=o.useTheme(),m=u.useCallback(({body:h},S)=>{S.preventDefault(),S.stopPropagation();try{c({body:h,metadata:n}),a()}catch(x){console.log(x)}},[c,a,n]);return o.jsxRuntimeExports.jsx(Ze.RoomProvider,{id:e,children:o.jsxRuntimeExports.jsx(tm,{children:o.jsxRuntimeExports.jsxs(mt.Composer.Form,{onComposerSubmit:m,style:{...Hu,...d},className:"customThreadComposer",children:[o.jsxRuntimeExports.jsx(mt.Composer.Editor,{placeholder:r,style:{...t.textStyles.standardRegular,...Ku,color:p.colors.primary,...l},components:{Mention:Zu,MentionSuggestions:Xu,Link:Ju}}),o.jsxRuntimeExports.jsx(mt.Composer.Submit,{asChild:!0,children:o.jsxRuntimeExports.jsx(em,{isSubmitComment:i})})]})})})};function Zu({userId:e}){const{user:n}=ii.useUser(e);return o.jsxRuntimeExports.jsx(mt.Composer.Mention,{asChild:!0,children:o.jsxRuntimeExports.jsxs(sm,{children:[Gu,n?.name||xs]})})}function Xu({userIds:e,selectedUserId:n}){return e.length===0?null:o.jsxRuntimeExports.jsx(mt.Composer.Suggestions,{asChild:!0,children:o.jsxRuntimeExports.jsx(om,{children:o.jsxRuntimeExports.jsx(mt.Composer.SuggestionsList,{asChild:!0,children:o.jsxRuntimeExports.jsx(nm,{children:e.map(r=>o.jsxRuntimeExports.jsx(u.Suspense,{fallback:o.jsxRuntimeExports.jsx(qu,{}),children:o.jsxRuntimeExports.jsx(Qu,{userId:r},r)},r))})})})})}function qu(){return o.jsxRuntimeExports.jsxs(Ei,{children:[o.jsxRuntimeExports.jsx(wi,{}),o.jsxRuntimeExports.jsx("span",{children:xs})]})}function Qu({userId:e}){const{user:n}=ii.useUser(e);return o.jsxRuntimeExports.jsx(mt.Composer.SuggestionsListItem,{asChild:!0,value:n.userId,children:o.jsxRuntimeExports.jsxs(Ei,{children:[n.avatar?o.jsxRuntimeExports.jsx(im,{src:n.avatar,alt:""}):o.jsxRuntimeExports.jsx(wi,{}),o.jsxRuntimeExports.jsx("span",{children:n.name||n.email||xs})]})},n.userId)}function Ju({href:e,children:n}){return o.jsxRuntimeExports.jsx(mt.Composer.Link,{href:e,asChild:!0,children:o.jsxRuntimeExports.jsx(rm,{children:n})})}const em=({isSubmitComment:e=!1})=>{const{isEmpty:n,submit:r}=mt.useComposer();return u.useEffect(()=>{e&&!n&&r()},[e,n,r]),o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{})},tm=s.div`
1240
1240
  .customThreadComposer span[data-slate-placeholder="true"] {
1241
1241
  color: ${e=>e.theme.colors.grey1};
1242
1242
  }
@@ -1251,7 +1251,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1251
1251
  border-radius: ${t.Space.sp2};
1252
1252
  margin: ${t.Space.sp0};
1253
1253
  padding: ${t.Space.sp0};
1254
- `,wi=s(t.StandardRegular)`
1254
+ `,Ei=s(t.StandardRegular)`
1255
1255
  display: flex;
1256
1256
  flex-direction: row;
1257
1257
  align-items: center;
@@ -1277,7 +1277,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1277
1277
  text-decoration: underline;
1278
1278
  color: ${e=>e.theme.colors.link};
1279
1279
  }
1280
- `,vi=s(t.SvgAvatar)`
1280
+ `,wi=s(t.SvgAvatar)`
1281
1281
  color: ${e=>e.theme.colors.hero};
1282
1282
  height: ${t.Space.sp4};
1283
1283
  width: ${t.Space.sp4};
@@ -1287,7 +1287,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1287
1287
  margin-right: ${t.Space.sp1};
1288
1288
  height: ${t.Space.sp4};
1289
1289
  width: ${t.Space.sp4};
1290
- `,Tt=t.appLocale.getLocalizedStrings().cockpit.health;function ki({percentage:e=-1,barHeight:n}){const r=o.useTheme();return o.jsxRuntimeExports.jsxs(lm,{"data-testid":t.generateDataTestId("cockpit-health-meter"),children:[o.jsxRuntimeExports.jsxs(no,{width:"13%",backgroundColor:e>0?t.Colors.success:r.colors.grey2,height:n,children:[o.jsxRuntimeExports.jsx(rs,{height:n,children:Tt.detailPage.meterRangePercents.zeroPercent}),o.jsxRuntimeExports.jsx(Do,{isRight:!0,height:n,children:Tt.detailPage.meterRangePercents.fiftyPercent}),e>=0&&e<50?o.jsxRuntimeExports.jsx(oo,{height:n,percentage:e,low:0,high:50}):null]}),o.jsxRuntimeExports.jsx(no,{height:n,width:"17%",backgroundColor:e>50?t.Colors.alert:r.colors.grey2,children:e>=50&&e<60?o.jsxRuntimeExports.jsx(oo,{height:n,percentage:e,low:50,high:60}):null}),o.jsxRuntimeExports.jsxs(no,{height:n,width:"23%",backgroundColor:e>60?t.Colors.graphColor34Dark:r.colors.grey2,children:[o.jsxRuntimeExports.jsx(Do,{height:n,isRight:!1,children:Tt.detailPage.meterRangePercents.sixtyPercent}),o.jsxRuntimeExports.jsx(Do,{height:n,isRight:!0,children:Tt.detailPage.meterRangePercents.seventyFivePercent}),e>=60&&e<75?o.jsxRuntimeExports.jsx(oo,{height:n,percentage:e,low:60,high:75}):null]}),o.jsxRuntimeExports.jsx(no,{height:n,width:"24%",backgroundColor:e>75?t.Colors.graphColor35Dark:r.colors.grey2,children:e>=75&&e<90?o.jsxRuntimeExports.jsx(oo,{height:n,percentage:e,low:75,high:90}):null}),o.jsxRuntimeExports.jsxs(no,{height:n,width:"20%",backgroundColor:e>90?t.Colors.graphColor01Dark:r.colors.grey2,children:[o.jsxRuntimeExports.jsx(Do,{height:n,isRight:!1,children:Tt.detailPage.meterRangePercents.ninetyPercent}),o.jsxRuntimeExports.jsx(rs,{height:n,children:Tt.detailPage.meterRangePercents.hundredPercent}),e>=90&&e<=100?o.jsxRuntimeExports.jsx(oo,{height:n,percentage:e,low:90,high:100}):null]})]})}const am=(e,n,r)=>{const i=r-n;return(e-n)/i*100},oo=({percentage:e,low:n,high:r,height:i})=>o.jsxRuntimeExports.jsx(cm,{height:i,style:{left:`${am(e,n,r)}%`},"data-testid":t.generateDataTestId("cockpit-health-meter-pointer"),children:o.jsxRuntimeExports.jsx(t.Tooltip,{title:`${e}${Tt.detailPage.churnProbabilityTexts.percent}`,placement:"top",style:{padding:`2px ${t.Space.sp2}`},children:o.jsxRuntimeExports.jsx("div",{style:{color:"transparent"},children:e})})}),lm=s.div`
1290
+ `,Lt=t.appLocale.getLocalizedStrings().cockpit.health;function vi({percentage:e=-1,barHeight:n}){const r=o.useTheme();return o.jsxRuntimeExports.jsxs(lm,{"data-testid":t.generateDataTestId("cockpit-health-meter"),children:[o.jsxRuntimeExports.jsxs(no,{width:"13%",backgroundColor:e>0?t.Colors.success:r.colors.grey2,height:n,children:[o.jsxRuntimeExports.jsx(ss,{height:n,children:Lt.detailPage.meterRangePercents.zeroPercent}),o.jsxRuntimeExports.jsx(Do,{isRight:!0,height:n,children:Lt.detailPage.meterRangePercents.fiftyPercent}),e>=0&&e<50?o.jsxRuntimeExports.jsx(oo,{height:n,percentage:e,low:0,high:50}):null]}),o.jsxRuntimeExports.jsx(no,{height:n,width:"17%",backgroundColor:e>50?t.Colors.alert:r.colors.grey2,children:e>=50&&e<60?o.jsxRuntimeExports.jsx(oo,{height:n,percentage:e,low:50,high:60}):null}),o.jsxRuntimeExports.jsxs(no,{height:n,width:"23%",backgroundColor:e>60?t.Colors.graphColor34Dark:r.colors.grey2,children:[o.jsxRuntimeExports.jsx(Do,{height:n,isRight:!1,children:Lt.detailPage.meterRangePercents.sixtyPercent}),o.jsxRuntimeExports.jsx(Do,{height:n,isRight:!0,children:Lt.detailPage.meterRangePercents.seventyFivePercent}),e>=60&&e<75?o.jsxRuntimeExports.jsx(oo,{height:n,percentage:e,low:60,high:75}):null]}),o.jsxRuntimeExports.jsx(no,{height:n,width:"24%",backgroundColor:e>75?t.Colors.graphColor35Dark:r.colors.grey2,children:e>=75&&e<90?o.jsxRuntimeExports.jsx(oo,{height:n,percentage:e,low:75,high:90}):null}),o.jsxRuntimeExports.jsxs(no,{height:n,width:"20%",backgroundColor:e>90?t.Colors.graphColor01Dark:r.colors.grey2,children:[o.jsxRuntimeExports.jsx(Do,{height:n,isRight:!1,children:Lt.detailPage.meterRangePercents.ninetyPercent}),o.jsxRuntimeExports.jsx(ss,{height:n,children:Lt.detailPage.meterRangePercents.hundredPercent}),e>=90&&e<=100?o.jsxRuntimeExports.jsx(oo,{height:n,percentage:e,low:90,high:100}):null]})]})}const am=(e,n,r)=>{const i=r-n;return(e-n)/i*100},oo=({percentage:e,low:n,high:r,height:i})=>o.jsxRuntimeExports.jsx(cm,{height:i,style:{left:`${am(e,n,r)}%`},"data-testid":t.generateDataTestId("cockpit-health-meter-pointer"),children:o.jsxRuntimeExports.jsx(t.Tooltip,{title:`${e}${Lt.detailPage.churnProbabilityTexts.percent}`,placement:"top",style:{padding:`2px ${t.Space.sp2}`},children:o.jsxRuntimeExports.jsx("div",{style:{color:"transparent"},children:e})})}),lm=s.div`
1291
1291
  display: flex;
1292
1292
  gap: 2px;
1293
1293
  `,no=s.div`
@@ -1298,13 +1298,13 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1298
1298
  height: ${e=>`${e.height}px`};
1299
1299
  width: ${e=>e.width};
1300
1300
  position: relative;
1301
- `,rs=s(t.LargeRegular)`
1301
+ `,ss=s(t.LargeRegular)`
1302
1302
  margin-top: ${e=>e.height===t.sp[5]?t.Space.sp5:"12px"};
1303
1303
  margin-left: ${t.Space.sp0};
1304
1304
  margin-right: ${t.Space.sp0};
1305
1305
  font-size: ${e=>e.height===t.sp[5]?t.textStyles.largeRegular.fontSize:t.textStyles.smallRegular.fontSize};
1306
1306
  color: ${e=>e.theme.colors.champion};
1307
- `,Do=s(rs)`
1307
+ `,Do=s(ss)`
1308
1308
  transform: ${e=>e.isRight?" translateX(70%)":" translateX(-35%);"};
1309
1309
  `,cm=s.div`
1310
1310
  cursor: pointer;
@@ -1317,7 +1317,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1317
1317
  left: 19%;
1318
1318
  position: absolute;
1319
1319
  background-color: ${e=>e.theme.colors.primary};
1320
- `,{dateFormat:Us,timeFormat:dm,timeframe:nt,common:pm}=t.appLocale.getLocalizedStrings(),Sn=e=>{if(e!=null){const n=ee.dateNow();return Math.abs(n.diff(e,"days"))}};function bo(e){if(e==null)return;const n=ee.dateNow();if(Math.abs(n.diff(e,"days"))<=0)return`0 ${nt.day}`;const[i,a]=e<n?[e,n]:[n,e],d=i.year(),l=i.month(),c=i.date(),p=a.year(),m=a.month(),h=a.date();let S=p-d,x=m-l,C=h-c;if(C<0){x--;const f=new Date(p,m,0);C+=f.getDate()}x<0&&(S--,x+=12);const b=[];return S>0&&b.push(`${S} ${S>1?nt.year:nt.year.slice(0,-1)}`),x>0&&b.push(`${x} ${x>1?nt.month:nt.month.slice(0,-1)}`),C>0&&b.push(`${C} ${C>1?nt.day:nt.day.slice(0,-1)}`),b.join(", ")}function Ti(e){if(e==null)return pm.strings.hyphen;const n=Math.floor(Number(e)/12),r=Number(e)%12,i=n>1?nt.year:nt.year.slice(0,-1),a=r>1?nt.month:nt.month.slice(0,-1);return n===0?`${e} ${a}`:r===0?`${n} ${i}`:`${n} ${i}, ${r} ${a}`}const Li=e=>({name:e?.companyInfo.name??"",productVerticals:e?.companyHealthMetric.verticalProductServices??void 0,runway:e?.companyHealthMetric.runway,churnProbabilityPercentage:e?.companyHealthMetric.churnProbabilityPercentage,netPromoterScore:e?.companyHealthMetric.netPromoterScore,customerSatisfactionScore:e?.companyHealthMetric.customerSatisfactionScore,lastReportSent:e?.managementInfo.lastReportSentDate!=null?bo(ee.zeniDate(e?.managementInfo.lastReportSentDate.toISOString())):void 0,dashboardLastVisit:e?.companyHealthMetric.customerLastDashboardVisit!=null?ee.zeniDate(e?.companyHealthMetric.customerLastDashboardVisit.toISOString()).format(Us.visual.MMMDCommaYYYYformat):void 0,companyEngagementMetricsUpdatedAt:e?.companyHealthMetric.companyEngagementMetricsUpdatedAt!=null?{date:ee.zeniDate(e?.companyHealthMetric.companyEngagementMetricsUpdatedAt.toISOString()).format(Us.visual.MMMDCommaYYYYformat),time:ee.zeniDate(e?.companyHealthMetric.companyEngagementMetricsUpdatedAt.toISOString()).format(dm.hhmmAFormat)}:void 0,noOfVerticalsEnabled:e?.noOfProductVerticalsEnabled,renewalDate:e?.companyHealthMetric.subscriptionRenewalDate!=null?bo(ee.zeniDate(e?.companyHealthMetric.subscriptionRenewalDate.toISOString())):void 0,lastEngagements:e!=null?e.companyHealthMetric.lastEngagements:[],additionalChurnFactors:e!=null?e.companyHealthMetric.additionalChurnFactors:{increasingChurnProbability:[],decreasingChurnProbability:[]},updatedByUserName:e?.companyHealthMetric.updatedByUser!=null?t.getFullName(e.companyHealthMetric.updatedByUser):void 0}),Be=t.appLocale.getLocalizedStrings().cockpit.health.header,Dt=[{key:"companyName",value:Be.name,sortOrder:"ascending",width:new t.ResponsiveSized(392,392),isThreadAllowed:!0},{key:"churnProbability",value:Be.churnProbability,sortOrder:"ascending",width:new t.ResponsiveSized(380,380),isThreadAllowed:!0},{key:"controller",value:Be.controller,sortOrder:"ascending",width:new t.ResponsiveSized(200,200),isThreadAllowed:!0},{key:"customerSuccessManager",value:Be.customerSuccessManager,sortOrder:"ascending",width:new t.ResponsiveSized(200,200),isThreadAllowed:!0},{key:"lastEngagement",value:Be.lastEngagement,sortOrder:"ascending",width:new t.ResponsiveSized(270,270),isThreadAllowed:!0},{key:"companyEngagementMetricsUpdatedAt",value:Be.companyEngagementMetricsUpdatedAt,sortOrder:"ascending",width:new t.ResponsiveSized(160,160),isThreadAllowed:!0},{key:"runway",value:Be.runway,sortOrder:"ascending",width:new t.ResponsiveSized(220,220),isThreadAllowed:!0},{key:"netPromoterScore",value:Be.netPromoterScore,sortOrder:"ascending",width:new t.ResponsiveSized(120,120),isThreadAllowed:!0},{key:"customerSatisfactionScore",value:Be.customerSatisfactionScore,sortOrder:"ascending",width:new t.ResponsiveSized(120,120),isThreadAllowed:!0},{key:"lastReportSent",value:Be.lastReportSent,sortOrder:"ascending",width:new t.ResponsiveSized(250,250),isThreadAllowed:!0},{key:"dashboardLastSeen",value:Be.dashboardLastSeen,sortOrder:"ascending",width:new t.ResponsiveSized(270,270),isThreadAllowed:!0},{key:"subscriptionDate",value:Be.subscriptionDate,sortOrder:"ascending",width:new t.ResponsiveSized(200,200),isThreadAllowed:!0},{key:"renewalDate",value:Be.renewalDate,sortOrder:"ascending",width:new t.ResponsiveSized(180,180),isThreadAllowed:!0},{key:"group",value:Be.group,sortOrder:"ascending",width:new t.ResponsiveSized(148,148),isThreadAllowed:!0},{key:"monthlyRecurringRevenue",value:Be.monthlyRecurringRevenue,sortOrder:"ascending",width:new t.ResponsiveSized(196,196),isThreadAllowed:!0},{key:"externalProductServiceExposure",value:Be.externalProductServiceExposure,sortOrder:"ascending",width:new t.ResponsiveSized(270,270),isThreadAllowed:!0},{key:"productVerticals",value:Be.productVerticals,sortOrder:"ascending",width:new t.ResponsiveSized(360,360),isThreadAllowed:!0}];Dt.map(e=>e.key);const Pi=e=>le.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M10.1094 4H2.3764C2.16286 4 1.98975 4.22386 1.98975 4.5V11.5C1.98975 11.7761 2.16286 12 2.3764 12H10.1094C10.323 12 10.4961 11.7761 10.4961 11.5V4.5C10.4961 4.22386 10.323 4 10.1094 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M11.0046 7L14.0046 5V11L11.0046 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}));function um({companyView:e,healthView:n,companyNameSticky:r,totalHeight:i,addThreadRequestThreadId:a,setNoteData:d,setElementRef:l,setAddThreadRequestThreadId:c,onRowClick:p}){const m=t.useWindowSizeContext(),h=t.appLocale.getLocalizedStrings(),{common:{strings:{hyphen:S,backspace:x,space:C,colon:b,dot:f}},cockpit:{health:{detailPage:{churnProbabilityTexts:{churnProbability:g,for:j,is:y,percent:$},notApplicable:w},common:{engagementTypes:O,labels:{lastEngagements:A,factorsThatDecreaseChurnProbability:v,factorsThatIncreaseChurnProbability:T}}}},dateFormat:F}=h,{companyInfo:{companyId:I,name:K},companyHealthMetric:M,controllers:Y,managementInfo:{lastReportSentDate:G,customerSuccessManagerUserIds:E}}=e,P=Li(e),k=n.zeniUsers.values.filter(R=>E.includes(R.userId)),D=`cockpit_${I}`,z="healthMonitor.notes",{threads:Z,isLoading:ie}=t.useFilteredThreads({entityType:z,companyId:I},!1),N={name:K,companyId:I,companyGroup:e.companyGroup!=null?e.companyGroup.find(R=>R.id===e.managementInfo.companyGroupId):void 0,monthlyRecurringRevenue:e.monthlyRecurringRevenue,productVerticals:M.verticalProductServices,runway:M.runway,churnProbabilityPercentage:M.churnProbabilityPercentage,netPromoterScore:M.netPromoterScore,customerSatisfactionScore:M.customerSatisfactionScore,controllers:Y.map(R=>ee.getUserName(R)),customerSuccessManagers:k.map(R=>ee.getUserName(R)),lastReportSent:G!=null?ee.zeniDate(G.toISOString()):void 0,subscriptionStartDate:M.subscriptionStartDate!=null?ee.zeniDate(M.subscriptionStartDate.toISOString()).format(F.visual.MMMDCommaYYYYformat):void 0,renewalDate:M.subscriptionRenewalDate!=null?ee.zeniDate(M.subscriptionRenewalDate.toISOString()):void 0,companyEngagementMetricsUpdatedAt:M.companyEngagementMetricsUpdatedAt,externalProductServiceExposure:M.externalProductServiceExposure},{openThread:H,threads:L,addThread:Q,removeThread:se,setOpenThread:X,setRequestToOpenThread:re}=u.useContext(t.ThreadsContext),te=H!==null?L.get(H):null,he=H?.includes(I)===!0,fe=H!=null&&L.get(H)==null&&he,be=a!=null&&L.get(a)?.metadata.companyId===I,_=u.useCallback(()=>{H?.includes(t.NEW_THREAD_SUFFIX)===!0&&se(H),a!=null&&c(void 0)},[a,H,se,c]),J=u.useCallback(R=>{if(R===H)X(null);else if(L.has(R))X(R);else if(R.includes(t.NEW_THREAD_SUFFIX)){const[Ce,ae]=R.replace(t.NEW_THREAD_SUFFIX,"").split("."),ce=Ft(Ct(Ce),ee.toHealthSortKeyType(ae),I,K);Q(R,{type:"thread",id:R,roomId:D,createdAt:new Date,updatedAt:new Date,comments:[],metadata:ce,resolved:!1}),X(R)}},[I,K,H,L,Q,X,D]),ge=u.useCallback((R,Ce,ae=!1)=>{const ce=Dt.find($e=>$e.key===Ce);if(re(null),ce!=null&&(R.type==="contextmenu"||ae===!0)){if(ce.isThreadAllowed===!1)return;_(),R.preventDefault(),R.stopPropagation();const $e=t.toCollaborationEntityType({tab:"healthMonitor",key:ce.key}),V=[...t.getFilteredThreads(L,{entityType:$e,companyId:I},"both")],B=V.length>0&&V[0].length>0?V[0][0]:Le("healthMonitor",ce.key,I);L.has(B)?J(B):a===B?c(void 0):(c(B),X(null))}},[L,I,a,J,c,X,re,_]),ve=u.useCallback((R,Ce)=>{R.stopPropagation();const ae=Le("healthMonitor",Ce,I);c(void 0),J(ae)},[I,c,J]),Re=R=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:R.isElementThreadOpen??!1,isElementThreadPresent:R.isElementThreadPresent??!1,itemKey:R.itemKey,elementThreadId:R.elementThreadId??"",roomId:D,addThreadRequestThreadId:a,openThreadId:H,threadStyle:R.threadStyle,openThreadMetadata:te?.metadata??null,onElementClick:ge,onAddThreadClick:ve});return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{re(null),a!=null&&(c(void 0),a.includes(t.NEW_THREAD_SUFFIX)&&se(a))},children:o.jsxRuntimeExports.jsx(mm,{windowSize:m,isThreadOpen:he||be,totalHeight:i,isCreationInProgress:fe,"data-testid":t.generateDataTestId("health-monitor-row",I),onClick:()=>p(N.companyId),children:Dt.map((R,Ce)=>{const ae=t.toCollaborationEntityType({tab:"healthMonitor",key:R.key}),ce=Dt.length-2<=Ce,$e=[...t.getFilteredThreads(L,{entityType:ae,companyId:I},"both")],V=$e.length>0&&$e[0].length>0?$e[0][0]:Le("healthMonitor",R.key,I),B=L.get(V),pe=B!=null&&B.resolved===!1,ye=V===H,ke=a===V,ue=P.lastEngagements;switch(R.key){case"companyName":return o.jsxRuntimeExports.jsxs(Sm,{companyNameSticky:r,columnWidth:R.width,windowSize:m,isThreadOpen:ye||ke,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-company-name",I),onContextMenu:U=>ge(U,R.key),ref:U=>{l(I,R.key,U)},children:[o.jsxRuntimeExports.jsxs(Cm,{"data-testid":t.generateDataTestId("health-monitor-row-company-name-text",I),children:[N.name,o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:ye,roomId:D,openThreadId:H,openThreadMetadata:te?.metadata??null})]}),o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:`2px ${t.Space.sp2}`},title:"Notes",children:o.jsxRuntimeExports.jsxs(bm,{className:"notesIcon","data-testid":t.generateDataTestId("health-monitor-row-notes-icon",I),onClick:U=>{U.preventDefault(),U.stopPropagation(),d({roomId:D,companyId:I,companyName:K,entityType:z})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:Z.length,isLoading:ie}),o.jsxRuntimeExports.jsx(Rm,{})]})}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:pe,itemKey:R.key,style:{left:t.Space.sp4},onElementClick:ge}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("healthMonitor",R.key,I),addThreadRequestThreadId:a,itemKey:R.key,onAddThreadClick:ve})]},V);case"productVerticals":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-product-verticals",I),onContextMenu:U=>ge(U,R.key),children:[o.jsxRuntimeExports.jsx(Ii,{productVerticals:M.verticalProductServices,testIdSuffix:I}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"runway":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-runway",I),onContextMenu:U=>ge(U,R.key),children:[N.runway!=null?ee.isCompanyRunwayInfinite(N.runway)===!0?o.jsxRuntimeExports.jsx($m,{"data-testid":t.generateDataTestId("health-monitor-row-runway-infinity",I)}):Ti(N.runway.runwayMonths):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:S}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"churnProbability":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-churn-probability",I),onContextMenu:U=>ge(U,R.key),children:[o.jsxRuntimeExports.jsx(jm,{"data-testid":t.generateDataTestId("health-monitor-row-churn-meter",I),children:o.jsxRuntimeExports.jsx(ki,{percentage:N.churnProbabilityPercentage,barHeight:12})}),P.churnProbabilityPercentage!=null?o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:`12px ${t.Space.sp3}`,textAlign:"left"},title:o.jsxRuntimeExports.jsxs(vm,{children:[o.jsxRuntimeExports.jsx(km,{children:`${g} ${j} ${e.companyInfo.name} ${y} ${Math.round(P.churnProbabilityPercentage??0)}${$}${f}`}),e.companyHealthMetric.churnProbabilityReason.length!==0||e.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(Ks,{children:[o.jsxRuntimeExports.jsxs(Gs,{children:[T,b]}),o.jsxRuntimeExports.jsxs(Ys,{children:[e.companyHealthMetric.churnProbabilityReason.map((U,Oe)=>o.jsxRuntimeExports.jsx(fn,{children:o.jsxRuntimeExports.jsx(Cn,{children:U.text})},`${o.nanoid()}_${Oe}}`)),e.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.map((U,Oe)=>o.jsxRuntimeExports.jsx(fn,{children:o.jsxRuntimeExports.jsx(Cn,{children:U.value})},`${o.nanoid()}_${Oe}}`))]})]}):null,e.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(Ks,{children:[o.jsxRuntimeExports.jsxs(Gs,{children:[v,b]}),o.jsxRuntimeExports.jsx(Ys,{children:e.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.map((U,Oe)=>o.jsxRuntimeExports.jsx(fn,{children:o.jsxRuntimeExports.jsx(Cn,{children:U.value})},`${o.nanoid()}_${Oe}}`))})]}):null]}),children:o.jsxRuntimeExports.jsx(wm,{"data-testid":t.generateDataTestId("health-monitor-row-churn-info-icon",I),style:{marginTop:t.Space.sp1,marginLeft:t.Space.sp1,marginRight:t.Space.sp0}})}):null,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"customerSatisfactionScore":case"netPromoterScore":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId(`health-monitor-row-${R.key==="netPromoterScore"?"nps":"csat"}`,I),onContextMenu:U=>ge(U,R.key),children:[N[R.key]!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(fm,{children:N[R.key]}),o.jsxRuntimeExports.jsx(ym,{children:x}),R.key==="netPromoterScore"?o.jsxRuntimeExports.jsxs(Hs,{children:[" ",Fa," "]}):o.jsxRuntimeExports.jsxs(Hs,{children:[" ",Wa," "]})]}):N.churnProbabilityPercentage!=null?w:S,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"controller":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-controller",I),onContextMenu:U=>ge(U,R.key),children:[o.jsxRuntimeExports.jsx(t.Tooltip,{enterDelay:600,style:{padding:`2px ${t.Space.sp2}`},title:N.controllers.join(", "),children:N.controllers[0]}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"customerSuccessManager":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-csm",I),onContextMenu:U=>ge(U,R.key),children:[o.jsxRuntimeExports.jsx(t.Tooltip,{enterDelay:600,style:{padding:`2px ${t.Space.sp2}`,textAlign:"left"},maxWidth:"300px",title:N.customerSuccessManagers.join(", "),children:N.customerSuccessManagers[0]}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"lastReportSent":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-last-report-sent",I),onContextMenu:U=>ge(U,R.key),children:[o.jsxRuntimeExports.jsx(yn,{children:N.lastReportSent!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(t.LargeRegular,{children:bo(N.lastReportSent)}),o.jsxRuntimeExports.jsx(t.SmallRegular,{children:N.lastReportSent.format(F.visual.MMMDCommaYYYYformat)})]}):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:S})}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"renewalDate":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-renewal-date",I),onContextMenu:U=>ge(U,R.key),children:[o.jsxRuntimeExports.jsx(yn,{children:N.renewalDate!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(t.LargeRegular,{children:bo(N.renewalDate)}),o.jsxRuntimeExports.jsx(t.SmallRegular,{children:N.renewalDate.format(F.visual.MMMDCommaYYYYformat)})]}):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:S})}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"group":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-group",I),onContextMenu:U=>ge(U,R.key),children:[N.companyGroup!=null?o.jsxRuntimeExports.jsx(Em,{"data-testid":t.generateDataTestId("health-monitor-row-group-badge",I),textColor:gi[N.companyGroup.id],children:N.companyGroup.name.toUpperCase()}):S,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"monthlyRecurringRevenue":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-mrr",I),onContextMenu:U=>ge(U,R.key),children:[t.amountToString("0,0",N.monthlyRecurringRevenue),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"externalProductServiceExposure":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-external-exposure",I),onContextMenu:U=>ge(U,R.key),children:[N.externalProductServiceExposure!=null?N.externalProductServiceExposure.name:S,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"lastEngagement":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-last-engagement",I),onContextMenu:U=>ge(U,R.key),children:[ue.length>0?o.jsxRuntimeExports.jsxs(t.Tooltip,{style:{padding:`12px ${t.Space.sp3}`},title:o.jsxRuntimeExports.jsxs(Tm,{children:[o.jsxRuntimeExports.jsxs(Lm,{children:[A,b]}),ue.map((U,Oe)=>o.jsxRuntimeExports.jsxs(Pm,{children:[o.jsxRuntimeExports.jsxs(Im,{children:[U.type==="email"?o.jsxRuntimeExports.jsx(Om,{}):o.jsxRuntimeExports.jsx(Nm,{}),o.jsxRuntimeExports.jsx(hm,{children:U.type==="email"?O.email:O.meeting})]}),o.jsxRuntimeExports.jsx(Dm,{children:U.scheduledAt?.utc(!0).local().format(F.visual.MMMDCommaYYYYformat)??S})]},`${o.nanoid()}_${Oe}}`))]}),children:[ue[0].scheduledAt?.utc(!0).local().format(F.visual.MMMDCommaYYYYformat)??S,o.jsxRuntimeExports.jsxs(Am,{children:[ue[0].type==="email"?o.jsxRuntimeExports.jsx(Di,{className:"engagement-email-icon"}):o.jsxRuntimeExports.jsx(Ai,{className:"engagement-meeting-icon"}),o.jsxRuntimeExports.jsxs(Mm,{children:["Via",C,ue[0].type==="email"?O.email:O.meeting]})]})]}):o.jsxRuntimeExports.jsx(t.StandardRegular,{children:S}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"dashboardLastSeen":case"subscriptionDate":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId(`health-monitor-row-${R.key==="dashboardLastSeen"?"dashboard-last-seen":"subscription-date"}`,I),onContextMenu:U=>ge(U,R.key),children:[N.subscriptionStartDate??S,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"companyEngagementMetricsUpdatedAt":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-engagement-updated",I),onContextMenu:U=>ge(U,R.key),children:[o.jsxRuntimeExports.jsx(yn,{children:N.companyEngagementMetricsUpdatedAt!=null?o.jsxRuntimeExports.jsx(t.LargeRegular,{children:bo(N.companyEngagementMetricsUpdatedAt)}):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:S})}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);default:return null}})})})}const Ii=({productVerticals:e,testIdSuffix:n})=>{const r=i=>{switch(i){case"billpay":return{key:"ZBP",color:t.Colors.graphColor34Dark};case"reimbursement":return{key:"ZR",color:t.Colors.graphColor06Dark};case"accounts":return{key:"ZA",color:t.Colors.graphColor09Dark};case"cards":return{key:"ZC",color:t.Colors.graphColor33Dark};case"payroll_manager_service_plan":return{key:"Payroll",color:t.Colors.graphColor26Dark};case"zeni_tax_plan":return{key:"Tax",color:t.Colors.graphColor35Dark};case"cfo_plan":return{key:"CFO",color:t.Colors.graphColor17Dark};default:return}};return o.jsxRuntimeExports.jsx(xm,{"data-testid":t.generateDataTestId("health-monitor-product-services",n),children:e.map((i,a)=>{const d=r(i.productServiceKey);if(d!=null){const l=n!=null&&n!==""?`${d.key}-${n}`:d.key;return o.jsxRuntimeExports.jsx(gm,{color:d.color,isEnabled:i.isEnabled,"data-testid":t.generateDataTestId("health-monitor-product-chip",l),children:d.key},`${o.nanoid()}_${a}`)}else return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{})})})},mm=s.div`
1320
+ `,{dateFormat:Us,timeFormat:dm,timeframe:nt,common:pm}=t.appLocale.getLocalizedStrings(),gn=e=>{if(e!=null){const n=J.dateNow();return Math.abs(n.diff(e,"days"))}};function bo(e){if(e==null)return;const n=J.dateNow();if(Math.abs(n.diff(e,"days"))<=0)return`0 ${nt.day}`;const[i,a]=e<n?[e,n]:[n,e],d=i.year(),l=i.month(),c=i.date(),p=a.year(),m=a.month(),h=a.date();let S=p-d,x=m-l,C=h-c;if(C<0){x--;const f=new Date(p,m,0);C+=f.getDate()}x<0&&(S--,x+=12);const b=[];return S>0&&b.push(`${S} ${S>1?nt.year:nt.year.slice(0,-1)}`),x>0&&b.push(`${x} ${x>1?nt.month:nt.month.slice(0,-1)}`),C>0&&b.push(`${C} ${C>1?nt.day:nt.day.slice(0,-1)}`),b.join(", ")}function ki(e){if(e==null)return pm.strings.hyphen;const n=Math.floor(Number(e)/12),r=Number(e)%12,i=n>1?nt.year:nt.year.slice(0,-1),a=r>1?nt.month:nt.month.slice(0,-1);return n===0?`${e} ${a}`:r===0?`${n} ${i}`:`${n} ${i}, ${r} ${a}`}const Ti=e=>({name:e?.companyInfo.name??"",productVerticals:e?.companyHealthMetric.verticalProductServices??void 0,runway:e?.companyHealthMetric.runway,churnProbabilityPercentage:e?.companyHealthMetric.churnProbabilityPercentage,netPromoterScore:e?.companyHealthMetric.netPromoterScore,customerSatisfactionScore:e?.companyHealthMetric.customerSatisfactionScore,lastReportSent:e?.managementInfo.lastReportSentDate!=null?bo(J.zeniDate(e?.managementInfo.lastReportSentDate.toISOString())):void 0,dashboardLastVisit:e?.companyHealthMetric.customerLastDashboardVisit!=null?J.zeniDate(e?.companyHealthMetric.customerLastDashboardVisit.toISOString()).format(Us.visual.MMMDCommaYYYYformat):void 0,companyEngagementMetricsUpdatedAt:e?.companyHealthMetric.companyEngagementMetricsUpdatedAt!=null?{date:J.zeniDate(e?.companyHealthMetric.companyEngagementMetricsUpdatedAt.toISOString()).format(Us.visual.MMMDCommaYYYYformat),time:J.zeniDate(e?.companyHealthMetric.companyEngagementMetricsUpdatedAt.toISOString()).format(dm.hhmmAFormat)}:void 0,noOfVerticalsEnabled:e?.noOfProductVerticalsEnabled,renewalDate:e?.companyHealthMetric.subscriptionRenewalDate!=null?bo(J.zeniDate(e?.companyHealthMetric.subscriptionRenewalDate.toISOString())):void 0,lastEngagements:e!=null?e.companyHealthMetric.lastEngagements:[],additionalChurnFactors:e!=null?e.companyHealthMetric.additionalChurnFactors:{increasingChurnProbability:[],decreasingChurnProbability:[]},updatedByUserName:e?.companyHealthMetric.updatedByUser!=null?t.getFullName(e.companyHealthMetric.updatedByUser):void 0}),Be=t.appLocale.getLocalizedStrings().cockpit.health.header,Dt=[{key:"companyName",value:Be.name,sortOrder:"ascending",width:new t.ResponsiveSized(392,392),isThreadAllowed:!0},{key:"churnProbability",value:Be.churnProbability,sortOrder:"ascending",width:new t.ResponsiveSized(380,380),isThreadAllowed:!0},{key:"controller",value:Be.controller,sortOrder:"ascending",width:new t.ResponsiveSized(200,200),isThreadAllowed:!0},{key:"customerSuccessManager",value:Be.customerSuccessManager,sortOrder:"ascending",width:new t.ResponsiveSized(200,200),isThreadAllowed:!0},{key:"lastEngagement",value:Be.lastEngagement,sortOrder:"ascending",width:new t.ResponsiveSized(270,270),isThreadAllowed:!0},{key:"companyEngagementMetricsUpdatedAt",value:Be.companyEngagementMetricsUpdatedAt,sortOrder:"ascending",width:new t.ResponsiveSized(160,160),isThreadAllowed:!0},{key:"runway",value:Be.runway,sortOrder:"ascending",width:new t.ResponsiveSized(220,220),isThreadAllowed:!0},{key:"netPromoterScore",value:Be.netPromoterScore,sortOrder:"ascending",width:new t.ResponsiveSized(120,120),isThreadAllowed:!0},{key:"customerSatisfactionScore",value:Be.customerSatisfactionScore,sortOrder:"ascending",width:new t.ResponsiveSized(120,120),isThreadAllowed:!0},{key:"lastReportSent",value:Be.lastReportSent,sortOrder:"ascending",width:new t.ResponsiveSized(250,250),isThreadAllowed:!0},{key:"dashboardLastSeen",value:Be.dashboardLastSeen,sortOrder:"ascending",width:new t.ResponsiveSized(270,270),isThreadAllowed:!0},{key:"subscriptionDate",value:Be.subscriptionDate,sortOrder:"ascending",width:new t.ResponsiveSized(200,200),isThreadAllowed:!0},{key:"renewalDate",value:Be.renewalDate,sortOrder:"ascending",width:new t.ResponsiveSized(180,180),isThreadAllowed:!0},{key:"group",value:Be.group,sortOrder:"ascending",width:new t.ResponsiveSized(148,148),isThreadAllowed:!0},{key:"monthlyRecurringRevenue",value:Be.monthlyRecurringRevenue,sortOrder:"ascending",width:new t.ResponsiveSized(196,196),isThreadAllowed:!0},{key:"externalProductServiceExposure",value:Be.externalProductServiceExposure,sortOrder:"ascending",width:new t.ResponsiveSized(270,270),isThreadAllowed:!0},{key:"productVerticals",value:Be.productVerticals,sortOrder:"ascending",width:new t.ResponsiveSized(360,360),isThreadAllowed:!0}];Dt.map(e=>e.key);const Li=e=>le.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M10.1094 4H2.3764C2.16286 4 1.98975 4.22386 1.98975 4.5V11.5C1.98975 11.7761 2.16286 12 2.3764 12H10.1094C10.323 12 10.4961 11.7761 10.4961 11.5V4.5C10.4961 4.22386 10.323 4 10.1094 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M11.0046 7L14.0046 5V11L11.0046 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}));function um({companyView:e,healthView:n,companyNameSticky:r,totalHeight:i,addThreadRequestThreadId:a,setNoteData:d,setElementRef:l,setAddThreadRequestThreadId:c,onRowClick:p}){const m=t.useWindowSizeContext(),h=t.appLocale.getLocalizedStrings(),{common:{strings:{hyphen:S,backspace:x,space:C,colon:b,dot:f}},cockpit:{health:{detailPage:{churnProbabilityTexts:{churnProbability:g,for:j,is:y,percent:$},notApplicable:w},common:{engagementTypes:O,labels:{lastEngagements:A,factorsThatDecreaseChurnProbability:v,factorsThatIncreaseChurnProbability:T}}}},dateFormat:F}=h,{companyInfo:{companyId:I,name:K},companyHealthMetric:M,controllers:Y,managementInfo:{lastReportSentDate:G,customerSuccessManagerUserIds:E}}=e,P=Ti(e),k=n.zeniUsers.values.filter(R=>E.includes(R.userId)),D=`cockpit_${I}`,z="healthMonitor.notes",{threads:Z,isLoading:ie}=t.useFilteredThreads({entityType:z,companyId:I},!1),N={name:K,companyId:I,companyGroup:e.companyGroup!=null?e.companyGroup.find(R=>R.id===e.managementInfo.companyGroupId):void 0,monthlyRecurringRevenue:e.monthlyRecurringRevenue,productVerticals:M.verticalProductServices,runway:M.runway,churnProbabilityPercentage:M.churnProbabilityPercentage,netPromoterScore:M.netPromoterScore,customerSatisfactionScore:M.customerSatisfactionScore,controllers:Y.map(R=>J.getUserName(R)),customerSuccessManagers:k.map(R=>J.getUserName(R)),lastReportSent:G!=null?J.zeniDate(G.toISOString()):void 0,subscriptionStartDate:M.subscriptionStartDate!=null?J.zeniDate(M.subscriptionStartDate.toISOString()).format(F.visual.MMMDCommaYYYYformat):void 0,renewalDate:M.subscriptionRenewalDate!=null?J.zeniDate(M.subscriptionRenewalDate.toISOString()):void 0,companyEngagementMetricsUpdatedAt:M.companyEngagementMetricsUpdatedAt,externalProductServiceExposure:M.externalProductServiceExposure},{openThread:H,threads:L,addThread:Q,removeThread:se,setOpenThread:X,setRequestToOpenThread:re}=u.useContext(t.ThreadsContext),te=H!==null?L.get(H):null,he=H?.includes(I)===!0,fe=H!=null&&L.get(H)==null&&he,be=a!=null&&L.get(a)?.metadata.companyId===I,_=u.useCallback(()=>{H?.includes(t.NEW_THREAD_SUFFIX)===!0&&se(H),a!=null&&c(void 0)},[a,H,se,c]),ee=u.useCallback(R=>{if(R===H)X(null);else if(L.has(R))X(R);else if(R.includes(t.NEW_THREAD_SUFFIX)){const[Ce,ae]=R.replace(t.NEW_THREAD_SUFFIX,"").split("."),ce=Ft(jt(Ce),J.toHealthSortKeyType(ae),I,K);Q(R,{type:"thread",id:R,roomId:D,createdAt:new Date,updatedAt:new Date,comments:[],metadata:ce,resolved:!1}),X(R)}},[I,K,H,L,Q,X,D]),ge=u.useCallback((R,Ce,ae=!1)=>{const ce=Dt.find($e=>$e.key===Ce);if(re(null),ce!=null&&(R.type==="contextmenu"||ae===!0)){if(ce.isThreadAllowed===!1)return;_(),R.preventDefault(),R.stopPropagation();const $e=t.toCollaborationEntityType({tab:"healthMonitor",key:ce.key}),V=[...t.getFilteredThreads(L,{entityType:$e,companyId:I},"both")],B=V.length>0&&V[0].length>0?V[0][0]:Le("healthMonitor",ce.key,I);L.has(B)?ee(B):a===B?c(void 0):(c(B),X(null))}},[L,I,a,ee,c,X,re,_]),ve=u.useCallback((R,Ce)=>{R.stopPropagation();const ae=Le("healthMonitor",Ce,I);c(void 0),ee(ae)},[I,c,ee]),Re=R=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:R.isElementThreadOpen??!1,isElementThreadPresent:R.isElementThreadPresent??!1,itemKey:R.itemKey,elementThreadId:R.elementThreadId??"",roomId:D,addThreadRequestThreadId:a,openThreadId:H,threadStyle:R.threadStyle,openThreadMetadata:te?.metadata??null,onElementClick:ge,onAddThreadClick:ve});return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{re(null),a!=null&&(c(void 0),a.includes(t.NEW_THREAD_SUFFIX)&&se(a))},children:o.jsxRuntimeExports.jsx(mm,{windowSize:m,isThreadOpen:he||be,totalHeight:i,isCreationInProgress:fe,"data-testid":t.generateDataTestId("health-monitor-row",I),onClick:()=>p(N.companyId),children:Dt.map((R,Ce)=>{const ae=t.toCollaborationEntityType({tab:"healthMonitor",key:R.key}),ce=Dt.length-2<=Ce,$e=[...t.getFilteredThreads(L,{entityType:ae,companyId:I},"both")],V=$e.length>0&&$e[0].length>0?$e[0][0]:Le("healthMonitor",R.key,I),B=L.get(V),pe=B!=null&&B.resolved===!1,ye=V===H,ke=a===V,ue=P.lastEngagements;switch(R.key){case"companyName":return o.jsxRuntimeExports.jsxs(Sm,{companyNameSticky:r,columnWidth:R.width,windowSize:m,isThreadOpen:ye||ke,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-company-name",I),onContextMenu:U=>ge(U,R.key),ref:U=>{l(I,R.key,U)},children:[o.jsxRuntimeExports.jsxs(Cm,{"data-testid":t.generateDataTestId("health-monitor-row-company-name-text",I),children:[N.name,o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:ye,roomId:D,openThreadId:H,openThreadMetadata:te?.metadata??null})]}),o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:`2px ${t.Space.sp2}`},title:"Notes",children:o.jsxRuntimeExports.jsxs(bm,{className:"notesIcon","data-testid":t.generateDataTestId("health-monitor-row-notes-icon",I),onClick:U=>{U.preventDefault(),U.stopPropagation(),d({roomId:D,companyId:I,companyName:K,entityType:z})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:Z.length,isLoading:ie}),o.jsxRuntimeExports.jsx(Rm,{})]})}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:pe,itemKey:R.key,style:{left:t.Space.sp4},onElementClick:ge}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("healthMonitor",R.key,I),addThreadRequestThreadId:a,itemKey:R.key,onAddThreadClick:ve})]},V);case"productVerticals":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-product-verticals",I),onContextMenu:U=>ge(U,R.key),children:[o.jsxRuntimeExports.jsx(Pi,{productVerticals:M.verticalProductServices,testIdSuffix:I}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"runway":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-runway",I),onContextMenu:U=>ge(U,R.key),children:[N.runway!=null?J.isCompanyRunwayInfinite(N.runway)===!0?o.jsxRuntimeExports.jsx($m,{"data-testid":t.generateDataTestId("health-monitor-row-runway-infinity",I)}):ki(N.runway.runwayMonths):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:S}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"churnProbability":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-churn-probability",I),onContextMenu:U=>ge(U,R.key),children:[o.jsxRuntimeExports.jsx(jm,{"data-testid":t.generateDataTestId("health-monitor-row-churn-meter",I),children:o.jsxRuntimeExports.jsx(vi,{percentage:N.churnProbabilityPercentage,barHeight:12})}),P.churnProbabilityPercentage!=null?o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:`12px ${t.Space.sp3}`,textAlign:"left"},title:o.jsxRuntimeExports.jsxs(vm,{children:[o.jsxRuntimeExports.jsx(km,{children:`${g} ${j} ${e.companyInfo.name} ${y} ${Math.round(P.churnProbabilityPercentage??0)}${$}${f}`}),e.companyHealthMetric.churnProbabilityReason.length!==0||e.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(Ks,{children:[o.jsxRuntimeExports.jsxs(Gs,{children:[T,b]}),o.jsxRuntimeExports.jsxs(Ys,{children:[e.companyHealthMetric.churnProbabilityReason.map((U,Oe)=>o.jsxRuntimeExports.jsx(yn,{children:o.jsxRuntimeExports.jsx(fn,{children:U.text})},`${o.nanoid()}_${Oe}}`)),e.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.map((U,Oe)=>o.jsxRuntimeExports.jsx(yn,{children:o.jsxRuntimeExports.jsx(fn,{children:U.value})},`${o.nanoid()}_${Oe}}`))]})]}):null,e.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(Ks,{children:[o.jsxRuntimeExports.jsxs(Gs,{children:[v,b]}),o.jsxRuntimeExports.jsx(Ys,{children:e.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.map((U,Oe)=>o.jsxRuntimeExports.jsx(yn,{children:o.jsxRuntimeExports.jsx(fn,{children:U.value})},`${o.nanoid()}_${Oe}}`))})]}):null]}),children:o.jsxRuntimeExports.jsx(wm,{"data-testid":t.generateDataTestId("health-monitor-row-churn-info-icon",I),style:{marginTop:t.Space.sp1,marginLeft:t.Space.sp1,marginRight:t.Space.sp0}})}):null,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"customerSatisfactionScore":case"netPromoterScore":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId(`health-monitor-row-${R.key==="netPromoterScore"?"nps":"csat"}`,I),onContextMenu:U=>ge(U,R.key),children:[N[R.key]!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(fm,{children:N[R.key]}),o.jsxRuntimeExports.jsx(ym,{children:x}),R.key==="netPromoterScore"?o.jsxRuntimeExports.jsxs(Hs,{children:[" ",Fa," "]}):o.jsxRuntimeExports.jsxs(Hs,{children:[" ",Wa," "]})]}):N.churnProbabilityPercentage!=null?w:S,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"controller":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-controller",I),onContextMenu:U=>ge(U,R.key),children:[o.jsxRuntimeExports.jsx(t.Tooltip,{enterDelay:600,style:{padding:`2px ${t.Space.sp2}`},title:N.controllers.join(", "),children:N.controllers[0]}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"customerSuccessManager":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-csm",I),onContextMenu:U=>ge(U,R.key),children:[o.jsxRuntimeExports.jsx(t.Tooltip,{enterDelay:600,style:{padding:`2px ${t.Space.sp2}`,textAlign:"left"},maxWidth:"300px",title:N.customerSuccessManagers.join(", "),children:N.customerSuccessManagers[0]}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"lastReportSent":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-last-report-sent",I),onContextMenu:U=>ge(U,R.key),children:[o.jsxRuntimeExports.jsx(Sn,{children:N.lastReportSent!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(t.LargeRegular,{children:bo(N.lastReportSent)}),o.jsxRuntimeExports.jsx(t.SmallRegular,{children:N.lastReportSent.format(F.visual.MMMDCommaYYYYformat)})]}):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:S})}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"renewalDate":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-renewal-date",I),onContextMenu:U=>ge(U,R.key),children:[o.jsxRuntimeExports.jsx(Sn,{children:N.renewalDate!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(t.LargeRegular,{children:bo(N.renewalDate)}),o.jsxRuntimeExports.jsx(t.SmallRegular,{children:N.renewalDate.format(F.visual.MMMDCommaYYYYformat)})]}):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:S})}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"group":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-group",I),onContextMenu:U=>ge(U,R.key),children:[N.companyGroup!=null?o.jsxRuntimeExports.jsx(Em,{"data-testid":t.generateDataTestId("health-monitor-row-group-badge",I),textColor:hi[N.companyGroup.id],children:N.companyGroup.name.toUpperCase()}):S,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"monthlyRecurringRevenue":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-mrr",I),onContextMenu:U=>ge(U,R.key),children:[t.amountToString("0,0",N.monthlyRecurringRevenue),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"externalProductServiceExposure":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-external-exposure",I),onContextMenu:U=>ge(U,R.key),children:[N.externalProductServiceExposure!=null?N.externalProductServiceExposure.name:S,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"lastEngagement":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-last-engagement",I),onContextMenu:U=>ge(U,R.key),children:[ue.length>0?o.jsxRuntimeExports.jsxs(t.Tooltip,{style:{padding:`12px ${t.Space.sp3}`},title:o.jsxRuntimeExports.jsxs(Tm,{children:[o.jsxRuntimeExports.jsxs(Lm,{children:[A,b]}),ue.map((U,Oe)=>o.jsxRuntimeExports.jsxs(Pm,{children:[o.jsxRuntimeExports.jsxs(Im,{children:[U.type==="email"?o.jsxRuntimeExports.jsx(Om,{}):o.jsxRuntimeExports.jsx(Nm,{}),o.jsxRuntimeExports.jsx(hm,{children:U.type==="email"?O.email:O.meeting})]}),o.jsxRuntimeExports.jsx(Dm,{children:U.scheduledAt?.utc(!0).local().format(F.visual.MMMDCommaYYYYformat)??S})]},`${o.nanoid()}_${Oe}}`))]}),children:[ue[0].scheduledAt?.utc(!0).local().format(F.visual.MMMDCommaYYYYformat)??S,o.jsxRuntimeExports.jsxs(Am,{children:[ue[0].type==="email"?o.jsxRuntimeExports.jsx(Ii,{className:"engagement-email-icon"}):o.jsxRuntimeExports.jsx(Di,{className:"engagement-meeting-icon"}),o.jsxRuntimeExports.jsxs(Mm,{children:["Via",C,ue[0].type==="email"?O.email:O.meeting]})]})]}):o.jsxRuntimeExports.jsx(t.StandardRegular,{children:S}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"dashboardLastSeen":case"subscriptionDate":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId(`health-monitor-row-${R.key==="dashboardLastSeen"?"dashboard-last-seen":"subscription-date"}`,I),onContextMenu:U=>ge(U,R.key),children:[N.subscriptionStartDate??S,Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"companyEngagementMetricsUpdatedAt":return o.jsxRuntimeExports.jsxs(Ye,{ref:U=>{l(I,R.key,U)},columnWidth:R.width,windowSize:m,isThreadAllowed:R.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-engagement-updated",I),onContextMenu:U=>ge(U,R.key),children:[o.jsxRuntimeExports.jsx(Sn,{children:N.companyEngagementMetricsUpdatedAt!=null?o.jsxRuntimeExports.jsx(t.LargeRegular,{children:bo(N.companyEngagementMetricsUpdatedAt)}):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:S})}),Re({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);default:return null}})})})}const Pi=({productVerticals:e,testIdSuffix:n})=>{const r=i=>{switch(i){case"billpay":return{key:"ZBP",color:t.Colors.graphColor34Dark};case"reimbursement":return{key:"ZR",color:t.Colors.graphColor06Dark};case"accounts":return{key:"ZA",color:t.Colors.graphColor09Dark};case"cards":return{key:"ZC",color:t.Colors.graphColor33Dark};case"payroll_manager_service_plan":return{key:"Payroll",color:t.Colors.graphColor26Dark};case"zeni_tax_plan":return{key:"Tax",color:t.Colors.graphColor35Dark};case"cfo_plan":return{key:"CFO",color:t.Colors.graphColor17Dark};default:return}};return o.jsxRuntimeExports.jsx(xm,{"data-testid":t.generateDataTestId("health-monitor-product-services",n),children:e.map((i,a)=>{const d=r(i.productServiceKey);if(d!=null){const l=n!=null&&n!==""?`${d.key}-${n}`:d.key;return o.jsxRuntimeExports.jsx(gm,{color:d.color,isEnabled:i.isEnabled,"data-testid":t.generateDataTestId("health-monitor-product-chip",l),children:d.key},`${o.nanoid()}_${a}`)}else return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{})})})},mm=s.div`
1321
1321
  cursor: pointer;
1322
1322
  border: 1px solid ${e=>e.theme.colors.grey3};
1323
1323
  border-radius: ${t.Space.sp2};
@@ -1401,7 +1401,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1401
1401
  padding-top: ${t.Space.sp1};
1402
1402
  `,Cm=s.div``,jm=s.div`
1403
1403
  width: 85%;
1404
- `,yn=s.div`
1404
+ `,Sn=s.div`
1405
1405
  justify-content: center;
1406
1406
  align-items: center;
1407
1407
  `,bm=s.div`
@@ -1476,27 +1476,27 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1476
1476
  text-align: right;
1477
1477
  justify-content: flex-end;
1478
1478
  width: 100%;
1479
- `,fn=s.li``,Cn=s(t.StandardRegular)`
1479
+ `,yn=s.li``,fn=s(t.StandardRegular)`
1480
1480
  word-break: break-all;
1481
1481
  `,Am=s.div`
1482
1482
  display: flex;
1483
1483
  flex-direction: row;
1484
1484
  align-items: center;
1485
- `,Di=s(t.SvgEmail)`
1485
+ `,Ii=s(t.SvgEmail)`
1486
1486
  width: ${t.Space.sp3};
1487
1487
  height: ${t.Space.sp3};
1488
1488
  margin-right: ${t.Space.sp1};
1489
1489
  color: ${e=>e.theme.colors.hero};
1490
- `,Ai=s(Pi)`
1490
+ `,Di=s(Li)`
1491
1491
  width: ${t.Space.sp3};
1492
1492
  height: ${t.Space.sp3};
1493
1493
  margin-right: ${t.Space.sp1};
1494
1494
  color: ${e=>e.theme.colors.hero};
1495
- `,Om=s(Di)`
1495
+ `,Om=s(Ii)`
1496
1496
  color: ${t.Colors.heroDark};
1497
- `,Nm=s(Ai)`
1497
+ `,Nm=s(Di)`
1498
1498
  color: ${t.Colors.heroDark};
1499
- `,Mm=s(t.SmallRegular)``,Ao=(e,n)=>`${e}.${n}`,Zs=e=>`${e}_form`,pt="healthMonitorDetails",Xs="healthMonitorPage",qs="netPromoterScore",Qs="customerSatisfactionScore",Js="externalProductServiceExposure",er="additionalChurnFactors",Oi=e=>[{label:Zm,options:e.increasingChurnProbability.map(n=>({label:n.value,value:n.code}))},{label:Ym,options:e.decreasingChurnProbability.map(n=>({label:n.value,value:n.code}))}],Ni=e=>e==null?[]:e.increasingChurnProbability.map(n=>n.code).concat(e.decreasingChurnProbability.map(n=>n.code)),{common:{to:zm,from:Fm,cc:Wm,host:Bm,attendees:_m,texts:{subject:tr,addMore:Vm,select:Um},strings:{colon:Ge,hyphen:or,comma:Hm,space:Km}},cockpit:{health:{detailPage:Ee,common:{engagementTypes:nr,labels:{lastEngagements:Gm,factorsThatDecreaseChurnProbability:Ym,factorsThatIncreaseChurnProbability:Zm,contributingFactors:Xm,increaseChurnProbability:qm,decreasingChurnProbability:Qm}}}},dateFormat:Jm}=t.appLocale.getLocalizedStrings();function ex({localData:e,companyHealthMetricViewSelector:n,additionalChurnFactorsOptions:r,analytics:i,urlSource:a,onCloseDrawer:d,onSaveChangesToLocalStore:l,onSaveClick:c}){const{selectedCompanyDetail:p,localFormDataAndStatusByCompanyId:m}=n,[h,S]=u.useState(!1),x=Li(p),[C,b]=u.useState(!1),[f,g]=u.useState(!1),j=o.useForm({mode:"all",defaultValues:tx(e,r),reValidateMode:"onBlur"}),y=u.useRef(null);function $(E){p!=null&&i.trackCockpitHealthMonitorChurnFormClicked(E,{companyId:p.companyInfo.companyId,companyName:p.companyInfo.name,zeniProductAndServicesCount:p.noOfProductVerticalsEnabled,daysToRenewal:Sn(p.companyHealthMetric.subscriptionRenewalDate)??null,netPromoterScore:m?.companyHealthMetricLocalData.netPromoterScore??null,customerSatisfactionScore:m?.companyHealthMetricLocalData.customerSatisfactionScore??null,externalServicesExposure:m?.companyHealthMetricLocalData.externalProductServiceExposure??null,runwayMonths:ee.isCompanyRunwayInfinite(p.companyHealthMetric.runway)===!0?1e6:p.companyHealthMetric.runway===void 0?null:p.companyHealthMetric.runway.runwayMonths??null,dashBoardLastSeen:Sn(p.companyHealthMetric.customerLastDashboardVisit)??null,lastReportSent:Sn(p.managementInfo.lastReportSentDate)??null,churnProbability:p.companyHealthMetric.churnProbabilityPercentage??null})}const w=j.handleSubmit(()=>{$("Save"),y?.current&&y.current.scrollTo({top:0,behavior:"instant"}),b(!0),S(!0),c()}),O=async(E,P)=>{if(E!=null){const W={...P},k=W[pt][er].selectedOptions,D={netPromoterScore:W[pt][qs]?.selectedOption,customerSatisfactionScore:W[pt][Qs]?.selectedOption,externalProductServiceExposure:W[pt][Js]?.selectedOption,additionalChurnFactors:{increasingChurnProbability:r.increasingChurnProbability.filter(z=>k.indexOf(z.code)!=-1),decreasingChurnProbability:r.decreasingChurnProbability.filter(z=>k.indexOf(z.code)!=-1)}};l(D)}},A=u.useRef(null),v=u.useRef(null),[T,F]=u.useState(null),I=u.useRef(null),K=Ni(e.additionalChurnFactors);u.useEffect(()=>(v.current=setTimeout(()=>{A.current&&(F(A.current),v.current&&clearTimeout(v.current))},10),()=>{v.current!=null&&clearTimeout(v.current)}),[K]),u.useEffect(()=>{const E=j.watch((P,{name:W})=>{W!=null&&P!=null&&o.defer(()=>O(W,P))});return()=>{E.unsubscribe()}}),u.useEffect(()=>{if(p!=null){const P=p.controllers.map(W=>`${W.firstName} ${W.lastName}`);a||i.trackCockpitHealthMonitorRowClicked(p.companyInfo.companyId,p.companyInfo.name,P,p.companyHealthMetric.netPromoterScore,p.companyHealthMetric.customerSatisfactionScore,p.companyHealthMetric.churnProbabilityPercentage)}},[]);function M(E){return E!=null?`${Ee.churnProbabilityTexts.churnProbability} ${Ee.churnProbabilityTexts.is} ${x.churnProbabilityPercentage}${Ee.churnProbabilityTexts.percent}`:`${Ee.churnProbabilityTexts.churnProbability} ${Ee.churnProbabilityTexts.percent}`}function Y(){$("Cancel"),d()}const G={valueContainer:E=>({...E,padding:`2px ${t.Space.sp3}`,overflow:"unset"}),multiValue:E=>({...E,margin:0})};return o.jsxRuntimeExports.jsxs(Tx,{ref:y,"data-testid":t.generateDataTestId("health-monitor-drawer"),children:[o.jsxRuntimeExports.jsxs($x,{"data-testid":t.generateDataTestId("health-monitor-drawer-header"),children:[o.jsxRuntimeExports.jsx(Ex,{"data-testid":t.generateDataTestId("health-monitor-drawer-title"),children:`${p?.companyInfo.name}${Ee.heading}`}),o.jsxRuntimeExports.jsx(dx,{"data-testid":t.generateDataTestId("health-monitor-drawer-close-button"),onClick:Y,children:o.jsxRuntimeExports.jsx(px,{})})]}),o.jsxRuntimeExports.jsxs(kx,{children:[n.localFormDataAndStatusByCompanyId?.saveStatus?.fetchState==="Error"?o.jsxRuntimeExports.jsx(Fx,{"data-testid":t.generateDataTestId("health-monitor-drawer-error"),children:o.jsxRuntimeExports.jsxs(Wx,{children:[o.jsxRuntimeExports.jsx(_x,{}),n.localFormDataAndStatusByCompanyId.saveStatus.error?.message!=null?o.jsxRuntimeExports.jsx(Bx,{"data-testid":t.generateDataTestId("health-monitor-drawer-error-text"),children:n.localFormDataAndStatusByCompanyId.saveStatus.error?.message}):null]})}):null,o.jsxRuntimeExports.jsx(mx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-section"),children:m?.saveStatus?.fetchState==="In-Progress"?o.jsxRuntimeExports.jsxs(ux,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-loader"),children:[o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0}),o.jsxRuntimeExports.jsx(t.ExtraLargeRegular,{children:Ee.calculatingProbability})]}):o.jsxRuntimeExports.jsxs(wx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-box"),children:[o.jsxRuntimeExports.jsx(vx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-heading"),children:M(x.churnProbabilityPercentage)}),o.jsxRuntimeExports.jsx(nx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-meter"),children:o.jsxRuntimeExports.jsx(ki,{barHeight:32,percentage:x.churnProbabilityPercentage})}),o.jsxRuntimeExports.jsx(xx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-reasons"),children:p?.companyHealthMetric.churnProbabilityPercentage!=null&&p?.companyHealthMetric.churnProbabilityReason.length!==0?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(hx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-contributing-heading"),children:Xm}),p.companyHealthMetric.churnProbabilityReason.length!==0||p.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(rr,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-increasing-factors"),children:[o.jsxRuntimeExports.jsx(sr,{children:`${qm}${Ge}`}),o.jsxRuntimeExports.jsxs(ar,{children:[p.companyHealthMetric.churnProbabilityReason.map((E,P)=>o.jsxRuntimeExports.jsx(jn,{children:o.jsxRuntimeExports.jsx(bn,{children:E.text})},`${o.nanoid()}_${P}}`)),p.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.map((E,P)=>o.jsxRuntimeExports.jsxs(jn,{children:[o.jsxRuntimeExports.jsx(bn,{children:E.value}),o.jsxRuntimeExports.jsx(ir,{children:"Newly added"})]},`${o.nanoid()}_${P}}`))]})]}):null,p?.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(rr,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-decreasing-factors"),children:[o.jsxRuntimeExports.jsx(sr,{children:`${Qm}${Ge}`}),o.jsxRuntimeExports.jsx(ar,{children:p.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.map((E,P)=>o.jsxRuntimeExports.jsxs(jn,{children:[o.jsxRuntimeExports.jsx(bn,{children:E.value}),o.jsxRuntimeExports.jsx(ir,{children:"Newly added"})]},`${o.nanoid()}_${P}}`))})]}):null,o.jsxRuntimeExports.jsxs(yx,{"data-testid":t.generateDataTestId("health-monitor-drawer-add-more-button"),onClick:()=>{t.scrollContainerToTargetAdjusted(I?.current,y?.current),setTimeout(()=>{g(!0)},500)},ref:I,children:[o.jsxRuntimeExports.jsx(Sx,{}),o.jsxRuntimeExports.jsx(gx,{children:Vm})]})]}):null})]})}),o.jsxRuntimeExports.jsxs(Px,{"data-testid":t.generateDataTestId("health-monitor-drawer-form-container"),children:[o.jsxRuntimeExports.jsxs(fx,{children:[o.jsxRuntimeExports.jsxs(jx,{children:[o.jsxRuntimeExports.jsx(bx,{"data-testid":t.generateDataTestId("health-monitor-drawer-manual-input-heading"),children:Ee.manualInput.header}),o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"250px",variant:"small-description",data:Ee.tooltipTexts.manualInputText,placement:"top",children:o.jsxRuntimeExports.jsx(Oo,{"data-testid":t.generateDataTestId("health-monitor-drawer-manual-input-info"),style:{marginTop:t.Space.sp1,marginRight:t.Space.sp0}})})]}),x.companyEngagementMetricsUpdatedAt!=null&&n.localFormDataAndStatusByCompanyId?.saveStatus?.fetchState!=="In-Progress"?o.jsxRuntimeExports.jsx(Cx,{"data-testid":t.generateDataTestId("health-monitor-drawer-last-updated"),children:x.updatedByUserName!=null?o.jsxRuntimeExports.jsxs(lr,{children:[`${Ee.lastUpdatedBy}${Ge} ${x.updatedByUserName}`,o.jsxRuntimeExports.jsx(is,{}),`${x.companyEngagementMetricsUpdatedAt.date}${Hm}${Km}${x.companyEngagementMetricsUpdatedAt.time}`]}):o.jsxRuntimeExports.jsxs(lr,{children:[`${Ee.lastUpdatedAt}${Ge} ${x.companyEngagementMetricsUpdatedAt.date}`,o.jsxRuntimeExports.jsx(is,{}),`${x.companyEngagementMetricsUpdatedAt.time}`]})}):null]}),o.jsxRuntimeExports.jsx(o.FormProvider,{...j,children:o.jsxRuntimeExports.jsx("form",{id:Zs(Xs),onSubmit:w,children:o.jsxRuntimeExports.jsxs(Ix,{"data-testid":t.generateDataTestId("health-monitor-drawer-form-fields"),children:[o.jsxRuntimeExports.jsx(sx,{"data-testid":t.generateDataTestId("health-monitor-drawer-nps-field"),children:o.jsxRuntimeExports.jsx(t.LabeledSingleSelectNumericField,{label:{label:`${Ee.manualInput.labels.netPromoterScore}${Ge}`,width:0,style:{width:"auto"}},singleSelectNumericField:{customStyleConfig:{input:(E,P)=>({input:{textAlign:P.selectProps.menuIsOpen===!1&&e.netPromoterScore==null?"right":"left"}})},placeholder:Ee.manualInput.placeholders.add,name:Ao(pt,qs),defaultValue:{allOptions:ui,selectedOption:e.netPromoterScore},registerOptions:{required:!0,validate:(E,P)=>P.healthMonitorDetails.customerSatisfactionScore.selectedOption?!0:E!=null&&!!E.selectedOption}},style:{width:"auto"}})}),o.jsxRuntimeExports.jsx(Rn,{}),o.jsxRuntimeExports.jsx(rx,{"data-testid":t.generateDataTestId("health-monitor-drawer-csat-field"),children:o.jsxRuntimeExports.jsx(t.LabeledSingleSelectNumericField,{label:{label:`${Ee.manualInput.labels.customerSatisfactionScore}${Ge}`,width:0,labelIcon:o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"300px",variant:"small-description",data:Ee.tooltipTexts.customerSatisfactionScoreText,placement:"top",children:o.jsxRuntimeExports.jsx(Oo,{"data-testid":t.generateDataTestId("health-monitor-drawer-csat-info")})}),style:{marginRight:t.Space.sp2,width:"auto"}},singleSelectNumericField:{customStyleConfig:{input:(E,P)=>({input:{textAlign:P.selectProps.menuIsOpen===!1&&e.customerSatisfactionScore==null?"right":"left"}})},placeholder:Ee.manualInput.placeholders.add,name:Ao(pt,Qs),defaultValue:{allOptions:mi,selectedOption:e.customerSatisfactionScore},registerOptions:{required:!0,validate:(E,P)=>P.healthMonitorDetails.netPromoterScore.selectedOption?!0:E!=null&&!!E.selectedOption}},style:{width:"auto"}})}),o.jsxRuntimeExports.jsx(Rn,{}),o.jsxRuntimeExports.jsx(ix,{"data-testid":t.generateDataTestId("health-monitor-drawer-external-exposure-field"),children:o.jsxRuntimeExports.jsx(t.LabeledSingleSelectPickerField,{label:{label:Ee.manualInput.labels.externalProductServices,labelIcon:o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"265px",variant:"small-description",data:Ee.tooltipTexts.externalProductServicesText,placement:"top",children:o.jsxRuntimeExports.jsx(Oo,{"data-testid":t.generateDataTestId("health-monitor-drawer-external-exposure-info")})}),style:{marginRight:t.Space.sp2}},singleSelectPickerField:{placeholder:Ee.manualInput.placeholders.add,name:Ao(pt,Js),defaultValue:{allOptions:ee.companyHealthMetricDropDownOptions,selectedOption:e.externalProductServiceExposure},textAlignment:"right",registerOptions:{required:!0,validate:E=>E!=null&&!!E.selectedOption}},style:{width:"auto"}})}),o.jsxRuntimeExports.jsx(Rn,{}),o.jsxRuntimeExports.jsxs(Dx,{"data-testid":t.generateDataTestId("health-monitor-drawer-additional-factors"),additionalNotesHidden:K.length===0,isFocused:f,children:[o.jsxRuntimeExports.jsx(t.LabeledGroupedMultiSelectField,{fullWidthSelect:!0,label:{label:`${Ee.manualInput.labels.additionalContributingFactorsLabel}${Ge}`,labelIcon:o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"280px",variant:"small-description",data:Ee.tooltipTexts.additionalContributingFactorsText,placement:"top",children:o.jsxRuntimeExports.jsx(Oo,{"data-testid":t.generateDataTestId("health-monitor-drawer-additional-factors-info")})})},groupedMultiSelectField:{name:Ao(pt,er),treeViewStructure:!0,registerOptions:{required:!1},defaultValue:{allOptions:Oi(r),selectedOptions:K},placeholder:Um,customStyleConfig:G,showSelectedInNewLines:!0},isMenuOpen:f,setIsMenuOpen:g,menuPortalEnabled:!0}),K.length!==0&&o.jsxRuntimeExports.jsxs(Ox,{"data-testid":t.generateDataTestId("health-monitor-drawer-notes-composer"),children:[o.jsxRuntimeExports.jsx(Gx,{}),o.jsxRuntimeExports.jsx(Ax,{ref:A,children:T&&ds.createPortal(o.jsxRuntimeExports.jsx(Yu,{roomId:`cockpit_${p?.companyInfo.companyId}`,threadMetadata:{application:"cockpit",companyId:p?.companyInfo.companyId!=null?p.companyInfo.companyId:"",entityId:p?.companyInfo.companyId!=null?p.companyInfo.companyId:"",companyName:p?.companyInfo.name!=null?p.companyInfo.name:"",tab:"healthMonitor",isGlobalComment:!1,entityType:"healthMonitor.notes",url:window.location.href},composerPlaceholder:Ee.manualInput.placeholders.addANote,createThreadCallback:()=>{b(!1)},isSubmitComment:C}),T)})]})]})]})})})]}),o.jsxRuntimeExports.jsxs(Lx,{"data-testid":t.generateDataTestId("health-monitor-drawer-prefilled-section"),children:[o.jsxRuntimeExports.jsx(Rx,{"data-testid":t.generateDataTestId("health-monitor-drawer-prefilled-heading"),children:Ee.preFilledInput.header}),o.jsxRuntimeExports.jsxs(Nx,{"data-testid":t.generateDataTestId("health-monitor-drawer-runway"),children:[o.jsxRuntimeExports.jsx(so,{children:Ee.preFilledInput.labels.runway}),x.runway!=null?ee.isCompanyRunwayInfinite(x.runway)===!0?o.jsxRuntimeExports.jsx(zx,{}):o.jsxRuntimeExports.jsx(Vt,{children:Ti(x.runway.runwayMonths)}):o.jsxRuntimeExports.jsx(Vt,{children:Ee.notApplicable})]}),o.jsxRuntimeExports.jsxs(No,{"data-testid":t.generateDataTestId("health-monitor-drawer-dashboard-last-seen"),children:[o.jsxRuntimeExports.jsx(so,{children:Ee.preFilledInput.labels.dashboardLastSeen}),o.jsxRuntimeExports.jsx(Vt,{children:x.dashboardLastVisit??Ee.notApplicable})]}),o.jsxRuntimeExports.jsxs(No,{"data-testid":t.generateDataTestId("health-monitor-drawer-last-report-sent"),children:[o.jsxRuntimeExports.jsx(so,{children:Ee.preFilledInput.labels.lastReportSent}),o.jsxRuntimeExports.jsx(Vt,{children:x.lastReportSent??Ee.notApplicable})]}),o.jsxRuntimeExports.jsxs(No,{"data-testid":t.generateDataTestId("health-monitor-drawer-product-services"),children:[o.jsxRuntimeExports.jsx(so,{children:Ee.preFilledInput.labels.zeniProductServices}),o.jsxRuntimeExports.jsx(Vt,{children:o.jsxRuntimeExports.jsx(Ii,{productVerticals:p?.companyHealthMetric.verticalProductServices??[],testIdSuffix:p?.companyInfo.companyId})})]}),o.jsxRuntimeExports.jsxs(No,{"data-testid":t.generateDataTestId("health-monitor-drawer-days-to-renewal"),children:[o.jsxRuntimeExports.jsx(so,{children:Ee.preFilledInput.labels.daysToRenewal}),o.jsxRuntimeExports.jsx(Vt,{children:x.renewalDate??Ee.notApplicable})]}),o.jsxRuntimeExports.jsx(Mx,{"data-testid":t.generateDataTestId("health-monitor-drawer-last-engagements"),children:o.jsxRuntimeExports.jsx(t.LabeledReadOnlyTextField,{label:{label:`${Gm}${Ge}`},text:o.jsxRuntimeExports.jsx(Vx,{children:x.lastEngagements.length>0?x.lastEngagements.map((E,P)=>o.jsxRuntimeExports.jsx(Ux,{"data-testid":t.generateDataTestId("health-monitor-drawer-engagement",String(P)),children:o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:`12px ${t.Space.sp3}`,color:t.Colors.heroDark},title:o.jsxRuntimeExports.jsx(Kx,{children:E.type==="email"?o.jsxRuntimeExports.jsxs(cr,{children:[o.jsxRuntimeExports.jsxs($t,{children:[o.jsxRuntimeExports.jsxs(Et,{children:[tr,Ge]}),o.jsxRuntimeExports.jsx(wt,{children:E.subject})]}),o.jsxRuntimeExports.jsxs($t,{children:[o.jsxRuntimeExports.jsxs(Et,{children:[Fm,Ge]}),o.jsxRuntimeExports.jsx(wt,{children:E.from})]}),o.jsxRuntimeExports.jsxs($t,{children:[o.jsxRuntimeExports.jsxs(Et,{children:[zm,Ge]}),o.jsxRuntimeExports.jsx(wt,{children:E.to})]}),E.cc!=""?o.jsxRuntimeExports.jsxs($t,{children:[o.jsxRuntimeExports.jsxs(Et,{children:[Wm,Ge]}),o.jsxRuntimeExports.jsx(wt,{children:E.cc})]}):null]}):o.jsxRuntimeExports.jsxs(cr,{children:[o.jsxRuntimeExports.jsxs($t,{children:[o.jsxRuntimeExports.jsxs(Et,{children:[tr,Ge]}),o.jsxRuntimeExports.jsx(wt,{children:E.subject})]}),o.jsxRuntimeExports.jsxs($t,{children:[o.jsxRuntimeExports.jsxs(Et,{children:[Bm,Ge]}),o.jsxRuntimeExports.jsx(wt,{children:E.hostName})]}),o.jsxRuntimeExports.jsxs($t,{children:[o.jsxRuntimeExports.jsxs(Et,{children:[_m,Ge]}),o.jsxRuntimeExports.jsx(wt,{children:E.attendees})]})]})}),placement:"left",children:o.jsxRuntimeExports.jsxs(Hx,{children:[o.jsxRuntimeExports.jsxs(cx,{children:[E.type==="email"?o.jsxRuntimeExports.jsx(Zx,{"data-testid":t.generateDataTestId("health-monitor-drawer-engagement-email-icon",String(P))}):o.jsxRuntimeExports.jsx(Yx,{"data-testid":t.generateDataTestId("health-monitor-drawer-engagement-meeting-icon",String(P))}),o.jsxRuntimeExports.jsx(ox,{children:E.type==="email"?nr.email:nr.meeting})]}),o.jsxRuntimeExports.jsx(Xx,{className:"engagementDot"}),o.jsxRuntimeExports.jsx(lx,{children:E.scheduledAt?.utc(!0).local().format(Jm.visual.MMMDCommaYYYYformat)??or})]},`${o.nanoid()}_${P}}`)})},P)):or}),style:{width:"100%"}})})]})]}),ee.hasCompanyHealthMetricFormFieldChanged(p?.companyHealthMetric,m?.companyHealthMetricLocalData)===!0||h===!1?o.jsxRuntimeExports.jsx(ax,{"data-testid":t.generateDataTestId("health-monitor-drawer-footer"),children:o.jsxRuntimeExports.jsx(t.Footer,{style:{zIndex:2,paddingTop:t.Space.sp3,paddingBottom:t.Space.sp3},formId:Zs(Xs),primaryBtn:{label:Ee.buttons.save,style:{minWidth:112},isLoading:m?.saveStatus?.fetchState==="In-Progress"},cancelBtn:{label:Ee.buttons.cancel,style:{minWidth:112},onClick:Y}})}):null]})}const tx=(e,n)=>({[pt]:{netPromoterScore:{selectedOption:e.netPromoterScore,allOptions:ui},customerSatisfactionScore:{selectedOption:e.customerSatisfactionScore,allOptions:mi},externalProductServiceExposure:{selectedOption:e.externalProductServiceExposure,allOptions:ee.companyHealthMetricDropDownOptions},additionalChurnFactors:{selectedOptions:Ni(e.additionalChurnFactors),allOptions:Oi(n)}}}),ox=s.div``,nx=s.div``,sx=s.div``,rx=s.div``,ix=s.div``,ax=s.div``,lx=s.div`
1499
+ `,Mm=s(t.SmallRegular)``,Ao=(e,n)=>`${e}.${n}`,Zs=e=>`${e}_form`,pt="healthMonitorDetails",Xs="healthMonitorPage",qs="netPromoterScore",Qs="customerSatisfactionScore",Js="externalProductServiceExposure",er="additionalChurnFactors",Ai=e=>[{label:Zm,options:e.increasingChurnProbability.map(n=>({label:n.value,value:n.code}))},{label:Ym,options:e.decreasingChurnProbability.map(n=>({label:n.value,value:n.code}))}],Oi=e=>e==null?[]:e.increasingChurnProbability.map(n=>n.code).concat(e.decreasingChurnProbability.map(n=>n.code)),{common:{to:zm,from:Fm,cc:Wm,host:Bm,attendees:_m,texts:{subject:tr,addMore:Vm,select:Um},strings:{colon:Ge,hyphen:or,comma:Hm,space:Km}},cockpit:{health:{detailPage:Ee,common:{engagementTypes:nr,labels:{lastEngagements:Gm,factorsThatDecreaseChurnProbability:Ym,factorsThatIncreaseChurnProbability:Zm,contributingFactors:Xm,increaseChurnProbability:qm,decreasingChurnProbability:Qm}}}},dateFormat:Jm}=t.appLocale.getLocalizedStrings();function ex({localData:e,companyHealthMetricViewSelector:n,additionalChurnFactorsOptions:r,analytics:i,urlSource:a,onCloseDrawer:d,onSaveChangesToLocalStore:l,onSaveClick:c}){const{selectedCompanyDetail:p,localFormDataAndStatusByCompanyId:m}=n,[h,S]=u.useState(!1),x=Ti(p),[C,b]=u.useState(!1),[f,g]=u.useState(!1),j=o.useForm({mode:"all",defaultValues:tx(e,r),reValidateMode:"onBlur"}),y=u.useRef(null);function $(E){p!=null&&i.trackCockpitHealthMonitorChurnFormClicked(E,{companyId:p.companyInfo.companyId,companyName:p.companyInfo.name,zeniProductAndServicesCount:p.noOfProductVerticalsEnabled,daysToRenewal:gn(p.companyHealthMetric.subscriptionRenewalDate)??null,netPromoterScore:m?.companyHealthMetricLocalData.netPromoterScore??null,customerSatisfactionScore:m?.companyHealthMetricLocalData.customerSatisfactionScore??null,externalServicesExposure:m?.companyHealthMetricLocalData.externalProductServiceExposure??null,runwayMonths:J.isCompanyRunwayInfinite(p.companyHealthMetric.runway)===!0?1e6:p.companyHealthMetric.runway===void 0?null:p.companyHealthMetric.runway.runwayMonths??null,dashBoardLastSeen:gn(p.companyHealthMetric.customerLastDashboardVisit)??null,lastReportSent:gn(p.managementInfo.lastReportSentDate)??null,churnProbability:p.companyHealthMetric.churnProbabilityPercentage??null})}const w=j.handleSubmit(()=>{$("Save"),y?.current&&y.current.scrollTo({top:0,behavior:"instant"}),b(!0),S(!0),c()}),O=async(E,P)=>{if(E!=null){const W={...P},k=W[pt][er].selectedOptions,D={netPromoterScore:W[pt][qs]?.selectedOption,customerSatisfactionScore:W[pt][Qs]?.selectedOption,externalProductServiceExposure:W[pt][Js]?.selectedOption,additionalChurnFactors:{increasingChurnProbability:r.increasingChurnProbability.filter(z=>k.indexOf(z.code)!=-1),decreasingChurnProbability:r.decreasingChurnProbability.filter(z=>k.indexOf(z.code)!=-1)}};l(D)}},A=u.useRef(null),v=u.useRef(null),[T,F]=u.useState(null),I=u.useRef(null),K=Oi(e.additionalChurnFactors);u.useEffect(()=>(v.current=setTimeout(()=>{A.current&&(F(A.current),v.current&&clearTimeout(v.current))},10),()=>{v.current!=null&&clearTimeout(v.current)}),[K]),u.useEffect(()=>{const E=j.watch((P,{name:W})=>{W!=null&&P!=null&&o.defer(()=>O(W,P))});return()=>{E.unsubscribe()}}),u.useEffect(()=>{if(p!=null){const P=p.controllers.map(W=>`${W.firstName} ${W.lastName}`);a||i.trackCockpitHealthMonitorRowClicked(p.companyInfo.companyId,p.companyInfo.name,P,p.companyHealthMetric.netPromoterScore,p.companyHealthMetric.customerSatisfactionScore,p.companyHealthMetric.churnProbabilityPercentage)}},[]);function M(E){return E!=null?`${Ee.churnProbabilityTexts.churnProbability} ${Ee.churnProbabilityTexts.is} ${x.churnProbabilityPercentage}${Ee.churnProbabilityTexts.percent}`:`${Ee.churnProbabilityTexts.churnProbability} ${Ee.churnProbabilityTexts.percent}`}function Y(){$("Cancel"),d()}const G={valueContainer:E=>({...E,padding:`2px ${t.Space.sp3}`,overflow:"unset"}),multiValue:E=>({...E,margin:0})};return o.jsxRuntimeExports.jsxs(Tx,{ref:y,"data-testid":t.generateDataTestId("health-monitor-drawer"),children:[o.jsxRuntimeExports.jsxs($x,{"data-testid":t.generateDataTestId("health-monitor-drawer-header"),children:[o.jsxRuntimeExports.jsx(Ex,{"data-testid":t.generateDataTestId("health-monitor-drawer-title"),children:`${p?.companyInfo.name}${Ee.heading}`}),o.jsxRuntimeExports.jsx(dx,{"data-testid":t.generateDataTestId("health-monitor-drawer-close-button"),onClick:Y,children:o.jsxRuntimeExports.jsx(px,{})})]}),o.jsxRuntimeExports.jsxs(kx,{children:[n.localFormDataAndStatusByCompanyId?.saveStatus?.fetchState==="Error"?o.jsxRuntimeExports.jsx(Fx,{"data-testid":t.generateDataTestId("health-monitor-drawer-error"),children:o.jsxRuntimeExports.jsxs(Wx,{children:[o.jsxRuntimeExports.jsx(_x,{}),n.localFormDataAndStatusByCompanyId.saveStatus.error?.message!=null?o.jsxRuntimeExports.jsx(Bx,{"data-testid":t.generateDataTestId("health-monitor-drawer-error-text"),children:n.localFormDataAndStatusByCompanyId.saveStatus.error?.message}):null]})}):null,o.jsxRuntimeExports.jsx(mx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-section"),children:m?.saveStatus?.fetchState==="In-Progress"?o.jsxRuntimeExports.jsxs(ux,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-loader"),children:[o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0}),o.jsxRuntimeExports.jsx(t.ExtraLargeRegular,{children:Ee.calculatingProbability})]}):o.jsxRuntimeExports.jsxs(wx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-box"),children:[o.jsxRuntimeExports.jsx(vx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-heading"),children:M(x.churnProbabilityPercentage)}),o.jsxRuntimeExports.jsx(nx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-meter"),children:o.jsxRuntimeExports.jsx(vi,{barHeight:32,percentage:x.churnProbabilityPercentage})}),o.jsxRuntimeExports.jsx(xx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-reasons"),children:p?.companyHealthMetric.churnProbabilityPercentage!=null&&p?.companyHealthMetric.churnProbabilityReason.length!==0?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(hx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-contributing-heading"),children:Xm}),p.companyHealthMetric.churnProbabilityReason.length!==0||p.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(rr,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-increasing-factors"),children:[o.jsxRuntimeExports.jsx(sr,{children:`${qm}${Ge}`}),o.jsxRuntimeExports.jsxs(ar,{children:[p.companyHealthMetric.churnProbabilityReason.map((E,P)=>o.jsxRuntimeExports.jsx(Cn,{children:o.jsxRuntimeExports.jsx(jn,{children:E.text})},`${o.nanoid()}_${P}}`)),p.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.map((E,P)=>o.jsxRuntimeExports.jsxs(Cn,{children:[o.jsxRuntimeExports.jsx(jn,{children:E.value}),o.jsxRuntimeExports.jsx(ir,{children:"Newly added"})]},`${o.nanoid()}_${P}}`))]})]}):null,p?.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(rr,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-decreasing-factors"),children:[o.jsxRuntimeExports.jsx(sr,{children:`${Qm}${Ge}`}),o.jsxRuntimeExports.jsx(ar,{children:p.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.map((E,P)=>o.jsxRuntimeExports.jsxs(Cn,{children:[o.jsxRuntimeExports.jsx(jn,{children:E.value}),o.jsxRuntimeExports.jsx(ir,{children:"Newly added"})]},`${o.nanoid()}_${P}}`))})]}):null,o.jsxRuntimeExports.jsxs(yx,{"data-testid":t.generateDataTestId("health-monitor-drawer-add-more-button"),onClick:()=>{t.scrollContainerToTargetAdjusted(I?.current,y?.current),setTimeout(()=>{g(!0)},500)},ref:I,children:[o.jsxRuntimeExports.jsx(Sx,{}),o.jsxRuntimeExports.jsx(gx,{children:Vm})]})]}):null})]})}),o.jsxRuntimeExports.jsxs(Px,{"data-testid":t.generateDataTestId("health-monitor-drawer-form-container"),children:[o.jsxRuntimeExports.jsxs(fx,{children:[o.jsxRuntimeExports.jsxs(jx,{children:[o.jsxRuntimeExports.jsx(bx,{"data-testid":t.generateDataTestId("health-monitor-drawer-manual-input-heading"),children:Ee.manualInput.header}),o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"250px",variant:"small-description",data:Ee.tooltipTexts.manualInputText,placement:"top",children:o.jsxRuntimeExports.jsx(Oo,{"data-testid":t.generateDataTestId("health-monitor-drawer-manual-input-info"),style:{marginTop:t.Space.sp1,marginRight:t.Space.sp0}})})]}),x.companyEngagementMetricsUpdatedAt!=null&&n.localFormDataAndStatusByCompanyId?.saveStatus?.fetchState!=="In-Progress"?o.jsxRuntimeExports.jsx(Cx,{"data-testid":t.generateDataTestId("health-monitor-drawer-last-updated"),children:x.updatedByUserName!=null?o.jsxRuntimeExports.jsxs(lr,{children:[`${Ee.lastUpdatedBy}${Ge} ${x.updatedByUserName}`,o.jsxRuntimeExports.jsx(rs,{}),`${x.companyEngagementMetricsUpdatedAt.date}${Hm}${Km}${x.companyEngagementMetricsUpdatedAt.time}`]}):o.jsxRuntimeExports.jsxs(lr,{children:[`${Ee.lastUpdatedAt}${Ge} ${x.companyEngagementMetricsUpdatedAt.date}`,o.jsxRuntimeExports.jsx(rs,{}),`${x.companyEngagementMetricsUpdatedAt.time}`]})}):null]}),o.jsxRuntimeExports.jsx(o.FormProvider,{...j,children:o.jsxRuntimeExports.jsx("form",{id:Zs(Xs),onSubmit:w,children:o.jsxRuntimeExports.jsxs(Ix,{"data-testid":t.generateDataTestId("health-monitor-drawer-form-fields"),children:[o.jsxRuntimeExports.jsx(sx,{"data-testid":t.generateDataTestId("health-monitor-drawer-nps-field"),children:o.jsxRuntimeExports.jsx(t.LabeledSingleSelectNumericField,{label:{label:`${Ee.manualInput.labels.netPromoterScore}${Ge}`,width:0,style:{width:"auto"}},singleSelectNumericField:{customStyleConfig:{input:(E,P)=>({input:{textAlign:P.selectProps.menuIsOpen===!1&&e.netPromoterScore==null?"right":"left"}})},placeholder:Ee.manualInput.placeholders.add,name:Ao(pt,qs),defaultValue:{allOptions:pi,selectedOption:e.netPromoterScore},registerOptions:{required:!0,validate:(E,P)=>P.healthMonitorDetails.customerSatisfactionScore.selectedOption?!0:E!=null&&!!E.selectedOption}},style:{width:"auto"}})}),o.jsxRuntimeExports.jsx(bn,{}),o.jsxRuntimeExports.jsx(rx,{"data-testid":t.generateDataTestId("health-monitor-drawer-csat-field"),children:o.jsxRuntimeExports.jsx(t.LabeledSingleSelectNumericField,{label:{label:`${Ee.manualInput.labels.customerSatisfactionScore}${Ge}`,width:0,labelIcon:o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"300px",variant:"small-description",data:Ee.tooltipTexts.customerSatisfactionScoreText,placement:"top",children:o.jsxRuntimeExports.jsx(Oo,{"data-testid":t.generateDataTestId("health-monitor-drawer-csat-info")})}),style:{marginRight:t.Space.sp2,width:"auto"}},singleSelectNumericField:{customStyleConfig:{input:(E,P)=>({input:{textAlign:P.selectProps.menuIsOpen===!1&&e.customerSatisfactionScore==null?"right":"left"}})},placeholder:Ee.manualInput.placeholders.add,name:Ao(pt,Qs),defaultValue:{allOptions:ui,selectedOption:e.customerSatisfactionScore},registerOptions:{required:!0,validate:(E,P)=>P.healthMonitorDetails.netPromoterScore.selectedOption?!0:E!=null&&!!E.selectedOption}},style:{width:"auto"}})}),o.jsxRuntimeExports.jsx(bn,{}),o.jsxRuntimeExports.jsx(ix,{"data-testid":t.generateDataTestId("health-monitor-drawer-external-exposure-field"),children:o.jsxRuntimeExports.jsx(t.LabeledSingleSelectPickerField,{label:{label:Ee.manualInput.labels.externalProductServices,labelIcon:o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"265px",variant:"small-description",data:Ee.tooltipTexts.externalProductServicesText,placement:"top",children:o.jsxRuntimeExports.jsx(Oo,{"data-testid":t.generateDataTestId("health-monitor-drawer-external-exposure-info")})}),style:{marginRight:t.Space.sp2}},singleSelectPickerField:{placeholder:Ee.manualInput.placeholders.add,name:Ao(pt,Js),defaultValue:{allOptions:J.companyHealthMetricDropDownOptions,selectedOption:e.externalProductServiceExposure},textAlignment:"right",registerOptions:{required:!0,validate:E=>E!=null&&!!E.selectedOption}},style:{width:"auto"}})}),o.jsxRuntimeExports.jsx(bn,{}),o.jsxRuntimeExports.jsxs(Dx,{"data-testid":t.generateDataTestId("health-monitor-drawer-additional-factors"),additionalNotesHidden:K.length===0,isFocused:f,children:[o.jsxRuntimeExports.jsx(t.LabeledGroupedMultiSelectField,{fullWidthSelect:!0,label:{label:`${Ee.manualInput.labels.additionalContributingFactorsLabel}${Ge}`,labelIcon:o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"280px",variant:"small-description",data:Ee.tooltipTexts.additionalContributingFactorsText,placement:"top",children:o.jsxRuntimeExports.jsx(Oo,{"data-testid":t.generateDataTestId("health-monitor-drawer-additional-factors-info")})})},groupedMultiSelectField:{name:Ao(pt,er),treeViewStructure:!0,registerOptions:{required:!1},defaultValue:{allOptions:Ai(r),selectedOptions:K},placeholder:Um,customStyleConfig:G,showSelectedInNewLines:!0},isMenuOpen:f,setIsMenuOpen:g,menuPortalEnabled:!0}),K.length!==0&&o.jsxRuntimeExports.jsxs(Ox,{"data-testid":t.generateDataTestId("health-monitor-drawer-notes-composer"),children:[o.jsxRuntimeExports.jsx(Gx,{}),o.jsxRuntimeExports.jsx(Ax,{ref:A,children:T&&cs.createPortal(o.jsxRuntimeExports.jsx(Yu,{roomId:`cockpit_${p?.companyInfo.companyId}`,threadMetadata:{application:"cockpit",companyId:p?.companyInfo.companyId!=null?p.companyInfo.companyId:"",entityId:p?.companyInfo.companyId!=null?p.companyInfo.companyId:"",companyName:p?.companyInfo.name!=null?p.companyInfo.name:"",tab:"healthMonitor",isGlobalComment:!1,entityType:"healthMonitor.notes",url:window.location.href},composerPlaceholder:Ee.manualInput.placeholders.addANote,createThreadCallback:()=>{b(!1)},isSubmitComment:C}),T)})]})]})]})})})]}),o.jsxRuntimeExports.jsxs(Lx,{"data-testid":t.generateDataTestId("health-monitor-drawer-prefilled-section"),children:[o.jsxRuntimeExports.jsx(Rx,{"data-testid":t.generateDataTestId("health-monitor-drawer-prefilled-heading"),children:Ee.preFilledInput.header}),o.jsxRuntimeExports.jsxs(Nx,{"data-testid":t.generateDataTestId("health-monitor-drawer-runway"),children:[o.jsxRuntimeExports.jsx(so,{children:Ee.preFilledInput.labels.runway}),x.runway!=null?J.isCompanyRunwayInfinite(x.runway)===!0?o.jsxRuntimeExports.jsx(zx,{}):o.jsxRuntimeExports.jsx(Vt,{children:ki(x.runway.runwayMonths)}):o.jsxRuntimeExports.jsx(Vt,{children:Ee.notApplicable})]}),o.jsxRuntimeExports.jsxs(No,{"data-testid":t.generateDataTestId("health-monitor-drawer-dashboard-last-seen"),children:[o.jsxRuntimeExports.jsx(so,{children:Ee.preFilledInput.labels.dashboardLastSeen}),o.jsxRuntimeExports.jsx(Vt,{children:x.dashboardLastVisit??Ee.notApplicable})]}),o.jsxRuntimeExports.jsxs(No,{"data-testid":t.generateDataTestId("health-monitor-drawer-last-report-sent"),children:[o.jsxRuntimeExports.jsx(so,{children:Ee.preFilledInput.labels.lastReportSent}),o.jsxRuntimeExports.jsx(Vt,{children:x.lastReportSent??Ee.notApplicable})]}),o.jsxRuntimeExports.jsxs(No,{"data-testid":t.generateDataTestId("health-monitor-drawer-product-services"),children:[o.jsxRuntimeExports.jsx(so,{children:Ee.preFilledInput.labels.zeniProductServices}),o.jsxRuntimeExports.jsx(Vt,{children:o.jsxRuntimeExports.jsx(Pi,{productVerticals:p?.companyHealthMetric.verticalProductServices??[],testIdSuffix:p?.companyInfo.companyId})})]}),o.jsxRuntimeExports.jsxs(No,{"data-testid":t.generateDataTestId("health-monitor-drawer-days-to-renewal"),children:[o.jsxRuntimeExports.jsx(so,{children:Ee.preFilledInput.labels.daysToRenewal}),o.jsxRuntimeExports.jsx(Vt,{children:x.renewalDate??Ee.notApplicable})]}),o.jsxRuntimeExports.jsx(Mx,{"data-testid":t.generateDataTestId("health-monitor-drawer-last-engagements"),children:o.jsxRuntimeExports.jsx(t.LabeledReadOnlyTextField,{label:{label:`${Gm}${Ge}`},text:o.jsxRuntimeExports.jsx(Vx,{children:x.lastEngagements.length>0?x.lastEngagements.map((E,P)=>o.jsxRuntimeExports.jsx(Ux,{"data-testid":t.generateDataTestId("health-monitor-drawer-engagement",String(P)),children:o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:`12px ${t.Space.sp3}`,color:t.Colors.heroDark},title:o.jsxRuntimeExports.jsx(Kx,{children:E.type==="email"?o.jsxRuntimeExports.jsxs(cr,{children:[o.jsxRuntimeExports.jsxs(Et,{children:[o.jsxRuntimeExports.jsxs(wt,{children:[tr,Ge]}),o.jsxRuntimeExports.jsx(vt,{children:E.subject})]}),o.jsxRuntimeExports.jsxs(Et,{children:[o.jsxRuntimeExports.jsxs(wt,{children:[Fm,Ge]}),o.jsxRuntimeExports.jsx(vt,{children:E.from})]}),o.jsxRuntimeExports.jsxs(Et,{children:[o.jsxRuntimeExports.jsxs(wt,{children:[zm,Ge]}),o.jsxRuntimeExports.jsx(vt,{children:E.to})]}),E.cc!=""?o.jsxRuntimeExports.jsxs(Et,{children:[o.jsxRuntimeExports.jsxs(wt,{children:[Wm,Ge]}),o.jsxRuntimeExports.jsx(vt,{children:E.cc})]}):null]}):o.jsxRuntimeExports.jsxs(cr,{children:[o.jsxRuntimeExports.jsxs(Et,{children:[o.jsxRuntimeExports.jsxs(wt,{children:[tr,Ge]}),o.jsxRuntimeExports.jsx(vt,{children:E.subject})]}),o.jsxRuntimeExports.jsxs(Et,{children:[o.jsxRuntimeExports.jsxs(wt,{children:[Bm,Ge]}),o.jsxRuntimeExports.jsx(vt,{children:E.hostName})]}),o.jsxRuntimeExports.jsxs(Et,{children:[o.jsxRuntimeExports.jsxs(wt,{children:[_m,Ge]}),o.jsxRuntimeExports.jsx(vt,{children:E.attendees})]})]})}),placement:"left",children:o.jsxRuntimeExports.jsxs(Hx,{children:[o.jsxRuntimeExports.jsxs(cx,{children:[E.type==="email"?o.jsxRuntimeExports.jsx(Zx,{"data-testid":t.generateDataTestId("health-monitor-drawer-engagement-email-icon",String(P))}):o.jsxRuntimeExports.jsx(Yx,{"data-testid":t.generateDataTestId("health-monitor-drawer-engagement-meeting-icon",String(P))}),o.jsxRuntimeExports.jsx(ox,{children:E.type==="email"?nr.email:nr.meeting})]}),o.jsxRuntimeExports.jsx(Xx,{className:"engagementDot"}),o.jsxRuntimeExports.jsx(lx,{children:E.scheduledAt?.utc(!0).local().format(Jm.visual.MMMDCommaYYYYformat)??or})]},`${o.nanoid()}_${P}}`)})},P)):or}),style:{width:"100%"}})})]})]}),J.hasCompanyHealthMetricFormFieldChanged(p?.companyHealthMetric,m?.companyHealthMetricLocalData)===!0||h===!1?o.jsxRuntimeExports.jsx(ax,{"data-testid":t.generateDataTestId("health-monitor-drawer-footer"),children:o.jsxRuntimeExports.jsx(t.Footer,{style:{zIndex:2,paddingTop:t.Space.sp3,paddingBottom:t.Space.sp3},formId:Zs(Xs),primaryBtn:{label:Ee.buttons.save,style:{minWidth:112},isLoading:m?.saveStatus?.fetchState==="In-Progress"},cancelBtn:{label:Ee.buttons.cancel,style:{minWidth:112},onClick:Y}})}):null]})}const tx=(e,n)=>({[pt]:{netPromoterScore:{selectedOption:e.netPromoterScore,allOptions:pi},customerSatisfactionScore:{selectedOption:e.customerSatisfactionScore,allOptions:ui},externalProductServiceExposure:{selectedOption:e.externalProductServiceExposure,allOptions:J.companyHealthMetricDropDownOptions},additionalChurnFactors:{selectedOptions:Oi(e.additionalChurnFactors),allOptions:Ai(n)}}}),ox=s.div``,nx=s.div``,sx=s.div``,rx=s.div``,ix=s.div``,ax=s.div``,lx=s.div`
1500
1500
  min-width: 100px;
1501
1501
  `,cx=s.div`
1502
1502
  min-width: 80px;
@@ -1593,13 +1593,13 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1593
1593
  padding-left: ${t.Space.sp4};
1594
1594
  margin-top: ${t.Space.sp0};
1595
1595
  margin-bottom: ${t.Space.sp0};
1596
- `,jn=s.li`
1596
+ `,Cn=s.li`
1597
1597
  ::marker {
1598
1598
  color: ${e=>e.theme.colors.primary};
1599
1599
  }
1600
1600
  margin-bottom: ${t.Space.sp2};
1601
1601
  word-break: break-word;
1602
- `,bn=s(t.LargeRegular)`
1602
+ `,jn=s(t.LargeRegular)`
1603
1603
  color: ${e=>e.theme.colors.primary};
1604
1604
  display: inline;
1605
1605
  margin-right: ${t.Space.sp2};
@@ -1715,13 +1715,13 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1715
1715
  margin-bottom: ${t.Space.sp2};
1716
1716
  border-radius: ${t.Space.sp2};
1717
1717
  background: ${e=>e.theme.colors.background};
1718
- `,Rn=s.div`
1718
+ `,bn=s.div`
1719
1719
  display: flex;
1720
1720
  flex: 1;
1721
1721
  background-color: ${e=>e.theme.colors.grey3};
1722
1722
  min-height: 1px;
1723
1723
  max-height: 1px;
1724
- `,gs=s.div`
1724
+ `,hs=s.div`
1725
1725
  box-sizing: border-box;
1726
1726
  min-height: ${t.Space.sp8};
1727
1727
  display: flex;
@@ -1733,7 +1733,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1733
1733
  background-color: ${e=>e.theme.colors.grey5};
1734
1734
  border-color: ${e=>e.theme.colors.grey3};
1735
1735
  color: ${e=>e.theme.colors.hero};
1736
- `,Nx=s(gs)`
1736
+ `,Nx=s(hs)`
1737
1737
  box-shadow: ${e=>`${t.Space.sp0} 2px ${t.Space.sp1} ${e.theme.colors.dropShadowNormal}`};
1738
1738
  display: flex;
1739
1739
  border-width: 1px;
@@ -1742,7 +1742,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1742
1742
  border-bottom-left-radius: ${t.Space.sp0};
1743
1743
  border-bottom-right-radius: ${t.Space.sp0};
1744
1744
  border-bottom: none;
1745
- `,Mx=s(gs)`
1745
+ `,Mx=s(hs)`
1746
1746
  box-shadow: ${e=>`${t.Space.sp0} 2px ${t.Space.sp1} ${e.theme.colors.dropShadowNormal}`};
1747
1747
  display: flex;
1748
1748
  border-width: 1px;
@@ -1751,7 +1751,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1751
1751
  border-bottom-left-radius: ${t.Space.sp2};
1752
1752
  border-bottom-right-radius: ${t.Space.sp2};
1753
1753
  padding: ${t.Space.sp0};
1754
- `,No=s(gs)`
1754
+ `,No=s(hs)`
1755
1755
  box-shadow: ${e=>`${t.Space.sp0} 2px ${t.Space.sp1} ${e.theme.colors.dropShadowNormal}`};
1756
1756
  display: flex;
1757
1757
  border-radius: ${t.Space.sp0};
@@ -1775,7 +1775,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1775
1775
  gap: ${t.Space.sp2};
1776
1776
  `,Bx=s(t.LargeRegular)`
1777
1777
  color: ${t.Colors.important};
1778
- `,is=s(t.CommonDot)`
1778
+ `,rs=s(t.CommonDot)`
1779
1779
  background: ${e=>e.theme.colors.grey1};
1780
1780
  margin: 0 6px;
1781
1781
  `,_x=s(t.SvgHighImportanceFilled)`
@@ -1816,16 +1816,16 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1816
1816
  justify-content: flex-end;
1817
1817
  align-items: start;
1818
1818
  gap: ${t.Space.sp1};
1819
- `,$t=s.div`
1819
+ `,Et=s.div`
1820
1820
  display: flex;
1821
1821
  flex-direction: row;
1822
1822
  gap: ${t.Space.sp3};
1823
1823
  max-width: 350px;
1824
1824
  width: 100%;
1825
- `,Et=s.div`
1825
+ `,wt=s.div`
1826
1826
  display: flex;
1827
1827
  text-transform: capitalize;
1828
- `,wt=s.div`
1828
+ `,vt=s.div`
1829
1829
  display: flex;
1830
1830
  color: ${e=>e.theme.colors.brandColorPearl};
1831
1831
  text-align: right;
@@ -1838,7 +1838,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1838
1838
  height: ${t.Space.sp4};
1839
1839
  color: ${e=>e.theme.colors.hero};
1840
1840
  align-self: flex-start;
1841
- `,Yx=s(Pi)`
1841
+ `,Yx=s(Li)`
1842
1842
  width: ${t.Space.sp3};
1843
1843
  height: ${t.Space.sp3};
1844
1844
  margin-right: ${t.Space.sp1};
@@ -1848,7 +1848,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1848
1848
  height: ${t.Space.sp3};
1849
1849
  margin-right: ${t.Space.sp1};
1850
1850
  color: ${e=>e.theme.colors.hero};
1851
- `,Xx=s(is)`
1851
+ `,Xx=s(rs)`
1852
1852
  background: ${e=>e.theme.colors.hero};
1853
1853
  `,Mo=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function qx({companyNameSticky:e,sortConfig:n,onColumnSortConfigChanged:r}){const i=t.useWindowSizeContext(),[a,d]=u.useState(o.cloneDeep(Dt));u.useEffect(()=>{const c=[...a];for(const p of c)p.key===n.sortKey?p.sortOrder=n.sortOrder:p.sortOrder="ascending";d(c)},[n.sortKey,n.sortOrder]);const l=(c,p)=>{let m=p;n.sortKey===c&&(m=p==="ascending"?"descending":"ascending"),r(c,m)};return o.jsxRuntimeExports.jsx(eh,{height:Nt,"data-testid":t.generateDataTestId("health-monitor-header-row"),children:a.map(c=>o.jsxRuntimeExports.jsxs(th,{companyNameSticky:e&&c.key==="companyName",sortDataValue:n.sortKey,actualDataValue:c.key,wrapperWidth:c.width,windowSize:i,"data-testid":t.generateDataTestId("health-monitor-header-cell",Mo(c.key)),children:[o.jsxRuntimeExports.jsxs(sh,{"data-testid":t.generateDataTestId("health-monitor-header-sort",Mo(c.key)),onClick:()=>l(c.key,c.sortOrder),children:[o.jsxRuntimeExports.jsx(t.SmallRegular,{children:c.value}),o.jsxRuntimeExports.jsx(Jx,{"data-testid":t.generateDataTestId("health-monitor-header-sort-icon",Mo(c.key)),sortDataValue:n.sortKey,headerdata:c,children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:12,height:12})})]}),o.jsxRuntimeExports.jsx(nh,{"data-testid":t.generateDataTestId("health-monitor-header-sort-cancel",Mo(c.key)),isVisible:n.sortKey===c.key&&c.key!=="churnProbability",children:o.jsxRuntimeExports.jsx(oh,{onClick:()=>l("churnProbability","descending")})})]},c.key))})}const Qx=u.memo(qx),Jx=s.div`
1854
1854
  display: flex;
@@ -1902,7 +1902,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1902
1902
  &:hover {
1903
1903
  color: ${e=>e.theme.colors.primary};
1904
1904
  }
1905
- `,rh=e=>le.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M7.07568 15.1944H1.45068C1.28492 15.1944 1.12595 15.1285 1.00874 15.0113C0.891532 14.8941 0.825684 14.7351 0.825684 14.5694V1.44437C0.825684 1.27861 0.891532 1.11964 1.00874 1.00243C1.12595 0.885219 1.28492 0.819371 1.45068 0.819371H9.75881C9.9242 0.818742 10.0831 0.883694 10.2007 0.999996L12.5176 3.31687C12.6348 3.43405 12.7006 3.593 12.7007 3.75875V5.81937",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M3.32568 9.19999L5.17193 7.35374C5.26025 7.2656 5.37635 7.21073 5.50051 7.19843C5.62468 7.18612 5.74928 7.21715 5.85318 7.28624L6.72381 7.86687C6.83014 7.93767 6.95812 7.96849 7.08503 7.95384C7.21193 7.93919 7.32953 7.88003 7.41693 7.78687L9.12818 5.96124",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M3.32568 4.56938V10.8194H5.82568",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M13.0242 9.84985H10.4955C9.11614 9.84985 8.65637 11.1335 8.65637 12.1487C8.68901 12.8186 8.93013 13.4616 9.34603 13.9878V12.8384C9.34603 12.3786 9.57591 12.1487 10.4955 12.1487H13.0242V13.528L15.323 10.9993L13.0242 8.47054V9.84985Z",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"})),{cockpit:{health:{healthMonitorFiltersHeaderInfoText:{showing:ih,outOf:ah,customers:lh}}},common:{headers:{comments:ch},analytics:dh,strings:{space:ph}},collaboration:{threads:{placeholder:{addANewComment:uh,replyAComment:mh},tooltip:{resolveComment:xh,unResolveComment:hh}}}}=t.appLocale.getLocalizedStrings();function gh({healthView:e,mixpanelUrl:n,onRowClick:r,onColumnSortConfigChanged:i,initialOpenThreadRequest:a}){const d=t.useWindowSizeContext(),l=u.useRef(null),[c,p]=u.useState(null),{uiState:m}=e,[h,S]=u.useState(null),{unfilteredCompanyCount:x}=e,{companies:C}=e,{setOpenThread:b,setRequestToOpenThread:f,requestToOpenThread:g,isLoading:j}=u.useContext(t.ThreadsContext),[y,$]=u.useState(void 0),w=u.useRef([]),O=!(d==="small"||d==="medium-compact"),A=I=>e.companies[I].companyInfo.name.length>zt?Ie+32:Ie,v=u.useMemo(()=>({makeCompanyNameSticky:O,uiState:m,onColumnSortConfigChanged:i}),[O,m,i]),T=u.useCallback((I,K,M)=>{const Y=e.companies.findIndex(E=>E.companyInfo.companyId===I),G=Dt.findIndex(E=>E.key===K);Y!==-1&&G!==-1&&(w.current[Y]==null?w.current[Y]=[M]:w.current[Y][G]=M)},[e.companies]);u.useEffect(()=>{l.current&&l.current.resetAfterIndex(0)},[e]),u.useEffect(()=>{a!=null&&e.fetchState==="Completed"&&j===!1&&f(a)},[a,e.fetchState,j,f]),u.useEffect(()=>{if(g!=null&&c!=null){const{companyId:I,entityType:K}=g,[M,Y]=K.split("."),G=e.companies.findIndex(k=>k.companyInfo.companyId===I),E=Dt.findIndex(k=>k.key===Y);G!==-1&&!(c.visibleStartIndex<=G&&c.visibleStopIndex>=G)&&l.current?.scrollToItem(G,"center"),setTimeout(()=>{const k=w.current[G]?.[0]?.getBoundingClientRect().bottom,D=w.current[G]?.[0]?.getBoundingClientRect().top;k!=null&&D!=null&&(window.innerHeight>=k&&window.innerHeight>=D||D<0)&&w.current[G][E]?.scrollIntoView({block:"center",behavior:"auto"})},0);const W=setInterval(()=>{const k=w.current[G]?.[E]?.getBoundingClientRect().left,D=w.current[G]?.[E]?.getBoundingClientRect().right,z=w.current[G]?.[E]?.offsetWidth;if(k!=null&&z!=null&&D!=null&&(k<window.innerWidth-z||D<window.innerWidth)){clearInterval(W);const Z=g.threadId,ie=g.onThreadShownCallback;Z&&(f(null),b(g.threadId),ie?.())}},500);setTimeout(()=>{clearInterval(W),f(null)},2e3)}},[g,c,b,f]);const F=()=>{window.open(n,"_blank")};return o.jsxRuntimeExports.jsxs(yh,{companyNameSticky:O,"data-testid":t.generateDataTestId("health-monitor-list-view"),children:[O&&o.jsxRuntimeExports.jsxs($h,{"data-testid":t.generateDataTestId("health-monitor-list-summary-bar"),children:[o.jsxRuntimeExports.jsxs(Eh,{"data-testid":t.generateDataTestId("health-monitor-list-summary-text"),children:[ih," ",o.jsxRuntimeExports.jsx(Rh,{children:C.length})," ",ah,ph,x," ",lh]}),o.jsxRuntimeExports.jsx(wh,{"data-testid":t.generateDataTestId("health-monitor-list-analytics-button"),children:o.jsxRuntimeExports.jsx(t.Button,{label:dh,variant:"outline",onClick:F,size:"small",prefixIcon:o.jsxRuntimeExports.jsx(kh,{})})})]}),o.jsxRuntimeExports.jsx(jh,{companyNameSticky:O,"data-testid":t.generateDataTestId("health-monitor-list-container"),children:o.jsxRuntimeExports.jsxs(Mi.Provider,{value:v,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:I,width:K})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{innerElementType:zi,height:I,width:K,ref:l,overscanCount:Mt,itemSize:A,onItemsRendered:M=>p(M),itemData:{healthView:e,makeCompanyNameSticky:O,addThreadRequestThreadId:y,setElementRef:T,setAddThreadRequestThreadId:$,onRowClick:r,setNoteData:S},itemCount:e.companies.length,children:Sh})}),h!=null?o.jsxRuntimeExports.jsx(vh,{"data-testid":t.generateDataTestId("health-monitor-notes-drawer"),children:o.jsxRuntimeExports.jsx(Ze.RoomProvider,{id:h.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${h.companyName} ${ch}`,filter:{application:"cockpit",companyId:h.companyId,entityType:h.entityType,isGlobalComment:!1,tab:"healthMonitor"},isLoading:!1,threadMetadata:{companyName:h.companyName,companyId:h.companyId,entityId:h.companyId,entityType:h.entityType,isGlobalComment:!1,application:"cockpit",tab:"healthMonitor",url:window.location.href},textOverrides:{composerPlaceholder:uh,replyComposerPlaceholder:mh,threadResolve:xh,threadUnResolve:hh},onThreadClick:I=>null,onCloseAllThreadsDrawer:()=>S(null)})})}):null]})})]})}const Mi=u.createContext(void 0),Sh=({index:e,style:n,data:r})=>{const{healthView:i,makeCompanyNameSticky:a,onRowClick:d,addThreadRequestThreadId:l,setElementRef:c,setNoteData:p,setAddThreadRequestThreadId:m}=r,h=i.companies[e],{companyId:S}=h.companyInfo;return o.jsxRuntimeExports.jsx(fh,{style:{...n,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${t.Space.sp8} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(um,{companyView:i.companies[e],healthView:i,totalHeight:typeof n.height=="number"?n.height:Ie,companyNameSticky:a,addThreadRequestThreadId:l,setNoteData:p,setElementRef:c,setAddThreadRequestThreadId:m,onRowClick:d})},S)},zi=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,onColumnSortConfigChanged:c}=u.useContext(Mi);return o.jsxRuntimeExports.jsxs(Ch,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(Qx,{companyNameSticky:d,onColumnSortConfigChanged:c,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(bh,{children:r})]})});zi.displayName="Health Monitor view inner element type";const yh=s.div`
1905
+ `,rh=e=>le.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M7.07568 15.1944H1.45068C1.28492 15.1944 1.12595 15.1285 1.00874 15.0113C0.891532 14.8941 0.825684 14.7351 0.825684 14.5694V1.44437C0.825684 1.27861 0.891532 1.11964 1.00874 1.00243C1.12595 0.885219 1.28492 0.819371 1.45068 0.819371H9.75881C9.9242 0.818742 10.0831 0.883694 10.2007 0.999996L12.5176 3.31687C12.6348 3.43405 12.7006 3.593 12.7007 3.75875V5.81937",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M3.32568 9.19999L5.17193 7.35374C5.26025 7.2656 5.37635 7.21073 5.50051 7.19843C5.62468 7.18612 5.74928 7.21715 5.85318 7.28624L6.72381 7.86687C6.83014 7.93767 6.95812 7.96849 7.08503 7.95384C7.21193 7.93919 7.32953 7.88003 7.41693 7.78687L9.12818 5.96124",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M3.32568 4.56938V10.8194H5.82568",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"}),le.createElement("path",{d:"M13.0242 9.84985H10.4955C9.11614 9.84985 8.65637 11.1335 8.65637 12.1487C8.68901 12.8186 8.93013 13.4616 9.34603 13.9878V12.8384C9.34603 12.3786 9.57591 12.1487 10.4955 12.1487H13.0242V13.528L15.323 10.9993L13.0242 8.47054V9.84985Z",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round"})),{cockpit:{health:{healthMonitorFiltersHeaderInfoText:{showing:ih,outOf:ah,customers:lh}}},common:{headers:{comments:ch},analytics:dh,strings:{space:ph}},collaboration:{threads:{placeholder:{addANewComment:uh,replyAComment:mh},tooltip:{resolveComment:xh,unResolveComment:hh}}}}=t.appLocale.getLocalizedStrings();function gh({healthView:e,mixpanelUrl:n,onRowClick:r,onColumnSortConfigChanged:i,initialOpenThreadRequest:a}){const d=t.useWindowSizeContext(),l=u.useRef(null),[c,p]=u.useState(null),{uiState:m}=e,[h,S]=u.useState(null),{unfilteredCompanyCount:x}=e,{companies:C}=e,{setOpenThread:b,setRequestToOpenThread:f,requestToOpenThread:g,isLoading:j}=u.useContext(t.ThreadsContext),[y,$]=u.useState(void 0),w=u.useRef([]),O=!(d==="small"||d==="medium-compact"),A=I=>e.companies[I].companyInfo.name.length>zt?Ie+32:Ie,v=u.useMemo(()=>({makeCompanyNameSticky:O,uiState:m,onColumnSortConfigChanged:i}),[O,m,i]),T=u.useCallback((I,K,M)=>{const Y=e.companies.findIndex(E=>E.companyInfo.companyId===I),G=Dt.findIndex(E=>E.key===K);Y!==-1&&G!==-1&&(w.current[Y]==null?w.current[Y]=[M]:w.current[Y][G]=M)},[e.companies]);u.useEffect(()=>{l.current&&l.current.resetAfterIndex(0)},[e]),u.useEffect(()=>{a!=null&&e.fetchState==="Completed"&&j===!1&&f(a)},[a,e.fetchState,j,f]),u.useEffect(()=>{if(g!=null&&c!=null){const{companyId:I,entityType:K}=g,[M,Y]=K.split("."),G=e.companies.findIndex(k=>k.companyInfo.companyId===I),E=Dt.findIndex(k=>k.key===Y);G!==-1&&!(c.visibleStartIndex<=G&&c.visibleStopIndex>=G)&&l.current?.scrollToItem(G,"center"),setTimeout(()=>{const k=w.current[G]?.[0]?.getBoundingClientRect().bottom,D=w.current[G]?.[0]?.getBoundingClientRect().top;k!=null&&D!=null&&(window.innerHeight>=k&&window.innerHeight>=D||D<0)&&w.current[G][E]?.scrollIntoView({block:"center",behavior:"auto"})},0);const W=setInterval(()=>{const k=w.current[G]?.[E]?.getBoundingClientRect().left,D=w.current[G]?.[E]?.getBoundingClientRect().right,z=w.current[G]?.[E]?.offsetWidth;if(k!=null&&z!=null&&D!=null&&(k<window.innerWidth-z||D<window.innerWidth)){clearInterval(W);const Z=g.threadId,ie=g.onThreadShownCallback;Z&&(f(null),b(g.threadId),ie?.())}},500);setTimeout(()=>{clearInterval(W),f(null)},2e3)}},[g,c,b,f]);const F=()=>{window.open(n,"_blank")};return o.jsxRuntimeExports.jsxs(yh,{companyNameSticky:O,"data-testid":t.generateDataTestId("health-monitor-list-view"),children:[O&&o.jsxRuntimeExports.jsxs($h,{"data-testid":t.generateDataTestId("health-monitor-list-summary-bar"),children:[o.jsxRuntimeExports.jsxs(Eh,{"data-testid":t.generateDataTestId("health-monitor-list-summary-text"),children:[ih," ",o.jsxRuntimeExports.jsx(Rh,{children:C.length})," ",ah,ph,x," ",lh]}),o.jsxRuntimeExports.jsx(wh,{"data-testid":t.generateDataTestId("health-monitor-list-analytics-button"),children:o.jsxRuntimeExports.jsx(t.Button,{label:dh,variant:"outline",onClick:F,size:"small",prefixIcon:o.jsxRuntimeExports.jsx(kh,{})})})]}),o.jsxRuntimeExports.jsx(jh,{companyNameSticky:O,"data-testid":t.generateDataTestId("health-monitor-list-container"),children:o.jsxRuntimeExports.jsxs(Ni.Provider,{value:v,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:I,width:K})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{innerElementType:Mi,height:I,width:K,ref:l,overscanCount:Mt,itemSize:A,onItemsRendered:M=>p(M),itemData:{healthView:e,makeCompanyNameSticky:O,addThreadRequestThreadId:y,setElementRef:T,setAddThreadRequestThreadId:$,onRowClick:r,setNoteData:S},itemCount:e.companies.length,children:Sh})}),h!=null?o.jsxRuntimeExports.jsx(vh,{"data-testid":t.generateDataTestId("health-monitor-notes-drawer"),children:o.jsxRuntimeExports.jsx(Ze.RoomProvider,{id:h.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${h.companyName} ${ch}`,filter:{application:"cockpit",companyId:h.companyId,entityType:h.entityType,isGlobalComment:!1,tab:"healthMonitor"},isLoading:!1,threadMetadata:{companyName:h.companyName,companyId:h.companyId,entityId:h.companyId,entityType:h.entityType,isGlobalComment:!1,application:"cockpit",tab:"healthMonitor",url:window.location.href},textOverrides:{composerPlaceholder:uh,replyComposerPlaceholder:mh,threadResolve:xh,threadUnResolve:hh},onThreadClick:I=>null,onCloseAllThreadsDrawer:()=>S(null)})})}):null]})})]})}const Ni=u.createContext(void 0),Sh=({index:e,style:n,data:r})=>{const{healthView:i,makeCompanyNameSticky:a,onRowClick:d,addThreadRequestThreadId:l,setElementRef:c,setNoteData:p,setAddThreadRequestThreadId:m}=r,h=i.companies[e],{companyId:S}=h.companyInfo;return o.jsxRuntimeExports.jsx(fh,{style:{...n,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${t.Space.sp8} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(um,{companyView:i.companies[e],healthView:i,totalHeight:typeof n.height=="number"?n.height:Ie,companyNameSticky:a,addThreadRequestThreadId:l,setNoteData:p,setElementRef:c,setAddThreadRequestThreadId:m,onRowClick:d})},S)},Mi=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,onColumnSortConfigChanged:c}=u.useContext(Ni);return o.jsxRuntimeExports.jsxs(Ch,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(Qx,{companyNameSticky:d,onColumnSortConfigChanged:c,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(bh,{children:r})]})});Mi.displayName="Health Monitor view inner element type";const yh=s.div`
1906
1906
  width: 100%;
1907
1907
  height: 100%;
1908
1908
  background-color: ${e=>e.theme.colors.grey4};
@@ -1940,7 +1940,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1940
1940
  margin-left: ${t.Space.sp1};
1941
1941
  cursor: pointer;
1942
1942
  stroke: ${e=>e.theme.colors.primary};
1943
- `,{cockpit:{emptySearchTextFirstLine:Th,emptySearchTextSecondLine:Lh}}=t.appLocale.getLocalizedStrings(),Ph=({headerActions:e,headerData:n,healthPageData:r,healthPageActions:i,initialOpenThreadRequest:a})=>{const{healthView:d,managementView:l,mixpanelUrl:c}=r,{onColumnSortConfigChanged:p,onRowClick:m,onCockpitReloadData:h,onFiltersChange:S}=i,{filterText:x,filters:C}=d.uiState,b=l.fetchState==="Completed"&&d.fetchState==="Completed"&&d.zeniUsers.fetchState==="Completed";return e.filterActions&&(e.filterActions.getCategoryWiseOptions=()=>Dh(d)),o.jsxRuntimeExports.jsxs(Ah,{"data-testid":t.generateDataTestId("health-monitor-page"),children:[o.jsxRuntimeExports.jsx(ht,{headerActions:{...e},headerData:{...n,allTabOptions:xt,selectedTabOption:"healthMonitor",filterData:{filterText:x,filters:C},companiesLoaded:b}}),o.jsxRuntimeExports.jsx(Ih,{healthView:d,initialOpenThreadRequest:a,managementView:l,mixpanelUrl:c,onClearFilter:()=>S({}),onColumnSortConfigChanged:p,onCockpitReloadData:h,onRowClick:m})]})},Ih=({healthView:e,initialOpenThreadRequest:n,managementView:r,mixpanelUrl:i,onClearFilter:a,onCockpitReloadData:d,onColumnSortConfigChanged:l,onRowClick:c})=>{const p=t.useWindowSizeContext();return e.fetchState==="Error"||e.zeniUsers.fetchState==="Error"?o.jsxRuntimeExports.jsx(Nh,{"data-testid":t.generateDataTestId("health-monitor-page-error"),children:o.jsxRuntimeExports.jsx(jt,{selectedCockpitOption:"healthMonitor",onCockpitReloadData:d})}):r.fetchState==="In-Progress"||r.fetchState==="Not-Started"||e.fetchState==="In-Progress"||e.fetchState==="Not-Started"||e.zeniUsers.fetchState==="In-Progress"||e.zeniUsers.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(Oh,{"data-testid":t.generateDataTestId("health-monitor-page-loader"),children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.companies.length===0?o.jsxRuntimeExports.jsx(Mh,{"data-testid":t.generateDataTestId("health-monitor-page-empty-state"),children:o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:Th,emptySearchTextSecondLine:Lh,filtersApplied:!0,onClearFilter:a})}):o.jsxRuntimeExports.jsx(zh,{windowSize:p,"data-testid":t.generateDataTestId("health-monitor-page-table-wrapper"),children:o.jsxRuntimeExports.jsx(gh,{healthView:e,mixpanelUrl:i,onColumnSortConfigChanged:l,onRowClick:c,initialOpenThreadRequest:n})})},Dh=e=>{const n=e.zeniUsers.values,r=pi,{companies:i}=e;return r.reduce((a,d)=>{switch(d.value){case"companyGroupId":if(i.length>0&&i[0].companyGroup!=null){const l=i[0].companyGroup.map(c=>{const p=c;return{label:p.name,value:p.id}});return{...a,[d.value]:l}}else return{...a,[d.value]:[]};case"verticalProductServices":return{...a,[d.value]:Za};case"runway":return{...a,[d.value]:Ja};case"churnProbabilityPercentage":return{...a,[d.value]:Xa};case"netPromoterScore":return{...a,[d.value]:qa};case"customerSatisfactionScore":return{...a,[d.value]:Qa};case"monthlyRecurringRevenue":return{...a,[d.value]:ps};case"externalProductServiceExposure":case"controller":case"customerSuccessManager":{const l=n.map(c=>({label:c.firstName||c.lastName?`${c.firstName} ${c.lastName}`:c.email,value:c.userId,photo:c.photo,email:c.email}));return{...a,[d.value]:l}}default:return{...a,[d.value]:[]}}},{})},Ah=s.div`
1943
+ `,{cockpit:{emptySearchTextFirstLine:Th,emptySearchTextSecondLine:Lh}}=t.appLocale.getLocalizedStrings(),Ph=({headerActions:e,headerData:n,healthPageData:r,healthPageActions:i,initialOpenThreadRequest:a})=>{const{healthView:d,managementView:l,mixpanelUrl:c}=r,{onColumnSortConfigChanged:p,onRowClick:m,onCockpitReloadData:h,onFiltersChange:S}=i,{filterText:x,filters:C}=d.uiState,b=l.fetchState==="Completed"&&d.fetchState==="Completed"&&d.zeniUsers.fetchState==="Completed";return e.filterActions&&(e.filterActions.getCategoryWiseOptions=()=>Dh(d)),o.jsxRuntimeExports.jsxs(Ah,{"data-testid":t.generateDataTestId("health-monitor-page"),children:[o.jsxRuntimeExports.jsx(ht,{headerActions:{...e},headerData:{...n,allTabOptions:xt,selectedTabOption:"healthMonitor",filterData:{filterText:x,filters:C},companiesLoaded:b}}),o.jsxRuntimeExports.jsx(Ih,{healthView:d,initialOpenThreadRequest:a,managementView:l,mixpanelUrl:c,onClearFilter:()=>S({}),onColumnSortConfigChanged:p,onCockpitReloadData:h,onRowClick:m})]})},Ih=({healthView:e,initialOpenThreadRequest:n,managementView:r,mixpanelUrl:i,onClearFilter:a,onCockpitReloadData:d,onColumnSortConfigChanged:l,onRowClick:c})=>{const p=t.useWindowSizeContext();return e.fetchState==="Error"||e.zeniUsers.fetchState==="Error"?o.jsxRuntimeExports.jsx(Nh,{"data-testid":t.generateDataTestId("health-monitor-page-error"),children:o.jsxRuntimeExports.jsx(bt,{selectedCockpitOption:"healthMonitor",onCockpitReloadData:d})}):r.fetchState==="In-Progress"||r.fetchState==="Not-Started"||e.fetchState==="In-Progress"||e.fetchState==="Not-Started"||e.zeniUsers.fetchState==="In-Progress"||e.zeniUsers.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(Oh,{"data-testid":t.generateDataTestId("health-monitor-page-loader"),children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.companies.length===0?o.jsxRuntimeExports.jsx(Mh,{"data-testid":t.generateDataTestId("health-monitor-page-empty-state"),children:o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:Th,emptySearchTextSecondLine:Lh,filtersApplied:!0,onClearFilter:a})}):o.jsxRuntimeExports.jsx(zh,{windowSize:p,"data-testid":t.generateDataTestId("health-monitor-page-table-wrapper"),children:o.jsxRuntimeExports.jsx(gh,{healthView:e,mixpanelUrl:i,onColumnSortConfigChanged:l,onRowClick:c,initialOpenThreadRequest:n})})},Dh=e=>{const n=e.zeniUsers.values,r=di,{companies:i}=e;return r.reduce((a,d)=>{switch(d.value){case"companyGroupId":if(i.length>0&&i[0].companyGroup!=null){const l=i[0].companyGroup.map(c=>{const p=c;return{label:p.name,value:p.id}});return{...a,[d.value]:l}}else return{...a,[d.value]:[]};case"verticalProductServices":return{...a,[d.value]:Za};case"runway":return{...a,[d.value]:Ja};case"churnProbabilityPercentage":return{...a,[d.value]:Xa};case"netPromoterScore":return{...a,[d.value]:qa};case"customerSatisfactionScore":return{...a,[d.value]:Qa};case"monthlyRecurringRevenue":return{...a,[d.value]:ds};case"externalProductServiceExposure":case"controller":case"customerSuccessManager":{const l=n.map(c=>({label:c.firstName||c.lastName?`${c.firstName} ${c.lastName}`:c.email,value:c.userId,photo:c.photo,email:c.email}));return{...a,[d.value]:l}}default:return{...a,[d.value]:[]}}},{})},Ah=s.div`
1944
1944
  height: calc(100vh - 45px);
1945
1945
  overflow-y: hidden;
1946
1946
  background-color: ${e=>e.theme.colors.grey4};
@@ -1957,7 +1957,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
1957
1957
  `,Nh=s.div``,Mh=s.div``,zh=s.div`
1958
1958
  height: calc(100% - 75px);
1959
1959
  padding: ${e=>`${t.Space.sp0} ${t.Space.sp0} ${t.Space.sp0} ${Xe.cockpitLeftPadding.valuePx(e.windowSize)}`};
1960
- `,st=t.appLocale.getLocalizedStrings().cockpit.subscription.header,yt=[{key:"companyName",value:st.name,sortOrder:"ascending",width:new t.ResponsiveSized(392,392),isThreadAllowed:!0},{key:"status",value:st.status,sortOrder:"ascending",width:new t.ResponsiveSized(149,149),isThreadAllowed:!0},{key:"controller",value:st.controller,sortOrder:"ascending",width:new t.ResponsiveSized(232,232),isThreadAllowed:!0},{key:"plans",value:st.plans,sortOrder:"ascending",width:new t.ResponsiveSized(374,374),isThreadAllowed:!0},{key:"planLowerLimit",value:st.planLowerLimit,sortOrder:"ascending",width:new t.ResponsiveSized(164,164),isThreadAllowed:!0},{key:"planHigherLimit",value:st.planHigherLimit,sortOrder:"ascending",width:new t.ResponsiveSized(164,164),isThreadAllowed:!0},{key:"avg2MonthExpenses",value:st.avg2MonthExpenses,sortOrder:"ascending",width:new t.ResponsiveSized(201,201),isThreadAllowed:!0},{key:"addons",value:st.addons,sortOrder:"ascending",width:new t.ResponsiveSized(374,374),isThreadAllowed:!0},{key:"upgradeStatus",value:st.upgradeStatus,sortOrder:"ascending",width:new t.ResponsiveSized(180,180),isThreadAllowed:!0},{key:"monthlyRecurringRevenue",value:st.monthlyRecurringRevenue,sortOrder:"ascending",width:new t.ResponsiveSized(196,196),isThreadAllowed:!0}];yt.map(e=>e.key);function Fh({companyNameSticky:e,sortConfig:n,onColumnSortConfigChanged:r}){const i=t.useWindowSizeContext(),[a,d]=u.useState(o.cloneDeep(yt));u.useEffect(()=>{const c=[...a];for(const p of c)p.key===n.sortKey?p.sortOrder=n.sortOrder:p.sortOrder="ascending";d(c)},[n.sortKey,n.sortOrder]);const l=(c,p)=>{let m=p;n.sortKey===c&&(m=p==="ascending"?"descending":"ascending"),r(c,m)};return o.jsxRuntimeExports.jsx(Bh,{height:Nt,children:a.map(c=>o.jsxRuntimeExports.jsxs(_h,{companyNameSticky:e&&c.key==="companyName",sortDataValue:n.sortKey,actualDataValue:c.key,wrapperWidth:c.width,windowSize:i,children:[o.jsxRuntimeExports.jsxs(Kh,{onClick:()=>l(ee.toSubscriptionSortKeyType(c.key),c.sortOrder),children:[o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:c.value}),o.jsxRuntimeExports.jsx(Uh,{sortDataValue:n.sortKey,headerdata:c,children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:12,height:12})})]}),o.jsxRuntimeExports.jsx(Hh,{windowSize:i,sortDataValue:n.sortKey,isVisible:n.sortKey===c.key&&c.key!=="status",children:o.jsxRuntimeExports.jsx(Vh,{onClick:()=>l("status","ascending")})})]},c.key))})}const Wh=u.memo(Fh),Bh=s(t.SmallRegular)`
1960
+ `,st=t.appLocale.getLocalizedStrings().cockpit.subscription.header,ft=[{key:"companyName",value:st.name,sortOrder:"ascending",width:new t.ResponsiveSized(392,392),isThreadAllowed:!0},{key:"status",value:st.status,sortOrder:"ascending",width:new t.ResponsiveSized(149,149),isThreadAllowed:!0},{key:"controller",value:st.controller,sortOrder:"ascending",width:new t.ResponsiveSized(232,232),isThreadAllowed:!0},{key:"plans",value:st.plans,sortOrder:"ascending",width:new t.ResponsiveSized(374,374),isThreadAllowed:!0},{key:"planLowerLimit",value:st.planLowerLimit,sortOrder:"ascending",width:new t.ResponsiveSized(164,164),isThreadAllowed:!0},{key:"planHigherLimit",value:st.planHigherLimit,sortOrder:"ascending",width:new t.ResponsiveSized(164,164),isThreadAllowed:!0},{key:"avg2MonthExpenses",value:st.avg2MonthExpenses,sortOrder:"ascending",width:new t.ResponsiveSized(201,201),isThreadAllowed:!0},{key:"addons",value:st.addons,sortOrder:"ascending",width:new t.ResponsiveSized(374,374),isThreadAllowed:!0},{key:"upgradeStatus",value:st.upgradeStatus,sortOrder:"ascending",width:new t.ResponsiveSized(180,180),isThreadAllowed:!0},{key:"monthlyRecurringRevenue",value:st.monthlyRecurringRevenue,sortOrder:"ascending",width:new t.ResponsiveSized(196,196),isThreadAllowed:!0}];ft.map(e=>e.key);function Fh({companyNameSticky:e,sortConfig:n,onColumnSortConfigChanged:r}){const i=t.useWindowSizeContext(),[a,d]=u.useState(o.cloneDeep(ft));u.useEffect(()=>{const c=[...a];for(const p of c)p.key===n.sortKey?p.sortOrder=n.sortOrder:p.sortOrder="ascending";d(c)},[n.sortKey,n.sortOrder]);const l=(c,p)=>{let m=p;n.sortKey===c&&(m=p==="ascending"?"descending":"ascending"),r(c,m)};return o.jsxRuntimeExports.jsx(Bh,{height:Nt,children:a.map(c=>o.jsxRuntimeExports.jsxs(_h,{companyNameSticky:e&&c.key==="companyName",sortDataValue:n.sortKey,actualDataValue:c.key,wrapperWidth:c.width,windowSize:i,children:[o.jsxRuntimeExports.jsxs(Kh,{onClick:()=>l(J.toSubscriptionSortKeyType(c.key),c.sortOrder),children:[o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:c.value}),o.jsxRuntimeExports.jsx(Uh,{sortDataValue:n.sortKey,headerdata:c,children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:12,height:12})})]}),o.jsxRuntimeExports.jsx(Hh,{windowSize:i,sortDataValue:n.sortKey,isVisible:n.sortKey===c.key&&c.key!=="status",children:o.jsxRuntimeExports.jsx(Vh,{onClick:()=>l("status","ascending")})})]},c.key))})}const Wh=u.memo(Fh),Bh=s(t.SmallRegular)`
1961
1961
  top: 0;
1962
1962
  left: 0;
1963
1963
  min-height: ${e=>e.height}px;
@@ -2005,7 +2005,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2005
2005
  &:hover {
2006
2006
  color: ${e=>e.theme.colors.primary};
2007
2007
  }
2008
- `,dr=t.appLocale.getLocalizedStrings().cockpit.subscription,pr=({plansAndAddonNames:e,rowIndex:n,isCollapsed:r,showCollapseToggle:i,onCollapseToggled:a,companyId:d,tenantId:l,onPlanOrAddOnClicked:c})=>{if(i===!0){const p=r?[...e]:[...e].splice(0,3),m=p.length-1;return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:p.map((h,S)=>o.jsxRuntimeExports.jsx(Gh,{listItem:h,isCollapsed:r,rowIndex:n,onCollapseToggled:a,isLastItem:m===S,tenantId:l,companyId:d,onPlanOrAddOnClicked:c},`${h.name}_${S}`))})}else return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e.map((p,m)=>o.jsxRuntimeExports.jsx(Fi,{children:o.jsxRuntimeExports.jsx(as,{listItem:p,tenantId:l,companyId:d,onPlanOrAddOnClicked:c})},`${p.name}_${m}`))})},Gh=({listItem:e,rowIndex:n,isCollapsed:r,isLastItem:i,onCollapseToggled:a,companyId:d,tenantId:l,onPlanOrAddOnClicked:c})=>o.jsxRuntimeExports.jsx(Fi,{children:i?o.jsxRuntimeExports.jsxs(Xh,{children:[o.jsxRuntimeExports.jsxs("span",{className:r?"expand":"collapse",children:[o.jsxRuntimeExports.jsx(as,{listItem:e,companyId:d,tenantId:l,onPlanOrAddOnClicked:c}),"..."]})," ",o.jsxRuntimeExports.jsx(Zh,{onClick:()=>a?.(n),children:r?dr.lessBtnText:dr.moreBtnText})]}):o.jsxRuntimeExports.jsx(as,{listItem:e,tenantId:l,companyId:d,onPlanOrAddOnClicked:c})}),as=({listItem:e,companyId:n,tenantId:r,onPlanOrAddOnClicked:i})=>o.jsxRuntimeExports.jsx(Yh,{isCancelled:e.status==="cancelled",onClick:a=>{a.preventDefault(),r!=null&&i?.(n,r)},children:e.name}),Yh=s(t.SmallRegular)`
2008
+ `,dr=t.appLocale.getLocalizedStrings().cockpit.subscription,pr=({plansAndAddonNames:e,rowIndex:n,isCollapsed:r,showCollapseToggle:i,onCollapseToggled:a,companyId:d,tenantId:l,onPlanOrAddOnClicked:c})=>{if(i===!0){const p=r?[...e]:[...e].splice(0,3),m=p.length-1;return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:p.map((h,S)=>o.jsxRuntimeExports.jsx(Gh,{listItem:h,isCollapsed:r,rowIndex:n,onCollapseToggled:a,isLastItem:m===S,tenantId:l,companyId:d,onPlanOrAddOnClicked:c},`${h.name}_${S}`))})}else return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e.map((p,m)=>o.jsxRuntimeExports.jsx(zi,{children:o.jsxRuntimeExports.jsx(is,{listItem:p,tenantId:l,companyId:d,onPlanOrAddOnClicked:c})},`${p.name}_${m}`))})},Gh=({listItem:e,rowIndex:n,isCollapsed:r,isLastItem:i,onCollapseToggled:a,companyId:d,tenantId:l,onPlanOrAddOnClicked:c})=>o.jsxRuntimeExports.jsx(zi,{children:i?o.jsxRuntimeExports.jsxs(Xh,{children:[o.jsxRuntimeExports.jsxs("span",{className:r?"expand":"collapse",children:[o.jsxRuntimeExports.jsx(is,{listItem:e,companyId:d,tenantId:l,onPlanOrAddOnClicked:c}),"..."]})," ",o.jsxRuntimeExports.jsx(Zh,{onClick:()=>a?.(n),children:r?dr.lessBtnText:dr.moreBtnText})]}):o.jsxRuntimeExports.jsx(is,{listItem:e,tenantId:l,companyId:d,onPlanOrAddOnClicked:c})}),is=({listItem:e,companyId:n,tenantId:r,onPlanOrAddOnClicked:i})=>o.jsxRuntimeExports.jsx(Yh,{isCancelled:e.status==="cancelled",onClick:a=>{a.preventDefault(),r!=null&&i?.(n,r)},children:e.name}),Yh=s(t.SmallRegular)`
2009
2009
  text-decoration: ${e=>e.isCancelled?"line-through":"unset"};
2010
2010
  display: inline;
2011
2011
  &:hover {
@@ -2015,7 +2015,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2015
2015
  `,Zh=s(t.SmallMedium)`
2016
2016
  cursor: pointer;
2017
2017
  color: ${e=>e.theme.colors.primary};
2018
- `,Fi=s.li`
2018
+ `,zi=s.li`
2019
2019
  height: 18px;
2020
2020
  `,Xh=s.div`
2021
2021
  display: flex;
@@ -2036,7 +2036,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2036
2036
  display: inline-block;
2037
2037
  }
2038
2038
  }
2039
- `,on={listItemHeightWithoutPadding:t.sp[10],listItemPadding:34,planAndAddonItemHeight:18},Wi=e=>({height:e.subscriptions.reduce((i,a)=>i+(a.addOns?.length??0),0)*on.planAndAddonItemHeight+on.listItemPadding,collapsedHeight:Ie}),Bi=e=>({height:e.subscriptions.reduce((i,a)=>i+(a.plan!=null?1:0),0)*on.planAndAddonItemHeight+on.listItemPadding,collapsedHeight:Ie}),qh=e=>{const n=Wi(e),r=Bi(e);return n.height>r.height?n:r},ur=(e,n)=>{switch(n){case"plans":{const r=Bi(e);return r.height>r.collapsedHeight}case"addons":{const r=Wi(e);return r.height>r.collapsedHeight}}},Qh=t.appLocale.getLocalizedStrings(),{cockpit:{management:{placeholder:Jh}},common:{strings:ro,due:eg}}=Qh,tg=({companyView:e,allUsers:n,rowIndex:r,companyNameSticky:i,isCollapsed:a,totalHeight:d,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:p,setNoteData:m,setElementRef:h,setAddThreadRequestThreadId:S,onCollapseToggled:x,onCompanyNameClicked:C,onPassportIconClicked:b,onPlanOrAddOnClicked:f,changeHandlers:g})=>{const[j,y]=u.useState(null),$=t.useWindowSizeContext(),w=e.primarySubscription?.subscription,O=e.primarySubscription?.summary,A=e.primarySubscription?.summary.summary.tenantId,{companyId:v,name:T}=e.company.company.companyInfo,F=ng(O?.schema?.recommendedAction??[]),I=sg(e,n),K=`cockpit_${v}`,M="subscription.notes",{threads:Y,isLoading:G}=t.useFilteredThreads({entityType:M,companyId:v},!1),{openThread:E,threads:P,addThread:W,removeThread:k,setOpenThread:D}=u.useContext(t.ThreadsContext),z=E!==null?P.get(E):null,Z=E?.includes(v)===!0,ie=E!=null&&P.get(E)==null&&Z,N=l!=null&&P.get(l)?.metadata.companyId===v,H={name:e.company.company.companyInfo.name,status:w?.subscription?.subscription?.status??{code:"",name:""},slabUpperLimit:w?.plan?.plan?.slabUpperLimit??{},slabLowerLimit:w?.plan?.plan?.slabLowerLimit??{},avg2MonthExpenses:O?.summary?.avg2MonthExpenses??{},totalDues:O?.summary?.totalDues??{},recommendedActionName:F[O?.summary?.recommendedActionCode??""]??"",recommendedActionCode:O?.summary?.recommendedActionCode??"",monthlyRecurringRevenue:O?.summary?.monthlyRecurringRevenue??{},...og(e.subscriptions)},L=o.useForm({mode:"all"}),Q="companyData",se=(_,J)=>`${_}.${J}`,X=(_,J)=>{_===`${Q}.controller`&&v!=null&&(J.users=rg(J,_).users,g(v,J))};u.useEffect(()=>{const _=L.watch((J,{name:ge})=>{ge!=null&&J.companyData!=null&&o.defer(()=>X(ge,J.companyData))});return()=>{_.unsubscribe()}});const re=u.useCallback(()=>{E?.includes(t.NEW_THREAD_SUFFIX)===!0&&k(E),l!=null&&S(void 0)},[l,E,k,S]),te=_=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:_.isElementThreadOpen??!1,isElementThreadPresent:_.isElementThreadPresent??!1,itemKey:_.itemKey,elementThreadId:_.elementThreadId??"",roomId:K,addThreadRequestThreadId:l,openThreadId:E,threadStyle:_.threadStyle,openThreadMetadata:z?.metadata??null,onElementClick:fe,onAddThreadClick:be,targetElement:c??j}),he=u.useCallback(_=>{if(_===E)D(null);else if(P.has(_))D(_);else if(_.includes(t.NEW_THREAD_SUFFIX)){const[J,ge]=_.replace(t.NEW_THREAD_SUFFIX,"").split("."),ve=Ft(Ct(J),ee.toSubscriptionSortKeyType(ge),v,T);W(_,{type:"thread",id:_,roomId:K,createdAt:new Date,updatedAt:new Date,comments:[],metadata:ve,resolved:!1}),D(_)}},[v,T,E,P,W,D,K]),fe=u.useCallback((_,J,ge=!1)=>{const ve=yt.find(Re=>Re.key===J);if(p(),ve!=null&&(_.type==="contextmenu"||ge===!0)){if(ve.isThreadAllowed===!1)return;re(),_.preventDefault(),_.stopPropagation();const Re=t.toCollaborationEntityType({tab:"subscription",key:ve.key});if(_.target instanceof HTMLElement||_.target instanceof SVGElement)if(ge===!0&&_.target instanceof HTMLElement)y(_.target.parentElement);else if(_.target instanceof HTMLElement){const ae=ms(_.target,oe);y(ae||_.target)}else{const ae=_.target.closest(`.${oe}`);ae instanceof HTMLElement&&y(ae)}const R=[...t.getFilteredThreads(P,{entityType:Re,companyId:v},"both")],Ce=R.length>0&&R[0].length>0?R[0][0]:Le("subscription",ve.key,v);P.has(Ce)?he(Ce):l===Ce?S(void 0):(S(Ce),D(null))}},[P,v,l,he,S,D,p,re]),be=u.useCallback((_,J)=>{_.stopPropagation();const ge=Le("subscription",J,v);S(void 0),he(ge)},[v,S,he]);return o.jsxRuntimeExports.jsx(o.FormProvider,{...L,children:o.jsxRuntimeExports.jsx("form",{style:{height:"100%"},children:o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{p(),l!=null&&(S(void 0),l.includes(t.NEW_THREAD_SUFFIX)&&k(l))},children:o.jsxRuntimeExports.jsx(cg,{windowSize:$,isThreadOpen:Z||N,totalHeight:d,isCreationInProgress:ie,children:yt.map((_,J)=>{const ge=t.toCollaborationEntityType({tab:"subscription",key:_.key}),ve=yt.length-2<=J,Re=[...t.getFilteredThreads(P,{entityType:ge,companyId:v},"both")],R=Re.length>0&&Re[0].length>0?Re[0][0]:Le("subscription",_.key,v),Ce=P.get(R),ae=Ce!=null&&Ce.resolved===!1,ce=R===E,$e=l===R;switch(_.key){case"companyName":return o.jsxRuntimeExports.jsxs(dg,{companyNameSticky:i,columnWidth:_.width,windowSize:$,isThreadOpen:ce||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),ref:V=>{h(v,_.key,V)},children:[o.jsxRuntimeExports.jsxs(ag,{children:[o.jsxRuntimeExports.jsx(lg,{onClick:V=>{V.preventDefault(),C(e)},children:H.name}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:ce,targetElement:c??j,roomId:K,openThreadId:E,openThreadMetadata:z?.metadata??null})]}),o.jsxRuntimeExports.jsxs(pg,{children:[o.jsxRuntimeExports.jsxs(xg,{onClick:V=>{V.preventDefault(),m({roomId:K,companyId:v,companyName:T,entityType:M})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:Y.length,isLoading:G}),o.jsxRuntimeExports.jsx(gg,{})]}),o.jsxRuntimeExports.jsx(ug,{onClick:V=>{V.preventDefault(),b(e)},children:o.jsxRuntimeExports.jsx(mg,{className:"passportIcon"})})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:ae,itemKey:_.key,style:{left:t.Space.sp4},onElementClick:fe}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("subscription",_.key,v),addThreadRequestThreadId:l,itemKey:_.key,onAddThreadClick:be})]},R);case"status":return o.jsxRuntimeExports.jsxs(lt,{ref:V=>{h(v,_.key,V)},columnWidth:_.width,windowSize:$,isThreadOpen:Z||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),children:[H.status.code?o.jsxRuntimeExports.jsx(gr,{textColor:t.getCockpitColor(H.status.code),children:H.status.name.toUpperCase()}):ro.hyphen,te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:_.key,elementThreadId:R,threadStyle:ve?{right:t.Space.sp0}:void 0})]},R);case"controller":return o.jsxRuntimeExports.jsxs(lt,{ref:V=>{h(v,_.key,V)},columnWidth:_.width,windowSize:$,isThreadOpen:Z||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:se(Q,"controller"),value:I.controller,placeholderLabel:Jh.controller,pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:_.key,elementThreadId:R,threadStyle:ve?{right:t.Space.sp0}:void 0})]},R);case"plans":return o.jsxRuntimeExports.jsxs(lt,{ref:V=>{h(v,_.key,V)},columnWidth:_.width,windowSize:$,isThreadOpen:Z||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),children:[o.jsxRuntimeExports.jsx(hr,{children:H.plansWithStatus.length>0?o.jsxRuntimeExports.jsx(pr,{plansAndAddonNames:H.plansWithStatus,isCollapsed:a,rowIndex:r,onCollapseToggled:x,showCollapseToggle:ur(e,"plans"),companyId:v,tenantId:A,onPlanOrAddOnClicked:f}):ro.hyphen}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:_.key,elementThreadId:R,threadStyle:ve?{right:t.Space.sp0}:void 0})]},R);case"planLowerLimit":return o.jsxRuntimeExports.jsxs(lt,{ref:V=>{h(v,_.key,V)},columnWidth:_.width,windowSize:$,isThreadOpen:Z||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),children:[o.jsxRuntimeExports.jsx($n,{widthWrapper:_.width,windowSize:$,textColor:t.getCockpitColor("lowerLimit"),children:t.amountToString("0,0",H.slabLowerLimit)}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:_.key,elementThreadId:R,threadStyle:ve?{right:t.Space.sp0}:void 0})]},R);case"planHigherLimit":return o.jsxRuntimeExports.jsxs(lt,{ref:V=>{h(v,_.key,V)},columnWidth:_.width,windowSize:$,isThreadOpen:Z||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),children:[o.jsxRuntimeExports.jsx($n,{widthWrapper:_.width,windowSize:$,textColor:t.getCockpitColor("upperLimit"),children:t.amountToString("0,0",H.slabUpperLimit)}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:_.key,elementThreadId:R,threadStyle:ve?{right:t.Space.sp0}:void 0})]},R);case"avg2MonthExpenses":return o.jsxRuntimeExports.jsxs(lt,{ref:V=>{h(v,_.key,V)},columnWidth:_.width,windowSize:$,isThreadOpen:Z||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),children:[o.jsxRuntimeExports.jsx($n,{widthWrapper:_.width,windowSize:$,textColor:t.getCockpitColor("avg2MonthExpenses"),children:t.amountToString("0,0",H.avg2MonthExpenses)}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:_.key,elementThreadId:R,threadStyle:ve?{right:t.Space.sp0}:void 0})]},R);case"addons":return o.jsxRuntimeExports.jsxs(lt,{ref:V=>{h(v,_.key,V)},columnWidth:_.width,windowSize:$,isThreadOpen:Z||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),children:[o.jsxRuntimeExports.jsx(hr,{children:H.addonsWithStatus.length>0?o.jsxRuntimeExports.jsx(pr,{plansAndAddonNames:H.addonsWithStatus,isCollapsed:a,rowIndex:r,onCollapseToggled:x,showCollapseToggle:ur(e,"addons"),companyId:v,tenantId:A,onPlanOrAddOnClicked:f}):ro.hyphen}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:_.key,elementThreadId:R,threadStyle:ve?{right:t.Space.sp0}:void 0})]},R);case"upgradeStatus":return o.jsxRuntimeExports.jsxs(lt,{ref:V=>{h(v,_.key,V)},columnWidth:_.width,windowSize:$,isThreadOpen:Z||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),children:[o.jsxRuntimeExports.jsx(xr,{children:H.recommendedActionName?o.jsxRuntimeExports.jsx(gr,{textColor:t.getCockpitColor(H.recommendedActionCode),onClick:V=>{V.preventDefault(),A!=null&&H.recommendedActionCode==="upgrade"&&f(v,A)},code:H.recommendedActionCode,children:H.recommendedActionName}):ro.hyphen}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:_.key,elementThreadId:R,threadStyle:ve?{right:t.Space.sp0}:void 0})]},R);case"monthlyRecurringRevenue":return o.jsxRuntimeExports.jsxs(lt,{ref:V=>{h(v,_.key,V)},columnWidth:_.width,windowSize:$,isThreadOpen:Z||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),children:[o.jsxRuntimeExports.jsxs(xr,{children:[o.jsxRuntimeExports.jsx(t.LargeRegular,{children:t.amountToString("0,0",H.monthlyRecurringRevenue)}),H.totalDues.amount>0?o.jsxRuntimeExports.jsx(hg,{children:t.amountToString("0,0",H.totalDues).concat(ro.space).concat(eg)}):null]}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:_.key,elementThreadId:R,threadStyle:ve?{right:t.Space.sp0}:void 0})]},R);default:return null}})})})})})},og=e=>{const n={plansWithStatus:[],addonsWithStatus:[]};return e.forEach(r=>{const i=r.plan?.plan.name??"",a=r.subscription.subscription.status.code;i!=null&&n.plansWithStatus.push({name:i,status:a}),r.addOns.forEach(d=>{n.addonsWithStatus.push({name:d.addOn.name,status:a})})}),n},ng=e=>{const n={};return e.reduce((i,a)=>(i[a.code]=a.name,i),n)};function sg(e,n){return{controller:{allUsers:n,selectedUsers:e.controllers.map(r=>r.user)}}}function rg(e,n){const r={};r.users=[];const i=n.split(".")[1],{selectedUsers:a,deSelectedUsers:d}=e[i];return d==null||d?.length==0?a.forEach(l=>{if(l.isUserSelectionUpdated===!0){const c=mr(i,l.userId,l.isRoleSelected);c!==void 0&&r.users?.push(c)}}):d.forEach(l=>{const c=mr(i,l.userId,l.isRoleSelected);c!==void 0&&r.users?.push(c)}),{users:r.users}}function ig(e){return e==="controller"}function mr(e,n,r){if(ig(e))return{isZeni:!0,role:e,userId:n,isSelected:r}}const ag=s.div``,lg=s(t.LargeMediumSp)`
2039
+ `,on={listItemHeightWithoutPadding:t.sp[10],listItemPadding:34,planAndAddonItemHeight:18},Fi=e=>({height:e.subscriptions.reduce((i,a)=>i+(a.addOns?.length??0),0)*on.planAndAddonItemHeight+on.listItemPadding,collapsedHeight:Ie}),Wi=e=>({height:e.subscriptions.reduce((i,a)=>i+(a.plan!=null?1:0),0)*on.planAndAddonItemHeight+on.listItemPadding,collapsedHeight:Ie}),qh=e=>{const n=Fi(e),r=Wi(e);return n.height>r.height?n:r},ur=(e,n)=>{switch(n){case"plans":{const r=Wi(e);return r.height>r.collapsedHeight}case"addons":{const r=Fi(e);return r.height>r.collapsedHeight}}},Qh=t.appLocale.getLocalizedStrings(),{cockpit:{management:{placeholder:Jh}},common:{strings:ro,due:eg}}=Qh,tg=({companyView:e,allUsers:n,rowIndex:r,companyNameSticky:i,isCollapsed:a,totalHeight:d,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:p,setNoteData:m,setElementRef:h,setAddThreadRequestThreadId:S,onCollapseToggled:x,onCompanyNameClicked:C,onPassportIconClicked:b,onPlanOrAddOnClicked:f,changeHandlers:g})=>{const[j,y]=u.useState(null),$=t.useWindowSizeContext(),w=e.primarySubscription?.subscription,O=e.primarySubscription?.summary,A=e.primarySubscription?.summary.summary.tenantId,{companyId:v,name:T}=e.company.company.companyInfo,F=ng(O?.schema?.recommendedAction??[]),I=sg(e,n),K=`cockpit_${v}`,M="subscription.notes",{threads:Y,isLoading:G}=t.useFilteredThreads({entityType:M,companyId:v},!1),{openThread:E,threads:P,addThread:W,removeThread:k,setOpenThread:D}=u.useContext(t.ThreadsContext),z=E!==null?P.get(E):null,Z=E?.includes(v)===!0,ie=E!=null&&P.get(E)==null&&Z,N=l!=null&&P.get(l)?.metadata.companyId===v,H={name:e.company.company.companyInfo.name,status:w?.subscription?.subscription?.status??{code:"",name:""},slabUpperLimit:w?.plan?.plan?.slabUpperLimit??{},slabLowerLimit:w?.plan?.plan?.slabLowerLimit??{},avg2MonthExpenses:O?.summary?.avg2MonthExpenses??{},totalDues:O?.summary?.totalDues??{},recommendedActionName:F[O?.summary?.recommendedActionCode??""]??"",recommendedActionCode:O?.summary?.recommendedActionCode??"",monthlyRecurringRevenue:O?.summary?.monthlyRecurringRevenue??{},...og(e.subscriptions)},L=o.useForm({mode:"all"}),Q="companyData",se=(_,ee)=>`${_}.${ee}`,X=(_,ee)=>{_===`${Q}.controller`&&v!=null&&(ee.users=rg(ee,_).users,g(v,ee))};u.useEffect(()=>{const _=L.watch((ee,{name:ge})=>{ge!=null&&ee.companyData!=null&&o.defer(()=>X(ge,ee.companyData))});return()=>{_.unsubscribe()}});const re=u.useCallback(()=>{E?.includes(t.NEW_THREAD_SUFFIX)===!0&&k(E),l!=null&&S(void 0)},[l,E,k,S]),te=_=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:_.isElementThreadOpen??!1,isElementThreadPresent:_.isElementThreadPresent??!1,itemKey:_.itemKey,elementThreadId:_.elementThreadId??"",roomId:K,addThreadRequestThreadId:l,openThreadId:E,threadStyle:_.threadStyle,openThreadMetadata:z?.metadata??null,onElementClick:fe,onAddThreadClick:be,targetElement:c??j}),he=u.useCallback(_=>{if(_===E)D(null);else if(P.has(_))D(_);else if(_.includes(t.NEW_THREAD_SUFFIX)){const[ee,ge]=_.replace(t.NEW_THREAD_SUFFIX,"").split("."),ve=Ft(jt(ee),J.toSubscriptionSortKeyType(ge),v,T);W(_,{type:"thread",id:_,roomId:K,createdAt:new Date,updatedAt:new Date,comments:[],metadata:ve,resolved:!1}),D(_)}},[v,T,E,P,W,D,K]),fe=u.useCallback((_,ee,ge=!1)=>{const ve=ft.find(Re=>Re.key===ee);if(p(),ve!=null&&(_.type==="contextmenu"||ge===!0)){if(ve.isThreadAllowed===!1)return;re(),_.preventDefault(),_.stopPropagation();const Re=t.toCollaborationEntityType({tab:"subscription",key:ve.key});if(_.target instanceof HTMLElement||_.target instanceof SVGElement)if(ge===!0&&_.target instanceof HTMLElement)y(_.target.parentElement);else if(_.target instanceof HTMLElement){const ae=us(_.target,oe);y(ae||_.target)}else{const ae=_.target.closest(`.${oe}`);ae instanceof HTMLElement&&y(ae)}const R=[...t.getFilteredThreads(P,{entityType:Re,companyId:v},"both")],Ce=R.length>0&&R[0].length>0?R[0][0]:Le("subscription",ve.key,v);P.has(Ce)?he(Ce):l===Ce?S(void 0):(S(Ce),D(null))}},[P,v,l,he,S,D,p,re]),be=u.useCallback((_,ee)=>{_.stopPropagation();const ge=Le("subscription",ee,v);S(void 0),he(ge)},[v,S,he]);return o.jsxRuntimeExports.jsx(o.FormProvider,{...L,children:o.jsxRuntimeExports.jsx("form",{style:{height:"100%"},children:o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{p(),l!=null&&(S(void 0),l.includes(t.NEW_THREAD_SUFFIX)&&k(l))},children:o.jsxRuntimeExports.jsx(cg,{windowSize:$,isThreadOpen:Z||N,totalHeight:d,isCreationInProgress:ie,children:ft.map((_,ee)=>{const ge=t.toCollaborationEntityType({tab:"subscription",key:_.key}),ve=ft.length-2<=ee,Re=[...t.getFilteredThreads(P,{entityType:ge,companyId:v},"both")],R=Re.length>0&&Re[0].length>0?Re[0][0]:Le("subscription",_.key,v),Ce=P.get(R),ae=Ce!=null&&Ce.resolved===!1,ce=R===E,$e=l===R;switch(_.key){case"companyName":return o.jsxRuntimeExports.jsxs(dg,{companyNameSticky:i,columnWidth:_.width,windowSize:$,isThreadOpen:ce||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),ref:V=>{h(v,_.key,V)},children:[o.jsxRuntimeExports.jsxs(ag,{children:[o.jsxRuntimeExports.jsx(lg,{onClick:V=>{V.preventDefault(),C(e)},children:H.name}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:ce,targetElement:c??j,roomId:K,openThreadId:E,openThreadMetadata:z?.metadata??null})]}),o.jsxRuntimeExports.jsxs(pg,{children:[o.jsxRuntimeExports.jsxs(xg,{onClick:V=>{V.preventDefault(),m({roomId:K,companyId:v,companyName:T,entityType:M})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:Y.length,isLoading:G}),o.jsxRuntimeExports.jsx(gg,{})]}),o.jsxRuntimeExports.jsx(ug,{onClick:V=>{V.preventDefault(),b(e)},children:o.jsxRuntimeExports.jsx(mg,{className:"passportIcon"})})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:ae,itemKey:_.key,style:{left:t.Space.sp4},onElementClick:fe}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("subscription",_.key,v),addThreadRequestThreadId:l,itemKey:_.key,onAddThreadClick:be})]},R);case"status":return o.jsxRuntimeExports.jsxs(lt,{ref:V=>{h(v,_.key,V)},columnWidth:_.width,windowSize:$,isThreadOpen:Z||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),children:[H.status.code?o.jsxRuntimeExports.jsx(gr,{textColor:t.getCockpitColor(H.status.code),children:H.status.name.toUpperCase()}):ro.hyphen,te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:_.key,elementThreadId:R,threadStyle:ve?{right:t.Space.sp0}:void 0})]},R);case"controller":return o.jsxRuntimeExports.jsxs(lt,{ref:V=>{h(v,_.key,V)},columnWidth:_.width,windowSize:$,isThreadOpen:Z||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:se(Q,"controller"),value:I.controller,placeholderLabel:Jh.controller,pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:_.key,elementThreadId:R,threadStyle:ve?{right:t.Space.sp0}:void 0})]},R);case"plans":return o.jsxRuntimeExports.jsxs(lt,{ref:V=>{h(v,_.key,V)},columnWidth:_.width,windowSize:$,isThreadOpen:Z||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),children:[o.jsxRuntimeExports.jsx(hr,{children:H.plansWithStatus.length>0?o.jsxRuntimeExports.jsx(pr,{plansAndAddonNames:H.plansWithStatus,isCollapsed:a,rowIndex:r,onCollapseToggled:x,showCollapseToggle:ur(e,"plans"),companyId:v,tenantId:A,onPlanOrAddOnClicked:f}):ro.hyphen}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:_.key,elementThreadId:R,threadStyle:ve?{right:t.Space.sp0}:void 0})]},R);case"planLowerLimit":return o.jsxRuntimeExports.jsxs(lt,{ref:V=>{h(v,_.key,V)},columnWidth:_.width,windowSize:$,isThreadOpen:Z||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),children:[o.jsxRuntimeExports.jsx(Rn,{widthWrapper:_.width,windowSize:$,textColor:t.getCockpitColor("lowerLimit"),children:t.amountToString("0,0",H.slabLowerLimit)}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:_.key,elementThreadId:R,threadStyle:ve?{right:t.Space.sp0}:void 0})]},R);case"planHigherLimit":return o.jsxRuntimeExports.jsxs(lt,{ref:V=>{h(v,_.key,V)},columnWidth:_.width,windowSize:$,isThreadOpen:Z||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),children:[o.jsxRuntimeExports.jsx(Rn,{widthWrapper:_.width,windowSize:$,textColor:t.getCockpitColor("upperLimit"),children:t.amountToString("0,0",H.slabUpperLimit)}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:_.key,elementThreadId:R,threadStyle:ve?{right:t.Space.sp0}:void 0})]},R);case"avg2MonthExpenses":return o.jsxRuntimeExports.jsxs(lt,{ref:V=>{h(v,_.key,V)},columnWidth:_.width,windowSize:$,isThreadOpen:Z||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),children:[o.jsxRuntimeExports.jsx(Rn,{widthWrapper:_.width,windowSize:$,textColor:t.getCockpitColor("avg2MonthExpenses"),children:t.amountToString("0,0",H.avg2MonthExpenses)}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:_.key,elementThreadId:R,threadStyle:ve?{right:t.Space.sp0}:void 0})]},R);case"addons":return o.jsxRuntimeExports.jsxs(lt,{ref:V=>{h(v,_.key,V)},columnWidth:_.width,windowSize:$,isThreadOpen:Z||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),children:[o.jsxRuntimeExports.jsx(hr,{children:H.addonsWithStatus.length>0?o.jsxRuntimeExports.jsx(pr,{plansAndAddonNames:H.addonsWithStatus,isCollapsed:a,rowIndex:r,onCollapseToggled:x,showCollapseToggle:ur(e,"addons"),companyId:v,tenantId:A,onPlanOrAddOnClicked:f}):ro.hyphen}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:_.key,elementThreadId:R,threadStyle:ve?{right:t.Space.sp0}:void 0})]},R);case"upgradeStatus":return o.jsxRuntimeExports.jsxs(lt,{ref:V=>{h(v,_.key,V)},columnWidth:_.width,windowSize:$,isThreadOpen:Z||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),children:[o.jsxRuntimeExports.jsx(xr,{children:H.recommendedActionName?o.jsxRuntimeExports.jsx(gr,{textColor:t.getCockpitColor(H.recommendedActionCode),onClick:V=>{V.preventDefault(),A!=null&&H.recommendedActionCode==="upgrade"&&f(v,A)},code:H.recommendedActionCode,children:H.recommendedActionName}):ro.hyphen}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:_.key,elementThreadId:R,threadStyle:ve?{right:t.Space.sp0}:void 0})]},R);case"monthlyRecurringRevenue":return o.jsxRuntimeExports.jsxs(lt,{ref:V=>{h(v,_.key,V)},columnWidth:_.width,windowSize:$,isThreadOpen:Z||$e,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:V=>fe(V,_.key),children:[o.jsxRuntimeExports.jsxs(xr,{children:[o.jsxRuntimeExports.jsx(t.LargeRegular,{children:t.amountToString("0,0",H.monthlyRecurringRevenue)}),H.totalDues.amount>0?o.jsxRuntimeExports.jsx(hg,{children:t.amountToString("0,0",H.totalDues).concat(ro.space).concat(eg)}):null]}),te({isElementThreadOpen:ce,isElementThreadPresent:ae,itemKey:_.key,elementThreadId:R,threadStyle:ve?{right:t.Space.sp0}:void 0})]},R);default:return null}})})})})})},og=e=>{const n={plansWithStatus:[],addonsWithStatus:[]};return e.forEach(r=>{const i=r.plan?.plan.name??"",a=r.subscription.subscription.status.code;i!=null&&n.plansWithStatus.push({name:i,status:a}),r.addOns.forEach(d=>{n.addonsWithStatus.push({name:d.addOn.name,status:a})})}),n},ng=e=>{const n={};return e.reduce((i,a)=>(i[a.code]=a.name,i),n)};function sg(e,n){return{controller:{allUsers:n,selectedUsers:e.controllers.map(r=>r.user)}}}function rg(e,n){const r={};r.users=[];const i=n.split(".")[1],{selectedUsers:a,deSelectedUsers:d}=e[i];return d==null||d?.length==0?a.forEach(l=>{if(l.isUserSelectionUpdated===!0){const c=mr(i,l.userId,l.isRoleSelected);c!==void 0&&r.users?.push(c)}}):d.forEach(l=>{const c=mr(i,l.userId,l.isRoleSelected);c!==void 0&&r.users?.push(c)}),{users:r.users}}function ig(e){return e==="controller"}function mr(e,n,r){if(ig(e))return{isZeni:!0,role:e,userId:n,isSelected:r}}const ag=s.div``,lg=s(t.LargeMediumSp)`
2040
2040
  word-break: break-word;
2041
2041
  margin-right: 10px;
2042
2042
  cursor: pointer;
@@ -2144,7 +2144,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2144
2144
  }
2145
2145
  `,hg=s(t.SmallRegular)`
2146
2146
  color: ${t.Colors.important};
2147
- `,$n=s(t.LargeRegular)`
2147
+ `,Rn=s(t.LargeRegular)`
2148
2148
  width: ${e=>e.widthWrapper.valuePx(e.windowSize)};
2149
2149
  color: ${e=>e.textColor.color.toString()};
2150
2150
  `,gr=s(t.SmallRegular)`
@@ -2170,7 +2170,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2170
2170
  z-index: auto;
2171
2171
  cursor: ${e=>e.isThreadAllowed?"pointer":"initial"};
2172
2172
  position: relative;
2173
- `,Sg=({companyNameSticky:e,totalMRRAmount:n})=>{const r=t.useWindowSizeContext(),i=yt;return o.jsxRuntimeExports.jsxs(yg,{className:"totalMRR",children:[o.jsxRuntimeExports.jsx(fg,{companyNameSticky:e,width:i[0].width,windowSize:r}),o.jsxRuntimeExports.jsx(En,{width:i[1].width,windowSize:r}),o.jsxRuntimeExports.jsx(Sr,{width:i[2].width,windowSize:r}),o.jsxRuntimeExports.jsx(Cg,{width:i[3].width,windowSize:r}),o.jsxRuntimeExports.jsx(wn,{width:i[4].width,textColor:t.getCockpitColor("lowerLimit"),windowSize:r}),o.jsxRuntimeExports.jsx(wn,{width:i[5].width,textColor:t.getCockpitColor("upperLimit"),windowSize:r}),o.jsxRuntimeExports.jsx(wn,{width:i[6].width,textColor:t.getCockpitColor("avg2MonthExpenses"),windowSize:r}),o.jsxRuntimeExports.jsx(Sr,{width:i[7].width,windowSize:r}),o.jsxRuntimeExports.jsx(En,{width:i[8].width,windowSize:r}),o.jsxRuntimeExports.jsx(En,{width:i[9].width,windowSize:r,children:o.jsxRuntimeExports.jsx(t.LargeMedium,{children:n})})]})},yg=s.div`
2173
+ `,Sg=({companyNameSticky:e,totalMRRAmount:n})=>{const r=t.useWindowSizeContext(),i=ft;return o.jsxRuntimeExports.jsxs(yg,{className:"totalMRR",children:[o.jsxRuntimeExports.jsx(fg,{companyNameSticky:e,width:i[0].width,windowSize:r}),o.jsxRuntimeExports.jsx($n,{width:i[1].width,windowSize:r}),o.jsxRuntimeExports.jsx(Sr,{width:i[2].width,windowSize:r}),o.jsxRuntimeExports.jsx(Cg,{width:i[3].width,windowSize:r}),o.jsxRuntimeExports.jsx(En,{width:i[4].width,textColor:t.getCockpitColor("lowerLimit"),windowSize:r}),o.jsxRuntimeExports.jsx(En,{width:i[5].width,textColor:t.getCockpitColor("upperLimit"),windowSize:r}),o.jsxRuntimeExports.jsx(En,{width:i[6].width,textColor:t.getCockpitColor("avg2MonthExpenses"),windowSize:r}),o.jsxRuntimeExports.jsx(Sr,{width:i[7].width,windowSize:r}),o.jsxRuntimeExports.jsx($n,{width:i[8].width,windowSize:r}),o.jsxRuntimeExports.jsx($n,{width:i[9].width,windowSize:r,children:o.jsxRuntimeExports.jsx(t.LargeMedium,{children:n})})]})},yg=s.div`
2174
2174
  display: flex;
2175
2175
  padding: 9px ${t.Space.sp4} 9px ${t.Space.sp0};
2176
2176
  align-items: center;
@@ -2193,7 +2193,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2193
2193
  flex: 1 1 auto;
2194
2194
  gap: ${t.Space.sp3};
2195
2195
  box-sizing: border-box;
2196
- `,En=s.div`
2196
+ `,$n=s.div`
2197
2197
  width: ${e=>e.width.valuePx(e.windowSize)};
2198
2198
  `,Cg=s(t.SmallRegularUl)`
2199
2199
  width: ${e=>e.width.valuePx(e.windowSize)};
@@ -2204,10 +2204,10 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2204
2204
  width: ${e=>e.width.valuePx(e.windowSize)};
2205
2205
  display: flex;
2206
2206
  justify-content: center;
2207
- `,wn=s.div`
2207
+ `,En=s.div`
2208
2208
  width: ${e=>e.width.valuePx(e.windowSize)};
2209
2209
  color: ${e=>e.textColor.color.toString()};
2210
- `,jg={subscriptionRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{common:{headers:{comments:bg}},collaboration:{threads:{placeholder:{addANewComment:Rg,replyAComment:$g},tooltip:{resolveComment:Eg,unResolveComment:wg}}}}=t.appLocale.getLocalizedStrings(),vg=({subscriptionView:e,onColumnSortConfigChanged:n,onCollapseToggled:r,onCompanyNameClicked:i,onPassportIconClicked:a,onPlanOrAddOnClicked:d,onScroll:l,changeHandlers:c,initialOpenThreadRequest:p})=>{const m=t.useWindowSizeContext(),h=u.useRef(null),[S,x]=u.useState(null),C=u.useRef(null),[b,f]=u.useState(null),g=!(m==="small"||m==="medium-compact");u.useEffect(()=>{h.current&&h.current.resetAfterIndex(0)},[e.uiState.isCollapsedByCompanyId,e.uiState.sortKey,e.uiState.sortOrder,e.companies.length]);const{uiState:j,totalMonthlyRecurringRevenue:y}=e,$=j.scrollYOffset??0,w=u.useCallback(P=>{const W=e.companies[P].company.company.companyInfo.companyId;r(W,!e.uiState.isCollapsedByCompanyId[W])},[r,e.companies,e.uiState.isCollapsedByCompanyId]),O=u.useCallback(P=>{const W=e.companies[P].company.company.companyInfo.name.length,k=e.companies[P].company.company.companyInfo.companyId,D=qh(e.companies[P]);return e.uiState.isCollapsedByCompanyId[k]?D.height:W>zt?Ie+32:Ie},[e.companies,e.uiState.isCollapsedByCompanyId]),{setOpenThread:A,setRequestToOpenThread:v,requestToOpenThread:T,isLoading:F}=u.useContext(t.ThreadsContext);u.useEffect(()=>{p!=null&&e.fetchState==="Completed"&&F===!1&&v(p)},[p,e.fetchState,F,v]);const[I,K]=u.useState(void 0),M=u.useRef([]),Y=u.useMemo(()=>({makeCompanyNameSticky:g,uiState:j,totalMonthlyRecurringRevenue:y,onColumnSortConfigChanged:n}),[g,j,y,n]),G=u.useCallback((P,W,k)=>{const D=e.companies.findIndex(Z=>Z.company.company.companyInfo.companyId===P),z=yt.findIndex(Z=>Z.key===W);D!==-1&&z!==-1&&(M.current[D]==null?M.current[D]=[k]:M.current[D][z]=k)},[e.companies]),E=u.useCallback(()=>{C.current=null,v(null)},[v]);return u.useEffect(()=>{if(T!=null&&S!=null){const{companyId:P,entityType:W}=T,[k,D]=W.split("."),z=e.companies.findIndex(H=>H.company.company.companyInfo.companyId===P),Z=yt.findIndex(H=>H.key===D);z!==-1&&!(S.visibleStartIndex<=z&&S.visibleStopIndex>=z)&&h.current?.scrollToItem(z,"center"),setTimeout(()=>{const H=M.current[z]?.[0]?.getBoundingClientRect().bottom,L=M.current[z]?.[0]?.getBoundingClientRect().top;if(H!=null&&L!=null&&(window.innerHeight>=H&&window.innerHeight>=L||L<0)){const Q=M.current[z][Z];Q!=null&&(C.current={companyId:P,target:Q}),M.current[z][Z]?.scrollIntoView({block:"center",behavior:"auto"})}},0);const N=setInterval(()=>{const H=M.current[z]?.[Z]?.getBoundingClientRect().left,L=M.current[z]?.[Z]?.getBoundingClientRect().right,Q=M.current[z]?.[Z]?.offsetWidth;if(C.current?.companyId===P&&H!=null&&Q!=null&&L!=null&&(H<window.innerWidth-Q||L<window.innerWidth)){clearInterval(N);const se=T.threadId,X=T.onThreadShownCallback;se&&(v(null),A(T.threadId),X?.())}},500);setTimeout(()=>{clearInterval(N),v(null)},2e3)}},[T,S,A,v]),o.jsxRuntimeExports.jsx(Tg,{children:o.jsxRuntimeExports.jsxs(_i.Provider,{value:Y,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:P,width:W})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:P,innerElementType:Vi,itemCount:e.companies.length,itemSize:O,onItemsRendered:k=>x(k),itemData:{subscriptionView:e,makeCompanyNameSticky:g,addThreadRequestThreadId:I,targetElement:C.current?.target,resetTargetElementFromNavigation:E,setElementRef:G,setAddThreadRequestThreadId:K,onCompanyNameClicked:i,onPassportIconClicked:a,changeHandlers:c,setNoteData:f,onCollapseToggledHandler:w,onPlanOrAddOnClicked:d},width:W,overscanCount:Mt,ref:h,onScroll:({scrollOffset:k})=>{l(k)},initialScrollOffset:$,children:kg})}),b!=null?o.jsxRuntimeExports.jsx(Ze.RoomProvider,{id:b.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${b.companyName} ${bg}`,filter:{application:"cockpit",companyId:b.companyId,entityType:b.entityType,isGlobalComment:!1,tab:"subscription"},isLoading:!1,threadMetadata:{companyName:b.companyName,companyId:b.companyId,entityId:b.companyId,entityType:b.entityType,isGlobalComment:!1,application:"cockpit",tab:"subscription",url:window.location.href},textOverrides:{composerPlaceholder:Rg,replyComposerPlaceholder:$g,threadResolve:Eg,threadUnResolve:wg},onThreadClick:P=>null,onCloseAllThreadsDrawer:()=>f(null)})}):null]})})},_i=u.createContext(void 0),Vi=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,totalMonthlyRecurringRevenue:c,onColumnSortConfigChanged:p}=u.useContext(_i);return o.jsxRuntimeExports.jsxs(Lg,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(Wh,{companyNameSticky:d,onColumnSortConfigChanged:p,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(Ig,{children:r}),o.jsxRuntimeExports.jsx(Sg,{companyNameSticky:d,totalMRRAmount:t.amountToString("0,0",c)})]})});Vi.displayName="Subscription list view inner element type";const kg=({index:e,data:n,style:r})=>{const i=t.useWindowSizeContext(),{setNoteData:a,subscriptionView:d,makeCompanyNameSticky:l,addThreadRequestThreadId:c,targetElement:p,resetTargetElementFromNavigation:m,setElementRef:h,changeHandlers:S,onCompanyNameClicked:x,onPassportIconClicked:C,onPlanOrAddOnClicked:b,setAddThreadRequestThreadId:f,onCollapseToggledHandler:g}=n,j=d.companies[e],{companyId:y}=j.company.company.companyInfo,$=d.uiState.isCollapsedByCompanyId[y]===!0;return o.jsxRuntimeExports.jsx(Pg,{isCollapsed:$,style:{...r,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${jg.subscriptionRightPadding.valuePx(i)} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(tg,{companyView:d.companies[e],allUsers:d.zeniUsers.values,rowIndex:e,companyNameSticky:l,isCollapsed:$,onCollapseToggled:g,onCompanyNameClicked:x,onPassportIconClicked:C,onPlanOrAddOnClicked:b,changeHandlers:S,addThreadRequestThreadId:c,targetElementFromNavigation:p,resetTargetElementFromNavigation:m,setNoteData:a,setElementRef:h,setAddThreadRequestThreadId:f,totalHeight:typeof r.height=="number"?r.height:Ie})},y)},Tg=s.div`
2210
+ `,jg={subscriptionRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{common:{headers:{comments:bg}},collaboration:{threads:{placeholder:{addANewComment:Rg,replyAComment:$g},tooltip:{resolveComment:Eg,unResolveComment:wg}}}}=t.appLocale.getLocalizedStrings(),vg=({subscriptionView:e,onColumnSortConfigChanged:n,onCollapseToggled:r,onCompanyNameClicked:i,onPassportIconClicked:a,onPlanOrAddOnClicked:d,onScroll:l,changeHandlers:c,initialOpenThreadRequest:p})=>{const m=t.useWindowSizeContext(),h=u.useRef(null),[S,x]=u.useState(null),C=u.useRef(null),[b,f]=u.useState(null),g=!(m==="small"||m==="medium-compact");u.useEffect(()=>{h.current&&h.current.resetAfterIndex(0)},[e.uiState.isCollapsedByCompanyId,e.uiState.sortKey,e.uiState.sortOrder,e.companies.length]);const{uiState:j,totalMonthlyRecurringRevenue:y}=e,$=j.scrollYOffset??0,w=u.useCallback(P=>{const W=e.companies[P].company.company.companyInfo.companyId;r(W,!e.uiState.isCollapsedByCompanyId[W])},[r,e.companies,e.uiState.isCollapsedByCompanyId]),O=u.useCallback(P=>{const W=e.companies[P].company.company.companyInfo.name.length,k=e.companies[P].company.company.companyInfo.companyId,D=qh(e.companies[P]);return e.uiState.isCollapsedByCompanyId[k]?D.height:W>zt?Ie+32:Ie},[e.companies,e.uiState.isCollapsedByCompanyId]),{setOpenThread:A,setRequestToOpenThread:v,requestToOpenThread:T,isLoading:F}=u.useContext(t.ThreadsContext);u.useEffect(()=>{p!=null&&e.fetchState==="Completed"&&F===!1&&v(p)},[p,e.fetchState,F,v]);const[I,K]=u.useState(void 0),M=u.useRef([]),Y=u.useMemo(()=>({makeCompanyNameSticky:g,uiState:j,totalMonthlyRecurringRevenue:y,onColumnSortConfigChanged:n}),[g,j,y,n]),G=u.useCallback((P,W,k)=>{const D=e.companies.findIndex(Z=>Z.company.company.companyInfo.companyId===P),z=ft.findIndex(Z=>Z.key===W);D!==-1&&z!==-1&&(M.current[D]==null?M.current[D]=[k]:M.current[D][z]=k)},[e.companies]),E=u.useCallback(()=>{C.current=null,v(null)},[v]);return u.useEffect(()=>{if(T!=null&&S!=null){const{companyId:P,entityType:W}=T,[k,D]=W.split("."),z=e.companies.findIndex(H=>H.company.company.companyInfo.companyId===P),Z=ft.findIndex(H=>H.key===D);z!==-1&&!(S.visibleStartIndex<=z&&S.visibleStopIndex>=z)&&h.current?.scrollToItem(z,"center"),setTimeout(()=>{const H=M.current[z]?.[0]?.getBoundingClientRect().bottom,L=M.current[z]?.[0]?.getBoundingClientRect().top;if(H!=null&&L!=null&&(window.innerHeight>=H&&window.innerHeight>=L||L<0)){const Q=M.current[z][Z];Q!=null&&(C.current={companyId:P,target:Q}),M.current[z][Z]?.scrollIntoView({block:"center",behavior:"auto"})}},0);const N=setInterval(()=>{const H=M.current[z]?.[Z]?.getBoundingClientRect().left,L=M.current[z]?.[Z]?.getBoundingClientRect().right,Q=M.current[z]?.[Z]?.offsetWidth;if(C.current?.companyId===P&&H!=null&&Q!=null&&L!=null&&(H<window.innerWidth-Q||L<window.innerWidth)){clearInterval(N);const se=T.threadId,X=T.onThreadShownCallback;se&&(v(null),A(T.threadId),X?.())}},500);setTimeout(()=>{clearInterval(N),v(null)},2e3)}},[T,S,A,v]),o.jsxRuntimeExports.jsx(Tg,{children:o.jsxRuntimeExports.jsxs(Bi.Provider,{value:Y,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:P,width:W})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:P,innerElementType:_i,itemCount:e.companies.length,itemSize:O,onItemsRendered:k=>x(k),itemData:{subscriptionView:e,makeCompanyNameSticky:g,addThreadRequestThreadId:I,targetElement:C.current?.target,resetTargetElementFromNavigation:E,setElementRef:G,setAddThreadRequestThreadId:K,onCompanyNameClicked:i,onPassportIconClicked:a,changeHandlers:c,setNoteData:f,onCollapseToggledHandler:w,onPlanOrAddOnClicked:d},width:W,overscanCount:Mt,ref:h,onScroll:({scrollOffset:k})=>{l(k)},initialScrollOffset:$,children:kg})}),b!=null?o.jsxRuntimeExports.jsx(Ze.RoomProvider,{id:b.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${b.companyName} ${bg}`,filter:{application:"cockpit",companyId:b.companyId,entityType:b.entityType,isGlobalComment:!1,tab:"subscription"},isLoading:!1,threadMetadata:{companyName:b.companyName,companyId:b.companyId,entityId:b.companyId,entityType:b.entityType,isGlobalComment:!1,application:"cockpit",tab:"subscription",url:window.location.href},textOverrides:{composerPlaceholder:Rg,replyComposerPlaceholder:$g,threadResolve:Eg,threadUnResolve:wg},onThreadClick:P=>null,onCloseAllThreadsDrawer:()=>f(null)})}):null]})})},Bi=u.createContext(void 0),_i=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,totalMonthlyRecurringRevenue:c,onColumnSortConfigChanged:p}=u.useContext(Bi);return o.jsxRuntimeExports.jsxs(Lg,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(Wh,{companyNameSticky:d,onColumnSortConfigChanged:p,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(Ig,{children:r}),o.jsxRuntimeExports.jsx(Sg,{companyNameSticky:d,totalMRRAmount:t.amountToString("0,0",c)})]})});_i.displayName="Subscription list view inner element type";const kg=({index:e,data:n,style:r})=>{const i=t.useWindowSizeContext(),{setNoteData:a,subscriptionView:d,makeCompanyNameSticky:l,addThreadRequestThreadId:c,targetElement:p,resetTargetElementFromNavigation:m,setElementRef:h,changeHandlers:S,onCompanyNameClicked:x,onPassportIconClicked:C,onPlanOrAddOnClicked:b,setAddThreadRequestThreadId:f,onCollapseToggledHandler:g}=n,j=d.companies[e],{companyId:y}=j.company.company.companyInfo,$=d.uiState.isCollapsedByCompanyId[y]===!0;return o.jsxRuntimeExports.jsx(Pg,{isCollapsed:$,style:{...r,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${jg.subscriptionRightPadding.valuePx(i)} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(tg,{companyView:d.companies[e],allUsers:d.zeniUsers.values,rowIndex:e,companyNameSticky:l,isCollapsed:$,onCollapseToggled:g,onCompanyNameClicked:x,onPassportIconClicked:C,onPlanOrAddOnClicked:b,changeHandlers:S,addThreadRequestThreadId:c,targetElementFromNavigation:p,resetTargetElementFromNavigation:m,setNoteData:a,setElementRef:h,setAddThreadRequestThreadId:f,totalHeight:typeof r.height=="number"?r.height:Ie})},y)},Tg=s.div`
2211
2211
  /** Subtract top so list can occupy remaining available height */
2212
2212
  height: calc(100vh - 110px);
2213
2213
  max-width: 99.9%;
@@ -2238,7 +2238,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2238
2238
  height: calc(100vh - 45px);
2239
2239
  overflow-y: hidden;
2240
2240
  background-color: ${e=>e.theme.colors.grey4};
2241
- `,Wg=({headerData:e,headerActions:n,initialOpenThreadRequest:r,subscriptionPageActions:i,subscriptionPageData:a})=>{const{subscriptionView:d}=a,{onColumnSortConfigChanged:l,changeHandlers:c,onScroll:p,onCompanyNameClicked:m,onPassportIconClicked:h,onCockpitReloadData:S,onPlanOrAddOnClicked:x,onCollapseToggled:C,onFiltersChange:b}=i,f=d.uiState.filterText,g=d.uiState.filters,j=d.fetchState==="Completed"&&d.zeniUsers.fetchState==="Completed";return n.filterActions&&(n.filterActions.getCategoryWiseOptions=()=>_g(d)),o.jsxRuntimeExports.jsxs(Fg,{children:[o.jsxRuntimeExports.jsx(ht,{headerActions:{...n},headerData:{...e,filterData:{filters:g,filterText:f},companiesLoaded:j,allTabOptions:xt,selectedTabOption:"subscription"}}),o.jsxRuntimeExports.jsx(Bg,{initialOpenThreadRequest:r,isFilterApplied:g?.categories!=null,subscriptionView:d,changeHandlers:c,onClearFilter:()=>b("subscription",{}),onCockpitReloadData:S,onCollapseToggled:C,onColumnSortConfigChanged:l,onCompanyNameClicked:m,onPassportIconClicked:h,onPlanOrAddOnClicked:x,onScroll:p})]})},Bg=({subscriptionView:e,isFilterApplied:n,initialOpenThreadRequest:r,onColumnSortConfigChanged:i,onCollapseToggled:a,onCockpitReloadData:d,changeHandlers:l,onScroll:c,onPlanOrAddOnClicked:p,onCompanyNameClicked:m,onPassportIconClicked:h,onClearFilter:S})=>{const x=t.useWindowSizeContext();return e.fetchState==="Error"?o.jsxRuntimeExports.jsx(jt,{onCockpitReloadData:d,selectedCockpitOption:"subscription"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(Mg,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.companies.length===0?n?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchOnFilters,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine,filtersApplied:!0,onClearFilter:S}):o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextFirstLine,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine}):o.jsxRuntimeExports.jsx(zg,{windowSize:x,children:o.jsxRuntimeExports.jsx(Ng,{initialOpenThreadRequest:r,subscriptionView:e,changeHandlers:l,onCollapseToggled:a,onColumnSortConfigChanged:i,onCompanyNameClicked:m,onPassportIconClicked:h,onPlanOrAddOnClicked:p,onScroll:c})})},_g=e=>{const n=e.zeniUsers.values,r=ci,{companies:i}=e;return r.reduce((a,d)=>{switch(d.value){case"statusCode":return i.length===0?{...a,[d.value]:[]}:{...a,[d.value]:i[0].primarySubscription?.subscription.subscription.schema.status.map(l=>{const c=l;return{label:c.name,value:c.code}})};case"controllerUserIds":{if(i.length===0)return{...a,[d.value]:[]};const l=n.map(c=>({label:c.firstName||c.lastName?`${c.firstName} ${c.lastName}`:c.email,value:c.userId,photo:c.photo,email:c.email}));return{...a,[d.value]:l}}case"recommendedActionCode":return i.length===0?{...a,[d.value]:[]}:{...a,[d.value]:i[0].primarySubscription?.summary.schema.recommendedAction.map(l=>{const c=l;return{label:c.name,value:c.code}})};case"monthlyRecurringRevenue":return{...a,[d.value]:ps};case"subscriptionPlans":return{...a,[d.value]:e.subscriptionPlans.map(l=>({label:l.name,value:l.subscriptionPlanId}))};case"subscriptionAddOns":return{...a,[d.value]:e.subscriptionAddOns.map(l=>({label:l.name,value:l.subscriptionAddOnId}))};case"avg2MonthExpenses":return{...a,[d.value]:_a};case"slabLowerLimit":case"slabUpperLimit":return{...a,[d.value]:Va};default:return{...a,[d.value]:[]}}},{})},Vg={width:new t.ResponsiveSized(343,580,756)};function Ug({subscriptionUpdateData:e,subscriptionTermEndDate:n,isSubscriptionDetailsChanged:r,isDisabled:i,sectionId:a,style:d}){const l=t.useWindowSizeContext(),{subscriptionUpdate:{updatePlan:{applyChanges:c}},dateFormat:{visual:p}}=t.appLocale.getLocalizedStrings(),m=n?.format(p.MMMDCommaYYYYformat),h=m?`${c.nextRenewal} (${m})`:c.nextRenewal;let S=e?.applyEndOfTerm===!0?"readonly":i;return r===!1&&(S="disabled"),o.jsxRuntimeExports.jsxs(Hg,{style:d,children:[o.jsxRuntimeExports.jsx(Kg,{children:c.title}),o.jsxRuntimeExports.jsxs(Yg,{children:[o.jsxRuntimeExports.jsx(t.LabeledRadioField,{isDisabled:i,label:{label:h},style:{padding:`${t.Space.sp3} ${t.Space.sp0}`},radioField:{name:vn(a,"changeType"),id:"applyEndOfTerm",value:"applyEndOfTerm"}}),o.jsxRuntimeExports.jsx(t.LabeledRadioField,{isDisabled:r===!1?"disabled":i,label:{label:c.immediately},style:{paddingTop:t.Space.sp3},radioField:{name:vn(a,"changeType"),id:"applyImmediately",value:"applyImmediately"}}),o.jsxRuntimeExports.jsx(t.LabeledUnSafeCheckBoxField,{isDisabled:S,label:{label:c.applyProRated},checkBoxField:{name:vn(a,"shouldProrate"),defaultChecked:e?.shouldProrate===!0,style:{paddingLeft:t.Space.sp4}}}),o.jsxRuntimeExports.jsxs(Gg,{size:l,isDisabled:r===!1?"disabled":i,children:[o.jsxRuntimeExports.jsx(kn,{children:c.proRatedDescription}),o.jsxRuntimeExports.jsx(kn,{children:c.proRatedText1}),o.jsxRuntimeExports.jsx(kn,{children:c.proRatedText2})]})]})]})}const vn=(e,n)=>`${e}.${n}`,Hg=s.div`
2241
+ `,Wg=({headerData:e,headerActions:n,initialOpenThreadRequest:r,subscriptionPageActions:i,subscriptionPageData:a})=>{const{subscriptionView:d}=a,{onColumnSortConfigChanged:l,changeHandlers:c,onScroll:p,onCompanyNameClicked:m,onPassportIconClicked:h,onCockpitReloadData:S,onPlanOrAddOnClicked:x,onCollapseToggled:C,onFiltersChange:b}=i,f=d.uiState.filterText,g=d.uiState.filters,j=d.fetchState==="Completed"&&d.zeniUsers.fetchState==="Completed";return n.filterActions&&(n.filterActions.getCategoryWiseOptions=()=>_g(d)),o.jsxRuntimeExports.jsxs(Fg,{children:[o.jsxRuntimeExports.jsx(ht,{headerActions:{...n},headerData:{...e,filterData:{filters:g,filterText:f},companiesLoaded:j,allTabOptions:xt,selectedTabOption:"subscription"}}),o.jsxRuntimeExports.jsx(Bg,{initialOpenThreadRequest:r,isFilterApplied:g?.categories!=null,subscriptionView:d,changeHandlers:c,onClearFilter:()=>b("subscription",{}),onCockpitReloadData:S,onCollapseToggled:C,onColumnSortConfigChanged:l,onCompanyNameClicked:m,onPassportIconClicked:h,onPlanOrAddOnClicked:x,onScroll:p})]})},Bg=({subscriptionView:e,isFilterApplied:n,initialOpenThreadRequest:r,onColumnSortConfigChanged:i,onCollapseToggled:a,onCockpitReloadData:d,changeHandlers:l,onScroll:c,onPlanOrAddOnClicked:p,onCompanyNameClicked:m,onPassportIconClicked:h,onClearFilter:S})=>{const x=t.useWindowSizeContext();return e.fetchState==="Error"?o.jsxRuntimeExports.jsx(bt,{onCockpitReloadData:d,selectedCockpitOption:"subscription"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(Mg,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.companies.length===0?n?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchOnFilters,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine,filtersApplied:!0,onClearFilter:S}):o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextFirstLine,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine}):o.jsxRuntimeExports.jsx(zg,{windowSize:x,children:o.jsxRuntimeExports.jsx(Ng,{initialOpenThreadRequest:r,subscriptionView:e,changeHandlers:l,onCollapseToggled:a,onColumnSortConfigChanged:i,onCompanyNameClicked:m,onPassportIconClicked:h,onPlanOrAddOnClicked:p,onScroll:c})})},_g=e=>{const n=e.zeniUsers.values,r=li,{companies:i}=e;return r.reduce((a,d)=>{switch(d.value){case"statusCode":return i.length===0?{...a,[d.value]:[]}:{...a,[d.value]:i[0].primarySubscription?.subscription.subscription.schema.status.map(l=>{const c=l;return{label:c.name,value:c.code}})};case"controllerUserIds":{if(i.length===0)return{...a,[d.value]:[]};const l=n.map(c=>({label:c.firstName||c.lastName?`${c.firstName} ${c.lastName}`:c.email,value:c.userId,photo:c.photo,email:c.email}));return{...a,[d.value]:l}}case"recommendedActionCode":return i.length===0?{...a,[d.value]:[]}:{...a,[d.value]:i[0].primarySubscription?.summary.schema.recommendedAction.map(l=>{const c=l;return{label:c.name,value:c.code}})};case"monthlyRecurringRevenue":return{...a,[d.value]:ds};case"subscriptionPlans":return{...a,[d.value]:e.subscriptionPlans.map(l=>({label:l.name,value:l.subscriptionPlanId}))};case"subscriptionAddOns":return{...a,[d.value]:e.subscriptionAddOns.map(l=>({label:l.name,value:l.subscriptionAddOnId}))};case"avg2MonthExpenses":return{...a,[d.value]:_a};case"slabLowerLimit":case"slabUpperLimit":return{...a,[d.value]:Va};default:return{...a,[d.value]:[]}}},{})},Vg={width:new t.ResponsiveSized(343,580,756)};function Ug({subscriptionUpdateData:e,subscriptionTermEndDate:n,isSubscriptionDetailsChanged:r,isDisabled:i,sectionId:a,style:d}){const l=t.useWindowSizeContext(),{subscriptionUpdate:{updatePlan:{applyChanges:c}},dateFormat:{visual:p}}=t.appLocale.getLocalizedStrings(),m=n?.format(p.MMMDCommaYYYYformat),h=m?`${c.nextRenewal} (${m})`:c.nextRenewal;let S=e?.applyEndOfTerm===!0?"readonly":i;return r===!1&&(S="disabled"),o.jsxRuntimeExports.jsxs(Hg,{style:d,children:[o.jsxRuntimeExports.jsx(Kg,{children:c.title}),o.jsxRuntimeExports.jsxs(Yg,{children:[o.jsxRuntimeExports.jsx(t.LabeledRadioField,{isDisabled:i,label:{label:h},style:{padding:`${t.Space.sp3} ${t.Space.sp0}`},radioField:{name:wn(a,"changeType"),id:"applyEndOfTerm",value:"applyEndOfTerm"}}),o.jsxRuntimeExports.jsx(t.LabeledRadioField,{isDisabled:r===!1?"disabled":i,label:{label:c.immediately},style:{paddingTop:t.Space.sp3},radioField:{name:wn(a,"changeType"),id:"applyImmediately",value:"applyImmediately"}}),o.jsxRuntimeExports.jsx(t.LabeledUnSafeCheckBoxField,{isDisabled:S,label:{label:c.applyProRated},checkBoxField:{name:wn(a,"shouldProrate"),defaultChecked:e?.shouldProrate===!0,style:{paddingLeft:t.Space.sp4}}}),o.jsxRuntimeExports.jsxs(Gg,{size:l,isDisabled:r===!1?"disabled":i,children:[o.jsxRuntimeExports.jsx(vn,{children:c.proRatedDescription}),o.jsxRuntimeExports.jsx(vn,{children:c.proRatedText1}),o.jsxRuntimeExports.jsx(vn,{children:c.proRatedText2})]})]})]})}const wn=(e,n)=>`${e}.${n}`,Hg=s.div`
2242
2242
  display: flex;
2243
2243
  flex-direction: column;
2244
2244
  `,Kg=s(t.ExtraLargeMedium)`
@@ -2254,13 +2254,13 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2254
2254
  margin-top: ${t.Space.sp2};
2255
2255
  display: flex;
2256
2256
  flex-direction: column;
2257
- `,kn=s.div`
2257
+ `,vn=s.div`
2258
2258
  display: flex;
2259
2259
  padding-left: ${t.Space.sp4};
2260
2260
  `,Yg=s.div`
2261
2261
  display: flex;
2262
2262
  flex-direction: column;
2263
- `,Ui={infoLabel:new t.ResponsiveSizedStyle("smallRegular","standardRegular"),selectFieldInput:new t.ResponsiveSizedStyle("standardRegular","largeRegular")},Zg=({name:e,registerOptions:n,defaultValue:r,isDisabled:i,style:a,placeholder:d,valueToInfo:l,valueToId:c,showEmptyState:p,additionalLabelInfo:m,customStyleConfig:h,showDownChevronWithValue:S,customPlaceholderString:x,allowEmpty:C=!0,tooltip:b,menuPortal:f,disableCurrentOption:g})=>{const{control:j,formState:{errors:y,dirtyFields:$}}=o.useFormContext(),w=t.useWindowSizeContext(),O=o.useTheme(),[A,v]=u.useState(!1),T=o.has($,e),F=o.has(y,e??""),I=t.appLocale.getLocalizedStrings().dropDowns,K=u.useCallback(P=>({value:P.value,label:P.label,info:l?.(P.value)??"",id:c?.(P.value)??null,isDisabled:P.isDisabled,additionalNote:P?.additionalNote,isOptionRecommended:P.isOptionRecommended}),[l,c]),M=P=>P.map(W=>({label:W.label,options:W.options.map(k=>K(k))})),Y=P=>{if(P==null||!P)return;let W=[];return r.allOptions.forEach(k=>{W=W.concat(k.options)}),{value:P,label:W.find(k=>k.value===P)?.label??P,info:l?.(P)??""}};if(p===!0&&A===!1&&T===!1&&!r.selectedOption&&i==null)return o.jsxRuntimeExports.jsx(t.ItemWithButton,{style:a,buttonTitle:I.add,onClick:()=>v(!0),name:e});const G={...h,container:P=>({...P,width:"100%",...a}),menu:(P,W)=>({...P,backgroundColor:O.colors.grey5,borderRadius:"6px",whiteSpace:"nowrap",zIndex:2,width:"100%",margin:0,...h?.menu?.(P,W)}),menuList:(P,W)=>({...P,borderRadius:"6px",...h?.menuList?.(P,W)}),group:P=>({...P,borderBottom:`1px solid ${O.colors.grey3}`,paddingBottom:0}),control:(P,W)=>({...P,borderRadius:"6px",...h?.control?.(P,W)})},E={hasError:F,showDownChevronWithValue:S,customPlaceholderString:x};return o.jsxRuntimeExports.jsx(o.Controller,{name:e,control:j,defaultValue:r,rules:n,render:({field:{onChange:P,onBlur:W,value:k,ref:D}})=>{const z=k;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[u.createElement(o.StateManagedSelect$1,{...E,ref:D,isMulti:!1,isSearchable:!0,isClearable:!0,controlShouldRenderValue:!0,placeholder:d,value:Y(z.selectedOption),options:M(z.allOptions),onChange:Z=>{Z==null||Z?.value!=null&&z?.selectedOption===Z.value?C===!0&&P({selectedOption:void 0,allOptions:z.allOptions}):P({selectedOption:Z.value,allOptions:z.allOptions})},key:o.nanoid(),tabSelectsValue:!1,openMenuOnFocus:!0,classNamePrefix:"grouped-single-select-field",onBlur:W,menuPlacement:"auto",menuPortalTarget:f,maxMenuHeight:288,menuShouldScrollIntoView:!0,closeMenuOnSelect:!0,components:{Control:Xg,Option:n1,Input:Qg,Group:Jg,GroupHeading:e1,SingleValue:Z=>t1(Z,b),ValueContainer:qg,DropdownIndicator:E1,IndicatorSeparator:w1,Placeholder:o1,ClearIndicator:v1},hideSelectedOptions:!1,styles:G,isDisabled:i!=null,isOptionDisabled:Z=>g?.(Z.value)??!1}),o.jsxRuntimeExports.jsx(g1,{size:w,children:m})]})}})},Xg=e=>{const{menuIsOpen:n,isFocused:r,isDisabled:i,selectProps:a,data:d,options:l}=e,{value:c,hasError:p,customPlaceholderString:m}=a;let h=[];l.forEach(C=>{h=h.concat(C.options)});const S=h.find(C=>C.value===d?.value),x=t.useWindowSizeContext();return o.jsxRuntimeExports.jsx(l1,{title:m!=null&&c!=null?c.label:void 0,windowSize:x,menuIsOpen:n,isFocused:r,isDisabled:i,selectedValue:c,hasError:p,customPlaceholderString:m,isRecommended:S?.isOptionRecommended,children:o.jsxRuntimeExports.jsx(o.components.Control,{...e,className:"select-control",children:e.children})})},qg=e=>{const{selectProps:n,children:r}=e,{showDownChevronWithValue:i}=n;return o.jsxRuntimeExports.jsxs(o.components.ValueContainer,{...e,className:"select-value-container",children:[r,i===!0?o.jsxRuntimeExports.jsx(t.LargeRegular,{children:o.jsxRuntimeExports.jsx(c1,{})}):null]})},Qg=e=>{const{selectProps:n,innerRef:r,innerProps:i}=e,{placeholder:a,value:d,customPlaceholderString:l,menuIsOpen:c,onMenuOpen:p,hasError:m}=n;return l!=null&&d==null&&c===!1?o.jsxRuntimeExports.jsx(P1,{ref:r,...i,onClick:p,style:{display:"flex",width:"100%",height:"100%",alignItems:"center",justifyContent:"flex-start",cursor:"pointer"},className:"custom-placeholder",children:o.jsxRuntimeExports.jsxs(k1,{children:[o.jsxRuntimeExports.jsx(T1,{hasError:m}),o.jsxRuntimeExports.jsx(L1,{hasError:m,children:l})]})}):o.jsxRuntimeExports.jsx(o.components.Input,{...e,autoComplete:"new-password",autoFocus:c,placeholder:d==null?a:void 0,children:e.children})},Jg=e=>o.jsxRuntimeExports.jsx(o.components.Group,{...e,children:e.children}),e1=e=>{const[n,r]=u.useState(!0);return o.jsxRuntimeExports.jsx(S1,{className:"group-heading-container",isGroupOpen:n,onClick:()=>r(!n),children:o.jsxRuntimeExports.jsxs(o.components.GroupHeading,{...e,children:[o.jsxRuntimeExports.jsx(y1,{isGroupOpen:n,children:o.jsxRuntimeExports.jsx(f1,{className:"close-tick-icon"})}),e.children]})})},t1=({children:e,...n},r)=>{const i=r==null||n.selectProps.menuIsOpen===!0?e:r.sticky===!0?o.jsxRuntimeExports.jsx(s1,{title:r.text,children:e}):o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:t.Space.sp3},title:r.text,placement:"top",children:e});return o.jsxRuntimeExports.jsx(o.components.SingleValue,{title:e,...n,children:i})},o1=()=>null,n1=e=>{const{data:n,isSelected:r,options:i,isDisabled:a,isFocused:d,selectProps:l}=e,{customPlaceholderString:c}=l;let p=[];i.forEach(h=>{p=p.concat(h.options)});const m=p.find(h=>h.value===n.value);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(d1,{title:c!=null?e.label:void 0,className:"select-option-wrapper",isFocused:d,isSelected:r,isDisabled:a,isOptionRecommended:m?.isOptionRecommended===!0,showBottomBorder:m?.additionalNote==null||m?.isOptionRecommended===!1,children:o.jsxRuntimeExports.jsx(o.components.Option,{...e,className:"select-option",children:o.jsxRuntimeExports.jsxs(p1,{children:[o.jsxRuntimeExports.jsxs(h1,{isSelected:r,children:[o.jsxRuntimeExports.jsx(u1,{isSelected:r,isDisabled:a,children:e.label}),d===!0&&m?.id!=null&&o.jsxRuntimeExports.jsx($1,{children:m.id}),d===!0&&m?.info?o.jsxRuntimeExports.jsx(x1,{isSelected:!!r,children:m?.info}):null]}),m?.isOptionRecommended===!0?o.jsxRuntimeExports.jsx(R1,{}):null,r&&m?.additionalNote==null?o.jsxRuntimeExports.jsxs(C1,{children:[o.jsxRuntimeExports.jsx(j1,{className:"right-tick-icon"}),o.jsxRuntimeExports.jsx(b1,{className:"close-tick-icon"})]}):null]})})}),m?.isOptionRecommended===!0&&m.additionalNote!=null?o.jsxRuntimeExports.jsx(m1,{isSelected:r,isDisabled:a,children:m?.additionalNote}):null]})},s1=({children:e,title:n})=>o.jsxRuntimeExports.jsxs(r1,{children:[o.jsxRuntimeExports.jsxs(i1,{children:[n,o.jsxRuntimeExports.jsx(a1,{})]}),e]}),r1=s.div`
2263
+ `,Vi={infoLabel:new t.ResponsiveSizedStyle("smallRegular","standardRegular"),selectFieldInput:new t.ResponsiveSizedStyle("standardRegular","largeRegular")},Zg=({name:e,registerOptions:n,defaultValue:r,isDisabled:i,style:a,placeholder:d,valueToInfo:l,valueToId:c,showEmptyState:p,additionalLabelInfo:m,customStyleConfig:h,showDownChevronWithValue:S,customPlaceholderString:x,allowEmpty:C=!0,tooltip:b,menuPortal:f,disableCurrentOption:g})=>{const{control:j,formState:{errors:y,dirtyFields:$}}=o.useFormContext(),w=t.useWindowSizeContext(),O=o.useTheme(),[A,v]=u.useState(!1),T=o.has($,e),F=o.has(y,e??""),I=t.appLocale.getLocalizedStrings().dropDowns,K=u.useCallback(P=>({value:P.value,label:P.label,info:l?.(P.value)??"",id:c?.(P.value)??null,isDisabled:P.isDisabled,additionalNote:P?.additionalNote,isOptionRecommended:P.isOptionRecommended}),[l,c]),M=P=>P.map(W=>({label:W.label,options:W.options.map(k=>K(k))})),Y=P=>{if(P==null||!P)return;let W=[];return r.allOptions.forEach(k=>{W=W.concat(k.options)}),{value:P,label:W.find(k=>k.value===P)?.label??P,info:l?.(P)??""}};if(p===!0&&A===!1&&T===!1&&!r.selectedOption&&i==null)return o.jsxRuntimeExports.jsx(t.ItemWithButton,{style:a,buttonTitle:I.add,onClick:()=>v(!0),name:e});const G={...h,container:P=>({...P,width:"100%",...a}),menu:(P,W)=>({...P,backgroundColor:O.colors.grey5,borderRadius:"6px",whiteSpace:"nowrap",zIndex:2,width:"100%",margin:0,...h?.menu?.(P,W)}),menuList:(P,W)=>({...P,borderRadius:"6px",...h?.menuList?.(P,W)}),group:P=>({...P,borderBottom:`1px solid ${O.colors.grey3}`,paddingBottom:0}),control:(P,W)=>({...P,borderRadius:"6px",...h?.control?.(P,W)})},E={hasError:F,showDownChevronWithValue:S,customPlaceholderString:x};return o.jsxRuntimeExports.jsx(o.Controller,{name:e,control:j,defaultValue:r,rules:n,render:({field:{onChange:P,onBlur:W,value:k,ref:D}})=>{const z=k;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[u.createElement(o.StateManagedSelect$1,{...E,ref:D,isMulti:!1,isSearchable:!0,isClearable:!0,controlShouldRenderValue:!0,placeholder:d,value:Y(z.selectedOption),options:M(z.allOptions),onChange:Z=>{Z==null||Z?.value!=null&&z?.selectedOption===Z.value?C===!0&&P({selectedOption:void 0,allOptions:z.allOptions}):P({selectedOption:Z.value,allOptions:z.allOptions})},key:o.nanoid(),tabSelectsValue:!1,openMenuOnFocus:!0,classNamePrefix:"grouped-single-select-field",onBlur:W,menuPlacement:"auto",menuPortalTarget:f,maxMenuHeight:288,menuShouldScrollIntoView:!0,closeMenuOnSelect:!0,components:{Control:Xg,Option:n1,Input:Qg,Group:Jg,GroupHeading:e1,SingleValue:Z=>t1(Z,b),ValueContainer:qg,DropdownIndicator:E1,IndicatorSeparator:w1,Placeholder:o1,ClearIndicator:v1},hideSelectedOptions:!1,styles:G,isDisabled:i!=null,isOptionDisabled:Z=>g?.(Z.value)??!1}),o.jsxRuntimeExports.jsx(g1,{size:w,children:m})]})}})},Xg=e=>{const{menuIsOpen:n,isFocused:r,isDisabled:i,selectProps:a,data:d,options:l}=e,{value:c,hasError:p,customPlaceholderString:m}=a;let h=[];l.forEach(C=>{h=h.concat(C.options)});const S=h.find(C=>C.value===d?.value),x=t.useWindowSizeContext();return o.jsxRuntimeExports.jsx(l1,{title:m!=null&&c!=null?c.label:void 0,windowSize:x,menuIsOpen:n,isFocused:r,isDisabled:i,selectedValue:c,hasError:p,customPlaceholderString:m,isRecommended:S?.isOptionRecommended,children:o.jsxRuntimeExports.jsx(o.components.Control,{...e,className:"select-control",children:e.children})})},qg=e=>{const{selectProps:n,children:r}=e,{showDownChevronWithValue:i}=n;return o.jsxRuntimeExports.jsxs(o.components.ValueContainer,{...e,className:"select-value-container",children:[r,i===!0?o.jsxRuntimeExports.jsx(t.LargeRegular,{children:o.jsxRuntimeExports.jsx(c1,{})}):null]})},Qg=e=>{const{selectProps:n,innerRef:r,innerProps:i}=e,{placeholder:a,value:d,customPlaceholderString:l,menuIsOpen:c,onMenuOpen:p,hasError:m}=n;return l!=null&&d==null&&c===!1?o.jsxRuntimeExports.jsx(P1,{ref:r,...i,onClick:p,style:{display:"flex",width:"100%",height:"100%",alignItems:"center",justifyContent:"flex-start",cursor:"pointer"},className:"custom-placeholder",children:o.jsxRuntimeExports.jsxs(k1,{children:[o.jsxRuntimeExports.jsx(T1,{hasError:m}),o.jsxRuntimeExports.jsx(L1,{hasError:m,children:l})]})}):o.jsxRuntimeExports.jsx(o.components.Input,{...e,autoComplete:"new-password",autoFocus:c,placeholder:d==null?a:void 0,children:e.children})},Jg=e=>o.jsxRuntimeExports.jsx(o.components.Group,{...e,children:e.children}),e1=e=>{const[n,r]=u.useState(!0);return o.jsxRuntimeExports.jsx(S1,{className:"group-heading-container",isGroupOpen:n,onClick:()=>r(!n),children:o.jsxRuntimeExports.jsxs(o.components.GroupHeading,{...e,children:[o.jsxRuntimeExports.jsx(y1,{isGroupOpen:n,children:o.jsxRuntimeExports.jsx(f1,{className:"close-tick-icon"})}),e.children]})})},t1=({children:e,...n},r)=>{const i=r==null||n.selectProps.menuIsOpen===!0?e:r.sticky===!0?o.jsxRuntimeExports.jsx(s1,{title:r.text,children:e}):o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:t.Space.sp3},title:r.text,placement:"top",children:e});return o.jsxRuntimeExports.jsx(o.components.SingleValue,{title:e,...n,children:i})},o1=()=>null,n1=e=>{const{data:n,isSelected:r,options:i,isDisabled:a,isFocused:d,selectProps:l}=e,{customPlaceholderString:c}=l;let p=[];i.forEach(h=>{p=p.concat(h.options)});const m=p.find(h=>h.value===n.value);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(d1,{title:c!=null?e.label:void 0,className:"select-option-wrapper",isFocused:d,isSelected:r,isDisabled:a,isOptionRecommended:m?.isOptionRecommended===!0,showBottomBorder:m?.additionalNote==null||m?.isOptionRecommended===!1,children:o.jsxRuntimeExports.jsx(o.components.Option,{...e,className:"select-option",children:o.jsxRuntimeExports.jsxs(p1,{children:[o.jsxRuntimeExports.jsxs(h1,{isSelected:r,children:[o.jsxRuntimeExports.jsx(u1,{isSelected:r,isDisabled:a,children:e.label}),d===!0&&m?.id!=null&&o.jsxRuntimeExports.jsx($1,{children:m.id}),d===!0&&m?.info?o.jsxRuntimeExports.jsx(x1,{isSelected:!!r,children:m?.info}):null]}),m?.isOptionRecommended===!0?o.jsxRuntimeExports.jsx(R1,{}):null,r&&m?.additionalNote==null?o.jsxRuntimeExports.jsxs(C1,{children:[o.jsxRuntimeExports.jsx(j1,{className:"right-tick-icon"}),o.jsxRuntimeExports.jsx(b1,{className:"close-tick-icon"})]}):null]})})}),m?.isOptionRecommended===!0&&m.additionalNote!=null?o.jsxRuntimeExports.jsx(m1,{isSelected:r,isDisabled:a,children:m?.additionalNote}):null]})},s1=({children:e,title:n})=>o.jsxRuntimeExports.jsxs(r1,{children:[o.jsxRuntimeExports.jsxs(i1,{children:[n,o.jsxRuntimeExports.jsx(a1,{})]}),e]}),r1=s.div`
2264
2264
  position: relative;
2265
2265
  display: contents;
2266
2266
  `,i1=s.div`
@@ -2316,7 +2316,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2316
2316
  .grouped-single-select-field__single-value {
2317
2317
  display: flex;
2318
2318
  color: ${e=>e.hasError?t.Colors.important:e.theme.colors.primary};
2319
- ${e=>`${Ui.selectFieldInput.style(e.windowSize)}`};
2319
+ ${e=>`${Vi.selectFieldInput.style(e.windowSize)}`};
2320
2320
  overflow: hidden;
2321
2321
  text-overflow: ellipsis;
2322
2322
  white-space: nowrap;
@@ -2422,7 +2422,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2422
2422
  `,g1=s.label`
2423
2423
  color: ${e=>e.theme.colors.grey1};
2424
2424
  width: 100%;
2425
- ${e=>`${Ui.infoLabel.style(e.size)}`};
2425
+ ${e=>`${Vi.infoLabel.style(e.size)}`};
2426
2426
  padding-right: ${t.Space.sp3};
2427
2427
  text-align: right;
2428
2428
  white-space: pre-line;
@@ -2495,7 +2495,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2495
2495
  color: ${e=>e.hasError?t.Colors.important:e.theme.colors.grey1};
2496
2496
  `,L1=s(t.LargeRegular)`
2497
2497
  color: ${e=>e.hasError?t.Colors.important:e.theme.colors.grey1};
2498
- `,P1=s.div``,ut={width:new t.ResponsiveSized(343,580,756),height:new t.ResponsiveSized(t.sp[6],t.sp[6]),controlHeight:new t.ResponsiveSized(t.sp[6],t.sp[6]),paddingTopBottom:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginTop:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginBottom:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginRight:new t.ResponsiveSized(t.sp[2],t.sp[2]),paddingRight:new t.ResponsiveSized(t.sp[0],t.sp[2]),labelMarginLeft:new t.ResponsiveSized(t.sp[3],t.sp[4]),labelMarginRight:new t.ResponsiveSized(t.sp[4],t.sp[4]),labelMarginTop:new t.ResponsiveSized(t.sp[2],t.sp[2])},I1={infoLabel:new t.ResponsiveSizedStyle("smallRegular","standardRegular")};function Hi({isDisabled:e,label:n,hideLabel:r=!1,groupedSingleSelectField:i,style:a,controlWidth:d,additionalLabelInfo:l,valueToAdditionalLabel:c,disableCurrentOption:p,fullWidthSelect:m=!0}){const h=t.useWindowSizeContext(),{formState:{errors:S}}=o.useFormContext(),x=o.has(S,i.name);return o.jsxRuntimeExports.jsxs(D1,{size:h,style:a,isDisabled:e!=null,controlWidth:d,isError:x,children:[!r&&o.jsxRuntimeExports.jsx(t.Label,{isDisabled:e,label:n.label,htmlFor:i.name,style:{marginLeft:ut.labelMarginLeft.value(h),marginRight:ut.labelMarginRight.value(h),marginTop:ut.labelMarginTop.value(h),width:n.width??"auto"}}),o.jsxRuntimeExports.jsxs(A1,{fullWidthSelect:m,labelWidth:n.width,children:[o.jsxRuntimeExports.jsx(Zg,{...i,isDisabled:e,style:{display:"flex",flexGrow:1,width:"-webkit-fill-available",height:ut.controlHeight.value(h),cursor:"inherit"},additionalLabelInfo:l,disableCurrentOption:p}),i.defaultValue.selectedOption!=null?o.jsxRuntimeExports.jsx(O1,{size:h,isError:x,children:c?.(i.defaultValue.selectedOption)}):null]})]})}const D1=s.div`
2498
+ `,P1=s.div``,ut={width:new t.ResponsiveSized(343,580,756),height:new t.ResponsiveSized(t.sp[6],t.sp[6]),controlHeight:new t.ResponsiveSized(t.sp[6],t.sp[6]),paddingTopBottom:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginTop:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginBottom:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginRight:new t.ResponsiveSized(t.sp[2],t.sp[2]),paddingRight:new t.ResponsiveSized(t.sp[0],t.sp[2]),labelMarginLeft:new t.ResponsiveSized(t.sp[3],t.sp[4]),labelMarginRight:new t.ResponsiveSized(t.sp[4],t.sp[4]),labelMarginTop:new t.ResponsiveSized(t.sp[2],t.sp[2])},I1={infoLabel:new t.ResponsiveSizedStyle("smallRegular","standardRegular")};function Ui({isDisabled:e,label:n,hideLabel:r=!1,groupedSingleSelectField:i,style:a,controlWidth:d,additionalLabelInfo:l,valueToAdditionalLabel:c,disableCurrentOption:p,fullWidthSelect:m=!0}){const h=t.useWindowSizeContext(),{formState:{errors:S}}=o.useFormContext(),x=o.has(S,i.name);return o.jsxRuntimeExports.jsxs(D1,{size:h,style:a,isDisabled:e!=null,controlWidth:d,isError:x,children:[!r&&o.jsxRuntimeExports.jsx(t.Label,{isDisabled:e,label:n.label,htmlFor:i.name,style:{marginLeft:ut.labelMarginLeft.value(h),marginRight:ut.labelMarginRight.value(h),marginTop:ut.labelMarginTop.value(h),width:n.width??"auto"}}),o.jsxRuntimeExports.jsxs(A1,{fullWidthSelect:m,labelWidth:n.width,children:[o.jsxRuntimeExports.jsx(Zg,{...i,isDisabled:e,style:{display:"flex",flexGrow:1,width:"-webkit-fill-available",height:ut.controlHeight.value(h),cursor:"inherit"},additionalLabelInfo:l,disableCurrentOption:p}),i.defaultValue.selectedOption!=null?o.jsxRuntimeExports.jsx(O1,{size:h,isError:x,children:c?.(i.defaultValue.selectedOption)}):null]})]})}const D1=s.div`
2499
2499
  display: flex;
2500
2500
  flex-direction: row;
2501
2501
  align-items: flex-start;
@@ -2546,7 +2546,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2546
2546
  ${e=>`${I1.infoLabel.style(e.size)}`};
2547
2547
  padding-right: ${t.Space.sp3};
2548
2548
  text-align: right;
2549
- `,ot={width:new t.ResponsiveSized(343,580,756),height:new t.ResponsiveSized(t.sp[6],t.sp[6]),controlHeight:new t.ResponsiveSized(t.sp[6],t.sp[6]),paddingTopBottom:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginTop:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginBottom:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginRight:new t.ResponsiveSized(t.sp[2],t.sp[2]),labelMarginLeft:new t.ResponsiveSized(t.sp[3],t.sp[4]),labelMarginRight:new t.ResponsiveSized(t.sp[4],t.sp[4]),labelMarginTop:new t.ResponsiveSized(t.sp[2],t.sp[2])},N1={infoLabel:new t.ResponsiveSizedStyle("smallRegular","standardRegular")};function Ki({isDisabled:e,label:n,singleSelectPickerField:r,allOptions:i,defaultValues:a,valueToAdditionalLabel:d,style:l}){const c=t.useWindowSizeContext(),{formState:{errors:p},control:m}=o.useFormContext(),{fields:h,replace:S}=o.useFieldArray({control:m,name:r.name}),x=o.has(p,r.name);return u.useEffect(()=>{const C=h.map(b=>b.selectedOption);if(!o.isEqual(C,a)){const b=a.map(f=>({selectedOption:f,allOptions:Tn(i,a,f)}));S(b)}},[i,a,h,S]),o.jsxRuntimeExports.jsxs(z1,{size:c,style:l,isDisabled:e!=null,children:[o.jsxRuntimeExports.jsx(t.Label,{isDisabled:e,label:n.label,htmlFor:r.name,style:{marginLeft:ot.labelMarginLeft.value(c),marginRight:ot.labelMarginRight.value(c),marginTop:ot.labelMarginTop.value(c),width:n.width??"auto"}}),o.jsxRuntimeExports.jsxs(F1,{size:c,labelWidth:n.width,children:[h.map((C,b)=>{const f=a[b];return o.jsxRuntimeExports.jsxs(yr,{children:[u.createElement(t.SingleSelectPickerField,{...r,name:`${r.name}.${b}`,key:C.id,defaultValue:{selectedOption:f,allOptions:Tn(i,a,f)},isDisabled:e,style:{display:"flex",flexGrow:1,width:"-webkit-fill-available",height:ot.controlHeight.value(c),cursor:"inherit"}}),f!=null?o.jsxRuntimeExports.jsx(W1,{size:c,isError:x,children:d?.(f)}):null]},`${r.name}.${b}`)}),e==null?o.jsxRuntimeExports.jsx(yr,{children:o.jsxRuntimeExports.jsx(t.SingleSelectPickerField,{...r,showEmptyState:h.length!==0,name:`${r.name}.${a.length}`,defaultValue:{selectedOption:void 0,allOptions:Tn(i,a)},isDisabled:e,style:{display:"flex",flexGrow:1,width:"-webkit-fill-available",height:ot.controlHeight.value(c),cursor:"inherit"}})},`${r.name}.${a.length}`):o.jsxRuntimeExports.jsx(M1,{numberOfFields:h.length,placeholder:r.placeholder})]})]})}const M1=({numberOfFields:e,placeholder:n})=>{const r=t.useWindowSizeContext();return e>0||n==null?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{}):o.jsxRuntimeExports.jsx(B1,{size:r,children:n})},z1=s.div`
2549
+ `,ot={width:new t.ResponsiveSized(343,580,756),height:new t.ResponsiveSized(t.sp[6],t.sp[6]),controlHeight:new t.ResponsiveSized(t.sp[6],t.sp[6]),paddingTopBottom:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginTop:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginBottom:new t.ResponsiveSized(t.sp[2],t.sp[2]),marginRight:new t.ResponsiveSized(t.sp[2],t.sp[2]),labelMarginLeft:new t.ResponsiveSized(t.sp[3],t.sp[4]),labelMarginRight:new t.ResponsiveSized(t.sp[4],t.sp[4]),labelMarginTop:new t.ResponsiveSized(t.sp[2],t.sp[2])},N1={infoLabel:new t.ResponsiveSizedStyle("smallRegular","standardRegular")};function Hi({isDisabled:e,label:n,singleSelectPickerField:r,allOptions:i,defaultValues:a,valueToAdditionalLabel:d,style:l}){const c=t.useWindowSizeContext(),{formState:{errors:p},control:m}=o.useFormContext(),{fields:h,replace:S}=o.useFieldArray({control:m,name:r.name}),x=o.has(p,r.name);return u.useEffect(()=>{const C=h.map(b=>b.selectedOption);if(!o.isEqual(C,a)){const b=a.map(f=>({selectedOption:f,allOptions:kn(i,a,f)}));S(b)}},[i,a,h,S]),o.jsxRuntimeExports.jsxs(z1,{size:c,style:l,isDisabled:e!=null,children:[o.jsxRuntimeExports.jsx(t.Label,{isDisabled:e,label:n.label,htmlFor:r.name,style:{marginLeft:ot.labelMarginLeft.value(c),marginRight:ot.labelMarginRight.value(c),marginTop:ot.labelMarginTop.value(c),width:n.width??"auto"}}),o.jsxRuntimeExports.jsxs(F1,{size:c,labelWidth:n.width,children:[h.map((C,b)=>{const f=a[b];return o.jsxRuntimeExports.jsxs(yr,{children:[u.createElement(t.SingleSelectPickerField,{...r,name:`${r.name}.${b}`,key:C.id,defaultValue:{selectedOption:f,allOptions:kn(i,a,f)},isDisabled:e,style:{display:"flex",flexGrow:1,width:"-webkit-fill-available",height:ot.controlHeight.value(c),cursor:"inherit"}}),f!=null?o.jsxRuntimeExports.jsx(W1,{size:c,isError:x,children:d?.(f)}):null]},`${r.name}.${b}`)}),e==null?o.jsxRuntimeExports.jsx(yr,{children:o.jsxRuntimeExports.jsx(t.SingleSelectPickerField,{...r,showEmptyState:h.length!==0,name:`${r.name}.${a.length}`,defaultValue:{selectedOption:void 0,allOptions:kn(i,a)},isDisabled:e,style:{display:"flex",flexGrow:1,width:"-webkit-fill-available",height:ot.controlHeight.value(c),cursor:"inherit"}})},`${r.name}.${a.length}`):o.jsxRuntimeExports.jsx(M1,{numberOfFields:h.length,placeholder:r.placeholder})]})]})}const M1=({numberOfFields:e,placeholder:n})=>{const r=t.useWindowSizeContext();return e>0||n==null?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{}):o.jsxRuntimeExports.jsx(B1,{size:r,children:n})},z1=s.div`
2550
2550
  display: flex;
2551
2551
  flex-direction: row;
2552
2552
  align-items: flex-start;
@@ -2605,7 +2605,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2605
2605
  justify-content: flex-end;
2606
2606
  align-items: center;
2607
2607
  user-select: none;
2608
- `,Tn=(e,n,r)=>e.map(i=>({...i,isDisabled:i.value!==r&&n.includes(i.value)})),Ln={labelWidth:new t.ResponsiveSized(115,145,155),mediumLabelWidth:new t.ResponsiveSized(140,160,170),largeLabelWidth:new t.ResponsiveSized(160,210,210),paddingBottom:new t.ResponsiveSized(t.sp[3],t.sp[2])};function _1({sectionId:e,isDisabled:n,subscriptionUpdateData:r,subscriptionMetaDetails:i,recommendedSubscriptionPlanId:a,style:d}){const l=t.useWindowSizeContext(),c=t.appLocale.getLocalizedStrings().subscriptionUpdate,{dropDowns:p}=t.appLocale.getLocalizedStrings(),{labels:m,placeholders:h}=c.dropDowns,S=Ln.labelWidth.value(l),x=Ln.mediumLabelWidth.value(l),C=Ln.largeLabelWidth.value(l),{plans:b,addOns:f,coupons:g}=i;return o.jsxRuntimeExports.jsx(V1,{style:d,children:o.jsxRuntimeExports.jsxs(U1,{children:[o.jsxRuntimeExports.jsx(Hi,{label:{label:m.planName,width:x},isDisabled:n,groupedSingleSelectField:{name:Pn(e,"subscriptionPlan"),placeholder:h.selectPlan,valueToInfo:j=>{const y=b.find($=>$.subscriptionPlanId===j);return t.amountToString("0,0.00",y?.price)},defaultValue:{selectedOption:r?.subscriptionPlanId,allOptions:Qt(b,a)},registerOptions:{required:!0,validate:j=>j!=null&&j.selectedOption!=null||n!=null}},valueToAdditionalLabel:j=>{const y=b.find($=>$.subscriptionPlanId===j);return nn(y?.price,y?.period)??""}}),o.jsxRuntimeExports.jsx(In,{}),o.jsxRuntimeExports.jsx(Ki,{label:{label:m.recurringAddOns,width:S},isDisabled:n,singleSelectPickerField:{name:Pn(e,"recurringAddOns"),placeholder:h.selectAddOn,valueToInfo:j=>{const y=f.find($=>$.subscriptionAddOnId===j);return t.amountToString("0,0.00",y?.price)}},valueToAdditionalLabel:j=>{const y=f.find($=>$.subscriptionAddOnId===j);return nn(y?.price,y?.period)??""},defaultValues:r?.subscriptionAddOnIds??[],allOptions:f.map(j=>({label:j.name,value:j.subscriptionAddOnId}))}),o.jsxRuntimeExports.jsx(In,{}),o.jsxRuntimeExports.jsx(t.LabeledItemWithButton,{isDisabled:"readonly",label:{label:m.nonRecurringAddOns,width:C},style:{opacity:.32},button:{buttonTitle:p.add,style:{pointerEvents:"none"}}}),o.jsxRuntimeExports.jsx(In,{}),o.jsxRuntimeExports.jsx(t.LabeledSingleSelectPickerField,{isDisabled:n,label:{label:m.coupon,width:S},singleSelectPickerField:{name:Pn(e,"coupon"),placeholder:h.selectCoupon,defaultValue:{selectedOption:r?.subscriptionCouponIds[0],allOptions:g.map(j=>({label:j.name,value:j.subscriptionCouponId}))}}})]})})}const Pn=(e,n)=>`${e}.${n}`,V1=s.div`
2608
+ `,kn=(e,n,r)=>e.map(i=>({...i,isDisabled:i.value!==r&&n.includes(i.value)})),Tn={labelWidth:new t.ResponsiveSized(115,145,155),mediumLabelWidth:new t.ResponsiveSized(140,160,170),largeLabelWidth:new t.ResponsiveSized(160,210,210),paddingBottom:new t.ResponsiveSized(t.sp[3],t.sp[2])};function _1({sectionId:e,isDisabled:n,subscriptionUpdateData:r,subscriptionMetaDetails:i,recommendedSubscriptionPlanId:a,style:d}){const l=t.useWindowSizeContext(),c=t.appLocale.getLocalizedStrings().subscriptionUpdate,{dropDowns:p}=t.appLocale.getLocalizedStrings(),{labels:m,placeholders:h}=c.dropDowns,S=Tn.labelWidth.value(l),x=Tn.mediumLabelWidth.value(l),C=Tn.largeLabelWidth.value(l),{plans:b,addOns:f,coupons:g}=i;return o.jsxRuntimeExports.jsx(V1,{style:d,children:o.jsxRuntimeExports.jsxs(U1,{children:[o.jsxRuntimeExports.jsx(Ui,{label:{label:m.planName,width:x},isDisabled:n,groupedSingleSelectField:{name:Ln(e,"subscriptionPlan"),placeholder:h.selectPlan,valueToInfo:j=>{const y=b.find($=>$.subscriptionPlanId===j);return t.amountToString("0,0.00",y?.price)},defaultValue:{selectedOption:r?.subscriptionPlanId,allOptions:Qt(b,a)},registerOptions:{required:!0,validate:j=>j!=null&&j.selectedOption!=null||n!=null}},valueToAdditionalLabel:j=>{const y=b.find($=>$.subscriptionPlanId===j);return nn(y?.price,y?.period)??""}}),o.jsxRuntimeExports.jsx(Pn,{}),o.jsxRuntimeExports.jsx(Hi,{label:{label:m.recurringAddOns,width:S},isDisabled:n,singleSelectPickerField:{name:Ln(e,"recurringAddOns"),placeholder:h.selectAddOn,valueToInfo:j=>{const y=f.find($=>$.subscriptionAddOnId===j);return t.amountToString("0,0.00",y?.price)}},valueToAdditionalLabel:j=>{const y=f.find($=>$.subscriptionAddOnId===j);return nn(y?.price,y?.period)??""},defaultValues:r?.subscriptionAddOnIds??[],allOptions:f.map(j=>({label:j.name,value:j.subscriptionAddOnId}))}),o.jsxRuntimeExports.jsx(Pn,{}),o.jsxRuntimeExports.jsx(t.LabeledItemWithButton,{isDisabled:"readonly",label:{label:m.nonRecurringAddOns,width:C},style:{opacity:.32},button:{buttonTitle:p.add,style:{pointerEvents:"none"}}}),o.jsxRuntimeExports.jsx(Pn,{}),o.jsxRuntimeExports.jsx(t.LabeledSingleSelectPickerField,{isDisabled:n,label:{label:m.coupon,width:S},singleSelectPickerField:{name:Ln(e,"coupon"),placeholder:h.selectCoupon,defaultValue:{selectedOption:r?.subscriptionCouponIds[0],allOptions:g.map(j=>({label:j.name,value:j.subscriptionCouponId}))}}})]})})}const Ln=(e,n)=>`${e}.${n}`,V1=s.div`
2609
2609
  display: flex;
2610
2610
  flex-direction: column;
2611
2611
  padding-top: ${t.Space.sp3};
@@ -2617,13 +2617,13 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2617
2617
  border: 1px solid ${e=>e.theme.colors.grey3};
2618
2618
  box-shadow: ${e=>`${t.Space.sp0} 2px ${t.Space.sp1} ${e.theme.colors.dropShadowNormal}`};
2619
2619
  border-radius: ${t.Space.sp2};
2620
- `,In=s.div`
2620
+ `,Pn=s.div`
2621
2621
  display: flex;
2622
2622
  flex: 1;
2623
2623
  background-color: ${e=>e.theme.colors.grey3};
2624
2624
  min-height: 1px;
2625
2625
  max-height: 1px;
2626
- `,Qt=(e,n)=>{const r=t.appLocale.getLocalizedStrings().subscriptionUpdate,{groups:i}=r.dropDowns,a=[];return n!=null&&a.push({label:i.recommendedPlan,options:e.filter(d=>d.subscriptionPlanId===n).map(d=>({label:d.name,value:d.subscriptionPlanId}))}),a.push({label:i.allPlans,options:e.filter(d=>d.subscriptionPlanId!==n).map(d=>({label:d.name,value:d.subscriptionPlanId}))}),a},nn=(e,n)=>e==null?void 0:`${(t.amountToString("0,0.00",e)+" "+H1(n)).trim()}`,H1=e=>{if(e==null)return"";const{count:n,unit:r}=e;return n===1?`/ ${r.substring(0,1).toUpperCase().concat(r.substring(1))}`:`/ ${r.substring(0,1).toUpperCase().concat(r.substring(1))} x ${n}`},fr="subscriptionUpdatePlanPage",sn="updatePlan",Pt="applyChanges";function K1(e){const n=t.useWindowSizeContext(),r=o.useTheme(),{localData:i,isDisabled:a,onSubscriptionDetailsChanged:d,onEstimateSuccess:l,onReviewClick:c,onBackClick:p,onResetClick:m}=e,[h,S]=u.useState(void 0),x=u.useRef(null),{data:C,subscriptionDetail:b,fetchState:f,estimateStatus:g}=i,j=t.usePrevious(g.fetchState),y=t.usePrevious(f),$=o.useForm({mode:"all",reValidateMode:"onChange",defaultValues:u.useMemo(()=>jr(i),[i])});u.useEffect(()=>()=>{S(void 0)},[]),u.useEffect(()=>{y==="In-Progress"&&f==="Completed"&&$.reset(jr(i))},[y,f,$,i]),u.useEffect(()=>{j==="In-Progress"&&(g.fetchState==="Error"?h!==g.fetchState&&S(g.fetchState):g.fetchState==="Completed"&&(S(void 0),l()))},[h,j,g.fetchState,l]);const w=async(E,P)=>{if(E.includes(sn)||E.includes(Pt)){if(E.includes(Pt)){const{applyChanges:W}=P,{changeType:k,shouldProrate:D}=W;k==="applyImmediately"&&C?.applyEndOfTerm===!0&&D===!1?$.setValue(Pt,{...W,shouldProrate:!0},{shouldDirty:!0}):k==="applyEndOfTerm"&&C?.applyEndOfTerm===!1&&D===!0&&$.setValue(Pt,{...W,shouldProrate:!1},{shouldDirty:!0})}d(P)}};u.useEffect(()=>{const E=$.watch((P,{name:W})=>{W!=null&&P!=null&&o.defer(()=>w(W,P))});return()=>{E.unsubscribe()}});const O=$.handleSubmit(E=>{h!=null&&S(void 0),c()}),A=()=>M?.status.code!=="future"?o.jsxRuntimeExports.jsx(Ug,{sectionId:Pt,style:{paddingBottom:t.Space.sp9},subscriptionUpdateData:C,subscriptionTermEndDate:M?.currentTerm?.end,isSubscriptionDetailsChanged:Gi(i),isDisabled:a}):null,{updatePlan:v,snackBar:T,footer:F}=t.appLocale.getLocalizedStrings().subscriptionUpdate,{title:I}=v,K=b?.summary?.summary,M=b?.subscription.subscription,Y=b?.plan?.plan.subscriptionPlanId,G=K?.recommendedSubscriptionPlanId!=null&&Y===K?.primarySubscriptionPlanId?K?.recommendedSubscriptionPlanId:void 0;return o.jsxRuntimeExports.jsxs(G1,{children:[o.jsxRuntimeExports.jsx(t.NavBar,{title:I,backgroundColor:r.colors.grey4,style:{zIndex:3},onBackClick:p,scrollableContent:x,source:"SubscriptionUpdatePlanPage"}),h!=null?o.jsxRuntimeExports.jsx(t.SubscriptionSnackBar,{fetchState:h,customMessageText:g.error?.message??T.failedText,onRemoveSnackbar:()=>S(void 0)}):null,o.jsxRuntimeExports.jsx(Z1,{ref:x,windowSize:n,children:f==="In-Progress"||f==="Not-Started"?o.jsxRuntimeExports.jsx(Y1,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Large",start:!0})}):o.jsxRuntimeExports.jsx(o.FormProvider,{...$,children:o.jsxRuntimeExports.jsxs("form",{id:Cr(fr),onSubmit:O,children:[o.jsxRuntimeExports.jsx(_1,{sectionId:sn,subscriptionUpdateData:C,recommendedSubscriptionPlanId:G,subscriptionMetaDetails:Jt(i),isDisabled:a}),o.jsxRuntimeExports.jsx(A,{})]})})}),t.formHasDirtyFields($.formState.dirtyFields)||X1(i)?o.jsxRuntimeExports.jsx(t.Footer,{formId:Cr(fr),primaryBtn:{label:F.review,isLoading:g.fetchState==="In-Progress",isDisabled:e.isDisabled!=null&&g.fetchState!=="In-Progress"},cancelBtn:{label:F.cancel,shouldResetOnCancel:!0,onClick:()=>{$.reset(q1(i)),b!=null&&m(b)}}}):null]})}const G1=s.div`
2626
+ `,Qt=(e,n)=>{const r=t.appLocale.getLocalizedStrings().subscriptionUpdate,{groups:i}=r.dropDowns,a=[];return n!=null&&a.push({label:i.recommendedPlan,options:e.filter(d=>d.subscriptionPlanId===n).map(d=>({label:d.name,value:d.subscriptionPlanId}))}),a.push({label:i.allPlans,options:e.filter(d=>d.subscriptionPlanId!==n).map(d=>({label:d.name,value:d.subscriptionPlanId}))}),a},nn=(e,n)=>e==null?void 0:`${(t.amountToString("0,0.00",e)+" "+H1(n)).trim()}`,H1=e=>{if(e==null)return"";const{count:n,unit:r}=e;return n===1?`/ ${r.substring(0,1).toUpperCase().concat(r.substring(1))}`:`/ ${r.substring(0,1).toUpperCase().concat(r.substring(1))} x ${n}`},fr="subscriptionUpdatePlanPage",sn="updatePlan",Pt="applyChanges";function K1(e){const n=t.useWindowSizeContext(),r=o.useTheme(),{localData:i,isDisabled:a,onSubscriptionDetailsChanged:d,onEstimateSuccess:l,onReviewClick:c,onBackClick:p,onResetClick:m}=e,[h,S]=u.useState(void 0),x=u.useRef(null),{data:C,subscriptionDetail:b,fetchState:f,estimateStatus:g}=i,j=t.usePrevious(g.fetchState),y=t.usePrevious(f),$=o.useForm({mode:"all",reValidateMode:"onChange",defaultValues:u.useMemo(()=>jr(i),[i])});u.useEffect(()=>()=>{S(void 0)},[]),u.useEffect(()=>{y==="In-Progress"&&f==="Completed"&&$.reset(jr(i))},[y,f,$,i]),u.useEffect(()=>{j==="In-Progress"&&(g.fetchState==="Error"?h!==g.fetchState&&S(g.fetchState):g.fetchState==="Completed"&&(S(void 0),l()))},[h,j,g.fetchState,l]);const w=async(E,P)=>{if(E.includes(sn)||E.includes(Pt)){if(E.includes(Pt)){const{applyChanges:W}=P,{changeType:k,shouldProrate:D}=W;k==="applyImmediately"&&C?.applyEndOfTerm===!0&&D===!1?$.setValue(Pt,{...W,shouldProrate:!0},{shouldDirty:!0}):k==="applyEndOfTerm"&&C?.applyEndOfTerm===!1&&D===!0&&$.setValue(Pt,{...W,shouldProrate:!1},{shouldDirty:!0})}d(P)}};u.useEffect(()=>{const E=$.watch((P,{name:W})=>{W!=null&&P!=null&&o.defer(()=>w(W,P))});return()=>{E.unsubscribe()}});const O=$.handleSubmit(E=>{h!=null&&S(void 0),c()}),A=()=>M?.status.code!=="future"?o.jsxRuntimeExports.jsx(Ug,{sectionId:Pt,style:{paddingBottom:t.Space.sp9},subscriptionUpdateData:C,subscriptionTermEndDate:M?.currentTerm?.end,isSubscriptionDetailsChanged:Ki(i),isDisabled:a}):null,{updatePlan:v,snackBar:T,footer:F}=t.appLocale.getLocalizedStrings().subscriptionUpdate,{title:I}=v,K=b?.summary?.summary,M=b?.subscription.subscription,Y=b?.plan?.plan.subscriptionPlanId,G=K?.recommendedSubscriptionPlanId!=null&&Y===K?.primarySubscriptionPlanId?K?.recommendedSubscriptionPlanId:void 0;return o.jsxRuntimeExports.jsxs(G1,{children:[o.jsxRuntimeExports.jsx(t.NavBar,{title:I,backgroundColor:r.colors.grey4,style:{zIndex:3},onBackClick:p,scrollableContent:x,source:"SubscriptionUpdatePlanPage"}),h!=null?o.jsxRuntimeExports.jsx(t.SubscriptionSnackBar,{fetchState:h,customMessageText:g.error?.message??T.failedText,onRemoveSnackbar:()=>S(void 0)}):null,o.jsxRuntimeExports.jsx(Z1,{ref:x,windowSize:n,children:f==="In-Progress"||f==="Not-Started"?o.jsxRuntimeExports.jsx(Y1,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Large",start:!0})}):o.jsxRuntimeExports.jsx(o.FormProvider,{...$,children:o.jsxRuntimeExports.jsxs("form",{id:Cr(fr),onSubmit:O,children:[o.jsxRuntimeExports.jsx(_1,{sectionId:sn,subscriptionUpdateData:C,recommendedSubscriptionPlanId:G,subscriptionMetaDetails:Jt(i),isDisabled:a}),o.jsxRuntimeExports.jsx(A,{})]})})}),t.formHasDirtyFields($.formState.dirtyFields)||X1(i)?o.jsxRuntimeExports.jsx(t.Footer,{formId:Cr(fr),primaryBtn:{label:F.review,isLoading:g.fetchState==="In-Progress",isDisabled:e.isDisabled!=null&&g.fetchState!=="In-Progress"},cancelBtn:{label:F.cancel,shouldResetOnCancel:!0,onClick:()=>{$.reset(q1(i)),b!=null&&m(b)}}}):null]})}const G1=s.div`
2627
2627
  display: flex;
2628
2628
  min-height: 100%;
2629
2629
  flex-direction: column;
@@ -2644,7 +2644,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2644
2644
  justify-content: center;
2645
2645
  height: 100%;
2646
2646
  overflow-y: auto;
2647
- `,Cr=e=>`${e}_form`,jr=e=>{const{data:n,subscriptionDetail:r}=e,i=r?.summary?.summary,a=r?.subscription.subscription.subscriptionPlanId,{plans:d,addOns:l,coupons:c}=Jt(e),p=i?.recommendedSubscriptionPlanId!=null&&a===i?.primarySubscriptionPlanId?i?.recommendedSubscriptionPlanId:void 0;return{[sn]:{subscriptionPlan:{selectedOption:n?.subscriptionPlanId,allOptions:Qt(d,p)},recurringAddOns:dn(l,n?.subscriptionAddOnIds),coupon:{selectedOption:n?.subscriptionCouponIds[0],allOptions:c.map(m=>({label:m.name,value:m.subscriptionCouponId}))}},[Pt]:{changeType:n?.applyEndOfTerm===!0?"applyEndOfTerm":"applyImmediately",shouldProrate:n?.shouldProrate===!0}}},dn=(e,n)=>n?.map(r=>{const i=e.map(a=>({label:a.name,value:a.subscriptionAddOnId,isDisabled:a.subscriptionAddOnId!==r&&n?.includes(a.subscriptionAddOnId)}));return{selectedOption:r,allOptions:i}})??[],Jt=e=>{const{subscriptionMetaDetails:n}=e,r=n.plans.filter(d=>d.plan.statusCode==="active").map(d=>d.plan),i=n.addOns.filter(d=>d.addOn.statusCode==="active"&&d.addOn.chargeType==="recurring").map(d=>d.addOn),a=n.coupons.filter(d=>d.coupon.statusCode==="active").map(d=>d.coupon);return{plans:r,addOns:i,coupons:a}},X1=e=>{const{data:n,subscriptionDetail:r}=e;if(n==null||r==null)return!1;const i=r.subscription.subscription.status.code;return[Gi(e),!o.isEqual(n.applyEndOfTerm,i!=="future"),!o.isEqual(n.shouldProrate,i==="future"),!o.isEqual(n.invoiceImmediately,!0)].reduce((a,d)=>a||d,!1)},Gi=e=>{const{data:n,subscriptionDetail:r}=e;return n==null||r==null?!1:[!o.isEqual(n.subscriptionPlanId,r.plan?.plan.subscriptionPlanId),!o.isEqual(n.subscriptionAddOnIds,r.addOns?.map(i=>i.addOn.subscriptionAddOnId)),!o.isEqual(n.subscriptionCouponIds,r.coupons?.map(i=>i.coupon.subscriptionCouponId))].reduce((i,a)=>i||a,!1)},q1=e=>{const{subscriptionDetail:n}=e,r=n?.subscription.subscription.status.code,i=n?.summary?.summary,a=n?.subscription.subscription.subscriptionPlanId,{plans:d,addOns:l,coupons:c}=Jt(e),p=i?.recommendedSubscriptionPlanId!=null&&a===i?.primarySubscriptionPlanId?i?.recommendedSubscriptionPlanId:void 0;return{[sn]:{subscriptionPlan:{selectedOption:a,allOptions:Qt(d,p)},recurringAddOns:dn(l,n?.addOns.map(m=>m.addOn.subscriptionAddOnId)),coupon:{selectedOption:n?.coupons[0]?.coupon.subscriptionCouponId,allOptions:c.map(m=>({label:m.name,value:m.subscriptionCouponId}))}},[Pt]:{changeType:r==="future"?"applyImmediately":"applyEndOfTerm",shouldProrate:r==="future"}}},Dn={labelWidth:new t.ResponsiveSized(115,145,155),mediumLabelWidth:new t.ResponsiveSized(140,160,170),largeLabelWidth:new t.ResponsiveSized(160,210,210),paddingBottom:new t.ResponsiveSized(t.sp[3],t.sp[2])};function Q1({sectionId:e,isDisabled:n,subscriptionCreateData:r,subscriptionMetaDetails:i,recommendedSubscriptionPlanId:a,style:d}){const l=t.useWindowSizeContext(),c=t.appLocale.getLocalizedStrings().subscriptionUpdate,{dropDowns:p,dateFormat:{visual:m}}=t.appLocale.getLocalizedStrings(),{labels:h,placeholders:S}=c.dropDowns,x=Dn.labelWidth.value(l),C=Dn.mediumLabelWidth.value(l),b=Dn.largeLabelWidth.value(l),{plans:f,addOns:g,coupons:j}=i;return o.jsxRuntimeExports.jsx(J1,{style:d,children:o.jsxRuntimeExports.jsxs(eS,{children:[o.jsxRuntimeExports.jsx(Hi,{label:{label:h.planName,width:C},isDisabled:n,groupedSingleSelectField:{name:zo(e,"subscriptionPlan"),placeholder:S.selectPlan,valueToInfo:y=>{const $=f.find(w=>w.subscriptionPlanId===y);return t.amountToString("0,0.00",$?.price)},defaultValue:{selectedOption:r?.subscriptionPlanId,allOptions:Qt(f,a)},registerOptions:{required:!0,validate:y=>y!=null&&y.selectedOption!=null||n!=null}},valueToAdditionalLabel:y=>{const $=f.find(w=>w.subscriptionPlanId===y);return nn($?.price,$?.period)??""}}),o.jsxRuntimeExports.jsx(Fo,{}),o.jsxRuntimeExports.jsx(Ki,{label:{label:h.recurringAddOns,width:x},isDisabled:n,singleSelectPickerField:{name:zo(e,"recurringAddOns"),placeholder:S.selectAddOn,valueToInfo:y=>{const $=g.find(w=>w.subscriptionAddOnId===y);return t.amountToString("0,0.00",$?.price)}},valueToAdditionalLabel:y=>{const $=g.find(w=>w.subscriptionAddOnId===y);return nn($?.price,$?.period)??""},defaultValues:r?.subscriptionAddOnIds??[],allOptions:g.map(y=>({label:y.name,value:y.subscriptionAddOnId}))}),o.jsxRuntimeExports.jsx(Fo,{}),o.jsxRuntimeExports.jsx(t.LabeledItemWithButton,{isDisabled:"readonly",label:{label:h.nonRecurringAddOns,width:b},style:{opacity:.32},button:{buttonTitle:p.add,style:{pointerEvents:"none"}}}),o.jsxRuntimeExports.jsx(Fo,{}),o.jsxRuntimeExports.jsx(t.LabeledSingleSelectPickerField,{isDisabled:n,label:{label:h.coupon,width:x},singleSelectPickerField:{name:zo(e,"coupon"),placeholder:S.selectCoupon,defaultValue:{selectedOption:r?.subscriptionCouponIds[0],allOptions:j.map(y=>({label:y.name,value:y.subscriptionCouponId}))}}}),o.jsxRuntimeExports.jsx(Fo,{}),o.jsxRuntimeExports.jsx(t.LabeledDatePickerField,{isDisabled:n,label:{label:h.startDate,width:x},dateField:{name:zo(e,"planStartDate"),placeholder:S.selectStartDate,defaultValue:r?.startDate,dateFormat:m.defaultInput,minDate:ee.dateNow(),autoComplete:"off"}})]})})}const zo=(e,n)=>`${e}.${n}`,J1=s.div`
2647
+ `,Cr=e=>`${e}_form`,jr=e=>{const{data:n,subscriptionDetail:r}=e,i=r?.summary?.summary,a=r?.subscription.subscription.subscriptionPlanId,{plans:d,addOns:l,coupons:c}=Jt(e),p=i?.recommendedSubscriptionPlanId!=null&&a===i?.primarySubscriptionPlanId?i?.recommendedSubscriptionPlanId:void 0;return{[sn]:{subscriptionPlan:{selectedOption:n?.subscriptionPlanId,allOptions:Qt(d,p)},recurringAddOns:cn(l,n?.subscriptionAddOnIds),coupon:{selectedOption:n?.subscriptionCouponIds[0],allOptions:c.map(m=>({label:m.name,value:m.subscriptionCouponId}))}},[Pt]:{changeType:n?.applyEndOfTerm===!0?"applyEndOfTerm":"applyImmediately",shouldProrate:n?.shouldProrate===!0}}},cn=(e,n)=>n?.map(r=>{const i=e.map(a=>({label:a.name,value:a.subscriptionAddOnId,isDisabled:a.subscriptionAddOnId!==r&&n?.includes(a.subscriptionAddOnId)}));return{selectedOption:r,allOptions:i}})??[],Jt=e=>{const{subscriptionMetaDetails:n}=e,r=n.plans.filter(d=>d.plan.statusCode==="active").map(d=>d.plan),i=n.addOns.filter(d=>d.addOn.statusCode==="active"&&d.addOn.chargeType==="recurring").map(d=>d.addOn),a=n.coupons.filter(d=>d.coupon.statusCode==="active").map(d=>d.coupon);return{plans:r,addOns:i,coupons:a}},X1=e=>{const{data:n,subscriptionDetail:r}=e;if(n==null||r==null)return!1;const i=r.subscription.subscription.status.code;return[Ki(e),!o.isEqual(n.applyEndOfTerm,i!=="future"),!o.isEqual(n.shouldProrate,i==="future"),!o.isEqual(n.invoiceImmediately,!0)].reduce((a,d)=>a||d,!1)},Ki=e=>{const{data:n,subscriptionDetail:r}=e;return n==null||r==null?!1:[!o.isEqual(n.subscriptionPlanId,r.plan?.plan.subscriptionPlanId),!o.isEqual(n.subscriptionAddOnIds,r.addOns?.map(i=>i.addOn.subscriptionAddOnId)),!o.isEqual(n.subscriptionCouponIds,r.coupons?.map(i=>i.coupon.subscriptionCouponId))].reduce((i,a)=>i||a,!1)},q1=e=>{const{subscriptionDetail:n}=e,r=n?.subscription.subscription.status.code,i=n?.summary?.summary,a=n?.subscription.subscription.subscriptionPlanId,{plans:d,addOns:l,coupons:c}=Jt(e),p=i?.recommendedSubscriptionPlanId!=null&&a===i?.primarySubscriptionPlanId?i?.recommendedSubscriptionPlanId:void 0;return{[sn]:{subscriptionPlan:{selectedOption:a,allOptions:Qt(d,p)},recurringAddOns:cn(l,n?.addOns.map(m=>m.addOn.subscriptionAddOnId)),coupon:{selectedOption:n?.coupons[0]?.coupon.subscriptionCouponId,allOptions:c.map(m=>({label:m.name,value:m.subscriptionCouponId}))}},[Pt]:{changeType:r==="future"?"applyImmediately":"applyEndOfTerm",shouldProrate:r==="future"}}},In={labelWidth:new t.ResponsiveSized(115,145,155),mediumLabelWidth:new t.ResponsiveSized(140,160,170),largeLabelWidth:new t.ResponsiveSized(160,210,210),paddingBottom:new t.ResponsiveSized(t.sp[3],t.sp[2])};function Q1({sectionId:e,isDisabled:n,subscriptionCreateData:r,subscriptionMetaDetails:i,recommendedSubscriptionPlanId:a,style:d}){const l=t.useWindowSizeContext(),c=t.appLocale.getLocalizedStrings().subscriptionUpdate,{dropDowns:p,dateFormat:{visual:m}}=t.appLocale.getLocalizedStrings(),{labels:h,placeholders:S}=c.dropDowns,x=In.labelWidth.value(l),C=In.mediumLabelWidth.value(l),b=In.largeLabelWidth.value(l),{plans:f,addOns:g,coupons:j}=i;return o.jsxRuntimeExports.jsx(J1,{style:d,children:o.jsxRuntimeExports.jsxs(eS,{children:[o.jsxRuntimeExports.jsx(Ui,{label:{label:h.planName,width:C},isDisabled:n,groupedSingleSelectField:{name:zo(e,"subscriptionPlan"),placeholder:S.selectPlan,valueToInfo:y=>{const $=f.find(w=>w.subscriptionPlanId===y);return t.amountToString("0,0.00",$?.price)},defaultValue:{selectedOption:r?.subscriptionPlanId,allOptions:Qt(f,a)},registerOptions:{required:!0,validate:y=>y!=null&&y.selectedOption!=null||n!=null}},valueToAdditionalLabel:y=>{const $=f.find(w=>w.subscriptionPlanId===y);return nn($?.price,$?.period)??""}}),o.jsxRuntimeExports.jsx(Fo,{}),o.jsxRuntimeExports.jsx(Hi,{label:{label:h.recurringAddOns,width:x},isDisabled:n,singleSelectPickerField:{name:zo(e,"recurringAddOns"),placeholder:S.selectAddOn,valueToInfo:y=>{const $=g.find(w=>w.subscriptionAddOnId===y);return t.amountToString("0,0.00",$?.price)}},valueToAdditionalLabel:y=>{const $=g.find(w=>w.subscriptionAddOnId===y);return nn($?.price,$?.period)??""},defaultValues:r?.subscriptionAddOnIds??[],allOptions:g.map(y=>({label:y.name,value:y.subscriptionAddOnId}))}),o.jsxRuntimeExports.jsx(Fo,{}),o.jsxRuntimeExports.jsx(t.LabeledItemWithButton,{isDisabled:"readonly",label:{label:h.nonRecurringAddOns,width:b},style:{opacity:.32},button:{buttonTitle:p.add,style:{pointerEvents:"none"}}}),o.jsxRuntimeExports.jsx(Fo,{}),o.jsxRuntimeExports.jsx(t.LabeledSingleSelectPickerField,{isDisabled:n,label:{label:h.coupon,width:x},singleSelectPickerField:{name:zo(e,"coupon"),placeholder:S.selectCoupon,defaultValue:{selectedOption:r?.subscriptionCouponIds[0],allOptions:j.map(y=>({label:y.name,value:y.subscriptionCouponId}))}}}),o.jsxRuntimeExports.jsx(Fo,{}),o.jsxRuntimeExports.jsx(t.LabeledDatePickerField,{isDisabled:n,label:{label:h.startDate,width:x},dateField:{name:zo(e,"planStartDate"),placeholder:S.selectStartDate,defaultValue:r?.startDate,dateFormat:m.defaultInput,minDate:J.dateNow(),autoComplete:"off"}})]})})}const zo=(e,n)=>`${e}.${n}`,J1=s.div`
2648
2648
  display: flex;
2649
2649
  flex-direction: column;
2650
2650
  padding-top: ${t.Space.sp3};
@@ -2702,7 +2702,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2702
2702
  justify-content: center;
2703
2703
  height: 100%;
2704
2704
  overflow-y: auto;
2705
- `,Rr=e=>`${e}_form`,$r=e=>{const{data:n}=e,{plans:r,addOns:i,coupons:a}=Jt(e);return{[rn]:{subscriptionPlan:{selectedOption:n?.subscriptionPlanId,allOptions:Qt(r)},recurringAddOns:dn(i,n?.subscriptionAddOnIds),coupon:{selectedOption:n?.subscriptionCouponIds[0],allOptions:a.map(d=>({label:d.name,value:d.subscriptionCouponId}))},planStartDate:n?.startDate?.toDate()},[an]:{invoicingOption:"invoiceNow"}}},mS=e=>{const{data:n}=e;return n==null?!1:[!o.isEqual(n.subscriptionPlanId,void 0),!o.isEqual(n.subscriptionAddOnIds,[]),!o.isEqual(n.subscriptionCouponIds,[]),!o.isEqual(n.startDate,void 0),!o.isEqual(n.invoiceImmediately,!0)].reduce((r,i)=>r||i,!1)},xS=e=>{const{plans:n,addOns:r,coupons:i}=Jt(e);return{[rn]:{subscriptionPlan:{selectedOption:void 0,allOptions:Qt(n)},recurringAddOns:dn(r),coupon:{selectedOption:void 0,allOptions:i.map(a=>({label:a.name,value:a.subscriptionCouponId}))},planStartDate:void 0},[an]:{invoicingOption:"invoiceNow"}}},Ut=t.appLocale.getLocalizedStrings().cockpit.portfolio.header,At=[{key:"companyName",value:Ut.name,sortOrder:"ascending",width:new t.ResponsiveSized(344,344),isThreadAllowed:!0},{key:"runway",value:Ut.runway,sortOrder:"ascending",width:new t.ResponsiveSized(155,155),isThreadAllowed:!0},{key:"cashBalance",value:Ut.cashbalance,sortOrder:"ascending",width:new t.ResponsiveSized(229,229),isThreadAllowed:!0},{key:"expenses",value:Ut.expenses,sortOrder:"ascending",width:new t.ResponsiveSized(228,228),isThreadAllowed:!0},{key:"revenues",value:Ut.revenues,sortOrder:"ascending",width:new t.ResponsiveSized(239,239),isThreadAllowed:!0},{key:"netIncome",value:Ut.netincome,sortOrder:"ascending",width:new t.ResponsiveSized(140,140),isThreadAllowed:!0}];At.map(e=>e.key);const hS={headerLastColumnRightPadding:new t.ResponsiveSized(30,82)};function gS({companyNameSticky:e,onColumnSortConfigChanged:n,sortConfig:r}){const i=t.useWindowSizeContext(),[a,d]=u.useState(o.cloneDeep(At));u.useEffect(()=>{const c=[...a];for(const p of c)p.key===r.sortKey?p.sortOrder=r.sortOrder:p.sortOrder="ascending";d(c)},[r.sortKey,r.sortOrder]);const l=(c,p)=>{let m=p;r.sortKey===c&&(m=p==="ascending"?"descending":"ascending"),n(c,m)};return o.jsxRuntimeExports.jsx(yS,{height:Nt,companyNameSticky:e,windowSize:i,children:a.map(c=>o.jsxRuntimeExports.jsxs(fS,{companyNameSticky:e&&c.key==="companyName",sortDataValue:r.sortKey,actualDataValue:c.key,wrapperWidth:c.width,windowSize:i,children:[o.jsxRuntimeExports.jsxs(RS,{onClick:()=>l(ee.toPortfolioSortKeyType(c.key),c.sortOrder),children:[o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:c.value}),o.jsxRuntimeExports.jsx(jS,{sortDataValue:r.sortKey,headerdata:c,children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:12,height:12})})]}),o.jsxRuntimeExports.jsx(bS,{sortDataValue:r.sortKey,windowSize:i,isVisible:r.sortKey===c.key&&c.key!=="runway",children:o.jsxRuntimeExports.jsx(CS,{onClick:()=>l("runway","ascending")})})]},c.key))})}const SS=u.memo(gS),yS=s(t.SmallRegular)`
2705
+ `,Rr=e=>`${e}_form`,$r=e=>{const{data:n}=e,{plans:r,addOns:i,coupons:a}=Jt(e);return{[rn]:{subscriptionPlan:{selectedOption:n?.subscriptionPlanId,allOptions:Qt(r)},recurringAddOns:cn(i,n?.subscriptionAddOnIds),coupon:{selectedOption:n?.subscriptionCouponIds[0],allOptions:a.map(d=>({label:d.name,value:d.subscriptionCouponId}))},planStartDate:n?.startDate?.toDate()},[an]:{invoicingOption:"invoiceNow"}}},mS=e=>{const{data:n}=e;return n==null?!1:[!o.isEqual(n.subscriptionPlanId,void 0),!o.isEqual(n.subscriptionAddOnIds,[]),!o.isEqual(n.subscriptionCouponIds,[]),!o.isEqual(n.startDate,void 0),!o.isEqual(n.invoiceImmediately,!0)].reduce((r,i)=>r||i,!1)},xS=e=>{const{plans:n,addOns:r,coupons:i}=Jt(e);return{[rn]:{subscriptionPlan:{selectedOption:void 0,allOptions:Qt(n)},recurringAddOns:cn(r),coupon:{selectedOption:void 0,allOptions:i.map(a=>({label:a.name,value:a.subscriptionCouponId}))},planStartDate:void 0},[an]:{invoicingOption:"invoiceNow"}}},Ut=t.appLocale.getLocalizedStrings().cockpit.portfolio.header,At=[{key:"companyName",value:Ut.name,sortOrder:"ascending",width:new t.ResponsiveSized(344,344),isThreadAllowed:!0},{key:"runway",value:Ut.runway,sortOrder:"ascending",width:new t.ResponsiveSized(155,155),isThreadAllowed:!0},{key:"cashBalance",value:Ut.cashbalance,sortOrder:"ascending",width:new t.ResponsiveSized(229,229),isThreadAllowed:!0},{key:"expenses",value:Ut.expenses,sortOrder:"ascending",width:new t.ResponsiveSized(228,228),isThreadAllowed:!0},{key:"revenues",value:Ut.revenues,sortOrder:"ascending",width:new t.ResponsiveSized(239,239),isThreadAllowed:!0},{key:"netIncome",value:Ut.netincome,sortOrder:"ascending",width:new t.ResponsiveSized(140,140),isThreadAllowed:!0}];At.map(e=>e.key);const hS={headerLastColumnRightPadding:new t.ResponsiveSized(30,82)};function gS({companyNameSticky:e,onColumnSortConfigChanged:n,sortConfig:r}){const i=t.useWindowSizeContext(),[a,d]=u.useState(o.cloneDeep(At));u.useEffect(()=>{const c=[...a];for(const p of c)p.key===r.sortKey?p.sortOrder=r.sortOrder:p.sortOrder="ascending";d(c)},[r.sortKey,r.sortOrder]);const l=(c,p)=>{let m=p;r.sortKey===c&&(m=p==="ascending"?"descending":"ascending"),n(c,m)};return o.jsxRuntimeExports.jsx(yS,{height:Nt,companyNameSticky:e,windowSize:i,children:a.map(c=>o.jsxRuntimeExports.jsxs(fS,{companyNameSticky:e&&c.key==="companyName",sortDataValue:r.sortKey,actualDataValue:c.key,wrapperWidth:c.width,windowSize:i,children:[o.jsxRuntimeExports.jsxs(RS,{onClick:()=>l(J.toPortfolioSortKeyType(c.key),c.sortOrder),children:[o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:c.value}),o.jsxRuntimeExports.jsx(jS,{sortDataValue:r.sortKey,headerdata:c,children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:12,height:12})})]}),o.jsxRuntimeExports.jsx(bS,{sortDataValue:r.sortKey,windowSize:i,isVisible:r.sortKey===c.key&&c.key!=="runway",children:o.jsxRuntimeExports.jsx(CS,{onClick:()=>l("runway","ascending")})})]},c.key))})}const SS=u.memo(gS),yS=s(t.SmallRegular)`
2706
2706
  top: ${e=>e.companyNameSticky?0:t.Space.sp12};
2707
2707
  left: 0;
2708
2708
  min-height: ${e=>e.height}px;
@@ -2751,7 +2751,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2751
2751
  &:hover {
2752
2752
  color: ${e=>e.theme.colors.primary};
2753
2753
  }
2754
- `,$S=t.appLocale.getLocalizedStrings(),{common:{strings:ES},cockpit:{portfolio:{header:{runway:wS}}}}=$S,vS=({companyView:e,companyNameSticky:n,totalHeight:r,addThreadRequestThreadId:i,setNoteData:a,setElementRef:d,setAddThreadRequestThreadId:l,onCompanyNameClicked:c,onPassportIconClicked:p})=>{const m=t.useWindowSizeContext(),{accountingSummary:h,company:S}=e,{companyId:x,name:C}=S.company.companyInfo,b=`cockpit_${x}`,f="portfolio.notes",{threads:g,isLoading:j}=t.useFilteredThreads({entityType:f,companyId:x},!1),{openThread:y,threads:$,addThread:w,removeThread:O,setOpenThread:A,setRequestToOpenThread:v}=u.useContext(t.ThreadsContext),T=y!==null?$.get(y):null,F=y?.includes(x)===!0,I=y!=null&&$.get(y)==null&&F,K=i!=null&&$.get(i)?.metadata.companyId===x,M=u.useCallback(()=>{y?.includes(t.NEW_THREAD_SUFFIX)===!0&&O(y),i!=null&&l(void 0)},[i,y,O,l]),Y=k=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:k.isElementThreadOpen??!1,isElementThreadPresent:k.isElementThreadPresent??!1,itemKey:k.itemKey,elementThreadId:k.elementThreadId??"",roomId:b,addThreadRequestThreadId:i,openThreadId:y,threadStyle:k.threadStyle,openThreadMetadata:T?.metadata??null,onElementClick:E,onAddThreadClick:P}),G=u.useCallback(k=>{if(k===y)A(null);else if($.has(k))A(k);else if(k.includes(t.NEW_THREAD_SUFFIX)){const[D,z]=k.replace(t.NEW_THREAD_SUFFIX,"").split("."),Z=Ft(Ct(D),ee.toPortfolioSortKeyType(z),x,C);w(k,{type:"thread",id:k,roomId:b,createdAt:new Date,updatedAt:new Date,comments:[],metadata:Z,resolved:!1}),A(k)}},[x,C,y,b,$,w,A]),E=u.useCallback((k,D,z=!1)=>{const Z=At.find(ie=>ie.key===D);if(v(null),Z!=null&&(k.type==="contextmenu"||z===!0)){if(Z.isThreadAllowed===!1)return;M(),k.preventDefault(),k.stopPropagation();const ie=t.toCollaborationEntityType({tab:"portfolio",key:Z.key}),N=[...t.getFilteredThreads($,{entityType:ie,companyId:x},"both")],H=N.length>0&&N[0].length>0?N[0][0]:Le("portfolio",Z.key,x);$.has(H)?G(H):i===H?l(void 0):(l(H),A(null))}},[$,x,i,G,l,A,v,M]),P=u.useCallback((k,D)=>{k.stopPropagation();const z=Le("portfolio",D,x);l(void 0),G(z)},[x,l,G]),W={name:e.company.company.companyInfo.name,runway:h.runway,cashBalance:h.cashPosition?.balance,expenses:h.cogs?.balance&&h.expenses?.balance?kS(h.cogs?.balance,h.expenses?.balance):void 0,netIncome:h.netBurnOrIncome?.balance,revenues:h.income?.balance};return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{v(null),i!=null&&(l(void 0),i.includes(t.NEW_THREAD_SUFFIX)&&O(i))},children:o.jsxRuntimeExports.jsx(TS,{windowSize:m,isThreadOpen:F||K,totalHeight:r,isCreationInProgress:I,children:At.map((k,D)=>{const z=t.toCollaborationEntityType({tab:"portfolio",key:k.key}),Z=[...t.getFilteredThreads($,{entityType:z,companyId:x},"both")],ie=At.length-2<=D,N=Z.length>0&&Z[0].length>0?Z[0][0]:Le("portfolio",k.key,x),H=$.get(N),L=H!=null&&H.resolved===!1,Q=N===y,se=i===N;switch(k.key){case"companyName":return o.jsxRuntimeExports.jsxs(MS,{companyNameSticky:n,columnWidth:k.width,windowSize:m,isThreadOpen:Q||se,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:X=>E(X,k.key),ref:X=>{d(x,k.key,X)},children:[o.jsxRuntimeExports.jsxs(LS,{children:[o.jsxRuntimeExports.jsx(PS,{onClick:X=>{X.preventDefault(),c(e)},children:W.name}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:Q,roomId:b,openThreadId:y,openThreadMetadata:T?.metadata??null})]}),o.jsxRuntimeExports.jsxs(DS,{children:[o.jsxRuntimeExports.jsxs(AS,{onClick:X=>{X.preventDefault(),a({roomId:b,companyId:x,companyName:C,entityType:f})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:g.length,isLoading:j}),o.jsxRuntimeExports.jsx(OS,{})]}),o.jsxRuntimeExports.jsx(NS,{onClick:X=>{X.preventDefault(),p(e)},children:o.jsxRuntimeExports.jsx(IS,{className:"passportIcon"})})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:L,itemKey:k.key,style:{left:t.Space.sp4},onElementClick:E}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("portfolio",k.key,x),addThreadRequestThreadId:i,itemKey:k.key,onAddThreadClick:P})]},N);case"cashBalance":return o.jsxRuntimeExports.jsxs(io,{ref:X=>{d(x,k.key,X)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:X=>E(X,k.key),children:[o.jsxRuntimeExports.jsx(Wo,{textColor:t.getCockpitColor("cashBalance"),wrapperWidth:k.width,windowSize:m,children:t.amountToString("0,0",W.cashBalance)}),Y({isElementThreadOpen:Q,isElementThreadPresent:L,itemKey:k.key,elementThreadId:N,threadStyle:ie?{right:t.Space.sp0}:void 0})]},N);case"expenses":return o.jsxRuntimeExports.jsxs(io,{ref:X=>{d(x,k.key,X)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:X=>E(X,k.key),children:[o.jsxRuntimeExports.jsx(Wo,{textColor:t.getCockpitColor("expenses"),wrapperWidth:k.width,windowSize:m,children:t.amountToString("0,0",W.expenses)}),Y({isElementThreadOpen:Q,isElementThreadPresent:L,itemKey:k.key,elementThreadId:N,threadStyle:ie?{right:t.Space.sp0}:void 0})]},N);case"revenues":return o.jsxRuntimeExports.jsxs(io,{ref:X=>{d(x,k.key,X)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:X=>E(X,k.key),children:[o.jsxRuntimeExports.jsx(Wo,{textColor:t.getCockpitColor("revenues"),wrapperWidth:k.width,windowSize:m,children:t.amountToString("0,0",W.revenues)}),Y({isElementThreadOpen:Q,isElementThreadPresent:L,itemKey:k.key,elementThreadId:N,threadStyle:ie?{right:t.Space.sp0}:void 0})]},N);case"netIncome":return o.jsxRuntimeExports.jsxs(io,{ref:X=>{d(x,k.key,X)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:X=>E(X,k.key),children:[o.jsxRuntimeExports.jsx(Wo,{textColor:t.getCockpitColor("netIncome"),wrapperWidth:k.width,windowSize:m,children:t.amountToString("0,0",W.netIncome)}),Y({isElementThreadOpen:Q,isElementThreadPresent:L,itemKey:k.key,elementThreadId:N,threadStyle:ie?{right:t.Space.sp0}:void 0})]},N);case"runway":return o.jsxRuntimeExports.jsxs(io,{ref:X=>{d(x,k.key,X)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:X=>E(X,k.key),children:[o.jsxRuntimeExports.jsx(zS,{wrapperWidth:k.width,windowSize:m,children:W.runway!=null?o.jsxRuntimeExports.jsx(t.Tooltip,{variant:"runway",data:W.runway,placement:"right",title:wS,children:o.jsxRuntimeExports.jsx(WS,{textColor:t.getCockpitColor(W.runway.runwayStatusCode)})}):o.jsxRuntimeExports.jsx(FS,{children:ES.hyphen})}),Y({isElementThreadOpen:Q,isElementThreadPresent:L,itemKey:k.key,elementThreadId:N,threadStyle:ie?{right:t.Space.sp0}:void 0})]},N);default:return null}})})})},kS=(e,n)=>({amount:e.amount+n.amount,currencyCode:e.currencyCode,currencySymbol:e.currencySymbol}),TS=s.div`
2754
+ `,$S=t.appLocale.getLocalizedStrings(),{common:{strings:ES},cockpit:{portfolio:{header:{runway:wS}}}}=$S,vS=({companyView:e,companyNameSticky:n,totalHeight:r,addThreadRequestThreadId:i,setNoteData:a,setElementRef:d,setAddThreadRequestThreadId:l,onCompanyNameClicked:c,onPassportIconClicked:p})=>{const m=t.useWindowSizeContext(),{accountingSummary:h,company:S}=e,{companyId:x,name:C}=S.company.companyInfo,b=`cockpit_${x}`,f="portfolio.notes",{threads:g,isLoading:j}=t.useFilteredThreads({entityType:f,companyId:x},!1),{openThread:y,threads:$,addThread:w,removeThread:O,setOpenThread:A,setRequestToOpenThread:v}=u.useContext(t.ThreadsContext),T=y!==null?$.get(y):null,F=y?.includes(x)===!0,I=y!=null&&$.get(y)==null&&F,K=i!=null&&$.get(i)?.metadata.companyId===x,M=u.useCallback(()=>{y?.includes(t.NEW_THREAD_SUFFIX)===!0&&O(y),i!=null&&l(void 0)},[i,y,O,l]),Y=k=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:k.isElementThreadOpen??!1,isElementThreadPresent:k.isElementThreadPresent??!1,itemKey:k.itemKey,elementThreadId:k.elementThreadId??"",roomId:b,addThreadRequestThreadId:i,openThreadId:y,threadStyle:k.threadStyle,openThreadMetadata:T?.metadata??null,onElementClick:E,onAddThreadClick:P}),G=u.useCallback(k=>{if(k===y)A(null);else if($.has(k))A(k);else if(k.includes(t.NEW_THREAD_SUFFIX)){const[D,z]=k.replace(t.NEW_THREAD_SUFFIX,"").split("."),Z=Ft(jt(D),J.toPortfolioSortKeyType(z),x,C);w(k,{type:"thread",id:k,roomId:b,createdAt:new Date,updatedAt:new Date,comments:[],metadata:Z,resolved:!1}),A(k)}},[x,C,y,b,$,w,A]),E=u.useCallback((k,D,z=!1)=>{const Z=At.find(ie=>ie.key===D);if(v(null),Z!=null&&(k.type==="contextmenu"||z===!0)){if(Z.isThreadAllowed===!1)return;M(),k.preventDefault(),k.stopPropagation();const ie=t.toCollaborationEntityType({tab:"portfolio",key:Z.key}),N=[...t.getFilteredThreads($,{entityType:ie,companyId:x},"both")],H=N.length>0&&N[0].length>0?N[0][0]:Le("portfolio",Z.key,x);$.has(H)?G(H):i===H?l(void 0):(l(H),A(null))}},[$,x,i,G,l,A,v,M]),P=u.useCallback((k,D)=>{k.stopPropagation();const z=Le("portfolio",D,x);l(void 0),G(z)},[x,l,G]),W={name:e.company.company.companyInfo.name,runway:h.runway,cashBalance:h.cashPosition?.balance,expenses:h.cogs?.balance&&h.expenses?.balance?kS(h.cogs?.balance,h.expenses?.balance):void 0,netIncome:h.netBurnOrIncome?.balance,revenues:h.income?.balance};return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{v(null),i!=null&&(l(void 0),i.includes(t.NEW_THREAD_SUFFIX)&&O(i))},children:o.jsxRuntimeExports.jsx(TS,{windowSize:m,isThreadOpen:F||K,totalHeight:r,isCreationInProgress:I,children:At.map((k,D)=>{const z=t.toCollaborationEntityType({tab:"portfolio",key:k.key}),Z=[...t.getFilteredThreads($,{entityType:z,companyId:x},"both")],ie=At.length-2<=D,N=Z.length>0&&Z[0].length>0?Z[0][0]:Le("portfolio",k.key,x),H=$.get(N),L=H!=null&&H.resolved===!1,Q=N===y,se=i===N;switch(k.key){case"companyName":return o.jsxRuntimeExports.jsxs(MS,{companyNameSticky:n,columnWidth:k.width,windowSize:m,isThreadOpen:Q||se,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:X=>E(X,k.key),ref:X=>{d(x,k.key,X)},children:[o.jsxRuntimeExports.jsxs(LS,{children:[o.jsxRuntimeExports.jsx(PS,{onClick:X=>{X.preventDefault(),c(e)},children:W.name}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:Q,roomId:b,openThreadId:y,openThreadMetadata:T?.metadata??null})]}),o.jsxRuntimeExports.jsxs(DS,{children:[o.jsxRuntimeExports.jsxs(AS,{onClick:X=>{X.preventDefault(),a({roomId:b,companyId:x,companyName:C,entityType:f})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:g.length,isLoading:j}),o.jsxRuntimeExports.jsx(OS,{})]}),o.jsxRuntimeExports.jsx(NS,{onClick:X=>{X.preventDefault(),p(e)},children:o.jsxRuntimeExports.jsx(IS,{className:"passportIcon"})})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:L,itemKey:k.key,style:{left:t.Space.sp4},onElementClick:E}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("portfolio",k.key,x),addThreadRequestThreadId:i,itemKey:k.key,onAddThreadClick:P})]},N);case"cashBalance":return o.jsxRuntimeExports.jsxs(io,{ref:X=>{d(x,k.key,X)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:X=>E(X,k.key),children:[o.jsxRuntimeExports.jsx(Wo,{textColor:t.getCockpitColor("cashBalance"),wrapperWidth:k.width,windowSize:m,children:t.amountToString("0,0",W.cashBalance)}),Y({isElementThreadOpen:Q,isElementThreadPresent:L,itemKey:k.key,elementThreadId:N,threadStyle:ie?{right:t.Space.sp0}:void 0})]},N);case"expenses":return o.jsxRuntimeExports.jsxs(io,{ref:X=>{d(x,k.key,X)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:X=>E(X,k.key),children:[o.jsxRuntimeExports.jsx(Wo,{textColor:t.getCockpitColor("expenses"),wrapperWidth:k.width,windowSize:m,children:t.amountToString("0,0",W.expenses)}),Y({isElementThreadOpen:Q,isElementThreadPresent:L,itemKey:k.key,elementThreadId:N,threadStyle:ie?{right:t.Space.sp0}:void 0})]},N);case"revenues":return o.jsxRuntimeExports.jsxs(io,{ref:X=>{d(x,k.key,X)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:X=>E(X,k.key),children:[o.jsxRuntimeExports.jsx(Wo,{textColor:t.getCockpitColor("revenues"),wrapperWidth:k.width,windowSize:m,children:t.amountToString("0,0",W.revenues)}),Y({isElementThreadOpen:Q,isElementThreadPresent:L,itemKey:k.key,elementThreadId:N,threadStyle:ie?{right:t.Space.sp0}:void 0})]},N);case"netIncome":return o.jsxRuntimeExports.jsxs(io,{ref:X=>{d(x,k.key,X)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:X=>E(X,k.key),children:[o.jsxRuntimeExports.jsx(Wo,{textColor:t.getCockpitColor("netIncome"),wrapperWidth:k.width,windowSize:m,children:t.amountToString("0,0",W.netIncome)}),Y({isElementThreadOpen:Q,isElementThreadPresent:L,itemKey:k.key,elementThreadId:N,threadStyle:ie?{right:t.Space.sp0}:void 0})]},N);case"runway":return o.jsxRuntimeExports.jsxs(io,{ref:X=>{d(x,k.key,X)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:X=>E(X,k.key),children:[o.jsxRuntimeExports.jsx(zS,{wrapperWidth:k.width,windowSize:m,children:W.runway!=null?o.jsxRuntimeExports.jsx(t.Tooltip,{variant:"runway",data:W.runway,placement:"right",title:wS,children:o.jsxRuntimeExports.jsx(WS,{textColor:t.getCockpitColor(W.runway.runwayStatusCode)})}):o.jsxRuntimeExports.jsx(FS,{children:ES.hyphen})}),Y({isElementThreadOpen:Q,isElementThreadPresent:L,itemKey:k.key,elementThreadId:N,threadStyle:ie?{right:t.Space.sp0}:void 0})]},N);default:return null}})})})},kS=(e,n)=>({amount:e.amount+n.amount,currencyCode:e.currencyCode,currencySymbol:e.currencySymbol}),TS=s.div`
2755
2755
  border: 1px solid ${e=>e.theme.colors.grey3};
2756
2756
  border-radius: ${t.Space.sp2};
2757
2757
  display: flex;
@@ -2878,7 +2878,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2878
2878
  height: 12px;
2879
2879
  border-radius: 50%;
2880
2880
  background-color: ${e=>e.textColor.color.toString()};
2881
- `,BS=e=>le.createElement("svg",{width:48,height:49,viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M23.994 6.29199C20.3944 6.29199 16.8756 7.3594 13.8826 9.35924C10.8897 11.3591 8.55692 14.2015 7.17941 17.5271C5.80189 20.8528 5.44147 24.5122 6.14372 28.0426C6.84597 31.5731 8.57935 34.816 11.1247 37.3613C13.67 39.9066 16.9129 41.64 20.4434 42.3423C23.9738 43.0445 27.6332 42.6841 30.9588 41.3066C34.2845 39.9291 37.1269 37.5963 39.1268 34.6034C41.1266 31.6104 42.194 28.0916 42.194 24.492C42.194 22.1019 41.7232 19.7353 40.8086 17.5271C39.894 15.319 38.5534 13.3127 36.8633 11.6226C35.1733 9.93262 33.167 8.59202 30.9588 7.67738C28.7507 6.76275 26.3841 6.29199 23.994 6.29199Z",fill:"#F9E3AE"}),le.createElement("path",{d:"M8.86603 42.1201C11.0593 44.2078 13.6416 45.8442 16.466 46.9361L44.69 18.7081V13.3861C43.8158 11.9373 42.7857 10.5886 41.618 9.36406L8.86603 42.1201ZM7.25203 40.4221L39.726 7.94806H34.76L5.14803 37.5601C5.77565 38.5661 6.47902 39.5229 7.25203 40.4221ZM4.79203 34.6061L32.276 7.12206L29.794 5.46606L3.60803 31.6521C3.93426 32.6628 4.32987 33.6498 4.79203 34.6061Z",fill:"#FFEFCA"}),le.createElement("path",{d:"M24 1.32788C19.417 1.32788 14.937 2.68689 11.1263 5.23307C7.31572 7.77924 4.34571 11.3982 2.59188 15.6323C0.838043 19.8665 0.37916 24.5256 1.27326 29.0205C2.16735 33.5154 4.37427 37.6443 7.61493 40.885C10.8556 44.1256 14.9845 46.3325 19.4794 47.2266C23.9743 48.1207 28.6334 47.6618 32.8675 45.908C37.1017 44.1542 40.7206 41.1842 43.2668 37.3735C45.813 33.5629 47.172 29.0829 47.172 24.4999C47.172 18.3543 44.7307 12.4604 40.3851 8.1148C36.0395 3.76921 30.1456 1.32788 24 1.32788ZM24 42.7079C21.0282 42.7036 18.1025 41.9717 15.4788 40.576C12.855 39.1803 10.613 37.1634 8.9485 34.7014C7.28402 32.2394 6.24775 29.4072 5.93024 26.4524C5.61273 23.4975 6.02363 20.5099 7.12705 17.7504C8.23047 14.991 9.99283 12.5438 12.2602 10.6225C14.5275 8.70128 17.2308 7.36449 20.1339 6.72895C23.037 6.0934 26.0516 6.17844 28.9143 6.97663C31.7769 7.77482 34.4006 9.26187 36.556 11.3079L37.118 11.8599C37.3313 12.0825 37.538 12.3085 37.738 12.5379C40.0344 15.1727 41.5236 18.4131 42.0276 21.8717C42.5315 25.3304 42.0289 28.861 40.5798 32.0416C39.1307 35.2222 36.7965 37.9183 33.856 39.8076C30.9155 41.697 27.4932 42.6997 23.998 42.6959L24 42.7079Z",fill:"#F6D397"}),le.createElement("path",{d:"M32.192 9.06799C32.3774 9.06725 32.5571 9.00433 32.7025 8.8893C32.8479 8.77426 32.9504 8.61378 32.9937 8.43354C33.0371 8.25331 33.0187 8.06374 32.9415 7.89521C32.8643 7.72667 32.7328 7.58891 32.568 7.50399C31.9491 7.19298 31.3135 6.91655 30.664 6.67599C30.4615 6.60992 30.2413 6.62464 30.0494 6.71706C29.8575 6.80949 29.7087 6.97247 29.6341 7.17199C29.5595 7.37151 29.5649 7.59213 29.6491 7.78779C29.7333 7.98345 29.8898 8.13901 30.086 8.22199C30.6776 8.44532 31.2571 8.69967 31.822 8.98399C31.9377 9.03856 32.064 9.06723 32.192 9.06799Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M24 0.5C19.2533 0.5 14.6131 1.90758 10.6663 4.54473C6.71954 7.18188 3.6434 10.9302 1.8269 15.3156C0.0103989 19.701 -0.464881 24.5266 0.461164 29.1822C1.38721 33.8377 3.67299 38.1141 7.02945 41.4706C10.3859 44.827 14.6623 47.1128 19.3178 48.0388C23.9734 48.9649 28.799 48.4896 33.1844 46.6731C37.5698 44.8566 41.3181 41.7805 43.9553 37.8337C46.5924 33.8869 48 29.2467 48 24.5C48 18.1348 45.4714 12.0303 40.9706 7.52944C36.4697 3.02856 30.3652 0.5 24 0.5ZM24 46.844C19.5808 46.844 15.2608 45.5335 11.5863 43.0783C7.9119 40.6232 5.04801 37.1335 3.35685 33.0507C1.66568 28.9678 1.2232 24.4752 2.08534 20.1409C2.94749 15.8066 5.07555 11.8253 8.20041 8.7004C11.3253 5.57554 15.3066 3.44748 19.6409 2.58533C23.9752 1.72319 28.4678 2.16567 32.5507 3.85684C36.6335 5.548 40.1232 8.41189 42.5784 12.0863C45.0336 15.7608 46.344 20.0808 46.344 24.5C46.3435 30.4258 43.9892 36.1088 39.799 40.299C35.6088 44.4892 29.9258 46.8435 24 46.844Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M24 40.2239C23.7805 40.2245 23.5702 40.3119 23.4151 40.467C23.2599 40.6222 23.1725 40.8325 23.172 41.0519V42.7079C23.172 42.9275 23.2592 43.1381 23.4145 43.2934C23.5698 43.4487 23.7804 43.5359 24 43.5359C24.2196 43.5359 24.4302 43.4487 24.5855 43.2934C24.7407 43.1381 24.828 42.9275 24.828 42.7079V41.0519C24.8274 40.8325 24.74 40.6222 24.5849 40.467C24.4297 40.3119 24.2194 40.2245 24 40.2239ZM28.958 40.2859C28.9004 40.0738 28.7609 39.8931 28.5702 39.7838C28.3795 39.6745 28.1531 39.6454 27.941 39.7029C27.7288 39.7605 27.5482 39.9 27.4389 40.0907C27.3295 40.2814 27.3004 40.5078 27.358 40.7199L27.788 42.3199C27.8585 42.5177 28.0013 42.6814 28.1875 42.7783C28.3737 42.8753 28.5897 42.8982 28.7922 42.8425C28.9946 42.7869 29.1685 42.6567 29.279 42.4782C29.3895 42.2997 29.4284 42.0859 29.388 41.8799L28.958 40.2859ZM16.338 38.1679C16.2435 38.113 16.139 38.0775 16.0306 38.0632C15.9222 38.049 15.8121 38.0564 15.7067 38.0851C15.6012 38.1137 15.5024 38.163 15.4161 38.2301C15.3299 38.2972 15.2577 38.3808 15.204 38.4759L14.376 39.9079C14.2783 40.097 14.2571 40.3164 14.3169 40.5207C14.3767 40.7249 14.5129 40.8983 14.6971 41.0048C14.8813 41.1114 15.0995 41.1429 15.3064 41.0928C15.5132 41.0427 15.6929 40.9149 15.808 40.7359L16.636 39.3039C16.6913 39.21 16.7274 39.1061 16.7424 38.9981C16.7573 38.8902 16.7508 38.7803 16.7231 38.6749C16.6954 38.5695 16.6471 38.4706 16.581 38.3839C16.5149 38.2973 16.4323 38.2245 16.338 38.1699V38.1679ZM32.784 38.4759C32.6689 38.2969 32.4892 38.1691 32.2824 38.1191C32.0755 38.069 31.8573 38.1005 31.6731 38.207C31.4889 38.3135 31.3527 38.4869 31.2929 38.6912C31.2331 38.8954 31.2543 39.1149 31.352 39.3039L32.18 40.7359C32.2314 40.8355 32.3025 40.9235 32.3889 40.9948C32.4754 41.066 32.5754 41.119 32.6829 41.1505C32.7904 41.1819 32.9032 41.1913 33.0145 41.1779C33.1257 41.1645 33.233 41.1287 33.33 41.0726C33.427 41.0165 33.5116 40.9414 33.5787 40.8516C33.6458 40.7619 33.694 40.6595 33.7203 40.5506C33.7467 40.4417 33.7507 40.3286 33.732 40.2182C33.7134 40.1077 33.6726 40.0022 33.612 39.9079L32.784 38.4759ZM20.03 39.7019C19.8181 39.6457 19.5926 39.6759 19.4028 39.7857C19.2131 39.8956 19.0747 40.0762 19.018 40.2879L18.588 41.8879C18.5597 41.993 18.5525 42.1026 18.5666 42.2104C18.5807 42.3183 18.6159 42.4223 18.6703 42.5166C18.7246 42.6108 18.7969 42.6935 18.8832 42.7598C18.9695 42.826 19.0679 42.8747 19.173 42.9029C19.278 42.9312 19.3876 42.9384 19.4955 42.9243C19.6034 42.9102 19.7074 42.875 19.8016 42.8206C19.8959 42.7663 19.9785 42.694 20.0448 42.6077C20.1111 42.5215 20.1597 42.423 20.188 42.3179L20.622 40.7179C20.6783 40.506 20.6485 40.2805 20.5391 40.0905C20.4296 39.9005 20.2495 39.7616 20.038 39.7039L20.03 39.7019ZM22.338 17.0499H25.648C26.3061 17.0505 26.9371 17.3121 27.4024 17.7775C27.8678 18.2428 28.1294 18.8738 28.13 19.5319C28.13 19.7515 28.2172 19.9621 28.3725 20.1174C28.5278 20.2727 28.7384 20.3599 28.958 20.3599C29.1776 20.3599 29.3882 20.2727 29.5435 20.1174C29.6987 19.9621 29.786 19.7515 29.786 19.5319C29.786 18.4345 29.35 17.382 28.574 16.6059C27.798 15.8299 26.7454 15.3939 25.648 15.3939H24.82V12.9139C24.82 12.6943 24.7327 12.4837 24.5775 12.3285C24.4222 12.1732 24.2116 12.0859 23.992 12.0859C23.7724 12.0859 23.5618 12.1732 23.4065 12.3285C23.2512 12.4837 23.164 12.6943 23.164 12.9139V15.3959H22.336C21.2385 15.3959 20.186 15.8319 19.41 16.6079C18.6339 17.384 18.198 18.4365 18.198 19.5339V21.1899C18.198 22.2874 18.6339 23.3399 19.41 24.1159C20.186 24.892 21.2385 25.3279 22.336 25.3279H25.646C26.3041 25.3285 26.9351 25.5901 27.4004 26.0555C27.8658 26.5208 28.1274 27.1518 28.128 27.8099V29.4659C28.1274 30.124 27.8658 30.755 27.4004 31.2204C26.9351 31.6857 26.3041 31.9474 25.646 31.9479H24.818V26.9819C24.818 26.7623 24.7307 26.5517 24.5755 26.3965C24.4202 26.2412 24.2096 26.1539 23.99 26.1539C23.7704 26.1539 23.5598 26.2412 23.4045 26.3965C23.2492 26.5517 23.162 26.7623 23.162 26.9819V31.9479H22.334C21.6759 31.9474 21.0449 31.6857 20.5795 31.2204C20.1142 30.755 19.8525 30.124 19.852 29.4659C19.852 29.2463 19.7647 29.0357 19.6095 28.8804C19.4542 28.7252 19.2436 28.6379 19.024 28.6379C18.8044 28.6379 18.5938 28.7252 18.4385 28.8804C18.2832 29.0357 18.196 29.2463 18.196 29.4659C18.196 30.5634 18.6319 31.6159 19.408 32.3919C20.184 33.168 21.2365 33.6039 22.334 33.6039H23.162V36.0859C23.162 36.3055 23.2492 36.5161 23.4045 36.6714C23.5598 36.8267 23.7704 36.9139 23.99 36.9139C24.2096 36.9139 24.4202 36.8267 24.5755 36.6714C24.7307 36.5161 24.818 36.3055 24.818 36.0859V33.6039H25.646C26.7434 33.6039 27.796 33.168 28.572 32.3919C29.348 31.6159 29.784 30.5634 29.784 29.4659V27.8099C29.784 26.7125 29.348 25.66 28.572 24.8839C27.796 24.1079 26.7434 23.6719 25.646 23.6719H24.818V18.7059C24.818 18.4863 24.7307 18.2757 24.5755 18.1205C24.4202 17.9652 24.2096 17.8779 23.99 17.8779C23.7704 17.8779 23.5598 17.9652 23.4045 18.1205C23.2492 18.2757 23.162 18.4863 23.162 18.7059V23.6719H22.334C21.6759 23.6714 21.0449 23.4097 20.5795 22.9444C20.1142 22.479 19.8525 21.848 19.852 21.1899V19.5339C19.8522 19.2071 19.917 18.8834 20.0426 18.5816C20.1682 18.2799 20.3521 18.0058 20.5838 17.7752C20.8155 17.5447 21.0904 17.3621 21.3928 17.238C21.6952 17.1138 22.0191 17.0506 22.346 17.0519L22.338 17.0499Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M11.71 12.2099C13.6587 10.2705 16.038 8.81892 18.654 7.97332C21.27 7.12772 24.0488 6.91207 26.764 7.34394C26.8727 7.3614 26.9838 7.35728 27.091 7.33181C27.1981 7.30633 27.2992 7.26 27.3884 7.19547C27.4776 7.13093 27.5533 7.04945 27.611 6.95568C27.6688 6.8619 27.7075 6.75767 27.725 6.64894C27.7424 6.5402 27.7383 6.42909 27.7128 6.32195C27.6874 6.21481 27.641 6.11374 27.5765 6.0245C27.512 5.93526 27.4305 5.85961 27.3367 5.80186C27.2429 5.74411 27.1387 5.7054 27.03 5.68794C23.0525 5.04153 18.9724 5.67402 15.3773 7.49435C11.7822 9.31469 8.85744 12.2289 7.02424 15.8175C5.19104 19.4061 4.54393 23.4839 5.17608 27.4637C5.80823 31.4435 7.68704 35.12 10.542 37.9639C10.7002 38.1011 10.9045 38.1732 11.1138 38.1657C11.3231 38.1583 11.5217 38.0718 11.6698 37.9238C11.8179 37.7757 11.9043 37.577 11.9118 37.3677C11.9192 37.1585 11.8471 36.9542 11.71 36.7959C10.0953 35.1818 8.81442 33.2654 7.94053 31.1561C7.06663 29.0468 6.61684 26.7861 6.61684 24.5029C6.61684 22.2198 7.06663 19.959 7.94053 17.8498C8.81442 15.7405 10.0953 13.8241 11.71 12.2099ZM37.458 11.0419C36.9116 10.4949 36.334 9.98007 35.728 9.49994C35.6147 9.39777 35.4755 9.32864 35.3256 9.30008C35.1758 9.27151 35.0209 9.28461 34.878 9.33794C34.7353 9.39119 34.6102 9.48284 34.5163 9.60276C34.4225 9.72268 34.3636 9.86621 34.3462 10.0175C34.3288 10.1688 34.3536 10.3219 34.4178 10.46C34.482 10.5981 34.5831 10.7157 34.71 10.7999C35.2627 11.2363 35.7902 11.7037 36.29 12.1999C39.5488 15.4602 41.3795 19.8812 41.3795 24.4909C41.3795 29.1006 39.5488 33.5217 36.29 36.7819C36.1739 36.881 36.0875 37.0101 36.0402 37.1552C35.9929 37.3002 35.9866 37.4555 36.022 37.6039C36.0579 37.7523 36.1341 37.888 36.2421 37.9959C36.3501 38.1038 36.4858 38.1799 36.6343 38.2156C36.7827 38.2514 36.9382 38.2455 37.0835 38.1986C37.2288 38.1518 37.3584 38.0657 37.458 37.9499C41.023 34.38 43.0254 29.5411 43.0254 24.4959C43.0254 19.4508 41.023 14.6119 37.458 11.0419Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M13.654 22.844L14.678 24.716L16.55 25.74L14.678 26.764L13.654 28.636L12.63 26.764L10.758 25.74L12.63 24.716L13.654 22.844ZM34.28 15.396L34.982 16.686L36.282 17.4L34.982 18.102L34.28 19.402L33.566 18.102L32.276 17.396L33.566 16.682L34.28 15.396ZM34.222 28.396L34.71 29.282L35.586 29.764L34.71 30.252L34.222 31.128L33.74 30.252L32.854 29.764L33.74 29.282L34.222 28.396Z",fill:"#FFF8F8"})),_S=e=>le.createElement("svg",{width:48,height:46,viewBox:"0 0 48 46",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M6 43.3579V1.35786L9.42857 3.92929L12.8571 1.35786L16.2857 3.92929L19.7143 1.35786L23.1429 3.92929L26.5714 1.35786L30 3.92929L33.4286 1.35786L36.8571 3.92929L40.2857 1.35786L42 3.07215V43.3579H6Z",fill:"#FAEFDE"}),le.createElement("path",{d:"M44.5714 39.0721H42H5.99997H3.42855C2.00826 39.0721 0.857117 40.2233 0.857117 41.6436C0.857117 43.0639 2.00826 44.215 3.42855 44.215H44.5714C45.9917 44.215 47.1428 43.0639 47.1428 41.6436C47.1428 40.2233 45.9917 39.0721 44.5714 39.0721Z",fill:"#7E8189"}),le.createElement("path",{d:"M6 36.5007H42V44.215H6V36.5007Z",fill:"#EFD8BE"}),le.createElement("path",{d:"M44.5714 38.215H42.8571V3.07215C42.8571 2.84501 42.7671 2.62644 42.606 2.46615L40.8917 0.751868C40.59 0.450154 40.1126 0.415867 39.7714 0.672153L36.8571 2.85787L33.9437 0.672153C33.6394 0.443296 33.2194 0.443296 32.9151 0.672153L30 2.85787L27.0857 0.672153C26.7814 0.442439 26.3614 0.443296 26.0571 0.672153L23.1429 2.85787L20.2286 0.672153C19.9243 0.443296 19.5043 0.443296 19.2 0.672153L16.2857 2.85787L13.3714 0.672153C13.0671 0.443296 12.6471 0.443296 12.3429 0.672153L9.42857 2.85787L6.51429 0.672153C6.25457 0.476725 5.90657 0.44501 5.61686 0.590724C5.32629 0.736439 5.14286 1.03301 5.14286 1.35787V38.215H3.42857C1.53771 38.215 0 39.7527 0 41.6436C0 43.5344 1.53771 45.0722 3.42857 45.0722H44.5714C46.4623 45.0722 48 43.5344 48 41.6436C48 39.7527 46.4623 38.215 44.5714 38.215ZM3.42857 43.3579C2.48314 43.3579 1.71429 42.589 1.71429 41.6436C1.71429 40.6982 2.48314 39.9293 3.42857 39.9293H5.14286V43.3579H3.42857ZM6.85714 43.3579V39.0739V39.0722V39.0704V38.215C7.33029 38.215 7.71429 37.831 7.71429 37.3579V35.6436C7.71429 35.1704 7.33029 34.7864 6.85714 34.7864V3.07215L8.91429 4.61501C9.21857 4.84387 9.63857 4.84387 9.94286 4.61501L12.8571 2.4293L15.7714 4.61501C16.0757 4.84387 16.4957 4.84387 16.8 4.61501L19.7143 2.4293L22.6286 4.61501C22.9329 4.84472 23.3529 4.84387 23.6571 4.61501L26.5714 2.4293L29.4857 4.61501C29.79 4.84472 30.21 4.84387 30.5143 4.61501L33.4286 2.4293L36.3429 4.61501C36.6471 4.84387 37.0671 4.84387 37.3714 4.61501L40.2051 2.49015L41.1429 3.42701V34.7864C40.6697 34.7864 40.2857 35.1704 40.2857 35.6436V37.3579C40.2857 37.831 40.6697 38.215 41.1429 38.215V43.3579H6.85714ZM44.5714 43.3579H42.8571V39.9293H44.5714C45.5169 39.9293 46.2857 40.6982 46.2857 41.6436C46.2857 42.589 45.5169 43.3579 44.5714 43.3579Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M11.1428 34.7864C10.6697 34.7864 10.2857 35.1704 10.2857 35.6436V37.3579C10.2857 37.831 10.6697 38.215 11.1428 38.215C11.616 38.215 12 37.831 12 37.3579V35.6436C12 35.1704 11.616 34.7864 11.1428 34.7864ZM15.4286 34.7864C14.9554 34.7864 14.5714 35.1704 14.5714 35.6436V37.3579C14.5714 37.831 14.9554 38.215 15.4286 38.215C15.9017 38.215 16.2857 37.831 16.2857 37.3579V35.6436C16.2857 35.1704 15.9017 34.7864 15.4286 34.7864ZM19.7143 34.7864C19.2411 34.7864 18.8571 35.1704 18.8571 35.6436V37.3579C18.8571 37.831 19.2411 38.215 19.7143 38.215C20.1874 38.215 20.5714 37.831 20.5714 37.3579V35.6436C20.5714 35.1704 20.1874 34.7864 19.7143 34.7864ZM24 34.7864C23.5268 34.7864 23.1428 35.1704 23.1428 35.6436V37.3579C23.1428 37.831 23.5268 38.215 24 38.215C24.4731 38.215 24.8571 37.831 24.8571 37.3579V35.6436C24.8571 35.1704 24.4731 34.7864 24 34.7864ZM28.2857 34.7864C27.8126 34.7864 27.4286 35.1704 27.4286 35.6436V37.3579C27.4286 37.831 27.8126 38.215 28.2857 38.215C28.7588 38.215 29.1428 37.831 29.1428 37.3579V35.6436C29.1428 35.1704 28.7588 34.7864 28.2857 34.7864ZM32.5714 34.7864C32.0983 34.7864 31.7143 35.1704 31.7143 35.6436V37.3579C31.7143 37.831 32.0983 38.215 32.5714 38.215C33.0446 38.215 33.4286 37.831 33.4286 37.3579V35.6436C33.4286 35.1704 33.0446 34.7864 32.5714 34.7864ZM36.8571 34.7864C36.384 34.7864 36 35.1704 36 35.6436V37.3579C36 37.831 36.384 38.215 36.8571 38.215C37.3303 38.215 37.7143 37.831 37.7143 37.3579V35.6436C37.7143 35.1704 37.3303 34.7864 36.8571 34.7864Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M30 10.7864H35.1429C35.616 10.7864 36 10.4024 36 9.92929C36 9.45614 35.616 9.07214 35.1429 9.07214H30C29.5269 9.07214 29.1429 9.45614 29.1429 9.92929C29.1429 10.4024 29.5269 10.7864 30 10.7864ZM26.5714 9.07214H12.8571C12.384 9.07214 12 9.45614 12 9.92929C12 10.4024 12.384 10.7864 12.8571 10.7864H26.5714C27.0446 10.7864 27.4286 10.4024 27.4286 9.92929C27.4286 9.45614 27.0446 9.07214 26.5714 9.07214ZM12.8571 14.215H22.2857C22.7589 14.215 23.1429 13.831 23.1429 13.3579C23.1429 12.8847 22.7589 12.5007 22.2857 12.5007H12.8571C12.384 12.5007 12 12.8847 12 13.3579C12 13.831 12.384 14.215 12.8571 14.215ZM12.8571 21.0721H21.4286C21.9017 21.0721 22.2857 20.6881 22.2857 20.215C22.2857 19.7419 21.9017 19.3579 21.4286 19.3579H12.8571C12.384 19.3579 12 19.7419 12 20.215C12 20.6881 12.384 21.0721 12.8571 21.0721Z",fill:"#A5BAC6"}),le.createElement("path",{d:"M21.4286 26.215H19.7143C19.2411 26.215 18.8571 26.599 18.8571 27.0722C18.8571 27.5453 19.2411 27.9293 19.7143 27.9293H21.4286C21.9017 27.9293 22.2857 27.5453 22.2857 27.0722C22.2857 26.599 21.9017 26.215 21.4286 26.215ZM16.2857 26.215H12.8571C12.384 26.215 12 26.599 12 27.0722C12 27.5453 12.384 27.9293 12.8571 27.9293H16.2857C16.7589 27.9293 17.1429 27.5453 17.1429 27.0722C17.1429 26.599 16.7589 26.215 16.2857 26.215ZM24 22.7864H12.8571C12.384 22.7864 12 23.1704 12 23.6436C12 24.1167 12.384 24.5007 12.8571 24.5007H24C24.4731 24.5007 24.8571 24.1167 24.8571 23.6436C24.8571 23.1704 24.4731 22.7864 24 22.7864Z",fill:"#EB9697"}),le.createElement("path",{d:"M36 24.5007C36 23.083 34.8463 21.9293 33.4286 21.9293H31.7143C31.242 21.9293 30.8572 21.5444 30.8572 21.0722V18.5007C30.8572 18.0284 31.242 17.6436 31.7143 17.6436H33.4286C33.9009 17.6436 34.2857 18.0284 34.2857 18.5007V19.3579C34.2857 19.831 34.6697 20.215 35.1429 20.215C35.616 20.215 36 19.831 36 19.3579V18.5007C36 17.083 34.8463 15.9293 33.4286 15.9293V15.0722C33.4286 14.599 33.0446 14.215 32.5715 14.215C32.0983 14.215 31.7143 14.599 31.7143 15.0722V15.9293C30.2966 15.9293 29.1429 17.083 29.1429 18.5007V21.0722C29.1429 22.4899 30.2966 23.6436 31.7143 23.6436H33.4286C33.9009 23.6436 34.2857 24.0284 34.2857 24.5007V27.0722C34.2857 27.5444 33.9009 27.9293 33.4286 27.9293H31.7143C31.242 27.9293 30.8572 27.5444 30.8572 27.0722V26.215C30.8572 25.7419 30.4732 25.3579 30 25.3579C29.5269 25.3579 29.1429 25.7419 29.1429 26.215V27.0722C29.1429 28.4899 30.2966 29.6436 31.7143 29.6436V30.5007C31.7143 30.9739 32.0983 31.3579 32.5715 31.3579C33.0446 31.3579 33.4286 30.9739 33.4286 30.5007V29.6436C34.8463 29.6436 36 28.4899 36 27.0722V24.5007Z",fill:"#98C77C"})),VS=e=>le.createElement("svg",{width:48,height:49,viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M44.2069 35.2586C44.2069 35.2586 42.5517 39.3965 32.6207 39.3965C24.3448 39.3965 21.0345 34.431 21.0345 34.431V5.46551C21.0345 5.46551 22.2759 2.15517 32.4138 2.15517C42.5517 2.15517 44.2069 5.46551 44.2069 5.46551V35.2586Z",fill:"#FFEB9B"}),le.createElement("path",{d:"M26 43.5345C26 43.5345 22.6896 46.8448 14.4138 46.8448C6.13792 46.8448 2.82758 43.5345 2.82758 43.5345V17.8793C2.82758 17.8793 4.06895 14.569 14.2069 14.569C24.3448 14.569 26 17.8793 26 17.8793V43.5345Z",fill:"#FFEB9B"}),le.createElement("path",{d:"M26 43.5345C26 43.5345 21.862 47.6724 16.8965 47.6724C10.2758 47.6724 8.62067 46.8448 8.62067 46.8448V22.0172C8.62067 22.0172 11.931 22.8448 16.8965 22.8448C22.6896 22.8448 26 19.5345 26 18.7069C26 17.8793 26 43.5345 26 43.5345ZM44.2069 35.2586C44.2069 35.2586 40.0689 39.3965 35.1034 39.3965C28.4827 39.3965 26.8276 38.569 26.8276 38.569V8.77586C26.8276 8.77586 30.1379 9.60345 35.1034 9.60345C41.7241 9.60345 44.2069 5.46552 44.2069 5.46552V35.2586Z",fill:"#F9DD8F"}),le.createElement("path",{d:"M18.5518 22.7199V47.5185C22.7476 46.7786 26 43.5345 26 43.5345C26 43.5345 26 16.2241 26 17.8793C26 19.5345 23.3112 22.0495 18.5518 22.7199ZM36.7587 9.47849V39.2426C40.9545 38.5028 44.2069 35.2586 44.2069 35.2586V4.63794C44.2069 4.63794 43.3793 8.77587 36.7587 9.47849Z",fill:"#EFC88E"}),le.createElement("path",{d:"M20.2069 5.46552H21.8621V16.0859H20.2069V5.46552Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M32.6207 10.431C26.1233 10.431 20.2069 8.06497 20.2069 5.46552C20.2069 2.86607 26.1233 0.5 32.6207 0.5C39.1181 0.5 45.0345 2.86607 45.0345 5.46552C45.0345 5.92317 44.6646 6.2931 44.2069 6.2931C43.7493 6.2931 43.3793 5.92317 43.3793 5.46552C43.3793 4.51131 39.0916 2.15517 32.6207 2.15517C26.1498 2.15517 21.8621 4.51131 21.8621 5.46552C21.8621 6.41972 26.1498 8.77586 32.6207 8.77586C33.0784 8.77586 33.4483 9.14579 33.4483 9.60345C33.4483 10.0611 33.0784 10.431 32.6207 10.431Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M35.9583 10.2192C35.5479 10.2192 35.1912 9.91461 35.1382 9.49668C35.0811 9.04316 35.4006 8.62854 35.8541 8.57061C36.9639 8.42909 38.0273 8.21723 39.0146 7.94082C39.4508 7.81999 39.9117 8.07406 40.0342 8.51433C40.1575 8.95461 39.901 9.41144 39.4607 9.53392C38.3956 9.83185 37.2527 10.0603 36.0643 10.2117C36.0287 10.2167 35.9931 10.2192 35.9583 10.2192ZM14.4138 23.6724C7.91641 23.6724 2 21.3063 2 18.7069C2 16.1074 7.91641 13.7414 14.4138 13.7414C20.9112 13.7414 26.8276 16.1074 26.8276 18.7069C26.8276 19.1645 26.4577 19.5345 26 19.5345C25.5423 19.5345 25.1724 19.1645 25.1724 18.7069C25.1724 17.7527 20.8847 15.3965 14.4138 15.3965C7.9429 15.3965 3.65517 17.7527 3.65517 18.7069C3.65517 19.6611 7.9429 22.0172 14.4138 22.0172C14.8714 22.0172 15.2414 22.3872 15.2414 22.8448C15.2414 23.3025 14.8714 23.6724 14.4138 23.6724Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M17.8317 23.4506C17.4221 23.4506 17.0662 23.1477 17.0124 22.7306C16.9528 22.2779 17.2714 21.8616 17.725 21.8029C18.8083 21.6605 19.8477 21.4512 20.8143 21.1805C21.2497 21.0589 21.7114 21.3138 21.8339 21.7541C21.9572 22.1943 21.7007 22.6512 21.2604 22.7736C20.2177 23.0658 19.1012 23.2909 17.9393 23.4432C17.9037 23.4481 17.8673 23.4506 17.8317 23.4506ZM14.4138 28.6379C7.91641 28.6379 2 26.2719 2 23.6724H3.65517C3.65517 24.6266 7.9429 26.9828 14.4138 26.9828C20.8847 26.9828 25.1724 24.6266 25.1724 23.6724H26.8276C26.8276 26.2719 20.9112 28.6379 14.4138 28.6379ZM14.4138 38.569C7.91641 38.569 2 36.2029 2 33.6034H3.65517C3.65517 34.5576 7.9429 36.9138 14.4138 36.9138C20.8847 36.9138 25.1724 34.5576 25.1724 33.6034H26.8276C26.8276 36.2029 20.9112 38.569 14.4138 38.569ZM14.4138 33.6034C7.91641 33.6034 2 31.2374 2 28.6379H3.65517C3.65517 29.5921 7.9429 31.9483 14.4138 31.9483C20.8847 31.9483 25.1724 29.5921 25.1724 28.6379H26.8276C26.8276 31.2374 20.9112 33.6034 14.4138 33.6034ZM14.4138 43.5345C7.91641 43.5345 2 41.1684 2 38.569H3.65517C3.65517 39.5232 7.9429 41.8793 14.4138 41.8793C20.8847 41.8793 25.1724 39.5232 25.1724 38.569H26.8276C26.8276 41.1684 20.9112 43.5345 14.4138 43.5345ZM32.6207 15.3965C26.1233 15.3965 20.2069 13.0305 20.2069 10.431H21.8621C21.8621 11.3852 26.1498 13.7414 32.6207 13.7414C39.0916 13.7414 43.3793 11.3852 43.3793 10.431H45.0345C45.0345 13.0305 39.1181 15.3965 32.6207 15.3965ZM32.6207 20.3621C30.2662 20.3621 27.92 20.0575 25.8378 19.4823L26.2789 17.8868C28.2204 18.423 30.4127 18.7069 32.6207 18.7069C39.0916 18.7069 43.3793 16.3508 43.3793 15.3965H45.0345C45.0345 17.996 39.1181 20.3621 32.6207 20.3621Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M32.6207 25.3276C30.2513 25.3276 27.8935 25.0197 25.8022 24.4371L26.2466 22.8432C28.1947 23.3852 30.3986 23.6724 32.6207 23.6724C39.0916 23.6724 43.3793 21.3163 43.3793 20.3621H45.0345C45.0345 22.9615 39.118 25.3276 32.6207 25.3276ZM32.6207 30.2931C30.2496 30.2931 27.8902 29.9844 25.7972 29.401L26.2416 27.807C28.1914 28.3499 30.3969 28.6379 32.6207 28.6379C39.0916 28.6379 43.3793 26.2818 43.3793 25.3276H45.0345C45.0345 27.927 39.118 30.2931 32.6207 30.2931ZM32.6207 35.2586C30.2438 35.2586 27.8778 34.9483 25.7773 34.3615L26.2234 32.7676C28.1798 33.3138 30.392 33.6034 32.6207 33.6034C39.0916 33.6034 43.3793 31.2473 43.3793 30.2931H45.0345C45.0345 32.8925 39.118 35.2586 32.6207 35.2586Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M32.6207 40.2241C30.2513 40.2241 27.8935 39.9163 25.8022 39.3336L26.2466 37.7397C28.1947 38.2818 30.3986 38.569 32.6207 38.569C39.0916 38.569 43.3793 36.2128 43.3793 35.2586V5.46552H45.0345V35.2586C45.0345 37.8581 39.118 40.2241 32.6207 40.2241Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M14.4138 48.5C7.91641 48.5 2 46.1339 2 43.5345V18.7069H3.65517V43.5345C3.65517 44.4887 7.9429 46.8448 14.4138 46.8448C20.8847 46.8448 25.1724 44.4887 25.1724 43.5345V18.7069H26.8276V43.5345C26.8276 46.1339 20.9112 48.5 14.4138 48.5ZM17.7241 2.98275H16.069C15.6113 2.98275 15.2414 2.61282 15.2414 2.15516C15.2414 1.69751 15.6113 1.32758 16.069 1.32758H17.7241C18.1818 1.32758 18.5517 1.69751 18.5517 2.15516C18.5517 2.61282 18.1818 2.98275 17.7241 2.98275ZM17.7241 7.12068H16.069C15.6113 7.12068 15.2414 6.75075 15.2414 6.29309C15.2414 5.83544 15.6113 5.46551 16.069 5.46551H17.7241C18.1818 5.46551 18.5517 5.83544 18.5517 6.29309C18.5517 6.75075 18.1818 7.12068 17.7241 7.12068ZM17.7241 11.2586H16.069C15.6113 11.2586 15.2414 10.8887 15.2414 10.431C15.2414 9.97337 15.6113 9.60344 16.069 9.60344H17.7241C18.1818 9.60344 18.5517 9.97337 18.5517 10.431C18.5517 10.8887 18.1818 11.2586 17.7241 11.2586Z",fill:"#8D6C9F"})),An=t.appLocale.getLocalizedStrings().cockpit.portfolio,Yi=({totalCashBalance:e,totalExpenses:n,totalRevenues:r,companyNameSticky:i})=>o.jsxRuntimeExports.jsxs(US,{companyNameSticky:i,children:[o.jsxRuntimeExports.jsxs(On,{children:[o.jsxRuntimeExports.jsx(Ht,{children:o.jsxRuntimeExports.jsx(BS,{})}),o.jsxRuntimeExports.jsxs(Ht,{children:[o.jsxRuntimeExports.jsx(Nn,{textColor:t.getCockpitColor("cashBalance"),children:t.amountToString("0,0",e)}),o.jsxRuntimeExports.jsx(Mn,{children:An.cashUnderManagementText})]})]}),o.jsxRuntimeExports.jsxs(On,{children:[o.jsxRuntimeExports.jsx(Ht,{children:o.jsxRuntimeExports.jsx(_S,{})}),o.jsxRuntimeExports.jsxs(Ht,{children:[o.jsxRuntimeExports.jsx(Nn,{textColor:t.getCockpitColor("expenses"),children:t.amountToString("0,0",n)}),o.jsxRuntimeExports.jsx(Mn,{children:An.expensesAcrossAllCustomersText})]})]}),o.jsxRuntimeExports.jsxs(On,{children:[o.jsxRuntimeExports.jsx(Ht,{children:o.jsxRuntimeExports.jsx(VS,{})}),o.jsxRuntimeExports.jsxs(Ht,{children:[o.jsxRuntimeExports.jsx(Nn,{textColor:t.getCockpitColor("revenues"),children:t.amountToString("0,0",r)}),o.jsxRuntimeExports.jsx(Mn,{children:An.revenuesAcrossAllCustomersText})]})]})]}),US=s.div`
2881
+ `,BS=e=>le.createElement("svg",{width:48,height:49,viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M23.994 6.29199C20.3944 6.29199 16.8756 7.3594 13.8826 9.35924C10.8897 11.3591 8.55692 14.2015 7.17941 17.5271C5.80189 20.8528 5.44147 24.5122 6.14372 28.0426C6.84597 31.5731 8.57935 34.816 11.1247 37.3613C13.67 39.9066 16.9129 41.64 20.4434 42.3423C23.9738 43.0445 27.6332 42.6841 30.9588 41.3066C34.2845 39.9291 37.1269 37.5963 39.1268 34.6034C41.1266 31.6104 42.194 28.0916 42.194 24.492C42.194 22.1019 41.7232 19.7353 40.8086 17.5271C39.894 15.319 38.5534 13.3127 36.8633 11.6226C35.1733 9.93262 33.167 8.59202 30.9588 7.67738C28.7507 6.76275 26.3841 6.29199 23.994 6.29199Z",fill:"#F9E3AE"}),le.createElement("path",{d:"M8.86603 42.1201C11.0593 44.2078 13.6416 45.8442 16.466 46.9361L44.69 18.7081V13.3861C43.8158 11.9373 42.7857 10.5886 41.618 9.36406L8.86603 42.1201ZM7.25203 40.4221L39.726 7.94806H34.76L5.14803 37.5601C5.77565 38.5661 6.47902 39.5229 7.25203 40.4221ZM4.79203 34.6061L32.276 7.12206L29.794 5.46606L3.60803 31.6521C3.93426 32.6628 4.32987 33.6498 4.79203 34.6061Z",fill:"#FFEFCA"}),le.createElement("path",{d:"M24 1.32788C19.417 1.32788 14.937 2.68689 11.1263 5.23307C7.31572 7.77924 4.34571 11.3982 2.59188 15.6323C0.838043 19.8665 0.37916 24.5256 1.27326 29.0205C2.16735 33.5154 4.37427 37.6443 7.61493 40.885C10.8556 44.1256 14.9845 46.3325 19.4794 47.2266C23.9743 48.1207 28.6334 47.6618 32.8675 45.908C37.1017 44.1542 40.7206 41.1842 43.2668 37.3735C45.813 33.5629 47.172 29.0829 47.172 24.4999C47.172 18.3543 44.7307 12.4604 40.3851 8.1148C36.0395 3.76921 30.1456 1.32788 24 1.32788ZM24 42.7079C21.0282 42.7036 18.1025 41.9717 15.4788 40.576C12.855 39.1803 10.613 37.1634 8.9485 34.7014C7.28402 32.2394 6.24775 29.4072 5.93024 26.4524C5.61273 23.4975 6.02363 20.5099 7.12705 17.7504C8.23047 14.991 9.99283 12.5438 12.2602 10.6225C14.5275 8.70128 17.2308 7.36449 20.1339 6.72895C23.037 6.0934 26.0516 6.17844 28.9143 6.97663C31.7769 7.77482 34.4006 9.26187 36.556 11.3079L37.118 11.8599C37.3313 12.0825 37.538 12.3085 37.738 12.5379C40.0344 15.1727 41.5236 18.4131 42.0276 21.8717C42.5315 25.3304 42.0289 28.861 40.5798 32.0416C39.1307 35.2222 36.7965 37.9183 33.856 39.8076C30.9155 41.697 27.4932 42.6997 23.998 42.6959L24 42.7079Z",fill:"#F6D397"}),le.createElement("path",{d:"M32.192 9.06799C32.3774 9.06725 32.5571 9.00433 32.7025 8.8893C32.8479 8.77426 32.9504 8.61378 32.9937 8.43354C33.0371 8.25331 33.0187 8.06374 32.9415 7.89521C32.8643 7.72667 32.7328 7.58891 32.568 7.50399C31.9491 7.19298 31.3135 6.91655 30.664 6.67599C30.4615 6.60992 30.2413 6.62464 30.0494 6.71706C29.8575 6.80949 29.7087 6.97247 29.6341 7.17199C29.5595 7.37151 29.5649 7.59213 29.6491 7.78779C29.7333 7.98345 29.8898 8.13901 30.086 8.22199C30.6776 8.44532 31.2571 8.69967 31.822 8.98399C31.9377 9.03856 32.064 9.06723 32.192 9.06799Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M24 0.5C19.2533 0.5 14.6131 1.90758 10.6663 4.54473C6.71954 7.18188 3.6434 10.9302 1.8269 15.3156C0.0103989 19.701 -0.464881 24.5266 0.461164 29.1822C1.38721 33.8377 3.67299 38.1141 7.02945 41.4706C10.3859 44.827 14.6623 47.1128 19.3178 48.0388C23.9734 48.9649 28.799 48.4896 33.1844 46.6731C37.5698 44.8566 41.3181 41.7805 43.9553 37.8337C46.5924 33.8869 48 29.2467 48 24.5C48 18.1348 45.4714 12.0303 40.9706 7.52944C36.4697 3.02856 30.3652 0.5 24 0.5ZM24 46.844C19.5808 46.844 15.2608 45.5335 11.5863 43.0783C7.9119 40.6232 5.04801 37.1335 3.35685 33.0507C1.66568 28.9678 1.2232 24.4752 2.08534 20.1409C2.94749 15.8066 5.07555 11.8253 8.20041 8.7004C11.3253 5.57554 15.3066 3.44748 19.6409 2.58533C23.9752 1.72319 28.4678 2.16567 32.5507 3.85684C36.6335 5.548 40.1232 8.41189 42.5784 12.0863C45.0336 15.7608 46.344 20.0808 46.344 24.5C46.3435 30.4258 43.9892 36.1088 39.799 40.299C35.6088 44.4892 29.9258 46.8435 24 46.844Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M24 40.2239C23.7805 40.2245 23.5702 40.3119 23.4151 40.467C23.2599 40.6222 23.1725 40.8325 23.172 41.0519V42.7079C23.172 42.9275 23.2592 43.1381 23.4145 43.2934C23.5698 43.4487 23.7804 43.5359 24 43.5359C24.2196 43.5359 24.4302 43.4487 24.5855 43.2934C24.7407 43.1381 24.828 42.9275 24.828 42.7079V41.0519C24.8274 40.8325 24.74 40.6222 24.5849 40.467C24.4297 40.3119 24.2194 40.2245 24 40.2239ZM28.958 40.2859C28.9004 40.0738 28.7609 39.8931 28.5702 39.7838C28.3795 39.6745 28.1531 39.6454 27.941 39.7029C27.7288 39.7605 27.5482 39.9 27.4389 40.0907C27.3295 40.2814 27.3004 40.5078 27.358 40.7199L27.788 42.3199C27.8585 42.5177 28.0013 42.6814 28.1875 42.7783C28.3737 42.8753 28.5897 42.8982 28.7922 42.8425C28.9946 42.7869 29.1685 42.6567 29.279 42.4782C29.3895 42.2997 29.4284 42.0859 29.388 41.8799L28.958 40.2859ZM16.338 38.1679C16.2435 38.113 16.139 38.0775 16.0306 38.0632C15.9222 38.049 15.8121 38.0564 15.7067 38.0851C15.6012 38.1137 15.5024 38.163 15.4161 38.2301C15.3299 38.2972 15.2577 38.3808 15.204 38.4759L14.376 39.9079C14.2783 40.097 14.2571 40.3164 14.3169 40.5207C14.3767 40.7249 14.5129 40.8983 14.6971 41.0048C14.8813 41.1114 15.0995 41.1429 15.3064 41.0928C15.5132 41.0427 15.6929 40.9149 15.808 40.7359L16.636 39.3039C16.6913 39.21 16.7274 39.1061 16.7424 38.9981C16.7573 38.8902 16.7508 38.7803 16.7231 38.6749C16.6954 38.5695 16.6471 38.4706 16.581 38.3839C16.5149 38.2973 16.4323 38.2245 16.338 38.1699V38.1679ZM32.784 38.4759C32.6689 38.2969 32.4892 38.1691 32.2824 38.1191C32.0755 38.069 31.8573 38.1005 31.6731 38.207C31.4889 38.3135 31.3527 38.4869 31.2929 38.6912C31.2331 38.8954 31.2543 39.1149 31.352 39.3039L32.18 40.7359C32.2314 40.8355 32.3025 40.9235 32.3889 40.9948C32.4754 41.066 32.5754 41.119 32.6829 41.1505C32.7904 41.1819 32.9032 41.1913 33.0145 41.1779C33.1257 41.1645 33.233 41.1287 33.33 41.0726C33.427 41.0165 33.5116 40.9414 33.5787 40.8516C33.6458 40.7619 33.694 40.6595 33.7203 40.5506C33.7467 40.4417 33.7507 40.3286 33.732 40.2182C33.7134 40.1077 33.6726 40.0022 33.612 39.9079L32.784 38.4759ZM20.03 39.7019C19.8181 39.6457 19.5926 39.6759 19.4028 39.7857C19.2131 39.8956 19.0747 40.0762 19.018 40.2879L18.588 41.8879C18.5597 41.993 18.5525 42.1026 18.5666 42.2104C18.5807 42.3183 18.6159 42.4223 18.6703 42.5166C18.7246 42.6108 18.7969 42.6935 18.8832 42.7598C18.9695 42.826 19.0679 42.8747 19.173 42.9029C19.278 42.9312 19.3876 42.9384 19.4955 42.9243C19.6034 42.9102 19.7074 42.875 19.8016 42.8206C19.8959 42.7663 19.9785 42.694 20.0448 42.6077C20.1111 42.5215 20.1597 42.423 20.188 42.3179L20.622 40.7179C20.6783 40.506 20.6485 40.2805 20.5391 40.0905C20.4296 39.9005 20.2495 39.7616 20.038 39.7039L20.03 39.7019ZM22.338 17.0499H25.648C26.3061 17.0505 26.9371 17.3121 27.4024 17.7775C27.8678 18.2428 28.1294 18.8738 28.13 19.5319C28.13 19.7515 28.2172 19.9621 28.3725 20.1174C28.5278 20.2727 28.7384 20.3599 28.958 20.3599C29.1776 20.3599 29.3882 20.2727 29.5435 20.1174C29.6987 19.9621 29.786 19.7515 29.786 19.5319C29.786 18.4345 29.35 17.382 28.574 16.6059C27.798 15.8299 26.7454 15.3939 25.648 15.3939H24.82V12.9139C24.82 12.6943 24.7327 12.4837 24.5775 12.3285C24.4222 12.1732 24.2116 12.0859 23.992 12.0859C23.7724 12.0859 23.5618 12.1732 23.4065 12.3285C23.2512 12.4837 23.164 12.6943 23.164 12.9139V15.3959H22.336C21.2385 15.3959 20.186 15.8319 19.41 16.6079C18.6339 17.384 18.198 18.4365 18.198 19.5339V21.1899C18.198 22.2874 18.6339 23.3399 19.41 24.1159C20.186 24.892 21.2385 25.3279 22.336 25.3279H25.646C26.3041 25.3285 26.9351 25.5901 27.4004 26.0555C27.8658 26.5208 28.1274 27.1518 28.128 27.8099V29.4659C28.1274 30.124 27.8658 30.755 27.4004 31.2204C26.9351 31.6857 26.3041 31.9474 25.646 31.9479H24.818V26.9819C24.818 26.7623 24.7307 26.5517 24.5755 26.3965C24.4202 26.2412 24.2096 26.1539 23.99 26.1539C23.7704 26.1539 23.5598 26.2412 23.4045 26.3965C23.2492 26.5517 23.162 26.7623 23.162 26.9819V31.9479H22.334C21.6759 31.9474 21.0449 31.6857 20.5795 31.2204C20.1142 30.755 19.8525 30.124 19.852 29.4659C19.852 29.2463 19.7647 29.0357 19.6095 28.8804C19.4542 28.7252 19.2436 28.6379 19.024 28.6379C18.8044 28.6379 18.5938 28.7252 18.4385 28.8804C18.2832 29.0357 18.196 29.2463 18.196 29.4659C18.196 30.5634 18.6319 31.6159 19.408 32.3919C20.184 33.168 21.2365 33.6039 22.334 33.6039H23.162V36.0859C23.162 36.3055 23.2492 36.5161 23.4045 36.6714C23.5598 36.8267 23.7704 36.9139 23.99 36.9139C24.2096 36.9139 24.4202 36.8267 24.5755 36.6714C24.7307 36.5161 24.818 36.3055 24.818 36.0859V33.6039H25.646C26.7434 33.6039 27.796 33.168 28.572 32.3919C29.348 31.6159 29.784 30.5634 29.784 29.4659V27.8099C29.784 26.7125 29.348 25.66 28.572 24.8839C27.796 24.1079 26.7434 23.6719 25.646 23.6719H24.818V18.7059C24.818 18.4863 24.7307 18.2757 24.5755 18.1205C24.4202 17.9652 24.2096 17.8779 23.99 17.8779C23.7704 17.8779 23.5598 17.9652 23.4045 18.1205C23.2492 18.2757 23.162 18.4863 23.162 18.7059V23.6719H22.334C21.6759 23.6714 21.0449 23.4097 20.5795 22.9444C20.1142 22.479 19.8525 21.848 19.852 21.1899V19.5339C19.8522 19.2071 19.917 18.8834 20.0426 18.5816C20.1682 18.2799 20.3521 18.0058 20.5838 17.7752C20.8155 17.5447 21.0904 17.3621 21.3928 17.238C21.6952 17.1138 22.0191 17.0506 22.346 17.0519L22.338 17.0499Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M11.71 12.2099C13.6587 10.2705 16.038 8.81892 18.654 7.97332C21.27 7.12772 24.0488 6.91207 26.764 7.34394C26.8727 7.3614 26.9838 7.35728 27.091 7.33181C27.1981 7.30633 27.2992 7.26 27.3884 7.19547C27.4776 7.13093 27.5533 7.04945 27.611 6.95568C27.6688 6.8619 27.7075 6.75767 27.725 6.64894C27.7424 6.5402 27.7383 6.42909 27.7128 6.32195C27.6874 6.21481 27.641 6.11374 27.5765 6.0245C27.512 5.93526 27.4305 5.85961 27.3367 5.80186C27.2429 5.74411 27.1387 5.7054 27.03 5.68794C23.0525 5.04153 18.9724 5.67402 15.3773 7.49435C11.7822 9.31469 8.85744 12.2289 7.02424 15.8175C5.19104 19.4061 4.54393 23.4839 5.17608 27.4637C5.80823 31.4435 7.68704 35.12 10.542 37.9639C10.7002 38.1011 10.9045 38.1732 11.1138 38.1657C11.3231 38.1583 11.5217 38.0718 11.6698 37.9238C11.8179 37.7757 11.9043 37.577 11.9118 37.3677C11.9192 37.1585 11.8471 36.9542 11.71 36.7959C10.0953 35.1818 8.81442 33.2654 7.94053 31.1561C7.06663 29.0468 6.61684 26.7861 6.61684 24.5029C6.61684 22.2198 7.06663 19.959 7.94053 17.8498C8.81442 15.7405 10.0953 13.8241 11.71 12.2099ZM37.458 11.0419C36.9116 10.4949 36.334 9.98007 35.728 9.49994C35.6147 9.39777 35.4755 9.32864 35.3256 9.30008C35.1758 9.27151 35.0209 9.28461 34.878 9.33794C34.7353 9.39119 34.6102 9.48284 34.5163 9.60276C34.4225 9.72268 34.3636 9.86621 34.3462 10.0175C34.3288 10.1688 34.3536 10.3219 34.4178 10.46C34.482 10.5981 34.5831 10.7157 34.71 10.7999C35.2627 11.2363 35.7902 11.7037 36.29 12.1999C39.5488 15.4602 41.3795 19.8812 41.3795 24.4909C41.3795 29.1006 39.5488 33.5217 36.29 36.7819C36.1739 36.881 36.0875 37.0101 36.0402 37.1552C35.9929 37.3002 35.9866 37.4555 36.022 37.6039C36.0579 37.7523 36.1341 37.888 36.2421 37.9959C36.3501 38.1038 36.4858 38.1799 36.6343 38.2156C36.7827 38.2514 36.9382 38.2455 37.0835 38.1986C37.2288 38.1518 37.3584 38.0657 37.458 37.9499C41.023 34.38 43.0254 29.5411 43.0254 24.4959C43.0254 19.4508 41.023 14.6119 37.458 11.0419Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M13.654 22.844L14.678 24.716L16.55 25.74L14.678 26.764L13.654 28.636L12.63 26.764L10.758 25.74L12.63 24.716L13.654 22.844ZM34.28 15.396L34.982 16.686L36.282 17.4L34.982 18.102L34.28 19.402L33.566 18.102L32.276 17.396L33.566 16.682L34.28 15.396ZM34.222 28.396L34.71 29.282L35.586 29.764L34.71 30.252L34.222 31.128L33.74 30.252L32.854 29.764L33.74 29.282L34.222 28.396Z",fill:"#FFF8F8"})),_S=e=>le.createElement("svg",{width:48,height:46,viewBox:"0 0 48 46",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M6 43.3579V1.35786L9.42857 3.92929L12.8571 1.35786L16.2857 3.92929L19.7143 1.35786L23.1429 3.92929L26.5714 1.35786L30 3.92929L33.4286 1.35786L36.8571 3.92929L40.2857 1.35786L42 3.07215V43.3579H6Z",fill:"#FAEFDE"}),le.createElement("path",{d:"M44.5714 39.0721H42H5.99997H3.42855C2.00826 39.0721 0.857117 40.2233 0.857117 41.6436C0.857117 43.0639 2.00826 44.215 3.42855 44.215H44.5714C45.9917 44.215 47.1428 43.0639 47.1428 41.6436C47.1428 40.2233 45.9917 39.0721 44.5714 39.0721Z",fill:"#7E8189"}),le.createElement("path",{d:"M6 36.5007H42V44.215H6V36.5007Z",fill:"#EFD8BE"}),le.createElement("path",{d:"M44.5714 38.215H42.8571V3.07215C42.8571 2.84501 42.7671 2.62644 42.606 2.46615L40.8917 0.751868C40.59 0.450154 40.1126 0.415867 39.7714 0.672153L36.8571 2.85787L33.9437 0.672153C33.6394 0.443296 33.2194 0.443296 32.9151 0.672153L30 2.85787L27.0857 0.672153C26.7814 0.442439 26.3614 0.443296 26.0571 0.672153L23.1429 2.85787L20.2286 0.672153C19.9243 0.443296 19.5043 0.443296 19.2 0.672153L16.2857 2.85787L13.3714 0.672153C13.0671 0.443296 12.6471 0.443296 12.3429 0.672153L9.42857 2.85787L6.51429 0.672153C6.25457 0.476725 5.90657 0.44501 5.61686 0.590724C5.32629 0.736439 5.14286 1.03301 5.14286 1.35787V38.215H3.42857C1.53771 38.215 0 39.7527 0 41.6436C0 43.5344 1.53771 45.0722 3.42857 45.0722H44.5714C46.4623 45.0722 48 43.5344 48 41.6436C48 39.7527 46.4623 38.215 44.5714 38.215ZM3.42857 43.3579C2.48314 43.3579 1.71429 42.589 1.71429 41.6436C1.71429 40.6982 2.48314 39.9293 3.42857 39.9293H5.14286V43.3579H3.42857ZM6.85714 43.3579V39.0739V39.0722V39.0704V38.215C7.33029 38.215 7.71429 37.831 7.71429 37.3579V35.6436C7.71429 35.1704 7.33029 34.7864 6.85714 34.7864V3.07215L8.91429 4.61501C9.21857 4.84387 9.63857 4.84387 9.94286 4.61501L12.8571 2.4293L15.7714 4.61501C16.0757 4.84387 16.4957 4.84387 16.8 4.61501L19.7143 2.4293L22.6286 4.61501C22.9329 4.84472 23.3529 4.84387 23.6571 4.61501L26.5714 2.4293L29.4857 4.61501C29.79 4.84472 30.21 4.84387 30.5143 4.61501L33.4286 2.4293L36.3429 4.61501C36.6471 4.84387 37.0671 4.84387 37.3714 4.61501L40.2051 2.49015L41.1429 3.42701V34.7864C40.6697 34.7864 40.2857 35.1704 40.2857 35.6436V37.3579C40.2857 37.831 40.6697 38.215 41.1429 38.215V43.3579H6.85714ZM44.5714 43.3579H42.8571V39.9293H44.5714C45.5169 39.9293 46.2857 40.6982 46.2857 41.6436C46.2857 42.589 45.5169 43.3579 44.5714 43.3579Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M11.1428 34.7864C10.6697 34.7864 10.2857 35.1704 10.2857 35.6436V37.3579C10.2857 37.831 10.6697 38.215 11.1428 38.215C11.616 38.215 12 37.831 12 37.3579V35.6436C12 35.1704 11.616 34.7864 11.1428 34.7864ZM15.4286 34.7864C14.9554 34.7864 14.5714 35.1704 14.5714 35.6436V37.3579C14.5714 37.831 14.9554 38.215 15.4286 38.215C15.9017 38.215 16.2857 37.831 16.2857 37.3579V35.6436C16.2857 35.1704 15.9017 34.7864 15.4286 34.7864ZM19.7143 34.7864C19.2411 34.7864 18.8571 35.1704 18.8571 35.6436V37.3579C18.8571 37.831 19.2411 38.215 19.7143 38.215C20.1874 38.215 20.5714 37.831 20.5714 37.3579V35.6436C20.5714 35.1704 20.1874 34.7864 19.7143 34.7864ZM24 34.7864C23.5268 34.7864 23.1428 35.1704 23.1428 35.6436V37.3579C23.1428 37.831 23.5268 38.215 24 38.215C24.4731 38.215 24.8571 37.831 24.8571 37.3579V35.6436C24.8571 35.1704 24.4731 34.7864 24 34.7864ZM28.2857 34.7864C27.8126 34.7864 27.4286 35.1704 27.4286 35.6436V37.3579C27.4286 37.831 27.8126 38.215 28.2857 38.215C28.7588 38.215 29.1428 37.831 29.1428 37.3579V35.6436C29.1428 35.1704 28.7588 34.7864 28.2857 34.7864ZM32.5714 34.7864C32.0983 34.7864 31.7143 35.1704 31.7143 35.6436V37.3579C31.7143 37.831 32.0983 38.215 32.5714 38.215C33.0446 38.215 33.4286 37.831 33.4286 37.3579V35.6436C33.4286 35.1704 33.0446 34.7864 32.5714 34.7864ZM36.8571 34.7864C36.384 34.7864 36 35.1704 36 35.6436V37.3579C36 37.831 36.384 38.215 36.8571 38.215C37.3303 38.215 37.7143 37.831 37.7143 37.3579V35.6436C37.7143 35.1704 37.3303 34.7864 36.8571 34.7864Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M30 10.7864H35.1429C35.616 10.7864 36 10.4024 36 9.92929C36 9.45614 35.616 9.07214 35.1429 9.07214H30C29.5269 9.07214 29.1429 9.45614 29.1429 9.92929C29.1429 10.4024 29.5269 10.7864 30 10.7864ZM26.5714 9.07214H12.8571C12.384 9.07214 12 9.45614 12 9.92929C12 10.4024 12.384 10.7864 12.8571 10.7864H26.5714C27.0446 10.7864 27.4286 10.4024 27.4286 9.92929C27.4286 9.45614 27.0446 9.07214 26.5714 9.07214ZM12.8571 14.215H22.2857C22.7589 14.215 23.1429 13.831 23.1429 13.3579C23.1429 12.8847 22.7589 12.5007 22.2857 12.5007H12.8571C12.384 12.5007 12 12.8847 12 13.3579C12 13.831 12.384 14.215 12.8571 14.215ZM12.8571 21.0721H21.4286C21.9017 21.0721 22.2857 20.6881 22.2857 20.215C22.2857 19.7419 21.9017 19.3579 21.4286 19.3579H12.8571C12.384 19.3579 12 19.7419 12 20.215C12 20.6881 12.384 21.0721 12.8571 21.0721Z",fill:"#A5BAC6"}),le.createElement("path",{d:"M21.4286 26.215H19.7143C19.2411 26.215 18.8571 26.599 18.8571 27.0722C18.8571 27.5453 19.2411 27.9293 19.7143 27.9293H21.4286C21.9017 27.9293 22.2857 27.5453 22.2857 27.0722C22.2857 26.599 21.9017 26.215 21.4286 26.215ZM16.2857 26.215H12.8571C12.384 26.215 12 26.599 12 27.0722C12 27.5453 12.384 27.9293 12.8571 27.9293H16.2857C16.7589 27.9293 17.1429 27.5453 17.1429 27.0722C17.1429 26.599 16.7589 26.215 16.2857 26.215ZM24 22.7864H12.8571C12.384 22.7864 12 23.1704 12 23.6436C12 24.1167 12.384 24.5007 12.8571 24.5007H24C24.4731 24.5007 24.8571 24.1167 24.8571 23.6436C24.8571 23.1704 24.4731 22.7864 24 22.7864Z",fill:"#EB9697"}),le.createElement("path",{d:"M36 24.5007C36 23.083 34.8463 21.9293 33.4286 21.9293H31.7143C31.242 21.9293 30.8572 21.5444 30.8572 21.0722V18.5007C30.8572 18.0284 31.242 17.6436 31.7143 17.6436H33.4286C33.9009 17.6436 34.2857 18.0284 34.2857 18.5007V19.3579C34.2857 19.831 34.6697 20.215 35.1429 20.215C35.616 20.215 36 19.831 36 19.3579V18.5007C36 17.083 34.8463 15.9293 33.4286 15.9293V15.0722C33.4286 14.599 33.0446 14.215 32.5715 14.215C32.0983 14.215 31.7143 14.599 31.7143 15.0722V15.9293C30.2966 15.9293 29.1429 17.083 29.1429 18.5007V21.0722C29.1429 22.4899 30.2966 23.6436 31.7143 23.6436H33.4286C33.9009 23.6436 34.2857 24.0284 34.2857 24.5007V27.0722C34.2857 27.5444 33.9009 27.9293 33.4286 27.9293H31.7143C31.242 27.9293 30.8572 27.5444 30.8572 27.0722V26.215C30.8572 25.7419 30.4732 25.3579 30 25.3579C29.5269 25.3579 29.1429 25.7419 29.1429 26.215V27.0722C29.1429 28.4899 30.2966 29.6436 31.7143 29.6436V30.5007C31.7143 30.9739 32.0983 31.3579 32.5715 31.3579C33.0446 31.3579 33.4286 30.9739 33.4286 30.5007V29.6436C34.8463 29.6436 36 28.4899 36 27.0722V24.5007Z",fill:"#98C77C"})),VS=e=>le.createElement("svg",{width:48,height:49,viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M44.2069 35.2586C44.2069 35.2586 42.5517 39.3965 32.6207 39.3965C24.3448 39.3965 21.0345 34.431 21.0345 34.431V5.46551C21.0345 5.46551 22.2759 2.15517 32.4138 2.15517C42.5517 2.15517 44.2069 5.46551 44.2069 5.46551V35.2586Z",fill:"#FFEB9B"}),le.createElement("path",{d:"M26 43.5345C26 43.5345 22.6896 46.8448 14.4138 46.8448C6.13792 46.8448 2.82758 43.5345 2.82758 43.5345V17.8793C2.82758 17.8793 4.06895 14.569 14.2069 14.569C24.3448 14.569 26 17.8793 26 17.8793V43.5345Z",fill:"#FFEB9B"}),le.createElement("path",{d:"M26 43.5345C26 43.5345 21.862 47.6724 16.8965 47.6724C10.2758 47.6724 8.62067 46.8448 8.62067 46.8448V22.0172C8.62067 22.0172 11.931 22.8448 16.8965 22.8448C22.6896 22.8448 26 19.5345 26 18.7069C26 17.8793 26 43.5345 26 43.5345ZM44.2069 35.2586C44.2069 35.2586 40.0689 39.3965 35.1034 39.3965C28.4827 39.3965 26.8276 38.569 26.8276 38.569V8.77586C26.8276 8.77586 30.1379 9.60345 35.1034 9.60345C41.7241 9.60345 44.2069 5.46552 44.2069 5.46552V35.2586Z",fill:"#F9DD8F"}),le.createElement("path",{d:"M18.5518 22.7199V47.5185C22.7476 46.7786 26 43.5345 26 43.5345C26 43.5345 26 16.2241 26 17.8793C26 19.5345 23.3112 22.0495 18.5518 22.7199ZM36.7587 9.47849V39.2426C40.9545 38.5028 44.2069 35.2586 44.2069 35.2586V4.63794C44.2069 4.63794 43.3793 8.77587 36.7587 9.47849Z",fill:"#EFC88E"}),le.createElement("path",{d:"M20.2069 5.46552H21.8621V16.0859H20.2069V5.46552Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M32.6207 10.431C26.1233 10.431 20.2069 8.06497 20.2069 5.46552C20.2069 2.86607 26.1233 0.5 32.6207 0.5C39.1181 0.5 45.0345 2.86607 45.0345 5.46552C45.0345 5.92317 44.6646 6.2931 44.2069 6.2931C43.7493 6.2931 43.3793 5.92317 43.3793 5.46552C43.3793 4.51131 39.0916 2.15517 32.6207 2.15517C26.1498 2.15517 21.8621 4.51131 21.8621 5.46552C21.8621 6.41972 26.1498 8.77586 32.6207 8.77586C33.0784 8.77586 33.4483 9.14579 33.4483 9.60345C33.4483 10.0611 33.0784 10.431 32.6207 10.431Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M35.9583 10.2192C35.5479 10.2192 35.1912 9.91461 35.1382 9.49668C35.0811 9.04316 35.4006 8.62854 35.8541 8.57061C36.9639 8.42909 38.0273 8.21723 39.0146 7.94082C39.4508 7.81999 39.9117 8.07406 40.0342 8.51433C40.1575 8.95461 39.901 9.41144 39.4607 9.53392C38.3956 9.83185 37.2527 10.0603 36.0643 10.2117C36.0287 10.2167 35.9931 10.2192 35.9583 10.2192ZM14.4138 23.6724C7.91641 23.6724 2 21.3063 2 18.7069C2 16.1074 7.91641 13.7414 14.4138 13.7414C20.9112 13.7414 26.8276 16.1074 26.8276 18.7069C26.8276 19.1645 26.4577 19.5345 26 19.5345C25.5423 19.5345 25.1724 19.1645 25.1724 18.7069C25.1724 17.7527 20.8847 15.3965 14.4138 15.3965C7.9429 15.3965 3.65517 17.7527 3.65517 18.7069C3.65517 19.6611 7.9429 22.0172 14.4138 22.0172C14.8714 22.0172 15.2414 22.3872 15.2414 22.8448C15.2414 23.3025 14.8714 23.6724 14.4138 23.6724Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M17.8317 23.4506C17.4221 23.4506 17.0662 23.1477 17.0124 22.7306C16.9528 22.2779 17.2714 21.8616 17.725 21.8029C18.8083 21.6605 19.8477 21.4512 20.8143 21.1805C21.2497 21.0589 21.7114 21.3138 21.8339 21.7541C21.9572 22.1943 21.7007 22.6512 21.2604 22.7736C20.2177 23.0658 19.1012 23.2909 17.9393 23.4432C17.9037 23.4481 17.8673 23.4506 17.8317 23.4506ZM14.4138 28.6379C7.91641 28.6379 2 26.2719 2 23.6724H3.65517C3.65517 24.6266 7.9429 26.9828 14.4138 26.9828C20.8847 26.9828 25.1724 24.6266 25.1724 23.6724H26.8276C26.8276 26.2719 20.9112 28.6379 14.4138 28.6379ZM14.4138 38.569C7.91641 38.569 2 36.2029 2 33.6034H3.65517C3.65517 34.5576 7.9429 36.9138 14.4138 36.9138C20.8847 36.9138 25.1724 34.5576 25.1724 33.6034H26.8276C26.8276 36.2029 20.9112 38.569 14.4138 38.569ZM14.4138 33.6034C7.91641 33.6034 2 31.2374 2 28.6379H3.65517C3.65517 29.5921 7.9429 31.9483 14.4138 31.9483C20.8847 31.9483 25.1724 29.5921 25.1724 28.6379H26.8276C26.8276 31.2374 20.9112 33.6034 14.4138 33.6034ZM14.4138 43.5345C7.91641 43.5345 2 41.1684 2 38.569H3.65517C3.65517 39.5232 7.9429 41.8793 14.4138 41.8793C20.8847 41.8793 25.1724 39.5232 25.1724 38.569H26.8276C26.8276 41.1684 20.9112 43.5345 14.4138 43.5345ZM32.6207 15.3965C26.1233 15.3965 20.2069 13.0305 20.2069 10.431H21.8621C21.8621 11.3852 26.1498 13.7414 32.6207 13.7414C39.0916 13.7414 43.3793 11.3852 43.3793 10.431H45.0345C45.0345 13.0305 39.1181 15.3965 32.6207 15.3965ZM32.6207 20.3621C30.2662 20.3621 27.92 20.0575 25.8378 19.4823L26.2789 17.8868C28.2204 18.423 30.4127 18.7069 32.6207 18.7069C39.0916 18.7069 43.3793 16.3508 43.3793 15.3965H45.0345C45.0345 17.996 39.1181 20.3621 32.6207 20.3621Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M32.6207 25.3276C30.2513 25.3276 27.8935 25.0197 25.8022 24.4371L26.2466 22.8432C28.1947 23.3852 30.3986 23.6724 32.6207 23.6724C39.0916 23.6724 43.3793 21.3163 43.3793 20.3621H45.0345C45.0345 22.9615 39.118 25.3276 32.6207 25.3276ZM32.6207 30.2931C30.2496 30.2931 27.8902 29.9844 25.7972 29.401L26.2416 27.807C28.1914 28.3499 30.3969 28.6379 32.6207 28.6379C39.0916 28.6379 43.3793 26.2818 43.3793 25.3276H45.0345C45.0345 27.927 39.118 30.2931 32.6207 30.2931ZM32.6207 35.2586C30.2438 35.2586 27.8778 34.9483 25.7773 34.3615L26.2234 32.7676C28.1798 33.3138 30.392 33.6034 32.6207 33.6034C39.0916 33.6034 43.3793 31.2473 43.3793 30.2931H45.0345C45.0345 32.8925 39.118 35.2586 32.6207 35.2586Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M32.6207 40.2241C30.2513 40.2241 27.8935 39.9163 25.8022 39.3336L26.2466 37.7397C28.1947 38.2818 30.3986 38.569 32.6207 38.569C39.0916 38.569 43.3793 36.2128 43.3793 35.2586V5.46552H45.0345V35.2586C45.0345 37.8581 39.118 40.2241 32.6207 40.2241Z",fill:"#8D6C9F"}),le.createElement("path",{d:"M14.4138 48.5C7.91641 48.5 2 46.1339 2 43.5345V18.7069H3.65517V43.5345C3.65517 44.4887 7.9429 46.8448 14.4138 46.8448C20.8847 46.8448 25.1724 44.4887 25.1724 43.5345V18.7069H26.8276V43.5345C26.8276 46.1339 20.9112 48.5 14.4138 48.5ZM17.7241 2.98275H16.069C15.6113 2.98275 15.2414 2.61282 15.2414 2.15516C15.2414 1.69751 15.6113 1.32758 16.069 1.32758H17.7241C18.1818 1.32758 18.5517 1.69751 18.5517 2.15516C18.5517 2.61282 18.1818 2.98275 17.7241 2.98275ZM17.7241 7.12068H16.069C15.6113 7.12068 15.2414 6.75075 15.2414 6.29309C15.2414 5.83544 15.6113 5.46551 16.069 5.46551H17.7241C18.1818 5.46551 18.5517 5.83544 18.5517 6.29309C18.5517 6.75075 18.1818 7.12068 17.7241 7.12068ZM17.7241 11.2586H16.069C15.6113 11.2586 15.2414 10.8887 15.2414 10.431C15.2414 9.97337 15.6113 9.60344 16.069 9.60344H17.7241C18.1818 9.60344 18.5517 9.97337 18.5517 10.431C18.5517 10.8887 18.1818 11.2586 17.7241 11.2586Z",fill:"#8D6C9F"})),Dn=t.appLocale.getLocalizedStrings().cockpit.portfolio,Gi=({totalCashBalance:e,totalExpenses:n,totalRevenues:r,companyNameSticky:i})=>o.jsxRuntimeExports.jsxs(US,{companyNameSticky:i,children:[o.jsxRuntimeExports.jsxs(An,{children:[o.jsxRuntimeExports.jsx(Ht,{children:o.jsxRuntimeExports.jsx(BS,{})}),o.jsxRuntimeExports.jsxs(Ht,{children:[o.jsxRuntimeExports.jsx(On,{textColor:t.getCockpitColor("cashBalance"),children:t.amountToString("0,0",e)}),o.jsxRuntimeExports.jsx(Nn,{children:Dn.cashUnderManagementText})]})]}),o.jsxRuntimeExports.jsxs(An,{children:[o.jsxRuntimeExports.jsx(Ht,{children:o.jsxRuntimeExports.jsx(_S,{})}),o.jsxRuntimeExports.jsxs(Ht,{children:[o.jsxRuntimeExports.jsx(On,{textColor:t.getCockpitColor("expenses"),children:t.amountToString("0,0",n)}),o.jsxRuntimeExports.jsx(Nn,{children:Dn.expensesAcrossAllCustomersText})]})]}),o.jsxRuntimeExports.jsxs(An,{children:[o.jsxRuntimeExports.jsx(Ht,{children:o.jsxRuntimeExports.jsx(VS,{})}),o.jsxRuntimeExports.jsxs(Ht,{children:[o.jsxRuntimeExports.jsx(On,{textColor:t.getCockpitColor("revenues"),children:t.amountToString("0,0",r)}),o.jsxRuntimeExports.jsx(Nn,{children:Dn.revenuesAcrossAllCustomersText})]})]})]}),US=s.div`
2882
2882
  position: sticky;
2883
2883
  top: 0;
2884
2884
  z-index: 6;
@@ -2895,16 +2895,16 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2895
2895
  `};
2896
2896
 
2897
2897
  background-color: ${e=>e.theme.colors.grey4};
2898
- `,On=s.div`
2898
+ `,An=s.div`
2899
2899
  display: flex;
2900
2900
  align-items: center;
2901
2901
  justify-content: space-evenly;
2902
2902
  gap: 12px;
2903
- `,Nn=s(t.H6Regular)`
2903
+ `,On=s(t.H6Regular)`
2904
2904
  color: ${e=>e.textColor.color.toString()};
2905
- `,Mn=s(t.StandardRegular)`
2905
+ `,Nn=s(t.StandardRegular)`
2906
2906
  color: ${e=>e.theme.colors.champion};
2907
- `,Ht=s.div``,HS={portfolioRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{common:{headers:{comments:KS}},collaboration:{threads:{placeholder:{addANewComment:GS,replyAComment:YS},tooltip:{resolveComment:ZS,unResolveComment:XS}}}}=t.appLocale.getLocalizedStrings(),qS=({portfolioView:e,onColumnSortConfigChanged:n,onCompanyNameClicked:r,onPassportIconClicked:i,onScroll:a,initialOpenThreadRequest:d})=>{const l=t.useWindowSizeContext(),c=u.useRef(null),[p,m]=u.useState(null),[h,S]=u.useState(null),x=!(l==="small"||l==="medium-compact"),{uiState:C,totalCashBalance:b,totalExpenses:f,totalRevenues:g}=e,j=C.scrollYOffset??0,y=M=>e.companies[M].company.company.companyInfo.name.length>zt?Ie+32:Ie;u.useEffect(()=>{c.current&&c.current.resetAfterIndex(0)},[e]);const{setOpenThread:$,setRequestToOpenThread:w,requestToOpenThread:O,isLoading:A}=u.useContext(t.ThreadsContext);u.useEffect(()=>{d!=null&&e.fetchState==="Completed"&&A===!1&&w(d)},[d,e.fetchState,A,w]);const[v,T]=u.useState(void 0),F=u.useRef([]),I=u.useMemo(()=>({makeCompanyNameSticky:x,uiState:C,totalCashBalance:b,totalExpenses:f,totalRevenues:g,onColumnSortConfigChanged:n}),[x,b,f,g,C,n]),K=u.useCallback((M,Y,G)=>{const E=e.companies.findIndex(W=>W.company.company.companyInfo.companyId===M),P=At.findIndex(W=>W.key===Y);E!==-1&&P!==-1&&(F.current[E]==null?F.current[E]=[G]:F.current[E][P]=G)},[e.companies]);return u.useEffect(()=>{if(O!=null&&p!=null){const{companyId:M,entityType:Y}=O,[G,E]=Y.split("."),P=e.companies.findIndex(z=>z.company.company.companyInfo.companyId===M),W=At.findIndex(z=>z.key===E);P!==-1&&!(p.visibleStartIndex<=P&&p.visibleStopIndex>=P)&&c.current?.scrollToItem(P,"center"),setTimeout(()=>{const z=F.current[P]?.[0]?.getBoundingClientRect().bottom,Z=F.current[P]?.[0]?.getBoundingClientRect().top;z!=null&&Z!=null&&(window.innerHeight>=z&&window.innerHeight>=Z||Z<0)&&F.current[P][W]?.scrollIntoView({block:"center",behavior:"auto"})},0);const D=setInterval(()=>{const z=F.current[P]?.[W]?.getBoundingClientRect().left,Z=F.current[P]?.[W]?.getBoundingClientRect().right,ie=F.current[P]?.[W]?.offsetWidth;if(z!=null&&ie!=null&&Z!=null&&(z<window.innerWidth-ie||Z<window.innerWidth)){clearInterval(D);const N=O.threadId,H=O.onThreadShownCallback;N&&(w(null),$(O.threadId),H?.())}},500);setTimeout(()=>{clearInterval(D),w(null)},2e3)}},[O,p,$,w]),o.jsxRuntimeExports.jsxs(JS,{companyNameSticky:x,children:[x&&o.jsxRuntimeExports.jsx(Yi,{totalCashBalance:b,totalExpenses:f,totalRevenues:g,companyNameSticky:x}),o.jsxRuntimeExports.jsx(ey,{companyNameSticky:x,children:o.jsxRuntimeExports.jsxs(Zi.Provider,{value:I,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:M,width:Y})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:M,innerElementType:Xi,itemCount:e.companies.length,itemSize:y,onItemsRendered:G=>m(G),itemData:{portfolioView:e,makeCompanyNameSticky:x,addThreadRequestThreadId:v,setElementRef:K,setAddThreadRequestThreadId:T,setNoteData:S,onCompanyNameClicked:r,onPassportIconClicked:i},width:Y,ref:c,overscanCount:Mt,onScroll:({scrollOffset:G})=>{a(G)},initialScrollOffset:j,children:QS})}),h!=null?o.jsxRuntimeExports.jsx(Ze.RoomProvider,{id:h.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${h.companyName} ${KS}`,filter:{application:"cockpit",companyId:h.companyId,entityType:h.entityType,isGlobalComment:!1,tab:"portfolio"},isLoading:!1,threadMetadata:{companyName:h.companyName,companyId:h.companyId,entityId:h.companyId,entityType:h.entityType,isGlobalComment:!1,application:"cockpit",tab:"portfolio",url:window.location.href},textOverrides:{composerPlaceholder:GS,replyComposerPlaceholder:YS,threadResolve:ZS,threadUnResolve:XS},onThreadClick:M=>null,onCloseAllThreadsDrawer:()=>S(null)})}):null]})})]})},Zi=u.createContext(void 0),QS=({index:e,style:n,data:r})=>{const i=t.useWindowSizeContext(),{portfolioView:a,makeCompanyNameSticky:d,addThreadRequestThreadId:l,setElementRef:c,setNoteData:p,onCompanyNameClicked:m,onPassportIconClicked:h,setAddThreadRequestThreadId:S}=r,x=a.companies[e],{companyId:C}=x.company.company.companyInfo;return o.jsxRuntimeExports.jsx(ty,{style:{...n,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${HS.portfolioRightPadding.valuePx(i)} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(vS,{addThreadRequestThreadId:l,setNoteData:p,setElementRef:c,setAddThreadRequestThreadId:S,totalHeight:typeof n.height=="number"?n.height:Ie,companyView:a.companies[e],companyNameSticky:d,onCompanyNameClicked:m,onPassportIconClicked:h})},C)},Xi=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,totalCashBalance:c,totalExpenses:p,totalRevenues:m,onColumnSortConfigChanged:h}=u.useContext(Zi);return o.jsxRuntimeExports.jsxs(ny,{ref:n,style:{...i,width:"auto"},...a,children:[!d&&o.jsxRuntimeExports.jsx(Yi,{totalCashBalance:c,totalExpenses:p,totalRevenues:m,companyNameSticky:d}),o.jsxRuntimeExports.jsx(SS,{companyNameSticky:d,onColumnSortConfigChanged:h,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(oy,{children:r})]})});Xi.displayName="Portfolio list view inner element type";const JS=s.div`
2907
+ `,Ht=s.div``,HS={portfolioRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{common:{headers:{comments:KS}},collaboration:{threads:{placeholder:{addANewComment:GS,replyAComment:YS},tooltip:{resolveComment:ZS,unResolveComment:XS}}}}=t.appLocale.getLocalizedStrings(),qS=({portfolioView:e,onColumnSortConfigChanged:n,onCompanyNameClicked:r,onPassportIconClicked:i,onScroll:a,initialOpenThreadRequest:d})=>{const l=t.useWindowSizeContext(),c=u.useRef(null),[p,m]=u.useState(null),[h,S]=u.useState(null),x=!(l==="small"||l==="medium-compact"),{uiState:C,totalCashBalance:b,totalExpenses:f,totalRevenues:g}=e,j=C.scrollYOffset??0,y=M=>e.companies[M].company.company.companyInfo.name.length>zt?Ie+32:Ie;u.useEffect(()=>{c.current&&c.current.resetAfterIndex(0)},[e]);const{setOpenThread:$,setRequestToOpenThread:w,requestToOpenThread:O,isLoading:A}=u.useContext(t.ThreadsContext);u.useEffect(()=>{d!=null&&e.fetchState==="Completed"&&A===!1&&w(d)},[d,e.fetchState,A,w]);const[v,T]=u.useState(void 0),F=u.useRef([]),I=u.useMemo(()=>({makeCompanyNameSticky:x,uiState:C,totalCashBalance:b,totalExpenses:f,totalRevenues:g,onColumnSortConfigChanged:n}),[x,b,f,g,C,n]),K=u.useCallback((M,Y,G)=>{const E=e.companies.findIndex(W=>W.company.company.companyInfo.companyId===M),P=At.findIndex(W=>W.key===Y);E!==-1&&P!==-1&&(F.current[E]==null?F.current[E]=[G]:F.current[E][P]=G)},[e.companies]);return u.useEffect(()=>{if(O!=null&&p!=null){const{companyId:M,entityType:Y}=O,[G,E]=Y.split("."),P=e.companies.findIndex(z=>z.company.company.companyInfo.companyId===M),W=At.findIndex(z=>z.key===E);P!==-1&&!(p.visibleStartIndex<=P&&p.visibleStopIndex>=P)&&c.current?.scrollToItem(P,"center"),setTimeout(()=>{const z=F.current[P]?.[0]?.getBoundingClientRect().bottom,Z=F.current[P]?.[0]?.getBoundingClientRect().top;z!=null&&Z!=null&&(window.innerHeight>=z&&window.innerHeight>=Z||Z<0)&&F.current[P][W]?.scrollIntoView({block:"center",behavior:"auto"})},0);const D=setInterval(()=>{const z=F.current[P]?.[W]?.getBoundingClientRect().left,Z=F.current[P]?.[W]?.getBoundingClientRect().right,ie=F.current[P]?.[W]?.offsetWidth;if(z!=null&&ie!=null&&Z!=null&&(z<window.innerWidth-ie||Z<window.innerWidth)){clearInterval(D);const N=O.threadId,H=O.onThreadShownCallback;N&&(w(null),$(O.threadId),H?.())}},500);setTimeout(()=>{clearInterval(D),w(null)},2e3)}},[O,p,$,w]),o.jsxRuntimeExports.jsxs(JS,{companyNameSticky:x,children:[x&&o.jsxRuntimeExports.jsx(Gi,{totalCashBalance:b,totalExpenses:f,totalRevenues:g,companyNameSticky:x}),o.jsxRuntimeExports.jsx(ey,{companyNameSticky:x,children:o.jsxRuntimeExports.jsxs(Yi.Provider,{value:I,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:M,width:Y})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:M,innerElementType:Zi,itemCount:e.companies.length,itemSize:y,onItemsRendered:G=>m(G),itemData:{portfolioView:e,makeCompanyNameSticky:x,addThreadRequestThreadId:v,setElementRef:K,setAddThreadRequestThreadId:T,setNoteData:S,onCompanyNameClicked:r,onPassportIconClicked:i},width:Y,ref:c,overscanCount:Mt,onScroll:({scrollOffset:G})=>{a(G)},initialScrollOffset:j,children:QS})}),h!=null?o.jsxRuntimeExports.jsx(Ze.RoomProvider,{id:h.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${h.companyName} ${KS}`,filter:{application:"cockpit",companyId:h.companyId,entityType:h.entityType,isGlobalComment:!1,tab:"portfolio"},isLoading:!1,threadMetadata:{companyName:h.companyName,companyId:h.companyId,entityId:h.companyId,entityType:h.entityType,isGlobalComment:!1,application:"cockpit",tab:"portfolio",url:window.location.href},textOverrides:{composerPlaceholder:GS,replyComposerPlaceholder:YS,threadResolve:ZS,threadUnResolve:XS},onThreadClick:M=>null,onCloseAllThreadsDrawer:()=>S(null)})}):null]})})]})},Yi=u.createContext(void 0),QS=({index:e,style:n,data:r})=>{const i=t.useWindowSizeContext(),{portfolioView:a,makeCompanyNameSticky:d,addThreadRequestThreadId:l,setElementRef:c,setNoteData:p,onCompanyNameClicked:m,onPassportIconClicked:h,setAddThreadRequestThreadId:S}=r,x=a.companies[e],{companyId:C}=x.company.company.companyInfo;return o.jsxRuntimeExports.jsx(ty,{style:{...n,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${HS.portfolioRightPadding.valuePx(i)} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(vS,{addThreadRequestThreadId:l,setNoteData:p,setElementRef:c,setAddThreadRequestThreadId:S,totalHeight:typeof n.height=="number"?n.height:Ie,companyView:a.companies[e],companyNameSticky:d,onCompanyNameClicked:m,onPassportIconClicked:h})},C)},Zi=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,totalCashBalance:c,totalExpenses:p,totalRevenues:m,onColumnSortConfigChanged:h}=u.useContext(Yi);return o.jsxRuntimeExports.jsxs(ny,{ref:n,style:{...i,width:"auto"},...a,children:[!d&&o.jsxRuntimeExports.jsx(Gi,{totalCashBalance:c,totalExpenses:p,totalRevenues:m,companyNameSticky:d}),o.jsxRuntimeExports.jsx(SS,{companyNameSticky:d,onColumnSortConfigChanged:h,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(oy,{children:r})]})});Zi.displayName="Portfolio list view inner element type";const JS=s.div`
2908
2908
  width: 100%;
2909
2909
  height: 100%;
2910
2910
  background-color: ${e=>e.theme.colors.grey4};
@@ -2938,7 +2938,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2938
2938
  height: calc(100vh - 45px);
2939
2939
  overflow-y: hidden;
2940
2940
  background-color: ${e=>e.theme.colors.grey4};
2941
- `,ay=({headerData:e,headerActions:n,portfolioPageActions:r,portfolioPageData:i,initialOpenThreadRequest:a})=>{const{portfolioView:d}=i,{onColumnSortConfigChanged:l,onCompanyNameClicked:c,onPassportIconClicked:p,onScroll:m,onFiltersChange:h,onCockpitReloadData:S}=r,x=d.uiState.filterText,C=d.uiState.filters,b=d.fetchState==="Completed";return n.filterActions&&(n.filterActions.getCategoryWiseOptions=()=>cy()),o.jsxRuntimeExports.jsxs(iy,{children:[o.jsxRuntimeExports.jsx(ht,{headerActions:{...n},headerData:{...e,filterData:{filterText:x,filters:C},companiesLoaded:b,selectedTabOption:"portfolio",allTabOptions:xt}}),o.jsxRuntimeExports.jsx(ly,{portfolioView:d,onColumnSortConfigChanged:l,onScroll:m,onCockpitReloadData:S,isFilterApplied:C?.categories!=null,onCompanyNameClicked:c,onPassportIconClicked:p,onClearFilter:()=>h("portfolio",{}),initialOpenThreadRequest:a})]})},ly=({portfolioView:e,isFilterApplied:n,onColumnSortConfigChanged:r,onCompanyNameClicked:i,onPassportIconClicked:a,onCockpitReloadData:d,onScroll:l,onClearFilter:c,initialOpenThreadRequest:p})=>{const m=t.useWindowSizeContext();return e.fetchState==="Error"?o.jsxRuntimeExports.jsx(jt,{onCockpitReloadData:d,selectedCockpitOption:"portfolio"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(sy,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.companies.length===0?n?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchOnFilters,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine,filtersApplied:!0,onClearFilter:c}):o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextFirstLine,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine}):o.jsxRuntimeExports.jsx(ry,{windowSize:m,children:o.jsxRuntimeExports.jsx(qS,{portfolioView:e,onColumnSortConfigChanged:r,onScroll:l,onCompanyNameClicked:i,onPassportIconClicked:a,initialOpenThreadRequest:p})})},cy=()=>di.reduce((n,r)=>{switch(r.value){case"netBurnOrIncome":return{...n,[r.value]:Ua};case"cashPosition":return{...n,[r.value]:Ha};case"expenses":return{...n,[r.value]:Ka};case"income":return{...n,[r.value]:Ga};case"runway":return{...n,[r.value]:Ya};default:return{...n,[r.value]:[]}}},{}),{dateFormat:dy,aiAccountantCustomer:ao}=t.appLocale.getLocalizedStrings(),Ss=({operationType:e,onCancel:n,onConfirm:r,dialogTitle:i,dialogDescription:a})=>{const d=o.useTheme(),[l,c]=u.useState(""),[p,m]=u.useState(""),h=e==="offboard",S=h||l.length>0&&p.length>0,x=e.replaceAll("_"," "),C=ee.zeniDate(new Date().toISOString()).format(dy.analytics.YYYYDashMMDashDDFormat),b=i??`${ao.jobTriggerDialog.title} — ${x}`;return o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{children:b}),descriptionComponent:a!=null?o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:a}):void 0,primaryButtonText:ao.jobTriggerDialog.confirm,secondaryButtonText:ao.jobTriggerDialog.cancel,isProceedDisabled:!S,action:{onOkClick:()=>{S&&r(e,l,p)},onCancelClick:n,onClickAway:n},shouldClickAway:!0,style:{background:d.colors.overlayColor},children:!h&&o.jsxRuntimeExports.jsxs(py,{children:[o.jsxRuntimeExports.jsxs(Er,{children:[o.jsxRuntimeExports.jsx(wr,{children:ao.jobTriggerDialog.startDate}),o.jsxRuntimeExports.jsx(vr,{type:"date",value:l,max:p.length>0?p:C,onChange:f=>c(f.target.value)})]}),o.jsxRuntimeExports.jsxs(Er,{children:[o.jsxRuntimeExports.jsx(wr,{children:ao.jobTriggerDialog.endDate}),o.jsxRuntimeExports.jsx(vr,{type:"date",value:p,min:l.length>0?l:void 0,max:C,onChange:f=>m(f.target.value)})]})]})})},py=s.div`
2941
+ `,ay=({headerData:e,headerActions:n,portfolioPageActions:r,portfolioPageData:i,initialOpenThreadRequest:a})=>{const{portfolioView:d}=i,{onColumnSortConfigChanged:l,onCompanyNameClicked:c,onPassportIconClicked:p,onScroll:m,onFiltersChange:h,onCockpitReloadData:S}=r,x=d.uiState.filterText,C=d.uiState.filters,b=d.fetchState==="Completed";return n.filterActions&&(n.filterActions.getCategoryWiseOptions=()=>cy()),o.jsxRuntimeExports.jsxs(iy,{children:[o.jsxRuntimeExports.jsx(ht,{headerActions:{...n},headerData:{...e,filterData:{filterText:x,filters:C},companiesLoaded:b,selectedTabOption:"portfolio",allTabOptions:xt}}),o.jsxRuntimeExports.jsx(ly,{portfolioView:d,onColumnSortConfigChanged:l,onScroll:m,onCockpitReloadData:S,isFilterApplied:C?.categories!=null,onCompanyNameClicked:c,onPassportIconClicked:p,onClearFilter:()=>h("portfolio",{}),initialOpenThreadRequest:a})]})},ly=({portfolioView:e,isFilterApplied:n,onColumnSortConfigChanged:r,onCompanyNameClicked:i,onPassportIconClicked:a,onCockpitReloadData:d,onScroll:l,onClearFilter:c,initialOpenThreadRequest:p})=>{const m=t.useWindowSizeContext();return e.fetchState==="Error"?o.jsxRuntimeExports.jsx(bt,{onCockpitReloadData:d,selectedCockpitOption:"portfolio"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(sy,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.companies.length===0?n?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchOnFilters,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine,filtersApplied:!0,onClearFilter:c}):o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextFirstLine,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine}):o.jsxRuntimeExports.jsx(ry,{windowSize:m,children:o.jsxRuntimeExports.jsx(qS,{portfolioView:e,onColumnSortConfigChanged:r,onScroll:l,onCompanyNameClicked:i,onPassportIconClicked:a,initialOpenThreadRequest:p})})},cy=()=>ci.reduce((n,r)=>{switch(r.value){case"netBurnOrIncome":return{...n,[r.value]:Ua};case"cashPosition":return{...n,[r.value]:Ha};case"expenses":return{...n,[r.value]:Ka};case"income":return{...n,[r.value]:Ga};case"runway":return{...n,[r.value]:Ya};default:return{...n,[r.value]:[]}}},{}),{dateFormat:dy,aiAccountantCustomer:ao}=t.appLocale.getLocalizedStrings(),gs=({operationType:e,onCancel:n,onConfirm:r,dialogTitle:i,dialogDescription:a})=>{const d=o.useTheme(),[l,c]=u.useState(""),[p,m]=u.useState(""),h=e==="offboard",S=h||l.length>0&&p.length>0,x=e.replaceAll("_"," "),C=J.zeniDate(new Date().toISOString()).format(dy.analytics.YYYYDashMMDashDDFormat),b=i??`${ao.jobTriggerDialog.title} — ${x}`;return o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{children:b}),descriptionComponent:a!=null?o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:a}):void 0,primaryButtonText:ao.jobTriggerDialog.confirm,secondaryButtonText:ao.jobTriggerDialog.cancel,useLegacyStyles:!0,isProceedDisabled:!S,action:{onOkClick:()=>{S&&r(e,l,p)},onCancelClick:n,onClickAway:n},shouldClickAway:!0,style:{background:d.colors.overlayColor},children:!h&&o.jsxRuntimeExports.jsxs(py,{children:[o.jsxRuntimeExports.jsxs(Er,{children:[o.jsxRuntimeExports.jsx(wr,{children:ao.jobTriggerDialog.startDate}),o.jsxRuntimeExports.jsx(vr,{type:"date",value:l,max:p.length>0?p:C,onChange:f=>c(f.target.value)})]}),o.jsxRuntimeExports.jsxs(Er,{children:[o.jsxRuntimeExports.jsx(wr,{children:ao.jobTriggerDialog.endDate}),o.jsxRuntimeExports.jsx(vr,{type:"date",value:p,min:l.length>0?l:void 0,max:C,onChange:f=>m(f.target.value)})]})]})})},py=s.div`
2942
2942
  display: flex;
2943
2943
  flex-direction: column;
2944
2944
  gap: ${t.Space.sp3};
@@ -2961,7 +2961,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
2961
2961
  outline: none;
2962
2962
  border-color: ${e=>e.theme.colors.primary};
2963
2963
  }
2964
- `,{aiAccountantCustomer:Lt}=t.appLocale.getLocalizedStrings(),Se={rowHeightPx:t.sp[8],headerHeightPx:44,jobRowHeightPx:44,jobHeaderHeightPx:36,jobTableMinHeightPx:200,jobOperationMinWidthPx:120,jobStatusColumnWidthPx:90,jobDateColumnWidthPx:120,jobByColumnWidthPx:100,jobSkeletonRowCount:3,skeletonLoaderHeightPx:14,accuracyLabelMinWidthPx:80,accuracyValueMinWidthPx:45,accuracySuccessThresholdPercent:80,accuracyAlertThresholdPercent:60,sortIconSize:t.Space.sp2,menuIconSize:t.Space.sp3,statusBadgeVerticalPadding:"2px",accuracyBarHeight:t.Space.sp2,globalNavBarHeightPx:45,pageHeaderHeightPx:75,menuDropdownMinWidthPx:160,checkboxColumnWidthPx:40},tt={companyName:200,status:120,bookcloseDate:130,latestTraining:130,latestSync:130,accuracy:100,actions:60},uy=[{key:"companyName",label:Lt.table.company,sortable:!0,width:tt.companyName,justifyContent:"flex-start",growToFill:!0},{key:"status",label:Lt.table.status,sortable:!0,width:tt.status,justifyContent:"flex-start"},{key:"bookcloseDate",label:Lt.table.bookClose,sortable:!0,width:tt.bookcloseDate,justifyContent:"flex-start"},{key:"latestTraining",label:Lt.table.lastTraining,sortable:!0,width:tt.latestTraining,justifyContent:"flex-start"},{key:"latestSync",label:Lt.table.lastSync,sortable:!0,width:tt.latestSync,justifyContent:"flex-start"},{key:"accuracy",label:Lt.table.accuracy,sortable:!0,width:tt.accuracy,justifyContent:"flex-end"},{key:"actions",label:"",sortable:!1,width:tt.actions,justifyContent:"center"}],ln={onboard:"onboard",retrain:"retrain",full_pipeline:"fullPipeline",offboard:"offboard",cancel_onboarding:"cancelOnboarding"},qi=(e,n)=>{const{jobTriggerDialog:r}=Lt;return e==="offboard"?r.singleDescriptionOffboard.replace("__companyName__",n):r.singleDescription.replace("__companyName__",n).replace("__datesInstruction__",r.datesInstruction)},kr={default:[{operationType:"onboard",labelKey:"onboard",destructive:!1},{operationType:"retrain",labelKey:"modelPreparation",destructive:!1},{operationType:"full_pipeline",labelKey:"fullPipeline",destructive:!1}],active:[{operationType:"retrain",labelKey:"retrain",destructive:!1},{operationType:"offboard",labelKey:"offboard",destructive:!0}],onboarding:[{operationType:"cancel_onboarding",labelKey:"cancelOnboarding",destructive:!0}],offboarding:[]},ys=e=>kr[e]??kr.default;function fs(){const{useDynamicConfig:e}=t.useZeniFeatureContext(),{configValue:n}=e(t.DynamicConfigNames.aiAccountantOnboardingConfig),r=t.useGlobalInfoContext().loggedInUser;return n==null||r?.userId==null?!1:Array.isArray(n.user_list_with_write_access)&&n.user_list_with_write_access.includes(r.userId)}const{common:{strings:Yt},dateFormat:en,timeFormat:Co,aiAccountantCustomer:_e}=t.appLocale.getLocalizedStrings(),my=({customer:e,hasMoreJobs:n,jobs:r,jobsFetchStatus:i,onAction:a,onCancelOnboarding:d,onClose:l,onLoadMoreJobs:c})=>{const[p,m]=u.useState(null),h=fs(),S=e.enrollment?.status??"unknown",x=e.enrollment,C=x?.accuracy??{},b=i.fetchState==="In-Progress",f=$=>{m({operationType:$})},g=($,w,O)=>{a(e,$,w,O),m(null)},j=$=>$<r.length,y=()=>{n&&!b&&c()};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(Sy,{children:[o.jsxRuntimeExports.jsx(yy,{children:o.jsxRuntimeExports.jsxs(fy,{children:[o.jsxRuntimeExports.jsx(Cy,{}),o.jsxRuntimeExports.jsxs(jy,{children:[o.jsxRuntimeExports.jsx(by,{children:e.companyName}),o.jsxRuntimeExports.jsx(Ry,{children:e.tenantId})]}),o.jsxRuntimeExports.jsx($y,{onClick:l,children:o.jsxRuntimeExports.jsx(Ey,{})})]})}),o.jsxRuntimeExports.jsxs(wy,{children:[o.jsxRuntimeExports.jsxs(zn,{children:[o.jsxRuntimeExports.jsx(Bo,{children:_e.drawer.enrollmentDetails}),o.jsxRuntimeExports.jsxs(ky,{children:[o.jsxRuntimeExports.jsxs(lo,{children:[o.jsxRuntimeExports.jsx(co,{children:_e.drawer.statusLabel}),o.jsxRuntimeExports.jsx(po,{children:S})]}),o.jsxRuntimeExports.jsxs(lo,{children:[o.jsxRuntimeExports.jsx(co,{children:_e.drawer.onboarded}),o.jsxRuntimeExports.jsx(po,{title:x?.onboardedAt!=null?x.onboardedAt.format(Co.hmmADashDDMMMCommaYYYY):void 0,children:x?.onboardedAt!=null?x.onboardedAt.format(en.visual.MMMDCommaYYYYformat):Yt.emDash})]}),o.jsxRuntimeExports.jsxs(lo,{children:[o.jsxRuntimeExports.jsx(co,{children:_e.drawer.lastTraining}),o.jsxRuntimeExports.jsx(po,{title:x?.latestTraining!=null?x.latestTraining.format(Co.hmmADashDDMMMCommaYYYY):void 0,children:x?.latestTraining!=null?x.latestTraining.format(en.visual.MMMDCommaYYYYformat):Yt.emDash})]}),o.jsxRuntimeExports.jsxs(lo,{children:[o.jsxRuntimeExports.jsx(co,{children:_e.drawer.lastSync}),o.jsxRuntimeExports.jsx(po,{title:x?.latestTransactionSync!=null?x.latestTransactionSync.local().format(Co.hmmADashDDMMMCommaYYYY):void 0,children:x?.latestTransactionSync!=null?x.latestTransactionSync.utc(!0).fromNow():Yt.emDash})]}),x?.offboardedAt!=null&&o.jsxRuntimeExports.jsxs(lo,{children:[o.jsxRuntimeExports.jsx(co,{children:_e.drawer.offboarded}),o.jsxRuntimeExports.jsx(po,{title:x.offboardedAt.format(Co.hmmADashDDMMMCommaYYYY),children:x.offboardedAt.format(en.visual.MMMDCommaYYYYformat)})]})]})]}),o.jsxRuntimeExports.jsxs(zn,{children:[o.jsxRuntimeExports.jsx(Bo,{children:_e.drawer.modelAccuracy}),Object.keys(C).length>0?o.jsxRuntimeExports.jsx(Ty,{children:Object.entries(C).map(([$,w])=>{const O=w*100,A=hy(O),v=`${O.toFixed(0)}${Yt.percentage}`,T=`${O.toFixed(1)}${Yt.percentage}`;return o.jsxRuntimeExports.jsxs(Ly,{children:[o.jsxRuntimeExports.jsx(Py,{children:gy($)}),o.jsxRuntimeExports.jsx(Iy,{children:o.jsxRuntimeExports.jsx(Dy,{style:{width:v,backgroundColor:A}})}),o.jsxRuntimeExports.jsx(Ay,{children:T})]},$)})}):o.jsxRuntimeExports.jsx(Tr,{children:_e.drawer.noAccuracyData})]}),h&&o.jsxRuntimeExports.jsxs(zn,{children:[o.jsxRuntimeExports.jsx(Bo,{children:_e.drawer.actionsTitle}),o.jsxRuntimeExports.jsx(Oy,{children:ys(S).map($=>o.jsxRuntimeExports.jsx(t.Button,{label:_e.actions[$.labelKey],variant:$.destructive?"destructive":"outline",size:"small",onClick:()=>{$.operationType==="cancel_onboarding"?d(e):f($.operationType)}},$.operationType))})]}),o.jsxRuntimeExports.jsxs(vy,{children:[o.jsxRuntimeExports.jsx(Bo,{children:_e.drawer.jobHistory}),r.length===0&&!b?o.jsxRuntimeExports.jsx(Tr,{children:_e.drawer.noJobsFound}):o.jsxRuntimeExports.jsxs(Ny,{children:[o.jsxRuntimeExports.jsxs(My,{children:[o.jsxRuntimeExports.jsx(zy,{children:o.jsxRuntimeExports.jsx(t.ExtraSmallSemiBold,{children:_e.drawer.operation})}),o.jsxRuntimeExports.jsx(Fy,{children:o.jsxRuntimeExports.jsx(t.ExtraSmallSemiBold,{children:_e.drawer.status})}),o.jsxRuntimeExports.jsx(Wy,{children:o.jsxRuntimeExports.jsx(t.ExtraSmallSemiBold,{children:_e.drawer.created})}),o.jsxRuntimeExports.jsx(By,{children:o.jsxRuntimeExports.jsx(t.ExtraSmallSemiBold,{children:_e.drawer.by})})]}),o.jsxRuntimeExports.jsx(_y,{children:o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:$,width:w})=>o.jsxRuntimeExports.jsx(o.InfiniteLoader,{isItemLoaded:j,itemCount:n?r.length+1:r.length,loadMoreItems:y,children:({onItemsRendered:O})=>o.jsxRuntimeExports.jsx(o.FixedSizeList,{height:$,width:w,itemCount:r.length,itemSize:Se.jobRowHeightPx,itemData:r,onItemsRendered:O,innerElementType:xy,overscanCount:Se.jobSkeletonRowCount,children:Qi})})})}),b&&o.jsxRuntimeExports.jsx(Yy,{children:Array.from({length:Se.jobSkeletonRowCount},($,w)=>o.jsxRuntimeExports.jsxs(Zy,{children:[o.jsxRuntimeExports.jsx(_o,{$flex:!0,children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:w%2===0?90:70,height:Se.skeletonLoaderHeightPx})}),o.jsxRuntimeExports.jsx(_o,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:60,height:Se.skeletonLoaderHeightPx})}),o.jsxRuntimeExports.jsx(_o,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:t.Space.sp11,height:Se.skeletonLoaderHeightPx})}),o.jsxRuntimeExports.jsx(_o,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:70,height:Se.skeletonLoaderHeightPx})})]},`skeleton-${w}`))})]})]})]})]}),p!=null&&o.jsxRuntimeExports.jsx(Ss,{operationType:p.operationType,dialogTitle:_e.actions[ln[p.operationType]],dialogDescription:qi(p.operationType,e.companyName),onCancel:()=>m(null),onConfirm:g})]})},Qi=u.memo(({index:e,style:n,data:r})=>{const i=r[e],a=i.operationType.replaceAll("_"," "),d=i.triggeredBy!=null?`${i.triggeredBy.firstName} ${i.triggeredBy.lastName}`.trim():Yt.emDash;return o.jsxRuntimeExports.jsxs(Vy,{style:n,children:[o.jsxRuntimeExports.jsx(Uy,{children:a}),o.jsxRuntimeExports.jsx(Hy,{children:i.status}),o.jsxRuntimeExports.jsx(Ky,{title:i.createdAt.format(Co.hmmADashDDMMMCommaYYYY),children:i.createdAt.format(en.visual.MMMDCommaYYYYformat)}),o.jsxRuntimeExports.jsx(Gy,{children:d})]})});Qi.displayName="JobListItem";const xy=u.forwardRef(({style:e,...n},r)=>o.jsxRuntimeExports.jsx("div",{ref:r,style:{...e,position:"relative"},...n})),hy=e=>e>=Se.accuracySuccessThresholdPercent?t.Colors.success:e>=Se.accuracyAlertThresholdPercent?t.Colors.alert:t.Colors.important,gy=e=>e.split("_").filter(n=>n.length>0).map(n=>n[0].toUpperCase()+n.slice(1).toLowerCase()).join(" "),Sy=s.div`
2964
+ `,{aiAccountantCustomer:St}=t.appLocale.getLocalizedStrings(),Se={rowHeightPx:t.sp[8],headerHeightPx:44,jobRowHeightPx:44,jobHeaderHeightPx:36,jobTableMinHeightPx:200,jobOperationMinWidthPx:120,jobStatusColumnWidthPx:90,jobDateColumnWidthPx:120,jobByColumnWidthPx:100,jobSkeletonRowCount:3,skeletonLoaderHeightPx:14,accuracyLabelMinWidthPx:80,accuracyValueMinWidthPx:45,accuracySuccessThresholdPercent:80,accuracyAlertThresholdPercent:60,sortIconSize:t.Space.sp2,menuIconSize:t.Space.sp3,statusBadgeVerticalPadding:"2px",accuracyBarHeight:t.Space.sp2,globalNavBarHeightPx:45,pageHeaderHeightPx:75,menuDropdownMinWidthPx:160,checkboxColumnWidthPx:40},tt={companyName:200,status:120,bookcloseDate:130,latestTraining:130,latestSync:130,accuracy:100,actions:60},uy=[{key:"companyName",label:St.table.company,sortable:!0,width:tt.companyName,justifyContent:"flex-start",growToFill:!0},{key:"status",label:St.table.status,sortable:!0,width:tt.status,justifyContent:"flex-start"},{key:"bookcloseDate",label:St.table.bookClose,sortable:!0,width:tt.bookcloseDate,justifyContent:"flex-start"},{key:"latestTraining",label:St.table.lastTraining,sortable:!0,width:tt.latestTraining,justifyContent:"flex-start"},{key:"latestSync",label:St.table.lastSync,sortable:!0,width:tt.latestSync,justifyContent:"flex-start"},{key:"accuracy",label:St.table.accuracy,sortable:!0,width:tt.accuracy,justifyContent:"flex-end"},{key:"actions",label:"",sortable:!1,width:tt.actions,justifyContent:"center"}],Ss={onboard:{labelKey:"onboard",destructive:!1},evaluate:{labelKey:"evaluate",destructive:!1},full_pipeline:{labelKey:"fullPipeline",destructive:!1},retrain:{labelKey:"retrain",destructive:!1},offboard:{labelKey:"offboard",destructive:!0},cancel_onboarding:{labelKey:"cancelOnboarding",destructive:!0}},Xi=(e,n)=>{const{jobTriggerDialog:r}=St;return e==="offboard"?r.singleDescriptionOffboard.replace("__companyName__",n):r.singleDescription.replace("__companyName__",n).replace("__datesInstruction__",r.datesInstruction)},ys=e=>J.getAllowedOperationsForStatus(e).map(n=>({operationType:n,...Ss[n]})),qi=e=>St.filters.enrollmentStatus[e]??e;function fs(){const{useDynamicConfig:e}=t.useZeniFeatureContext(),{configValue:n}=e(t.DynamicConfigNames.aiAccountantOnboardingConfig),r=t.useGlobalInfoContext().loggedInUser;return n==null||r?.userId==null?!1:Array.isArray(n.user_list_with_write_access)&&n.user_list_with_write_access.includes(r.userId)}const{common:{strings:Yt},dateFormat:en,timeFormat:Co,aiAccountantCustomer:_e}=t.appLocale.getLocalizedStrings(),my=({customer:e,hasMoreJobs:n,jobs:r,jobsFetchStatus:i,onAction:a,onCancelOnboarding:d,onClose:l,onLoadMoreJobs:c})=>{const[p,m]=u.useState(null),h=fs(),S=e.enrollment?.status??"unknown",x=e.enrollment,C=x?.accuracy??{},b=i.fetchState==="In-Progress",f=$=>{m({operationType:$})},g=($,w,O)=>{a(e,$,w,O),m(null)},j=$=>$<r.length,y=()=>{n&&!b&&c()};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(Sy,{children:[o.jsxRuntimeExports.jsx(yy,{children:o.jsxRuntimeExports.jsxs(fy,{children:[o.jsxRuntimeExports.jsx(Cy,{}),o.jsxRuntimeExports.jsxs(jy,{children:[o.jsxRuntimeExports.jsx(by,{children:e.companyName}),o.jsxRuntimeExports.jsx(Ry,{children:e.tenantId})]}),o.jsxRuntimeExports.jsx($y,{onClick:l,children:o.jsxRuntimeExports.jsx(Ey,{})})]})}),o.jsxRuntimeExports.jsxs(wy,{children:[o.jsxRuntimeExports.jsxs(Mn,{children:[o.jsxRuntimeExports.jsx(Bo,{children:_e.drawer.enrollmentDetails}),o.jsxRuntimeExports.jsxs(ky,{children:[o.jsxRuntimeExports.jsxs(lo,{children:[o.jsxRuntimeExports.jsx(co,{children:_e.drawer.statusLabel}),o.jsxRuntimeExports.jsx(po,{children:qi(S)})]}),o.jsxRuntimeExports.jsxs(lo,{children:[o.jsxRuntimeExports.jsx(co,{children:_e.drawer.onboarded}),o.jsxRuntimeExports.jsx(po,{title:x?.onboardedAt!=null?x.onboardedAt.format(Co.hmmADashDDMMMCommaYYYY):void 0,children:x?.onboardedAt!=null?x.onboardedAt.format(en.visual.MMMDCommaYYYYformat):Yt.emDash})]}),o.jsxRuntimeExports.jsxs(lo,{children:[o.jsxRuntimeExports.jsx(co,{children:_e.drawer.lastTraining}),o.jsxRuntimeExports.jsx(po,{title:x?.latestTraining!=null?x.latestTraining.format(Co.hmmADashDDMMMCommaYYYY):void 0,children:x?.latestTraining!=null?x.latestTraining.format(en.visual.MMMDCommaYYYYformat):Yt.emDash})]}),o.jsxRuntimeExports.jsxs(lo,{children:[o.jsxRuntimeExports.jsx(co,{children:_e.drawer.lastSync}),o.jsxRuntimeExports.jsx(po,{title:x?.latestTransactionSync!=null?x.latestTransactionSync.local().format(Co.hmmADashDDMMMCommaYYYY):void 0,children:x?.latestTransactionSync!=null?x.latestTransactionSync.utc(!0).fromNow():Yt.emDash})]}),x?.offboardedAt!=null&&o.jsxRuntimeExports.jsxs(lo,{children:[o.jsxRuntimeExports.jsx(co,{children:_e.drawer.offboarded}),o.jsxRuntimeExports.jsx(po,{title:x.offboardedAt.format(Co.hmmADashDDMMMCommaYYYY),children:x.offboardedAt.format(en.visual.MMMDCommaYYYYformat)})]})]})]}),o.jsxRuntimeExports.jsxs(Mn,{children:[o.jsxRuntimeExports.jsx(Bo,{children:_e.drawer.modelAccuracy}),Object.keys(C).length>0?o.jsxRuntimeExports.jsx(Ty,{children:Object.entries(C).map(([$,w])=>{const O=w*100,A=hy(O),v=`${O.toFixed(0)}${Yt.percentage}`,T=`${O.toFixed(1)}${Yt.percentage}`;return o.jsxRuntimeExports.jsxs(Ly,{children:[o.jsxRuntimeExports.jsx(Py,{children:gy($)}),o.jsxRuntimeExports.jsx(Iy,{children:o.jsxRuntimeExports.jsx(Dy,{style:{width:v,backgroundColor:A}})}),o.jsxRuntimeExports.jsx(Ay,{children:T})]},$)})}):o.jsxRuntimeExports.jsx(kr,{children:_e.drawer.noAccuracyData})]}),h&&o.jsxRuntimeExports.jsxs(Mn,{children:[o.jsxRuntimeExports.jsx(Bo,{children:_e.drawer.actionsTitle}),o.jsxRuntimeExports.jsx(Oy,{children:ys(S).map($=>o.jsxRuntimeExports.jsx(t.Button,{label:_e.actions[$.labelKey],variant:$.destructive?"destructive":"outline",size:"small",onClick:()=>{$.operationType==="cancel_onboarding"?d(e):f($.operationType)}},$.operationType))})]}),o.jsxRuntimeExports.jsxs(vy,{children:[o.jsxRuntimeExports.jsx(Bo,{children:_e.drawer.jobHistory}),r.length===0&&!b?o.jsxRuntimeExports.jsx(kr,{children:_e.drawer.noJobsFound}):o.jsxRuntimeExports.jsxs(Ny,{children:[o.jsxRuntimeExports.jsxs(My,{children:[o.jsxRuntimeExports.jsx(zy,{children:o.jsxRuntimeExports.jsx(t.ExtraSmallSemiBold,{children:_e.drawer.operation})}),o.jsxRuntimeExports.jsx(Fy,{children:o.jsxRuntimeExports.jsx(t.ExtraSmallSemiBold,{children:_e.drawer.status})}),o.jsxRuntimeExports.jsx(Wy,{children:o.jsxRuntimeExports.jsx(t.ExtraSmallSemiBold,{children:_e.drawer.created})}),o.jsxRuntimeExports.jsx(By,{children:o.jsxRuntimeExports.jsx(t.ExtraSmallSemiBold,{children:_e.drawer.by})})]}),o.jsxRuntimeExports.jsx(_y,{children:o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:$,width:w})=>o.jsxRuntimeExports.jsx(o.InfiniteLoader,{isItemLoaded:j,itemCount:n?r.length+1:r.length,loadMoreItems:y,children:({onItemsRendered:O})=>o.jsxRuntimeExports.jsx(o.FixedSizeList,{height:$,width:w,itemCount:r.length,itemSize:Se.jobRowHeightPx,itemData:r,onItemsRendered:O,innerElementType:xy,overscanCount:Se.jobSkeletonRowCount,children:Qi})})})}),b&&o.jsxRuntimeExports.jsx(Yy,{children:Array.from({length:Se.jobSkeletonRowCount},($,w)=>o.jsxRuntimeExports.jsxs(Zy,{children:[o.jsxRuntimeExports.jsx(_o,{$flex:!0,children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:w%2===0?90:70,height:Se.skeletonLoaderHeightPx})}),o.jsxRuntimeExports.jsx(_o,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:60,height:Se.skeletonLoaderHeightPx})}),o.jsxRuntimeExports.jsx(_o,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:t.Space.sp11,height:Se.skeletonLoaderHeightPx})}),o.jsxRuntimeExports.jsx(_o,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:70,height:Se.skeletonLoaderHeightPx})})]},`skeleton-${w}`))})]})]})]})]}),p!=null&&o.jsxRuntimeExports.jsx(gs,{operationType:p.operationType,dialogTitle:_e.actions[Ss[p.operationType].labelKey],dialogDescription:Xi(p.operationType,e.companyName),onCancel:()=>m(null),onConfirm:g})]})},Qi=u.memo(({index:e,style:n,data:r})=>{const i=r[e],a=i.operationType.replaceAll("_"," "),d=i.triggeredBy!=null?`${i.triggeredBy.firstName} ${i.triggeredBy.lastName}`.trim():Yt.emDash;return o.jsxRuntimeExports.jsxs(Vy,{style:n,children:[o.jsxRuntimeExports.jsx(Uy,{children:a}),o.jsxRuntimeExports.jsx(Hy,{children:i.status}),o.jsxRuntimeExports.jsx(Ky,{title:i.createdAt.format(Co.hmmADashDDMMMCommaYYYY),children:i.createdAt.format(en.visual.MMMDCommaYYYYformat)}),o.jsxRuntimeExports.jsx(Gy,{children:d})]})});Qi.displayName="JobListItem";const xy=u.forwardRef(({style:e,...n},r)=>o.jsxRuntimeExports.jsx("div",{ref:r,style:{...e,position:"relative"},...n})),hy=e=>e>=Se.accuracySuccessThresholdPercent?t.Colors.success:e>=Se.accuracyAlertThresholdPercent?t.Colors.alert:t.Colors.important,gy=e=>e.split("_").filter(n=>n.length>0).map(n=>n[0].toUpperCase()+n.slice(1).toLowerCase()).join(" "),Sy=s.div`
2965
2965
  display: flex;
2966
2966
  flex-direction: column;
2967
2967
  background-color: ${e=>e.theme.colors.grey4};
@@ -3028,7 +3028,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3028
3028
  flex-direction: column;
3029
3029
  gap: ${t.Space.sp5};
3030
3030
  padding: ${t.Space.sp4};
3031
- `,zn=s.div``,vy=s.div`
3031
+ `,Mn=s.div``,vy=s.div`
3032
3032
  display: flex;
3033
3033
  flex-direction: column;
3034
3034
  flex: 1;
@@ -3073,7 +3073,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3073
3073
  min-width: ${Se.accuracyValueMinWidthPx}px;
3074
3074
  text-align: right;
3075
3075
  color: ${e=>e.theme.colors.champion};
3076
- `,Tr=s(t.SmallRegular)`
3076
+ `,kr=s(t.SmallRegular)`
3077
3077
  color: ${e=>e.theme.colors.hero};
3078
3078
  `,Oy=s.div`
3079
3079
  display: flex;
@@ -3110,18 +3110,18 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3110
3110
  border-bottom: 1px solid ${e=>e.theme.colors.grey2};
3111
3111
  color: ${e=>e.theme.colors.hero};
3112
3112
  padding: ${t.Space.sp0} ${t.Space.sp3};
3113
- `,pn=s.div`
3113
+ `,dn=s.div`
3114
3114
  display: flex;
3115
3115
  align-items: center;
3116
3116
  padding: ${t.Space.sp1} ${t.Space.sp2};
3117
- `,zy=s(pn)`
3117
+ `,zy=s(dn)`
3118
3118
  flex: 1 1 auto;
3119
3119
  min-width: ${Se.jobOperationMinWidthPx}px;
3120
- `,Fy=s(pn)`
3120
+ `,Fy=s(dn)`
3121
3121
  width: ${Se.jobStatusColumnWidthPx}px;
3122
- `,Wy=s(pn)`
3122
+ `,Wy=s(dn)`
3123
3123
  width: ${Se.jobDateColumnWidthPx}px;
3124
- `,By=s(pn)`
3124
+ `,By=s(dn)`
3125
3125
  width: ${Se.jobByColumnWidthPx}px;
3126
3126
  `,_y=s.div`
3127
3127
  flex: 1;
@@ -3139,7 +3139,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3139
3139
  &:last-child > div {
3140
3140
  border-bottom: none;
3141
3141
  }
3142
- `,un=s(t.SmallRegular)`
3142
+ `,pn=s(t.SmallRegular)`
3143
3143
  display: flex;
3144
3144
  align-items: center;
3145
3145
  padding: ${t.Space.sp1} ${t.Space.sp2};
@@ -3147,14 +3147,14 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3147
3147
  overflow: hidden;
3148
3148
  border-bottom: 1px solid ${e=>e.theme.colors.grey2};
3149
3149
  min-height: ${Se.jobRowHeightPx}px;
3150
- `,Uy=s(un)`
3150
+ `,Uy=s(pn)`
3151
3151
  flex: 1 1 auto;
3152
3152
  min-width: ${Se.jobOperationMinWidthPx}px;
3153
- `,Hy=s(un)`
3153
+ `,Hy=s(pn)`
3154
3154
  width: ${Se.jobStatusColumnWidthPx}px;
3155
- `,Ky=s(un)`
3155
+ `,Ky=s(pn)`
3156
3156
  width: ${Se.jobDateColumnWidthPx}px;
3157
- `,Gy=s(un)`
3157
+ `,Gy=s(pn)`
3158
3158
  width: ${Se.jobByColumnWidthPx}px;
3159
3159
  `,Yy=s.div`
3160
3160
  display: flex;
@@ -3172,7 +3172,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3172
3172
  flex: ${e=>e.$flex===!0?"1 1 auto":"0 0 auto"};
3173
3173
  min-width: ${e=>e.$flex===!0?`${Se.jobOperationMinWidthPx}px`:`${Se.jobStatusColumnWidthPx}px`};
3174
3174
  padding: ${t.Space.sp1} ${t.Space.sp2};
3175
- `,{common:{strings:uo},dateFormat:Lr,timeFormat:Pr,aiAccountantCustomer:ls}=t.appLocale.getLocalizedStrings(),Xy=({customers:e,sortKey:n,sortOrder:r,selectedTenantIds:i,onAction:a,onCancelOnboarding:d,onColumnSortConfigChanged:l,onRowClick:c,onToggleAllVisible:p,onToggleTenantSelection:m})=>{const[h,S]=u.useState(null),x=fs(),C=u.useMemo(()=>new Set(i),[i]),b=i.length>0,f=u.useMemo(()=>e.map(F=>F.tenantId),[e]),g=u.useMemo(()=>f.filter(F=>C.has(F)).length,[f,C]),j=f.length>0&&g===f.length,y=g>0&&!j,$=F=>{l(F,n===F&&r==="ascending"?"descending":"ascending")},w=u.useCallback((F,I)=>{S({customer:F,operationType:I})},[]),O=u.useCallback((F,I,K)=>{h!=null&&a(h.customer,F,I,K),S(null)},[a,h]),A=u.useRef(null),v=u.useMemo(()=>({customerCount:e.length,customers:e,hasWriteAccess:x,isSelectionActive:b,onCancelOnboarding:d,onRequestAction:w,onRowClick:c,onToggleTenantSelection:m,selectedTenantIdSet:C}),[e,x,b,d,w,c,m,C]),T=u.useCallback(({scrollOffset:F})=>{A.current!=null&&(A.current.scrollLeft=F)},[]);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(Qy,{children:[o.jsxRuntimeExports.jsxs(Jy,{ref:A,children:[x&&o.jsxRuntimeExports.jsx(i0,{children:o.jsxRuntimeExports.jsx(o.Checkbox,{size:"small",checked:j,indeterminate:y,disabled:f.length===0,onChange:()=>p(f)})}),uy.map(F=>{const I=n===F.key,K=r==="ascending"?"asc":"desc";return o.jsxRuntimeExports.jsx(e0,{$width:F.width,$justifyContent:F.justifyContent,$growToFill:F.growToFill,children:o.jsxRuntimeExports.jsx(t0,{children:F.sortable&&F.key!=="actions"?o.jsxRuntimeExports.jsxs(o0,{type:"button",$active:I,onClick:()=>$(F.key),children:[F.label,o.jsxRuntimeExports.jsx(n0,{$direction:I?K:"asc",children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:Se.sortIconSize,height:Se.sortIconSize})})]}):F.label})},F.key)})]}),e.length===0?o.jsxRuntimeExports.jsx(u0,{children:ls.table.noCustomersFound}):o.jsxRuntimeExports.jsx(s0,{children:o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:F,width:I})=>o.jsxRuntimeExports.jsx(o.FixedSizeList,{height:F,width:I,itemCount:e.length,itemSize:Se.rowHeightPx,itemData:v,innerElementType:qy,onScroll:T,overscanCount:5,children:Ji})})})]}),h!=null&&o.jsxRuntimeExports.jsx(Ss,{operationType:h.operationType,dialogTitle:ls.actions[ln[h.operationType]],dialogDescription:qi(h.operationType,h.customer.companyName),onCancel:()=>S(null),onConfirm:O})]})},Ji=u.memo(({index:e,style:n,data:r})=>{const{customerCount:i,customers:a,hasWriteAccess:d,isSelectionActive:l,onCancelOnboarding:c,onRequestAction:p,onRowClick:m,onToggleTenantSelection:h,selectedTenantIdSet:S}=r,x=a[e],C=S.has(x.tenantId),b=e===i-1,[f,g]=u.useState(!1),j=u.useRef(null),[y,$]=u.useState({top:0,right:0}),w=x.enrollment?.status??"unknown",O=x.averageAccuracy,A=O>0?`${(O*100).toFixed(1)}${uo.percentage}`:uo.emDash;return u.useEffect(()=>{if(f&&j.current!=null){const v=j.current.getBoundingClientRect();$({top:v.bottom,right:window.innerWidth-v.right})}},[f]),u.useEffect(()=>{if(!f)return;const v=()=>g(!1);return document.addEventListener("click",v),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{document.removeEventListener("click",v),window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[f]),u.useEffect(()=>{l&&f&&g(!1)},[l,f]),o.jsxRuntimeExports.jsxs(r0,{style:n,$isSelected:C,onClick:()=>m(x),children:[d&&o.jsxRuntimeExports.jsx(a0,{$hideBorder:b,onClick:v=>v.stopPropagation(),children:o.jsxRuntimeExports.jsx(o.Checkbox,{size:"small",checked:C,onChange:()=>h(x.tenantId)})}),o.jsxRuntimeExports.jsx(l0,{$hideBorder:b,children:o.jsxRuntimeExports.jsxs("div",{children:[o.jsxRuntimeExports.jsx(m0,{children:x.companyName.length>0?x.companyName:x.companyId}),o.jsxRuntimeExports.jsx(x0,{children:x.tenantId})]})}),o.jsxRuntimeExports.jsx(c0,{$hideBorder:b,children:o.jsxRuntimeExports.jsx(h0,{status:w,children:w})}),o.jsxRuntimeExports.jsx(Fn,{$hideBorder:b,children:x.bookcloseDate!=null?x.bookcloseDate.format(Lr.visual.MMMDCommaYYYYformat):uo.emDash}),o.jsxRuntimeExports.jsx(Fn,{$hideBorder:b,title:x.enrollment?.latestTraining!=null?x.enrollment.latestTraining.format(Pr.hmmADashDDMMMCommaYYYY):void 0,children:x.enrollment?.latestTraining!=null?x.enrollment.latestTraining.format(Lr.visual.MMMDCommaYYYYformat):uo.emDash}),o.jsxRuntimeExports.jsx(Fn,{$hideBorder:b,title:x.enrollment?.latestTransactionSync!=null?x.enrollment.latestTransactionSync.local().format(Pr.hmmADashDDMMMCommaYYYY):void 0,children:x.enrollment?.latestTransactionSync!=null?x.enrollment.latestTransactionSync.utc(!0).fromNow():uo.emDash}),o.jsxRuntimeExports.jsx(d0,{$hideBorder:b,children:A}),o.jsxRuntimeExports.jsx(p0,{$hideBorder:b,children:d&&!l&&o.jsxRuntimeExports.jsxs(g0,{onClick:v=>v.stopPropagation(),children:[o.jsxRuntimeExports.jsx(S0,{ref:j,onClick:()=>g(!f),children:o.jsxRuntimeExports.jsx(t.SvgMore,{width:Se.menuIconSize,height:Se.menuIconSize})}),f&&ds.createPortal(o.jsxRuntimeExports.jsx(y0,{style:{top:y.top,right:y.right},children:ys(w).map(v=>o.jsxRuntimeExports.jsx(f0,{onClick:()=>{g(!1),v.operationType==="cancel_onboarding"?c(x):p(x,v.operationType)},children:ls.actions[v.labelKey]},v.operationType))}),document.body)]})})]})});Ji.displayName="AiAccountantCustomerListItem";const qy=u.forwardRef(({style:e,...n},r)=>o.jsxRuntimeExports.jsx("div",{ref:r,style:{...e,position:"relative"},...n})),Qy=s.div`
3175
+ `,{common:{strings:uo},dateFormat:Tr,timeFormat:Lr,aiAccountantCustomer:as}=t.appLocale.getLocalizedStrings(),Xy=({customers:e,sortKey:n,sortOrder:r,selectedTenantIds:i,onAction:a,onCancelOnboarding:d,onColumnSortConfigChanged:l,onRowClick:c,onToggleAllVisible:p,onToggleTenantSelection:m})=>{const[h,S]=u.useState(null),x=fs(),C=u.useMemo(()=>new Set(i),[i]),b=i.length>0,f=u.useMemo(()=>e.map(F=>F.tenantId),[e]),g=u.useMemo(()=>f.filter(F=>C.has(F)).length,[f,C]),j=f.length>0&&g===f.length,y=g>0&&!j,$=F=>{l(F,n===F&&r==="ascending"?"descending":"ascending")},w=u.useCallback((F,I)=>{S({customer:F,operationType:I})},[]),O=u.useCallback((F,I,K)=>{h!=null&&a(h.customer,F,I,K),S(null)},[a,h]),A=u.useRef(null),v=u.useMemo(()=>({customerCount:e.length,customers:e,hasWriteAccess:x,isSelectionActive:b,onCancelOnboarding:d,onRequestAction:w,onRowClick:c,onToggleTenantSelection:m,selectedTenantIdSet:C}),[e,x,b,d,w,c,m,C]),T=u.useCallback(({scrollOffset:F})=>{A.current!=null&&(A.current.scrollLeft=F)},[]);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(Qy,{children:[o.jsxRuntimeExports.jsxs(Jy,{ref:A,children:[x&&o.jsxRuntimeExports.jsx(i0,{children:o.jsxRuntimeExports.jsx(o.Checkbox,{size:"small",checked:j,indeterminate:y,disabled:f.length===0,onChange:()=>p(f)})}),uy.map(F=>{const I=n===F.key,K=r==="ascending"?"asc":"desc";return o.jsxRuntimeExports.jsx(e0,{$width:F.width,$justifyContent:F.justifyContent,$growToFill:F.growToFill,children:o.jsxRuntimeExports.jsx(t0,{children:F.sortable&&F.key!=="actions"?o.jsxRuntimeExports.jsxs(o0,{type:"button",$active:I,onClick:()=>$(F.key),children:[F.label,o.jsxRuntimeExports.jsx(n0,{$direction:I?K:"asc",children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:Se.sortIconSize,height:Se.sortIconSize})})]}):F.label})},F.key)})]}),e.length===0?o.jsxRuntimeExports.jsx(u0,{children:as.table.noCustomersFound}):o.jsxRuntimeExports.jsx(s0,{children:o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:F,width:I})=>o.jsxRuntimeExports.jsx(o.FixedSizeList,{height:F,width:I,itemCount:e.length,itemSize:Se.rowHeightPx,itemData:v,innerElementType:qy,onScroll:T,overscanCount:5,children:Ji})})})]}),h!=null&&o.jsxRuntimeExports.jsx(gs,{operationType:h.operationType,dialogTitle:as.actions[Ss[h.operationType].labelKey],dialogDescription:Xi(h.operationType,h.customer.companyName),onCancel:()=>S(null),onConfirm:O})]})},Ji=u.memo(({index:e,style:n,data:r})=>{const{customerCount:i,customers:a,hasWriteAccess:d,isSelectionActive:l,onCancelOnboarding:c,onRequestAction:p,onRowClick:m,onToggleTenantSelection:h,selectedTenantIdSet:S}=r,x=a[e],C=S.has(x.tenantId),b=e===i-1,[f,g]=u.useState(!1),j=u.useRef(null),[y,$]=u.useState({top:0,right:0}),w=x.enrollment?.status??"unknown",O=x.averageAccuracy,A=O>0?`${(O*100).toFixed(1)}${uo.percentage}`:uo.emDash;return u.useEffect(()=>{if(f&&j.current!=null){const v=j.current.getBoundingClientRect();$({top:v.bottom,right:window.innerWidth-v.right})}},[f]),u.useEffect(()=>{if(!f)return;const v=()=>g(!1);return document.addEventListener("click",v),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{document.removeEventListener("click",v),window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[f]),u.useEffect(()=>{l&&f&&g(!1)},[l,f]),o.jsxRuntimeExports.jsxs(r0,{style:n,$isSelected:C,onClick:()=>m(x),children:[d&&o.jsxRuntimeExports.jsx(a0,{$hideBorder:b,onClick:v=>v.stopPropagation(),children:o.jsxRuntimeExports.jsx(o.Checkbox,{size:"small",checked:C,onChange:()=>h(x.tenantId)})}),o.jsxRuntimeExports.jsx(l0,{$hideBorder:b,children:o.jsxRuntimeExports.jsxs("div",{children:[o.jsxRuntimeExports.jsx(m0,{children:x.companyName.length>0?x.companyName:x.companyId}),o.jsxRuntimeExports.jsx(x0,{children:x.tenantId})]})}),o.jsxRuntimeExports.jsx(c0,{$hideBorder:b,children:o.jsxRuntimeExports.jsx(h0,{status:w,children:qi(w)})}),o.jsxRuntimeExports.jsx(zn,{$hideBorder:b,children:x.bookcloseDate!=null?x.bookcloseDate.format(Tr.visual.MMMDCommaYYYYformat):uo.emDash}),o.jsxRuntimeExports.jsx(zn,{$hideBorder:b,title:x.enrollment?.latestTraining!=null?x.enrollment.latestTraining.format(Lr.hmmADashDDMMMCommaYYYY):void 0,children:x.enrollment?.latestTraining!=null?x.enrollment.latestTraining.format(Tr.visual.MMMDCommaYYYYformat):uo.emDash}),o.jsxRuntimeExports.jsx(zn,{$hideBorder:b,title:x.enrollment?.latestTransactionSync!=null?x.enrollment.latestTransactionSync.local().format(Lr.hmmADashDDMMMCommaYYYY):void 0,children:x.enrollment?.latestTransactionSync!=null?x.enrollment.latestTransactionSync.utc(!0).fromNow():uo.emDash}),o.jsxRuntimeExports.jsx(d0,{$hideBorder:b,children:A}),o.jsxRuntimeExports.jsx(p0,{$hideBorder:b,children:d&&!l&&o.jsxRuntimeExports.jsxs(g0,{onClick:v=>v.stopPropagation(),children:[o.jsxRuntimeExports.jsx(S0,{ref:j,onClick:()=>g(!f),children:o.jsxRuntimeExports.jsx(t.SvgMore,{width:Se.menuIconSize,height:Se.menuIconSize})}),f&&cs.createPortal(o.jsxRuntimeExports.jsx(y0,{style:{top:y.top,right:y.right},children:ys(w).map(v=>o.jsxRuntimeExports.jsx(f0,{onClick:()=>{g(!1),v.operationType==="cancel_onboarding"?c(x):p(x,v.operationType)},children:as.actions[v.labelKey]},v.operationType))}),document.body)]})})]})});Ji.displayName="AiAccountantCustomerListItem";const qy=u.forwardRef(({style:e,...n},r)=>o.jsxRuntimeExports.jsx("div",{ref:r,style:{...e,position:"relative"},...n})),Qy=s.div`
3176
3176
  position: relative;
3177
3177
  flex: 1;
3178
3178
  min-height: 0;
@@ -3291,7 +3291,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3291
3291
  min-width: ${tt.companyName}px;
3292
3292
  `,c0=s(Eo)`
3293
3293
  width: ${tt.status}px;
3294
- `,Fn=s(Eo)`
3294
+ `,zn=s(Eo)`
3295
3295
  width: ${tt.bookcloseDate}px;
3296
3296
  `,d0=s(Eo)`
3297
3297
  width: ${tt.accuracy}px;
@@ -3358,7 +3358,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3358
3358
  border-radius: ${t.Space.sp2};
3359
3359
  padding: ${t.Space.sp4};
3360
3360
  box-sizing: border-box;
3361
- `,{common:{strings:Ir},aiAccountantCustomer:Uo}=t.appLocale.getLocalizedStrings(),E0=({averageAccuracy:e,customers:n})=>{const r=n.length,i=n.filter(l=>l.enrollment?.status==="active").length,a=n.filter(l=>{const c=l.enrollment?.status;return c==="pending"||c==="onboarding"||c==="offboarding"}).length,d=e>0?`${(e*100).toFixed(1)}${Ir.percentage}`:Ir.emDash;return o.jsxRuntimeExports.jsxs(w0,{children:[o.jsxRuntimeExports.jsxs(Ho,{children:[o.jsxRuntimeExports.jsx(Ko,{children:Uo.summary.totalCustomers}),o.jsxRuntimeExports.jsx(Go,{children:r})]}),o.jsxRuntimeExports.jsxs(Ho,{children:[o.jsxRuntimeExports.jsx(Ko,{children:Uo.summary.active}),o.jsxRuntimeExports.jsx(Go,{children:i})]}),o.jsxRuntimeExports.jsxs(Ho,{children:[o.jsxRuntimeExports.jsx(Ko,{children:Uo.summary.inProgress}),o.jsxRuntimeExports.jsx(Go,{children:a})]}),o.jsxRuntimeExports.jsxs(Ho,{children:[o.jsxRuntimeExports.jsx(Ko,{children:Uo.summary.avgAccuracy}),o.jsxRuntimeExports.jsx(Go,{children:d})]})]})},w0=s.div`
3361
+ `,{common:{strings:Pr},aiAccountantCustomer:Uo}=t.appLocale.getLocalizedStrings(),E0=({averageAccuracy:e,customers:n})=>{const r=n.length,i=n.filter(l=>l.enrollment?.status==="active").length,a=n.filter(l=>{const c=l.enrollment?.status;return c==="pending"||c==="onboarding"||c==="offboarding"}).length,d=e>0?`${(e*100).toFixed(1)}${Pr.percentage}`:Pr.emDash;return o.jsxRuntimeExports.jsxs(w0,{children:[o.jsxRuntimeExports.jsxs(Ho,{children:[o.jsxRuntimeExports.jsx(Ko,{children:Uo.summary.totalCustomers}),o.jsxRuntimeExports.jsx(Go,{children:r})]}),o.jsxRuntimeExports.jsxs(Ho,{children:[o.jsxRuntimeExports.jsx(Ko,{children:Uo.summary.active}),o.jsxRuntimeExports.jsx(Go,{children:i})]}),o.jsxRuntimeExports.jsxs(Ho,{children:[o.jsxRuntimeExports.jsx(Ko,{children:Uo.summary.inProgress}),o.jsxRuntimeExports.jsx(Go,{children:a})]}),o.jsxRuntimeExports.jsxs(Ho,{children:[o.jsxRuntimeExports.jsx(Ko,{children:Uo.summary.avgAccuracy}),o.jsxRuntimeExports.jsx(Go,{children:d})]})]})},w0=s.div`
3362
3362
  display: flex;
3363
3363
  flex-direction: row;
3364
3364
  gap: ${t.Space.sp3};
@@ -3382,7 +3382,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3382
3382
  `,Go=s(t.LargeSemiBold)`
3383
3383
  color: ${e=>e.theme.colors.primary};
3384
3384
  margin-top: ${t.Space.sp2};
3385
- `,{aiAccountantCustomer:Ue}=t.appLocale.getLocalizedStrings(),v0="retrain",k0=[{label:Ue.filters.enrollmentStatus.active,value:"active"},{label:Ue.filters.enrollmentStatus.pending,value:"pending"},{label:Ue.filters.enrollmentStatus.onboarding,value:"onboarding"},{label:Ue.filters.enrollmentStatus.offboarded,value:"offboarded"},{label:Ue.filters.enrollmentStatus.failed,value:"failed"}],T0=()=>({enrollmentStatus:k0}),L0=({headerData:e,headerActions:n,aiAccountantPageActions:r,aiAccountantPageData:i})=>{const a=t.useWindowSizeContext(),d=fs(),{aiAccountantView:l}=i,{onAction:c,onBulkAction:p,onCancelOnboarding:m,onClearSelection:h,onCockpitReloadData:S,onColumnSortConfigChanged:x,onCustomerSelected:C,onEvaluateAll:b,onFilterTextChanged:f,onFiltersChange:g,onToggleAllVisible:j,onToggleTenantSelection:y}=r,$=l.fetchState==="Completed",w=l.fetchState==="In-Progress"||l.fetchState==="Not-Started",O=l.fetchState==="Error",A=l.triggerJobStatus.fetchState==="In-Progress",v=l.selectedTenantIds,T=v.length,F=l.unonboardedTenantIds.length,I=T>0,K=u.useMemo(()=>{if(!I)return[];const N=l.selectedCustomersForJobTrigger.map(Q=>ys(Q.enrollment?.status??"unknown"));if(N.length===0)return[];const[H,...L]=N;return H.filter(Q=>Q.operationType!=="cancel_onboarding"&&L.every(se=>se.some(X=>X.operationType===Q.operationType)))},[I,l.selectedCustomersForJobTrigger]),[M,Y]=u.useState(!1),G=u.useRef(null),[E,P]=u.useState({top:0,right:0});u.useEffect(()=>{if(M&&G.current!=null){const N=G.current.getBoundingClientRect();P({top:N.bottom,right:window.innerWidth-N.right})}},[M]),u.useEffect(()=>{if(!M)return;const N=()=>Y(!1);return document.addEventListener("click",N),window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{document.removeEventListener("click",N),window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[M]);const[W,k]=u.useState(null),D=()=>{F===0||A||k({mode:"evaluateAll",count:F})},z=N=>{Y(!1),k({mode:"bulk",operationType:N.operationType,operationLabel:Ue.actions[ln[N.operationType]],count:T})},Z=(N,H,L)=>{W!=null&&(W.mode==="evaluateAll"?b(H,L):p(N,H,L),k(null))},ie=I||F===0||A;return o.jsxRuntimeExports.jsxs(P0,{children:[o.jsxRuntimeExports.jsx(ht,{headerActions:{...n,filterActions:{onFilterTextChanged:(N,H)=>{f(H)},getCategoryWiseOptions:T0,onFiltersChange:g}},headerData:{...e,allTabOptions:xt,companiesLoaded:$,filterData:{filterText:l.uiState.filterText,filters:l.uiState.filters},selectedTabOption:"aiAccountant"}}),o.jsxRuntimeExports.jsx(I0,{windowSize:a,children:w?o.jsxRuntimeExports.jsx(j0,{}):O?o.jsxRuntimeExports.jsx(jt,{onCockpitReloadData:S,selectedCockpitOption:"aiAccountant"}):o.jsxRuntimeExports.jsxs(V0,{children:[o.jsxRuntimeExports.jsxs(D0,{children:[o.jsxRuntimeExports.jsx(A0,{children:I&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(N0,{children:Ue.bulkActions.selectedCount.replace("__count__",String(T))}),o.jsxRuntimeExports.jsx(M0,{type:"button",onClick:h,children:Ue.bulkActions.clear})]})}),o.jsxRuntimeExports.jsxs(O0,{children:[o.jsxRuntimeExports.jsx(t.RefreshButton,{isEnabled:!w,spinRefreshIcon:w,onClick:()=>S("aiAccountant")}),d&&!I&&o.jsxRuntimeExports.jsx(t.Button,{label:Ue.summary.evaluateAll,variant:"primary",size:"small",disabled:ie,onClick:D}),d&&I&&o.jsxRuntimeExports.jsxs(z0,{children:[o.jsxRuntimeExports.jsxs(F0,{ref:G,onClick:N=>N.stopPropagation(),children:[o.jsxRuntimeExports.jsx(t.Button,{label:Ue.bulkActions.menuLabel,variant:"primary",size:"small",disabled:K.length===0||A,onClick:()=>Y(!M)}),M&&K.length>0&&ds.createPortal(o.jsxRuntimeExports.jsx(B0,{style:{top:E.top,right:E.right},children:K.map(N=>o.jsxRuntimeExports.jsx(_0,{onClick:()=>z(N),children:Ue.actions[ln[N.operationType]]},N.operationType))}),document.body)]}),K.length===0&&o.jsxRuntimeExports.jsx(W0,{children:Ue.bulkActions.disabledInfo})]})]})]}),o.jsxRuntimeExports.jsx(E0,{averageAccuracy:l.averageAccuracy,customers:l.customers}),o.jsxRuntimeExports.jsx(Xy,{customers:l.customers,sortKey:l.uiState.sortKey,sortOrder:l.uiState.sortOrder,selectedTenantIds:v,onColumnSortConfigChanged:x,onRowClick:C,onAction:c,onCancelOnboarding:m,onToggleAllVisible:j,onToggleTenantSelection:y})]})}),W!=null&&o.jsxRuntimeExports.jsx(Ss,{operationType:W.mode==="evaluateAll"?v0:W.operationType,dialogTitle:W.mode==="evaluateAll"?Ue.bulkActions.evaluateAllDialogTitle:W.operationLabel,dialogDescription:W.mode==="evaluateAll"?Ue.bulkActions.evaluateAllDialogDescription.replace("__count__",String(W.count)):W.operationType==="offboard"?Ue.bulkActions.bulkDialogDescriptionOffboard.replace("__count__",String(W.count)):Ue.bulkActions.bulkDialogDescription.replace("__count__",String(W.count)).replace("__action__",W.operationLabel),onCancel:()=>k(null),onConfirm:Z})]})},P0=s.div`
3385
+ `,{aiAccountantCustomer:Ue}=t.appLocale.getLocalizedStrings(),v0="evaluate",k0=[{label:Ue.filters.enrollmentStatus.active,value:"active"},{label:Ue.filters.enrollmentStatus.pending,value:"pending"},{label:Ue.filters.enrollmentStatus.onboarding,value:"onboarding"},{label:Ue.filters.enrollmentStatus.offboarded,value:"offboarded"},{label:Ue.filters.enrollmentStatus.failed,value:"failed"}],T0=()=>({enrollmentStatus:k0}),L0=({headerData:e,headerActions:n,aiAccountantPageActions:r,aiAccountantPageData:i})=>{const a=t.useWindowSizeContext(),d=fs(),{aiAccountantView:l}=i,{onAction:c,onBulkAction:p,onCancelOnboarding:m,onClearSelection:h,onCockpitReloadData:S,onColumnSortConfigChanged:x,onCustomerSelected:C,onEvaluateAll:b,onFilterTextChanged:f,onFiltersChange:g,onToggleAllVisible:j,onToggleTenantSelection:y}=r,$=l.fetchState==="Completed",w=l.fetchState==="In-Progress"||l.fetchState==="Not-Started",O=l.fetchState==="Error",A=l.triggerJobStatus.fetchState==="In-Progress",v=l.selectedTenantIds,T=v.length,F=l.unonboardedTenantIds.length,I=T>0,K=u.useMemo(()=>{if(!I)return[];const N=l.selectedCustomersForJobTrigger.map(Q=>ys(Q.enrollment?.status??"unknown"));if(N.length===0)return[];const[H,...L]=N;return H.filter(Q=>Q.operationType!=="cancel_onboarding"&&L.every(se=>se.some(X=>X.operationType===Q.operationType)))},[I,l.selectedCustomersForJobTrigger]),[M,Y]=u.useState(!1),G=u.useRef(null),[E,P]=u.useState({top:0,right:0});u.useEffect(()=>{if(M&&G.current!=null){const N=G.current.getBoundingClientRect();P({top:N.bottom,right:window.innerWidth-N.right})}},[M]),u.useEffect(()=>{if(!M)return;const N=()=>Y(!1);return document.addEventListener("click",N),window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{document.removeEventListener("click",N),window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[M]);const[W,k]=u.useState(null),D=()=>{F===0||A||k({mode:"evaluateAll",count:F})},z=N=>{Y(!1),k({mode:"bulk",operationType:N.operationType,operationLabel:Ue.actions[N.labelKey],count:T})},Z=(N,H,L)=>{W!=null&&(W.mode==="evaluateAll"?b(H,L):p(N,H,L),k(null))},ie=I||F===0||A;return o.jsxRuntimeExports.jsxs(P0,{children:[o.jsxRuntimeExports.jsx(ht,{headerActions:{...n,filterActions:{onFilterTextChanged:(N,H)=>{f(H)},getCategoryWiseOptions:T0,onFiltersChange:g}},headerData:{...e,allTabOptions:xt,companiesLoaded:$,filterData:{filterText:l.uiState.filterText,filters:l.uiState.filters},selectedTabOption:"aiAccountant"}}),o.jsxRuntimeExports.jsx(I0,{windowSize:a,children:w?o.jsxRuntimeExports.jsx(j0,{}):O?o.jsxRuntimeExports.jsx(bt,{onCockpitReloadData:S,selectedCockpitOption:"aiAccountant"}):o.jsxRuntimeExports.jsxs(V0,{children:[o.jsxRuntimeExports.jsxs(D0,{children:[o.jsxRuntimeExports.jsx(A0,{children:I&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(N0,{children:Ue.bulkActions.selectedCount.replace("__count__",String(T))}),o.jsxRuntimeExports.jsx(M0,{type:"button",onClick:h,children:Ue.bulkActions.clear})]})}),o.jsxRuntimeExports.jsxs(O0,{children:[o.jsxRuntimeExports.jsx(t.RefreshButton,{isEnabled:!w,spinRefreshIcon:w,onClick:()=>S("aiAccountant")}),d&&!I&&o.jsxRuntimeExports.jsx(t.Button,{label:Ue.summary.evaluateAll,variant:"primary",size:"small",disabled:ie,onClick:D}),d&&I&&o.jsxRuntimeExports.jsxs(z0,{children:[o.jsxRuntimeExports.jsxs(F0,{ref:G,onClick:N=>N.stopPropagation(),children:[o.jsxRuntimeExports.jsx(t.Button,{label:Ue.bulkActions.menuLabel,variant:"primary",size:"small",disabled:K.length===0||A,onClick:()=>Y(!M)}),M&&K.length>0&&cs.createPortal(o.jsxRuntimeExports.jsx(B0,{style:{top:E.top,right:E.right},children:K.map(N=>o.jsxRuntimeExports.jsx(_0,{onClick:()=>z(N),children:Ue.actions[N.labelKey]},N.operationType))}),document.body)]}),K.length===0&&o.jsxRuntimeExports.jsx(W0,{children:Ue.bulkActions.disabledInfo})]})]})]}),o.jsxRuntimeExports.jsx(E0,{averageAccuracy:l.averageAccuracy,customers:l.customers}),o.jsxRuntimeExports.jsx(Xy,{customers:l.customers,sortKey:l.uiState.sortKey,sortOrder:l.uiState.sortOrder,selectedTenantIds:v,onColumnSortConfigChanged:x,onRowClick:C,onAction:c,onCancelOnboarding:m,onToggleAllVisible:j,onToggleTenantSelection:y})]})}),W!=null&&o.jsxRuntimeExports.jsx(gs,{operationType:W.mode==="evaluateAll"?v0:W.operationType,dialogTitle:W.mode==="evaluateAll"?Ue.bulkActions.evaluateAllDialogTitle:W.operationLabel,dialogDescription:W.mode==="evaluateAll"?Ue.bulkActions.evaluateAllDialogDescription.replace("__count__",String(W.count)):W.operationType==="offboard"?Ue.bulkActions.bulkDialogDescriptionOffboard.replace("__count__",String(W.count)):Ue.bulkActions.bulkDialogDescription.replace("__count__",String(W.count)).replace("__action__",W.operationLabel),onCancel:()=>k(null),onConfirm:Z})]})},P0=s.div`
3386
3386
  height: calc(100vh - ${Se.globalNavBarHeightPx}px);
3387
3387
  overflow-y: hidden;
3388
3388
  background-color: ${e=>e.theme.colors.grey4};
@@ -3450,7 +3450,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3450
3450
  flex-direction: column;
3451
3451
  flex: 1;
3452
3452
  min-height: 0;
3453
- `,vt={1:12,2:64,3:95};function U0({qboConnectionPool:e,isLoading:n,onQBOConnectClick:r}){const i=t.appLocale.getLocalizedStrings().cockpit.onboarding.qboSetupAutomated;return o.jsxRuntimeExports.jsx(H0,{children:o.jsxRuntimeExports.jsx(K0,{children:o.jsxRuntimeExports.jsxs(G0,{children:[n===!0?o.jsxRuntimeExports.jsx(Dr,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:154,height:t.sp[4]})}):o.jsxRuntimeExports.jsx(Dr,{children:i.qboSectionText}),o.jsxRuntimeExports.jsxs(Y0,{children:[o.jsxRuntimeExports.jsxs(Wn,{minWidth:t.Space.sp9,children:[n===!0?o.jsxRuntimeExports.jsx(Kt,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:vt[1],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(Kt,{children:e.essentialConnectionsCount}),n===!0?o.jsxRuntimeExports.jsx(kt,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:vt[2],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(kt,{children:i.typeOfQBOAccount.essentials})]}),o.jsxRuntimeExports.jsxs(Wn,{minWidth:"28px",children:[n===!0?o.jsxRuntimeExports.jsx(Kt,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:vt[1],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(Kt,{children:e.plusConnectionsCount}),n===!0?o.jsxRuntimeExports.jsx(kt,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:vt[2],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(kt,{children:i.typeOfQBOAccount.plus})]}),o.jsxRuntimeExports.jsxs(Wn,{minWidth:"62px",children:[n===!0?o.jsxRuntimeExports.jsx(Kt,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:vt[1],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(Kt,{children:e.advanceConnectionsCount}),n===!0?o.jsxRuntimeExports.jsx(kt,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:vt[2],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(kt,{children:i.typeOfQBOAccount.advanced})]})]}),n===!0?o.jsxRuntimeExports.jsx(Ar,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:vt[3],height:t.sp[4]})}):o.jsxRuntimeExports.jsxs(Ar,{onClick:()=>{r()},children:[o.jsxRuntimeExports.jsx(Z0,{className:"setupQbo"}),o.jsxRuntimeExports.jsx(kt,{className:"setupQbo",children:i.setupQBO})]})]})})})}const H0=s.div`
3453
+ `,kt={1:12,2:64,3:95};function U0({qboConnectionPool:e,isLoading:n,onQBOConnectClick:r}){const i=t.appLocale.getLocalizedStrings().cockpit.onboarding.qboSetupAutomated;return o.jsxRuntimeExports.jsx(H0,{children:o.jsxRuntimeExports.jsx(K0,{children:o.jsxRuntimeExports.jsxs(G0,{children:[n===!0?o.jsxRuntimeExports.jsx(Ir,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:154,height:t.sp[4]})}):o.jsxRuntimeExports.jsx(Ir,{children:i.qboSectionText}),o.jsxRuntimeExports.jsxs(Y0,{children:[o.jsxRuntimeExports.jsxs(Fn,{minWidth:t.Space.sp9,children:[n===!0?o.jsxRuntimeExports.jsx(Kt,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:kt[1],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(Kt,{children:e.essentialConnectionsCount}),n===!0?o.jsxRuntimeExports.jsx(Tt,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:kt[2],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(Tt,{children:i.typeOfQBOAccount.essentials})]}),o.jsxRuntimeExports.jsxs(Fn,{minWidth:"28px",children:[n===!0?o.jsxRuntimeExports.jsx(Kt,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:kt[1],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(Kt,{children:e.plusConnectionsCount}),n===!0?o.jsxRuntimeExports.jsx(Tt,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:kt[2],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(Tt,{children:i.typeOfQBOAccount.plus})]}),o.jsxRuntimeExports.jsxs(Fn,{minWidth:"62px",children:[n===!0?o.jsxRuntimeExports.jsx(Kt,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:kt[1],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(Kt,{children:e.advanceConnectionsCount}),n===!0?o.jsxRuntimeExports.jsx(Tt,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:kt[2],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(Tt,{children:i.typeOfQBOAccount.advanced})]})]}),n===!0?o.jsxRuntimeExports.jsx(Dr,{children:o.jsxRuntimeExports.jsx(t.RectangularContentLoader,{width:kt[3],height:t.sp[4]})}):o.jsxRuntimeExports.jsxs(Dr,{onClick:()=>{r()},children:[o.jsxRuntimeExports.jsx(Z0,{className:"setupQbo"}),o.jsxRuntimeExports.jsx(Tt,{className:"setupQbo",children:i.setupQBO})]})]})})})}const H0=s.div`
3454
3454
  z-index: 2;
3455
3455
  display: flex;
3456
3456
  flex-direction: column;
@@ -3475,7 +3475,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3475
3475
  display: flex;
3476
3476
  justify-content: space-between;
3477
3477
  row-gap: ${t.Space.sp2};
3478
- `,Dr=s(t.SmallRegular)`
3478
+ `,Ir=s(t.SmallRegular)`
3479
3479
  display: flex;
3480
3480
  align-items: center;
3481
3481
  justify-content: left;
@@ -3489,7 +3489,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3489
3489
  justify-content: space-between;
3490
3490
  align-items: center;
3491
3491
  column-gap: ${t.Space.sp11};
3492
- `,Wn=s.div`
3492
+ `,Fn=s.div`
3493
3493
  display: flex;
3494
3494
  min-width: ${e=>e.minWidth};
3495
3495
  flex-direction: column;
@@ -3497,7 +3497,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3497
3497
  align-items: center;
3498
3498
  `,Kt=s(t.LargeSemiBold)`
3499
3499
  color: ${e=>e.theme.colors.primary};
3500
- `,Ar=s.div`
3500
+ `,Dr=s.div`
3501
3501
  display: flex;
3502
3502
  flex-direction: row;
3503
3503
  align-items: center;
@@ -3515,7 +3515,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3515
3515
  align-self: center;
3516
3516
  margin-right: ${t.Space.sp2};
3517
3517
  color: ${e=>e.theme.colors.hero};
3518
- `,kt=s(t.SmallRegular)`
3518
+ `,Tt=s(t.SmallRegular)`
3519
3519
  color: ${e=>e.theme.colors.hero};
3520
3520
  `,X0=s.div`
3521
3521
  display: flex;
@@ -3587,10 +3587,10 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3587
3587
  justify-content: center;
3588
3588
  align-items: flex-start;
3589
3589
  animation: ${s2} 0.4s;
3590
- `,Or=s(t.StandardRegularSp)`
3590
+ `,Ar=s(t.StandardRegularSp)`
3591
3591
  color: ${t.Colors.neutralGrey2Light};
3592
3592
  word-break: break-word;
3593
- `,Nr=s.div`
3593
+ `,Or=s.div`
3594
3594
  max-width: ${e=>ea.contentMaxWidth.valuePx(e.windowSize)};
3595
3595
  margin: ${t.Space.sp0} 12px;
3596
3596
  `,i2=s.div`
@@ -3605,7 +3605,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3605
3605
  &:hover {
3606
3606
  color: ${t.Colors.primaryDark};
3607
3607
  }
3608
- `,xo=t.appLocale.getLocalizedStrings().cockpit.onboarding;function Mr(e){const n=t.useWindowSizeContext(),{customMessageText:r,onRemoveSnackbar:i,customerCreationType:a={stage:"none",type:"create"}}=e;u.useEffect(()=>{setTimeout(i,5e3)});const d=a2(a);return o.jsxRuntimeExports.jsxs(r2,{windowSize:n,children:[r?o.jsxRuntimeExports.jsx(Nr,{windowSize:n,children:o.jsxRuntimeExports.jsx(Or,{children:r})}):o.jsxRuntimeExports.jsx(Nr,{windowSize:n,children:o.jsxRuntimeExports.jsx(Or,{children:d})}),o.jsxRuntimeExports.jsx(i2,{onClick:i,children:o.jsxRuntimeExports.jsx(t.SvgClose,{})})]})}const a2=e=>{switch(e?.stage){case"both":return xo.bothCreated;case"customer":return e?.type==="create"?xo.customerCreated:xo.customerUpdated;case"group":return xo.groupCreated;case"company_details":return xo.companyDetailsUpdated;default:return""}},ct=t.appLocale.getLocalizedStrings().cockpit.onboarding.header,Ot=[{key:"companyName",value:ct.name,sortOrder:"ascending",width:new t.ResponsiveSized(344,344),isThreadAllowed:!0},{key:"groupCreated",value:ct.groupCreation,sortOrder:"ascending",width:new t.ResponsiveSized(288,288),isThreadAllowed:!0},{key:"customerCreated",value:ct.customerCreation,sortOrder:"ascending",width:new t.ResponsiveSized(288,288),isThreadAllowed:!0},{key:"bankAccountLinked",value:ct.setupPayment,sortOrder:"ascending",width:new t.ResponsiveSized(288,288),isThreadAllowed:!0},{key:"qboLinked",value:ct.connectToQBO,sortOrder:"ascending",width:new t.ResponsiveSized(288,288),isThreadAllowed:!0},{key:"identityVerified",value:ct.verifyIdentity,sortOrder:"ascending",width:new t.ResponsiveSized(288,288),isThreadAllowed:!0},{key:"businessVerified",value:ct.verifyBusiness,sortOrder:"ascending",width:new t.ResponsiveSized(288,288),isThreadAllowed:!0},{key:"enroller",value:ct.enroller,sortOrder:"ascending",width:new t.ResponsiveSized(220,220),isThreadAllowed:!0},{key:"invite",value:ct.invite,sortOrder:"ascending",width:new t.ResponsiveSized(180,180),isThreadAllowed:!0}];Ot.map(e=>e.key);function l2({companyNameSticky:e,sortConfig:n,onColumnSortConfigChanged:r}){const i=t.useWindowSizeContext(),[a,d]=u.useState(o.cloneDeep(Ot));u.useEffect(()=>{const c=[...a];for(const p of c)p.key===n.sortKey?p.sortOrder=n.sortOrder:p.sortOrder="ascending";d(c)},[n.sortKey,n.sortOrder]);const l=(c,p)=>{let m=p;n.sortKey===c&&(m=p==="ascending"?"descending":"ascending"),r(c,m)};return o.jsxRuntimeExports.jsx(p2,{height:Nt,children:a.map(c=>o.jsxRuntimeExports.jsxs(u2,{companyNameSticky:e&&c.key==="companyName",sortDataValue:n.sortKey,actualDataValue:c.key,wrapperWidth:c.width,windowSize:i,children:[o.jsxRuntimeExports.jsxs(h2,{onClick:()=>l(ee.toOnboardingSortKeyType(c.key),c.sortOrder),children:[o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:c.value}),o.jsxRuntimeExports.jsx(d2,{sortDataValue:n.sortKey,headerdata:c,children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:12,height:12})})]}),o.jsxRuntimeExports.jsx(x2,{isVisible:n.sortKey===c.key,children:o.jsxRuntimeExports.jsx(m2,{onClick:()=>l("latestCreated","descending")})})]},c.key))})}const c2=u.memo(l2),d2=s.div`
3608
+ `,xo=t.appLocale.getLocalizedStrings().cockpit.onboarding;function Nr(e){const n=t.useWindowSizeContext(),{customMessageText:r,onRemoveSnackbar:i,customerCreationType:a={stage:"none",type:"create"}}=e;u.useEffect(()=>{setTimeout(i,5e3)});const d=a2(a);return o.jsxRuntimeExports.jsxs(r2,{windowSize:n,children:[r?o.jsxRuntimeExports.jsx(Or,{windowSize:n,children:o.jsxRuntimeExports.jsx(Ar,{children:r})}):o.jsxRuntimeExports.jsx(Or,{windowSize:n,children:o.jsxRuntimeExports.jsx(Ar,{children:d})}),o.jsxRuntimeExports.jsx(i2,{onClick:i,children:o.jsxRuntimeExports.jsx(t.SvgClose,{})})]})}const a2=e=>{switch(e?.stage){case"both":return xo.bothCreated;case"customer":return e?.type==="create"?xo.customerCreated:xo.customerUpdated;case"group":return xo.groupCreated;case"company_details":return xo.companyDetailsUpdated;default:return""}},ct=t.appLocale.getLocalizedStrings().cockpit.onboarding.header,Ot=[{key:"companyName",value:ct.name,sortOrder:"ascending",width:new t.ResponsiveSized(344,344),isThreadAllowed:!0},{key:"groupCreated",value:ct.groupCreation,sortOrder:"ascending",width:new t.ResponsiveSized(288,288),isThreadAllowed:!0},{key:"customerCreated",value:ct.customerCreation,sortOrder:"ascending",width:new t.ResponsiveSized(288,288),isThreadAllowed:!0},{key:"bankAccountLinked",value:ct.setupPayment,sortOrder:"ascending",width:new t.ResponsiveSized(288,288),isThreadAllowed:!0},{key:"qboLinked",value:ct.connectToQBO,sortOrder:"ascending",width:new t.ResponsiveSized(288,288),isThreadAllowed:!0},{key:"identityVerified",value:ct.verifyIdentity,sortOrder:"ascending",width:new t.ResponsiveSized(288,288),isThreadAllowed:!0},{key:"businessVerified",value:ct.verifyBusiness,sortOrder:"ascending",width:new t.ResponsiveSized(288,288),isThreadAllowed:!0},{key:"enroller",value:ct.enroller,sortOrder:"ascending",width:new t.ResponsiveSized(220,220),isThreadAllowed:!0},{key:"invite",value:ct.invite,sortOrder:"ascending",width:new t.ResponsiveSized(180,180),isThreadAllowed:!0}];Ot.map(e=>e.key);function l2({companyNameSticky:e,sortConfig:n,onColumnSortConfigChanged:r}){const i=t.useWindowSizeContext(),[a,d]=u.useState(o.cloneDeep(Ot));u.useEffect(()=>{const c=[...a];for(const p of c)p.key===n.sortKey?p.sortOrder=n.sortOrder:p.sortOrder="ascending";d(c)},[n.sortKey,n.sortOrder]);const l=(c,p)=>{let m=p;n.sortKey===c&&(m=p==="ascending"?"descending":"ascending"),r(c,m)};return o.jsxRuntimeExports.jsx(p2,{height:Nt,children:a.map(c=>o.jsxRuntimeExports.jsxs(u2,{companyNameSticky:e&&c.key==="companyName",sortDataValue:n.sortKey,actualDataValue:c.key,wrapperWidth:c.width,windowSize:i,children:[o.jsxRuntimeExports.jsxs(h2,{onClick:()=>l(J.toOnboardingSortKeyType(c.key),c.sortOrder),children:[o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:c.value}),o.jsxRuntimeExports.jsx(d2,{sortDataValue:n.sortKey,headerdata:c,children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:12,height:12})})]}),o.jsxRuntimeExports.jsx(x2,{isVisible:n.sortKey===c.key,children:o.jsxRuntimeExports.jsx(m2,{onClick:()=>l("latestCreated","descending")})})]},c.key))})}const c2=u.memo(l2),d2=s.div`
3609
3609
  display: flex;
3610
3610
  align-items: center;
3611
3611
  transform: ${e=>e.sortDataValue===e.headerdata.key&&e.headerdata.sortOrder==="descending"?"rotate(180deg)":"rotate(0deg)"};
@@ -3652,7 +3652,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3652
3652
  &:hover {
3653
3653
  color: ${e=>e.theme.colors.primary};
3654
3654
  }
3655
- `;function Ro({complete:e,notInitiated:n,isDisabled:r=!1,pendingReview:i=!1,pendingVerification:a=!1,onClick:d}){return e===!0?o.jsxRuntimeExports.jsx(g2,{clickable:d!=null,onClick:d,children:o.jsxRuntimeExports.jsx(t.SmallRegular,{children:t.appLocale.getLocalizedStrings().common.completeText})}):a===!0?o.jsxRuntimeExports.jsx(y2,{clickable:d!=null,onClick:d,children:o.jsxRuntimeExports.jsx(t.SmallRegular,{children:t.appLocale.getLocalizedStrings().common.pendingVerificationText})}):i===!0?o.jsxRuntimeExports.jsx(S2,{clickable:d!=null,onClick:d,children:o.jsxRuntimeExports.jsx(t.SmallRegular,{children:t.appLocale.getLocalizedStrings().common.pendingReviewText})}):n===!0?o.jsxRuntimeExports.jsx(zr,{clickable:d!=null,isDisabled:r===!0,onClick:d,children:o.jsxRuntimeExports.jsx(t.SmallRegular,{children:t.appLocale.getLocalizedStrings().common.notInitiatedText})}):o.jsxRuntimeExports.jsx(zr,{clickable:d!=null,isDisabled:r===!0,onClick:d,children:o.jsxRuntimeExports.jsx(t.SmallRegular,{children:t.appLocale.getLocalizedStrings().common.incompleteText})})}const g2=s.div`
3655
+ `;function Ro({complete:e,notInitiated:n,isDisabled:r=!1,pendingReview:i=!1,pendingVerification:a=!1,onClick:d}){return e===!0?o.jsxRuntimeExports.jsx(g2,{clickable:d!=null,onClick:d,children:o.jsxRuntimeExports.jsx(t.SmallRegular,{children:t.appLocale.getLocalizedStrings().common.completeText})}):a===!0?o.jsxRuntimeExports.jsx(y2,{clickable:d!=null,onClick:d,children:o.jsxRuntimeExports.jsx(t.SmallRegular,{children:t.appLocale.getLocalizedStrings().common.pendingVerificationText})}):i===!0?o.jsxRuntimeExports.jsx(S2,{clickable:d!=null,onClick:d,children:o.jsxRuntimeExports.jsx(t.SmallRegular,{children:t.appLocale.getLocalizedStrings().common.pendingReviewText})}):n===!0?o.jsxRuntimeExports.jsx(Mr,{clickable:d!=null,isDisabled:r===!0,onClick:d,children:o.jsxRuntimeExports.jsx(t.SmallRegular,{children:t.appLocale.getLocalizedStrings().common.notInitiatedText})}):o.jsxRuntimeExports.jsx(Mr,{clickable:d!=null,isDisabled:r===!0,onClick:d,children:o.jsxRuntimeExports.jsx(t.SmallRegular,{children:t.appLocale.getLocalizedStrings().common.incompleteText})})}const g2=s.div`
3656
3656
  color: ${e=>e.theme.colors.success};
3657
3657
  border: 1px solid ${e=>e.theme.colors.success};
3658
3658
  padding: ${t.Space.sp0} 6px;
@@ -3679,7 +3679,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3679
3679
  width: fit-content;
3680
3680
  display: flex;
3681
3681
  align-items: center;
3682
- `,zr=s.div`
3682
+ `,Mr=s.div`
3683
3683
  color: ${e=>e.isDisabled===!0?e.theme.colors.grey3:e.theme.colors.grey1};
3684
3684
  border: 1px solid
3685
3685
  ${e=>e.isDisabled===!0?e.theme.colors.grey3:e.theme.colors.grey2};
@@ -3689,7 +3689,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3689
3689
  width: fit-content;
3690
3690
  display: flex;
3691
3691
  align-items: center;
3692
- `,f2=({headerItemData:e,onboardingInfo:n,allUsers:r,isDisabled:i=!1,onOnboardingStepClicked:a})=>{const d=e.key;if(n!=null&&(d==="businessVerified"||d==="identityVerified")){const l=n[d],c=l.userIds!=null?r.find(m=>m.userId===l.userIds[0]):null,p=l.status==="Error"?t.appLocale.getLocalizedStrings().cockpit.review.errors.unitVerificationFailed:null;return l.status==="Error"?o.jsxRuntimeExports.jsxs(Fr,{children:[o.jsxRuntimeExports.jsxs(C2,{children:[o.jsxRuntimeExports.jsx(t.SvgHighImportance,{width:t.sp[3],height:t.sp[3]}),o.jsxRuntimeExports.jsx(b2,{children:o.jsxRuntimeExports.jsx(R2,{children:o.jsxRuntimeExports.jsx(t.Tooltip,{display:"flex",placement:"bottom",title:o.jsxRuntimeExports.jsx($2,{children:p}),children:o.jsxRuntimeExports.jsx(j2,{children:p})})})})]}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:c!=null,children:o.jsxRuntimeExports.jsx(Wr,{setMargin:!0,children:`${t.appLocale.getLocalizedStrings().common.by} ${c?.firstName} ${c?.lastName}`})})]}):o.jsxRuntimeExports.jsxs(Fr,{children:[o.jsxRuntimeExports.jsx(Ro,{isDisabled:i,complete:l.status==="Complete",onClick:a!=null?()=>{a(e.key)}:void 0,pendingReview:l.status==="Pending Review",notInitiated:l.status==="Not Initiated"}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:c!=null,children:o.jsxRuntimeExports.jsx(Wr,{setMargin:!1,children:`${t.appLocale.getLocalizedStrings().common.by} ${c?.firstName} ${c?.lastName}`})}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:c==null,children:o.jsxRuntimeExports.jsx(E2,{})})]})}return null},Fr=s.div``,C2=s.div`
3692
+ `,f2=({headerItemData:e,onboardingInfo:n,allUsers:r,isDisabled:i=!1,onOnboardingStepClicked:a})=>{const d=e.key;if(n!=null&&(d==="businessVerified"||d==="identityVerified")){const l=n[d],c=l.userIds!=null?r.find(m=>m.userId===l.userIds[0]):null,p=l.status==="Error"?t.appLocale.getLocalizedStrings().cockpit.review.errors.unitVerificationFailed:null;return l.status==="Error"?o.jsxRuntimeExports.jsxs(zr,{children:[o.jsxRuntimeExports.jsxs(C2,{children:[o.jsxRuntimeExports.jsx(t.SvgHighImportance,{width:t.sp[3],height:t.sp[3]}),o.jsxRuntimeExports.jsx(b2,{children:o.jsxRuntimeExports.jsx(R2,{children:o.jsxRuntimeExports.jsx(t.Tooltip,{display:"flex",placement:"bottom",title:o.jsxRuntimeExports.jsx($2,{children:p}),children:o.jsxRuntimeExports.jsx(j2,{children:p})})})})]}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:c!=null,children:o.jsxRuntimeExports.jsx(Fr,{setMargin:!0,children:`${t.appLocale.getLocalizedStrings().common.by} ${c?.firstName} ${c?.lastName}`})})]}):o.jsxRuntimeExports.jsxs(zr,{children:[o.jsxRuntimeExports.jsx(Ro,{isDisabled:i,complete:l.status==="Complete",onClick:a!=null?()=>{a(e.key)}:void 0,pendingReview:l.status==="Pending Review",notInitiated:l.status==="Not Initiated"}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:c!=null,children:o.jsxRuntimeExports.jsx(Fr,{setMargin:!1,children:`${t.appLocale.getLocalizedStrings().common.by} ${c?.firstName} ${c?.lastName}`})}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:c==null,children:o.jsxRuntimeExports.jsx(E2,{})})]})}return null},zr=s.div``,C2=s.div`
3693
3693
  display: flex;
3694
3694
  align-items: center;
3695
3695
  column-gap: ${t.Space.sp1};
@@ -3720,12 +3720,12 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3720
3720
  color: ${e=>e.theme.colors.grey1};
3721
3721
  background: ${e=>e.theme.colors.overlayColor};
3722
3722
  border-radius: ${t.Space.sp1};
3723
- `,Wr=s(t.SmallRegular)`
3723
+ `,Fr=s(t.SmallRegular)`
3724
3724
  color: ${e=>e.theme.colors.grey1};
3725
3725
  margin-left: ${e=>e.setMargin===!0?"20px":t.Space.sp0};
3726
3726
  `,E2=s.div`
3727
3727
  height: 18px;
3728
- `,{common:Te,cockpit:Br}=t.appLocale.getLocalizedStrings(),Bn=({headerItemData:e,onboardingInfo:n,allUsers:r,retryButtonLoading:i,viaCockpit:a=!1,isDisabled:d=!1,headerKey:l,onOnboardingStepClicked:c,onRetry:p})=>{if(n!=null&&Sl(e.key,n)===!0){const m=e.key,h=n[m],S=h.userIds!=null?r.find(b=>b.userId===h.userIds[0]):null,x=h.errorDetails!=null?h.errorDetails.summary:m==="qboLinked"?Br.review.errors.qboLinked:Br.review.errors.bankAccountLinked,C=`${Te.via} ${Te.cockpit}`;return h.error===!0&&(m==="qboLinked"||m==="bankAccountLinked")?o.jsxRuntimeExports.jsxs(Zo,{children:[o.jsxRuntimeExports.jsxs(w2,{children:[o.jsxRuntimeExports.jsx(t.SvgHighImportance,{width:t.sp[3],height:t.sp[3]}),o.jsxRuntimeExports.jsxs(T2,{children:[o.jsxRuntimeExports.jsx(L2,{children:o.jsxRuntimeExports.jsx(t.Tooltip,{display:"flex",placement:"bottom",title:o.jsxRuntimeExports.jsx(P2,{children:x}),children:o.jsxRuntimeExports.jsx(v2,{children:x})})}),o.jsxRuntimeExports.jsx(k2,{}),o.jsxRuntimeExports.jsx(t.Button,{variant:"ghost",size:"small",label:Te.retry,loading:i===!0,onClick:p})]})]}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:S!=null,children:o.jsxRuntimeExports.jsx(Xo,{setMargin:!0,children:`${a===!0?C:Te.strings.empty}${m==="bankAccountLinked"&&t.isZeniAIUser(r,S?.userId)===!0?`${Te.via} ${Te.texts.chargebee}`:`${Te.by} ${S?.firstName??Te.strings.empty} ${S?.lastName??Te.strings.empty}`}`})})]}):h.completed===!0?o.jsxRuntimeExports.jsxs(Zo,{children:[o.jsxRuntimeExports.jsx(Ro,{complete:!0,onClick:c!=null?()=>{c(e.key)}:void 0}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:S!=null,children:o.jsxRuntimeExports.jsx(Xo,{setMargin:!1,children:`${a===!0?C:Te.strings.empty}${m==="bankAccountLinked"&&t.isZeniAIUser(r,S?.userId)===!0?`${Te.via} ${Te.texts.chargebee}`:`${Te.by} ${S?.firstName??Te.strings.empty} ${S?.lastName??Te.strings.empty}`}`})}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:S==null,children:o.jsxRuntimeExports.jsx(_n,{})})]}):h.pendingVerification===!0&&l==="bankAccountLinked"?o.jsxRuntimeExports.jsxs(Zo,{children:[o.jsxRuntimeExports.jsx(Ro,{complete:!1,pendingVerification:!0,onClick:c!=null?()=>{c(e.key)}:void 0}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:S!=null,children:o.jsxRuntimeExports.jsx(Xo,{setMargin:!1,children:`${a===!0?C:Te.strings.empty}${m==="bankAccountLinked"&&t.isZeniAIUser(r,S?.userId)===!0?`${Te.via} ${Te.texts.chargebee}`:`${Te.by} ${S?.firstName??Te.strings.empty} ${S?.lastName??Te.strings.empty}`}`})}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:S==null,children:o.jsxRuntimeExports.jsx(_n,{})})]}):o.jsxRuntimeExports.jsxs(Zo,{children:[o.jsxRuntimeExports.jsx(Ro,{isDisabled:d,complete:!1,onClick:c!=null?()=>{c(e.key)}:void 0}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:S!=null,children:o.jsxRuntimeExports.jsx(Xo,{setMargin:!1,children:`${a===!0?C:Te.strings.empty}${m==="bankAccountLinked"&&t.isZeniAIUser(r,S?.userId)===!0?`${Te.via} ${Te.texts.chargebee}`:`${Te.by} ${S?.firstName??Te.strings.empty} ${S?.lastName??Te.strings.empty}`}`})}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:S==null,children:o.jsxRuntimeExports.jsx(_n,{})})]})}return null},Zo=s.div``,w2=s.div`
3728
+ `,{common:Te,cockpit:Wr}=t.appLocale.getLocalizedStrings(),Wn=({headerItemData:e,onboardingInfo:n,allUsers:r,retryButtonLoading:i,viaCockpit:a=!1,isDisabled:d=!1,headerKey:l,onOnboardingStepClicked:c,onRetry:p})=>{if(n!=null&&Sl(e.key,n)===!0){const m=e.key,h=n[m],S=h.userIds!=null?r.find(b=>b.userId===h.userIds[0]):null,x=h.errorDetails!=null?h.errorDetails.summary:m==="qboLinked"?Wr.review.errors.qboLinked:Wr.review.errors.bankAccountLinked,C=`${Te.via} ${Te.cockpit}`;return h.error===!0&&(m==="qboLinked"||m==="bankAccountLinked")?o.jsxRuntimeExports.jsxs(Zo,{children:[o.jsxRuntimeExports.jsxs(w2,{children:[o.jsxRuntimeExports.jsx(t.SvgHighImportance,{width:t.sp[3],height:t.sp[3]}),o.jsxRuntimeExports.jsxs(T2,{children:[o.jsxRuntimeExports.jsx(L2,{children:o.jsxRuntimeExports.jsx(t.Tooltip,{display:"flex",placement:"bottom",title:o.jsxRuntimeExports.jsx(P2,{children:x}),children:o.jsxRuntimeExports.jsx(v2,{children:x})})}),o.jsxRuntimeExports.jsx(k2,{}),o.jsxRuntimeExports.jsx(t.Button,{variant:"ghost",size:"small",label:Te.retry,loading:i===!0,onClick:p})]})]}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:S!=null,children:o.jsxRuntimeExports.jsx(Xo,{setMargin:!0,children:`${a===!0?C:Te.strings.empty}${m==="bankAccountLinked"&&t.isZeniAIUser(r,S?.userId)===!0?`${Te.via} ${Te.texts.chargebee}`:`${Te.by} ${S?.firstName??Te.strings.empty} ${S?.lastName??Te.strings.empty}`}`})})]}):h.completed===!0?o.jsxRuntimeExports.jsxs(Zo,{children:[o.jsxRuntimeExports.jsx(Ro,{complete:!0,onClick:c!=null?()=>{c(e.key)}:void 0}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:S!=null,children:o.jsxRuntimeExports.jsx(Xo,{setMargin:!1,children:`${a===!0?C:Te.strings.empty}${m==="bankAccountLinked"&&t.isZeniAIUser(r,S?.userId)===!0?`${Te.via} ${Te.texts.chargebee}`:`${Te.by} ${S?.firstName??Te.strings.empty} ${S?.lastName??Te.strings.empty}`}`})}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:S==null,children:o.jsxRuntimeExports.jsx(Bn,{})})]}):h.pendingVerification===!0&&l==="bankAccountLinked"?o.jsxRuntimeExports.jsxs(Zo,{children:[o.jsxRuntimeExports.jsx(Ro,{complete:!1,pendingVerification:!0,onClick:c!=null?()=>{c(e.key)}:void 0}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:S!=null,children:o.jsxRuntimeExports.jsx(Xo,{setMargin:!1,children:`${a===!0?C:Te.strings.empty}${m==="bankAccountLinked"&&t.isZeniAIUser(r,S?.userId)===!0?`${Te.via} ${Te.texts.chargebee}`:`${Te.by} ${S?.firstName??Te.strings.empty} ${S?.lastName??Te.strings.empty}`}`})}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:S==null,children:o.jsxRuntimeExports.jsx(Bn,{})})]}):o.jsxRuntimeExports.jsxs(Zo,{children:[o.jsxRuntimeExports.jsx(Ro,{isDisabled:d,complete:!1,onClick:c!=null?()=>{c(e.key)}:void 0}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:S!=null,children:o.jsxRuntimeExports.jsx(Xo,{setMargin:!1,children:`${a===!0?C:Te.strings.empty}${m==="bankAccountLinked"&&t.isZeniAIUser(r,S?.userId)===!0?`${Te.via} ${Te.texts.chargebee}`:`${Te.by} ${S?.firstName??Te.strings.empty} ${S?.lastName??Te.strings.empty}`}`})}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:S==null,children:o.jsxRuntimeExports.jsx(Bn,{})})]})}return null},Zo=s.div``,w2=s.div`
3729
3729
  display: flex;
3730
3730
  align-items: center;
3731
3731
  column-gap: ${t.Space.sp1};
@@ -3762,9 +3762,9 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3762
3762
  `,Xo=s(t.SmallRegular)`
3763
3763
  color: ${e=>e.theme.colors.grey1};
3764
3764
  margin-left: ${e=>e.setMargin===!0?"20px":t.Space.sp0};
3765
- `,_n=s.div`
3765
+ `,Bn=s.div`
3766
3766
  height: 18px;
3767
- `,{common:{strings:I2},cockpit:{onboarding:Vn}}=t.appLocale.getLocalizedStrings(),D2=["bankAccountLinked","qboLinked","identityVerified","businessVerified"],A2=({companyView:e,companyNameSticky:n,allUsers:r,sendInviteFetchState:i,retryBankAccountConnectionFetchState:a,totalHeight:d,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:p,setNoteData:m,setElementRef:h,setAddThreadRequestThreadId:S,onOnboardingStepClicked:x,onSendInviteClick:C,redirectToDashboardOnboarding:b,onRetryBankAccountConnection:f})=>{const[g,j]=u.useState(null),y=t.useWindowSizeContext(),$=o.useForm({mode:"all"}),{company:{company:{companyInfo:{companyId:w,name:O,primaryEmailDomain:A},companyOnboardingInfo:{onboardingInfo:v}}},tenant:T}=e,F=O2(e,r),I=`cockpit_${w}`,K="onboarding.notes",{threads:M,isLoading:Y}=t.useFilteredThreads({entityType:K,companyId:w},!1),{openThread:G,threads:E,addThread:P,removeThread:W,setOpenThread:k}=u.useContext(t.ThreadsContext),D=G!==null?E.get(G):null,z=G?.includes(w)===!0,Z=G!=null&&E.get(G)==null&&z,ie=l!=null&&E.get(l)?.metadata.companyId===w,N=u.useCallback(()=>{G?.includes(t.NEW_THREAD_SUFFIX)===!0&&W(G),l!=null&&S(void 0)},[l,G,W,S]),H=R=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:R.isElementThreadOpen??!1,isElementThreadPresent:R.isElementThreadPresent??!1,itemKey:R.itemKey,elementThreadId:R.elementThreadId??I2.empty,roomId:I,addThreadRequestThreadId:l,openThreadId:G,threadStyle:R.threadStyle,openThreadMetadata:D?.metadata??null,onElementClick:Q,onAddThreadClick:se,targetElement:c??g}),L=u.useCallback(R=>{if(R===G)k(null);else if(E.has(R))k(R);else if(R.includes(t.NEW_THREAD_SUFFIX)){const[Ce,ae]=R.replace(t.NEW_THREAD_SUFFIX,"").split("."),ce=Ft(Ct(Ce),ee.toOnboardingSortKeyType(ae),w,O);P(R,{type:"thread",id:R,roomId:I,createdAt:new Date,updatedAt:new Date,comments:[],metadata:ce,resolved:!1}),k(R)}},[w,O,G,E,P,k,I]),Q=u.useCallback((R,Ce,ae=!1)=>{const ce=Ot.find($e=>$e.key===Ce);if(p(),ce!=null&&(R.type==="contextmenu"||ae===!0)){if(ce.isThreadAllowed===!1)return;N(),R.preventDefault(),R.stopPropagation();const $e=t.toCollaborationEntityType({tab:"onboarding",key:ce.key});if(R.target instanceof HTMLElement||R.target instanceof SVGElement)if(ae===!0&&R.target instanceof HTMLElement)j(R.target.parentElement);else if(R.target instanceof HTMLElement){const pe=ms(R.target,oe);j(pe||R.target)}else{const pe=R.target.closest(`.${oe}`);pe instanceof HTMLElement&&j(pe)}const V=[...t.getFilteredThreads(E,{entityType:$e,companyId:w},"both")],B=V.length>0&&V[0].length>0?V[0][0]:Le("onboarding",ce.key,w);E.has(B)?L(B):l===B?S(void 0):(S(B),k(null))}},[E,w,l,L,S,k,p,N]),se=u.useCallback((R,Ce)=>{R.stopPropagation();const ae=Le("onboarding",Ce,w);S(void 0),L(ae)},[w,S,L]),X=(R,Ce)=>{},re=u.useCallback(()=>{f(w)},[f,w]);u.useEffect(()=>{const R=$.watch((Ce,{name:ae})=>{ae!=null&&Ce.companyData!=null&&o.defer(()=>X())});return()=>{R.unsubscribe()}});const te=v?.inviteSent,he=v?.accountingConnectionCreationMode,fe=u.useCallback(R=>{if(v==null)return!1;switch(R){case"bankAccountLinked":case"qboLinked":case"identityVerified":case"businessVerified":return!0;default:return!1}},[v]),be=u.useCallback(R=>{if(D2.includes(R)&&fe(R)){b(A);return}x(w,R)},[b,A,w,x,fe]),{useFeatureGate:_}=t.useZeniFeatureContext(),{isFeatureEnabled:J}=_(t.FeatureGatesNames.isDebitCardFeatureEnabled),ge=ee.isTenantBankingOnly(J,T),ve=u.useMemo(()=>{const R=v?.inviteAccepted===!0,Ce=v?.groupCreated.completed===!0,ae=v?.customerCreated.completed===!0,ce=v?.accountingConnectionCreationMode==null,$e=v?.accountingConnectionCreationMode==="zeni_user"&&v?.qboLinked.completed!==!0,V=!ge;return R||!Ce||!ae||ce&&V||$e&&V},[v?.accountingConnectionCreationMode,v?.customerCreated.completed,v?.groupCreated.completed,v?.inviteAccepted,v?.qboLinked.completed,ge]),Re=u.useMemo(()=>v?.inviteSent===!0?Vn.resendInvite:Vn.sendInvite,[v?.inviteSent]);return o.jsxRuntimeExports.jsx(o.FormProvider,{...$,children:o.jsxRuntimeExports.jsx("form",{style:{height:"100%"},children:o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{p(),l!=null&&(S(void 0),l.includes(t.NEW_THREAD_SUFFIX)&&W(l))},children:o.jsxRuntimeExports.jsx(M2,{windowSize:y,isThreadOpen:z||ie,totalHeight:d,isCreationInProgress:Z,children:Ot.map((R,Ce)=>{const ae=t.toCollaborationEntityType({tab:"onboarding",key:R.key}),ce=Ot.length-2<=Ce,$e=[...t.getFilteredThreads(E,{entityType:ae,companyId:w},"both")],V=$e.length>0&&$e[0].length>0?$e[0][0]:Le("onboarding",R.key,w),B=E.get(V),pe=B!=null&&B.resolved===!1,ye=V===G,ke=l===V;switch(R.key){case"companyName":return o.jsxRuntimeExports.jsxs(z2,{companyNameSticky:n,columnWidth:R.width,windowSize:y,isThreadOpen:ye||ke,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,R.key),ref:ue=>{h(w,R.key,ue)},children:[o.jsxRuntimeExports.jsxs(N2,{children:[o.jsxRuntimeExports.jsx(F2,{onClick:ue=>{ue.preventDefault()},children:O||A}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:ye,targetElement:c??g,roomId:I,openThreadId:G,openThreadMetadata:D?.metadata??null})]}),o.jsxRuntimeExports.jsxs(W2,{className:"notesIcon",onClick:ue=>{ue.preventDefault(),m({roomId:I,companyId:w,companyName:O,entityType:K})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:M.length,isLoading:Y}),o.jsxRuntimeExports.jsx(B2,{})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:pe,itemKey:R.key,style:{left:t.Space.sp4},onElementClick:Q}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("onboarding",R.key,w),addThreadRequestThreadId:l,itemKey:R.key,onAddThreadClick:se})]},V);case"groupCreated":case"customerCreated":return o.jsxRuntimeExports.jsxs(Gt,{ref:ue=>{h(w,R.key,ue)},columnWidth:R.width,windowSize:y,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,R.key),children:[o.jsxRuntimeExports.jsx(Bn,{headerItemData:R,onOnboardingStepClicked:be,onboardingInfo:v,allUsers:r}),H({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"bankAccountLinked":return o.jsxRuntimeExports.jsxs(Gt,{ref:ue=>{h(w,R.key,ue)},columnWidth:R.width,windowSize:y,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,R.key),children:[o.jsxRuntimeExports.jsx(Bn,{headerItemData:R,onOnboardingStepClicked:be,onboardingInfo:v,allUsers:r,isDisabled:te!==!0,onRetry:re,retryButtonLoading:a==="In-Progress",headerKey:R.key}),H({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"qboLinked":return o.jsxRuntimeExports.jsxs(Gt,{ref:ue=>{h(w,R.key,ue)},columnWidth:R.width,windowSize:y,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,R.key),children:[o.jsxRuntimeExports.jsx(Bn,{headerItemData:R,onOnboardingStepClicked:be,onboardingInfo:v,allUsers:r,isDisabled:he==="customer"&&te!==!0||ge}),H({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"identityVerified":case"businessVerified":return o.jsxRuntimeExports.jsxs(Gt,{ref:ue=>{h(w,R.key,ue)},columnWidth:R.width,windowSize:y,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,R.key),children:[o.jsxRuntimeExports.jsx(f2,{headerItemData:R,onOnboardingStepClicked:be,onboardingInfo:v,allUsers:r,isDisabled:te!==!0}),H({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"enroller":return o.jsxRuntimeExports.jsxs(Gt,{ref:ue=>{h(w,R.key,ue)},columnWidth:R.width,windowSize:y,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,R.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:"companyData.controller",value:F.controller,placeholderLabel:Vn.onboardingUsersPlaceholder,isReadOnly:!0,pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),H({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"invite":return o.jsxRuntimeExports.jsxs(Gt,{ref:ue=>{h(w,R.key,ue)},columnWidth:R.width,windowSize:y,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,R.key),children:[o.jsxRuntimeExports.jsx(t.Button,{disabled:ve,variant:"primary",label:Re,onClick:()=>C(w,v?.inviteSent??!1),size:"small",loading:i==="In-Progress"}),H({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);default:return null}})})})})})};function O2(e,n){const r=e.company.company.companyOnboardingInfo.onboardingUserIds,i=n.filter(d=>r.findIndex(l=>l===d.userId)>-1),a=[];return r.forEach(d=>{const l=i.filter(c=>c.userId===d)[0];l!=null&&a.push(l)}),{controller:{allUsers:n,selectedUsers:a}}}const N2=s.div``,M2=s.div`
3767
+ `,{common:{strings:I2},cockpit:{onboarding:_n}}=t.appLocale.getLocalizedStrings(),D2=["bankAccountLinked","qboLinked","identityVerified","businessVerified"],A2=({companyView:e,companyNameSticky:n,allUsers:r,sendInviteFetchState:i,retryBankAccountConnectionFetchState:a,totalHeight:d,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:p,setNoteData:m,setElementRef:h,setAddThreadRequestThreadId:S,onOnboardingStepClicked:x,onSendInviteClick:C,redirectToDashboardOnboarding:b,onRetryBankAccountConnection:f})=>{const[g,j]=u.useState(null),y=t.useWindowSizeContext(),$=o.useForm({mode:"all"}),{company:{company:{companyInfo:{companyId:w,name:O,primaryEmailDomain:A},companyOnboardingInfo:{onboardingInfo:v}}},tenant:T}=e,F=O2(e,r),I=`cockpit_${w}`,K="onboarding.notes",{threads:M,isLoading:Y}=t.useFilteredThreads({entityType:K,companyId:w},!1),{openThread:G,threads:E,addThread:P,removeThread:W,setOpenThread:k}=u.useContext(t.ThreadsContext),D=G!==null?E.get(G):null,z=G?.includes(w)===!0,Z=G!=null&&E.get(G)==null&&z,ie=l!=null&&E.get(l)?.metadata.companyId===w,N=u.useCallback(()=>{G?.includes(t.NEW_THREAD_SUFFIX)===!0&&W(G),l!=null&&S(void 0)},[l,G,W,S]),H=R=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:R.isElementThreadOpen??!1,isElementThreadPresent:R.isElementThreadPresent??!1,itemKey:R.itemKey,elementThreadId:R.elementThreadId??I2.empty,roomId:I,addThreadRequestThreadId:l,openThreadId:G,threadStyle:R.threadStyle,openThreadMetadata:D?.metadata??null,onElementClick:Q,onAddThreadClick:se,targetElement:c??g}),L=u.useCallback(R=>{if(R===G)k(null);else if(E.has(R))k(R);else if(R.includes(t.NEW_THREAD_SUFFIX)){const[Ce,ae]=R.replace(t.NEW_THREAD_SUFFIX,"").split("."),ce=Ft(jt(Ce),J.toOnboardingSortKeyType(ae),w,O);P(R,{type:"thread",id:R,roomId:I,createdAt:new Date,updatedAt:new Date,comments:[],metadata:ce,resolved:!1}),k(R)}},[w,O,G,E,P,k,I]),Q=u.useCallback((R,Ce,ae=!1)=>{const ce=Ot.find($e=>$e.key===Ce);if(p(),ce!=null&&(R.type==="contextmenu"||ae===!0)){if(ce.isThreadAllowed===!1)return;N(),R.preventDefault(),R.stopPropagation();const $e=t.toCollaborationEntityType({tab:"onboarding",key:ce.key});if(R.target instanceof HTMLElement||R.target instanceof SVGElement)if(ae===!0&&R.target instanceof HTMLElement)j(R.target.parentElement);else if(R.target instanceof HTMLElement){const pe=us(R.target,oe);j(pe||R.target)}else{const pe=R.target.closest(`.${oe}`);pe instanceof HTMLElement&&j(pe)}const V=[...t.getFilteredThreads(E,{entityType:$e,companyId:w},"both")],B=V.length>0&&V[0].length>0?V[0][0]:Le("onboarding",ce.key,w);E.has(B)?L(B):l===B?S(void 0):(S(B),k(null))}},[E,w,l,L,S,k,p,N]),se=u.useCallback((R,Ce)=>{R.stopPropagation();const ae=Le("onboarding",Ce,w);S(void 0),L(ae)},[w,S,L]),X=(R,Ce)=>{},re=u.useCallback(()=>{f(w)},[f,w]);u.useEffect(()=>{const R=$.watch((Ce,{name:ae})=>{ae!=null&&Ce.companyData!=null&&o.defer(()=>X())});return()=>{R.unsubscribe()}});const te=v?.inviteSent,he=v?.accountingConnectionCreationMode,fe=u.useCallback(R=>{if(v==null)return!1;switch(R){case"bankAccountLinked":case"qboLinked":case"identityVerified":case"businessVerified":return!0;default:return!1}},[v]),be=u.useCallback(R=>{if(D2.includes(R)&&fe(R)){b(A);return}x(w,R)},[b,A,w,x,fe]),{useFeatureGate:_}=t.useZeniFeatureContext(),{isFeatureEnabled:ee}=_(t.FeatureGatesNames.isDebitCardFeatureEnabled),ge=J.isTenantBankingOnly(ee,T),ve=u.useMemo(()=>{const R=v?.inviteAccepted===!0,Ce=v?.groupCreated.completed===!0,ae=v?.customerCreated.completed===!0,ce=v?.accountingConnectionCreationMode==null,$e=v?.accountingConnectionCreationMode==="zeni_user"&&v?.qboLinked.completed!==!0,V=!ge;return R||!Ce||!ae||ce&&V||$e&&V},[v?.accountingConnectionCreationMode,v?.customerCreated.completed,v?.groupCreated.completed,v?.inviteAccepted,v?.qboLinked.completed,ge]),Re=u.useMemo(()=>v?.inviteSent===!0?_n.resendInvite:_n.sendInvite,[v?.inviteSent]);return o.jsxRuntimeExports.jsx(o.FormProvider,{...$,children:o.jsxRuntimeExports.jsx("form",{style:{height:"100%"},children:o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{p(),l!=null&&(S(void 0),l.includes(t.NEW_THREAD_SUFFIX)&&W(l))},children:o.jsxRuntimeExports.jsx(M2,{windowSize:y,isThreadOpen:z||ie,totalHeight:d,isCreationInProgress:Z,children:Ot.map((R,Ce)=>{const ae=t.toCollaborationEntityType({tab:"onboarding",key:R.key}),ce=Ot.length-2<=Ce,$e=[...t.getFilteredThreads(E,{entityType:ae,companyId:w},"both")],V=$e.length>0&&$e[0].length>0?$e[0][0]:Le("onboarding",R.key,w),B=E.get(V),pe=B!=null&&B.resolved===!1,ye=V===G,ke=l===V;switch(R.key){case"companyName":return o.jsxRuntimeExports.jsxs(z2,{companyNameSticky:n,columnWidth:R.width,windowSize:y,isThreadOpen:ye||ke,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,R.key),ref:ue=>{h(w,R.key,ue)},children:[o.jsxRuntimeExports.jsxs(N2,{children:[o.jsxRuntimeExports.jsx(F2,{onClick:ue=>{ue.preventDefault()},children:O||A}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:ye,targetElement:c??g,roomId:I,openThreadId:G,openThreadMetadata:D?.metadata??null})]}),o.jsxRuntimeExports.jsxs(W2,{className:"notesIcon",onClick:ue=>{ue.preventDefault(),m({roomId:I,companyId:w,companyName:O,entityType:K})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:M.length,isLoading:Y}),o.jsxRuntimeExports.jsx(B2,{})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:pe,itemKey:R.key,style:{left:t.Space.sp4},onElementClick:Q}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("onboarding",R.key,w),addThreadRequestThreadId:l,itemKey:R.key,onAddThreadClick:se})]},V);case"groupCreated":case"customerCreated":return o.jsxRuntimeExports.jsxs(Gt,{ref:ue=>{h(w,R.key,ue)},columnWidth:R.width,windowSize:y,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,R.key),children:[o.jsxRuntimeExports.jsx(Wn,{headerItemData:R,onOnboardingStepClicked:be,onboardingInfo:v,allUsers:r}),H({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"bankAccountLinked":return o.jsxRuntimeExports.jsxs(Gt,{ref:ue=>{h(w,R.key,ue)},columnWidth:R.width,windowSize:y,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,R.key),children:[o.jsxRuntimeExports.jsx(Wn,{headerItemData:R,onOnboardingStepClicked:be,onboardingInfo:v,allUsers:r,isDisabled:te!==!0,onRetry:re,retryButtonLoading:a==="In-Progress",headerKey:R.key}),H({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"qboLinked":return o.jsxRuntimeExports.jsxs(Gt,{ref:ue=>{h(w,R.key,ue)},columnWidth:R.width,windowSize:y,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,R.key),children:[o.jsxRuntimeExports.jsx(Wn,{headerItemData:R,onOnboardingStepClicked:be,onboardingInfo:v,allUsers:r,isDisabled:he==="customer"&&te!==!0||ge}),H({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"identityVerified":case"businessVerified":return o.jsxRuntimeExports.jsxs(Gt,{ref:ue=>{h(w,R.key,ue)},columnWidth:R.width,windowSize:y,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,R.key),children:[o.jsxRuntimeExports.jsx(f2,{headerItemData:R,onOnboardingStepClicked:be,onboardingInfo:v,allUsers:r,isDisabled:te!==!0}),H({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"enroller":return o.jsxRuntimeExports.jsxs(Gt,{ref:ue=>{h(w,R.key,ue)},columnWidth:R.width,windowSize:y,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,R.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:"companyData.controller",value:F.controller,placeholderLabel:_n.onboardingUsersPlaceholder,isReadOnly:!0,pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),H({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);case"invite":return o.jsxRuntimeExports.jsxs(Gt,{ref:ue=>{h(w,R.key,ue)},columnWidth:R.width,windowSize:y,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:ue=>Q(ue,R.key),children:[o.jsxRuntimeExports.jsx(t.Button,{disabled:ve,variant:"primary",label:Re,onClick:()=>C(w,v?.inviteSent??!1),size:"small",loading:i==="In-Progress"}),H({isElementThreadOpen:ye,isElementThreadPresent:pe,itemKey:R.key,elementThreadId:V,threadStyle:ce?{right:t.Space.sp0}:void 0})]},V);default:return null}})})})})})};function O2(e,n){const r=e.company.company.companyOnboardingInfo.onboardingUserIds,i=n.filter(d=>r.findIndex(l=>l===d.userId)>-1),a=[];return r.forEach(d=>{const l=i.filter(c=>c.userId===d)[0];l!=null&&a.push(l)}),{controller:{allUsers:n,selectedUsers:a}}}const N2=s.div``,M2=s.div`
3768
3768
  display: flex;
3769
3769
  flex-direction: row;
3770
3770
  align-items: center;
@@ -3863,7 +3863,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3863
3863
  z-index: auto;
3864
3864
  cursor: ${e=>e.isThreadAllowed?"pointer":"initial"};
3865
3865
  position: relative;
3866
- `,_2={onboardingRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{cockpit:{onboarding:V2},common:{headers:{comments:U2}},collaboration:{threads:{placeholder:{addANewComment:H2,replyAComment:K2},tooltip:{resolveComment:G2,unResolveComment:Y2}}}}=t.appLocale.getLocalizedStrings(),Z2=({onboardingView:e,qboConnectionPoolFlag:n,onSendInviteClick:r,onOnboardingStepClicked:i,onCancelClicked:a,onGoLiveClicked:d,onScroll:l,onUpdateCustomerCreationStatus:c,onColumnSortConfigChanged:p,redirectToDashboardOnboarding:m,onRetryBankAccountConnection:h,onQBOConnectClick:S,initialOpenThreadRequest:x})=>{const C=t.useWindowSizeContext(),b=u.useRef(null),[f,g]=u.useState(null),{setOpenThread:j,setRequestToOpenThread:y,requestToOpenThread:$,isLoading:w}=u.useContext(t.ThreadsContext);u.useEffect(()=>{x!=null&&e.fetchState==="Completed"&&w===!1&&y(x)},[x,e.fetchState,w,y]);const[O,A]=u.useState(void 0),v=u.useRef(null),T=u.useRef([]),[F,I]=u.useState(null),K=!(C==="small"||C==="medium-compact"),{uiState:M}=e,Y=V2.onboardingCompleted.replace("_company-name_",M.selectedCustomerName),[G,E]=u.useState("Not-Started"),[P,W]=u.useState("Not-Started"),{saveFetchState:k,customerCreationStatus:D}=e;u.useEffect(()=>{k.fetchState==="Completed"&&D.stage!=="none"?(W("Not-Started"),E(k.fetchState)):E("Not-Started")},[k.fetchState,D]),u.useEffect(()=>{e.updateStatus.fetchState==="Completed"?(E("Not-Started"),W(e.updateStatus.fetchState)):W("Not-Started")},[e.updateStatus.fetchState]);const z=0,Z=u.useCallback(()=>{const Q=e.onboardingCustomers.filter(se=>se.company.company.companyInfo.companyId===M.selectedCompanyId);if(Q.length>0){const{company:se,onboardingCustomerInfo:X,tenant:re}=Q[0],te={companyEmailDomain:X.companyEmailDomain,companyId:se.company.companyInfo.companyId,isOnboardingCompleted:!0,isOnboardingTenant:!0,tenantId:re.tenantId,userEmailWithPreOnboardSuccess:X.userEmailWithPreOnboardSuccess};d(te)}},[d,e.onboardingCustomers,M.selectedCompanyId]),ie=u.useCallback(Q=>e.onboardingCustomers[Q].company.company.companyInfo.name.length>zt?Ie+32:Ie,[e.onboardingCustomers]);u.useEffect(()=>{b.current&&b.current.resetAfterIndex(0)},[e]);const N=u.useMemo(()=>({makeCompanyNameSticky:K,uiState:M,onColumnSortConfigChanged:p}),[K,M,p]),H=u.useCallback((Q,se,X)=>{const re=e.onboardingCustomers.findIndex(he=>he.company.company.companyInfo.companyId===Q),te=Ot.findIndex(he=>he.key===se);re!==-1&&te!==-1&&(T.current[re]==null?T.current[re]=[X]:T.current[re][te]=X)},[e.onboardingCustomers]),L=u.useCallback(()=>{v.current=null,y(null)},[y]);return u.useEffect(()=>{if($!=null&&f!=null){const{companyId:Q,entityType:se}=$,[X,re]=se.split("."),te=e.onboardingCustomers.findIndex(_=>_.company.company.companyInfo.companyId===Q),he=Ot.findIndex(_=>_.key===re);te!==-1&&!(f.visibleStartIndex<=te&&f.visibleStopIndex>=te)&&b.current?.scrollToItem(te,"center"),setTimeout(()=>{const _=T.current[te]?.[0]?.getBoundingClientRect().bottom,J=T.current[te]?.[0]?.getBoundingClientRect().top;if(_!=null&&J!=null&&(window.innerHeight>=_&&window.innerHeight>=J||J<0)){const ge=T.current[te][he];ge!=null&&(v.current={companyId:Q,target:ge}),T.current[te][he]?.scrollIntoView({block:"center",behavior:"auto"})}},0);const be=setInterval(()=>{const _=T.current[te]?.[he]?.getBoundingClientRect().left,J=T.current[te]?.[he]?.getBoundingClientRect().right,ge=T.current[te]?.[he]?.offsetWidth;if(v.current?.companyId===Q&&_!=null&&ge!=null&&J!=null&&(_<window.innerWidth-ge||J<window.innerWidth)){clearInterval(be);const ve=$.threadId,Re=$.onThreadShownCallback;ve&&(y(null),j($.threadId),Re?.())}},500);setTimeout(()=>{clearInterval(be),y(null)},2e3)}},[$,f,j,y]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[n?o.jsxRuntimeExports.jsx(U0,{qboConnectionPool:e.qboConnectionPool,isLoading:e.qboConnectionPool.saveQBOConnectionPoolState.fetchState==="In-Progress",onQBOConnectClick:S}):null,o.jsxRuntimeExports.jsxs(q2,{children:[M.showGoLivePopUp===!0?o.jsxRuntimeExports.jsx(t2,{hasAdminRole:!0,onCancelClick:()=>{a()},onGoLiveClick:Z,showGoLivePopup:M.showGoLivePopUp,loading:e.updateStatus.fetchState==="In-Progress"}):null,G==="Completed"?o.jsxRuntimeExports.jsx(Mr,{customerCreationType:D,fetchState:G,onRemoveSnackbar:()=>{c(),E("Not-Started")}}):null,P==="Completed"?o.jsxRuntimeExports.jsx(Mr,{fetchState:P,customMessageText:Y,onRemoveSnackbar:()=>{W("Not-Started")}}):null,o.jsxRuntimeExports.jsxs(ta.Provider,{value:N,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:Q,width:se})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:Q,width:se,itemCount:e.onboardingCustomers.length,itemSize:ie,onItemsRendered:X=>g(X),overscanCount:Mt,itemData:{onboardingView:e,makeCompanyNameSticky:K,addThreadRequestThreadId:O,targetElement:v.current?.target,resetTargetElementFromNavigation:L,setElementRef:H,setAddThreadRequestThreadId:A,setNoteData:I,onOnboardingStepClicked:i,onSendInviteClick:r,redirectToDashboardOnboarding:m,onRetryBankAccountConnection:h},ref:b,innerElementType:oa,onScroll:({scrollOffset:X})=>{l(X)},initialScrollOffset:z,style:{willChange:"auto"},children:X2})}),F!=null?o.jsxRuntimeExports.jsx(Ze.RoomProvider,{id:F.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${F.companyName} ${U2}`,filter:{application:"cockpit",companyId:F.companyId,entityType:F.entityType,isGlobalComment:!1,tab:"onboarding"},isLoading:!1,threadMetadata:{companyName:F.companyName,companyId:F.companyId,entityId:F.companyId,entityType:F.entityType,isGlobalComment:!1,application:"cockpit",tab:"onboarding",url:window.location.href},textOverrides:{composerPlaceholder:H2,replyComposerPlaceholder:K2,threadResolve:G2,threadUnResolve:Y2},onThreadClick:Q=>null,onCloseAllThreadsDrawer:()=>I(null)})}):null]})]})]})},ta=u.createContext(void 0),oa=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,onColumnSortConfigChanged:c}=u.useContext(ta);return o.jsxRuntimeExports.jsxs(ef,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(c2,{companyNameSticky:d,onColumnSortConfigChanged:c,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(J2,{children:r})]})});oa.displayName="Onboarding list view inner element type";const X2=({index:e,style:n,data:r})=>{const i=t.useWindowSizeContext(),{onboardingView:a,makeCompanyNameSticky:d,addThreadRequestThreadId:l,targetElement:c,resetTargetElementFromNavigation:p,setElementRef:m,setNoteData:h,setAddThreadRequestThreadId:S,onOnboardingStepClicked:x,onSendInviteClick:C,redirectToDashboardOnboarding:b,onRetryBankAccountConnection:f}=r,g=a.onboardingCustomers[e],{companyId:j}=g.company.company.companyInfo;return o.jsxRuntimeExports.jsx(Q2,{isCollapsed:!0,style:{...n,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${_2.onboardingRightPadding.valuePx(i)} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(A2,{totalHeight:typeof n.height=="number"?n.height:Ie,companyView:a.onboardingCustomers[e],companyNameSticky:d,allUsers:a.zeniUsers.values,sendInviteFetchState:a.sendInviteFetchStateByCompanyId[a.onboardingCustomers[e].company.company.companyInfo.companyId]?.fetchState,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:p,setNoteData:h,setElementRef:m,setAddThreadRequestThreadId:S,retryBankAccountConnectionFetchState:a.retryBankAccountConnectionFetchStateByCompanyId[a.onboardingCustomers[e].company.company.companyInfo.companyId]?.fetchState,onOnboardingStepClicked:x,onSendInviteClick:C,redirectToDashboardOnboarding:b,onRetryBankAccountConnection:f})},j)},q2=s.div`
3866
+ `,_2={onboardingRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{cockpit:{onboarding:V2},common:{headers:{comments:U2}},collaboration:{threads:{placeholder:{addANewComment:H2,replyAComment:K2},tooltip:{resolveComment:G2,unResolveComment:Y2}}}}=t.appLocale.getLocalizedStrings(),Z2=({onboardingView:e,qboConnectionPoolFlag:n,onSendInviteClick:r,onOnboardingStepClicked:i,onCancelClicked:a,onGoLiveClicked:d,onScroll:l,onUpdateCustomerCreationStatus:c,onColumnSortConfigChanged:p,redirectToDashboardOnboarding:m,onRetryBankAccountConnection:h,onQBOConnectClick:S,initialOpenThreadRequest:x})=>{const C=t.useWindowSizeContext(),b=u.useRef(null),[f,g]=u.useState(null),{setOpenThread:j,setRequestToOpenThread:y,requestToOpenThread:$,isLoading:w}=u.useContext(t.ThreadsContext);u.useEffect(()=>{x!=null&&e.fetchState==="Completed"&&w===!1&&y(x)},[x,e.fetchState,w,y]);const[O,A]=u.useState(void 0),v=u.useRef(null),T=u.useRef([]),[F,I]=u.useState(null),K=!(C==="small"||C==="medium-compact"),{uiState:M}=e,Y=V2.onboardingCompleted.replace("_company-name_",M.selectedCustomerName),[G,E]=u.useState("Not-Started"),[P,W]=u.useState("Not-Started"),{saveFetchState:k,customerCreationStatus:D}=e;u.useEffect(()=>{k.fetchState==="Completed"&&D.stage!=="none"?(W("Not-Started"),E(k.fetchState)):E("Not-Started")},[k.fetchState,D]),u.useEffect(()=>{e.updateStatus.fetchState==="Completed"?(E("Not-Started"),W(e.updateStatus.fetchState)):W("Not-Started")},[e.updateStatus.fetchState]);const z=0,Z=u.useCallback(()=>{const Q=e.onboardingCustomers.filter(se=>se.company.company.companyInfo.companyId===M.selectedCompanyId);if(Q.length>0){const{company:se,onboardingCustomerInfo:X,tenant:re}=Q[0],te={companyEmailDomain:X.companyEmailDomain,companyId:se.company.companyInfo.companyId,isOnboardingCompleted:!0,isOnboardingTenant:!0,tenantId:re.tenantId,userEmailWithPreOnboardSuccess:X.userEmailWithPreOnboardSuccess};d(te)}},[d,e.onboardingCustomers,M.selectedCompanyId]),ie=u.useCallback(Q=>e.onboardingCustomers[Q].company.company.companyInfo.name.length>zt?Ie+32:Ie,[e.onboardingCustomers]);u.useEffect(()=>{b.current&&b.current.resetAfterIndex(0)},[e]);const N=u.useMemo(()=>({makeCompanyNameSticky:K,uiState:M,onColumnSortConfigChanged:p}),[K,M,p]),H=u.useCallback((Q,se,X)=>{const re=e.onboardingCustomers.findIndex(he=>he.company.company.companyInfo.companyId===Q),te=Ot.findIndex(he=>he.key===se);re!==-1&&te!==-1&&(T.current[re]==null?T.current[re]=[X]:T.current[re][te]=X)},[e.onboardingCustomers]),L=u.useCallback(()=>{v.current=null,y(null)},[y]);return u.useEffect(()=>{if($!=null&&f!=null){const{companyId:Q,entityType:se}=$,[X,re]=se.split("."),te=e.onboardingCustomers.findIndex(_=>_.company.company.companyInfo.companyId===Q),he=Ot.findIndex(_=>_.key===re);te!==-1&&!(f.visibleStartIndex<=te&&f.visibleStopIndex>=te)&&b.current?.scrollToItem(te,"center"),setTimeout(()=>{const _=T.current[te]?.[0]?.getBoundingClientRect().bottom,ee=T.current[te]?.[0]?.getBoundingClientRect().top;if(_!=null&&ee!=null&&(window.innerHeight>=_&&window.innerHeight>=ee||ee<0)){const ge=T.current[te][he];ge!=null&&(v.current={companyId:Q,target:ge}),T.current[te][he]?.scrollIntoView({block:"center",behavior:"auto"})}},0);const be=setInterval(()=>{const _=T.current[te]?.[he]?.getBoundingClientRect().left,ee=T.current[te]?.[he]?.getBoundingClientRect().right,ge=T.current[te]?.[he]?.offsetWidth;if(v.current?.companyId===Q&&_!=null&&ge!=null&&ee!=null&&(_<window.innerWidth-ge||ee<window.innerWidth)){clearInterval(be);const ve=$.threadId,Re=$.onThreadShownCallback;ve&&(y(null),j($.threadId),Re?.())}},500);setTimeout(()=>{clearInterval(be),y(null)},2e3)}},[$,f,j,y]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[n?o.jsxRuntimeExports.jsx(U0,{qboConnectionPool:e.qboConnectionPool,isLoading:e.qboConnectionPool.saveQBOConnectionPoolState.fetchState==="In-Progress",onQBOConnectClick:S}):null,o.jsxRuntimeExports.jsxs(q2,{children:[M.showGoLivePopUp===!0?o.jsxRuntimeExports.jsx(t2,{hasAdminRole:!0,onCancelClick:()=>{a()},onGoLiveClick:Z,showGoLivePopup:M.showGoLivePopUp,loading:e.updateStatus.fetchState==="In-Progress"}):null,G==="Completed"?o.jsxRuntimeExports.jsx(Nr,{customerCreationType:D,fetchState:G,onRemoveSnackbar:()=>{c(),E("Not-Started")}}):null,P==="Completed"?o.jsxRuntimeExports.jsx(Nr,{fetchState:P,customMessageText:Y,onRemoveSnackbar:()=>{W("Not-Started")}}):null,o.jsxRuntimeExports.jsxs(ta.Provider,{value:N,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:Q,width:se})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:Q,width:se,itemCount:e.onboardingCustomers.length,itemSize:ie,onItemsRendered:X=>g(X),overscanCount:Mt,itemData:{onboardingView:e,makeCompanyNameSticky:K,addThreadRequestThreadId:O,targetElement:v.current?.target,resetTargetElementFromNavigation:L,setElementRef:H,setAddThreadRequestThreadId:A,setNoteData:I,onOnboardingStepClicked:i,onSendInviteClick:r,redirectToDashboardOnboarding:m,onRetryBankAccountConnection:h},ref:b,innerElementType:oa,onScroll:({scrollOffset:X})=>{l(X)},initialScrollOffset:z,style:{willChange:"auto"},children:X2})}),F!=null?o.jsxRuntimeExports.jsx(Ze.RoomProvider,{id:F.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${F.companyName} ${U2}`,filter:{application:"cockpit",companyId:F.companyId,entityType:F.entityType,isGlobalComment:!1,tab:"onboarding"},isLoading:!1,threadMetadata:{companyName:F.companyName,companyId:F.companyId,entityId:F.companyId,entityType:F.entityType,isGlobalComment:!1,application:"cockpit",tab:"onboarding",url:window.location.href},textOverrides:{composerPlaceholder:H2,replyComposerPlaceholder:K2,threadResolve:G2,threadUnResolve:Y2},onThreadClick:Q=>null,onCloseAllThreadsDrawer:()=>I(null)})}):null]})]})]})},ta=u.createContext(void 0),oa=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,onColumnSortConfigChanged:c}=u.useContext(ta);return o.jsxRuntimeExports.jsxs(ef,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(c2,{companyNameSticky:d,onColumnSortConfigChanged:c,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(J2,{children:r})]})});oa.displayName="Onboarding list view inner element type";const X2=({index:e,style:n,data:r})=>{const i=t.useWindowSizeContext(),{onboardingView:a,makeCompanyNameSticky:d,addThreadRequestThreadId:l,targetElement:c,resetTargetElementFromNavigation:p,setElementRef:m,setNoteData:h,setAddThreadRequestThreadId:S,onOnboardingStepClicked:x,onSendInviteClick:C,redirectToDashboardOnboarding:b,onRetryBankAccountConnection:f}=r,g=a.onboardingCustomers[e],{companyId:j}=g.company.company.companyInfo;return o.jsxRuntimeExports.jsx(Q2,{isCollapsed:!0,style:{...n,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${_2.onboardingRightPadding.valuePx(i)} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(A2,{totalHeight:typeof n.height=="number"?n.height:Ie,companyView:a.onboardingCustomers[e],companyNameSticky:d,allUsers:a.zeniUsers.values,sendInviteFetchState:a.sendInviteFetchStateByCompanyId[a.onboardingCustomers[e].company.company.companyInfo.companyId]?.fetchState,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:p,setNoteData:h,setElementRef:m,setAddThreadRequestThreadId:S,retryBankAccountConnectionFetchState:a.retryBankAccountConnectionFetchStateByCompanyId[a.onboardingCustomers[e].company.company.companyInfo.companyId]?.fetchState,onOnboardingStepClicked:x,onSendInviteClick:C,redirectToDashboardOnboarding:b,onRetryBankAccountConnection:f})},j)},q2=s.div`
3867
3867
  /** Subtract top so list can occupy remaining available height */
3868
3868
  height: calc(100vh - 108px);
3869
3869
  max-width: 99.9%;
@@ -3894,7 +3894,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
3894
3894
  height: calc(100vh - 45px);
3895
3895
  overflow-y: hidden;
3896
3896
  background-color: ${e=>e.theme.colors.grey4};
3897
- `,{cockpit:{emptySearchTextFirstLine:sf,emptySearchTextSecondLine:rf,onboarding:_r},common:{no:af,yes:lf}}=t.appLocale.getLocalizedStrings(),cf=({headerData:e,headerActions:n,initialOpenThreadRequest:r,onboardingPageActions:i,onboardingPageData:a})=>{const[d,l]=u.useState(!1),[c,p]=u.useState(void 0),{onboardingView:m,qboConnectionPoolFlag:h}=a,{onScroll:S,onOnboardingStepClicked:x,onCancelClicked:C,onGoLiveClicked:b,onUpdateCustomerCreationStatus:f,onCockpitReloadData:g,onSendInviteClick:j,onColumnSortConfigChanged:y,redirectToDashboardOnboarding:$,onRetryBankAccountConnection:w,onQBOConnectClick:O}=i,A=m.fetchState==="Completed"&&m.zeniUsers.fetchState==="Completed",v={onOkClick:()=>{l(!1),c!=null&&j(c)},onCancelClick:()=>{l(!1)}};return o.jsxRuntimeExports.jsxs(nf,{children:[d===!0?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{style:{paddingLeft:t.Space.sp6,paddingRight:t.Space.sp6},children:_r.confirmationPopup.title}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:_r.confirmationPopup.subTitle}),primaryButtonText:lf,secondaryButtonText:af,action:v,style:{background:t.Colors.overlayDark}}):null,o.jsxRuntimeExports.jsx(ht,{headerActions:{...n},headerData:{...e,allTabOptions:xt,companiesLoaded:A,filterData:{filterText:m.uiState.filterText,disableFilters:!0},selectedTabOption:"onboarding"}}),o.jsxRuntimeExports.jsx(df,{initialOpenThreadRequest:r,onColumnSortConfigChanged:y,onCockpitReloadData:g,onGoLiveClicked:b,onQBOConnectClick:O,onRetryBankAccountConnection:w,onScroll:S,onSendInviteClick:(T,F)=>{F?j(T):(p(T),l(!0))},onboardingView:m,onOnboardingStepClicked:x,onCancelClicked:C,onUpdateCustomerCreationStatus:f,qboConnectionPoolFlag:h,redirectToDashboardOnboarding:$})]})},df=({onboardingView:e,qboConnectionPoolFlag:n,initialOpenThreadRequest:r,onSendInviteClick:i,onScroll:a,onOnboardingStepClicked:d,onCancelClicked:l,onGoLiveClicked:c,onUpdateCustomerCreationStatus:p,onCockpitReloadData:m,onColumnSortConfigChanged:h,redirectToDashboardOnboarding:S,onRetryBankAccountConnection:x,onQBOConnectClick:C})=>{const b=t.useWindowSizeContext();return e.fetchState==="Error"?o.jsxRuntimeExports.jsx(jt,{onCockpitReloadData:m,selectedCockpitOption:"onboarding"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(tf,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.onboardingCustomers.length===0?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:sf,emptySearchTextSecondLine:rf}):o.jsxRuntimeExports.jsx(of,{windowSize:b,children:o.jsxRuntimeExports.jsx(Z2,{initialOpenThreadRequest:r,onCancelClicked:l,onColumnSortConfigChanged:h,onGoLiveClicked:c,onQBOConnectClick:C,onRetryBankAccountConnection:x,onScroll:a,onSendInviteClick:i,onUpdateCustomerCreationStatus:p,onboardingView:e,qboConnectionPoolFlag:n,redirectToDashboardOnboarding:S,onOnboardingStepClicked:d})})},pf=({localData:e,labelWidth:n,onCompanyDomainBlurred:r,isOnboardingAllowedForUser:i})=>{const a=t.appLocale.getLocalizedStrings().cockpit.onboarding,{isCustomerCreated:d,isEmailGroupCreated:l,companyEmailDomain:c,companyId:p}=e.newOnboardingCustomerLocalData,m=d===!0||l===!0||p!=null||i===!1,h=c!=null&&hf(c);return o.jsxRuntimeExports.jsxs(uf,{children:[o.jsxRuntimeExports.jsx(xf,{children:a.customer.companyCredentials}),o.jsxRuntimeExports.jsx(mf,{children:o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:a.customer.companyDomain,width:n},text:{type:"text",name:"companySection.companyDomain",placeholder:`${a.customer.add} ${a.customer.domain}`,options:{required:!0,pattern:t.DOMAIN_PATTERN}},onBlur:()=>{h&&r(c)},isDisabled:m===!0?"readonly":void 0})})]})},uf=s.div`
3897
+ `,{cockpit:{emptySearchTextFirstLine:sf,emptySearchTextSecondLine:rf,onboarding:Br},common:{no:af,yes:lf}}=t.appLocale.getLocalizedStrings(),cf=({headerData:e,headerActions:n,initialOpenThreadRequest:r,onboardingPageActions:i,onboardingPageData:a})=>{const[d,l]=u.useState(!1),[c,p]=u.useState(void 0),{onboardingView:m,qboConnectionPoolFlag:h}=a,{onScroll:S,onOnboardingStepClicked:x,onCancelClicked:C,onGoLiveClicked:b,onUpdateCustomerCreationStatus:f,onCockpitReloadData:g,onSendInviteClick:j,onColumnSortConfigChanged:y,redirectToDashboardOnboarding:$,onRetryBankAccountConnection:w,onQBOConnectClick:O}=i,A=m.fetchState==="Completed"&&m.zeniUsers.fetchState==="Completed",v={onOkClick:()=>{l(!1),c!=null&&j(c)},onCancelClick:()=>{l(!1)}};return o.jsxRuntimeExports.jsxs(nf,{children:[d===!0?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{style:{paddingLeft:t.Space.sp6,paddingRight:t.Space.sp6},children:Br.confirmationPopup.title}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:Br.confirmationPopup.subTitle}),primaryButtonText:lf,secondaryButtonText:af,action:v,style:{background:t.Colors.overlayDark}}):null,o.jsxRuntimeExports.jsx(ht,{headerActions:{...n},headerData:{...e,allTabOptions:xt,companiesLoaded:A,filterData:{filterText:m.uiState.filterText,disableFilters:!0},selectedTabOption:"onboarding"}}),o.jsxRuntimeExports.jsx(df,{initialOpenThreadRequest:r,onColumnSortConfigChanged:y,onCockpitReloadData:g,onGoLiveClicked:b,onQBOConnectClick:O,onRetryBankAccountConnection:w,onScroll:S,onSendInviteClick:(T,F)=>{F?j(T):(p(T),l(!0))},onboardingView:m,onOnboardingStepClicked:x,onCancelClicked:C,onUpdateCustomerCreationStatus:f,qboConnectionPoolFlag:h,redirectToDashboardOnboarding:$})]})},df=({onboardingView:e,qboConnectionPoolFlag:n,initialOpenThreadRequest:r,onSendInviteClick:i,onScroll:a,onOnboardingStepClicked:d,onCancelClicked:l,onGoLiveClicked:c,onUpdateCustomerCreationStatus:p,onCockpitReloadData:m,onColumnSortConfigChanged:h,redirectToDashboardOnboarding:S,onRetryBankAccountConnection:x,onQBOConnectClick:C})=>{const b=t.useWindowSizeContext();return e.fetchState==="Error"?o.jsxRuntimeExports.jsx(bt,{onCockpitReloadData:m,selectedCockpitOption:"onboarding"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(tf,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.onboardingCustomers.length===0?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:sf,emptySearchTextSecondLine:rf}):o.jsxRuntimeExports.jsx(of,{windowSize:b,children:o.jsxRuntimeExports.jsx(Z2,{initialOpenThreadRequest:r,onCancelClicked:l,onColumnSortConfigChanged:h,onGoLiveClicked:c,onQBOConnectClick:C,onRetryBankAccountConnection:x,onScroll:a,onSendInviteClick:i,onUpdateCustomerCreationStatus:p,onboardingView:e,qboConnectionPoolFlag:n,redirectToDashboardOnboarding:S,onOnboardingStepClicked:d})})},pf=({localData:e,labelWidth:n,onCompanyDomainBlurred:r,isOnboardingAllowedForUser:i})=>{const a=t.appLocale.getLocalizedStrings().cockpit.onboarding,{isCustomerCreated:d,isEmailGroupCreated:l,companyEmailDomain:c,companyId:p}=e.newOnboardingCustomerLocalData,m=d===!0||l===!0||p!=null||i===!1,h=c!=null&&hf(c);return o.jsxRuntimeExports.jsxs(uf,{children:[o.jsxRuntimeExports.jsx(xf,{children:a.customer.companyCredentials}),o.jsxRuntimeExports.jsx(mf,{children:o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:a.customer.companyDomain,width:n},text:{type:"text",name:"companySection.companyDomain",placeholder:`${a.customer.add} ${a.customer.domain}`,options:{required:!0,pattern:t.DOMAIN_PATTERN}},onBlur:()=>{h&&r(c)},isDisabled:m===!0?"readonly":void 0})})]})},uf=s.div`
3898
3898
  display: flex;
3899
3899
  flex-direction: column;
3900
3900
  gap: ${t.Space.sp2};
@@ -4205,7 +4205,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
4205
4205
  height: ${t.Space.sp6};
4206
4206
  align-items: center;
4207
4207
  padding: ${t.Space.sp0} ${t.Space.sp4};
4208
- `,{cockpit:{onboarding:xe},common:{strings:{colon:dt,empty:Vr},placeholder:Zf,labels:Xf}}=t.appLocale.getLocalizedStrings(),qf=`${xe.customer.add} ${xe.customer.customerFirstName.toLowerCase()}`,Qf=`${xe.customer.add} ${xe.customer.customerLastName.toLowerCase()}`,Jf=`${xe.customer.add} ${xe.customer.customerName.toLowerCase()}`,sa=u.forwardRef(({sectionId:e,localData:n,onboardedCompanies:r,isSubsidiary:i,labelWidth:a,realmIdAdditionalLabel:d,productsAdditionalLabel:l,isDisabled:c,largeLabelWidth:p},m)=>{const{emailGroupFetchState:h,newOnboardingCustomerLocalData:S,companyView:x,allProductsList:C}=n,b=o.useTheme(),[f,g]=u.useState(cn(C,S.selectedProducts??[]));u.useEffect(()=>{S.selectedProducts!=null&&g(cn(C,S.selectedProducts))},[S.selectedProducts]);const j=h.fetchState!=="Completed"&&S.isEmailGroupCreated==null,y=c!=null||j?"disabled":c,$=n.companyView?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed===!0;let w;const O=r.find(A=>A.companyInfo.companyId===S.parentCompanyId);return O!=null&&(w={label:O.companyInfo.name,value:O.companyInfo.companyId}),o.jsxRuntimeExports.jsxs(e3,{isDisabled:j,ref:m,children:[o.jsxRuntimeExports.jsxs(t3,{children:[o.jsxRuntimeExports.jsx(n3,{children:xe.customer.customerCreation}),S.companyId!=null&&o.jsxRuntimeExports.jsx(na,{isCompleted:x?.company.companyOnboardingInfo.onboardingInfo?.customerCreated.completed===!0})]}),o.jsxRuntimeExports.jsxs(o3,{children:[o.jsxRuntimeExports.jsx(t.LabeledNameField,{label:{label:`${xe.customer.customerName}${dt}`,width:a},nameField:{name:`${e}.customerName`,registerOptions:{required:!0},defaultValue:{firstName:n.newOnboardingCustomerLocalData.customerName?.firstName??Vr,lastName:n.newOnboardingCustomerLocalData.customerName?.lastName??Vr},placeHolder:{firstName:qf,lastName:Qf,name:Jf},showFullNameError:!0},isDisabled:y==="disabled"?"disabled":c,showAdditionalInfoLabel:!0,additionalInfoLabel:xe.customer.customerNameInfoText,style:{width:"auto"}}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${xe.customer.customerEmail}${dt}`,width:a},text:{type:"email",name:`${e}.email`,placeholder:`${xe.customer.add} ${xe.customer.customerEmail.toLowerCase()}`,autoComplete:"off",options:{required:!0}},isDisabled:y==="disabled"?"disabled":c,showAdditionalInfoLabel:!0,additionalInfoLabel:xe.customer.customerEmailInfoText}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${xe.customer.companyName}${dt}`,width:a},text:{type:"text",name:`${e}.name`,placeholder:`${xe.customer.add} ${xe.customer.companyName.toLowerCase()}`,options:{required:!0}},isDisabled:y,showAdditionalInfoLabel:!0,additionalInfoLabel:xe.customer.companyNameInfoText}),i===!0?o.jsxRuntimeExports.jsx(Kf,{label:{label:`${xe.customer.entity}${dt}`,width:a},concatText:xe.customer.of,firstSingleSelectField:{name:`${e}.entityType`,placeholder:`${xe.customer.add} ${xe.customer.entity.toLowerCase()}`,defaultValue:{selectedOption:{value:xe.customer.subsidiary,label:xe.customer.subsidiary},allOptions:[{value:xe.customer.parent,label:xe.customer.parent},{value:xe.customer.subsidiary,label:xe.customer.subsidiary}]},style:{backgroundColor:b.colors.background}},secondSingleSelectField:{name:`${e}.company`,placeholder:`${xe.customer.add} ${xe.customer.parent.toLowerCase()}`,defaultValue:{selectedOption:w,allOptions:r.map(A=>({label:A.companyInfo.name,value:A.companyInfo.companyId}))},style:{backgroundColor:b.colors.background},registerOptions:{required:i}},isDisabled:y}):o.jsxRuntimeExports.jsx(t.LabeledSingleSelectWithoutClearableField,{label:{label:`${xe.customer.entity}${dt}`,width:a},singleSelectWithoutClearableField:{name:`${e}.entityType`,placeholder:`${xe.customer.add} ${xe.customer.entity.toLowerCase()}`,defaultValue:{selectedOption:{value:xe.customer.parent,label:xe.customer.parent},allOptions:[{value:xe.customer.parent,label:xe.customer.parent},{value:xe.customer.subsidiary,label:xe.customer.subsidiary}]}},isDisabled:y}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${xe.customer.realmId}${dt}`,width:a},text:{type:"text",name:`${e}.realmId`,placeholder:`${xe.customer.add} ${xe.customer.realmIdText}`,options:{pattern:t.REALM_ID}},showTooltip:!0,tooltipTitle:o.jsxRuntimeExports.jsx(s3,{}),isDisabled:y==="disabled"||$===!0?"disabled":c,isOptional:!0}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${xe.customer.confirmRealmId}${dt}`,width:p},text:{type:"text",name:`${e}.confirmRealmId`,placeholder:`${xe.customer.confirmRealmIdText}`,options:{pattern:t.REALM_ID,validate:(A,v)=>A===v[e].realmId}},additionalInfoLabel:d,disableCopyPaste:!0,isDisabled:y==="disabled"||$===!0?"disabled":c,isOptional:!0}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${xe.customer.hubSpotId}${dt}`,width:a},text:{type:"text",name:"customerSection.hubSpotId",placeholder:`${xe.customer.add} ${xe.customer.hubSpotIdText}`,options:{pattern:t.DIGITS_PATTERN}},isDisabled:y,isOptional:!0}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${xe.customer.chargebeeId}${dt}`,width:a},text:{type:"text",name:"customerSection.chargebeeId",placeholder:`${xe.customer.add} ${xe.customer.chargebeeIdText}`,options:{pattern:t.ALPHA_NUMERIC_PATTERN,required:!0}},isDisabled:y}),o.jsxRuntimeExports.jsx(zf,{label:{label:Xf.products,width:a},additionalInfoLabel:l||void 0,multiSelectWithCheckBoxField:{name:"customerSection.products",defaultValue:{allOptions:f,selectedOptions:S.selectedProducts??[]},placeholder:Zf.productsPlaceholder,isDisabled:y,registerOptions:{validate:A=>A!=null&&A.selectedOptions.length>0}},style:{width:"auto"}})]})]})});sa.displayName="CustomerCreation";const e3=s.div`
4208
+ `,{cockpit:{onboarding:xe},common:{strings:{colon:dt,empty:_r},placeholder:Zf,labels:Xf}}=t.appLocale.getLocalizedStrings(),qf=`${xe.customer.add} ${xe.customer.customerFirstName.toLowerCase()}`,Qf=`${xe.customer.add} ${xe.customer.customerLastName.toLowerCase()}`,Jf=`${xe.customer.add} ${xe.customer.customerName.toLowerCase()}`,sa=u.forwardRef(({sectionId:e,localData:n,onboardedCompanies:r,isSubsidiary:i,labelWidth:a,realmIdAdditionalLabel:d,productsAdditionalLabel:l,isDisabled:c,largeLabelWidth:p},m)=>{const{emailGroupFetchState:h,newOnboardingCustomerLocalData:S,companyView:x,allProductsList:C}=n,b=o.useTheme(),[f,g]=u.useState(ln(C,S.selectedProducts??[]));u.useEffect(()=>{S.selectedProducts!=null&&g(ln(C,S.selectedProducts))},[S.selectedProducts]);const j=h.fetchState!=="Completed"&&S.isEmailGroupCreated==null,y=c!=null||j?"disabled":c,$=n.companyView?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed===!0;let w;const O=r.find(A=>A.companyInfo.companyId===S.parentCompanyId);return O!=null&&(w={label:O.companyInfo.name,value:O.companyInfo.companyId}),o.jsxRuntimeExports.jsxs(e3,{isDisabled:j,ref:m,children:[o.jsxRuntimeExports.jsxs(t3,{children:[o.jsxRuntimeExports.jsx(n3,{children:xe.customer.customerCreation}),S.companyId!=null&&o.jsxRuntimeExports.jsx(na,{isCompleted:x?.company.companyOnboardingInfo.onboardingInfo?.customerCreated.completed===!0})]}),o.jsxRuntimeExports.jsxs(o3,{children:[o.jsxRuntimeExports.jsx(t.LabeledNameField,{label:{label:`${xe.customer.customerName}${dt}`,width:a},nameField:{name:`${e}.customerName`,registerOptions:{required:!0},defaultValue:{firstName:n.newOnboardingCustomerLocalData.customerName?.firstName??_r,lastName:n.newOnboardingCustomerLocalData.customerName?.lastName??_r},placeHolder:{firstName:qf,lastName:Qf,name:Jf},showFullNameError:!0},isDisabled:y==="disabled"?"disabled":c,showAdditionalInfoLabel:!0,additionalInfoLabel:xe.customer.customerNameInfoText,style:{width:"auto"}}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${xe.customer.customerEmail}${dt}`,width:a},text:{type:"email",name:`${e}.email`,placeholder:`${xe.customer.add} ${xe.customer.customerEmail.toLowerCase()}`,autoComplete:"off",options:{required:!0}},isDisabled:y==="disabled"?"disabled":c,showAdditionalInfoLabel:!0,additionalInfoLabel:xe.customer.customerEmailInfoText}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${xe.customer.companyName}${dt}`,width:a},text:{type:"text",name:`${e}.name`,placeholder:`${xe.customer.add} ${xe.customer.companyName.toLowerCase()}`,options:{required:!0}},isDisabled:y,showAdditionalInfoLabel:!0,additionalInfoLabel:xe.customer.companyNameInfoText}),i===!0?o.jsxRuntimeExports.jsx(Kf,{label:{label:`${xe.customer.entity}${dt}`,width:a},concatText:xe.customer.of,firstSingleSelectField:{name:`${e}.entityType`,placeholder:`${xe.customer.add} ${xe.customer.entity.toLowerCase()}`,defaultValue:{selectedOption:{value:xe.customer.subsidiary,label:xe.customer.subsidiary},allOptions:[{value:xe.customer.parent,label:xe.customer.parent},{value:xe.customer.subsidiary,label:xe.customer.subsidiary}]},style:{backgroundColor:b.colors.background}},secondSingleSelectField:{name:`${e}.company`,placeholder:`${xe.customer.add} ${xe.customer.parent.toLowerCase()}`,defaultValue:{selectedOption:w,allOptions:r.map(A=>({label:A.companyInfo.name,value:A.companyInfo.companyId}))},style:{backgroundColor:b.colors.background},registerOptions:{required:i}},isDisabled:y}):o.jsxRuntimeExports.jsx(t.LabeledSingleSelectWithoutClearableField,{label:{label:`${xe.customer.entity}${dt}`,width:a},singleSelectWithoutClearableField:{name:`${e}.entityType`,placeholder:`${xe.customer.add} ${xe.customer.entity.toLowerCase()}`,defaultValue:{selectedOption:{value:xe.customer.parent,label:xe.customer.parent},allOptions:[{value:xe.customer.parent,label:xe.customer.parent},{value:xe.customer.subsidiary,label:xe.customer.subsidiary}]}},isDisabled:y}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${xe.customer.realmId}${dt}`,width:a},text:{type:"text",name:`${e}.realmId`,placeholder:`${xe.customer.add} ${xe.customer.realmIdText}`,options:{pattern:t.REALM_ID}},showTooltip:!0,tooltipTitle:o.jsxRuntimeExports.jsx(s3,{}),isDisabled:y==="disabled"||$===!0?"disabled":c,isOptional:!0}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${xe.customer.confirmRealmId}${dt}`,width:p},text:{type:"text",name:`${e}.confirmRealmId`,placeholder:`${xe.customer.confirmRealmIdText}`,options:{pattern:t.REALM_ID,validate:(A,v)=>A===v[e].realmId}},additionalInfoLabel:d,disableCopyPaste:!0,isDisabled:y==="disabled"||$===!0?"disabled":c,isOptional:!0}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${xe.customer.hubSpotId}${dt}`,width:a},text:{type:"text",name:"customerSection.hubSpotId",placeholder:`${xe.customer.add} ${xe.customer.hubSpotIdText}`,options:{pattern:t.DIGITS_PATTERN}},isDisabled:y,isOptional:!0}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${xe.customer.chargebeeId}${dt}`,width:a},text:{type:"text",name:"customerSection.chargebeeId",placeholder:`${xe.customer.add} ${xe.customer.chargebeeIdText}`,options:{pattern:t.ALPHA_NUMERIC_PATTERN,required:!0}},isDisabled:y}),o.jsxRuntimeExports.jsx(zf,{label:{label:Xf.products,width:a},additionalInfoLabel:l||void 0,multiSelectWithCheckBoxField:{name:"customerSection.products",defaultValue:{allOptions:f,selectedOptions:S.selectedProducts??[]},placeholder:Zf.productsPlaceholder,isDisabled:y,registerOptions:{validate:A=>A!=null&&A.selectedOptions.length>0}},style:{width:"auto"}})]})]})});sa.displayName="CustomerCreation";const e3=s.div`
4209
4209
  opacity: ${e=>e.isDisabled?.4:1};
4210
4210
  display: flex;
4211
4211
  flex-direction: column;
@@ -4221,7 +4221,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
4221
4221
  border-radius: ${t.Space.sp2};
4222
4222
  `,n3=s(t.LargeSemiBold)`
4223
4223
  color: ${e=>e.theme.colors.champion};
4224
- `,s3=()=>{const e=t.appLocale.getLocalizedStrings().cockpit.onboarding.customer.reamlIdTooltip;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ur,{children:e.firstLine}),o.jsxRuntimeExports.jsx(Ur,{children:e.secondLine})]})},Ur=s.div``,cn=(e,n)=>{const r=n.includes("bookkeeping"),i=n.includes("zeni_checking"),a=n.includes("zeni_cards"),d=n.includes("zeni_treasury"),l=n.includes("zeni_payroll"),c=n.includes("zeni_cfo"),p=n.includes("zeni_tax"),m=l||c||p,h=["zeni_payroll","zeni_cfo","zeni_tax"],S=["zeni_bill_pay","zeni_reimbursements"],x=["zeni_checking","zeni_cards","zeni_bill_pay","zeni_reimbursements","zeni_treasury"];return e.map(C=>{const{code:b,name:f}=C,g={label:f,value:b,isDisabled:!1,isFiltered:!1};if(S.includes(b))return r?(g.isDisabled=!0,g.isFiltered=!1):(g.isDisabled=!0,g.isFiltered=!0),g;if(m){const j=h.includes(b);return g.isFiltered=!j,g.isDisabled=!j,g}if(r)return b==="bookkeeping"?(g.isDisabled=!1,g.isFiltered=!1):x.includes(b)?(g.isDisabled=!0,g.isFiltered=!1):(g.isDisabled=!0,g.isFiltered=!0),g;if(i||a||d){const y=["bookkeeping","zeni_checking","zeni_cards","zeni_treasury"].includes(b);return g.isFiltered=!y,g.isDisabled=!y,g}return g})},r3=e=>{switch(e){case"ExtraSmall":return t.sp[2];case"Small":return t.sp[3];case"Standard":return t.sp[4];case"Large":return t.sp[5];case"ExtraLarge":return t.sp[7]}},i3=s.div`
4224
+ `,s3=()=>{const e=t.appLocale.getLocalizedStrings().cockpit.onboarding.customer.reamlIdTooltip;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Vr,{children:e.firstLine}),o.jsxRuntimeExports.jsx(Vr,{children:e.secondLine})]})},Vr=s.div``,ln=(e,n)=>{const r=n.includes("bookkeeping"),i=n.includes("zeni_checking"),a=n.includes("zeni_cards"),d=n.includes("zeni_treasury"),l=n.includes("zeni_payroll"),c=n.includes("zeni_cfo"),p=n.includes("zeni_tax"),m=l||c||p,h=["zeni_payroll","zeni_cfo","zeni_tax"],S=["zeni_bill_pay","zeni_reimbursements"],x=["zeni_checking","zeni_cards","zeni_bill_pay","zeni_reimbursements","zeni_treasury"];return e.map(C=>{const{code:b,name:f}=C,g={label:f,value:b,isDisabled:!1,isFiltered:!1};if(S.includes(b))return r?(g.isDisabled=!0,g.isFiltered=!1):(g.isDisabled=!0,g.isFiltered=!0),g;if(m){const j=h.includes(b);return g.isFiltered=!j,g.isDisabled=!j,g}if(r)return b==="bookkeeping"?(g.isDisabled=!1,g.isFiltered=!1):x.includes(b)?(g.isDisabled=!0,g.isFiltered=!1):(g.isDisabled=!0,g.isFiltered=!0),g;if(i||a||d){const y=["bookkeeping","zeni_checking","zeni_cards","zeni_treasury"].includes(b);return g.isFiltered=!y,g.isDisabled=!y,g}return g})},r3=e=>{switch(e){case"ExtraSmall":return t.sp[2];case"Small":return t.sp[3];case"Standard":return t.sp[4];case"Large":return t.sp[5];case"ExtraLarge":return t.sp[7]}},i3=s.div`
4225
4225
  color: ${e=>e.theme.colors.primary};
4226
4226
  display: flex;
4227
4227
  justify-content: center;
@@ -4257,7 +4257,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
4257
4257
  align-items: center;
4258
4258
  z-index: 10;
4259
4259
  margin-top: 28px;
4260
- `;function x3({sectionId:e,isSectionDisabled:n,isLoading:r,accountingConnectionCreationMode:i,isConnected:a,isInviteSent:d,saveConnectionState:l,onQBOConnectClick:c}){const p=t.appLocale.getLocalizedStrings().cockpit.onboarding;return o.jsxRuntimeExports.jsxs(h3,{isDisabled:n===!0,children:[o.jsxRuntimeExports.jsx(b3,{children:p.qboSectionTitle}),o.jsxRuntimeExports.jsxs(g3,{children:[o.jsxRuntimeExports.jsx(R3,{children:ee.ALL_ACCOUNTING_CONNECTION_CREATION_MODES.map((m,h)=>o.jsxRuntimeExports.jsx($3,{isDisabled:n===!0,leftSideContainer:h===0,children:o.jsxRuntimeExports.jsx(t.LabeledRadioField,{label:{label:p.qboRadioButtonLabels[m]},style:{width:"100%",backgroundColor:"transparent",borderWidth:0},isDisabled:a===!0||n===!0||d===!0?"disabled":void 0,changeLabelColorInDisableMode:!1,radioField:{radioSize:"small",name:`${e}.accountingConnectionCreationMode`,id:m,value:m}})},m))}),o.jsxRuntimeExports.jsxs(w3,{isDisabled:n===!0||i!=="zeni_user",children:[o.jsxRuntimeExports.jsxs(S3,{children:[o.jsxRuntimeExports.jsxs(y3,{children:[o.jsxRuntimeExports.jsx(f3,{}),o.jsxRuntimeExports.jsx(C3,{}),o.jsxRuntimeExports.jsx(j3,{})]}),a!==!0?o.jsxRuntimeExports.jsx(t.Button,{variant:"primary",label:p.connectQBOButtonLabel,style:{width:"fit-content"},disabled:n===!0||i!=="zeni_user",onClick:c,loading:r===!0}):o.jsxRuntimeExports.jsx(Ro,{complete:!0})]}),a===!0?o.jsxRuntimeExports.jsx(E3,{children:p.qboSuccessText}):null,l==="Error"?o.jsxRuntimeExports.jsx(v3,{children:p.qboErrorText}):null]})]})]})}const h3=s.div`
4260
+ `;function x3({sectionId:e,isSectionDisabled:n,isLoading:r,accountingConnectionCreationMode:i,isConnected:a,isInviteSent:d,saveConnectionState:l,onQBOConnectClick:c}){const p=t.appLocale.getLocalizedStrings().cockpit.onboarding;return o.jsxRuntimeExports.jsxs(h3,{isDisabled:n===!0,children:[o.jsxRuntimeExports.jsx(b3,{children:p.qboSectionTitle}),o.jsxRuntimeExports.jsxs(g3,{children:[o.jsxRuntimeExports.jsx(R3,{children:J.ALL_ACCOUNTING_CONNECTION_CREATION_MODES.map((m,h)=>o.jsxRuntimeExports.jsx($3,{isDisabled:n===!0,leftSideContainer:h===0,children:o.jsxRuntimeExports.jsx(t.LabeledRadioField,{label:{label:p.qboRadioButtonLabels[m]},style:{width:"100%",backgroundColor:"transparent",borderWidth:0},isDisabled:a===!0||n===!0||d===!0?"disabled":void 0,changeLabelColorInDisableMode:!1,radioField:{radioSize:"small",name:`${e}.accountingConnectionCreationMode`,id:m,value:m}})},m))}),o.jsxRuntimeExports.jsxs(w3,{isDisabled:n===!0||i!=="zeni_user",children:[o.jsxRuntimeExports.jsxs(S3,{children:[o.jsxRuntimeExports.jsxs(y3,{children:[o.jsxRuntimeExports.jsx(f3,{}),o.jsxRuntimeExports.jsx(C3,{}),o.jsxRuntimeExports.jsx(j3,{})]}),a!==!0?o.jsxRuntimeExports.jsx(t.Button,{variant:"primary",label:p.connectQBOButtonLabel,style:{width:"fit-content"},disabled:n===!0||i!=="zeni_user",onClick:c,loading:r===!0}):o.jsxRuntimeExports.jsx(Ro,{complete:!0})]}),a===!0?o.jsxRuntimeExports.jsx(E3,{children:p.qboSuccessText}):null,l==="Error"?o.jsxRuntimeExports.jsx(v3,{children:p.qboErrorText}):null]})]})]})}const h3=s.div`
4261
4261
  opacity: ${e=>e.isDisabled?.4:1};
4262
4262
  display: flex;
4263
4263
  flex-direction: column;
@@ -4327,7 +4327,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
4327
4327
  color: ${t.Colors.importantDark};
4328
4328
  padding: ${t.Space.sp2} ${t.Space.sp2};
4329
4329
  border-radius: ${t.Space.sp1};
4330
- `,Hr="onboardingCustomerPage",k3="companySection",rt="groupSection",De="customerSection",ia="qboConnectionSection",ho={labelWidth:new t.ResponsiveSized(120,180),largeLabelWidth:new t.ResponsiveSized(120,210,210),extraLargeLabelWidth:new t.ResponsiveSized(240,240,240),descriptionMarginBottom:new t.ResponsiveSized(20,t.sp[3]),titleFontSize:new t.ResponsiveSized(t.sp[3],18),titleLineHeight:new t.ResponsiveSized(t.sp[4],27),buttonWidth:new t.ResponsiveSized(135,135)},{cockpit:{onboarding:je},common:{no:T3,yes:L3,strings:de}}=t.appLocale.getLocalizedStrings();function P3({localData:e,screenType:n,qboConnectClicked:r,analytics:i,onOnboardingCustomerDataUpdated:a,onCloseClick:d,onSaveClick:l,onViewClick:c,onCompanyDomainBlurred:p,onNavigateToPreOnboarding:m,onQBOConnectClick:h}){const S=o.useTheme(),x=t.useWindowSizeContext(),C=ho.labelWidth.value(x),b=ho.largeLabelWidth.value(x),f=ho.extraLargeLabelWidth.value(x),g=o.useForm({mode:"all",reValidateMode:"onChange",defaultValues:u.useMemo(()=>go(e),[e])}),{emailGroupFetchState:j,newOnboardingCustomerLocalData:y,onboardingCompletedCompanies:$,isOnboardingAllowedForUser:w,fetchState:O,sendInviteFetchState:A,uiState:v,companyView:T,externalConnections:F}=e,[I,K]=u.useState(de.empty),[M,Y]=u.useState(de.empty),[G]=u.useState(de.empty),[E,P]=u.useState(de.empty),[W,k]=u.useState(de.empty),[D,z]=u.useState(!1),[Z,ie]=u.useState(!1),[N,H]=u.useState(je.customer.completePreOnboardingText),[L,Q]=u.useState(!1),se=u.useRef(null),X=u.useRef(null),re=u.useRef(null),{isExistingCustomer:te,isCustomerOnboardedSuccessfully:he}=N3(e),fe=te&&he?je.customer.customerNameExistInManagementText:je.customer.customerNameExistInOnboardingText,be=u.useMemo(()=>fe.replace("_company-domain_",y.companyEmailDomain??de.empty),[j.fetchState]),_=T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed,J=u.useCallback(()=>{const me=g.getValues();return me[De].realmId!==me[De].confirmRealmId?(P(je.customer.realmIdWarning),g.trigger(`${De}.confirmRealmId`),!1):(P(de.empty),g.clearErrors(`${De}.confirmRealmId`),!0)},[g]),ge=u.useCallback(()=>{const me=g.getValues();return me[De].entityType.selectedOption?.value=="Subsidiary"&&me[De].company.selectedOption==null?(g.setError("customerSection.company",{type:"required"}),!1):(g.clearErrors("customerSection.company"),!0)},[g]),ve=u.useCallback(()=>y.customerName?.firstName&&!y.customerName?.lastName||!y.customerName?.firstName&&y.customerName?.lastName?(g.trigger(`${De}.customerName`),!1):(y.customerName?.firstName||y.customerName?.lastName)&&!y.email?(g.trigger(`${De}.email`),!1):(y.customerName?.firstName||y.customerName?.lastName)&&y.email&&y.selectedProducts?.length===0?(k(je.customer.productsWarning),g.trigger(`${De}.products`),!1):!0,[g,y.customerName,y.email,y.selectedProducts]),Re=u.useCallback(()=>J()&&ge()&&ve(),[ge,J,ve]),R=g.handleSubmit(()=>{H(je.customer.completePreOnboardingText),Re()&&ie(!0)},()=>{Re(),console.warn("Onboarding customer form error")}),Ce=g.getValues()[De].email??de.empty,ae=(me=!1)=>{const q={companyDomain:y.companyEmailDomain??de.empty,primaryContactEmail:Ce},Ne={groupName:y.groupName??de.empty,groupEmail:y.groupId??de.empty,groupDescription:y.groupDescription??de.empty},qe={firstName:y.customerName?.firstName??de.empty,lastName:y.customerName?.lastName??de.empty,customerEmail:Ce,companyName:y.name??de.empty,entittyType:y.isSubsidiary===!0?je.customer.subsidiary:je.customer.parent??de.empty,chargebeeId:y.chargebeeId??de.empty,products:y.selectedProducts??[],qboRealmId:y.qboRealmId??de.empty,hubSpotId:y.hubSpotId},He={isSendInvite:me,isInviteAlreadySent:T?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0,isZeniManagedQboConnectionSelected:y.accountingConnectionCreationMode==="zeni_user",isCustomerManagedQboConnectionSelected:y.accountingConnectionCreationMode==="customer",qboConnectionStatus:T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed??!1};i?.trackOnboardingSaveOrSendInvite(q,Ne,qe,He)},ce=()=>{const me={companyEmailDomain:y.companyEmailDomain??de.empty,primaryContactEmail:Ce},q={groupName:y.groupName??de.empty,groupEmail:y.groupId??de.empty,groupDescription:y.groupDescription??de.empty,isCompanyEmailDomainAvailable:!0};i?.trackOnboardingNewCustomerGroupCreationCheck(me,q)},$e=()=>{let me=!0;const q=g.getValues();if(q[rt].groupEmail!==de.empty&&q[rt].groupName===de.empty)K(je.customer.groupNameWarning),g.setError("groupSection.groupName",{type:"required"}),me=!1;else if(q[rt].groupName!==de.empty&&q[rt].groupEmail===de.empty)Y(je.customer.groupEmailWarning),g.setError("groupSection.groupEmail",{type:"required"}),me=!1;else{const{error:Ne}=g.getFieldState("groupSection.groupName"),{error:qe}=g.getFieldState("groupSection.groupEmail");(Ne==null||Ne.type==="required")&&(qe==null||qe.type==="required")&&(me=!1,g.clearErrors("groupSection")),K(de.empty),Y(de.empty)}return me},V={onOkClick:()=>{z(!1),g.reset(),d()},onCancelClick:()=>{z(!1)}},B={onOkClick:()=>{ie(!1),l(!0),ae(!0)},onCancelClick:()=>{ie(!1)}},pe=async(me,q)=>{const Ne={...q};if(me.includes("groupName")&&q[rt].groupName!=de.empty&&(q[rt].groupName=q[rt].groupName.charAt(0).toUpperCase()+q[rt].groupName.slice(1)),(me.includes("groupName")||me.includes("groupEmail"))&&$e(),me.includes("confirmRealmId")&&P(de.empty),me.includes("products")&&o.isEqual(y.selectedProducts??[],q[De].products.selectedOptions)===!1){k(de.empty);const qe=M3(y.selectedProducts??[],q[De].products.selectedOptions.map(bt=>ee.toProductTypeStrict(bt)).filter(bt=>bt!=null));Ne[De].products.selectedOptions=qe;const He=cn(e.allProductsList,qe);g.setValue(`${De}.products`,{allOptions:He,selectedOptions:qe})}me.includes("realmId")&&o.has(g.formState.errors,`${De}.confirmRealmId`)&&g.trigger(`${De}.confirmRealmId`),a(Ne)},ye=me=>{const{dirtyFields:q}=g.formState;q.companySection?.companyDomain===!0&&p(me)},ke=()=>{Object.keys(g.formState.errors).length===0&&(m?.(),H(de.empty))},ue=()=>{j.fetchState==="Error"?p(y.companyEmailDomain):Re()&&Object.keys(g.formState.errors).length===0&&(l(A.fetchState==="Error"),ae())},U=()=>{Re()&&Object.keys(g.formState.errors).length===0&&(l(!1),ae())};u.useEffect(()=>{const me=g.watch((q,{name:Ne})=>{Ne!=null&&q!=null&&o.defer(()=>pe(Ne,q))});return()=>{me.unsubscribe()}}),u.useEffect(()=>{y.isCustomerCreationDisabled===!0&&(g.resetField("customerSection",{defaultValue:go(e)[De],keepDirty:!0}),g.clearErrors("customerSection"))},[y.isCustomerCreationDisabled]),u.useEffect(()=>{Q(y.isSubsidiary===!0),y.isSubsidiary!==!0&&g.resetField("customerSection.company",{defaultValue:go(e)[De].company,keepDirty:!0}),g.resetField("customerSection.entityType",{defaultValue:go(e)[De].entityType,keepDirty:!0})},[y.isSubsidiary]),u.useEffect(()=>{j.fetchState==="Completed"&&(g.reset(go(e)),te||ce())},[j.fetchState]),u.useEffect(()=>{v.selectedStep==="STEP_1"?se.current?.scrollIntoView():v.selectedStep==="STEP_2"?X.current?.scrollIntoView():v.selectedStep==="STEP_3"&&re.current?.scrollIntoView()},[]),u.useEffect(()=>{const me=T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed;if(F?.saveConnectionState==="Error"){const Ne={firstName:y.customerName?.firstName??de.empty,lastName:y.customerName?.lastName??de.empty,customerEmail:g.getValues()[De].email??de.empty,qboConnectionResponseMessage:je.qboErrorText,isSuccess:!1};i?.trackOnboardingZeniManagedQBOConnection(Ne)}else if(me??!1){const Ne={firstName:y.customerName?.firstName??de.empty,lastName:y.customerName?.lastName??de.empty,customerEmail:g.getValues()[De].email??de.empty,qboConnectionResponseMessage:je.qboSuccessText,isSuccess:!0};i?.trackOnboardingZeniManagedQBOConnection(Ne)}},[F?.saveConnectionState,T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed]),u.useEffect(()=>{if(y.accountingConnectionCreationMode){const me=T?.company.companyOnboardingInfo.onboardingInfo?.accountingConnectionCreationMode??de.empty;if(y.accountingConnectionCreationMode!==me){const q={firstName:y.customerName?.firstName??de.empty,lastName:y.customerName?.lastName??de.empty,customerEmail:g.getValues()[De].email??de.empty,isZeniOrCustomer:y.accountingConnectionCreationMode??de.empty};i?.trackOnboardingQBOConnectionSelected(q)}}},[y.accountingConnectionCreationMode]);const Oe=(me,q)=>{const{fetchState:Ne}=me,{isEmailGroupCreated:qe,selectedProducts:He}=q,bt=Ne!=="Completed"&&qe==null,eo=He==null||He.length===0,Bt=(He?.includes("zeni_checking")===!0||He?.includes("zeni_treasury")===!0||He?.includes("zeni_cards")===!0||He?.includes("zeni_payroll")===!0||He?.includes("zeni_cfo")===!0||He?.includes("zeni_tax")===!0)&&He?.includes("bookkeeping")===!1;return bt||eo||Bt},Pe=u.useMemo(()=>{const me=g.formState.isValid,q=y.selectedProducts!=null&&(y.selectedProducts.includes("zeni_payroll")===!0||y.selectedProducts.includes("zeni_cfo")===!0||y.selectedProducts.includes("zeni_tax")===!0),Ne=y.selectedProducts!=null&&(y.selectedProducts.includes("zeni_checking")===!0||y.selectedProducts.includes("zeni_cards")===!0||q)&&y.selectedProducts.includes("bookkeeping")===!1;return me!==!0||j.fetchState==="In-Progress"||j.fetchState==="Error"||O==="In-Progress"||O==="Error"||w!==!0||y.selectedProducts==null||y.selectedProducts.length===0||y.accountingConnectionCreationMode==null&&!Ne||y.accountingConnectionCreationMode==="zeni_user"&&_!==!0&&!Ne||j.fetchState==="Completed"&&te||T?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted===!0},[j.fetchState,te,w,O,g.formState.isValid,y.accountingConnectionCreationMode,_,y.selectedProducts,T?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted]),Fe=u.useMemo(()=>A.fetchState!=="In-Progress"&&A.fetchState!=="Error"&&O!=="In-Progress"&&O!=="Error"&&j.fetchState!=="In-Progress"&&te===!0,[j.fetchState,te,O,A.fetchState]);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[D===!0?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{children:je.discardTitle}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:je.discardDescription}),primaryButtonText:je.delete,secondaryButtonText:je.cancel,action:V,style:{background:t.Colors.overlayDark}}):null,Z===!0?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{style:{paddingLeft:t.Space.sp6,paddingRight:t.Space.sp6},children:je.confirmationPopup.title}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:je.confirmationPopup.subTitle}),primaryButtonText:L3,secondaryButtonText:T3,action:B,style:{background:t.Colors.overlayDark}}):null,o.jsxRuntimeExports.jsx(t.NavBarWithClose,{title:n==="create"?je.customer.modalNewCustomerText:je.customer.modalEditCustomerText,backgroundColor:S.colors.grey5,style:{zIndex:4},onCloseClick:()=>{Object.keys(g.formState.dirtyFields).length>0?z(!0):(g.reset(),d())}}),o.jsxRuntimeExports.jsxs(I3,{children:[o.jsxRuntimeExports.jsx(D3,{children:je.customer.subTitle}),o.jsxRuntimeExports.jsx(o.FormProvider,{...g,children:o.jsxRuntimeExports.jsxs("form",{id:`${Hr}_form`,onSubmit:R,children:[o.jsxRuntimeExports.jsx(pf,{localData:e,labelWidth:C,onCompanyDomainBlurred:ye,primaryEmailDomainAdditionalLabel:G,isOnboardingAllowedForUser:w}),Fe===!0?o.jsxRuntimeExports.jsxs(Hn,{children:[o.jsxRuntimeExports.jsxs(Kn,{children:[o.jsxRuntimeExports.jsxs(Kr,{children:[o.jsxRuntimeExports.jsx(Un,{}),o.jsxRuntimeExports.jsx(t.StandardMedium,{children:je.customer.groupCreationError})]}),o.jsxRuntimeExports.jsx(O3,{children:be})]}),o.jsxRuntimeExports.jsx(t.Button,{style:{padding:`${t.Space.sp1} ${t.Space.sp2}`,backgroundColor:S.colors.champion,borderColor:S.colors.champion,color:S.mode==="light"?t.darkColors.primary:t.lightColors.primary,height:"30px",width:t.Space.sp7},label:je.customer.view,size:"small",onClick:()=>{c(he?"management":"onboarding")}})]}):null,j.fetchState==="Error"||O==="Error"||A.fetchState==="Error"&&e.error!=null&&e.error?.code!==406?o.jsxRuntimeExports.jsxs(Hn,{children:[o.jsxRuntimeExports.jsx(Kn,{children:o.jsxRuntimeExports.jsxs(Kr,{children:[o.jsxRuntimeExports.jsx(Un,{}),o.jsxRuntimeExports.jsx(t.LargeMedium,{children:je.customer.emailgroupAPIError})]})}),o.jsxRuntimeExports.jsx(t.Button,{style:{padding:`${t.Space.sp1} ${t.Space.sp2}`,backgroundColor:S.colors.champion,borderColor:S.colors.champion,color:S.mode==="light"?t.darkColors.primary:t.lightColors.primary},label:je.customer.tryAgainText,size:"small",onClick:ue})]}):null,A.fetchState==="Error"&&e.error!=null&&e.error?.code===406?o.jsxRuntimeExports.jsxs(Hn,{children:[o.jsxRuntimeExports.jsx(Un,{}),o.jsxRuntimeExports.jsxs(Kn,{children:[o.jsxRuntimeExports.jsx(t.LargeMedium,{children:N!==de.empty?je.customer.preOnboardingError:je.customer.preOnboardingSaveError}),N!==de.empty?o.jsxRuntimeExports.jsx(t.Button,{style:{padding:`${t.Space.sp1} ${t.Space.sp2}`,backgroundColor:S.colors.champion,borderColor:S.colors.champion,color:S.mode==="light"?t.darkColors.primary:t.lightColors.primary},label:N,size:"small",onClick:ke}):null]})]}):null,o.jsxRuntimeExports.jsx(ra,{groupEmailAdditionalLabel:M,groupNameAdditionalLabel:I,labelWidth:C,localData:e,ref:se,sectionId:rt}),o.jsxRuntimeExports.jsx(sa,{localData:e,onboardedCompanies:$.companies,isSubsidiary:L,labelWidth:C,largeLabelWidth:b,extraLargeLabelWidth:f,realmIdAdditionalLabel:E,productsAdditionalLabel:W,ref:X,sectionId:De,isDisabled:w===!1?"disabled":void 0}),o.jsxRuntimeExports.jsx(A3,{children:o.jsxRuntimeExports.jsx(x3,{isSectionDisabled:Oe(j,y),sectionId:ia,isLoading:r===!0||F?.fetchState==="In-Progress"||F?.saveConnectionState==="In-Progress",accountingConnectionCreationMode:e.newOnboardingCustomerLocalData.accountingConnectionCreationMode,onQBOConnectClick:h,isConnected:T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed===!0,isInviteSent:T?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0||T?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted===!0,saveConnectionState:F?.saveConnectionState})})]})})]}),o.jsxRuntimeExports.jsx(t.Footer,{formId:`${Hr}_form`,primaryBtn:{label:T?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0?je.customer.resendInviteBtnText:je.customer.sendInviteBtnText,style:{width:ho.buttonWidth.value(x),display:"flex",alignItems:"center",justifyContent:"center"},isLoading:A.fetchState==="In-Progress",isDisabled:Pe},cancelBtn:{label:je.customer.saveBtnText,style:{width:ho.buttonWidth.value(x),display:"flex",alignItems:"center",justifyContent:"center"},isDisabled:!(t.formHasDirtyFields(g.formState.dirtyFields)||e.emailGroupFetchState.fetchState==="Completed"),isLoading:O==="In-Progress"&&r===!1,shouldResetOnCancel:!1,onClick:U,reverseSpinnerColor:!1}})]})}const go=e=>{const{newOnboardingCustomerLocalData:n,onboardingCompletedCompanies:r}=e;let i;const a=r.companies.find(d=>d.companyInfo.companyId===n.parentCompanyId);return a!=null&&(i={label:a.companyInfo.name,value:a.companyInfo.companyId}),{[k3]:{companyDomain:n.companyEmailDomain??de.empty},[rt]:{groupName:n.groupName??de.empty,groupEmail:n.groupId??de.empty,groupDescription:n.groupDescription??de.empty},[De]:{name:n.name??de.empty,entityType:{allOptions:[{label:je.customer.parent,value:je.customer.parent},{label:je.customer.subsidiary,value:je.customer.subsidiary}],selectedOption:n.isSubsidiary===!0?{label:je.customer.subsidiary,value:je.customer.subsidiary}:{label:je.customer.parent,value:je.customer.parent}},company:{selectedOption:i,allOptions:r.companies.map(d=>({label:d.companyInfo.name,value:d.companyInfo.companyId}))},realmId:n.qboRealmId??de.empty,confirmRealmId:n.qboRealmId??de.empty,chargebeeId:n.chargebeeId??de.empty,hubSpotId:n.hubSpotId??de.empty,email:n.email??de.empty,customerName:n.customerName??{firstName:de.empty,lastName:de.empty},products:{allOptions:cn(e.allProductsList,n.selectedProducts??[]),selectedOptions:n.selectedProducts??[]}},[ia]:{accountingConnectionCreationMode:n.accountingConnectionCreationMode}}},I3=s.div`
4330
+ `,Ur="onboardingCustomerPage",k3="companySection",rt="groupSection",De="customerSection",ia="qboConnectionSection",ho={labelWidth:new t.ResponsiveSized(120,180),largeLabelWidth:new t.ResponsiveSized(120,210,210),extraLargeLabelWidth:new t.ResponsiveSized(240,240,240),descriptionMarginBottom:new t.ResponsiveSized(20,t.sp[3]),titleFontSize:new t.ResponsiveSized(t.sp[3],18),titleLineHeight:new t.ResponsiveSized(t.sp[4],27),buttonWidth:new t.ResponsiveSized(135,135)},{cockpit:{onboarding:je},common:{no:T3,yes:L3,strings:de}}=t.appLocale.getLocalizedStrings();function P3({localData:e,screenType:n,qboConnectClicked:r,analytics:i,onOnboardingCustomerDataUpdated:a,onCloseClick:d,onSaveClick:l,onViewClick:c,onCompanyDomainBlurred:p,onNavigateToPreOnboarding:m,onQBOConnectClick:h}){const S=o.useTheme(),x=t.useWindowSizeContext(),C=ho.labelWidth.value(x),b=ho.largeLabelWidth.value(x),f=ho.extraLargeLabelWidth.value(x),g=o.useForm({mode:"all",reValidateMode:"onChange",defaultValues:u.useMemo(()=>go(e),[e])}),{emailGroupFetchState:j,newOnboardingCustomerLocalData:y,onboardingCompletedCompanies:$,isOnboardingAllowedForUser:w,fetchState:O,sendInviteFetchState:A,uiState:v,companyView:T,externalConnections:F}=e,[I,K]=u.useState(de.empty),[M,Y]=u.useState(de.empty),[G]=u.useState(de.empty),[E,P]=u.useState(de.empty),[W,k]=u.useState(de.empty),[D,z]=u.useState(!1),[Z,ie]=u.useState(!1),[N,H]=u.useState(je.customer.completePreOnboardingText),[L,Q]=u.useState(!1),se=u.useRef(null),X=u.useRef(null),re=u.useRef(null),{isExistingCustomer:te,isCustomerOnboardedSuccessfully:he}=N3(e),fe=te&&he?je.customer.customerNameExistInManagementText:je.customer.customerNameExistInOnboardingText,be=u.useMemo(()=>fe.replace("_company-domain_",y.companyEmailDomain??de.empty),[j.fetchState]),_=T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed,ee=u.useCallback(()=>{const me=g.getValues();return me[De].realmId!==me[De].confirmRealmId?(P(je.customer.realmIdWarning),g.trigger(`${De}.confirmRealmId`),!1):(P(de.empty),g.clearErrors(`${De}.confirmRealmId`),!0)},[g]),ge=u.useCallback(()=>{const me=g.getValues();return me[De].entityType.selectedOption?.value=="Subsidiary"&&me[De].company.selectedOption==null?(g.setError("customerSection.company",{type:"required"}),!1):(g.clearErrors("customerSection.company"),!0)},[g]),ve=u.useCallback(()=>y.customerName?.firstName&&!y.customerName?.lastName||!y.customerName?.firstName&&y.customerName?.lastName?(g.trigger(`${De}.customerName`),!1):(y.customerName?.firstName||y.customerName?.lastName)&&!y.email?(g.trigger(`${De}.email`),!1):(y.customerName?.firstName||y.customerName?.lastName)&&y.email&&y.selectedProducts?.length===0?(k(je.customer.productsWarning),g.trigger(`${De}.products`),!1):!0,[g,y.customerName,y.email,y.selectedProducts]),Re=u.useCallback(()=>ee()&&ge()&&ve(),[ge,ee,ve]),R=g.handleSubmit(()=>{H(je.customer.completePreOnboardingText),Re()&&ie(!0)},()=>{Re(),console.warn("Onboarding customer form error")}),Ce=g.getValues()[De].email??de.empty,ae=(me=!1)=>{const q={companyDomain:y.companyEmailDomain??de.empty,primaryContactEmail:Ce},Ne={groupName:y.groupName??de.empty,groupEmail:y.groupId??de.empty,groupDescription:y.groupDescription??de.empty},qe={firstName:y.customerName?.firstName??de.empty,lastName:y.customerName?.lastName??de.empty,customerEmail:Ce,companyName:y.name??de.empty,entittyType:y.isSubsidiary===!0?je.customer.subsidiary:je.customer.parent??de.empty,chargebeeId:y.chargebeeId??de.empty,products:y.selectedProducts??[],qboRealmId:y.qboRealmId??de.empty,hubSpotId:y.hubSpotId},He={isSendInvite:me,isInviteAlreadySent:T?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0,isZeniManagedQboConnectionSelected:y.accountingConnectionCreationMode==="zeni_user",isCustomerManagedQboConnectionSelected:y.accountingConnectionCreationMode==="customer",qboConnectionStatus:T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed??!1};i?.trackOnboardingSaveOrSendInvite(q,Ne,qe,He)},ce=()=>{const me={companyEmailDomain:y.companyEmailDomain??de.empty,primaryContactEmail:Ce},q={groupName:y.groupName??de.empty,groupEmail:y.groupId??de.empty,groupDescription:y.groupDescription??de.empty,isCompanyEmailDomainAvailable:!0};i?.trackOnboardingNewCustomerGroupCreationCheck(me,q)},$e=()=>{let me=!0;const q=g.getValues();if(q[rt].groupEmail!==de.empty&&q[rt].groupName===de.empty)K(je.customer.groupNameWarning),g.setError("groupSection.groupName",{type:"required"}),me=!1;else if(q[rt].groupName!==de.empty&&q[rt].groupEmail===de.empty)Y(je.customer.groupEmailWarning),g.setError("groupSection.groupEmail",{type:"required"}),me=!1;else{const{error:Ne}=g.getFieldState("groupSection.groupName"),{error:qe}=g.getFieldState("groupSection.groupEmail");(Ne==null||Ne.type==="required")&&(qe==null||qe.type==="required")&&(me=!1,g.clearErrors("groupSection")),K(de.empty),Y(de.empty)}return me},V={onOkClick:()=>{z(!1),g.reset(),d()},onCancelClick:()=>{z(!1)}},B={onOkClick:()=>{ie(!1),l(!0),ae(!0)},onCancelClick:()=>{ie(!1)}},pe=async(me,q)=>{const Ne={...q};if(me.includes("groupName")&&q[rt].groupName!=de.empty&&(q[rt].groupName=q[rt].groupName.charAt(0).toUpperCase()+q[rt].groupName.slice(1)),(me.includes("groupName")||me.includes("groupEmail"))&&$e(),me.includes("confirmRealmId")&&P(de.empty),me.includes("products")&&o.isEqual(y.selectedProducts??[],q[De].products.selectedOptions)===!1){k(de.empty);const qe=M3(y.selectedProducts??[],q[De].products.selectedOptions.map(Rt=>J.toProductTypeStrict(Rt)).filter(Rt=>Rt!=null));Ne[De].products.selectedOptions=qe;const He=ln(e.allProductsList,qe);g.setValue(`${De}.products`,{allOptions:He,selectedOptions:qe})}me.includes("realmId")&&o.has(g.formState.errors,`${De}.confirmRealmId`)&&g.trigger(`${De}.confirmRealmId`),a(Ne)},ye=me=>{const{dirtyFields:q}=g.formState;q.companySection?.companyDomain===!0&&p(me)},ke=()=>{Object.keys(g.formState.errors).length===0&&(m?.(),H(de.empty))},ue=()=>{j.fetchState==="Error"?p(y.companyEmailDomain):Re()&&Object.keys(g.formState.errors).length===0&&(l(A.fetchState==="Error"),ae())},U=()=>{Re()&&Object.keys(g.formState.errors).length===0&&(l(!1),ae())};u.useEffect(()=>{const me=g.watch((q,{name:Ne})=>{Ne!=null&&q!=null&&o.defer(()=>pe(Ne,q))});return()=>{me.unsubscribe()}}),u.useEffect(()=>{y.isCustomerCreationDisabled===!0&&(g.resetField("customerSection",{defaultValue:go(e)[De],keepDirty:!0}),g.clearErrors("customerSection"))},[y.isCustomerCreationDisabled]),u.useEffect(()=>{Q(y.isSubsidiary===!0),y.isSubsidiary!==!0&&g.resetField("customerSection.company",{defaultValue:go(e)[De].company,keepDirty:!0}),g.resetField("customerSection.entityType",{defaultValue:go(e)[De].entityType,keepDirty:!0})},[y.isSubsidiary]),u.useEffect(()=>{j.fetchState==="Completed"&&(g.reset(go(e)),te||ce())},[j.fetchState]),u.useEffect(()=>{v.selectedStep==="STEP_1"?se.current?.scrollIntoView():v.selectedStep==="STEP_2"?X.current?.scrollIntoView():v.selectedStep==="STEP_3"&&re.current?.scrollIntoView()},[]),u.useEffect(()=>{const me=T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed;if(F?.saveConnectionState==="Error"){const Ne={firstName:y.customerName?.firstName??de.empty,lastName:y.customerName?.lastName??de.empty,customerEmail:g.getValues()[De].email??de.empty,qboConnectionResponseMessage:je.qboErrorText,isSuccess:!1};i?.trackOnboardingZeniManagedQBOConnection(Ne)}else if(me??!1){const Ne={firstName:y.customerName?.firstName??de.empty,lastName:y.customerName?.lastName??de.empty,customerEmail:g.getValues()[De].email??de.empty,qboConnectionResponseMessage:je.qboSuccessText,isSuccess:!0};i?.trackOnboardingZeniManagedQBOConnection(Ne)}},[F?.saveConnectionState,T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed]),u.useEffect(()=>{if(y.accountingConnectionCreationMode){const me=T?.company.companyOnboardingInfo.onboardingInfo?.accountingConnectionCreationMode??de.empty;if(y.accountingConnectionCreationMode!==me){const q={firstName:y.customerName?.firstName??de.empty,lastName:y.customerName?.lastName??de.empty,customerEmail:g.getValues()[De].email??de.empty,isZeniOrCustomer:y.accountingConnectionCreationMode??de.empty};i?.trackOnboardingQBOConnectionSelected(q)}}},[y.accountingConnectionCreationMode]);const Oe=(me,q)=>{const{fetchState:Ne}=me,{isEmailGroupCreated:qe,selectedProducts:He}=q,Rt=Ne!=="Completed"&&qe==null,eo=He==null||He.length===0,Bt=(He?.includes("zeni_checking")===!0||He?.includes("zeni_treasury")===!0||He?.includes("zeni_cards")===!0||He?.includes("zeni_payroll")===!0||He?.includes("zeni_cfo")===!0||He?.includes("zeni_tax")===!0)&&He?.includes("bookkeeping")===!1;return Rt||eo||Bt},Pe=u.useMemo(()=>{const me=g.formState.isValid,q=y.selectedProducts!=null&&(y.selectedProducts.includes("zeni_payroll")===!0||y.selectedProducts.includes("zeni_cfo")===!0||y.selectedProducts.includes("zeni_tax")===!0),Ne=y.selectedProducts!=null&&(y.selectedProducts.includes("zeni_checking")===!0||y.selectedProducts.includes("zeni_cards")===!0||q)&&y.selectedProducts.includes("bookkeeping")===!1;return me!==!0||j.fetchState==="In-Progress"||j.fetchState==="Error"||O==="In-Progress"||O==="Error"||w!==!0||y.selectedProducts==null||y.selectedProducts.length===0||y.accountingConnectionCreationMode==null&&!Ne||y.accountingConnectionCreationMode==="zeni_user"&&_!==!0&&!Ne||j.fetchState==="Completed"&&te||T?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted===!0},[j.fetchState,te,w,O,g.formState.isValid,y.accountingConnectionCreationMode,_,y.selectedProducts,T?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted]),Fe=u.useMemo(()=>A.fetchState!=="In-Progress"&&A.fetchState!=="Error"&&O!=="In-Progress"&&O!=="Error"&&j.fetchState!=="In-Progress"&&te===!0,[j.fetchState,te,O,A.fetchState]);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[D===!0?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{children:je.discardTitle}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:je.discardDescription}),primaryButtonText:je.delete,secondaryButtonText:je.cancel,proceedButtonVariant:"destructive",action:V,style:{background:t.Colors.overlayDark}}):null,Z===!0?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{style:{paddingLeft:t.Space.sp6,paddingRight:t.Space.sp6},children:je.confirmationPopup.title}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:je.confirmationPopup.subTitle}),primaryButtonText:L3,secondaryButtonText:T3,action:B,style:{background:t.Colors.overlayDark}}):null,o.jsxRuntimeExports.jsx(t.NavBarWithClose,{title:n==="create"?je.customer.modalNewCustomerText:je.customer.modalEditCustomerText,backgroundColor:S.colors.grey5,style:{zIndex:4},onCloseClick:()=>{Object.keys(g.formState.dirtyFields).length>0?z(!0):(g.reset(),d())}}),o.jsxRuntimeExports.jsxs(I3,{children:[o.jsxRuntimeExports.jsx(D3,{children:je.customer.subTitle}),o.jsxRuntimeExports.jsx(o.FormProvider,{...g,children:o.jsxRuntimeExports.jsxs("form",{id:`${Ur}_form`,onSubmit:R,children:[o.jsxRuntimeExports.jsx(pf,{localData:e,labelWidth:C,onCompanyDomainBlurred:ye,primaryEmailDomainAdditionalLabel:G,isOnboardingAllowedForUser:w}),Fe===!0?o.jsxRuntimeExports.jsxs(Un,{children:[o.jsxRuntimeExports.jsxs(Hn,{children:[o.jsxRuntimeExports.jsxs(Hr,{children:[o.jsxRuntimeExports.jsx(Vn,{}),o.jsxRuntimeExports.jsx(t.StandardMedium,{children:je.customer.groupCreationError})]}),o.jsxRuntimeExports.jsx(O3,{children:be})]}),o.jsxRuntimeExports.jsx(t.Button,{style:{padding:`${t.Space.sp1} ${t.Space.sp2}`,backgroundColor:S.colors.champion,borderColor:S.colors.champion,color:S.mode==="light"?t.darkColors.primary:t.lightColors.primary,height:"30px",width:t.Space.sp7},label:je.customer.view,size:"small",onClick:()=>{c(he?"management":"onboarding")}})]}):null,j.fetchState==="Error"||O==="Error"||A.fetchState==="Error"&&e.error!=null&&e.error?.code!==406?o.jsxRuntimeExports.jsxs(Un,{children:[o.jsxRuntimeExports.jsx(Hn,{children:o.jsxRuntimeExports.jsxs(Hr,{children:[o.jsxRuntimeExports.jsx(Vn,{}),o.jsxRuntimeExports.jsx(t.LargeMedium,{children:je.customer.emailgroupAPIError})]})}),o.jsxRuntimeExports.jsx(t.Button,{style:{padding:`${t.Space.sp1} ${t.Space.sp2}`,backgroundColor:S.colors.champion,borderColor:S.colors.champion,color:S.mode==="light"?t.darkColors.primary:t.lightColors.primary},label:je.customer.tryAgainText,size:"small",onClick:ue})]}):null,A.fetchState==="Error"&&e.error!=null&&e.error?.code===406?o.jsxRuntimeExports.jsxs(Un,{children:[o.jsxRuntimeExports.jsx(Vn,{}),o.jsxRuntimeExports.jsxs(Hn,{children:[o.jsxRuntimeExports.jsx(t.LargeMedium,{children:N!==de.empty?je.customer.preOnboardingError:je.customer.preOnboardingSaveError}),N!==de.empty?o.jsxRuntimeExports.jsx(t.Button,{style:{padding:`${t.Space.sp1} ${t.Space.sp2}`,backgroundColor:S.colors.champion,borderColor:S.colors.champion,color:S.mode==="light"?t.darkColors.primary:t.lightColors.primary},label:N,size:"small",onClick:ke}):null]})]}):null,o.jsxRuntimeExports.jsx(ra,{groupEmailAdditionalLabel:M,groupNameAdditionalLabel:I,labelWidth:C,localData:e,ref:se,sectionId:rt}),o.jsxRuntimeExports.jsx(sa,{localData:e,onboardedCompanies:$.companies,isSubsidiary:L,labelWidth:C,largeLabelWidth:b,extraLargeLabelWidth:f,realmIdAdditionalLabel:E,productsAdditionalLabel:W,ref:X,sectionId:De,isDisabled:w===!1?"disabled":void 0}),o.jsxRuntimeExports.jsx(A3,{children:o.jsxRuntimeExports.jsx(x3,{isSectionDisabled:Oe(j,y),sectionId:ia,isLoading:r===!0||F?.fetchState==="In-Progress"||F?.saveConnectionState==="In-Progress",accountingConnectionCreationMode:e.newOnboardingCustomerLocalData.accountingConnectionCreationMode,onQBOConnectClick:h,isConnected:T?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed===!0,isInviteSent:T?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0||T?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted===!0,saveConnectionState:F?.saveConnectionState})})]})})]}),o.jsxRuntimeExports.jsx(t.Footer,{formId:`${Ur}_form`,primaryBtn:{label:T?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0?je.customer.resendInviteBtnText:je.customer.sendInviteBtnText,style:{width:ho.buttonWidth.value(x),display:"flex",alignItems:"center",justifyContent:"center"},isLoading:A.fetchState==="In-Progress",isDisabled:Pe},cancelBtn:{label:je.customer.saveBtnText,style:{width:ho.buttonWidth.value(x),display:"flex",alignItems:"center",justifyContent:"center"},isDisabled:!(t.formHasDirtyFields(g.formState.dirtyFields)||e.emailGroupFetchState.fetchState==="Completed"),isLoading:O==="In-Progress"&&r===!1,shouldResetOnCancel:!1,onClick:U,reverseSpinnerColor:!1}})]})}const go=e=>{const{newOnboardingCustomerLocalData:n,onboardingCompletedCompanies:r}=e;let i;const a=r.companies.find(d=>d.companyInfo.companyId===n.parentCompanyId);return a!=null&&(i={label:a.companyInfo.name,value:a.companyInfo.companyId}),{[k3]:{companyDomain:n.companyEmailDomain??de.empty},[rt]:{groupName:n.groupName??de.empty,groupEmail:n.groupId??de.empty,groupDescription:n.groupDescription??de.empty},[De]:{name:n.name??de.empty,entityType:{allOptions:[{label:je.customer.parent,value:je.customer.parent},{label:je.customer.subsidiary,value:je.customer.subsidiary}],selectedOption:n.isSubsidiary===!0?{label:je.customer.subsidiary,value:je.customer.subsidiary}:{label:je.customer.parent,value:je.customer.parent}},company:{selectedOption:i,allOptions:r.companies.map(d=>({label:d.companyInfo.name,value:d.companyInfo.companyId}))},realmId:n.qboRealmId??de.empty,confirmRealmId:n.qboRealmId??de.empty,chargebeeId:n.chargebeeId??de.empty,hubSpotId:n.hubSpotId??de.empty,email:n.email??de.empty,customerName:n.customerName??{firstName:de.empty,lastName:de.empty},products:{allOptions:ln(e.allProductsList,n.selectedProducts??[]),selectedOptions:n.selectedProducts??[]}},[ia]:{accountingConnectionCreationMode:n.accountingConnectionCreationMode}}},I3=s.div`
4331
4331
  display: flex;
4332
4332
  justify-content: flex-start;
4333
4333
  height: 100%;
@@ -4341,11 +4341,11 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
4341
4341
  display: flex;
4342
4342
  justify-content: center;
4343
4343
  padding: ${t.Space.sp3} ${t.Space.sp0} ${t.Space.sp7};
4344
- `,Un=s(t.SvgAlert)`
4344
+ `,Vn=s(t.SvgAlert)`
4345
4345
  color: ${t.Colors.important};
4346
4346
  width: ${t.Space.sp3};
4347
4347
  height: ${t.Space.sp3};
4348
- `,Hn=s.div`
4348
+ `,Un=s.div`
4349
4349
  display: flex;
4350
4350
  gap: ${t.Space.sp2};
4351
4351
  padding: ${t.Space.sp3};
@@ -4354,14 +4354,14 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
4354
4354
  border-radius: ${t.Space.sp2};
4355
4355
  align-items: center;
4356
4356
  justify-content: space-between;
4357
- `,Kn=s.div`
4357
+ `,Hn=s.div`
4358
4358
  display: flex;
4359
4359
  max-width: 95%;
4360
4360
  align-items: flex-start;
4361
4361
  flex-direction: column;
4362
4362
  `,A3=s.div`
4363
4363
  padding-bottom: ${t.Space.sp11};
4364
- `,Kr=s.div`
4364
+ `,Hr=s.div`
4365
4365
  display: flex;
4366
4366
  align-items: center;
4367
4367
  gap: ${t.Space.sp2};
@@ -4422,7 +4422,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
4422
4422
  `,X3=s(t.SvgArrowRight)`
4423
4423
  width: ${t.Space.sp4};
4424
4424
  height: ${t.Space.sp4};
4425
- `,aa=u.forwardRef(({highlight:e,auditSummaryData:n,isAuditScoreLoadingCompleted:r,onClickAuditScore:i},a)=>{const{cockpit:d,common:l,dateFormat:{visual:c}}=t.appLocale.getLocalizedStrings(),p=t.useWindowSizeContext(),m=n.auditSummary,h=!r||n.fetchState==="In-Progress"||n.fetchState==="Not-Started",S=o.useTheme();let x;return m.bypassedAuditScore<=50?x=t.Colors.important:m.bypassedAuditScore<=75?x=t.Colors.alert:x=t.Colors.success,o.jsxRuntimeExports.jsx(z3,{ref:a,highlight:e,isAuditScoreLoading:h,onClick:()=>!h&&i(),children:o.jsxRuntimeExports.jsxs(F3,{auditPercentage:m.bypassedAuditScore,children:[o.jsxRuntimeExports.jsxs(W3,{children:[h?o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Standard",start:h}):o.jsxRuntimeExports.jsx(B3,{children:o.jsxRuntimeExports.jsx(o.CircularProgressbar,{value:m.bypassedAuditScore,text:`${Math.ceil(m.bypassedAuditScore)}%`,strokeWidth:10,styles:o.buildStyles({rotation:.5,strokeLinecap:"butt",pathColor:x,textColor:S.colors.primary,trailColor:S.colors.grey3,textSize:t.Space.sp4})})}),o.jsxRuntimeExports.jsx(_3,{children:o.jsxRuntimeExports.jsxs(V3,{children:[o.jsxRuntimeExports.jsxs(U3,{children:[o.jsxRuntimeExports.jsx(H3,{children:h?d.monthEndReport.auditScoreSectionLoadingTitle.replace("__date__",ee.dateNow().subtract(1,"month").format(c.MMMMYYYYFormat)):d.monthEndReport.auditScoreSectionTitle}),h?null:o.jsxRuntimeExports.jsx(K3,{children:m.fixesRequired>0?`${l.strings.openingBrace}${m.fixesRequired} ${m.fixesRequired>1?l.texts.issues:l.texts.issue}${l.strings.closingBrace}`:l.strings.empty})]}),o.jsxRuntimeExports.jsx(G3,{children:o.jsxRuntimeExports.jsx(Y3,{children:h?d.review.auditReportDrawer.subTitle:d.monthEndReport.auditScoreSectionSubtitle})})]})})]}),h?null:o.jsxRuntimeExports.jsx(Z3,{windowSize:p,children:o.jsxRuntimeExports.jsx(X3,{width:t.Space.sp4,height:t.Space.sp4})})]})})});aa.displayName="MonthEndReportAuditSummarySection";const q3=[...ee.SUPPORTED_ATTACHMENT_FILE_TYPES],Q3=7*1024*100,J3=s.div`
4425
+ `,aa=u.forwardRef(({highlight:e,auditSummaryData:n,isAuditScoreLoadingCompleted:r,onClickAuditScore:i},a)=>{const{cockpit:d,common:l,dateFormat:{visual:c}}=t.appLocale.getLocalizedStrings(),p=t.useWindowSizeContext(),m=n.auditSummary,h=!r||n.fetchState==="In-Progress"||n.fetchState==="Not-Started",S=o.useTheme();let x;return m.bypassedAuditScore<=50?x=t.Colors.important:m.bypassedAuditScore<=75?x=t.Colors.alert:x=t.Colors.success,o.jsxRuntimeExports.jsx(z3,{ref:a,highlight:e,isAuditScoreLoading:h,onClick:()=>!h&&i(),children:o.jsxRuntimeExports.jsxs(F3,{auditPercentage:m.bypassedAuditScore,children:[o.jsxRuntimeExports.jsxs(W3,{children:[h?o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Standard",start:h}):o.jsxRuntimeExports.jsx(B3,{children:o.jsxRuntimeExports.jsx(o.CircularProgressbar,{value:m.bypassedAuditScore,text:`${Math.ceil(m.bypassedAuditScore)}%`,strokeWidth:10,styles:o.buildStyles({rotation:.5,strokeLinecap:"butt",pathColor:x,textColor:S.colors.primary,trailColor:S.colors.grey3,textSize:t.Space.sp4})})}),o.jsxRuntimeExports.jsx(_3,{children:o.jsxRuntimeExports.jsxs(V3,{children:[o.jsxRuntimeExports.jsxs(U3,{children:[o.jsxRuntimeExports.jsx(H3,{children:h?d.monthEndReport.auditScoreSectionLoadingTitle.replace("__date__",J.dateNow().subtract(1,"month").format(c.MMMMYYYYFormat)):d.monthEndReport.auditScoreSectionTitle}),h?null:o.jsxRuntimeExports.jsx(K3,{children:m.fixesRequired>0?`${l.strings.openingBrace}${m.fixesRequired} ${m.fixesRequired>1?l.texts.issues:l.texts.issue}${l.strings.closingBrace}`:l.strings.empty})]}),o.jsxRuntimeExports.jsx(G3,{children:o.jsxRuntimeExports.jsx(Y3,{children:h?d.review.auditReportDrawer.subTitle:d.monthEndReport.auditScoreSectionSubtitle})})]})})]}),h?null:o.jsxRuntimeExports.jsx(Z3,{windowSize:p,children:o.jsxRuntimeExports.jsx(X3,{width:t.Space.sp4,height:t.Space.sp4})})]})})});aa.displayName="MonthEndReportAuditSummarySection";const q3=[...J.SUPPORTED_ATTACHMENT_FILE_TYPES],Q3=7*1024*100,J3=s.div`
4426
4426
  width: ${t.FORM_MINIMUM_WIDTH}px;
4427
4427
  margin: ${t.Space.sp4} ${t.Space.sp0};
4428
4428
  `,eC=s.div`
@@ -4455,7 +4455,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
4455
4455
  margin-bottom: ${t.Space.sp3};
4456
4456
  `,nC=s.div`
4457
4457
  position: relative;
4458
- `,Gr=s(t.StandardRegular)`
4458
+ `,Kr=s(t.StandardRegular)`
4459
4459
  position: relative;
4460
4460
  `,sC=s.div`
4461
4461
  background-color: ${e=>e.theme.colors.grey5};
@@ -4525,7 +4525,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
4525
4525
  z-index: ${t.sp[2]};
4526
4526
  min-width: ${t.COMMENTS_SECTION_MINIMUM_WIDTH}px;
4527
4527
  max-width: ${t.COMMENTS_DRAWER_MAXIMUM_WIDTH}px;
4528
- `,Xt="monthEndReportFormSection",Yr="monthEndReportPage",ze=t.appLocale.getLocalizedStrings();function xC({companyId:e,enableZeniGPTFeature:n,enableSendingMonthEndEmail:r,monthEndReportView:i,previewMode:a,customerRequestData:d,allThreadsSectionOpen:l,filterMetaData:c,newThreadMetadata:p,isAuditScoreLoadingCompleted:m,improveUsingZeniGPTClick:h,onRemoveFileAttachment:S,onUpdateFileAttachment:x,onCloseAllThreadsSection:C,previewMonthEndReport:b,saveMonthEndReport:f,onEditClick:g,onOpenFileAttachmentSnackBar:j,onClickAuditScore:y,onClickCustomerRequest:$,sendMonthEndReport:w}){const O=o.useTheme(),[A,v]=u.useState(),[T,F]=u.useState(0),[I,K]=u.useState(0),M=u.useRef(),Y=u.useRef(null),G=u.useRef(null),E=u.useRef(null),{html:P,subject:W,improveUsingZeniGPTStatus:k}=i,[D,z]=u.useState(),[Z,ie]=u.useState(!1),[N,H]=u.useState(!1),[L,Q]=u.useState(!1),[se,X]=u.useState(!1),re=u.useRef(null),te=u.useRef(null),he=t.useDelayUnmount(l,250),fe=i.fetchState==="Not-Started"||i.fetchState==="In-Progress"||i.companyMonthEndReportTemplatesData.fetchState==="Not-Started"||i.companyMonthEndReportTemplatesData.fetchState==="In-Progress",{threadsRefs:be,sortedThreads:_,threadsPositions:J,observer:ge,unresolvedThreadsMap:ve,handleRemoveFloatingThread:Re}=t.useFloatingThreads(c,re,!a,fe),[R,Ce]=u.useState(0),ae=u.useCallback(()=>{const Ke=be.current?.[be.current?.length-1];Ce(window.scrollY+(Ke?.getBoundingClientRect()?.bottom??0))},[be]),ce=u.useCallback(()=>{l?K(Math.min((window.innerWidth-t.FORM_MINIMUM_WIDTH)/2,window.innerWidth-t.FORM_MINIMUM_WIDTH-t.COMMENTS_DRAWER_MAXIMUM_WIDTH-t.sp[4])):F(Math.min((window.innerWidth-t.FORM_MINIMUM_WIDTH)/2,window.innerWidth-t.FORM_MINIMUM_WIDTH-t.COMMENTS_SECTION_MINIMUM_WIDTH))},[l]);u.useEffect(()=>{ce()},[l,ce]),u.useEffect(()=>(window.addEventListener("resize",ce),()=>{window.removeEventListener("resize",ce)}),[ce]),u.useEffect(()=>(window.addEventListener("scroll",ae),()=>window.removeEventListener("scroll",ae)),[ae]);const{openThread:$e,addThread:V,setOpenThread:B}=u.useContext(t.ThreadsContext),pe=t.useHandleSelection(t.MONTH_END_REPORT_CANVAS,!1,!a),ye=re.current?.getBoundingClientRect(),ke=pe!=null&&pe.coords&&ye?{left:pe.coords.left-ye.left,top:pe.coords.top-ye.top}:void 0,ue=u.useCallback(()=>{const Ke=window.getSelection()?.getRangeAt(0),Me=t.getSelectionData();if(!Ke||Me==null)return;const Qe={...p,...Me,startPath:Me.startPath.join(),endPath:Me.endPath.join()},Je=`${o.nanoid()}${t.NEW_THREAD_SUFFIX}`,Rt=`cockpit_${e}`;V(Je,{type:"thread",id:Je,roomId:Rt,createdAt:new Date,updatedAt:new Date,comments:[],metadata:Qe,resolved:!1}),B(Je)},[V,e,p,B]),U=()=>{Q(!0),setTimeout(()=>{Q(!1)},2e3)};u.useEffect(()=>{$e!=null&&l&&C()},[l,$e,C]);const Oe=k.fetchState==="In-Progress",Pe=o.useForm({mode:"all",defaultValues:Zr(i),values:Zr(i)}),Fe=Pe.handleSubmit(Ke=>{const{recipientEmailList:Me,subject:Qe}=Ke[Xt],Je=i.auditSummaryData.auditSummary.bypassedAuditScore,Rt=i.auditSummaryData.isControllerOrReviewer;if(a===!0)Je>=75?w?.(D?.id):Je<75&&(Rt||r)&&X(!0);else if(Je>=75||Je<75&&(Rt||r)){const to=A?.replace(t.EMPTY_HTML_CHECKER,ze.common.strings.empty);Me!=null&&Qe!=null&&b(Me,Qe,D?.id,to!=null&&to.length>0?A:void 0)}else He()}),me=()=>{Y.current!=null&&Y.current.click()},q=()=>{D!==void 0&&D!=null&&(S([D.id]),z(void 0),ie(!1))},Ne=Ke=>{const Me=Ke.target.files?Ke.target.files[0]:null;if(Me)if(!ee.toSupportedAttachmentFileType(Me.type)||N)console.warn("Please select a valid file.");else{const Qe=new FileReader;Qe.onload=function(Je){const Rt=Je.target?.result;if(typeof Rt=="string"){const to={data:Rt.split(",")[1],name:Me.name,id:ee.getAttachmentFileIdByFileName(e,Me.name)};z(to),ie(!0),x([to])}},Qe.readAsDataURL(Me)}},qe=()=>{G.current&&G.current.scrollIntoView({behavior:"smooth"})},He=()=>{E.current&&(E.current.scrollIntoView({behavior:"smooth"}),U())},bt=()=>{const Ke=Pe.getValues(),{recipientEmailList:Me,subject:Qe}=Ke[Xt];Me!=null&&Qe!=null&&f(Me,Qe,D?.id,A)};u.useEffect(()=>{v(i.zeniRequestsHtml)},[i.zeniRequestsHtml]),u.useEffect(()=>{M.current=D},[D]),u.useEffect(()=>{z(ee.mapAttachmentFileToAttachmentFilePayload(i.attachmentFile)),ie(!1)},[i.attachmentFile]),u.useEffect(()=>{N&&j()},[N,j]);const eo=ee.dateNow().subtract(1,"month").format(ze.dateFormat.visual.MMMMFormat),Bt=P!=null?P.split(t.MONTH_END_EDITOR_PLACEHOLDER):[],ma=i.concatenatedHtml,xa=()=>i.lastDraftSavedDate!=null&&a===!1?o.jsxRuntimeExports.jsx(t.UserWithTimestamp,{time:i.lastDraftSavedDate,user:i.reportLastSavedByUser,timeStampLabel:ze.cockpit.monthEndReport.timeStampLabel}):null,ha={onOkClick:()=>{w?.(D?.id),X(!1),Pe.reset()},onCancelClick:()=>{g==null?X(!1):g(),X(!1)}};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(tC,{ref:te,style:R>0?{height:R}:void 0,children:[o.jsxRuntimeExports.jsx(eC,{availableWidth:l?I:T}),o.jsxRuntimeExports.jsxs(J3,{children:[o.jsxRuntimeExports.jsx(o.FormProvider,{...Pe,children:o.jsxRuntimeExports.jsx("form",{id:Xr(Yr),onSubmit:Fe,children:o.jsxRuntimeExports.jsxs(dC,{children:[o.jsxRuntimeExports.jsx(t.MonthEndReportSection,{sectionId:Xt,previewMode:a,subject:W}),a?null:o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(aa,{ref:E,highlight:L,onClickAuditScore:y,auditSummaryData:i.auditSummaryData,isAuditScoreLoadingCompleted:m}),o.jsxRuntimeExports.jsx(t.MonthEndReportCustomerRequestSection,{totalItems:(i.zeniRequestsData??[]).length+t.getTemplatesFromTemplatedData(i.companyMonthEndReportTemplatesData).length,onClickCustomerRequest:$})]}),o.jsxRuntimeExports.jsxs(sC,{id:t.MONTH_END_REPORT_CANVAS,ref:re,children:[o.jsxRuntimeExports.jsxs(rC,{className:"monthEndReportCanvasWrapper",children:[D!=null||N?o.jsxRuntimeExports.jsx(iC,{onClick:qe,children:o.jsxRuntimeExports.jsx(t.CircleWithAttachmentSuccessIcon,{fileSizeError:N,setFileSizeError:H,loading:!1,showAnimation:!a&&Z})}):null,a?o.jsxRuntimeExports.jsx(Gr,{dangerouslySetInnerHTML:{__html:t.getHTMLWithCommentingSections(ma)}}):o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(nC,{id:t.MONTH_END_EMAIL_HEADER_SECTION,children:[o.jsxRuntimeExports.jsx(t.StandardRegular,{dangerouslySetInnerHTML:{__html:Bt[0]!=null?Bt[0]+"</body></html>":ze.common.strings.empty}}),o.jsxRuntimeExports.jsxs(oC,{children:[o.jsxRuntimeExports.jsx(cC,{children:ze.cockpit.monthEndReport.editorTitle}),o.jsxRuntimeExports.jsx(lC,{children:ze.cockpit.monthEndReport.editorNote})]})]}),o.jsxRuntimeExports.jsx(aC,{id:t.MONTH_END_EMAIL_EDITOR_SECTION,children:o.jsxRuntimeExports.jsx(t.Editor,{handleFileInputClick:me,fileAttached:D!=null,enableZeniGPTFeature:n,isZeniGPTResponseLoading:Oe,initialHtmlString:i.zeniRequestsHtml,improveUsingZeniGPTClick:h,setZeniRequestsHtml:v,customerRequestData:d})}),o.jsxRuntimeExports.jsx(Gr,{id:t.MONTH_END_EMAIL_BODY_SECTION,dangerouslySetInnerHTML:{__html:Bt[1]!=null?"<html><body>"+Bt[1]:ze.common.strings.empty}})]}),D!=null?o.jsxRuntimeExports.jsx(t.FileAttachment,{ref:G,fileName:D.name,fileSize:t.base64FileSize(D.data),onRemove:q,isRemovable:!a}):null]}),ke?o.jsxRuntimeExports.jsx(t.AddThreadFloating,{style:{zIndex:15},coords:ke,alignment:pe.alignment,onClick:ue}):null,o.jsxRuntimeExports.jsx(t.TextHighlightSection,{canvasContainerRef:re,sortedThreads:_,editorMode:!a})]})]})})}),o.jsxRuntimeExports.jsx(t.FileInputElement,{name:D?.name??ze.common.strings.empty,fileRef:Y,sizeLimit:Q3,acceptableTypes:q3,onFileChange:async Ke=>{Ne(Ke)},onFileSizeError:Ke=>H(Ke),multiple:!1})]}),he?o.jsxRuntimeExports.jsx(mC,{allThreadsSectionOpen:l,children:o.jsxRuntimeExports.jsx(t.AllThreadsSection,{autoExpand:!0,autoFocus:!1,style:{borderLeft:`1px solid ${O.colors.grey3}`,boxShadow:`${t.Space.sp0} 1px 2px ${t.Space.sp0} ${t.Colors.boxShadowElevation}`},drawerSectionStyle:{width:`calc(100% - ${t.Space.sp5} - ${t.Space.sp5})`,backgroundColor:O.colors.background},threadsContainerStyle:{paddingBottom:a?"160px":t.Space.sp12},collapsibleThreadStyle:{width:`calc(100% - ${t.Space.sp4})`},allowComposer:!1,drawerTitle:ze.common.texts.comments,filter:c,textOverrides:{},preventResolvedThreadClick:!0,onThreadClick:(Ke,Me)=>{B(Me);const Qe=_.findIndex(Je=>Je[0]===Me);C(),be.current?.[Qe]?.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},onCloseAllThreadsDrawer:()=>C()})}):o.jsxRuntimeExports.jsx(t.FloatingThreads,{observer:ge,canvasContainerRef:re,sortedThreads:_,threadsPositions:J,threadsRefs:be,unresolvedThreadsMap:ve,editorMode:!a,style:{minWidth:`${t.COMMENTS_SECTION_MINIMUM_WIDTH}px`,position:"relative",height:"fit-content",width:"auto",top:`${re.current?.offsetTop}px`},handleRemoveFloatingThread:Re})]}),se?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{children:ze.cockpit.monthEndReport.sendMonthInsightsTitle.replace("__month__",eo)}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:ze.cockpit.monthEndReport.sendMonthInsightsDescription.replace("__month__",eo)}),primaryButtonText:ze.cockpit.monthEndReport.sendAnyway,primaryButtonWidth:150,proceedButtonVariant:"destructive",secondaryButtonWidth:150,secondaryButtonText:ze.cockpit.monthEndReport.editButtonLabel,action:ha}):null,o.jsxRuntimeExports.jsx(t.Footer,{style:{zIndex:10},leftSideComponent:xa(),formId:Xr(Yr),helperText:a===!0?ze.cockpit.monthEndReport.reportSentDateInfo:void 0,cancelBtn:{isDisabled:!m||Oe,label:a===!0?ze.cockpit.monthEndReport.editButtonLabel:ze.cockpit.monthEndReport.saveChanges,onClick:a===!0?g:bt,style:{width:"225px"},size:"medium",isLoading:i.saveMonthEndReportStatus.fetchState==="In-Progress",reverseSpinnerColor:!1},primaryBtn:{isDisabled:!m||Oe,isLoading:a===!0?i.sendMonthEndReportStatus.fetchState==="In-Progress":i.previewMonthEndReportStatus.fetchState==="In-Progress",style:{width:a===!0?"unset":"225px"},label:a===!0?ze.cockpit.monthEndReport.sendEmailButtonLabel.replace("__month__",eo):ze.cockpit.monthEndReport.preview,size:"medium"}})]})}const Zr=e=>({[Xt]:{recipientEmailList:e.recipientEmailList,subject:e.subject??ze.common.strings.empty}}),Xr=e=>`${e}_form`,hC=s(t.SmallRegular)`
4528
+ `,Xt="monthEndReportFormSection",Gr="monthEndReportPage",ze=t.appLocale.getLocalizedStrings();function xC({companyId:e,enableZeniGPTFeature:n,enableSendingMonthEndEmail:r,monthEndReportView:i,previewMode:a,customerRequestData:d,allThreadsSectionOpen:l,filterMetaData:c,newThreadMetadata:p,isAuditScoreLoadingCompleted:m,improveUsingZeniGPTClick:h,onRemoveFileAttachment:S,onUpdateFileAttachment:x,onCloseAllThreadsSection:C,previewMonthEndReport:b,saveMonthEndReport:f,onEditClick:g,onOpenFileAttachmentSnackBar:j,onClickAuditScore:y,onClickCustomerRequest:$,sendMonthEndReport:w}){const O=o.useTheme(),[A,v]=u.useState(),[T,F]=u.useState(0),[I,K]=u.useState(0),M=u.useRef(),Y=u.useRef(null),G=u.useRef(null),E=u.useRef(null),{html:P,subject:W,improveUsingZeniGPTStatus:k}=i,[D,z]=u.useState(),[Z,ie]=u.useState(!1),[N,H]=u.useState(!1),[L,Q]=u.useState(!1),[se,X]=u.useState(!1),re=u.useRef(null),te=u.useRef(null),he=t.useDelayUnmount(l,250),fe=i.fetchState==="Not-Started"||i.fetchState==="In-Progress"||i.companyMonthEndReportTemplatesData.fetchState==="Not-Started"||i.companyMonthEndReportTemplatesData.fetchState==="In-Progress",{threadsRefs:be,sortedThreads:_,threadsPositions:ee,observer:ge,unresolvedThreadsMap:ve,handleRemoveFloatingThread:Re}=t.useFloatingThreads(c,re,!a,fe),[R,Ce]=u.useState(0),ae=u.useCallback(()=>{const Ke=be.current?.[be.current?.length-1];Ce(window.scrollY+(Ke?.getBoundingClientRect()?.bottom??0))},[be]),ce=u.useCallback(()=>{l?K(Math.min((window.innerWidth-t.FORM_MINIMUM_WIDTH)/2,window.innerWidth-t.FORM_MINIMUM_WIDTH-t.COMMENTS_DRAWER_MAXIMUM_WIDTH-t.sp[4])):F(Math.min((window.innerWidth-t.FORM_MINIMUM_WIDTH)/2,window.innerWidth-t.FORM_MINIMUM_WIDTH-t.COMMENTS_SECTION_MINIMUM_WIDTH))},[l]);u.useEffect(()=>{ce()},[l,ce]),u.useEffect(()=>(window.addEventListener("resize",ce),()=>{window.removeEventListener("resize",ce)}),[ce]),u.useEffect(()=>(window.addEventListener("scroll",ae),()=>window.removeEventListener("scroll",ae)),[ae]);const{openThread:$e,addThread:V,setOpenThread:B}=u.useContext(t.ThreadsContext),pe=t.useHandleSelection(t.MONTH_END_REPORT_CANVAS,!1,!a),ye=re.current?.getBoundingClientRect(),ke=pe!=null&&pe.coords&&ye?{left:pe.coords.left-ye.left,top:pe.coords.top-ye.top}:void 0,ue=u.useCallback(()=>{const Ke=window.getSelection()?.getRangeAt(0),Me=t.getSelectionData();if(!Ke||Me==null)return;const Qe={...p,...Me,startPath:Me.startPath.join(),endPath:Me.endPath.join()},Je=`${o.nanoid()}${t.NEW_THREAD_SUFFIX}`,$t=`cockpit_${e}`;V(Je,{type:"thread",id:Je,roomId:$t,createdAt:new Date,updatedAt:new Date,comments:[],metadata:Qe,resolved:!1}),B(Je)},[V,e,p,B]),U=()=>{Q(!0),setTimeout(()=>{Q(!1)},2e3)};u.useEffect(()=>{$e!=null&&l&&C()},[l,$e,C]);const Oe=k.fetchState==="In-Progress",Pe=o.useForm({mode:"all",defaultValues:Yr(i),values:Yr(i)}),Fe=Pe.handleSubmit(Ke=>{const{recipientEmailList:Me,subject:Qe}=Ke[Xt],Je=i.auditSummaryData.auditSummary.bypassedAuditScore,$t=i.auditSummaryData.isControllerOrReviewer;if(a===!0)Je>=75?w?.(D?.id):Je<75&&($t||r)&&X(!0);else if(Je>=75||Je<75&&($t||r)){const to=A?.replace(t.EMPTY_HTML_CHECKER,ze.common.strings.empty);Me!=null&&Qe!=null&&b(Me,Qe,D?.id,to!=null&&to.length>0?A:void 0)}else He()}),me=()=>{Y.current!=null&&Y.current.click()},q=()=>{D!==void 0&&D!=null&&(S([D.id]),z(void 0),ie(!1))},Ne=Ke=>{const Me=Ke.target.files?Ke.target.files[0]:null;if(Me)if(!J.toSupportedAttachmentFileType(Me.type)||N)console.warn("Please select a valid file.");else{const Qe=new FileReader;Qe.onload=function(Je){const $t=Je.target?.result;if(typeof $t=="string"){const to={data:$t.split(",")[1],name:Me.name,id:J.getAttachmentFileIdByFileName(e,Me.name)};z(to),ie(!0),x([to])}},Qe.readAsDataURL(Me)}},qe=()=>{G.current&&G.current.scrollIntoView({behavior:"smooth"})},He=()=>{E.current&&(E.current.scrollIntoView({behavior:"smooth"}),U())},Rt=()=>{const Ke=Pe.getValues(),{recipientEmailList:Me,subject:Qe}=Ke[Xt];Me!=null&&Qe!=null&&f(Me,Qe,D?.id,A)};u.useEffect(()=>{v(i.zeniRequestsHtml)},[i.zeniRequestsHtml]),u.useEffect(()=>{M.current=D},[D]),u.useEffect(()=>{z(J.mapAttachmentFileToAttachmentFilePayload(i.attachmentFile)),ie(!1)},[i.attachmentFile]),u.useEffect(()=>{N&&j()},[N,j]);const eo=J.dateNow().subtract(1,"month").format(ze.dateFormat.visual.MMMMFormat),Bt=P!=null?P.split(t.MONTH_END_EDITOR_PLACEHOLDER):[],ma=i.concatenatedHtml,xa=()=>i.lastDraftSavedDate!=null&&a===!1?o.jsxRuntimeExports.jsx(t.UserWithTimestamp,{time:i.lastDraftSavedDate,user:i.reportLastSavedByUser,timeStampLabel:ze.cockpit.monthEndReport.timeStampLabel}):null,ha={onOkClick:()=>{w?.(D?.id),X(!1),Pe.reset()},onCancelClick:()=>{g==null?X(!1):g(),X(!1)}};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(tC,{ref:te,style:R>0?{height:R}:void 0,children:[o.jsxRuntimeExports.jsx(eC,{availableWidth:l?I:T}),o.jsxRuntimeExports.jsxs(J3,{children:[o.jsxRuntimeExports.jsx(o.FormProvider,{...Pe,children:o.jsxRuntimeExports.jsx("form",{id:Zr(Gr),onSubmit:Fe,children:o.jsxRuntimeExports.jsxs(dC,{children:[o.jsxRuntimeExports.jsx(t.MonthEndReportSection,{sectionId:Xt,previewMode:a,subject:W}),a?null:o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(aa,{ref:E,highlight:L,onClickAuditScore:y,auditSummaryData:i.auditSummaryData,isAuditScoreLoadingCompleted:m}),o.jsxRuntimeExports.jsx(t.MonthEndReportCustomerRequestSection,{totalItems:(i.zeniRequestsData??[]).length+t.getTemplatesFromTemplatedData(i.companyMonthEndReportTemplatesData).length,onClickCustomerRequest:$})]}),o.jsxRuntimeExports.jsxs(sC,{id:t.MONTH_END_REPORT_CANVAS,ref:re,children:[o.jsxRuntimeExports.jsxs(rC,{className:"monthEndReportCanvasWrapper",children:[D!=null||N?o.jsxRuntimeExports.jsx(iC,{onClick:qe,children:o.jsxRuntimeExports.jsx(t.CircleWithAttachmentSuccessIcon,{fileSizeError:N,setFileSizeError:H,loading:!1,showAnimation:!a&&Z})}):null,a?o.jsxRuntimeExports.jsx(Kr,{dangerouslySetInnerHTML:{__html:t.getHTMLWithCommentingSections(ma)}}):o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(nC,{id:t.MONTH_END_EMAIL_HEADER_SECTION,children:[o.jsxRuntimeExports.jsx(t.StandardRegular,{dangerouslySetInnerHTML:{__html:Bt[0]!=null?Bt[0]+"</body></html>":ze.common.strings.empty}}),o.jsxRuntimeExports.jsxs(oC,{children:[o.jsxRuntimeExports.jsx(cC,{children:ze.cockpit.monthEndReport.editorTitle}),o.jsxRuntimeExports.jsx(lC,{children:ze.cockpit.monthEndReport.editorNote})]})]}),o.jsxRuntimeExports.jsx(aC,{id:t.MONTH_END_EMAIL_EDITOR_SECTION,children:o.jsxRuntimeExports.jsx(t.Editor,{handleFileInputClick:me,fileAttached:D!=null,enableZeniGPTFeature:n,isZeniGPTResponseLoading:Oe,initialHtmlString:i.zeniRequestsHtml,improveUsingZeniGPTClick:h,setZeniRequestsHtml:v,customerRequestData:d})}),o.jsxRuntimeExports.jsx(Kr,{id:t.MONTH_END_EMAIL_BODY_SECTION,dangerouslySetInnerHTML:{__html:Bt[1]!=null?"<html><body>"+Bt[1]:ze.common.strings.empty}})]}),D!=null?o.jsxRuntimeExports.jsx(t.FileAttachment,{ref:G,fileName:D.name,fileSize:t.base64FileSize(D.data),onRemove:q,isRemovable:!a}):null]}),ke?o.jsxRuntimeExports.jsx(t.AddThreadFloating,{style:{zIndex:15},coords:ke,alignment:pe.alignment,onClick:ue}):null,o.jsxRuntimeExports.jsx(t.TextHighlightSection,{canvasContainerRef:re,sortedThreads:_,editorMode:!a})]})]})})}),o.jsxRuntimeExports.jsx(t.FileInputElement,{name:D?.name??ze.common.strings.empty,fileRef:Y,sizeLimit:Q3,acceptableTypes:q3,onFileChange:async Ke=>{Ne(Ke)},onFileSizeError:Ke=>H(Ke),multiple:!1})]}),he?o.jsxRuntimeExports.jsx(mC,{allThreadsSectionOpen:l,children:o.jsxRuntimeExports.jsx(t.AllThreadsSection,{autoExpand:!0,autoFocus:!1,style:{borderLeft:`1px solid ${O.colors.grey3}`,boxShadow:`${t.Space.sp0} 1px 2px ${t.Space.sp0} ${t.Colors.boxShadowElevation}`},drawerSectionStyle:{width:`calc(100% - ${t.Space.sp5} - ${t.Space.sp5})`,backgroundColor:O.colors.background},threadsContainerStyle:{paddingBottom:a?"160px":t.Space.sp12},collapsibleThreadStyle:{width:`calc(100% - ${t.Space.sp4})`},allowComposer:!1,drawerTitle:ze.common.texts.comments,filter:c,textOverrides:{},preventResolvedThreadClick:!0,onThreadClick:(Ke,Me)=>{B(Me);const Qe=_.findIndex(Je=>Je[0]===Me);C(),be.current?.[Qe]?.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},onCloseAllThreadsDrawer:()=>C()})}):o.jsxRuntimeExports.jsx(t.FloatingThreads,{observer:ge,canvasContainerRef:re,sortedThreads:_,threadsPositions:ee,threadsRefs:be,unresolvedThreadsMap:ve,editorMode:!a,style:{minWidth:`${t.COMMENTS_SECTION_MINIMUM_WIDTH}px`,position:"relative",height:"fit-content",width:"auto",top:`${re.current?.offsetTop}px`},handleRemoveFloatingThread:Re})]}),se?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{children:ze.cockpit.monthEndReport.sendMonthInsightsTitle.replace("__month__",eo)}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:ze.cockpit.monthEndReport.sendMonthInsightsDescription.replace("__month__",eo)}),primaryButtonText:ze.cockpit.monthEndReport.sendAnyway,primaryButtonWidth:124,secondaryButtonWidth:124,proceedButtonVariant:"destructive",secondaryButtonText:ze.cockpit.monthEndReport.editButtonLabel,action:ha,containerStyle:{minWidth:356}}):null,o.jsxRuntimeExports.jsx(t.Footer,{style:{zIndex:10},leftSideComponent:xa(),formId:Zr(Gr),helperText:a===!0?ze.cockpit.monthEndReport.reportSentDateInfo:void 0,cancelBtn:{isDisabled:!m||Oe,label:a===!0?ze.cockpit.monthEndReport.editButtonLabel:ze.cockpit.monthEndReport.saveChanges,onClick:a===!0?g:Rt,style:{width:"225px"},size:"medium",isLoading:i.saveMonthEndReportStatus.fetchState==="In-Progress",reverseSpinnerColor:!1},primaryBtn:{isDisabled:!m||Oe,isLoading:a===!0?i.sendMonthEndReportStatus.fetchState==="In-Progress":i.previewMonthEndReportStatus.fetchState==="In-Progress",style:{width:a===!0?"unset":"225px"},label:a===!0?ze.cockpit.monthEndReport.sendEmailButtonLabel.replace("__month__",eo):ze.cockpit.monthEndReport.preview,size:"medium"}})]})}const Yr=e=>({[Xt]:{recipientEmailList:e.recipientEmailList,subject:e.subject??ze.common.strings.empty}}),Zr=e=>`${e}_form`,hC=s(t.SmallRegular)`
4529
4529
  color: ${e=>e.theme.colors.hero};
4530
4530
  display: flex;
4531
4531
  align-items: center;
@@ -4623,7 +4623,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
4623
4623
  `,TC=s(t.SvgReload)`
4624
4624
  width: ${t.Space.sp10};
4625
4625
  height: ${t.Space.sp10};
4626
- `,{dateFormat:LC,card:PC,cockpit:IC}=t.appLocale.getLocalizedStrings(),qr=({message:e,onReload:n})=>o.jsxRuntimeExports.jsxs(kC,{onClick:n,children:[o.jsxRuntimeExports.jsx(TC,{}),o.jsxRuntimeExports.jsx(vC,{children:e})]}),DC=e=>{const{monthEndReportView:n,companyId:r,previewMode:i,onRefresh:a,onNavigateBack:d}=e,{openThread:l,setOpenThread:c}=u.useContext(t.ThreadsContext),p=ee.dateNow().subtract(1,"month").format(LC.visual.MMSlashYYYYFormat),[m,h]=u.useState(!1);if(n.fetchState==="Not-Started"||n.fetchState==="In-Progress"||n.companyMonthEndReportTemplatesData.fetchState==="Not-Started"||n.companyMonthEndReportTemplatesData.fetchState==="In-Progress")return o.jsxRuntimeExports.jsx(qo,{children:o.jsxRuntimeExports.jsx(wC,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})})});if(n.fetchState==="Error"||n.companyMonthEndReportTemplatesData.fetchState==="Error")return o.jsxRuntimeExports.jsx(qo,{children:o.jsxRuntimeExports.jsx(qr,{onReload:a,message:PC.failedText})});if(n.html==null)return o.jsxRuntimeExports.jsx(qo,{children:o.jsxRuntimeExports.jsx(qr,{onReload:a,message:IC.monthEndReport.insightsNotAvailable})});const S={application:"cockpit",companyId:r,entityId:r,tab:"management",isGlobalComment:!1,entityType:"management.monthEndEmail",companyName:n.companyName,url:window.location.href,selectedRange:p},{url:x,...C}=S,b={...C},f=`cockpit_${r}`;return o.jsxRuntimeExports.jsx(Ze.RoomProvider,{id:f,children:o.jsxRuntimeExports.jsxs(qo,{children:[o.jsxRuntimeExports.jsx(la,{companyName:n.companyName,threadMetadata:b,onAllThreadsClick:()=>{l!=null&&c(null),h(!0)},onNavigateBack:d,onRefresh:a}),o.jsxRuntimeExports.jsx(xC,{...e,allThreadsSectionOpen:m,filterMetaData:b,newThreadMetadata:S,onCloseAllThreadsSection:()=>h(!1)},i.toString())]})})},Gn=s.div`
4626
+ `,{dateFormat:LC,card:PC,cockpit:IC}=t.appLocale.getLocalizedStrings(),Xr=({message:e,onReload:n})=>o.jsxRuntimeExports.jsxs(kC,{onClick:n,children:[o.jsxRuntimeExports.jsx(TC,{}),o.jsxRuntimeExports.jsx(vC,{children:e})]}),DC=e=>{const{monthEndReportView:n,companyId:r,previewMode:i,onRefresh:a,onNavigateBack:d}=e,{openThread:l,setOpenThread:c}=u.useContext(t.ThreadsContext),p=J.dateNow().subtract(1,"month").format(LC.visual.MMSlashYYYYFormat),[m,h]=u.useState(!1);if(n.fetchState==="Not-Started"||n.fetchState==="In-Progress"||n.companyMonthEndReportTemplatesData.fetchState==="Not-Started"||n.companyMonthEndReportTemplatesData.fetchState==="In-Progress")return o.jsxRuntimeExports.jsx(qo,{children:o.jsxRuntimeExports.jsx(wC,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})})});if(n.fetchState==="Error"||n.companyMonthEndReportTemplatesData.fetchState==="Error")return o.jsxRuntimeExports.jsx(qo,{children:o.jsxRuntimeExports.jsx(Xr,{onReload:a,message:PC.failedText})});if(n.html==null)return o.jsxRuntimeExports.jsx(qo,{children:o.jsxRuntimeExports.jsx(Xr,{onReload:a,message:IC.monthEndReport.insightsNotAvailable})});const S={application:"cockpit",companyId:r,entityId:r,tab:"management",isGlobalComment:!1,entityType:"management.monthEndEmail",companyName:n.companyName,url:window.location.href,selectedRange:p},{url:x,...C}=S,b={...C},f=`cockpit_${r}`;return o.jsxRuntimeExports.jsx(Ze.RoomProvider,{id:f,children:o.jsxRuntimeExports.jsxs(qo,{children:[o.jsxRuntimeExports.jsx(la,{companyName:n.companyName,threadMetadata:b,onAllThreadsClick:()=>{l!=null&&c(null),h(!0)},onNavigateBack:d,onRefresh:a}),o.jsxRuntimeExports.jsx(xC,{...e,allThreadsSectionOpen:m,filterMetaData:b,newThreadMetadata:S,onCloseAllThreadsSection:()=>h(!1)},i.toString())]})})},Kn=s.div`
4627
4627
  display: flex;
4628
4628
  justify-content: flex-end;
4629
4629
  align-items: center;
@@ -4654,13 +4654,13 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
4654
4654
  position: absolute;
4655
4655
  top: ${t.Space.sp4}; // Attachment icon position from the top
4656
4656
  right: -${t.Space.sp3}; // To show attachment icon on the edge
4657
- `,Yn=s.div`
4657
+ `,Gn=s.div`
4658
4658
  height: 100vh;
4659
4659
  display: flex;
4660
4660
  background-color: ${e=>e.theme.colors.grey4};
4661
4661
  justify-content: center;
4662
4662
  flex-direction: column;
4663
- `,Zn=s(t.SvgClose)`
4663
+ `,Yn=s(t.SvgClose)`
4664
4664
  width: ${t.Space.sp3};
4665
4665
  height: ${t.Space.sp3};
4666
4666
  margin-right: ${t.Space.sp8};
@@ -4746,7 +4746,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
4746
4746
  padding-bottom: ${t.Space.sp5};
4747
4747
  `,GC=s(t.ExtraSmallRegular)`
4748
4748
  color: ${e=>e.theme.colors.grey1};
4749
- `,{common:{strings:Qo,datePicker:YC,texts:ZC},dateFormat:Jo,cockpit:XC,card:qC}=t.appLocale.getLocalizedStrings(),QC=({historicData:e,companyId:n,newThreadMetadata:r,containerRef:i,sortedThreads:a})=>{const{addThread:d,setOpenThread:l}=u.useContext(t.ThreadsContext),c=u.useRef(null),[p,m]=u.useState(),[h,S]=u.useState(!1),x="monthEndReportHistoricDataPage",C=t.useHandleSelection(t.MONTH_END_REPORT_CANVAS,!1,!1),b=i.current?.getBoundingClientRect(),f=C!=null&&C.coords!=null&&b?{left:C.coords.left-b.left,top:C.coords.top-b.top}:void 0,g=o.useForm({mode:"all",defaultValues:Qr(e),values:Qr(e)}),j=()=>{c.current&&c.current.scrollIntoView({behavior:"smooth"})};u.useEffect(()=>{m(ee.mapAttachmentFileToAttachmentFilePayload(e.attachmentFile))},[e.attachmentFile]);const y=u.useCallback(()=>{const $=window.getSelection()?.getRangeAt(0),w=t.getSelectionData();if(!$||w==null)return;const O={...r,...w,startPath:w.startPath.join(),endPath:w.endPath.join()},A=`${o.nanoid()}${t.NEW_THREAD_SUFFIX}`,v=`cockpit_${n}`;d(A,{type:"thread",id:A,roomId:v,createdAt:new Date,updatedAt:new Date,comments:[],metadata:O,resolved:!1}),l(A)},[d,n,r,l]);return o.jsxRuntimeExports.jsx(o.FormProvider,{...g,children:o.jsxRuntimeExports.jsx("form",{id:ej(x),children:o.jsxRuntimeExports.jsxs(UC,{children:[o.jsxRuntimeExports.jsx(t.MonthEndReportSection,{previewMode:!0,subject:e.subject,sectionId:Xt}),o.jsxRuntimeExports.jsxs(AC,{id:t.MONTH_END_REPORT_CANVAS,ref:i,children:[o.jsxRuntimeExports.jsxs(OC,{className:"monthEndReportCanvasWrapper",children:[p!=null?o.jsxRuntimeExports.jsx(NC,{onClick:j,children:o.jsxRuntimeExports.jsx(t.CircleWithAttachmentSuccessIcon,{loading:!1,fileSizeError:h,setFileSizeError:S})}):null,o.jsxRuntimeExports.jsx(t.StandardRegular,{style:{position:"relative"},dangerouslySetInnerHTML:{__html:t.getHTMLWithCommentingSections(e.concatenatedHtml)}}),p!=null?o.jsxRuntimeExports.jsx(t.FileAttachment,{ref:c,fileName:p.name,fileSize:t.base64FileSize(p.data),isRemovable:!1}):null]}),f?o.jsxRuntimeExports.jsx(t.AddThreadFloating,{style:{zIndex:15},coords:f,alignment:C.alignment,onClick:y}):null,o.jsxRuntimeExports.jsx(t.TextHighlightSection,{canvasContainerRef:i,sortedThreads:a,editorMode:!1})]})]})})})},JC=e=>{const{monthEndReportHistoricData:n,reportSentDate:r,onRefresh:i,onNavigateBack:a,onDateChange:d}=e,l=o.useTheme(),[c,p]=u.useState(!1),[m,h]=u.useState(),S=u.useRef(null),[x,C]=u.useState(0),[b,f]=u.useState(0),g=t.useDelayUnmount(c,250),{data:j,companyId:y,companyName:$,firstMonthOfFY:w}=n,O=t.getMonthIndex(r.format(Jo.visual.MMMMFormat)),A=Number(r.format(Jo.visual.YYYYformat)),v=w>O?A-1:A;u.useEffect(()=>{const re=O>0?O-1:12;h(`${o.padStart(re.toString(),2,"0")}${Qo.backspace}${A}`)},[]);const T={application:"cockpit",companyId:y,entityId:y,tab:"management",isGlobalComment:!1,entityType:"management.monthEndEmail",companyName:$,url:window.location.href,selectedRange:m},{url:F,...I}=T,K={...I},M=n.fetchState==="Not-Started"||n.fetchState==="In-Progress",{threadsRefs:Y,sortedThreads:G,threadsPositions:E,observer:P,unresolvedThreadsMap:W,handleRemoveFloatingThread:k}=t.useFloatingThreads(K,S,!1,M),D=u.useRef(null),[z,Z]=u.useState(0),ie=u.useCallback(()=>{const re=Y.current?.[Y.current?.length-1];Z(window.scrollY+(re?.getBoundingClientRect()?.bottom??0))},[Y]),N=u.useCallback(()=>{c?f(Math.min((window.innerWidth-t.FORM_MINIMUM_WIDTH)/2,window.innerWidth-t.FORM_MINIMUM_WIDTH-t.COMMENTS_DRAWER_MAXIMUM_WIDTH-t.sp[4])):C(Math.min((window.innerWidth-t.FORM_MINIMUM_WIDTH)/2,window.innerWidth-t.FORM_MINIMUM_WIDTH-t.COMMENTS_SECTION_MINIMUM_WIDTH))},[c]);u.useEffect(()=>{N()},[c,N]),u.useEffect(()=>(window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N)}),[N]),u.useEffect(()=>(window.addEventListener("scroll",ie),()=>window.removeEventListener("scroll",ie)),[ie]);const{openThread:H,setOpenThread:L}=u.useContext(t.ThreadsContext);u.useEffect(()=>{H!=null&&c&&p(!1)},[c,H,p]);const Q=t.getHistoricMonthsList(w,n.historicReportSentDates),se=u.useCallback((re,te)=>{const he=w>re?te+1:te;d(ee.dateFromYearMonthDate(he,re-1));const fe=re>0?re-1:12;h(`${o.padStart(fe.toString(),2,"0")}${Qo.backspace}${he}`)},[w,d]);if(n.fetchState==="Not-Started"||n.fetchState==="In-Progress")return o.jsxRuntimeExports.jsxs(Yn,{children:[o.jsxRuntimeExports.jsx(Gn,{children:o.jsxRuntimeExports.jsx(Zn,{onClick:a})}),o.jsxRuntimeExports.jsx(t.BusyIndication,{fetchState:n.fetchState,styles:{margin:t.Space.sp0}})]});if(n.fetchState==="Error")return o.jsxRuntimeExports.jsxs(Yn,{children:[o.jsxRuntimeExports.jsx(Gn,{children:o.jsxRuntimeExports.jsx(Zn,{onClick:a})}),o.jsxRuntimeExports.jsx(t.ReloadContainer,{onReload:i,message:qC.failedText})]});if(j?.concatenatedHtml==null)return o.jsxRuntimeExports.jsxs(Yn,{children:[o.jsxRuntimeExports.jsx(Gn,{children:o.jsxRuntimeExports.jsx(Zn,{onClick:a})}),o.jsxRuntimeExports.jsx(t.ReloadContainer,{onReload:i,message:XC.monthEndReport.insightsNotAvailable})]});const X=`cockpit_${y}`;return o.jsxRuntimeExports.jsx(Ze.RoomProvider,{id:X,children:o.jsxRuntimeExports.jsxs(MC,{children:[o.jsxRuntimeExports.jsx(la,{companyName:n.companyName,onNavigateBack:a,monthCalendar:{monthAndYears:Q,label:`${r.format(Jo.visual.MMMformat)} ${v}`,selectedMonth:{month:O,year:v},onChange:se},threadMetadata:K,onAllThreadsClick:()=>{H!=null&&L(null),p(!0)}}),o.jsxRuntimeExports.jsxs(_C,{ref:D,style:z>0?{height:z}:void 0,children:[o.jsxRuntimeExports.jsx(zC,{availableWidth:c?b:x}),o.jsxRuntimeExports.jsxs(VC,{children:[o.jsxRuntimeExports.jsx(QC,{historicData:j,newThreadMetadata:T,companyId:y,sortedThreads:G,containerRef:S}),o.jsxRuntimeExports.jsxs(KC,{children:[o.jsxRuntimeExports.jsx(yi,{user:n.reportLastSentByUser}),o.jsxRuntimeExports.jsx(HC,{}),o.jsxRuntimeExports.jsxs(GC,{children:[YC.businessDay,Qo.space,n.data?.reportSentDate!=null?ee.getBusinessDayOfDate(n.data.reportSentDate):null,":",Qo.space,n.data?.reportSentDate?.format(Jo.visual.MMMDFormat)]})]})]}),g?o.jsxRuntimeExports.jsx(BC,{allThreadsSectionOpen:c,children:o.jsxRuntimeExports.jsx(t.AllThreadsSection,{autoExpand:!0,autoFocus:!1,style:{borderLeft:`1px solid ${l.colors.grey3}`,boxShadow:`${t.Space.sp0} 1px 2px ${t.Space.sp0} ${t.Colors.boxShadowElevation}`},drawerSectionStyle:{width:`calc(100% - ${t.Space.sp5} - ${t.Space.sp5})`,backgroundColor:l.colors.background},threadsContainerStyle:{paddingBottom:t.Space.sp5},collapsibleThreadStyle:{width:`calc(100% - ${t.Space.sp4})`},allowComposer:!1,drawerTitle:ZC.comments,filter:K,textOverrides:{},preventResolvedThreadClick:!0,onThreadClick:(re,te)=>{L(te);const he=G.findIndex(fe=>fe[0]===te);p(!1),Y.current?.[he]?.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},onCloseAllThreadsDrawer:()=>p(!1)})}):o.jsxRuntimeExports.jsx(t.FloatingThreads,{observer:P,canvasContainerRef:S,sortedThreads:G,threadsPositions:E,threadsRefs:Y,unresolvedThreadsMap:W,editorMode:!1,style:{minWidth:`${t.COMMENTS_SECTION_MINIMUM_WIDTH}px`,position:"relative",height:"fit-content",width:"auto",top:`${S.current?.offsetTop}px`},handleRemoveFloatingThread:k})]})]})})},Qr=e=>({[Xt]:{recipientEmailList:e.recipientEmailList??[],subject:e.subject??""}}),ej=e=>`${e}_form`,tj=e=>le.createElement("svg",{width:98,height:121,viewBox:"0 0 98 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M49.2796 0.921875C32.9744 0.921875 19.7096 14.1944 19.7096 30.5087C19.7125 35.7639 21.1132 40.9238 23.7681 45.459C26.423 49.9943 30.2365 53.7418 34.8175 56.317C34.4083 56.561 33.9588 56.7299 33.4901 56.8156C26.6518 57.6437 22.4965 58.8342 19.5952 60.7958C16.8429 62.6568 15.2375 65.1511 14.0552 69.4056C14.0509 69.4209 14.0466 69.4363 14.0431 69.4518L10.0918 85.7362C9.51826 88.1132 9.82738 90.6176 10.9617 92.7837C12.0961 94.9499 13.9785 96.6304 16.2589 97.5129L20.1569 99.0144H10.7796C7.99797 99.0144 5.33033 100.119 3.36345 102.086C1.39658 104.053 0.291567 106.721 0.291504 109.502V110.435C0.291815 113.216 1.39693 115.884 3.36378 117.85C5.33063 119.817 7.99813 120.922 10.7796 120.922H53.2747C53.6551 120.922 54.0199 120.771 54.2889 120.502C54.5579 120.233 54.709 119.868 54.709 119.488C54.709 119.107 54.5579 118.742 54.2889 118.473C54.0199 118.204 53.6551 118.053 53.2747 118.053H34.0289C38.6739 116.234 43.0832 113.862 47.1618 110.989C59.9371 101.998 69.4844 101.883 69.5755 101.883H86.6115C88.6324 101.883 90.5704 102.686 91.9994 104.115C93.4283 105.544 94.2311 107.482 94.2311 109.502V110.435C94.2308 112.455 93.4279 114.393 91.999 115.822C90.5701 117.251 88.6322 118.053 86.6115 118.053H62.8365C62.4561 118.053 62.0913 118.204 61.8223 118.473C61.5533 118.742 61.4022 119.107 61.4022 119.488C61.4022 119.868 61.5533 120.233 61.8223 120.502C62.0913 120.771 62.4561 120.922 62.8365 120.922H86.6115C89.3932 120.922 92.0609 119.817 94.0278 117.85C95.9947 115.883 97.0996 113.215 97.0996 110.433V109.501C97.0996 106.72 95.9947 104.052 94.0278 102.085C92.0609 100.118 89.3932 99.013 86.6115 99.013H77.2552L81.1289 97.5124C83.4101 96.6305 85.2933 94.95 86.4283 92.7836C87.5633 90.6172 87.8728 88.1123 87.2993 85.7348L83.3471 69.4504C83.3435 69.4349 83.3393 69.42 83.335 69.4047C81.0779 61.2834 76.7211 58.4595 63.9108 56.8156C63.6617 56.7812 63.4178 56.7159 63.1848 56.6214C67.9202 54.1003 71.88 50.3378 74.6396 45.7373C77.3993 41.1368 78.8546 35.872 78.8496 30.5073C78.8496 14.1942 65.5848 0.921875 49.2796 0.921875ZM50.0808 3.84176C56.084 4.02211 61.8511 6.22111 66.4504 10.0835C71.0497 13.9459 74.2125 19.2461 75.4278 25.1278C76.6431 31.0094 75.84 37.1291 73.1483 42.498C70.4565 47.867 66.0332 52.1716 60.5931 54.7165C59.1024 53.1795 57.8049 51.1354 57.3184 49.7456C58.4778 48.8954 59.4906 47.8615 60.3167 46.6848C60.9625 46.9809 61.6621 47.1419 62.3724 47.1577C62.8095 47.1603 63.2432 47.0811 63.6512 46.9243C64.5464 46.5762 65.7044 45.6681 66.1373 43.3181C66.2624 42.9869 66.4272 42.6721 66.628 42.3806L66.7279 42.2148C68.7825 38.8099 69.2671 36.263 68.2103 34.43C67.7877 33.7064 67.1417 33.1394 66.3694 32.8142C66.4922 32.3725 66.5552 31.9163 66.5566 31.4579V29.7934C66.5566 24.4319 64.183 20.499 58.861 17.0401C58.612 16.8783 58.3989 16.667 58.235 16.4194C58.071 16.1718 57.9598 15.8931 57.9081 15.6007C57.125 11.0899 54.1033 8.50358 49.6158 8.50358H49.613C42.7338 8.50525 41.4374 13.4875 41.1983 15.6301C41.1628 15.9531 41.0576 16.2647 40.8901 16.5432C40.7227 16.8217 40.4968 17.0607 40.2282 17.2436C36.7881 19.5877 32.8393 23.1325 32.8393 29.7934V31.4579C32.8389 31.9742 32.9165 32.4876 33.0695 32.9808C32.4212 33.2864 31.8789 33.7785 31.5119 34.3941C30.4489 36.1843 30.9504 38.7427 33.0456 42.2153L33.133 42.36C33.3398 42.6607 33.5094 42.9854 33.6381 43.3269C33.9878 45.1621 34.9709 46.0635 35.7344 46.4966C36.4514 46.8873 37.2576 47.0851 38.074 47.0704C38.4264 47.0695 38.7782 47.0401 39.1259 46.9826C39.7172 47.7756 40.3958 48.4996 41.1489 49.141C40.3987 51.1167 38.8989 53.0103 37.368 54.4238C32.9251 52.2043 29.188 48.7913 26.5758 44.5673C23.9635 40.3432 22.5793 35.4752 22.5781 30.5087C22.5811 26.9366 23.3008 23.4015 24.6945 20.1126C26.0883 16.8237 28.1278 13.8479 30.6922 11.3613C33.2567 8.87477 36.294 6.92806 39.6244 5.63643C42.9547 4.34481 46.5104 3.73454 50.0808 3.84176V3.84176ZM49.6125 11.3716H49.6148C52.6985 11.3716 54.5375 12.9592 55.0811 16.0909C55.2008 16.7719 55.4592 17.4211 55.8404 17.998C56.2216 18.575 56.7174 19.0673 57.2969 19.4445C61.7759 22.3556 63.6871 25.4502 63.6871 29.793V31.4574C63.6872 31.8279 63.5967 32.1929 63.4235 32.5204C63.2502 32.8479 62.9995 33.1281 62.6931 33.3366V30.1506C62.6908 29.0631 62.4335 27.9912 61.9419 27.0212C61.4503 26.0511 60.7381 25.2098 59.8624 24.5648C57.1677 22.6285 53.7984 24.3061 53.6562 24.3785C53.605 24.4045 53.5554 24.4335 53.5077 24.4654C51.1056 26.0768 48.8478 26.0308 45.9671 24.3085C44.5197 23.32 41.5837 23.1611 39.9541 24.4266C38.9025 25.1029 38.0381 26.0333 37.4408 27.1317C36.8435 28.2302 36.5325 29.4614 36.5365 30.7118V33.2124C36.2772 32.9993 36.0684 32.7314 35.925 32.428C35.7816 32.1245 35.7073 31.793 35.7073 31.4574V29.793C35.7073 25.5322 37.4846 22.5834 41.8426 19.614C42.4535 19.1982 42.9671 18.6551 43.348 18.0219C43.7289 17.3888 43.9681 16.6806 44.0491 15.9462C44.3864 12.9103 46.258 11.3724 49.6125 11.3716ZM42.9781 26.3894C43.5413 26.3894 44.1076 26.5022 44.3521 26.6774C44.3832 26.6999 44.4156 26.7216 44.4478 26.7414C48.2475 29.0291 51.7046 29.0839 55.0125 26.9086C55.356 26.7553 57.0461 26.072 58.1756 26.8833C58.6864 27.2611 59.1017 27.7533 59.3881 28.3204C59.6746 28.8875 59.8242 29.5138 59.8251 30.1492V39.1638C59.8346 40.5106 59.5775 41.846 59.0687 43.0931C58.5599 44.3401 57.8093 45.4742 56.8603 46.4299C55.9113 47.3856 54.7826 48.1442 53.5392 48.6618C52.2957 49.1794 50.9622 49.4459 49.6153 49.4459C48.2684 49.4459 46.9349 49.1794 45.6914 48.6618C44.448 48.1442 43.3193 47.3856 42.3703 46.4299C41.4213 45.4742 40.6707 44.3401 40.1619 43.0931C39.6531 41.846 39.396 40.5106 39.4055 39.1638L39.4051 30.7118C39.4026 29.9319 39.5988 29.1642 39.9752 28.4812C40.3516 27.7981 40.8958 27.2222 41.5564 26.8077C41.6082 26.7751 41.6578 26.7393 41.7049 26.7003C41.9698 26.4814 42.4723 26.3894 42.9781 26.3894ZM64.8091 35.3101C64.9906 35.3368 65.165 35.3995 65.322 35.4944C65.4791 35.5893 65.6156 35.7146 65.7237 35.8629C65.8941 36.1581 66.2926 37.3823 64.2707 40.7329L64.1755 40.8922C63.8002 41.5108 63.4455 42.0954 63.316 42.798C63.1702 43.5909 62.9076 44.1338 62.6138 44.2495C62.3092 44.316 61.9912 44.2814 61.708 44.151C62.3602 42.5697 62.6953 40.8757 62.6941 39.1652V36.4316C63.4779 36.2303 64.2027 35.8459 64.8091 35.3101V35.3101ZM34.7204 35.4301C35.2551 35.8691 35.8732 36.1952 36.5375 36.3886V39.1652C36.536 40.8714 36.8691 42.5613 37.5179 44.1393C37.3892 44.1108 37.2652 44.0643 37.1495 44.0011C37.0209 43.9282 36.63 43.7063 36.4562 42.7896C36.3224 42.087 35.9653 41.4972 35.5869 40.873L35.5019 40.7329C33.8673 38.0236 33.6415 36.4418 33.9752 35.8652C34.0639 35.7464 34.1755 35.6466 34.3035 35.5719C34.4315 35.4971 34.5733 35.4489 34.7204 35.4301ZM43.572 50.7798C45.2964 51.6836 47.2015 52.1892 49.1472 52.2594C51.0929 52.3295 53.0295 51.9624 54.8145 51.185C55.503 52.7783 56.4174 54.2641 57.5294 55.5966C55.8184 62.7256 51.9726 67.8702 46.0773 70.8823C43.7618 72.0558 41.27 72.8428 38.7005 73.2121V57.0594C40.6315 55.4367 42.498 53.2058 43.572 50.7798ZM59.8769 57.9292C60.5403 58.4659 61.2737 58.9097 62.0568 59.2486C59.9126 69.1211 55.1295 77.1108 47.8239 83.0068C45.0554 85.2523 41.984 87.0961 38.7005 88.4838V84.0797C41.0671 83.8122 45.8154 82.543 51.2503 77.062C51.383 76.9283 51.4881 76.7698 51.5595 76.5954C51.6309 76.4211 51.6673 76.2344 51.6666 76.0461C51.6658 75.8577 51.628 75.6713 51.5552 75.4975C51.4824 75.3238 51.3761 75.1661 51.2424 75.0334C50.9723 74.7656 50.6069 74.616 50.2266 74.6176C49.8462 74.6192 49.4821 74.7718 49.2143 75.0418C44.594 79.7008 40.6461 80.8889 38.7005 81.1832V76.1086C41.683 75.7301 44.5792 74.8464 47.265 73.4955C51.6634 71.2764 57.241 66.7984 59.8769 57.9292ZM35.8339 58.9941V91.0545L33.4518 89.7005V80.5235C33.4518 80.1431 33.3007 79.7783 33.0317 79.5093C32.7628 79.2403 32.398 79.0892 32.0176 79.0892C31.6372 79.0892 31.2724 79.2403 31.0034 79.5093C30.7344 79.7783 30.5833 80.1431 30.5833 80.5235V88.0716L27.1783 86.1354L26.7446 60.8925C27.4993 60.7008 28.3155 60.524 29.199 60.3588L29.1995 60.3593V69.4906C29.1995 69.871 29.3506 70.2358 29.6196 70.5047C29.8885 70.7737 30.2533 70.9248 30.6337 70.9248C31.0141 70.9248 31.3789 70.7737 31.6479 70.5047C31.9169 70.2358 32.068 69.871 32.068 69.4906V59.8938C32.635 59.8141 33.2247 59.7373 33.837 59.6632C34.5352 59.5528 35.2101 59.3267 35.8339 58.9941V58.9941ZM64.8642 59.841C66.498 60.0748 67.9475 60.3316 69.2384 60.6147C69.0142 63.3677 67.9385 70.5555 62.8514 75.4279C62.7154 75.5582 62.6063 75.714 62.5305 75.8864C62.4546 76.0589 62.4135 76.2446 62.4094 76.4329C62.4054 76.6212 62.4384 76.8085 62.5067 76.9841C62.575 77.1596 62.6772 77.32 62.8075 77.4561C62.9378 77.5921 63.0936 77.7012 63.2661 77.777C63.4385 77.8528 63.6242 77.894 63.8125 77.898C64.0008 77.9021 64.1881 77.8691 64.3637 77.8008C64.5392 77.7324 64.6996 77.6302 64.8357 77.4999C70.3593 72.2111 71.7222 64.7855 72.0583 61.3505C73.3289 61.7263 74.5513 62.2488 75.701 62.9075C75.6503 65.9403 74.7925 77.8281 64.76 84.4532C64.5999 84.5557 64.4618 84.689 64.3537 84.8453C64.2455 85.0016 64.1696 85.1779 64.1301 85.3639C64.0907 85.5498 64.0887 85.7418 64.1241 85.9285C64.1595 86.1153 64.2317 86.2931 64.3365 86.4517C64.4413 86.6103 64.5765 86.7465 64.7344 86.8524C64.8923 86.9583 65.0696 87.0317 65.2561 87.0685C65.4426 87.1052 65.6346 87.1045 65.8208 87.0664C66.007 87.0283 66.1838 86.9535 66.3409 86.8465C71.6878 83.3153 75.4975 77.9065 77.3575 71.2059C77.8907 69.2799 78.2534 67.3108 78.4416 65.3213C79.4455 66.6635 80.0371 68.2544 80.5654 70.1498L84.512 86.4113C84.9225 88.1121 84.7011 89.904 83.8891 91.4537C83.077 93.0034 81.7296 94.2053 80.0976 94.8358L69.314 99.013H62.5825C62.5992 98.5058 62.4787 98.0035 62.2337 97.5591C61.7499 96.6821 61.1164 95.8965 60.362 95.2377L62.8458 93.7904C65.7686 95.2672 69.0004 96.0285 72.275 96.0114C72.6684 96.0114 73.0714 96.0007 73.4819 95.9777C73.6716 95.9697 73.8579 95.924 74.0299 95.8434C74.2018 95.7628 74.3561 95.6488 74.4837 95.5081C74.6112 95.3674 74.7096 95.2027 74.773 95.0237C74.8364 94.8446 74.8636 94.6548 74.8531 94.4652C74.8426 94.2755 74.7945 94.0899 74.7116 93.919C74.6287 93.7481 74.5127 93.5953 74.3703 93.4696C74.228 93.3439 74.062 93.2477 73.8822 93.1867C73.7023 93.1256 73.5121 93.1009 73.3227 93.1139C70.8018 93.2547 68.2788 92.8773 65.9095 92.005L74.692 86.8875C75.0183 86.6948 75.2549 86.3808 75.3504 86.0141C75.4459 85.6474 75.3924 85.2578 75.2015 84.9304C75.0107 84.6031 74.6981 84.3645 74.332 84.2669C73.9659 84.1693 73.576 84.2205 73.2475 84.4093L57.5066 93.5817C56.1863 93.1236 54.7739 92.9966 53.3931 93.2117C52.0124 93.4269 50.7055 93.9776 49.5873 94.8157L48.6643 95.5001C48.5304 95.4205 48.3911 95.3438 48.2422 95.2723C47.9751 95.1448 47.7037 95.0231 47.428 94.9067C56.5064 90.843 59.3085 85.1014 59.4385 84.8249C59.595 84.4822 59.6103 84.0917 59.4813 83.7378C59.3522 83.3838 59.0891 83.0949 58.7488 82.9334C58.4084 82.7719 58.0182 82.7507 57.6624 82.8745C57.3066 82.9984 57.0138 83.2572 56.8473 83.5951C56.8392 83.6116 56.0169 85.2804 53.8191 87.3596C51.8123 89.2583 48.215 91.8914 42.4529 93.732C41.8642 93.7075 41.2745 93.7357 40.6908 93.8161L38.7005 92.6844V91.5671C42.6145 90.0729 46.2659 87.9655 49.5177 85.324C54.9887 80.9385 62.0006 72.9935 64.8642 59.841ZM23.8891 61.7828L24.2795 84.4873L24.2048 84.4481C23.8664 84.265 23.4693 84.2235 23.1004 84.3327C22.7315 84.4419 22.4209 84.6929 22.2367 85.0306C22.0525 85.3684 22.0098 85.7654 22.1178 86.1347C22.2258 86.5039 22.4758 86.8153 22.813 87.0005L31.3032 91.7814C31.3173 91.7895 31.3311 91.7978 31.3457 91.8052L37.2705 95.1733C36.4189 95.8053 35.7066 96.6058 35.1779 97.525C35.1707 97.5369 35.1643 97.549 35.1574 97.5614C34.9113 98.0057 34.7871 98.5071 34.7974 99.0148H28.1392L17.2893 94.8353C15.6584 94.2042 14.3121 93.0023 13.501 91.453C12.6898 89.9038 12.469 88.1126 12.8796 86.4127L16.8257 70.1512C17.9834 65.9983 19.5804 63.4623 23.8891 61.7828ZM54.4854 95.989C55.5433 95.9455 56.5925 96.1967 57.5161 96.7145C58.4397 97.2322 59.2014 97.9963 59.7163 98.9214C59.7134 98.952 59.6656 99.0144 59.6379 99.0144H50.5122C50.5835 98.5926 50.5633 98.1605 50.4529 97.7472L51.3003 97.1193C52.2238 96.4302 53.334 96.0362 54.4854 95.989ZM41.9412 96.5926C42.1716 96.5887 42.4018 96.5962 42.6307 96.6127H42.6457H42.6471C44.1604 96.7679 45.6344 97.1896 47.0008 97.8584C47.1767 97.9369 47.3382 98.0442 47.4788 98.1758C47.5934 98.2908 47.721 98.4521 47.6763 98.5689C47.5938 98.7032 47.4786 98.8144 47.3414 98.892C47.2042 98.9697 47.0496 99.0113 46.892 99.013H37.6776V98.9705L37.6706 98.9439C38.7185 97.1942 40.3283 96.6203 41.9412 96.5926ZM10.7796 101.883H57.7358C53.4157 103.661 49.3139 105.93 45.5109 108.643C34.377 116.48 24.2433 117.936 23.334 118.053H10.7796C9.7789 118.053 8.78805 117.856 7.86358 117.473C6.93911 117.09 6.09912 116.529 5.39157 115.821C4.68403 115.114 4.12279 114.274 3.7399 113.349C3.35701 112.425 3.15997 111.434 3.16003 110.433V109.502C3.16003 107.482 3.9628 105.544 5.39174 104.115C6.82067 102.686 8.75873 101.883 10.7796 101.883V101.883ZM9.70899 105.504C9.3286 105.504 8.96379 105.655 8.69481 105.924C8.42584 106.193 8.27473 106.557 8.27473 106.938C8.27473 107.318 8.42584 107.683 8.69481 107.952C8.96379 108.221 9.3286 108.372 9.70899 108.372H10.3542C10.7346 108.372 11.0994 108.221 11.3684 107.952C11.6374 107.683 11.7885 107.318 11.7885 106.938C11.7885 106.557 11.6374 106.193 11.3684 105.924C11.0994 105.655 10.7346 105.504 10.3542 105.504H9.70899ZM14.982 105.504C14.6016 105.504 14.2368 105.655 13.9678 105.924C13.6988 106.193 13.5477 106.557 13.5477 106.938C13.5477 107.318 13.6988 107.683 13.9678 107.952C14.2368 108.221 14.6016 108.372 14.982 108.372H33.3192C33.6996 108.372 34.0644 108.221 34.3334 107.952C34.6024 107.683 34.7535 107.318 34.7535 106.938C34.7535 106.557 34.6024 106.193 34.3334 105.924C34.0644 105.655 33.6996 105.504 33.3192 105.504H14.982Z",fill:"#D4D8DD"})),oj=s.div`
4749
+ `,{common:{strings:Qo,datePicker:YC,texts:ZC},dateFormat:Jo,cockpit:XC,card:qC}=t.appLocale.getLocalizedStrings(),QC=({historicData:e,companyId:n,newThreadMetadata:r,containerRef:i,sortedThreads:a})=>{const{addThread:d,setOpenThread:l}=u.useContext(t.ThreadsContext),c=u.useRef(null),[p,m]=u.useState(),[h,S]=u.useState(!1),x="monthEndReportHistoricDataPage",C=t.useHandleSelection(t.MONTH_END_REPORT_CANVAS,!1,!1),b=i.current?.getBoundingClientRect(),f=C!=null&&C.coords!=null&&b?{left:C.coords.left-b.left,top:C.coords.top-b.top}:void 0,g=o.useForm({mode:"all",defaultValues:qr(e),values:qr(e)}),j=()=>{c.current&&c.current.scrollIntoView({behavior:"smooth"})};u.useEffect(()=>{m(J.mapAttachmentFileToAttachmentFilePayload(e.attachmentFile))},[e.attachmentFile]);const y=u.useCallback(()=>{const $=window.getSelection()?.getRangeAt(0),w=t.getSelectionData();if(!$||w==null)return;const O={...r,...w,startPath:w.startPath.join(),endPath:w.endPath.join()},A=`${o.nanoid()}${t.NEW_THREAD_SUFFIX}`,v=`cockpit_${n}`;d(A,{type:"thread",id:A,roomId:v,createdAt:new Date,updatedAt:new Date,comments:[],metadata:O,resolved:!1}),l(A)},[d,n,r,l]);return o.jsxRuntimeExports.jsx(o.FormProvider,{...g,children:o.jsxRuntimeExports.jsx("form",{id:ej(x),children:o.jsxRuntimeExports.jsxs(UC,{children:[o.jsxRuntimeExports.jsx(t.MonthEndReportSection,{previewMode:!0,subject:e.subject,sectionId:Xt}),o.jsxRuntimeExports.jsxs(AC,{id:t.MONTH_END_REPORT_CANVAS,ref:i,children:[o.jsxRuntimeExports.jsxs(OC,{className:"monthEndReportCanvasWrapper",children:[p!=null?o.jsxRuntimeExports.jsx(NC,{onClick:j,children:o.jsxRuntimeExports.jsx(t.CircleWithAttachmentSuccessIcon,{loading:!1,fileSizeError:h,setFileSizeError:S})}):null,o.jsxRuntimeExports.jsx(t.StandardRegular,{style:{position:"relative"},dangerouslySetInnerHTML:{__html:t.getHTMLWithCommentingSections(e.concatenatedHtml)}}),p!=null?o.jsxRuntimeExports.jsx(t.FileAttachment,{ref:c,fileName:p.name,fileSize:t.base64FileSize(p.data),isRemovable:!1}):null]}),f?o.jsxRuntimeExports.jsx(t.AddThreadFloating,{style:{zIndex:15},coords:f,alignment:C.alignment,onClick:y}):null,o.jsxRuntimeExports.jsx(t.TextHighlightSection,{canvasContainerRef:i,sortedThreads:a,editorMode:!1})]})]})})})},JC=e=>{const{monthEndReportHistoricData:n,reportSentDate:r,onRefresh:i,onNavigateBack:a,onDateChange:d}=e,l=o.useTheme(),[c,p]=u.useState(!1),[m,h]=u.useState(),S=u.useRef(null),[x,C]=u.useState(0),[b,f]=u.useState(0),g=t.useDelayUnmount(c,250),{data:j,companyId:y,companyName:$,firstMonthOfFY:w}=n,O=t.getMonthIndex(r.format(Jo.visual.MMMMFormat)),A=Number(r.format(Jo.visual.YYYYformat)),v=w>O?A-1:A;u.useEffect(()=>{const re=O>0?O-1:12;h(`${o.padStart(re.toString(),2,"0")}${Qo.backspace}${A}`)},[]);const T={application:"cockpit",companyId:y,entityId:y,tab:"management",isGlobalComment:!1,entityType:"management.monthEndEmail",companyName:$,url:window.location.href,selectedRange:m},{url:F,...I}=T,K={...I},M=n.fetchState==="Not-Started"||n.fetchState==="In-Progress",{threadsRefs:Y,sortedThreads:G,threadsPositions:E,observer:P,unresolvedThreadsMap:W,handleRemoveFloatingThread:k}=t.useFloatingThreads(K,S,!1,M),D=u.useRef(null),[z,Z]=u.useState(0),ie=u.useCallback(()=>{const re=Y.current?.[Y.current?.length-1];Z(window.scrollY+(re?.getBoundingClientRect()?.bottom??0))},[Y]),N=u.useCallback(()=>{c?f(Math.min((window.innerWidth-t.FORM_MINIMUM_WIDTH)/2,window.innerWidth-t.FORM_MINIMUM_WIDTH-t.COMMENTS_DRAWER_MAXIMUM_WIDTH-t.sp[4])):C(Math.min((window.innerWidth-t.FORM_MINIMUM_WIDTH)/2,window.innerWidth-t.FORM_MINIMUM_WIDTH-t.COMMENTS_SECTION_MINIMUM_WIDTH))},[c]);u.useEffect(()=>{N()},[c,N]),u.useEffect(()=>(window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N)}),[N]),u.useEffect(()=>(window.addEventListener("scroll",ie),()=>window.removeEventListener("scroll",ie)),[ie]);const{openThread:H,setOpenThread:L}=u.useContext(t.ThreadsContext);u.useEffect(()=>{H!=null&&c&&p(!1)},[c,H,p]);const Q=t.getHistoricMonthsList(w,n.historicReportSentDates),se=u.useCallback((re,te)=>{const he=w>re?te+1:te;d(J.dateFromYearMonthDate(he,re-1));const fe=re>0?re-1:12;h(`${o.padStart(fe.toString(),2,"0")}${Qo.backspace}${he}`)},[w,d]);if(n.fetchState==="Not-Started"||n.fetchState==="In-Progress")return o.jsxRuntimeExports.jsxs(Gn,{children:[o.jsxRuntimeExports.jsx(Kn,{children:o.jsxRuntimeExports.jsx(Yn,{onClick:a})}),o.jsxRuntimeExports.jsx(t.BusyIndication,{fetchState:n.fetchState,styles:{margin:t.Space.sp0}})]});if(n.fetchState==="Error")return o.jsxRuntimeExports.jsxs(Gn,{children:[o.jsxRuntimeExports.jsx(Kn,{children:o.jsxRuntimeExports.jsx(Yn,{onClick:a})}),o.jsxRuntimeExports.jsx(t.ReloadContainer,{onReload:i,message:qC.failedText})]});if(j?.concatenatedHtml==null)return o.jsxRuntimeExports.jsxs(Gn,{children:[o.jsxRuntimeExports.jsx(Kn,{children:o.jsxRuntimeExports.jsx(Yn,{onClick:a})}),o.jsxRuntimeExports.jsx(t.ReloadContainer,{onReload:i,message:XC.monthEndReport.insightsNotAvailable})]});const X=`cockpit_${y}`;return o.jsxRuntimeExports.jsx(Ze.RoomProvider,{id:X,children:o.jsxRuntimeExports.jsxs(MC,{children:[o.jsxRuntimeExports.jsx(la,{companyName:n.companyName,onNavigateBack:a,monthCalendar:{monthAndYears:Q,label:`${r.format(Jo.visual.MMMformat)} ${v}`,selectedMonth:{month:O,year:v},onChange:se},threadMetadata:K,onAllThreadsClick:()=>{H!=null&&L(null),p(!0)}}),o.jsxRuntimeExports.jsxs(_C,{ref:D,style:z>0?{height:z}:void 0,children:[o.jsxRuntimeExports.jsx(zC,{availableWidth:c?b:x}),o.jsxRuntimeExports.jsxs(VC,{children:[o.jsxRuntimeExports.jsx(QC,{historicData:j,newThreadMetadata:T,companyId:y,sortedThreads:G,containerRef:S}),o.jsxRuntimeExports.jsxs(KC,{children:[o.jsxRuntimeExports.jsx(Si,{user:n.reportLastSentByUser}),o.jsxRuntimeExports.jsx(HC,{}),o.jsxRuntimeExports.jsxs(GC,{children:[YC.businessDay,Qo.space,n.data?.reportSentDate!=null?J.getBusinessDayOfDate(n.data.reportSentDate):null,":",Qo.space,n.data?.reportSentDate?.format(Jo.visual.MMMDFormat)]})]})]}),g?o.jsxRuntimeExports.jsx(BC,{allThreadsSectionOpen:c,children:o.jsxRuntimeExports.jsx(t.AllThreadsSection,{autoExpand:!0,autoFocus:!1,style:{borderLeft:`1px solid ${l.colors.grey3}`,boxShadow:`${t.Space.sp0} 1px 2px ${t.Space.sp0} ${t.Colors.boxShadowElevation}`},drawerSectionStyle:{width:`calc(100% - ${t.Space.sp5} - ${t.Space.sp5})`,backgroundColor:l.colors.background},threadsContainerStyle:{paddingBottom:t.Space.sp5},collapsibleThreadStyle:{width:`calc(100% - ${t.Space.sp4})`},allowComposer:!1,drawerTitle:ZC.comments,filter:K,textOverrides:{},preventResolvedThreadClick:!0,onThreadClick:(re,te)=>{L(te);const he=G.findIndex(fe=>fe[0]===te);p(!1),Y.current?.[he]?.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},onCloseAllThreadsDrawer:()=>p(!1)})}):o.jsxRuntimeExports.jsx(t.FloatingThreads,{observer:P,canvasContainerRef:S,sortedThreads:G,threadsPositions:E,threadsRefs:Y,unresolvedThreadsMap:W,editorMode:!1,style:{minWidth:`${t.COMMENTS_SECTION_MINIMUM_WIDTH}px`,position:"relative",height:"fit-content",width:"auto",top:`${S.current?.offsetTop}px`},handleRemoveFloatingThread:k})]})]})})},qr=e=>({[Xt]:{recipientEmailList:e.recipientEmailList??[],subject:e.subject??""}}),ej=e=>`${e}_form`,tj=e=>le.createElement("svg",{width:98,height:121,viewBox:"0 0 98 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},le.createElement("path",{d:"M49.2796 0.921875C32.9744 0.921875 19.7096 14.1944 19.7096 30.5087C19.7125 35.7639 21.1132 40.9238 23.7681 45.459C26.423 49.9943 30.2365 53.7418 34.8175 56.317C34.4083 56.561 33.9588 56.7299 33.4901 56.8156C26.6518 57.6437 22.4965 58.8342 19.5952 60.7958C16.8429 62.6568 15.2375 65.1511 14.0552 69.4056C14.0509 69.4209 14.0466 69.4363 14.0431 69.4518L10.0918 85.7362C9.51826 88.1132 9.82738 90.6176 10.9617 92.7837C12.0961 94.9499 13.9785 96.6304 16.2589 97.5129L20.1569 99.0144H10.7796C7.99797 99.0144 5.33033 100.119 3.36345 102.086C1.39658 104.053 0.291567 106.721 0.291504 109.502V110.435C0.291815 113.216 1.39693 115.884 3.36378 117.85C5.33063 119.817 7.99813 120.922 10.7796 120.922H53.2747C53.6551 120.922 54.0199 120.771 54.2889 120.502C54.5579 120.233 54.709 119.868 54.709 119.488C54.709 119.107 54.5579 118.742 54.2889 118.473C54.0199 118.204 53.6551 118.053 53.2747 118.053H34.0289C38.6739 116.234 43.0832 113.862 47.1618 110.989C59.9371 101.998 69.4844 101.883 69.5755 101.883H86.6115C88.6324 101.883 90.5704 102.686 91.9994 104.115C93.4283 105.544 94.2311 107.482 94.2311 109.502V110.435C94.2308 112.455 93.4279 114.393 91.999 115.822C90.5701 117.251 88.6322 118.053 86.6115 118.053H62.8365C62.4561 118.053 62.0913 118.204 61.8223 118.473C61.5533 118.742 61.4022 119.107 61.4022 119.488C61.4022 119.868 61.5533 120.233 61.8223 120.502C62.0913 120.771 62.4561 120.922 62.8365 120.922H86.6115C89.3932 120.922 92.0609 119.817 94.0278 117.85C95.9947 115.883 97.0996 113.215 97.0996 110.433V109.501C97.0996 106.72 95.9947 104.052 94.0278 102.085C92.0609 100.118 89.3932 99.013 86.6115 99.013H77.2552L81.1289 97.5124C83.4101 96.6305 85.2933 94.95 86.4283 92.7836C87.5633 90.6172 87.8728 88.1123 87.2993 85.7348L83.3471 69.4504C83.3435 69.4349 83.3393 69.42 83.335 69.4047C81.0779 61.2834 76.7211 58.4595 63.9108 56.8156C63.6617 56.7812 63.4178 56.7159 63.1848 56.6214C67.9202 54.1003 71.88 50.3378 74.6396 45.7373C77.3993 41.1368 78.8546 35.872 78.8496 30.5073C78.8496 14.1942 65.5848 0.921875 49.2796 0.921875ZM50.0808 3.84176C56.084 4.02211 61.8511 6.22111 66.4504 10.0835C71.0497 13.9459 74.2125 19.2461 75.4278 25.1278C76.6431 31.0094 75.84 37.1291 73.1483 42.498C70.4565 47.867 66.0332 52.1716 60.5931 54.7165C59.1024 53.1795 57.8049 51.1354 57.3184 49.7456C58.4778 48.8954 59.4906 47.8615 60.3167 46.6848C60.9625 46.9809 61.6621 47.1419 62.3724 47.1577C62.8095 47.1603 63.2432 47.0811 63.6512 46.9243C64.5464 46.5762 65.7044 45.6681 66.1373 43.3181C66.2624 42.9869 66.4272 42.6721 66.628 42.3806L66.7279 42.2148C68.7825 38.8099 69.2671 36.263 68.2103 34.43C67.7877 33.7064 67.1417 33.1394 66.3694 32.8142C66.4922 32.3725 66.5552 31.9163 66.5566 31.4579V29.7934C66.5566 24.4319 64.183 20.499 58.861 17.0401C58.612 16.8783 58.3989 16.667 58.235 16.4194C58.071 16.1718 57.9598 15.8931 57.9081 15.6007C57.125 11.0899 54.1033 8.50358 49.6158 8.50358H49.613C42.7338 8.50525 41.4374 13.4875 41.1983 15.6301C41.1628 15.9531 41.0576 16.2647 40.8901 16.5432C40.7227 16.8217 40.4968 17.0607 40.2282 17.2436C36.7881 19.5877 32.8393 23.1325 32.8393 29.7934V31.4579C32.8389 31.9742 32.9165 32.4876 33.0695 32.9808C32.4212 33.2864 31.8789 33.7785 31.5119 34.3941C30.4489 36.1843 30.9504 38.7427 33.0456 42.2153L33.133 42.36C33.3398 42.6607 33.5094 42.9854 33.6381 43.3269C33.9878 45.1621 34.9709 46.0635 35.7344 46.4966C36.4514 46.8873 37.2576 47.0851 38.074 47.0704C38.4264 47.0695 38.7782 47.0401 39.1259 46.9826C39.7172 47.7756 40.3958 48.4996 41.1489 49.141C40.3987 51.1167 38.8989 53.0103 37.368 54.4238C32.9251 52.2043 29.188 48.7913 26.5758 44.5673C23.9635 40.3432 22.5793 35.4752 22.5781 30.5087C22.5811 26.9366 23.3008 23.4015 24.6945 20.1126C26.0883 16.8237 28.1278 13.8479 30.6922 11.3613C33.2567 8.87477 36.294 6.92806 39.6244 5.63643C42.9547 4.34481 46.5104 3.73454 50.0808 3.84176V3.84176ZM49.6125 11.3716H49.6148C52.6985 11.3716 54.5375 12.9592 55.0811 16.0909C55.2008 16.7719 55.4592 17.4211 55.8404 17.998C56.2216 18.575 56.7174 19.0673 57.2969 19.4445C61.7759 22.3556 63.6871 25.4502 63.6871 29.793V31.4574C63.6872 31.8279 63.5967 32.1929 63.4235 32.5204C63.2502 32.8479 62.9995 33.1281 62.6931 33.3366V30.1506C62.6908 29.0631 62.4335 27.9912 61.9419 27.0212C61.4503 26.0511 60.7381 25.2098 59.8624 24.5648C57.1677 22.6285 53.7984 24.3061 53.6562 24.3785C53.605 24.4045 53.5554 24.4335 53.5077 24.4654C51.1056 26.0768 48.8478 26.0308 45.9671 24.3085C44.5197 23.32 41.5837 23.1611 39.9541 24.4266C38.9025 25.1029 38.0381 26.0333 37.4408 27.1317C36.8435 28.2302 36.5325 29.4614 36.5365 30.7118V33.2124C36.2772 32.9993 36.0684 32.7314 35.925 32.428C35.7816 32.1245 35.7073 31.793 35.7073 31.4574V29.793C35.7073 25.5322 37.4846 22.5834 41.8426 19.614C42.4535 19.1982 42.9671 18.6551 43.348 18.0219C43.7289 17.3888 43.9681 16.6806 44.0491 15.9462C44.3864 12.9103 46.258 11.3724 49.6125 11.3716ZM42.9781 26.3894C43.5413 26.3894 44.1076 26.5022 44.3521 26.6774C44.3832 26.6999 44.4156 26.7216 44.4478 26.7414C48.2475 29.0291 51.7046 29.0839 55.0125 26.9086C55.356 26.7553 57.0461 26.072 58.1756 26.8833C58.6864 27.2611 59.1017 27.7533 59.3881 28.3204C59.6746 28.8875 59.8242 29.5138 59.8251 30.1492V39.1638C59.8346 40.5106 59.5775 41.846 59.0687 43.0931C58.5599 44.3401 57.8093 45.4742 56.8603 46.4299C55.9113 47.3856 54.7826 48.1442 53.5392 48.6618C52.2957 49.1794 50.9622 49.4459 49.6153 49.4459C48.2684 49.4459 46.9349 49.1794 45.6914 48.6618C44.448 48.1442 43.3193 47.3856 42.3703 46.4299C41.4213 45.4742 40.6707 44.3401 40.1619 43.0931C39.6531 41.846 39.396 40.5106 39.4055 39.1638L39.4051 30.7118C39.4026 29.9319 39.5988 29.1642 39.9752 28.4812C40.3516 27.7981 40.8958 27.2222 41.5564 26.8077C41.6082 26.7751 41.6578 26.7393 41.7049 26.7003C41.9698 26.4814 42.4723 26.3894 42.9781 26.3894ZM64.8091 35.3101C64.9906 35.3368 65.165 35.3995 65.322 35.4944C65.4791 35.5893 65.6156 35.7146 65.7237 35.8629C65.8941 36.1581 66.2926 37.3823 64.2707 40.7329L64.1755 40.8922C63.8002 41.5108 63.4455 42.0954 63.316 42.798C63.1702 43.5909 62.9076 44.1338 62.6138 44.2495C62.3092 44.316 61.9912 44.2814 61.708 44.151C62.3602 42.5697 62.6953 40.8757 62.6941 39.1652V36.4316C63.4779 36.2303 64.2027 35.8459 64.8091 35.3101V35.3101ZM34.7204 35.4301C35.2551 35.8691 35.8732 36.1952 36.5375 36.3886V39.1652C36.536 40.8714 36.8691 42.5613 37.5179 44.1393C37.3892 44.1108 37.2652 44.0643 37.1495 44.0011C37.0209 43.9282 36.63 43.7063 36.4562 42.7896C36.3224 42.087 35.9653 41.4972 35.5869 40.873L35.5019 40.7329C33.8673 38.0236 33.6415 36.4418 33.9752 35.8652C34.0639 35.7464 34.1755 35.6466 34.3035 35.5719C34.4315 35.4971 34.5733 35.4489 34.7204 35.4301ZM43.572 50.7798C45.2964 51.6836 47.2015 52.1892 49.1472 52.2594C51.0929 52.3295 53.0295 51.9624 54.8145 51.185C55.503 52.7783 56.4174 54.2641 57.5294 55.5966C55.8184 62.7256 51.9726 67.8702 46.0773 70.8823C43.7618 72.0558 41.27 72.8428 38.7005 73.2121V57.0594C40.6315 55.4367 42.498 53.2058 43.572 50.7798ZM59.8769 57.9292C60.5403 58.4659 61.2737 58.9097 62.0568 59.2486C59.9126 69.1211 55.1295 77.1108 47.8239 83.0068C45.0554 85.2523 41.984 87.0961 38.7005 88.4838V84.0797C41.0671 83.8122 45.8154 82.543 51.2503 77.062C51.383 76.9283 51.4881 76.7698 51.5595 76.5954C51.6309 76.4211 51.6673 76.2344 51.6666 76.0461C51.6658 75.8577 51.628 75.6713 51.5552 75.4975C51.4824 75.3238 51.3761 75.1661 51.2424 75.0334C50.9723 74.7656 50.6069 74.616 50.2266 74.6176C49.8462 74.6192 49.4821 74.7718 49.2143 75.0418C44.594 79.7008 40.6461 80.8889 38.7005 81.1832V76.1086C41.683 75.7301 44.5792 74.8464 47.265 73.4955C51.6634 71.2764 57.241 66.7984 59.8769 57.9292ZM35.8339 58.9941V91.0545L33.4518 89.7005V80.5235C33.4518 80.1431 33.3007 79.7783 33.0317 79.5093C32.7628 79.2403 32.398 79.0892 32.0176 79.0892C31.6372 79.0892 31.2724 79.2403 31.0034 79.5093C30.7344 79.7783 30.5833 80.1431 30.5833 80.5235V88.0716L27.1783 86.1354L26.7446 60.8925C27.4993 60.7008 28.3155 60.524 29.199 60.3588L29.1995 60.3593V69.4906C29.1995 69.871 29.3506 70.2358 29.6196 70.5047C29.8885 70.7737 30.2533 70.9248 30.6337 70.9248C31.0141 70.9248 31.3789 70.7737 31.6479 70.5047C31.9169 70.2358 32.068 69.871 32.068 69.4906V59.8938C32.635 59.8141 33.2247 59.7373 33.837 59.6632C34.5352 59.5528 35.2101 59.3267 35.8339 58.9941V58.9941ZM64.8642 59.841C66.498 60.0748 67.9475 60.3316 69.2384 60.6147C69.0142 63.3677 67.9385 70.5555 62.8514 75.4279C62.7154 75.5582 62.6063 75.714 62.5305 75.8864C62.4546 76.0589 62.4135 76.2446 62.4094 76.4329C62.4054 76.6212 62.4384 76.8085 62.5067 76.9841C62.575 77.1596 62.6772 77.32 62.8075 77.4561C62.9378 77.5921 63.0936 77.7012 63.2661 77.777C63.4385 77.8528 63.6242 77.894 63.8125 77.898C64.0008 77.9021 64.1881 77.8691 64.3637 77.8008C64.5392 77.7324 64.6996 77.6302 64.8357 77.4999C70.3593 72.2111 71.7222 64.7855 72.0583 61.3505C73.3289 61.7263 74.5513 62.2488 75.701 62.9075C75.6503 65.9403 74.7925 77.8281 64.76 84.4532C64.5999 84.5557 64.4618 84.689 64.3537 84.8453C64.2455 85.0016 64.1696 85.1779 64.1301 85.3639C64.0907 85.5498 64.0887 85.7418 64.1241 85.9285C64.1595 86.1153 64.2317 86.2931 64.3365 86.4517C64.4413 86.6103 64.5765 86.7465 64.7344 86.8524C64.8923 86.9583 65.0696 87.0317 65.2561 87.0685C65.4426 87.1052 65.6346 87.1045 65.8208 87.0664C66.007 87.0283 66.1838 86.9535 66.3409 86.8465C71.6878 83.3153 75.4975 77.9065 77.3575 71.2059C77.8907 69.2799 78.2534 67.3108 78.4416 65.3213C79.4455 66.6635 80.0371 68.2544 80.5654 70.1498L84.512 86.4113C84.9225 88.1121 84.7011 89.904 83.8891 91.4537C83.077 93.0034 81.7296 94.2053 80.0976 94.8358L69.314 99.013H62.5825C62.5992 98.5058 62.4787 98.0035 62.2337 97.5591C61.7499 96.6821 61.1164 95.8965 60.362 95.2377L62.8458 93.7904C65.7686 95.2672 69.0004 96.0285 72.275 96.0114C72.6684 96.0114 73.0714 96.0007 73.4819 95.9777C73.6716 95.9697 73.8579 95.924 74.0299 95.8434C74.2018 95.7628 74.3561 95.6488 74.4837 95.5081C74.6112 95.3674 74.7096 95.2027 74.773 95.0237C74.8364 94.8446 74.8636 94.6548 74.8531 94.4652C74.8426 94.2755 74.7945 94.0899 74.7116 93.919C74.6287 93.7481 74.5127 93.5953 74.3703 93.4696C74.228 93.3439 74.062 93.2477 73.8822 93.1867C73.7023 93.1256 73.5121 93.1009 73.3227 93.1139C70.8018 93.2547 68.2788 92.8773 65.9095 92.005L74.692 86.8875C75.0183 86.6948 75.2549 86.3808 75.3504 86.0141C75.4459 85.6474 75.3924 85.2578 75.2015 84.9304C75.0107 84.6031 74.6981 84.3645 74.332 84.2669C73.9659 84.1693 73.576 84.2205 73.2475 84.4093L57.5066 93.5817C56.1863 93.1236 54.7739 92.9966 53.3931 93.2117C52.0124 93.4269 50.7055 93.9776 49.5873 94.8157L48.6643 95.5001C48.5304 95.4205 48.3911 95.3438 48.2422 95.2723C47.9751 95.1448 47.7037 95.0231 47.428 94.9067C56.5064 90.843 59.3085 85.1014 59.4385 84.8249C59.595 84.4822 59.6103 84.0917 59.4813 83.7378C59.3522 83.3838 59.0891 83.0949 58.7488 82.9334C58.4084 82.7719 58.0182 82.7507 57.6624 82.8745C57.3066 82.9984 57.0138 83.2572 56.8473 83.5951C56.8392 83.6116 56.0169 85.2804 53.8191 87.3596C51.8123 89.2583 48.215 91.8914 42.4529 93.732C41.8642 93.7075 41.2745 93.7357 40.6908 93.8161L38.7005 92.6844V91.5671C42.6145 90.0729 46.2659 87.9655 49.5177 85.324C54.9887 80.9385 62.0006 72.9935 64.8642 59.841ZM23.8891 61.7828L24.2795 84.4873L24.2048 84.4481C23.8664 84.265 23.4693 84.2235 23.1004 84.3327C22.7315 84.4419 22.4209 84.6929 22.2367 85.0306C22.0525 85.3684 22.0098 85.7654 22.1178 86.1347C22.2258 86.5039 22.4758 86.8153 22.813 87.0005L31.3032 91.7814C31.3173 91.7895 31.3311 91.7978 31.3457 91.8052L37.2705 95.1733C36.4189 95.8053 35.7066 96.6058 35.1779 97.525C35.1707 97.5369 35.1643 97.549 35.1574 97.5614C34.9113 98.0057 34.7871 98.5071 34.7974 99.0148H28.1392L17.2893 94.8353C15.6584 94.2042 14.3121 93.0023 13.501 91.453C12.6898 89.9038 12.469 88.1126 12.8796 86.4127L16.8257 70.1512C17.9834 65.9983 19.5804 63.4623 23.8891 61.7828ZM54.4854 95.989C55.5433 95.9455 56.5925 96.1967 57.5161 96.7145C58.4397 97.2322 59.2014 97.9963 59.7163 98.9214C59.7134 98.952 59.6656 99.0144 59.6379 99.0144H50.5122C50.5835 98.5926 50.5633 98.1605 50.4529 97.7472L51.3003 97.1193C52.2238 96.4302 53.334 96.0362 54.4854 95.989ZM41.9412 96.5926C42.1716 96.5887 42.4018 96.5962 42.6307 96.6127H42.6457H42.6471C44.1604 96.7679 45.6344 97.1896 47.0008 97.8584C47.1767 97.9369 47.3382 98.0442 47.4788 98.1758C47.5934 98.2908 47.721 98.4521 47.6763 98.5689C47.5938 98.7032 47.4786 98.8144 47.3414 98.892C47.2042 98.9697 47.0496 99.0113 46.892 99.013H37.6776V98.9705L37.6706 98.9439C38.7185 97.1942 40.3283 96.6203 41.9412 96.5926ZM10.7796 101.883H57.7358C53.4157 103.661 49.3139 105.93 45.5109 108.643C34.377 116.48 24.2433 117.936 23.334 118.053H10.7796C9.7789 118.053 8.78805 117.856 7.86358 117.473C6.93911 117.09 6.09912 116.529 5.39157 115.821C4.68403 115.114 4.12279 114.274 3.7399 113.349C3.35701 112.425 3.15997 111.434 3.16003 110.433V109.502C3.16003 107.482 3.9628 105.544 5.39174 104.115C6.82067 102.686 8.75873 101.883 10.7796 101.883V101.883ZM9.70899 105.504C9.3286 105.504 8.96379 105.655 8.69481 105.924C8.42584 106.193 8.27473 106.557 8.27473 106.938C8.27473 107.318 8.42584 107.683 8.69481 107.952C8.96379 108.221 9.3286 108.372 9.70899 108.372H10.3542C10.7346 108.372 11.0994 108.221 11.3684 107.952C11.6374 107.683 11.7885 107.318 11.7885 106.938C11.7885 106.557 11.6374 106.193 11.3684 105.924C11.0994 105.655 10.7346 105.504 10.3542 105.504H9.70899ZM14.982 105.504C14.6016 105.504 14.2368 105.655 13.9678 105.924C13.6988 106.193 13.5477 106.557 13.5477 106.938C13.5477 107.318 13.6988 107.683 13.9678 107.952C14.2368 108.221 14.6016 108.372 14.982 108.372H33.3192C33.6996 108.372 34.0644 108.221 34.3334 107.952C34.6024 107.683 34.7535 107.318 34.7535 106.938C34.7535 106.557 34.6024 106.193 34.3334 105.924C34.0644 105.655 33.6996 105.504 33.3192 105.504H14.982Z",fill:"#D4D8DD"})),oj=s.div`
4750
4750
  justify-content: center;
4751
4751
  align-items: center;
4752
4752
  display: flex;
@@ -4761,7 +4761,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
4761
4761
  color: ${e=>e.theme.colors.hero};
4762
4762
  `,sj=s(t.StandardRegular)`
4763
4763
  color: ${e=>e.theme.colors.grey1};
4764
- `,rj=()=>o.jsxRuntimeExports.jsxs(oj,{children:[o.jsxRuntimeExports.jsx(nj,{}),o.jsxRuntimeExports.jsx(sj,{children:t.appLocale.getLocalizedStrings().cockpit.review.reachedZeni})]}),ft=[{key:"companyName",value:t.appLocale.getLocalizedStrings().cockpit.review.header.name,sortOrder:"ascending",width:new t.ResponsiveSized(400,400),isThreadAllowed:!0},{key:"auditScore",value:t.appLocale.getLocalizedStrings().cockpit.review.header.auditScore,sortOrder:"descending",width:new t.ResponsiveSized(235,235),isThreadAllowed:!0},{key:"uncategorized",value:t.appLocale.getLocalizedStrings().cockpit.review.header.uncategorizedTransactions,sortOrder:"ascending",width:new t.ResponsiveSized(300,300),isThreadAllowed:!0},{key:"miscategorized",value:t.appLocale.getLocalizedStrings().cockpit.review.header.miscategorizedTransactions,sortOrder:"ascending",width:new t.ResponsiveSized(300,300),isThreadAllowed:!0},{key:"reviewVendor",value:t.appLocale.getLocalizedStrings().cockpit.review.header.reviewVendor,sortOrder:"ascending",width:new t.ResponsiveSized(225,225),isThreadAllowed:!0},{key:"warnings",value:t.appLocale.getLocalizedStrings().cockpit.review.header.warnings,sortOrder:"descending",width:new t.ResponsiveSized(125,125),isThreadAllowed:!0}];ft.map(e=>e.key);function ij({companyNameSticky:e,isReviewVendorColumnVisible:n,sortConfig:r,onColumnSortConfigChanged:i}){const a=t.useWindowSizeContext(),[d,l]=u.useState(o.cloneDeep(n?ft:ft.filter(p=>p.key!=="reviewVendor")));u.useEffect(()=>{const p=[...d];for(const m of p)m.key===r.sortKey&&(m.sortOrder=r.sortOrder);l(p)},[r.sortKey,r.sortOrder]);const c=(p,m)=>{let h=m;r.sortKey===p&&(h=m==="ascending"?"descending":"ascending"),i(p,h??void 0)};return o.jsxRuntimeExports.jsx(dj,{height:Nt,children:d.map(p=>o.jsxRuntimeExports.jsxs(pj,{sortDataValue:r.sortKey,actualDataValue:p.key,widthSize:p.width,companyNameSticky:e&&p.key==="companyName",windowSize:a,children:[o.jsxRuntimeExports.jsxs(uj,{onClick:()=>c(p.key,p.sortOrder),disabled:p.sortOrder==null,children:[o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:p.value}),p.sortOrder!=null&&o.jsxRuntimeExports.jsx(cj,{sortDataValue:r.sortKey,headerdata:p,children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:12,height:12})})]}),o.jsxRuntimeExports.jsx(lj,{isVisible:r.sortKey===p.key&&r.sortKey!=="companyName",children:o.jsxRuntimeExports.jsx(aj,{onClick:()=>c("companyName","ascending")})})]},p.key))})}const aj=s(t.SvgCloseRound)`
4764
+ `,rj=()=>o.jsxRuntimeExports.jsxs(oj,{children:[o.jsxRuntimeExports.jsx(nj,{}),o.jsxRuntimeExports.jsx(sj,{children:t.appLocale.getLocalizedStrings().cockpit.review.reachedZeni})]}),Ct=[{key:"companyName",value:t.appLocale.getLocalizedStrings().cockpit.review.header.name,sortOrder:"ascending",width:new t.ResponsiveSized(400,400),isThreadAllowed:!0},{key:"auditScore",value:t.appLocale.getLocalizedStrings().cockpit.review.header.auditScore,sortOrder:"descending",width:new t.ResponsiveSized(235,235),isThreadAllowed:!0},{key:"uncategorized",value:t.appLocale.getLocalizedStrings().cockpit.review.header.uncategorizedTransactions,sortOrder:"ascending",width:new t.ResponsiveSized(300,300),isThreadAllowed:!0},{key:"miscategorized",value:t.appLocale.getLocalizedStrings().cockpit.review.header.miscategorizedTransactions,sortOrder:"ascending",width:new t.ResponsiveSized(300,300),isThreadAllowed:!0},{key:"reviewVendor",value:t.appLocale.getLocalizedStrings().cockpit.review.header.reviewVendor,sortOrder:"ascending",width:new t.ResponsiveSized(225,225),isThreadAllowed:!0},{key:"warnings",value:t.appLocale.getLocalizedStrings().cockpit.review.header.warnings,sortOrder:"descending",width:new t.ResponsiveSized(125,125),isThreadAllowed:!0}];Ct.map(e=>e.key);function ij({companyNameSticky:e,isReviewVendorColumnVisible:n,sortConfig:r,onColumnSortConfigChanged:i}){const a=t.useWindowSizeContext(),[d,l]=u.useState(o.cloneDeep(n?Ct:Ct.filter(p=>p.key!=="reviewVendor")));u.useEffect(()=>{const p=[...d];for(const m of p)m.key===r.sortKey&&(m.sortOrder=r.sortOrder);l(p)},[r.sortKey,r.sortOrder]);const c=(p,m)=>{let h=m;r.sortKey===p&&(h=m==="ascending"?"descending":"ascending"),i(p,h??void 0)};return o.jsxRuntimeExports.jsx(dj,{height:Nt,children:d.map(p=>o.jsxRuntimeExports.jsxs(pj,{sortDataValue:r.sortKey,actualDataValue:p.key,widthSize:p.width,companyNameSticky:e&&p.key==="companyName",windowSize:a,children:[o.jsxRuntimeExports.jsxs(uj,{onClick:()=>c(p.key,p.sortOrder),disabled:p.sortOrder==null,children:[o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:p.value}),p.sortOrder!=null&&o.jsxRuntimeExports.jsx(cj,{sortDataValue:r.sortKey,headerdata:p,children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:12,height:12})})]}),o.jsxRuntimeExports.jsx(lj,{isVisible:r.sortKey===p.key&&r.sortKey!=="companyName",children:o.jsxRuntimeExports.jsx(aj,{onClick:()=>c("companyName","ascending")})})]},p.key))})}const aj=s(t.SvgCloseRound)`
4765
4765
  cursor: pointer;
4766
4766
  width: 12px;
4767
4767
  height: 12px;
@@ -4818,7 +4818,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
4818
4818
  &:hover {
4819
4819
  color: ${e=>e.disabled?e.theme.colors.grey1:e.theme.colors.primary};
4820
4820
  }
4821
- `,Xn=t.appLocale.getLocalizedStrings(),mj=s.div`
4821
+ `,Zn=t.appLocale.getLocalizedStrings(),mj=s.div`
4822
4822
  display: flex;
4823
4823
  align-items: center;
4824
4824
  column-gap: ${t.Space.sp2};
@@ -4836,7 +4836,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
4836
4836
  `,Sj=s(t.SmallRegular)`
4837
4837
  display: flex;
4838
4838
  align-items: center;
4839
- `,yj=({auditSummary:e,onClickScore:n})=>{const r=o.useTheme(),i=e.auditScorePercentage<=50?t.Colors.important:e.auditScorePercentage<=85?t.Colors.alert:t.Colors.success;return o.jsxRuntimeExports.jsx(mj,{onClick:n,auditPercentage:e.auditScorePercentage,children:e.auditReportLastGeneratedDate!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(xj,{children:o.jsxRuntimeExports.jsx(o.CircularProgressbar,{value:e.auditScorePercentage,text:`${Math.ceil(e.auditScorePercentage)}%`,strokeWidth:10,styles:o.buildStyles({rotation:.5,strokeLinecap:"butt",pathColor:i,textColor:r.colors.primary,trailColor:r.colors.grey3,textSize:t.textStyles.extraLargeRegular.fontSize})})}),o.jsxRuntimeExports.jsxs(hj,{children:[o.jsxRuntimeExports.jsx(gj,{children:`${e.fixesRequired} ${Xn.cockpit.review.pendingIssues}`}),o.jsxRuntimeExports.jsx(Sj,{children:e.auditReportLastGeneratedDate.format(Xn.dateFormat.visual.MMMDCommaYYYYformat)})]})]}):o.jsxRuntimeExports.jsx(t.Button,{label:Xn.cockpit.review.getScore,onClick:n,style:{backgroundColor:r.colors.grey5},textStyle:{...t.textStyles.smallMedium.cssObject},size:"small",variant:"outline"})})},fj=s.div`
4839
+ `,yj=({auditSummary:e,onClickScore:n})=>{const r=o.useTheme(),i=e.auditScorePercentage<=50?t.Colors.important:e.auditScorePercentage<=85?t.Colors.alert:t.Colors.success;return o.jsxRuntimeExports.jsx(mj,{onClick:n,auditPercentage:e.auditScorePercentage,children:e.auditReportLastGeneratedDate!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(xj,{children:o.jsxRuntimeExports.jsx(o.CircularProgressbar,{value:e.auditScorePercentage,text:`${Math.ceil(e.auditScorePercentage)}%`,strokeWidth:10,styles:o.buildStyles({rotation:.5,strokeLinecap:"butt",pathColor:i,textColor:r.colors.primary,trailColor:r.colors.grey3,textSize:t.textStyles.extraLargeRegular.fontSize})})}),o.jsxRuntimeExports.jsxs(hj,{children:[o.jsxRuntimeExports.jsx(gj,{children:`${e.fixesRequired} ${Zn.cockpit.review.pendingIssues}`}),o.jsxRuntimeExports.jsx(Sj,{children:e.auditReportLastGeneratedDate.format(Zn.dateFormat.visual.MMMDCommaYYYYformat)})]})]}):o.jsxRuntimeExports.jsx(t.Button,{label:Zn.cockpit.review.getScore,onClick:n,style:{backgroundColor:r.colors.grey5},textStyle:{...t.textStyles.smallMedium.cssObject},size:"small",variant:"outline"})})},fj=s.div`
4840
4840
  padding: ${t.Space.sp0} ${t.Space.sp2};
4841
4841
  color: ${e=>e.color};
4842
4842
  border-radius: ${t.Space.sp1};
@@ -4872,14 +4872,14 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
4872
4872
  color: ${e=>e.theme.colors.grey3};
4873
4873
  background-color: ${e=>e.theme.colors.grey5};
4874
4874
  border-radius: 50%;
4875
- `,Jr=({color:e,disabled:n,text:r,showTickForDisabled:i,onClick:a})=>o.jsxRuntimeExports.jsxs(Ej,{onClick:()=>!n&&a!=null?a():!1,disabled:n,children:[o.jsxRuntimeExports.jsx($j,{disabled:n,color:e,children:o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:r})}),n&&i?o.jsxRuntimeExports.jsx(wj,{className:"tick-icon"}):null]}),vj=s.div`
4875
+ `,Qr=({color:e,disabled:n,text:r,showTickForDisabled:i,onClick:a})=>o.jsxRuntimeExports.jsxs(Ej,{onClick:()=>!n&&a!=null?a():!1,disabled:n,children:[o.jsxRuntimeExports.jsx($j,{disabled:n,color:e,children:o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:r})}),n&&i?o.jsxRuntimeExports.jsx(wj,{className:"tick-icon"}):null]}),vj=s.div`
4876
4876
  display: flex;
4877
4877
  align-items: center;
4878
4878
  column-gap: ${t.Space.sp4};
4879
4879
  `,kj=s.div`
4880
4880
  border-left: 1px solid ${e=>e.theme.colors.grey2};
4881
4881
  height: ${t.Space.sp4};
4882
- `,ei=({income:e,expense:n,showTickForDisabled:r=!0,onTransactionTagClicked:i})=>o.jsxRuntimeExports.jsxs(vj,{children:[o.jsxRuntimeExports.jsx(Jr,{text:t.appLocale.getLocalizedStrings().cockpit.review.transactionTag.expense,showTickForDisabled:r,disabled:!n,color:t.getTransactionTagColor("expense"),onClick:()=>i?.("expense")}),o.jsxRuntimeExports.jsx(kj,{}),o.jsxRuntimeExports.jsx(Jr,{text:t.appLocale.getLocalizedStrings().cockpit.review.transactionTag.income,disabled:!e,showTickForDisabled:r,color:t.getTransactionTagColor("income"),onClick:()=>i?.("income")})]}),Tj=({companyId:e,warningsCount:n,onClick:r})=>{const i=()=>{r(e)};return o.jsxRuntimeExports.jsx(Lj,{onClick:i,children:n===0?o.jsxRuntimeExports.jsx(Ij,{}):o.jsxRuntimeExports.jsxs(Aj,{children:[o.jsxRuntimeExports.jsx(Dj,{})," ",o.jsxRuntimeExports.jsx(Pj,{children:n})]})})},Lj=s.div`
4882
+ `,Jr=({income:e,expense:n,showTickForDisabled:r=!0,onTransactionTagClicked:i})=>o.jsxRuntimeExports.jsxs(vj,{children:[o.jsxRuntimeExports.jsx(Qr,{text:t.appLocale.getLocalizedStrings().cockpit.review.transactionTag.expense,showTickForDisabled:r,disabled:!n,color:t.getTransactionTagColor("expense"),onClick:()=>i?.("expense")}),o.jsxRuntimeExports.jsx(kj,{}),o.jsxRuntimeExports.jsx(Qr,{text:t.appLocale.getLocalizedStrings().cockpit.review.transactionTag.income,disabled:!e,showTickForDisabled:r,color:t.getTransactionTagColor("income"),onClick:()=>i?.("income")})]}),Tj=({companyId:e,warningsCount:n,onClick:r})=>{const i=()=>{r(e)};return o.jsxRuntimeExports.jsx(Lj,{onClick:i,children:n===0?o.jsxRuntimeExports.jsx(Ij,{}):o.jsxRuntimeExports.jsxs(Aj,{children:[o.jsxRuntimeExports.jsx(Dj,{})," ",o.jsxRuntimeExports.jsx(Pj,{children:n})]})})},Lj=s.div`
4883
4883
  display: flex;
4884
4884
  align-items: center;
4885
4885
  cursor: pointer;
@@ -4897,7 +4897,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
4897
4897
  `,Aj=s.div`
4898
4898
  display: flex;
4899
4899
  align-items: center;
4900
- `,{dateFormat:ti}=t.appLocale.getLocalizedStrings(),Oj=({companyView:e,companyNameSticky:n,isReviewVendorColumnVisible:r,totalHeight:i,analytics:a,addThreadRequestThreadId:d,setNoteData:l,setElementRef:c,setAddThreadRequestThreadId:p,onTransactionTagClicked:m,onClickAuditScore:h,onClickWarningsCount:S,onCompanyNameClicked:x,onUncategorizedAccountsErrorClick:C,onReviewVendorTagClicked:b})=>{const f=t.useWindowSizeContext(),{name:g,companyId:j}=e,y=`cockpit_${j}`,$="audit.notes",{threads:w,isLoading:O}=t.useFilteredThreads({entityType:$,companyId:j},!1),{openThread:A,threads:v,addThread:T,removeThread:F,setOpenThread:I,setRequestToOpenThread:K}=u.useContext(t.ThreadsContext),M=A!==null?v.get(A):null,Y=A?.includes(j)===!0,G=A!=null&&v.get(A)==null&&Y,E=d!=null&&v.get(d)?.metadata.companyId===j,P=u.useCallback(()=>{A?.includes(t.NEW_THREAD_SUFFIX)===!0&&F(A),d!=null&&p(void 0)},[d,A,F,p]),W=L=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:L.isElementThreadOpen??!1,isElementThreadPresent:L.isElementThreadPresent??!1,itemKey:L.itemKey,elementThreadId:L.elementThreadId??"",roomId:y,addThreadRequestThreadId:d,openThreadId:A,threadStyle:L.threadStyle,openThreadMetadata:M?.metadata??null,onElementClick:D,onAddThreadClick:z}),k=u.useCallback(L=>{if(L===A)I(null);else if(v.has(L))I(L);else if(L.includes(t.NEW_THREAD_SUFFIX)){const[Q,se]=L.replace(t.NEW_THREAD_SUFFIX,"").split("."),X=Ft(Ct(Q),ee.toReviewColumnKeyType(se),j,g);T(L,{type:"thread",id:L,roomId:y,createdAt:new Date,updatedAt:new Date,comments:[],metadata:X,resolved:!1}),I(L)}},[j,g,A,v,T,I,y]),D=u.useCallback((L,Q,se=!1)=>{const X=ft.find(re=>re.key===Q);if(K(null),X!=null&&(L.type==="contextmenu"||se===!0)){if(X.isThreadAllowed===!1)return;P(),L.preventDefault(),L.stopPropagation();const re=t.toCollaborationEntityType({tab:"audit",key:X.key}),te=[...t.getFilteredThreads(v,{entityType:re,companyId:j},"both")],he=te.length>0&&te[0].length>0?te[0][0]:Le("audit",X.key,j);v.has(he)?k(he):d===he?p(void 0):(p(he),I(null))}},[v,j,d,k,p,I,K,P]),z=u.useCallback((L,Q)=>{L.stopPropagation();const se=Le("audit",Q,j);p(void 0),k(se)},[j,p,k]),Z=()=>{x(e)},ie=u.useCallback(()=>{C(e.primaryEmailDomain)},[C,e.primaryEmailDomain]),N=()=>{if(e.auditSummary.auditReportLastGeneratedDate==null){const L=ee.dateNow().startOf("month").subtract(1,"date").format(ti.analytics.MMMYYYYFormat),Q=e.controllers?.map(se=>`${se.user.firstName} ${se.user.middleName} ${se.user.lastName}`)??[];a.trackGetAuditScore(!0,e.name,L,Q,ee.dateNow().format(ti.analytics.MMSlashDDSlashYYYYFormat))}h(e.companyId)},H=e.onboardingInfo?.uncategorizedExpenseAccountIdentified===!0&&e.onboardingInfo?.uncategorizedIncomeAccountIdentified===!0;return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{K(null),d!=null&&(p(void 0),d.includes(t.NEW_THREAD_SUFFIX)&&F(d))},children:o.jsxRuntimeExports.jsx(Wj,{windowSize:f,isThreadOpen:Y||E,totalHeight:i,isCreationInProgress:G,children:ft.map((L,Q)=>{const se=t.toCollaborationEntityType({tab:"audit",key:L.key}),X=ft.length-2<=Q,re=[...t.getFilteredThreads(v,{entityType:se,companyId:j},"both")],te=re.length>0&&re[0].length>0?re[0][0]:Le("audit",L.key,j),he=v.get(te),fe=he!=null&&he.resolved===!1,be=te===A,_=d===te;switch(L.key){case"companyName":return o.jsxRuntimeExports.jsxs(Mj,{companyNameSticky:n,columnWidth:L.width,windowSize:f,isThreadOpen:be||_,isThreadAllowed:L.isThreadAllowed,className:oe,onContextMenu:J=>D(J,L.key),ref:J=>{c(j,L.key,J)},children:[o.jsxRuntimeExports.jsxs(Fj,{children:[o.jsxRuntimeExports.jsx(zj,{onClick:J=>{J.preventDefault(),Z()},children:g}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:be,roomId:y,openThreadId:A,openThreadMetadata:M?.metadata??null})]}),o.jsxRuntimeExports.jsxs(Bj,{className:"notesIcon",onClick:J=>{J.preventDefault(),l({roomId:y,companyId:j,companyName:g,entityType:$})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:w.length,isLoading:O}),o.jsxRuntimeExports.jsx(_j,{})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:fe,itemKey:L.key,style:{left:t.Space.sp4},onElementClick:D}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("audit",L.key,j),addThreadRequestThreadId:d,itemKey:L.key,onAddThreadClick:z})]},te);case"auditScore":return o.jsxRuntimeExports.jsxs(So,{ref:J=>{c(j,L.key,J)},columnWidth:L.width,windowSize:f,isThreadAllowed:L.isThreadAllowed,className:oe,onContextMenu:J=>D(J,L.key),children:[o.jsxRuntimeExports.jsx(yj,{auditSummary:e.auditSummary,onClickScore:N}),W({isElementThreadOpen:be,isElementThreadPresent:fe,itemKey:L.key,elementThreadId:te,threadStyle:X?{right:t.Space.sp0}:void 0})]},te);case"uncategorized":return o.jsxRuntimeExports.jsxs(So,{ref:J=>{c(j,L.key,J)},columnWidth:L.width,windowSize:f,isThreadAllowed:L.isThreadAllowed,className:oe,onContextMenu:J=>D(J,L.key),children:[H===!0?o.jsxRuntimeExports.jsx(ei,{onTransactionTagClicked:J=>m(e,J,"uncategorized"),...e.uncategorizedTransactions}):o.jsxRuntimeExports.jsxs(Uj,{onClick:ie,children:[o.jsxRuntimeExports.jsx(t.SvgHighImportance,{className:"alert-icon",width:t.sp[3],height:t.sp[3]}),o.jsxRuntimeExports.jsx(Vj,{children:t.appLocale.getLocalizedStrings().cockpit.review.selectUncategorizedAccounts})]}),W({isElementThreadOpen:be,isElementThreadPresent:fe,itemKey:L.key,elementThreadId:te,threadStyle:X?{right:t.Space.sp0}:void 0})]},te);case"miscategorized":return o.jsxRuntimeExports.jsxs(So,{ref:J=>{c(j,L.key,J)},columnWidth:L.width,windowSize:f,isThreadAllowed:L.isThreadAllowed,className:oe,onContextMenu:J=>D(J,L.key),children:[o.jsxRuntimeExports.jsx(ei,{onTransactionTagClicked:J=>m(e,J,"miscategorized"),...e.miscategorizedTransactions}),W({isElementThreadOpen:be,isElementThreadPresent:fe,itemKey:L.key,elementThreadId:te,threadStyle:X?{right:t.Space.sp0}:void 0})]},te);case"reviewVendor":return r?o.jsxRuntimeExports.jsxs(So,{ref:J=>{c(j,L.key,J)},columnWidth:L.width,windowSize:f,isThreadAllowed:L.isThreadAllowed,className:oe,onContextMenu:J=>D(J,L.key),children:[o.jsxRuntimeExports.jsx(Nj,{widthSize:L.width,windowSize:f,children:o.jsxRuntimeExports.jsx(Rj,{onReviewVendorTagClicked:()=>b(e),isReviewComplete:!e.isVendorReviewReqiured})}),W({isElementThreadOpen:be,isElementThreadPresent:fe,itemKey:L.key,elementThreadId:te,threadStyle:X?{right:t.Space.sp0}:void 0})]},te):null;case"warnings":return o.jsxRuntimeExports.jsxs(So,{ref:J=>{c(j,L.key,J)},columnWidth:L.width,windowSize:f,isThreadAllowed:L.isThreadAllowed,className:oe,onContextMenu:J=>D(J,L.key),children:[o.jsxRuntimeExports.jsx(Tj,{companyId:e.companyId,warningsCount:ee.getAuditWarningsCount(e),onClick:S}),W({isElementThreadOpen:be,isElementThreadPresent:fe,itemKey:L.key,elementThreadId:te,threadStyle:X?{right:t.Space.sp0}:void 0})]},te);default:return null}})})})},Nj=s.div`
4900
+ `,{dateFormat:ei}=t.appLocale.getLocalizedStrings(),Oj=({companyView:e,companyNameSticky:n,isReviewVendorColumnVisible:r,totalHeight:i,analytics:a,addThreadRequestThreadId:d,setNoteData:l,setElementRef:c,setAddThreadRequestThreadId:p,onTransactionTagClicked:m,onClickAuditScore:h,onClickWarningsCount:S,onCompanyNameClicked:x,onUncategorizedAccountsErrorClick:C,onReviewVendorTagClicked:b})=>{const f=t.useWindowSizeContext(),{name:g,companyId:j}=e,y=`cockpit_${j}`,$="audit.notes",{threads:w,isLoading:O}=t.useFilteredThreads({entityType:$,companyId:j},!1),{openThread:A,threads:v,addThread:T,removeThread:F,setOpenThread:I,setRequestToOpenThread:K}=u.useContext(t.ThreadsContext),M=A!==null?v.get(A):null,Y=A?.includes(j)===!0,G=A!=null&&v.get(A)==null&&Y,E=d!=null&&v.get(d)?.metadata.companyId===j,P=u.useCallback(()=>{A?.includes(t.NEW_THREAD_SUFFIX)===!0&&F(A),d!=null&&p(void 0)},[d,A,F,p]),W=L=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:L.isElementThreadOpen??!1,isElementThreadPresent:L.isElementThreadPresent??!1,itemKey:L.itemKey,elementThreadId:L.elementThreadId??"",roomId:y,addThreadRequestThreadId:d,openThreadId:A,threadStyle:L.threadStyle,openThreadMetadata:M?.metadata??null,onElementClick:D,onAddThreadClick:z}),k=u.useCallback(L=>{if(L===A)I(null);else if(v.has(L))I(L);else if(L.includes(t.NEW_THREAD_SUFFIX)){const[Q,se]=L.replace(t.NEW_THREAD_SUFFIX,"").split("."),X=Ft(jt(Q),J.toReviewColumnKeyType(se),j,g);T(L,{type:"thread",id:L,roomId:y,createdAt:new Date,updatedAt:new Date,comments:[],metadata:X,resolved:!1}),I(L)}},[j,g,A,v,T,I,y]),D=u.useCallback((L,Q,se=!1)=>{const X=Ct.find(re=>re.key===Q);if(K(null),X!=null&&(L.type==="contextmenu"||se===!0)){if(X.isThreadAllowed===!1)return;P(),L.preventDefault(),L.stopPropagation();const re=t.toCollaborationEntityType({tab:"audit",key:X.key}),te=[...t.getFilteredThreads(v,{entityType:re,companyId:j},"both")],he=te.length>0&&te[0].length>0?te[0][0]:Le("audit",X.key,j);v.has(he)?k(he):d===he?p(void 0):(p(he),I(null))}},[v,j,d,k,p,I,K,P]),z=u.useCallback((L,Q)=>{L.stopPropagation();const se=Le("audit",Q,j);p(void 0),k(se)},[j,p,k]),Z=()=>{x(e)},ie=u.useCallback(()=>{C(e.primaryEmailDomain)},[C,e.primaryEmailDomain]),N=()=>{if(e.auditSummary.auditReportLastGeneratedDate==null){const L=J.dateNow().startOf("month").subtract(1,"date").format(ei.analytics.MMMYYYYFormat),Q=e.controllers?.map(se=>`${se.user.firstName} ${se.user.middleName} ${se.user.lastName}`)??[];a.trackGetAuditScore(!0,e.name,L,Q,J.dateNow().format(ei.analytics.MMSlashDDSlashYYYYFormat))}h(e.companyId)},H=e.onboardingInfo?.uncategorizedExpenseAccountIdentified===!0&&e.onboardingInfo?.uncategorizedIncomeAccountIdentified===!0;return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{K(null),d!=null&&(p(void 0),d.includes(t.NEW_THREAD_SUFFIX)&&F(d))},children:o.jsxRuntimeExports.jsx(Wj,{windowSize:f,isThreadOpen:Y||E,totalHeight:i,isCreationInProgress:G,children:Ct.map((L,Q)=>{const se=t.toCollaborationEntityType({tab:"audit",key:L.key}),X=Ct.length-2<=Q,re=[...t.getFilteredThreads(v,{entityType:se,companyId:j},"both")],te=re.length>0&&re[0].length>0?re[0][0]:Le("audit",L.key,j),he=v.get(te),fe=he!=null&&he.resolved===!1,be=te===A,_=d===te;switch(L.key){case"companyName":return o.jsxRuntimeExports.jsxs(Mj,{companyNameSticky:n,columnWidth:L.width,windowSize:f,isThreadOpen:be||_,isThreadAllowed:L.isThreadAllowed,className:oe,onContextMenu:ee=>D(ee,L.key),ref:ee=>{c(j,L.key,ee)},children:[o.jsxRuntimeExports.jsxs(Fj,{children:[o.jsxRuntimeExports.jsx(zj,{onClick:ee=>{ee.preventDefault(),Z()},children:g}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:be,roomId:y,openThreadId:A,openThreadMetadata:M?.metadata??null})]}),o.jsxRuntimeExports.jsxs(Bj,{className:"notesIcon",onClick:ee=>{ee.preventDefault(),l({roomId:y,companyId:j,companyName:g,entityType:$})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:w.length,isLoading:O}),o.jsxRuntimeExports.jsx(_j,{})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:fe,itemKey:L.key,style:{left:t.Space.sp4},onElementClick:D}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Le("audit",L.key,j),addThreadRequestThreadId:d,itemKey:L.key,onAddThreadClick:z})]},te);case"auditScore":return o.jsxRuntimeExports.jsxs(So,{ref:ee=>{c(j,L.key,ee)},columnWidth:L.width,windowSize:f,isThreadAllowed:L.isThreadAllowed,className:oe,onContextMenu:ee=>D(ee,L.key),children:[o.jsxRuntimeExports.jsx(yj,{auditSummary:e.auditSummary,onClickScore:N}),W({isElementThreadOpen:be,isElementThreadPresent:fe,itemKey:L.key,elementThreadId:te,threadStyle:X?{right:t.Space.sp0}:void 0})]},te);case"uncategorized":return o.jsxRuntimeExports.jsxs(So,{ref:ee=>{c(j,L.key,ee)},columnWidth:L.width,windowSize:f,isThreadAllowed:L.isThreadAllowed,className:oe,onContextMenu:ee=>D(ee,L.key),children:[H===!0?o.jsxRuntimeExports.jsx(Jr,{onTransactionTagClicked:ee=>m(e,ee,"uncategorized"),...e.uncategorizedTransactions}):o.jsxRuntimeExports.jsxs(Uj,{onClick:ie,children:[o.jsxRuntimeExports.jsx(t.SvgHighImportance,{className:"alert-icon",width:t.sp[3],height:t.sp[3]}),o.jsxRuntimeExports.jsx(Vj,{children:t.appLocale.getLocalizedStrings().cockpit.review.selectUncategorizedAccounts})]}),W({isElementThreadOpen:be,isElementThreadPresent:fe,itemKey:L.key,elementThreadId:te,threadStyle:X?{right:t.Space.sp0}:void 0})]},te);case"miscategorized":return o.jsxRuntimeExports.jsxs(So,{ref:ee=>{c(j,L.key,ee)},columnWidth:L.width,windowSize:f,isThreadAllowed:L.isThreadAllowed,className:oe,onContextMenu:ee=>D(ee,L.key),children:[o.jsxRuntimeExports.jsx(Jr,{onTransactionTagClicked:ee=>m(e,ee,"miscategorized"),...e.miscategorizedTransactions}),W({isElementThreadOpen:be,isElementThreadPresent:fe,itemKey:L.key,elementThreadId:te,threadStyle:X?{right:t.Space.sp0}:void 0})]},te);case"reviewVendor":return r?o.jsxRuntimeExports.jsxs(So,{ref:ee=>{c(j,L.key,ee)},columnWidth:L.width,windowSize:f,isThreadAllowed:L.isThreadAllowed,className:oe,onContextMenu:ee=>D(ee,L.key),children:[o.jsxRuntimeExports.jsx(Nj,{widthSize:L.width,windowSize:f,children:o.jsxRuntimeExports.jsx(Rj,{onReviewVendorTagClicked:()=>b(e),isReviewComplete:!e.isVendorReviewReqiured})}),W({isElementThreadOpen:be,isElementThreadPresent:fe,itemKey:L.key,elementThreadId:te,threadStyle:X?{right:t.Space.sp0}:void 0})]},te):null;case"warnings":return o.jsxRuntimeExports.jsxs(So,{ref:ee=>{c(j,L.key,ee)},columnWidth:L.width,windowSize:f,isThreadAllowed:L.isThreadAllowed,className:oe,onContextMenu:ee=>D(ee,L.key),children:[o.jsxRuntimeExports.jsx(Tj,{companyId:e.companyId,warningsCount:J.getAuditWarningsCount(e),onClick:S}),W({isElementThreadOpen:be,isElementThreadPresent:fe,itemKey:L.key,elementThreadId:te,threadStyle:X?{right:t.Space.sp0}:void 0})]},te);default:return null}})})})},Nj=s.div`
4901
4901
  display: flex;
4902
4902
  align-items: flex-start;
4903
4903
  width: ${e=>e.widthSize.valuePx(e.windowSize)};
@@ -5022,7 +5022,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
5022
5022
  svg {
5023
5023
  color: ${t.Colors.important};
5024
5024
  }
5025
- `,{common:{headers:{comments:Hj}},collaboration:{threads:{placeholder:{addANewComment:Kj,replyAComment:Gj},tooltip:{resolveComment:Yj,unResolveComment:Zj}}}}=t.appLocale.getLocalizedStrings(),Xj=({reviewView:e,allUsers:n,isReviewVendorColumnVisible:r,analytics:i,onColumnSortConfigChanged:a,onClickAuditScore:d,onClickWarningsCount:l,onTransactionTagClicked:c,onCompanyNameClicked:p,onRetryBankAccountConnection:m,onUncategorizedAccountsErrorClick:h,onReviewVendorTagClicked:S,initialOpenThreadRequest:x})=>{const C=t.useWindowSizeContext(),b=u.useRef(null),[f,g]=u.useState(null),[j,y]=u.useState(null),{uiState:$}=e,w=!(C==="small"||C==="medium-compact"),O=E=>e.companies[E].name.length>zt?Ie+32:Ie;u.useEffect(()=>{b.current&&b.current.resetAfterIndex(0)},[e]);const{setOpenThread:A,setRequestToOpenThread:v,requestToOpenThread:T,isLoading:F}=u.useContext(t.ThreadsContext);u.useEffect(()=>{x!=null&&e.fetchState==="Completed"&&F===!1&&v(x)},[x,e.fetchState,F,v]);const[I,K]=u.useState(void 0),M=u.useRef([]),Y=u.useMemo(()=>({makeCompanyNameSticky:w,uiState:$,isReviewVendorColumnVisible:r,onColumnSortConfigChanged:a}),[w,$,r,a]),G=u.useCallback((E,P,W)=>{const k=e.companies.findIndex(z=>z.companyId===E),D=ft.findIndex(z=>z.key===P);k!==-1&&D!==-1&&(M.current[k]==null?M.current[k]=[W]:M.current[k][D]=W)},[e.companies]);return u.useEffect(()=>{if(T!=null&&f!=null){const{companyId:E,entityType:P}=T,[W,k]=P.split("."),D=e.companies.findIndex(N=>N.companyId===E),z=ft.findIndex(N=>N.key===k);D!==-1&&!(f.visibleStartIndex<=D&&f.visibleStopIndex>=D)&&b.current?.scrollToItem(D,"center"),setTimeout(()=>{const N=M.current[D]?.[0]?.getBoundingClientRect().bottom,H=M.current[D]?.[0]?.getBoundingClientRect().top;N!=null&&H!=null&&(window.innerHeight>=N&&window.innerHeight>=H||H<0)&&M.current[D][z]?.scrollIntoView({block:"center",behavior:"auto"})},0);const ie=setInterval(()=>{const N=M.current[D]?.[z]?.getBoundingClientRect().left,H=M.current[D]?.[z]?.getBoundingClientRect().right,L=M.current[D]?.[z]?.offsetWidth;if(N!=null&&L!=null&&H!=null&&(N<window.innerWidth-L||H<window.innerWidth)){clearInterval(ie);const Q=T.threadId,se=T.onThreadShownCallback;Q&&(v(null),A(T.threadId),se?.())}},500);setTimeout(()=>{clearInterval(ie),v(null)},2e3)}},[T,f,A,v]),o.jsxRuntimeExports.jsx(qj,{children:o.jsxRuntimeExports.jsxs(ca.Provider,{value:Y,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:E,width:P})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:E,innerElementType:da,itemCount:e.companies.length,itemSize:O,onItemsRendered:W=>g(W),itemData:{reviewView:e,isReviewVendorColumnVisible:r,analytics:i,makeCompanyNameSticky:w,allUsers:n,addThreadRequestThreadId:I,setElementRef:G,setAddThreadRequestThreadId:K,setNoteData:y,onTransactionTagClicked:c,onCompanyNameClicked:p,onRetryBankAccountConnection:m,onUncategorizedAccountsErrorClick:h,onReviewVendorTagClicked:S,onClickAuditScore:d,onClickWarningsCount:l},width:P,ref:b,overscanCount:Mt,children:pa})}),j!=null?o.jsxRuntimeExports.jsx(Ze.RoomProvider,{id:j.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${j.companyName} ${Hj}`,filter:{application:"cockpit",companyId:j.companyId,entityType:j.entityType,isGlobalComment:!1,tab:"audit"},isLoading:!1,threadMetadata:{companyName:j.companyName,companyId:j.companyId,entityId:j.companyId,entityType:j.entityType,isGlobalComment:!1,application:"cockpit",tab:"audit",url:window.location.href},textOverrides:{composerPlaceholder:Kj,replyComposerPlaceholder:Gj,threadResolve:Yj,threadUnResolve:Zj},onThreadClick:E=>null,onCloseAllThreadsDrawer:()=>y(null)})}):null]})})},ca=u.createContext(void 0),da=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,isReviewVendorColumnVisible:c,onColumnSortConfigChanged:p}=u.useContext(ca);return o.jsxRuntimeExports.jsxs(e4,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(ij,{companyNameSticky:d,onColumnSortConfigChanged:p,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder},isReviewVendorColumnVisible:c}),o.jsxRuntimeExports.jsx(Jj,{children:r})]})});da.displayName="Review list view inner element type";const pa=({index:e,style:n,data:r})=>{const{reviewView:i,isReviewVendorColumnVisible:a,makeCompanyNameSticky:d,allUsers:l,analytics:c,addThreadRequestThreadId:p,setElementRef:m,setNoteData:h,onCompanyNameClicked:S,onTransactionTagClicked:x,setAddThreadRequestThreadId:C,onUncategorizedAccountsErrorClick:b,onReviewVendorTagClicked:f,onClickAuditScore:g,onClickWarningsCount:j}=r,y=i.companies[e],{companyId:$}=y;return o.jsxRuntimeExports.jsx(Qj,{style:{...n,width:"fit-content",minWidth:"100%"},children:o.jsxRuntimeExports.jsx(Oj,{totalHeight:typeof n.height=="number"?n.height:Ie,addThreadRequestThreadId:p,setNoteData:h,setElementRef:m,setAddThreadRequestThreadId:C,analytics:c,companyView:i.companies[e],isReviewVendorColumnVisible:a,companyNameSticky:d,onCompanyNameClicked:S,onTransactionTagClicked:x,allUsers:l,onUncategorizedAccountsErrorClick:b,onReviewVendorTagClicked:f,onClickWarningsCount:j,onClickAuditScore:g})},$)};pa.displayName="ListItem";const qj=s.div`
5025
+ `,{common:{headers:{comments:Hj}},collaboration:{threads:{placeholder:{addANewComment:Kj,replyAComment:Gj},tooltip:{resolveComment:Yj,unResolveComment:Zj}}}}=t.appLocale.getLocalizedStrings(),Xj=({reviewView:e,allUsers:n,isReviewVendorColumnVisible:r,analytics:i,onColumnSortConfigChanged:a,onClickAuditScore:d,onClickWarningsCount:l,onTransactionTagClicked:c,onCompanyNameClicked:p,onRetryBankAccountConnection:m,onUncategorizedAccountsErrorClick:h,onReviewVendorTagClicked:S,initialOpenThreadRequest:x})=>{const C=t.useWindowSizeContext(),b=u.useRef(null),[f,g]=u.useState(null),[j,y]=u.useState(null),{uiState:$}=e,w=!(C==="small"||C==="medium-compact"),O=E=>e.companies[E].name.length>zt?Ie+32:Ie;u.useEffect(()=>{b.current&&b.current.resetAfterIndex(0)},[e]);const{setOpenThread:A,setRequestToOpenThread:v,requestToOpenThread:T,isLoading:F}=u.useContext(t.ThreadsContext);u.useEffect(()=>{x!=null&&e.fetchState==="Completed"&&F===!1&&v(x)},[x,e.fetchState,F,v]);const[I,K]=u.useState(void 0),M=u.useRef([]),Y=u.useMemo(()=>({makeCompanyNameSticky:w,uiState:$,isReviewVendorColumnVisible:r,onColumnSortConfigChanged:a}),[w,$,r,a]),G=u.useCallback((E,P,W)=>{const k=e.companies.findIndex(z=>z.companyId===E),D=Ct.findIndex(z=>z.key===P);k!==-1&&D!==-1&&(M.current[k]==null?M.current[k]=[W]:M.current[k][D]=W)},[e.companies]);return u.useEffect(()=>{if(T!=null&&f!=null){const{companyId:E,entityType:P}=T,[W,k]=P.split("."),D=e.companies.findIndex(N=>N.companyId===E),z=Ct.findIndex(N=>N.key===k);D!==-1&&!(f.visibleStartIndex<=D&&f.visibleStopIndex>=D)&&b.current?.scrollToItem(D,"center"),setTimeout(()=>{const N=M.current[D]?.[0]?.getBoundingClientRect().bottom,H=M.current[D]?.[0]?.getBoundingClientRect().top;N!=null&&H!=null&&(window.innerHeight>=N&&window.innerHeight>=H||H<0)&&M.current[D][z]?.scrollIntoView({block:"center",behavior:"auto"})},0);const ie=setInterval(()=>{const N=M.current[D]?.[z]?.getBoundingClientRect().left,H=M.current[D]?.[z]?.getBoundingClientRect().right,L=M.current[D]?.[z]?.offsetWidth;if(N!=null&&L!=null&&H!=null&&(N<window.innerWidth-L||H<window.innerWidth)){clearInterval(ie);const Q=T.threadId,se=T.onThreadShownCallback;Q&&(v(null),A(T.threadId),se?.())}},500);setTimeout(()=>{clearInterval(ie),v(null)},2e3)}},[T,f,A,v]),o.jsxRuntimeExports.jsx(qj,{children:o.jsxRuntimeExports.jsxs(ca.Provider,{value:Y,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:E,width:P})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:E,innerElementType:da,itemCount:e.companies.length,itemSize:O,onItemsRendered:W=>g(W),itemData:{reviewView:e,isReviewVendorColumnVisible:r,analytics:i,makeCompanyNameSticky:w,allUsers:n,addThreadRequestThreadId:I,setElementRef:G,setAddThreadRequestThreadId:K,setNoteData:y,onTransactionTagClicked:c,onCompanyNameClicked:p,onRetryBankAccountConnection:m,onUncategorizedAccountsErrorClick:h,onReviewVendorTagClicked:S,onClickAuditScore:d,onClickWarningsCount:l},width:P,ref:b,overscanCount:Mt,children:pa})}),j!=null?o.jsxRuntimeExports.jsx(Ze.RoomProvider,{id:j.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${j.companyName} ${Hj}`,filter:{application:"cockpit",companyId:j.companyId,entityType:j.entityType,isGlobalComment:!1,tab:"audit"},isLoading:!1,threadMetadata:{companyName:j.companyName,companyId:j.companyId,entityId:j.companyId,entityType:j.entityType,isGlobalComment:!1,application:"cockpit",tab:"audit",url:window.location.href},textOverrides:{composerPlaceholder:Kj,replyComposerPlaceholder:Gj,threadResolve:Yj,threadUnResolve:Zj},onThreadClick:E=>null,onCloseAllThreadsDrawer:()=>y(null)})}):null]})})},ca=u.createContext(void 0),da=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,isReviewVendorColumnVisible:c,onColumnSortConfigChanged:p}=u.useContext(ca);return o.jsxRuntimeExports.jsxs(e4,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(ij,{companyNameSticky:d,onColumnSortConfigChanged:p,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder},isReviewVendorColumnVisible:c}),o.jsxRuntimeExports.jsx(Jj,{children:r})]})});da.displayName="Review list view inner element type";const pa=({index:e,style:n,data:r})=>{const{reviewView:i,isReviewVendorColumnVisible:a,makeCompanyNameSticky:d,allUsers:l,analytics:c,addThreadRequestThreadId:p,setElementRef:m,setNoteData:h,onCompanyNameClicked:S,onTransactionTagClicked:x,setAddThreadRequestThreadId:C,onUncategorizedAccountsErrorClick:b,onReviewVendorTagClicked:f,onClickAuditScore:g,onClickWarningsCount:j}=r,y=i.companies[e],{companyId:$}=y;return o.jsxRuntimeExports.jsx(Qj,{style:{...n,width:"fit-content",minWidth:"100%"},children:o.jsxRuntimeExports.jsx(Oj,{totalHeight:typeof n.height=="number"?n.height:Ie,addThreadRequestThreadId:p,setNoteData:h,setElementRef:m,setAddThreadRequestThreadId:C,analytics:c,companyView:i.companies[e],isReviewVendorColumnVisible:a,companyNameSticky:d,onCompanyNameClicked:S,onTransactionTagClicked:x,allUsers:l,onUncategorizedAccountsErrorClick:b,onReviewVendorTagClicked:f,onClickWarningsCount:j,onClickAuditScore:g})},$)};pa.displayName="ListItem";const qj=s.div`
5026
5026
  /** Subtract top so list can occupy remaining available height */
5027
5027
  height: calc(100vh - 150px);
5028
5028
  max-width: 99.9%;
@@ -5051,7 +5051,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
5051
5051
  height: calc(100vh - 60px);
5052
5052
  overflow-y: hidden;
5053
5053
  background-color: ${e=>e.theme.colors.grey4};
5054
- `,s4=({headerData:e,headerActions:n,initialOpenThreadRequest:r,reviewPageActions:i,reviewPageData:a,analytics:d})=>{const{reviewView:l,zeniUserFetchState:c,allUsers:p,isReviewVendorColumnVisible:m}=a,{onColumnSortConfigChanged:h,onCockpitReloadData:S,onCompanyNameClicked:x,onClickAuditScore:C,onClickWarningsCount:b,onTransactionTagClicked:f,onRetryBankAccountConnection:g,onReviewVendorTagClicked:j,onUncategorizedAccountsErrorClick:y}=i,$=l.uiState.filterText,w=l.fetchState==="Completed",O=u.useMemo(()=>n.filterActions?{...n,filterActions:{...n.filterActions}}:n,[n]);return o.jsxRuntimeExports.jsxs(n4,{children:[o.jsxRuntimeExports.jsx(ht,{headerActions:O,headerData:{...e,allTabOptions:xt,filterData:{filterText:$,disableFilters:!0},selectedTabOption:"audit",companiesLoaded:w}}),o.jsxRuntimeExports.jsx(r4,{allUsers:p,analytics:d,initialOpenThreadRequest:r,isReviewVendorColumnVisible:m,reviewView:l,zeniUserFetchState:c,onColumnSortConfigChanged:h,onCockpitReloadData:S,onCompanyNameClicked:x,onClickAuditScore:C,onClickWarningsCount:b,onRetryBankAccountConnection:g,onReviewVendorTagClicked:j,onTransactionTagClicked:f,onUncategorizedAccountsErrorClick:y})]})},r4=({reviewView:e,zeniUserFetchState:n,allUsers:r,isReviewVendorColumnVisible:i,analytics:a,initialOpenThreadRequest:d,onClickAuditScore:l,onColumnSortConfigChanged:c,onCockpitReloadData:p,onCompanyNameClicked:m,onClickWarningsCount:h,onTransactionTagClicked:S,onRetryBankAccountConnection:x,onReviewVendorTagClicked:C,onUncategorizedAccountsErrorClick:b})=>{const f=t.useWindowSizeContext();return e.fetchState==="Error"?o.jsxRuntimeExports.jsx(jt,{onCockpitReloadData:p,selectedCockpitOption:"audit"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"||n==="In-Progress"||n==="Not-Started"?o.jsxRuntimeExports.jsx(t4,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.companies.length===0?e.uiState.filterText.trim().length>0?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextFirstLine,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine}):o.jsxRuntimeExports.jsx(rj,{}):o.jsxRuntimeExports.jsx(o4,{windowSize:f,children:o.jsxRuntimeExports.jsx(Xj,{allUsers:r,analytics:a,initialOpenThreadRequest:d,isReviewVendorColumnVisible:i,reviewView:e,onColumnSortConfigChanged:c,onCompanyNameClicked:m,onClickAuditScore:l,onClickWarningsCount:h,onRetryBankAccountConnection:x,onReviewVendorTagClicked:C,onTransactionTagClicked:S,onUncategorizedAccountsErrorClick:b})})},i4=s.div`
5054
+ `,s4=({headerData:e,headerActions:n,initialOpenThreadRequest:r,reviewPageActions:i,reviewPageData:a,analytics:d})=>{const{reviewView:l,zeniUserFetchState:c,allUsers:p,isReviewVendorColumnVisible:m}=a,{onColumnSortConfigChanged:h,onCockpitReloadData:S,onCompanyNameClicked:x,onClickAuditScore:C,onClickWarningsCount:b,onTransactionTagClicked:f,onRetryBankAccountConnection:g,onReviewVendorTagClicked:j,onUncategorizedAccountsErrorClick:y}=i,$=l.uiState.filterText,w=l.fetchState==="Completed",O=u.useMemo(()=>n.filterActions?{...n,filterActions:{...n.filterActions}}:n,[n]);return o.jsxRuntimeExports.jsxs(n4,{children:[o.jsxRuntimeExports.jsx(ht,{headerActions:O,headerData:{...e,allTabOptions:xt,filterData:{filterText:$,disableFilters:!0},selectedTabOption:"audit",companiesLoaded:w}}),o.jsxRuntimeExports.jsx(r4,{allUsers:p,analytics:d,initialOpenThreadRequest:r,isReviewVendorColumnVisible:m,reviewView:l,zeniUserFetchState:c,onColumnSortConfigChanged:h,onCockpitReloadData:S,onCompanyNameClicked:x,onClickAuditScore:C,onClickWarningsCount:b,onRetryBankAccountConnection:g,onReviewVendorTagClicked:j,onTransactionTagClicked:f,onUncategorizedAccountsErrorClick:y})]})},r4=({reviewView:e,zeniUserFetchState:n,allUsers:r,isReviewVendorColumnVisible:i,analytics:a,initialOpenThreadRequest:d,onClickAuditScore:l,onColumnSortConfigChanged:c,onCockpitReloadData:p,onCompanyNameClicked:m,onClickWarningsCount:h,onTransactionTagClicked:S,onRetryBankAccountConnection:x,onReviewVendorTagClicked:C,onUncategorizedAccountsErrorClick:b})=>{const f=t.useWindowSizeContext();return e.fetchState==="Error"?o.jsxRuntimeExports.jsx(bt,{onCockpitReloadData:p,selectedCockpitOption:"audit"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"||n==="In-Progress"||n==="Not-Started"?o.jsxRuntimeExports.jsx(t4,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.companies.length===0?e.uiState.filterText.trim().length>0?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextFirstLine,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine}):o.jsxRuntimeExports.jsx(rj,{}):o.jsxRuntimeExports.jsx(o4,{windowSize:f,children:o.jsxRuntimeExports.jsx(Xj,{allUsers:r,analytics:a,initialOpenThreadRequest:d,isReviewVendorColumnVisible:i,reviewView:e,onColumnSortConfigChanged:c,onCompanyNameClicked:m,onClickAuditScore:l,onClickWarningsCount:h,onRetryBankAccountConnection:x,onReviewVendorTagClicked:C,onTransactionTagClicked:S,onUncategorizedAccountsErrorClick:b})})},i4=s.div`
5055
5055
  display: flex;
5056
5056
  width: 100%;
5057
5057
  padding: ${t.Space.sp3};
@@ -5099,7 +5099,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
5099
5099
  `,g4=s(t.StandardRegular)`
5100
5100
  margin-bottom: ${t.Space.sp4};
5101
5101
  color: ${e=>e.theme.colors.hero};
5102
- `,S4=({auditSummaryData:e,isAuditScoreLoadingCompleted:n,isMonthEnd:r})=>{const i=!n,a=o.useTheme(),{common:d,dateFormat:l,cockpit:c}=t.appLocale.getLocalizedStrings(),p=e,m=r?p.bypassedAuditScore:p.auditScorePercentage;let h;m<=50?h=t.Colors.important:m<=75?h=t.Colors.alert:h=t.Colors.success;const S=u.useCallback(()=>p.fixesRequired>0?`${d.strings.openingBrace}${p.fixesRequired} ${p.fixesRequired>1?d.texts.issues:d.texts.issue}${d.strings.closingBrace}`:d.strings.empty,[p.fixesRequired,d.strings,d.texts]);return o.jsxRuntimeExports.jsx(i4,{isAuditScoreLoading:i,children:o.jsxRuntimeExports.jsx(l4,{auditPercentage:m,children:o.jsxRuntimeExports.jsxs(a4,{children:[!i&&o.jsxRuntimeExports.jsx(c4,{children:o.jsxRuntimeExports.jsx(o.CircularProgressbar,{value:m,text:`${Math.ceil(m)}${d.strings.percentage}`,strokeWidth:10,styles:o.buildStyles({rotation:.5,strokeLinecap:"butt",pathColor:h,textColor:a.colors.primary,trailColor:a.colors.grey3,textSize:t.Space.sp4})})}),o.jsxRuntimeExports.jsx(d4,{children:o.jsxRuntimeExports.jsxs(p4,{children:[o.jsxRuntimeExports.jsxs(u4,{children:[o.jsxRuntimeExports.jsx(m4,{children:i?c.monthEndReport.auditScoreSectionLoadingTitle.replace("__date__",ee.dateNow().subtract(1,"month").format(l.visual.MMMMYYYYFormat)):c.monthEndReport.auditScoreSectionTitle}),i?null:o.jsxRuntimeExports.jsx(x4,{children:S()})]}),o.jsxRuntimeExports.jsx(h4,{children:o.jsxRuntimeExports.jsx(g4,{children:i?c.review.auditReportDrawer.subTitle:c.review.auditReportDrawer.reportGeneratedSubtitle})})]})})]})})})},y4=({open:e,anchorElement:n,children:r,onClose:i})=>{const a=o.useTheme();return o.jsxRuntimeExports.jsx(o.Popover,{transitionDuration:0,anchorEl:n,open:e,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",background:a.colors.grey5,boxSizing:"border-box",transform:"translate(0px,30px)",padding:t.Space.sp3,borderRadius:t.Space.sp2}},onClose:i,children:r})},f4=({rule:e,commentsText:n,ruleGroup:r,isControllerOrReviewer:i,triggerComponent:a,setCommentsText:d,handleReasonAuditRule:l})=>{const[c,p]=u.useState(!1),[m,h]=u.useState(n),S=u.useRef(null),{cockpit:x,common:C}=t.appLocale.getLocalizedStrings(),b=o.useTheme();u.useEffect(()=>{n!==""&&p(!0)},[n]);const f=()=>{m!==""&&e.reasonUpdateFetchState.fetchState!=="In-Progress"&&l(e.auditRuleId,r.auditRuleGroupId,m,i?"approved":"pending")};return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{p(!1)},children:o.jsxRuntimeExports.jsxs(k4,{ref:S,children:[a!=null?o.jsxRuntimeExports.jsxs(v4,{className:"placeholder",onClick:()=>{p(!c)},children:[a," "]}):null,c?o.jsxRuntimeExports.jsxs(y4,{open:c,anchorElement:S.current,onClose:()=>p(!1),children:[o.jsxRuntimeExports.jsx(b4,{children:o.jsxRuntimeExports.jsx(C4,{children:x.review.auditReportDrawer.commentTitle})}),o.jsxRuntimeExports.jsx(T4,{autoFocus:!0,onFocus:g=>{if(g.target instanceof HTMLTextAreaElement){const j=g.target.value;g.target.value="",g.target.value=j}},placeholder:x.commentPlaceholder,value:m,onChange:g=>{g.target instanceof HTMLTextAreaElement&&h(g.target.value)}}),o.jsxRuntimeExports.jsx($4,{}),o.jsxRuntimeExports.jsx(E4,{}),o.jsxRuntimeExports.jsxs(j4,{children:[o.jsxRuntimeExports.jsx(w4,{}),o.jsxRuntimeExports.jsxs(R4,{children:[o.jsxRuntimeExports.jsx(L4,{disabled:e.reasonUpdateFetchState.fetchState==="In-Progress",size:"small",style:{whiteSpace:"nowrap",padding:`${t.Space.sp1} ${t.Space.sp3}`,borderRadius:t.Space.sp2},textStyle:{color:b.colors.primary},label:C.footer.cancel,onClick:()=>{n!==""&&l(e.auditRuleId,r.auditRuleGroupId,n,"pending"),d(""),p(!1)}}),o.jsxRuntimeExports.jsx(P4,{disabled:m===""&&e.reasonUpdateFetchState.fetchState==="In-Progress",variant:"primary",size:"small",style:{whiteSpace:"nowrap",padding:i?`${t.Space.sp1} 14px`:`${t.Space.sp1} 22px`,borderRadius:t.Space.sp2},onClick:f,label:i?C.footer.resolve:C.footer.send,loading:e.reasonUpdateFetchState.fetchState==="In-Progress"})]})]})]}):null]})})},C4=s(t.LargeRegular)`
5102
+ `,S4=({auditSummaryData:e,isAuditScoreLoadingCompleted:n,isMonthEnd:r})=>{const i=!n,a=o.useTheme(),{common:d,dateFormat:l,cockpit:c}=t.appLocale.getLocalizedStrings(),p=e,m=r?p.bypassedAuditScore:p.auditScorePercentage;let h;m<=50?h=t.Colors.important:m<=75?h=t.Colors.alert:h=t.Colors.success;const S=u.useCallback(()=>p.fixesRequired>0?`${d.strings.openingBrace}${p.fixesRequired} ${p.fixesRequired>1?d.texts.issues:d.texts.issue}${d.strings.closingBrace}`:d.strings.empty,[p.fixesRequired,d.strings,d.texts]);return o.jsxRuntimeExports.jsx(i4,{isAuditScoreLoading:i,children:o.jsxRuntimeExports.jsx(l4,{auditPercentage:m,children:o.jsxRuntimeExports.jsxs(a4,{children:[!i&&o.jsxRuntimeExports.jsx(c4,{children:o.jsxRuntimeExports.jsx(o.CircularProgressbar,{value:m,text:`${Math.ceil(m)}${d.strings.percentage}`,strokeWidth:10,styles:o.buildStyles({rotation:.5,strokeLinecap:"butt",pathColor:h,textColor:a.colors.primary,trailColor:a.colors.grey3,textSize:t.Space.sp4})})}),o.jsxRuntimeExports.jsx(d4,{children:o.jsxRuntimeExports.jsxs(p4,{children:[o.jsxRuntimeExports.jsxs(u4,{children:[o.jsxRuntimeExports.jsx(m4,{children:i?c.monthEndReport.auditScoreSectionLoadingTitle.replace("__date__",J.dateNow().subtract(1,"month").format(l.visual.MMMMYYYYFormat)):c.monthEndReport.auditScoreSectionTitle}),i?null:o.jsxRuntimeExports.jsx(x4,{children:S()})]}),o.jsxRuntimeExports.jsx(h4,{children:o.jsxRuntimeExports.jsx(g4,{children:i?c.review.auditReportDrawer.subTitle:c.review.auditReportDrawer.reportGeneratedSubtitle})})]})})]})})})},y4=({open:e,anchorElement:n,children:r,onClose:i})=>{const a=o.useTheme();return o.jsxRuntimeExports.jsx(o.Popover,{transitionDuration:0,anchorEl:n,open:e,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",background:a.colors.grey5,boxSizing:"border-box",transform:"translate(0px,30px)",padding:t.Space.sp3,borderRadius:t.Space.sp2}},onClose:i,children:r})},f4=({rule:e,commentsText:n,ruleGroup:r,isControllerOrReviewer:i,triggerComponent:a,setCommentsText:d,handleReasonAuditRule:l})=>{const[c,p]=u.useState(!1),[m,h]=u.useState(n),S=u.useRef(null),{cockpit:x,common:C}=t.appLocale.getLocalizedStrings(),b=o.useTheme();u.useEffect(()=>{n!==""&&p(!0)},[n]);const f=()=>{m!==""&&e.reasonUpdateFetchState.fetchState!=="In-Progress"&&l(e.auditRuleId,r.auditRuleGroupId,m,i?"approved":"pending")};return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{p(!1)},children:o.jsxRuntimeExports.jsxs(k4,{ref:S,children:[a!=null?o.jsxRuntimeExports.jsxs(v4,{className:"placeholder",onClick:()=>{p(!c)},children:[a," "]}):null,c?o.jsxRuntimeExports.jsxs(y4,{open:c,anchorElement:S.current,onClose:()=>p(!1),children:[o.jsxRuntimeExports.jsx(b4,{children:o.jsxRuntimeExports.jsx(C4,{children:x.review.auditReportDrawer.commentTitle})}),o.jsxRuntimeExports.jsx(T4,{autoFocus:!0,onFocus:g=>{if(g.target instanceof HTMLTextAreaElement){const j=g.target.value;g.target.value="",g.target.value=j}},placeholder:x.commentPlaceholder,value:m,onChange:g=>{g.target instanceof HTMLTextAreaElement&&h(g.target.value)}}),o.jsxRuntimeExports.jsx($4,{}),o.jsxRuntimeExports.jsx(E4,{}),o.jsxRuntimeExports.jsxs(j4,{children:[o.jsxRuntimeExports.jsx(w4,{}),o.jsxRuntimeExports.jsxs(R4,{children:[o.jsxRuntimeExports.jsx(L4,{disabled:e.reasonUpdateFetchState.fetchState==="In-Progress",size:"small",style:{whiteSpace:"nowrap",padding:`${t.Space.sp1} ${t.Space.sp3}`,borderRadius:t.Space.sp2},textStyle:{color:b.colors.primary},label:C.footer.cancel,onClick:()=>{n!==""&&l(e.auditRuleId,r.auditRuleGroupId,n,"pending"),d(""),p(!1)}}),o.jsxRuntimeExports.jsx(P4,{disabled:m===""&&e.reasonUpdateFetchState.fetchState==="In-Progress",variant:"primary",size:"small",style:{whiteSpace:"nowrap",padding:i?`${t.Space.sp1} 14px`:`${t.Space.sp1} 22px`,borderRadius:t.Space.sp2},onClick:f,label:i?C.footer.resolve:C.footer.send,loading:e.reasonUpdateFetchState.fetchState==="In-Progress"})]})]})]}):null]})})},C4=s(t.LargeRegular)`
5103
5103
  color: ${e=>e.theme.colors.primary};
5104
5104
  margin-bottom: ${t.Space.sp3};
5105
5105
  `,j4=s.div`
@@ -5149,7 +5149,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
5149
5149
  color: ${e=>e.theme.colors.hero};
5150
5150
  ${t.textStyles.largeRegular.css};
5151
5151
  }
5152
- `,L4=s(t.Button)``,P4=s(t.Button)``,I4=({open:e,anchorElement:n,children:r,onClose:i})=>{const a=o.useTheme();return o.jsxRuntimeExports.jsx(o.Popover,{transitionDuration:0,anchorEl:n,open:e,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{style:{width:"356px",display:"flex",flexDirection:"column",background:a.colors.grey5,boxSizing:"border-box",transform:"translate(0px,10px)",borderRadius:t.Space.sp2}},onClose:i,children:r})},D4=({isControllerOrReviewer:e,allUsers:n,loggedInUser:r,rule:i,ruleGroup:a,triggerComponent:d,isDisabled:l=!1,handleReasonAuditRule:c,setCommentsText:p})=>{const[m,h]=u.useState(!1),S=u.useRef(null),{cockpit:x,common:C,dateFormat:b,timeFormat:f}=t.appLocale.getLocalizedStrings(),g=i.reason!=null&&i.reason.userId?ee.getUserFromAllUsers(n,i.reason.userId):void 0,j=i.reason?.reasonUpdatedAt,y=o.useTheme();return u.useEffect(()=>{i.reasonUpdateFetchState.fetchState==="Completed"&&h(!1)},[i.reasonUpdateFetchState.fetchState]),o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{h(!1)},children:o.jsxRuntimeExports.jsxs(V4,{ref:S,children:[o.jsxRuntimeExports.jsxs(_4,{className:"placeholder",onClick:()=>{h($=>!$)},children:[d," "]}),m&&o.jsxRuntimeExports.jsxs(I4,{open:m,anchorElement:S.current,onClose:()=>h(!1),children:[o.jsxRuntimeExports.jsxs(U4,{children:[o.jsxRuntimeExports.jsxs(W4,{children:[o.jsxRuntimeExports.jsx(A4,{children:g?.photo!=null?o.jsxRuntimeExports.jsx(B4,{src:g.photo.href,alt:x.userProfileAltText,onError:({currentTarget:$})=>{$.onerror=null,$.src=t.AvatarSVG}}):o.jsxRuntimeExports.jsx(t.EntityAvatarWithInitials,{firstName:g?.firstName??"",lastName:g?.lastName??""})}),o.jsxRuntimeExports.jsxs(F4,{children:[o.jsxRuntimeExports.jsx(z4,{children:`${ee.getUserName(g)}`}),o.jsxRuntimeExports.jsxs(M4,{children:[o.jsxRuntimeExports.jsx(O4,{children:j!=null?ee.zeniDate(j.toISOString()).format(b.visual.MMMDFormat)+C.strings.comma:C.strings.empty}),o.jsxRuntimeExports.jsx(N4,{children:j!=null?ee.zeniDate(j.toISOString()).format(f.hhmmAFormat):C.strings.empty})]})]})]}),!e&&r.userId===i.reason?.userId?o.jsxRuntimeExports.jsx(t.MoreMenuButton,{moreIconType:"plain",options:[{label:C.edit,value:C.edit},{label:C.delete,value:C.delete}],onOptionSelection:$=>{c(i.auditRuleId,a.auditRuleGroupId,i.reason?.reasonToPass??"","rejected"),$===C.edit?p(i.reason?.reasonToPass??""):p("")},valueToIcon:$=>$===C.delete?o.jsxRuntimeExports.jsx(t.SvgDelete,{}):$===C.edit?o.jsxRuntimeExports.jsx(Z4,{}):o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{}),customStyleConfig:{menuPortal:()=>({zIndex:1e4})},menuPortalTarget:document.body,menuPosition:"fixed"}):null]}),o.jsxRuntimeExports.jsx(H4,{children:o.jsxRuntimeExports.jsx(K4,{children:i.reason?.reasonToPass})}),e?o.jsxRuntimeExports.jsx(G4,{children:o.jsxRuntimeExports.jsxs(Y4,{children:[o.jsxRuntimeExports.jsx(X4,{size:"small",style:{whiteSpace:"nowrap",padding:`${t.Space.sp1} 22px`,borderRadius:t.Space.sp2},textStyle:{color:y.colors.primary},disabled:i.reasonUpdateFetchState.fetchState==="In-Progress",onClick:()=>{i.reasonUpdateFetchState.fetchState!=="In-Progress"&&c(i.auditRuleId,a.auditRuleGroupId,i.reason?.reasonToPass??"","rejected")},label:C.footer.reject}),o.jsxRuntimeExports.jsx(q4,{variant:"primary",size:"small",style:{whiteSpace:"nowrap",padding:`${t.Space.sp1} 14px`,borderRadius:t.Space.sp2},label:C.footer.approve,disabled:i.reasonUpdateFetchState.fetchState==="In-Progress",onClick:()=>{l!==!0&&i.reasonUpdateFetchState.fetchState!=="In-Progress"&&c(i.auditRuleId,a.auditRuleGroupId,i.reason?.reasonToPass??"","approved")}})]})}):o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{})]})]})})},A4=s.div`
5152
+ `,L4=s(t.Button)``,P4=s(t.Button)``,I4=({open:e,anchorElement:n,children:r,onClose:i})=>{const a=o.useTheme();return o.jsxRuntimeExports.jsx(o.Popover,{transitionDuration:0,anchorEl:n,open:e,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{style:{width:"356px",display:"flex",flexDirection:"column",background:a.colors.grey5,boxSizing:"border-box",transform:"translate(0px,10px)",borderRadius:t.Space.sp2}},onClose:i,children:r})},D4=({isControllerOrReviewer:e,allUsers:n,loggedInUser:r,rule:i,ruleGroup:a,triggerComponent:d,isDisabled:l=!1,handleReasonAuditRule:c,setCommentsText:p})=>{const[m,h]=u.useState(!1),S=u.useRef(null),{cockpit:x,common:C,dateFormat:b,timeFormat:f}=t.appLocale.getLocalizedStrings(),g=i.reason!=null&&i.reason.userId?J.getUserFromAllUsers(n,i.reason.userId):void 0,j=i.reason?.reasonUpdatedAt,y=o.useTheme();return u.useEffect(()=>{i.reasonUpdateFetchState.fetchState==="Completed"&&h(!1)},[i.reasonUpdateFetchState.fetchState]),o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{h(!1)},children:o.jsxRuntimeExports.jsxs(V4,{ref:S,children:[o.jsxRuntimeExports.jsxs(_4,{className:"placeholder",onClick:()=>{h($=>!$)},children:[d," "]}),m&&o.jsxRuntimeExports.jsxs(I4,{open:m,anchorElement:S.current,onClose:()=>h(!1),children:[o.jsxRuntimeExports.jsxs(U4,{children:[o.jsxRuntimeExports.jsxs(W4,{children:[o.jsxRuntimeExports.jsx(A4,{children:g?.photo!=null?o.jsxRuntimeExports.jsx(B4,{src:g.photo.href,alt:x.userProfileAltText,onError:({currentTarget:$})=>{$.onerror=null,$.src=t.AvatarSVG}}):o.jsxRuntimeExports.jsx(t.EntityAvatarWithInitials,{firstName:g?.firstName??"",lastName:g?.lastName??""})}),o.jsxRuntimeExports.jsxs(F4,{children:[o.jsxRuntimeExports.jsx(z4,{children:`${J.getUserName(g)}`}),o.jsxRuntimeExports.jsxs(M4,{children:[o.jsxRuntimeExports.jsx(O4,{children:j!=null?J.zeniDate(j.toISOString()).format(b.visual.MMMDFormat)+C.strings.comma:C.strings.empty}),o.jsxRuntimeExports.jsx(N4,{children:j!=null?J.zeniDate(j.toISOString()).format(f.hhmmAFormat):C.strings.empty})]})]})]}),!e&&r.userId===i.reason?.userId?o.jsxRuntimeExports.jsx(t.MoreMenuButton,{moreIconType:"plain",options:[{label:C.edit,value:C.edit},{label:C.delete,value:C.delete}],onOptionSelection:$=>{c(i.auditRuleId,a.auditRuleGroupId,i.reason?.reasonToPass??"","rejected"),$===C.edit?p(i.reason?.reasonToPass??""):p("")},valueToIcon:$=>$===C.delete?o.jsxRuntimeExports.jsx(t.SvgDelete,{}):$===C.edit?o.jsxRuntimeExports.jsx(Z4,{}):o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{}),customStyleConfig:{menuPortal:()=>({zIndex:1e4})},menuPortalTarget:document.body,menuPosition:"fixed"}):null]}),o.jsxRuntimeExports.jsx(H4,{children:o.jsxRuntimeExports.jsx(K4,{children:i.reason?.reasonToPass})}),e?o.jsxRuntimeExports.jsx(G4,{children:o.jsxRuntimeExports.jsxs(Y4,{children:[o.jsxRuntimeExports.jsx(X4,{size:"small",style:{whiteSpace:"nowrap",padding:`${t.Space.sp1} 22px`,borderRadius:t.Space.sp2},textStyle:{color:y.colors.primary},disabled:i.reasonUpdateFetchState.fetchState==="In-Progress",onClick:()=>{i.reasonUpdateFetchState.fetchState!=="In-Progress"&&c(i.auditRuleId,a.auditRuleGroupId,i.reason?.reasonToPass??"","rejected")},label:C.footer.reject}),o.jsxRuntimeExports.jsx(q4,{variant:"primary",size:"small",style:{whiteSpace:"nowrap",padding:`${t.Space.sp1} 14px`,borderRadius:t.Space.sp2},label:C.footer.approve,disabled:i.reasonUpdateFetchState.fetchState==="In-Progress",onClick:()=>{l!==!0&&i.reasonUpdateFetchState.fetchState!=="In-Progress"&&c(i.auditRuleId,a.auditRuleGroupId,i.reason?.reasonToPass??"","approved")}})]})}):o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{})]})]})})},A4=s.div`
5153
5153
  display: flex;
5154
5154
  margin-right: ${t.Space.sp2};
5155
5155
  margin-left: ${t.Space.sp2};
@@ -5261,7 +5261,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
5261
5261
  justify-content: space-around;
5262
5262
  align-items: center;
5263
5263
  color: ${t.Colors.brandColorGoldDark};
5264
- `,Zt=t.appLocale.getLocalizedStrings(),{cockpit:{review:ib}}=Zt,oi=({loggedInUser:e,isControllerOrReviewer:n,allUsers:r,isMonthEnd:i,auditReportGroup:a,groupIdWithActiveStatus:d,ruleGroup:l,setGroupIdWithActiveStatus:c,onClickRetryGroupFetch:p,onClickRule:m,handleReasonAuditRule:h})=>{const S=a.fetchState,x=S==="In-Progress"&&d[l.auditRuleGroupId].isActive===!0,C=(S==="Completed"||S==="Error")&&d[l.auditRuleGroupId].isActive===!0,b=!a.auditReport?.auditRulesGroupReport[0]?.isSuccess,f=ab(C,x,l,a),g=()=>{const y=d[l.auditRuleGroupId];S==="Completed"&&c({...d,[l.auditRuleGroupId]:{...y,isGroupExpanded:!y.isGroupExpanded}})},j=()=>{p(a.auditReportGroupId)};return o.jsxRuntimeExports.jsxs(lb,{isGroupActive:C,isGroupLoading:x,isAnyIssueInReportGroup:b,groupFetchState:S,isGroupExpanded:d[l.auditRuleGroupId].isGroupExpanded,isFirst:d[l.auditRuleGroupId].isFirst,isLast:d[l.auditRuleGroupId].isLast,children:[o.jsxRuntimeExports.jsxs(cb,{onClick:g,children:[x?o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Small",style:{display:"flex"},start:!0}):C?b?o.jsxRuntimeExports.jsx(ni,{}):S==="Error"?o.jsxRuntimeExports.jsx(ni,{}):o.jsxRuntimeExports.jsx(hb,{}):o.jsxRuntimeExports.jsx(gb,{}),o.jsxRuntimeExports.jsxs(db,{children:[o.jsxRuntimeExports.jsx(mb,{isGroupActive:C,isGroupLoading:x,isAnyIssueInReportGroup:b,groupFetchState:S,children:f}),C?S==="Completed"&&(a.auditReport?.auditRulesGroupReport[0]?.auditRules.length??0)>0?d[l.auditRuleGroupId].isGroupExpanded?o.jsxRuntimeExports.jsx(ub,{isAnyIssueInReportGroup:b}):o.jsxRuntimeExports.jsx(pb,{isAnyIssueInReportGroup:b}):o.jsxRuntimeExports.jsx(t.Button,{label:Zt.common.retry,onClick:j,variant:"outline",buttonColors:{borderColor:{default:t.Colors.neutralGrey2Light,hover:t.Colors.primaryLight,disabled:t.Colors.neutralGrey2Light},backgroundColor:{default:"transparent",hover:"transparent",disabled:"transparent"},textColor:{default:t.Colors.heroLight,hover:t.Colors.primaryLight,disabled:t.Colors.heroLight}},style:{padding:`${t.Space.sp1} ${t.Space.sp3}`,borderRadius:t.Space.sp1,marginBottom:"-2px",marginTop:"-2px"},textStyle:{...t.textStyles.smallRegular.cssObject}}):null]})]}),d[l.auditRuleGroupId].isGroupExpanded?o.jsxRuntimeExports.jsx(xb,{children:a.auditReport?.auditRulesGroupReport.map(y=>y.auditRules.map($=>o.jsxRuntimeExports.jsx(Q4,{loggedInUser:e,isControllerOrReviewer:n,allUsers:r,isMonthEnd:i,rule:$,isGroupFixed:!b,ruleGroup:l,onClickRule:m,handleReasonAuditRule:h},$.auditRuleId)))}):null]})},ab=(e,n,r,i)=>{if(e){if(i.fetchState==="Error")return`${Zt.cockpit.errorMessages.auditReportFetchError} ${r.auditRuleGroupDescription.toLocaleLowerCase()}`;if(i.fetchState==="Completed"){const a=ua(i.auditReport?.auditRulesGroupReport[0]?.auditRules);return i.auditReport?.auditRulesGroupReport[0].isSuccess===!0?r.auditRuleGroupDescription:`${r.auditRuleGroupDescription} (${a})`}return Zt.common.strings.empty}else return(n?ib.auditReportDrawer.reviewing:Zt.common.review)+Zt.common.strings.space+r.auditRuleGroupDescription.toLocaleLowerCase()},ua=e=>e?.filter(r=>r.isSuccess===!1)?.length??0,lb=s.div`
5264
+ `,Zt=t.appLocale.getLocalizedStrings(),{cockpit:{review:ib}}=Zt,ti=({loggedInUser:e,isControllerOrReviewer:n,allUsers:r,isMonthEnd:i,auditReportGroup:a,groupIdWithActiveStatus:d,ruleGroup:l,setGroupIdWithActiveStatus:c,onClickRetryGroupFetch:p,onClickRule:m,handleReasonAuditRule:h})=>{const S=a.fetchState,x=S==="In-Progress"&&d[l.auditRuleGroupId].isActive===!0,C=(S==="Completed"||S==="Error")&&d[l.auditRuleGroupId].isActive===!0,b=!a.auditReport?.auditRulesGroupReport[0]?.isSuccess,f=ab(C,x,l,a),g=()=>{const y=d[l.auditRuleGroupId];S==="Completed"&&c({...d,[l.auditRuleGroupId]:{...y,isGroupExpanded:!y.isGroupExpanded}})},j=()=>{p(a.auditReportGroupId)};return o.jsxRuntimeExports.jsxs(lb,{isGroupActive:C,isGroupLoading:x,isAnyIssueInReportGroup:b,groupFetchState:S,isGroupExpanded:d[l.auditRuleGroupId].isGroupExpanded,isFirst:d[l.auditRuleGroupId].isFirst,isLast:d[l.auditRuleGroupId].isLast,children:[o.jsxRuntimeExports.jsxs(cb,{onClick:g,children:[x?o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Small",style:{display:"flex"},start:!0}):C?b?o.jsxRuntimeExports.jsx(oi,{}):S==="Error"?o.jsxRuntimeExports.jsx(oi,{}):o.jsxRuntimeExports.jsx(hb,{}):o.jsxRuntimeExports.jsx(gb,{}),o.jsxRuntimeExports.jsxs(db,{children:[o.jsxRuntimeExports.jsx(mb,{isGroupActive:C,isGroupLoading:x,isAnyIssueInReportGroup:b,groupFetchState:S,children:f}),C?S==="Completed"&&(a.auditReport?.auditRulesGroupReport[0]?.auditRules.length??0)>0?d[l.auditRuleGroupId].isGroupExpanded?o.jsxRuntimeExports.jsx(ub,{isAnyIssueInReportGroup:b}):o.jsxRuntimeExports.jsx(pb,{isAnyIssueInReportGroup:b}):o.jsxRuntimeExports.jsx(t.Button,{label:Zt.common.retry,onClick:j,variant:"outline",buttonColors:{borderColor:{default:t.Colors.neutralGrey2Light,hover:t.Colors.primaryLight,disabled:t.Colors.neutralGrey2Light},backgroundColor:{default:"transparent",hover:"transparent",disabled:"transparent"},textColor:{default:t.Colors.heroLight,hover:t.Colors.primaryLight,disabled:t.Colors.heroLight}},style:{padding:`${t.Space.sp1} ${t.Space.sp3}`,borderRadius:t.Space.sp1,marginBottom:"-2px",marginTop:"-2px"},textStyle:{...t.textStyles.smallRegular.cssObject}}):null]})]}),d[l.auditRuleGroupId].isGroupExpanded?o.jsxRuntimeExports.jsx(xb,{children:a.auditReport?.auditRulesGroupReport.map(y=>y.auditRules.map($=>o.jsxRuntimeExports.jsx(Q4,{loggedInUser:e,isControllerOrReviewer:n,allUsers:r,isMonthEnd:i,rule:$,isGroupFixed:!b,ruleGroup:l,onClickRule:m,handleReasonAuditRule:h},$.auditRuleId)))}):null]})},ab=(e,n,r,i)=>{if(e){if(i.fetchState==="Error")return`${Zt.cockpit.errorMessages.auditReportFetchError} ${r.auditRuleGroupDescription.toLocaleLowerCase()}`;if(i.fetchState==="Completed"){const a=ua(i.auditReport?.auditRulesGroupReport[0]?.auditRules);return i.auditReport?.auditRulesGroupReport[0].isSuccess===!0?r.auditRuleGroupDescription:`${r.auditRuleGroupDescription} (${a})`}return Zt.common.strings.empty}else return(n?ib.auditReportDrawer.reviewing:Zt.common.review)+Zt.common.strings.space+r.auditRuleGroupDescription.toLocaleLowerCase()},ua=e=>e?.filter(r=>r.isSuccess===!1)?.length??0,lb=s.div`
5265
5265
  display: flex;
5266
5266
  background-color: ${e=>e.isGroupActive&&(e.groupFetchState==="Error"||e.isAnyIssueInReportGroup)?t.Colors.alertLight:e.theme.colors.grey5};
5267
5267
  border: ${e=>`1px solid ${e.theme.colors.grey3}`};
@@ -5309,7 +5309,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
5309
5309
  margin-left: ${t.Space.sp7};
5310
5310
  margin-bottom: ${t.Space.sp3};
5311
5311
  flex-direction: column;
5312
- `,ni=s(t.SvgHighImportanceFill)`
5312
+ `,oi=s(t.SvgHighImportanceFill)`
5313
5313
  width: ${t.Space.sp4};
5314
5314
  height: ${t.Space.sp4};
5315
5315
  color: ${t.Colors.brandColorGoldDark};
@@ -5321,7 +5321,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
5321
5321
  width: ${t.Space.sp4};
5322
5322
  height: ${t.Space.sp4};
5323
5323
  color: ${e=>e.theme.colors.grey2};
5324
- `,cs={navBarHeight:new t.ResponsiveSized(62,62,62),navBarPaddingLeft:new t.ResponsiveSized(t.sp[3],t.sp[3],t.sp[8]),navBarPaddingRight:new t.ResponsiveSized(t.sp[3],t.sp[3],t.sp[8])},{cockpit:{review:yo},dateFormat:qn,timeFormat:Sb,common:yb}=t.appLocale.getLocalizedStrings(),fb=({isAuditScoreCompleted:e,auditRuleGroups:n,loggedInUser:r,isMonthEnd:i,auditReportGroupView:a,allUsers:d,reviewCompanyView:l,style:c,analytics:p,handleFetchAuditReportGroupView:m,handleGenerateAuditReport:h,handleCancelIconClick:S,handleRuleClick:x,handleReasonAuditRule:C})=>{const b=t.useWindowSizeContext(),[f,g]=u.useState(Qn(n,1)),[j,y]=u.useState({id:n[0]?.auditRuleGroupId,index:0}),[$,w]=u.useState(!1),[O,A]=u.useState(1),[v,T]=u.useState(!1),[F,I]=u.useState(null),K=u.useMemo(()=>l?.controllers.map(k=>`${k.user.firstName} ${k.user.middleName} ${k.user.lastName}`)??[],[l?.controllers]),M={fixesRequired:0,totalChecks:0,auditScorePercentage:0,bypassedAuditScore:0,auditReportLastGeneratedDate:null};u.useEffect(()=>{a.auditReportGroups.forEach(k=>{a.auditReportGroups.forEach(z=>{z.auditReportGroupId===j.id&&(z.fetchState==="Completed"||z.fetchState==="Error")&&y({id:n[j.index+1]?.auditRuleGroupId,index:j.index+1})});const D=k.auditReport?.auditRulesGroupReport.find(z=>z.auditRuleGroupId===k.auditReportGroupId);(k.fetchState==="Completed"&&j.id===k.auditReportGroupId&&f[k.auditReportGroupId].isActive===!0&&D?.sequence===O||k.fetchState==="Error"&&j.id===k.auditReportGroupId)&&(A(O+1),g(Qn(n,O+1)))})},[a.auditReportGroups,O,n,f]),u.useEffect(()=>{if(a.auditReportGroups.filter(Z=>Z.fetchState==="In-Progress").length===0&&w(!0),a.auditReportGroups.filter(Z=>Z.fetchState==="Completed"||Z.fetchState==="Error").length===n.length){T(!0);let Z=0;a.auditReportGroups.forEach(Q=>{Z=Z+ua(Q.auditReport?.auditRulesGroupReport[0]?.auditRules)});const ie=Cb(a),N=ee.dateNow().startOf("month").subtract(1,"date").format(qn.analytics.MMMYYYYFormat),H=l?.customerGroup,L=Math.ceil(a.auditReportGroups[0].auditReport?.auditSummary.auditScorePercentage??0);p.trackAuditScorePercentage(ee.dateNow().format(qn.analytics.MMSlashDDSlashYYYYFormat),N,L,l?.name??"",ie,Z,K,H??null)}const z=a.auditReportGroups.find(Z=>Z.fetchState==="Completed");z?.auditReport?.status?.lastRefreshSuccessTime!=null&&I(z)},[a.auditReportGroups,n.length,p,l,a,K]);const Y=()=>{g(Qn(n,1)),y({id:n[0]?.auditRuleGroupId,index:0}),w(!1),A(1),T(!1),I(null)},G=()=>{Y();const k=n.map(D=>D.auditRuleGroupId);h(k)},E=()=>{S()},P=k=>{m(k)},W=(k,D,z)=>{p.trackAuditIssuesClicked(z,l?.name??"",K,ee.dateNow().format(qn.analytics.MMSlashDDSlashYYYYFormat)),x(k,D)};return o.jsxRuntimeExports.jsxs(jb,{style:c,children:[o.jsxRuntimeExports.jsx(Eb,{windowSize:b,style:c,children:o.jsxRuntimeExports.jsx(wb,{children:o.jsxRuntimeExports.jsxs(vb,{windowSize:b,children:[o.jsxRuntimeExports.jsx(bb,{}),o.jsxRuntimeExports.jsxs(kb,{children:[o.jsxRuntimeExports.jsx(Tb,{children:l?.name}),o.jsxRuntimeExports.jsx(Lb,{children:v?F?.auditReport?.status?.lastRefreshSuccessTime?.utc(!0).local().format(Sb.hmmADashDDMMMCommaYYYY):yb.strings.empty})]}),o.jsxRuntimeExports.jsxs(Ib,{children:[o.jsxRuntimeExports.jsxs(Pb,{isGenerateClickEnabled:$,onClick:G,children:[o.jsxRuntimeExports.jsx(Ab,{}),o.jsxRuntimeExports.jsx(Db,{children:yo.auditReportDrawer.updateScore})]}),o.jsxRuntimeExports.jsx(Ob,{onClick:E,children:o.jsxRuntimeExports.jsx(Nb,{})})]})]})})}),o.jsxRuntimeExports.jsxs(Rb,{children:[o.jsxRuntimeExports.jsx($b,{children:o.jsxRuntimeExports.jsx(S4,{auditSummaryData:l!=null?l.auditSummary:M,isAuditScoreLoadingCompleted:v&&e,isMonthEnd:i})}),o.jsxRuntimeExports.jsxs(si,{children:[o.jsxRuntimeExports.jsx(ri,{children:yo.auditReportDrawer.Business}),o.jsxRuntimeExports.jsx(ii,{children:n.filter(k=>k.ruleType===yo.auditReportDrawer.Business.toLowerCase()).map(k=>{const D=a.auditReportGroups.find(z=>z.auditReportGroupId===k.auditRuleGroupId);return D!=null&&Object.keys(f).length>0?o.jsxRuntimeExports.jsx(oi,{loggedInUser:r,isControllerOrReviewer:a.isControllerOrReviewer,allUsers:d,isMonthEnd:i,ruleGroup:k,groupIdWithActiveStatus:f,auditReportGroup:D,setGroupIdWithActiveStatus:g,onClickRetryGroupFetch:P,onClickRule:W,handleReasonAuditRule:C},k.auditRuleGroupId):null})})]}),o.jsxRuntimeExports.jsxs(si,{children:[o.jsxRuntimeExports.jsx(ri,{children:yo.auditReportDrawer.Accounting}),o.jsxRuntimeExports.jsx(ii,{children:n.filter(k=>k.ruleType===yo.auditReportDrawer.Accounting.toLowerCase()).map(k=>{const D=a.auditReportGroups.find(z=>z.auditReportGroupId===k.auditRuleGroupId);return D!=null&&Object.keys(f).length>0?o.jsxRuntimeExports.jsx(oi,{loggedInUser:r,isControllerOrReviewer:a.isControllerOrReviewer,allUsers:d,isMonthEnd:i,ruleGroup:k,groupIdWithActiveStatus:f,auditReportGroup:D,setGroupIdWithActiveStatus:g,onClickRetryGroupFetch:P,onClickRule:W,handleReasonAuditRule:C},k.auditRuleGroupId):null})})]})]})]})},Qn=(e,n)=>{const r={},i={};return e.forEach(a=>{const{ruleType:d,sequence:l}=a;i[d]===void 0?i[d]={first:l,last:l}:(l<i[d].first&&(i[d].first=l),l>i[d].last&&(i[d].last=l))}),e.forEach(a=>{const{auditRuleGroupId:d,ruleType:l,sequence:c}=a,p=c<=n,m=c===i[l].first,h=c===i[l].last;r[d]={isActive:p,isGroupExpanded:!1,isFirst:m,isLast:h}}),r},Cb=e=>e.auditReportGroups.filter(r=>r.auditReport?.auditRulesGroupReport[0].isSuccess===!1).map(r=>r.auditReportGroupId),jb=s.div`
5324
+ `,ls={navBarHeight:new t.ResponsiveSized(62,62,62),navBarPaddingLeft:new t.ResponsiveSized(t.sp[3],t.sp[3],t.sp[8]),navBarPaddingRight:new t.ResponsiveSized(t.sp[3],t.sp[3],t.sp[8])},{cockpit:{review:yo},dateFormat:Xn,timeFormat:Sb,common:yb}=t.appLocale.getLocalizedStrings(),fb=({isAuditScoreCompleted:e,auditRuleGroups:n,loggedInUser:r,isMonthEnd:i,auditReportGroupView:a,allUsers:d,reviewCompanyView:l,style:c,analytics:p,handleFetchAuditReportGroupView:m,handleGenerateAuditReport:h,handleCancelIconClick:S,handleRuleClick:x,handleReasonAuditRule:C})=>{const b=t.useWindowSizeContext(),[f,g]=u.useState(qn(n,1)),[j,y]=u.useState({id:n[0]?.auditRuleGroupId,index:0}),[$,w]=u.useState(!1),[O,A]=u.useState(1),[v,T]=u.useState(!1),[F,I]=u.useState(null),K=u.useMemo(()=>l?.controllers.map(k=>`${k.user.firstName} ${k.user.middleName} ${k.user.lastName}`)??[],[l?.controllers]),M={fixesRequired:0,totalChecks:0,auditScorePercentage:0,bypassedAuditScore:0,auditReportLastGeneratedDate:null};u.useEffect(()=>{a.auditReportGroups.forEach(k=>{a.auditReportGroups.forEach(z=>{z.auditReportGroupId===j.id&&(z.fetchState==="Completed"||z.fetchState==="Error")&&y({id:n[j.index+1]?.auditRuleGroupId,index:j.index+1})});const D=k.auditReport?.auditRulesGroupReport.find(z=>z.auditRuleGroupId===k.auditReportGroupId);(k.fetchState==="Completed"&&j.id===k.auditReportGroupId&&f[k.auditReportGroupId].isActive===!0&&D?.sequence===O||k.fetchState==="Error"&&j.id===k.auditReportGroupId)&&(A(O+1),g(qn(n,O+1)))})},[a.auditReportGroups,O,n,f]),u.useEffect(()=>{if(a.auditReportGroups.filter(Z=>Z.fetchState==="In-Progress").length===0&&w(!0),a.auditReportGroups.filter(Z=>Z.fetchState==="Completed"||Z.fetchState==="Error").length===n.length){T(!0);let Z=0;a.auditReportGroups.forEach(Q=>{Z=Z+ua(Q.auditReport?.auditRulesGroupReport[0]?.auditRules)});const ie=Cb(a),N=J.dateNow().startOf("month").subtract(1,"date").format(Xn.analytics.MMMYYYYFormat),H=l?.customerGroup,L=Math.ceil(a.auditReportGroups[0].auditReport?.auditSummary.auditScorePercentage??0);p.trackAuditScorePercentage(J.dateNow().format(Xn.analytics.MMSlashDDSlashYYYYFormat),N,L,l?.name??"",ie,Z,K,H??null)}const z=a.auditReportGroups.find(Z=>Z.fetchState==="Completed");z?.auditReport?.status?.lastRefreshSuccessTime!=null&&I(z)},[a.auditReportGroups,n.length,p,l,a,K]);const Y=()=>{g(qn(n,1)),y({id:n[0]?.auditRuleGroupId,index:0}),w(!1),A(1),T(!1),I(null)},G=()=>{Y();const k=n.map(D=>D.auditRuleGroupId);h(k)},E=()=>{S()},P=k=>{m(k)},W=(k,D,z)=>{p.trackAuditIssuesClicked(z,l?.name??"",K,J.dateNow().format(Xn.analytics.MMSlashDDSlashYYYYFormat)),x(k,D)};return o.jsxRuntimeExports.jsxs(jb,{style:c,children:[o.jsxRuntimeExports.jsx(Eb,{windowSize:b,style:c,children:o.jsxRuntimeExports.jsx(wb,{children:o.jsxRuntimeExports.jsxs(vb,{windowSize:b,children:[o.jsxRuntimeExports.jsx(bb,{}),o.jsxRuntimeExports.jsxs(kb,{children:[o.jsxRuntimeExports.jsx(Tb,{children:l?.name}),o.jsxRuntimeExports.jsx(Lb,{children:v?F?.auditReport?.status?.lastRefreshSuccessTime?.utc(!0).local().format(Sb.hmmADashDDMMMCommaYYYY):yb.strings.empty})]}),o.jsxRuntimeExports.jsxs(Ib,{children:[o.jsxRuntimeExports.jsxs(Pb,{isGenerateClickEnabled:$,onClick:G,children:[o.jsxRuntimeExports.jsx(Ab,{}),o.jsxRuntimeExports.jsx(Db,{children:yo.auditReportDrawer.updateScore})]}),o.jsxRuntimeExports.jsx(Ob,{onClick:E,children:o.jsxRuntimeExports.jsx(Nb,{})})]})]})})}),o.jsxRuntimeExports.jsxs(Rb,{children:[o.jsxRuntimeExports.jsx($b,{children:o.jsxRuntimeExports.jsx(S4,{auditSummaryData:l!=null?l.auditSummary:M,isAuditScoreLoadingCompleted:v&&e,isMonthEnd:i})}),o.jsxRuntimeExports.jsxs(ni,{children:[o.jsxRuntimeExports.jsx(si,{children:yo.auditReportDrawer.Business}),o.jsxRuntimeExports.jsx(ri,{children:n.filter(k=>k.ruleType===yo.auditReportDrawer.Business.toLowerCase()).map(k=>{const D=a.auditReportGroups.find(z=>z.auditReportGroupId===k.auditRuleGroupId);return D!=null&&Object.keys(f).length>0?o.jsxRuntimeExports.jsx(ti,{loggedInUser:r,isControllerOrReviewer:a.isControllerOrReviewer,allUsers:d,isMonthEnd:i,ruleGroup:k,groupIdWithActiveStatus:f,auditReportGroup:D,setGroupIdWithActiveStatus:g,onClickRetryGroupFetch:P,onClickRule:W,handleReasonAuditRule:C},k.auditRuleGroupId):null})})]}),o.jsxRuntimeExports.jsxs(ni,{children:[o.jsxRuntimeExports.jsx(si,{children:yo.auditReportDrawer.Accounting}),o.jsxRuntimeExports.jsx(ri,{children:n.filter(k=>k.ruleType===yo.auditReportDrawer.Accounting.toLowerCase()).map(k=>{const D=a.auditReportGroups.find(z=>z.auditReportGroupId===k.auditRuleGroupId);return D!=null&&Object.keys(f).length>0?o.jsxRuntimeExports.jsx(ti,{loggedInUser:r,isControllerOrReviewer:a.isControllerOrReviewer,allUsers:d,isMonthEnd:i,ruleGroup:k,groupIdWithActiveStatus:f,auditReportGroup:D,setGroupIdWithActiveStatus:g,onClickRetryGroupFetch:P,onClickRule:W,handleReasonAuditRule:C},k.auditRuleGroupId):null})})]})]})]})},qn=(e,n)=>{const r={},i={};return e.forEach(a=>{const{ruleType:d,sequence:l}=a;i[d]===void 0?i[d]={first:l,last:l}:(l<i[d].first&&(i[d].first=l),l>i[d].last&&(i[d].last=l))}),e.forEach(a=>{const{auditRuleGroupId:d,ruleType:l,sequence:c}=a,p=c<=n,m=c===i[l].first,h=c===i[l].last;r[d]={isActive:p,isGroupExpanded:!1,isFirst:m,isLast:h}}),r},Cb=e=>e.auditReportGroups.filter(r=>r.auditReport?.auditRulesGroupReport[0].isSuccess===!1).map(r=>r.auditReportGroupId),jb=s.div`
5325
5325
  display: flex;
5326
5326
  flex-direction: column;
5327
5327
  align-items: center;
@@ -5336,20 +5336,20 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
5336
5336
  `,$b=s.div`
5337
5337
  display: flex;
5338
5338
  align-items: center;
5339
- `,si=s.div`
5339
+ `,ni=s.div`
5340
5340
  display: flex;
5341
5341
  flex-direction: column;
5342
5342
  margin-bottom: ${t.Space.sp2};
5343
5343
  margin-top: ${t.Space.sp2};
5344
- `,ri=s(t.ExtraLargeMedium)`
5344
+ `,si=s(t.ExtraLargeMedium)`
5345
5345
  color: ${e=>e.theme.colors.primary};
5346
5346
  margin-bottom: ${t.Space.sp2};
5347
5347
  margin-right: ${t.Space.sp3};
5348
- `,ii=s.div`
5348
+ `,ri=s.div`
5349
5349
  display: flex;
5350
5350
  flex-direction: column;
5351
5351
  `,Eb=s.div`
5352
- min-height: ${e=>cs.navBarHeight.valuePx(e.windowSize)};
5352
+ min-height: ${e=>ls.navBarHeight.valuePx(e.windowSize)};
5353
5353
  position: sticky;
5354
5354
  background-color: ${e=>e.theme.colors.grey4};
5355
5355
  border-bottom: 1px solid transparent;
@@ -5368,8 +5368,8 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
5368
5368
  top: 0;
5369
5369
  left: 0;
5370
5370
  right: 0;
5371
- padding-right: ${e=>cs.navBarPaddingRight.valuePx(e.windowSize)};
5372
- padding-left: ${e=>cs.navBarPaddingLeft.valuePx(e.windowSize)};
5371
+ padding-right: ${e=>ls.navBarPaddingRight.valuePx(e.windowSize)};
5372
+ padding-left: ${e=>ls.navBarPaddingLeft.valuePx(e.windowSize)};
5373
5373
  height: 100%;
5374
5374
  `,kb=s(t.StyledText)`
5375
5375
  display: flex;
@@ -5427,7 +5427,7 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
5427
5427
  `,Nb=s(t.SvgClose)`
5428
5428
  width: ${t.Space.sp3};
5429
5429
  height: ${t.Space.sp3};
5430
- `,ne=t.appLocale.getLocalizedStrings(),jo={navBarHeight:new t.ResponsiveSized(62,62,62),navBarPaddingLeft:new t.ResponsiveSized(t.sp[3],t.sp[3],t.sp[8]),navBarPaddingRight:new t.ResponsiveSized(t.sp[3],t.sp[3],t.sp[8]),navBarPaddingTop:new t.ResponsiveSized(12,12,t.sp[3]),navBarPaddingBottom:new t.ResponsiveSized(12,12,19)},Mb={title:new t.ResponsiveSizedStyle("extraLargeMedium","extraLargeSemiBold")},zb=({companyView:e,allUsers:n,onRetryBankAccountConnection:r,onCloseClick:i})=>{const a=t.useWindowSizeContext(),d=e!=null?ee.getAuditWarningsCount(e):0,l=e?.onboardingInfo?.bankAccountLinked,c=e?.onboardingInfo?.qboLinked,p=e?.onboardingInfo?.identityVerified,m=e?.onboardingInfo?.businessVerified,h=e?.onboardingInfo?.accountingConnectionCreationMode==="zeni_user",S=[];if(l!=null){const x=n.find(f=>f.userId===l.userIds[0]),{errorMessage:C,successMessage:b}=Fb(l,h,x);S.push({status:C!=null?"Error":b!=null?"Complete":"Incomplete",userInfo:x,message:C??b??`${ne.cockpit.onboarding.header.linkBankAccount} ${ne.common.strings.hyphen} ${ne.common.incompleteText}`,onClickRetry:r})}if(c!=null){const x=n.find(f=>f.userId===c.userIds[0]),{errorMessage:C,successMessage:b}=Wb(c,h,x);S.push({status:C!=null?"Error":b!=null?"Complete":"Incomplete",userInfo:x,message:C??b??`${ne.cockpit.onboarding.header.connectToQBO} ${ne.common.strings.hyphen} ${ne.common.incompleteText}`})}if(p!=null){const x=n.find(f=>f.userId===p.userIds[0]),{errorMessage:C,successMessage:b}=Bb(p,h,x);S.push({status:C!=null?"Error":b!=null?"Complete":"Incomplete",userInfo:x,message:C??b??`${ne.cockpit.review.warningsDrawer.kyc} ${ne.common.strings.hyphen} ${p.status}`})}if(m!=null){const x=n.find(f=>f.userId===m.userIds[0]),{errorMessage:C,successMessage:b}=_b(m,h,x);S.push({status:C!=null?"Error":b!=null?"Complete":"Incomplete",userInfo:x,message:C??b??`${ne.cockpit.review.warningsDrawer.kyb} ${ne.common.strings.hyphen} ${m.status}`})}return o.jsxRuntimeExports.jsxs(Vb,{children:[o.jsxRuntimeExports.jsx(Ub,{windowSize:a,children:o.jsxRuntimeExports.jsx(Hb,{children:o.jsxRuntimeExports.jsxs(Yb,{windowSize:a,children:[o.jsxRuntimeExports.jsx(Zb,{windowSize:a,children:e?.name}),o.jsxRuntimeExports.jsx(nR,{onClick:i,children:o.jsxRuntimeExports.jsx(sR,{})})]})})}),o.jsxRuntimeExports.jsxs(Kb,{children:[o.jsxRuntimeExports.jsx(Gb,{children:d>0?o.jsxRuntimeExports.jsxs(Jn,{children:[o.jsxRuntimeExports.jsx(Jn,{children:t.capitaliseWords(ne.cockpit.review.warningsDrawer.issueFound)}),o.jsxRuntimeExports.jsx(rR,{children:`${ne.common.strings.openingBrace}${d}${ne.common.strings.closingBrace}`})]}):o.jsxRuntimeExports.jsx(Jn,{children:`${ne.common.no}
5430
+ `,ne=t.appLocale.getLocalizedStrings(),jo={navBarHeight:new t.ResponsiveSized(62,62,62),navBarPaddingLeft:new t.ResponsiveSized(t.sp[3],t.sp[3],t.sp[8]),navBarPaddingRight:new t.ResponsiveSized(t.sp[3],t.sp[3],t.sp[8]),navBarPaddingTop:new t.ResponsiveSized(12,12,t.sp[3]),navBarPaddingBottom:new t.ResponsiveSized(12,12,19)},Mb={title:new t.ResponsiveSizedStyle("extraLargeMedium","extraLargeSemiBold")},zb=({companyView:e,allUsers:n,onRetryBankAccountConnection:r,onCloseClick:i})=>{const a=t.useWindowSizeContext(),d=e!=null?J.getAuditWarningsCount(e):0,l=e?.onboardingInfo?.bankAccountLinked,c=e?.onboardingInfo?.qboLinked,p=e?.onboardingInfo?.identityVerified,m=e?.onboardingInfo?.businessVerified,h=e?.onboardingInfo?.accountingConnectionCreationMode==="zeni_user",S=[];if(l!=null){const x=n.find(f=>f.userId===l.userIds[0]),{errorMessage:C,successMessage:b}=Fb(l,h,x);S.push({status:C!=null?"Error":b!=null?"Complete":"Incomplete",userInfo:x,message:C??b??`${ne.cockpit.onboarding.header.linkBankAccount} ${ne.common.strings.hyphen} ${ne.common.incompleteText}`,onClickRetry:r})}if(c!=null){const x=n.find(f=>f.userId===c.userIds[0]),{errorMessage:C,successMessage:b}=Wb(c,h,x);S.push({status:C!=null?"Error":b!=null?"Complete":"Incomplete",userInfo:x,message:C??b??`${ne.cockpit.onboarding.header.connectToQBO} ${ne.common.strings.hyphen} ${ne.common.incompleteText}`})}if(p!=null){const x=n.find(f=>f.userId===p.userIds[0]),{errorMessage:C,successMessage:b}=Bb(p,h,x);S.push({status:C!=null?"Error":b!=null?"Complete":"Incomplete",userInfo:x,message:C??b??`${ne.cockpit.review.warningsDrawer.kyc} ${ne.common.strings.hyphen} ${p.status}`})}if(m!=null){const x=n.find(f=>f.userId===m.userIds[0]),{errorMessage:C,successMessage:b}=_b(m,h,x);S.push({status:C!=null?"Error":b!=null?"Complete":"Incomplete",userInfo:x,message:C??b??`${ne.cockpit.review.warningsDrawer.kyb} ${ne.common.strings.hyphen} ${m.status}`})}return o.jsxRuntimeExports.jsxs(Vb,{children:[o.jsxRuntimeExports.jsx(Ub,{windowSize:a,children:o.jsxRuntimeExports.jsx(Hb,{children:o.jsxRuntimeExports.jsxs(Yb,{windowSize:a,children:[o.jsxRuntimeExports.jsx(Zb,{windowSize:a,children:e?.name}),o.jsxRuntimeExports.jsx(nR,{onClick:i,children:o.jsxRuntimeExports.jsx(sR,{})})]})})}),o.jsxRuntimeExports.jsxs(Kb,{children:[o.jsxRuntimeExports.jsx(Gb,{children:d>0?o.jsxRuntimeExports.jsxs(Qn,{children:[o.jsxRuntimeExports.jsx(Qn,{children:t.capitaliseWords(ne.cockpit.review.warningsDrawer.issueFound)}),o.jsxRuntimeExports.jsx(rR,{children:`${ne.common.strings.openingBrace}${d}${ne.common.strings.closingBrace}`})]}):o.jsxRuntimeExports.jsx(Qn,{children:`${ne.common.no}
5431
5431
  ${t.capitaliseWords(ne.cockpit.review.warningsDrawer.issueFound)}`})}),S.map((x,C)=>o.jsxRuntimeExports.jsx(Xb,{isStepInError:x.status==="Error",children:o.jsxRuntimeExports.jsxs(qb,{children:[o.jsxRuntimeExports.jsx(Qb,{children:x.status==="Complete"?o.jsxRuntimeExports.jsx(tR,{}):x.status==="Error"?o.jsxRuntimeExports.jsx(t.SvgHighImportanceFilled,{}):o.jsxRuntimeExports.jsx(oR,{})}),o.jsxRuntimeExports.jsxs(Jb,{children:[o.jsxRuntimeExports.jsx(eR,{isStepInError:x.status==="Error",children:x.message}),x.status==="Error"?o.jsxRuntimeExports.jsx(t.Button,{label:ne.common.retry,onClick:x.onClickRetry,loading:e?.retryBankAccountConnectionFetchState.fetchState==="In-Progress",variant:"outline",style:{padding:`${t.Space.sp1} ${t.Space.sp3}`,borderRadius:t.Space.sp1},textStyle:{...t.textStyles.smallMedium.cssObject}}):null]})]})},C))]})]})},Fb=(e,n,r)=>{const i=e.error===!0?e.errorDetails!=null?e.errorDetails.summary:ne.cockpit.review.errors.bankAccountLinked:null,a=e.completed===!0?r!=null?`${ne.cockpit.onboarding.header.linkBankAccount} ${ne.common.strings.hyphen} ${n===!0?`${ne.common.via} ${ne.common.cockpit} `:ne.common.strings.empty}${ne.common.by} ${r.firstName} ${r.lastName}`:ne.cockpit.onboarding.header.linkBankAccount:null;return{errorMessage:i,successMessage:a}},Wb=(e,n,r)=>{const i=e.error===!0?e.errorDetails!=null?e.errorDetails.summary:ne.cockpit.review.errors.qboLinked:null,a=e.completed===!0?r!=null?`${ne.cockpit.onboarding.header.connectToQBO} ${ne.common.strings.hyphen} ${n===!0?`${ne.common.via} ${ne.common.cockpit} `:ne.common.strings.empty}${ne.common.by} ${r.firstName} ${r.lastName}`:`${ne.cockpit.onboarding.header.connectToQBO}`:null;return{errorMessage:i,successMessage:a}},Bb=(e,n,r)=>{const i=e.status==="Error"?r!=null?`${ne.cockpit.review.warningsDrawer.kyc} ${ne.common.failed.toLocaleLowerCase()} ${ne.common.strings.hyphen} ${n===!0?`${ne.common.via} ${ne.common.cockpit} `:ne.common.strings.empty}${ne.common.by} ${r.firstName} ${r.lastName}`:`${ne.cockpit.review.warningsDrawer.kyc} ${ne.common.failed.toLocaleLowerCase()}`:null,a=e.status==="Complete"?r!=null?`${ne.cockpit.review.warningsDrawer.kyc} ${ne.cockpit.review.warningsDrawer.identity} ${ne.common.strings.hyphen} ${n===!0?`${ne.common.via} ${ne.common.cockpit} `:ne.common.strings.empty}${ne.common.by} ${r.firstName} ${r.lastName}`:`${ne.cockpit.review.warningsDrawer.kyc} ${ne.cockpit.review.warningsDrawer.identity}`:null;return{errorMessage:i,successMessage:a}},_b=(e,n,r)=>{const i=e.status==="Error"?r!=null?`${ne.cockpit.review.warningsDrawer.kyb} ${ne.common.failed.toLocaleLowerCase()} ${ne.common.strings.hyphen} ${n===!0?`${ne.common.via} ${ne.common.cockpit} `:ne.common.strings.empty}${ne.common.by} ${r.firstName} ${r.lastName}`:`${ne.cockpit.review.warningsDrawer.kyb} ${ne.common.failed.toLocaleLowerCase()}`:null,a=e.status==="Complete"?r!=null?`${ne.cockpit.review.warningsDrawer.kyb} ${ne.cockpit.review.warningsDrawer.identity} ${ne.common.strings.hyphen} ${n===!0?`${ne.common.via} ${ne.common.cockpit} `:ne.common.strings.empty}${ne.common.by} ${r.firstName} ${r.lastName}`:`${ne.cockpit.review.warningsDrawer.kyb} ${ne.cockpit.review.warningsDrawer.identity}`:null;return{errorMessage:i,successMessage:a}},Vb=s.div`
5432
5432
  display: flex;
5433
5433
  flex-direction: column;
@@ -5519,11 +5519,11 @@ ${e}`,bd=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
5519
5519
  `,sR=s(t.SvgClose)`
5520
5520
  width: ${t.Space.sp3};
5521
5521
  height: ${t.Space.sp3};
5522
- `,Jn=s.div`
5522
+ `,Qn=s.div`
5523
5523
  display: flex;
5524
5524
  `,rR=s(t.ExtraLargeRegular)`
5525
5525
  display: flex;
5526
5526
  align-items: end;
5527
5527
  color: ${t.Colors.brandColorGoldDark};
5528
5528
  margin-left: ${t.Space.sp2};
5529
- `;exports.AIIconButton=t.AIIconButton;exports.AIPerformancePage=t.AIPerformancePage;exports.ALL_AI_CFO_MENU_OPTIONS=t.ALL_AI_CFO_MENU_OPTIONS;exports.ALL_SETTINGS_MENU_OPTIONS=t.ALL_SETTINGS_MENU_OPTIONS;exports.APP_DRAWER_CONTENT_WIDTH_PX=t.APP_DRAWER_CONTENT_WIDTH_PX;exports.AccountInfoPage=t.AccountInfoPage;exports.AccountLockedInfoModal=t.AccountLockedInfoModal;exports.AccountReconDetailsDrawerPage=t.AccountReconDetailsDrawerPage;exports.ActivityIndicator=t.ActivityIndicator;exports.AddAddressForCardDrawer=t.AddAddressForCardDrawer;exports.AddToWalletPage=t.AddToWalletPage;exports.AddressFormPage=t.AddressFormPage;exports.AgingReportsPage=t.AgingReportsPage;exports.AiCfoMenuContent=t.AiCfoMenuContent;exports.AiCfoOnboardingPage=t.AiCfoOnboardingPage;exports.AiCfoPage=t.AiCfoPage;exports.AiCfoSidePanel=t.AiCfoSidePanel;exports.AnalyticsOnLoad=t.AnalyticsOnLoad;exports.ApAgingDetailPage=t.ApAgingDetailPage;exports.AppBasePage=t.AppBasePage;exports.AppDrawerContent=t.AppDrawerContent;exports.AppDrawerHeightMobile=t.AppDrawerHeightMobile;exports.ApprovalRulesSettingsPage=t.ApprovalRulesSettingsPage;exports.ArAgingDetailPage=t.ArAgingDetailPage;exports.AskAiCfoNavButton=t.AskAiCfoNavButton;exports.AttachmentView=t.AttachmentView;exports.AutoTransferRulePage=t.AutoTransferRulePage;exports.BackNavigationProvider=t.BackNavigationProvider;exports.BankConnectionsSettingsPage=t.BankConnectionsSettingsPage;exports.BillDetailPage=t.BillDetailPage;exports.BillDetailPageSkeleton=t.BillDetailPageSkeleton;exports.BillPayApprovalRuleDetailPage=t.BillPayApprovalRuleDetailPage;exports.BillPayApprovalRulesPage=t.BillPayApprovalRulesPage;exports.BillPayPromoPage=t.BillPayPromoPage;exports.BillPaySetUpLoading=t.SpendManagementSetUpLoading;exports.BillPaySetUpPage=t.BillPaySetUpPage;exports.BillingSettingsPage=t.BillingSettingsPage;exports.BillsBulkReviewDrawerPage=t.BillsBulkReviewDrawerPage;exports.BusinessVerificationPage=t.BusinessVerificationPage;exports.COMMAND_CENTER_SUBMENU_TYPES=t.COMMAND_CENTER_SUBMENU_TYPES;exports.CashbackDetailLoading=t.CashbackDetailLoading;exports.CashbackDetailPage=t.CashbackDetailPage;exports.ChargeCardCVVActivate=t.ChargeCardCVVActivate;exports.ChargeCardDetailLoading=t.ChargeCardDetailLoading;exports.ChargeCardDetailPage=t.ChargeCardDetailPage;exports.ChargeCardListLoading=t.ChargeCardListLoading;exports.ChargeCardListPage=t.ChargeCardListPage;exports.ChargeCardPaymentHistoryPage=t.ChargeCardPaymentHistoryPage;exports.ChargeCardPromoPage=t.ChargeCardPromoPage;exports.ChargeCardSetUpPage=t.ChargeCardSetUpPage;exports.ChargeCardSetupLoading=t.SpendManagementSetUpLoading;exports.ChargeCardStatementsLoading=t.ChargeCardStatementsLoading;exports.ChargeCardStatementsPage=t.ChargeCardStatementsPage;exports.ChargeCardUserOnboardingPromoPage=t.ChargeCardUserOnboardingPromoPage;exports.CheckDepositDrawerPage=t.CheckDepositDrawerPage;exports.CollaborationGlobalStyles=t.CollaborationGlobalStyles;exports.CollaborationProvider=t.CollaborationProvider;exports.CollaborationRoomProvider=t.CollaborationRoomProvider;exports.Colors=t.Colors;exports.CommentsAndNotesCount=t.CommentsAndNotesCount;exports.CommentsDrawerProvider=t.CommentsDrawerProvider;exports.CompanyPassportCard=t.CompanyPassportCard;exports.CompanyPassportPage=t.CompanyPassportPage;exports.CompleteProfile=t.CompleteProfile;exports.ConfettiBurst=t.ConfettiBurst;exports.ConfirmationPopup=t.ConfirmationPopup;exports.CreateOrEditVendorPage=t.CreateOrEditVendorPage;exports.CreateOrEditVendorPageSkeleton=t.CreateOrEditVendorPageSkeleton;exports.CreditCardPaymentDrawerPage=t.CreditCardPaymentDrawerPage;exports.CustomerOnboardingActivationPage=t.CustomerOnboardingActivationPage;exports.CustomerOnboardingContainerPage=t.CustomerOnboardingContainerPage;exports.CustomerOnboardingNoStepsPage=t.CustomerOnboardingNoStepsPage;exports.CustomerOnboardingPage=t.CustomerOnboardingPage;exports.CustomerOnboardingProductSuitePage=t.CustomerOnboardingProductSuitePage;exports.Dashboard=t.Dashboard;exports.DashboardReportPage=t.DashboardReportPage;exports.DashboardSidebarLogoAnimation=t.DashboardSidebarLogoAnimation;exports.DataListTable=t.DataListTable;exports.DataListTableHeader=t.DataListTableHeader;exports.DataListTableRow=t.DataListTableRow;exports.DataListTableSortIndicator=t.DataListTableSortIndicator;exports.DebitCardSetPin=t.DebitCardSetPin;exports.DepositAccTransactionListLoading=t.DepositAccTransactionListLoading;exports.DepositAccTransactionListPage=t.DepositAccTransactionListPage;exports.DropdownPortalContext=t.DropdownPortalContext;exports.EditPeoplePage=t.EditPeoplePage;exports.EditReimbursementDetailPage=t.EditReimbursementDetailPage;exports.EditableBillDetailPage=t.EditableBillDetailPage;exports.EntityDetailPage=t.EntityDetailPage;exports.ErrorBoundaryWrapper=t.ErrorBoundaryWrapper;exports.ExcludedAccountReconDetailsDrawerPage=t.ExcludedAccountReconDetailsDrawerPage;exports.ExpenseAutomationOverviewPage=t.ExpenseAutomationOverviewPage;exports.ExpenseAutomationOverviewPageSkeleton=t.ExpenseAutomationOverviewPageSkeleton;exports.ExpenseAutomationPage=t.ExpenseAutomationPage;exports.ExpressPayPage=t.ExpressPayPage;exports.FeatureDynamicConfigNames=t.DynamicConfigNames;exports.FeatureGatesNames=t.FeatureGatesNames;exports.FeaturePreviewPage=t.FeaturePreviewPage;exports.FeatureProvider=t.FeatureProvider;exports.FirstReviewVendorDetailPage=t.FirstReviewVendorDetailPage;exports.FontWeight=t.FontWeight;exports.GlobalInfoProvider=t.GlobalInfoProvider;exports.GlobalReviewListPage=t.GlobalReviewListPage;exports.InformationCardStack=t.InformationCardStack;exports.InitialCollaborationProvider=t.InitialCollaborationProvider;exports.InsightsCardStack=t.InsightCardStack;exports.IntegrationsSettingsPage=t.IntegrationsSettingsPage;exports.InternationalWireVerificationPage=t.InternationalWireVerificationPage;exports.InviteFormPage=t.InviteFormPage;exports.InvitePageListView=t.InvitePageListView;exports.InvitePeoplePage=t.InvitePeoplePage;exports.InvoiceUploadSection=t.InvoiceUploadSection;exports.InvoiceUploadSectionSkeleton=t.InvoiceUploadSectionSkeleton;exports.IssueChargeCardPage=t.IssueChargeCardPage;exports.IssueChargeCardPageSkeleton=t.IssueChargeCardPageSkeleton;exports.LinkBillExpensePage=t.LinkBillExpensePage;exports.LinkJETransactionPage=t.LinkJETransactionPage;exports.Loader=t.Loader;exports.LogoutButton=t.LogoutButton;exports.MagicLinkDomesticWireDetailsPage=t.MagicLinkDomesticWireDetailsPage;exports.MagicLinkInternationalWireDetailsPage=t.MagicLinkInternationalWireDetailsPage;exports.MagicLinkSuccessPage=t.MagicLinkSuccessPage;exports.MagicLinkVendorACHDetailsPage=t.MagicLinkVendorACHDetailsPage;exports.MonthEndEmailDrawerCustomerRequestPage=t.MonthEndEmailDrawerCustomerRequestPage;exports.MyBankConnectionsSettingsPage=t.MyBankConnectionsSettingsPage;exports.MyPendingActivationChargeCardListPage=t.MyPendingActivationChargeCardListPage;exports.MyProfileSettingsPage=t.MyProfileSettingsPage;exports.NavBar=t.NavBar;exports.NavBarRightRowStyled=t.NavBarRightRowStyled;exports.NewGlobalMerchantPage=t.NewGlobalMerchantPage;exports.NewUpdateAvailablePage=t.NewUpdateAvailablePage;exports.NotFoundPage=t.NotFoundPage;exports.NotificationIcon=t.SvgNotification;exports.NotificationSettingsPage=t.NotificationSettingsPage;exports.NotificationsPage=t.NotificationsPage;exports.OpExByVendorPage=t.OpExByVendorPage;exports.OverlayContainerPage=t.OverlayContainerPage;exports.PandLWithForecastPage=t.PandLWithForecastPage;exports.PanelInternalContext=t.PanelInternalContext;exports.PeoplePage=t.PeoplePage;exports.Picker=t.Picker;exports.PortfolioAllocationFormPage=t.PortfolioAllocationFormPage;exports.QBOConnectionDialog=t.QBOConnectionDialog;exports.QuickViewModeContext=t.QuickViewModeContext;exports.ReferralDrawerPage=t.DrawerPage;exports.ReimbursementApprovalRuleDetailPage=t.ReimbursementApprovalRuleDetailPage;exports.ReimbursementApprovalRulesPage=t.ReimbursementApprovalRulesPage;exports.ReimbursementDetailPage=t.ReimbursementDetailPage;exports.ReimbursementDetailPageSkeleton=t.ReimbursementDetailPageSkeleton;exports.ReimbursementPromoPage=t.ReimbursementPromoPage;exports.ReimbursementSetUpLoading=t.SpendManagementSetUpLoading;exports.ReimbursementSetUpPage=t.RemiSetupPage;exports.RemisBulkReviewDrawerPage=t.ReimbursementsBulkReviewDrawerPage;exports.ReportsPage=t.ReportsPage;exports.ResponsiveSized=t.ResponsiveSized;exports.ReviewBillDetailsPage=t.ReviewBillDetailsPage;exports.ReviewDetailsPageSkeleton=t.ReviewDetailsPageSkeleton;exports.ScheduleDetailSkeleton=t.ScheduleDetailSkeleton;exports.ScheduleDetailsAccruedExpensesPage=t.ScheduleDetailsAccruedExpensesPage;exports.ScheduleDetailsFixedAssetsPage=t.ScheduleDetailsFixedAssetsPage;exports.ScheduleDetailsPage=t.ScheduleDetailsPage;exports.SchedulePanelInternalContext=t.SchedulePanelInternalContext;exports.SessionTimeoutPopup=t.SessionTimeoutPopup;exports.SidePanelContext=t.SidePanelContext;exports.SidePanelProvider=t.SidePanelProvider;exports.SignIn=t.SignIn;exports.SomethingWrongPage=t.SomethingWrongPage;exports.Space=t.Space;exports.SpendManagementListLoading=t.SpendManagementListLoading;exports.SpendManagementListViewPage=t.SpendManagementListViewPage;exports.StatementsPage=t.StatementsPage;exports.StyledCapsule=t.StyledCapsule;exports.SubscriptionDetailPage=t.SubscriptionDetailPage;exports.SubscriptionSummaryPage=t.SubscriptionSummaryPage;exports.TaskDetailPage=t.TaskDetailPage;exports.TaskManagementPage=t.TaskManagementPage;exports.TenantsDropDown=t.TenantsDropDown;exports.TextStyle=t.TextStyle;exports.ToolkitProvider=t.ToolkitProvider;exports.TopExDetailPage=t.TopExDetailPage;exports.TransactionActivityLogPage=t.TransactionActivityLogPage;exports.TransactionActivityLogPanel=t.TransactionActivityLogPanel;exports.TransactionDetailPage=t.TransactionDetailPage;exports.TransactionDetailSkeleton=t.TransactionDetailSkeleton;exports.TransactionListBig=t.TransactionListBig;exports.TransactionListPage=t.TransactionListPage;exports.TransactionPanelInternalContext=t.TransactionPanelInternalContext;exports.TransactionSidePanelLayout=t.TransactionSidePanelLayout;exports.TransactionVendorDetailPage=t.TransactionVendorDetailPage;exports.TransferDrawerPage=t.TransferDrawerPage;exports.TreasuryOverviewPage=t.TreasuryOverviewPage;exports.TreasuryPromoPage=t.TreasuryPromoPage;exports.TreasurySetUpPage=t.TreasurySetUpPage;exports.TreasuryStatementsPage=t.TreasuryStatementsPage;exports.TreasuryTaxLetterPage=t.TreasuryTaxLetterPage;exports.TreasuryTransferOrReviewPage=t.TreasuryTransferOrReviewPage;exports.TrendChart=t.TrendChart;exports.UncategorizedAccountsMappingPage=t.UncategorizedAccountsMappingPage;exports.UnitIntegrationPage=t.UnitIntegrationPage;exports.Vendor2FAPopup=t.Vendor2FAPopup;exports.VendorACHDetailsPage=t.VendorACHDetailsPage;exports.VendorAccruedSchedulesPage=t.VendorAccruedSchedulesPage;exports.VendorDetailPage=t.VendorDetailPage;exports.VendorDomesticWireDetailsPage=t.VendorDomesticWireDetailsPage;exports.VendorFiling1099DetailsEditablePage=t.VendorFiling1099DetailsEditablePage;exports.VendorFiling1099EditableFormSkeleton=t.VendorFiling1099EditableFormSkeleton;exports.VendorFiling1099ListPage=t.VendorFiling1099ListPage;exports.VendorFirstReviewPage=t.VendorFirstReviewPage;exports.VendorInternationalSwiftBasedDetailsPage=t.VendorInternationalSwiftBasedDetailsPage;exports.VendorInternationalWireDetailsPage=t.VendorInternationalWireDetailsPage;exports.VendorListPage=t.VendorListPage;exports.VendorSchedulesPage=t.VendorSchedulesPage;exports.VerifyDevice=t.VerifyDevice;exports.WebV2MicroService=t.WebV2MicroService;exports.WebV2MicroServiceProvider=t.WebV2MicroServiceProvider;exports.WindowSizeProvider=t.WindowSizeProvider;exports.ZeniAccountDetailLoading=t.ZeniAccountDetailLoading;exports.ZeniAccountDetailNavBarTitleShimmer=t.ZeniAccountDetailNavBarTitleShimmer;exports.ZeniAccountDetailPage=t.ZeniAccountDetailPage;exports.ZeniAccountListLoading=t.ZeniAccountListLoading;exports.ZeniAccountListViewPage=t.ZeniAccountListViewPage;exports.ZeniAccountPromoPage=t.ZeniAccountPromoPage;exports.ZeniAccountSetUpPage=t.ZeniAccountSetUpPage;exports.ZeniText=t.ZeniText;exports.ZeniThemeProvider=t.ZeniThemeProvider;exports.alignToJustify=t.alignToJustify;exports.amountToString=t.amountToString;exports.amountValueToString=t.amountValueToString;exports.appLocale=t.appLocale;exports.buildStickyKeySet=t.buildStickyKeySet;exports.cellVerticalAlignToFlexAlign=t.cellVerticalAlignToFlexAlign;exports.computeStickyLeftOffsets=t.computeStickyLeftOffsets;exports.darkColors=t.darkColors;exports.darkTheme=t.darkTheme;exports.dashboardCardDimension=t.designDimension;exports.getAlpha2=t.getAlpha2;exports.getAlpha3=t.getAlpha3;exports.getColorForALabel=t.getColorForALabel;exports.getCountries=t.getCountries;exports.getCustomerDataFromAutoComplete=t.getCustomerDataFromAutoComplete;exports.getFullName=t.getFullName;exports.getInitialOpenThreadRequestFromSearch=t.getInitialOpenThreadRequestFromSearch;exports.getRecipientTotalAmount=t.getRecipientTotalAmount;exports.getShowNegativeAmountInParenthesisDefaultValue=t.getShowNegativeAmountInParenthesisDefaultValue;exports.getShowNegativeAmountInParenthesisForPercentDefaultValue=t.getShowNegativeAmountInParenthesisForPercentDefaultValue;exports.getStableTransactionId=t.getStableTransactionId;exports.isCloseManagementMenu=t.isCloseManagementMenu;exports.isCollaborationEntityType=t.isCollaborationEntityType;exports.isMobileOrTabletView=t.isMobileOrTabletView;exports.isMobilePhoneScreen=t.isMobilePhoneScreen;exports.lightColors=t.lightColors;exports.lightTheme=t.lightTheme;exports.mergeColumnDeclarativeWithRenderers=t.mergeColumnDeclarativeWithRenderers;exports.mergeLayoutDefaults=t.mergeLayoutDefaults;exports.percentValueToString=t.percentValueToString;exports.resolveColumnWidth=t.resolveColumnWidth;exports.roundAmountIfNeeded=t.roundAmountIfNeeded;exports.roundOffNumberToTwoDecimal=t.roundOffNumberToTwoDecimal;exports.setShowNegativeAmountInParenthesisDefaultValue=t.setShowNegativeAmountInParenthesisDefaultValue;exports.setShowNegativeAmountInParenthesisForPercentDefaultValue=t.setShowNegativeAmountInParenthesisForPercentDefaultValue;exports.sp=t.sp;exports.textAlignForCell=t.textAlignForCell;exports.textStyles=t.textStyles;exports.toMenuOptionType=t.toMenuOptionType;exports.toSettingsMenuOptionTypeStrict=t.toSettingsMenuOptionTypeStrict;exports.toSupportedLocaleStrict=t.toSupportedLocaleStrict;exports.trackTreasuryTransferAnalytics=t.trackTreasuryTransferAnalytics;exports.uploadAttachmentReceipts=t.uploadAttachmentReceipts;exports.useAgentPerfAccess=t.useAgentPerfAccess;exports.useBackNavigation=t.useBackNavigation;exports.useCollaborationInfoContext=t.useCollaborationInfoContext;exports.useCommentsDrawer=t.useCommentsDrawer;exports.useDropdownPortal=t.useDropdownPortal;exports.useGlobalInfoContext=t.useGlobalInfoContext;exports.useLockBodyScroll=t.useLockBodyScroll;exports.usePanelInternal=t.usePanelInternal;exports.usePrevious=t.usePrevious;exports.useQuickViewMode=t.useQuickViewMode;exports.useRegisterBackHandler=t.useRegisterBackHandler;exports.useRequestCloseAllCommentDrawers=t.useRequestCloseAllCommentDrawers;exports.useSchedulePanelInternal=t.useSchedulePanelInternal;exports.useSessionAutoLogoutConfig=t.useSessionAutoLogoutConfig;exports.useSidePanelContext=t.useSidePanelContext;exports.useToolkitContext=t.useToolkitContext;exports.useTransactionPanelInternal=t.useTransactionPanelInternal;exports.useWindowSizeContext=t.useWindowSizeContext;exports.useZeniFeatureContext=t.useZeniFeatureContext;exports.useZeniThemeContext=t.useZeniThemeContext;exports.waitFor=t.waitFor;exports.useZeniTheme=o.useTheme;exports.zeniStyled=o.styled;exports.zeniEmotionStyled=s;exports.AiAccountantDetailDrawer=my;exports.AiAccountantPage=L0;exports.AuditReportDrawerPage=fb;exports.COCKPIT_TAB_OPTIONS=xt;exports.CockpitNavBar=hl;exports.HealthMonitorDetailDrawer=ex;exports.HealthMonitorPage=Ph;exports.ManagementPage=hu;exports.MonthEndReportHistoricDataPage=JC;exports.MonthEndReportPage=DC;exports.NavHeader=ht;exports.OnboardingCustomerPage=P3;exports.OnboardingPage=cf;exports.PortfolioPage=ay;exports.ReviewPage=s4;exports.SubscriptionAddPlanPage=cS;exports.SubscriptionPage=Wg;exports.SubscriptionUpdatePlanPage=K1;exports.TaskManagerPage=zu;exports.WarningsDrawerPage=zb;exports.toCockpitOptionType=Ct;exports.toCockpitOptionTypeStrict=gl;
5529
+ `;exports.AIIconButton=t.AIIconButton;exports.AIPerformancePage=t.AIPerformancePage;exports.ALL_AI_CFO_MENU_OPTIONS=t.ALL_AI_CFO_MENU_OPTIONS;exports.ALL_SETTINGS_MENU_OPTIONS=t.ALL_SETTINGS_MENU_OPTIONS;exports.APP_DRAWER_CONTENT_WIDTH_PX=t.APP_DRAWER_CONTENT_WIDTH_PX;exports.AccountInfoPage=t.AccountInfoPage;exports.AccountLockedInfoModal=t.AccountLockedInfoModal;exports.AccountReconDetailsDrawerPage=t.AccountReconDetailsDrawerPage;exports.ActivityIndicator=t.ActivityIndicator;exports.AddAddressForCardDrawer=t.AddAddressForCardDrawer;exports.AddToWalletPage=t.AddToWalletPage;exports.AddressFormPage=t.AddressFormPage;exports.AgingReportsPage=t.AgingReportsPage;exports.AiCfoMenuContent=t.AiCfoMenuContent;exports.AiCfoOnboardingPage=t.AiCfoOnboardingPage;exports.AiCfoPage=t.AiCfoPage;exports.AiCfoSidePanel=t.AiCfoSidePanel;exports.AnalyticsOnLoad=t.AnalyticsOnLoad;exports.ApAgingDetailPage=t.ApAgingDetailPage;exports.AppBasePage=t.AppBasePage;exports.AppDrawerContent=t.AppDrawerContent;exports.AppDrawerHeightMobile=t.AppDrawerHeightMobile;exports.ApprovalRulesSettingsPage=t.ApprovalRulesSettingsPage;exports.ArAgingDetailPage=t.ArAgingDetailPage;exports.AskAiCfoNavButton=t.AskAiCfoNavButton;exports.AttachmentView=t.AttachmentView;exports.AutoTransferRulePage=t.AutoTransferRulePage;exports.BackNavigationProvider=t.BackNavigationProvider;exports.BankConnectionsSettingsPage=t.BankConnectionsSettingsPage;exports.BillDetailPage=t.BillDetailPage;exports.BillDetailPageSkeleton=t.BillDetailPageSkeleton;exports.BillPayApprovalRuleDetailPage=t.BillPayApprovalRuleDetailPage;exports.BillPayApprovalRulesPage=t.BillPayApprovalRulesPage;exports.BillPayPromoPage=t.BillPayPromoPage;exports.BillPaySetUpLoading=t.SpendManagementSetUpLoading;exports.BillPaySetUpPage=t.BillPaySetUpPage;exports.BillingSettingsPage=t.BillingSettingsPage;exports.BillsBulkReviewDrawerPage=t.BillsBulkReviewDrawerPage;exports.BusinessVerificationPage=t.BusinessVerificationPage;exports.COMMAND_CENTER_SUBMENU_TYPES=t.COMMAND_CENTER_SUBMENU_TYPES;exports.CashbackDetailLoading=t.CashbackDetailLoading;exports.CashbackDetailPage=t.CashbackDetailPage;exports.ChargeCardCVVActivate=t.ChargeCardCVVActivate;exports.ChargeCardDetailLoading=t.ChargeCardDetailLoading;exports.ChargeCardDetailPage=t.ChargeCardDetailPage;exports.ChargeCardListLoading=t.ChargeCardListLoading;exports.ChargeCardListPage=t.ChargeCardListPage;exports.ChargeCardPaymentHistoryPage=t.ChargeCardPaymentHistoryPage;exports.ChargeCardPromoPage=t.ChargeCardPromoPage;exports.ChargeCardSetUpPage=t.ChargeCardSetUpPage;exports.ChargeCardSetupLoading=t.SpendManagementSetUpLoading;exports.ChargeCardStatementsLoading=t.ChargeCardStatementsLoading;exports.ChargeCardStatementsPage=t.ChargeCardStatementsPage;exports.ChargeCardUserOnboardingPromoPage=t.ChargeCardUserOnboardingPromoPage;exports.CheckDepositDrawerPage=t.CheckDepositDrawerPage;exports.CollaborationGlobalStyles=t.CollaborationGlobalStyles;exports.CollaborationProvider=t.CollaborationProvider;exports.CollaborationRoomProvider=t.CollaborationRoomProvider;exports.Colors=t.Colors;exports.CommentsAndNotesCount=t.CommentsAndNotesCount;exports.CommentsDrawerProvider=t.CommentsDrawerProvider;exports.CompanyPassportCard=t.CompanyPassportCard;exports.CompanyPassportPage=t.CompanyPassportPage;exports.CompleteProfile=t.CompleteProfile;exports.ConfettiBurst=t.ConfettiBurst;exports.ConfirmationPopup=t.ConfirmationPopup;exports.CreateOrEditVendorPage=t.CreateOrEditVendorPage;exports.CreateOrEditVendorPageSkeleton=t.CreateOrEditVendorPageSkeleton;exports.CreditCardPaymentDrawerPage=t.CreditCardPaymentDrawerPage;exports.CustomerOnboardingActivationPage=t.CustomerOnboardingActivationPage;exports.CustomerOnboardingContainerPage=t.CustomerOnboardingContainerPage;exports.CustomerOnboardingNoStepsPage=t.CustomerOnboardingNoStepsPage;exports.CustomerOnboardingPage=t.CustomerOnboardingPage;exports.CustomerOnboardingProductSuitePage=t.CustomerOnboardingProductSuitePage;exports.Dashboard=t.Dashboard;exports.DashboardReportPage=t.DashboardReportPage;exports.DashboardSidebarLogoAnimation=t.DashboardSidebarLogoAnimation;exports.DataListTable=t.DataListTable;exports.DataListTableHeader=t.DataListTableHeader;exports.DataListTableRow=t.DataListTableRow;exports.DataListTableSortIndicator=t.DataListTableSortIndicator;exports.DebitCardSetPin=t.DebitCardSetPin;exports.DepositAccTransactionListLoading=t.DepositAccTransactionListLoading;exports.DepositAccTransactionListPage=t.DepositAccTransactionListPage;exports.DropdownPortalContext=t.DropdownPortalContext;exports.EditPeoplePage=t.EditPeoplePage;exports.EditReimbursementDetailPage=t.EditReimbursementDetailPage;exports.EditableBillDetailPage=t.EditableBillDetailPage;exports.EntityDetailPage=t.EntityDetailPage;exports.ErrorBoundaryWrapper=t.ErrorBoundaryWrapper;exports.ExcludedAccountReconDetailsDrawerPage=t.ExcludedAccountReconDetailsDrawerPage;exports.ExpenseAutomationOverviewPage=t.ExpenseAutomationOverviewPage;exports.ExpenseAutomationOverviewPageSkeleton=t.ExpenseAutomationOverviewPageSkeleton;exports.ExpenseAutomationPage=t.ExpenseAutomationPage;exports.ExpressPayPage=t.ExpressPayPage;exports.FeatureDynamicConfigNames=t.DynamicConfigNames;exports.FeatureGatesNames=t.FeatureGatesNames;exports.FeaturePreviewPage=t.FeaturePreviewPage;exports.FeatureProvider=t.FeatureProvider;exports.FirstReviewVendorDetailPage=t.FirstReviewVendorDetailPage;exports.FontWeight=t.FontWeight;exports.GlobalInfoProvider=t.GlobalInfoProvider;exports.GlobalReviewListPage=t.GlobalReviewListPage;exports.InformationCardStack=t.InformationCardStack;exports.InitialCollaborationProvider=t.InitialCollaborationProvider;exports.InsightsCardStack=t.InsightCardStack;exports.IntegrationsSettingsPage=t.IntegrationsSettingsPage;exports.InternationalWireVerificationPage=t.InternationalWireVerificationPage;exports.InviteFormPage=t.InviteFormPage;exports.InvitePageListView=t.InvitePageListView;exports.InvitePeoplePage=t.InvitePeoplePage;exports.InvoiceUploadSection=t.InvoiceUploadSection;exports.InvoiceUploadSectionSkeleton=t.InvoiceUploadSectionSkeleton;exports.IssueChargeCardPage=t.IssueChargeCardPage;exports.IssueChargeCardPageSkeleton=t.IssueChargeCardPageSkeleton;exports.LinkBillExpensePage=t.LinkBillExpensePage;exports.LinkJETransactionPage=t.LinkJETransactionPage;exports.Loader=t.Loader;exports.LogoutButton=t.LogoutButton;exports.MagicLinkDomesticWireDetailsPage=t.MagicLinkDomesticWireDetailsPage;exports.MagicLinkInternationalWireDetailsPage=t.MagicLinkInternationalWireDetailsPage;exports.MagicLinkSuccessPage=t.MagicLinkSuccessPage;exports.MagicLinkVendorACHDetailsPage=t.MagicLinkVendorACHDetailsPage;exports.MonthEndEmailDrawerCustomerRequestPage=t.MonthEndEmailDrawerCustomerRequestPage;exports.MyBankConnectionsSettingsPage=t.MyBankConnectionsSettingsPage;exports.MyPendingActivationChargeCardListPage=t.MyPendingActivationChargeCardListPage;exports.MyProfileSettingsPage=t.MyProfileSettingsPage;exports.NavBar=t.NavBar;exports.NavBarRightRowStyled=t.NavBarRightRowStyled;exports.NewGlobalMerchantPage=t.NewGlobalMerchantPage;exports.NewUpdateAvailablePage=t.NewUpdateAvailablePage;exports.NotFoundPage=t.NotFoundPage;exports.NotificationIcon=t.SvgNotification;exports.NotificationSettingsPage=t.NotificationSettingsPage;exports.NotificationsPage=t.NotificationsPage;exports.OpExByVendorPage=t.OpExByVendorPage;exports.OverlayContainerPage=t.OverlayContainerPage;exports.PandLWithForecastPage=t.PandLWithForecastPage;exports.PanelInternalContext=t.PanelInternalContext;exports.PeoplePage=t.PeoplePage;exports.Picker=t.Picker;exports.PortfolioAllocationFormPage=t.PortfolioAllocationFormPage;exports.QBOConnectionDialog=t.QBOConnectionDialog;exports.QuickViewModeContext=t.QuickViewModeContext;exports.ReferralDrawerPage=t.DrawerPage;exports.ReimbursementApprovalRuleDetailPage=t.ReimbursementApprovalRuleDetailPage;exports.ReimbursementApprovalRulesPage=t.ReimbursementApprovalRulesPage;exports.ReimbursementDetailPage=t.ReimbursementDetailPage;exports.ReimbursementDetailPageSkeleton=t.ReimbursementDetailPageSkeleton;exports.ReimbursementPromoPage=t.ReimbursementPromoPage;exports.ReimbursementSetUpLoading=t.SpendManagementSetUpLoading;exports.ReimbursementSetUpPage=t.RemiSetupPage;exports.RemisBulkReviewDrawerPage=t.ReimbursementsBulkReviewDrawerPage;exports.ReportsPage=t.ReportsPage;exports.ResponsiveSized=t.ResponsiveSized;exports.ReviewBillDetailsPage=t.ReviewBillDetailsPage;exports.ReviewDetailsPageSkeleton=t.ReviewDetailsPageSkeleton;exports.ScheduleDetailSkeleton=t.ScheduleDetailSkeleton;exports.ScheduleDetailsAccruedExpensesPage=t.ScheduleDetailsAccruedExpensesPage;exports.ScheduleDetailsFixedAssetsPage=t.ScheduleDetailsFixedAssetsPage;exports.ScheduleDetailsPage=t.ScheduleDetailsPage;exports.SchedulePanelInternalContext=t.SchedulePanelInternalContext;exports.SessionTimeoutPopup=t.SessionTimeoutPopup;exports.SidePanelContext=t.SidePanelContext;exports.SidePanelProvider=t.SidePanelProvider;exports.SignIn=t.SignIn;exports.SomethingWrongPage=t.SomethingWrongPage;exports.Space=t.Space;exports.SpendManagementListLoading=t.SpendManagementListLoading;exports.SpendManagementListViewPage=t.SpendManagementListViewPage;exports.StatementsPage=t.StatementsPage;exports.StyledCapsule=t.StyledCapsule;exports.SubscriptionDetailPage=t.SubscriptionDetailPage;exports.SubscriptionSummaryPage=t.SubscriptionSummaryPage;exports.TaskDetailPage=t.TaskDetailPage;exports.TaskManagementPage=t.TaskManagementPage;exports.TenantsDropDown=t.TenantsDropDown;exports.TextStyle=t.TextStyle;exports.ToolkitProvider=t.ToolkitProvider;exports.TopExDetailPage=t.TopExDetailPage;exports.TransactionActivityLogPage=t.TransactionActivityLogPage;exports.TransactionActivityLogPanel=t.TransactionActivityLogPanel;exports.TransactionDetailPage=t.TransactionDetailPage;exports.TransactionDetailSkeleton=t.TransactionDetailSkeleton;exports.TransactionListBig=t.TransactionListBig;exports.TransactionListPage=t.TransactionListPage;exports.TransactionPanelInternalContext=t.TransactionPanelInternalContext;exports.TransactionSidePanelLayout=t.TransactionSidePanelLayout;exports.TransactionVendorDetailPage=t.TransactionVendorDetailPage;exports.TransferDrawerPage=t.TransferDrawerPage;exports.TreasuryOverviewPage=t.TreasuryOverviewPage;exports.TreasuryPromoPage=t.TreasuryPromoPage;exports.TreasurySetUpPage=t.TreasurySetUpPage;exports.TreasuryStatementsPage=t.TreasuryStatementsPage;exports.TreasuryTaxLetterPage=t.TreasuryTaxLetterPage;exports.TreasuryTransferOrReviewPage=t.TreasuryTransferOrReviewPage;exports.TrendChart=t.TrendChart;exports.UncategorizedAccountsMappingPage=t.UncategorizedAccountsMappingPage;exports.UnitIntegrationPage=t.UnitIntegrationPage;exports.Vendor2FAPopup=t.Vendor2FAPopup;exports.VendorACHDetailsPage=t.VendorACHDetailsPage;exports.VendorAccruedSchedulesPage=t.VendorAccruedSchedulesPage;exports.VendorDetailPage=t.VendorDetailPage;exports.VendorDomesticWireDetailsPage=t.VendorDomesticWireDetailsPage;exports.VendorFiling1099DetailsEditablePage=t.VendorFiling1099DetailsEditablePage;exports.VendorFiling1099EditableFormSkeleton=t.VendorFiling1099EditableFormSkeleton;exports.VendorFiling1099ListPage=t.VendorFiling1099ListPage;exports.VendorFirstReviewPage=t.VendorFirstReviewPage;exports.VendorInternationalSwiftBasedDetailsPage=t.VendorInternationalSwiftBasedDetailsPage;exports.VendorInternationalWireDetailsPage=t.VendorInternationalWireDetailsPage;exports.VendorListPage=t.VendorListPage;exports.VendorSchedulesPage=t.VendorSchedulesPage;exports.VerifyDevice=t.VerifyDevice;exports.WebV2MicroService=t.WebV2MicroService;exports.WebV2MicroServiceProvider=t.WebV2MicroServiceProvider;exports.WindowSizeProvider=t.WindowSizeProvider;exports.ZeniAccountDetailLoading=t.ZeniAccountDetailLoading;exports.ZeniAccountDetailNavBarTitleShimmer=t.ZeniAccountDetailNavBarTitleShimmer;exports.ZeniAccountDetailPage=t.ZeniAccountDetailPage;exports.ZeniAccountListLoading=t.ZeniAccountListLoading;exports.ZeniAccountListViewPage=t.ZeniAccountListViewPage;exports.ZeniAccountPromoPage=t.ZeniAccountPromoPage;exports.ZeniAccountSetUpPage=t.ZeniAccountSetUpPage;exports.ZeniText=t.ZeniText;exports.ZeniThemeProvider=t.ZeniThemeProvider;exports.alignToJustify=t.alignToJustify;exports.amountToString=t.amountToString;exports.amountValueToString=t.amountValueToString;exports.appLocale=t.appLocale;exports.buildStickyKeySet=t.buildStickyKeySet;exports.cellVerticalAlignToFlexAlign=t.cellVerticalAlignToFlexAlign;exports.computeStickyLeftOffsets=t.computeStickyLeftOffsets;exports.darkColors=t.darkColors;exports.darkTheme=t.darkTheme;exports.dashboardCardDimension=t.designDimension;exports.getAlpha2=t.getAlpha2;exports.getAlpha3=t.getAlpha3;exports.getColorForALabel=t.getColorForALabel;exports.getCountries=t.getCountries;exports.getCustomerDataFromAutoComplete=t.getCustomerDataFromAutoComplete;exports.getFullName=t.getFullName;exports.getInitialOpenThreadRequestFromSearch=t.getInitialOpenThreadRequestFromSearch;exports.getRecipientTotalAmount=t.getRecipientTotalAmount;exports.getShowNegativeAmountInParenthesisDefaultValue=t.getShowNegativeAmountInParenthesisDefaultValue;exports.getShowNegativeAmountInParenthesisForPercentDefaultValue=t.getShowNegativeAmountInParenthesisForPercentDefaultValue;exports.getStableTransactionId=t.getStableTransactionId;exports.isCloseManagementMenu=t.isCloseManagementMenu;exports.isCollaborationEntityType=t.isCollaborationEntityType;exports.isMobileOrTabletView=t.isMobileOrTabletView;exports.isMobilePhoneScreen=t.isMobilePhoneScreen;exports.lightColors=t.lightColors;exports.lightTheme=t.lightTheme;exports.mergeColumnDeclarativeWithRenderers=t.mergeColumnDeclarativeWithRenderers;exports.mergeLayoutDefaults=t.mergeLayoutDefaults;exports.percentValueToString=t.percentValueToString;exports.resolveColumnWidth=t.resolveColumnWidth;exports.roundAmountIfNeeded=t.roundAmountIfNeeded;exports.roundOffNumberToTwoDecimal=t.roundOffNumberToTwoDecimal;exports.setShowNegativeAmountInParenthesisDefaultValue=t.setShowNegativeAmountInParenthesisDefaultValue;exports.setShowNegativeAmountInParenthesisForPercentDefaultValue=t.setShowNegativeAmountInParenthesisForPercentDefaultValue;exports.sp=t.sp;exports.textAlignForCell=t.textAlignForCell;exports.textStyles=t.textStyles;exports.toMenuOptionType=t.toMenuOptionType;exports.toSettingsMenuOptionTypeStrict=t.toSettingsMenuOptionTypeStrict;exports.toSupportedLocaleStrict=t.toSupportedLocaleStrict;exports.trackTreasuryTransferAnalytics=t.trackTreasuryTransferAnalytics;exports.uploadAttachmentReceipts=t.uploadAttachmentReceipts;exports.useAgentPerfAccess=t.useAgentPerfAccess;exports.useBackNavigation=t.useBackNavigation;exports.useCollaborationInfoContext=t.useCollaborationInfoContext;exports.useCommentsDrawer=t.useCommentsDrawer;exports.useDropdownPortal=t.useDropdownPortal;exports.useGlobalInfoContext=t.useGlobalInfoContext;exports.useLockBodyScroll=t.useLockBodyScroll;exports.usePanelInternal=t.usePanelInternal;exports.usePrevious=t.usePrevious;exports.useQuickViewMode=t.useQuickViewMode;exports.useRegisterBackHandler=t.useRegisterBackHandler;exports.useRequestCloseAllCommentDrawers=t.useRequestCloseAllCommentDrawers;exports.useSchedulePanelInternal=t.useSchedulePanelInternal;exports.useSessionAutoLogoutConfig=t.useSessionAutoLogoutConfig;exports.useSidePanelContext=t.useSidePanelContext;exports.useToolkitContext=t.useToolkitContext;exports.useTransactionPanelInternal=t.useTransactionPanelInternal;exports.useWindowSizeContext=t.useWindowSizeContext;exports.useZeniFeatureContext=t.useZeniFeatureContext;exports.useZeniThemeContext=t.useZeniThemeContext;exports.waitFor=t.waitFor;exports.useZeniTheme=o.useTheme;exports.zeniStyled=o.styled;exports.zeniEmotionStyled=s;exports.AiAccountantDetailDrawer=my;exports.AiAccountantPage=L0;exports.AuditReportDrawerPage=fb;exports.COCKPIT_TAB_OPTIONS=xt;exports.CockpitNavBar=hl;exports.HealthMonitorDetailDrawer=ex;exports.HealthMonitorPage=Ph;exports.ManagementPage=hu;exports.MonthEndReportHistoricDataPage=JC;exports.MonthEndReportPage=DC;exports.NavHeader=ht;exports.OnboardingCustomerPage=P3;exports.OnboardingPage=cf;exports.PortfolioPage=ay;exports.ReviewPage=s4;exports.SubscriptionAddPlanPage=cS;exports.SubscriptionPage=Wg;exports.SubscriptionUpdatePlanPage=K1;exports.TaskManagerPage=zu;exports.WarningsDrawerPage=zb;exports.toCockpitOptionType=jt;exports.toCockpitOptionTypeStrict=gl;