@zeniai/web-components 4.3.8 → 4.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{SessionTimeoutPopup-BfSjI6xY.cjs → SessionTimeoutPopup-B9l5xt8w.cjs} +16523 -16372
- package/dist/{SessionTimeoutPopup-DTocbMko.js → SessionTimeoutPopup-BieF8U6a.js} +94089 -92526
- package/dist/appLocale.d.ts +50 -16
- package/dist/cockpit.cjs.js +91 -91
- package/dist/cockpit.esm.js +1244 -1234
- package/dist/common/util.d.ts +1 -0
- package/dist/components/aiCfo/components/FieldRowWithAutoFillBadge.d.ts +14 -1
- package/dist/components/aiCfo/components/common/downloadAndCopyHandlers.d.ts +5 -0
- package/dist/components/appDrawerContent/MenuButton.d.ts +6 -6
- package/dist/components/appDrawerContent/MenuList.d.ts +1 -0
- package/dist/components/cards/summaryCard/tasksCard/TasksCard.d.ts +2 -4
- package/dist/components/common/downloadReport/types/downloadReportOptions.d.ts +2 -1
- package/dist/components/common/downloadReport/types/downloadReportOptionsPayload.d.ts +2 -1
- package/dist/components/commonSetUp/utils/hasFormFieldValue.d.ts +11 -0
- package/dist/components/customerOnboarding/detail/CustomerOnboardingDetailPage.d.ts +11 -0
- package/dist/components/customerOnboarding/detail/components/BankVerification.d.ts +5 -2
- package/dist/components/customerOnboarding/detail/components/OnboardingStepFrame.d.ts +5 -1
- package/dist/components/customerOnboarding/detail/pages/AIAgentsActivatingPage.d.ts +8 -1
- package/dist/components/customerOnboarding/detail/pages/VerifyUnlockFinancialStackPage.d.ts +4 -1
- package/dist/components/customerOnboarding/drawer/OnboardingSidebar.d.ts +9 -1
- package/dist/components/dashboard/Dashboard.d.ts +1 -2
- package/dist/components/detail/common/dashboardReportDownload.d.ts +4 -2
- package/dist/components/detail/dashboardReportPage/DashboardReportPage.d.ts +5 -1
- package/dist/components/detail/dashboardReportPage/DetailPageReportFilters.d.ts +4 -1
- package/dist/components/detail/dashboardReportPage/DetailPageReportTable.d.ts +2 -1
- package/dist/components/detail/dashboardReportPage/common/getRootNodesWithUpdatedConfig.d.ts +2 -2
- package/dist/components/detail/dashboardReportPage/detailPageReportTypes.d.ts +2 -1
- package/dist/components/detail/netBurnOrIncome/mapNetBurnOrIncomeProjectReportToReportTreeNodes.d.ts +4 -0
- package/dist/components/detail/opEx/mapOpExProjectReportToReportTreeNodes.d.ts +4 -0
- package/dist/components/detail/revenue/mapRevenueProjectReportToReportTreeNodes.d.ts +4 -0
- package/dist/components/expenseAutomation/sections/accountRecon/statementParseFormHelpers.d.ts +11 -20
- package/dist/components/formElements/labeledColorPicker/LabeledColorPickerField.d.ts +12 -0
- package/dist/components/formElements/labeledGroupedCheckBoxField/LabeledGroupedCheckBoxField.d.ts +1 -0
- package/dist/components/invoicing/catalogForm/InvoicingCatalogItemFormPage.d.ts +4 -2
- package/dist/components/invoicing/catalogForm/catalogItemForm.shared.d.ts +10 -3
- package/dist/components/invoicing/common/InvoicingFormRows.d.ts +4 -1
- package/dist/components/invoicing/common/InvoicingOpenEntityValue.d.ts +14 -0
- package/dist/components/invoicing/couponForm/couponForm.shared.d.ts +3 -1
- package/dist/components/invoicing/customerForm/customerForm.shared.d.ts +2 -2
- package/dist/components/invoicing/recordPayment/recordPayment.shared.d.ts +3 -1
- package/dist/components/invoicing/settings/InvoicingIntegrationsSection.d.ts +2 -1
- package/dist/components/invoicing/settings/InvoicingIntegrationsSettingsPage.d.ts +9 -0
- package/dist/components/invoicing/settings/InvoicingPaymentDestinationSettingsPage.d.ts +5 -2
- package/dist/components/invoicing/settings/InvoicingQBOSettingsPage.d.ts +24 -0
- package/dist/components/invoicing/settings/StripeWebhookUrlField.d.ts +4 -0
- package/dist/components/invoicing/settings/invoicingIntegrationCards.d.ts +2 -1
- package/dist/components/invoicing/settings/invoicingSettingsShared.d.ts +21 -35
- package/dist/components/invoicing/subscriptionForm/subscriptionForm.shared.d.ts +6 -3
- package/dist/components/notifications/components/CommentsNotificationTileMedium.d.ts +4 -7
- package/dist/components/notifications/components/NotificationRowText.d.ts +13 -0
- package/dist/components/notifications/components/NotificationTagPill.d.ts +12 -0
- package/dist/components/notifications/components/NotificationTileMedium.d.ts +1 -7
- package/dist/components/notifications/components/notificationRowStyles.d.ts +34 -0
- package/dist/components/notifications/table/notificationsListHeader/NotificationsListConfig.d.ts +2 -0
- package/dist/components/notifications/utils/commentsNotificationHelpers.d.ts +13 -2
- package/dist/components/notifications/utils/commonHelpers.d.ts +2 -1
- package/dist/components/reportTree/treeNode/treeNodeMappers/mapTotalBalancesToTreeNode.d.ts +2 -2
- package/dist/components/settingsPage/Integrations/components/integrationCardTypes.d.ts +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.esm.js +388 -382
- package/dist/strings/strings.d.ts +50 -16
- package/dist/types/liveblocks.config.d.ts +8 -0
- package/package.json +4 -4
package/dist/cockpit.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./SessionTimeoutPopup-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./SessionTimeoutPopup-B9l5xt8w.cjs"),o=require("./vendor-.pnpm-Bks7atPv.cjs"),u=require("react"),s=require("@emotion/styled"),Xe=require("@liveblocks/react"),J=require("@zeniai/client-epic-state"),ws=require("@liveblocks/react-ui"),Ee=require("@emotion/react"),Po=require("react-dom"),St=require("@liveblocks/react-ui/primitives"),yi=require("@liveblocks/react/suspense");function Pa(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=Pa(u),Ia=({inboxNotification:e,onNotificationClick:n})=>{const r=Xe.useInboxNotificationThread(e.id),i=r.metadata.entityType.split("."),a=r.metadata.isGlobalComment&&i.length===2;return o.jsxRuntimeExports.jsx(La,{isClickable:a,isUnRead:e.readAt==null,onClick:()=>{n(r.metadata,r.id)},children:o.jsxRuntimeExports.jsx(ws.InboxNotification,{inboxNotification:e,kinds:{thread:d=>o.jsxRuntimeExports.jsx(ws.InboxNotification.Thread,{...d,showRoomName:!0})}})})},La=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:Aa}},commentsAndNotifications:{notifications:{texts:Da}},timeFormat:{hmmADashDDMMMCommaYYYY:ks}}=t.appLocale.getLocalizedStrings(),Oa=e=>{const{inboxNotifications:n,isLoading:r,isFetchingMore:i,hasFetchedAll:a,fetchMore:d}=Xe.useInboxNotifications();u.useEffect(()=>{const y=setTimeout(()=>d?.(),0);return()=>clearTimeout(y)});const l=r||i===!0||a!==!0,c=Xe.useMarkInboxNotificationAsRead(),[p,m]=u.useState(!1),{isDrawerOpen:x,application:g,onNotificationClick:h,onCloseAllInboxNotificationsDrawer:C}=e,b=u.useMemo(()=>{if(!n)return[];const y=[...n];return y.sort((j,f)=>{const E=J.zeniDate(j.notifiedAt.toDateString(),ks),$=J.zeniDate(f.notifiedAt.toDateString(),ks);return E.isSame($,"day")?0:E.isSameOrBefore($,"day")?-1:1}),y.filter(j=>j.roomId?.includes(g)===!0)},[g,n]),S=u.useCallback(()=>{m(!0);const y=b.filter(j=>j.readAt==null);y.length===0?m(!1):y.forEach((j,f)=>{c(j.id),f===y.length-1&&setTimeout(()=>{m(!1)},1e3)})},[c,b]);return o.jsxRuntimeExports.jsx(o.Drawer,{anchor:"right",open:x,style:{display:"flex",justifyContent:"space-between"},onClose:C,transitionDuration:250,children:o.jsxRuntimeExports.jsx(Na,{children:o.jsxRuntimeExports.jsxs(Ma,{children:[o.jsxRuntimeExports.jsxs(_a,{children:[o.jsxRuntimeExports.jsx(Ua,{}),o.jsxRuntimeExports.jsx(Ka,{onClick:C,children:o.jsxRuntimeExports.jsx(Ga,{})})]}),o.jsxRuntimeExports.jsxs(za,{children:[o.jsxRuntimeExports.jsxs(Va,{children:[o.jsxRuntimeExports.jsx(Ha,{children:Aa}),o.jsxRuntimeExports.jsx(Fa,{variant:"ghost",size:"small",label:Da.markAllAsRead,onClick:S,prefixIcon:l||p?o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Small",start:!0}):o.jsxRuntimeExports.jsx(Ba,{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(Ya,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Standard",style:{color:"inherit"},start:!0})}):o.jsxRuntimeExports.jsx(Wa,{children:b.map(y=>o.jsxRuntimeExports.jsx(
|
|
17
|
+
`,{common:{headers:{notifications:Aa}},commentsAndNotifications:{notifications:{texts:Da}},timeFormat:{hmmADashDDMMMCommaYYYY:ks}}=t.appLocale.getLocalizedStrings(),Oa=e=>{const{inboxNotifications:n,isLoading:r,isFetchingMore:i,hasFetchedAll:a,fetchMore:d}=Xe.useInboxNotifications();u.useEffect(()=>{const y=setTimeout(()=>d?.(),0);return()=>clearTimeout(y)});const l=r||i===!0||a!==!0,c=Xe.useMarkInboxNotificationAsRead(),[p,m]=u.useState(!1),{isDrawerOpen:x,application:g,onNotificationClick:h,onCloseAllInboxNotificationsDrawer:C}=e,b=u.useMemo(()=>{if(!n)return[];const y=[...n];return y.sort((j,f)=>{const E=J.zeniDate(j.notifiedAt.toDateString(),ks),$=J.zeniDate(f.notifiedAt.toDateString(),ks);return E.isSame($,"day")?0:E.isSameOrBefore($,"day")?-1:1}),y.filter(j=>j.roomId?.includes(g)===!0&&j.kind==="thread")},[g,n]),S=u.useCallback(()=>{m(!0);const y=b.filter(j=>j.readAt==null);y.length===0?m(!1):y.forEach((j,f)=>{c(j.id),f===y.length-1&&setTimeout(()=>{m(!1)},1e3)})},[c,b]);return o.jsxRuntimeExports.jsx(o.Drawer,{anchor:"right",open:x,style:{display:"flex",justifyContent:"space-between"},onClose:C,transitionDuration:250,children:o.jsxRuntimeExports.jsx(Na,{children:o.jsxRuntimeExports.jsxs(Ma,{children:[o.jsxRuntimeExports.jsxs(_a,{children:[o.jsxRuntimeExports.jsx(Ua,{}),o.jsxRuntimeExports.jsx(Ka,{onClick:C,children:o.jsxRuntimeExports.jsx(Ga,{})})]}),o.jsxRuntimeExports.jsxs(za,{children:[o.jsxRuntimeExports.jsxs(Va,{children:[o.jsxRuntimeExports.jsx(Ha,{children:Aa}),o.jsxRuntimeExports.jsx(Fa,{variant:"ghost",size:"small",label:Da.markAllAsRead,onClick:S,prefixIcon:l||p?o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Small",start:!0}):o.jsxRuntimeExports.jsx(Ba,{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(Ya,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Standard",style:{color:"inherit"},start:!0})}):o.jsxRuntimeExports.jsx(Wa,{children:b.map(y=>o.jsxRuntimeExports.jsx(Ia,{inboxNotification:y,onNotificationClick:(j,f)=>h(j,f)},y.id))})]})]})})})},Na=s.div`
|
|
18
18
|
height: 100%; // Drawer header height
|
|
19
19
|
`,Ma=s.div`
|
|
20
20
|
width: 400px;
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
display: flex;
|
|
165
165
|
gap: ${t.Space.sp5};
|
|
166
166
|
align-items: center;
|
|
167
|
-
`,
|
|
167
|
+
`,Is=s.div`
|
|
168
168
|
display: flex;
|
|
169
169
|
align-items: center;
|
|
170
170
|
justify-content: center;
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
height: ${t.Space.sp3};
|
|
191
191
|
align-items: center;
|
|
192
192
|
justify-content: center;
|
|
193
|
-
`,kl=s.div``,{cockpit:yn,common:Tl}=t.appLocale.getLocalizedStrings();function Pl({defaultOptions:e,downloadState:n,downloadParams:r,signedInUser:i,cockpitHeader:a,analytics:d,currentTab:l,updateDownloadStateHandler:c,onZeniLogoClick:p,onLogOutClick:m,onThreadClick:x,onNotificationClick:g,onNewCustomerClick:h}){const C=t.useWindowSizeContext(),[b,S]=u.useState(!1),[y,j]=u.useState(!1),{inboxNotifications:f,isLoading:E,isFetchingMore:$,hasFetchedAll:A,fetchMore:
|
|
193
|
+
`,kl=s.div``,{cockpit:yn,common:Tl}=t.appLocale.getLocalizedStrings();function Pl({defaultOptions:e,downloadState:n,downloadParams:r,signedInUser:i,cockpitHeader:a,analytics:d,currentTab:l,updateDownloadStateHandler:c,onZeniLogoClick:p,onLogOutClick:m,onThreadClick:x,onNotificationClick:g,onNewCustomerClick:h}){const C=t.useWindowSizeContext(),[b,S]=u.useState(!1),[y,j]=u.useState(!1),{inboxNotifications:f,isLoading:E,isFetchingMore:$,hasFetchedAll:A,fetchMore:I}=Xe.useInboxNotifications(),{threads:v,isLoading:w}=t.useFilteredThreads({application:"cockpit",isGlobalComment:!0},"both",!0),D=u.useMemo(()=>v.filter(P=>P.resolved===!1),[v]).length,{setOpenThread:K,setRequestToOpenThread:M,openThread:G}=u.useContext(t.ThreadsContext);u.useEffect(()=>{const P=setTimeout(()=>I?.(),0);return()=>clearTimeout(P)});const q=E||$===!0||A!==!0,R=f?.filter(P=>P.readAt==null&&P.roomId?.includes("cockpit")===!0&&P.kind==="thread").length,L=hl(l),W=u.useCallback((P,N)=>{const{companyId:Q,entityType:ae}=P;G===N?K(null):(S(!1),M({threadId:N,companyId:Q,entityType:ae}))},[G,K,M]),k=u.useCallback((P,N)=>{const{companyId:Q,entityType:ae}=P;G===N?K(null):(j(!1),M({threadId:N,companyId:Q,entityType:ae}))},[G,K,M]);return C!=="small"?o.jsxRuntimeExports.jsxs(Ts,{children:[o.jsxRuntimeExports.jsxs(Ps,{children:[o.jsxRuntimeExports.jsx($l,{children:o.jsxRuntimeExports.jsx(Rl,{"data-testid":t.generateDataTestId("zeni-logo-cockpit-nav-bar"),onClick:p})}),o.jsxRuntimeExports.jsx(jl,{children:a??yn.cockpitHeader}),o.jsxRuntimeExports.jsxs(El,{children:[b?null:o.jsxRuntimeExports.jsxs(Is,{isDisabled:w,onClick:w?()=>null:()=>S(!0),children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:w?void 0:D,isLoading:w,style:{left:"12px"}}),o.jsxRuntimeExports.jsx(vl,{})]}),o.jsxRuntimeExports.jsxs(Is,{isDisabled:q,onClick:q?()=>null:()=>j(!0),children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:R,isLoading:q,style:{left:"12px"}}),o.jsxRuntimeExports.jsx(wl,{})]}),o.jsxRuntimeExports.jsx(fl,{defaultOptions:e,downloadParams:r,downloadState:n,analytics:d,currentCockpitTab:L,updateDownloadStateHandler:c}),o.jsxRuntimeExports.jsx(t.Button,{variant:"primary",size:"small",style:{whiteSpace:"nowrap"},label:yn.newCustomer,onClick:h}),o.jsxRuntimeExports.jsx(bl,{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:Tl.headers.comments,onCloseAllThreadsDrawer:()=>S(!1),onThreadClick:(P,N)=>{x(P,N,W)},style:{cursor:"pointer"},showReactions:!0,showActions:!0,allowExpand:!0,threads:v,isLoading:w,allowComposer:!1,textOverrides:{},withRoomProvider:!0}),o.jsxRuntimeExports.jsx(Oa,{application:"cockpit",isDrawerOpen:y,onNotificationClick:(P,N)=>{g(P,N,k)},onCloseAllInboxNotificationsDrawer:()=>j(!1)})]}):o.jsxRuntimeExports.jsx(Ts,{className:"mobileHeader",children:o.jsxRuntimeExports.jsxs(Ps,{className:"mobileTitle",children:[o.jsxRuntimeExports.jsx(t.Button,{variant:"primary",size:"small",style:{whiteSpace:"nowrap"},label:yn.newCustomer,onClick:h}),o.jsxRuntimeExports.jsx(kl,{children:o.jsxRuntimeExports.jsx(t.LogoutButton,{signedInUser:i,pageName:"Cockpit",onLogOutClick:m})})]})})}const ys=["management","subscription","portfolio","onboarding","audit","healthMonitor","taskManager","aiAccountant","creditAgent"],Rt=e=>J.stringToUnion(e,ys),Il=e=>J.stringToUnionStrict(e,ys),Ll=(e,n)=>e in n,vi=e=>{switch(e){case"management":return fi;case"subscription":return Ci;case"portfolio":return ji;case"healthMonitor":return bi;case"aiAccountant":return Sl;case"taskManager":return Ei;default:return[]}},as=(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"taskManager":return r.taskManager[n];default:return r.healthMonitor[n]}},Al=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
|
-
`,
|
|
201
|
+
`,Ls=({onChange:e,value:n,categoryIndex:r,defaultMenuIsOpen:i=!1,selectedCockpitOption:a})=>{const d=o.useTheme(),l=u.useRef(null),c=t.getDropdownStyles(d),p=vi(a),m=p.find(h=>h.value===n);u.useEffect(()=>{const h=setTimeout(()=>{l.current!=null&&i&&l.current.focus()},300);return()=>{clearTimeout(h)}},[i]);const x=h=>{const C=as(a,h.data.value);return o.jsxRuntimeExports.jsx(o.components.SingleValue,{...h,children:o.jsxRuntimeExports.jsx(t.StandardRegularSp,{children:C})})},g=h=>{const{isSelected:C}=h,b=as(a,h.data.value);return o.jsxRuntimeExports.jsx(o.components.Option,{...h,children:o.jsxRuntimeExports.jsxs(Al,{"data-testid":t.generateDataTestId("cockpit-filters-category-option",typeof h.data.value=="string"?h.data.value:h.data.value?.code??h.data.value?.id??h.label),children:[o.jsxRuntimeExports.jsx(t.StandardRegular,{children:b}),C&&o.jsxRuntimeExports.jsx(Dl,{})]})})};return o.jsxRuntimeExports.jsx(Ol,{"data-testid":t.generateDataTestId("cockpit-filters-category-select"),children:o.jsxRuntimeExports.jsx(o.StateManagedSelect$1,{ref:l,isMulti:!1,value:m,onChange:h=>{e(h,r)},placeholder:t.appLocale.getLocalizedStrings().cockpit.filters.categoryPlaceholder,options:p,styles:c,menuPosition:"fixed",openMenuOnFocus:!0,components:{Option:g,SingleValue:x}})})},Ol=s.div``,Nl=({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,x]=u.useState(l),[g,h]=u.useState(n);u.useEffect(()=>{c!=null&&m!=null&&(r({start:c,end:m}),c>m&&x(c)),c!=null?h(n.filter(y=>y>=c)):h(n)},[c,m]);const C=y=>{p(y)},b=y=>{x(y)},S=t.appLocale.getLocalizedStrings().spendManagement.filters;return o.jsxRuntimeExports.jsxs(Ml,{size:i,children:[o.jsxRuntimeExports.jsx(As,{children:o.jsxRuntimeExports.jsx(t.SingleSelectNumeric,{onSelectedValueChanged:C,placeholder:S.from,defaultValue:{allOptions:n,selectedOption:c},hasError:!1,customStyleConfig:{input:()=>({input:{textAlign:"left"}}),control:()=>({backgroundColor:a.colors.background})}})}),o.jsxRuntimeExports.jsx(zl,{children:S.enDash}),o.jsxRuntimeExports.jsx(As,{children:o.jsxRuntimeExports.jsx(t.SingleSelectNumeric,{onSelectedValueChanged:b,placeholder:S.to,defaultValue:{allOptions:g,selectedOption:m},hasError:!1,customStyleConfig:{input:()=>({input:{textAlign:"left"}}),control:()=>({backgroundColor:a.colors.background})}})})]})},Ml=s.div`
|
|
202
202
|
display: flex;
|
|
203
203
|
align-items: center;
|
|
204
204
|
column-gap: ${t.Space.sp3};
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
`,ql=s(t.StandardRegularSp)`
|
|
263
263
|
overflow: hidden;
|
|
264
264
|
text-overflow: ellipsis;
|
|
265
|
-
`,Ql=({options:e,categoryIndex:n,value:r,categoryType:i,categoryLabel:a,valuesCombinationOperator:d,showAnyAll:l,onChange:c,onValuesCombinationOperatorChange:p})=>{const m=o.useTheme(),x=t.getMultiSelectDropdownStyles(m),{common:{filters:g,texts:h},cockpit:{userProfileAltText:C}}=t.appLocale.getLocalizedStrings(),b=r.map(w=>e.find(F=>F.value===w)),S=(w,F,D,K)=>i!=="user"?null:w==null?o.jsxRuntimeExports.jsx(t.EntityAvatarWithInitials,{firstName:F,lastName:D,index:K}):o.jsxRuntimeExports.jsx(Gl,{src:w.href,alt:C,onError:({currentTarget:M})=>{M.onerror=null,M.src=t.AvatarSVG},loading:"lazy"}),y=w=>i!=="rating"?null:Object.keys(eo).includes(w)?o.jsxRuntimeExports.jsx(ln,{iconName:eo[w].iconName,width:18,height:18,stopAnimation:!0,style:{margin:0}}):o.jsxRuntimeExports.jsx(ln,{iconName:To[w].iconName,stopAnimation:!0,width:18,height:18,style:{margin:0}}),j=w=>i!=="runway"?null:o.jsxRuntimeExports.jsx(Wl,{color:w}),f=w=>{const F=e.findIndex(D=>D.value===w.data.value);return o.jsxRuntimeExports.jsx(o.components.MultiValueLabel,{...w,children:o.jsxRuntimeExports.jsxs(Ul,{children:[S(w.data.photo,w.data.label.split(" ")[0],w.data.label.split(" ")[1]!=null?w.data.label.split(" ")[1]:"",F),y(w.data.value),j(w.data.iconColor),o.jsxRuntimeExports.jsx(ql,{children:w.children})]})})},E=w=>o.jsxRuntimeExports.jsx(o.components.MultiValueRemove,{...w,children:o.jsxRuntimeExports.jsx(Xl,{})}),$=w=>{const{onMouseMove:F,onMouseOver:D,isSelected:K,...M}=w.innerProps,G=e.findIndex(R=>R.value===w.data.value),q={...w,innerProps:M};return o.jsxRuntimeExports.jsx(o.components.Option,{...q,children:o.jsxRuntimeExports.jsxs(Kl,{children:[o.jsxRuntimeExports.jsxs(Hl,{children:[S(w.data.photo,w.data.label.split(" ")[0],w.data.label.split(" ")[1]!=null?w.data.label.split(" ")[1]:"",G),y(w.data.value),j(w.data.iconColor),o.jsxRuntimeExports.jsx(t.StandardRegular,{children:w.label})]}),w.isSelected&&o.jsxRuntimeExports.jsx(Yl,{})]})})},A=(w,F)=>i==="user"&&w.data.email!=null?w.data.label.toLowerCase().includes(F.toLowerCase())||w.data.email.toLowerCase().includes(F.toLowerCase()):w.data.label.toLowerCase().includes(F.toLowerCase()),
|
|
265
|
+
`,Ql=({options:e,categoryIndex:n,value:r,categoryType:i,categoryLabel:a,valuesCombinationOperator:d,showAnyAll:l,onChange:c,onValuesCombinationOperatorChange:p})=>{const m=o.useTheme(),x=t.getMultiSelectDropdownStyles(m),{common:{filters:g,texts:h},cockpit:{userProfileAltText:C}}=t.appLocale.getLocalizedStrings(),b=r.map(w=>e.find(F=>F.value===w)),S=(w,F,D,K)=>i!=="user"?null:w==null?o.jsxRuntimeExports.jsx(t.EntityAvatarWithInitials,{firstName:F,lastName:D,index:K}):o.jsxRuntimeExports.jsx(Gl,{src:w.href,alt:C,onError:({currentTarget:M})=>{M.onerror=null,M.src=t.AvatarSVG},loading:"lazy"}),y=w=>i!=="rating"?null:Object.keys(eo).includes(w)?o.jsxRuntimeExports.jsx(ln,{iconName:eo[w].iconName,width:18,height:18,stopAnimation:!0,style:{margin:0}}):o.jsxRuntimeExports.jsx(ln,{iconName:To[w].iconName,stopAnimation:!0,width:18,height:18,style:{margin:0}}),j=w=>i!=="runway"?null:o.jsxRuntimeExports.jsx(Wl,{color:w}),f=w=>{const F=e.findIndex(D=>D.value===w.data.value);return o.jsxRuntimeExports.jsx(o.components.MultiValueLabel,{...w,children:o.jsxRuntimeExports.jsxs(Ul,{children:[S(w.data.photo,w.data.label.split(" ")[0],w.data.label.split(" ")[1]!=null?w.data.label.split(" ")[1]:"",F),y(w.data.value),j(w.data.iconColor),o.jsxRuntimeExports.jsx(ql,{children:w.children})]})})},E=w=>o.jsxRuntimeExports.jsx(o.components.MultiValueRemove,{...w,children:o.jsxRuntimeExports.jsx(Xl,{})}),$=w=>{const{onMouseMove:F,onMouseOver:D,isSelected:K,...M}=w.innerProps,G=e.findIndex(R=>R.value===w.data.value),q={...w,innerProps:M};return o.jsxRuntimeExports.jsx(o.components.Option,{...q,children:o.jsxRuntimeExports.jsxs(Kl,{children:[o.jsxRuntimeExports.jsxs(Hl,{children:[S(w.data.photo,w.data.label.split(" ")[0],w.data.label.split(" ")[1]!=null?w.data.label.split(" ")[1]:"",G),y(w.data.value),j(w.data.iconColor),o.jsxRuntimeExports.jsx(t.StandardRegular,{children:w.label})]}),w.isSelected&&o.jsxRuntimeExports.jsx(Yl,{})]})})},A=(w,F)=>i==="user"&&w.data.email!=null?w.data.label.toLowerCase().includes(F.toLowerCase())||w.data.email.toLowerCase().includes(F.toLowerCase()):w.data.label.toLowerCase().includes(F.toLowerCase()),I=l&&b.length>1,v=()=>{switch(i){case"dateRange":return o.jsxRuntimeExports.jsx(ec,{"data-testid":t.generateDataTestId("cockpit-filters-values-daterange"),children:o.jsxRuntimeExports.jsx(t.DateRangeFilterField,{onDateRangeChange:w=>{w.startDate!=null&&w.endDate!=null&&c([{label:g.startDate,value:w.startDate},{label:g.endDate,value:w.endDate}],n)},selectedDates:r})});case"dropdownRange":return o.jsxRuntimeExports.jsx(tc,{"data-testid":t.generateDataTestId("cockpit-filters-values-numrange"),children:o.jsxRuntimeExports.jsx(Nl,{options:e.map(w=>parseInt(w.label)),onNumericRangeChange:w=>{w.start!=null&&w.end!=null&&c([{label:g.startDate,value:w.start.toString()},{label:g.endDate,value:w.end.toString()}],n)},selectedRanges:r!=null&&r.length>0?{start:parseInt(r[0].toString()),end:parseInt(r[1].toString())}:{start:void 0,end:void 0}})});default:return o.jsxRuntimeExports.jsxs(Vl,{"data-testid":t.generateDataTestId("cockpit-filters-values-select-container"),children:[b.length===0&&i==="user"?o.jsxRuntimeExports.jsx(Zl,{}):null,o.jsxRuntimeExports.jsx(o.StateManagedSelect$1,{isMulti:!0,hideSelectedOptions:!1,value:b,onChange:w=>{Array.isArray(w)===!0&&c(w,n)},placeholder:`${h.select} ${a}`,options:e,styles:x,menuPosition:"fixed",components:{Option:$,MultiValueLabel:f,MultiValueRemove:E},filterOption:A})]})}};return o.jsxRuntimeExports.jsxs(_l,{categoryType:i,"data-testid":t.generateDataTestId("cockpit-filters-values-wrapper"),children:[v(),I&&o.jsxRuntimeExports.jsx(Jl,{"data-testid":t.generateDataTestId("cockpit-filters-values-any-all"),children:o.jsxRuntimeExports.jsx(Fl,{categoryIndex:n,value:d,onChange:p})})]})},Jl=s.div``,ec=s.div``,tc=s.div``,Os=s.div`
|
|
266
266
|
display: flex;
|
|
267
267
|
flex-direction: column;
|
|
268
268
|
row-gap: ${t.Space.sp4};
|
|
@@ -350,14 +350,14 @@
|
|
|
350
350
|
align-items: flex-start;
|
|
351
351
|
column-gap: ${t.Space.sp3};
|
|
352
352
|
animation: ${dc} 0.4s;
|
|
353
|
-
`,wi=u.forwardRef(({filters:e,onFiltersChange:n,filterValues:r,selectedCockpitOption:i},a)=>{const d=u.useCallback((S,y)=>{const j=t.getUpdatedFiltersOnCategoryChange({currentFilters:e,selectedOption:S,categoryIndex:y});n(j)},[e,n]),l=u.useCallback((S,y)=>{const j=t.getUpdatedFiltersOnMatchingOperatorChange({currentFilters:e,selectedOption:S,categoryIndex:y});n(j)},[e,n]),c=u.useCallback((S,y)=>{if(e.categories==null)return;const j={...e,categories:e.categories.map((f,E)=>E!=y?f:{...f,valuesCombinationOperator:S.value})};n(j)},[e,n]),p=u.useCallback(S=>{if(e!=null){const y={...e,categoryCombinationOperator:S};n(y)}},[e,n]),m=u.useCallback(S=>{if(S===0&&e.categories!=null&&e.categories.length===1){n({});return}if(e.categories!=null){if([...e.categories.slice(0,S),...e.categories.slice(S+1)].filter(j=>j.field!=null).length){const j={...e,categories:[...e.categories.slice(0,S),...e.categories.slice(S+1)]};n(j);return}n({})}},[n,e]),x=()=>{e.categories!=null&&n({...e,categories:[...e.categories,{...t.NEW_CATEGORY_BODY}]})},g=()=>{n({})},h=u.useCallback((S,y)=>{const j=t.getUpdatedFiltersOnValueChange({currentFilters:e,selectedOptions:S,categoryIndex:y});n(j)},[e,n]),C=()=>e.categories!=null?o.jsxRuntimeExports.jsxs(rc,{children:[o.jsxRuntimeExports.jsxs(Fs,{onClick:x,"data-testid":t.generateDataTestId("cockpit-filters-add-button"),children:[o.jsxRuntimeExports.jsx(oc,{}),o.jsxRuntimeExports.jsx(t.StandardRegular,{children:t.appLocale.getLocalizedStrings().cockpit.filters.addFilterBtnText})]}),o.jsxRuntimeExports.jsxs(Fs,{onClick:g,"data-testid":t.generateDataTestId("cockpit-filters-clear-all-button"),children:[o.jsxRuntimeExports.jsx(nc,{}),o.jsxRuntimeExports.jsx(t.StandardRegular,{children:t.appLocale.getLocalizedStrings().cockpit.filters.clearAllBtnText})]})]}):null,b=()=>e.categories==null?o.jsxRuntimeExports.jsx(Os,{"data-testid":t.generateDataTestId("cockpit-filters-empty-state"),children:o.jsxRuntimeExports.jsx(Ns,{children:o.jsxRuntimeExports.jsxs(Ws,{children:[o.jsxRuntimeExports.jsx(Ms,{children:o.jsxRuntimeExports.jsx(Bs,{children:t.appLocale.getLocalizedStrings().cockpit.filters.filterByLabel})}),o.jsxRuntimeExports.jsx(zs,{children:o.jsxRuntimeExports.jsx(
|
|
353
|
+
`,wi=u.forwardRef(({filters:e,onFiltersChange:n,filterValues:r,selectedCockpitOption:i},a)=>{const d=u.useCallback((S,y)=>{const j=t.getUpdatedFiltersOnCategoryChange({currentFilters:e,selectedOption:S,categoryIndex:y});n(j)},[e,n]),l=u.useCallback((S,y)=>{const j=t.getUpdatedFiltersOnMatchingOperatorChange({currentFilters:e,selectedOption:S,categoryIndex:y});n(j)},[e,n]),c=u.useCallback((S,y)=>{if(e.categories==null)return;const j={...e,categories:e.categories.map((f,E)=>E!=y?f:{...f,valuesCombinationOperator:S.value})};n(j)},[e,n]),p=u.useCallback(S=>{if(e!=null){const y={...e,categoryCombinationOperator:S};n(y)}},[e,n]),m=u.useCallback(S=>{if(S===0&&e.categories!=null&&e.categories.length===1){n({});return}if(e.categories!=null){if([...e.categories.slice(0,S),...e.categories.slice(S+1)].filter(j=>j.field!=null).length){const j={...e,categories:[...e.categories.slice(0,S),...e.categories.slice(S+1)]};n(j);return}n({})}},[n,e]),x=()=>{e.categories!=null&&n({...e,categories:[...e.categories,{...t.NEW_CATEGORY_BODY}]})},g=()=>{n({})},h=u.useCallback((S,y)=>{const j=t.getUpdatedFiltersOnValueChange({currentFilters:e,selectedOptions:S,categoryIndex:y});n(j)},[e,n]),C=()=>e.categories!=null?o.jsxRuntimeExports.jsxs(rc,{children:[o.jsxRuntimeExports.jsxs(Fs,{onClick:x,"data-testid":t.generateDataTestId("cockpit-filters-add-button"),children:[o.jsxRuntimeExports.jsx(oc,{}),o.jsxRuntimeExports.jsx(t.StandardRegular,{children:t.appLocale.getLocalizedStrings().cockpit.filters.addFilterBtnText})]}),o.jsxRuntimeExports.jsxs(Fs,{onClick:g,"data-testid":t.generateDataTestId("cockpit-filters-clear-all-button"),children:[o.jsxRuntimeExports.jsx(nc,{}),o.jsxRuntimeExports.jsx(t.StandardRegular,{children:t.appLocale.getLocalizedStrings().cockpit.filters.clearAllBtnText})]})]}):null,b=()=>e.categories==null?o.jsxRuntimeExports.jsx(Os,{"data-testid":t.generateDataTestId("cockpit-filters-empty-state"),children:o.jsxRuntimeExports.jsx(Ns,{children:o.jsxRuntimeExports.jsxs(Ws,{children:[o.jsxRuntimeExports.jsx(Ms,{children:o.jsxRuntimeExports.jsx(Bs,{children:t.appLocale.getLocalizedStrings().cockpit.filters.filterByLabel})}),o.jsxRuntimeExports.jsx(zs,{children:o.jsxRuntimeExports.jsx(Ls,{defaultMenuIsOpen:!0,onChange:d,selectedCockpitOption:i})})]})})}):o.jsxRuntimeExports.jsx(u.Fragment,{children:e.categories.map((S,y)=>{const f=vi(i).find(v=>v.value===S.field),E=f?.multiple,$=f?.type,A=f!=null?as(i,f?.value):"",I=S.field??`${y}`;return o.jsxRuntimeExports.jsxs(Ns,{"data-testid":t.generateDataTestId("cockpit-filters-row",I),children:[o.jsxRuntimeExports.jsxs(Ws,{children:[o.jsxRuntimeExports.jsxs(Ms,{children:[y===0&&o.jsxRuntimeExports.jsx(Bs,{children:t.appLocale.getLocalizedStrings().cockpit.filters.filterByLabel}),y!==0?o.jsxRuntimeExports.jsx(pc,{"data-testid":t.generateDataTestId("cockpit-filters-combination-operator",I),children:o.jsxRuntimeExports.jsx(t.CombinationOperatorButton,{categoryCombinationOperator:e.categoryCombinationOperator,onChange:p,buttonsDisabled:y>1})}):null]}),o.jsxRuntimeExports.jsx(zs,{"data-testid":t.generateDataTestId("cockpit-filters-category-dropdown",I),children:o.jsxRuntimeExports.jsx(Ls,{categoryIndex:y,value:S.field,onChange:d,selectedCockpitOption:i})})]}),S.field&&o.jsxRuntimeExports.jsxs(uc,{children:[o.jsxRuntimeExports.jsx(sc,{"data-testid":t.generateDataTestId("cockpit-filters-matching-operator",I),children:o.jsxRuntimeExports.jsx(t.MatchingOperatorDropdown,{categoryIndex:y,value:S.matchingOperator,onChange:l})}),o.jsxRuntimeExports.jsxs(lc,{children:[o.jsxRuntimeExports.jsx(cc,{categoryType:$,"data-testid":t.generateDataTestId("cockpit-filters-values-dropdown",I),children:o.jsxRuntimeExports.jsx(Ql,{options:r[S.field]!=null?r[S.field]:[],value:S.values,categoryIndex:y,categoryType:$,categoryLabel:A,showAnyAll:E??!1,onChange:h,valuesCombinationOperator:S.valuesCombinationOperator,onValuesCombinationOperatorChange:c})}),o.jsxRuntimeExports.jsx(ic,{onClick:()=>m(y),"data-testid":t.generateDataTestId("cockpit-filters-delete-row",I),children:o.jsxRuntimeExports.jsx(ac,{})})]})]})]},S.field?S.field+y:y)})});return o.jsxRuntimeExports.jsxs(Os,{ref:a,"data-testid":t.generateDataTestId("cockpit-filters-selection-container"),children:[b(),C()]})});wi.displayName="FiltersSelection";const mc=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
|
-
`,xc=({selectedCockpitOption:e,filters:n,disableFilters:r=!1,onFiltersChange:i,onSearchTextChanged:a,getCategoryWiseOptions:d,companiesLoaded:l=!0,filterText:c})=>{const p=u.useRef(null),[m,x]=u.useState(!1),g=u.useRef(!1),[h,C]=u.useState({management:{},portfolio:{},subscription:{},onboarding:{},audit:{},healthMonitor:{},taskManager:{},aiAccountant:{},creditAgent:{}}),[b,S]=u.useState(136),y=u.useRef(null),j=t.useWindowSizeContext(),f=u.useCallback(()=>{x(!1)},[]),E=u.useCallback(()=>{r===!1&&x(!0)},[r]);u.useEffect(()=>{d&&Object.keys(h[e]).length===0&&l&&C(v=>({...v,[e]:d()}))},[e,h,l]);const $=u.useCallback(()=>{if(n?.categories==null)return Ae;const v=y.current,w=v!=null?v.clientHeight:0;return t.sp[7]+(w>0?w:Ae)},[n]);u.useEffect(()=>{if(m!==g.current){S("auto");return}S($())},[$,m]),u.useEffect(()=>{g.current=m},[m]),u.useEffect(()=>{b==="auto"&&S($())},[b,$]);const A=()=>o.jsxRuntimeExports.jsx(t.FiltersPopover,{anchorEl:p.current,open:m,onClose:f,paperStyle:{overflow:"visible"},children:o.jsxRuntimeExports.jsx(mc,{height:b,windowSize:j,"data-testid":t.generateDataTestId("cockpit-filters-selection-wrapper"),children:n&&o.jsxRuntimeExports.jsx(gc,{"data-testid":t.generateDataTestId("cockpit-filters-selection"),children:o.jsxRuntimeExports.jsx(wi,{filters:n,onFiltersChange:i,filterValues:h[e],selectedCockpitOption:e,ref:y})})})},n?.categories==null||n.categories.length===0?"smallBox":"largeBox"),
|
|
360
|
+
`,xc=({selectedCockpitOption:e,filters:n,disableFilters:r=!1,onFiltersChange:i,onSearchTextChanged:a,getCategoryWiseOptions:d,companiesLoaded:l=!0,filterText:c})=>{const p=u.useRef(null),[m,x]=u.useState(!1),g=u.useRef(!1),[h,C]=u.useState({management:{},portfolio:{},subscription:{},onboarding:{},audit:{},healthMonitor:{},taskManager:{},aiAccountant:{},creditAgent:{}}),[b,S]=u.useState(136),y=u.useRef(null),j=t.useWindowSizeContext(),f=u.useCallback(()=>{x(!1)},[]),E=u.useCallback(()=>{r===!1&&x(!0)},[r]);u.useEffect(()=>{d&&Object.keys(h[e]).length===0&&l&&C(v=>({...v,[e]:d()}))},[e,h,l]);const $=u.useCallback(()=>{if(n?.categories==null)return Ae;const v=y.current,w=v!=null?v.clientHeight:0;return t.sp[7]+(w>0?w:Ae)},[n]);u.useEffect(()=>{if(m!==g.current){S("auto");return}S($())},[$,m]),u.useEffect(()=>{g.current=m},[m]),u.useEffect(()=>{b==="auto"&&S($())},[b,$]);const A=()=>o.jsxRuntimeExports.jsx(t.FiltersPopover,{anchorEl:p.current,open:m,onClose:f,paperStyle:{overflow:"visible"},children:o.jsxRuntimeExports.jsx(mc,{height:b,windowSize:j,"data-testid":t.generateDataTestId("cockpit-filters-selection-wrapper"),children:n&&o.jsxRuntimeExports.jsx(gc,{"data-testid":t.generateDataTestId("cockpit-filters-selection"),children:o.jsxRuntimeExports.jsx(wi,{filters:n,onFiltersChange:i,filterValues:h[e],selectedCockpitOption:e,ref:y})})})},n?.categories==null||n.categories.length===0?"smallBox":"largeBox"),I=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(hc,{"data-testid":t.generateDataTestId("cockpit-filters-search-box"),children:o.jsxRuntimeExports.jsx(t.SearchBoxWithFilterButton,{isFilterBtnActive:m||I>0,searchPlaceholder:t.appLocale.getLocalizedStrings().cockpit.searchplaceholder,ref:p,isFilterDisabled:r,onSearchTextChanged:a,onFilterButtonClick:E,filtersCount:I,filterText:c})}),r!=!0&&A()]})},hc=s.div``,gc=s.div``,{common:{numbers:Sc,strings:yc}}=t.appLocale.getLocalizedStrings(),fc=({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}`:`${Sc.maximumCount}${yc.plus}`};return o.jsxRuntimeExports.jsx(jc,{"data-testid":t.generateDataTestId("cockpit-nav-switcher"),children:o.jsxRuntimeExports.jsx(Cc,{value:r,onChange:d,centered:!0,"data-testid":t.generateDataTestId("cockpit-nav-switcher-tabs"),children:n.map(c=>o.jsxRuntimeExports.jsx(bc,{count:l(c),label:a(c),disableRipple:!0,"data-testid":t.generateDataTestId("cockpit-nav-switcher-tab",c)},c))})})},Cc=s(o.Tabs)`
|
|
361
361
|
.MuiTabs-indicator {
|
|
362
362
|
background-color: ${e=>e.theme.colors.primary};
|
|
363
363
|
width: calc(100% - 20px);
|
|
@@ -428,20 +428,20 @@
|
|
|
428
428
|
`,He={cockpitLeftPadding:new t.ResponsiveSized(t.sp[3],t.sp[8]),cockpitRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},Pc=s.div`
|
|
429
429
|
height: calc(100% - 75px);
|
|
430
430
|
padding: ${e=>`${t.Space.sp0} ${t.Space.sp0} ${t.Space.sp0} ${He.cockpitLeftPadding.valuePx(e.windowSize)}`};
|
|
431
|
-
`,
|
|
431
|
+
`,Ic=s(Pc)`
|
|
432
432
|
justify-content: center;
|
|
433
433
|
align-items: center;
|
|
434
434
|
display: flex;
|
|
435
435
|
flex-direction: column;
|
|
436
436
|
height: calc(100vh - 110px);
|
|
437
|
-
`,
|
|
437
|
+
`,Lc=s(t.StandardRegular)`
|
|
438
438
|
color: ${e=>e.theme.colors.hero};
|
|
439
439
|
`,Ac=s(t.SvgReload)`
|
|
440
440
|
width: ${t.Space.sp8};
|
|
441
441
|
height: ${t.Space.sp8};
|
|
442
442
|
color: ${e=>e.theme.colors.hero};
|
|
443
443
|
margin-bottom: ${t.Space.sp4};
|
|
444
|
-
`,$t=({selectedCockpitOption:e,reloadMsg:n,onCockpitReloadData:r})=>{const i=n??t.appLocale.getLocalizedStrings().card.failedText,a=t.useWindowSizeContext();return o.jsxRuntimeExports.jsxs(
|
|
444
|
+
`,$t=({selectedCockpitOption:e,reloadMsg:n,onCockpitReloadData:r})=>{const i=n??t.appLocale.getLocalizedStrings().card.failedText,a=t.useWindowSizeContext();return o.jsxRuntimeExports.jsxs(Ic,{onClick:()=>r(e),windowSize:a,"data-testid":t.generateDataTestId("cockpit-reload-container"),children:[o.jsxRuntimeExports.jsx(Ac,{"data-testid":t.generateDataTestId("cockpit-reload-icon")}),o.jsxRuntimeExports.jsx(Lc,{"data-testid":t.generateDataTestId("cockpit-reload-message"),children:i})]})},{common:{strings:{dot:_s}}}=t.appLocale.getLocalizedStrings(),oe="cockpitCommentsContainer",_t=(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}),Pe=(e,n,r)=>`${t.toCollaborationEntityType({tab:e,key:n})}${_s}${r}${_s}${t.NEW_THREAD_SUFFIX}`,fs=(e,n)=>{for(;e&&!e.classList.contains(n);)e=e.parentElement;return e},Dc=({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})},Oc=({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(Vs,{isHighlighted:!1,"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-item",m.companyId),children:o.jsxRuntimeExports.jsx(Us,{children:m.name})},m.companyId)),c=i?i.parentCompanyId:e,p=r!=null?n:i?.parentCompanyName;return o.jsxRuntimeExports.jsxs(Mc,{"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-content"),children:[o.jsxRuntimeExports.jsxs(zc,{isHighlighted:r!=null,children:[o.jsxRuntimeExports.jsx(Fc,{isHighlighted:r!=null,"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-parent-name"),children:p}),o.jsxRuntimeExports.jsxs(Bc,{"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-view-details"),onClick:()=>{a&&a(c)},children:[t.appLocale.getLocalizedStrings().cockpit.parentSubsidiary.viewDetailsLink,o.jsxRuntimeExports.jsx(Nc,{})]})]}),o.jsxRuntimeExports.jsxs(Wc,{"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-list"),children:[i&&o.jsxRuntimeExports.jsx(Vs,{isHighlighted:!0,"data-testid":t.generateDataTestId("cockpit-parent-subsidiary-current-company"),children:o.jsxRuntimeExports.jsx(Us,{children:n})}),l()]})]})},Nc=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 Cs({allowedValues:e,pickerStyles:{optionBackgroundColor:n,backgroundColor:r,selectedOptionBackgroundColor:i,optionTextStyle:a,titleTextAlignment:d,selectedOptionColor:l,titleTextStyle:c}={},onSelectedValueChanged:p,selectedValue:m,customization:{placeholderLabel:x}={}}){const g=e.map($=>({...$.value,...$.options,label:$.value.name,value:J.isAllowedValueWithCode($.value)?$.value.code:$.value.id})),h=g.find($=>$.name===m?.value.name),C=o.useTheme(),b=n??C.colors.grey5,S=r??C.colors.grey5,y=i??C.colors.grey3,j=a??t.textStyles.standardRegular.cssObject,f=c??t.textStyles.smallRegular.cssObject,E={control:($,{selectProps:A})=>({...$,border:0,height:"100%",backgroundColor:S,fill:A.menuIsOpen===!0?C.colors.primary:C.colors.grey1,boxShadow:S,":active":{backgroundColor:S},":hover":{fill:C.colors.primary},width:"auto",minHeight:"auto",cursor:"pointer"}),container:$=>({...$,backgroundColor:S,width:"100%",height:"100%"}),singleValue:($,{data:A})=>({...$,display:"flex",flexDirection:"row",alignItems:"center",padding:"1px 6px",margin:`${t.Space.sp0}`,height:"20px",color:A.color?.toString()??C.colors.hero,background:A.bgColor?.toString()??C.colors.grey3,border:`1px solid ${A.borderColor?.toString()??C.colors.hero}`,borderRadius:t.sp[1]}),valueContainer:$=>({...$,maxWidth:"100%",height:"100%",cursor:"pointer",...f,overflow:"visible",minWidth:"auto",padding:0,display:"flex",justifyContent:d??"flex-start",alignItems:"center",flexWrap:"nowrap"}),menu:$=>({...$,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:$=>({...$,borderRadius:t.sp[1]}),placeholder:($,{isFocused:A})=>({...$,width:"100%",margin:0,color:A?C.colors.primary:"currentColor"}),option:($,{isSelected:A,isFocused:
|
|
527
|
+
`;function Cs({allowedValues:e,pickerStyles:{optionBackgroundColor:n,backgroundColor:r,selectedOptionBackgroundColor:i,optionTextStyle:a,titleTextAlignment:d,selectedOptionColor:l,titleTextStyle:c}={},onSelectedValueChanged:p,selectedValue:m,customization:{placeholderLabel:x}={}}){const g=e.map($=>({...$.value,...$.options,label:$.value.name,value:J.isAllowedValueWithCode($.value)?$.value.code:$.value.id})),h=g.find($=>$.name===m?.value.name),C=o.useTheme(),b=n??C.colors.grey5,S=r??C.colors.grey5,y=i??C.colors.grey3,j=a??t.textStyles.standardRegular.cssObject,f=c??t.textStyles.smallRegular.cssObject,E={control:($,{selectProps:A})=>({...$,border:0,height:"100%",backgroundColor:S,fill:A.menuIsOpen===!0?C.colors.primary:C.colors.grey1,boxShadow:S,":active":{backgroundColor:S},":hover":{fill:C.colors.primary},width:"auto",minHeight:"auto",cursor:"pointer"}),container:$=>({...$,backgroundColor:S,width:"100%",height:"100%"}),singleValue:($,{data:A})=>({...$,display:"flex",flexDirection:"row",alignItems:"center",padding:"1px 6px",margin:`${t.Space.sp0}`,height:"20px",color:A.color?.toString()??C.colors.hero,background:A.bgColor?.toString()??C.colors.grey3,border:`1px solid ${A.borderColor?.toString()??C.colors.hero}`,borderRadius:t.sp[1]}),valueContainer:$=>({...$,maxWidth:"100%",height:"100%",cursor:"pointer",...f,overflow:"visible",minWidth:"auto",padding:0,display:"flex",justifyContent:d??"flex-start",alignItems:"center",flexWrap:"nowrap"}),menu:$=>({...$,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:$=>({...$,borderRadius:t.sp[1]}),placeholder:($,{isFocused:A})=>({...$,width:"100%",margin:0,color:A?C.colors.primary:"currentColor"}),option:($,{isSelected:A,isFocused:I,isDisabled:v,data:w})=>({...$,...j,height:t.sp[6],color:A?l??C.colors.champion:C.colors.hero,backgroundColor:A?y:I?C.colors.background:b,cursor:v?"not-allowed":"pointer",borderTop:w.topBorder===!0?`1px solid ${C.colors.grey3}`:"none",":hover":{backgroundColor:C.colors.background,color:C.colors.primary},"& label":{paddingRight:"10px",cursor:v?"not-allowed":A?"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(Hc,{onClick:$=>$.stopPropagation(),"data-testid":t.generateDataTestId("cockpit-single-value-picker"),children:o.jsxRuntimeExports.jsx(o.StateManagedSelect$1,{onChange:$=>{if($){const A=e.find(I=>I.value.name===$.name);p(A)}},menuPlacement:"auto",minMenuHeight:208,defaultValue:h,value:h,menuShouldScrollIntoView:!1,components:{Option:Qc,DropdownIndicator:Kc,IndicatorSeparator:Gc,SingleValue:Jc},hideSelectedOptions:!1,closeMenuOnSelect:!1,styles:E,options:g,isClearable:!1,isSearchable:!1,placeholder:o.jsxRuntimeExports.jsxs(Yc,{"data-testid":t.generateDataTestId("cockpit-single-value-picker-placeholder"),children:[o.jsxRuntimeExports.jsx(Zc,{children:o.jsxRuntimeExports.jsx(Xc,{})}),o.jsxRuntimeExports.jsx(qc,{children:x??"Select..."})]})})})}const Kc=()=>null,Gc=()=>null,Yc=s.div`
|
|
528
528
|
display: flex;
|
|
529
529
|
align-items: center;
|
|
530
530
|
color: ${e=>e.theme.colors.grey1};
|
|
@@ -645,7 +645,7 @@
|
|
|
645
645
|
fill: ${e=>e.theme.colors.grey1};
|
|
646
646
|
`,$d=({chips:e})=>o.jsxRuntimeExports.jsx(jd,{children:e.length>0?e.map((n,r)=>o.jsxRuntimeExports.jsx(bd,{color:n.color,children:n.label},`${n.label}_${r}`)):o.jsxRuntimeExports.jsx(Rd,{children:"-"})}),fn=[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],Ed=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 vd(e,n=0){const r=Ed(e)+n*n*n;return fn[Math.floor(r/fn.length)%fn.length]}const wd=e=>e.map(n=>({label:n,color:vd(n,n.length)})),ki={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)}},kd=e=>e.map(n=>({value:n,options:ki[n.id]})),Td=({onSelectionChanged:e,selectedGroupIndex:n,allGroups:r})=>{const i=kd(r);return o.jsxRuntimeExports.jsx(Pd,{children:o.jsxRuntimeExports.jsx(Cs,{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})})},Pd=s.div`
|
|
647
647
|
width: 70%;
|
|
648
|
-
`,
|
|
648
|
+
`,Id=({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(Td,{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,Ct=[{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}];Ct.map(e=>e.key);var Oe=(e=>(e.CUSTOMER="customer",e.TEAM="team",e))(Oe||{});const Ld=({activeEntity:e,teamNote:n,customerNote:r})=>e===Oe.CUSTOMER?r:e===Oe.TEAM?n:"",Ad=({activeEntity:e,teamRating:n,customerRating:r})=>{if(e===Oe.CUSTOMER)return r;if(e===Oe.TEAM)return n},Dd=({activeEntity:e,teamRatingLastUpdatedBy:n,customerRatingLastUpdatedBy:r})=>{if(e===Oe.CUSTOMER)return r;if(e===Oe.TEAM)return n},Od=({activeEntity:e,customerRatingLastUpdatedDate:n,teamRatingLastUpdatedDate:r})=>{if(e===Oe.CUSTOMER)return n;if(e===Oe.TEAM)return r},ls=({teamRating:e,teamNote:n,customerRating:r,customerNote:i,activeEntity:a})=>{const d=Ad({activeEntity:a,teamRating:e,customerRating:r}),l=Ld({activeEntity:a,teamNote:n,customerNote:i});return{savedOption:d,savedNote:l}},Nd=({teamRating:e,customerRating:n,teamNote:r,customerNote:i,activeEntity:a,selectedOption:d,noteValue:l})=>{if(a!=null){const{savedOption:c,savedNote:p}=ls({teamRating:e,teamNote:r,customerRating:n,customerNote:i,activeEntity:a});return l.trim().length===0||c===d&&l===p||c!==d&&l===Ti(p)}return!0},Ti=e=>`
|
|
649
649
|
---------------
|
|
650
650
|
${e}`,Md=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"})),zd=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"})),Hs=s.button`
|
|
651
651
|
background: none;
|
|
@@ -777,7 +777,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
777
777
|
display: flex;
|
|
778
778
|
column-gap: ${t.Space.sp3};
|
|
779
779
|
align-items: center;
|
|
780
|
-
`,Sp=({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),x=u.useCallback(E=>{const{savedOption:$,savedNote:A}=ls({...e,activeEntity:E});d($),c(A)},[e]),g=u.useCallback(E=>{if(E!==a&&r!=null){const{savedOption:$,savedNote:A}=ls({...e,activeEntity:r});if(d(E),$!=null){if(E===$){c(A);return}c(Ti(A));return}c("")}},[a,r,e]),h=u.useCallback(E=>{c(E.target.value)},[]),C=u.useCallback((E,$)=>{$.preventDefault(),i(E),x(E)},[x]),b=u.useCallback(()=>{i(void 0),d(void 0),c("")},[]),S=u.useCallback(()=>{const E={...e};E.customerSatisfactionId=e.customerSatisfactionId,r===Oe.CUSTOMER&&(E.customerRating=a,E.customerNote=l),r===Oe.TEAM&&(E.teamRating=a,E.teamNote=l),i(void 0),n(E)},[a,l,r,e,n]),y=r===Oe.CUSTOMER?To:r===Oe.TEAM?eo:{},j=Nd({...e,activeEntity:r,selectedOption:a,noteValue:l}),f=()=>{const E=r===Oe.CUSTOMER?p.current:m.current;return o.jsxRuntimeExports.jsx(hp,{onClose:b,anchorEl:E,open:!!r,children:o.jsxRuntimeExports.jsx(xp,{customerSatisfactionOptions:y,selectedOption:a,noteValue:l,lastUpdatedBy:Dd({...e,activeEntity:r}),lastUpdatedTime:Od({...e,activeEntity:r}),savedOption:r===Oe.CUSTOMER?e.customerRating:e.teamRating,saveBtnDisabled:j,onCancel:b,onSave:S,onOptionChange:g,onNoteChange:h})})};return o.jsxRuntimeExports.jsxs(gp,{children:[o.jsxRuntimeExports.jsx(cs,{ref:p,savedRating:e.customerRating,isActive:r===Oe.CUSTOMER,entityType:Oe.CUSTOMER,onClick:C}),o.jsxRuntimeExports.jsx(cs,{ref:m,savedRating:e.teamRating,isActive:r===Oe.TEAM,entityType:Oe.TEAM,onClick:C}),f()]})},yp=({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(Sp,{customerSatisfaction:n,onSave:a})})},fp={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)}},Cp=e=>e.map(n=>({value:n,options:fp[n.code]})),jp=({onSelectionChanged:e,selectedTaxStatusIndex:n,allTaxStatuses:r})=>{const i=Cp(r);return o.jsxRuntimeExports.jsx(Cs,{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})},bp=({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(jp,{onSelectionChanged:l=>d({allGroups:e.allTaxStatuses,selectedValue:e.allTaxStatuses[l]}),selectedTaxStatusIndex:e.allTaxStatuses.findIndex(l=>l.code===a.selectedValue?.code),allTaxStatuses:e.allTaxStatuses})})},Vt=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"})),Li=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:Ks,editMonthInsight:Rp,createMonthInsight:$p,monthInsightSent:Ep,monthInsightNotReady:vp,monthInsightsCanBeSentFromDashboard:wp,sendMonthInsightsFromDashboardWhenReady:kp,monthInsightsCanBeEditedFromDashboard:Tp,monthEndHistoryUnavailable:Pp}},dateFormat:Ii,common:bo}=t.appLocale.getLocalizedStrings(),Lp=["status","group","reportSent","taxStatus","customerSatisfaction"],Ip=({reportSent:e,hasMonthEndEmailHistory:n,onReportSentClick:r})=>{if(e.date==null)return o.jsxRuntimeExports.jsx(Cn,{children:bo.strings.hyphen});const i=`${bo.datePicker.businessDay} ${e.businessDay??bo.strings.empty}${bo.strings.colon} ${e.date.format(Ii.visual.DMMMFormat)}`;return n?o.jsxRuntimeExports.jsx(Cn,{onClick:r,children:i}):o.jsxRuntimeExports.jsx(t.Tooltip,{placement:"bottom-end",variant:"small-description",data:Pp,style:{color:t.Colors.championDark,marginTop:t.Space.sp2},display:"flex",children:o.jsxRuntimeExports.jsx(Cn,{children:i})})},Ap=({companyView:e,hasMonthEndEmailHistory:n,companiesExcludedFromMonthEndReport:r,showDetailsPageLink:i,allUsers:a,loggedInUserRole:d,companyNameSticky:l,totalHeight:c,isExpenseAutomationEnabledForUser:p,addThreadRequestThreadId:m,targetElementFromNavigation:x,resetTargetElementFromNavigation:g,setNoteData:h,setElementRef:C,setAddThreadRequestThreadId:b,changeHandlers:S,onCompanyNameClicked:y,onPassportIconClicked:j,onTaskIconClicked:f,onViewDetailsLinkClicked:E,onMonthEndReportPageClick:$,showMonthEndReportHistoricData:A})=>{const[P,v]=u.useState(null),w=t.useWindowSizeContext(),F=o.useForm({mode:"all"}),[D,K]=u.useState(!1),{companyId:M,name:G}=e.company.company.companyInfo,q=["companyData.status","companyData.group","companyData.controller","companyData.customerSuccessManager","companyData.preparer","companyData.reviewer","companyData.apAnalyst","companyData.reportSent","companyData.taxStatus","companyData.taxLead","companyData.customerSatisfaction"],R=`cockpit_${M}`,L="management.notes",{threads:W,isLoading:k}=t.useFilteredThreads({entityType:L,companyId:M},!1),{openThread:I,threads:N,addThread:Q,removeThread:ae,setOpenThread:z}=u.useContext(t.ThreadsContext),Y=I!==null?N.get(I):null,T=I?.includes(M)===!0,te=I!=null&&N.get(I)==null&&T,re=m!=null&&N.get(m)?.metadata.companyId===M,Z=(_,ce)=>{q.includes(_)&&S(M,ce)};u.useEffect(()=>{const _=F.watch((ce,{name:Se})=>{Se!=null&&ce.companyData!=null&&o.defer(()=>Z(Se,qp(ce.companyData,Se)))});return()=>{_.unsubscribe()}});const ie=Xp(e,a),ne=()=>{e.company.schema.status.length===0?K(!0):y(e)},xe=()=>{$?.(e)},ye=d?.userRoles?.includes("admin"),$e=e.company.company.configInfo.isMonthEndReportInDraft,V=J.canSendMonthEndEmailReport(e,r),ee=J.shouldEnableCalendarPickerForLastReportSent(e,r),ge=e.company.company.companyInfo.bookCloseDate,ve=e.company.company.managementInfo.lastReportSentDate,Ce=e.taskSummary?.count??0,O=u.useCallback(()=>{I?.includes(t.NEW_THREAD_SUFFIX)===!0&&ae(I),m!=null&&b(void 0)},[m,I,ae,b]),ke=u.useCallback(_=>{if(_===I)z(null);else if(N.has(_))z(_);else if(_.includes(t.NEW_THREAD_SUFFIX)){const[ce,Se]=_.replace(t.NEW_THREAD_SUFFIX,"").split("."),fe=_t(Rt(ce),J.toManagementSortKeyType(Se),M,G);Q(_,{type:"thread",visibility:"public",id:_,roomId:R,createdAt:new Date,updatedAt:new Date,comments:[],metadata:fe,resolved:!1}),z(_)}},[M,G,I,N,Q,z,R]),B=u.useCallback((_,ce,Se=!1)=>{const fe=Ct.find(Le=>Le.key===ce);if(g(),fe!=null&&(_.type==="contextmenu"||Se===!0)){if(fe.isThreadAllowed===!1)return;O(),_.preventDefault(),_.stopPropagation();const Le=t.toCollaborationEntityType({tab:"management",key:fe.key});if(_.target instanceof HTMLElement||_.target instanceof SVGElement)if(Se===!0&&_.target instanceof HTMLElement)v(_.target.parentElement);else if(_.target instanceof HTMLElement){const Ie=fs(_.target,oe);v(Ie||_.target)}else{const Ie=_.target.closest(`.${oe}`);Ie instanceof HTMLElement&&v(Ie)}const H=[...t.getFilteredThreads(N,{entityType:Le,companyId:M},"both")],ue=H.length>0&&H[0].length>0?H[0][0]:Pe("management",fe.key,M);N.has(ue)?ke(ue):m===ue?b(void 0):(b(ue),z(null))}},[N,M,m,ke,b,z,g,O]),de=u.useCallback((_,ce)=>{_.stopPropagation();const Se=Pe("management",ce,M);b(void 0),ke(Se)},[M,b,ke]),je=()=>{ie.reportSent.date!=null&&A(M,ie.reportSent.date)},U=_=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:_.isElementThreadOpen??!1,isElementThreadPresent:_.isElementThreadPresent??!1,itemKey:_.itemKey,elementThreadId:_.elementThreadId??"",roomId:R,addThreadRequestThreadId:m,openThreadId:I,threadStyle:_.threadStyle,openThreadMetadata:Y?.metadata??null,onElementClick:B,onAddThreadClick:de,targetElement:x??P});return o.jsxRuntimeExports.jsxs(o.FormProvider,{...F,children:[D===!0?o.jsxRuntimeExports.jsx(Cd,{companyDomain:e.company.company.companyInfo.primaryEmailDomain,hasAdminRole:ye,onCancelClick:()=>K(!1),onConnectClick:()=>y(e)}):null,o.jsxRuntimeExports.jsx("form",{style:{height:"100%"},children:o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{g(),m!=null&&(b(void 0),m.includes(t.NEW_THREAD_SUFFIX)&&ae(m))},children:o.jsxRuntimeExports.jsx(Dp,{windowSize:w,hoverParentSubsidiaryTag:i??!1,isThreadOpen:T||re,totalHeight:c,isCreationInProgress:te,children:Ct.map((_,ce)=>{const Se=t.toCollaborationEntityType({tab:"management",key:_.key}),fe=Ct.length-2<=ce,Le=[...t.getFilteredThreads(N,{entityType:Se,companyId:M},"both")],H=Le.length>0&&Le[0].length>0?Le[0][0]:Pe("management",_.key,M),ue=N.get(H),Ie=ue!=null&&ue.resolved===!1,Be=H===I,me=m===H;switch(_.key){case"companyName":return o.jsxRuntimeExports.jsxs(Fp,{companyNameSticky:l,columnWidth:_.width,windowSize:w,isThreadOpen:Be||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),ref:X=>{C(M,_.key,X)},children:[o.jsxRuntimeExports.jsxs(Mp,{children:[o.jsxRuntimeExports.jsx(zp,{className:"company-name",onClick:X=>{X.preventDefault(),X.stopPropagation(),ne()},children:ie.companyName}),ie.parentSubsidiaryInfo&&o.jsxRuntimeExports.jsx(_c,{companyId:ie.companyId,isEnabled:i,onViewDetailsLinkClicked:E,companyName:ie.companyName,parentSubsidiaryRelationship:ie.parentSubsidiaryInfo}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:Be,targetElement:x??P,roomId:R,openThreadId:I,openThreadMetadata:Y?.metadata??null})]}),o.jsxRuntimeExports.jsxs(Bp,{children:[o.jsxRuntimeExports.jsxs(Vp,{onClick:X=>{X.preventDefault(),h({roomId:R,companyId:M,companyName:G,entityType:L})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:W.length,isLoading:k}),o.jsxRuntimeExports.jsx(Up,{})]}),o.jsxRuntimeExports.jsx(Wp,{onClick:X=>{X.preventDefault(),j(e)},children:o.jsxRuntimeExports.jsx(_p,{className:"passportIcon"})})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:Ie,itemKey:_.key,style:{left:t.Space.sp4},onElementClick:B}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Pe("management",_.key,M),addThreadRequestThreadId:m,itemKey:_.key,onAddThreadClick:de})]},H);case"task":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[o.jsxRuntimeExports.jsxs(Hp,{onClick:X=>{X.preventDefault(),f?.(e)},children:[o.jsxRuntimeExports.jsx(Kp,{}),Ce>0?o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{isLoading:!1,count:Ce}):null]}),U({isElementThreadOpen:Be,isElementThreadPresent:Ie,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"status":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[o.jsxRuntimeExports.jsx(rd,{name:"companyData.status",value:ie.status}),U({isElementThreadOpen:Be,isElementThreadPresent:Ie,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"group":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[o.jsxRuntimeExports.jsx(Ld,{name:"companyData.group",value:ie.group}),U({isElementThreadOpen:Be,isElementThreadPresent:Ie,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"plans":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[o.jsxRuntimeExports.jsx($d,{chips:ie.plansAndAddons}),U({isElementThreadOpen:Be,isElementThreadPresent:Ie,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"satisfaction":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},windowSize:w,columnWidth:_.width,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[o.jsxRuntimeExports.jsx(yp,{name:"companyData.customerSatisfaction",value:ie.customerSatisfaction}),U({isElementThreadOpen:Be,isElementThreadPresent:Ie,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"bookCloseDate":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[ge?.format(Ii.visual.MMMDCommaYYYYformat)??bo.strings.hyphen,U({isElementThreadOpen:Be,isElementThreadPresent:Ie,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"reportSent":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),style:{alignItems:"center"},children:[ee&&o.jsxRuntimeExports.jsx(Np,{children:o.jsxRuntimeExports.jsx(t.ZeniDatePickerField,{name:"companyData.reportSent",defaultValue:ie.reportSent})}),!ee&&o.jsxRuntimeExports.jsx(Ip,{reportSent:ie.reportSent,onReportSentClick:je,hasMonthEndEmailHistory:n}),o.jsxRuntimeExports.jsx(Op,{children:p?o.jsxRuntimeExports.jsx(eu,{isMonthEndReportInDraft:$e,bookCloseDate:ge,lastReportSentDate:ve,enableCompanyMonthEndReportBtn:V,handleMonthEndReportPageClick:xe}):o.jsxRuntimeExports.jsx(ds,{isMonthEndReportInDraft:$e,bookCloseDate:ge,lastReportSentDate:ve,enableCompanyMonthEndReportBtn:V,isExpenseAutomationEnabledForUser:p,handleMonthEndReportPageClick:xe})}),U({isElementThreadOpen:Be,isElementThreadPresent:Ie,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"customerSuccessManager":case"preparer":case"reviewer":case"apAnalyst":case"controller":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:`companyData.${_.key}`,value:ie[_.key],placeholderLabel:Ks[_.key],pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),U({isElementThreadOpen:Be,isElementThreadPresent:Ie,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"taxStatus":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[o.jsxRuntimeExports.jsx(bp,{name:"companyData.taxStatus",value:ie.taxStatus}),U({isElementThreadOpen:Be,isElementThreadPresent:Ie,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"taxLead":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:"companyData.taxLead",value:ie.taxLead,placeholderLabel:Ks.taxLead,pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),U({isElementThreadOpen:Be,isElementThreadPresent:Ie,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"monthlyRecurringRevenue":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[t.amountToString("0,0",ie.monthlyRecurringRevenue),U({isElementThreadOpen:Be,isElementThreadPresent:Ie,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"annualRecurringRevenue":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[t.amountToString("0,0",ie.annualRecurringRevenue),U({isElementThreadOpen:Be,isElementThreadPresent:Ie,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);default:return null}})})})})]})},ds=({enableCompanyMonthEndReportBtn:e,isMonthEndReportInDraft:n,isExpenseAutomationEnabledForUser:r,bookCloseDate:i,lastReportSentDate:a,handleMonthEndReportPageClick:d})=>o.jsxRuntimeExports.jsx(t.Button,{size:"small",onClick:d,variant:"primary",label:Jp(e,n,i,a),disabled:!e||r,style:e?{}:{background:"transparent"},prefixIcon:e&&n?o.jsxRuntimeExports.jsx(Gp,{}):void 0}),Dp=s.div`
|
|
780
|
+
`,Sp=({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),x=u.useCallback(E=>{const{savedOption:$,savedNote:A}=ls({...e,activeEntity:E});d($),c(A)},[e]),g=u.useCallback(E=>{if(E!==a&&r!=null){const{savedOption:$,savedNote:A}=ls({...e,activeEntity:r});if(d(E),$!=null){if(E===$){c(A);return}c(Ti(A));return}c("")}},[a,r,e]),h=u.useCallback(E=>{c(E.target.value)},[]),C=u.useCallback((E,$)=>{$.preventDefault(),i(E),x(E)},[x]),b=u.useCallback(()=>{i(void 0),d(void 0),c("")},[]),S=u.useCallback(()=>{const E={...e};E.customerSatisfactionId=e.customerSatisfactionId,r===Oe.CUSTOMER&&(E.customerRating=a,E.customerNote=l),r===Oe.TEAM&&(E.teamRating=a,E.teamNote=l),i(void 0),n(E)},[a,l,r,e,n]),y=r===Oe.CUSTOMER?To:r===Oe.TEAM?eo:{},j=Nd({...e,activeEntity:r,selectedOption:a,noteValue:l}),f=()=>{const E=r===Oe.CUSTOMER?p.current:m.current;return o.jsxRuntimeExports.jsx(hp,{onClose:b,anchorEl:E,open:!!r,children:o.jsxRuntimeExports.jsx(xp,{customerSatisfactionOptions:y,selectedOption:a,noteValue:l,lastUpdatedBy:Dd({...e,activeEntity:r}),lastUpdatedTime:Od({...e,activeEntity:r}),savedOption:r===Oe.CUSTOMER?e.customerRating:e.teamRating,saveBtnDisabled:j,onCancel:b,onSave:S,onOptionChange:g,onNoteChange:h})})};return o.jsxRuntimeExports.jsxs(gp,{children:[o.jsxRuntimeExports.jsx(cs,{ref:p,savedRating:e.customerRating,isActive:r===Oe.CUSTOMER,entityType:Oe.CUSTOMER,onClick:C}),o.jsxRuntimeExports.jsx(cs,{ref:m,savedRating:e.teamRating,isActive:r===Oe.TEAM,entityType:Oe.TEAM,onClick:C}),f()]})},yp=({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(Sp,{customerSatisfaction:n,onSave:a})})},fp={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)}},Cp=e=>e.map(n=>({value:n,options:fp[n.code]})),jp=({onSelectionChanged:e,selectedTaxStatusIndex:n,allTaxStatuses:r})=>{const i=Cp(r);return o.jsxRuntimeExports.jsx(Cs,{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})},bp=({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(jp,{onSelectionChanged:l=>d({allGroups:e.allTaxStatuses,selectedValue:e.allTaxStatuses[l]}),selectedTaxStatusIndex:e.allTaxStatuses.findIndex(l=>l.code===a.selectedValue?.code),allTaxStatuses:e.allTaxStatuses})})},Vt=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"})),Ii=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:Ks,editMonthInsight:Rp,createMonthInsight:$p,monthInsightSent:Ep,monthInsightNotReady:vp,monthInsightsCanBeSentFromDashboard:wp,sendMonthInsightsFromDashboardWhenReady:kp,monthInsightsCanBeEditedFromDashboard:Tp,monthEndHistoryUnavailable:Pp}},dateFormat:Li,common:bo}=t.appLocale.getLocalizedStrings(),Ip=["status","group","reportSent","taxStatus","customerSatisfaction"],Lp=({reportSent:e,hasMonthEndEmailHistory:n,onReportSentClick:r})=>{if(e.date==null)return o.jsxRuntimeExports.jsx(Cn,{children:bo.strings.hyphen});const i=`${bo.datePicker.businessDay} ${e.businessDay??bo.strings.empty}${bo.strings.colon} ${e.date.format(Li.visual.DMMMFormat)}`;return n?o.jsxRuntimeExports.jsx(Cn,{onClick:r,children:i}):o.jsxRuntimeExports.jsx(t.Tooltip,{placement:"bottom-end",variant:"small-description",data:Pp,style:{color:t.Colors.championDark,marginTop:t.Space.sp2},display:"flex",children:o.jsxRuntimeExports.jsx(Cn,{children:i})})},Ap=({companyView:e,hasMonthEndEmailHistory:n,companiesExcludedFromMonthEndReport:r,showDetailsPageLink:i,allUsers:a,loggedInUserRole:d,companyNameSticky:l,totalHeight:c,isExpenseAutomationEnabledForUser:p,addThreadRequestThreadId:m,targetElementFromNavigation:x,resetTargetElementFromNavigation:g,setNoteData:h,setElementRef:C,setAddThreadRequestThreadId:b,changeHandlers:S,onCompanyNameClicked:y,onPassportIconClicked:j,onTaskIconClicked:f,onViewDetailsLinkClicked:E,onMonthEndReportPageClick:$,showMonthEndReportHistoricData:A})=>{const[I,v]=u.useState(null),w=t.useWindowSizeContext(),F=o.useForm({mode:"all"}),[D,K]=u.useState(!1),{companyId:M,name:G}=e.company.company.companyInfo,q=["companyData.status","companyData.group","companyData.controller","companyData.customerSuccessManager","companyData.preparer","companyData.reviewer","companyData.apAnalyst","companyData.reportSent","companyData.taxStatus","companyData.taxLead","companyData.customerSatisfaction"],R=`cockpit_${M}`,L="management.notes",{threads:W,isLoading:k}=t.useFilteredThreads({entityType:L,companyId:M},!1),{openThread:P,threads:N,addThread:Q,removeThread:ae,setOpenThread:z}=u.useContext(t.ThreadsContext),Y=P!==null?N.get(P):null,T=P?.includes(M)===!0,te=P!=null&&N.get(P)==null&&T,re=m!=null&&N.get(m)?.metadata.companyId===M,Z=(_,ce)=>{q.includes(_)&&S(M,ce)};u.useEffect(()=>{const _=F.watch((ce,{name:Se})=>{Se!=null&&ce.companyData!=null&&o.defer(()=>Z(Se,qp(ce.companyData,Se)))});return()=>{_.unsubscribe()}});const ie=Xp(e,a),ne=()=>{e.company.schema.status.length===0?K(!0):y(e)},xe=()=>{$?.(e)},ye=d?.userRoles?.includes("admin"),$e=e.company.company.configInfo.isMonthEndReportInDraft,V=J.canSendMonthEndEmailReport(e,r),ee=J.shouldEnableCalendarPickerForLastReportSent(e,r),ge=e.company.company.companyInfo.bookCloseDate,ve=e.company.company.managementInfo.lastReportSentDate,Ce=e.taskSummary?.count??0,O=u.useCallback(()=>{P?.includes(t.NEW_THREAD_SUFFIX)===!0&&ae(P),m!=null&&b(void 0)},[m,P,ae,b]),ke=u.useCallback(_=>{if(_===P)z(null);else if(N.has(_))z(_);else if(_.includes(t.NEW_THREAD_SUFFIX)){const[ce,Se]=_.replace(t.NEW_THREAD_SUFFIX,"").split("."),fe=_t(Rt(ce),J.toManagementSortKeyType(Se),M,G);Q(_,{type:"thread",visibility:"public",id:_,roomId:R,createdAt:new Date,updatedAt:new Date,comments:[],metadata:fe,resolved:!1}),z(_)}},[M,G,P,N,Q,z,R]),B=u.useCallback((_,ce,Se=!1)=>{const fe=Ct.find(Ie=>Ie.key===ce);if(g(),fe!=null&&(_.type==="contextmenu"||Se===!0)){if(fe.isThreadAllowed===!1)return;O(),_.preventDefault(),_.stopPropagation();const Ie=t.toCollaborationEntityType({tab:"management",key:fe.key});if(_.target instanceof HTMLElement||_.target instanceof SVGElement)if(Se===!0&&_.target instanceof HTMLElement)v(_.target.parentElement);else if(_.target instanceof HTMLElement){const Le=fs(_.target,oe);v(Le||_.target)}else{const Le=_.target.closest(`.${oe}`);Le instanceof HTMLElement&&v(Le)}const H=[...t.getFilteredThreads(N,{entityType:Ie,companyId:M},"both")],ue=H.length>0&&H[0].length>0?H[0][0]:Pe("management",fe.key,M);N.has(ue)?ke(ue):m===ue?b(void 0):(b(ue),z(null))}},[N,M,m,ke,b,z,g,O]),de=u.useCallback((_,ce)=>{_.stopPropagation();const Se=Pe("management",ce,M);b(void 0),ke(Se)},[M,b,ke]),je=()=>{ie.reportSent.date!=null&&A(M,ie.reportSent.date)},U=_=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:_.isElementThreadOpen??!1,isElementThreadPresent:_.isElementThreadPresent??!1,itemKey:_.itemKey,elementThreadId:_.elementThreadId??"",roomId:R,addThreadRequestThreadId:m,openThreadId:P,threadStyle:_.threadStyle,openThreadMetadata:Y?.metadata??null,onElementClick:B,onAddThreadClick:de,targetElement:x??I});return o.jsxRuntimeExports.jsxs(o.FormProvider,{...F,children:[D===!0?o.jsxRuntimeExports.jsx(Cd,{companyDomain:e.company.company.companyInfo.primaryEmailDomain,hasAdminRole:ye,onCancelClick:()=>K(!1),onConnectClick:()=>y(e)}):null,o.jsxRuntimeExports.jsx("form",{style:{height:"100%"},children:o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{g(),m!=null&&(b(void 0),m.includes(t.NEW_THREAD_SUFFIX)&&ae(m))},children:o.jsxRuntimeExports.jsx(Dp,{windowSize:w,hoverParentSubsidiaryTag:i??!1,isThreadOpen:T||re,totalHeight:c,isCreationInProgress:te,children:Ct.map((_,ce)=>{const Se=t.toCollaborationEntityType({tab:"management",key:_.key}),fe=Ct.length-2<=ce,Ie=[...t.getFilteredThreads(N,{entityType:Se,companyId:M},"both")],H=Ie.length>0&&Ie[0].length>0?Ie[0][0]:Pe("management",_.key,M),ue=N.get(H),Le=ue!=null&&ue.resolved===!1,Be=H===P,me=m===H;switch(_.key){case"companyName":return o.jsxRuntimeExports.jsxs(Fp,{companyNameSticky:l,columnWidth:_.width,windowSize:w,isThreadOpen:Be||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),ref:X=>{C(M,_.key,X)},children:[o.jsxRuntimeExports.jsxs(Mp,{children:[o.jsxRuntimeExports.jsx(zp,{className:"company-name",onClick:X=>{X.preventDefault(),X.stopPropagation(),ne()},children:ie.companyName}),ie.parentSubsidiaryInfo&&o.jsxRuntimeExports.jsx(_c,{companyId:ie.companyId,isEnabled:i,onViewDetailsLinkClicked:E,companyName:ie.companyName,parentSubsidiaryRelationship:ie.parentSubsidiaryInfo}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:Be,targetElement:x??I,roomId:R,openThreadId:P,openThreadMetadata:Y?.metadata??null})]}),o.jsxRuntimeExports.jsxs(Bp,{children:[o.jsxRuntimeExports.jsxs(Vp,{onClick:X=>{X.preventDefault(),h({roomId:R,companyId:M,companyName:G,entityType:L})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:W.length,isLoading:k}),o.jsxRuntimeExports.jsx(Up,{})]}),o.jsxRuntimeExports.jsx(Wp,{onClick:X=>{X.preventDefault(),j(e)},children:o.jsxRuntimeExports.jsx(_p,{className:"passportIcon"})})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:Le,itemKey:_.key,style:{left:t.Space.sp4},onElementClick:B}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Pe("management",_.key,M),addThreadRequestThreadId:m,itemKey:_.key,onAddThreadClick:de})]},H);case"task":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[o.jsxRuntimeExports.jsxs(Hp,{onClick:X=>{X.preventDefault(),f?.(e)},children:[o.jsxRuntimeExports.jsx(Kp,{}),Ce>0?o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{isLoading:!1,count:Ce}):null]}),U({isElementThreadOpen:Be,isElementThreadPresent:Le,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"status":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[o.jsxRuntimeExports.jsx(rd,{name:"companyData.status",value:ie.status}),U({isElementThreadOpen:Be,isElementThreadPresent:Le,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"group":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[o.jsxRuntimeExports.jsx(Id,{name:"companyData.group",value:ie.group}),U({isElementThreadOpen:Be,isElementThreadPresent:Le,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"plans":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[o.jsxRuntimeExports.jsx($d,{chips:ie.plansAndAddons}),U({isElementThreadOpen:Be,isElementThreadPresent:Le,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"satisfaction":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},windowSize:w,columnWidth:_.width,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[o.jsxRuntimeExports.jsx(yp,{name:"companyData.customerSatisfaction",value:ie.customerSatisfaction}),U({isElementThreadOpen:Be,isElementThreadPresent:Le,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"bookCloseDate":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[ge?.format(Li.visual.MMMDCommaYYYYformat)??bo.strings.hyphen,U({isElementThreadOpen:Be,isElementThreadPresent:Le,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"reportSent":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),style:{alignItems:"center"},children:[ee&&o.jsxRuntimeExports.jsx(Np,{children:o.jsxRuntimeExports.jsx(t.ZeniDatePickerField,{name:"companyData.reportSent",defaultValue:ie.reportSent})}),!ee&&o.jsxRuntimeExports.jsx(Lp,{reportSent:ie.reportSent,onReportSentClick:je,hasMonthEndEmailHistory:n}),o.jsxRuntimeExports.jsx(Op,{children:p?o.jsxRuntimeExports.jsx(eu,{isMonthEndReportInDraft:$e,bookCloseDate:ge,lastReportSentDate:ve,enableCompanyMonthEndReportBtn:V,handleMonthEndReportPageClick:xe}):o.jsxRuntimeExports.jsx(ds,{isMonthEndReportInDraft:$e,bookCloseDate:ge,lastReportSentDate:ve,enableCompanyMonthEndReportBtn:V,isExpenseAutomationEnabledForUser:p,handleMonthEndReportPageClick:xe})}),U({isElementThreadOpen:Be,isElementThreadPresent:Le,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"customerSuccessManager":case"preparer":case"reviewer":case"apAnalyst":case"controller":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:`companyData.${_.key}`,value:ie[_.key],placeholderLabel:Ks[_.key],pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),U({isElementThreadOpen:Be,isElementThreadPresent:Le,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"taxStatus":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[o.jsxRuntimeExports.jsx(bp,{name:"companyData.taxStatus",value:ie.taxStatus}),U({isElementThreadOpen:Be,isElementThreadPresent:Le,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"taxLead":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:"companyData.taxLead",value:ie.taxLead,placeholderLabel:Ks.taxLead,pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),U({isElementThreadOpen:Be,isElementThreadPresent:Le,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"monthlyRecurringRevenue":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[t.amountToString("0,0",ie.monthlyRecurringRevenue),U({isElementThreadOpen:Be,isElementThreadPresent:Le,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);case"annualRecurringRevenue":return o.jsxRuntimeExports.jsxs(tt,{ref:X=>{C(M,_.key,X)},columnWidth:_.width,windowSize:w,isThreadOpen:T||me,isThreadAllowed:_.isThreadAllowed,className:oe,onContextMenu:X=>B(X,_.key),children:[t.amountToString("0,0",ie.annualRecurringRevenue),U({isElementThreadOpen:Be,isElementThreadPresent:Le,itemKey:_.key,elementThreadId:H,threadStyle:fe?{right:t.Space.sp0}:void 0})]},H);default:return null}})})})})]})},ds=({enableCompanyMonthEndReportBtn:e,isMonthEndReportInDraft:n,isExpenseAutomationEnabledForUser:r,bookCloseDate:i,lastReportSentDate:a,handleMonthEndReportPageClick:d})=>o.jsxRuntimeExports.jsx(t.Button,{size:"small",onClick:d,variant:"primary",label:Jp(e,n,i,a),disabled:!e||r,style:e?{}:{background:"transparent"},prefixIcon:e&&n?o.jsxRuntimeExports.jsx(Gp,{}):void 0}),Dp=s.div`
|
|
781
781
|
display: flex;
|
|
782
782
|
flex-direction: row;
|
|
783
783
|
align-items: center;
|
|
@@ -919,7 +919,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
919
919
|
`,Hp=s.div`
|
|
920
920
|
display: flex;
|
|
921
921
|
position: relative;
|
|
922
|
-
`,Kp=s(
|
|
922
|
+
`,Kp=s(Ii)`
|
|
923
923
|
height: ${t.Space.sp4};
|
|
924
924
|
width: ${t.Space.sp4};
|
|
925
925
|
color: ${e=>e.theme.colors.hero};
|
|
@@ -931,7 +931,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
931
931
|
width: 12px;
|
|
932
932
|
height: 12px;
|
|
933
933
|
color: ${e=>e.theme.colors.grey5};
|
|
934
|
-
`,Yp=e=>{const n=[];return e.subscriptions.forEach(r=>{r.plan&&n.push(r.plan.plan.zeniSku)}),n},Zp=e=>{const n=[];return e.subscriptions.forEach(r=>{r.addOns.forEach(i=>{i.addOn.zeniSku!=null&&n.push(i.addOn.zeniSku)})}),n};function Xp(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:wd([...new Set(Yp(e).concat(Zp(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 qp(e,n){const r={};r.users=[];const i=n.split(".")[1];if(Qp(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(Gs(i,l.userId,l.isRoleSelected))}):d.forEach(l=>{r.users?.push(Gs(i,l.userId,l.isRoleSelected))}),{users:r.users}}}const Qp=e=>
|
|
934
|
+
`,Yp=e=>{const n=[];return e.subscriptions.forEach(r=>{r.plan&&n.push(r.plan.plan.zeniSku)}),n},Zp=e=>{const n=[];return e.subscriptions.forEach(r=>{r.addOns.forEach(i=>{i.addOn.zeniSku!=null&&n.push(i.addOn.zeniSku)})}),n};function Xp(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:wd([...new Set(Yp(e).concat(Zp(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 qp(e,n){const r={};r.users=[];const i=n.split(".")[1];if(Qp(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(Gs(i,l.userId,l.isRoleSelected))}):d.forEach(l=>{r.users?.push(Gs(i,l.userId,l.isRoleSelected))}),{users:r.users}}}const Qp=e=>Ip.includes(e);function Gs(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};default:return{isZeni:!0,role:e,userId:n,isSelected:r}}}const Jp=(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?Rp.replace("__month__",d):$p.replace("__month__",d):c===!0?Ep.replace("__month__",d):vp.replace("__month__",d)},eu=({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?Tp:wp:l===!0?null:kp;return c!=null?o.jsxRuntimeExports.jsx(t.Tooltip,{display:"block",placement:"bottom",maxWidth:"250",title:c,enterDelay:600,children:o.jsxRuntimeExports.jsx(ds,{isMonthEndReportInDraft:n,bookCloseDate:r,lastReportSentDate:i,enableCompanyMonthEndReportBtn:e,isExpenseAutomationEnabledForUser:!0,handleMonthEndReportPageClick:a})}):o.jsxRuntimeExports.jsx(ds,{isMonthEndReportInDraft:n,bookCloseDate:r,lastReportSentDate:i,enableCompanyMonthEndReportBtn:e,isExpenseAutomationEnabledForUser:!0,handleMonthEndReportPageClick:a})};function tu({companyNameSticky:e,sortConfig:n,onColumnSortConfigChanged:r}){const i=t.useWindowSizeContext(),[a,d]=u.useState(o.cloneDeep(Ct));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(su,{height:Ft,children:a.map(c=>o.jsxRuntimeExports.jsxs(ru,{companyNameSticky:e&&c.key==="companyName",sortDataValue:n.sortKey,actualDataValue:c.key,wrapperWidth:c.width,windowSize:i,children:[o.jsxRuntimeExports.jsxs(lu,{onClick:()=>l(J.toManagementSortKeyType(c.key),c.sortOrder),children:[o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:c.value}),o.jsxRuntimeExports.jsx(nu,{sortDataValue:n.sortKey,headerdata:c,children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:12,height:12})})]}),o.jsxRuntimeExports.jsx(au,{isVisible:n.sortKey===c.key&&c.key!=="status",children:o.jsxRuntimeExports.jsx(iu,{onClick:()=>l("status","ascending")})})]},c.key))})}const ou=u.memo(tu),nu=s.div`
|
|
935
935
|
display: flex;
|
|
936
936
|
align-items: center;
|
|
937
937
|
transform: ${e=>e.sortDataValue===e.headerdata.key&&e.headerdata.sortOrder==="descending"?"rotate(180deg)":"rotate(0deg)"};
|
|
@@ -1004,7 +1004,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1004
1004
|
width: ${e=>e.width.valuePx(e.windowSize)};
|
|
1005
1005
|
display: flex;
|
|
1006
1006
|
justify-content: start;
|
|
1007
|
-
`,uu={managementRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{common:{headers:{comments:mu}},collaboration:{threads:{placeholder:{addANewComment:xu,replyAComment:hu},tooltip:{resolveComment:gu,unResolveComment:Su}}},dateFormat:{analytics:{YYYYDashMMDashDDFormat:Ys}}}=t.appLocale.getLocalizedStrings(),yu=({managementView:e,companiesExcludedFromMonthEndReport:n,showDetailsPageLink:r=!0,loggedInUser:i,loggedInUserRole:a,expenseAutomationEnabledCompanies:d,onColumnSortConfigChanged:l,changeHandlers:c,onCompanyNameClicked:p,onTaskIconClicked:m,onPassportIconClicked:x,onScroll:g,onViewDetailsLinkClicked:h,onMonthEndReportPageClick:C,showMonthEndReportHistoricData:b,initialOpenThreadRequest:S})=>{const y=t.useWindowSizeContext(),j=u.useRef(null),[f,E]=u.useState(null),[$,A]=u.useState(null),{setOpenThread:
|
|
1007
|
+
`,uu={managementRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{common:{headers:{comments:mu}},collaboration:{threads:{placeholder:{addANewComment:xu,replyAComment:hu},tooltip:{resolveComment:gu,unResolveComment:Su}}},dateFormat:{analytics:{YYYYDashMMDashDDFormat:Ys}}}=t.appLocale.getLocalizedStrings(),yu=({managementView:e,companiesExcludedFromMonthEndReport:n,showDetailsPageLink:r=!0,loggedInUser:i,loggedInUserRole:a,expenseAutomationEnabledCompanies:d,onColumnSortConfigChanged:l,changeHandlers:c,onCompanyNameClicked:p,onTaskIconClicked:m,onPassportIconClicked:x,onScroll:g,onViewDetailsLinkClicked:h,onMonthEndReportPageClick:C,showMonthEndReportHistoricData:b,initialOpenThreadRequest:S})=>{const y=t.useWindowSizeContext(),j=u.useRef(null),[f,E]=u.useState(null),[$,A]=u.useState(null),{setOpenThread:I,setRequestToOpenThread:v,requestToOpenThread:w,isLoading:F}=u.useContext(t.ThreadsContext);u.useEffect(()=>{S!=null&&e.fetchState==="Completed"&&F===!1&&v(S)},[S,e.fetchState,F,v]);const[D,K]=u.useState(void 0),M=u.useRef(null),G=u.useRef([]),q=!(y==="small"||y==="medium-compact"),{uiState:R,totalAnnualRecurringRevenue:L,totalMonthlyRecurringRevenue:W}=e,k=R.scrollYOffset??0,P=u.useCallback((z,Y,T)=>{const te=e.companies.findIndex(Z=>Z.company.company.companyInfo.companyId===z),re=Ct.findIndex(Z=>Z.key===Y);te!==-1&&re!==-1&&(G.current[te]==null?G.current[te]=[T]:G.current[te][re]=T)},[e.companies]),N=u.useCallback(z=>{let Y=e.companies[z].company.company.companyInfo.name.length;const T=e.companies[z].company.company.parentSubsidiaryInfo;return T.parentInfo?Y+=10:T.subsidiaryInfo&&(Y+=15),Y>Wt?Ae+32:Ae},[e.companies]),Q=u.useCallback(()=>{M.current=null,v(null)},[v]);u.useEffect(()=>{j.current&&j.current.resetAfterIndex(0)},[e]),u.useEffect(()=>{if(w!=null&&f!=null){const{companyId:z,entityType:Y}=w,[T,te]=Y.split("."),re=e.companies.findIndex(xe=>xe.company.company.companyInfo.companyId===z),Z=Ct.findIndex(xe=>xe.key===te);re!==-1&&!(f.visibleStartIndex<=re&&f.visibleStopIndex>=re)&&j.current?.scrollToItem(re,"center"),setTimeout(()=>{const ye=G.current[re]?.[Z];ye!=null&&(M.current={companyId:z,target:ye});const $e=G.current[re]?.[0]?.getBoundingClientRect().bottom,V=G.current[re]?.[0]?.getBoundingClientRect().top;if($e!=null&&V!=null&&(window.innerHeight>=$e&&window.innerHeight>=V||V<0)){const ee=G.current[re][Z];ee!=null&&(M.current={companyId:z,target:ee}),G.current[re][Z]?.scrollIntoView({block:"center",behavior:"auto"})}},0);const ne=setInterval(()=>{const xe=G.current[re]?.[Z]?.getBoundingClientRect().left,ye=G.current[re]?.[Z]?.getBoundingClientRect().right,$e=G.current[re]?.[Z]?.offsetWidth;if(M.current?.companyId===z&&xe!=null&&$e!=null&&ye!=null&&(xe<window.innerWidth-$e||ye<window.innerWidth)){clearInterval(ne);const V=w.threadId,ee=w.onThreadShownCallback;V&&(v(null),I(w.threadId),ee?.())}},500);setTimeout(()=>{clearInterval(ne),v(null)},2e3)}},[w,f,I,v]);const ae=u.useMemo(()=>({makeCompanyNameSticky:q,uiState:R,totalAnnualRecurringRevenue:L,totalMonthlyRecurringRevenue:W,onColumnSortConfigChanged:l}),[q,R,L,W,l]);return o.jsxRuntimeExports.jsx(Cu,{children:o.jsxRuntimeExports.jsxs(Ai.Provider,{value:ae,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:z,width:Y})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:z,innerElementType:Di,itemCount:e.companies.length,itemSize:N,onItemsRendered:T=>E(T),itemData:{managementView:e,loggedInUser:i,loggedInUserRole:a,showDetailsPageLink:r,makeCompanyNameSticky:q,companiesExcludedFromMonthEndReport:n,addThreadRequestThreadId:D,expenseAutomationEnabledCompanies:d,targetElement:M.current?.target,resetTargetElementFromNavigation:Q,setElementRef:P,onCompanyNameClicked:p,onPassportIconClicked:x,onTaskIconClicked:m,onMonthEndReportPageClick:C,setAddThreadRequestThreadId:K,changeHandlers:c,setNoteData:A,onViewDetailsLinkClicked:h,showMonthEndReportHistoricData:b},width:Y,ref:j,overscanCount:Bt,onScroll:({scrollOffset:T})=>{g?.(T)},initialScrollOffset:k??0,children:fu})}),$!=null?o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:$.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${$.companyName} ${mu}`,filter:{application:"cockpit",companyId:$.companyId,entityType:$.entityType,isGlobalComment:!1,tab:"management"},isLoading:!1,threadMetadata:{companyName:$.companyName,companyId:$.companyId,entityId:$.companyId,entityType:$.entityType,isGlobalComment:!1,application:"cockpit",tab:"management",url:window.location.href},textOverrides:{composerPlaceholder:xu,replyComposerPlaceholder:hu,threadResolve:gu,threadUnResolve:Su},onThreadClick:z=>null,onCloseAllThreadsDrawer:()=>A(null)})}):null]})})},Ai=u.createContext(void 0),fu=({index:e,style:n,data:r})=>{const i=t.useWindowSizeContext(),{loggedInUserRole:a,showDetailsPageLink:d,addThreadRequestThreadId:l,targetElement:c,setNoteData:p,managementView:m,resetTargetElementFromNavigation:x,setElementRef:g,companiesExcludedFromMonthEndReport:h,makeCompanyNameSticky:C,changeHandlers:b,expenseAutomationEnabledCompanies:S,onCompanyNameClicked:y,onPassportIconClicked:j,onTaskIconClicked:f,onMonthEndReportPageClick:E,onViewDetailsLinkClicked:$,setAddThreadRequestThreadId:A,showMonthEndReportHistoricData:I}=r,v=m.companies[e],{companyId:w}=v.company.company.companyInfo,F=S.includes(w);return o.jsxRuntimeExports.jsx(bu,{style:{...n,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${uu.managementRightPadding.valuePx(i)} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(Ap,{onViewDetailsLinkClicked:$,showDetailsPageLink:d,loggedInUserRole:a,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:x,setNoteData:p,setElementRef:g,isExpenseAutomationEnabledForUser:F,totalHeight:typeof n.height=="number"?n.height:Ae,changeHandlers:b,companyView:m.companies[e],hasMonthEndEmailHistory:m.companies[e].hasMonthEndEmailHistory,allUsers:m.zeniUsers.values,companyNameSticky:C,onCompanyNameClicked:y,onPassportIconClicked:j,onTaskIconClicked:f,onMonthEndReportPageClick:E,setAddThreadRequestThreadId:A,companiesExcludedFromMonthEndReport:h,showMonthEndReportHistoricData:I})},w)},Di=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,totalAnnualRecurringRevenue:c,totalMonthlyRecurringRevenue:p,onColumnSortConfigChanged:m}=u.useContext(Ai);return o.jsxRuntimeExports.jsxs(ju,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(ou,{companyNameSticky:d,onColumnSortConfigChanged:m,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(Ru,{children:r}),o.jsxRuntimeExports.jsx(cu,{companyNameSticky:d,totalMRRAmount:t.amountToString("0,0",p),totalARRAmount:t.amountToString("0,0",c)})]})});Di.displayName="Management list view inner element type";const Cu=s.div`
|
|
1008
1008
|
/** Subtract top so list can occupy remaining available height */
|
|
1009
1009
|
height: calc(100vh - 110px);
|
|
1010
1010
|
max-width: 99.9%;
|
|
@@ -1034,7 +1034,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1034
1034
|
height: calc(100vh - 45px);
|
|
1035
1035
|
overflow-y: hidden;
|
|
1036
1036
|
background-color: ${e=>e.theme.colors.grey4};
|
|
1037
|
-
`,Pu=({companiesExcludedFromMonthEndReport:e,headerData:n,headerActions:r,managementPageActions:i,managementPageData:a,expenseAutomationEnabledCompanies:d,initialOpenThreadRequest:l})=>{const{managementView:c,loggedInUser:p,loggedInUserRole:m,showDetailsPageLink:x}=a,{onColumnSortConfigChanged:g,changeHandlers:h,onScroll:C,onViewDetailsLinkClicked:b,onCockpitReloadData:S,onCompanyNameClicked:y,onPassportIconClicked:j,onTaskIconClicked:f,onFiltersChange:E,onMonthEndReportPageClick:$,showMonthEndReportHistoricData:A}=i,
|
|
1037
|
+
`,Pu=({companiesExcludedFromMonthEndReport:e,headerData:n,headerActions:r,managementPageActions:i,managementPageData:a,expenseAutomationEnabledCompanies:d,initialOpenThreadRequest:l})=>{const{managementView:c,loggedInUser:p,loggedInUserRole:m,showDetailsPageLink:x}=a,{onColumnSortConfigChanged:g,changeHandlers:h,onScroll:C,onViewDetailsLinkClicked:b,onCockpitReloadData:S,onCompanyNameClicked:y,onPassportIconClicked:j,onTaskIconClicked:f,onFiltersChange:E,onMonthEndReportPageClick:$,showMonthEndReportHistoricData:A}=i,I=c.uiState.filterText,v=c.uiState.filters,w=c.fetchState==="Completed"&&c.zeniUsers.fetchState==="Completed";return r.filterActions&&(r.filterActions.getCategoryWiseOptions=()=>Lu(c)),o.jsxRuntimeExports.jsxs(Tu,{children:[o.jsxRuntimeExports.jsx(dt,{headerActions:{...r},headerData:{...n,filterData:{filterText:I,filters:v},companiesLoaded:w,selectedTabOption:"management",allTabOptions:x===void 0?n.allTabOptions??it:void 0}}),o.jsxRuntimeExports.jsx(Iu,{changeHandlers:h,companiesExcludedFromMonthEndReport:e,expenseAutomationEnabledCompanies:d,initialOpenThreadRequest:l,isFilterApplied:v?.categories!=null,loggedInUser:p,loggedInUserRole:m,managementView:c,onClearFilter:()=>E?.("management",{}),onCockpitReloadData:S,onColumnSortConfigChanged:g,onCompanyNameClicked:y,onMonthEndReportPageClick:$,onPassportIconClicked:j,onScroll:C,onTaskIconClicked:f,onViewDetailsLinkClicked:b,showMonthEndReportHistoricData:A})]})},Iu=({managementView:e,showDetailsPageLink:n=!0,loggedInUser:r,companiesExcludedFromMonthEndReport:i,expenseAutomationEnabledCompanies:a,initialOpenThreadRequest:d,isFilterApplied:l,loggedInUserRole:c,onColumnSortConfigChanged:p,changeHandlers:m,onScroll:x,onViewDetailsLinkClicked:g,onCockpitReloadData:h,onCompanyNameClicked:C,onTaskIconClicked:b,onPassportIconClicked:S,onClearFilter:y,onMonthEndReportPageClick:j,showMonthEndReportHistoricData:f})=>{const E=t.useWindowSizeContext();return e.fetchState==="Error"||e.zeniUsers.fetchState==="Error"?o.jsxRuntimeExports.jsx($t,{onCockpitReloadData:h,selectedCockpitOption:"management"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"||e.zeniUsers.fetchState==="In-Progress"||e.zeniUsers.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(wu,{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:y}):o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextFirstLine,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine}):o.jsxRuntimeExports.jsx(ku,{windowSize:E,children:o.jsxRuntimeExports.jsx(vu,{showDetailsPageLink:n,onColumnSortConfigChanged:p,changeHandlers:m,onScroll:x,onViewDetailsLinkClicked:g,managementView:e,loggedInUser:r,loggedInUserRole:c,expenseAutomationEnabledCompanies:a,onCompanyNameClicked:C,onTaskIconClicked:b,onPassportIconClicked:S,onMonthEndReportPageClick:j,companiesExcludedFromMonthEndReport:i,showMonthEndReportHistoricData:f,initialOpenThreadRequest:d})})},Lu=e=>{const n=e.zeniUsers.values,r=fi,{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]:ol};case"monthlyRecurringRevenue":return{...a,[d.value]:Ss};case"customerSatisfaction":{const l=Object.values(To).map(c=>({label:c.name,value:c.id}));return{...a,[d.value]:l}}case"zeniSatisfaction":{const l=Object.values(eo).map(c=>({label:c.name,value:c.id}));return{...a,[d.value]:l}}default:return{...a,[d.value]:[]}}},{})},Zs=t.appLocale.getLocalizedStrings().cockpit.taskManager.header,{common:Ht}=t.appLocale.getLocalizedStrings(),Ot=[{key:"name",value:Ht.texts.name,sortOrder:"ascending",width:new t.ResponsiveSized(176,176),isThreadAllowed:!0},{key:"taskName",value:Zs.taskName,sortOrder:"ascending",width:new t.ResponsiveSized(320,320),isThreadAllowed:!0},{key:"status",value:Ht.texts.status,sortOrder:"ascending",width:new t.ResponsiveSized(100,100),isThreadAllowed:!0},{key:"priority",value:Ht.texts.priority,sortOrder:"ascending",width:new t.ResponsiveSized(90,90),isThreadAllowed:!0},{key:"dueDate",value:Ht.texts.dueDate,sortOrder:"ascending",width:new t.ResponsiveSized(100,100),isThreadAllowed:!0},{key:"assignee",value:Ht.texts.assignee,sortOrder:"ascending",width:new t.ResponsiveSized(220,220),isThreadAllowed:!0},{key:"tags",value:Zs.tags,sortOrder:"ascending",width:new t.ResponsiveSized(115,115),isThreadAllowed:!0},{key:"createdBy",value:Ht.texts.createdBy,sortOrder:"ascending",width:new t.ResponsiveSized(140,140),isThreadAllowed:!0}];Ot.map(e=>e.key);function Au({sortConfig:e,onColumnSortConfigChanged:n}){const r=t.useWindowSizeContext(),[i,a]=u.useState(o.cloneDeep(Ot));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(Ou,{height:Ft,children:i.map(l=>o.jsxRuntimeExports.jsxs(Nu,{sortDataValue:e.sortKey,actualDataValue:l.key,wrapperWidth:l.width,windowSize:r,children:[o.jsxRuntimeExports.jsxs(Fu,{onClick:()=>d(J.toTaskManagerSortKeyType(l.key),l.sortOrder),children:[o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:l.value}),o.jsxRuntimeExports.jsx(Du,{sortDataValue:e.sortKey,headerdata:l,children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:12,height:12})})]}),o.jsxRuntimeExports.jsx(zu,{isVisible:e.sortKey===l.key&&l.key!=="dueDate",children:o.jsxRuntimeExports.jsx(Mu,{onClick:()=>d("dueDate","ascending")})})]},l.key))})}const Du=s.div`
|
|
1038
1038
|
display: flex;
|
|
1039
1039
|
align-items: center;
|
|
1040
1040
|
transform: ${e=>e.sortDataValue===e.headerdata.key&&e.headerdata.sortOrder==="descending"?"rotate(180deg)":"rotate(0deg)"};
|
|
@@ -1091,7 +1091,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1091
1091
|
&:hover {
|
|
1092
1092
|
color: ${e=>e.theme.colors.primary};
|
|
1093
1093
|
}
|
|
1094
|
-
`,{dateFormat:Bu,common:{strings:{empty:jn,hyphen:Wu,plus:
|
|
1094
|
+
`,{dateFormat:Bu,common:{strings:{empty:jn,hyphen:Wu,plus:Lo}}}=t.appLocale.getLocalizedStrings(),_u=({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??jn,{companyId:x,name:g}=n.company.companyInfo,h=n.createdByUser?.firstName!==null&&n.createdByUser?.lastName!=null?`${n.createdByUser.firstName} ${n.createdByUser.lastName}`:n.createdByUser?.email??jn,C=n.assignees.length,b=n.task.id,{openThread:S,threads:y,addThread:j,removeThread:f,setOpenThread:E,setRequestToOpenThread:$}=u.useContext(t.ThreadsContext),A=S!==null?y.get(S):null,I=S?.includes(x)===!0,v=S!=null&&y.get(S)==null&&I,w=r!=null&&y.get(r)?.metadata.companyId===x,F=`cockpit_${x}`,D=u.useCallback(()=>{S?.includes(t.NEW_THREAD_SUFFIX)===!0&&f(S),r!=null&&a(void 0)},[r,S,f,a]),K=R=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:R.isElementThreadOpen??!1,isElementThreadPresent:R.isElementThreadPresent??!1,itemKey:R.itemKey,elementThreadId:R.elementThreadId??"",roomId:F,addThreadRequestThreadId:r,openThreadId:S,threadStyle:R.threadStyle,openThreadMetadata:A?.metadata??null,onElementClick:G,onAddThreadClick:q}),M=u.useCallback(R=>{if(R===S)E(null);else if(y.has(R))E(R);else if(R.includes(t.NEW_THREAD_SUFFIX)){const[L,W]=R.replace(t.NEW_THREAD_SUFFIX,"").split("."),k=_t(Rt(L),J.toTaskManagerSortKeyType(W),x,g,b);j(R,{type:"thread",visibility:"public",id:R,roomId:F,createdAt:new Date,updatedAt:new Date,comments:[],metadata:k,resolved:!1}),E(R)}},[S,y,E,x,g,b,j,F]),G=u.useCallback((R,L,W=!1)=>{const k=Ot.find(P=>P.key===L);if($(null),k!=null&&(R.type==="contextmenu"||W===!0)){if(k.isThreadAllowed===!1)return;D(),R.preventDefault(),R.stopPropagation();const P=t.toCollaborationEntityType({tab:"taskManager",key:k.key}),N=[...t.getFilteredThreads(y,{entityType:P,entityId:b,companyId:x},"both")],Q=N.length>0&&N[0].length>0?N[0][0]:Pe("taskManager",k.key,x+Lo+b);y.has(Q)?M(Q):r===Q?a(void 0):(a(Q),E(null))}},[y,b,x,r,M,a,E,$,D]),q=u.useCallback((R,L)=>{R.stopPropagation();const W=Pe("taskManager",L,x+Lo+b);a(void 0),M(W)},[x,b,a,M]);return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{$(null),r!=null&&(a(void 0),r.includes(t.NEW_THREAD_SUFFIX)&&f(r))},children:o.jsxRuntimeExports.jsx(Vu,{onClick:()=>d(n.company.companyInfo.primaryEmailDomain,n.task.id),windowSize:l,isThreadOpen:I||w,totalHeight:e,isCreationInProgress:v,children:Ot.map((R,L)=>{const W=t.toCollaborationEntityType({tab:"taskManager",key:R.key}),k=Ot.length-2<=L,P=[...t.getFilteredThreads(y,{entityType:W,entityId:b,companyId:x},"both")],N=P.length>0&&P[0].length>0?P[0][0]:Pe("taskManager",R.key,x+Lo+b),Q=y.get(N),ae=Q!=null&&Q.resolved===!1,z=N===S,Y=T=>J.allTaskPriority.find(te=>te.code===T)?.name??jn;switch(R.key){case"name":return o.jsxRuntimeExports.jsxs(yt,{ref:T=>{i(x,R.key,T)},columnWidth:R.width,windowSize:l,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:T=>G(T,R.key),children:[o.jsxRuntimeExports.jsx(Uu,{children:n.company.companyInfo.name}),K({isElementThreadOpen:z,isElementThreadPresent:ae,itemKey:R.key,elementThreadId:N,threadStyle:k?{right:t.Space.sp0}:void 0})]},N);case"taskName":return o.jsxRuntimeExports.jsxs(yt,{ref:T=>{i(x,R.key,T)},columnWidth:R.width,windowSize:l,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:T=>G(T,R.key),children:[o.jsxRuntimeExports.jsx(t.StandardRegular,{children:n.task.name}),K({isElementThreadOpen:z,isElementThreadPresent:ae,itemKey:R.key,elementThreadId:N,threadStyle:k?{right:t.Space.sp0}:void 0})]},N);case"status":return o.jsxRuntimeExports.jsxs(yt,{ref:T=>{i(x,R.key,T)},columnWidth:R.width,windowSize:l,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:T=>G(T,R.key),children:[t.getRichLabel(n.task.status.code,c),K({isElementThreadOpen:z,isElementThreadPresent:ae,itemKey:R.key,elementThreadId:N,threadStyle:k?{right:t.Space.sp0}:void 0})]},N);case"priority":return o.jsxRuntimeExports.jsxs(yt,{ref:T=>{i(x,R.key,T)},columnWidth:R.width,windowSize:l,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:T=>G(T,R.key),children:[o.jsxRuntimeExports.jsxs(Ku,{children:[o.jsxRuntimeExports.jsx(Gu,{color:t.getLabelColor(n.task.priority.code,c)}),o.jsxRuntimeExports.jsx(t.StandardRegular,{children:Y(n.task.priority.code)})]}),K({isElementThreadOpen:z,isElementThreadPresent:ae,itemKey:R.key,elementThreadId:N,threadStyle:k?{right:t.Space.sp0}:void 0})]},N);case"dueDate":return o.jsxRuntimeExports.jsxs(yt,{ref:T=>{i(x,R.key,T)},columnWidth:R.width,windowSize:l,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:T=>G(T,R.key),children:[o.jsxRuntimeExports.jsx(t.StandardRegular,{children:n.task.dueDate!=null?n.task.dueDate.format(Bu.visual.MMMDCommaYYYYformat):Wu}),K({isElementThreadOpen:z,isElementThreadPresent:ae,itemKey:R.key,elementThreadId:N,threadStyle:k?{right:t.Space.sp0}:void 0})]},N);case"assignee":return o.jsxRuntimeExports.jsxs(yt,{ref:T=>{i(x,R.key,T)},columnWidth:R.width,windowSize:l,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:T=>G(T,R.key),children:[o.jsxRuntimeExports.jsx(t.ZeniAvatar,{personBasic:p,styles:{width:t.Space.sp4,height:t.Space.sp4}}),o.jsxRuntimeExports.jsx(Xs,{children:m}),C>1?o.jsxRuntimeExports.jsx(Hu,{children:o.jsxRuntimeExports.jsx(t.SmallRegular,{children:`${Lo}${C-1}`})}):null,K({isElementThreadOpen:z,isElementThreadPresent:ae,itemKey:R.key,elementThreadId:N,threadStyle:k?{right:t.Space.sp0}:void 0})]},N);case"tags":return o.jsxRuntimeExports.jsxs(yt,{ref:T=>{i(x,R.key,T)},columnWidth:R.width,windowSize:l,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:T=>G(T,R.key),children:[n.task.tagIds.length>0?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:t.getTagLabel(n.task.tagIds,n.tags)}):null,K({isElementThreadOpen:z,isElementThreadPresent:ae,itemKey:R.key,elementThreadId:N,threadStyle:k?{right:t.Space.sp0}:void 0})]},N);case"createdBy":return o.jsxRuntimeExports.jsxs(yt,{ref:T=>{i(x,R.key,T)},columnWidth:R.width,windowSize:l,isThreadAllowed:R.isThreadAllowed,className:oe,onContextMenu:T=>G(T,R.key),children:[o.jsxRuntimeExports.jsx(t.ZeniAvatar,{personBasic:n.createdByUser,styles:{width:t.Space.sp4,height:t.Space.sp4}}),o.jsxRuntimeExports.jsx(Xs,{children:h}),K({isElementThreadOpen:z,isElementThreadPresent:ae,itemKey:R.key,elementThreadId:N,threadStyle:k?{right:t.Space.sp0}:void 0})]},N);default:return null}})})})},Vu=s.div`
|
|
1095
1095
|
display: flex;
|
|
1096
1096
|
min-width: 100%;
|
|
1097
1097
|
flex-direction: row;
|
|
@@ -1178,7 +1178,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1178
1178
|
height: ${t.Space.sp3};
|
|
1179
1179
|
color: ${e=>e.color};
|
|
1180
1180
|
margin-right: ${t.Space.sp2};
|
|
1181
|
-
`,Oi=u.createContext(void 0),Ni=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{uiState:d,onColumnSortConfigChanged:l}=u.useContext(Oi);return o.jsxRuntimeExports.jsxs(Mi,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(Au,{onColumnSortConfigChanged:l,sortConfig:{sortKey:d.sortKey,sortOrder:d.sortOrder}}),o.jsxRuntimeExports.jsx(Xu,{children:r})]})});Ni.displayName="Task manager list view inner element type";const Yu=({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),x=u.useMemo(()=>({uiState:e.uiState,onColumnSortConfigChanged:r}),[e.uiState,r]),{setOpenThread:g,setRequestToOpenThread:h,requestToOpenThread:C,isLoading:b}=u.useContext(t.ThreadsContext);u.useEffect(()=>{a!=null&&e.fetchState==="Completed"&&b===!1&&h(a)},[a,e.fetchState,b,h]);const[S,y]=u.useState(void 0),j=u.useRef([]),f=u.useCallback(
|
|
1181
|
+
`,Oi=u.createContext(void 0),Ni=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{uiState:d,onColumnSortConfigChanged:l}=u.useContext(Oi);return o.jsxRuntimeExports.jsxs(Mi,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(Au,{onColumnSortConfigChanged:l,sortConfig:{sortKey:d.sortKey,sortOrder:d.sortOrder}}),o.jsxRuntimeExports.jsx(Xu,{children:r})]})});Ni.displayName="Task manager list view inner element type";const Yu=({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),x=u.useMemo(()=>({uiState:e.uiState,onColumnSortConfigChanged:r}),[e.uiState,r]),{setOpenThread:g,setRequestToOpenThread:h,requestToOpenThread:C,isLoading:b}=u.useContext(t.ThreadsContext);u.useEffect(()=>{a!=null&&e.fetchState==="Completed"&&b===!1&&h(a)},[a,e.fetchState,b,h]);const[S,y]=u.useState(void 0),j=u.useRef([]),f=u.useCallback(I=>e.tasksList[I].company.companyInfo.name.length>Wt?Ae+32:Ae,[e.tasksList]),E=u.useCallback(I=>I<e.tasksList.length,[e.tasksList.length]),$=u.useCallback(()=>{d.from!=null&&l==="Completed"&&n()},[n,l,d.from]);u.useEffect(()=>{c.current&&c.current.resetAfterIndex(0)},[e]);const A=u.useCallback((I,v,w)=>{const F=e.tasksList.findIndex(K=>K.company.companyInfo.companyId===I),D=Ot.findIndex(K=>K.key===v);F!==-1&&D!==-1&&(j.current[F]==null?j.current[F]=[w]:j.current[F][D]=w)},[e.tasksList]);return u.useEffect(()=>{if(C!=null&&p!=null){const{companyId:I,entityType:v}=C,[w,F]=v.split("."),D=e.tasksList.findIndex(q=>q.company.companyInfo.companyId===I),K=Ot.findIndex(q=>q.key===F);D!==-1&&!(p.visibleStartIndex<=D&&p.visibleStopIndex>=D)&&c.current?.scrollToItem(D,"center"),setTimeout(()=>{const q=j.current[D]?.[0]?.getBoundingClientRect().bottom,R=j.current[D]?.[0]?.getBoundingClientRect().top;q!=null&&R!=null&&(window.innerHeight>=q&&window.innerHeight>=R||R<0)&&j.current[D][K]?.scrollIntoView({block:"center",behavior:"auto"})},0);const G=setInterval(()=>{const q=j.current[D]?.[K]?.getBoundingClientRect().left,R=j.current[D]?.[K]?.getBoundingClientRect().right,L=j.current[D]?.[K]?.offsetWidth;if(q!=null&&L!=null&&R!=null&&(q<window.innerWidth-L||R<window.innerWidth)){clearInterval(G);const W=C.threadId,k=C.onThreadShownCallback;W&&(h(null),g(C.threadId),k?.())}},500);setTimeout(()=>{clearInterval(G),h(null)},2e3)}},[C,p,g,h]),o.jsxRuntimeExports.jsx(Qu,{children:o.jsxRuntimeExports.jsx(Oi.Provider,{value:x,children:o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:I,width:v})=>o.jsxRuntimeExports.jsx(Mi,{style:{height:I,width:v},children:o.jsxRuntimeExports.jsx(o.InfiniteLoader,{isItemLoaded:E,itemCount:e.tasksList.length+1,loadMoreItems:$,children:({onItemsRendered:w})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:I,innerElementType:Ni,itemCount:e.tasksList.length,itemSize:f,itemData:{companyTaskManagerView:e,addThreadRequestThreadId:S,setElementRef:A,setAddThreadRequestThreadId:y,onRowClick:i},width:v,ref:c,onItemsRendered:F=>{m(F),w(F)},overscanCount:Bt,children:Zu})})})})})})},Zu=({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(qu,{style:{...n,width:"fit-content",minWidth:"100%"},children:o.jsxRuntimeExports.jsx(_u,{totalHeight:typeof n.height=="number"?n.height:Ae,addThreadRequestThreadId:a,setElementRef:d,setAddThreadRequestThreadId:l,task:p,onRowClick:c})},p.task.id)},Mi=s.div``,Xu=s.div`
|
|
1182
1182
|
position: relative;
|
|
1183
1183
|
width: auto;
|
|
1184
1184
|
height: 100%;
|
|
@@ -1212,7 +1212,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1212
1212
|
flex: 1;
|
|
1213
1213
|
overflow: hidden;
|
|
1214
1214
|
padding: ${e=>`${t.Space.sp0} ${He.cockpitRightPadding.valuePx(e.windowSize)} ${t.Space.sp0} ${He.cockpitLeftPadding.valuePx(e.windowSize)}`};
|
|
1215
|
-
`,Ao=ps.taskManager.metrics,rm=({metrics:e})=>{const n=t.useWindowSizeContext();return o.jsxRuntimeExports.jsxs(im,{windowSize:n,children:[o.jsxRuntimeExports.jsxs(Do,{children:[o.jsxRuntimeExports.jsxs(Oo,{children:[o.jsxRuntimeExports.jsx(No,{children:Ao.totalTasks}),o.jsxRuntimeExports.jsx(Mo,{as:
|
|
1215
|
+
`,Ao=ps.taskManager.metrics,rm=({metrics:e})=>{const n=t.useWindowSizeContext();return o.jsxRuntimeExports.jsxs(im,{windowSize:n,children:[o.jsxRuntimeExports.jsxs(Do,{children:[o.jsxRuntimeExports.jsxs(Oo,{children:[o.jsxRuntimeExports.jsx(No,{children:Ao.totalTasks}),o.jsxRuntimeExports.jsx(Mo,{as:Ii})]}),o.jsxRuntimeExports.jsx(zo,{children:e.total})]}),o.jsxRuntimeExports.jsxs(Do,{children:[o.jsxRuntimeExports.jsxs(Oo,{children:[o.jsxRuntimeExports.jsx(No,{children:Ao.openTasks}),o.jsxRuntimeExports.jsx(Mo,{as:t.SvgClock})]}),o.jsxRuntimeExports.jsx(zo,{children:e.open})]}),o.jsxRuntimeExports.jsxs(Do,{children:[o.jsxRuntimeExports.jsxs(Oo,{children:[o.jsxRuntimeExports.jsx(No,{children:Ao.overdueTasks}),o.jsxRuntimeExports.jsx(Mo,{as:t.SvgWarning})]}),o.jsxRuntimeExports.jsx(zo,{children:e.overdue})]}),o.jsxRuntimeExports.jsxs(Do,{children:[o.jsxRuntimeExports.jsxs(Oo,{children:[o.jsxRuntimeExports.jsx(No,{children:Ao.closedTasks}),o.jsxRuntimeExports.jsx(Mo,{as:t.SvgTickRoundFill})]}),o.jsxRuntimeExports.jsx(zo,{children:e.closed})]})]})},im=s.div`
|
|
1216
1216
|
display: flex;
|
|
1217
1217
|
flex-direction: row;
|
|
1218
1218
|
gap: ${t.Space.sp4};
|
|
@@ -1318,7 +1318,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1318
1318
|
left: 19%;
|
|
1319
1319
|
position: absolute;
|
|
1320
1320
|
background-color: ${e=>e.theme.colors.primary};
|
|
1321
|
-
`,{dateFormat:qs,timeFormat:vm,timeframe:rt,common:wm}=t.appLocale.getLocalizedStrings(),bn=e=>{if(e!=null){const n=J.dateNow();return Math.abs(n.diff(e,"days"))}};function vo(e){if(e==null)return;const n=J.dateNow();if(Math.abs(n.diff(e,"days"))<=0)return`0 ${rt.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(),x=a.date();let g=p-d,h=m-l,C=x-c;if(C<0){h--;const S=new Date(p,m,0);C+=S.getDate()}h<0&&(g--,h+=12);const b=[];return g>0&&b.push(`${g} ${g>1?rt.year:rt.year.slice(0,-1)}`),h>0&&b.push(`${h} ${h>1?rt.month:rt.month.slice(0,-1)}`),C>0&&b.push(`${C} ${C>1?rt.day:rt.day.slice(0,-1)}`),b.join(", ")}function Wi(e){if(e==null)return wm.strings.hyphen;const n=Math.floor(Number(e)/12),r=Number(e)%12,i=n>1?rt.year:rt.year.slice(0,-1),a=r>1?rt.month:rt.month.slice(0,-1);return n===0?`${e} ${a}`:r===0?`${n} ${i}`:`${n} ${i}, ${r} ${a}`}const _i=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?vo(J.zeniDate(e?.managementInfo.lastReportSentDate.toISOString())):void 0,dashboardLastVisit:e?.companyHealthMetric.customerLastDashboardVisit!=null?J.zeniDate(e?.companyHealthMetric.customerLastDashboardVisit.toISOString()).format(qs.visual.MMMDCommaYYYYformat):void 0,companyEngagementMetricsUpdatedAt:e?.companyHealthMetric.companyEngagementMetricsUpdatedAt!=null?{date:J.zeniDate(e?.companyHealthMetric.companyEngagementMetricsUpdatedAt.toISOString()).format(qs.visual.MMMDCommaYYYYformat),time:J.zeniDate(e?.companyHealthMetric.companyEngagementMetricsUpdatedAt.toISOString()).format(vm.hhmmAFormat)}:void 0,noOfVerticalsEnabled:e?.noOfProductVerticalsEnabled,renewalDate:e?.companyHealthMetric.subscriptionRenewalDate!=null?vo(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}),_e=t.appLocale.getLocalizedStrings().cockpit.health.header,Nt=[{key:"companyName",value:_e.name,sortOrder:"ascending",width:new t.ResponsiveSized(392,392),isThreadAllowed:!0},{key:"churnProbability",value:_e.churnProbability,sortOrder:"ascending",width:new t.ResponsiveSized(380,380),isThreadAllowed:!0},{key:"controller",value:_e.controller,sortOrder:"ascending",width:new t.ResponsiveSized(200,200),isThreadAllowed:!0},{key:"customerSuccessManager",value:_e.customerSuccessManager,sortOrder:"ascending",width:new t.ResponsiveSized(200,200),isThreadAllowed:!0},{key:"lastEngagement",value:_e.lastEngagement,sortOrder:"ascending",width:new t.ResponsiveSized(270,270),isThreadAllowed:!0},{key:"companyEngagementMetricsUpdatedAt",value:_e.companyEngagementMetricsUpdatedAt,sortOrder:"ascending",width:new t.ResponsiveSized(160,160),isThreadAllowed:!0},{key:"runway",value:_e.runway,sortOrder:"ascending",width:new t.ResponsiveSized(220,220),isThreadAllowed:!0},{key:"netPromoterScore",value:_e.netPromoterScore,sortOrder:"ascending",width:new t.ResponsiveSized(120,120),isThreadAllowed:!0},{key:"customerSatisfactionScore",value:_e.customerSatisfactionScore,sortOrder:"ascending",width:new t.ResponsiveSized(120,120),isThreadAllowed:!0},{key:"lastReportSent",value:_e.lastReportSent,sortOrder:"ascending",width:new t.ResponsiveSized(250,250),isThreadAllowed:!0},{key:"dashboardLastSeen",value:_e.dashboardLastSeen,sortOrder:"ascending",width:new t.ResponsiveSized(270,270),isThreadAllowed:!0},{key:"subscriptionDate",value:_e.subscriptionDate,sortOrder:"ascending",width:new t.ResponsiveSized(200,200),isThreadAllowed:!0},{key:"renewalDate",value:_e.renewalDate,sortOrder:"ascending",width:new t.ResponsiveSized(180,180),isThreadAllowed:!0},{key:"group",value:_e.group,sortOrder:"ascending",width:new t.ResponsiveSized(148,148),isThreadAllowed:!0},{key:"monthlyRecurringRevenue",value:_e.monthlyRecurringRevenue,sortOrder:"ascending",width:new t.ResponsiveSized(196,196),isThreadAllowed:!0},{key:"externalProductServiceExposure",value:_e.externalProductServiceExposure,sortOrder:"ascending",width:new t.ResponsiveSized(270,270),isThreadAllowed:!0},{key:"productVerticals",value:_e.productVerticals,sortOrder:"ascending",width:new t.ResponsiveSized(360,360),isThreadAllowed:!0}];Nt.map(e=>e.key);const Vi=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 km({companyView:e,healthView:n,companyNameSticky:r,totalHeight:i,addThreadRequestThreadId:a,setNoteData:d,setElementRef:l,setAddThreadRequestThreadId:c,onRowClick:p}){const m=t.useWindowSizeContext(),x=t.appLocale.getLocalizedStrings(),{common:{strings:{hyphen:g,backspace:h,space:C,colon:b,dot:S}},cockpit:{health:{detailPage:{churnProbabilityTexts:{churnProbability:y,for:j,is:f,percent:E},notApplicable:$},common:{engagementTypes:A,labels:{lastEngagements:P,factorsThatDecreaseChurnProbability:v,factorsThatIncreaseChurnProbability:w}}}},dateFormat:F}=x,{companyInfo:{companyId:D,name:K},companyHealthMetric:M,controllers:G,managementInfo:{lastReportSentDate:q,customerSuccessManagerUserIds:R}}=e,L=_i(e),k=n.zeniUsers.values.filter(O=>R.includes(O.userId)),I=`cockpit_${D}`,N="healthMonitor.notes",{threads:Q,isLoading:ae}=t.useFilteredThreads({entityType:N,companyId:D},!1),z={name:K,companyId:D,companyGroup:e.companyGroup!=null?e.companyGroup.find(O=>O.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:G.map(O=>J.getUserName(O)),customerSuccessManagers:k.map(O=>J.getUserName(O)),lastReportSent:q!=null?J.zeniDate(q.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:Y,threads:T,addThread:te,removeThread:re,setOpenThread:Z,setRequestToOpenThread:ie}=u.useContext(t.ThreadsContext),ne=Y!==null?T.get(Y):null,xe=Y?.includes(D)===!0,ye=Y!=null&&T.get(Y)==null&&xe,$e=a!=null&&T.get(a)?.metadata.companyId===D,V=u.useCallback(()=>{Y?.includes(t.NEW_THREAD_SUFFIX)===!0&&re(Y),a!=null&&c(void 0)},[a,Y,re,c]),ee=u.useCallback(O=>{if(O===Y)Z(null);else if(T.has(O))Z(O);else if(O.includes(t.NEW_THREAD_SUFFIX)){const[ke,B]=O.replace(t.NEW_THREAD_SUFFIX,"").split("."),de=_t(Rt(ke),J.toHealthSortKeyType(B),D,K);te(O,{type:"thread",visibility:"public",id:O,roomId:I,createdAt:new Date,updatedAt:new Date,comments:[],metadata:de,resolved:!1}),Z(O)}},[D,K,Y,T,te,Z,I]),ge=u.useCallback((O,ke,B=!1)=>{const de=Nt.find(je=>je.key===ke);if(ie(null),de!=null&&(O.type==="contextmenu"||B===!0)){if(de.isThreadAllowed===!1)return;V(),O.preventDefault(),O.stopPropagation();const je=t.toCollaborationEntityType({tab:"healthMonitor",key:de.key}),U=[...t.getFilteredThreads(T,{entityType:je,companyId:D},"both")],_=U.length>0&&U[0].length>0?U[0][0]:Pe("healthMonitor",de.key,D);T.has(_)?ee(_):a===_?c(void 0):(c(_),Z(null))}},[T,D,a,ee,c,Z,ie,V]),ve=u.useCallback((O,ke)=>{O.stopPropagation();const B=Pe("healthMonitor",ke,D);c(void 0),ee(B)},[D,c,ee]),Ce=O=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:O.isElementThreadOpen??!1,isElementThreadPresent:O.isElementThreadPresent??!1,itemKey:O.itemKey,elementThreadId:O.elementThreadId??"",roomId:I,addThreadRequestThreadId:a,openThreadId:Y,threadStyle:O.threadStyle,openThreadMetadata:ne?.metadata??null,onElementClick:ge,onAddThreadClick:ve});return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{ie(null),a!=null&&(c(void 0),a.includes(t.NEW_THREAD_SUFFIX)&&re(a))},children:o.jsxRuntimeExports.jsx(Tm,{windowSize:m,isThreadOpen:xe||$e,totalHeight:i,isCreationInProgress:ye,"data-testid":t.generateDataTestId("health-monitor-row",D),onClick:()=>p(z.companyId),children:Nt.map((O,ke)=>{const B=t.toCollaborationEntityType({tab:"healthMonitor",key:O.key}),de=Nt.length-2<=ke,je=[...t.getFilteredThreads(T,{entityType:B,companyId:D},"both")],U=je.length>0&&je[0].length>0?je[0][0]:Pe("healthMonitor",O.key,D),_=T.get(U),ce=_!=null&&_.resolved===!1,Se=U===Y,fe=a===U,Le=L.lastEngagements;switch(O.key){case"companyName":return o.jsxRuntimeExports.jsxs(Am,{companyNameSticky:r,columnWidth:O.width,windowSize:m,isThreadOpen:Se||fe,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-company-name",D),onContextMenu:H=>ge(H,O.key),ref:H=>{l(D,O.key,H)},children:[o.jsxRuntimeExports.jsxs(Nm,{"data-testid":t.generateDataTestId("health-monitor-row-company-name-text",D),children:[z.name,o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:Se,roomId:I,openThreadId:Y,openThreadMetadata:ne?.metadata??null})]}),o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:`2px ${t.Space.sp2}`},title:"Notes",children:o.jsxRuntimeExports.jsxs(zm,{className:"notesIcon","data-testid":t.generateDataTestId("health-monitor-row-notes-icon",D),onClick:H=>{H.preventDefault(),H.stopPropagation(),d({roomId:I,companyId:D,companyName:K,entityType:N})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:Q.length,isLoading:ae}),o.jsxRuntimeExports.jsx(Fm,{})]})}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:ce,itemKey:O.key,style:{left:t.Space.sp4},onElementClick:ge}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Pe("healthMonitor",O.key,D),addThreadRequestThreadId:a,itemKey:O.key,onAddThreadClick:ve})]},U);case"productVerticals":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-product-verticals",D),onContextMenu:H=>ge(H,O.key),children:[o.jsxRuntimeExports.jsx(Ui,{productVerticals:M.verticalProductServices,testIdSuffix:D}),Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"runway":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-runway",D),onContextMenu:H=>ge(H,O.key),children:[z.runway!=null?J.isCompanyRunwayInfinite(z.runway)===!0?o.jsxRuntimeExports.jsx(Bm,{"data-testid":t.generateDataTestId("health-monitor-row-runway-infinity",D)}):Wi(z.runway.runwayMonths):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:g}),Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"churnProbability":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-churn-probability",D),onContextMenu:H=>ge(H,O.key),children:[o.jsxRuntimeExports.jsx(Mm,{"data-testid":t.generateDataTestId("health-monitor-row-churn-meter",D),children:o.jsxRuntimeExports.jsx(Bi,{percentage:z.churnProbabilityPercentage,barHeight:12})}),L.churnProbabilityPercentage!=null?o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:`12px ${t.Space.sp3}`,textAlign:"left"},title:o.jsxRuntimeExports.jsxs(Vm,{children:[o.jsxRuntimeExports.jsx(Um,{children:`${y} ${j} ${e.companyInfo.name} ${f} ${Math.round(L.churnProbabilityPercentage??0)}${E}${S}`}),e.companyHealthMetric.churnProbabilityReason.length!==0||e.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(Js,{children:[o.jsxRuntimeExports.jsxs(er,{children:[w,b]}),o.jsxRuntimeExports.jsxs(tr,{children:[e.companyHealthMetric.churnProbabilityReason.map((H,ue)=>o.jsxRuntimeExports.jsx($n,{children:o.jsxRuntimeExports.jsx(En,{children:H.text})},`${o.nanoid()}_${ue}}`)),e.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.map((H,ue)=>o.jsxRuntimeExports.jsx($n,{children:o.jsxRuntimeExports.jsx(En,{children:H.value})},`${o.nanoid()}_${ue}}`))]})]}):null,e.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(Js,{children:[o.jsxRuntimeExports.jsxs(er,{children:[v,b]}),o.jsxRuntimeExports.jsx(tr,{children:e.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.map((H,ue)=>o.jsxRuntimeExports.jsx($n,{children:o.jsxRuntimeExports.jsx(En,{children:H.value})},`${o.nanoid()}_${ue}}`))})]}):null]}),children:o.jsxRuntimeExports.jsx(_m,{"data-testid":t.generateDataTestId("health-monitor-row-churn-info-icon",D),style:{marginTop:t.Space.sp1,marginLeft:t.Space.sp1,marginRight:t.Space.sp0}})}):null,Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"customerSatisfactionScore":case"netPromoterScore":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId(`health-monitor-row-${O.key==="netPromoterScore"?"nps":"csat"}`,D),onContextMenu:H=>ge(H,O.key),children:[z[O.key]!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Om,{children:z[O.key]}),o.jsxRuntimeExports.jsx(Dm,{children:h}),O.key==="netPromoterScore"?o.jsxRuntimeExports.jsxs(Qs,{children:[" ",Ja," "]}):o.jsxRuntimeExports.jsxs(Qs,{children:[" ",el," "]})]}):z.churnProbabilityPercentage!=null?$:g,Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"controller":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-controller",D),onContextMenu:H=>ge(H,O.key),children:[o.jsxRuntimeExports.jsx(t.Tooltip,{enterDelay:600,style:{padding:`2px ${t.Space.sp2}`},title:z.controllers.join(", "),children:z.controllers[0]}),Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"customerSuccessManager":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-csm",D),onContextMenu:H=>ge(H,O.key),children:[o.jsxRuntimeExports.jsx(t.Tooltip,{enterDelay:600,style:{padding:`2px ${t.Space.sp2}`,textAlign:"left"},maxWidth:"300px",title:z.customerSuccessManagers.join(", "),children:z.customerSuccessManagers[0]}),Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"lastReportSent":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-last-report-sent",D),onContextMenu:H=>ge(H,O.key),children:[o.jsxRuntimeExports.jsx(Rn,{children:z.lastReportSent!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(t.LargeRegular,{children:vo(z.lastReportSent)}),o.jsxRuntimeExports.jsx(t.SmallRegular,{children:z.lastReportSent.format(F.visual.MMMDCommaYYYYformat)})]}):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:g})}),Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"renewalDate":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-renewal-date",D),onContextMenu:H=>ge(H,O.key),children:[o.jsxRuntimeExports.jsx(Rn,{children:z.renewalDate!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(t.LargeRegular,{children:vo(z.renewalDate)}),o.jsxRuntimeExports.jsx(t.SmallRegular,{children:z.renewalDate.format(F.visual.MMMDCommaYYYYformat)})]}):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:g})}),Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"group":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-group",D),onContextMenu:H=>ge(H,O.key),children:[z.companyGroup!=null?o.jsxRuntimeExports.jsx(Wm,{"data-testid":t.generateDataTestId("health-monitor-row-group-badge",D),textColor:ki[z.companyGroup.id],children:z.companyGroup.name.toUpperCase()}):g,Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"monthlyRecurringRevenue":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-mrr",D),onContextMenu:H=>ge(H,O.key),children:[t.amountToString("0,0",z.monthlyRecurringRevenue),Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"externalProductServiceExposure":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-external-exposure",D),onContextMenu:H=>ge(H,O.key),children:[z.externalProductServiceExposure!=null?z.externalProductServiceExposure.name:g,Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"lastEngagement":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-last-engagement",D),onContextMenu:H=>ge(H,O.key),children:[Le.length>0?o.jsxRuntimeExports.jsxs(t.Tooltip,{style:{padding:`12px ${t.Space.sp3}`},title:o.jsxRuntimeExports.jsxs(Hm,{children:[o.jsxRuntimeExports.jsxs(Km,{children:[P,b]}),Le.map((H,ue)=>o.jsxRuntimeExports.jsxs(Gm,{children:[o.jsxRuntimeExports.jsxs(Ym,{children:[H.type==="email"?o.jsxRuntimeExports.jsx(qm,{}):o.jsxRuntimeExports.jsx(Qm,{}),o.jsxRuntimeExports.jsx(Lm,{children:H.type==="email"?A.email:A.meeting})]}),o.jsxRuntimeExports.jsx(Zm,{children:H.scheduledAt?.utc(!0).local().format(F.visual.MMMDCommaYYYYformat)??g})]},`${o.nanoid()}_${ue}}`))]}),children:[Le[0].scheduledAt?.utc(!0).local().format(F.visual.MMMDCommaYYYYformat)??g,o.jsxRuntimeExports.jsxs(Xm,{children:[Le[0].type==="email"?o.jsxRuntimeExports.jsx(Hi,{className:"engagement-email-icon"}):o.jsxRuntimeExports.jsx(Ki,{className:"engagement-meeting-icon"}),o.jsxRuntimeExports.jsxs(Jm,{children:["Via",C,Le[0].type==="email"?A.email:A.meeting]})]})]}):o.jsxRuntimeExports.jsx(t.StandardRegular,{children:g}),Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"dashboardLastSeen":case"subscriptionDate":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId(`health-monitor-row-${O.key==="dashboardLastSeen"?"dashboard-last-seen":"subscription-date"}`,D),onContextMenu:H=>ge(H,O.key),children:[z.subscriptionStartDate??g,Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"companyEngagementMetricsUpdatedAt":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-engagement-updated",D),onContextMenu:H=>ge(H,O.key),children:[o.jsxRuntimeExports.jsx(Rn,{children:z.companyEngagementMetricsUpdatedAt!=null?o.jsxRuntimeExports.jsx(t.LargeRegular,{children:vo(z.companyEngagementMetricsUpdatedAt)}):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:g})}),Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);default:return null}})})})}const Ui=({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(Pm,{"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(Im,{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,{})})})},Tm=s.div`
|
|
1321
|
+
`,{dateFormat:qs,timeFormat:vm,timeframe:rt,common:wm}=t.appLocale.getLocalizedStrings(),bn=e=>{if(e!=null){const n=J.dateNow();return Math.abs(n.diff(e,"days"))}};function vo(e){if(e==null)return;const n=J.dateNow();if(Math.abs(n.diff(e,"days"))<=0)return`0 ${rt.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(),x=a.date();let g=p-d,h=m-l,C=x-c;if(C<0){h--;const S=new Date(p,m,0);C+=S.getDate()}h<0&&(g--,h+=12);const b=[];return g>0&&b.push(`${g} ${g>1?rt.year:rt.year.slice(0,-1)}`),h>0&&b.push(`${h} ${h>1?rt.month:rt.month.slice(0,-1)}`),C>0&&b.push(`${C} ${C>1?rt.day:rt.day.slice(0,-1)}`),b.join(", ")}function Wi(e){if(e==null)return wm.strings.hyphen;const n=Math.floor(Number(e)/12),r=Number(e)%12,i=n>1?rt.year:rt.year.slice(0,-1),a=r>1?rt.month:rt.month.slice(0,-1);return n===0?`${e} ${a}`:r===0?`${n} ${i}`:`${n} ${i}, ${r} ${a}`}const _i=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?vo(J.zeniDate(e?.managementInfo.lastReportSentDate.toISOString())):void 0,dashboardLastVisit:e?.companyHealthMetric.customerLastDashboardVisit!=null?J.zeniDate(e?.companyHealthMetric.customerLastDashboardVisit.toISOString()).format(qs.visual.MMMDCommaYYYYformat):void 0,companyEngagementMetricsUpdatedAt:e?.companyHealthMetric.companyEngagementMetricsUpdatedAt!=null?{date:J.zeniDate(e?.companyHealthMetric.companyEngagementMetricsUpdatedAt.toISOString()).format(qs.visual.MMMDCommaYYYYformat),time:J.zeniDate(e?.companyHealthMetric.companyEngagementMetricsUpdatedAt.toISOString()).format(vm.hhmmAFormat)}:void 0,noOfVerticalsEnabled:e?.noOfProductVerticalsEnabled,renewalDate:e?.companyHealthMetric.subscriptionRenewalDate!=null?vo(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}),_e=t.appLocale.getLocalizedStrings().cockpit.health.header,Nt=[{key:"companyName",value:_e.name,sortOrder:"ascending",width:new t.ResponsiveSized(392,392),isThreadAllowed:!0},{key:"churnProbability",value:_e.churnProbability,sortOrder:"ascending",width:new t.ResponsiveSized(380,380),isThreadAllowed:!0},{key:"controller",value:_e.controller,sortOrder:"ascending",width:new t.ResponsiveSized(200,200),isThreadAllowed:!0},{key:"customerSuccessManager",value:_e.customerSuccessManager,sortOrder:"ascending",width:new t.ResponsiveSized(200,200),isThreadAllowed:!0},{key:"lastEngagement",value:_e.lastEngagement,sortOrder:"ascending",width:new t.ResponsiveSized(270,270),isThreadAllowed:!0},{key:"companyEngagementMetricsUpdatedAt",value:_e.companyEngagementMetricsUpdatedAt,sortOrder:"ascending",width:new t.ResponsiveSized(160,160),isThreadAllowed:!0},{key:"runway",value:_e.runway,sortOrder:"ascending",width:new t.ResponsiveSized(220,220),isThreadAllowed:!0},{key:"netPromoterScore",value:_e.netPromoterScore,sortOrder:"ascending",width:new t.ResponsiveSized(120,120),isThreadAllowed:!0},{key:"customerSatisfactionScore",value:_e.customerSatisfactionScore,sortOrder:"ascending",width:new t.ResponsiveSized(120,120),isThreadAllowed:!0},{key:"lastReportSent",value:_e.lastReportSent,sortOrder:"ascending",width:new t.ResponsiveSized(250,250),isThreadAllowed:!0},{key:"dashboardLastSeen",value:_e.dashboardLastSeen,sortOrder:"ascending",width:new t.ResponsiveSized(270,270),isThreadAllowed:!0},{key:"subscriptionDate",value:_e.subscriptionDate,sortOrder:"ascending",width:new t.ResponsiveSized(200,200),isThreadAllowed:!0},{key:"renewalDate",value:_e.renewalDate,sortOrder:"ascending",width:new t.ResponsiveSized(180,180),isThreadAllowed:!0},{key:"group",value:_e.group,sortOrder:"ascending",width:new t.ResponsiveSized(148,148),isThreadAllowed:!0},{key:"monthlyRecurringRevenue",value:_e.monthlyRecurringRevenue,sortOrder:"ascending",width:new t.ResponsiveSized(196,196),isThreadAllowed:!0},{key:"externalProductServiceExposure",value:_e.externalProductServiceExposure,sortOrder:"ascending",width:new t.ResponsiveSized(270,270),isThreadAllowed:!0},{key:"productVerticals",value:_e.productVerticals,sortOrder:"ascending",width:new t.ResponsiveSized(360,360),isThreadAllowed:!0}];Nt.map(e=>e.key);const Vi=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 km({companyView:e,healthView:n,companyNameSticky:r,totalHeight:i,addThreadRequestThreadId:a,setNoteData:d,setElementRef:l,setAddThreadRequestThreadId:c,onRowClick:p}){const m=t.useWindowSizeContext(),x=t.appLocale.getLocalizedStrings(),{common:{strings:{hyphen:g,backspace:h,space:C,colon:b,dot:S}},cockpit:{health:{detailPage:{churnProbabilityTexts:{churnProbability:y,for:j,is:f,percent:E},notApplicable:$},common:{engagementTypes:A,labels:{lastEngagements:I,factorsThatDecreaseChurnProbability:v,factorsThatIncreaseChurnProbability:w}}}},dateFormat:F}=x,{companyInfo:{companyId:D,name:K},companyHealthMetric:M,controllers:G,managementInfo:{lastReportSentDate:q,customerSuccessManagerUserIds:R}}=e,L=_i(e),k=n.zeniUsers.values.filter(O=>R.includes(O.userId)),P=`cockpit_${D}`,N="healthMonitor.notes",{threads:Q,isLoading:ae}=t.useFilteredThreads({entityType:N,companyId:D},!1),z={name:K,companyId:D,companyGroup:e.companyGroup!=null?e.companyGroup.find(O=>O.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:G.map(O=>J.getUserName(O)),customerSuccessManagers:k.map(O=>J.getUserName(O)),lastReportSent:q!=null?J.zeniDate(q.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:Y,threads:T,addThread:te,removeThread:re,setOpenThread:Z,setRequestToOpenThread:ie}=u.useContext(t.ThreadsContext),ne=Y!==null?T.get(Y):null,xe=Y?.includes(D)===!0,ye=Y!=null&&T.get(Y)==null&&xe,$e=a!=null&&T.get(a)?.metadata.companyId===D,V=u.useCallback(()=>{Y?.includes(t.NEW_THREAD_SUFFIX)===!0&&re(Y),a!=null&&c(void 0)},[a,Y,re,c]),ee=u.useCallback(O=>{if(O===Y)Z(null);else if(T.has(O))Z(O);else if(O.includes(t.NEW_THREAD_SUFFIX)){const[ke,B]=O.replace(t.NEW_THREAD_SUFFIX,"").split("."),de=_t(Rt(ke),J.toHealthSortKeyType(B),D,K);te(O,{type:"thread",visibility:"public",id:O,roomId:P,createdAt:new Date,updatedAt:new Date,comments:[],metadata:de,resolved:!1}),Z(O)}},[D,K,Y,T,te,Z,P]),ge=u.useCallback((O,ke,B=!1)=>{const de=Nt.find(je=>je.key===ke);if(ie(null),de!=null&&(O.type==="contextmenu"||B===!0)){if(de.isThreadAllowed===!1)return;V(),O.preventDefault(),O.stopPropagation();const je=t.toCollaborationEntityType({tab:"healthMonitor",key:de.key}),U=[...t.getFilteredThreads(T,{entityType:je,companyId:D},"both")],_=U.length>0&&U[0].length>0?U[0][0]:Pe("healthMonitor",de.key,D);T.has(_)?ee(_):a===_?c(void 0):(c(_),Z(null))}},[T,D,a,ee,c,Z,ie,V]),ve=u.useCallback((O,ke)=>{O.stopPropagation();const B=Pe("healthMonitor",ke,D);c(void 0),ee(B)},[D,c,ee]),Ce=O=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:O.isElementThreadOpen??!1,isElementThreadPresent:O.isElementThreadPresent??!1,itemKey:O.itemKey,elementThreadId:O.elementThreadId??"",roomId:P,addThreadRequestThreadId:a,openThreadId:Y,threadStyle:O.threadStyle,openThreadMetadata:ne?.metadata??null,onElementClick:ge,onAddThreadClick:ve});return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{ie(null),a!=null&&(c(void 0),a.includes(t.NEW_THREAD_SUFFIX)&&re(a))},children:o.jsxRuntimeExports.jsx(Tm,{windowSize:m,isThreadOpen:xe||$e,totalHeight:i,isCreationInProgress:ye,"data-testid":t.generateDataTestId("health-monitor-row",D),onClick:()=>p(z.companyId),children:Nt.map((O,ke)=>{const B=t.toCollaborationEntityType({tab:"healthMonitor",key:O.key}),de=Nt.length-2<=ke,je=[...t.getFilteredThreads(T,{entityType:B,companyId:D},"both")],U=je.length>0&&je[0].length>0?je[0][0]:Pe("healthMonitor",O.key,D),_=T.get(U),ce=_!=null&&_.resolved===!1,Se=U===Y,fe=a===U,Ie=L.lastEngagements;switch(O.key){case"companyName":return o.jsxRuntimeExports.jsxs(Am,{companyNameSticky:r,columnWidth:O.width,windowSize:m,isThreadOpen:Se||fe,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-company-name",D),onContextMenu:H=>ge(H,O.key),ref:H=>{l(D,O.key,H)},children:[o.jsxRuntimeExports.jsxs(Nm,{"data-testid":t.generateDataTestId("health-monitor-row-company-name-text",D),children:[z.name,o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:Se,roomId:P,openThreadId:Y,openThreadMetadata:ne?.metadata??null})]}),o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:`2px ${t.Space.sp2}`},title:"Notes",children:o.jsxRuntimeExports.jsxs(zm,{className:"notesIcon","data-testid":t.generateDataTestId("health-monitor-row-notes-icon",D),onClick:H=>{H.preventDefault(),H.stopPropagation(),d({roomId:P,companyId:D,companyName:K,entityType:N})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:Q.length,isLoading:ae}),o.jsxRuntimeExports.jsx(Fm,{})]})}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:ce,itemKey:O.key,style:{left:t.Space.sp4},onElementClick:ge}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Pe("healthMonitor",O.key,D),addThreadRequestThreadId:a,itemKey:O.key,onAddThreadClick:ve})]},U);case"productVerticals":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-product-verticals",D),onContextMenu:H=>ge(H,O.key),children:[o.jsxRuntimeExports.jsx(Ui,{productVerticals:M.verticalProductServices,testIdSuffix:D}),Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"runway":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-runway",D),onContextMenu:H=>ge(H,O.key),children:[z.runway!=null?J.isCompanyRunwayInfinite(z.runway)===!0?o.jsxRuntimeExports.jsx(Bm,{"data-testid":t.generateDataTestId("health-monitor-row-runway-infinity",D)}):Wi(z.runway.runwayMonths):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:g}),Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"churnProbability":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-churn-probability",D),onContextMenu:H=>ge(H,O.key),children:[o.jsxRuntimeExports.jsx(Mm,{"data-testid":t.generateDataTestId("health-monitor-row-churn-meter",D),children:o.jsxRuntimeExports.jsx(Bi,{percentage:z.churnProbabilityPercentage,barHeight:12})}),L.churnProbabilityPercentage!=null?o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:`12px ${t.Space.sp3}`,textAlign:"left"},title:o.jsxRuntimeExports.jsxs(Vm,{children:[o.jsxRuntimeExports.jsx(Um,{children:`${y} ${j} ${e.companyInfo.name} ${f} ${Math.round(L.churnProbabilityPercentage??0)}${E}${S}`}),e.companyHealthMetric.churnProbabilityReason.length!==0||e.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(Js,{children:[o.jsxRuntimeExports.jsxs(er,{children:[w,b]}),o.jsxRuntimeExports.jsxs(tr,{children:[e.companyHealthMetric.churnProbabilityReason.map((H,ue)=>o.jsxRuntimeExports.jsx($n,{children:o.jsxRuntimeExports.jsx(En,{children:H.text})},`${o.nanoid()}_${ue}}`)),e.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.map((H,ue)=>o.jsxRuntimeExports.jsx($n,{children:o.jsxRuntimeExports.jsx(En,{children:H.value})},`${o.nanoid()}_${ue}}`))]})]}):null,e.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(Js,{children:[o.jsxRuntimeExports.jsxs(er,{children:[v,b]}),o.jsxRuntimeExports.jsx(tr,{children:e.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.map((H,ue)=>o.jsxRuntimeExports.jsx($n,{children:o.jsxRuntimeExports.jsx(En,{children:H.value})},`${o.nanoid()}_${ue}}`))})]}):null]}),children:o.jsxRuntimeExports.jsx(_m,{"data-testid":t.generateDataTestId("health-monitor-row-churn-info-icon",D),style:{marginTop:t.Space.sp1,marginLeft:t.Space.sp1,marginRight:t.Space.sp0}})}):null,Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"customerSatisfactionScore":case"netPromoterScore":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId(`health-monitor-row-${O.key==="netPromoterScore"?"nps":"csat"}`,D),onContextMenu:H=>ge(H,O.key),children:[z[O.key]!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Om,{children:z[O.key]}),o.jsxRuntimeExports.jsx(Dm,{children:h}),O.key==="netPromoterScore"?o.jsxRuntimeExports.jsxs(Qs,{children:[" ",Ja," "]}):o.jsxRuntimeExports.jsxs(Qs,{children:[" ",el," "]})]}):z.churnProbabilityPercentage!=null?$:g,Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"controller":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-controller",D),onContextMenu:H=>ge(H,O.key),children:[o.jsxRuntimeExports.jsx(t.Tooltip,{enterDelay:600,style:{padding:`2px ${t.Space.sp2}`},title:z.controllers.join(", "),children:z.controllers[0]}),Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"customerSuccessManager":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-csm",D),onContextMenu:H=>ge(H,O.key),children:[o.jsxRuntimeExports.jsx(t.Tooltip,{enterDelay:600,style:{padding:`2px ${t.Space.sp2}`,textAlign:"left"},maxWidth:"300px",title:z.customerSuccessManagers.join(", "),children:z.customerSuccessManagers[0]}),Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"lastReportSent":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-last-report-sent",D),onContextMenu:H=>ge(H,O.key),children:[o.jsxRuntimeExports.jsx(Rn,{children:z.lastReportSent!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(t.LargeRegular,{children:vo(z.lastReportSent)}),o.jsxRuntimeExports.jsx(t.SmallRegular,{children:z.lastReportSent.format(F.visual.MMMDCommaYYYYformat)})]}):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:g})}),Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"renewalDate":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-renewal-date",D),onContextMenu:H=>ge(H,O.key),children:[o.jsxRuntimeExports.jsx(Rn,{children:z.renewalDate!=null?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(t.LargeRegular,{children:vo(z.renewalDate)}),o.jsxRuntimeExports.jsx(t.SmallRegular,{children:z.renewalDate.format(F.visual.MMMDCommaYYYYformat)})]}):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:g})}),Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"group":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-group",D),onContextMenu:H=>ge(H,O.key),children:[z.companyGroup!=null?o.jsxRuntimeExports.jsx(Wm,{"data-testid":t.generateDataTestId("health-monitor-row-group-badge",D),textColor:ki[z.companyGroup.id],children:z.companyGroup.name.toUpperCase()}):g,Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"monthlyRecurringRevenue":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-mrr",D),onContextMenu:H=>ge(H,O.key),children:[t.amountToString("0,0",z.monthlyRecurringRevenue),Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"externalProductServiceExposure":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-external-exposure",D),onContextMenu:H=>ge(H,O.key),children:[z.externalProductServiceExposure!=null?z.externalProductServiceExposure.name:g,Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"lastEngagement":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-last-engagement",D),onContextMenu:H=>ge(H,O.key),children:[Ie.length>0?o.jsxRuntimeExports.jsxs(t.Tooltip,{style:{padding:`12px ${t.Space.sp3}`},title:o.jsxRuntimeExports.jsxs(Hm,{children:[o.jsxRuntimeExports.jsxs(Km,{children:[I,b]}),Ie.map((H,ue)=>o.jsxRuntimeExports.jsxs(Gm,{children:[o.jsxRuntimeExports.jsxs(Ym,{children:[H.type==="email"?o.jsxRuntimeExports.jsx(qm,{}):o.jsxRuntimeExports.jsx(Qm,{}),o.jsxRuntimeExports.jsx(Im,{children:H.type==="email"?A.email:A.meeting})]}),o.jsxRuntimeExports.jsx(Zm,{children:H.scheduledAt?.utc(!0).local().format(F.visual.MMMDCommaYYYYformat)??g})]},`${o.nanoid()}_${ue}}`))]}),children:[Ie[0].scheduledAt?.utc(!0).local().format(F.visual.MMMDCommaYYYYformat)??g,o.jsxRuntimeExports.jsxs(Xm,{children:[Ie[0].type==="email"?o.jsxRuntimeExports.jsx(Hi,{className:"engagement-email-icon"}):o.jsxRuntimeExports.jsx(Ki,{className:"engagement-meeting-icon"}),o.jsxRuntimeExports.jsxs(Jm,{children:["Via",C,Ie[0].type==="email"?A.email:A.meeting]})]})]}):o.jsxRuntimeExports.jsx(t.StandardRegular,{children:g}),Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"dashboardLastSeen":case"subscriptionDate":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId(`health-monitor-row-${O.key==="dashboardLastSeen"?"dashboard-last-seen":"subscription-date"}`,D),onContextMenu:H=>ge(H,O.key),children:[z.subscriptionStartDate??g,Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);case"companyEngagementMetricsUpdatedAt":return o.jsxRuntimeExports.jsxs(qe,{ref:H=>{l(D,O.key,H)},columnWidth:O.width,windowSize:m,isThreadAllowed:O.isThreadAllowed,className:oe,"data-testid":t.generateDataTestId("health-monitor-row-engagement-updated",D),onContextMenu:H=>ge(H,O.key),children:[o.jsxRuntimeExports.jsx(Rn,{children:z.companyEngagementMetricsUpdatedAt!=null?o.jsxRuntimeExports.jsx(t.LargeRegular,{children:vo(z.companyEngagementMetricsUpdatedAt)}):o.jsxRuntimeExports.jsx(t.LargeRegular,{children:g})}),Ce({isElementThreadOpen:Se,isElementThreadPresent:ce,itemKey:O.key,elementThreadId:U,threadStyle:de?{right:t.Space.sp0}:void 0})]},U);default:return null}})})})}const Ui=({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(Pm,{"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(Lm,{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,{})})})},Tm=s.div`
|
|
1322
1322
|
border: 1px solid ${e=>e.theme.colors.grey3};
|
|
1323
1323
|
border-radius: ${t.Space.sp2};
|
|
1324
1324
|
display: flex;
|
|
@@ -1371,7 +1371,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1371
1371
|
display: flex;
|
|
1372
1372
|
justify-content: flex-start;
|
|
1373
1373
|
gap: ${t.Space.sp2};
|
|
1374
|
-
`,
|
|
1374
|
+
`,Im=s.div``,Lm=s(t.SmallRegular)`
|
|
1375
1375
|
padding: 1px 6px;
|
|
1376
1376
|
border-radius: ${t.Space.sp1};
|
|
1377
1377
|
border: ${e=>`1px solid ${e.isEnabled?e.color:e.theme.colors.grey2}`};
|
|
@@ -1497,7 +1497,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1497
1497
|
color: ${t.Colors.heroDark};
|
|
1498
1498
|
`,Qm=s(Ki)`
|
|
1499
1499
|
color: ${t.Colors.heroDark};
|
|
1500
|
-
`,Jm=s(t.SmallRegular)``,ao=t.appLocale.getLocalizedStrings().common,Bo=(e,n)=>`${e}.${n}`,or=e=>`${e}_form`,ht="healthMonitorDetails",nr="healthMonitorPage",sr="netPromoterScore",rr="customerSatisfactionScore",ir="externalProductServiceExposure",ar="additionalChurnFactors",Gi=e=>[{label:px,options:e.increasingChurnProbability.map(n=>({label:n.value,value:n.code}))},{label:dx,options:e.decreasingChurnProbability.map(n=>({label:n.value,value:n.code}))}],Yi=e=>e==null?[]:e.increasingChurnProbability.map(n=>n.code).concat(e.decreasingChurnProbability.map(n=>n.code)),{common:{to:ex,from:tx,cc:ox,host:nx,attendees:sx,texts:{subject:lr,addMore:rx,select:ix},strings:{colon:Ye,hyphen:cr,comma:ax,space:lx}},cockpit:{health:{detailPage:we,common:{engagementTypes:dr,labels:{lastEngagements:cx,factorsThatDecreaseChurnProbability:dx,factorsThatIncreaseChurnProbability:px,contributingFactors:ux,increaseChurnProbability:mx,decreasingChurnProbability:xx}}}},dateFormat:hx}=t.appLocale.getLocalizedStrings();function gx({localData:e,companyHealthMetricViewSelector:n,additionalChurnFactorsOptions:r,analytics:i,urlSource:a,onCloseDrawer:d,onSaveChangesToLocalStore:l,onSaveClick:c}){const{selectedCompanyDetail:p,localFormDataAndStatusByCompanyId:m}=n,[x,g]=u.useState(!1),h=_i(p),[C,b]=u.useState(!1),[S,y]=u.useState(!1),j=o.useForm({mode:"all",defaultValues:Sx(e,r),reValidateMode:"onBlur"}),f=u.useRef(null);function E(R){p!=null&&i.trackCockpitHealthMonitorChurnFormClicked(R,{companyId:p.companyInfo.companyId,companyName:p.companyInfo.name,zeniProductAndServicesCount:p.noOfProductVerticalsEnabled,daysToRenewal:bn(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:bn(p.companyHealthMetric.customerLastDashboardVisit)??null,lastReportSent:bn(p.managementInfo.lastReportSentDate)??null,churnProbability:p.companyHealthMetric.churnProbabilityPercentage??null})}const $=j.handleSubmit(()=>{E("Save"),f?.current&&f.current.scrollTo({top:0,behavior:"instant"}),b(!0),g(!0),c()}),A=async(R,L)=>{if(R!=null){const W={...L},k=W[ht][ar].selectedOptions,I={netPromoterScore:W[ht][sr]?.selectedOption,customerSatisfactionScore:W[ht][rr]?.selectedOption,externalProductServiceExposure:W[ht][ir]?.selectedOption,additionalChurnFactors:{increasingChurnProbability:r.increasingChurnProbability.filter(N=>k.indexOf(N.code)!=-1),decreasingChurnProbability:r.decreasingChurnProbability.filter(N=>k.indexOf(N.code)!=-1)}};l(I)}},P=u.useRef(null),v=u.useRef(null),[w,F]=u.useState(null),D=u.useRef(null),K=Yi(e.additionalChurnFactors);u.useEffect(()=>(v.current=setTimeout(()=>{P.current&&(F(P.current),v.current&&clearTimeout(v.current))},10),()=>{v.current!=null&&clearTimeout(v.current)}),[K]),u.useEffect(()=>{const R=j.watch((L,{name:W})=>{W!=null&&L!=null&&o.defer(()=>A(W,L))});return()=>{R.unsubscribe()}}),u.useEffect(()=>{if(p!=null){const L=p.controllers.map(W=>`${W.firstName} ${W.lastName}`);a||i.trackCockpitHealthMonitorRowClicked(p.companyInfo.companyId,p.companyInfo.name,L,p.companyHealthMetric.netPromoterScore,p.companyHealthMetric.customerSatisfactionScore,p.companyHealthMetric.churnProbabilityPercentage)}},[]);function M(R){return R!=null?`${we.churnProbabilityTexts.churnProbability} ${we.churnProbabilityTexts.is} ${h.churnProbabilityPercentage}${we.churnProbabilityTexts.percent}`:`${we.churnProbabilityTexts.churnProbability} ${we.churnProbabilityTexts.percent}`}function G(){E("Cancel"),d()}const q={valueContainer:R=>({...R,padding:`2px ${t.Space.sp3}`,overflow:"unset"}),multiValue:R=>({...R,margin:0})};return o.jsxRuntimeExports.jsxs(Hx,{ref:f,"data-testid":t.generateDataTestId("health-monitor-drawer"),children:[o.jsxRuntimeExports.jsxs(Bx,{"data-testid":t.generateDataTestId("health-monitor-drawer-header"),children:[o.jsxRuntimeExports.jsx(Wx,{"data-testid":t.generateDataTestId("health-monitor-drawer-title"),children:`${p?.companyInfo.name}${we.heading}`}),o.jsxRuntimeExports.jsx(vx,{"data-testid":t.generateDataTestId("health-monitor-drawer-close-button"),onClick:G,children:o.jsxRuntimeExports.jsx(wx,{})})]}),o.jsxRuntimeExports.jsxs(Ux,{children:[n.localFormDataAndStatusByCompanyId?.saveStatus?.fetchState==="Error"?o.jsxRuntimeExports.jsx(th,{"data-testid":t.generateDataTestId("health-monitor-drawer-error"),children:o.jsxRuntimeExports.jsxs(oh,{children:[o.jsxRuntimeExports.jsx(sh,{}),n.localFormDataAndStatusByCompanyId.saveStatus.error?.message!=null?o.jsxRuntimeExports.jsx(nh,{"data-testid":t.generateDataTestId("health-monitor-drawer-error-text"),children:n.localFormDataAndStatusByCompanyId.saveStatus.error?.message}):null]})}):null,o.jsxRuntimeExports.jsx(Tx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-section"),children:m?.saveStatus?.fetchState==="In-Progress"?o.jsxRuntimeExports.jsxs(kx,{"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:we.calculatingProbability})]}):o.jsxRuntimeExports.jsxs(_x,{"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(h.churnProbabilityPercentage)}),o.jsxRuntimeExports.jsx(fx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-meter"),children:o.jsxRuntimeExports.jsx(Bi,{barHeight:32,percentage:h.churnProbabilityPercentage})}),o.jsxRuntimeExports.jsx(Px,{"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(Lx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-contributing-heading"),children:ux}),p.companyHealthMetric.churnProbabilityReason.length!==0||p.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(ur,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-increasing-factors"),children:[o.jsxRuntimeExports.jsx(pr,{children:`${mx}${Ye}`}),o.jsxRuntimeExports.jsxs(xr,{children:[p.companyHealthMetric.churnProbabilityReason.map((R,L)=>o.jsxRuntimeExports.jsx(vn,{children:o.jsxRuntimeExports.jsx(wn,{children:R.text})},`${o.nanoid()}_${L}}`)),p.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.map((R,L)=>o.jsxRuntimeExports.jsxs(vn,{children:[o.jsxRuntimeExports.jsx(wn,{children:R.value}),o.jsxRuntimeExports.jsx(mr,{children:"Newly added"})]},`${o.nanoid()}_${L}}`))]})]}):null,p?.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(ur,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-decreasing-factors"),children:[o.jsxRuntimeExports.jsx(pr,{children:`${xx}${Ye}`}),o.jsxRuntimeExports.jsx(xr,{children:p.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.map((R,L)=>o.jsxRuntimeExports.jsxs(vn,{children:[o.jsxRuntimeExports.jsx(wn,{children:R.value}),o.jsxRuntimeExports.jsx(mr,{children:"Newly added"})]},`${o.nanoid()}_${L}}`))})]}):null,o.jsxRuntimeExports.jsxs(Dx,{"data-testid":t.generateDataTestId("health-monitor-drawer-add-more-button"),onClick:()=>{t.scrollContainerToTargetAdjusted(D?.current,f?.current),setTimeout(()=>{y(!0)},500)},ref:D,children:[o.jsxRuntimeExports.jsx(Ax,{}),o.jsxRuntimeExports.jsx(Ix,{children:rx})]})]}):null})]})}),o.jsxRuntimeExports.jsxs(Gx,{"data-testid":t.generateDataTestId("health-monitor-drawer-form-container"),children:[o.jsxRuntimeExports.jsxs(Ox,{children:[o.jsxRuntimeExports.jsxs(Mx,{children:[o.jsxRuntimeExports.jsx(zx,{"data-testid":t.generateDataTestId("health-monitor-drawer-manual-input-heading"),children:we.manualInput.header}),o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"250px",variant:"small-description",data:we.tooltipTexts.manualInputText,placement:"top",children:o.jsxRuntimeExports.jsx(Wo,{"data-testid":t.generateDataTestId("health-monitor-drawer-manual-input-info"),style:{marginTop:t.Space.sp1,marginRight:t.Space.sp0}})})]}),h.companyEngagementMetricsUpdatedAt!=null&&n.localFormDataAndStatusByCompanyId?.saveStatus?.fetchState!=="In-Progress"?o.jsxRuntimeExports.jsx(Nx,{"data-testid":t.generateDataTestId("health-monitor-drawer-last-updated"),children:h.updatedByUserName!=null?o.jsxRuntimeExports.jsxs(hr,{children:[`${we.lastUpdatedBy}${Ye} ${h.updatedByUserName}`,o.jsxRuntimeExports.jsx(ms,{}),`${h.companyEngagementMetricsUpdatedAt.date}${ax}${lx}${h.companyEngagementMetricsUpdatedAt.time}`]}):o.jsxRuntimeExports.jsxs(hr,{children:[`${we.lastUpdatedAt}${Ye} ${h.companyEngagementMetricsUpdatedAt.date}`,o.jsxRuntimeExports.jsx(ms,{}),`${h.companyEngagementMetricsUpdatedAt.time}`]})}):null]}),o.jsxRuntimeExports.jsx(o.FormProvider,{...j,children:o.jsxRuntimeExports.jsx("form",{id:or(nr),onSubmit:$,children:o.jsxRuntimeExports.jsxs(Yx,{"data-testid":t.generateDataTestId("health-monitor-drawer-form-fields"),children:[o.jsxRuntimeExports.jsx(Cx,{"data-testid":t.generateDataTestId("health-monitor-drawer-nps-field"),children:o.jsxRuntimeExports.jsx(t.LabeledSingleSelectNumericField,{label:{label:`${we.manualInput.labels.netPromoterScore}${Ye}`,width:0,style:{width:"auto"}},singleSelectNumericField:{customStyleConfig:{input:(R,L)=>({input:{textAlign:L.selectProps.menuIsOpen===!1&&e.netPromoterScore==null?"right":"left"}})},placeholder:ao.add,name:Bo(ht,sr),defaultValue:{allOptions:Ri,selectedOption:e.netPromoterScore},registerOptions:{required:!0,validate:(R,L)=>L.healthMonitorDetails.customerSatisfactionScore.selectedOption?!0:R!=null&&!!R.selectedOption}},style:{width:"auto"}})}),o.jsxRuntimeExports.jsx(kn,{}),o.jsxRuntimeExports.jsx(jx,{"data-testid":t.generateDataTestId("health-monitor-drawer-csat-field"),children:o.jsxRuntimeExports.jsx(t.LabeledSingleSelectNumericField,{label:{label:`${we.manualInput.labels.customerSatisfactionScore}${Ye}`,width:0,labelIcon:o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"300px",variant:"small-description",data:we.tooltipTexts.customerSatisfactionScoreText,placement:"top",children:o.jsxRuntimeExports.jsx(Wo,{"data-testid":t.generateDataTestId("health-monitor-drawer-csat-info")})}),style:{marginRight:t.Space.sp2,width:"auto"}},singleSelectNumericField:{customStyleConfig:{input:(R,L)=>({input:{textAlign:L.selectProps.menuIsOpen===!1&&e.customerSatisfactionScore==null?"right":"left"}})},placeholder:ao.add,name:Bo(ht,rr),defaultValue:{allOptions:$i,selectedOption:e.customerSatisfactionScore},registerOptions:{required:!0,validate:(R,L)=>L.healthMonitorDetails.netPromoterScore.selectedOption?!0:R!=null&&!!R.selectedOption}},style:{width:"auto"}})}),o.jsxRuntimeExports.jsx(kn,{}),o.jsxRuntimeExports.jsx(bx,{"data-testid":t.generateDataTestId("health-monitor-drawer-external-exposure-field"),children:o.jsxRuntimeExports.jsx(t.LabeledSingleSelectPickerField,{label:{label:we.manualInput.labels.externalProductServices,labelIcon:o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"265px",variant:"small-description",data:we.tooltipTexts.externalProductServicesText,placement:"top",children:o.jsxRuntimeExports.jsx(Wo,{"data-testid":t.generateDataTestId("health-monitor-drawer-external-exposure-info")})}),style:{marginRight:t.Space.sp2}},singleSelectPickerField:{placeholder:ao.add,name:Bo(ht,ir),defaultValue:{allOptions:J.companyHealthMetricDropDownOptions,selectedOption:e.externalProductServiceExposure},textAlignment:"right",registerOptions:{required:!0,validate:R=>R!=null&&!!R.selectedOption}},style:{width:"auto"}})}),o.jsxRuntimeExports.jsx(kn,{}),o.jsxRuntimeExports.jsxs(Zx,{"data-testid":t.generateDataTestId("health-monitor-drawer-additional-factors"),additionalNotesHidden:K.length===0,isFocused:S,children:[o.jsxRuntimeExports.jsx(t.LabeledGroupedMultiSelectField,{fullWidthSelect:!0,label:{label:`${we.manualInput.labels.additionalContributingFactorsLabel}${Ye}`,labelIcon:o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"280px",variant:"small-description",data:we.tooltipTexts.additionalContributingFactorsText,placement:"top",children:o.jsxRuntimeExports.jsx(Wo,{"data-testid":t.generateDataTestId("health-monitor-drawer-additional-factors-info")})})},groupedMultiSelectField:{name:Bo(ht,ar),treeViewStructure:!0,registerOptions:{required:!1},defaultValue:{allOptions:Gi(r),selectedOptions:K},placeholder:ix,customStyleConfig:q,showSelectedInNewLines:!0},isMenuOpen:S,setIsMenuOpen:y,menuPortalEnabled:!0}),K.length!==0&&o.jsxRuntimeExports.jsxs(qx,{"data-testid":t.generateDataTestId("health-monitor-drawer-notes-composer"),children:[o.jsxRuntimeExports.jsx(ch,{}),o.jsxRuntimeExports.jsx(Xx,{ref:P,children:w&&Po.createPortal(o.jsxRuntimeExports.jsx(dm,{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:we.manualInput.placeholders.addANote,createThreadCallback:()=>{b(!1)},isSubmitComment:C}),w)})]})]})]})})})]}),o.jsxRuntimeExports.jsxs(Kx,{"data-testid":t.generateDataTestId("health-monitor-drawer-prefilled-section"),children:[o.jsxRuntimeExports.jsx(Fx,{"data-testid":t.generateDataTestId("health-monitor-drawer-prefilled-heading"),children:we.preFilledInput.header}),o.jsxRuntimeExports.jsxs(Qx,{"data-testid":t.generateDataTestId("health-monitor-drawer-runway"),children:[o.jsxRuntimeExports.jsx(lo,{children:we.preFilledInput.labels.runway}),h.runway!=null?J.isCompanyRunwayInfinite(h.runway)===!0?o.jsxRuntimeExports.jsx(eh,{}):o.jsxRuntimeExports.jsx(Kt,{children:Wi(h.runway.runwayMonths)}):o.jsxRuntimeExports.jsx(Kt,{children:we.notApplicable})]}),o.jsxRuntimeExports.jsxs(_o,{"data-testid":t.generateDataTestId("health-monitor-drawer-dashboard-last-seen"),children:[o.jsxRuntimeExports.jsx(lo,{children:we.preFilledInput.labels.dashboardLastSeen}),o.jsxRuntimeExports.jsx(Kt,{children:h.dashboardLastVisit??we.notApplicable})]}),o.jsxRuntimeExports.jsxs(_o,{"data-testid":t.generateDataTestId("health-monitor-drawer-last-report-sent"),children:[o.jsxRuntimeExports.jsx(lo,{children:we.preFilledInput.labels.lastReportSent}),o.jsxRuntimeExports.jsx(Kt,{children:h.lastReportSent??we.notApplicable})]}),o.jsxRuntimeExports.jsxs(_o,{"data-testid":t.generateDataTestId("health-monitor-drawer-product-services"),children:[o.jsxRuntimeExports.jsx(lo,{children:we.preFilledInput.labels.zeniProductServices}),o.jsxRuntimeExports.jsx(Kt,{children:o.jsxRuntimeExports.jsx(Ui,{productVerticals:p?.companyHealthMetric.verticalProductServices??[],testIdSuffix:p?.companyInfo.companyId})})]}),o.jsxRuntimeExports.jsxs(_o,{"data-testid":t.generateDataTestId("health-monitor-drawer-days-to-renewal"),children:[o.jsxRuntimeExports.jsx(lo,{children:we.preFilledInput.labels.daysToRenewal}),o.jsxRuntimeExports.jsx(Kt,{children:h.renewalDate??we.notApplicable})]}),o.jsxRuntimeExports.jsx(Jx,{"data-testid":t.generateDataTestId("health-monitor-drawer-last-engagements"),children:o.jsxRuntimeExports.jsx(t.LabeledReadOnlyTextField,{label:{label:`${cx}${Ye}`},text:o.jsxRuntimeExports.jsx(rh,{children:h.lastEngagements.length>0?h.lastEngagements.map((R,L)=>o.jsxRuntimeExports.jsx(ih,{"data-testid":t.generateDataTestId("health-monitor-drawer-engagement",String(L)),children:o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:`12px ${t.Space.sp3}`,color:t.Colors.heroDark},title:o.jsxRuntimeExports.jsx(lh,{children:R.type==="email"?o.jsxRuntimeExports.jsxs(gr,{children:[o.jsxRuntimeExports.jsxs(wt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[lr,Ye]}),o.jsxRuntimeExports.jsx(Tt,{children:R.subject})]}),o.jsxRuntimeExports.jsxs(wt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[tx,Ye]}),o.jsxRuntimeExports.jsx(Tt,{children:R.from})]}),o.jsxRuntimeExports.jsxs(wt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[ex,Ye]}),o.jsxRuntimeExports.jsx(Tt,{children:R.to})]}),R.cc!=""?o.jsxRuntimeExports.jsxs(wt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[ox,Ye]}),o.jsxRuntimeExports.jsx(Tt,{children:R.cc})]}):null]}):o.jsxRuntimeExports.jsxs(gr,{children:[o.jsxRuntimeExports.jsxs(wt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[lr,Ye]}),o.jsxRuntimeExports.jsx(Tt,{children:R.subject})]}),o.jsxRuntimeExports.jsxs(wt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[nx,Ye]}),o.jsxRuntimeExports.jsx(Tt,{children:R.hostName})]}),o.jsxRuntimeExports.jsxs(wt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[sx,Ye]}),o.jsxRuntimeExports.jsx(Tt,{children:R.attendees})]})]})}),placement:"left",children:o.jsxRuntimeExports.jsxs(ah,{children:[o.jsxRuntimeExports.jsxs(Ex,{children:[R.type==="email"?o.jsxRuntimeExports.jsx(ph,{"data-testid":t.generateDataTestId("health-monitor-drawer-engagement-email-icon",String(L))}):o.jsxRuntimeExports.jsx(dh,{"data-testid":t.generateDataTestId("health-monitor-drawer-engagement-meeting-icon",String(L))}),o.jsxRuntimeExports.jsx(yx,{children:R.type==="email"?dr.email:dr.meeting})]}),o.jsxRuntimeExports.jsx(uh,{className:"engagementDot"}),o.jsxRuntimeExports.jsx($x,{children:R.scheduledAt?.utc(!0).local().format(hx.visual.MMMDCommaYYYYformat)??cr})]},`${o.nanoid()}_${L}}`)})},L)):cr}),style:{width:"100%"}})})]})]}),J.hasCompanyHealthMetricFormFieldChanged(p?.companyHealthMetric,m?.companyHealthMetricLocalData)===!0||x===!1?o.jsxRuntimeExports.jsx(Rx,{"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:or(nr),primaryBtn:{label:ao.save,style:{minWidth:112},isLoading:m?.saveStatus?.fetchState==="In-Progress"},cancelBtn:{label:ao.cancel,style:{minWidth:112},onClick:G}})}):null]})}const Sx=(e,n)=>({[ht]:{netPromoterScore:{selectedOption:e.netPromoterScore,allOptions:Ri},customerSatisfactionScore:{selectedOption:e.customerSatisfactionScore,allOptions:$i},externalProductServiceExposure:{selectedOption:e.externalProductServiceExposure,allOptions:J.companyHealthMetricDropDownOptions},additionalChurnFactors:{selectedOptions:Yi(e.additionalChurnFactors),allOptions:Gi(n)}}}),yx=s.div``,fx=s.div``,Cx=s.div``,jx=s.div``,bx=s.div``,Rx=s.div``,$x=s.div`
|
|
1500
|
+
`,Jm=s(t.SmallRegular)``,ao=t.appLocale.getLocalizedStrings().common,Bo=(e,n)=>`${e}.${n}`,or=e=>`${e}_form`,ht="healthMonitorDetails",nr="healthMonitorPage",sr="netPromoterScore",rr="customerSatisfactionScore",ir="externalProductServiceExposure",ar="additionalChurnFactors",Gi=e=>[{label:px,options:e.increasingChurnProbability.map(n=>({label:n.value,value:n.code}))},{label:dx,options:e.decreasingChurnProbability.map(n=>({label:n.value,value:n.code}))}],Yi=e=>e==null?[]:e.increasingChurnProbability.map(n=>n.code).concat(e.decreasingChurnProbability.map(n=>n.code)),{common:{to:ex,from:tx,cc:ox,host:nx,attendees:sx,texts:{subject:lr,addMore:rx,select:ix},strings:{colon:Ye,hyphen:cr,comma:ax,space:lx}},cockpit:{health:{detailPage:we,common:{engagementTypes:dr,labels:{lastEngagements:cx,factorsThatDecreaseChurnProbability:dx,factorsThatIncreaseChurnProbability:px,contributingFactors:ux,increaseChurnProbability:mx,decreasingChurnProbability:xx}}}},dateFormat:hx}=t.appLocale.getLocalizedStrings();function gx({localData:e,companyHealthMetricViewSelector:n,additionalChurnFactorsOptions:r,analytics:i,urlSource:a,onCloseDrawer:d,onSaveChangesToLocalStore:l,onSaveClick:c}){const{selectedCompanyDetail:p,localFormDataAndStatusByCompanyId:m}=n,[x,g]=u.useState(!1),h=_i(p),[C,b]=u.useState(!1),[S,y]=u.useState(!1),j=o.useForm({mode:"all",defaultValues:Sx(e,r),reValidateMode:"onBlur"}),f=u.useRef(null);function E(R){p!=null&&i.trackCockpitHealthMonitorChurnFormClicked(R,{companyId:p.companyInfo.companyId,companyName:p.companyInfo.name,zeniProductAndServicesCount:p.noOfProductVerticalsEnabled,daysToRenewal:bn(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:bn(p.companyHealthMetric.customerLastDashboardVisit)??null,lastReportSent:bn(p.managementInfo.lastReportSentDate)??null,churnProbability:p.companyHealthMetric.churnProbabilityPercentage??null})}const $=j.handleSubmit(()=>{E("Save"),f?.current&&f.current.scrollTo({top:0,behavior:"instant"}),b(!0),g(!0),c()}),A=async(R,L)=>{if(R!=null){const W={...L},k=W[ht][ar].selectedOptions,P={netPromoterScore:W[ht][sr]?.selectedOption,customerSatisfactionScore:W[ht][rr]?.selectedOption,externalProductServiceExposure:W[ht][ir]?.selectedOption,additionalChurnFactors:{increasingChurnProbability:r.increasingChurnProbability.filter(N=>k.indexOf(N.code)!=-1),decreasingChurnProbability:r.decreasingChurnProbability.filter(N=>k.indexOf(N.code)!=-1)}};l(P)}},I=u.useRef(null),v=u.useRef(null),[w,F]=u.useState(null),D=u.useRef(null),K=Yi(e.additionalChurnFactors);u.useEffect(()=>(v.current=setTimeout(()=>{I.current&&(F(I.current),v.current&&clearTimeout(v.current))},10),()=>{v.current!=null&&clearTimeout(v.current)}),[K]),u.useEffect(()=>{const R=j.watch((L,{name:W})=>{W!=null&&L!=null&&o.defer(()=>A(W,L))});return()=>{R.unsubscribe()}}),u.useEffect(()=>{if(p!=null){const L=p.controllers.map(W=>`${W.firstName} ${W.lastName}`);a||i.trackCockpitHealthMonitorRowClicked(p.companyInfo.companyId,p.companyInfo.name,L,p.companyHealthMetric.netPromoterScore,p.companyHealthMetric.customerSatisfactionScore,p.companyHealthMetric.churnProbabilityPercentage)}},[]);function M(R){return R!=null?`${we.churnProbabilityTexts.churnProbability} ${we.churnProbabilityTexts.is} ${h.churnProbabilityPercentage}${we.churnProbabilityTexts.percent}`:`${we.churnProbabilityTexts.churnProbability} ${we.churnProbabilityTexts.percent}`}function G(){E("Cancel"),d()}const q={valueContainer:R=>({...R,padding:`2px ${t.Space.sp3}`,overflow:"unset"}),multiValue:R=>({...R,margin:0})};return o.jsxRuntimeExports.jsxs(Hx,{ref:f,"data-testid":t.generateDataTestId("health-monitor-drawer"),children:[o.jsxRuntimeExports.jsxs(Bx,{"data-testid":t.generateDataTestId("health-monitor-drawer-header"),children:[o.jsxRuntimeExports.jsx(Wx,{"data-testid":t.generateDataTestId("health-monitor-drawer-title"),children:`${p?.companyInfo.name}${we.heading}`}),o.jsxRuntimeExports.jsx(vx,{"data-testid":t.generateDataTestId("health-monitor-drawer-close-button"),onClick:G,children:o.jsxRuntimeExports.jsx(wx,{})})]}),o.jsxRuntimeExports.jsxs(Ux,{children:[n.localFormDataAndStatusByCompanyId?.saveStatus?.fetchState==="Error"?o.jsxRuntimeExports.jsx(th,{"data-testid":t.generateDataTestId("health-monitor-drawer-error"),children:o.jsxRuntimeExports.jsxs(oh,{children:[o.jsxRuntimeExports.jsx(sh,{}),n.localFormDataAndStatusByCompanyId.saveStatus.error?.message!=null?o.jsxRuntimeExports.jsx(nh,{"data-testid":t.generateDataTestId("health-monitor-drawer-error-text"),children:n.localFormDataAndStatusByCompanyId.saveStatus.error?.message}):null]})}):null,o.jsxRuntimeExports.jsx(Tx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-section"),children:m?.saveStatus?.fetchState==="In-Progress"?o.jsxRuntimeExports.jsxs(kx,{"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:we.calculatingProbability})]}):o.jsxRuntimeExports.jsxs(_x,{"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(h.churnProbabilityPercentage)}),o.jsxRuntimeExports.jsx(fx,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-meter"),children:o.jsxRuntimeExports.jsx(Bi,{barHeight:32,percentage:h.churnProbabilityPercentage})}),o.jsxRuntimeExports.jsx(Px,{"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(Ix,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-contributing-heading"),children:ux}),p.companyHealthMetric.churnProbabilityReason.length!==0||p.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(ur,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-increasing-factors"),children:[o.jsxRuntimeExports.jsx(pr,{children:`${mx}${Ye}`}),o.jsxRuntimeExports.jsxs(xr,{children:[p.companyHealthMetric.churnProbabilityReason.map((R,L)=>o.jsxRuntimeExports.jsx(vn,{children:o.jsxRuntimeExports.jsx(wn,{children:R.text})},`${o.nanoid()}_${L}}`)),p.companyHealthMetric.additionalChurnFactors.increasingChurnProbability.map((R,L)=>o.jsxRuntimeExports.jsxs(vn,{children:[o.jsxRuntimeExports.jsx(wn,{children:R.value}),o.jsxRuntimeExports.jsx(mr,{children:"Newly added"})]},`${o.nanoid()}_${L}}`))]})]}):null,p?.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.length!==0?o.jsxRuntimeExports.jsxs(ur,{"data-testid":t.generateDataTestId("health-monitor-drawer-churn-decreasing-factors"),children:[o.jsxRuntimeExports.jsx(pr,{children:`${xx}${Ye}`}),o.jsxRuntimeExports.jsx(xr,{children:p.companyHealthMetric.additionalChurnFactors.decreasingChurnProbability.map((R,L)=>o.jsxRuntimeExports.jsxs(vn,{children:[o.jsxRuntimeExports.jsx(wn,{children:R.value}),o.jsxRuntimeExports.jsx(mr,{children:"Newly added"})]},`${o.nanoid()}_${L}}`))})]}):null,o.jsxRuntimeExports.jsxs(Dx,{"data-testid":t.generateDataTestId("health-monitor-drawer-add-more-button"),onClick:()=>{t.scrollContainerToTargetAdjusted(D?.current,f?.current),setTimeout(()=>{y(!0)},500)},ref:D,children:[o.jsxRuntimeExports.jsx(Ax,{}),o.jsxRuntimeExports.jsx(Lx,{children:rx})]})]}):null})]})}),o.jsxRuntimeExports.jsxs(Gx,{"data-testid":t.generateDataTestId("health-monitor-drawer-form-container"),children:[o.jsxRuntimeExports.jsxs(Ox,{children:[o.jsxRuntimeExports.jsxs(Mx,{children:[o.jsxRuntimeExports.jsx(zx,{"data-testid":t.generateDataTestId("health-monitor-drawer-manual-input-heading"),children:we.manualInput.header}),o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"250px",variant:"small-description",data:we.tooltipTexts.manualInputText,placement:"top",children:o.jsxRuntimeExports.jsx(Wo,{"data-testid":t.generateDataTestId("health-monitor-drawer-manual-input-info"),style:{marginTop:t.Space.sp1,marginRight:t.Space.sp0}})})]}),h.companyEngagementMetricsUpdatedAt!=null&&n.localFormDataAndStatusByCompanyId?.saveStatus?.fetchState!=="In-Progress"?o.jsxRuntimeExports.jsx(Nx,{"data-testid":t.generateDataTestId("health-monitor-drawer-last-updated"),children:h.updatedByUserName!=null?o.jsxRuntimeExports.jsxs(hr,{children:[`${we.lastUpdatedBy}${Ye} ${h.updatedByUserName}`,o.jsxRuntimeExports.jsx(ms,{}),`${h.companyEngagementMetricsUpdatedAt.date}${ax}${lx}${h.companyEngagementMetricsUpdatedAt.time}`]}):o.jsxRuntimeExports.jsxs(hr,{children:[`${we.lastUpdatedAt}${Ye} ${h.companyEngagementMetricsUpdatedAt.date}`,o.jsxRuntimeExports.jsx(ms,{}),`${h.companyEngagementMetricsUpdatedAt.time}`]})}):null]}),o.jsxRuntimeExports.jsx(o.FormProvider,{...j,children:o.jsxRuntimeExports.jsx("form",{id:or(nr),onSubmit:$,children:o.jsxRuntimeExports.jsxs(Yx,{"data-testid":t.generateDataTestId("health-monitor-drawer-form-fields"),children:[o.jsxRuntimeExports.jsx(Cx,{"data-testid":t.generateDataTestId("health-monitor-drawer-nps-field"),children:o.jsxRuntimeExports.jsx(t.LabeledSingleSelectNumericField,{label:{label:`${we.manualInput.labels.netPromoterScore}${Ye}`,width:0,style:{width:"auto"}},singleSelectNumericField:{customStyleConfig:{input:(R,L)=>({input:{textAlign:L.selectProps.menuIsOpen===!1&&e.netPromoterScore==null?"right":"left"}})},placeholder:ao.add,name:Bo(ht,sr),defaultValue:{allOptions:Ri,selectedOption:e.netPromoterScore},registerOptions:{required:!0,validate:(R,L)=>L.healthMonitorDetails.customerSatisfactionScore.selectedOption?!0:R!=null&&!!R.selectedOption}},style:{width:"auto"}})}),o.jsxRuntimeExports.jsx(kn,{}),o.jsxRuntimeExports.jsx(jx,{"data-testid":t.generateDataTestId("health-monitor-drawer-csat-field"),children:o.jsxRuntimeExports.jsx(t.LabeledSingleSelectNumericField,{label:{label:`${we.manualInput.labels.customerSatisfactionScore}${Ye}`,width:0,labelIcon:o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"300px",variant:"small-description",data:we.tooltipTexts.customerSatisfactionScoreText,placement:"top",children:o.jsxRuntimeExports.jsx(Wo,{"data-testid":t.generateDataTestId("health-monitor-drawer-csat-info")})}),style:{marginRight:t.Space.sp2,width:"auto"}},singleSelectNumericField:{customStyleConfig:{input:(R,L)=>({input:{textAlign:L.selectProps.menuIsOpen===!1&&e.customerSatisfactionScore==null?"right":"left"}})},placeholder:ao.add,name:Bo(ht,rr),defaultValue:{allOptions:$i,selectedOption:e.customerSatisfactionScore},registerOptions:{required:!0,validate:(R,L)=>L.healthMonitorDetails.netPromoterScore.selectedOption?!0:R!=null&&!!R.selectedOption}},style:{width:"auto"}})}),o.jsxRuntimeExports.jsx(kn,{}),o.jsxRuntimeExports.jsx(bx,{"data-testid":t.generateDataTestId("health-monitor-drawer-external-exposure-field"),children:o.jsxRuntimeExports.jsx(t.LabeledSingleSelectPickerField,{label:{label:we.manualInput.labels.externalProductServices,labelIcon:o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"265px",variant:"small-description",data:we.tooltipTexts.externalProductServicesText,placement:"top",children:o.jsxRuntimeExports.jsx(Wo,{"data-testid":t.generateDataTestId("health-monitor-drawer-external-exposure-info")})}),style:{marginRight:t.Space.sp2}},singleSelectPickerField:{placeholder:ao.add,name:Bo(ht,ir),defaultValue:{allOptions:J.companyHealthMetricDropDownOptions,selectedOption:e.externalProductServiceExposure},textAlignment:"right",registerOptions:{required:!0,validate:R=>R!=null&&!!R.selectedOption}},style:{width:"auto"}})}),o.jsxRuntimeExports.jsx(kn,{}),o.jsxRuntimeExports.jsxs(Zx,{"data-testid":t.generateDataTestId("health-monitor-drawer-additional-factors"),additionalNotesHidden:K.length===0,isFocused:S,children:[o.jsxRuntimeExports.jsx(t.LabeledGroupedMultiSelectField,{fullWidthSelect:!0,label:{label:`${we.manualInput.labels.additionalContributingFactorsLabel}${Ye}`,labelIcon:o.jsxRuntimeExports.jsx(t.Tooltip,{maxWidth:"280px",variant:"small-description",data:we.tooltipTexts.additionalContributingFactorsText,placement:"top",children:o.jsxRuntimeExports.jsx(Wo,{"data-testid":t.generateDataTestId("health-monitor-drawer-additional-factors-info")})})},groupedMultiSelectField:{name:Bo(ht,ar),treeViewStructure:!0,registerOptions:{required:!1},defaultValue:{allOptions:Gi(r),selectedOptions:K},placeholder:ix,customStyleConfig:q,showSelectedInNewLines:!0},isMenuOpen:S,setIsMenuOpen:y,menuPortalEnabled:!0}),K.length!==0&&o.jsxRuntimeExports.jsxs(qx,{"data-testid":t.generateDataTestId("health-monitor-drawer-notes-composer"),children:[o.jsxRuntimeExports.jsx(ch,{}),o.jsxRuntimeExports.jsx(Xx,{ref:I,children:w&&Po.createPortal(o.jsxRuntimeExports.jsx(dm,{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:we.manualInput.placeholders.addANote,createThreadCallback:()=>{b(!1)},isSubmitComment:C}),w)})]})]})]})})})]}),o.jsxRuntimeExports.jsxs(Kx,{"data-testid":t.generateDataTestId("health-monitor-drawer-prefilled-section"),children:[o.jsxRuntimeExports.jsx(Fx,{"data-testid":t.generateDataTestId("health-monitor-drawer-prefilled-heading"),children:we.preFilledInput.header}),o.jsxRuntimeExports.jsxs(Qx,{"data-testid":t.generateDataTestId("health-monitor-drawer-runway"),children:[o.jsxRuntimeExports.jsx(lo,{children:we.preFilledInput.labels.runway}),h.runway!=null?J.isCompanyRunwayInfinite(h.runway)===!0?o.jsxRuntimeExports.jsx(eh,{}):o.jsxRuntimeExports.jsx(Kt,{children:Wi(h.runway.runwayMonths)}):o.jsxRuntimeExports.jsx(Kt,{children:we.notApplicable})]}),o.jsxRuntimeExports.jsxs(_o,{"data-testid":t.generateDataTestId("health-monitor-drawer-dashboard-last-seen"),children:[o.jsxRuntimeExports.jsx(lo,{children:we.preFilledInput.labels.dashboardLastSeen}),o.jsxRuntimeExports.jsx(Kt,{children:h.dashboardLastVisit??we.notApplicable})]}),o.jsxRuntimeExports.jsxs(_o,{"data-testid":t.generateDataTestId("health-monitor-drawer-last-report-sent"),children:[o.jsxRuntimeExports.jsx(lo,{children:we.preFilledInput.labels.lastReportSent}),o.jsxRuntimeExports.jsx(Kt,{children:h.lastReportSent??we.notApplicable})]}),o.jsxRuntimeExports.jsxs(_o,{"data-testid":t.generateDataTestId("health-monitor-drawer-product-services"),children:[o.jsxRuntimeExports.jsx(lo,{children:we.preFilledInput.labels.zeniProductServices}),o.jsxRuntimeExports.jsx(Kt,{children:o.jsxRuntimeExports.jsx(Ui,{productVerticals:p?.companyHealthMetric.verticalProductServices??[],testIdSuffix:p?.companyInfo.companyId})})]}),o.jsxRuntimeExports.jsxs(_o,{"data-testid":t.generateDataTestId("health-monitor-drawer-days-to-renewal"),children:[o.jsxRuntimeExports.jsx(lo,{children:we.preFilledInput.labels.daysToRenewal}),o.jsxRuntimeExports.jsx(Kt,{children:h.renewalDate??we.notApplicable})]}),o.jsxRuntimeExports.jsx(Jx,{"data-testid":t.generateDataTestId("health-monitor-drawer-last-engagements"),children:o.jsxRuntimeExports.jsx(t.LabeledReadOnlyTextField,{label:{label:`${cx}${Ye}`},text:o.jsxRuntimeExports.jsx(rh,{children:h.lastEngagements.length>0?h.lastEngagements.map((R,L)=>o.jsxRuntimeExports.jsx(ih,{"data-testid":t.generateDataTestId("health-monitor-drawer-engagement",String(L)),children:o.jsxRuntimeExports.jsx(t.Tooltip,{style:{padding:`12px ${t.Space.sp3}`,color:t.Colors.heroDark},title:o.jsxRuntimeExports.jsx(lh,{children:R.type==="email"?o.jsxRuntimeExports.jsxs(gr,{children:[o.jsxRuntimeExports.jsxs(wt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[lr,Ye]}),o.jsxRuntimeExports.jsx(Tt,{children:R.subject})]}),o.jsxRuntimeExports.jsxs(wt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[tx,Ye]}),o.jsxRuntimeExports.jsx(Tt,{children:R.from})]}),o.jsxRuntimeExports.jsxs(wt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[ex,Ye]}),o.jsxRuntimeExports.jsx(Tt,{children:R.to})]}),R.cc!=""?o.jsxRuntimeExports.jsxs(wt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[ox,Ye]}),o.jsxRuntimeExports.jsx(Tt,{children:R.cc})]}):null]}):o.jsxRuntimeExports.jsxs(gr,{children:[o.jsxRuntimeExports.jsxs(wt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[lr,Ye]}),o.jsxRuntimeExports.jsx(Tt,{children:R.subject})]}),o.jsxRuntimeExports.jsxs(wt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[nx,Ye]}),o.jsxRuntimeExports.jsx(Tt,{children:R.hostName})]}),o.jsxRuntimeExports.jsxs(wt,{children:[o.jsxRuntimeExports.jsxs(kt,{children:[sx,Ye]}),o.jsxRuntimeExports.jsx(Tt,{children:R.attendees})]})]})}),placement:"left",children:o.jsxRuntimeExports.jsxs(ah,{children:[o.jsxRuntimeExports.jsxs(Ex,{children:[R.type==="email"?o.jsxRuntimeExports.jsx(ph,{"data-testid":t.generateDataTestId("health-monitor-drawer-engagement-email-icon",String(L))}):o.jsxRuntimeExports.jsx(dh,{"data-testid":t.generateDataTestId("health-monitor-drawer-engagement-meeting-icon",String(L))}),o.jsxRuntimeExports.jsx(yx,{children:R.type==="email"?dr.email:dr.meeting})]}),o.jsxRuntimeExports.jsx(uh,{className:"engagementDot"}),o.jsxRuntimeExports.jsx($x,{children:R.scheduledAt?.utc(!0).local().format(hx.visual.MMMDCommaYYYYformat)??cr})]},`${o.nanoid()}_${L}}`)})},L)):cr}),style:{width:"100%"}})})]})]}),J.hasCompanyHealthMetricFormFieldChanged(p?.companyHealthMetric,m?.companyHealthMetricLocalData)===!0||x===!1?o.jsxRuntimeExports.jsx(Rx,{"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:or(nr),primaryBtn:{label:ao.save,style:{minWidth:112},isLoading:m?.saveStatus?.fetchState==="In-Progress"},cancelBtn:{label:ao.cancel,style:{minWidth:112},onClick:G}})}):null]})}const Sx=(e,n)=>({[ht]:{netPromoterScore:{selectedOption:e.netPromoterScore,allOptions:Ri},customerSatisfactionScore:{selectedOption:e.customerSatisfactionScore,allOptions:$i},externalProductServiceExposure:{selectedOption:e.externalProductServiceExposure,allOptions:J.companyHealthMetricDropDownOptions},additionalChurnFactors:{selectedOptions:Yi(e.additionalChurnFactors),allOptions:Gi(n)}}}),yx=s.div``,fx=s.div``,Cx=s.div``,jx=s.div``,bx=s.div``,Rx=s.div``,$x=s.div`
|
|
1501
1501
|
min-width: 100px;
|
|
1502
1502
|
`,Ex=s.div`
|
|
1503
1503
|
min-width: 80px;
|
|
@@ -1551,13 +1551,13 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1551
1551
|
box-shadow: ${e=>`${t.Space.sp0} 2px ${t.Space.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
1552
1552
|
`,Px=s.div`
|
|
1553
1553
|
margin-top: ${t.Space.sp5};
|
|
1554
|
-
`,
|
|
1554
|
+
`,Ix=s(t.ExtraLargeSemiBold)`
|
|
1555
1555
|
color: ${e=>e.theme.colors.primary};
|
|
1556
1556
|
`,pr=s(t.LargeMedium)`
|
|
1557
1557
|
margin-left: ${t.Space.sp2};
|
|
1558
1558
|
margin-bottom: ${t.Space.sp2};
|
|
1559
1559
|
color: ${e=>e.theme.colors.primary};
|
|
1560
|
-
`,
|
|
1560
|
+
`,Lx=s(t.LargeRegular)`
|
|
1561
1561
|
color: inherit;
|
|
1562
1562
|
`,Ax=s(t.SvgAddRound)`
|
|
1563
1563
|
margin-right: ${t.Space.sp1};
|
|
@@ -1903,7 +1903,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1903
1903
|
&:hover {
|
|
1904
1904
|
color: ${e=>e.theme.colors.primary};
|
|
1905
1905
|
}
|
|
1906
|
-
`,jh=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:bh,outOf:Rh,customers:$h}}},common:{headers:{comments:Eh},analytics:vh,strings:{space:wh}},collaboration:{threads:{placeholder:{addANewComment:kh,replyAComment:Th},tooltip:{resolveComment:Ph,unResolveComment:
|
|
1906
|
+
`,jh=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:bh,outOf:Rh,customers:$h}}},common:{headers:{comments:Eh},analytics:vh,strings:{space:wh}},collaboration:{threads:{placeholder:{addANewComment:kh,replyAComment:Th},tooltip:{resolveComment:Ph,unResolveComment:Ih}}}}=t.appLocale.getLocalizedStrings();function Lh({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,[x,g]=u.useState(null),{unfilteredCompanyCount:h}=e,{companies:C}=e,{setOpenThread:b,setRequestToOpenThread:S,requestToOpenThread:y,isLoading:j}=u.useContext(t.ThreadsContext),[f,E]=u.useState(void 0),$=u.useRef([]),A=!(d==="small"||d==="medium-compact"),I=D=>e.companies[D].companyInfo.name.length>Wt?Ae+32:Ae,v=u.useMemo(()=>({makeCompanyNameSticky:A,uiState:m,onColumnSortConfigChanged:i}),[A,m,i]),w=u.useCallback((D,K,M)=>{const G=e.companies.findIndex(R=>R.companyInfo.companyId===D),q=Nt.findIndex(R=>R.key===K);G!==-1&&q!==-1&&($.current[G]==null?$.current[G]=[M]:$.current[G][q]=M)},[e.companies]);u.useEffect(()=>{l.current&&l.current.resetAfterIndex(0)},[e]),u.useEffect(()=>{a!=null&&e.fetchState==="Completed"&&j===!1&&S(a)},[a,e.fetchState,j,S]),u.useEffect(()=>{if(y!=null&&c!=null){const{companyId:D,entityType:K}=y,[M,G]=K.split("."),q=e.companies.findIndex(k=>k.companyInfo.companyId===D),R=Nt.findIndex(k=>k.key===G);q!==-1&&!(c.visibleStartIndex<=q&&c.visibleStopIndex>=q)&&l.current?.scrollToItem(q,"center"),setTimeout(()=>{const k=$.current[q]?.[0]?.getBoundingClientRect().bottom,P=$.current[q]?.[0]?.getBoundingClientRect().top;k!=null&&P!=null&&(window.innerHeight>=k&&window.innerHeight>=P||P<0)&&$.current[q][R]?.scrollIntoView({block:"center",behavior:"auto"})},0);const W=setInterval(()=>{const k=$.current[q]?.[R]?.getBoundingClientRect().left,P=$.current[q]?.[R]?.getBoundingClientRect().right,N=$.current[q]?.[R]?.offsetWidth;if(k!=null&&N!=null&&P!=null&&(k<window.innerWidth-N||P<window.innerWidth)){clearInterval(W);const Q=y.threadId,ae=y.onThreadShownCallback;Q&&(S(null),b(y.threadId),ae?.())}},500);setTimeout(()=>{clearInterval(W),S(null)},2e3)}},[y,c,b,S]);const F=()=>{window.open(n,"_blank")};return o.jsxRuntimeExports.jsxs(Dh,{companyNameSticky:A,"data-testid":t.generateDataTestId("health-monitor-list-view"),children:[A&&o.jsxRuntimeExports.jsxs(Bh,{"data-testid":t.generateDataTestId("health-monitor-list-summary-bar"),children:[o.jsxRuntimeExports.jsxs(Wh,{"data-testid":t.generateDataTestId("health-monitor-list-summary-text"),children:[bh," ",o.jsxRuntimeExports.jsx(Fh,{children:C.length})," ",Rh,wh,h," ",$h]}),o.jsxRuntimeExports.jsx(_h,{"data-testid":t.generateDataTestId("health-monitor-list-analytics-button"),children:o.jsxRuntimeExports.jsx(t.Button,{label:vh,variant:"outline",onClick:F,size:"small",prefixIcon:o.jsxRuntimeExports.jsx(Uh,{})})})]}),o.jsxRuntimeExports.jsx(Mh,{companyNameSticky:A,"data-testid":t.generateDataTestId("health-monitor-list-container"),children:o.jsxRuntimeExports.jsxs(Zi.Provider,{value:v,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:D,width:K})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{innerElementType:Xi,height:D,width:K,ref:l,overscanCount:Bt,itemSize:I,onItemsRendered:M=>p(M),itemData:{healthView:e,makeCompanyNameSticky:A,addThreadRequestThreadId:f,setElementRef:w,setAddThreadRequestThreadId:E,onRowClick:r,setNoteData:g},itemCount:e.companies.length,children:Ah})}),x!=null?o.jsxRuntimeExports.jsx(Vh,{"data-testid":t.generateDataTestId("health-monitor-notes-drawer"),children:o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:x.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${x.companyName} ${Eh}`,filter:{application:"cockpit",companyId:x.companyId,entityType:x.entityType,isGlobalComment:!1,tab:"healthMonitor"},isLoading:!1,threadMetadata:{companyName:x.companyName,companyId:x.companyId,entityId:x.companyId,entityType:x.entityType,isGlobalComment:!1,application:"cockpit",tab:"healthMonitor",url:window.location.href},textOverrides:{composerPlaceholder:kh,replyComposerPlaceholder:Th,threadResolve:Ph,threadUnResolve:Ih},onThreadClick:D=>null,onCloseAllThreadsDrawer:()=>g(null)})})}):null]})})]})}const Zi=u.createContext(void 0),Ah=({index:e,style:n,data:r})=>{const{healthView:i,makeCompanyNameSticky:a,onRowClick:d,addThreadRequestThreadId:l,setElementRef:c,setNoteData:p,setAddThreadRequestThreadId:m}=r,x=i.companies[e],{companyId:g}=x.companyInfo;return o.jsxRuntimeExports.jsx(Oh,{style:{...n,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${t.Space.sp8} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(km,{companyView:i.companies[e],healthView:i,totalHeight:typeof n.height=="number"?n.height:Ae,companyNameSticky:a,addThreadRequestThreadId:l,setNoteData:p,setElementRef:c,setAddThreadRequestThreadId:m,onRowClick:d})},g)},Xi=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,onColumnSortConfigChanged:c}=u.useContext(Zi);return o.jsxRuntimeExports.jsxs(Nh,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(xh,{companyNameSticky:d,onColumnSortConfigChanged:c,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(zh,{children:r})]})});Xi.displayName="Health Monitor view inner element type";const Dh=s.div`
|
|
1907
1907
|
width: 100%;
|
|
1908
1908
|
height: 100%;
|
|
1909
1909
|
background-color: ${e=>e.theme.colors.grey4};
|
|
@@ -1941,7 +1941,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
1941
1941
|
margin-left: ${t.Space.sp1};
|
|
1942
1942
|
cursor: pointer;
|
|
1943
1943
|
stroke: ${e=>e.theme.colors.primary};
|
|
1944
|
-
`,{cockpit:{emptySearchTextFirstLine:Hh,emptySearchTextSecondLine:Kh}}=t.appLocale.getLocalizedStrings(),Gh=({headerActions:e,headerData:n,healthPageData:r,healthPageActions:i,initialOpenThreadRequest:a})=>{const{healthView:d,managementView:l,mixpanelUrl:c}=r,{onColumnSortConfigChanged:p,onRowClick:m,onCockpitReloadData:x,onFiltersChange:g}=i,{filterText:h,filters:C}=d.uiState,b=l.fetchState==="Completed"&&d.fetchState==="Completed"&&d.zeniUsers.fetchState==="Completed";return e.filterActions&&(e.filterActions.getCategoryWiseOptions=()=>Zh(d)),o.jsxRuntimeExports.jsxs(Xh,{"data-testid":t.generateDataTestId("health-monitor-page"),children:[o.jsxRuntimeExports.jsx(dt,{headerActions:{...e},headerData:{...n,allTabOptions:n.allTabOptions??it,selectedTabOption:"healthMonitor",filterData:{filterText:h,filters:C},companiesLoaded:b}}),o.jsxRuntimeExports.jsx(Yh,{healthView:d,initialOpenThreadRequest:a,managementView:l,mixpanelUrl:c,onClearFilter:()=>g({}),onColumnSortConfigChanged:p,onCockpitReloadData:x,onRowClick:m})]})},Yh=({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(Qh,{"data-testid":t.generateDataTestId("health-monitor-page-error"),children:o.jsxRuntimeExports.jsx($t,{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(qh,{"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(Jh,{"data-testid":t.generateDataTestId("health-monitor-page-empty-state"),children:o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:Hh,emptySearchTextSecondLine:Kh,filtersApplied:!0,onClearFilter:a})}):o.jsxRuntimeExports.jsx(eg,{windowSize:p,"data-testid":t.generateDataTestId("health-monitor-page-table-wrapper"),children:o.jsxRuntimeExports.jsx(
|
|
1944
|
+
`,{cockpit:{emptySearchTextFirstLine:Hh,emptySearchTextSecondLine:Kh}}=t.appLocale.getLocalizedStrings(),Gh=({headerActions:e,headerData:n,healthPageData:r,healthPageActions:i,initialOpenThreadRequest:a})=>{const{healthView:d,managementView:l,mixpanelUrl:c}=r,{onColumnSortConfigChanged:p,onRowClick:m,onCockpitReloadData:x,onFiltersChange:g}=i,{filterText:h,filters:C}=d.uiState,b=l.fetchState==="Completed"&&d.fetchState==="Completed"&&d.zeniUsers.fetchState==="Completed";return e.filterActions&&(e.filterActions.getCategoryWiseOptions=()=>Zh(d)),o.jsxRuntimeExports.jsxs(Xh,{"data-testid":t.generateDataTestId("health-monitor-page"),children:[o.jsxRuntimeExports.jsx(dt,{headerActions:{...e},headerData:{...n,allTabOptions:n.allTabOptions??it,selectedTabOption:"healthMonitor",filterData:{filterText:h,filters:C},companiesLoaded:b}}),o.jsxRuntimeExports.jsx(Yh,{healthView:d,initialOpenThreadRequest:a,managementView:l,mixpanelUrl:c,onClearFilter:()=>g({}),onColumnSortConfigChanged:p,onCockpitReloadData:x,onRowClick:m})]})},Yh=({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(Qh,{"data-testid":t.generateDataTestId("health-monitor-page-error"),children:o.jsxRuntimeExports.jsx($t,{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(qh,{"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(Jh,{"data-testid":t.generateDataTestId("health-monitor-page-empty-state"),children:o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:Hh,emptySearchTextSecondLine:Kh,filtersApplied:!0,onClearFilter:a})}):o.jsxRuntimeExports.jsx(eg,{windowSize:p,"data-testid":t.generateDataTestId("health-monitor-page-table-wrapper"),children:o.jsxRuntimeExports.jsx(Lh,{healthView:e,mixpanelUrl:i,onColumnSortConfigChanged:l,onRowClick:c,initialOpenThreadRequest:n})})},Zh=e=>{const n=e.zeniUsers.values,r=bi,{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]:dl};case"runway":return{...a,[d.value]:xl};case"churnProbabilityPercentage":return{...a,[d.value]:pl};case"netPromoterScore":return{...a,[d.value]:ul};case"customerSatisfactionScore":return{...a,[d.value]:ml};case"monthlyRecurringRevenue":return{...a,[d.value]:Ss};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]:[]}}},{})},Xh=s.div`
|
|
1945
1945
|
height: calc(100vh - 45px);
|
|
1946
1946
|
overflow-y: hidden;
|
|
1947
1947
|
background-color: ${e=>e.theme.colors.grey4};
|
|
@@ -2037,7 +2037,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2037
2037
|
display: inline-block;
|
|
2038
2038
|
}
|
|
2039
2039
|
}
|
|
2040
|
-
`,cn={listItemHeightWithoutPadding:t.sp[10],listItemPadding:34,planAndAddonItemHeight:18},Qi=e=>({height:e.subscriptions.reduce((i,a)=>i+(a.addOns?.length??0),0)*cn.planAndAddonItemHeight+cn.listItemPadding,collapsedHeight:Ae}),Ji=e=>({height:e.subscriptions.reduce((i,a)=>i+(a.plan!=null?1:0),0)*cn.planAndAddonItemHeight+cn.listItemPadding,collapsedHeight:Ae}),mg=e=>{const n=Qi(e),r=Ji(e);return n.height>r.height?n:r},fr=(e,n)=>{switch(n){case"plans":{const r=Ji(e);return r.height>r.collapsedHeight}case"addons":{const r=Qi(e);return r.height>r.collapsedHeight}}},xg=t.appLocale.getLocalizedStrings(),{cockpit:{management:{placeholder:hg}},common:{strings:co,due:gg}}=xg,Sg=({companyView:e,allUsers:n,rowIndex:r,companyNameSticky:i,isCollapsed:a,totalHeight:d,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:p,setNoteData:m,setElementRef:x,setAddThreadRequestThreadId:g,onCollapseToggled:h,onCompanyNameClicked:C,onPassportIconClicked:b,onPlanOrAddOnClicked:S,changeHandlers:y})=>{const[j,f]=u.useState(null),E=t.useWindowSizeContext(),$=e.primarySubscription?.subscription,A=e.primarySubscription?.summary,P=e.primarySubscription?.summary.summary.tenantId,{companyId:v,name:w}=e.company.company.companyInfo,F=fg(A?.schema?.recommendedAction??[]),D=Cg(e,n),K=`cockpit_${v}`,M="subscription.notes",{threads:G,isLoading:q}=t.useFilteredThreads({entityType:M,companyId:v},!1),{openThread:R,threads:L,addThread:W,removeThread:k,setOpenThread:I}=u.useContext(t.ThreadsContext),N=R!==null?L.get(R):null,Q=R?.includes(v)===!0,ae=R!=null&&L.get(R)==null&&Q,z=l!=null&&L.get(l)?.metadata.companyId===v,Y={name:e.company.company.companyInfo.name,status:$?.subscription?.subscription?.status??{code:"",name:""},slabUpperLimit:$?.plan?.plan?.slabUpperLimit??{},slabLowerLimit:$?.plan?.plan?.slabLowerLimit??{},avg2MonthExpenses:A?.summary?.avg2MonthExpenses??{},totalDues:A?.summary?.totalDues??{},recommendedActionName:F[A?.summary?.recommendedActionCode??""]??"",recommendedActionCode:A?.summary?.recommendedActionCode??"",monthlyRecurringRevenue:A?.summary?.monthlyRecurringRevenue??{},...yg(e.subscriptions)},T=o.useForm({mode:"all"}),te="companyData",re=(V,ee)=>`${V}.${ee}`,Z=(V,ee)=>{V===`${te}.controller`&&v!=null&&(ee.users=jg(ee,V).users,y(v,ee))};u.useEffect(()=>{const V=T.watch((ee,{name:ge})=>{ge!=null&&ee.companyData!=null&&o.defer(()=>Z(ge,ee.companyData))});return()=>{V.unsubscribe()}});const ie=u.useCallback(()=>{R?.includes(t.NEW_THREAD_SUFFIX)===!0&&k(R),l!=null&&g(void 0)},[l,R,k,g]),ne=V=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:V.isElementThreadOpen??!1,isElementThreadPresent:V.isElementThreadPresent??!1,itemKey:V.itemKey,elementThreadId:V.elementThreadId??"",roomId:K,addThreadRequestThreadId:l,openThreadId:R,threadStyle:V.threadStyle,openThreadMetadata:N?.metadata??null,onElementClick:ye,onAddThreadClick:$e,targetElement:c??j}),xe=u.useCallback(V=>{if(V===R)I(null);else if(L.has(V))I(V);else if(V.includes(t.NEW_THREAD_SUFFIX)){const[ee,ge]=V.replace(t.NEW_THREAD_SUFFIX,"").split("."),ve=_t(Rt(ee),J.toSubscriptionSortKeyType(ge),v,w);W(V,{type:"thread",visibility:"public",id:V,roomId:K,createdAt:new Date,updatedAt:new Date,comments:[],metadata:ve,resolved:!1}),I(V)}},[v,w,R,L,W,I,K]),ye=u.useCallback((V,ee,ge=!1)=>{const ve=jt.find(Ce=>Ce.key===ee);if(p(),ve!=null&&(V.type==="contextmenu"||ge===!0)){if(ve.isThreadAllowed===!1)return;ie(),V.preventDefault(),V.stopPropagation();const Ce=t.toCollaborationEntityType({tab:"subscription",key:ve.key});if(V.target instanceof HTMLElement||V.target instanceof SVGElement)if(ge===!0&&V.target instanceof HTMLElement)f(V.target.parentElement);else if(V.target instanceof HTMLElement){const B=fs(V.target,oe);f(B||V.target)}else{const B=V.target.closest(`.${oe}`);B instanceof HTMLElement&&f(B)}const O=[...t.getFilteredThreads(L,{entityType:Ce,companyId:v},"both")],ke=O.length>0&&O[0].length>0?O[0][0]:Pe("subscription",ve.key,v);L.has(ke)?xe(ke):l===ke?g(void 0):(g(ke),I(null))}},[L,v,l,xe,g,I,p,ie]),$e=u.useCallback((V,ee)=>{V.stopPropagation();const ge=Pe("subscription",ee,v);g(void 0),xe(ge)},[v,g,xe]);return o.jsxRuntimeExports.jsx(o.FormProvider,{...T,children:o.jsxRuntimeExports.jsx("form",{style:{height:"100%"},children:o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{p(),l!=null&&(g(void 0),l.includes(t.NEW_THREAD_SUFFIX)&&k(l))},children:o.jsxRuntimeExports.jsx(Eg,{windowSize:E,isThreadOpen:Q||z,totalHeight:d,isCreationInProgress:ae,children:jt.map((V,ee)=>{const ge=t.toCollaborationEntityType({tab:"subscription",key:V.key}),ve=jt.length-2<=ee,Ce=[...t.getFilteredThreads(L,{entityType:ge,companyId:v},"both")],O=Ce.length>0&&Ce[0].length>0?Ce[0][0]:Pe("subscription",V.key,v),ke=L.get(O),B=ke!=null&&ke.resolved===!1,de=O===R,je=l===O;switch(V.key){case"companyName":return o.jsxRuntimeExports.jsxs(vg,{companyNameSticky:i,columnWidth:V.width,windowSize:E,isThreadOpen:de||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),ref:U=>{x(v,V.key,U)},children:[o.jsxRuntimeExports.jsxs(Rg,{children:[o.jsxRuntimeExports.jsx($g,{onClick:U=>{U.preventDefault(),C(e)},children:Y.name}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:de,targetElement:c??j,roomId:K,openThreadId:R,openThreadMetadata:N?.metadata??null})]}),o.jsxRuntimeExports.jsxs(wg,{children:[o.jsxRuntimeExports.jsxs(Pg,{onClick:U=>{U.preventDefault(),m({roomId:K,companyId:v,companyName:w,entityType:M})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:G.length,isLoading:q}),o.jsxRuntimeExports.jsx(Ig,{})]}),o.jsxRuntimeExports.jsx(kg,{onClick:U=>{U.preventDefault(),b(e)},children:o.jsxRuntimeExports.jsx(Tg,{className:"passportIcon"})})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:B,itemKey:V.key,style:{left:t.Space.sp4},onElementClick:ye}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Pe("subscription",V.key,v),addThreadRequestThreadId:l,itemKey:V.key,onAddThreadClick:$e})]},O);case"status":return o.jsxRuntimeExports.jsxs(ut,{ref:U=>{x(v,V.key,U)},columnWidth:V.width,windowSize:E,isThreadOpen:Q||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),children:[Y.status.code?o.jsxRuntimeExports.jsx(Rr,{textColor:t.getCockpitColor(Y.status.code),children:Y.status.name.toUpperCase()}):co.hyphen,ne({isElementThreadOpen:de,isElementThreadPresent:B,itemKey:V.key,elementThreadId:O,threadStyle:ve?{right:t.Space.sp0}:void 0})]},O);case"controller":return o.jsxRuntimeExports.jsxs(ut,{ref:U=>{x(v,V.key,U)},columnWidth:V.width,windowSize:E,isThreadOpen:Q||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:re(te,"controller"),value:D.controller,placeholderLabel:hg.controller,pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),ne({isElementThreadOpen:de,isElementThreadPresent:B,itemKey:V.key,elementThreadId:O,threadStyle:ve?{right:t.Space.sp0}:void 0})]},O);case"plans":return o.jsxRuntimeExports.jsxs(ut,{ref:U=>{x(v,V.key,U)},columnWidth:V.width,windowSize:E,isThreadOpen:Q||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),children:[o.jsxRuntimeExports.jsx(br,{children:Y.plansWithStatus.length>0?o.jsxRuntimeExports.jsx(yr,{plansAndAddonNames:Y.plansWithStatus,isCollapsed:a,rowIndex:r,onCollapseToggled:h,showCollapseToggle:fr(e,"plans"),companyId:v,tenantId:P,onPlanOrAddOnClicked:S}):co.hyphen}),ne({isElementThreadOpen:de,isElementThreadPresent:B,itemKey:V.key,elementThreadId:O,threadStyle:ve?{right:t.Space.sp0}:void 0})]},O);case"planLowerLimit":return o.jsxRuntimeExports.jsxs(ut,{ref:U=>{x(v,V.key,U)},columnWidth:V.width,windowSize:E,isThreadOpen:Q||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),children:[o.jsxRuntimeExports.jsx(Tn,{widthWrapper:V.width,windowSize:E,textColor:t.getCockpitColor("lowerLimit"),children:t.amountToString("0,0",Y.slabLowerLimit)}),ne({isElementThreadOpen:de,isElementThreadPresent:B,itemKey:V.key,elementThreadId:O,threadStyle:ve?{right:t.Space.sp0}:void 0})]},O);case"planHigherLimit":return o.jsxRuntimeExports.jsxs(ut,{ref:U=>{x(v,V.key,U)},columnWidth:V.width,windowSize:E,isThreadOpen:Q||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),children:[o.jsxRuntimeExports.jsx(Tn,{widthWrapper:V.width,windowSize:E,textColor:t.getCockpitColor("upperLimit"),children:t.amountToString("0,0",Y.slabUpperLimit)}),ne({isElementThreadOpen:de,isElementThreadPresent:B,itemKey:V.key,elementThreadId:O,threadStyle:ve?{right:t.Space.sp0}:void 0})]},O);case"avg2MonthExpenses":return o.jsxRuntimeExports.jsxs(ut,{ref:U=>{x(v,V.key,U)},columnWidth:V.width,windowSize:E,isThreadOpen:Q||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),children:[o.jsxRuntimeExports.jsx(Tn,{widthWrapper:V.width,windowSize:E,textColor:t.getCockpitColor("avg2MonthExpenses"),children:t.amountToString("0,0",Y.avg2MonthExpenses)}),ne({isElementThreadOpen:de,isElementThreadPresent:B,itemKey:V.key,elementThreadId:O,threadStyle:ve?{right:t.Space.sp0}:void 0})]},O);case"addons":return o.jsxRuntimeExports.jsxs(ut,{ref:U=>{x(v,V.key,U)},columnWidth:V.width,windowSize:E,isThreadOpen:Q||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),children:[o.jsxRuntimeExports.jsx(br,{children:Y.addonsWithStatus.length>0?o.jsxRuntimeExports.jsx(yr,{plansAndAddonNames:Y.addonsWithStatus,isCollapsed:a,rowIndex:r,onCollapseToggled:h,showCollapseToggle:fr(e,"addons"),companyId:v,tenantId:P,onPlanOrAddOnClicked:S}):co.hyphen}),ne({isElementThreadOpen:de,isElementThreadPresent:B,itemKey:V.key,elementThreadId:O,threadStyle:ve?{right:t.Space.sp0}:void 0})]},O);case"upgradeStatus":return o.jsxRuntimeExports.jsxs(ut,{ref:U=>{x(v,V.key,U)},columnWidth:V.width,windowSize:E,isThreadOpen:Q||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),children:[o.jsxRuntimeExports.jsx(jr,{children:Y.recommendedActionName?o.jsxRuntimeExports.jsx(Rr,{textColor:t.getCockpitColor(Y.recommendedActionCode),onClick:U=>{U.preventDefault(),P!=null&&Y.recommendedActionCode==="upgrade"&&S(v,P)},code:Y.recommendedActionCode,children:Y.recommendedActionName}):co.hyphen}),ne({isElementThreadOpen:de,isElementThreadPresent:B,itemKey:V.key,elementThreadId:O,threadStyle:ve?{right:t.Space.sp0}:void 0})]},O);case"monthlyRecurringRevenue":return o.jsxRuntimeExports.jsxs(ut,{ref:U=>{x(v,V.key,U)},columnWidth:V.width,windowSize:E,isThreadOpen:Q||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),children:[o.jsxRuntimeExports.jsxs(jr,{children:[o.jsxRuntimeExports.jsx(t.LargeRegular,{children:t.amountToString("0,0",Y.monthlyRecurringRevenue)}),Y.totalDues.amount>0?o.jsxRuntimeExports.jsx(Lg,{children:t.amountToString("0,0",Y.totalDues).concat(co.space).concat(gg)}):null]}),ne({isElementThreadOpen:de,isElementThreadPresent:B,itemKey:V.key,elementThreadId:O,threadStyle:ve?{right:t.Space.sp0}:void 0})]},O);default:return null}})})})})})},yg=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},fg=e=>{const n={};return e.reduce((i,a)=>(i[a.code]=a.name,i),n)};function Cg(e,n){return{controller:{allUsers:n,selectedUsers:e.controllers.map(r=>r.user)}}}function jg(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=Cr(i,l.userId,l.isRoleSelected);c!==void 0&&r.users?.push(c)}}):d.forEach(l=>{const c=Cr(i,l.userId,l.isRoleSelected);c!==void 0&&r.users?.push(c)}),{users:r.users}}function bg(e){return e==="controller"}function Cr(e,n,r){if(bg(e))return{isZeni:!0,role:e,userId:n,isSelected:r}}const Rg=s.div``,$g=s(t.LargeMediumSp)`
|
|
2040
|
+
`,cn={listItemHeightWithoutPadding:t.sp[10],listItemPadding:34,planAndAddonItemHeight:18},Qi=e=>({height:e.subscriptions.reduce((i,a)=>i+(a.addOns?.length??0),0)*cn.planAndAddonItemHeight+cn.listItemPadding,collapsedHeight:Ae}),Ji=e=>({height:e.subscriptions.reduce((i,a)=>i+(a.plan!=null?1:0),0)*cn.planAndAddonItemHeight+cn.listItemPadding,collapsedHeight:Ae}),mg=e=>{const n=Qi(e),r=Ji(e);return n.height>r.height?n:r},fr=(e,n)=>{switch(n){case"plans":{const r=Ji(e);return r.height>r.collapsedHeight}case"addons":{const r=Qi(e);return r.height>r.collapsedHeight}}},xg=t.appLocale.getLocalizedStrings(),{cockpit:{management:{placeholder:hg}},common:{strings:co,due:gg}}=xg,Sg=({companyView:e,allUsers:n,rowIndex:r,companyNameSticky:i,isCollapsed:a,totalHeight:d,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:p,setNoteData:m,setElementRef:x,setAddThreadRequestThreadId:g,onCollapseToggled:h,onCompanyNameClicked:C,onPassportIconClicked:b,onPlanOrAddOnClicked:S,changeHandlers:y})=>{const[j,f]=u.useState(null),E=t.useWindowSizeContext(),$=e.primarySubscription?.subscription,A=e.primarySubscription?.summary,I=e.primarySubscription?.summary.summary.tenantId,{companyId:v,name:w}=e.company.company.companyInfo,F=fg(A?.schema?.recommendedAction??[]),D=Cg(e,n),K=`cockpit_${v}`,M="subscription.notes",{threads:G,isLoading:q}=t.useFilteredThreads({entityType:M,companyId:v},!1),{openThread:R,threads:L,addThread:W,removeThread:k,setOpenThread:P}=u.useContext(t.ThreadsContext),N=R!==null?L.get(R):null,Q=R?.includes(v)===!0,ae=R!=null&&L.get(R)==null&&Q,z=l!=null&&L.get(l)?.metadata.companyId===v,Y={name:e.company.company.companyInfo.name,status:$?.subscription?.subscription?.status??{code:"",name:""},slabUpperLimit:$?.plan?.plan?.slabUpperLimit??{},slabLowerLimit:$?.plan?.plan?.slabLowerLimit??{},avg2MonthExpenses:A?.summary?.avg2MonthExpenses??{},totalDues:A?.summary?.totalDues??{},recommendedActionName:F[A?.summary?.recommendedActionCode??""]??"",recommendedActionCode:A?.summary?.recommendedActionCode??"",monthlyRecurringRevenue:A?.summary?.monthlyRecurringRevenue??{},...yg(e.subscriptions)},T=o.useForm({mode:"all"}),te="companyData",re=(V,ee)=>`${V}.${ee}`,Z=(V,ee)=>{V===`${te}.controller`&&v!=null&&(ee.users=jg(ee,V).users,y(v,ee))};u.useEffect(()=>{const V=T.watch((ee,{name:ge})=>{ge!=null&&ee.companyData!=null&&o.defer(()=>Z(ge,ee.companyData))});return()=>{V.unsubscribe()}});const ie=u.useCallback(()=>{R?.includes(t.NEW_THREAD_SUFFIX)===!0&&k(R),l!=null&&g(void 0)},[l,R,k,g]),ne=V=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:V.isElementThreadOpen??!1,isElementThreadPresent:V.isElementThreadPresent??!1,itemKey:V.itemKey,elementThreadId:V.elementThreadId??"",roomId:K,addThreadRequestThreadId:l,openThreadId:R,threadStyle:V.threadStyle,openThreadMetadata:N?.metadata??null,onElementClick:ye,onAddThreadClick:$e,targetElement:c??j}),xe=u.useCallback(V=>{if(V===R)P(null);else if(L.has(V))P(V);else if(V.includes(t.NEW_THREAD_SUFFIX)){const[ee,ge]=V.replace(t.NEW_THREAD_SUFFIX,"").split("."),ve=_t(Rt(ee),J.toSubscriptionSortKeyType(ge),v,w);W(V,{type:"thread",visibility:"public",id:V,roomId:K,createdAt:new Date,updatedAt:new Date,comments:[],metadata:ve,resolved:!1}),P(V)}},[v,w,R,L,W,P,K]),ye=u.useCallback((V,ee,ge=!1)=>{const ve=jt.find(Ce=>Ce.key===ee);if(p(),ve!=null&&(V.type==="contextmenu"||ge===!0)){if(ve.isThreadAllowed===!1)return;ie(),V.preventDefault(),V.stopPropagation();const Ce=t.toCollaborationEntityType({tab:"subscription",key:ve.key});if(V.target instanceof HTMLElement||V.target instanceof SVGElement)if(ge===!0&&V.target instanceof HTMLElement)f(V.target.parentElement);else if(V.target instanceof HTMLElement){const B=fs(V.target,oe);f(B||V.target)}else{const B=V.target.closest(`.${oe}`);B instanceof HTMLElement&&f(B)}const O=[...t.getFilteredThreads(L,{entityType:Ce,companyId:v},"both")],ke=O.length>0&&O[0].length>0?O[0][0]:Pe("subscription",ve.key,v);L.has(ke)?xe(ke):l===ke?g(void 0):(g(ke),P(null))}},[L,v,l,xe,g,P,p,ie]),$e=u.useCallback((V,ee)=>{V.stopPropagation();const ge=Pe("subscription",ee,v);g(void 0),xe(ge)},[v,g,xe]);return o.jsxRuntimeExports.jsx(o.FormProvider,{...T,children:o.jsxRuntimeExports.jsx("form",{style:{height:"100%"},children:o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{p(),l!=null&&(g(void 0),l.includes(t.NEW_THREAD_SUFFIX)&&k(l))},children:o.jsxRuntimeExports.jsx(Eg,{windowSize:E,isThreadOpen:Q||z,totalHeight:d,isCreationInProgress:ae,children:jt.map((V,ee)=>{const ge=t.toCollaborationEntityType({tab:"subscription",key:V.key}),ve=jt.length-2<=ee,Ce=[...t.getFilteredThreads(L,{entityType:ge,companyId:v},"both")],O=Ce.length>0&&Ce[0].length>0?Ce[0][0]:Pe("subscription",V.key,v),ke=L.get(O),B=ke!=null&&ke.resolved===!1,de=O===R,je=l===O;switch(V.key){case"companyName":return o.jsxRuntimeExports.jsxs(vg,{companyNameSticky:i,columnWidth:V.width,windowSize:E,isThreadOpen:de||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),ref:U=>{x(v,V.key,U)},children:[o.jsxRuntimeExports.jsxs(Rg,{children:[o.jsxRuntimeExports.jsx($g,{onClick:U=>{U.preventDefault(),C(e)},children:Y.name}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:de,targetElement:c??j,roomId:K,openThreadId:R,openThreadMetadata:N?.metadata??null})]}),o.jsxRuntimeExports.jsxs(wg,{children:[o.jsxRuntimeExports.jsxs(Pg,{onClick:U=>{U.preventDefault(),m({roomId:K,companyId:v,companyName:w,entityType:M})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:G.length,isLoading:q}),o.jsxRuntimeExports.jsx(Lg,{})]}),o.jsxRuntimeExports.jsx(kg,{onClick:U=>{U.preventDefault(),b(e)},children:o.jsxRuntimeExports.jsx(Tg,{className:"passportIcon"})})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:B,itemKey:V.key,style:{left:t.Space.sp4},onElementClick:ye}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Pe("subscription",V.key,v),addThreadRequestThreadId:l,itemKey:V.key,onAddThreadClick:$e})]},O);case"status":return o.jsxRuntimeExports.jsxs(ut,{ref:U=>{x(v,V.key,U)},columnWidth:V.width,windowSize:E,isThreadOpen:Q||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),children:[Y.status.code?o.jsxRuntimeExports.jsx(Rr,{textColor:t.getCockpitColor(Y.status.code),children:Y.status.name.toUpperCase()}):co.hyphen,ne({isElementThreadOpen:de,isElementThreadPresent:B,itemKey:V.key,elementThreadId:O,threadStyle:ve?{right:t.Space.sp0}:void 0})]},O);case"controller":return o.jsxRuntimeExports.jsxs(ut,{ref:U=>{x(v,V.key,U)},columnWidth:V.width,windowSize:E,isThreadOpen:Q||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:re(te,"controller"),value:D.controller,placeholderLabel:hg.controller,pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),ne({isElementThreadOpen:de,isElementThreadPresent:B,itemKey:V.key,elementThreadId:O,threadStyle:ve?{right:t.Space.sp0}:void 0})]},O);case"plans":return o.jsxRuntimeExports.jsxs(ut,{ref:U=>{x(v,V.key,U)},columnWidth:V.width,windowSize:E,isThreadOpen:Q||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),children:[o.jsxRuntimeExports.jsx(br,{children:Y.plansWithStatus.length>0?o.jsxRuntimeExports.jsx(yr,{plansAndAddonNames:Y.plansWithStatus,isCollapsed:a,rowIndex:r,onCollapseToggled:h,showCollapseToggle:fr(e,"plans"),companyId:v,tenantId:I,onPlanOrAddOnClicked:S}):co.hyphen}),ne({isElementThreadOpen:de,isElementThreadPresent:B,itemKey:V.key,elementThreadId:O,threadStyle:ve?{right:t.Space.sp0}:void 0})]},O);case"planLowerLimit":return o.jsxRuntimeExports.jsxs(ut,{ref:U=>{x(v,V.key,U)},columnWidth:V.width,windowSize:E,isThreadOpen:Q||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),children:[o.jsxRuntimeExports.jsx(Tn,{widthWrapper:V.width,windowSize:E,textColor:t.getCockpitColor("lowerLimit"),children:t.amountToString("0,0",Y.slabLowerLimit)}),ne({isElementThreadOpen:de,isElementThreadPresent:B,itemKey:V.key,elementThreadId:O,threadStyle:ve?{right:t.Space.sp0}:void 0})]},O);case"planHigherLimit":return o.jsxRuntimeExports.jsxs(ut,{ref:U=>{x(v,V.key,U)},columnWidth:V.width,windowSize:E,isThreadOpen:Q||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),children:[o.jsxRuntimeExports.jsx(Tn,{widthWrapper:V.width,windowSize:E,textColor:t.getCockpitColor("upperLimit"),children:t.amountToString("0,0",Y.slabUpperLimit)}),ne({isElementThreadOpen:de,isElementThreadPresent:B,itemKey:V.key,elementThreadId:O,threadStyle:ve?{right:t.Space.sp0}:void 0})]},O);case"avg2MonthExpenses":return o.jsxRuntimeExports.jsxs(ut,{ref:U=>{x(v,V.key,U)},columnWidth:V.width,windowSize:E,isThreadOpen:Q||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),children:[o.jsxRuntimeExports.jsx(Tn,{widthWrapper:V.width,windowSize:E,textColor:t.getCockpitColor("avg2MonthExpenses"),children:t.amountToString("0,0",Y.avg2MonthExpenses)}),ne({isElementThreadOpen:de,isElementThreadPresent:B,itemKey:V.key,elementThreadId:O,threadStyle:ve?{right:t.Space.sp0}:void 0})]},O);case"addons":return o.jsxRuntimeExports.jsxs(ut,{ref:U=>{x(v,V.key,U)},columnWidth:V.width,windowSize:E,isThreadOpen:Q||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),children:[o.jsxRuntimeExports.jsx(br,{children:Y.addonsWithStatus.length>0?o.jsxRuntimeExports.jsx(yr,{plansAndAddonNames:Y.addonsWithStatus,isCollapsed:a,rowIndex:r,onCollapseToggled:h,showCollapseToggle:fr(e,"addons"),companyId:v,tenantId:I,onPlanOrAddOnClicked:S}):co.hyphen}),ne({isElementThreadOpen:de,isElementThreadPresent:B,itemKey:V.key,elementThreadId:O,threadStyle:ve?{right:t.Space.sp0}:void 0})]},O);case"upgradeStatus":return o.jsxRuntimeExports.jsxs(ut,{ref:U=>{x(v,V.key,U)},columnWidth:V.width,windowSize:E,isThreadOpen:Q||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),children:[o.jsxRuntimeExports.jsx(jr,{children:Y.recommendedActionName?o.jsxRuntimeExports.jsx(Rr,{textColor:t.getCockpitColor(Y.recommendedActionCode),onClick:U=>{U.preventDefault(),I!=null&&Y.recommendedActionCode==="upgrade"&&S(v,I)},code:Y.recommendedActionCode,children:Y.recommendedActionName}):co.hyphen}),ne({isElementThreadOpen:de,isElementThreadPresent:B,itemKey:V.key,elementThreadId:O,threadStyle:ve?{right:t.Space.sp0}:void 0})]},O);case"monthlyRecurringRevenue":return o.jsxRuntimeExports.jsxs(ut,{ref:U=>{x(v,V.key,U)},columnWidth:V.width,windowSize:E,isThreadOpen:Q||je,isThreadAllowed:V.isThreadAllowed,className:oe,onContextMenu:U=>ye(U,V.key),children:[o.jsxRuntimeExports.jsxs(jr,{children:[o.jsxRuntimeExports.jsx(t.LargeRegular,{children:t.amountToString("0,0",Y.monthlyRecurringRevenue)}),Y.totalDues.amount>0?o.jsxRuntimeExports.jsx(Ig,{children:t.amountToString("0,0",Y.totalDues).concat(co.space).concat(gg)}):null]}),ne({isElementThreadOpen:de,isElementThreadPresent:B,itemKey:V.key,elementThreadId:O,threadStyle:ve?{right:t.Space.sp0}:void 0})]},O);default:return null}})})})})})},yg=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},fg=e=>{const n={};return e.reduce((i,a)=>(i[a.code]=a.name,i),n)};function Cg(e,n){return{controller:{allUsers:n,selectedUsers:e.controllers.map(r=>r.user)}}}function jg(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=Cr(i,l.userId,l.isRoleSelected);c!==void 0&&r.users?.push(c)}}):d.forEach(l=>{const c=Cr(i,l.userId,l.isRoleSelected);c!==void 0&&r.users?.push(c)}),{users:r.users}}function bg(e){return e==="controller"}function Cr(e,n,r){if(bg(e))return{isZeni:!0,role:e,userId:n,isSelected:r}}const Rg=s.div``,$g=s(t.LargeMediumSp)`
|
|
2041
2041
|
word-break: break-word;
|
|
2042
2042
|
margin-right: 10px;
|
|
2043
2043
|
cursor: pointer;
|
|
@@ -2145,7 +2145,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2145
2145
|
&:hover {
|
|
2146
2146
|
color: ${e=>e.theme.colors.primary};
|
|
2147
2147
|
}
|
|
2148
|
-
`,
|
|
2148
|
+
`,Ig=s(t.SmallRegular)`
|
|
2149
2149
|
color: ${t.Colors.important};
|
|
2150
2150
|
`,Tn=s(t.LargeRegular)`
|
|
2151
2151
|
width: ${e=>e.widthWrapper.valuePx(e.windowSize)};
|
|
@@ -2158,7 +2158,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2158
2158
|
border-radius: ${t.Space.sp1};
|
|
2159
2159
|
width: fit-content;
|
|
2160
2160
|
cursor: ${e=>e.code==="upgrade"?"pointer":"unset"};
|
|
2161
|
-
`,
|
|
2161
|
+
`,Lg=s(Vt)`
|
|
2162
2162
|
display: flex;
|
|
2163
2163
|
width: ${t.Space.sp4};
|
|
2164
2164
|
height: ${t.Space.sp4};
|
|
@@ -2173,7 +2173,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2173
2173
|
z-index: auto;
|
|
2174
2174
|
cursor: ${e=>e.isThreadAllowed?"pointer":"initial"};
|
|
2175
2175
|
position: relative;
|
|
2176
|
-
`,Ag=({companyNameSticky:e,totalMRRAmount:n})=>{const r=t.useWindowSizeContext(),i=jt;return o.jsxRuntimeExports.jsxs(Dg,{className:"totalMRR",children:[o.jsxRuntimeExports.jsx(Og,{companyNameSticky:e,width:i[0].width,windowSize:r}),o.jsxRuntimeExports.jsx(Pn,{width:i[1].width,windowSize:r}),o.jsxRuntimeExports.jsx($r,{width:i[2].width,windowSize:r}),o.jsxRuntimeExports.jsx(Ng,{width:i[3].width,windowSize:r}),o.jsxRuntimeExports.jsx(
|
|
2176
|
+
`,Ag=({companyNameSticky:e,totalMRRAmount:n})=>{const r=t.useWindowSizeContext(),i=jt;return o.jsxRuntimeExports.jsxs(Dg,{className:"totalMRR",children:[o.jsxRuntimeExports.jsx(Og,{companyNameSticky:e,width:i[0].width,windowSize:r}),o.jsxRuntimeExports.jsx(Pn,{width:i[1].width,windowSize:r}),o.jsxRuntimeExports.jsx($r,{width:i[2].width,windowSize:r}),o.jsxRuntimeExports.jsx(Ng,{width:i[3].width,windowSize:r}),o.jsxRuntimeExports.jsx(In,{width:i[4].width,textColor:t.getCockpitColor("lowerLimit"),windowSize:r}),o.jsxRuntimeExports.jsx(In,{width:i[5].width,textColor:t.getCockpitColor("upperLimit"),windowSize:r}),o.jsxRuntimeExports.jsx(In,{width:i[6].width,textColor:t.getCockpitColor("avg2MonthExpenses"),windowSize:r}),o.jsxRuntimeExports.jsx($r,{width:i[7].width,windowSize:r}),o.jsxRuntimeExports.jsx(Pn,{width:i[8].width,windowSize:r}),o.jsxRuntimeExports.jsx(Pn,{width:i[9].width,windowSize:r,children:o.jsxRuntimeExports.jsx(t.LargeMedium,{children:n})})]})},Dg=s.div`
|
|
2177
2177
|
display: flex;
|
|
2178
2178
|
padding: 9px ${t.Space.sp4} 9px ${t.Space.sp0};
|
|
2179
2179
|
align-items: center;
|
|
@@ -2207,10 +2207,10 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2207
2207
|
width: ${e=>e.width.valuePx(e.windowSize)};
|
|
2208
2208
|
display: flex;
|
|
2209
2209
|
justify-content: center;
|
|
2210
|
-
`,
|
|
2210
|
+
`,In=s.div`
|
|
2211
2211
|
width: ${e=>e.width.valuePx(e.windowSize)};
|
|
2212
2212
|
color: ${e=>e.textColor.color.toString()};
|
|
2213
|
-
`,Mg={subscriptionRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{common:{headers:{comments:zg}},collaboration:{threads:{placeholder:{addANewComment:Fg,replyAComment:Bg},tooltip:{resolveComment:Wg,unResolveComment:_g}}}}=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(),x=u.useRef(null),[g,h]=u.useState(null),C=u.useRef(null),[b,S]=u.useState(null),y=!(m==="small"||m==="medium-compact");u.useEffect(()=>{x.current&&x.current.resetAfterIndex(0)},[e.uiState.isCollapsedByCompanyId,e.uiState.sortKey,e.uiState.sortOrder,e.companies.length]);const{uiState:j,totalMonthlyRecurringRevenue:f}=e,E=j.scrollYOffset??0,$=u.useCallback(L=>{const W=e.companies[L].company.company.companyInfo.companyId;r(W,!e.uiState.isCollapsedByCompanyId[W])},[r,e.companies,e.uiState.isCollapsedByCompanyId]),A=u.useCallback(L=>{const W=e.companies[L].company.company.companyInfo.name.length,k=e.companies[L].company.company.companyInfo.companyId,
|
|
2213
|
+
`,Mg={subscriptionRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{common:{headers:{comments:zg}},collaboration:{threads:{placeholder:{addANewComment:Fg,replyAComment:Bg},tooltip:{resolveComment:Wg,unResolveComment:_g}}}}=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(),x=u.useRef(null),[g,h]=u.useState(null),C=u.useRef(null),[b,S]=u.useState(null),y=!(m==="small"||m==="medium-compact");u.useEffect(()=>{x.current&&x.current.resetAfterIndex(0)},[e.uiState.isCollapsedByCompanyId,e.uiState.sortKey,e.uiState.sortOrder,e.companies.length]);const{uiState:j,totalMonthlyRecurringRevenue:f}=e,E=j.scrollYOffset??0,$=u.useCallback(L=>{const W=e.companies[L].company.company.companyInfo.companyId;r(W,!e.uiState.isCollapsedByCompanyId[W])},[r,e.companies,e.uiState.isCollapsedByCompanyId]),A=u.useCallback(L=>{const W=e.companies[L].company.company.companyInfo.name.length,k=e.companies[L].company.company.companyInfo.companyId,P=mg(e.companies[L]);return e.uiState.isCollapsedByCompanyId[k]?P.height:W>Wt?Ae+32:Ae},[e.companies,e.uiState.isCollapsedByCompanyId]),{setOpenThread:I,setRequestToOpenThread:v,requestToOpenThread:w,isLoading:F}=u.useContext(t.ThreadsContext);u.useEffect(()=>{p!=null&&e.fetchState==="Completed"&&F===!1&&v(p)},[p,e.fetchState,F,v]);const[D,K]=u.useState(void 0),M=u.useRef([]),G=u.useMemo(()=>({makeCompanyNameSticky:y,uiState:j,totalMonthlyRecurringRevenue:f,onColumnSortConfigChanged:n}),[y,j,f,n]),q=u.useCallback((L,W,k)=>{const P=e.companies.findIndex(Q=>Q.company.company.companyInfo.companyId===L),N=jt.findIndex(Q=>Q.key===W);P!==-1&&N!==-1&&(M.current[P]==null?M.current[P]=[k]:M.current[P][N]=k)},[e.companies]),R=u.useCallback(()=>{C.current=null,v(null)},[v]);return u.useEffect(()=>{if(w!=null&&g!=null){const{companyId:L,entityType:W}=w,[k,P]=W.split("."),N=e.companies.findIndex(Y=>Y.company.company.companyInfo.companyId===L),Q=jt.findIndex(Y=>Y.key===P);N!==-1&&!(g.visibleStartIndex<=N&&g.visibleStopIndex>=N)&&x.current?.scrollToItem(N,"center"),setTimeout(()=>{const Y=M.current[N]?.[0]?.getBoundingClientRect().bottom,T=M.current[N]?.[0]?.getBoundingClientRect().top;if(Y!=null&&T!=null&&(window.innerHeight>=Y&&window.innerHeight>=T||T<0)){const te=M.current[N][Q];te!=null&&(C.current={companyId:L,target:te}),M.current[N][Q]?.scrollIntoView({block:"center",behavior:"auto"})}},0);const z=setInterval(()=>{const Y=M.current[N]?.[Q]?.getBoundingClientRect().left,T=M.current[N]?.[Q]?.getBoundingClientRect().right,te=M.current[N]?.[Q]?.offsetWidth;if(C.current?.companyId===L&&Y!=null&&te!=null&&T!=null&&(Y<window.innerWidth-te||T<window.innerWidth)){clearInterval(z);const re=w.threadId,Z=w.onThreadShownCallback;re&&(v(null),I(w.threadId),Z?.())}},500);setTimeout(()=>{clearInterval(z),v(null)},2e3)}},[w,g,I,v]),o.jsxRuntimeExports.jsx(Hg,{children:o.jsxRuntimeExports.jsxs(ea.Provider,{value:G,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:L,width:W})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:L,innerElementType:ta,itemCount:e.companies.length,itemSize:A,onItemsRendered:k=>h(k),itemData:{subscriptionView:e,makeCompanyNameSticky:y,addThreadRequestThreadId:D,targetElement:C.current?.target,resetTargetElementFromNavigation:R,setElementRef:q,setAddThreadRequestThreadId:K,onCompanyNameClicked:i,onPassportIconClicked:a,changeHandlers:c,setNoteData:S,onCollapseToggledHandler:$,onPlanOrAddOnClicked:d},width:W,overscanCount:Bt,ref:x,onScroll:({scrollOffset:k})=>{l(k)},initialScrollOffset:E,children:Ug})}),b!=null?o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:b.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${b.companyName} ${zg}`,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:Fg,replyComposerPlaceholder:Bg,threadResolve:Wg,threadUnResolve:_g},onThreadClick:L=>null,onCloseAllThreadsDrawer:()=>S(null)})}):null]})})},ea=u.createContext(void 0),ta=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,totalMonthlyRecurringRevenue:c,onColumnSortConfigChanged:p}=u.useContext(ea);return o.jsxRuntimeExports.jsxs(Kg,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(og,{companyNameSticky:d,onColumnSortConfigChanged:p,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(Yg,{children:r}),o.jsxRuntimeExports.jsx(Ag,{companyNameSticky:d,totalMRRAmount:t.amountToString("0,0",c)})]})});ta.displayName="Subscription list view inner element type";const Ug=({index:e,data:n,style:r})=>{const i=t.useWindowSizeContext(),{setNoteData:a,subscriptionView:d,makeCompanyNameSticky:l,addThreadRequestThreadId:c,targetElement:p,resetTargetElementFromNavigation:m,setElementRef:x,changeHandlers:g,onCompanyNameClicked:h,onPassportIconClicked:C,onPlanOrAddOnClicked:b,setAddThreadRequestThreadId:S,onCollapseToggledHandler:y}=n,j=d.companies[e],{companyId:f}=j.company.company.companyInfo,E=d.uiState.isCollapsedByCompanyId[f]===!0;return o.jsxRuntimeExports.jsx(Gg,{isCollapsed:E,style:{...r,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${Mg.subscriptionRightPadding.valuePx(i)} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(Sg,{companyView:d.companies[e],allUsers:d.zeniUsers.values,rowIndex:e,companyNameSticky:l,isCollapsed:E,onCollapseToggled:y,onCompanyNameClicked:h,onPassportIconClicked:C,onPlanOrAddOnClicked:b,changeHandlers:g,addThreadRequestThreadId:c,targetElementFromNavigation:p,resetTargetElementFromNavigation:m,setNoteData:a,setElementRef:x,setAddThreadRequestThreadId:S,totalHeight:typeof r.height=="number"?r.height:Ae})},f)},Hg=s.div`
|
|
2214
2214
|
/** Subtract top so list can occupy remaining available height */
|
|
2215
2215
|
height: calc(100vh - 110px);
|
|
2216
2216
|
max-width: 99.9%;
|
|
@@ -2241,7 +2241,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2241
2241
|
height: calc(100vh - 45px);
|
|
2242
2242
|
overflow-y: hidden;
|
|
2243
2243
|
background-color: ${e=>e.theme.colors.grey4};
|
|
2244
|
-
`,o1=({headerData:e,headerActions:n,initialOpenThreadRequest:r,subscriptionPageActions:i,subscriptionPageData:a})=>{const{subscriptionView:d}=a,{onColumnSortConfigChanged:l,changeHandlers:c,onScroll:p,onCompanyNameClicked:m,onPassportIconClicked:x,onCockpitReloadData:g,onPlanOrAddOnClicked:h,onCollapseToggled:C,onFiltersChange:b}=i,S=d.uiState.filterText,y=d.uiState.filters,j=d.fetchState==="Completed"&&d.zeniUsers.fetchState==="Completed";return n.filterActions&&(n.filterActions.getCategoryWiseOptions=()=>s1(d)),o.jsxRuntimeExports.jsxs(t1,{children:[o.jsxRuntimeExports.jsx(dt,{headerActions:{...n},headerData:{...e,filterData:{filters:y,filterText:S},companiesLoaded:j,allTabOptions:e.allTabOptions??it,selectedTabOption:"subscription"}}),o.jsxRuntimeExports.jsx(n1,{initialOpenThreadRequest:r,isFilterApplied:y?.categories!=null,subscriptionView:d,changeHandlers:c,onClearFilter:()=>b("subscription",{}),onCockpitReloadData:g,onCollapseToggled:C,onColumnSortConfigChanged:l,onCompanyNameClicked:m,onPassportIconClicked:x,onPlanOrAddOnClicked:h,onScroll:p})]})},n1=({subscriptionView:e,isFilterApplied:n,initialOpenThreadRequest:r,onColumnSortConfigChanged:i,onCollapseToggled:a,onCockpitReloadData:d,changeHandlers:l,onScroll:c,onPlanOrAddOnClicked:p,onCompanyNameClicked:m,onPassportIconClicked:x,onClearFilter:g})=>{const h=t.useWindowSizeContext();return e.fetchState==="Error"?o.jsxRuntimeExports.jsx($t,{onCockpitReloadData:d,selectedCockpitOption:"subscription"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(Jg,{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:g}):o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextFirstLine,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine}):o.jsxRuntimeExports.jsx(e1,{windowSize:h,children:o.jsxRuntimeExports.jsx(Qg,{initialOpenThreadRequest:r,subscriptionView:e,changeHandlers:l,onCollapseToggled:a,onColumnSortConfigChanged:i,onCompanyNameClicked:m,onPassportIconClicked:x,onPlanOrAddOnClicked:p,onScroll:c})})},s1=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]:Ss};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]:nl};case"slabLowerLimit":case"slabUpperLimit":return{...a,[d.value]:sl};default:return{...a,[d.value]:[]}}},{})},r1={width:new t.ResponsiveSized(343,580,756)};function i1({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),x=m?`${c.nextRenewal} (${m})`:c.nextRenewal;let g=e?.applyEndOfTerm===!0?"readonly":i;return r===!1&&(g="disabled"),o.jsxRuntimeExports.jsxs(a1,{style:d,children:[o.jsxRuntimeExports.jsx(l1,{children:c.title}),o.jsxRuntimeExports.jsxs(d1,{children:[o.jsxRuntimeExports.jsx(t.LabeledRadioField,{isDisabled:i,label:{label:x},style:{padding:`${t.Space.sp3} ${t.Space.sp0}`},radioField:{name:
|
|
2244
|
+
`,o1=({headerData:e,headerActions:n,initialOpenThreadRequest:r,subscriptionPageActions:i,subscriptionPageData:a})=>{const{subscriptionView:d}=a,{onColumnSortConfigChanged:l,changeHandlers:c,onScroll:p,onCompanyNameClicked:m,onPassportIconClicked:x,onCockpitReloadData:g,onPlanOrAddOnClicked:h,onCollapseToggled:C,onFiltersChange:b}=i,S=d.uiState.filterText,y=d.uiState.filters,j=d.fetchState==="Completed"&&d.zeniUsers.fetchState==="Completed";return n.filterActions&&(n.filterActions.getCategoryWiseOptions=()=>s1(d)),o.jsxRuntimeExports.jsxs(t1,{children:[o.jsxRuntimeExports.jsx(dt,{headerActions:{...n},headerData:{...e,filterData:{filters:y,filterText:S},companiesLoaded:j,allTabOptions:e.allTabOptions??it,selectedTabOption:"subscription"}}),o.jsxRuntimeExports.jsx(n1,{initialOpenThreadRequest:r,isFilterApplied:y?.categories!=null,subscriptionView:d,changeHandlers:c,onClearFilter:()=>b("subscription",{}),onCockpitReloadData:g,onCollapseToggled:C,onColumnSortConfigChanged:l,onCompanyNameClicked:m,onPassportIconClicked:x,onPlanOrAddOnClicked:h,onScroll:p})]})},n1=({subscriptionView:e,isFilterApplied:n,initialOpenThreadRequest:r,onColumnSortConfigChanged:i,onCollapseToggled:a,onCockpitReloadData:d,changeHandlers:l,onScroll:c,onPlanOrAddOnClicked:p,onCompanyNameClicked:m,onPassportIconClicked:x,onClearFilter:g})=>{const h=t.useWindowSizeContext();return e.fetchState==="Error"?o.jsxRuntimeExports.jsx($t,{onCockpitReloadData:d,selectedCockpitOption:"subscription"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(Jg,{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:g}):o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextFirstLine,emptySearchTextSecondLine:t.appLocale.getLocalizedStrings().cockpit.emptySearchTextSecondLine}):o.jsxRuntimeExports.jsx(e1,{windowSize:h,children:o.jsxRuntimeExports.jsx(Qg,{initialOpenThreadRequest:r,subscriptionView:e,changeHandlers:l,onCollapseToggled:a,onColumnSortConfigChanged:i,onCompanyNameClicked:m,onPassportIconClicked:x,onPlanOrAddOnClicked:p,onScroll:c})})},s1=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]:Ss};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]:nl};case"slabLowerLimit":case"slabUpperLimit":return{...a,[d.value]:sl};default:return{...a,[d.value]:[]}}},{})},r1={width:new t.ResponsiveSized(343,580,756)};function i1({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),x=m?`${c.nextRenewal} (${m})`:c.nextRenewal;let g=e?.applyEndOfTerm===!0?"readonly":i;return r===!1&&(g="disabled"),o.jsxRuntimeExports.jsxs(a1,{style:d,children:[o.jsxRuntimeExports.jsx(l1,{children:c.title}),o.jsxRuntimeExports.jsxs(d1,{children:[o.jsxRuntimeExports.jsx(t.LabeledRadioField,{isDisabled:i,label:{label:x},style:{padding:`${t.Space.sp3} ${t.Space.sp0}`},radioField:{name:Ln(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:Ln(a,"changeType"),id:"applyImmediately",value:"applyImmediately"}}),o.jsxRuntimeExports.jsx(t.LabeledUnSafeCheckBoxField,{isDisabled:g,label:{label:c.applyProRated},checkBoxField:{name:Ln(a,"shouldProrate"),defaultChecked:e?.shouldProrate===!0,style:{paddingLeft:t.Space.sp4}}}),o.jsxRuntimeExports.jsxs(c1,{size:l,isDisabled:r===!1?"disabled":i,children:[o.jsxRuntimeExports.jsx(An,{children:c.proRatedDescription}),o.jsxRuntimeExports.jsx(An,{children:c.proRatedText1}),o.jsxRuntimeExports.jsx(An,{children:c.proRatedText2})]})]})]})}const Ln=(e,n)=>`${e}.${n}`,a1=s.div`
|
|
2245
2245
|
display: flex;
|
|
2246
2246
|
flex-direction: column;
|
|
2247
2247
|
`,l1=s(t.ExtraLargeMedium)`
|
|
@@ -2263,7 +2263,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2263
2263
|
`,d1=s.div`
|
|
2264
2264
|
display: flex;
|
|
2265
2265
|
flex-direction: column;
|
|
2266
|
-
`,p1=t.appLocale.getLocalizedStrings().common,oa={infoLabel:new t.ResponsiveSizedStyle("smallRegular","standardRegular"),selectFieldInput:new t.ResponsiveSizedStyle("standardRegular","largeRegular")},u1=({name:e,registerOptions:n,defaultValue:r,isDisabled:i,style:a,placeholder:d,valueToInfo:l,valueToId:c,showEmptyState:p,additionalLabelInfo:m,customStyleConfig:x,showDownChevronWithValue:g,customPlaceholderString:h,allowEmpty:C=!0,tooltip:b,menuPortal:S,disableCurrentOption:y})=>{const{control:j,formState:{errors:f,dirtyFields:E}}=o.useFormContext(),$=t.useWindowSizeContext(),A=o.useTheme(),[
|
|
2266
|
+
`,p1=t.appLocale.getLocalizedStrings().common,oa={infoLabel:new t.ResponsiveSizedStyle("smallRegular","standardRegular"),selectFieldInput:new t.ResponsiveSizedStyle("standardRegular","largeRegular")},u1=({name:e,registerOptions:n,defaultValue:r,isDisabled:i,style:a,placeholder:d,valueToInfo:l,valueToId:c,showEmptyState:p,additionalLabelInfo:m,customStyleConfig:x,showDownChevronWithValue:g,customPlaceholderString:h,allowEmpty:C=!0,tooltip:b,menuPortal:S,disableCurrentOption:y})=>{const{control:j,formState:{errors:f,dirtyFields:E}}=o.useFormContext(),$=t.useWindowSizeContext(),A=o.useTheme(),[I,v]=u.useState(!1),w=o.has(E,e),F=o.has(f,e??""),D=u.useCallback(R=>({value:R.value,label:R.label,info:l?.(R.value)??"",id:c?.(R.value)??null,isDisabled:R.isDisabled,additionalNote:R?.additionalNote,isOptionRecommended:R.isOptionRecommended}),[l,c]),K=R=>R.map(L=>({label:L.label,options:L.options.map(W=>D(W))})),M=R=>{if(R==null||!R)return;let L=[];return r.allOptions.forEach(W=>{L=L.concat(W.options)}),{value:R,label:L.find(W=>W.value===R)?.label??R,info:l?.(R)??""}};if(p===!0&&I===!1&&w===!1&&!r.selectedOption&&i==null)return o.jsxRuntimeExports.jsx(t.ItemWithButton,{style:a,buttonTitle:p1.add,onClick:()=>v(!0),name:e});const G={...x,container:R=>({...R,width:"100%",...a}),menu:(R,L)=>({...R,backgroundColor:A.colors.grey5,borderRadius:"6px",whiteSpace:"nowrap",zIndex:2,width:"100%",margin:0,...x?.menu?.(R,L)}),menuList:(R,L)=>({...R,borderRadius:"6px",...x?.menuList?.(R,L)}),group:R=>({...R,borderBottom:`1px solid ${A.colors.grey3}`,paddingBottom:0}),control:(R,L)=>({...R,borderRadius:"6px",...x?.control?.(R,L)})},q={hasError:F,showDownChevronWithValue:g,customPlaceholderString:h};return o.jsxRuntimeExports.jsx(o.Controller,{name:e,control:j,defaultValue:r,rules:n,render:({field:{onChange:R,onBlur:L,value:W,ref:k}})=>{const P=W;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[u.createElement(o.StateManagedSelect$1,{...q,ref:k,isMulti:!1,isSearchable:!0,isClearable:!0,controlShouldRenderValue:!0,placeholder:d,value:M(P.selectedOption),options:K(P.allOptions),onChange:N=>{N==null||N?.value!=null&&P?.selectedOption===N.value?C===!0&&R({selectedOption:void 0,allOptions:P.allOptions}):R({selectedOption:N.value,allOptions:P.allOptions})},key:o.nanoid(),tabSelectsValue:!1,openMenuOnFocus:!0,classNamePrefix:"grouped-single-select-field",onBlur:L,menuPlacement:"auto",menuPortalTarget:S,maxMenuHeight:288,menuShouldScrollIntoView:!0,closeMenuOnSelect:!0,components:{Control:m1,Option:C1,Input:h1,Group:g1,GroupHeading:S1,SingleValue:N=>y1(N,b),ValueContainer:x1,DropdownIndicator:_1,IndicatorSeparator:V1,Placeholder:f1,ClearIndicator:U1},hideSelectedOptions:!1,styles:G,isDisabled:i!=null,isOptionDisabled:N=>y?.(N.value)??!1}),o.jsxRuntimeExports.jsx(A1,{size:$,children:m})]})}})},m1=e=>{const{menuIsOpen:n,isFocused:r,isDisabled:i,selectProps:a,data:d,options:l}=e,{value:c,hasError:p,customPlaceholderString:m}=a;let x=[];l.forEach(C=>{x=x.concat(C.options)});const g=x.find(C=>C.value===d?.value),h=t.useWindowSizeContext();return o.jsxRuntimeExports.jsx(E1,{title:m!=null&&c!=null?c.label:void 0,windowSize:h,menuIsOpen:n,isFocused:r,isDisabled:i,selectedValue:c,hasError:p,customPlaceholderString:m,isRecommended:g?.isOptionRecommended,children:o.jsxRuntimeExports.jsx(o.components.Control,{...e,className:"select-control",children:e.children})})},x1=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(v1,{})}):null]})},h1=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(Y1,{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(H1,{children:[o.jsxRuntimeExports.jsx(K1,{hasError:m}),o.jsxRuntimeExports.jsx(G1,{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})},g1=e=>o.jsxRuntimeExports.jsx(o.components.Group,{...e,children:e.children}),S1=e=>{const[n,r]=u.useState(!0);return o.jsxRuntimeExports.jsx(D1,{className:"group-heading-container",isGroupOpen:n,onClick:()=>r(!n),children:o.jsxRuntimeExports.jsxs(o.components.GroupHeading,{...e,children:[o.jsxRuntimeExports.jsx(O1,{isGroupOpen:n,children:o.jsxRuntimeExports.jsx(N1,{className:"close-tick-icon"})}),e.children]})})},y1=({children:e,...n},r)=>{const i=r==null||n.selectProps.menuIsOpen===!0?e:r.sticky===!0?o.jsxRuntimeExports.jsx(j1,{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})},f1=()=>null,C1=e=>{const{data:n,isSelected:r,options:i,isDisabled:a,isFocused:d,selectProps:l}=e,{customPlaceholderString:c}=l;let p=[];i.forEach(x=>{p=p.concat(x.options)});const m=p.find(x=>x.value===n.value);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(w1,{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(k1,{children:[o.jsxRuntimeExports.jsxs(L1,{isSelected:r,children:[o.jsxRuntimeExports.jsx(T1,{isSelected:r,isDisabled:a,children:e.label}),d===!0&&m?.id!=null&&o.jsxRuntimeExports.jsx(W1,{children:m.id}),d===!0&&m?.info?o.jsxRuntimeExports.jsx(I1,{isSelected:!!r,children:m?.info}):null]}),m?.isOptionRecommended===!0?o.jsxRuntimeExports.jsx(B1,{}):null,r&&m?.additionalNote==null?o.jsxRuntimeExports.jsxs(M1,{children:[o.jsxRuntimeExports.jsx(z1,{className:"right-tick-icon"}),o.jsxRuntimeExports.jsx(F1,{className:"close-tick-icon"})]}):null]})})}),m?.isOptionRecommended===!0&&m.additionalNote!=null?o.jsxRuntimeExports.jsx(P1,{isSelected:r,isDisabled:a,children:m?.additionalNote}):null]})},j1=({children:e,title:n})=>o.jsxRuntimeExports.jsxs(b1,{children:[o.jsxRuntimeExports.jsxs(R1,{children:[n,o.jsxRuntimeExports.jsx($1,{})]}),e]}),b1=s.div`
|
|
2267
2267
|
position: relative;
|
|
2268
2268
|
display: contents;
|
|
2269
2269
|
`,R1=s.div`
|
|
@@ -2409,7 +2409,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2409
2409
|
color: ${e=>e.theme.colors.grey1};
|
|
2410
2410
|
padding: 9px ${t.Space.sp3};
|
|
2411
2411
|
border-bottom: 1px solid ${e=>e.theme.colors.grey3};
|
|
2412
|
-
`,
|
|
2412
|
+
`,I1=s.div`
|
|
2413
2413
|
display: flex;
|
|
2414
2414
|
color: ${e=>e.theme.colors.primary};
|
|
2415
2415
|
align-items: center;
|
|
@@ -2417,7 +2417,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2417
2417
|
justify-content: flex-end;
|
|
2418
2418
|
margin: 0 ${t.Space.sp3};
|
|
2419
2419
|
margin-right: ${e=>e.isSelected?t.Space.sp3:t.Space.sp5};
|
|
2420
|
-
`,
|
|
2420
|
+
`,L1=s.div`
|
|
2421
2421
|
width: ${e=>e.isSelected?`calc(100% - ${t.Space.sp3})`:"100%"};
|
|
2422
2422
|
display: flex;
|
|
2423
2423
|
align-items: center;
|
|
@@ -2626,7 +2626,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2626
2626
|
background-color: ${e=>e.theme.colors.grey3};
|
|
2627
2627
|
min-height: 1px;
|
|
2628
2628
|
max-height: 1px;
|
|
2629
|
-
`,to=(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},dn=(e,n)=>e==null?void 0:`${(t.amountToString("0,0.00",e)+" "+cS(n)).trim()}`,cS=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}`},dS=t.appLocale.getLocalizedStrings().common,vr="subscriptionUpdatePlanPage",pn="updatePlan",Dt="applyChanges";function pS(e){const n=t.useWindowSizeContext(),r=o.useTheme(),{localData:i,isDisabled:a,onSubscriptionDetailsChanged:d,onEstimateSuccess:l,onReviewClick:c,onBackClick:p,onResetClick:m}=e,[x,g]=u.useState(void 0),h=u.useRef(null),{data:C,subscriptionDetail:b,fetchState:S,estimateStatus:y}=i,j=t.usePrevious(y.fetchState),f=t.usePrevious(S),E=o.useForm({mode:"all",reValidateMode:"onChange",defaultValues:u.useMemo(()=>kr(i),[i])});u.useEffect(()=>()=>{g(void 0)},[]),u.useEffect(()=>{f==="In-Progress"&&S==="Completed"&&E.reset(kr(i))},[f,S,E,i]),u.useEffect(()=>{j==="In-Progress"&&(y.fetchState==="Error"?x!==y.fetchState&&g(y.fetchState):y.fetchState==="Completed"&&(g(void 0),l()))},[x,j,y.fetchState,l]);const $=async(R,L)=>{if(R.includes(pn)||R.includes(Dt)){if(R.includes(Dt)){const{applyChanges:W}=L,{changeType:k,shouldProrate:
|
|
2629
|
+
`,to=(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},dn=(e,n)=>e==null?void 0:`${(t.amountToString("0,0.00",e)+" "+cS(n)).trim()}`,cS=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}`},dS=t.appLocale.getLocalizedStrings().common,vr="subscriptionUpdatePlanPage",pn="updatePlan",Dt="applyChanges";function pS(e){const n=t.useWindowSizeContext(),r=o.useTheme(),{localData:i,isDisabled:a,onSubscriptionDetailsChanged:d,onEstimateSuccess:l,onReviewClick:c,onBackClick:p,onResetClick:m}=e,[x,g]=u.useState(void 0),h=u.useRef(null),{data:C,subscriptionDetail:b,fetchState:S,estimateStatus:y}=i,j=t.usePrevious(y.fetchState),f=t.usePrevious(S),E=o.useForm({mode:"all",reValidateMode:"onChange",defaultValues:u.useMemo(()=>kr(i),[i])});u.useEffect(()=>()=>{g(void 0)},[]),u.useEffect(()=>{f==="In-Progress"&&S==="Completed"&&E.reset(kr(i))},[f,S,E,i]),u.useEffect(()=>{j==="In-Progress"&&(y.fetchState==="Error"?x!==y.fetchState&&g(y.fetchState):y.fetchState==="Completed"&&(g(void 0),l()))},[x,j,y.fetchState,l]);const $=async(R,L)=>{if(R.includes(pn)||R.includes(Dt)){if(R.includes(Dt)){const{applyChanges:W}=L,{changeType:k,shouldProrate:P}=W;k==="applyImmediately"&&C?.applyEndOfTerm===!0&&P===!1?E.setValue(Dt,{...W,shouldProrate:!0},{shouldDirty:!0}):k==="applyEndOfTerm"&&C?.applyEndOfTerm===!1&&P===!0&&E.setValue(Dt,{...W,shouldProrate:!1},{shouldDirty:!0})}d(L)}};u.useEffect(()=>{const R=E.watch((L,{name:W})=>{W!=null&&L!=null&&o.defer(()=>$(W,L))});return()=>{R.unsubscribe()}});const A=E.handleSubmit(R=>{x!=null&&g(void 0),c()}),I=()=>M?.status.code!=="future"?o.jsxRuntimeExports.jsx(i1,{sectionId:Dt,style:{paddingBottom:t.Space.sp9},subscriptionUpdateData:C,subscriptionTermEndDate:M?.currentTerm?.end,isSubscriptionDetailsChanged:ra(i),isDisabled:a}):null,{updatePlan:v,snackBar:w,footer:F}=t.appLocale.getLocalizedStrings().subscriptionUpdate,{title:D}=v,K=b?.summary?.summary,M=b?.subscription.subscription,G=b?.plan?.plan.subscriptionPlanId,q=K?.recommendedSubscriptionPlanId!=null&&G===K?.primarySubscriptionPlanId?K?.recommendedSubscriptionPlanId:void 0;return o.jsxRuntimeExports.jsxs(uS,{children:[o.jsxRuntimeExports.jsx(t.NavBar,{title:D,backgroundColor:r.colors.grey4,style:{zIndex:3},onBackClick:p,scrollableContent:h,source:"SubscriptionUpdatePlanPage"}),x!=null?o.jsxRuntimeExports.jsx(t.SubscriptionSnackBar,{fetchState:x,customMessageText:y.error?.message??w.failedText,onRemoveSnackbar:()=>g(void 0)}):null,o.jsxRuntimeExports.jsx(xS,{ref:h,windowSize:n,children:S==="In-Progress"||S==="Not-Started"?o.jsxRuntimeExports.jsx(mS,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Large",start:!0})}):o.jsxRuntimeExports.jsx(o.FormProvider,{...E,children:o.jsxRuntimeExports.jsxs("form",{id:wr(vr),onSubmit:A,children:[o.jsxRuntimeExports.jsx(iS,{sectionId:pn,subscriptionUpdateData:C,recommendedSubscriptionPlanId:q,subscriptionMetaDetails:oo(i),isDisabled:a}),o.jsxRuntimeExports.jsx(I,{})]})})}),t.formHasDirtyFields(E.formState.dirtyFields)||hS(i)?o.jsxRuntimeExports.jsx(t.Footer,{formId:wr(vr),primaryBtn:{label:F.review,isLoading:y.fetchState==="In-Progress",isDisabled:e.isDisabled!=null&&y.fetchState!=="In-Progress"},cancelBtn:{label:dS.cancel,shouldResetOnCancel:!0,onClick:()=>{E.reset(gS(i)),b!=null&&m(b)}}}):null]})}const uS=s.div`
|
|
2630
2630
|
display: flex;
|
|
2631
2631
|
min-height: 100%;
|
|
2632
2632
|
flex-direction: column;
|
|
@@ -2684,14 +2684,14 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2684
2684
|
`,kS=s.div`
|
|
2685
2685
|
display: flex;
|
|
2686
2686
|
flex-direction: column;
|
|
2687
|
-
`,TS=t.appLocale.getLocalizedStrings().common,Tr="subscriptionAddPlanPage",un="addPlan",mn="invoiceOption";function PS(e){const n=t.useWindowSizeContext(),r=o.useTheme(),i=u.useRef(null),{localData:a,isDisabled:d,onSubscriptionDetailsChanged:l,onEstimateSuccess:c,onReviewClick:p,onBackClick:m,onResetClick:x}=e,[g,h]=u.useState(void 0),{data:C,fetchState:b,estimateStatus:S}=a,y=t.usePrevious(S.fetchState),j=t.usePrevious(b),f=o.useForm({mode:"all",reValidateMode:"onChange",defaultValues:u.useMemo(()=>
|
|
2687
|
+
`,TS=t.appLocale.getLocalizedStrings().common,Tr="subscriptionAddPlanPage",un="addPlan",mn="invoiceOption";function PS(e){const n=t.useWindowSizeContext(),r=o.useTheme(),i=u.useRef(null),{localData:a,isDisabled:d,onSubscriptionDetailsChanged:l,onEstimateSuccess:c,onReviewClick:p,onBackClick:m,onResetClick:x}=e,[g,h]=u.useState(void 0),{data:C,fetchState:b,estimateStatus:S}=a,y=t.usePrevious(S.fetchState),j=t.usePrevious(b),f=o.useForm({mode:"all",reValidateMode:"onChange",defaultValues:u.useMemo(()=>Ir(a),[a])});u.useEffect(()=>()=>{h(void 0)},[]),u.useEffect(()=>{j==="In-Progress"&&b==="Completed"&&f.reset(Ir(a))},[j,b,f,a]),u.useEffect(()=>{y==="In-Progress"&&(S.fetchState==="Error"?g!==S.fetchState&&h(S.fetchState):S.fetchState==="Completed"&&(h(void 0),c()))},[g,y,S.fetchState,c]);const E=async(F,D)=>{(F.includes(un)||F.includes(mn))&&l(D)};u.useEffect(()=>{const F=f.watch((D,{name:K})=>{K!=null&&D!=null&&o.defer(()=>E(K,D))});return()=>{F.unsubscribe()}});const $=f.handleSubmit(F=>{g!=null&&h(void 0),p()}),{addPlan:A,snackBar:I,footer:v}=t.appLocale.getLocalizedStrings().subscriptionUpdate,{title:w}=A;return o.jsxRuntimeExports.jsxs(IS,{children:[o.jsxRuntimeExports.jsx(t.NavBar,{title:w,backgroundColor:r.colors.grey4,style:{zIndex:3},onBackClick:m,scrollableContent:i,source:"SubscriptionAddPlanPage"}),g!=null?o.jsxRuntimeExports.jsx(t.SubscriptionSnackBar,{fetchState:g,customMessageText:S.error?.message??I.failedText,onRemoveSnackbar:()=>h(void 0)}):null,o.jsxRuntimeExports.jsx(AS,{ref:i,windowSize:n,children:b==="In-Progress"||b==="Not-Started"?o.jsxRuntimeExports.jsx(LS,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Large",start:!0})}):o.jsxRuntimeExports.jsx(o.FormProvider,{...f,children:o.jsxRuntimeExports.jsxs("form",{id:Pr(Tr),onSubmit:$,children:[o.jsxRuntimeExports.jsx(yS,{sectionId:un,subscriptionCreateData:C,subscriptionMetaDetails:oo(a),isDisabled:d}),o.jsxRuntimeExports.jsx(bS,{sectionId:mn,style:{paddingBottom:t.Space.sp9},subscriptionCreateData:C,isDisabled:d})]})})}),t.formHasDirtyFields(f.formState.dirtyFields)||DS(a)?o.jsxRuntimeExports.jsx(t.Footer,{formId:Pr(Tr),primaryBtn:{label:v.review,isLoading:S.fetchState==="In-Progress",isDisabled:e.isDisabled!=null&&S.fetchState!=="In-Progress"},cancelBtn:{label:TS.cancel,shouldResetOnCancel:!0,onClick:()=>{f.reset(OS(a)),x()}}}):null]})}const IS=s.div`
|
|
2688
2688
|
display: flex;
|
|
2689
2689
|
min-height: 100%;
|
|
2690
2690
|
flex-direction: column;
|
|
2691
2691
|
width: 100%;
|
|
2692
2692
|
background-color: ${e=>e.theme.colors.grey4};
|
|
2693
2693
|
box-shadow: ${e=>`${t.Space.sp0} 2px ${t.Space.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
2694
|
-
`,
|
|
2694
|
+
`,LS=s.div`
|
|
2695
2695
|
display: flex;
|
|
2696
2696
|
width: 100%;
|
|
2697
2697
|
height: calc(100vh - 110px);
|
|
@@ -2705,7 +2705,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2705
2705
|
justify-content: center;
|
|
2706
2706
|
height: 100%;
|
|
2707
2707
|
overflow-y: auto;
|
|
2708
|
-
`,Pr=e=>`${e}_form`,
|
|
2708
|
+
`,Pr=e=>`${e}_form`,Ir=e=>{const{data:n}=e,{plans:r,addOns:i,coupons:a}=oo(e);return{[un]:{subscriptionPlan:{selectedOption:n?.subscriptionPlanId,allOptions:to(r)},recurringAddOns:hn(i,n?.subscriptionAddOnIds),coupon:{selectedOption:n?.subscriptionCouponIds[0],allOptions:a.map(d=>({label:d.name,value:d.subscriptionCouponId}))},planStartDate:n?.startDate?.toDate()},[mn]:{invoicingOption:"invoiceNow"}}},DS=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)},OS=e=>{const{plans:n,addOns:r,coupons:i}=oo(e);return{[un]:{subscriptionPlan:{selectedOption:void 0,allOptions:to(n)},recurringAddOns:hn(r),coupon:{selectedOption:void 0,allOptions:i.map(a=>({label:a.name,value:a.subscriptionCouponId}))},planStartDate:void 0},[mn]:{invoicingOption:"invoiceNow"}}},Gt=t.appLocale.getLocalizedStrings().cockpit.portfolio.header,Mt=[{key:"companyName",value:Gt.name,sortOrder:"ascending",width:new t.ResponsiveSized(344,344),isThreadAllowed:!0},{key:"runway",value:Gt.runway,sortOrder:"ascending",width:new t.ResponsiveSized(155,155),isThreadAllowed:!0},{key:"cashBalance",value:Gt.cashbalance,sortOrder:"ascending",width:new t.ResponsiveSized(229,229),isThreadAllowed:!0},{key:"expenses",value:Gt.expenses,sortOrder:"ascending",width:new t.ResponsiveSized(228,228),isThreadAllowed:!0},{key:"revenues",value:Gt.revenues,sortOrder:"ascending",width:new t.ResponsiveSized(239,239),isThreadAllowed:!0},{key:"netIncome",value:Gt.netincome,sortOrder:"ascending",width:new t.ResponsiveSized(140,140),isThreadAllowed:!0}];Mt.map(e=>e.key);const NS={headerLastColumnRightPadding:new t.ResponsiveSized(30,82)};function MS({companyNameSticky:e,onColumnSortConfigChanged:n,sortConfig:r}){const i=t.useWindowSizeContext(),[a,d]=u.useState(o.cloneDeep(Mt));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(FS,{height:Ft,companyNameSticky:e,windowSize:i,children:a.map(c=>o.jsxRuntimeExports.jsxs(BS,{companyNameSticky:e&&c.key==="companyName",sortDataValue:r.sortKey,actualDataValue:c.key,wrapperWidth:c.width,windowSize:i,children:[o.jsxRuntimeExports.jsxs(US,{onClick:()=>l(J.toPortfolioSortKeyType(c.key),c.sortOrder),children:[o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:c.value}),o.jsxRuntimeExports.jsx(_S,{sortDataValue:r.sortKey,headerdata:c,children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:12,height:12})})]}),o.jsxRuntimeExports.jsx(VS,{sortDataValue:r.sortKey,windowSize:i,isVisible:r.sortKey===c.key&&c.key!=="runway",children:o.jsxRuntimeExports.jsx(WS,{onClick:()=>l("runway","ascending")})})]},c.key))})}const zS=u.memo(MS),FS=s(t.SmallRegular)`
|
|
2709
2709
|
top: ${e=>e.companyNameSticky?0:t.Space.sp12};
|
|
2710
2710
|
left: 0;
|
|
2711
2711
|
min-height: ${e=>e.height}px;
|
|
@@ -2754,7 +2754,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2754
2754
|
&:hover {
|
|
2755
2755
|
color: ${e=>e.theme.colors.primary};
|
|
2756
2756
|
}
|
|
2757
|
-
`,HS=t.appLocale.getLocalizedStrings(),{common:{strings:KS},cockpit:{portfolio:{header:{runway:GS}}}}=HS,YS=({companyView:e,companyNameSticky:n,totalHeight:r,addThreadRequestThreadId:i,setNoteData:a,setElementRef:d,setAddThreadRequestThreadId:l,onCompanyNameClicked:c,onPassportIconClicked:p})=>{const m=t.useWindowSizeContext(),{accountingSummary:x,company:g}=e,{companyId:h,name:C}=g.company.companyInfo,b=`cockpit_${h}`,S="portfolio.notes",{threads:y,isLoading:j}=t.useFilteredThreads({entityType:S,companyId:h},!1),{openThread:f,threads:E,addThread:$,removeThread:A,setOpenThread:
|
|
2757
|
+
`,HS=t.appLocale.getLocalizedStrings(),{common:{strings:KS},cockpit:{portfolio:{header:{runway:GS}}}}=HS,YS=({companyView:e,companyNameSticky:n,totalHeight:r,addThreadRequestThreadId:i,setNoteData:a,setElementRef:d,setAddThreadRequestThreadId:l,onCompanyNameClicked:c,onPassportIconClicked:p})=>{const m=t.useWindowSizeContext(),{accountingSummary:x,company:g}=e,{companyId:h,name:C}=g.company.companyInfo,b=`cockpit_${h}`,S="portfolio.notes",{threads:y,isLoading:j}=t.useFilteredThreads({entityType:S,companyId:h},!1),{openThread:f,threads:E,addThread:$,removeThread:A,setOpenThread:I,setRequestToOpenThread:v}=u.useContext(t.ThreadsContext),w=f!==null?E.get(f):null,F=f?.includes(h)===!0,D=f!=null&&E.get(f)==null&&F,K=i!=null&&E.get(i)?.metadata.companyId===h,M=u.useCallback(()=>{f?.includes(t.NEW_THREAD_SUFFIX)===!0&&A(f),i!=null&&l(void 0)},[i,f,A,l]),G=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:f,threadStyle:k.threadStyle,openThreadMetadata:w?.metadata??null,onElementClick:R,onAddThreadClick:L}),q=u.useCallback(k=>{if(k===f)I(null);else if(E.has(k))I(k);else if(k.includes(t.NEW_THREAD_SUFFIX)){const[P,N]=k.replace(t.NEW_THREAD_SUFFIX,"").split("."),Q=_t(Rt(P),J.toPortfolioSortKeyType(N),h,C);$(k,{type:"thread",visibility:"public",id:k,roomId:b,createdAt:new Date,updatedAt:new Date,comments:[],metadata:Q,resolved:!1}),I(k)}},[h,C,f,b,E,$,I]),R=u.useCallback((k,P,N=!1)=>{const Q=Mt.find(ae=>ae.key===P);if(v(null),Q!=null&&(k.type==="contextmenu"||N===!0)){if(Q.isThreadAllowed===!1)return;M(),k.preventDefault(),k.stopPropagation();const ae=t.toCollaborationEntityType({tab:"portfolio",key:Q.key}),z=[...t.getFilteredThreads(E,{entityType:ae,companyId:h},"both")],Y=z.length>0&&z[0].length>0?z[0][0]:Pe("portfolio",Q.key,h);E.has(Y)?q(Y):i===Y?l(void 0):(l(Y),I(null))}},[E,h,i,q,l,I,v,M]),L=u.useCallback((k,P)=>{k.stopPropagation();const N=Pe("portfolio",P,h);l(void 0),q(N)},[h,l,q]),W={name:e.company.company.companyInfo.name,runway:x.runway,cashBalance:x.cashPosition?.balance,expenses:x.cogs?.balance&&x.expenses?.balance?ZS(x.cogs?.balance,x.expenses?.balance):void 0,netIncome:x.netBurnOrIncome?.balance,revenues:x.income?.balance};return o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{v(null),i!=null&&(l(void 0),i.includes(t.NEW_THREAD_SUFFIX)&&A(i))},children:o.jsxRuntimeExports.jsx(XS,{windowSize:m,isThreadOpen:F||K,totalHeight:r,isCreationInProgress:D,children:Mt.map((k,P)=>{const N=t.toCollaborationEntityType({tab:"portfolio",key:k.key}),Q=[...t.getFilteredThreads(E,{entityType:N,companyId:h},"both")],ae=Mt.length-2<=P,z=Q.length>0&&Q[0].length>0?Q[0][0]:Pe("portfolio",k.key,h),Y=E.get(z),T=Y!=null&&Y.resolved===!1,te=z===f,re=i===z;switch(k.key){case"companyName":return o.jsxRuntimeExports.jsxs(sy,{companyNameSticky:n,columnWidth:k.width,windowSize:m,isThreadOpen:te||re,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:Z=>R(Z,k.key),ref:Z=>{d(h,k.key,Z)},children:[o.jsxRuntimeExports.jsxs(qS,{children:[o.jsxRuntimeExports.jsx(QS,{onClick:Z=>{Z.preventDefault(),c(e)},children:W.name}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:te,roomId:b,openThreadId:f,openThreadMetadata:w?.metadata??null})]}),o.jsxRuntimeExports.jsxs(ey,{children:[o.jsxRuntimeExports.jsxs(ty,{onClick:Z=>{Z.preventDefault(),a({roomId:b,companyId:h,companyName:C,entityType:S})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:y.length,isLoading:j}),o.jsxRuntimeExports.jsx(oy,{})]}),o.jsxRuntimeExports.jsx(ny,{onClick:Z=>{Z.preventDefault(),p(e)},children:o.jsxRuntimeExports.jsx(JS,{className:"passportIcon"})})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:T,itemKey:k.key,style:{left:t.Space.sp4},onElementClick:R}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Pe("portfolio",k.key,h),addThreadRequestThreadId:i,itemKey:k.key,onAddThreadClick:L})]},z);case"cashBalance":return o.jsxRuntimeExports.jsxs(po,{ref:Z=>{d(h,k.key,Z)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:Z=>R(Z,k.key),children:[o.jsxRuntimeExports.jsx(Ko,{textColor:t.getCockpitColor("cashBalance"),wrapperWidth:k.width,windowSize:m,children:t.amountToString("0,0",W.cashBalance)}),G({isElementThreadOpen:te,isElementThreadPresent:T,itemKey:k.key,elementThreadId:z,threadStyle:ae?{right:t.Space.sp0}:void 0})]},z);case"expenses":return o.jsxRuntimeExports.jsxs(po,{ref:Z=>{d(h,k.key,Z)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:Z=>R(Z,k.key),children:[o.jsxRuntimeExports.jsx(Ko,{textColor:t.getCockpitColor("expenses"),wrapperWidth:k.width,windowSize:m,children:t.amountToString("0,0",W.expenses)}),G({isElementThreadOpen:te,isElementThreadPresent:T,itemKey:k.key,elementThreadId:z,threadStyle:ae?{right:t.Space.sp0}:void 0})]},z);case"revenues":return o.jsxRuntimeExports.jsxs(po,{ref:Z=>{d(h,k.key,Z)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:Z=>R(Z,k.key),children:[o.jsxRuntimeExports.jsx(Ko,{textColor:t.getCockpitColor("revenues"),wrapperWidth:k.width,windowSize:m,children:t.amountToString("0,0",W.revenues)}),G({isElementThreadOpen:te,isElementThreadPresent:T,itemKey:k.key,elementThreadId:z,threadStyle:ae?{right:t.Space.sp0}:void 0})]},z);case"netIncome":return o.jsxRuntimeExports.jsxs(po,{ref:Z=>{d(h,k.key,Z)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:Z=>R(Z,k.key),children:[o.jsxRuntimeExports.jsx(Ko,{textColor:t.getCockpitColor("netIncome"),wrapperWidth:k.width,windowSize:m,children:t.amountToString("0,0",W.netIncome)}),G({isElementThreadOpen:te,isElementThreadPresent:T,itemKey:k.key,elementThreadId:z,threadStyle:ae?{right:t.Space.sp0}:void 0})]},z);case"runway":return o.jsxRuntimeExports.jsxs(po,{ref:Z=>{d(h,k.key,Z)},columnWidth:k.width,windowSize:m,isThreadAllowed:k.isThreadAllowed,className:oe,onContextMenu:Z=>R(Z,k.key),children:[o.jsxRuntimeExports.jsx(ry,{wrapperWidth:k.width,windowSize:m,children:W.runway!=null?o.jsxRuntimeExports.jsx(t.Tooltip,{variant:"runway",data:W.runway,placement:"right",title:GS,children:o.jsxRuntimeExports.jsx(ay,{textColor:t.getCockpitColor(W.runway.runwayStatusCode)})}):o.jsxRuntimeExports.jsx(iy,{children:KS.hyphen})}),G({isElementThreadOpen:te,isElementThreadPresent:T,itemKey:k.key,elementThreadId:z,threadStyle:ae?{right:t.Space.sp0}:void 0})]},z);default:return null}})})})},ZS=(e,n)=>({amount:e.amount+n.amount,currencyCode:e.currencyCode,currencySymbol:e.currencySymbol}),XS=s.div`
|
|
2758
2758
|
border: 1px solid ${e=>e.theme.colors.grey3};
|
|
2759
2759
|
border-radius: ${t.Space.sp2};
|
|
2760
2760
|
display: flex;
|
|
@@ -2908,7 +2908,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2908
2908
|
color: ${e=>e.textColor.color.toString()};
|
|
2909
2909
|
`,_n=s(t.StandardRegular)`
|
|
2910
2910
|
color: ${e=>e.theme.colors.champion};
|
|
2911
|
-
`,Yt=s.div``,uy={portfolioRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{common:{headers:{comments:my}},collaboration:{threads:{placeholder:{addANewComment:xy,replyAComment:hy},tooltip:{resolveComment:gy,unResolveComment:Sy}}}}=t.appLocale.getLocalizedStrings(),yy=({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),[x,g]=u.useState(null),h=!(l==="small"||l==="medium-compact"),{uiState:C,totalCashBalance:b,totalExpenses:S,totalRevenues:y}=e,j=C.scrollYOffset??0,f=M=>e.companies[M].company.company.companyInfo.name.length>Wt?Ae+32:Ae;u.useEffect(()=>{c.current&&c.current.resetAfterIndex(0)},[e]);const{setOpenThread:E,setRequestToOpenThread:$,requestToOpenThread:A,isLoading:
|
|
2911
|
+
`,Yt=s.div``,uy={portfolioRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{common:{headers:{comments:my}},collaboration:{threads:{placeholder:{addANewComment:xy,replyAComment:hy},tooltip:{resolveComment:gy,unResolveComment:Sy}}}}=t.appLocale.getLocalizedStrings(),yy=({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),[x,g]=u.useState(null),h=!(l==="small"||l==="medium-compact"),{uiState:C,totalCashBalance:b,totalExpenses:S,totalRevenues:y}=e,j=C.scrollYOffset??0,f=M=>e.companies[M].company.company.companyInfo.name.length>Wt?Ae+32:Ae;u.useEffect(()=>{c.current&&c.current.resetAfterIndex(0)},[e]);const{setOpenThread:E,setRequestToOpenThread:$,requestToOpenThread:A,isLoading:I}=u.useContext(t.ThreadsContext);u.useEffect(()=>{d!=null&&e.fetchState==="Completed"&&I===!1&&$(d)},[d,e.fetchState,I,$]);const[v,w]=u.useState(void 0),F=u.useRef([]),D=u.useMemo(()=>({makeCompanyNameSticky:h,uiState:C,totalCashBalance:b,totalExpenses:S,totalRevenues:y,onColumnSortConfigChanged:n}),[h,b,S,y,C,n]),K=u.useCallback((M,G,q)=>{const R=e.companies.findIndex(W=>W.company.company.companyInfo.companyId===M),L=Mt.findIndex(W=>W.key===G);R!==-1&&L!==-1&&(F.current[R]==null?F.current[R]=[q]:F.current[R][L]=q)},[e.companies]);return u.useEffect(()=>{if(A!=null&&p!=null){const{companyId:M,entityType:G}=A,[q,R]=G.split("."),L=e.companies.findIndex(N=>N.company.company.companyInfo.companyId===M),W=Mt.findIndex(N=>N.key===R);L!==-1&&!(p.visibleStartIndex<=L&&p.visibleStopIndex>=L)&&c.current?.scrollToItem(L,"center"),setTimeout(()=>{const N=F.current[L]?.[0]?.getBoundingClientRect().bottom,Q=F.current[L]?.[0]?.getBoundingClientRect().top;N!=null&&Q!=null&&(window.innerHeight>=N&&window.innerHeight>=Q||Q<0)&&F.current[L][W]?.scrollIntoView({block:"center",behavior:"auto"})},0);const P=setInterval(()=>{const N=F.current[L]?.[W]?.getBoundingClientRect().left,Q=F.current[L]?.[W]?.getBoundingClientRect().right,ae=F.current[L]?.[W]?.offsetWidth;if(N!=null&&ae!=null&&Q!=null&&(N<window.innerWidth-ae||Q<window.innerWidth)){clearInterval(P);const z=A.threadId,Y=A.onThreadShownCallback;z&&($(null),E(A.threadId),Y?.())}},500);setTimeout(()=>{clearInterval(P),$(null)},2e3)}},[A,p,E,$]),o.jsxRuntimeExports.jsxs(Cy,{companyNameSticky:h,children:[h&&o.jsxRuntimeExports.jsx(ia,{totalCashBalance:b,totalExpenses:S,totalRevenues:y,companyNameSticky:h}),o.jsxRuntimeExports.jsx(jy,{companyNameSticky:h,children:o.jsxRuntimeExports.jsxs(aa.Provider,{value:D,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:M,width:G})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:M,innerElementType:la,itemCount:e.companies.length,itemSize:f,onItemsRendered:q=>m(q),itemData:{portfolioView:e,makeCompanyNameSticky:h,addThreadRequestThreadId:v,setElementRef:K,setAddThreadRequestThreadId:w,setNoteData:g,onCompanyNameClicked:r,onPassportIconClicked:i},width:G,ref:c,overscanCount:Bt,onScroll:({scrollOffset:q})=>{a(q)},initialScrollOffset:j,children:fy})}),x!=null?o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:x.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${x.companyName} ${my}`,filter:{application:"cockpit",companyId:x.companyId,entityType:x.entityType,isGlobalComment:!1,tab:"portfolio"},isLoading:!1,threadMetadata:{companyName:x.companyName,companyId:x.companyId,entityId:x.companyId,entityType:x.entityType,isGlobalComment:!1,application:"cockpit",tab:"portfolio",url:window.location.href},textOverrides:{composerPlaceholder:xy,replyComposerPlaceholder:hy,threadResolve:gy,threadUnResolve:Sy},onThreadClick:M=>null,onCloseAllThreadsDrawer:()=>g(null)})}):null]})})]})},aa=u.createContext(void 0),fy=({index:e,style:n,data:r})=>{const i=t.useWindowSizeContext(),{portfolioView:a,makeCompanyNameSticky:d,addThreadRequestThreadId:l,setElementRef:c,setNoteData:p,onCompanyNameClicked:m,onPassportIconClicked:x,setAddThreadRequestThreadId:g}=r,h=a.companies[e],{companyId:C}=h.company.company.companyInfo;return o.jsxRuntimeExports.jsx(by,{style:{...n,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${uy.portfolioRightPadding.valuePx(i)} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(YS,{addThreadRequestThreadId:l,setNoteData:p,setElementRef:c,setAddThreadRequestThreadId:g,totalHeight:typeof n.height=="number"?n.height:Ae,companyView:a.companies[e],companyNameSticky:d,onCompanyNameClicked:m,onPassportIconClicked:x})},C)},la=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,totalCashBalance:c,totalExpenses:p,totalRevenues:m,onColumnSortConfigChanged:x}=u.useContext(aa);return o.jsxRuntimeExports.jsxs($y,{ref:n,style:{...i,width:"auto"},...a,children:[!d&&o.jsxRuntimeExports.jsx(ia,{totalCashBalance:c,totalExpenses:p,totalRevenues:m,companyNameSticky:d}),o.jsxRuntimeExports.jsx(zS,{companyNameSticky:d,onColumnSortConfigChanged:x,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(Ry,{children:r})]})});la.displayName="Portfolio list view inner element type";const Cy=s.div`
|
|
2912
2912
|
width: 100%;
|
|
2913
2913
|
height: 100%;
|
|
2914
2914
|
background-color: ${e=>e.theme.colors.grey4};
|
|
@@ -2942,7 +2942,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2942
2942
|
height: calc(100vh - 45px);
|
|
2943
2943
|
overflow-y: hidden;
|
|
2944
2944
|
background-color: ${e=>e.theme.colors.grey4};
|
|
2945
|
-
`,ky=({headerData:e,headerActions:n,portfolioPageActions:r,portfolioPageData:i,initialOpenThreadRequest:a})=>{const{portfolioView:d}=i,{onColumnSortConfigChanged:l,onCompanyNameClicked:c,onPassportIconClicked:p,onScroll:m,onFiltersChange:x,onCockpitReloadData:g}=r,h=d.uiState.filterText,C=d.uiState.filters,b=d.fetchState==="Completed";return n.filterActions&&(n.filterActions.getCategoryWiseOptions=()=>Py()),o.jsxRuntimeExports.jsxs(wy,{children:[o.jsxRuntimeExports.jsx(dt,{headerActions:{...n},headerData:{...e,filterData:{filterText:h,filters:C},companiesLoaded:b,selectedTabOption:"portfolio",allTabOptions:e.allTabOptions??it}}),o.jsxRuntimeExports.jsx(Ty,{portfolioView:d,onColumnSortConfigChanged:l,onScroll:m,onCockpitReloadData:g,isFilterApplied:C?.categories!=null,onCompanyNameClicked:c,onPassportIconClicked:p,onClearFilter:()=>x("portfolio",{}),initialOpenThreadRequest:a})]})},Ty=({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($t,{onCockpitReloadData:d,selectedCockpitOption:"portfolio"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(Ey,{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(vy,{windowSize:m,children:o.jsxRuntimeExports.jsx(yy,{portfolioView:e,onColumnSortConfigChanged:r,onScroll:l,onCompanyNameClicked:i,onPassportIconClicked:a,initialOpenThreadRequest:p})})},Py=()=>ji.reduce((n,r)=>{switch(r.value){case"netBurnOrIncome":return{...n,[r.value]:rl};case"cashPosition":return{...n,[r.value]:il};case"expenses":return{...n,[r.value]:al};case"income":return{...n,[r.value]:ll};case"runway":return{...n,[r.value]:cl};default:return{...n,[r.value]:[]}}},{}),
|
|
2945
|
+
`,ky=({headerData:e,headerActions:n,portfolioPageActions:r,portfolioPageData:i,initialOpenThreadRequest:a})=>{const{portfolioView:d}=i,{onColumnSortConfigChanged:l,onCompanyNameClicked:c,onPassportIconClicked:p,onScroll:m,onFiltersChange:x,onCockpitReloadData:g}=r,h=d.uiState.filterText,C=d.uiState.filters,b=d.fetchState==="Completed";return n.filterActions&&(n.filterActions.getCategoryWiseOptions=()=>Py()),o.jsxRuntimeExports.jsxs(wy,{children:[o.jsxRuntimeExports.jsx(dt,{headerActions:{...n},headerData:{...e,filterData:{filterText:h,filters:C},companiesLoaded:b,selectedTabOption:"portfolio",allTabOptions:e.allTabOptions??it}}),o.jsxRuntimeExports.jsx(Ty,{portfolioView:d,onColumnSortConfigChanged:l,onScroll:m,onCockpitReloadData:g,isFilterApplied:C?.categories!=null,onCompanyNameClicked:c,onPassportIconClicked:p,onClearFilter:()=>x("portfolio",{}),initialOpenThreadRequest:a})]})},Ty=({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($t,{onCockpitReloadData:d,selectedCockpitOption:"portfolio"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(Ey,{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(vy,{windowSize:m,children:o.jsxRuntimeExports.jsx(yy,{portfolioView:e,onColumnSortConfigChanged:r,onScroll:l,onCompanyNameClicked:i,onPassportIconClicked:a,initialOpenThreadRequest:p})})},Py=()=>ji.reduce((n,r)=>{switch(r.value){case"netBurnOrIncome":return{...n,[r.value]:rl};case"cashPosition":return{...n,[r.value]:il};case"expenses":return{...n,[r.value]:al};case"income":return{...n,[r.value]:ll};case"runway":return{...n,[r.value]:cl};default:return{...n,[r.value]:[]}}},{}),Lr=t.appLocale.getLocalizedStrings().common,{dateFormat:Iy,aiAccountantCustomer:Vn}=t.appLocale.getLocalizedStrings(),Rs=({operationType:e,onCancel:n,onConfirm:r,dialogTitle:i,dialogDescription:a})=>{const d=o.useTheme(),[l,c]=u.useState(""),[p,m]=u.useState(""),x=e==="offboard",g=x||l.length>0&&p.length>0,h=e.replaceAll("_"," "),C=J.zeniDate(new Date().toISOString()).format(Iy.analytics.YYYYDashMMDashDDFormat),b=i??`${Vn.jobTriggerDialog.title} — ${h}`;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:Lr.confirm,secondaryButtonText:Lr.cancel,useLegacyStyles:!0,isProceedDisabled:!g,action:{onOkClick:()=>{g&&r(e,l,p)},onCancelClick:n,onClickAway:n},shouldClickAway:!0,style:{background:d.colors.overlayColor},children:!x&&o.jsxRuntimeExports.jsxs(Ly,{children:[o.jsxRuntimeExports.jsxs(Ar,{children:[o.jsxRuntimeExports.jsx(Dr,{children:Vn.jobTriggerDialog.startDate}),o.jsxRuntimeExports.jsx(Or,{type:"date",value:l,max:p.length>0?p:C,onChange:S=>c(S.target.value)})]}),o.jsxRuntimeExports.jsxs(Ar,{children:[o.jsxRuntimeExports.jsx(Dr,{children:Vn.jobTriggerDialog.endDate}),o.jsxRuntimeExports.jsx(Or,{type:"date",value:p,min:l.length>0?l:void 0,max:C,onChange:S=>m(S.target.value)})]})]})})},Ly=s.div`
|
|
2946
2946
|
display: flex;
|
|
2947
2947
|
flex-direction: column;
|
|
2948
2948
|
gap: ${t.Space.sp3};
|
|
@@ -2965,7 +2965,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
2965
2965
|
outline: none;
|
|
2966
2966
|
border-color: ${e=>e.theme.colors.primary};
|
|
2967
2967
|
}
|
|
2968
|
-
`,{aiAccountantCustomer:ft}=t.appLocale.getLocalizedStrings(),he={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},ot={companyName:200,status:120,bookcloseDate:130,latestTraining:130,latestSync:130,accuracy:100,actions:60},Ay=[{key:"companyName",label:ft.table.company,sortable:!0,width:ot.companyName,justifyContent:"flex-start",growToFill:!0},{key:"status",label:ft.table.status,sortable:!0,width:ot.status,justifyContent:"flex-start"},{key:"bookcloseDate",label:ft.table.bookClose,sortable:!0,width:ot.bookcloseDate,justifyContent:"flex-start"},{key:"latestTraining",label:ft.table.lastTraining,sortable:!0,width:ot.latestTraining,justifyContent:"flex-start"},{key:"latestSync",label:ft.table.lastSync,sortable:!0,width:ot.latestSync,justifyContent:"flex-start"},{key:"accuracy",label:ft.table.accuracy,sortable:!0,width:ot.accuracy,justifyContent:"flex-end"},{key:"actions",label:"",sortable:!1,width:ot.actions,justifyContent:"center"}],$s={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}},ca=(e,n)=>{const{jobTriggerDialog:r}=ft;return e==="offboard"?r.singleDescriptionOffboard.replace("__companyName__",n):r.singleDescription.replace("__companyName__",n).replace("__datesInstruction__",r.datesInstruction)},Es=e=>J.getAllowedOperationsForStatus(e).map(n=>({operationType:n,...$s[n]})),da=e=>ft.filters.enrollmentStatus[e]??e;function vs(){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:qt},dateFormat:an,timeFormat:Ro,aiAccountantCustomer:Ve}=t.appLocale.getLocalizedStrings(),Dy=({customer:e,hasMoreJobs:n,jobs:r,jobsFetchStatus:i,onAction:a,onCancelOnboarding:d,onClose:l,onLoadMoreJobs:c})=>{const[p,m]=u.useState(null),x=vs(),g=e.enrollment?.status??"unknown",h=e.enrollment,C=h?.accuracy??{},b=i.fetchState==="In-Progress",S=E=>{m({operationType:E})},y=(E,$,A)=>{a(e,E,$,A),m(null)},j=E=>E<r.length,f=()=>{n&&!b&&c()};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(zy,{children:[o.jsxRuntimeExports.jsx(Fy,{children:o.jsxRuntimeExports.jsxs(By,{children:[o.jsxRuntimeExports.jsx(Wy,{}),o.jsxRuntimeExports.jsxs(_y,{children:[o.jsxRuntimeExports.jsx(Vy,{children:e.companyName}),o.jsxRuntimeExports.jsx(Uy,{children:e.tenantId})]}),o.jsxRuntimeExports.jsx(Hy,{onClick:l,children:o.jsxRuntimeExports.jsx(Ky,{})})]})}),o.jsxRuntimeExports.jsxs(Gy,{children:[o.jsxRuntimeExports.jsxs(Un,{children:[o.jsxRuntimeExports.jsx(Go,{children:Ve.drawer.enrollmentDetails}),o.jsxRuntimeExports.jsxs(Zy,{children:[o.jsxRuntimeExports.jsxs(uo,{children:[o.jsxRuntimeExports.jsx(mo,{children:Ve.drawer.statusLabel}),o.jsxRuntimeExports.jsx(xo,{children:da(g)})]}),o.jsxRuntimeExports.jsxs(uo,{children:[o.jsxRuntimeExports.jsx(mo,{children:Ve.drawer.onboarded}),o.jsxRuntimeExports.jsx(xo,{title:h?.onboardedAt!=null?h.onboardedAt.format(Ro.hmmADashDDMMMCommaYYYY):void 0,children:h?.onboardedAt!=null?h.onboardedAt.format(an.visual.MMMDCommaYYYYformat):qt.emDash})]}),o.jsxRuntimeExports.jsxs(uo,{children:[o.jsxRuntimeExports.jsx(mo,{children:Ve.drawer.lastTraining}),o.jsxRuntimeExports.jsx(xo,{title:h?.latestTraining!=null?h.latestTraining.format(Ro.hmmADashDDMMMCommaYYYY):void 0,children:h?.latestTraining!=null?h.latestTraining.format(an.visual.MMMDCommaYYYYformat):qt.emDash})]}),o.jsxRuntimeExports.jsxs(uo,{children:[o.jsxRuntimeExports.jsx(mo,{children:Ve.drawer.lastSync}),o.jsxRuntimeExports.jsx(xo,{title:h?.latestTransactionSync!=null?h.latestTransactionSync.local().format(Ro.hmmADashDDMMMCommaYYYY):void 0,children:h?.latestTransactionSync!=null?h.latestTransactionSync.utc(!0).fromNow():qt.emDash})]}),h?.offboardedAt!=null&&o.jsxRuntimeExports.jsxs(uo,{children:[o.jsxRuntimeExports.jsx(mo,{children:Ve.drawer.offboarded}),o.jsxRuntimeExports.jsx(xo,{title:h.offboardedAt.format(Ro.hmmADashDDMMMCommaYYYY),children:h.offboardedAt.format(an.visual.MMMDCommaYYYYformat)})]})]})]}),o.jsxRuntimeExports.jsxs(Un,{children:[o.jsxRuntimeExports.jsx(Go,{children:Ve.drawer.modelAccuracy}),Object.keys(C).length>0?o.jsxRuntimeExports.jsx(Xy,{children:Object.entries(C).map(([E,$])=>{const A=$*100,
|
|
2968
|
+
`,{aiAccountantCustomer:ft}=t.appLocale.getLocalizedStrings(),he={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},ot={companyName:200,status:120,bookcloseDate:130,latestTraining:130,latestSync:130,accuracy:100,actions:60},Ay=[{key:"companyName",label:ft.table.company,sortable:!0,width:ot.companyName,justifyContent:"flex-start",growToFill:!0},{key:"status",label:ft.table.status,sortable:!0,width:ot.status,justifyContent:"flex-start"},{key:"bookcloseDate",label:ft.table.bookClose,sortable:!0,width:ot.bookcloseDate,justifyContent:"flex-start"},{key:"latestTraining",label:ft.table.lastTraining,sortable:!0,width:ot.latestTraining,justifyContent:"flex-start"},{key:"latestSync",label:ft.table.lastSync,sortable:!0,width:ot.latestSync,justifyContent:"flex-start"},{key:"accuracy",label:ft.table.accuracy,sortable:!0,width:ot.accuracy,justifyContent:"flex-end"},{key:"actions",label:"",sortable:!1,width:ot.actions,justifyContent:"center"}],$s={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}},ca=(e,n)=>{const{jobTriggerDialog:r}=ft;return e==="offboard"?r.singleDescriptionOffboard.replace("__companyName__",n):r.singleDescription.replace("__companyName__",n).replace("__datesInstruction__",r.datesInstruction)},Es=e=>J.getAllowedOperationsForStatus(e).map(n=>({operationType:n,...$s[n]})),da=e=>ft.filters.enrollmentStatus[e]??e;function vs(){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:qt},dateFormat:an,timeFormat:Ro,aiAccountantCustomer:Ve}=t.appLocale.getLocalizedStrings(),Dy=({customer:e,hasMoreJobs:n,jobs:r,jobsFetchStatus:i,onAction:a,onCancelOnboarding:d,onClose:l,onLoadMoreJobs:c})=>{const[p,m]=u.useState(null),x=vs(),g=e.enrollment?.status??"unknown",h=e.enrollment,C=h?.accuracy??{},b=i.fetchState==="In-Progress",S=E=>{m({operationType:E})},y=(E,$,A)=>{a(e,E,$,A),m(null)},j=E=>E<r.length,f=()=>{n&&!b&&c()};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(zy,{children:[o.jsxRuntimeExports.jsx(Fy,{children:o.jsxRuntimeExports.jsxs(By,{children:[o.jsxRuntimeExports.jsx(Wy,{}),o.jsxRuntimeExports.jsxs(_y,{children:[o.jsxRuntimeExports.jsx(Vy,{children:e.companyName}),o.jsxRuntimeExports.jsx(Uy,{children:e.tenantId})]}),o.jsxRuntimeExports.jsx(Hy,{onClick:l,children:o.jsxRuntimeExports.jsx(Ky,{})})]})}),o.jsxRuntimeExports.jsxs(Gy,{children:[o.jsxRuntimeExports.jsxs(Un,{children:[o.jsxRuntimeExports.jsx(Go,{children:Ve.drawer.enrollmentDetails}),o.jsxRuntimeExports.jsxs(Zy,{children:[o.jsxRuntimeExports.jsxs(uo,{children:[o.jsxRuntimeExports.jsx(mo,{children:Ve.drawer.statusLabel}),o.jsxRuntimeExports.jsx(xo,{children:da(g)})]}),o.jsxRuntimeExports.jsxs(uo,{children:[o.jsxRuntimeExports.jsx(mo,{children:Ve.drawer.onboarded}),o.jsxRuntimeExports.jsx(xo,{title:h?.onboardedAt!=null?h.onboardedAt.format(Ro.hmmADashDDMMMCommaYYYY):void 0,children:h?.onboardedAt!=null?h.onboardedAt.format(an.visual.MMMDCommaYYYYformat):qt.emDash})]}),o.jsxRuntimeExports.jsxs(uo,{children:[o.jsxRuntimeExports.jsx(mo,{children:Ve.drawer.lastTraining}),o.jsxRuntimeExports.jsx(xo,{title:h?.latestTraining!=null?h.latestTraining.format(Ro.hmmADashDDMMMCommaYYYY):void 0,children:h?.latestTraining!=null?h.latestTraining.format(an.visual.MMMDCommaYYYYformat):qt.emDash})]}),o.jsxRuntimeExports.jsxs(uo,{children:[o.jsxRuntimeExports.jsx(mo,{children:Ve.drawer.lastSync}),o.jsxRuntimeExports.jsx(xo,{title:h?.latestTransactionSync!=null?h.latestTransactionSync.local().format(Ro.hmmADashDDMMMCommaYYYY):void 0,children:h?.latestTransactionSync!=null?h.latestTransactionSync.utc(!0).fromNow():qt.emDash})]}),h?.offboardedAt!=null&&o.jsxRuntimeExports.jsxs(uo,{children:[o.jsxRuntimeExports.jsx(mo,{children:Ve.drawer.offboarded}),o.jsxRuntimeExports.jsx(xo,{title:h.offboardedAt.format(Ro.hmmADashDDMMMCommaYYYY),children:h.offboardedAt.format(an.visual.MMMDCommaYYYYformat)})]})]})]}),o.jsxRuntimeExports.jsxs(Un,{children:[o.jsxRuntimeExports.jsx(Go,{children:Ve.drawer.modelAccuracy}),Object.keys(C).length>0?o.jsxRuntimeExports.jsx(Xy,{children:Object.entries(C).map(([E,$])=>{const A=$*100,I=Ny(A),v=`${A.toFixed(0)}${qt.percentage}`,w=`${A.toFixed(1)}${qt.percentage}`;return o.jsxRuntimeExports.jsxs(qy,{children:[o.jsxRuntimeExports.jsx(Qy,{children:My(E)}),o.jsxRuntimeExports.jsx(Jy,{children:o.jsxRuntimeExports.jsx(e0,{style:{width:v,backgroundColor:I}})}),o.jsxRuntimeExports.jsx(t0,{children:w})]},E)})}):o.jsxRuntimeExports.jsx(Nr,{children:Ve.drawer.noAccuracyData})]}),x&&o.jsxRuntimeExports.jsxs(Un,{children:[o.jsxRuntimeExports.jsx(Go,{children:Ve.drawer.actionsTitle}),o.jsxRuntimeExports.jsx(o0,{children:Es(g).map(E=>o.jsxRuntimeExports.jsx(t.Button,{label:Ve.actions[E.labelKey],variant:E.destructive?"destructive":"outline",size:"small",onClick:()=>{E.operationType==="cancel_onboarding"?d(e):S(E.operationType)}},E.operationType))})]}),o.jsxRuntimeExports.jsxs(Yy,{children:[o.jsxRuntimeExports.jsx(Go,{children:Ve.drawer.jobHistory}),r.length===0&&!b?o.jsxRuntimeExports.jsx(Nr,{children:Ve.drawer.noJobsFound}):o.jsxRuntimeExports.jsxs(n0,{children:[o.jsxRuntimeExports.jsxs(s0,{children:[o.jsxRuntimeExports.jsx(r0,{children:o.jsxRuntimeExports.jsx(t.ExtraSmallSemiBold,{children:Ve.drawer.operation})}),o.jsxRuntimeExports.jsx(i0,{children:o.jsxRuntimeExports.jsx(t.ExtraSmallSemiBold,{children:Ve.drawer.status})}),o.jsxRuntimeExports.jsx(a0,{children:o.jsxRuntimeExports.jsx(t.ExtraSmallSemiBold,{children:Ve.drawer.created})}),o.jsxRuntimeExports.jsx(l0,{children:o.jsxRuntimeExports.jsx(t.ExtraSmallSemiBold,{children:Ve.drawer.by})})]}),o.jsxRuntimeExports.jsx(c0,{children:o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:E,width:$})=>o.jsxRuntimeExports.jsx(o.InfiniteLoader,{isItemLoaded:j,itemCount:n?r.length+1:r.length,loadMoreItems:f,children:({onItemsRendered:A})=>o.jsxRuntimeExports.jsx(o.FixedSizeList,{height:E,width:$,itemCount:r.length,itemSize:he.jobRowHeightPx,itemData:r,onItemsRendered:A,innerElementType:Oy,overscanCount:he.jobSkeletonRowCount,children:pa})})})}),b&&o.jsxRuntimeExports.jsx(h0,{children:Array.from({length:he.jobSkeletonRowCount},(E,$)=>o.jsxRuntimeExports.jsxs(g0,{children:[o.jsxRuntimeExports.jsx(Yo,{$flex:!0,children:o.jsxRuntimeExports.jsx(t.ContentLoaderSkeleton,{width:$%2===0?90:70,height:he.skeletonLoaderHeightPx})}),o.jsxRuntimeExports.jsx(Yo,{children:o.jsxRuntimeExports.jsx(t.ContentLoaderSkeleton,{width:60,height:he.skeletonLoaderHeightPx})}),o.jsxRuntimeExports.jsx(Yo,{children:o.jsxRuntimeExports.jsx(t.ContentLoaderSkeleton,{width:t.Space.sp11,height:he.skeletonLoaderHeightPx})}),o.jsxRuntimeExports.jsx(Yo,{children:o.jsxRuntimeExports.jsx(t.ContentLoaderSkeleton,{width:70,height:he.skeletonLoaderHeightPx})})]},`skeleton-${$}`))})]})]})]})]}),p!=null&&o.jsxRuntimeExports.jsx(Rs,{operationType:p.operationType,dialogTitle:Ve.actions[$s[p.operationType].labelKey],dialogDescription:ca(p.operationType,e.companyName),onCancel:()=>m(null),onConfirm:y})]})},pa=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():qt.emDash;return o.jsxRuntimeExports.jsxs(d0,{style:n,children:[o.jsxRuntimeExports.jsx(p0,{children:a}),o.jsxRuntimeExports.jsx(u0,{children:i.status}),o.jsxRuntimeExports.jsx(m0,{title:i.createdAt.format(Ro.hmmADashDDMMMCommaYYYY),children:i.createdAt.format(an.visual.MMMDCommaYYYYformat)}),o.jsxRuntimeExports.jsx(x0,{children:d})]})});pa.displayName="JobListItem";const Oy=u.forwardRef(({style:e,...n},r)=>o.jsxRuntimeExports.jsx("div",{ref:r,style:{...e,position:"relative"},...n})),Ny=e=>e>=he.accuracySuccessThresholdPercent?t.Colors.success:e>=he.accuracyAlertThresholdPercent?t.Colors.alert:t.Colors.important,My=e=>e.split("_").filter(n=>n.length>0).map(n=>n[0].toUpperCase()+n.slice(1).toLowerCase()).join(" "),zy=s.div`
|
|
2969
2969
|
display: flex;
|
|
2970
2970
|
flex-direction: column;
|
|
2971
2971
|
background-color: ${e=>e.theme.colors.grey4};
|
|
@@ -3205,7 +3205,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3205
3205
|
100% {
|
|
3206
3206
|
rotate: 720deg;
|
|
3207
3207
|
}
|
|
3208
|
-
`,{common:{strings:ho},dateFormat:Mr,timeFormat:zr,aiAccountantCustomer:hs}=t.appLocale.getLocalizedStrings(),$0=({customers:e,sortKey:n,sortOrder:r,selectedTenantIds:i,onAction:a,onCancelOnboarding:d,onColumnSortConfigChanged:l,onRowClick:c,onToggleAllVisible:p,onToggleTenantSelection:m})=>{const[x,g]=u.useState(null),h=vs(),C=u.useMemo(()=>new Set(i),[i]),b=i.length>0,S=u.useMemo(()=>e.map(F=>F.tenantId),[e]),y=u.useMemo(()=>S.filter(F=>C.has(F)).length,[S,C]),j=S.length>0&&y===S.length,f=y>0&&!j,E=F=>{l(F,n===F&&r==="ascending"?"descending":"ascending")},$=u.useCallback((F,D)=>{g({customer:F,operationType:D})},[]),A=u.useCallback((F,D,K)=>{x!=null&&a(x.customer,F,D,K),g(null)},[a,x]),
|
|
3208
|
+
`,{common:{strings:ho},dateFormat:Mr,timeFormat:zr,aiAccountantCustomer:hs}=t.appLocale.getLocalizedStrings(),$0=({customers:e,sortKey:n,sortOrder:r,selectedTenantIds:i,onAction:a,onCancelOnboarding:d,onColumnSortConfigChanged:l,onRowClick:c,onToggleAllVisible:p,onToggleTenantSelection:m})=>{const[x,g]=u.useState(null),h=vs(),C=u.useMemo(()=>new Set(i),[i]),b=i.length>0,S=u.useMemo(()=>e.map(F=>F.tenantId),[e]),y=u.useMemo(()=>S.filter(F=>C.has(F)).length,[S,C]),j=S.length>0&&y===S.length,f=y>0&&!j,E=F=>{l(F,n===F&&r==="ascending"?"descending":"ascending")},$=u.useCallback((F,D)=>{g({customer:F,operationType:D})},[]),A=u.useCallback((F,D,K)=>{x!=null&&a(x.customer,F,D,K),g(null)},[a,x]),I=u.useRef(null),v=u.useMemo(()=>({customerCount:e.length,customers:e,hasWriteAccess:h,isSelectionActive:b,onCancelOnboarding:d,onRequestAction:$,onRowClick:c,onToggleTenantSelection:m,selectedTenantIdSet:C}),[e,h,b,d,$,c,m,C]),w=u.useCallback(({scrollOffset:F})=>{I.current!=null&&(I.current.scrollLeft=F)},[]);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(v0,{children:[o.jsxRuntimeExports.jsxs(w0,{ref:I,children:[h&&o.jsxRuntimeExports.jsx(D0,{children:o.jsxRuntimeExports.jsx(o.Checkbox,{size:"small",checked:j,indeterminate:f,disabled:S.length===0,onChange:()=>p(S)})}),Ay.map(F=>{const D=n===F.key,K=r==="ascending"?"asc":"desc";return o.jsxRuntimeExports.jsx(k0,{$width:F.width,$justifyContent:F.justifyContent,$growToFill:F.growToFill,children:o.jsxRuntimeExports.jsx(T0,{children:F.sortable&&F.key!=="actions"?o.jsxRuntimeExports.jsxs(P0,{type:"button",$active:D,onClick:()=>E(F.key),children:[F.label,o.jsxRuntimeExports.jsx(I0,{$direction:D?K:"asc",children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:he.sortIconSize,height:he.sortIconSize})})]}):F.label})},F.key)})]}),e.length===0?o.jsxRuntimeExports.jsx(B0,{children:hs.table.noCustomersFound}):o.jsxRuntimeExports.jsx(L0,{children:o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:F,width:D})=>o.jsxRuntimeExports.jsx(o.FixedSizeList,{height:F,width:D,itemCount:e.length,itemSize:he.rowHeightPx,itemData:v,innerElementType:E0,onScroll:w,overscanCount:5,children:ua})})})]}),x!=null&&o.jsxRuntimeExports.jsx(Rs,{operationType:x.operationType,dialogTitle:hs.actions[$s[x.operationType].labelKey],dialogDescription:ca(x.operationType,x.customer.companyName),onCancel:()=>g(null),onConfirm:A})]})},ua=u.memo(({index:e,style:n,data:r})=>{const{customerCount:i,customers:a,hasWriteAccess:d,isSelectionActive:l,onCancelOnboarding:c,onRequestAction:p,onRowClick:m,onToggleTenantSelection:x,selectedTenantIdSet:g}=r,h=a[e],C=g.has(h.tenantId),b=e===i-1,[S,y]=u.useState(!1),j=u.useRef(null),[f,E]=u.useState({top:0,right:0}),$=h.enrollment?.status??"unknown",A=h.averageAccuracy,I=A>0?`${(A*100).toFixed(1)}${ho.percentage}`:ho.emDash;return u.useEffect(()=>{if(S&&j.current!=null){const v=j.current.getBoundingClientRect();E({top:v.bottom,right:window.innerWidth-v.right})}},[S]),u.useEffect(()=>{if(!S)return;const v=()=>y(!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)}},[S]),u.useEffect(()=>{l&&S&&y(!1)},[l,S]),o.jsxRuntimeExports.jsxs(A0,{style:n,$isSelected:C,onClick:()=>m(h),children:[d&&o.jsxRuntimeExports.jsx(O0,{$hideBorder:b,onClick:v=>v.stopPropagation(),children:o.jsxRuntimeExports.jsx(o.Checkbox,{size:"small",checked:C,onChange:()=>x(h.tenantId)})}),o.jsxRuntimeExports.jsx(N0,{$hideBorder:b,children:o.jsxRuntimeExports.jsxs("div",{children:[o.jsxRuntimeExports.jsx(W0,{children:h.companyName.length>0?h.companyName:h.companyId}),o.jsxRuntimeExports.jsx(_0,{children:h.tenantId})]})}),o.jsxRuntimeExports.jsx(M0,{$hideBorder:b,children:o.jsxRuntimeExports.jsx(V0,{status:$,children:da($)})}),o.jsxRuntimeExports.jsx(Hn,{$hideBorder:b,children:h.bookcloseDate!=null?h.bookcloseDate.format(Mr.visual.MMMDCommaYYYYformat):ho.emDash}),o.jsxRuntimeExports.jsx(Hn,{$hideBorder:b,title:h.enrollment?.latestTraining!=null?h.enrollment.latestTraining.format(zr.hmmADashDDMMMCommaYYYY):void 0,children:h.enrollment?.latestTraining!=null?h.enrollment.latestTraining.format(Mr.visual.MMMDCommaYYYYformat):ho.emDash}),o.jsxRuntimeExports.jsx(Hn,{$hideBorder:b,title:h.enrollment?.latestTransactionSync!=null?h.enrollment.latestTransactionSync.local().format(zr.hmmADashDDMMMCommaYYYY):void 0,children:h.enrollment?.latestTransactionSync!=null?h.enrollment.latestTransactionSync.utc(!0).fromNow():ho.emDash}),o.jsxRuntimeExports.jsx(z0,{$hideBorder:b,children:I}),o.jsxRuntimeExports.jsx(F0,{$hideBorder:b,children:d&&!l&&o.jsxRuntimeExports.jsxs(U0,{onClick:v=>v.stopPropagation(),children:[o.jsxRuntimeExports.jsx(H0,{ref:j,onClick:()=>y(!S),children:o.jsxRuntimeExports.jsx(t.SvgMore,{width:he.menuIconSize,height:he.menuIconSize})}),S&&Po.createPortal(o.jsxRuntimeExports.jsx(K0,{style:{top:f.top,right:f.right},children:Es($).map(v=>o.jsxRuntimeExports.jsx(G0,{onClick:()=>{y(!1),v.operationType==="cancel_onboarding"?c(h):p(h,v.operationType)},children:hs.actions[v.labelKey]},v.operationType))}),document.body)]})})]})});ua.displayName="AiAccountantCustomerListItem";const E0=u.forwardRef(({style:e,...n},r)=>o.jsxRuntimeExports.jsx("div",{ref:r,style:{...e,position:"relative"},...n})),v0=s.div`
|
|
3209
3209
|
position: relative;
|
|
3210
3210
|
flex: 1;
|
|
3211
3211
|
min-height: 0;
|
|
@@ -3265,14 +3265,14 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3265
3265
|
font: inherit;
|
|
3266
3266
|
text-align: inherit;
|
|
3267
3267
|
color: ${e=>e.$active?e.theme.colors.primary:"inherit"};
|
|
3268
|
-
`,
|
|
3268
|
+
`,I0=s.span`
|
|
3269
3269
|
display: inline-flex;
|
|
3270
3270
|
align-items: center;
|
|
3271
3271
|
margin-left: ${t.Space.sp1};
|
|
3272
3272
|
transform: rotate(
|
|
3273
3273
|
${e=>e.$direction==="desc"?"180deg":"0deg"}
|
|
3274
3274
|
);
|
|
3275
|
-
`,
|
|
3275
|
+
`,L0=s.div`
|
|
3276
3276
|
flex: 1;
|
|
3277
3277
|
min-height: 0;
|
|
3278
3278
|
`,A0=s.div`
|
|
@@ -3310,7 +3310,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3310
3310
|
justify-content: center;
|
|
3311
3311
|
border-bottom: ${e=>e.$hideBorder===!0?"none":`1px solid ${e.theme.colors.grey2}`};
|
|
3312
3312
|
min-height: ${he.rowHeightPx}px;
|
|
3313
|
-
`,
|
|
3313
|
+
`,Io=s.div`
|
|
3314
3314
|
flex: 0 0 auto;
|
|
3315
3315
|
box-sizing: border-box;
|
|
3316
3316
|
padding: ${t.Space.sp2} ${t.Space.sp3};
|
|
@@ -3319,17 +3319,17 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3319
3319
|
overflow: hidden;
|
|
3320
3320
|
border-bottom: ${e=>e.$hideBorder===!0?"none":`1px solid ${e.theme.colors.grey2}`};
|
|
3321
3321
|
min-height: ${he.rowHeightPx}px;
|
|
3322
|
-
`,N0=s(
|
|
3322
|
+
`,N0=s(Io)`
|
|
3323
3323
|
flex: 1 1 auto;
|
|
3324
3324
|
min-width: ${ot.companyName}px;
|
|
3325
|
-
`,M0=s(
|
|
3325
|
+
`,M0=s(Io)`
|
|
3326
3326
|
width: ${ot.status}px;
|
|
3327
|
-
`,Hn=s(
|
|
3327
|
+
`,Hn=s(Io)`
|
|
3328
3328
|
width: ${ot.bookcloseDate}px;
|
|
3329
|
-
`,z0=s(
|
|
3329
|
+
`,z0=s(Io)`
|
|
3330
3330
|
width: ${ot.accuracy}px;
|
|
3331
3331
|
justify-content: flex-end;
|
|
3332
|
-
`,F0=s(
|
|
3332
|
+
`,F0=s(Io)`
|
|
3333
3333
|
width: ${ot.actions}px;
|
|
3334
3334
|
justify-content: center;
|
|
3335
3335
|
overflow: visible;
|
|
@@ -3415,7 +3415,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3415
3415
|
`,Jo=s(t.LargeSemiBold)`
|
|
3416
3416
|
color: ${e=>e.theme.colors.primary};
|
|
3417
3417
|
margin-top: ${t.Space.sp2};
|
|
3418
|
-
`,tf=t.appLocale.getLocalizedStrings().common,{aiAccountantCustomer:Ze}=t.appLocale.getLocalizedStrings(),of="evaluate",nf=[{label:Ze.filters.enrollmentStatus.active,value:"active"},{label:Ze.filters.enrollmentStatus.pending,value:"pending"},{label:Ze.filters.enrollmentStatus.onboarding,value:"onboarding"},{label:Ze.filters.enrollmentStatus.offboarded,value:"offboarded"},{label:Ze.filters.enrollmentStatus.failed,value:"failed"}],sf=()=>({enrollmentStatus:nf}),rf=({headerData:e,headerActions:n,aiAccountantPageActions:r,aiAccountantPageData:i})=>{const a=t.useWindowSizeContext(),d=vs(),{aiAccountantView:l}=i,{onAction:c,onBulkAction:p,onCancelOnboarding:m,onClearSelection:x,onCockpitReloadData:g,onColumnSortConfigChanged:h,onCustomerSelected:C,onEvaluateAll:b,onFilterTextChanged:S,onFiltersChange:y,onToggleAllVisible:j,onToggleTenantSelection:f}=r,E=l.fetchState==="Completed",$=l.fetchState==="In-Progress"||l.fetchState==="Not-Started",A=l.fetchState==="Error",
|
|
3418
|
+
`,tf=t.appLocale.getLocalizedStrings().common,{aiAccountantCustomer:Ze}=t.appLocale.getLocalizedStrings(),of="evaluate",nf=[{label:Ze.filters.enrollmentStatus.active,value:"active"},{label:Ze.filters.enrollmentStatus.pending,value:"pending"},{label:Ze.filters.enrollmentStatus.onboarding,value:"onboarding"},{label:Ze.filters.enrollmentStatus.offboarded,value:"offboarded"},{label:Ze.filters.enrollmentStatus.failed,value:"failed"}],sf=()=>({enrollmentStatus:nf}),rf=({headerData:e,headerActions:n,aiAccountantPageActions:r,aiAccountantPageData:i})=>{const a=t.useWindowSizeContext(),d=vs(),{aiAccountantView:l}=i,{onAction:c,onBulkAction:p,onCancelOnboarding:m,onClearSelection:x,onCockpitReloadData:g,onColumnSortConfigChanged:h,onCustomerSelected:C,onEvaluateAll:b,onFilterTextChanged:S,onFiltersChange:y,onToggleAllVisible:j,onToggleTenantSelection:f}=r,E=l.fetchState==="Completed",$=l.fetchState==="In-Progress"||l.fetchState==="Not-Started",A=l.fetchState==="Error",I=l.triggerJobStatus.fetchState==="In-Progress",v=l.selectedTenantIds,w=v.length,F=l.unonboardedTenantIds.length,D=w>0,K=u.useMemo(()=>{if(!D)return[];const z=l.selectedCustomersForJobTrigger.map(te=>Es(te.enrollment?.status??"unknown"));if(z.length===0)return[];const[Y,...T]=z;return Y.filter(te=>te.operationType!=="cancel_onboarding"&&T.every(re=>re.some(Z=>Z.operationType===te.operationType)))},[D,l.selectedCustomersForJobTrigger]),[M,G]=u.useState(!1),q=u.useRef(null),[R,L]=u.useState({top:0,right:0});u.useEffect(()=>{if(M&&q.current!=null){const z=q.current.getBoundingClientRect();L({top:z.bottom,right:window.innerWidth-z.right})}},[M]),u.useEffect(()=>{if(!M)return;const z=()=>G(!1);return document.addEventListener("click",z),window.addEventListener("scroll",z,!0),window.addEventListener("resize",z),()=>{document.removeEventListener("click",z),window.removeEventListener("scroll",z,!0),window.removeEventListener("resize",z)}},[M]);const[W,k]=u.useState(null),P=()=>{F===0||I||k({mode:"evaluateAll",count:F})},N=z=>{G(!1),k({mode:"bulk",operationType:z.operationType,operationLabel:Ze.actions[z.labelKey],count:w})},Q=(z,Y,T)=>{W!=null&&(W.mode==="evaluateAll"?b(Y,T):p(z,Y,T),k(null))},ae=D||F===0||I;return o.jsxRuntimeExports.jsxs(af,{children:[o.jsxRuntimeExports.jsx(dt,{headerActions:{...n,filterActions:{onFilterTextChanged:(z,Y)=>{S(Y)},getCategoryWiseOptions:sf,onFiltersChange:y}},headerData:{...e,allTabOptions:e.allTabOptions??it,companiesLoaded:E,filterData:{filterText:l.uiState.filterText,filters:l.uiState.filters},selectedTabOption:"aiAccountant"}}),o.jsxRuntimeExports.jsx(lf,{windowSize:a,children:$?o.jsxRuntimeExports.jsx(Z0,{}):A?o.jsxRuntimeExports.jsx($t,{onCockpitReloadData:g,selectedCockpitOption:"aiAccountant"}):o.jsxRuntimeExports.jsxs(ff,{children:[o.jsxRuntimeExports.jsxs(cf,{children:[o.jsxRuntimeExports.jsx(df,{children:D&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(uf,{children:Ze.bulkActions.selectedCount.replace("__count__",String(w))}),o.jsxRuntimeExports.jsx(mf,{type:"button",onClick:x,children:tf.clear})]})}),o.jsxRuntimeExports.jsxs(pf,{children:[o.jsxRuntimeExports.jsx(y0,{isEnabled:!$,spinRefreshIcon:$,onClick:()=>g("aiAccountant")}),d&&!D&&o.jsxRuntimeExports.jsx(t.Button,{label:Ze.summary.evaluateAll,variant:"primary",size:"small",disabled:ae,onClick:P}),d&&D&&o.jsxRuntimeExports.jsxs(xf,{children:[o.jsxRuntimeExports.jsxs(hf,{ref:q,onClick:z=>z.stopPropagation(),children:[o.jsxRuntimeExports.jsx(t.Button,{label:Ze.bulkActions.menuLabel,variant:"primary",size:"small",disabled:K.length===0||I,onClick:()=>G(!M)}),M&&K.length>0&&Po.createPortal(o.jsxRuntimeExports.jsx(Sf,{style:{top:R.top,right:R.right},children:K.map(z=>o.jsxRuntimeExports.jsx(yf,{onClick:()=>N(z),children:Ze.actions[z.labelKey]},z.operationType))}),document.body)]}),K.length===0&&o.jsxRuntimeExports.jsx(gf,{children:Ze.bulkActions.disabledInfo})]})]})]}),o.jsxRuntimeExports.jsx(J0,{averageAccuracy:l.averageAccuracy,customers:l.customers}),o.jsxRuntimeExports.jsx($0,{customers:l.customers,sortKey:l.uiState.sortKey,sortOrder:l.uiState.sortOrder,selectedTenantIds:v,onColumnSortConfigChanged:h,onRowClick:C,onAction:c,onCancelOnboarding:m,onToggleAllVisible:j,onToggleTenantSelection:f})]})}),W!=null&&o.jsxRuntimeExports.jsx(Rs,{operationType:W.mode==="evaluateAll"?of:W.operationType,dialogTitle:W.mode==="evaluateAll"?Ze.bulkActions.evaluateAllDialogTitle:W.operationLabel,dialogDescription:W.mode==="evaluateAll"?Ze.bulkActions.evaluateAllDialogDescription.replace("__count__",String(W.count)):W.operationType==="offboard"?Ze.bulkActions.bulkDialogDescriptionOffboard.replace("__count__",String(W.count)):Ze.bulkActions.bulkDialogDescription.replace("__count__",String(W.count)).replace("__action__",W.operationLabel),onCancel:()=>k(null),onConfirm:Q})]})},af=s.div`
|
|
3419
3419
|
height: calc(100vh - ${he.globalNavBarHeightPx}px);
|
|
3420
3420
|
overflow-y: hidden;
|
|
3421
3421
|
background-color: ${e=>e.theme.colors.grey4};
|
|
@@ -3483,7 +3483,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3483
3483
|
flex-direction: column;
|
|
3484
3484
|
flex: 1;
|
|
3485
3485
|
min-height: 0;
|
|
3486
|
-
`,Pt={1:12,2:64,3:95};function Cf({qboConnectionPool:e,isLoading:n,onQBOConnectClick:r}){const i=t.appLocale.getLocalizedStrings().cockpit.onboarding.qboSetupAutomated;return o.jsxRuntimeExports.jsx(jf,{children:o.jsxRuntimeExports.jsx(bf,{children:o.jsxRuntimeExports.jsxs(Rf,{children:[n===!0?o.jsxRuntimeExports.jsx(Br,{children:o.jsxRuntimeExports.jsx(t.ContentLoaderSkeleton,{width:154,height:t.sp[4]})}):o.jsxRuntimeExports.jsx(Br,{children:i.qboSectionText}),o.jsxRuntimeExports.jsxs($f,{children:[o.jsxRuntimeExports.jsxs(Kn,{minWidth:t.Space.sp9,children:[n===!0?o.jsxRuntimeExports.jsx(Zt,{children:o.jsxRuntimeExports.jsx(t.ContentLoaderSkeleton,{width:Pt[1],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(Zt,{children:e.essentialConnectionsCount}),n===!0?o.jsxRuntimeExports.jsx(
|
|
3486
|
+
`,Pt={1:12,2:64,3:95};function Cf({qboConnectionPool:e,isLoading:n,onQBOConnectClick:r}){const i=t.appLocale.getLocalizedStrings().cockpit.onboarding.qboSetupAutomated;return o.jsxRuntimeExports.jsx(jf,{children:o.jsxRuntimeExports.jsx(bf,{children:o.jsxRuntimeExports.jsxs(Rf,{children:[n===!0?o.jsxRuntimeExports.jsx(Br,{children:o.jsxRuntimeExports.jsx(t.ContentLoaderSkeleton,{width:154,height:t.sp[4]})}):o.jsxRuntimeExports.jsx(Br,{children:i.qboSectionText}),o.jsxRuntimeExports.jsxs($f,{children:[o.jsxRuntimeExports.jsxs(Kn,{minWidth:t.Space.sp9,children:[n===!0?o.jsxRuntimeExports.jsx(Zt,{children:o.jsxRuntimeExports.jsx(t.ContentLoaderSkeleton,{width:Pt[1],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(Zt,{children:e.essentialConnectionsCount}),n===!0?o.jsxRuntimeExports.jsx(It,{children:o.jsxRuntimeExports.jsx(t.ContentLoaderSkeleton,{width:Pt[2],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(It,{children:i.typeOfQBOAccount.essentials})]}),o.jsxRuntimeExports.jsxs(Kn,{minWidth:"28px",children:[n===!0?o.jsxRuntimeExports.jsx(Zt,{children:o.jsxRuntimeExports.jsx(t.ContentLoaderSkeleton,{width:Pt[1],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(Zt,{children:e.plusConnectionsCount}),n===!0?o.jsxRuntimeExports.jsx(It,{children:o.jsxRuntimeExports.jsx(t.ContentLoaderSkeleton,{width:Pt[2],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(It,{children:i.typeOfQBOAccount.plus})]}),o.jsxRuntimeExports.jsxs(Kn,{minWidth:"62px",children:[n===!0?o.jsxRuntimeExports.jsx(Zt,{children:o.jsxRuntimeExports.jsx(t.ContentLoaderSkeleton,{width:Pt[1],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(Zt,{children:e.advanceConnectionsCount}),n===!0?o.jsxRuntimeExports.jsx(It,{children:o.jsxRuntimeExports.jsx(t.ContentLoaderSkeleton,{width:Pt[2],height:t.sp[3]})}):o.jsxRuntimeExports.jsx(It,{children:i.typeOfQBOAccount.advanced})]})]}),n===!0?o.jsxRuntimeExports.jsx(Wr,{children:o.jsxRuntimeExports.jsx(t.ContentLoaderSkeleton,{width:Pt[3],height:t.sp[4]})}):o.jsxRuntimeExports.jsxs(Wr,{onClick:()=>{r()},children:[o.jsxRuntimeExports.jsx(Ef,{className:"setupQbo"}),o.jsxRuntimeExports.jsx(It,{className:"setupQbo",children:i.setupQBO})]})]})})})}const jf=s.div`
|
|
3487
3487
|
z-index: 2;
|
|
3488
3488
|
display: flex;
|
|
3489
3489
|
flex-direction: column;
|
|
@@ -3548,7 +3548,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3548
3548
|
align-self: center;
|
|
3549
3549
|
margin-right: ${t.Space.sp2};
|
|
3550
3550
|
color: ${e=>e.theme.colors.hero};
|
|
3551
|
-
`,
|
|
3551
|
+
`,It=s(t.SmallRegular)`
|
|
3552
3552
|
color: ${e=>e.theme.colors.hero};
|
|
3553
3553
|
`,vf=t.appLocale.getLocalizedStrings().common,wf=s.div`
|
|
3554
3554
|
display: flex;
|
|
@@ -3582,11 +3582,11 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3582
3582
|
white-space: pre-line;
|
|
3583
3583
|
text-align: left;
|
|
3584
3584
|
width: ${e=>e.windowSize==="small"?"auto":"432px"};
|
|
3585
|
-
`,en=s(t.StandardRegularLi)``,
|
|
3585
|
+
`,en=s(t.StandardRegularLi)``,If=s.hr`
|
|
3586
3586
|
width: 100%;
|
|
3587
3587
|
border: 0.2px solid ${e=>e.theme.colors.grey3};
|
|
3588
3588
|
margin-top: auto;
|
|
3589
|
-
`;function
|
|
3589
|
+
`;function Lf(e){const{onCancelClick:n,onGoLiveClick:r,showGoLivePopup:i,loading:a}=e,d=t.appLocale.getLocalizedStrings().cockpit.onboarding,l=t.useWindowSizeContext();return o.jsxRuntimeExports.jsx(o.Modal,{"aria-labelledby":"modal-title","aria-describedby":"modal-description",open:i,BackdropProps:{style:{backgroundColor:t.Colors.modalBackground}},children:o.jsxRuntimeExports.jsxs(wf,{children:[o.jsxRuntimeExports.jsx(kf,{children:d.goLiveTitle}),o.jsxRuntimeExports.jsx(Tf,{children:d.goLiveDescription}),o.jsxRuntimeExports.jsxs(Pf,{windowSize:l,children:[o.jsxRuntimeExports.jsx(en,{children:d.goLiveSteps.stepOne}),o.jsxRuntimeExports.jsx(en,{children:d.goLiveSteps.stepTwo}),o.jsxRuntimeExports.jsx(en,{children:d.goLiveSteps.stepThree}),o.jsxRuntimeExports.jsx(en,{children:d.goLiveSteps.stepFour})]}),o.jsxRuntimeExports.jsx(If,{}),o.jsxRuntimeExports.jsxs(Af,{onClick:c=>c.stopPropagation(),children:[o.jsxRuntimeExports.jsx(t.Button,{label:vf.cancel,onClick:n,size:"standard",type:"reset",disabled:a}),o.jsxRuntimeExports.jsx(Df,{space:t.Space.sp3}),o.jsxRuntimeExports.jsx(t.Button,{variant:"primary",label:d.goLiveText,loading:a,disabled:a,size:"standard",onClick:r})]})]})})}const Af=s.div`
|
|
3590
3590
|
display: flex;
|
|
3591
3591
|
bottom: 0;
|
|
3592
3592
|
left: 0;
|
|
@@ -3758,7 +3758,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3758
3758
|
margin-left: ${e=>e.setMargin===!0?"20px":t.Space.sp0};
|
|
3759
3759
|
`,o2=s.div`
|
|
3760
3760
|
height: 18px;
|
|
3761
|
-
`,{common:Te,cockpit:Yr}=t.appLocale.getLocalizedStrings(),Gn=({headerItemData:e,onboardingInfo:n,allUsers:r,retryButtonLoading:i,viaCockpit:a=!1,isDisabled:d=!1,headerKey:l,onOnboardingStepClicked:c,onRetry:p})=>{if(n!=null&&
|
|
3761
|
+
`,{common:Te,cockpit:Yr}=t.appLocale.getLocalizedStrings(),Gn=({headerItemData:e,onboardingInfo:n,allUsers:r,retryButtonLoading:i,viaCockpit:a=!1,isDisabled:d=!1,headerKey:l,onOnboardingStepClicked:c,onRetry:p})=>{if(n!=null&&Ll(e.key,n)===!0){const m=e.key,x=n[m],g=x.userIds!=null?r.find(b=>b.userId===x.userIds[0]):null,h=x.errorDetails!=null?x.errorDetails.summary:m==="qboLinked"?Yr.review.errors.qboLinked:Yr.review.errors.bankAccountLinked,C=`${Te.via} ${Te.cockpit}`;return x.error===!0&&(m==="qboLinked"||m==="bankAccountLinked")?o.jsxRuntimeExports.jsxs(tn,{children:[o.jsxRuntimeExports.jsxs(n2,{children:[o.jsxRuntimeExports.jsx(t.SvgHighImportance,{width:t.sp[3],height:t.sp[3]}),o.jsxRuntimeExports.jsxs(i2,{children:[o.jsxRuntimeExports.jsx(a2,{children:o.jsxRuntimeExports.jsx(t.Tooltip,{display:"flex",placement:"bottom",title:o.jsxRuntimeExports.jsx(l2,{children:h}),children:o.jsxRuntimeExports.jsx(s2,{children:h})})}),o.jsxRuntimeExports.jsx(r2,{}),o.jsxRuntimeExports.jsx(t.Button,{variant:"ghost",size:"small",label:Te.retry,loading:i===!0,onClick:p})]})]}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:g!=null,children:o.jsxRuntimeExports.jsx(on,{setMargin:!0,children:`${a===!0?C:Te.strings.empty}${m==="bankAccountLinked"&&t.isZeniAIUser(r,g?.userId)===!0?`${Te.via} ${Te.texts.chargebee}`:`${Te.by} ${g?.firstName??Te.strings.empty} ${g?.lastName??Te.strings.empty}`}`})})]}):x.completed===!0?o.jsxRuntimeExports.jsxs(tn,{children:[o.jsxRuntimeExports.jsx(wo,{complete:!0,onClick:c!=null?()=>{c(e.key)}:void 0}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:g!=null,children:o.jsxRuntimeExports.jsx(on,{setMargin:!1,children:`${a===!0?C:Te.strings.empty}${m==="bankAccountLinked"&&t.isZeniAIUser(r,g?.userId)===!0?`${Te.via} ${Te.texts.chargebee}`:`${Te.by} ${g?.firstName??Te.strings.empty} ${g?.lastName??Te.strings.empty}`}`})}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:g==null,children:o.jsxRuntimeExports.jsx(Yn,{})})]}):x.pendingVerification===!0&&l==="bankAccountLinked"?o.jsxRuntimeExports.jsxs(tn,{children:[o.jsxRuntimeExports.jsx(wo,{complete:!1,pendingVerification:!0,onClick:c!=null?()=>{c(e.key)}:void 0}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:g!=null,children:o.jsxRuntimeExports.jsx(on,{setMargin:!1,children:`${a===!0?C:Te.strings.empty}${m==="bankAccountLinked"&&t.isZeniAIUser(r,g?.userId)===!0?`${Te.via} ${Te.texts.chargebee}`:`${Te.by} ${g?.firstName??Te.strings.empty} ${g?.lastName??Te.strings.empty}`}`})}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:g==null,children:o.jsxRuntimeExports.jsx(Yn,{})})]}):o.jsxRuntimeExports.jsxs(tn,{children:[o.jsxRuntimeExports.jsx(wo,{isDisabled:d,complete:!1,onClick:c!=null?()=>{c(e.key)}:void 0}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:g!=null,children:o.jsxRuntimeExports.jsx(on,{setMargin:!1,children:`${a===!0?C:Te.strings.empty}${m==="bankAccountLinked"&&t.isZeniAIUser(r,g?.userId)===!0?`${Te.via} ${Te.texts.chargebee}`:`${Te.by} ${g?.firstName??Te.strings.empty} ${g?.lastName??Te.strings.empty}`}`})}),o.jsxRuntimeExports.jsx(t.ControlledComponent,{controller:g==null,children:o.jsxRuntimeExports.jsx(Yn,{})})]})}return null},tn=s.div``,n2=s.div`
|
|
3762
3762
|
display: flex;
|
|
3763
3763
|
align-items: center;
|
|
3764
3764
|
column-gap: ${t.Space.sp1};
|
|
@@ -3797,7 +3797,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3797
3797
|
margin-left: ${e=>e.setMargin===!0?"20px":t.Space.sp0};
|
|
3798
3798
|
`,Yn=s.div`
|
|
3799
3799
|
height: 18px;
|
|
3800
|
-
`,{common:{strings:c2},cockpit:{onboarding:Zn}}=t.appLocale.getLocalizedStrings(),d2=["bankAccountLinked","qboLinked","identityVerified","businessVerified"],p2=({companyView:e,companyNameSticky:n,allUsers:r,sendInviteFetchState:i,retryBankAccountConnectionFetchState:a,totalHeight:d,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:p,setNoteData:m,setElementRef:x,setAddThreadRequestThreadId:g,onOnboardingStepClicked:h,onSendInviteClick:C,redirectToDashboardOnboarding:b,onRetryBankAccountConnection:S})=>{const[y,j]=u.useState(null),f=t.useWindowSizeContext(),E=o.useForm({mode:"all"}),{company:{company:{companyInfo:{companyId:$,name:A,primaryEmailDomain:
|
|
3800
|
+
`,{common:{strings:c2},cockpit:{onboarding:Zn}}=t.appLocale.getLocalizedStrings(),d2=["bankAccountLinked","qboLinked","identityVerified","businessVerified"],p2=({companyView:e,companyNameSticky:n,allUsers:r,sendInviteFetchState:i,retryBankAccountConnectionFetchState:a,totalHeight:d,addThreadRequestThreadId:l,targetElementFromNavigation:c,resetTargetElementFromNavigation:p,setNoteData:m,setElementRef:x,setAddThreadRequestThreadId:g,onOnboardingStepClicked:h,onSendInviteClick:C,redirectToDashboardOnboarding:b,onRetryBankAccountConnection:S})=>{const[y,j]=u.useState(null),f=t.useWindowSizeContext(),E=o.useForm({mode:"all"}),{company:{company:{companyInfo:{companyId:$,name:A,primaryEmailDomain:I},companyOnboardingInfo:{onboardingInfo:v}}},tenant:w,onboardingCustomerInfo:F}=e,D=u2(e,r),K={companyEmailDomain:I,companyName:A,customerEmail:F.email??F.receiverEmails[0]??""},M=`cockpit_${$}`,G="onboarding.notes",{threads:q,isLoading:R}=t.useFilteredThreads({entityType:G,companyId:$},!1),{openThread:L,threads:W,addThread:k,removeThread:P,setOpenThread:N}=u.useContext(t.ThreadsContext),Q=L!==null?W.get(L):null,ae=L?.includes($)===!0,z=L!=null&&W.get(L)==null&&ae,Y=l!=null&&W.get(l)?.metadata.companyId===$,T=u.useCallback(()=>{L?.includes(t.NEW_THREAD_SUFFIX)===!0&&P(L),l!=null&&g(void 0)},[l,L,P,g]),te=B=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:B.isElementThreadOpen??!1,isElementThreadPresent:B.isElementThreadPresent??!1,itemKey:B.itemKey,elementThreadId:B.elementThreadId??c2.empty,roomId:M,addThreadRequestThreadId:l,openThreadId:L,threadStyle:B.threadStyle,openThreadMetadata:Q?.metadata??null,onElementClick:Z,onAddThreadClick:ie,targetElement:c??y}),re=u.useCallback(B=>{if(B===L)N(null);else if(W.has(B))N(B);else if(B.includes(t.NEW_THREAD_SUFFIX)){const[de,je]=B.replace(t.NEW_THREAD_SUFFIX,"").split("."),U=_t(Rt(de),J.toOnboardingSortKeyType(je),$,A);k(B,{type:"thread",visibility:"public",id:B,roomId:M,createdAt:new Date,updatedAt:new Date,comments:[],metadata:U,resolved:!1}),N(B)}},[$,A,L,W,k,N,M]),Z=u.useCallback((B,de,je=!1)=>{const U=zt.find(_=>_.key===de);if(p(),U!=null&&(B.type==="contextmenu"||je===!0)){if(U.isThreadAllowed===!1)return;T(),B.preventDefault(),B.stopPropagation();const _=t.toCollaborationEntityType({tab:"onboarding",key:U.key});if(B.target instanceof HTMLElement||B.target instanceof SVGElement)if(je===!0&&B.target instanceof HTMLElement)j(B.target.parentElement);else if(B.target instanceof HTMLElement){const fe=fs(B.target,oe);j(fe||B.target)}else{const fe=B.target.closest(`.${oe}`);fe instanceof HTMLElement&&j(fe)}const ce=[...t.getFilteredThreads(W,{entityType:_,companyId:$},"both")],Se=ce.length>0&&ce[0].length>0?ce[0][0]:Pe("onboarding",U.key,$);W.has(Se)?re(Se):l===Se?g(void 0):(g(Se),N(null))}},[W,$,l,re,g,N,p,T]),ie=u.useCallback((B,de)=>{B.stopPropagation();const je=Pe("onboarding",de,$);g(void 0),re(je)},[$,g,re]),ne=(B,de)=>{},xe=u.useCallback(()=>{S($)},[S,$]);u.useEffect(()=>{const B=E.watch((de,{name:je})=>{je!=null&&de.companyData!=null&&o.defer(()=>ne())});return()=>{B.unsubscribe()}});const ye=v?.inviteSent,$e=v?.accountingConnectionCreationMode,V=u.useCallback(B=>{if(v==null)return!1;switch(B){case"bankAccountLinked":case"qboLinked":case"identityVerified":case"businessVerified":return!0;default:return!1}},[v]),ee=u.useCallback(B=>{if(d2.includes(B)&&V(B)){b(I);return}h($,B)},[b,I,$,h,V]),{useFeatureGate:ge}=t.useZeniFeatureContext(),{isFeatureEnabled:ve}=ge(t.FeatureGatesNames.isDebitCardFeatureEnabled),Ce=J.isTenantBankingOnly(ve,w),O=u.useMemo(()=>{const B=v?.inviteAccepted===!0,de=v?.groupCreated.completed===!0,je=v?.customerCreated.completed===!0,U=v?.accountingConnectionCreationMode==null,_=v?.accountingConnectionCreationMode==="zeni_user"&&v?.qboLinked.completed!==!0,ce=!Ce;return B||!de||!je||U&&ce||_&&ce},[v?.accountingConnectionCreationMode,v?.customerCreated.completed,v?.groupCreated.completed,v?.inviteAccepted,v?.qboLinked.completed,Ce]),ke=u.useMemo(()=>v?.inviteSent===!0?Zn.resendInvite:Zn.sendInvite,[v?.inviteSent]);return o.jsxRuntimeExports.jsx(o.FormProvider,{...E,children:o.jsxRuntimeExports.jsx("form",{style:{height:"100%"},children:o.jsxRuntimeExports.jsx(o.ClickAwayListener,{onClickAway:()=>{p(),l!=null&&(g(void 0),l.includes(t.NEW_THREAD_SUFFIX)&&P(l))},children:o.jsxRuntimeExports.jsx(x2,{windowSize:f,isThreadOpen:ae||Y,totalHeight:d,isCreationInProgress:z,children:zt.map((B,de)=>{const je=t.toCollaborationEntityType({tab:"onboarding",key:B.key}),U=zt.length-2<=de,_=[...t.getFilteredThreads(W,{entityType:je,companyId:$},"both")],ce=_.length>0&&_[0].length>0?_[0][0]:Pe("onboarding",B.key,$),Se=W.get(ce),fe=Se!=null&&Se.resolved===!1,Ie=ce===L,H=l===ce;switch(B.key){case"companyName":return o.jsxRuntimeExports.jsxs(h2,{companyNameSticky:n,columnWidth:B.width,windowSize:f,isThreadOpen:Ie||H,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:ue=>Z(ue,B.key),ref:ue=>{x($,B.key,ue)},children:[o.jsxRuntimeExports.jsxs(m2,{children:[o.jsxRuntimeExports.jsx(g2,{onClick:ue=>{ue.preventDefault()},children:A||I}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:Ie,targetElement:c??y,roomId:M,openThreadId:L,openThreadMetadata:Q?.metadata??null})]}),o.jsxRuntimeExports.jsxs(S2,{className:"notesIcon",onClick:ue=>{ue.preventDefault(),m({roomId:M,companyId:$,companyName:A,entityType:G})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:q.length,isLoading:R}),o.jsxRuntimeExports.jsx(y2,{})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:fe,itemKey:B.key,style:{left:t.Space.sp4},onElementClick:Z}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Pe("onboarding",B.key,$),addThreadRequestThreadId:l,itemKey:B.key,onAddThreadClick:ie})]},ce);case"groupCreated":case"customerCreated":return o.jsxRuntimeExports.jsxs(Xt,{ref:ue=>{x($,B.key,ue)},columnWidth:B.width,windowSize:f,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:ue=>Z(ue,B.key),children:[o.jsxRuntimeExports.jsx(Gn,{headerItemData:B,onOnboardingStepClicked:ee,onboardingInfo:v,allUsers:r}),te({isElementThreadOpen:Ie,isElementThreadPresent:fe,itemKey:B.key,elementThreadId:ce,threadStyle:U?{right:t.Space.sp0}:void 0})]},ce);case"bankAccountLinked":return o.jsxRuntimeExports.jsxs(Xt,{ref:ue=>{x($,B.key,ue)},columnWidth:B.width,windowSize:f,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:ue=>Z(ue,B.key),children:[o.jsxRuntimeExports.jsx(Gn,{headerItemData:B,onOnboardingStepClicked:ee,onboardingInfo:v,allUsers:r,isDisabled:ye!==!0,onRetry:xe,retryButtonLoading:a==="In-Progress",headerKey:B.key}),te({isElementThreadOpen:Ie,isElementThreadPresent:fe,itemKey:B.key,elementThreadId:ce,threadStyle:U?{right:t.Space.sp0}:void 0})]},ce);case"qboLinked":return o.jsxRuntimeExports.jsxs(Xt,{ref:ue=>{x($,B.key,ue)},columnWidth:B.width,windowSize:f,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:ue=>Z(ue,B.key),children:[o.jsxRuntimeExports.jsx(Gn,{headerItemData:B,onOnboardingStepClicked:ee,onboardingInfo:v,allUsers:r,isDisabled:$e==="customer"&&ye!==!0||Ce}),te({isElementThreadOpen:Ie,isElementThreadPresent:fe,itemKey:B.key,elementThreadId:ce,threadStyle:U?{right:t.Space.sp0}:void 0})]},ce);case"identityVerified":case"businessVerified":return o.jsxRuntimeExports.jsxs(Xt,{ref:ue=>{x($,B.key,ue)},columnWidth:B.width,windowSize:f,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:ue=>Z(ue,B.key),children:[o.jsxRuntimeExports.jsx(Xf,{headerItemData:B,onOnboardingStepClicked:ee,onboardingInfo:v,allUsers:r,isDisabled:ye!==!0}),te({isElementThreadOpen:Ie,isElementThreadPresent:fe,itemKey:B.key,elementThreadId:ce,threadStyle:U?{right:t.Space.sp0}:void 0})]},ce);case"enroller":return o.jsxRuntimeExports.jsxs(Xt,{ref:ue=>{x($,B.key,ue)},columnWidth:B.width,windowSize:f,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:ue=>Z(ue,B.key),children:[o.jsxRuntimeExports.jsx(t.UserMultiSelectField,{name:"companyData.controller",value:D.controller,placeholderLabel:Zn.onboardingUsersPlaceholder,isReadOnly:!0,pickerStyles:{titleTextStyle:t.textStyles.largeRegular,multiValueLabelTitleStyle:t.textStyles.largeRegular}}),te({isElementThreadOpen:Ie,isElementThreadPresent:fe,itemKey:B.key,elementThreadId:ce,threadStyle:U?{right:t.Space.sp0}:void 0})]},ce);case"invite":return o.jsxRuntimeExports.jsxs(Xt,{ref:ue=>{x($,B.key,ue)},columnWidth:B.width,windowSize:f,isThreadAllowed:B.isThreadAllowed,className:oe,onContextMenu:ue=>Z(ue,B.key),children:[o.jsxRuntimeExports.jsx(t.Button,{disabled:O,variant:"primary",label:ke,onClick:()=>C($,v?.inviteSent??!1,K),size:"small",loading:i==="In-Progress"}),te({isElementThreadOpen:Ie,isElementThreadPresent:fe,itemKey:B.key,elementThreadId:ce,threadStyle:U?{right:t.Space.sp0}:void 0})]},ce);default:return null}})})})})})};function u2(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 m2=s.div``,x2=s.div`
|
|
3801
3801
|
display: flex;
|
|
3802
3802
|
flex-direction: row;
|
|
3803
3803
|
align-items: center;
|
|
@@ -3897,7 +3897,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3897
3897
|
z-index: auto;
|
|
3898
3898
|
cursor: ${e=>e.isThreadAllowed?"pointer":"initial"};
|
|
3899
3899
|
position: relative;
|
|
3900
|
-
`,f2={onboardingRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{cockpit:{onboarding:C2},common:{headers:{comments:j2}},collaboration:{threads:{placeholder:{addANewComment:b2,replyAComment:R2},tooltip:{resolveComment:$2,unResolveComment:E2}}}}=t.appLocale.getLocalizedStrings(),v2=({onboardingView:e,qboConnectionPoolFlag:n,onSendInviteClick:r,onOnboardingStepClicked:i,onCancelClicked:a,onGoLiveClicked:d,onScroll:l,onUpdateCustomerCreationStatus:c,onColumnSortConfigChanged:p,redirectToDashboardOnboarding:m,onRetryBankAccountConnection:x,onQBOConnectClick:g,initialOpenThreadRequest:h})=>{const C=t.useWindowSizeContext(),b=u.useRef(null),[S,y]=u.useState(null),{setOpenThread:j,setRequestToOpenThread:f,requestToOpenThread:E,isLoading:$}=u.useContext(t.ThreadsContext);u.useEffect(()=>{h!=null&&e.fetchState==="Completed"&&$===!1&&f(h)},[h,e.fetchState,$,f]);const[A,
|
|
3900
|
+
`,f2={onboardingRightPadding:new t.ResponsiveSized(t.sp[3],t.sp[8])},{cockpit:{onboarding:C2},common:{headers:{comments:j2}},collaboration:{threads:{placeholder:{addANewComment:b2,replyAComment:R2},tooltip:{resolveComment:$2,unResolveComment:E2}}}}=t.appLocale.getLocalizedStrings(),v2=({onboardingView:e,qboConnectionPoolFlag:n,onSendInviteClick:r,onOnboardingStepClicked:i,onCancelClicked:a,onGoLiveClicked:d,onScroll:l,onUpdateCustomerCreationStatus:c,onColumnSortConfigChanged:p,redirectToDashboardOnboarding:m,onRetryBankAccountConnection:x,onQBOConnectClick:g,initialOpenThreadRequest:h})=>{const C=t.useWindowSizeContext(),b=u.useRef(null),[S,y]=u.useState(null),{setOpenThread:j,setRequestToOpenThread:f,requestToOpenThread:E,isLoading:$}=u.useContext(t.ThreadsContext);u.useEffect(()=>{h!=null&&e.fetchState==="Completed"&&$===!1&&f(h)},[h,e.fetchState,$,f]);const[A,I]=u.useState(void 0),v=u.useRef(null),w=u.useRef([]),[F,D]=u.useState(null),K=!(C==="small"||C==="medium-compact"),{uiState:M}=e,G=C2.onboardingCompleted.replace("_company-name_",M.selectedCustomerName),[q,R]=u.useState("Not-Started"),[L,W]=u.useState("Not-Started"),{saveFetchState:k,customerCreationStatus:P}=e;u.useEffect(()=>{k.fetchState==="Completed"&&P.stage!=="none"?(W("Not-Started"),R(k.fetchState)):R("Not-Started")},[k.fetchState,P]),u.useEffect(()=>{e.updateStatus.fetchState==="Completed"?(R("Not-Started"),W(e.updateStatus.fetchState)):W("Not-Started")},[e.updateStatus.fetchState]);const N=0,Q=u.useCallback(()=>{const te=e.onboardingCustomers.filter(re=>re.company.company.companyInfo.companyId===M.selectedCompanyId);if(te.length>0){const{company:re,onboardingCustomerInfo:Z,tenant:ie}=te[0],ne={companyEmailDomain:Z.companyEmailDomain,companyId:re.company.companyInfo.companyId,isOnboardingCompleted:!0,isOnboardingTenant:!0,tenantId:ie.tenantId,userEmailWithPreOnboardSuccess:Z.userEmailWithPreOnboardSuccess};d(ne)}},[d,e.onboardingCustomers,M.selectedCompanyId]),ae=u.useCallback(te=>e.onboardingCustomers[te].company.company.companyInfo.name.length>Wt?Ae+32:Ae,[e.onboardingCustomers]);u.useEffect(()=>{b.current&&b.current.resetAfterIndex(0)},[e]);const z=u.useMemo(()=>({makeCompanyNameSticky:K,uiState:M,onColumnSortConfigChanged:p}),[K,M,p]),Y=u.useCallback((te,re,Z)=>{const ie=e.onboardingCustomers.findIndex(xe=>xe.company.company.companyInfo.companyId===te),ne=zt.findIndex(xe=>xe.key===re);ie!==-1&&ne!==-1&&(w.current[ie]==null?w.current[ie]=[Z]:w.current[ie][ne]=Z)},[e.onboardingCustomers]),T=u.useCallback(()=>{v.current=null,f(null)},[f]);return u.useEffect(()=>{if(E!=null&&S!=null){const{companyId:te,entityType:re}=E,[Z,ie]=re.split("."),ne=e.onboardingCustomers.findIndex(V=>V.company.company.companyInfo.companyId===te),xe=zt.findIndex(V=>V.key===ie);ne!==-1&&!(S.visibleStartIndex<=ne&&S.visibleStopIndex>=ne)&&b.current?.scrollToItem(ne,"center"),setTimeout(()=>{const V=w.current[ne]?.[0]?.getBoundingClientRect().bottom,ee=w.current[ne]?.[0]?.getBoundingClientRect().top;if(V!=null&&ee!=null&&(window.innerHeight>=V&&window.innerHeight>=ee||ee<0)){const ge=w.current[ne][xe];ge!=null&&(v.current={companyId:te,target:ge}),w.current[ne][xe]?.scrollIntoView({block:"center",behavior:"auto"})}},0);const $e=setInterval(()=>{const V=w.current[ne]?.[xe]?.getBoundingClientRect().left,ee=w.current[ne]?.[xe]?.getBoundingClientRect().right,ge=w.current[ne]?.[xe]?.offsetWidth;if(v.current?.companyId===te&&V!=null&&ge!=null&&ee!=null&&(V<window.innerWidth-ge||ee<window.innerWidth)){clearInterval($e);const ve=E.threadId,Ce=E.onThreadShownCallback;ve&&(f(null),j(E.threadId),Ce?.())}},500);setTimeout(()=>{clearInterval($e),f(null)},2e3)}},[E,S,j,f]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[n?o.jsxRuntimeExports.jsx(Cf,{qboConnectionPool:e.qboConnectionPool,isLoading:e.qboConnectionPool.saveQBOConnectionPoolState.fetchState==="In-Progress",onQBOConnectClick:g}):null,o.jsxRuntimeExports.jsxs(k2,{children:[M.showGoLivePopUp===!0?o.jsxRuntimeExports.jsx(Lf,{hasAdminRole:!0,onCancelClick:()=>{a()},onGoLiveClick:Q,showGoLivePopup:M.showGoLivePopUp,loading:e.updateStatus.fetchState==="In-Progress"}):null,q==="Completed"?o.jsxRuntimeExports.jsx(Ur,{customerCreationType:P,fetchState:q,onRemoveSnackbar:()=>{c(),R("Not-Started")}}):null,L==="Completed"?o.jsxRuntimeExports.jsx(Ur,{fetchState:L,customMessageText:G,onRemoveSnackbar:()=>{W("Not-Started")}}):null,o.jsxRuntimeExports.jsxs(xa.Provider,{value:z,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:te,width:re})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:te,width:re,itemCount:e.onboardingCustomers.length,itemSize:ae,onItemsRendered:Z=>y(Z),overscanCount:Bt,itemData:{onboardingView:e,makeCompanyNameSticky:K,addThreadRequestThreadId:A,targetElement:v.current?.target,resetTargetElementFromNavigation:T,setElementRef:Y,setAddThreadRequestThreadId:I,setNoteData:D,onOnboardingStepClicked:i,onSendInviteClick:r,redirectToDashboardOnboarding:m,onRetryBankAccountConnection:x},ref:b,innerElementType:ha,onScroll:({scrollOffset:Z})=>{l(Z)},initialScrollOffset:N,style:{willChange:"auto"},children:w2})}),F!=null?o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:F.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${F.companyName} ${j2}`,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:b2,replyComposerPlaceholder:R2,threadResolve:$2,threadUnResolve:E2},onThreadClick:te=>null,onCloseAllThreadsDrawer:()=>D(null)})}):null]})]})]})},xa=u.createContext(void 0),ha=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,onColumnSortConfigChanged:c}=u.useContext(xa);return o.jsxRuntimeExports.jsxs(I2,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(Bf,{companyNameSticky:d,onColumnSortConfigChanged:c,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder}}),o.jsxRuntimeExports.jsx(P2,{children:r})]})});ha.displayName="Onboarding list view inner element type";const w2=({index:e,style:n,data:r})=>{const i=t.useWindowSizeContext(),{onboardingView:a,makeCompanyNameSticky:d,addThreadRequestThreadId:l,targetElement:c,resetTargetElementFromNavigation:p,setElementRef:m,setNoteData:x,setAddThreadRequestThreadId:g,onOnboardingStepClicked:h,onSendInviteClick:C,redirectToDashboardOnboarding:b,onRetryBankAccountConnection:S}=r,y=a.onboardingCustomers[e],{companyId:j}=y.company.company.companyInfo;return o.jsxRuntimeExports.jsx(T2,{isCollapsed:!0,style:{...n,width:"fit-content",minWidth:"100%",padding:`${t.Space.sp0} ${f2.onboardingRightPadding.valuePx(i)} ${t.Space.sp3} ${t.Space.sp0}`},children:o.jsxRuntimeExports.jsx(p2,{totalHeight:typeof n.height=="number"?n.height:Ae,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:x,setElementRef:m,setAddThreadRequestThreadId:g,retryBankAccountConnectionFetchState:a.retryBankAccountConnectionFetchStateByCompanyId[a.onboardingCustomers[e].company.company.companyInfo.companyId]?.fetchState,onOnboardingStepClicked:h,onSendInviteClick:C,redirectToDashboardOnboarding:b,onRetryBankAccountConnection:S})},j)},k2=s.div`
|
|
3901
3901
|
/** Subtract top so list can occupy remaining available height */
|
|
3902
3902
|
height: calc(100vh - 108px);
|
|
3903
3903
|
max-width: 99.9%;
|
|
@@ -3911,7 +3911,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3911
3911
|
position: relative;
|
|
3912
3912
|
width: auto;
|
|
3913
3913
|
height: 100%;
|
|
3914
|
-
`,
|
|
3914
|
+
`,I2=s.div``,L2=s.div`
|
|
3915
3915
|
display: flex;
|
|
3916
3916
|
width: 100%;
|
|
3917
3917
|
height: calc(100vh - 110px);
|
|
@@ -3928,7 +3928,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3928
3928
|
height: calc(100vh - 45px);
|
|
3929
3929
|
overflow-y: hidden;
|
|
3930
3930
|
background-color: ${e=>e.theme.colors.grey4};
|
|
3931
|
-
`,{cockpit:{emptySearchTextFirstLine:O2,emptySearchTextSecondLine:N2,onboarding:Zr},common:{no:M2,yes:z2}}=t.appLocale.getLocalizedStrings(),F2=({headerData:e,headerActions:n,initialOpenThreadRequest:r,onboardingPageActions:i,onboardingPageData:a})=>{const[d,l]=u.useState(!1),[c,p]=u.useState(void 0),[m,x]=u.useState(void 0),{analytics:g}=t.useToolkitContext(),{onboardingView:h,qboConnectionPoolFlag:C}=a,{onScroll:b,onOnboardingStepClicked:S,onCancelClicked:y,onGoLiveClicked:j,onUpdateCustomerCreationStatus:f,onCockpitReloadData:E,onSendInviteClick:$,onColumnSortConfigChanged:A,redirectToDashboardOnboarding:
|
|
3931
|
+
`,{cockpit:{emptySearchTextFirstLine:O2,emptySearchTextSecondLine:N2,onboarding:Zr},common:{no:M2,yes:z2}}=t.appLocale.getLocalizedStrings(),F2=({headerData:e,headerActions:n,initialOpenThreadRequest:r,onboardingPageActions:i,onboardingPageData:a})=>{const[d,l]=u.useState(!1),[c,p]=u.useState(void 0),[m,x]=u.useState(void 0),{analytics:g}=t.useToolkitContext(),{onboardingView:h,qboConnectionPoolFlag:C}=a,{onScroll:b,onOnboardingStepClicked:S,onCancelClicked:y,onGoLiveClicked:j,onUpdateCustomerCreationStatus:f,onCockpitReloadData:E,onSendInviteClick:$,onColumnSortConfigChanged:A,redirectToDashboardOnboarding:I,onRetryBankAccountConnection:v,onQBOConnectClick:w}=i,F=h.fetchState==="Completed"&&h.zeniUsers.fetchState==="Completed",D={onOkClick:()=>{l(!1),c!=null&&($(c),m!=null&&g.trackOnboardingSendInvite(c,!1,m))},onCancelClick:()=>{l(!1)}};return o.jsxRuntimeExports.jsxs(D2,{children:[d===!0?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{style:{paddingLeft:t.Space.sp6,paddingRight:t.Space.sp6},children:Zr.confirmationPopup.title}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:Zr.confirmationPopup.subTitle}),primaryButtonText:z2,secondaryButtonText:M2,action:D,style:{background:t.Colors.overlayDark}}):null,o.jsxRuntimeExports.jsx(dt,{headerActions:{...n},headerData:{...e,allTabOptions:e.allTabOptions??it,companiesLoaded:F,filterData:{filterText:h.uiState.filterText,disableFilters:!0},selectedTabOption:"onboarding"}}),o.jsxRuntimeExports.jsx(B2,{initialOpenThreadRequest:r,onColumnSortConfigChanged:A,onCockpitReloadData:E,onGoLiveClicked:j,onQBOConnectClick:w,onRetryBankAccountConnection:v,onScroll:b,onSendInviteClick:(K,M,G)=>{M?($(K),g.trackOnboardingSendInvite(K,!0,G)):(p(K),x(G),l(!0))},onboardingView:h,onOnboardingStepClicked:S,onCancelClicked:y,onUpdateCustomerCreationStatus:f,qboConnectionPoolFlag:C,redirectToDashboardOnboarding:I})]})},B2=({onboardingView:e,qboConnectionPoolFlag:n,initialOpenThreadRequest:r,onSendInviteClick:i,onScroll:a,onOnboardingStepClicked:d,onCancelClicked:l,onGoLiveClicked:c,onUpdateCustomerCreationStatus:p,onCockpitReloadData:m,onColumnSortConfigChanged:x,redirectToDashboardOnboarding:g,onRetryBankAccountConnection:h,onQBOConnectClick:C})=>{const b=t.useWindowSizeContext();return e.fetchState==="Error"?o.jsxRuntimeExports.jsx($t,{onCockpitReloadData:m,selectedCockpitOption:"onboarding"}):e.fetchState==="In-Progress"||e.fetchState==="Not-Started"?o.jsxRuntimeExports.jsx(L2,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})}):e.onboardingCustomers.length===0?o.jsxRuntimeExports.jsx(t.EmptySearchResults,{emptySearchTextFirstLine:O2,emptySearchTextSecondLine:N2}):o.jsxRuntimeExports.jsx(A2,{windowSize:b,children:o.jsxRuntimeExports.jsx(v2,{initialOpenThreadRequest:r,onCancelClicked:l,onColumnSortConfigChanged:x,onGoLiveClicked:c,onQBOConnectClick:C,onRetryBankAccountConnection:h,onScroll:a,onSendInviteClick:i,onUpdateCustomerCreationStatus:p,onboardingView:e,qboConnectionPoolFlag:n,redirectToDashboardOnboarding:g,onOnboardingStepClicked:d})})},W2=t.appLocale.getLocalizedStrings().common,_2=({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,x=c!=null&&K2(c);return o.jsxRuntimeExports.jsxs(V2,{children:[o.jsxRuntimeExports.jsx(H2,{children:a.customer.companyCredentials}),o.jsxRuntimeExports.jsx(U2,{children:o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:a.customer.companyDomain,width:n},text:{type:"text",name:"companySection.companyDomain",placeholder:`${W2.add} ${a.customer.domain}`,options:{required:!0,pattern:t.DOMAIN_PATTERN}},onBlur:()=>{x&&r(c)},isDisabled:m===!0?"readonly":void 0})})]})},V2=s.div`
|
|
3932
3932
|
display: flex;
|
|
3933
3933
|
flex-direction: column;
|
|
3934
3934
|
gap: ${t.Space.sp2};
|
|
@@ -3998,7 +3998,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
3998
3998
|
height: ${t.Space.sp6};
|
|
3999
3999
|
align-items: center;
|
|
4000
4000
|
padding: ${t.Space.sp0} ${t.Space.sp4};
|
|
4001
|
-
`,st=t.appLocale.getLocalizedStrings().common,{cockpit:{onboarding:be},common:{strings:{colon:xt,empty:Xr},placeholder:J2,labels:eC}}=t.appLocale.getLocalizedStrings(),tC=`${st.add} ${be.customer.customerFirstName.toLowerCase()}`,oC=`${st.add} ${be.customer.customerLastName.toLowerCase()}`,nC=`${st.add} ${be.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:x,newOnboardingCustomerLocalData:g,companyView:h,allProductsList:C}=n,b=o.useTheme(),[S,y]=u.useState(xn(C,g.selectedProducts??[]));u.useEffect(()=>{g.selectedProducts!=null&&y(xn(C,g.selectedProducts))},[g.selectedProducts]);const j=x.fetchState!=="Completed"&&g.isEmailGroupCreated==null,f=c!=null||j?"disabled":c,E=n.companyView?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed===!0;let $;const A=r.find(
|
|
4001
|
+
`,st=t.appLocale.getLocalizedStrings().common,{cockpit:{onboarding:be},common:{strings:{colon:xt,empty:Xr},placeholder:J2,labels:eC}}=t.appLocale.getLocalizedStrings(),tC=`${st.add} ${be.customer.customerFirstName.toLowerCase()}`,oC=`${st.add} ${be.customer.customerLastName.toLowerCase()}`,nC=`${st.add} ${be.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:x,newOnboardingCustomerLocalData:g,companyView:h,allProductsList:C}=n,b=o.useTheme(),[S,y]=u.useState(xn(C,g.selectedProducts??[]));u.useEffect(()=>{g.selectedProducts!=null&&y(xn(C,g.selectedProducts))},[g.selectedProducts]);const j=x.fetchState!=="Completed"&&g.isEmailGroupCreated==null,f=c!=null||j?"disabled":c,E=n.companyView?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed===!0;let $;const A=r.find(I=>I.companyInfo.companyId===g.parentCompanyId);return A!=null&&($={label:A.companyInfo.name,value:A.companyInfo.companyId}),o.jsxRuntimeExports.jsxs(sC,{isDisabled:j,ref:m,children:[o.jsxRuntimeExports.jsxs(rC,{children:[o.jsxRuntimeExports.jsx(aC,{children:be.customer.customerCreation}),g.companyId!=null&&o.jsxRuntimeExports.jsx(ga,{isCompleted:h?.company.companyOnboardingInfo.onboardingInfo?.customerCreated.completed===!0})]}),o.jsxRuntimeExports.jsxs(iC,{children:[o.jsxRuntimeExports.jsx(t.LabeledNameField,{label:{label:`${be.customer.customerName}${xt}`,width:a},nameField:{name:`${e}.customerName`,registerOptions:{required:!0},defaultValue:{firstName:n.newOnboardingCustomerLocalData.customerName?.firstName??Xr,lastName:n.newOnboardingCustomerLocalData.customerName?.lastName??Xr},placeHolder:{firstName:tC,lastName:oC,name:nC},showFullNameError:!0},isDisabled:f==="disabled"?"disabled":c,showAdditionalInfoLabel:!0,additionalInfoLabel:be.customer.customerNameInfoText,style:{width:"auto"}}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${be.customer.customerEmail}${xt}`,width:a},text:{type:"email",name:`${e}.email`,placeholder:`${st.add} ${be.customer.customerEmail.toLowerCase()}`,autoComplete:"off",options:{required:!0}},isDisabled:f==="disabled"?"disabled":c,showAdditionalInfoLabel:!0,additionalInfoLabel:be.customer.customerEmailInfoText}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${be.customer.companyName}${xt}`,width:a},text:{type:"text",name:`${e}.name`,placeholder:`${st.add} ${be.customer.companyName.toLowerCase()}`,options:{required:!0}},isDisabled:f,showAdditionalInfoLabel:!0,additionalInfoLabel:be.customer.companyNameInfoText}),i===!0?o.jsxRuntimeExports.jsx(X2,{label:{label:`${be.customer.entity}${xt}`,width:a},concatText:be.customer.of,firstSingleSelectField:{name:`${e}.entityType`,placeholder:`${st.add} ${be.customer.entity.toLowerCase()}`,defaultValue:{selectedOption:{value:be.customer.subsidiary,label:be.customer.subsidiary},allOptions:[{value:be.customer.parent,label:be.customer.parent},{value:be.customer.subsidiary,label:be.customer.subsidiary}]},style:{backgroundColor:b.colors.background}},secondSingleSelectField:{name:`${e}.company`,placeholder:`${st.add} ${be.customer.parent.toLowerCase()}`,defaultValue:{selectedOption:$,allOptions:r.map(I=>({label:I.companyInfo.name,value:I.companyInfo.companyId}))},style:{backgroundColor:b.colors.background},registerOptions:{required:i}},isDisabled:f}):o.jsxRuntimeExports.jsx(t.LabeledSingleSelectWithoutClearableField,{label:{label:`${be.customer.entity}${xt}`,width:a},singleSelectWithoutClearableField:{name:`${e}.entityType`,placeholder:`${st.add} ${be.customer.entity.toLowerCase()}`,defaultValue:{selectedOption:{value:be.customer.parent,label:be.customer.parent},allOptions:[{value:be.customer.parent,label:be.customer.parent},{value:be.customer.subsidiary,label:be.customer.subsidiary}]}},isDisabled:f}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${be.customer.realmId}${xt}`,width:a},text:{type:"text",name:`${e}.realmId`,placeholder:`${st.add} ${be.customer.realmIdText}`,options:{pattern:t.REALM_ID}},showTooltip:!0,tooltipTitle:o.jsxRuntimeExports.jsx(lC,{}),isDisabled:f==="disabled"||E===!0?"disabled":c,isOptional:!0}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${be.customer.confirmRealmId}${xt}`,width:p},text:{type:"text",name:`${e}.confirmRealmId`,placeholder:`${be.customer.confirmRealmIdText}`,options:{pattern:t.REALM_ID,validate:(I,v)=>I===v[e].realmId}},additionalInfoLabel:d,disableCopyPaste:!0,isDisabled:f==="disabled"||E===!0?"disabled":c,isOptional:!0}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${be.customer.hubSpotId}${xt}`,width:a},text:{type:"text",name:"customerSection.hubSpotId",placeholder:`${st.add} ${be.customer.hubSpotIdText}`,options:{pattern:t.DIGITS_PATTERN}},isDisabled:f,isOptional:!0}),o.jsxRuntimeExports.jsx(t.LabeledTextField,{label:{label:`${be.customer.chargebeeId}${xt}`,width:a},text:{type:"text",name:"customerSection.chargebeeId",placeholder:`${st.add} ${be.customer.chargebeeIdText}`,options:{pattern:t.ALPHA_NUMERIC_PATTERN,required:!0}},isDisabled:f}),o.jsxRuntimeExports.jsx(t.LabeledMultiSelectWithCheckBoxField,{label:{label:eC.products,width:a},additionalInfoLabel:l||void 0,multiSelectWithCheckBoxField:{name:"customerSection.products",defaultValue:{allOptions:S,selectedOptions:g.selectedProducts??[]},placeholder:J2.productsPlaceholder,isDisabled:f,registerOptions:{validate:I=>I!=null&&I.selectedOptions.length>0}},style:{width:"auto"}})]})]})});Sa.displayName="CustomerCreation";const sC=s.div`
|
|
4002
4002
|
opacity: ${e=>e.isDisabled?.4:1};
|
|
4003
4003
|
display: flex;
|
|
4004
4004
|
flex-direction: column;
|
|
@@ -4050,7 +4050,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4050
4050
|
align-items: center;
|
|
4051
4051
|
z-index: 10;
|
|
4052
4052
|
margin-top: 28px;
|
|
4053
|
-
`;function yC({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(fC,{isDisabled:n===!0,children:[o.jsxRuntimeExports.jsx(vC,{children:p.qboSectionTitle}),o.jsxRuntimeExports.jsxs(CC,{children:[o.jsxRuntimeExports.jsx(wC,{children:J.ALL_ACCOUNTING_CONNECTION_CREATION_MODES.map((m,x)=>o.jsxRuntimeExports.jsx(kC,{isDisabled:n===!0,leftSideContainer:x===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(PC,{isDisabled:n===!0||i!=="zeni_user",children:[o.jsxRuntimeExports.jsxs(jC,{children:[o.jsxRuntimeExports.jsxs(bC,{children:[o.jsxRuntimeExports.jsx(RC,{}),o.jsxRuntimeExports.jsx($C,{}),o.jsxRuntimeExports.jsx(EC,{})]}),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(wo,{complete:!0})]}),a===!0?o.jsxRuntimeExports.jsx(TC,{children:p.qboSuccessText}):null,l==="Error"?o.jsxRuntimeExports.jsx(
|
|
4053
|
+
`;function yC({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(fC,{isDisabled:n===!0,children:[o.jsxRuntimeExports.jsx(vC,{children:p.qboSectionTitle}),o.jsxRuntimeExports.jsxs(CC,{children:[o.jsxRuntimeExports.jsx(wC,{children:J.ALL_ACCOUNTING_CONNECTION_CREATION_MODES.map((m,x)=>o.jsxRuntimeExports.jsx(kC,{isDisabled:n===!0,leftSideContainer:x===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(PC,{isDisabled:n===!0||i!=="zeni_user",children:[o.jsxRuntimeExports.jsxs(jC,{children:[o.jsxRuntimeExports.jsxs(bC,{children:[o.jsxRuntimeExports.jsx(RC,{}),o.jsxRuntimeExports.jsx($C,{}),o.jsxRuntimeExports.jsx(EC,{})]}),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(wo,{complete:!0})]}),a===!0?o.jsxRuntimeExports.jsx(TC,{children:p.qboSuccessText}):null,l==="Error"?o.jsxRuntimeExports.jsx(IC,{children:p.qboErrorText}):null]})]})]})}const fC=s.div`
|
|
4054
4054
|
opacity: ${e=>e.isDisabled?.4:1};
|
|
4055
4055
|
display: flex;
|
|
4056
4056
|
flex-direction: column;
|
|
@@ -4113,14 +4113,14 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4113
4113
|
&:hover {
|
|
4114
4114
|
fill: ${e=>e.theme.colors.primary};
|
|
4115
4115
|
}
|
|
4116
|
-
`,
|
|
4116
|
+
`,IC=s(t.StandardRegular)`
|
|
4117
4117
|
display: flex;
|
|
4118
4118
|
margin-top: ${t.Space.sp3};
|
|
4119
4119
|
background-color: ${t.Colors.importantLight};
|
|
4120
4120
|
color: ${t.Colors.importantDark};
|
|
4121
4121
|
padding: ${t.Space.sp2} ${t.Space.sp2};
|
|
4122
4122
|
border-radius: ${t.Space.sp1};
|
|
4123
|
-
`,Qr=t.appLocale.getLocalizedStrings().common,Jr="onboardingCustomerPage",IC="companySection",lt="groupSection",De="customerSection",fa="qboConnectionSection",yo={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:Re},common:{no:AC,yes:DC,strings:pe}}=t.appLocale.getLocalizedStrings();function OC({localData:e,screenType:n,qboConnectClicked:r,analytics:i,onOnboardingCustomerDataUpdated:a,onCloseClick:d,onSaveClick:l,onViewClick:c,onCompanyDomainBlurred:p,onNavigateToPreOnboarding:m,onQBOConnectClick:x}){const g=o.useTheme(),h=t.useWindowSizeContext(),C=yo.labelWidth.value(h),b=yo.largeLabelWidth.value(h),S=yo.extraLargeLabelWidth.value(h),y=o.useForm({mode:"all",reValidateMode:"onChange",defaultValues:u.useMemo(()=>fo(e),[e])}),{emailGroupFetchState:j,newOnboardingCustomerLocalData:f,onboardingCompletedCompanies:E,isOnboardingAllowedForUser:$,fetchState:A,sendInviteFetchState:P,uiState:v,companyView:w,externalConnections:F}=e,[D,K]=u.useState(pe.empty),[M,G]=u.useState(pe.empty),[q]=u.useState(pe.empty),[R,L]=u.useState(pe.empty),[W,k]=u.useState(pe.empty),[I,N]=u.useState(!1),[Q,ae]=u.useState(!1),[z,Y]=u.useState(Re.customer.completePreOnboardingText),[T,te]=u.useState(!1),re=u.useRef(null),Z=u.useRef(null),ie=u.useRef(null),{isExistingCustomer:ne,isCustomerOnboardedSuccessfully:xe}=BC(e),ye=ne&&xe?Re.customer.customerNameExistInManagementText:Re.customer.customerNameExistInOnboardingText,$e=u.useMemo(()=>ye.replace("_company-domain_",f.companyEmailDomain??pe.empty),[j.fetchState]),V=w?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed,ee=u.useCallback(()=>{const me=y.getValues();return me[De].realmId!==me[De].confirmRealmId?(L(Re.customer.realmIdWarning),y.trigger(`${De}.confirmRealmId`),!1):(L(pe.empty),y.clearErrors(`${De}.confirmRealmId`),!0)},[y]),ge=u.useCallback(()=>{const me=y.getValues();return me[De].entityType.selectedOption?.value=="Subsidiary"&&me[De].company.selectedOption==null?(y.setError("customerSection.company",{type:"required"}),!1):(y.clearErrors("customerSection.company"),!0)},[y]),ve=u.useCallback(()=>f.customerName?.firstName&&!f.customerName?.lastName||!f.customerName?.firstName&&f.customerName?.lastName?(y.trigger(`${De}.customerName`),!1):(f.customerName?.firstName||f.customerName?.lastName)&&!f.email?(y.trigger(`${De}.email`),!1):(f.customerName?.firstName||f.customerName?.lastName)&&f.email&&f.selectedProducts?.length===0?(k(Re.customer.productsWarning),y.trigger(`${De}.products`),!1):!0,[y,f.customerName,f.email,f.selectedProducts]),Ce=u.useCallback(()=>ee()&&ge()&&ve(),[ge,ee,ve]),O=y.handleSubmit(()=>{Y(Re.customer.completePreOnboardingText),Ce()&&ae(!0)},()=>{Ce(),console.warn("Onboarding customer form error")}),ke=y.getValues()[De].email??pe.empty,B=(me=!1)=>{const X={companyDomain:f.companyEmailDomain??pe.empty,primaryContactEmail:ke},Ne={groupName:f.groupName??pe.empty,groupEmail:f.groupId??pe.empty,groupDescription:f.groupDescription??pe.empty},Qe={firstName:f.customerName?.firstName??pe.empty,lastName:f.customerName?.lastName??pe.empty,customerEmail:ke,companyName:f.name??pe.empty,entittyType:f.isSubsidiary===!0?Re.customer.subsidiary:Re.customer.parent??pe.empty,chargebeeId:f.chargebeeId??pe.empty,products:f.selectedProducts??[],qboRealmId:f.qboRealmId??pe.empty,hubSpotId:f.hubSpotId},Ke={isSendInvite:me,isInviteAlreadySent:w?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0,isZeniManagedQboConnectionSelected:f.accountingConnectionCreationMode==="zeni_user",isCustomerManagedQboConnectionSelected:f.accountingConnectionCreationMode==="customer",qboConnectionStatus:w?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed??!1};i?.trackOnboardingSaveOrSendInvite(X,Ne,Qe,Ke)},de=()=>{const me={companyEmailDomain:f.companyEmailDomain??pe.empty,primaryContactEmail:ke},X={groupName:f.groupName??pe.empty,groupEmail:f.groupId??pe.empty,groupDescription:f.groupDescription??pe.empty,isCompanyEmailDomainAvailable:!0};i?.trackOnboardingNewCustomerGroupCreationCheck(me,X)},je=()=>{let me=!0;const X=y.getValues();if(X[lt].groupEmail!==pe.empty&&X[lt].groupName===pe.empty)K(Re.customer.groupNameWarning),y.setError("groupSection.groupName",{type:"required"}),me=!1;else if(X[lt].groupName!==pe.empty&&X[lt].groupEmail===pe.empty)G(Re.customer.groupEmailWarning),y.setError("groupSection.groupEmail",{type:"required"}),me=!1;else{const{error:Ne}=y.getFieldState("groupSection.groupName"),{error:Qe}=y.getFieldState("groupSection.groupEmail");(Ne==null||Ne.type==="required")&&(Qe==null||Qe.type==="required")&&(me=!1,y.clearErrors("groupSection")),K(pe.empty),G(pe.empty)}return me},U={onOkClick:()=>{N(!1),y.reset(),d()},onCancelClick:()=>{N(!1)}},_={onOkClick:()=>{ae(!1),l(!0),B(!0)},onCancelClick:()=>{ae(!1)}},ce=async(me,X)=>{const Ne={...X};if(me.includes("groupName")&&X[lt].groupName!=pe.empty&&(X[lt].groupName=X[lt].groupName.charAt(0).toUpperCase()+X[lt].groupName.slice(1)),(me.includes("groupName")||me.includes("groupEmail"))&&je(),me.includes("confirmRealmId")&&L(pe.empty),me.includes("products")&&o.isEqual(f.selectedProducts??[],X[De].products.selectedOptions)===!1){k(pe.empty);const Qe=WC(f.selectedProducts??[],X[De].products.selectedOptions.map(Et=>J.toProductTypeStrict(Et)).filter(Et=>Et!=null));Ne[De].products.selectedOptions=Qe;const Ke=xn(e.allProductsList,Qe);y.setValue(`${De}.products`,{allOptions:Ke,selectedOptions:Qe})}me.includes("realmId")&&o.has(y.formState.errors,`${De}.confirmRealmId`)&&y.trigger(`${De}.confirmRealmId`),a(Ne)},Se=me=>{const{dirtyFields:X}=y.formState;X.companySection?.companyDomain===!0&&p(me)},fe=()=>{Object.keys(y.formState.errors).length===0&&(m?.(),Y(pe.empty))},Le=()=>{j.fetchState==="Error"?p(f.companyEmailDomain):Ce()&&Object.keys(y.formState.errors).length===0&&(l(P.fetchState==="Error"),B())},H=()=>{Ce()&&Object.keys(y.formState.errors).length===0&&(l(!1),B())};u.useEffect(()=>{const me=y.watch((X,{name:Ne})=>{Ne!=null&&X!=null&&o.defer(()=>ce(Ne,X))});return()=>{me.unsubscribe()}}),u.useEffect(()=>{f.isCustomerCreationDisabled===!0&&(y.resetField("customerSection",{defaultValue:fo(e)[De],keepDirty:!0}),y.clearErrors("customerSection"))},[f.isCustomerCreationDisabled]),u.useEffect(()=>{te(f.isSubsidiary===!0),f.isSubsidiary!==!0&&y.resetField("customerSection.company",{defaultValue:fo(e)[De].company,keepDirty:!0}),y.resetField("customerSection.entityType",{defaultValue:fo(e)[De].entityType,keepDirty:!0})},[f.isSubsidiary]),u.useEffect(()=>{j.fetchState==="Completed"&&(y.reset(fo(e)),ne||de())},[j.fetchState]),u.useEffect(()=>{v.selectedStep==="STEP_1"?re.current?.scrollIntoView():v.selectedStep==="STEP_2"?Z.current?.scrollIntoView():v.selectedStep==="STEP_3"&&ie.current?.scrollIntoView()},[]),u.useEffect(()=>{const me=w?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed;if(F?.saveConnectionState==="Error"){const Ne={firstName:f.customerName?.firstName??pe.empty,lastName:f.customerName?.lastName??pe.empty,customerEmail:y.getValues()[De].email??pe.empty,qboConnectionResponseMessage:Re.qboErrorText,isSuccess:!1};i?.trackOnboardingZeniManagedQBOConnection(Ne)}else if(me??!1){const Ne={firstName:f.customerName?.firstName??pe.empty,lastName:f.customerName?.lastName??pe.empty,customerEmail:y.getValues()[De].email??pe.empty,qboConnectionResponseMessage:Re.qboSuccessText,isSuccess:!0};i?.trackOnboardingZeniManagedQBOConnection(Ne)}},[F?.saveConnectionState,w?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed]),u.useEffect(()=>{if(f.accountingConnectionCreationMode){const me=w?.company.companyOnboardingInfo.onboardingInfo?.accountingConnectionCreationMode??pe.empty;if(f.accountingConnectionCreationMode!==me){const X={firstName:f.customerName?.firstName??pe.empty,lastName:f.customerName?.lastName??pe.empty,customerEmail:y.getValues()[De].email??pe.empty,isZeniOrCustomer:f.accountingConnectionCreationMode??pe.empty};i?.trackOnboardingQBOConnectionSelected(X)}}},[f.accountingConnectionCreationMode]);const ue=(me,X)=>{const{fetchState:Ne}=me,{isEmailGroupCreated:Qe,selectedProducts:Ke}=X,Et=Ne!=="Completed"&&Qe==null,no=Ke==null||Ke.length===0,Ut=(Ke?.includes("zeni_checking")===!0||Ke?.includes("zeni_treasury")===!0||Ke?.includes("zeni_cards")===!0||Ke?.includes("zeni_payroll")===!0||Ke?.includes("zeni_cfo")===!0||Ke?.includes("zeni_tax")===!0)&&Ke?.includes("bookkeeping")===!1;return Et||no||Ut},Ie=u.useMemo(()=>{const me=y.formState.isValid,X=f.selectedProducts!=null&&(f.selectedProducts.includes("zeni_payroll")===!0||f.selectedProducts.includes("zeni_cfo")===!0||f.selectedProducts.includes("zeni_tax")===!0),Ne=f.selectedProducts!=null&&(f.selectedProducts.includes("zeni_checking")===!0||f.selectedProducts.includes("zeni_cards")===!0||X)&&f.selectedProducts.includes("bookkeeping")===!1;return me!==!0||j.fetchState==="In-Progress"||j.fetchState==="Error"||A==="In-Progress"||A==="Error"||$!==!0||f.selectedProducts==null||f.selectedProducts.length===0||f.accountingConnectionCreationMode==null&&!Ne||f.accountingConnectionCreationMode==="zeni_user"&&V!==!0&&!Ne||j.fetchState==="Completed"&&ne||w?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted===!0},[j.fetchState,ne,$,A,y.formState.isValid,f.accountingConnectionCreationMode,V,f.selectedProducts,w?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted]),Be=u.useMemo(()=>P.fetchState!=="In-Progress"&&P.fetchState!=="Error"&&A!=="In-Progress"&&A!=="Error"&&j.fetchState!=="In-Progress"&&ne===!0,[j.fetchState,ne,A,P.fetchState]);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[I===!0?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{children:Re.discardTitle}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:Re.discardDescription}),primaryButtonText:Re.delete,secondaryButtonText:Qr.cancel,proceedButtonVariant:"destructive",action:U,style:{background:t.Colors.overlayDark}}):null,Q===!0?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{style:{paddingLeft:t.Space.sp6,paddingRight:t.Space.sp6},children:Re.confirmationPopup.title}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:Re.confirmationPopup.subTitle}),primaryButtonText:DC,secondaryButtonText:AC,action:_,style:{background:t.Colors.overlayDark}}):null,o.jsxRuntimeExports.jsx(t.NavBarWithClose,{title:n==="create"?Re.customer.modalNewCustomerText:Re.customer.modalEditCustomerText,backgroundColor:g.colors.grey5,style:{zIndex:4},onCloseClick:()=>{Object.keys(y.formState.dirtyFields).length>0?N(!0):(y.reset(),d())}}),o.jsxRuntimeExports.jsxs(NC,{children:[o.jsxRuntimeExports.jsx(MC,{children:Re.customer.subTitle}),o.jsxRuntimeExports.jsx(o.FormProvider,{...y,children:o.jsxRuntimeExports.jsxs("form",{id:`${Jr}_form`,onSubmit:O,children:[o.jsxRuntimeExports.jsx(_2,{localData:e,labelWidth:C,onCompanyDomainBlurred:Se,primaryEmailDomainAdditionalLabel:q,isOnboardingAllowedForUser:$}),Be===!0?o.jsxRuntimeExports.jsxs(Qn,{children:[o.jsxRuntimeExports.jsxs(Jn,{children:[o.jsxRuntimeExports.jsxs(ei,{children:[o.jsxRuntimeExports.jsx(qn,{}),o.jsxRuntimeExports.jsx(t.StandardMedium,{children:Re.customer.groupCreationError})]}),o.jsxRuntimeExports.jsx(FC,{children:$e})]}),o.jsxRuntimeExports.jsx(t.Button,{style:{padding:`${t.Space.sp1} ${t.Space.sp2}`,backgroundColor:g.colors.champion,borderColor:g.colors.champion,color:g.mode==="light"?t.darkColors.primary:t.lightColors.primary,height:"30px",width:t.Space.sp7},label:Qr.view,size:"small",onClick:()=>{c(xe?"management":"onboarding")}})]}):null,j.fetchState==="Error"||A==="Error"||P.fetchState==="Error"&&e.error!=null&&e.error?.code!==406?o.jsxRuntimeExports.jsxs(Qn,{children:[o.jsxRuntimeExports.jsx(Jn,{children:o.jsxRuntimeExports.jsxs(ei,{children:[o.jsxRuntimeExports.jsx(qn,{}),o.jsxRuntimeExports.jsx(t.LargeMedium,{children:Re.customer.emailgroupAPIError})]})}),o.jsxRuntimeExports.jsx(t.Button,{style:{padding:`${t.Space.sp1} ${t.Space.sp2}`,backgroundColor:g.colors.champion,borderColor:g.colors.champion,color:g.mode==="light"?t.darkColors.primary:t.lightColors.primary},label:Re.customer.tryAgainText,size:"small",onClick:Le})]}):null,P.fetchState==="Error"&&e.error!=null&&e.error?.code===406?o.jsxRuntimeExports.jsxs(Qn,{children:[o.jsxRuntimeExports.jsx(qn,{}),o.jsxRuntimeExports.jsxs(Jn,{children:[o.jsxRuntimeExports.jsx(t.LargeMedium,{children:z!==pe.empty?Re.customer.preOnboardingError:Re.customer.preOnboardingSaveError}),z!==pe.empty?o.jsxRuntimeExports.jsx(t.Button,{style:{padding:`${t.Space.sp1} ${t.Space.sp2}`,backgroundColor:g.colors.champion,borderColor:g.colors.champion,color:g.mode==="light"?t.darkColors.primary:t.lightColors.primary},label:z,size:"small",onClick:fe}):null]})]}):null,o.jsxRuntimeExports.jsx(ya,{groupEmailAdditionalLabel:M,groupNameAdditionalLabel:D,labelWidth:C,localData:e,ref:re,sectionId:lt}),o.jsxRuntimeExports.jsx(Sa,{localData:e,onboardedCompanies:E.companies,isSubsidiary:T,labelWidth:C,largeLabelWidth:b,extraLargeLabelWidth:S,realmIdAdditionalLabel:R,productsAdditionalLabel:W,ref:Z,sectionId:De,isDisabled:$===!1?"disabled":void 0}),o.jsxRuntimeExports.jsx(zC,{children:o.jsxRuntimeExports.jsx(yC,{isSectionDisabled:ue(j,f),sectionId:fa,isLoading:r===!0||F?.fetchState==="In-Progress"||F?.saveConnectionState==="In-Progress",accountingConnectionCreationMode:e.newOnboardingCustomerLocalData.accountingConnectionCreationMode,onQBOConnectClick:x,isConnected:w?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed===!0,isInviteSent:w?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0||w?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted===!0,saveConnectionState:F?.saveConnectionState})})]})})]}),o.jsxRuntimeExports.jsx(t.Footer,{formId:`${Jr}_form`,primaryBtn:{label:w?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0?Re.customer.resendInviteBtnText:Re.customer.sendInviteBtnText,style:{width:yo.buttonWidth.value(h),display:"flex",alignItems:"center",justifyContent:"center"},isLoading:P.fetchState==="In-Progress",isDisabled:Ie},cancelBtn:{label:Re.customer.saveBtnText,style:{width:yo.buttonWidth.value(h),display:"flex",alignItems:"center",justifyContent:"center"},isDisabled:!(t.formHasDirtyFields(y.formState.dirtyFields)||e.emailGroupFetchState.fetchState==="Completed"),isLoading:A==="In-Progress"&&r===!1,shouldResetOnCancel:!1,onClick:H,reverseSpinnerColor:!1}})]})}const fo=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}),{[IC]:{companyDomain:n.companyEmailDomain??pe.empty},[lt]:{groupName:n.groupName??pe.empty,groupEmail:n.groupId??pe.empty,groupDescription:n.groupDescription??pe.empty},[De]:{name:n.name??pe.empty,entityType:{allOptions:[{label:Re.customer.parent,value:Re.customer.parent},{label:Re.customer.subsidiary,value:Re.customer.subsidiary}],selectedOption:n.isSubsidiary===!0?{label:Re.customer.subsidiary,value:Re.customer.subsidiary}:{label:Re.customer.parent,value:Re.customer.parent}},company:{selectedOption:i,allOptions:r.companies.map(d=>({label:d.companyInfo.name,value:d.companyInfo.companyId}))},realmId:n.qboRealmId??pe.empty,confirmRealmId:n.qboRealmId??pe.empty,chargebeeId:n.chargebeeId??pe.empty,hubSpotId:n.hubSpotId??pe.empty,email:n.email??pe.empty,customerName:n.customerName??{firstName:pe.empty,lastName:pe.empty},products:{allOptions:xn(e.allProductsList,n.selectedProducts??[]),selectedOptions:n.selectedProducts??[]}},[fa]:{accountingConnectionCreationMode:n.accountingConnectionCreationMode}}},NC=s.div`
|
|
4123
|
+
`,Qr=t.appLocale.getLocalizedStrings().common,Jr="onboardingCustomerPage",LC="companySection",lt="groupSection",De="customerSection",fa="qboConnectionSection",yo={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:Re},common:{no:AC,yes:DC,strings:pe}}=t.appLocale.getLocalizedStrings();function OC({localData:e,screenType:n,qboConnectClicked:r,analytics:i,onOnboardingCustomerDataUpdated:a,onCloseClick:d,onSaveClick:l,onViewClick:c,onCompanyDomainBlurred:p,onNavigateToPreOnboarding:m,onQBOConnectClick:x}){const g=o.useTheme(),h=t.useWindowSizeContext(),C=yo.labelWidth.value(h),b=yo.largeLabelWidth.value(h),S=yo.extraLargeLabelWidth.value(h),y=o.useForm({mode:"all",reValidateMode:"onChange",defaultValues:u.useMemo(()=>fo(e),[e])}),{emailGroupFetchState:j,newOnboardingCustomerLocalData:f,onboardingCompletedCompanies:E,isOnboardingAllowedForUser:$,fetchState:A,sendInviteFetchState:I,uiState:v,companyView:w,externalConnections:F}=e,[D,K]=u.useState(pe.empty),[M,G]=u.useState(pe.empty),[q]=u.useState(pe.empty),[R,L]=u.useState(pe.empty),[W,k]=u.useState(pe.empty),[P,N]=u.useState(!1),[Q,ae]=u.useState(!1),[z,Y]=u.useState(Re.customer.completePreOnboardingText),[T,te]=u.useState(!1),re=u.useRef(null),Z=u.useRef(null),ie=u.useRef(null),{isExistingCustomer:ne,isCustomerOnboardedSuccessfully:xe}=BC(e),ye=ne&&xe?Re.customer.customerNameExistInManagementText:Re.customer.customerNameExistInOnboardingText,$e=u.useMemo(()=>ye.replace("_company-domain_",f.companyEmailDomain??pe.empty),[j.fetchState]),V=w?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed,ee=u.useCallback(()=>{const me=y.getValues();return me[De].realmId!==me[De].confirmRealmId?(L(Re.customer.realmIdWarning),y.trigger(`${De}.confirmRealmId`),!1):(L(pe.empty),y.clearErrors(`${De}.confirmRealmId`),!0)},[y]),ge=u.useCallback(()=>{const me=y.getValues();return me[De].entityType.selectedOption?.value=="Subsidiary"&&me[De].company.selectedOption==null?(y.setError("customerSection.company",{type:"required"}),!1):(y.clearErrors("customerSection.company"),!0)},[y]),ve=u.useCallback(()=>f.customerName?.firstName&&!f.customerName?.lastName||!f.customerName?.firstName&&f.customerName?.lastName?(y.trigger(`${De}.customerName`),!1):(f.customerName?.firstName||f.customerName?.lastName)&&!f.email?(y.trigger(`${De}.email`),!1):(f.customerName?.firstName||f.customerName?.lastName)&&f.email&&f.selectedProducts?.length===0?(k(Re.customer.productsWarning),y.trigger(`${De}.products`),!1):!0,[y,f.customerName,f.email,f.selectedProducts]),Ce=u.useCallback(()=>ee()&&ge()&&ve(),[ge,ee,ve]),O=y.handleSubmit(()=>{Y(Re.customer.completePreOnboardingText),Ce()&&ae(!0)},()=>{Ce(),console.warn("Onboarding customer form error")}),ke=y.getValues()[De].email??pe.empty,B=(me=!1)=>{const X={companyDomain:f.companyEmailDomain??pe.empty,primaryContactEmail:ke},Ne={groupName:f.groupName??pe.empty,groupEmail:f.groupId??pe.empty,groupDescription:f.groupDescription??pe.empty},Qe={firstName:f.customerName?.firstName??pe.empty,lastName:f.customerName?.lastName??pe.empty,customerEmail:ke,companyName:f.name??pe.empty,entittyType:f.isSubsidiary===!0?Re.customer.subsidiary:Re.customer.parent??pe.empty,chargebeeId:f.chargebeeId??pe.empty,products:f.selectedProducts??[],qboRealmId:f.qboRealmId??pe.empty,hubSpotId:f.hubSpotId},Ke={isSendInvite:me,isInviteAlreadySent:w?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0,isZeniManagedQboConnectionSelected:f.accountingConnectionCreationMode==="zeni_user",isCustomerManagedQboConnectionSelected:f.accountingConnectionCreationMode==="customer",qboConnectionStatus:w?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed??!1};i?.trackOnboardingSaveOrSendInvite(X,Ne,Qe,Ke)},de=()=>{const me={companyEmailDomain:f.companyEmailDomain??pe.empty,primaryContactEmail:ke},X={groupName:f.groupName??pe.empty,groupEmail:f.groupId??pe.empty,groupDescription:f.groupDescription??pe.empty,isCompanyEmailDomainAvailable:!0};i?.trackOnboardingNewCustomerGroupCreationCheck(me,X)},je=()=>{let me=!0;const X=y.getValues();if(X[lt].groupEmail!==pe.empty&&X[lt].groupName===pe.empty)K(Re.customer.groupNameWarning),y.setError("groupSection.groupName",{type:"required"}),me=!1;else if(X[lt].groupName!==pe.empty&&X[lt].groupEmail===pe.empty)G(Re.customer.groupEmailWarning),y.setError("groupSection.groupEmail",{type:"required"}),me=!1;else{const{error:Ne}=y.getFieldState("groupSection.groupName"),{error:Qe}=y.getFieldState("groupSection.groupEmail");(Ne==null||Ne.type==="required")&&(Qe==null||Qe.type==="required")&&(me=!1,y.clearErrors("groupSection")),K(pe.empty),G(pe.empty)}return me},U={onOkClick:()=>{N(!1),y.reset(),d()},onCancelClick:()=>{N(!1)}},_={onOkClick:()=>{ae(!1),l(!0),B(!0)},onCancelClick:()=>{ae(!1)}},ce=async(me,X)=>{const Ne={...X};if(me.includes("groupName")&&X[lt].groupName!=pe.empty&&(X[lt].groupName=X[lt].groupName.charAt(0).toUpperCase()+X[lt].groupName.slice(1)),(me.includes("groupName")||me.includes("groupEmail"))&&je(),me.includes("confirmRealmId")&&L(pe.empty),me.includes("products")&&o.isEqual(f.selectedProducts??[],X[De].products.selectedOptions)===!1){k(pe.empty);const Qe=WC(f.selectedProducts??[],X[De].products.selectedOptions.map(Et=>J.toProductTypeStrict(Et)).filter(Et=>Et!=null));Ne[De].products.selectedOptions=Qe;const Ke=xn(e.allProductsList,Qe);y.setValue(`${De}.products`,{allOptions:Ke,selectedOptions:Qe})}me.includes("realmId")&&o.has(y.formState.errors,`${De}.confirmRealmId`)&&y.trigger(`${De}.confirmRealmId`),a(Ne)},Se=me=>{const{dirtyFields:X}=y.formState;X.companySection?.companyDomain===!0&&p(me)},fe=()=>{Object.keys(y.formState.errors).length===0&&(m?.(),Y(pe.empty))},Ie=()=>{j.fetchState==="Error"?p(f.companyEmailDomain):Ce()&&Object.keys(y.formState.errors).length===0&&(l(I.fetchState==="Error"),B())},H=()=>{Ce()&&Object.keys(y.formState.errors).length===0&&(l(!1),B())};u.useEffect(()=>{const me=y.watch((X,{name:Ne})=>{Ne!=null&&X!=null&&o.defer(()=>ce(Ne,X))});return()=>{me.unsubscribe()}}),u.useEffect(()=>{f.isCustomerCreationDisabled===!0&&(y.resetField("customerSection",{defaultValue:fo(e)[De],keepDirty:!0}),y.clearErrors("customerSection"))},[f.isCustomerCreationDisabled]),u.useEffect(()=>{te(f.isSubsidiary===!0),f.isSubsidiary!==!0&&y.resetField("customerSection.company",{defaultValue:fo(e)[De].company,keepDirty:!0}),y.resetField("customerSection.entityType",{defaultValue:fo(e)[De].entityType,keepDirty:!0})},[f.isSubsidiary]),u.useEffect(()=>{j.fetchState==="Completed"&&(y.reset(fo(e)),ne||de())},[j.fetchState]),u.useEffect(()=>{v.selectedStep==="STEP_1"?re.current?.scrollIntoView():v.selectedStep==="STEP_2"?Z.current?.scrollIntoView():v.selectedStep==="STEP_3"&&ie.current?.scrollIntoView()},[]),u.useEffect(()=>{const me=w?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed;if(F?.saveConnectionState==="Error"){const Ne={firstName:f.customerName?.firstName??pe.empty,lastName:f.customerName?.lastName??pe.empty,customerEmail:y.getValues()[De].email??pe.empty,qboConnectionResponseMessage:Re.qboErrorText,isSuccess:!1};i?.trackOnboardingZeniManagedQBOConnection(Ne)}else if(me??!1){const Ne={firstName:f.customerName?.firstName??pe.empty,lastName:f.customerName?.lastName??pe.empty,customerEmail:y.getValues()[De].email??pe.empty,qboConnectionResponseMessage:Re.qboSuccessText,isSuccess:!0};i?.trackOnboardingZeniManagedQBOConnection(Ne)}},[F?.saveConnectionState,w?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed]),u.useEffect(()=>{if(f.accountingConnectionCreationMode){const me=w?.company.companyOnboardingInfo.onboardingInfo?.accountingConnectionCreationMode??pe.empty;if(f.accountingConnectionCreationMode!==me){const X={firstName:f.customerName?.firstName??pe.empty,lastName:f.customerName?.lastName??pe.empty,customerEmail:y.getValues()[De].email??pe.empty,isZeniOrCustomer:f.accountingConnectionCreationMode??pe.empty};i?.trackOnboardingQBOConnectionSelected(X)}}},[f.accountingConnectionCreationMode]);const ue=(me,X)=>{const{fetchState:Ne}=me,{isEmailGroupCreated:Qe,selectedProducts:Ke}=X,Et=Ne!=="Completed"&&Qe==null,no=Ke==null||Ke.length===0,Ut=(Ke?.includes("zeni_checking")===!0||Ke?.includes("zeni_treasury")===!0||Ke?.includes("zeni_cards")===!0||Ke?.includes("zeni_payroll")===!0||Ke?.includes("zeni_cfo")===!0||Ke?.includes("zeni_tax")===!0)&&Ke?.includes("bookkeeping")===!1;return Et||no||Ut},Le=u.useMemo(()=>{const me=y.formState.isValid,X=f.selectedProducts!=null&&(f.selectedProducts.includes("zeni_payroll")===!0||f.selectedProducts.includes("zeni_cfo")===!0||f.selectedProducts.includes("zeni_tax")===!0),Ne=f.selectedProducts!=null&&(f.selectedProducts.includes("zeni_checking")===!0||f.selectedProducts.includes("zeni_cards")===!0||X)&&f.selectedProducts.includes("bookkeeping")===!1;return me!==!0||j.fetchState==="In-Progress"||j.fetchState==="Error"||A==="In-Progress"||A==="Error"||$!==!0||f.selectedProducts==null||f.selectedProducts.length===0||f.accountingConnectionCreationMode==null&&!Ne||f.accountingConnectionCreationMode==="zeni_user"&&V!==!0&&!Ne||j.fetchState==="Completed"&&ne||w?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted===!0},[j.fetchState,ne,$,A,y.formState.isValid,f.accountingConnectionCreationMode,V,f.selectedProducts,w?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted]),Be=u.useMemo(()=>I.fetchState!=="In-Progress"&&I.fetchState!=="Error"&&A!=="In-Progress"&&A!=="Error"&&j.fetchState!=="In-Progress"&&ne===!0,[j.fetchState,ne,A,I.fetchState]);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[P===!0?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{children:Re.discardTitle}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:Re.discardDescription}),primaryButtonText:Re.delete,secondaryButtonText:Qr.cancel,proceedButtonVariant:"destructive",action:U,style:{background:t.Colors.overlayDark}}):null,Q===!0?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{style:{paddingLeft:t.Space.sp6,paddingRight:t.Space.sp6},children:Re.confirmationPopup.title}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:Re.confirmationPopup.subTitle}),primaryButtonText:DC,secondaryButtonText:AC,action:_,style:{background:t.Colors.overlayDark}}):null,o.jsxRuntimeExports.jsx(t.NavBarWithClose,{title:n==="create"?Re.customer.modalNewCustomerText:Re.customer.modalEditCustomerText,backgroundColor:g.colors.grey5,style:{zIndex:4},onCloseClick:()=>{Object.keys(y.formState.dirtyFields).length>0?N(!0):(y.reset(),d())}}),o.jsxRuntimeExports.jsxs(NC,{children:[o.jsxRuntimeExports.jsx(MC,{children:Re.customer.subTitle}),o.jsxRuntimeExports.jsx(o.FormProvider,{...y,children:o.jsxRuntimeExports.jsxs("form",{id:`${Jr}_form`,onSubmit:O,children:[o.jsxRuntimeExports.jsx(_2,{localData:e,labelWidth:C,onCompanyDomainBlurred:Se,primaryEmailDomainAdditionalLabel:q,isOnboardingAllowedForUser:$}),Be===!0?o.jsxRuntimeExports.jsxs(Qn,{children:[o.jsxRuntimeExports.jsxs(Jn,{children:[o.jsxRuntimeExports.jsxs(ei,{children:[o.jsxRuntimeExports.jsx(qn,{}),o.jsxRuntimeExports.jsx(t.StandardMedium,{children:Re.customer.groupCreationError})]}),o.jsxRuntimeExports.jsx(FC,{children:$e})]}),o.jsxRuntimeExports.jsx(t.Button,{style:{padding:`${t.Space.sp1} ${t.Space.sp2}`,backgroundColor:g.colors.champion,borderColor:g.colors.champion,color:g.mode==="light"?t.darkColors.primary:t.lightColors.primary,height:"30px",width:t.Space.sp7},label:Qr.view,size:"small",onClick:()=>{c(xe?"management":"onboarding")}})]}):null,j.fetchState==="Error"||A==="Error"||I.fetchState==="Error"&&e.error!=null&&e.error?.code!==406?o.jsxRuntimeExports.jsxs(Qn,{children:[o.jsxRuntimeExports.jsx(Jn,{children:o.jsxRuntimeExports.jsxs(ei,{children:[o.jsxRuntimeExports.jsx(qn,{}),o.jsxRuntimeExports.jsx(t.LargeMedium,{children:Re.customer.emailgroupAPIError})]})}),o.jsxRuntimeExports.jsx(t.Button,{style:{padding:`${t.Space.sp1} ${t.Space.sp2}`,backgroundColor:g.colors.champion,borderColor:g.colors.champion,color:g.mode==="light"?t.darkColors.primary:t.lightColors.primary},label:Re.customer.tryAgainText,size:"small",onClick:Ie})]}):null,I.fetchState==="Error"&&e.error!=null&&e.error?.code===406?o.jsxRuntimeExports.jsxs(Qn,{children:[o.jsxRuntimeExports.jsx(qn,{}),o.jsxRuntimeExports.jsxs(Jn,{children:[o.jsxRuntimeExports.jsx(t.LargeMedium,{children:z!==pe.empty?Re.customer.preOnboardingError:Re.customer.preOnboardingSaveError}),z!==pe.empty?o.jsxRuntimeExports.jsx(t.Button,{style:{padding:`${t.Space.sp1} ${t.Space.sp2}`,backgroundColor:g.colors.champion,borderColor:g.colors.champion,color:g.mode==="light"?t.darkColors.primary:t.lightColors.primary},label:z,size:"small",onClick:fe}):null]})]}):null,o.jsxRuntimeExports.jsx(ya,{groupEmailAdditionalLabel:M,groupNameAdditionalLabel:D,labelWidth:C,localData:e,ref:re,sectionId:lt}),o.jsxRuntimeExports.jsx(Sa,{localData:e,onboardedCompanies:E.companies,isSubsidiary:T,labelWidth:C,largeLabelWidth:b,extraLargeLabelWidth:S,realmIdAdditionalLabel:R,productsAdditionalLabel:W,ref:Z,sectionId:De,isDisabled:$===!1?"disabled":void 0}),o.jsxRuntimeExports.jsx(zC,{children:o.jsxRuntimeExports.jsx(yC,{isSectionDisabled:ue(j,f),sectionId:fa,isLoading:r===!0||F?.fetchState==="In-Progress"||F?.saveConnectionState==="In-Progress",accountingConnectionCreationMode:e.newOnboardingCustomerLocalData.accountingConnectionCreationMode,onQBOConnectClick:x,isConnected:w?.company.companyOnboardingInfo.onboardingInfo?.qboLinked.completed===!0,isInviteSent:w?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0||w?.company.companyOnboardingInfo.onboardingInfo?.inviteAccepted===!0,saveConnectionState:F?.saveConnectionState})})]})})]}),o.jsxRuntimeExports.jsx(t.Footer,{formId:`${Jr}_form`,primaryBtn:{label:w?.company.companyOnboardingInfo.onboardingInfo?.inviteSent===!0?Re.customer.resendInviteBtnText:Re.customer.sendInviteBtnText,style:{width:yo.buttonWidth.value(h),display:"flex",alignItems:"center",justifyContent:"center"},isLoading:I.fetchState==="In-Progress",isDisabled:Le},cancelBtn:{label:Re.customer.saveBtnText,style:{width:yo.buttonWidth.value(h),display:"flex",alignItems:"center",justifyContent:"center"},isDisabled:!(t.formHasDirtyFields(y.formState.dirtyFields)||e.emailGroupFetchState.fetchState==="Completed"),isLoading:A==="In-Progress"&&r===!1,shouldResetOnCancel:!1,onClick:H,reverseSpinnerColor:!1}})]})}const fo=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}),{[LC]:{companyDomain:n.companyEmailDomain??pe.empty},[lt]:{groupName:n.groupName??pe.empty,groupEmail:n.groupId??pe.empty,groupDescription:n.groupDescription??pe.empty},[De]:{name:n.name??pe.empty,entityType:{allOptions:[{label:Re.customer.parent,value:Re.customer.parent},{label:Re.customer.subsidiary,value:Re.customer.subsidiary}],selectedOption:n.isSubsidiary===!0?{label:Re.customer.subsidiary,value:Re.customer.subsidiary}:{label:Re.customer.parent,value:Re.customer.parent}},company:{selectedOption:i,allOptions:r.companies.map(d=>({label:d.companyInfo.name,value:d.companyInfo.companyId}))},realmId:n.qboRealmId??pe.empty,confirmRealmId:n.qboRealmId??pe.empty,chargebeeId:n.chargebeeId??pe.empty,hubSpotId:n.hubSpotId??pe.empty,email:n.email??pe.empty,customerName:n.customerName??{firstName:pe.empty,lastName:pe.empty},products:{allOptions:xn(e.allProductsList,n.selectedProducts??[]),selectedOptions:n.selectedProducts??[]}},[fa]:{accountingConnectionCreationMode:n.accountingConnectionCreationMode}}},NC=s.div`
|
|
4124
4124
|
display: flex;
|
|
4125
4125
|
justify-content: flex-start;
|
|
4126
4126
|
height: 100%;
|
|
@@ -4316,7 +4316,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4316
4316
|
z-index: ${t.sp[2]};
|
|
4317
4317
|
min-width: ${t.COMMENTS_SECTION_MINIMUM_WIDTH}px;
|
|
4318
4318
|
max-width: ${t.COMMENTS_DRAWER_MAXIMUM_WIDTH}px;
|
|
4319
|
-
`,Jt="monthEndReportFormSection",oi="monthEndReportPage",Fe=t.appLocale.getLocalizedStrings();function y3({companyId:e,enableZeniGPTFeature:n,enableSendingMonthEndEmail:r,monthEndReportView:i,previewMode:a,customerRequestData:d,allThreadsSectionOpen:l,filterMetaData:c,newThreadMetadata:p,isAuditScoreLoadingCompleted:m,improveUsingZeniGPTClick:x,onRemoveFileAttachment:g,onUpdateFileAttachment:h,onCloseAllThreadsSection:C,previewMonthEndReport:b,saveMonthEndReport:S,onEditClick:y,onOpenFileAttachmentSnackBar:j,onClickAuditScore:f,onClickCustomerRequest:E,sendMonthEndReport:$}){const A=o.useTheme(),[P,v]=u.useState(),[w,F]=u.useState(0),[D,K]=u.useState(0),M=u.useRef(),G=u.useRef(null),q=u.useRef(null),R=u.useRef(null),{html:L,subject:W,improveUsingZeniGPTStatus:k}=i,[I,N]=u.useState(),[Q,ae]=u.useState(!1),[z,Y]=u.useState(!1),[T,te]=u.useState(!1),[re,Z]=u.useState(!1),ie=u.useRef(null),ne=u.useRef(null),xe=t.useDelayUnmount(l,250),ye=i.fetchState==="Not-Started"||i.fetchState==="In-Progress"||i.companyMonthEndReportTemplatesData.fetchState==="Not-Started"||i.companyMonthEndReportTemplatesData.fetchState==="In-Progress",{threadsRefs:$e,sortedThreads:V,threadsPositions:ee,observer:ge,unresolvedThreadsMap:ve,handleRemoveFloatingThread:Ce}=t.useFloatingThreads(c,ie,!a,ye),[O,ke]=u.useState(0),B=u.useCallback(()=>{const Ge=$e.current?.[$e.current?.length-1];ke(window.scrollY+(Ge?.getBoundingClientRect()?.bottom??0))},[$e]),de=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(()=>{de()},[l,de]),u.useEffect(()=>(window.addEventListener("resize",de),()=>{window.removeEventListener("resize",de)}),[de]),u.useEffect(()=>(window.addEventListener("scroll",B),()=>window.removeEventListener("scroll",B)),[B]);const{openThread:je,addThread:U,setOpenThread:_}=u.useContext(t.ThreadsContext),ce=t.useHandleSelection(t.MONTH_END_REPORT_CANVAS,!1,!a),Se=ie.current?.getBoundingClientRect(),fe=ce!=null&&ce.coords&&Se?{left:ce.coords.left-Se.left,top:ce.coords.top-Se.top}:void 0,Le=u.useCallback(()=>{const Ge=window.getSelection()?.getRangeAt(0),ze=t.getSelectionData();if(!Ge||ze==null)return;const Je={...p,...ze,startPath:ze.startPath.join(),endPath:ze.endPath.join()},et=`${o.nanoid()}${t.NEW_THREAD_SUFFIX}`,vt=`cockpit_${e}`;U(et,{type:"thread",visibility:"public",id:et,roomId:vt,createdAt:new Date,updatedAt:new Date,comments:[],metadata:Je,resolved:!1}),_(et)},[U,e,p,_]),H=()=>{te(!0),setTimeout(()=>{te(!1)},2e3)};u.useEffect(()=>{je!=null&&l&&C()},[l,je,C]);const ue=k.fetchState==="In-Progress",Ie=o.useForm({mode:"all",defaultValues:ni(i),values:ni(i)}),Be=Ie.handleSubmit(Ge=>{const{recipientEmailList:ze,subject:Je}=Ge[Jt],et=i.auditSummaryData.auditSummary.bypassedAuditScore,vt=i.auditSummaryData.isControllerOrReviewer;if(a===!0)et>=75?$?.(I?.id):et<75&&(vt||r)&&Z(!0);else if(et>=75||et<75&&(vt||r)){const so=P?.replace(t.EMPTY_HTML_CHECKER,Fe.common.strings.empty);ze!=null&&Je!=null&&b(ze,Je,I?.id,so!=null&&so.length>0?P:void 0)}else Ke()}),me=()=>{G.current!=null&&G.current.click()},X=()=>{I!==void 0&&I!=null&&(g([I.id]),N(void 0),ae(!1))},Ne=Ge=>{const ze=Ge.target.files?Ge.target.files[0]:null;if(ze)if(!J.toSupportedAttachmentFileType(ze.type)||z)console.warn("Please select a valid file.");else{const Je=new FileReader;Je.onload=function(et){const vt=et.target?.result;if(typeof vt=="string"){const so={data:vt.split(",")[1],name:ze.name,id:J.getAttachmentFileIdByFileName(e,ze.name)};N(so),ae(!0),h([so])}},Je.readAsDataURL(ze)}},Qe=()=>{q.current&&q.current.scrollIntoView({behavior:"smooth"})},Ke=()=>{R.current&&(R.current.scrollIntoView({behavior:"smooth"}),H())},Et=()=>{const Ge=Ie.getValues(),{recipientEmailList:ze,subject:Je}=Ge[Jt];ze!=null&&Je!=null&&S(ze,Je,I?.id,P)};u.useEffect(()=>{v(i.zeniRequestsHtml)},[i.zeniRequestsHtml]),u.useEffect(()=>{M.current=I},[I]),u.useEffect(()=>{N(J.mapAttachmentFileToAttachmentFilePayload(i.attachmentFile)),ae(!1)},[i.attachmentFile]),u.useEffect(()=>{z&&j()},[z,j]);const no=J.dateNow().subtract(1,"month").format(Fe.dateFormat.visual.MMMMFormat),Ut=L!=null?L.split(t.MONTH_END_EDITOR_PLACEHOLDER):[],wa=i.concatenatedHtml,ka=()=>i.lastDraftSavedDate!=null&&a===!1?o.jsxRuntimeExports.jsx(t.UserWithTimestamp,{time:i.lastDraftSavedDate,user:i.reportLastSavedByUser,timeStampLabel:Fe.cockpit.monthEndReport.timeStampLabel}):null,Ta={onOkClick:()=>{$?.(I?.id),Z(!1),Ie.reset()},onCancelClick:()=>{y==null?Z(!1):y(),Z(!1)}};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(r3,{ref:ne,style:O>0?{height:O}:void 0,children:[o.jsxRuntimeExports.jsx(s3,{availableWidth:l?D:w}),o.jsxRuntimeExports.jsxs(n3,{children:[o.jsxRuntimeExports.jsx(o.FormProvider,{...Ie,children:o.jsxRuntimeExports.jsx("form",{id:si(oi),onSubmit:Be,children:o.jsxRuntimeExports.jsxs(x3,{children:[o.jsxRuntimeExports.jsx(t.MonthEndReportSection,{sectionId:Jt,previewMode:a,subject:W}),a?null:o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ca,{ref:R,highlight:T,onClickAuditScore:f,auditSummaryData:i.auditSummaryData,isAuditScoreLoadingCompleted:m}),o.jsxRuntimeExports.jsx(t.MonthEndReportCustomerRequestSection,{totalItems:(i.zeniRequestsData??[]).length+t.getTemplatesFromTemplatedData(i.companyMonthEndReportTemplatesData).length,onClickCustomerRequest:E})]}),o.jsxRuntimeExports.jsxs(l3,{id:t.MONTH_END_REPORT_CANVAS,ref:ie,children:[o.jsxRuntimeExports.jsxs(c3,{className:"monthEndReportCanvasWrapper",children:[I!=null||z?o.jsxRuntimeExports.jsx(d3,{onClick:Qe,children:o.jsxRuntimeExports.jsx(t.CircleWithAttachmentSuccessIcon,{fileSizeError:z,setFileSizeError:Y,loading:!1,showAnimation:!a&&Q})}):null,a?o.jsxRuntimeExports.jsx(ti,{dangerouslySetInnerHTML:{__html:t.getHTMLWithCommentingSections(wa)}}):o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(a3,{id:t.MONTH_END_EMAIL_HEADER_SECTION,children:[o.jsxRuntimeExports.jsx(t.StandardRegular,{dangerouslySetInnerHTML:{__html:Ut[0]!=null?Ut[0]+"</body></html>":Fe.common.strings.empty}}),o.jsxRuntimeExports.jsxs(i3,{children:[o.jsxRuntimeExports.jsx(m3,{children:Fe.cockpit.monthEndReport.editorTitle}),o.jsxRuntimeExports.jsx(u3,{children:Fe.cockpit.monthEndReport.editorNote})]})]}),o.jsxRuntimeExports.jsx(p3,{id:t.MONTH_END_EMAIL_EDITOR_SECTION,children:o.jsxRuntimeExports.jsx(t.Editor,{handleFileInputClick:me,fileAttached:I!=null,enableZeniGPTFeature:n,isZeniGPTResponseLoading:ue,initialHtmlString:i.zeniRequestsHtml,improveUsingZeniGPTClick:x,setZeniRequestsHtml:v,customerRequestData:d})}),o.jsxRuntimeExports.jsx(ti,{id:t.MONTH_END_EMAIL_BODY_SECTION,dangerouslySetInnerHTML:{__html:Ut[1]!=null?"<html><body>"+Ut[1]:Fe.common.strings.empty}})]}),I!=null?o.jsxRuntimeExports.jsx(t.FileAttachment,{ref:q,fileName:I.name,fileSize:t.base64FileSize(I.data),onRemove:X,isRemovable:!a}):null]}),fe?o.jsxRuntimeExports.jsx(t.AddThreadFloating,{style:{zIndex:15},coords:fe,alignment:ce.alignment,onClick:Le}):null,o.jsxRuntimeExports.jsx(t.TextHighlightSection,{canvasContainerRef:ie,sortedThreads:V,editorMode:!a})]})]})})}),o.jsxRuntimeExports.jsx(t.FileInputElement,{name:I?.name??Fe.common.strings.empty,fileRef:G,sizeLimit:o3,acceptableTypes:t3,onFileChange:async Ge=>{Ne(Ge)},onFileSizeError:Ge=>Y(Ge),multiple:!1})]}),xe?o.jsxRuntimeExports.jsx(S3,{allThreadsSectionOpen:l,children:o.jsxRuntimeExports.jsx(t.AllThreadsSection,{autoExpand:!0,autoFocus:!1,style:{borderLeft:`1px solid ${A.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:A.colors.background},threadsContainerStyle:{paddingBottom:a?"160px":t.Space.sp12},collapsibleThreadStyle:{width:`calc(100% - ${t.Space.sp4})`},allowComposer:!1,drawerTitle:Fe.common.texts.comments,filter:c,textOverrides:{},preventResolvedThreadClick:!0,onThreadClick:(Ge,ze)=>{_(ze);const Je=V.findIndex(et=>et[0]===ze);C(),$e.current?.[Je]?.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},onCloseAllThreadsDrawer:()=>C()})}):o.jsxRuntimeExports.jsx(t.FloatingThreads,{observer:ge,canvasContainerRef:ie,sortedThreads:V,threadsPositions:ee,threadsRefs:$e,unresolvedThreadsMap:ve,editorMode:!a,style:{minWidth:`${t.COMMENTS_SECTION_MINIMUM_WIDTH}px`,position:"relative",height:"fit-content",width:"auto",top:`${ie.current?.offsetTop}px`},handleRemoveFloatingThread:Ce})]}),re?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{children:Fe.cockpit.monthEndReport.sendMonthInsightsTitle.replace("__month__",no)}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:Fe.cockpit.monthEndReport.sendMonthInsightsDescription.replace("__month__",no)}),primaryButtonText:Fe.cockpit.monthEndReport.sendAnyway,primaryButtonWidth:124,secondaryButtonWidth:124,proceedButtonVariant:"destructive",secondaryButtonText:Fe.cockpit.monthEndReport.editButtonLabel,action:Ta,containerStyle:{minWidth:356}}):null,o.jsxRuntimeExports.jsx(t.Footer,{style:{zIndex:10},leftSideComponent:ka(),formId:si(oi),helperText:a===!0?Fe.cockpit.monthEndReport.reportSentDateInfo:void 0,cancelBtn:{isDisabled:!m||ue,label:a===!0?Fe.cockpit.monthEndReport.editButtonLabel:Fe.cockpit.monthEndReport.saveChanges,onClick:a===!0?y:Et,style:{width:"225px"},size:"medium",isLoading:i.saveMonthEndReportStatus.fetchState==="In-Progress",reverseSpinnerColor:!1},primaryBtn:{isDisabled:!m||ue,isLoading:a===!0?i.sendMonthEndReportStatus.fetchState==="In-Progress":i.previewMonthEndReportStatus.fetchState==="In-Progress",style:{width:a===!0?"unset":"225px"},label:a===!0?Fe.cockpit.monthEndReport.sendEmailButtonLabel.replace("__month__",no):Fe.cockpit.monthEndReport.preview,size:"medium"}})]})}const ni=e=>({[Jt]:{recipientEmailList:e.recipientEmailList,subject:e.subject??Fe.common.strings.empty}}),si=e=>`${e}_form`,f3=s(t.SmallRegular)`
|
|
4319
|
+
`,Jt="monthEndReportFormSection",oi="monthEndReportPage",Fe=t.appLocale.getLocalizedStrings();function y3({companyId:e,enableZeniGPTFeature:n,enableSendingMonthEndEmail:r,monthEndReportView:i,previewMode:a,customerRequestData:d,allThreadsSectionOpen:l,filterMetaData:c,newThreadMetadata:p,isAuditScoreLoadingCompleted:m,improveUsingZeniGPTClick:x,onRemoveFileAttachment:g,onUpdateFileAttachment:h,onCloseAllThreadsSection:C,previewMonthEndReport:b,saveMonthEndReport:S,onEditClick:y,onOpenFileAttachmentSnackBar:j,onClickAuditScore:f,onClickCustomerRequest:E,sendMonthEndReport:$}){const A=o.useTheme(),[I,v]=u.useState(),[w,F]=u.useState(0),[D,K]=u.useState(0),M=u.useRef(),G=u.useRef(null),q=u.useRef(null),R=u.useRef(null),{html:L,subject:W,improveUsingZeniGPTStatus:k}=i,[P,N]=u.useState(),[Q,ae]=u.useState(!1),[z,Y]=u.useState(!1),[T,te]=u.useState(!1),[re,Z]=u.useState(!1),ie=u.useRef(null),ne=u.useRef(null),xe=t.useDelayUnmount(l,250),ye=i.fetchState==="Not-Started"||i.fetchState==="In-Progress"||i.companyMonthEndReportTemplatesData.fetchState==="Not-Started"||i.companyMonthEndReportTemplatesData.fetchState==="In-Progress",{threadsRefs:$e,sortedThreads:V,threadsPositions:ee,observer:ge,unresolvedThreadsMap:ve,handleRemoveFloatingThread:Ce}=t.useFloatingThreads(c,ie,!a,ye),[O,ke]=u.useState(0),B=u.useCallback(()=>{const Ge=$e.current?.[$e.current?.length-1];ke(window.scrollY+(Ge?.getBoundingClientRect()?.bottom??0))},[$e]),de=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(()=>{de()},[l,de]),u.useEffect(()=>(window.addEventListener("resize",de),()=>{window.removeEventListener("resize",de)}),[de]),u.useEffect(()=>(window.addEventListener("scroll",B),()=>window.removeEventListener("scroll",B)),[B]);const{openThread:je,addThread:U,setOpenThread:_}=u.useContext(t.ThreadsContext),ce=t.useHandleSelection(t.MONTH_END_REPORT_CANVAS,!1,!a),Se=ie.current?.getBoundingClientRect(),fe=ce!=null&&ce.coords&&Se?{left:ce.coords.left-Se.left,top:ce.coords.top-Se.top}:void 0,Ie=u.useCallback(()=>{const Ge=window.getSelection()?.getRangeAt(0),ze=t.getSelectionData();if(!Ge||ze==null)return;const Je={...p,...ze,startPath:ze.startPath.join(),endPath:ze.endPath.join()},et=`${o.nanoid()}${t.NEW_THREAD_SUFFIX}`,vt=`cockpit_${e}`;U(et,{type:"thread",visibility:"public",id:et,roomId:vt,createdAt:new Date,updatedAt:new Date,comments:[],metadata:Je,resolved:!1}),_(et)},[U,e,p,_]),H=()=>{te(!0),setTimeout(()=>{te(!1)},2e3)};u.useEffect(()=>{je!=null&&l&&C()},[l,je,C]);const ue=k.fetchState==="In-Progress",Le=o.useForm({mode:"all",defaultValues:ni(i),values:ni(i)}),Be=Le.handleSubmit(Ge=>{const{recipientEmailList:ze,subject:Je}=Ge[Jt],et=i.auditSummaryData.auditSummary.bypassedAuditScore,vt=i.auditSummaryData.isControllerOrReviewer;if(a===!0)et>=75?$?.(P?.id):et<75&&(vt||r)&&Z(!0);else if(et>=75||et<75&&(vt||r)){const so=I?.replace(t.EMPTY_HTML_CHECKER,Fe.common.strings.empty);ze!=null&&Je!=null&&b(ze,Je,P?.id,so!=null&&so.length>0?I:void 0)}else Ke()}),me=()=>{G.current!=null&&G.current.click()},X=()=>{P!==void 0&&P!=null&&(g([P.id]),N(void 0),ae(!1))},Ne=Ge=>{const ze=Ge.target.files?Ge.target.files[0]:null;if(ze)if(!J.toSupportedAttachmentFileType(ze.type)||z)console.warn("Please select a valid file.");else{const Je=new FileReader;Je.onload=function(et){const vt=et.target?.result;if(typeof vt=="string"){const so={data:vt.split(",")[1],name:ze.name,id:J.getAttachmentFileIdByFileName(e,ze.name)};N(so),ae(!0),h([so])}},Je.readAsDataURL(ze)}},Qe=()=>{q.current&&q.current.scrollIntoView({behavior:"smooth"})},Ke=()=>{R.current&&(R.current.scrollIntoView({behavior:"smooth"}),H())},Et=()=>{const Ge=Le.getValues(),{recipientEmailList:ze,subject:Je}=Ge[Jt];ze!=null&&Je!=null&&S(ze,Je,P?.id,I)};u.useEffect(()=>{v(i.zeniRequestsHtml)},[i.zeniRequestsHtml]),u.useEffect(()=>{M.current=P},[P]),u.useEffect(()=>{N(J.mapAttachmentFileToAttachmentFilePayload(i.attachmentFile)),ae(!1)},[i.attachmentFile]),u.useEffect(()=>{z&&j()},[z,j]);const no=J.dateNow().subtract(1,"month").format(Fe.dateFormat.visual.MMMMFormat),Ut=L!=null?L.split(t.MONTH_END_EDITOR_PLACEHOLDER):[],wa=i.concatenatedHtml,ka=()=>i.lastDraftSavedDate!=null&&a===!1?o.jsxRuntimeExports.jsx(t.UserWithTimestamp,{time:i.lastDraftSavedDate,user:i.reportLastSavedByUser,timeStampLabel:Fe.cockpit.monthEndReport.timeStampLabel}):null,Ta={onOkClick:()=>{$?.(P?.id),Z(!1),Le.reset()},onCancelClick:()=>{y==null?Z(!1):y(),Z(!1)}};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(r3,{ref:ne,style:O>0?{height:O}:void 0,children:[o.jsxRuntimeExports.jsx(s3,{availableWidth:l?D:w}),o.jsxRuntimeExports.jsxs(n3,{children:[o.jsxRuntimeExports.jsx(o.FormProvider,{...Le,children:o.jsxRuntimeExports.jsx("form",{id:si(oi),onSubmit:Be,children:o.jsxRuntimeExports.jsxs(x3,{children:[o.jsxRuntimeExports.jsx(t.MonthEndReportSection,{sectionId:Jt,previewMode:a,subject:W}),a?null:o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ca,{ref:R,highlight:T,onClickAuditScore:f,auditSummaryData:i.auditSummaryData,isAuditScoreLoadingCompleted:m}),o.jsxRuntimeExports.jsx(t.MonthEndReportCustomerRequestSection,{totalItems:(i.zeniRequestsData??[]).length+t.getTemplatesFromTemplatedData(i.companyMonthEndReportTemplatesData).length,onClickCustomerRequest:E})]}),o.jsxRuntimeExports.jsxs(l3,{id:t.MONTH_END_REPORT_CANVAS,ref:ie,children:[o.jsxRuntimeExports.jsxs(c3,{className:"monthEndReportCanvasWrapper",children:[P!=null||z?o.jsxRuntimeExports.jsx(d3,{onClick:Qe,children:o.jsxRuntimeExports.jsx(t.CircleWithAttachmentSuccessIcon,{fileSizeError:z,setFileSizeError:Y,loading:!1,showAnimation:!a&&Q})}):null,a?o.jsxRuntimeExports.jsx(ti,{dangerouslySetInnerHTML:{__html:t.getHTMLWithCommentingSections(wa)}}):o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(a3,{id:t.MONTH_END_EMAIL_HEADER_SECTION,children:[o.jsxRuntimeExports.jsx(t.StandardRegular,{dangerouslySetInnerHTML:{__html:Ut[0]!=null?Ut[0]+"</body></html>":Fe.common.strings.empty}}),o.jsxRuntimeExports.jsxs(i3,{children:[o.jsxRuntimeExports.jsx(m3,{children:Fe.cockpit.monthEndReport.editorTitle}),o.jsxRuntimeExports.jsx(u3,{children:Fe.cockpit.monthEndReport.editorNote})]})]}),o.jsxRuntimeExports.jsx(p3,{id:t.MONTH_END_EMAIL_EDITOR_SECTION,children:o.jsxRuntimeExports.jsx(t.Editor,{handleFileInputClick:me,fileAttached:P!=null,enableZeniGPTFeature:n,isZeniGPTResponseLoading:ue,initialHtmlString:i.zeniRequestsHtml,improveUsingZeniGPTClick:x,setZeniRequestsHtml:v,customerRequestData:d})}),o.jsxRuntimeExports.jsx(ti,{id:t.MONTH_END_EMAIL_BODY_SECTION,dangerouslySetInnerHTML:{__html:Ut[1]!=null?"<html><body>"+Ut[1]:Fe.common.strings.empty}})]}),P!=null?o.jsxRuntimeExports.jsx(t.FileAttachment,{ref:q,fileName:P.name,fileSize:t.base64FileSize(P.data),onRemove:X,isRemovable:!a}):null]}),fe?o.jsxRuntimeExports.jsx(t.AddThreadFloating,{style:{zIndex:15},coords:fe,alignment:ce.alignment,onClick:Ie}):null,o.jsxRuntimeExports.jsx(t.TextHighlightSection,{canvasContainerRef:ie,sortedThreads:V,editorMode:!a})]})]})})}),o.jsxRuntimeExports.jsx(t.FileInputElement,{name:P?.name??Fe.common.strings.empty,fileRef:G,sizeLimit:o3,acceptableTypes:t3,onFileChange:async Ge=>{Ne(Ge)},onFileSizeError:Ge=>Y(Ge),multiple:!1})]}),xe?o.jsxRuntimeExports.jsx(S3,{allThreadsSectionOpen:l,children:o.jsxRuntimeExports.jsx(t.AllThreadsSection,{autoExpand:!0,autoFocus:!1,style:{borderLeft:`1px solid ${A.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:A.colors.background},threadsContainerStyle:{paddingBottom:a?"160px":t.Space.sp12},collapsibleThreadStyle:{width:`calc(100% - ${t.Space.sp4})`},allowComposer:!1,drawerTitle:Fe.common.texts.comments,filter:c,textOverrides:{},preventResolvedThreadClick:!0,onThreadClick:(Ge,ze)=>{_(ze);const Je=V.findIndex(et=>et[0]===ze);C(),$e.current?.[Je]?.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},onCloseAllThreadsDrawer:()=>C()})}):o.jsxRuntimeExports.jsx(t.FloatingThreads,{observer:ge,canvasContainerRef:ie,sortedThreads:V,threadsPositions:ee,threadsRefs:$e,unresolvedThreadsMap:ve,editorMode:!a,style:{minWidth:`${t.COMMENTS_SECTION_MINIMUM_WIDTH}px`,position:"relative",height:"fit-content",width:"auto",top:`${ie.current?.offsetTop}px`},handleRemoveFloatingThread:Ce})]}),re?o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpTitle,{children:Fe.cockpit.monthEndReport.sendMonthInsightsTitle.replace("__month__",no)}),descriptionComponent:o.jsxRuntimeExports.jsx(t.ConfirmationPopUpDescription,{children:Fe.cockpit.monthEndReport.sendMonthInsightsDescription.replace("__month__",no)}),primaryButtonText:Fe.cockpit.monthEndReport.sendAnyway,primaryButtonWidth:124,secondaryButtonWidth:124,proceedButtonVariant:"destructive",secondaryButtonText:Fe.cockpit.monthEndReport.editButtonLabel,action:Ta,containerStyle:{minWidth:356}}):null,o.jsxRuntimeExports.jsx(t.Footer,{style:{zIndex:10},leftSideComponent:ka(),formId:si(oi),helperText:a===!0?Fe.cockpit.monthEndReport.reportSentDateInfo:void 0,cancelBtn:{isDisabled:!m||ue,label:a===!0?Fe.cockpit.monthEndReport.editButtonLabel:Fe.cockpit.monthEndReport.saveChanges,onClick:a===!0?y:Et,style:{width:"225px"},size:"medium",isLoading:i.saveMonthEndReportStatus.fetchState==="In-Progress",reverseSpinnerColor:!1},primaryBtn:{isDisabled:!m||ue,isLoading:a===!0?i.sendMonthEndReportStatus.fetchState==="In-Progress":i.previewMonthEndReportStatus.fetchState==="In-Progress",style:{width:a===!0?"unset":"225px"},label:a===!0?Fe.cockpit.monthEndReport.sendEmailButtonLabel.replace("__month__",no):Fe.cockpit.monthEndReport.preview,size:"medium"}})]})}const ni=e=>({[Jt]:{recipientEmailList:e.recipientEmailList,subject:e.subject??Fe.common.strings.empty}}),si=e=>`${e}_form`,f3=s(t.SmallRegular)`
|
|
4320
4320
|
color: ${e=>e.theme.colors.hero};
|
|
4321
4321
|
display: flex;
|
|
4322
4322
|
align-items: center;
|
|
@@ -4404,9 +4404,9 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4404
4404
|
flex-wrap: nowrap;
|
|
4405
4405
|
height: 100vh;
|
|
4406
4406
|
justify-content: center;
|
|
4407
|
-
`,
|
|
4407
|
+
`,I3=s(t.SmallRegular)`
|
|
4408
4408
|
color: ${e=>e.theme.colors.hero};
|
|
4409
|
-
`,
|
|
4409
|
+
`,L3=s.div`
|
|
4410
4410
|
justify-content: center;
|
|
4411
4411
|
align-items: center;
|
|
4412
4412
|
display: flex;
|
|
@@ -4414,7 +4414,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4414
4414
|
`,A3=s(t.SvgReload)`
|
|
4415
4415
|
width: ${t.Space.sp10};
|
|
4416
4416
|
height: ${t.Space.sp10};
|
|
4417
|
-
`,{dateFormat:D3,card:O3,cockpit:N3}=t.appLocale.getLocalizedStrings(),ri=({message:e,onReload:n})=>o.jsxRuntimeExports.jsxs(
|
|
4417
|
+
`,{dateFormat:D3,card:O3,cockpit:N3}=t.appLocale.getLocalizedStrings(),ri=({message:e,onReload:n})=>o.jsxRuntimeExports.jsxs(L3,{onClick:n,children:[o.jsxRuntimeExports.jsx(A3,{}),o.jsxRuntimeExports.jsx(I3,{children:e})]}),M3=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(D3.visual.MMSlashYYYYFormat),[m,x]=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(nn,{children:o.jsxRuntimeExports.jsx(P3,{children:o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"ExtraLarge",start:!0})})});if(n.fetchState==="Error"||n.companyMonthEndReportTemplatesData.fetchState==="Error")return o.jsxRuntimeExports.jsx(nn,{children:o.jsxRuntimeExports.jsx(ri,{onReload:a,message:O3.failedText})});if(n.html==null)return o.jsxRuntimeExports.jsx(nn,{children:o.jsxRuntimeExports.jsx(ri,{onReload:a,message:N3.monthEndReport.insightsNotAvailable})});const g={application:"cockpit",companyId:r,entityId:r,tab:"management",isGlobalComment:!1,entityType:"management.monthEndEmail",companyName:n.companyName,url:window.location.href,selectedRange:p},{url:h,...C}=g,b={...C},S=`cockpit_${r}`;return o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:S,children:o.jsxRuntimeExports.jsxs(nn,{children:[o.jsxRuntimeExports.jsx(ja,{companyName:n.companyName,threadMetadata:b,onAllThreadsClick:()=>{l!=null&&c(null),x(!0)},onNavigateBack:d,onRefresh:a}),o.jsxRuntimeExports.jsx(y3,{...e,allThreadsSectionOpen:m,filterMetaData:b,newThreadMetadata:g,onCloseAllThreadsSection:()=>x(!1)},i.toString())]})})},es=s.div`
|
|
4418
4418
|
display: flex;
|
|
4419
4419
|
justify-content: flex-end;
|
|
4420
4420
|
align-items: center;
|
|
@@ -4537,7 +4537,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4537
4537
|
padding-bottom: ${t.Space.sp5};
|
|
4538
4538
|
`,q3=s(t.ExtraSmallRegular)`
|
|
4539
4539
|
color: ${e=>e.theme.colors.grey1};
|
|
4540
|
-
`,{common:{strings:sn,datePicker:Q3,texts:J3},dateFormat:rn,cockpit:ej,card:tj}=t.appLocale.getLocalizedStrings(),oj=({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(),[x,g]=u.useState(!1),h="monthEndReportHistoricDataPage",C=t.useHandleSelection(t.MONTH_END_REPORT_CANVAS,!1,!1),b=i.current?.getBoundingClientRect(),S=C!=null&&C.coords!=null&&b?{left:C.coords.left-b.left,top:C.coords.top-b.top}:void 0,y=o.useForm({mode:"all",defaultValues:ii(e),values:ii(e)}),j=()=>{c.current&&c.current.scrollIntoView({behavior:"smooth"})};u.useEffect(()=>{m(J.mapAttachmentFileToAttachmentFilePayload(e.attachmentFile))},[e.attachmentFile]);const f=u.useCallback(()=>{const E=window.getSelection()?.getRangeAt(0),$=t.getSelectionData();if(!E||$==null)return;const A={...r,...$,startPath:$.startPath.join(),endPath:$.endPath.join()},P=`${o.nanoid()}${t.NEW_THREAD_SUFFIX}`,v=`cockpit_${n}`;d(P,{type:"thread",visibility:"public",id:P,roomId:v,createdAt:new Date,updatedAt:new Date,comments:[],metadata:A,resolved:!1}),l(P)},[d,n,r,l]);return o.jsxRuntimeExports.jsx(o.FormProvider,{...y,children:o.jsxRuntimeExports.jsx("form",{id:sj(h),children:o.jsxRuntimeExports.jsxs(Y3,{children:[o.jsxRuntimeExports.jsx(t.MonthEndReportSection,{previewMode:!0,subject:e.subject,sectionId:Jt}),o.jsxRuntimeExports.jsxs(z3,{id:t.MONTH_END_REPORT_CANVAS,ref:i,children:[o.jsxRuntimeExports.jsxs(F3,{className:"monthEndReportCanvasWrapper",children:[p!=null?o.jsxRuntimeExports.jsx(B3,{onClick:j,children:o.jsxRuntimeExports.jsx(t.CircleWithAttachmentSuccessIcon,{loading:!1,fileSizeError:x,setFileSizeError:g})}):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]}),S?o.jsxRuntimeExports.jsx(t.AddThreadFloating,{style:{zIndex:15},coords:S,alignment:C.alignment,onClick:f}):null,o.jsxRuntimeExports.jsx(t.TextHighlightSection,{canvasContainerRef:i,sortedThreads:a,editorMode:!1})]})]})})})},nj=e=>{const{monthEndReportHistoricData:n,reportSentDate:r,onRefresh:i,onNavigateBack:a,onDateChange:d}=e,l=o.useTheme(),[c,p]=u.useState(!1),[m,x]=u.useState(),g=u.useRef(null),[h,C]=u.useState(0),[b,S]=u.useState(0),y=t.useDelayUnmount(c,250),{data:j,companyId:f,companyName:E,firstMonthOfFY:$}=n,A=t.getMonthIndex(r.format(rn.visual.MMMMFormat)),P=Number(r.format(rn.visual.YYYYformat)),v=$>A?P-1:P;u.useEffect(()=>{const ie=A>0?A-1:12;x(`${o.padStart(ie.toString(),2,"0")}${sn.backspace}${P}`)},[]);const w={application:"cockpit",companyId:f,entityId:f,tab:"management",isGlobalComment:!1,entityType:"management.monthEndEmail",companyName:E,url:window.location.href,selectedRange:m},{url:F,...D}=w,K={...D},M=n.fetchState==="Not-Started"||n.fetchState==="In-Progress",{threadsRefs:G,sortedThreads:q,threadsPositions:R,observer:L,unresolvedThreadsMap:W,handleRemoveFloatingThread:k}=t.useFloatingThreads(K,g,!1,M),I=u.useRef(null),[N,Q]=u.useState(0),ae=u.useCallback(()=>{const ie=G.current?.[G.current?.length-1];Q(window.scrollY+(ie?.getBoundingClientRect()?.bottom??0))},[G]),z=u.useCallback(()=>{c?S(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(()=>{z()},[c,z]),u.useEffect(()=>(window.addEventListener("resize",z),()=>{window.removeEventListener("resize",z)}),[z]),u.useEffect(()=>(window.addEventListener("scroll",ae),()=>window.removeEventListener("scroll",ae)),[ae]);const{openThread:Y,setOpenThread:T}=u.useContext(t.ThreadsContext);u.useEffect(()=>{Y!=null&&c&&p(!1)},[c,Y,p]);const te=t.getHistoricMonthsList($,n.historicReportSentDates),re=u.useCallback((ie,ne)=>{const xe=$>ie?ne+1:ne;d(J.dateFromYearMonthDate(xe,ie-1));const ye=ie>0?ie-1:12;x(`${o.padStart(ye.toString(),2,"0")}${sn.backspace}${xe}`)},[$,d]);if(n.fetchState==="Not-Started"||n.fetchState==="In-Progress")return o.jsxRuntimeExports.jsxs(ts,{children:[o.jsxRuntimeExports.jsx(es,{children:o.jsxRuntimeExports.jsx(os,{onClick:a})}),o.jsxRuntimeExports.jsx(t.BusyIndication,{fetchState:n.fetchState,styles:{margin:t.Space.sp0}})]});if(n.fetchState==="Error")return o.jsxRuntimeExports.jsxs(ts,{children:[o.jsxRuntimeExports.jsx(es,{children:o.jsxRuntimeExports.jsx(os,{onClick:a})}),o.jsxRuntimeExports.jsx(t.ReloadContainer,{onReload:i,message:tj.failedText})]});if(j?.concatenatedHtml==null)return o.jsxRuntimeExports.jsxs(ts,{children:[o.jsxRuntimeExports.jsx(es,{children:o.jsxRuntimeExports.jsx(os,{onClick:a})}),o.jsxRuntimeExports.jsx(t.ReloadContainer,{onReload:i,message:ej.monthEndReport.insightsNotAvailable})]});const Z=`cockpit_${f}`;return o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:Z,children:o.jsxRuntimeExports.jsxs(W3,{children:[o.jsxRuntimeExports.jsx(ja,{companyName:n.companyName,onNavigateBack:a,monthCalendar:{monthAndYears:te,label:`${r.format(rn.visual.MMMformat)} ${v}`,selectedMonth:{month:A,year:v},onChange:re},threadMetadata:K,onAllThreadsClick:()=>{Y!=null&&T(null),p(!0)}}),o.jsxRuntimeExports.jsxs(K3,{ref:I,style:N>0?{height:N}:void 0,children:[o.jsxRuntimeExports.jsx(_3,{availableWidth:c?b:h}),o.jsxRuntimeExports.jsxs(G3,{children:[o.jsxRuntimeExports.jsx(oj,{historicData:j,newThreadMetadata:w,companyId:f,sortedThreads:q,containerRef:g}),o.jsxRuntimeExports.jsxs(X3,{children:[o.jsxRuntimeExports.jsx(Pi,{user:n.reportLastSentByUser}),o.jsxRuntimeExports.jsx(Z3,{}),o.jsxRuntimeExports.jsxs(q3,{children:[Q3.businessDay,sn.space,n.data?.reportSentDate!=null?J.getBusinessDayOfDate(n.data.reportSentDate):null,":",sn.space,n.data?.reportSentDate?.format(rn.visual.MMMDFormat)]})]})]}),y?o.jsxRuntimeExports.jsx(H3,{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:J3.comments,filter:K,textOverrides:{},preventResolvedThreadClick:!0,onThreadClick:(ie,ne)=>{T(ne);const xe=q.findIndex(ye=>ye[0]===ne);p(!1),G.current?.[xe]?.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},onCloseAllThreadsDrawer:()=>p(!1)})}):o.jsxRuntimeExports.jsx(t.FloatingThreads,{observer:L,canvasContainerRef:g,sortedThreads:q,threadsPositions:R,threadsRefs:G,unresolvedThreadsMap:W,editorMode:!1,style:{minWidth:`${t.COMMENTS_SECTION_MINIMUM_WIDTH}px`,position:"relative",height:"fit-content",width:"auto",top:`${g.current?.offsetTop}px`},handleRemoveFloatingThread:k})]})]})})},ii=e=>({[Jt]:{recipientEmailList:e.recipientEmailList??[],subject:e.subject??""}}),sj=e=>`${e}_form`,rj=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"})),ij=s.div`
|
|
4540
|
+
`,{common:{strings:sn,datePicker:Q3,texts:J3},dateFormat:rn,cockpit:ej,card:tj}=t.appLocale.getLocalizedStrings(),oj=({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(),[x,g]=u.useState(!1),h="monthEndReportHistoricDataPage",C=t.useHandleSelection(t.MONTH_END_REPORT_CANVAS,!1,!1),b=i.current?.getBoundingClientRect(),S=C!=null&&C.coords!=null&&b?{left:C.coords.left-b.left,top:C.coords.top-b.top}:void 0,y=o.useForm({mode:"all",defaultValues:ii(e),values:ii(e)}),j=()=>{c.current&&c.current.scrollIntoView({behavior:"smooth"})};u.useEffect(()=>{m(J.mapAttachmentFileToAttachmentFilePayload(e.attachmentFile))},[e.attachmentFile]);const f=u.useCallback(()=>{const E=window.getSelection()?.getRangeAt(0),$=t.getSelectionData();if(!E||$==null)return;const A={...r,...$,startPath:$.startPath.join(),endPath:$.endPath.join()},I=`${o.nanoid()}${t.NEW_THREAD_SUFFIX}`,v=`cockpit_${n}`;d(I,{type:"thread",visibility:"public",id:I,roomId:v,createdAt:new Date,updatedAt:new Date,comments:[],metadata:A,resolved:!1}),l(I)},[d,n,r,l]);return o.jsxRuntimeExports.jsx(o.FormProvider,{...y,children:o.jsxRuntimeExports.jsx("form",{id:sj(h),children:o.jsxRuntimeExports.jsxs(Y3,{children:[o.jsxRuntimeExports.jsx(t.MonthEndReportSection,{previewMode:!0,subject:e.subject,sectionId:Jt}),o.jsxRuntimeExports.jsxs(z3,{id:t.MONTH_END_REPORT_CANVAS,ref:i,children:[o.jsxRuntimeExports.jsxs(F3,{className:"monthEndReportCanvasWrapper",children:[p!=null?o.jsxRuntimeExports.jsx(B3,{onClick:j,children:o.jsxRuntimeExports.jsx(t.CircleWithAttachmentSuccessIcon,{loading:!1,fileSizeError:x,setFileSizeError:g})}):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]}),S?o.jsxRuntimeExports.jsx(t.AddThreadFloating,{style:{zIndex:15},coords:S,alignment:C.alignment,onClick:f}):null,o.jsxRuntimeExports.jsx(t.TextHighlightSection,{canvasContainerRef:i,sortedThreads:a,editorMode:!1})]})]})})})},nj=e=>{const{monthEndReportHistoricData:n,reportSentDate:r,onRefresh:i,onNavigateBack:a,onDateChange:d}=e,l=o.useTheme(),[c,p]=u.useState(!1),[m,x]=u.useState(),g=u.useRef(null),[h,C]=u.useState(0),[b,S]=u.useState(0),y=t.useDelayUnmount(c,250),{data:j,companyId:f,companyName:E,firstMonthOfFY:$}=n,A=t.getMonthIndex(r.format(rn.visual.MMMMFormat)),I=Number(r.format(rn.visual.YYYYformat)),v=$>A?I-1:I;u.useEffect(()=>{const ie=A>0?A-1:12;x(`${o.padStart(ie.toString(),2,"0")}${sn.backspace}${I}`)},[]);const w={application:"cockpit",companyId:f,entityId:f,tab:"management",isGlobalComment:!1,entityType:"management.monthEndEmail",companyName:E,url:window.location.href,selectedRange:m},{url:F,...D}=w,K={...D},M=n.fetchState==="Not-Started"||n.fetchState==="In-Progress",{threadsRefs:G,sortedThreads:q,threadsPositions:R,observer:L,unresolvedThreadsMap:W,handleRemoveFloatingThread:k}=t.useFloatingThreads(K,g,!1,M),P=u.useRef(null),[N,Q]=u.useState(0),ae=u.useCallback(()=>{const ie=G.current?.[G.current?.length-1];Q(window.scrollY+(ie?.getBoundingClientRect()?.bottom??0))},[G]),z=u.useCallback(()=>{c?S(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(()=>{z()},[c,z]),u.useEffect(()=>(window.addEventListener("resize",z),()=>{window.removeEventListener("resize",z)}),[z]),u.useEffect(()=>(window.addEventListener("scroll",ae),()=>window.removeEventListener("scroll",ae)),[ae]);const{openThread:Y,setOpenThread:T}=u.useContext(t.ThreadsContext);u.useEffect(()=>{Y!=null&&c&&p(!1)},[c,Y,p]);const te=t.getHistoricMonthsList($,n.historicReportSentDates),re=u.useCallback((ie,ne)=>{const xe=$>ie?ne+1:ne;d(J.dateFromYearMonthDate(xe,ie-1));const ye=ie>0?ie-1:12;x(`${o.padStart(ye.toString(),2,"0")}${sn.backspace}${xe}`)},[$,d]);if(n.fetchState==="Not-Started"||n.fetchState==="In-Progress")return o.jsxRuntimeExports.jsxs(ts,{children:[o.jsxRuntimeExports.jsx(es,{children:o.jsxRuntimeExports.jsx(os,{onClick:a})}),o.jsxRuntimeExports.jsx(t.BusyIndication,{fetchState:n.fetchState,styles:{margin:t.Space.sp0}})]});if(n.fetchState==="Error")return o.jsxRuntimeExports.jsxs(ts,{children:[o.jsxRuntimeExports.jsx(es,{children:o.jsxRuntimeExports.jsx(os,{onClick:a})}),o.jsxRuntimeExports.jsx(t.ReloadContainer,{onReload:i,message:tj.failedText})]});if(j?.concatenatedHtml==null)return o.jsxRuntimeExports.jsxs(ts,{children:[o.jsxRuntimeExports.jsx(es,{children:o.jsxRuntimeExports.jsx(os,{onClick:a})}),o.jsxRuntimeExports.jsx(t.ReloadContainer,{onReload:i,message:ej.monthEndReport.insightsNotAvailable})]});const Z=`cockpit_${f}`;return o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:Z,children:o.jsxRuntimeExports.jsxs(W3,{children:[o.jsxRuntimeExports.jsx(ja,{companyName:n.companyName,onNavigateBack:a,monthCalendar:{monthAndYears:te,label:`${r.format(rn.visual.MMMformat)} ${v}`,selectedMonth:{month:A,year:v},onChange:re},threadMetadata:K,onAllThreadsClick:()=>{Y!=null&&T(null),p(!0)}}),o.jsxRuntimeExports.jsxs(K3,{ref:P,style:N>0?{height:N}:void 0,children:[o.jsxRuntimeExports.jsx(_3,{availableWidth:c?b:h}),o.jsxRuntimeExports.jsxs(G3,{children:[o.jsxRuntimeExports.jsx(oj,{historicData:j,newThreadMetadata:w,companyId:f,sortedThreads:q,containerRef:g}),o.jsxRuntimeExports.jsxs(X3,{children:[o.jsxRuntimeExports.jsx(Pi,{user:n.reportLastSentByUser}),o.jsxRuntimeExports.jsx(Z3,{}),o.jsxRuntimeExports.jsxs(q3,{children:[Q3.businessDay,sn.space,n.data?.reportSentDate!=null?J.getBusinessDayOfDate(n.data.reportSentDate):null,":",sn.space,n.data?.reportSentDate?.format(rn.visual.MMMDFormat)]})]})]}),y?o.jsxRuntimeExports.jsx(H3,{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:J3.comments,filter:K,textOverrides:{},preventResolvedThreadClick:!0,onThreadClick:(ie,ne)=>{T(ne);const xe=q.findIndex(ye=>ye[0]===ne);p(!1),G.current?.[xe]?.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},onCloseAllThreadsDrawer:()=>p(!1)})}):o.jsxRuntimeExports.jsx(t.FloatingThreads,{observer:L,canvasContainerRef:g,sortedThreads:q,threadsPositions:R,threadsRefs:G,unresolvedThreadsMap:W,editorMode:!1,style:{minWidth:`${t.COMMENTS_SECTION_MINIMUM_WIDTH}px`,position:"relative",height:"fit-content",width:"auto",top:`${g.current?.offsetTop}px`},handleRemoveFloatingThread:k})]})]})})},ii=e=>({[Jt]:{recipientEmailList:e.recipientEmailList??[],subject:e.subject??""}}),sj=e=>`${e}_form`,rj=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"})),ij=s.div`
|
|
4541
4541
|
justify-content: center;
|
|
4542
4542
|
align-items: center;
|
|
4543
4543
|
display: flex;
|
|
@@ -4663,14 +4663,14 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4663
4663
|
color: ${e=>e.theme.colors.grey3};
|
|
4664
4664
|
background-color: ${e=>e.theme.colors.grey5};
|
|
4665
4665
|
border-radius: 50%;
|
|
4666
|
-
`,ai=({color:e,disabled:n,text:r,showTickForDisabled:i,onClick:a})=>o.jsxRuntimeExports.jsxs(Tj,{onClick:()=>!n&&a!=null?a():!1,disabled:n,children:[o.jsxRuntimeExports.jsx(kj,{disabled:n,color:e,children:o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:r})}),n&&i?o.jsxRuntimeExports.jsx(Pj,{className:"tick-icon"}):null]}),
|
|
4666
|
+
`,ai=({color:e,disabled:n,text:r,showTickForDisabled:i,onClick:a})=>o.jsxRuntimeExports.jsxs(Tj,{onClick:()=>!n&&a!=null?a():!1,disabled:n,children:[o.jsxRuntimeExports.jsx(kj,{disabled:n,color:e,children:o.jsxRuntimeExports.jsx(t.ExtraSmallRegular,{children:r})}),n&&i?o.jsxRuntimeExports.jsx(Pj,{className:"tick-icon"}):null]}),Ij=s.div`
|
|
4667
4667
|
display: flex;
|
|
4668
4668
|
align-items: center;
|
|
4669
4669
|
column-gap: ${t.Space.sp4};
|
|
4670
|
-
`,
|
|
4670
|
+
`,Lj=s.div`
|
|
4671
4671
|
border-left: 1px solid ${e=>e.theme.colors.grey2};
|
|
4672
4672
|
height: ${t.Space.sp4};
|
|
4673
|
-
`,li=({income:e,expense:n,showTickForDisabled:r=!0,onTransactionTagClicked:i})=>o.jsxRuntimeExports.jsxs(
|
|
4673
|
+
`,li=({income:e,expense:n,showTickForDisabled:r=!0,onTransactionTagClicked:i})=>o.jsxRuntimeExports.jsxs(Ij,{children:[o.jsxRuntimeExports.jsx(ai,{text:t.appLocale.getLocalizedStrings().cockpit.review.transactionTag.expense,showTickForDisabled:r,disabled:!n,color:t.getTransactionTagColor("expense"),onClick:()=>i?.("expense")}),o.jsxRuntimeExports.jsx(Lj,{}),o.jsxRuntimeExports.jsx(ai,{text:t.appLocale.getLocalizedStrings().cockpit.review.transactionTag.income,disabled:!e,showTickForDisabled:r,color:t.getTransactionTagColor("income"),onClick:()=>i?.("income")})]}),Aj=({companyId:e,warningsCount:n,onClick:r})=>{const i=()=>{r(e)};return o.jsxRuntimeExports.jsx(Dj,{onClick:i,children:n===0?o.jsxRuntimeExports.jsx(Nj,{}):o.jsxRuntimeExports.jsxs(zj,{children:[o.jsxRuntimeExports.jsx(Mj,{})," ",o.jsxRuntimeExports.jsx(Oj,{children:n})]})})},Dj=s.div`
|
|
4674
4674
|
display: flex;
|
|
4675
4675
|
align-items: center;
|
|
4676
4676
|
cursor: pointer;
|
|
@@ -4688,7 +4688,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4688
4688
|
`,zj=s.div`
|
|
4689
4689
|
display: flex;
|
|
4690
4690
|
align-items: center;
|
|
4691
|
-
`,{dateFormat:ci}=t.appLocale.getLocalizedStrings(),Fj=({companyView:e,companyNameSticky:n,isReviewVendorColumnVisible:r,totalHeight:i,analytics:a,addThreadRequestThreadId:d,setNoteData:l,setElementRef:c,setAddThreadRequestThreadId:p,onTransactionTagClicked:m,onClickAuditScore:x,onClickWarningsCount:g,onCompanyNameClicked:h,onUncategorizedAccountsErrorClick:C,onReviewVendorTagClicked:b})=>{const S=t.useWindowSizeContext(),{name:y,companyId:j}=e,f=`cockpit_${j}`,E="audit.notes",{threads:$,isLoading:A}=t.useFilteredThreads({entityType:E,companyId:j},!1),{openThread:
|
|
4691
|
+
`,{dateFormat:ci}=t.appLocale.getLocalizedStrings(),Fj=({companyView:e,companyNameSticky:n,isReviewVendorColumnVisible:r,totalHeight:i,analytics:a,addThreadRequestThreadId:d,setNoteData:l,setElementRef:c,setAddThreadRequestThreadId:p,onTransactionTagClicked:m,onClickAuditScore:x,onClickWarningsCount:g,onCompanyNameClicked:h,onUncategorizedAccountsErrorClick:C,onReviewVendorTagClicked:b})=>{const S=t.useWindowSizeContext(),{name:y,companyId:j}=e,f=`cockpit_${j}`,E="audit.notes",{threads:$,isLoading:A}=t.useFilteredThreads({entityType:E,companyId:j},!1),{openThread:I,threads:v,addThread:w,removeThread:F,setOpenThread:D,setRequestToOpenThread:K}=u.useContext(t.ThreadsContext),M=I!==null?v.get(I):null,G=I?.includes(j)===!0,q=I!=null&&v.get(I)==null&&G,R=d!=null&&v.get(d)?.metadata.companyId===j,L=u.useCallback(()=>{I?.includes(t.NEW_THREAD_SUFFIX)===!0&&F(I),d!=null&&p(void 0)},[d,I,F,p]),W=T=>o.jsxRuntimeExports.jsx(t.StickyThread,{isElementThreadOpen:T.isElementThreadOpen??!1,isElementThreadPresent:T.isElementThreadPresent??!1,itemKey:T.itemKey,elementThreadId:T.elementThreadId??"",roomId:f,addThreadRequestThreadId:d,openThreadId:I,threadStyle:T.threadStyle,openThreadMetadata:M?.metadata??null,onElementClick:P,onAddThreadClick:N}),k=u.useCallback(T=>{if(T===I)D(null);else if(v.has(T))D(T);else if(T.includes(t.NEW_THREAD_SUFFIX)){const[te,re]=T.replace(t.NEW_THREAD_SUFFIX,"").split("."),Z=_t(Rt(te),J.toReviewColumnKeyType(re),j,y);w(T,{type:"thread",visibility:"public",id:T,roomId:f,createdAt:new Date,updatedAt:new Date,comments:[],metadata:Z,resolved:!1}),D(T)}},[j,y,I,v,w,D,f]),P=u.useCallback((T,te,re=!1)=>{const Z=bt.find(ie=>ie.key===te);if(K(null),Z!=null&&(T.type==="contextmenu"||re===!0)){if(Z.isThreadAllowed===!1)return;L(),T.preventDefault(),T.stopPropagation();const ie=t.toCollaborationEntityType({tab:"audit",key:Z.key}),ne=[...t.getFilteredThreads(v,{entityType:ie,companyId:j},"both")],xe=ne.length>0&&ne[0].length>0?ne[0][0]:Pe("audit",Z.key,j);v.has(xe)?k(xe):d===xe?p(void 0):(p(xe),D(null))}},[v,j,d,k,p,D,K,L]),N=u.useCallback((T,te)=>{T.stopPropagation();const re=Pe("audit",te,j);p(void 0),k(re)},[j,p,k]),Q=()=>{h(e)},ae=u.useCallback(()=>{C(e.primaryEmailDomain)},[C,e.primaryEmailDomain]),z=()=>{if(e.auditSummary.auditReportLastGeneratedDate==null){const T=J.dateNow().startOf("month").subtract(1,"date").format(ci.analytics.MMMYYYYFormat),te=e.controllers?.map(re=>`${re.user.firstName} ${re.user.middleName} ${re.user.lastName}`)??[];a.trackGetAuditScore(!0,e.name,T,te,J.dateNow().format(ci.analytics.MMSlashDDSlashYYYYFormat))}x(e.companyId)},Y=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(Uj,{windowSize:S,isThreadOpen:G||R,totalHeight:i,isCreationInProgress:q,children:bt.map((T,te)=>{const re=t.toCollaborationEntityType({tab:"audit",key:T.key}),Z=bt.length-2<=te,ie=[...t.getFilteredThreads(v,{entityType:re,companyId:j},"both")],ne=ie.length>0&&ie[0].length>0?ie[0][0]:Pe("audit",T.key,j),xe=v.get(ne),ye=xe!=null&&xe.resolved===!1,$e=ne===I,V=d===ne;switch(T.key){case"companyName":return o.jsxRuntimeExports.jsxs(Wj,{companyNameSticky:n,columnWidth:T.width,windowSize:S,isThreadOpen:$e||V,isThreadAllowed:T.isThreadAllowed,className:oe,onContextMenu:ee=>P(ee,T.key),ref:ee=>{c(j,T.key,ee)},children:[o.jsxRuntimeExports.jsxs(Vj,{children:[o.jsxRuntimeExports.jsx(_j,{onClick:ee=>{ee.preventDefault(),Q()},children:y}),o.jsxRuntimeExports.jsx(t.ThreadComponent,{isElementThreadOpen:$e,roomId:f,openThreadId:I,openThreadMetadata:M?.metadata??null})]}),o.jsxRuntimeExports.jsxs(Hj,{className:"notesIcon",onClick:ee=>{ee.preventDefault(),l({roomId:f,companyId:j,companyName:y,entityType:E})},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:$.length,isLoading:A}),o.jsxRuntimeExports.jsx(Kj,{})]}),o.jsxRuntimeExports.jsx(t.ThreadDotComponent,{isElementThreadPresent:ye,itemKey:T.key,style:{left:t.Space.sp4},onElementClick:P}),o.jsxRuntimeExports.jsx(t.AddThreadsComponent,{elementThreadId:Pe("audit",T.key,j),addThreadRequestThreadId:d,itemKey:T.key,onAddThreadClick:N})]},ne);case"auditScore":return o.jsxRuntimeExports.jsxs(Co,{ref:ee=>{c(j,T.key,ee)},columnWidth:T.width,windowSize:S,isThreadAllowed:T.isThreadAllowed,className:oe,onContextMenu:ee=>P(ee,T.key),children:[o.jsxRuntimeExports.jsx(bj,{auditSummary:e.auditSummary,onClickScore:z}),W({isElementThreadOpen:$e,isElementThreadPresent:ye,itemKey:T.key,elementThreadId:ne,threadStyle:Z?{right:t.Space.sp0}:void 0})]},ne);case"uncategorized":return o.jsxRuntimeExports.jsxs(Co,{ref:ee=>{c(j,T.key,ee)},columnWidth:T.width,windowSize:S,isThreadAllowed:T.isThreadAllowed,className:oe,onContextMenu:ee=>P(ee,T.key),children:[Y===!0?o.jsxRuntimeExports.jsx(li,{onTransactionTagClicked:ee=>m(e,ee,"uncategorized"),...e.uncategorizedTransactions}):o.jsxRuntimeExports.jsxs(Yj,{onClick:ae,children:[o.jsxRuntimeExports.jsx(t.SvgHighImportance,{className:"alert-icon",width:t.sp[3],height:t.sp[3]}),o.jsxRuntimeExports.jsx(Gj,{children:t.appLocale.getLocalizedStrings().cockpit.review.selectUncategorizedAccounts})]}),W({isElementThreadOpen:$e,isElementThreadPresent:ye,itemKey:T.key,elementThreadId:ne,threadStyle:Z?{right:t.Space.sp0}:void 0})]},ne);case"miscategorized":return o.jsxRuntimeExports.jsxs(Co,{ref:ee=>{c(j,T.key,ee)},columnWidth:T.width,windowSize:S,isThreadAllowed:T.isThreadAllowed,className:oe,onContextMenu:ee=>P(ee,T.key),children:[o.jsxRuntimeExports.jsx(li,{onTransactionTagClicked:ee=>m(e,ee,"miscategorized"),...e.miscategorizedTransactions}),W({isElementThreadOpen:$e,isElementThreadPresent:ye,itemKey:T.key,elementThreadId:ne,threadStyle:Z?{right:t.Space.sp0}:void 0})]},ne);case"reviewVendor":return r?o.jsxRuntimeExports.jsxs(Co,{ref:ee=>{c(j,T.key,ee)},columnWidth:T.width,windowSize:S,isThreadAllowed:T.isThreadAllowed,className:oe,onContextMenu:ee=>P(ee,T.key),children:[o.jsxRuntimeExports.jsx(Bj,{widthSize:T.width,windowSize:S,children:o.jsxRuntimeExports.jsx(wj,{onReviewVendorTagClicked:()=>b(e),isReviewComplete:!e.isVendorReviewReqiured})}),W({isElementThreadOpen:$e,isElementThreadPresent:ye,itemKey:T.key,elementThreadId:ne,threadStyle:Z?{right:t.Space.sp0}:void 0})]},ne):null;case"warnings":return o.jsxRuntimeExports.jsxs(Co,{ref:ee=>{c(j,T.key,ee)},columnWidth:T.width,windowSize:S,isThreadAllowed:T.isThreadAllowed,className:oe,onContextMenu:ee=>P(ee,T.key),children:[o.jsxRuntimeExports.jsx(Aj,{companyId:e.companyId,warningsCount:J.getAuditWarningsCount(e),onClick:g}),W({isElementThreadOpen:$e,isElementThreadPresent:ye,itemKey:T.key,elementThreadId:ne,threadStyle:Z?{right:t.Space.sp0}:void 0})]},ne);default:return null}})})})},Bj=s.div`
|
|
4692
4692
|
display: flex;
|
|
4693
4693
|
align-items: flex-start;
|
|
4694
4694
|
width: ${e=>e.widthSize.valuePx(e.windowSize)};
|
|
@@ -4814,7 +4814,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4814
4814
|
svg {
|
|
4815
4815
|
color: ${t.Colors.important};
|
|
4816
4816
|
}
|
|
4817
|
-
`,{common:{headers:{comments:Zj}},collaboration:{threads:{placeholder:{addANewComment:Xj,replyAComment:qj},tooltip:{resolveComment:Qj,unResolveComment:Jj}}}}=t.appLocale.getLocalizedStrings(),e4=({reviewView:e,allUsers:n,isReviewVendorColumnVisible:r,analytics:i,onColumnSortConfigChanged:a,onClickAuditScore:d,onClickWarningsCount:l,onTransactionTagClicked:c,onCompanyNameClicked:p,onRetryBankAccountConnection:m,onUncategorizedAccountsErrorClick:x,onReviewVendorTagClicked:g,initialOpenThreadRequest:h})=>{const C=t.useWindowSizeContext(),b=u.useRef(null),[S,y]=u.useState(null),[j,f]=u.useState(null),{uiState:E}=e,$=!(C==="small"||C==="medium-compact"),A=R=>e.companies[R].name.length>Wt?Ae+32:Ae;u.useEffect(()=>{b.current&&b.current.resetAfterIndex(0)},[e]);const{setOpenThread:
|
|
4817
|
+
`,{common:{headers:{comments:Zj}},collaboration:{threads:{placeholder:{addANewComment:Xj,replyAComment:qj},tooltip:{resolveComment:Qj,unResolveComment:Jj}}}}=t.appLocale.getLocalizedStrings(),e4=({reviewView:e,allUsers:n,isReviewVendorColumnVisible:r,analytics:i,onColumnSortConfigChanged:a,onClickAuditScore:d,onClickWarningsCount:l,onTransactionTagClicked:c,onCompanyNameClicked:p,onRetryBankAccountConnection:m,onUncategorizedAccountsErrorClick:x,onReviewVendorTagClicked:g,initialOpenThreadRequest:h})=>{const C=t.useWindowSizeContext(),b=u.useRef(null),[S,y]=u.useState(null),[j,f]=u.useState(null),{uiState:E}=e,$=!(C==="small"||C==="medium-compact"),A=R=>e.companies[R].name.length>Wt?Ae+32:Ae;u.useEffect(()=>{b.current&&b.current.resetAfterIndex(0)},[e]);const{setOpenThread:I,setRequestToOpenThread:v,requestToOpenThread:w,isLoading:F}=u.useContext(t.ThreadsContext);u.useEffect(()=>{h!=null&&e.fetchState==="Completed"&&F===!1&&v(h)},[h,e.fetchState,F,v]);const[D,K]=u.useState(void 0),M=u.useRef([]),G=u.useMemo(()=>({makeCompanyNameSticky:$,uiState:E,isReviewVendorColumnVisible:r,onColumnSortConfigChanged:a}),[$,E,r,a]),q=u.useCallback((R,L,W)=>{const k=e.companies.findIndex(N=>N.companyId===R),P=bt.findIndex(N=>N.key===L);k!==-1&&P!==-1&&(M.current[k]==null?M.current[k]=[W]:M.current[k][P]=W)},[e.companies]);return u.useEffect(()=>{if(w!=null&&S!=null){const{companyId:R,entityType:L}=w,[W,k]=L.split("."),P=e.companies.findIndex(z=>z.companyId===R),N=bt.findIndex(z=>z.key===k);P!==-1&&!(S.visibleStartIndex<=P&&S.visibleStopIndex>=P)&&b.current?.scrollToItem(P,"center"),setTimeout(()=>{const z=M.current[P]?.[0]?.getBoundingClientRect().bottom,Y=M.current[P]?.[0]?.getBoundingClientRect().top;z!=null&&Y!=null&&(window.innerHeight>=z&&window.innerHeight>=Y||Y<0)&&M.current[P][N]?.scrollIntoView({block:"center",behavior:"auto"})},0);const ae=setInterval(()=>{const z=M.current[P]?.[N]?.getBoundingClientRect().left,Y=M.current[P]?.[N]?.getBoundingClientRect().right,T=M.current[P]?.[N]?.offsetWidth;if(z!=null&&T!=null&&Y!=null&&(z<window.innerWidth-T||Y<window.innerWidth)){clearInterval(ae);const te=w.threadId,re=w.onThreadShownCallback;te&&(v(null),I(w.threadId),re?.())}},500);setTimeout(()=>{clearInterval(ae),v(null)},2e3)}},[w,S,I,v]),o.jsxRuntimeExports.jsx(t4,{children:o.jsxRuntimeExports.jsxs(ba.Provider,{value:G,children:[o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:R,width:L})=>o.jsxRuntimeExports.jsx(o.VariableSizeList,{height:R,innerElementType:Ra,itemCount:e.companies.length,itemSize:A,onItemsRendered:W=>y(W),itemData:{reviewView:e,isReviewVendorColumnVisible:r,analytics:i,makeCompanyNameSticky:$,allUsers:n,addThreadRequestThreadId:D,setElementRef:q,setAddThreadRequestThreadId:K,setNoteData:f,onTransactionTagClicked:c,onCompanyNameClicked:p,onRetryBankAccountConnection:m,onUncategorizedAccountsErrorClick:x,onReviewVendorTagClicked:g,onClickAuditScore:d,onClickWarningsCount:l},width:L,ref:b,overscanCount:Bt,children:$a})}),j!=null?o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:j.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${j.companyName} ${Zj}`,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:Xj,replyComposerPlaceholder:qj,threadResolve:Qj,threadUnResolve:Jj},onThreadClick:R=>null,onCloseAllThreadsDrawer:()=>f(null)})}):null]})})},ba=u.createContext(void 0),Ra=u.forwardRef((e,n)=>{const{children:r,style:i,...a}=e,{makeCompanyNameSticky:d,uiState:l,isReviewVendorColumnVisible:c,onColumnSortConfigChanged:p}=u.useContext(ba);return o.jsxRuntimeExports.jsxs(s4,{ref:n,style:{...i,width:"auto"},...a,children:[o.jsxRuntimeExports.jsx(dj,{companyNameSticky:d,onColumnSortConfigChanged:p,sortConfig:{sortKey:l.sortKey,sortOrder:l.sortOrder},isReviewVendorColumnVisible:c}),o.jsxRuntimeExports.jsx(n4,{children:r})]})});Ra.displayName="Review list view inner element type";const $a=({index:e,style:n,data:r})=>{const{reviewView:i,isReviewVendorColumnVisible:a,makeCompanyNameSticky:d,allUsers:l,analytics:c,addThreadRequestThreadId:p,setElementRef:m,setNoteData:x,onCompanyNameClicked:g,onTransactionTagClicked:h,setAddThreadRequestThreadId:C,onUncategorizedAccountsErrorClick:b,onReviewVendorTagClicked:S,onClickAuditScore:y,onClickWarningsCount:j}=r,f=i.companies[e],{companyId:E}=f;return o.jsxRuntimeExports.jsx(o4,{style:{...n,width:"fit-content",minWidth:"100%"},children:o.jsxRuntimeExports.jsx(Fj,{totalHeight:typeof n.height=="number"?n.height:Ae,addThreadRequestThreadId:p,setNoteData:x,setElementRef:m,setAddThreadRequestThreadId:C,analytics:c,companyView:i.companies[e],isReviewVendorColumnVisible:a,companyNameSticky:d,onCompanyNameClicked:g,onTransactionTagClicked:h,allUsers:l,onUncategorizedAccountsErrorClick:b,onReviewVendorTagClicked:S,onClickWarningsCount:j,onClickAuditScore:y})},E)};$a.displayName="ListItem";const t4=s.div`
|
|
4818
4818
|
/** Subtract top so list can occupy remaining available height */
|
|
4819
4819
|
height: calc(100vh - 150px);
|
|
4820
4820
|
max-width: 99.9%;
|
|
@@ -4891,7 +4891,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4891
4891
|
`,C4=s(t.StandardRegular)`
|
|
4892
4892
|
margin-bottom: ${t.Space.sp4};
|
|
4893
4893
|
color: ${e=>e.theme.colors.hero};
|
|
4894
|
-
`,j4=({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 x;m<=50?x=t.Colors.important:m<=75?x=t.Colors.alert:x=t.Colors.success;const g=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(d4,{isAuditScoreLoading:i,children:o.jsxRuntimeExports.jsx(u4,{auditPercentage:m,children:o.jsxRuntimeExports.jsxs(p4,{children:[!i&&o.jsxRuntimeExports.jsx(m4,{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:x,textColor:a.colors.primary,trailColor:a.colors.grey3,textSize:t.Space.sp4})})}),o.jsxRuntimeExports.jsx(x4,{children:o.jsxRuntimeExports.jsxs(h4,{children:[o.jsxRuntimeExports.jsxs(g4,{children:[o.jsxRuntimeExports.jsx(S4,{children:i?c.monthEndReport.auditScoreSectionLoadingTitle.replace("__date__",J.dateNow().subtract(1,"month").format(l.visual.MMMMYYYYFormat)):c.monthEndReport.auditScoreSectionTitle}),i?null:o.jsxRuntimeExports.jsx(y4,{children:g()})]}),o.jsxRuntimeExports.jsx(f4,{children:o.jsxRuntimeExports.jsx(C4,{children:i?c.review.auditReportDrawer.subTitle:c.review.auditReportDrawer.reportGeneratedSubtitle})})]})})]})})})},b4=({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})},R4=({rule:e,commentsText:n,ruleGroup:r,isControllerOrReviewer:i,triggerComponent:a,setCommentsText:d,handleReasonAuditRule:l})=>{const[c,p]=u.useState(!1),[m,x]=u.useState(n),g=u.useRef(null),{cockpit:h,common:C}=t.appLocale.getLocalizedStrings(),b=o.useTheme();u.useEffect(()=>{n!==""&&p(!0)},[n]);const S=()=>{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(
|
|
4894
|
+
`,j4=({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 x;m<=50?x=t.Colors.important:m<=75?x=t.Colors.alert:x=t.Colors.success;const g=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(d4,{isAuditScoreLoading:i,children:o.jsxRuntimeExports.jsx(u4,{auditPercentage:m,children:o.jsxRuntimeExports.jsxs(p4,{children:[!i&&o.jsxRuntimeExports.jsx(m4,{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:x,textColor:a.colors.primary,trailColor:a.colors.grey3,textSize:t.Space.sp4})})}),o.jsxRuntimeExports.jsx(x4,{children:o.jsxRuntimeExports.jsxs(h4,{children:[o.jsxRuntimeExports.jsxs(g4,{children:[o.jsxRuntimeExports.jsx(S4,{children:i?c.monthEndReport.auditScoreSectionLoadingTitle.replace("__date__",J.dateNow().subtract(1,"month").format(l.visual.MMMMYYYYFormat)):c.monthEndReport.auditScoreSectionTitle}),i?null:o.jsxRuntimeExports.jsx(y4,{children:g()})]}),o.jsxRuntimeExports.jsx(f4,{children:o.jsxRuntimeExports.jsx(C4,{children:i?c.review.auditReportDrawer.subTitle:c.review.auditReportDrawer.reportGeneratedSubtitle})})]})})]})})})},b4=({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})},R4=({rule:e,commentsText:n,ruleGroup:r,isControllerOrReviewer:i,triggerComponent:a,setCommentsText:d,handleReasonAuditRule:l})=>{const[c,p]=u.useState(!1),[m,x]=u.useState(n),g=u.useRef(null),{cockpit:h,common:C}=t.appLocale.getLocalizedStrings(),b=o.useTheme();u.useEffect(()=>{n!==""&&p(!0)},[n]);const S=()=>{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(L4,{ref:g,children:[a!=null?o.jsxRuntimeExports.jsxs(I4,{className:"placeholder",onClick:()=>{p(!c)},children:[a," "]}):null,c?o.jsxRuntimeExports.jsxs(b4,{open:c,anchorElement:g.current,onClose:()=>p(!1),children:[o.jsxRuntimeExports.jsx(v4,{children:o.jsxRuntimeExports.jsx($4,{children:h.review.auditReportDrawer.commentTitle})}),o.jsxRuntimeExports.jsx(A4,{autoFocus:!0,onFocus:y=>{if(y.target instanceof HTMLTextAreaElement){const j=y.target.value;y.target.value="",y.target.value=j}},placeholder:h.commentPlaceholder,value:m,onChange:y=>{y.target instanceof HTMLTextAreaElement&&x(y.target.value)}}),o.jsxRuntimeExports.jsx(k4,{}),o.jsxRuntimeExports.jsx(T4,{}),o.jsxRuntimeExports.jsxs(E4,{children:[o.jsxRuntimeExports.jsx(P4,{}),o.jsxRuntimeExports.jsxs(w4,{children:[o.jsxRuntimeExports.jsx(D4,{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.cancel,onClick:()=>{n!==""&&l(e.auditRuleId,r.auditRuleGroupId,n,"pending"),d(""),p(!1)}}),o.jsxRuntimeExports.jsx(O4,{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:S,label:i?C.footer.resolve:C.send,loading:e.reasonUpdateFetchState.fetchState==="In-Progress"})]})]})]}):null]})})},$4=s(t.LargeRegular)`
|
|
4895
4895
|
color: ${e=>e.theme.colors.primary};
|
|
4896
4896
|
margin-bottom: ${t.Space.sp3};
|
|
4897
4897
|
`,E4=s.div`
|
|
@@ -4916,7 +4916,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4916
4916
|
`,P4=s.div`
|
|
4917
4917
|
height: ${t.Space.sp2};
|
|
4918
4918
|
width: 100%;
|
|
4919
|
-
`,
|
|
4919
|
+
`,I4=s.div`
|
|
4920
4920
|
height: ${t.Space.sp4};
|
|
4921
4921
|
position: relative;
|
|
4922
4922
|
color: ${e=>e.theme.colors.grey1};
|
|
@@ -4924,7 +4924,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
4924
4924
|
&:hover {
|
|
4925
4925
|
cursor: pointer;
|
|
4926
4926
|
}
|
|
4927
|
-
`,
|
|
4927
|
+
`,L4=s.div`
|
|
4928
4928
|
position: relative;
|
|
4929
4929
|
`,A4=s(t.LargeRegularTA)`
|
|
4930
4930
|
width: 432px;
|
|
@@ -5113,7 +5113,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5113
5113
|
width: ${t.Space.sp4};
|
|
5114
5114
|
height: ${t.Space.sp4};
|
|
5115
5115
|
color: ${e=>e.theme.colors.grey2};
|
|
5116
|
-
`,gs={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:jo},dateFormat:ss,timeFormat:jb,common:bb}=t.appLocale.getLocalizedStrings(),Rb=({isAuditScoreCompleted:e,auditRuleGroups:n,loggedInUser:r,isMonthEnd:i,auditReportGroupView:a,allUsers:d,reviewCompanyView:l,style:c,analytics:p,handleFetchAuditReportGroupView:m,handleGenerateAuditReport:x,handleCancelIconClick:g,handleRuleClick:h,handleReasonAuditRule:C})=>{const b=t.useWindowSizeContext(),[S,y]=u.useState(rs(n,1)),[j,f]=u.useState({id:n[0]?.auditRuleGroupId,index:0}),[E,$]=u.useState(!1),[A,
|
|
5116
|
+
`,gs={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:jo},dateFormat:ss,timeFormat:jb,common:bb}=t.appLocale.getLocalizedStrings(),Rb=({isAuditScoreCompleted:e,auditRuleGroups:n,loggedInUser:r,isMonthEnd:i,auditReportGroupView:a,allUsers:d,reviewCompanyView:l,style:c,analytics:p,handleFetchAuditReportGroupView:m,handleGenerateAuditReport:x,handleCancelIconClick:g,handleRuleClick:h,handleReasonAuditRule:C})=>{const b=t.useWindowSizeContext(),[S,y]=u.useState(rs(n,1)),[j,f]=u.useState({id:n[0]?.auditRuleGroupId,index:0}),[E,$]=u.useState(!1),[A,I]=u.useState(1),[v,w]=u.useState(!1),[F,D]=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(N=>{N.auditReportGroupId===j.id&&(N.fetchState==="Completed"||N.fetchState==="Error")&&f({id:n[j.index+1]?.auditRuleGroupId,index:j.index+1})});const P=k.auditReport?.auditRulesGroupReport.find(N=>N.auditRuleGroupId===k.auditReportGroupId);(k.fetchState==="Completed"&&j.id===k.auditReportGroupId&&S[k.auditReportGroupId].isActive===!0&&P?.sequence===A||k.fetchState==="Error"&&j.id===k.auditReportGroupId)&&(I(A+1),y(rs(n,A+1)))})},[a.auditReportGroups,A,n,S]),u.useEffect(()=>{if(a.auditReportGroups.filter(Q=>Q.fetchState==="In-Progress").length===0&&$(!0),a.auditReportGroups.filter(Q=>Q.fetchState==="Completed"||Q.fetchState==="Error").length===n.length){w(!0);let Q=0;a.auditReportGroups.forEach(te=>{Q=Q+Ea(te.auditReport?.auditRulesGroupReport[0]?.auditRules)});const ae=$b(a),z=J.dateNow().startOf("month").subtract(1,"date").format(ss.analytics.MMMYYYYFormat),Y=l?.customerGroup,T=Math.ceil(a.auditReportGroups[0].auditReport?.auditSummary.auditScorePercentage??0);p.trackAuditScorePercentage(J.dateNow().format(ss.analytics.MMSlashDDSlashYYYYFormat),z,T,l?.name??"",ae,Q,K,Y??null)}const N=a.auditReportGroups.find(Q=>Q.fetchState==="Completed");N?.auditReport?.status?.lastRefreshSuccessTime!=null&&D(N)},[a.auditReportGroups,n.length,p,l,a,K]);const G=()=>{y(rs(n,1)),f({id:n[0]?.auditRuleGroupId,index:0}),$(!1),I(1),w(!1),D(null)},q=()=>{G();const k=n.map(P=>P.auditRuleGroupId);x(k)},R=()=>{g()},L=k=>{m(k)},W=(k,P,N)=>{p.trackAuditIssuesClicked(N,l?.name??"",K,J.dateNow().format(ss.analytics.MMSlashDDSlashYYYYFormat)),h(k,P)};return o.jsxRuntimeExports.jsxs(Eb,{style:c,children:[o.jsxRuntimeExports.jsx(Tb,{windowSize:b,style:c,children:o.jsxRuntimeExports.jsx(Pb,{children:o.jsxRuntimeExports.jsxs(Ib,{windowSize:b,children:[o.jsxRuntimeExports.jsx(vb,{}),o.jsxRuntimeExports.jsxs(Lb,{children:[o.jsxRuntimeExports.jsx(Ab,{children:l?.name}),o.jsxRuntimeExports.jsx(Db,{children:v?F?.auditReport?.status?.lastRefreshSuccessTime?.utc(!0).local().format(jb.hmmADashDDMMMCommaYYYY):bb.strings.empty})]}),o.jsxRuntimeExports.jsxs(Nb,{children:[o.jsxRuntimeExports.jsxs(Ob,{isGenerateClickEnabled:E,onClick:q,children:[o.jsxRuntimeExports.jsx(zb,{}),o.jsxRuntimeExports.jsx(Mb,{children:jo.auditReportDrawer.updateScore})]}),o.jsxRuntimeExports.jsx(Fb,{onClick:R,children:o.jsxRuntimeExports.jsx(Bb,{})})]})]})})}),o.jsxRuntimeExports.jsxs(wb,{children:[o.jsxRuntimeExports.jsx(kb,{children:o.jsxRuntimeExports.jsx(j4,{auditSummaryData:l!=null?l.auditSummary:M,isAuditScoreLoadingCompleted:v&&e,isMonthEnd:i})}),o.jsxRuntimeExports.jsxs(ui,{children:[o.jsxRuntimeExports.jsx(mi,{children:jo.auditReportDrawer.Business}),o.jsxRuntimeExports.jsx(xi,{children:n.filter(k=>k.ruleType===jo.auditReportDrawer.Business.toLowerCase()).map(k=>{const P=a.auditReportGroups.find(N=>N.auditReportGroupId===k.auditRuleGroupId);return P!=null&&Object.keys(S).length>0?o.jsxRuntimeExports.jsx(di,{loggedInUser:r,isControllerOrReviewer:a.isControllerOrReviewer,allUsers:d,isMonthEnd:i,ruleGroup:k,groupIdWithActiveStatus:S,auditReportGroup:P,setGroupIdWithActiveStatus:y,onClickRetryGroupFetch:L,onClickRule:W,handleReasonAuditRule:C},k.auditRuleGroupId):null})})]}),o.jsxRuntimeExports.jsxs(ui,{children:[o.jsxRuntimeExports.jsx(mi,{children:jo.auditReportDrawer.Accounting}),o.jsxRuntimeExports.jsx(xi,{children:n.filter(k=>k.ruleType===jo.auditReportDrawer.Accounting.toLowerCase()).map(k=>{const P=a.auditReportGroups.find(N=>N.auditReportGroupId===k.auditRuleGroupId);return P!=null&&Object.keys(S).length>0?o.jsxRuntimeExports.jsx(di,{loggedInUser:r,isControllerOrReviewer:a.isControllerOrReviewer,allUsers:d,isMonthEnd:i,ruleGroup:k,groupIdWithActiveStatus:S,auditReportGroup:P,setGroupIdWithActiveStatus:y,onClickRetryGroupFetch:L,onClickRule:W,handleReasonAuditRule:C},k.auditRuleGroupId):null})})]})]})]})},rs=(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,x=c===i[l].last;r[d]={isActive:p,isGroupExpanded:!1,isFirst:m,isLast:x}}),r},$b=e=>e.auditReportGroups.filter(r=>r.auditReport?.auditRulesGroupReport[0].isSuccess===!1).map(r=>r.auditReportGroupId),Eb=s.div`
|
|
5117
5117
|
display: flex;
|
|
5118
5118
|
flex-direction: column;
|
|
5119
5119
|
align-items: center;
|
|
@@ -5151,7 +5151,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5151
5151
|
`,Pb=s.div`
|
|
5152
5152
|
position: relative;
|
|
5153
5153
|
min-height: 62px;
|
|
5154
|
-
`,
|
|
5154
|
+
`,Ib=s.div`
|
|
5155
5155
|
display: flex;
|
|
5156
5156
|
flex-direction: row;
|
|
5157
5157
|
align-items: center;
|
|
@@ -5163,7 +5163,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5163
5163
|
padding-right: ${e=>gs.navBarPaddingRight.valuePx(e.windowSize)};
|
|
5164
5164
|
padding-left: ${e=>gs.navBarPaddingLeft.valuePx(e.windowSize)};
|
|
5165
5165
|
height: 100%;
|
|
5166
|
-
`,
|
|
5166
|
+
`,Lb=s(t.StyledText)`
|
|
5167
5167
|
display: flex;
|
|
5168
5168
|
flex: 1 1 0;
|
|
5169
5169
|
justify-content: center;
|
|
@@ -5393,7 +5393,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5393
5393
|
&:hover {
|
|
5394
5394
|
background: ${({theme:e})=>e.colors.grey4};
|
|
5395
5395
|
}
|
|
5396
|
-
`,vR=t.appLocale.getLocalizedStrings().common;function wR({style:e,row:n,isLastRow:r,cardProfilesActions:i,editingNs:a,editingValue:d,onEditStart:l,onEditChange:c,onEditCancel:p,onNoteOpen:m}){const x=t.appLocale.getLocalizedStrings().cockpit.creditAgent,g=t.appLocale.getLocalizedStrings().dateFormat.visual.MMMDCommaYYYYformat;return o.jsxRuntimeExports.jsxs(AR,{style:e,children:[o.jsxRuntimeExports.jsx(DR,{$hideBorder:r,children:o.jsxRuntimeExports.jsxs(UR,{children:[n.customerName??n.tenantId??n.tenantEmailDomain,n.isNew&&o.jsxRuntimeExports.jsx(HR,{children:x.newBadge})]})}),o.jsxRuntimeExports.jsx(OR,{$hideBorder:r,children:n.companyId!=null&&n.companyId!==""?o.jsxRuntimeExports.jsx(PR,{companyId:n.companyId,onOpen:()=>{const h=n.companyId;m({companyId:h,companyName:n.customerName??n.tenantId??n.tenantEmailDomain,roomId:`cockpit_${h}`})}}):o.jsxRuntimeExports.jsx(
|
|
5396
|
+
`,vR=t.appLocale.getLocalizedStrings().common;function wR({style:e,row:n,isLastRow:r,cardProfilesActions:i,editingNs:a,editingValue:d,onEditStart:l,onEditChange:c,onEditCancel:p,onNoteOpen:m}){const x=t.appLocale.getLocalizedStrings().cockpit.creditAgent,g=t.appLocale.getLocalizedStrings().dateFormat.visual.MMMDCommaYYYYformat;return o.jsxRuntimeExports.jsxs(AR,{style:e,children:[o.jsxRuntimeExports.jsx(DR,{$hideBorder:r,children:o.jsxRuntimeExports.jsxs(UR,{children:[n.customerName??n.tenantId??n.tenantEmailDomain,n.isNew&&o.jsxRuntimeExports.jsx(HR,{children:x.newBadge})]})}),o.jsxRuntimeExports.jsx(OR,{$hideBorder:r,children:n.companyId!=null&&n.companyId!==""?o.jsxRuntimeExports.jsx(PR,{companyId:n.companyId,onOpen:()=>{const h=n.companyId;m({companyId:h,companyName:n.customerName??n.tenantId??n.tenantEmailDomain,roomId:`cockpit_${h}`})}}):o.jsxRuntimeExports.jsx(Lt,{children:x.dash})}),o.jsxRuntimeExports.jsx(NR,{$hideBorder:r,children:o.jsxRuntimeExports.jsx(KR,{status:n.cardStatus,children:n.cardStatus})}),o.jsxRuntimeExports.jsx(MR,{$hideBorder:r,children:a===n.tenantEmailDomain?o.jsxRuntimeExports.jsxs(GR,{children:[o.jsxRuntimeExports.jsx(YR,{type:"number",min:"0",step:"any",autoFocus:!0,value:d,onChange:h=>c(h.target.value),onKeyDown:h=>{if(h.key==="Enter"){const C=parseFloat(d);!isNaN(C)&&C>=0&&(i.onUpdateProfile(n.tenantEmailDomain,n.tenantId,{creditLimit:C}),p())}else h.key==="Escape"&&p()}}),o.jsxRuntimeExports.jsx(ZR,{onClick:()=>{const h=parseFloat(d);!isNaN(h)&&h>=0&&(i.onUpdateProfile(n.tenantEmailDomain,n.tenantId,{creditLimit:h}),p())},children:o.jsxRuntimeExports.jsx(t.SvgTick,{width:t.Space.sp3,height:t.Space.sp3})}),o.jsxRuntimeExports.jsx(XR,{onClick:p,children:o.jsxRuntimeExports.jsx(t.SvgClose,{width:t.Space.sp3,height:t.Space.sp3})})]}):n.creditLimit!=null?o.jsxRuntimeExports.jsxs(hi,{onClick:()=>{l(n.tenantEmailDomain,String(n.creditLimit??""))},children:["$",t.appLocale.numberFormatter().format(n.creditLimit??0)]}):o.jsxRuntimeExports.jsx(hi,{onClick:()=>{l(n.tenantEmailDomain,"")},children:x.addLimit})}),o.jsxRuntimeExports.jsx(zR,{$hideBorder:r,children:n.isAnalyzing?o.jsxRuntimeExports.jsx(Lt,{children:x.inProgress}):o.jsxRuntimeExports.jsx(pR,{score:n.creditScore})}),o.jsxRuntimeExports.jsx(FR,{$hideBorder:r,children:n.isAnalyzing?o.jsxRuntimeExports.jsx(Lt,{children:x.inProgress}):n.recommendedAmount!=null?o.jsxRuntimeExports.jsx(qR,{children:t.currencyAmountCompactFormatter(n.recommendedAmount)}):o.jsxRuntimeExports.jsx(Lt,{children:x.pending})}),o.jsxRuntimeExports.jsx(BR,{$hideBorder:r,children:n.isAnalyzing?o.jsxRuntimeExports.jsx(Lt,{children:x.inProgress}):n.rationale!=null?o.jsxRuntimeExports.jsx(TR,{text:n.rationale}):o.jsxRuntimeExports.jsx(Lt,{children:x.dash})}),o.jsxRuntimeExports.jsx(WR,{$hideBorder:r,children:n.isAnalyzing?o.jsxRuntimeExports.jsx(Lt,{children:x.inProgress}):n.reportDate!=null?n.reportDate.format(g):"—"}),o.jsxRuntimeExports.jsx(_R,{$hideBorder:r,children:o.jsxRuntimeExports.jsxs(t$,{children:[o.jsxRuntimeExports.jsx(t.EntityAvatar,{name:n.updatedByName??x.creditAgentFallback}),o.jsxRuntimeExports.jsxs(o$,{children:[o.jsxRuntimeExports.jsx(n$,{children:n.updatedByName??x.creditAgentFallback}),n.updatedOn!=null&&o.jsxRuntimeExports.jsx(s$,{children:n.updatedOn.format(g)})]})]})}),o.jsxRuntimeExports.jsx(VR,{$hideBorder:r,children:o.jsxRuntimeExports.jsx(kR,{row:n,cardProfilesActions:i})})]})}function kR({row:e,cardProfilesActions:n}){const[r,i]=u.useState(null),[a,d]=u.useState(!1),l=u.useRef(null),c=t.appLocale.getLocalizedStrings().cockpit.creditAgent;u.useEffect(()=>()=>{l.current!=null&&clearTimeout(l.current)},[]);const p=n.onAnalyse?o.jsxRuntimeExports.jsx(Eo,{title:e.tenantId?c.analyseTitle:c.tenantIdNotAvailable,disabled:!e.tenantId,onClick:()=>e.tenantId!=null&&n.onAnalyse?.(e.tenantId),children:o.jsxRuntimeExports.jsx(t.SvgPlayButtonSmall,{width:t.Space.sp3,height:t.Space.sp3})}):null,m=S=>{const y=S??"";if(r==="pre-approve")n.onUpdateProfile(e.tenantEmailDomain,e.tenantId,{cardStatus:"Pre-approved",reason:y});else if(r==="approve")n.onUpdateProfile(e.tenantEmailDomain,e.tenantId,{cardStatus:"Approved",reason:y});else if(r==="reject")n.onUpdateProfile(e.tenantEmailDomain,e.tenantId,{cardStatus:"Rejected",reason:y});else if(r==="lock")n.onUpdateProfile(e.tenantEmailDomain,e.tenantId,{cardStatus:"Locked",reason:y});else if(r==="unlock")n.onUpdateProfile(e.tenantEmailDomain,e.tenantId,{cardStatus:"Active",reason:y});else if(r==="reset"){const j=e.cardStatus==="Pre-approved"?"Not-Initiated":"Interested";n.onUpdateProfile(e.tenantEmailDomain,e.tenantId,{cardStatus:j,reason:y})}i(null)},x=u.useCallback(S=>{S==="approve"?i("approve"):S==="reject"?i("reject"):S==="reset"?i("reset"):S==="lock"?i("lock"):S==="unlock"&&i("unlock")},[]),g=e.customerName??e.tenantEmailDomain,h=e.creditLimit!=null?t.currencyAmountCompactFormatter(e.creditLimit):"",C=r?IR(r,g,h,c):null,b={onOkClick:S=>m(S),onCancelClick:()=>{i(null)},onClickAway:()=>{i(null)}};return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[r&&C&&o.jsxRuntimeExports.jsx(t.ConfirmationPopup,{titleComponent:o.jsxRuntimeExports.jsx(c$,{children:C.title}),descriptionComponent:o.jsxRuntimeExports.jsx(d$,{children:C.body}),primaryButtonText:C.confirmLabel,proceedButtonVariant:C.confirmVariant,secondaryButtonText:vR.cancel,isNotesIncluded:!0,notesPlaceholder:c.addReasonOptional,action:b,containerStyle:{maxWidth:520}}),o.jsxRuntimeExports.jsxs(i$,{children:[p,e.cardStatus==="Interested"&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Eo,{className:"reject",title:c.rejectTitle,onClick:()=>i("reject"),children:o.jsxRuntimeExports.jsx(t.SvgClose,{width:t.Space.sp3,height:t.Space.sp3})}),o.jsxRuntimeExports.jsxs(a$,{children:[o.jsxRuntimeExports.jsx(Eo,{className:"approve",title:e.creditLimit==null?c.setLimitBeforeApproving:c.preApprove,onClick:()=>{if(e.creditLimit==null){d(!0),l.current!=null&&clearTimeout(l.current),l.current=setTimeout(()=>d(!1),3e3);return}i("pre-approve")},children:o.jsxRuntimeExports.jsx(t.SvgTick,{width:t.Space.sp3,height:t.Space.sp3})}),a&&o.jsxRuntimeExports.jsx(l$,{children:c.setCreditLimitFirst})]})]}),e.cardStatus==="Not-Initiated"&&o.jsxRuntimeExports.jsx(Eo,{className:"approve",title:c.moveToInterested,onClick:()=>n.onUpdateProfile(e.tenantEmailDomain,e.tenantId,{cardStatus:"Interested"}),children:o.jsxRuntimeExports.jsx(t.SvgTick,{width:t.Space.sp3,height:t.Space.sp3})}),["Pre-approved","Approved","Active","Locked"].includes(e.cardStatus)&&o.jsxRuntimeExports.jsx(jR,{row:e,onAction:x})]})]})}function TR({text:e}){const n=u.useRef(null),[r,i]=u.useState(null),a=()=>{if(!n.current)return;const d=n.current.getBoundingClientRect(),c=d.top>160+16;i({...c?{bottom:window.innerHeight-d.top+8}:{top:d.bottom+8},left:d.left,above:c})};return o.jsxRuntimeExports.jsxs(QR,{ref:n,onMouseEnter:a,onMouseLeave:()=>i(null),children:[o.jsxRuntimeExports.jsx(JR,{children:e}),r&&Po.createPortal(o.jsxRuntimeExports.jsx(e$,{style:{position:"fixed",left:r.left,...r.above?{bottom:r.bottom}:{top:r.top}},above:r.above,children:e}),document.body)]})}function PR({companyId:e,onOpen:n}){const{threads:r,isLoading:i}=t.useFilteredThreads({entityType:t.toCollaborationEntityType({tab:"creditAgent",key:"details"}),companyId:e},!1);return o.jsxRuntimeExports.jsxs(r$,{onClick:a=>{a.stopPropagation(),n()},children:[o.jsxRuntimeExports.jsx(t.CommentsAndNotesCount,{count:r.length,isLoading:i}),o.jsxRuntimeExports.jsx(t.SvgComment,{width:t.Space.sp3,height:t.Space.sp3})]})}function IR(e,n,r,i){return{"pre-approve":{title:i.modalPreApproveTitle,body:`${n} ${i.modalCardAccessBodySuffix} ${r}.`,confirmLabel:i.modalConfirmLabel,confirmVariant:"primary"},approve:{title:i.modalApproveTitle,body:`${n} ${i.modalCardAccessBodySuffix} ${r}.`,confirmLabel:i.modalConfirmLabel,confirmVariant:"primary"},reject:{title:i.modalRejectTitle,body:`${n} ${i.modalRejectBodySuffix}`,confirmLabel:i.modalConfirmLabel,confirmVariant:"destructive"},lock:{title:i.modalLockTitle,body:`${n}${i.modalLockBodySuffix}`,confirmLabel:i.modalLockLabel,confirmVariant:"destructive"},unlock:{title:i.modalUnlockTitle,body:`${n}${i.modalUnlockBodySuffix}`,confirmLabel:i.modalUnlockLabel,confirmVariant:"primary"},reset:{title:i.modalResetTitle,body:`${n}${i.modalResetBodySuffix}`,confirmLabel:i.modalResetLabel,confirmVariant:"destructive"}}[e]}function LR(e,n){switch(e){case"Interested":return{backgroundColor:n.tagWarningBg,color:n.tagWarningColor};case"Not-Initiated":return{backgroundColor:n.tagDefaultBg,color:n.tagDefaultColor};case"Pre-approved":return{backgroundColor:n.tagInfoBg,color:n.tagInfoColor};case"Approved":return{backgroundColor:n.tagSuccessBg,color:n.tagSuccessColor};case"Enabled":return{backgroundColor:n.tagInfoBg,color:n.tagInfoColor};case"Active":return{backgroundColor:n.tagSuccessBg,color:n.tagSuccessColor};case"Rejected":return{backgroundColor:n.tagAttentionBg,color:n.tagAttentionColor};case"Locked":return{backgroundColor:n.tagDefaultBg,color:n.tagDefaultColor};default:return{backgroundColor:n.tagDefaultBg,color:n.tagDefaultColor}}}const AR=s.div`
|
|
5397
5397
|
display: flex;
|
|
5398
5398
|
flex-direction: row;
|
|
5399
5399
|
align-items: stretch;
|
|
@@ -5454,7 +5454,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5454
5454
|
border-radius: ${t.Space.sp1};
|
|
5455
5455
|
text-transform: uppercase;
|
|
5456
5456
|
letter-spacing: 0.5px;
|
|
5457
|
-
`,
|
|
5457
|
+
`,Lt=s(t.SmallRegularSp)`
|
|
5458
5458
|
color: ${({theme:e})=>e.colors.grey1};
|
|
5459
5459
|
font-style: italic;
|
|
5460
5460
|
`,KR=s(t.ExtraSmallSemiBoldSp)`
|
|
@@ -5463,7 +5463,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5463
5463
|
border-radius: ${t.Space.sp2};
|
|
5464
5464
|
text-transform: capitalize;
|
|
5465
5465
|
white-space: nowrap;
|
|
5466
|
-
${e=>{const n=
|
|
5466
|
+
${e=>{const n=LR(e.status,e.theme.colors);return`background-color: ${n.backgroundColor}; color: ${n.color};`}}
|
|
5467
5467
|
`,hi=s(t.SmallRegularSp)`
|
|
5468
5468
|
color: ${({theme:e})=>e.colors.grey1};
|
|
5469
5469
|
cursor: pointer;
|
|
@@ -5589,7 +5589,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5589
5589
|
`,d$=s(t.StandardRegularSp)`
|
|
5590
5590
|
color: ${({theme:e})=>e.colors.grey1};
|
|
5591
5591
|
line-height: 1.5;
|
|
5592
|
-
`;function p$({cardProfilesData:e,cardProfilesActions:n,onUIStateChange:r,uiState:i}){const a=t.appLocale.getLocalizedStrings().cockpit.creditAgent,d=u.useMemo(()=>CR(a),[a]),[l,c]=u.useState(null),[p,m]=u.useState(""),[x,g]=u.useState(null),h=i.sortKey??null,C=i.sortDir,b=i.filterText,S=e.fetchState==="Not-Started"||e.fetchState==="In-Progress",y=$=>{r(h===$?{sortDir:C==="asc"?"desc":"asc"}:{sortKey:$,sortDir:"asc"})},j=e.rows,f=j.length,E=u.useMemo(()=>({cardProfilesActions:n,editingNs:l,editingValue:p,onEditCancel:()=>c(null),onEditChange:m,onEditStart:($,A)=>{c($),m(A)},onNoteOpen:g,rowCount:j.length,rows:j}),[n,l,p,j]);return o.jsxRuntimeExports.jsxs(m$,{children:[o.jsxRuntimeExports.jsxs($$,{children:[o.jsxRuntimeExports.jsxs(E$,{children:[o.jsxRuntimeExports.jsx(v$,{children:o.jsxRuntimeExports.jsx(t.SvgSearch,{width:t.Space.sp3,height:t.Space.sp3})}),o.jsxRuntimeExports.jsx(w$,{placeholder:a.searchPlaceholder,value:b,onChange:$=>r({filterText:$.target.value})}),!!b&&o.jsxRuntimeExports.jsx(k$,{onClick:()=>r({filterText:""}),children:o.jsxRuntimeExports.jsx(t.SvgClose,{width:t.Space.sp3,height:t.Space.sp3})})]}),!S&&o.jsxRuntimeExports.jsxs(T$,{children:[f," ",f!==1?a.tenantCountPlural:a.tenantCountSingular,b?` ${a.tenantCountFound}`:""]})]}),e.fetchState==="Error"?o.jsxRuntimeExports.jsx(R$,{children:a.failedToLoadCardProfiles}):o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(x$,{children:[o.jsxRuntimeExports.jsx(h$,{children:d.map($=>{const A=$.sortable&&h===$.key,
|
|
5592
|
+
`;function p$({cardProfilesData:e,cardProfilesActions:n,onUIStateChange:r,uiState:i}){const a=t.appLocale.getLocalizedStrings().cockpit.creditAgent,d=u.useMemo(()=>CR(a),[a]),[l,c]=u.useState(null),[p,m]=u.useState(""),[x,g]=u.useState(null),h=i.sortKey??null,C=i.sortDir,b=i.filterText,S=e.fetchState==="Not-Started"||e.fetchState==="In-Progress",y=$=>{r(h===$?{sortDir:C==="asc"?"desc":"asc"}:{sortKey:$,sortDir:"asc"})},j=e.rows,f=j.length,E=u.useMemo(()=>({cardProfilesActions:n,editingNs:l,editingValue:p,onEditCancel:()=>c(null),onEditChange:m,onEditStart:($,A)=>{c($),m(A)},onNoteOpen:g,rowCount:j.length,rows:j}),[n,l,p,j]);return o.jsxRuntimeExports.jsxs(m$,{children:[o.jsxRuntimeExports.jsxs($$,{children:[o.jsxRuntimeExports.jsxs(E$,{children:[o.jsxRuntimeExports.jsx(v$,{children:o.jsxRuntimeExports.jsx(t.SvgSearch,{width:t.Space.sp3,height:t.Space.sp3})}),o.jsxRuntimeExports.jsx(w$,{placeholder:a.searchPlaceholder,value:b,onChange:$=>r({filterText:$.target.value})}),!!b&&o.jsxRuntimeExports.jsx(k$,{onClick:()=>r({filterText:""}),children:o.jsxRuntimeExports.jsx(t.SvgClose,{width:t.Space.sp3,height:t.Space.sp3})})]}),!S&&o.jsxRuntimeExports.jsxs(T$,{children:[f," ",f!==1?a.tenantCountPlural:a.tenantCountSingular,b?` ${a.tenantCountFound}`:""]})]}),e.fetchState==="Error"?o.jsxRuntimeExports.jsx(R$,{children:a.failedToLoadCardProfiles}):o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(x$,{children:[o.jsxRuntimeExports.jsx(h$,{children:d.map($=>{const A=$.sortable&&h===$.key,I=C;return o.jsxRuntimeExports.jsx(g$,{$width:$.width,$justifyContent:$.justifyContent,$growToFill:$.growToFill,children:o.jsxRuntimeExports.jsx(S$,{children:$.sortable?o.jsxRuntimeExports.jsxs(y$,{type:"button",$active:A,onClick:()=>y($.key),children:[$.label,o.jsxRuntimeExports.jsx(f$,{$direction:A?I:"asc",children:o.jsxRuntimeExports.jsx(t.SvgArrowTailTop,{width:ko.sortIconSize,height:ko.sortIconSize})})]}):$.label})},$.key)})}),S?o.jsxRuntimeExports.jsx(j$,{children:o.jsxRuntimeExports.jsx(t.ListTableSkeleton,{colPcts:yR,rowCount:fR})}):j.length===0?o.jsxRuntimeExports.jsx(b$,{children:b||i.focus!=="All"||i.minScore>0?a.noTenantsMatchFilters:a.noCardProfilesYet}):o.jsxRuntimeExports.jsx(C$,{children:o.jsxRuntimeExports.jsx(o.AutoSizer,{children:({height:$,width:A})=>o.jsxRuntimeExports.jsx(o.FixedSizeList,{height:$,width:A,itemCount:j.length,itemSize:ko.rowHeightPx,itemData:E,innerElementType:u$,overscanCount:5,children:va})})})]}),x!=null&&o.jsxRuntimeExports.jsx(Xe.RoomProvider,{id:x.roomId,children:o.jsxRuntimeExports.jsx(t.AllThreadsDrawer,{isDrawerOpen:!0,allowComposer:!0,autoExpand:!0,autoFocus:!1,drawerTitle:`${x.companyName} ${a.noteDrawerTitleSuffix}`,filter:{application:"cockpit",companyId:x.companyId,entityType:t.toCollaborationEntityType({tab:"creditAgent",key:"details"}),isGlobalComment:!1,tab:"creditAgent"},isLoading:!1,threadMetadata:{companyName:x.companyName,companyId:x.companyId,entityId:x.companyId,entityType:t.toCollaborationEntityType({tab:"creditAgent",key:"details"}),isGlobalComment:!1,application:"cockpit",tab:"creditAgent",url:window.location.href},textOverrides:{composerPlaceholder:a.composerPlaceholder,replyComposerPlaceholder:a.replyComposerPlaceholder},onThreadClick:()=>null,onCloseAllThreadsDrawer:()=>g(null)})})]})]})}const va=u.memo(({index:e,style:n,data:r})=>{const i=r.rows[e],a=e===r.rowCount-1;return o.jsxRuntimeExports.jsx(wR,{style:n,row:i,isLastRow:a,cardProfilesActions:r.cardProfilesActions,editingNs:r.editingNs,editingValue:r.editingValue,onEditStart:r.onEditStart,onEditChange:r.onEditChange,onEditCancel:r.onEditCancel,onNoteOpen:r.onNoteOpen})});va.displayName="CreditAgentListItem";const u$=u.forwardRef(({style:e,...n},r)=>o.jsxRuntimeExports.jsx("div",{ref:r,style:{...e,position:"relative"},...n})),m$=s.div`
|
|
5593
5593
|
display: flex;
|
|
5594
5594
|
flex-direction: column;
|
|
5595
5595
|
flex: 1;
|
|
@@ -5721,7 +5721,7 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5721
5721
|
}
|
|
5722
5722
|
`,T$=s(t.SmallMediumSp)`
|
|
5723
5723
|
color: ${e=>e.theme.colors.hero};
|
|
5724
|
-
`,P$=t.appLocale.getLocalizedStrings().common,
|
|
5724
|
+
`,P$=t.appLocale.getLocalizedStrings().common,I$=["All","New only","Interested","Active only"],L$=e=>{const{creditAgent:n}=t.appLocale.getLocalizedStrings().cockpit;switch(e){case"All":return n.focusAll;case"New only":return n.focusNewOnly;case"Interested":return n.focusInterested;case"Active only":return n.focusActiveOnly}};function A$({headerActions:e,headerData:n,creditAgentPageData:r,creditAgentPageActions:i}){const a=t.appLocale.getLocalizedStrings().cockpit.creditAgent,d=t.useWindowSizeContext(),{macroData:l,cardProfilesData:c}=r,{onFetchMacro:p,onSaveMacro:m,onResetSaveMacro:x,onUIStateChange:g,cardProfilesActions:h}=i,{onDownloadReport:C}=h,[b,S]=u.useState(""),[y,j]=u.useState(!1),{focus:f,minScore:E}=c.uiState;u.useEffect(()=>{l.fetchState==="Not-Started"&&p()},[l.fetchState,p]),u.useEffect(()=>{l.data!=null&&!y&&S(l.data.instructions)},[l.data,y]),u.useEffect(()=>{l.updateState==="Completed"&&(j(!1),x())},[l.updateState,x]),u.useEffect(()=>{c.fetchState==="Not-Started"&&h.onFetch()},[c.fetchState,h]);const $=u.useCallback(()=>{m(b)},[m,b]),A=u.useCallback(()=>{j(!1),l.data!=null&&S(l.data.instructions),l.updateState==="Error"&&x()},[l.data,l.updateState,x]);return o.jsxRuntimeExports.jsxs(D$,{children:[o.jsxRuntimeExports.jsx(dt,{headerActions:e,headerData:{...n,allTabOptions:n.allTabOptions??it,selectedTabOption:"creditAgent"}}),o.jsxRuntimeExports.jsxs(O$,{windowSize:d,children:[o.jsxRuntimeExports.jsxs(N$,{children:[o.jsxRuntimeExports.jsx(M$,{}),o.jsxRuntimeExports.jsxs(z$,{children:[y&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(t.Button,{variant:"secondary",size:"small",label:P$.cancel,onClick:A}),o.jsxRuntimeExports.jsx(t.Button,{variant:"primary",size:"small",label:l.updateState==="In-Progress"?a.saving:a.savePrompt,disabled:l.updateState==="In-Progress",onClick:$})]}),o.jsxRuntimeExports.jsx(t.Button,{variant:"secondary",size:"small",label:a.downloadReport,onClick:C})]})]}),o.jsxRuntimeExports.jsxs(F$,{children:[o.jsxRuntimeExports.jsxs(B$,{children:[o.jsxRuntimeExports.jsxs(W$,{children:[o.jsxRuntimeExports.jsx(_$,{children:"✦"}),l.fetchState==="In-Progress"?o.jsxRuntimeExports.jsx(t.ActivityIndicator,{size:"Standard",start:!0}):o.jsxRuntimeExports.jsx(V$,{value:b,disabled:l.updateState==="In-Progress",onChange:I=>{S(I.target.value),j(!0)},placeholder:a.promptPlaceholder,rows:6})]}),o.jsxRuntimeExports.jsxs(U$,{children:[o.jsxRuntimeExports.jsxs(gi,{children:[o.jsxRuntimeExports.jsx(Si,{children:a.focusLabel}),o.jsxRuntimeExports.jsx(H$,{children:I$.map(I=>o.jsxRuntimeExports.jsx(K$,{active:f===I,onClick:()=>g({focus:I}),children:L$(I)},I))})]}),o.jsxRuntimeExports.jsx(G$,{}),o.jsxRuntimeExports.jsxs(gi,{children:[o.jsxRuntimeExports.jsx(Si,{children:a.minScoreLabel}),o.jsxRuntimeExports.jsx(Y$,{type:"range",min:0,max:100,value:E,onChange:I=>g({minScore:parseInt(I.target.value)})}),o.jsxRuntimeExports.jsx(Z$,{children:E})]})]})]}),l.updateState==="Error"&&o.jsxRuntimeExports.jsx(q$,{children:a.failedToSavePrompt})]}),o.jsxRuntimeExports.jsx(X$,{children:o.jsxRuntimeExports.jsx(p$,{cardProfilesData:c,cardProfilesActions:h,onUIStateChange:g,uiState:c.uiState})})]})]})}const D$=s.div`
|
|
5725
5725
|
height: calc(100vh - 45px);
|
|
5726
5726
|
overflow: hidden;
|
|
5727
5727
|
background-color: ${e=>e.theme.colors.grey4};
|
|
@@ -5844,4 +5844,4 @@ ${e}`,Md=e=>le.createElement("svg",{width:38,height:39,viewBox:"0 0 38 39",fill:
|
|
|
5844
5844
|
`,q$=s(t.SmallRegularP)`
|
|
5845
5845
|
color: ${e=>e.theme.colors.alert};
|
|
5846
5846
|
margin-top: ${t.Space.sp2};
|
|
5847
|
-
`;exports.AIAgentsActivatingPage=t.AIAgentsActivatingPage;exports.AIIconButton=t.AIIconButton;exports.AIPerformancePage=t.AIPerformancePage;exports.ALL_AI_CFO_MENU_OPTIONS=t.ALL_AI_CFO_MENU_OPTIONS;exports.ALL_INVOICING_MENU_GROUPS=t.ALL_INVOICING_MENU_GROUPS;exports.ALL_INVOICING_MENU_OPTIONS=t.ALL_INVOICING_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.AccountReconDetailsDrawerPageV2=t.AccountReconDetailsDrawerPage$1;exports.ActivityIndicator=t.ActivityIndicator;exports.AddAddressForCardDrawer=t.AddAddressForCardDrawer;exports.AddToWalletPage=t.AddToWalletPage;exports.AddressFormPage=t.AddressFormPage;exports.AgingReportsPage=t.AgingReportsPage;exports.AiCfoChatHeader=t.AiCfoChatHeader;exports.AiCfoMenuContent=t.AiCfoMenuContent;exports.AiCfoOnboardingPage=t.AiCfoOnboardingPage;exports.AiCfoPage=t.AiCfoPage;exports.AiCfoScopeModal=t.AiCfoScopeModal;exports.AiCfoScopeModalScrollBody=t.AiCfoScopeModalScrollBody;exports.AiCfoSidePanel=t.AiCfoSidePanel;exports.AiFinanceTeamReadyPage=t.AiFinanceTeamReadyPage;exports.AllowBlockChipPicker=t.AllowBlockChipPicker;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.AskAiCfoNavButtonWhenEnabled=t.AskAiCfoNavButtonWhenEnabled;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.BillPayApprovalRuleDetailPageV1=t.BillPayApprovalRuleDetailPage$1;exports.BillPayApprovalRulesPage=t.BillPayApprovalRulesPage;exports.BillPayApprovalRulesPageV1=t.BillPayApprovalRulesPage$1;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.CARD_POLICY_LIMIT_ROW_ID_REQUIRE_RECEIPT=t.CARD_POLICY_LIMIT_ROW_ID_REQUIRE_RECEIPT;exports.CARD_POLICY_LIMIT_ROW_ID_TRANSACTION=t.CARD_POLICY_LIMIT_ROW_ID_TRANSACTION;exports.COMMAND_CENTER_SUBMENU_TYPES=t.COMMAND_CENTER_SUBMENU_TYPES;exports.CapitalizationOnboardingPopup=t.CapitalizationOnboardingPopup;exports.CapitalizationSettingsSection=t.CapitalizationSettingsSection;exports.CardPolicyCreatePage=t.CardPolicyCreatePage;exports.CardPolicyEditPage=t.CardPolicyEditPage;exports.CardPolicyFormPageSkeleton=t.CardPolicyFormPageSkeleton;exports.CardPolicyFormSections=t.CardPolicyFormSections;exports.CardPolicyListPage=t.CardPolicyListPage;exports.CardPolicyListPageSkeleton=t.CardPolicyListPageSkeleton;exports.CardPolicyListRow=t.CardPolicyListRow;exports.CardPolicyListSkeletonRow=t.CardPolicyListSkeletonRow;exports.CardPolicyManualEmptyState=t.CardPolicyManualEmptyState;exports.CardsAiCfoHero=t.CardsAiCfoHero;exports.CardsShutdownBanner=t.CardsShutdownBanner;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.ChargeCardListSkeletonRow=t.ChargeCardListSkeletonRow;exports.ChargeCardPaymentHistoryPage=t.ChargeCardPaymentHistoryPage;exports.ChargeCardPromoPage=t.ChargeCardPromoPage;exports.ChargeCardPromoPageSkeleton=t.ChargeCardPromoPageSkeleton;exports.ChargeCardSetUpPage=t.ChargeCardSetUpPage;exports.ChargeCardSetupLoading=t.SpendManagementSetUpLoading;exports.ChargeCardStatementsLoading=t.ChargeCardStatementsLoading;exports.ChargeCardStatementsPage=t.ChargeCardStatementsPage;exports.ChargeCardUserOnboardingPromoPage=t.ChargeCardUserOnboardingPromoPage;exports.ChargeCardUserOnboardingPromoPageSkeleton=t.ChargeCardUserOnboardingPromoPageSkeleton;exports.CheckDepositDrawerPage=t.CheckDepositDrawerPage;exports.ClickableRow=t.ClickableRow;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.CompanyOfficerOnboardingDetailsSection=t.CompanyOfficerOnboardingDetailsSection;exports.CompanyOnboardingDetailsSection=t.CompanyOnboardingDetailsSection;exports.CompanyPassportCard=t.CompanyPassportCard;exports.CompanyPassportPage=t.CompanyPassportPage;exports.CompleteProfile=t.CompleteProfile;exports.ConfettiBurst=t.ConfettiBurst;exports.ConfirmationPopup=t.ConfirmationPopup;exports.ConnectDataSourcesPage=t.ConnectDataSourcesPage;exports.CreateOrEditVendorPage=t.CreateOrEditVendorPage;exports.CreateOrEditVendorPageSkeleton=t.CreateOrEditVendorPageSkeleton;exports.CreatedEntitiesAnswer=t.CreatedEntitiesAnswer;exports.CreatingEntitiesAnswerLoading=t.CreatingEntitiesAnswerLoading;exports.CreditCardPaymentDrawerPage=t.CreditCardPaymentDrawerPage;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.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.INVOICING_SETTINGS_NAV_SECTIONS=t.INVOICING_SETTINGS_NAV_SECTIONS;exports.INVOICING_SETTINGS_TABS=t.INVOICING_SETTINGS_TABS;exports.InformationCardStack=t.InformationCardStack;exports.InitialCollaborationProvider=t.InitialCollaborationProvider;exports.InsightsCardStack=t.InsightCardStack;exports.IntegrationCardView=t.IntegrationCardView;exports.IntegrationsCardGrid=t.IntegrationsCardGrid;exports.IntegrationsSection=t.IntegrationsSection;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.InvoicingAddPaymentMethodDialog=t.InvoicingAddPaymentMethodDialog;exports.InvoicingAuditLogPage=t.InvoicingAuditLogPage;exports.InvoicingBrandingSettingsPage=t.InvoicingBrandingSettingsPage;exports.InvoicingCatalogItemDetailPage=t.InvoicingCatalogItemDetailPage;exports.InvoicingCatalogItemFormPage=t.InvoicingCatalogItemFormPage;exports.InvoicingCatalogPage=t.InvoicingCatalogPage;exports.InvoicingCouponFormPage=t.InvoicingCouponFormPage;exports.InvoicingCreateInvoicePage=t.InvoicingCreateInvoicePage;exports.InvoicingCreateInvoiceSkeleton=t.InvoicingCreateInvoiceSkeleton;exports.InvoicingCreatePromotionalCreditsDialog=t.InvoicingCreatePromotionalCreditsDialog;exports.InvoicingCreditDetailPage=t.InvoicingCreditDetailPage;exports.InvoicingCreditListPage=t.InvoicingCreditListPage;exports.InvoicingCustomerDetailPage=t.InvoicingCustomerDetailPage;exports.InvoicingCustomerFormPage=t.InvoicingCustomerFormPage;exports.InvoicingCustomerListPage=t.InvoicingCustomerListPage;exports.InvoicingDashboardSkeleton=t.InvoicingDashboardSkeleton;exports.InvoicingDataImportDetailPage=t.InvoicingDataImportDetailPage;exports.InvoicingDataImportHubPage=t.InvoicingDataImportHubPage;exports.InvoicingDataImportMigratePage=t.InvoicingDataImportMigratePage;exports.InvoicingDetailScaffold=t.InvoicingDetailScaffold;exports.InvoicingDiscountDetailPage=t.InvoicingDiscountDetailPage;exports.InvoicingDiscountListPage=t.InvoicingDiscountListPage;exports.InvoicingDunningDetailPage=t.InvoicingDunningDetailPage;exports.InvoicingDunningListPage=t.InvoicingDunningListPage;exports.InvoicingDunningSettingsPage=t.InvoicingDunningSettingsPage;exports.InvoicingEmptyState=t.InvoicingEmptyState;exports.InvoicingInvoiceDetailPage=t.InvoicingInvoiceDetailPage;exports.InvoicingInvoiceListPage=t.InvoicingInvoiceListPage;exports.InvoicingIssueCreditNotePage=t.InvoicingIssueCreditNotePage;exports.InvoicingOverviewPage=t.InvoicingOverviewPage;exports.InvoicingPaymentDestinationSettingsPage=t.InvoicingPaymentDestinationSettingsPage;exports.InvoicingPaymentLinkPage=t.InvoicingPaymentLinkPage;exports.InvoicingPaymentListPage=t.InvoicingPaymentListPage;exports.InvoicingPromoPage=t.InvoicingPromoPage;exports.InvoicingRecordPaymentPage=t.InvoicingRecordPaymentPage;exports.InvoicingSettingsHubPage=t.InvoicingSettingsHubPage;exports.InvoicingSettingsPage=t.InvoicingSettingsHubPage;exports.InvoicingSubscriptionDetailPage=t.InvoicingSubscriptionDetailPage;exports.InvoicingSubscriptionFormPage=t.InvoicingSubscriptionFormPage;exports.InvoicingSubscriptionListPage=t.InvoicingSubscriptionListPage;exports.InvoicingTransactionDetailPage=t.InvoicingTransactionDetailPage;exports.InvoicingVoidInvoiceDialog=t.InvoicingVoidInvoiceDialog;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.MCC_CHIP_ID_PREFIX=t.MCC_CHIP_ID_PREFIX;exports.MagicLinkDomesticWireDetailsPage=t.MagicLinkDomesticWireDetailsPage;exports.MagicLinkInternationalWireDetailsPage=t.MagicLinkInternationalWireDetailsPage;exports.MagicLinkSuccessPage=t.MagicLinkSuccessPage;exports.MagicLinkVendorACHDetailsPage=t.MagicLinkVendorACHDetailsPage;exports.Modal=t.Modal;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.OAuthConsentPage=t.OAuthConsentPage;exports.OnboardingInitialLoader=t.OnboardingInitialLoader;exports.OnboardingSidebar=t.OnboardingSidebar;exports.OnboardingStepFrame=t.OnboardingStepFrame;exports.OpExByVendorPage=t.OpExByVendorPage;exports.OverlayContainerPage=t.OverlayContainerPage;exports.PandLWithForecastPage=t.PandLWithForecastPage;exports.PanelInternalContext=t.PanelInternalContext;exports.PaymentAccountSetupBillingAddressSection=t.PaymentAccountSetupBillingAddressSection;exports.PeoplePage=t.PeoplePage;exports.Picker=t.Picker;exports.PolicyLimitsRowList=t.PolicyLimitsRowList;exports.PolicyModeSelector=t.PolicyModeSelector;exports.PortfolioAllocationFormPage=t.PortfolioAllocationFormPage;exports.QBOConnectionDialog=t.QBOConnectionDialog;exports.QBOSetupSectionWithForm=t.QBOSetupSectionWithForm;exports.QuickResponsesPage=t.QuickResponsesPage;exports.QuickViewModeContext=t.QuickViewModeContext;exports.RIGHT_SIDE_PANEL_WIDTH_PX=t.RIGHT_SIDE_PANEL_WIDTH_PX;exports.ReferralDrawerPage=t.DrawerPage;exports.ReimbursementApprovalRuleDetailPage=t.ReimbursementApprovalRuleDetailPage;exports.ReimbursementApprovalRuleDetailPageV1=t.ReimbursementApprovalRuleDetailPage$1;exports.ReimbursementApprovalRulesPage=t.ReimbursementApprovalRulesPage;exports.ReimbursementApprovalRulesPageV1=t.ReimbursementApprovalRulesPage$1;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.ReviewConfirmTransferPanel=t.ReviewConfirmTransferPanel;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.SearchableCheckboxCardList=t.SearchableCheckboxCardList;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.StatementParseInfo=t.StatementParseInfo;exports.StatementProcessingPage=t.StatementProcessingPage;exports.StatementsPage=t.StatementsPage;exports.StyledCapsule=t.StyledCapsule;exports.SubscriptionDetailPage=t.SubscriptionDetailPage;exports.SubscriptionSummaryPage=t.SubscriptionSummaryPage;exports.SyntheticAiCfoAnswerView=t.SyntheticAiCfoAnswerView;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.TransactionListComments=t.TransactionListComments;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.VENDOR_CHIP_ID_PREFIX=t.VENDOR_CHIP_ID_PREFIX;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.VerificationFrame=t.VerificationFrame;exports.VerifyDevice=t.VerifyDevice;exports.VerifyUnlockFinancialStackPage=t.VerifyUnlockFinancialStackPage;exports.WebV2MicroService=t.WebV2MicroService;exports.WebV2MicroServiceProvider=t.WebV2MicroServiceProvider;exports.WelcomeAnimation=t.WelcomeAnimation;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.applyExtractedPolicyRulesToFormValues=t.applyExtractedPolicyRulesToFormValues;exports.buildBulkCreateCardPolicyTemplateRequestsFromInteractiveForm=t.buildBulkCreateCardPolicyTemplateRequestsFromInteractiveForm;exports.buildCardPolicyFormValuesFromRequest=t.buildCardPolicyFormValuesFromRequest;exports.buildCreateCardPolicyTemplateRequest=t.buildCreateCardPolicyTemplateRequest;exports.buildCreateCardPolicyTemplateRequestFromInteractiveForm=t.buildCreateCardPolicyTemplateRequestFromInteractiveForm;exports.buildMccCategoryChipId=t.buildMccCategoryChipId;exports.buildStickyKeySet=t.buildStickyKeySet;exports.buildVendorChipId=t.buildVendorChipId;exports.buildVoidInvoiceSubmitBody=t.buildVoidInvoiceSubmitBody;exports.cellVerticalAlignToFlexAlign=t.cellVerticalAlignToFlexAlign;exports.clearAutoLogoutContext=t.clearAutoLogoutContext;exports.clickableRowStyles=t.clickableRowStyles;exports.computeStatementProcessingStepsFromElapsedTime=t.computeStatementProcessingStepsFromElapsedTime;exports.computeStickyLeftOffsets=t.computeStickyLeftOffsets;exports.darkColors=t.darkColors;exports.darkTheme=t.darkTheme;exports.dashboardCardDimension=t.designDimension;exports.defaultCardPolicyFormValues=t.defaultCardPolicyFormValues;exports.formatReconAccountDisplayName=t.formatReconAccountDisplayName;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.getReconAccountDisplayName=t.getReconAccountDisplayName;exports.getShowNegativeAmountInParenthesisDefaultValue=t.getShowNegativeAmountInParenthesisDefaultValue;exports.getShowNegativeAmountInParenthesisForPercentDefaultValue=t.getShowNegativeAmountInParenthesisForPercentDefaultValue;exports.getStableTransactionId=t.getStableTransactionId;exports.getStatementParseTransactionCount=t.getStatementParseTransactionCount;exports.invoicingMenuList=t.invoicingMenuList;exports.isBackdatedInvoiceDate=t.isBackdatedInvoiceDate;exports.isCloseManagementMenu=t.isCloseManagementMenu;exports.isClosedCardStatus=t.isClosedCardStatus;exports.isCollaborationEntityType=t.isCollaborationEntityType;exports.isMobileOrTabletView=t.isMobileOrTabletView;exports.isMobilePhoneScreen=t.isMobilePhoneScreen;exports.lightColors=t.lightColors;exports.lightTheme=t.lightTheme;exports.menuList=t.menuList;exports.mergeColumnDeclarativeWithRenderers=t.mergeColumnDeclarativeWithRenderers;exports.mergeLayoutDefaults=t.mergeLayoutDefaults;exports.percentValueToString=t.percentValueToString;exports.resolveBackgroundStatementProcessingCompletedSteps=t.resolveBackgroundStatementProcessingCompletedSteps;exports.resolveColumnWidth=t.resolveColumnWidth;exports.roundAmountIfNeeded=t.roundAmountIfNeeded;exports.roundOffNumberToTwoDecimal=t.roundOffNumberToTwoDecimal;exports.setAutoLogoutContext=t.setAutoLogoutContext;exports.setShowNegativeAmountInParenthesisDefaultValue=t.setShowNegativeAmountInParenthesisDefaultValue;exports.setShowNegativeAmountInParenthesisForPercentDefaultValue=t.setShowNegativeAmountInParenthesisForPercentDefaultValue;exports.settingMenuList=t.settingMenuList;exports.shouldDefaultAdjustmentCreditNote=t.shouldDefaultAdjustmentCreditNote;exports.sp=t.sp;exports.textAlignForCell=t.textAlignForCell;exports.textStyles=t.textStyles;exports.toInstitutionLogoDataUri=t.toInstitutionLogoDataUri;exports.toInvoicingMenuOptionType=t.toInvoicingMenuOptionType;exports.toInvoicingMenuOptionTypeStrict=t.toInvoicingMenuOptionTypeStrict;exports.toMccCategoryChipFieldValue=t.toMccCategoryChipFieldValue;exports.toMenuOptionType=t.toMenuOptionType;exports.toSettingsMenuOptionTypeStrict=t.toSettingsMenuOptionTypeStrict;exports.toSupportedLocaleStrict=t.toSupportedLocaleStrict;exports.toVendorChipFieldValue=t.toVendorChipFieldValue;exports.trackTreasuryTransferAnalytics=t.trackTreasuryTransferAnalytics;exports.uploadAttachmentReceipts=t.uploadAttachmentReceipts;exports.useApprovalRulesV3Config=t.useApprovalRulesV3Config;exports.useBackNavigation=t.useBackNavigation;exports.useCollaborationInfoContext=t.useCollaborationInfoContext;exports.useCommentsDrawer=t.useCommentsDrawer;exports.useDropdownPortal=t.useDropdownPortal;exports.useExpenseAutomationEnabledForUser=t.useExpenseAutomationEnabledForUser;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.useZeniCardsVisibilityConfig=t.useZeniCardsVisibilityConfig;exports.useZeniFeatureContext=t.useZeniFeatureContext;exports.useZeniThemeContext=t.useZeniThemeContext;exports.waitFor=t.waitFor;exports.useZeniTheme=o.useTheme;exports.zeniStyled=o.styled;exports.zeniEmotionStyled=s;Object.defineProperty(exports,"buildInvoicingEntityPath",{enumerable:!0,get:()=>J.buildInvoicingEntityPath});Object.defineProperty(exports,"isInvoicingEntityLinkable",{enumerable:!0,get:()=>J.isInvoicingEntityLinkable});exports.AiAccountantDetailDrawer=Dy;exports.AiAccountantPage=rf;exports.AuditReportDrawerPage=Rb;exports.COCKPIT_TAB_OPTIONS=it;exports.COCKPIT_TAB_OPTIONS_WITH_CREDIT_AGENT=tl;exports.CockpitNavBar=Pl;exports.CreditAgentPage=A$;exports.HealthMonitorDetailDrawer=gx;exports.HealthMonitorPage=Gh;exports.ManagementPage=Pu;exports.MonthEndReportHistoricDataPage=nj;exports.MonthEndReportPage=M3;exports.NavHeader=dt;exports.OnboardingCustomerPage=OC;exports.OnboardingPage=F2;exports.PortfolioPage=ky;exports.ReviewPage=l4;exports.SubscriptionAddPlanPage=PS;exports.SubscriptionPage=o1;exports.SubscriptionUpdatePlanPage=pS;exports.TaskManagerPage=Ju;exports.WarningsDrawerPage=_b;exports.toCockpitOptionType=Rt;exports.toCockpitOptionTypeStrict=Ll;
|
|
5847
|
+
`;exports.AIAgentsActivatingPage=t.AIAgentsActivatingPage;exports.AIIconButton=t.AIIconButton;exports.AIPerformancePage=t.AIPerformancePage;exports.ALL_AI_CFO_MENU_OPTIONS=t.ALL_AI_CFO_MENU_OPTIONS;exports.ALL_INVOICING_MENU_GROUPS=t.ALL_INVOICING_MENU_GROUPS;exports.ALL_INVOICING_MENU_OPTIONS=t.ALL_INVOICING_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.AccountReconDetailsDrawerPageV2=t.AccountReconDetailsDrawerPage$1;exports.ActivityIndicator=t.ActivityIndicator;exports.AddAddressForCardDrawer=t.AddAddressForCardDrawer;exports.AddToWalletPage=t.AddToWalletPage;exports.AddressFormPage=t.AddressFormPage;exports.AgingReportsPage=t.AgingReportsPage;exports.AiCfoChatHeader=t.AiCfoChatHeader;exports.AiCfoMenuContent=t.AiCfoMenuContent;exports.AiCfoOnboardingPage=t.AiCfoOnboardingPage;exports.AiCfoPage=t.AiCfoPage;exports.AiCfoScopeModal=t.AiCfoScopeModal;exports.AiCfoScopeModalScrollBody=t.AiCfoScopeModalScrollBody;exports.AiCfoSidePanel=t.AiCfoSidePanel;exports.AiFinanceTeamReadyPage=t.AiFinanceTeamReadyPage;exports.AllowBlockChipPicker=t.AllowBlockChipPicker;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.AskAiCfoNavButtonWhenEnabled=t.AskAiCfoNavButtonWhenEnabled;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.BillPayApprovalRuleDetailPageV1=t.BillPayApprovalRuleDetailPage$1;exports.BillPayApprovalRulesPage=t.BillPayApprovalRulesPage;exports.BillPayApprovalRulesPageV1=t.BillPayApprovalRulesPage$1;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.CARD_POLICY_LIMIT_ROW_ID_REQUIRE_RECEIPT=t.CARD_POLICY_LIMIT_ROW_ID_REQUIRE_RECEIPT;exports.CARD_POLICY_LIMIT_ROW_ID_TRANSACTION=t.CARD_POLICY_LIMIT_ROW_ID_TRANSACTION;exports.COMMAND_CENTER_SUBMENU_TYPES=t.COMMAND_CENTER_SUBMENU_TYPES;exports.COMMENT_NOTIFICATION_KINDS=t.COMMENT_NOTIFICATION_KINDS;exports.CapitalizationOnboardingPopup=t.CapitalizationOnboardingPopup;exports.CapitalizationSettingsSection=t.CapitalizationSettingsSection;exports.CardPolicyCreatePage=t.CardPolicyCreatePage;exports.CardPolicyEditPage=t.CardPolicyEditPage;exports.CardPolicyFormPageSkeleton=t.CardPolicyFormPageSkeleton;exports.CardPolicyFormSections=t.CardPolicyFormSections;exports.CardPolicyListPage=t.CardPolicyListPage;exports.CardPolicyListPageSkeleton=t.CardPolicyListPageSkeleton;exports.CardPolicyListRow=t.CardPolicyListRow;exports.CardPolicyListSkeletonRow=t.CardPolicyListSkeletonRow;exports.CardPolicyManualEmptyState=t.CardPolicyManualEmptyState;exports.CardsAiCfoHero=t.CardsAiCfoHero;exports.CardsShutdownBanner=t.CardsShutdownBanner;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.ChargeCardListSkeletonRow=t.ChargeCardListSkeletonRow;exports.ChargeCardPaymentHistoryPage=t.ChargeCardPaymentHistoryPage;exports.ChargeCardPromoPage=t.ChargeCardPromoPage;exports.ChargeCardPromoPageSkeleton=t.ChargeCardPromoPageSkeleton;exports.ChargeCardSetUpPage=t.ChargeCardSetUpPage;exports.ChargeCardSetupLoading=t.SpendManagementSetUpLoading;exports.ChargeCardStatementsLoading=t.ChargeCardStatementsLoading;exports.ChargeCardStatementsPage=t.ChargeCardStatementsPage;exports.ChargeCardUserOnboardingPromoPage=t.ChargeCardUserOnboardingPromoPage;exports.ChargeCardUserOnboardingPromoPageSkeleton=t.ChargeCardUserOnboardingPromoPageSkeleton;exports.CheckDepositDrawerPage=t.CheckDepositDrawerPage;exports.ClickableRow=t.ClickableRow;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.CompanyOfficerOnboardingDetailsSection=t.CompanyOfficerOnboardingDetailsSection;exports.CompanyOnboardingDetailsSection=t.CompanyOnboardingDetailsSection;exports.CompanyPassportCard=t.CompanyPassportCard;exports.CompanyPassportPage=t.CompanyPassportPage;exports.CompleteProfile=t.CompleteProfile;exports.ConfettiBurst=t.ConfettiBurst;exports.ConfirmationPopup=t.ConfirmationPopup;exports.ConnectDataSourcesPage=t.ConnectDataSourcesPage;exports.CreateOrEditVendorPage=t.CreateOrEditVendorPage;exports.CreateOrEditVendorPageSkeleton=t.CreateOrEditVendorPageSkeleton;exports.CreatedEntitiesAnswer=t.CreatedEntitiesAnswer;exports.CreatingEntitiesAnswerLoading=t.CreatingEntitiesAnswerLoading;exports.CreditCardPaymentDrawerPage=t.CreditCardPaymentDrawerPage;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.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.INVOICING_SETTINGS_NAV_SECTIONS=t.INVOICING_SETTINGS_NAV_SECTIONS;exports.INVOICING_SETTINGS_TABS=t.INVOICING_SETTINGS_TABS;exports.InformationCardStack=t.InformationCardStack;exports.InitialCollaborationProvider=t.InitialCollaborationProvider;exports.InsightsCardStack=t.InsightCardStack;exports.IntegrationCardView=t.IntegrationCardView;exports.IntegrationsCardGrid=t.IntegrationsCardGrid;exports.IntegrationsSection=t.IntegrationsSection;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.InvoicingAddPaymentMethodDialog=t.InvoicingAddPaymentMethodDialog;exports.InvoicingAuditLogPage=t.InvoicingAuditLogPage;exports.InvoicingBrandingSettingsPage=t.InvoicingBrandingSettingsPage;exports.InvoicingCatalogItemDetailPage=t.InvoicingCatalogItemDetailPage;exports.InvoicingCatalogItemFormPage=t.InvoicingCatalogItemFormPage;exports.InvoicingCatalogPage=t.InvoicingCatalogPage;exports.InvoicingCouponFormPage=t.InvoicingCouponFormPage;exports.InvoicingCreateInvoicePage=t.InvoicingCreateInvoicePage;exports.InvoicingCreateInvoiceSkeleton=t.InvoicingCreateInvoiceSkeleton;exports.InvoicingCreatePromotionalCreditsDialog=t.InvoicingCreatePromotionalCreditsDialog;exports.InvoicingCreditDetailPage=t.InvoicingCreditDetailPage;exports.InvoicingCreditListPage=t.InvoicingCreditListPage;exports.InvoicingCustomerDetailPage=t.InvoicingCustomerDetailPage;exports.InvoicingCustomerFormPage=t.InvoicingCustomerFormPage;exports.InvoicingCustomerListPage=t.InvoicingCustomerListPage;exports.InvoicingDashboardSkeleton=t.InvoicingDashboardSkeleton;exports.InvoicingDataImportDetailPage=t.InvoicingDataImportDetailPage;exports.InvoicingDataImportHubPage=t.InvoicingDataImportHubPage;exports.InvoicingDataImportMigratePage=t.InvoicingDataImportMigratePage;exports.InvoicingDetailScaffold=t.InvoicingDetailScaffold;exports.InvoicingDiscountDetailPage=t.InvoicingDiscountDetailPage;exports.InvoicingDiscountListPage=t.InvoicingDiscountListPage;exports.InvoicingDunningDetailPage=t.InvoicingDunningDetailPage;exports.InvoicingDunningListPage=t.InvoicingDunningListPage;exports.InvoicingDunningSettingsPage=t.InvoicingDunningSettingsPage;exports.InvoicingEmptyState=t.InvoicingEmptyState;exports.InvoicingIntegrationsSettingsPage=t.InvoicingIntegrationsSettingsPage;exports.InvoicingInvoiceDetailPage=t.InvoicingInvoiceDetailPage;exports.InvoicingInvoiceListPage=t.InvoicingInvoiceListPage;exports.InvoicingIssueCreditNotePage=t.InvoicingIssueCreditNotePage;exports.InvoicingOverviewPage=t.InvoicingOverviewPage;exports.InvoicingPaymentDestinationSettingsPage=t.InvoicingPaymentDestinationSettingsPage;exports.InvoicingPaymentLinkPage=t.InvoicingPaymentLinkPage;exports.InvoicingPaymentListPage=t.InvoicingPaymentListPage;exports.InvoicingPromoPage=t.InvoicingPromoPage;exports.InvoicingQBOSettingsPage=t.InvoicingQBOSettingsPage;exports.InvoicingRecordPaymentPage=t.InvoicingRecordPaymentPage;exports.InvoicingSettingsHubPage=t.InvoicingSettingsHubPage;exports.InvoicingSettingsPage=t.InvoicingSettingsHubPage;exports.InvoicingSubscriptionDetailPage=t.InvoicingSubscriptionDetailPage;exports.InvoicingSubscriptionFormPage=t.InvoicingSubscriptionFormPage;exports.InvoicingSubscriptionListPage=t.InvoicingSubscriptionListPage;exports.InvoicingTransactionDetailPage=t.InvoicingTransactionDetailPage;exports.InvoicingVoidInvoiceDialog=t.InvoicingVoidInvoiceDialog;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.MCC_CHIP_ID_PREFIX=t.MCC_CHIP_ID_PREFIX;exports.MagicLinkDomesticWireDetailsPage=t.MagicLinkDomesticWireDetailsPage;exports.MagicLinkInternationalWireDetailsPage=t.MagicLinkInternationalWireDetailsPage;exports.MagicLinkSuccessPage=t.MagicLinkSuccessPage;exports.MagicLinkVendorACHDetailsPage=t.MagicLinkVendorACHDetailsPage;exports.Modal=t.Modal;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.OAuthConsentPage=t.OAuthConsentPage;exports.OnboardingInitialLoader=t.OnboardingInitialLoader;exports.OnboardingSidebar=t.OnboardingSidebar;exports.OnboardingStepFrame=t.OnboardingStepFrame;exports.OpExByVendorPage=t.OpExByVendorPage;exports.OverlayContainerPage=t.OverlayContainerPage;exports.PandLWithForecastPage=t.PandLWithForecastPage;exports.PanelInternalContext=t.PanelInternalContext;exports.PaymentAccountSetupBillingAddressSection=t.PaymentAccountSetupBillingAddressSection;exports.PeoplePage=t.PeoplePage;exports.Picker=t.Picker;exports.PolicyLimitsRowList=t.PolicyLimitsRowList;exports.PolicyModeSelector=t.PolicyModeSelector;exports.PortfolioAllocationFormPage=t.PortfolioAllocationFormPage;exports.QBOConnectionDialog=t.QBOConnectionDialog;exports.QBOSetupSectionWithForm=t.QBOSetupSectionWithForm;exports.QuickResponsesPage=t.QuickResponsesPage;exports.QuickViewModeContext=t.QuickViewModeContext;exports.RIGHT_SIDE_PANEL_WIDTH_PX=t.RIGHT_SIDE_PANEL_WIDTH_PX;exports.ReferralDrawerPage=t.DrawerPage;exports.ReimbursementApprovalRuleDetailPage=t.ReimbursementApprovalRuleDetailPage;exports.ReimbursementApprovalRuleDetailPageV1=t.ReimbursementApprovalRuleDetailPage$1;exports.ReimbursementApprovalRulesPage=t.ReimbursementApprovalRulesPage;exports.ReimbursementApprovalRulesPageV1=t.ReimbursementApprovalRulesPage$1;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.ReviewConfirmTransferPanel=t.ReviewConfirmTransferPanel;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.SearchableCheckboxCardList=t.SearchableCheckboxCardList;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.StatementParseInfo=t.StatementParseInfo;exports.StatementProcessingPage=t.StatementProcessingPage;exports.StatementsPage=t.StatementsPage;exports.StyledCapsule=t.StyledCapsule;exports.SubscriptionDetailPage=t.SubscriptionDetailPage;exports.SubscriptionSummaryPage=t.SubscriptionSummaryPage;exports.SyntheticAiCfoAnswerView=t.SyntheticAiCfoAnswerView;exports.THREAD_RESOLVED_NOTIFICATION_KIND=t.THREAD_RESOLVED_NOTIFICATION_KIND;exports.THREAD_UNRESOLVED_NOTIFICATION_KIND=t.THREAD_UNRESOLVED_NOTIFICATION_KIND;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.TransactionListComments=t.TransactionListComments;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.VENDOR_CHIP_ID_PREFIX=t.VENDOR_CHIP_ID_PREFIX;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.VerificationFrame=t.VerificationFrame;exports.VerifyDevice=t.VerifyDevice;exports.VerifyUnlockFinancialStackPage=t.VerifyUnlockFinancialStackPage;exports.WebV2MicroService=t.WebV2MicroService;exports.WebV2MicroServiceProvider=t.WebV2MicroServiceProvider;exports.WelcomeAnimation=t.WelcomeAnimation;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.applyExtractedPolicyRulesToFormValues=t.applyExtractedPolicyRulesToFormValues;exports.buildBulkCreateCardPolicyTemplateRequestsFromInteractiveForm=t.buildBulkCreateCardPolicyTemplateRequestsFromInteractiveForm;exports.buildCardPolicyFormValuesFromRequest=t.buildCardPolicyFormValuesFromRequest;exports.buildCreateCardPolicyTemplateRequest=t.buildCreateCardPolicyTemplateRequest;exports.buildCreateCardPolicyTemplateRequestFromInteractiveForm=t.buildCreateCardPolicyTemplateRequestFromInteractiveForm;exports.buildMccCategoryChipId=t.buildMccCategoryChipId;exports.buildStickyKeySet=t.buildStickyKeySet;exports.buildVendorChipId=t.buildVendorChipId;exports.buildVoidInvoiceSubmitBody=t.buildVoidInvoiceSubmitBody;exports.cellVerticalAlignToFlexAlign=t.cellVerticalAlignToFlexAlign;exports.clearAutoLogoutContext=t.clearAutoLogoutContext;exports.clickableRowStyles=t.clickableRowStyles;exports.computeStatementProcessingStepsFromElapsedTime=t.computeStatementProcessingStepsFromElapsedTime;exports.computeStickyLeftOffsets=t.computeStickyLeftOffsets;exports.darkColors=t.darkColors;exports.darkTheme=t.darkTheme;exports.dashboardCardDimension=t.designDimension;exports.defaultCardPolicyFormValues=t.defaultCardPolicyFormValues;exports.formatReconAccountDisplayName=t.formatReconAccountDisplayName;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.getReconAccountDisplayName=t.getReconAccountDisplayName;exports.getShowNegativeAmountInParenthesisDefaultValue=t.getShowNegativeAmountInParenthesisDefaultValue;exports.getShowNegativeAmountInParenthesisForPercentDefaultValue=t.getShowNegativeAmountInParenthesisForPercentDefaultValue;exports.getStableTransactionId=t.getStableTransactionId;exports.getStatementParseTransactionCount=t.getStatementParseTransactionCount;exports.invoicingMenuList=t.invoicingMenuList;exports.isBackdatedInvoiceDate=t.isBackdatedInvoiceDate;exports.isCloseManagementMenu=t.isCloseManagementMenu;exports.isClosedCardStatus=t.isClosedCardStatus;exports.isCollaborationEntityType=t.isCollaborationEntityType;exports.isCommentNotificationKind=t.isCommentNotificationKind;exports.isMobileOrTabletView=t.isMobileOrTabletView;exports.isMobilePhoneScreen=t.isMobilePhoneScreen;exports.lightColors=t.lightColors;exports.lightTheme=t.lightTheme;exports.menuList=t.menuList;exports.mergeColumnDeclarativeWithRenderers=t.mergeColumnDeclarativeWithRenderers;exports.mergeLayoutDefaults=t.mergeLayoutDefaults;exports.percentValueToString=t.percentValueToString;exports.resolveBackgroundStatementProcessingCompletedSteps=t.resolveBackgroundStatementProcessingCompletedSteps;exports.resolveColumnWidth=t.resolveColumnWidth;exports.roundAmountIfNeeded=t.roundAmountIfNeeded;exports.roundOffNumberToTwoDecimal=t.roundOffNumberToTwoDecimal;exports.setAutoLogoutContext=t.setAutoLogoutContext;exports.setShowNegativeAmountInParenthesisDefaultValue=t.setShowNegativeAmountInParenthesisDefaultValue;exports.setShowNegativeAmountInParenthesisForPercentDefaultValue=t.setShowNegativeAmountInParenthesisForPercentDefaultValue;exports.settingMenuList=t.settingMenuList;exports.shouldDefaultAdjustmentCreditNote=t.shouldDefaultAdjustmentCreditNote;exports.sp=t.sp;exports.textAlignForCell=t.textAlignForCell;exports.textStyles=t.textStyles;exports.toInstitutionLogoDataUri=t.toInstitutionLogoDataUri;exports.toInvoicingMenuOptionType=t.toInvoicingMenuOptionType;exports.toInvoicingMenuOptionTypeStrict=t.toInvoicingMenuOptionTypeStrict;exports.toMccCategoryChipFieldValue=t.toMccCategoryChipFieldValue;exports.toMenuOptionType=t.toMenuOptionType;exports.toSettingsMenuOptionTypeStrict=t.toSettingsMenuOptionTypeStrict;exports.toSupportedLocaleStrict=t.toSupportedLocaleStrict;exports.toVendorChipFieldValue=t.toVendorChipFieldValue;exports.trackTreasuryTransferAnalytics=t.trackTreasuryTransferAnalytics;exports.uploadAttachmentReceipts=t.uploadAttachmentReceipts;exports.useApprovalRulesV3Config=t.useApprovalRulesV3Config;exports.useBackNavigation=t.useBackNavigation;exports.useCollaborationInfoContext=t.useCollaborationInfoContext;exports.useCommentsDrawer=t.useCommentsDrawer;exports.useDropdownPortal=t.useDropdownPortal;exports.useExpenseAutomationEnabledForUser=t.useExpenseAutomationEnabledForUser;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.useZeniCardsVisibilityConfig=t.useZeniCardsVisibilityConfig;exports.useZeniFeatureContext=t.useZeniFeatureContext;exports.useZeniThemeContext=t.useZeniThemeContext;exports.waitFor=t.waitFor;exports.useZeniTheme=o.useTheme;exports.zeniStyled=o.styled;exports.zeniEmotionStyled=s;Object.defineProperty(exports,"buildInvoicingEntityPath",{enumerable:!0,get:()=>J.buildInvoicingEntityPath});Object.defineProperty(exports,"isInvoicingEntityLinkable",{enumerable:!0,get:()=>J.isInvoicingEntityLinkable});exports.AiAccountantDetailDrawer=Dy;exports.AiAccountantPage=rf;exports.AuditReportDrawerPage=Rb;exports.COCKPIT_TAB_OPTIONS=it;exports.COCKPIT_TAB_OPTIONS_WITH_CREDIT_AGENT=tl;exports.CockpitNavBar=Pl;exports.CreditAgentPage=A$;exports.HealthMonitorDetailDrawer=gx;exports.HealthMonitorPage=Gh;exports.ManagementPage=Pu;exports.MonthEndReportHistoricDataPage=nj;exports.MonthEndReportPage=M3;exports.NavHeader=dt;exports.OnboardingCustomerPage=OC;exports.OnboardingPage=F2;exports.PortfolioPage=ky;exports.ReviewPage=l4;exports.SubscriptionAddPlanPage=PS;exports.SubscriptionPage=o1;exports.SubscriptionUpdatePlanPage=pS;exports.TaskManagerPage=Ju;exports.WarningsDrawerPage=_b;exports.toCockpitOptionType=Rt;exports.toCockpitOptionTypeStrict=Il;
|