@zeniai/web-cockpit-ui 2.0.84-prod → 2.0.85-dev

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.
Files changed (40) hide show
  1. package/dist/assets/{CreditAgentRoutes-B45YoGWe.js → CreditAgentRoutes-S4VaXFlU.js} +2 -2
  2. package/dist/assets/{Preview-HMWr0soo.js → Preview-CgBwFtBQ.js} +1 -1
  3. package/dist/assets/{ScreenRoutes-CrvjONSe.js → ScreenRoutes-BcAO2sXU.js} +46 -46
  4. package/dist/assets/SignInScreen-JRqANln2.js +1 -0
  5. package/dist/assets/{analytics-CZ-FmaV9.js → analytics-GhKaERnA.js} +1 -1
  6. package/dist/assets/{analyticsHelper-1HtqPsGC.js → analyticsHelper-YnSprNDK.js} +1 -1
  7. package/dist/assets/{core-CE3H_VNa.js → core-D5Fsnw0z.js} +1 -1
  8. package/dist/assets/{dash.all.min-QgtNkQHZ.js → dash.all.min-B0yj2D7O.js} +1 -1
  9. package/dist/assets/{empty-CY42FA32.js → empty-CmvTAiVP.js} +1 -1
  10. package/dist/assets/{empty-ndXrmqa0.js → empty-DrAz-vvT.js} +1 -1
  11. package/dist/assets/epic-zSFJNGQ0.js +2 -0
  12. package/dist/assets/{index-D7tNamzI.js → index-Bczc1KOS.js} +11953 -11842
  13. package/dist/assets/{index-BW2QxJq4.js → index-CoLYnuMk.js} +1 -1
  14. package/dist/assets/{index-Cm05H-7F.js → index-DF4S4Rtq.js} +2 -2
  15. package/dist/assets/{index-zucFkE8J.js → index-DbwsvqQG.js} +1 -1
  16. package/dist/assets/{index-CH_sMxWL.js → index-JV4Q69ZO.js} +1 -1
  17. package/dist/assets/{index-DJP0IjUR.js → index-K9SX3_2e.js} +1 -1
  18. package/dist/assets/{index-B6M95Yuw.js → index-kzBNl2h6.js} +1 -1
  19. package/dist/assets/{lexical-U5jL5t5C.js → lexical-DfO0Q69H.js} +1 -1
  20. package/dist/assets/{liveblocks-BAvcyCma.js → liveblocks-CSba8GsX.js} +1 -1
  21. package/dist/assets/{lottie-CWfppmr7.js → lottie-CC61aeWb.js} +1 -1
  22. package/dist/assets/{mui-CmjNTPCz.js → mui-Zto83dWr.js} +1 -1
  23. package/dist/assets/{react-Cdr2rq0U.js → react-0NCrAmlt.js} +2 -2
  24. package/dist/assets/{react-DEonn4t1.js → react-BHYXRGFI.js} +1 -1
  25. package/dist/assets/{react-BN7gDUSQ.js → react-BwIJs6Z2.js} +1 -1
  26. package/dist/assets/{react-DXuf2HxI.js → react-CweZThY6.js} +1 -1
  27. package/dist/assets/{react-SfNroXJK.js → react-CyzDEzvL.js} +1 -1
  28. package/dist/assets/{react-BfOjzt7w.js → react-P-OH8yAg.js} +1 -1
  29. package/dist/assets/{react-CrmupjMp.js → react-Q_gr291O.js} +1 -1
  30. package/dist/assets/{react-fnA89LDc.js → react-hm05xAoc.js} +1 -1
  31. package/dist/assets/{recharts-BiozIppC.js → recharts-CHUOt7mX.js} +1 -1
  32. package/dist/assets/{sentry-DrJPfWXM.js → sentry-Cdl8_Foz.js} +1 -1
  33. package/dist/assets/{url-CzlhNrPM.js → url-Crhm_VuL.js} +1 -1
  34. package/dist/assets/{url-gkEZAgp-.js → url-DBgh3jCD.js} +1 -1
  35. package/dist/assets/{utils-D1zZL3wm.js → utils-recTAQXG.js} +1 -1
  36. package/dist/assets/{zeni-epic-state-B6iXd1x5.js → zeni-epic-state-DQffgXnI.js} +6 -6
  37. package/dist/index.html +1 -1
  38. package/package.json +4 -4
  39. package/dist/assets/SignInScreen-CVwyDM_u.js +0 -1
  40. package/dist/assets/epic-CBdicRfA.js +0 -2
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-BAvcyCma.js";import{u as D,P as k}from"./ScreenRoutes-CrvjONSe.js";import{a as f}from"./sentry-DrJPfWXM.js";import{i as v,n as P,g as m,h as j,k as C,l as I,N as R}from"./core-CE3H_VNa.js";import{K7 as T,K8 as N,kd as M,K9 as E,kX as L,k_ as $,kM as _,Ka as K,Kb as O,kU as B,kQ as F}from"./zeni-epic-state-B6iXd1x5.js";import{z as J,$ as q,f as V,i as Q,a0 as X,U as Z,J as G,b as H,g as W,h as Y}from"./index-D7tNamzI.js";import{n as ee}from"./mui-CmjNTPCz.js";import"./recharts-BiozIppC.js";import"./analyticsHelper-1HtqPsGC.js";import"./utils-D1zZL3wm.js";import"./empty-CY42FA32.js";import"./index-zucFkE8J.js";import"./url-CzlhNrPM.js";import"./index-DJP0IjUR.js";import"./analytics-CZ-FmaV9.js";import"./lottie-CWfppmr7.js";import"./lexical-U5jL5t5C.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="2cdd8d4c-908d-4b38-83d3-66ccfe1f6dcb",a._sentryDebugIdIdentifier="sentry-dbid-2cdd8d4c-908d-4b38-83d3-66ccfe1f6dcb")}catch{}})();function te(a,t){return{headerData:{allTabOptions:Z,selectedTabOption:G("creditAgent")},creditAgentPageData:{macroData:{data:t.macroCombined.data,fetchState:t.macroCombined.fetchStatus.fetchState,updateState:t.macroCombined.updateStatus.fetchState},cardProfilesData:t.cardProfilesData}}}function ne(a,t){return{headerActions:{onTabChange:n=>{const g=Y(n),c=W(n);H.trackCockpitTabClicked(c),t.navigate(`../../${g}`,{replace:!0})}},creditAgentPageActions:{onFetchMacro:()=>{a(F())},onSaveMacro:n=>{a(B(n))},onResetSaveMacro:()=>{a(O())},onUIStateChange:n=>{a(K(n))},cardProfilesActions:t.cardProfilesActions}}}const ae=j(te,ne)(X),oe=ee.div`
1
+ import{j as s}from"./liveblocks-CSba8GsX.js";import{u as D,P as j}from"./ScreenRoutes-BcAO2sXU.js";import{a as f}from"./sentry-Cdl8_Foz.js";import{i as k,n as v,g as m,h as P,k as C,l as I,N as R}from"./core-D5Fsnw0z.js";import{Ka as T,Kb as N,kd as M,Kc as E,kX as L,k_ as _,kM as $,Kd as K,Ke as O,kU as B,kQ as F}from"./zeni-epic-state-DQffgXnI.js";import{z as J,_ as q,i as V,j as Q,a0 as X,a as Z,J as G,c as H,g as W,h as Y}from"./index-Bczc1KOS.js";import{n as ee}from"./mui-Zto83dWr.js";import"./recharts-CHUOt7mX.js";import"./analyticsHelper-YnSprNDK.js";import"./utils-recTAQXG.js";import"./empty-CmvTAiVP.js";import"./index-DbwsvqQG.js";import"./url-Crhm_VuL.js";import"./index-K9SX3_2e.js";import"./analytics-GhKaERnA.js";import"./lottie-CC61aeWb.js";import"./lexical-DfO0Q69H.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="2c424aec-de29-41bf-9839-0b2cbf026cf4",a._sentryDebugIdIdentifier="sentry-dbid-2c424aec-de29-41bf-9839-0b2cbf026cf4")}catch{}})();function te(a,t){return{headerData:{allTabOptions:Z,selectedTabOption:G("creditAgent")},creditAgentPageData:{macroData:{data:t.macroCombined.data,fetchState:t.macroCombined.fetchStatus.fetchState,updateState:t.macroCombined.updateStatus.fetchState},cardProfilesData:t.cardProfilesData}}}function ne(a,t){return{headerActions:{onTabChange:n=>{const g=Y(n),c=W(n);H.trackCockpitTabClicked(c),t.navigate(`../../${g}`,{replace:!0})}},creditAgentPageActions:{onFetchMacro:()=>{a(F())},onSaveMacro:n=>{a(B(n))},onResetSaveMacro:()=>{a(O())},onUIStateChange:n=>{a(K(n))},cardProfilesActions:t.cardProfilesActions}}}const ae=P(te,ne)(X),oe=ee.div`
2
2
  padding: ${Q.sp5};
3
3
  text-align: center;
4
- `;function re(){const a=v(),t=P(),n=m(T),g=m(N),[c,h]=f.useState(new Set),p=f.useRef(new Set),b=m(e=>e.tenantState.currentTenantId),y=m(e=>e.companyViewState.zeniUsers.fetchState);f.useEffect(()=>{y==="Not-Started"&&t(M())},[t,y]);const d=J.getSignedInUser(),A=d!=null&&[d.firstName,d.lastName].filter(Boolean).join(" ")||void 0,z=f.useMemo(()=>({onFetch:()=>{t(_())},onUpdateProfile:(e,o,r)=>{const i=r.updatedByName??A;t($({tenantId:o,tenantEmailDomain:e,update:{...r,updatedByName:i}}))},onAnalyse:e=>{h(o=>new Set(o).add(e)),t(L(e))},onDownloadReport:()=>{const e=E(n.rows),o=d?.userId??"",r=d?.zeniSessionId??"",i=b??"";if(!o||!r||!i)return;const x=encodeURIComponent(JSON.stringify(e)),U=`${q}/tableDownload?query=${x}`;fetch(U,{headers:{"zeni-user-id":o,"zeni-session-id":r,"zeni-tenant-id":i}}).then(async l=>{if(!l.ok){const u=await l.text();throw new Error(`Download failed: ${l.status} ${u}`)}return l.blob()}).then(l=>{const u=URL.createObjectURL(l),S=document.createElement("a");S.href=u,S.download=`${e.file_name}.xlsx`,S.click(),URL.revokeObjectURL(u)}).catch(()=>{})}}),[t,A,d,b,n.rows]);f.useEffect(()=>{if(c.size===0)return;const e=new Set;for(const o of c){const r=n.rows.find(i=>i.tenantId===o);r!=null&&r.isAnalyzing?p.current.add(o):r!=null&&!r.isAnalyzing&&p.current.has(o)&&(e.add(o),p.current.delete(o))}e.size>0&&h(o=>{const r=new Set(o);for(const i of e)r.delete(i);return r})},[n.rows,c]);const w=f.useMemo(()=>({fetchState:n.fetchStatus.fetchState,rows:n.rows.map(e=>e.isAnalyzing||e.tenantId!=null&&c.has(e.tenantId)?{...e,isAnalyzing:!0}:e),uiState:n.uiState}),[n,c]);return d==null?s.jsx(oe,{children:V.getLocalizedStrings().cockpit.creditAgent.notSignedIn}):s.jsx(ae,{macroCombined:g,navigate:a,cardProfilesActions:z,cardProfilesData:w})}function ze(){const{isAllowed:a,isLoading:t}=D();return t?null:a?s.jsx(C,{children:s.jsx(I,{path:"/*",element:s.jsx(k,{element:s.jsx(re,{})})})}):s.jsx(C,{children:s.jsx(I,{path:"/*",element:s.jsx(R,{to:"/management",replace:!0})})})}export{ze as default};
4
+ `;function re(){const a=k(),t=v(),n=m(T),g=m(N),[c,h]=f.useState(new Set),p=f.useRef(new Set),b=m(e=>e.tenantState.currentTenantId),y=m(e=>e.companyViewState.zeniUsers.fetchState);f.useEffect(()=>{y==="Not-Started"&&t(M())},[t,y]);const d=J.getSignedInUser(),A=d!=null&&[d.firstName,d.lastName].filter(Boolean).join(" ")||void 0,z=f.useMemo(()=>({onFetch:()=>{t($())},onUpdateProfile:(e,o,r)=>{const i=r.updatedByName??A;t(_({tenantId:o,tenantEmailDomain:e,update:{...r,updatedByName:i}}))},onAnalyse:e=>{h(o=>new Set(o).add(e)),t(L(e))},onDownloadReport:()=>{const e=E(n.rows),o=d?.userId??"",r=d?.zeniSessionId??"",i=b??"";if(!o||!r||!i)return;const x=encodeURIComponent(JSON.stringify(e)),U=`${q}/tableDownload?query=${x}`;fetch(U,{headers:{"zeni-user-id":o,"zeni-session-id":r,"zeni-tenant-id":i}}).then(async l=>{if(!l.ok){const u=await l.text();throw new Error(`Download failed: ${l.status} ${u}`)}return l.blob()}).then(l=>{const u=URL.createObjectURL(l),S=document.createElement("a");S.href=u,S.download=`${e.file_name}.xlsx`,S.click(),URL.revokeObjectURL(u)}).catch(()=>{})}}),[t,A,d,b,n.rows]);f.useEffect(()=>{if(c.size===0)return;const e=new Set;for(const o of c){const r=n.rows.find(i=>i.tenantId===o);r!=null&&r.isAnalyzing?p.current.add(o):r!=null&&!r.isAnalyzing&&p.current.has(o)&&(e.add(o),p.current.delete(o))}e.size>0&&h(o=>{const r=new Set(o);for(const i of e)r.delete(i);return r})},[n.rows,c]);const w=f.useMemo(()=>({fetchState:n.fetchStatus.fetchState,rows:n.rows.map(e=>e.isAnalyzing||e.tenantId!=null&&c.has(e.tenantId)?{...e,isAnalyzing:!0}:e),uiState:n.uiState}),[n,c]);return d==null?s.jsx(oe,{children:V.getLocalizedStrings().cockpit.creditAgent.notSignedIn}):s.jsx(ae,{macroCombined:g,navigate:a,cardProfilesActions:z,cardProfilesData:w})}function ze(){const{isAllowed:a,isLoading:t}=D();return t?null:a?s.jsx(C,{children:s.jsx(I,{path:"/*",element:s.jsx(j,{element:s.jsx(re,{})})})}):s.jsx(C,{children:s.jsx(I,{path:"/*",element:s.jsx(R,{to:"/management",replace:!0})})})}export{ze as default};
@@ -1 +1 @@
1
- import{a as h,b as a}from"./sentry-DrJPfWXM.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="6d600b3f-6c40-4b9e-8892-371ff81f1c30",t._sentryDebugIdIdentifier="sentry-dbid-6d600b3f-6c40-4b9e-8892-371ff81f1c30")}catch{}})();const c="64px",f={},k=({src:t,light:n,oEmbedUrl:r,onClickPreview:s,playIcon:m,previewTabIndex:I,previewAriaLabel:u})=>{const[p,o]=h.useState(null);h.useEffect(()=>{!t||!n||!r||_({src:t,light:n,oEmbedUrl:r})},[t,n,r]);const _=async({src:e,light:i,oEmbedUrl:E})=>{if(a.isValidElement(i))return;if(typeof i=="string"){o(i);return}if(f[e]){o(f[e]);return}o(null);const b=await(await fetch(E.replace("{url}",e))).json();if(b.thumbnail_url){const g=b.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");o(g),f[e]=g}},w=e=>{(e.key==="Enter"||e.key===" ")&&s?.(e)},v=e=>{s?.(e)},l=a.isValidElement(n),y={display:"flex",alignItems:"center",justifyContent:"center"},d={preview:{width:"100%",height:"100%",backgroundImage:p&&!l?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:l?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},x=a.createElement("div",{style:d.shadow,className:"react-player__shadow"},a.createElement("div",{style:d.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:d.preview,className:"react-player__preview",tabIndex:I,onClick:v,onKeyDown:w,...u?{"aria-label":u}:{}},l?n:null,m||x)};var S=k;export{S as default};
1
+ import{a as h,b as a}from"./sentry-Cdl8_Foz.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="6d600b3f-6c40-4b9e-8892-371ff81f1c30",t._sentryDebugIdIdentifier="sentry-dbid-6d600b3f-6c40-4b9e-8892-371ff81f1c30")}catch{}})();const c="64px",f={},k=({src:t,light:n,oEmbedUrl:r,onClickPreview:s,playIcon:m,previewTabIndex:I,previewAriaLabel:u})=>{const[p,o]=h.useState(null);h.useEffect(()=>{!t||!n||!r||_({src:t,light:n,oEmbedUrl:r})},[t,n,r]);const _=async({src:e,light:i,oEmbedUrl:E})=>{if(a.isValidElement(i))return;if(typeof i=="string"){o(i);return}if(f[e]){o(f[e]);return}o(null);const b=await(await fetch(E.replace("{url}",e))).json();if(b.thumbnail_url){const g=b.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");o(g),f[e]=g}},w=e=>{(e.key==="Enter"||e.key===" ")&&s?.(e)},v=e=>{s?.(e)},l=a.isValidElement(n),y={display:"flex",alignItems:"center",justifyContent:"center"},d={preview:{width:"100%",height:"100%",backgroundImage:p&&!l?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:l?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},x=a.createElement("div",{style:d.shadow,className:"react-player__shadow"},a.createElement("div",{style:d.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:d.preview,className:"react-player__preview",tabIndex:I,onClick:v,onKeyDown:w,...u?{"aria-label":u}:{}},l?n:null,m||x)};var S=k;export{S as default};