@viswa-test/creative-workspace-ui-component 0.0.69 → 0.0.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),n=require("react"),i=require("lucide-react"),l=require("../styles/ReviewStatusStyles.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=t(n),r=function(e){var s=e.trim().split(/\s+/);return 1===s.length?s[0].slice(0,2).toUpperCase():(s[0][0]+s[s.length-1][0]).toUpperCase()},a=function(e){for(var s=[{bg:"#FEF9C3",fg:"#854D0E"},{bg:"#DCFCE7",fg:"#166534"},{bg:"#DBEAFE",fg:"#1E40AF"},{bg:"#F3E8FF",fg:"#6B21A8"},{bg:"#FFE4E6",fg:"#9F1239"},{bg:"#FEE2E2",fg:"#991B1B"},{bg:"#E0F2FE",fg:"#0369A1"}],n=0,i=0;i<e.length;i++)n=e.charCodeAt(i)+((n<<5)-n);return s[Math.abs(n)%s.length]},d=function(e){var s=(null==e?void 0:e.role)||(null==e?void 0:e.accessLevel);return"string"==typeof s&&s.trim()?s:"No role assigned"},p=function(e){return!0===e||("string"==typeof e?["approved","completed","complete","done","accepted"].includes(e.trim().toLowerCase()):!(!e||"object"!=typeof e)&&(p(e.approved)||p(e.status)||p(e.action)||p(e.value)))},c=function(e){return"string"==typeof e?["rejected","declined","denied"].includes(e.trim().toLowerCase()):!(!e||"object"!=typeof e)&&(c(e.rejected)||c(e.status)||c(e.action)||c(e.value))};function g(n){var l,t=n.reviewLevel,o=n.levelIndex,r=n.nextLevel,a=n.showApproveAndMoveToNextLevelButton,d=n.onApproveAndMoveToNextLevel,p=t.level,c=t.assigneeStatuses,g=t.extendedStatus,x=a&&"pending"===g&&!!d,_=null!==(l={approved:{bg:"#ECFDF5",color:"#059669",icon:s.jsx(i.Check,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:s.jsx(i.Hourglass,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(i.Hourglass,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:s.jsx(i.X,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:s.jsx(i.Info,{size:14}),text:"Optional"}}[g])&&void 0!==l?l:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(i.Hourglass,{size:14}),text:"Waiting"},f="approved"===g?"1px solid #D1FAE5":"rejected"===g?"1px solid #FCA5A5":"optional"===g?"1px dashed #CBD5E1":"1px solid #E5E7EB",h="approved"===g?"#F0FDF4":"rejected"===g?"#FEF2F2":"#F8FAFC";return!p.assignees||!Array.isArray(p.assignees)||p.assignees.length<1?null:s.jsxs("div",e.__assign({style:{backgroundColor:"#FFFFFF",border:f,borderRadius:"8px",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:h,borderBottom:f,padding:"12px 16px"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[s.jsx(v,{name:p.headerName}),s.jsx("span",e.__assign({style:{fontSize:15,fontWeight:500,color:"#374151"}},{children:p.title}))]})),s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"10px"}},{children:[x&&s.jsxs("button",e.__assign({type:"button",onClick:function(){return null==d?void 0:d({level:p,levelIndex:o,nextLevel:r})},style:{border:"1px solid #C7D2FE",backgroundColor:"#EEF2FF",color:"#4F46E5",borderRadius:"8px",padding:"6px 10px",fontSize:"12px",fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:"6px"}},{children:[s.jsx(i.Check,{size:13}),"Approve & Move to Next Level"]})),s.jsxs("div",e.__assign({style:{backgroundColor:_.bg,color:_.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[_.icon,_.text]}))]}))]})),s.jsx("div",e.__assign({style:{padding:"16px"}},{children:c.length>0?s.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:16}},{children:c.map(function(e,n){var i;return s.jsx(u,{assigneeStatus:e,extendedStatus:g},null!==(i=e.user.id)&&void 0!==i?i:n)})})):s.jsx("div",e.__assign({style:{fontSize:14,color:"#6B7280"}},{children:"No assignees added yet"}))}))]}))}function x(n){var l,t,o,p,c=n.reviewLevel,g=c.assigneeStatuses,x=c.extendedStatus,u=null!==(l={approved:{bg:"#ECFDF5",color:"#059669",icon:s.jsx(i.Check,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:s.jsx(i.Hourglass,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(i.Hourglass,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:s.jsx(i.X,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:s.jsx(i.Info,{size:14}),text:"Optional"}}[x])&&void 0!==l?l:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(i.Hourglass,{size:14}),text:"Waiting"},v=null===(t=g[0])||void 0===t?void 0:t.user;null==v||v.email;var _=d(v);return s.jsxs("div",e.__assign({style:{backgroundColor:"#FFFFFF",border:"1px solid #E5E7EB",borderRadius:"8px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[v?s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[s.jsx("div",e.__assign({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:a(null!==(o=v.id)&&void 0!==o?o:v.name).bg,color:a(null!==(p=v.id)&&void 0!==p?p:v.name).fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:"14px"}},{children:r(v.name)})),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[s.jsx("span",e.__assign({style:{fontSize:"15px",fontWeight:400,color:"#374151"}},{children:v.name})),s.jsxs("span",e.__assign({style:{fontSize:"13px",color:"#475569",fontWeight:500}},{children:["Role: ",_]})),s.jsx("span",e.__assign({style:{fontSize:"13px",color:"#6B7280"}},{children:"Will be notified after all levels approve"}))]}))]})):s.jsx("span",e.__assign({style:{fontSize:14,color:"#6B7280"}},{children:"No owner assigned"})),s.jsxs("div",e.__assign({style:{backgroundColor:u.bg,color:u.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[u.icon,u.text]}))]}))}function u(n){var l,t=n.assigneeStatus,o=n.extendedStatus,p=t.user,c=t.approved||"approved"===p.action,g=t.rejected||"rejected"===p.action,x=r(p.name),u=a(null!==(l=p.id)&&void 0!==l?l:p.name),v=d(p);return s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[s.jsx("div",e.__assign({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:u.bg,color:u.fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:"13px"}},{children:x})),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[s.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:400,color:"#374151"}},{children:p.name})),s.jsx("span",e.__assign({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:v}))]})),s.jsx("span",e.__assign({style:{fontSize:"13px",color:"#6B7280"}},{children:p.email}))]}))]})),s.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:c?s.jsx(i.CircleCheck,{size:20,color:"#16A34A",strokeWidth:1.5}):g?s.jsx(i.X,{size:20,color:"#DC2626",strokeWidth:1.5}):"pending"===o?s.jsxs(s.Fragment,{children:[s.jsx("span",{style:{fontSize:"13px",color:"#4B5563"}}),s.jsx(i.MinusCircle,{size:20,color:"#9CA3AF",strokeWidth:1.5})]}):"optional"===o?s.jsx(i.MinusCircle,{size:20,color:"#CBD5E1",strokeWidth:1.5}):s.jsx(i.MinusCircle,{size:20,color:"#9CA3AF",strokeWidth:1.5})}))]}))}function v(n){var i=n.name,l=a(i);return s.jsx("span",e.__assign({style:{backgroundColor:l.bg,color:l.fg,borderRadius:12,padding:"3px 10px",fontSize:12,fontWeight:500}},{children:i}))}var _=function(e){switch(e){case 0:return s.jsx(i.LucidePen,{size:16,color:"#475569"});case 1:return s.jsx(i.FileCheck,{size:16,color:"#475569"});case 2:return s.jsx(i.User,{size:16,color:"#475569"});default:return s.jsx(i.CheckCircle,{size:16,color:"#475569"})}};function f(n){var t=n.levels.filter(function(e){var s,n;return(null!==(n=null===(s=e.assignees)||void 0===s?void 0:s.length)&&void 0!==n?n:0)>0});return s.jsxs("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.flowBox},{children:[s.jsx("span",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.flowTitle},{children:"Current Approval Flow"})),t.length>0?s.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center",marginTop:6}},{children:t.map(function(n,r){var a,p=n.isHidden,c=!n.isMandatory&&!p,g=p?s.jsx(i.User,{size:16,color:"#475569"}):_(r);return s.jsxs(o.default.Fragment,{children:[s.jsxs("span",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_REVIEW_STATUS_STYLES.flowChip),{display:"flex",alignItems:"center",gap:"8px",border:c?"1px dashed #CBD5E1":void 0})},{children:[g,s.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"}},{children:[n.assignees.map(function(n,i){var l,t,r=d(n);return s.jsxs(o.default.Fragment,{children:[i>0&&s.jsx("span",e.__assign({style:{color:"#9CA3AF"}},{children:"/"})),s.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[s.jsx("span",e.__assign({style:{fontSize:13,color:c?"#64748B":"#374151"}},{children:n.name})),s.jsx("span",e.__assign({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:r}))]}))]},null!==(t=null!==(l=n.id)&&void 0!==l?l:n.email)&&void 0!==t?t:i)}),c&&s.jsx("span",e.__assign({style:{fontSize:12,color:"#64748B"}},{children:"Optional"}))]}))]})),r<t.length-1&&s.jsx(i.ArrowRight,{size:16,color:"#9CA3AF"})]},null!==(a=n.id)&&void 0!==a?a:"".concat(n.headerName,"-").concat(r))})})):s.jsx("p",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.flowEmpty},{children:"No owners assigned yet."}))]}))}exports.default=function(n){var t=n.levels,r=n.reviewData,a=void 0===r?{}:r,d=n.showApproveAndMoveToNextLevelButton,u=void 0!==d&&d,v=n.onApproveAndMoveToNextLevel,_=t.map(function(e,s){var n,i,l,t,o,r,d,g,x=null!==(d=null!==(l=null!==(i=null!==(n=a[s])&&void 0!==n?n:a[e.headerName])&&void 0!==i?i:a[e.title])&&void 0!==l?l:e.isHidden?null!==(r=null!==(o=null!==(t=a.final)&&void 0!==t?t:a.Final)&&void 0!==o?o:a.finalApproval)&&void 0!==r?r:a.final_approval:void 0)&&void 0!==d?d:{},u=x&&"object"==typeof x?x:{},v=(null!==(g=e.assignees)&&void 0!==g?g:[]).map(function(s){var n,i,l,t,o,r,a=null!==(i=null!==(n=u[String(s.id)])&&void 0!==n?n:u[String(s.email)])&&void 0!==i?i:e.isHidden?null!==(r=null!==(o=null!==(t=null!==(l=u.owner)&&void 0!==l?l:u.final)&&void 0!==t?t:u.finalApproval)&&void 0!==o?o:u.final_approval)&&void 0!==r?r:x:void 0;return{user:s,approved:p(a)||p(s.action)||p(s.status)||p(s.approved)||p(s.isApproved),rejected:c(a)||c(s.action)||c(s.status)||c(s.rejected)||c(s.isRejected)}}),_="not_started";if(p(x)||p(e.isApproved)||p(e.approved))_="approved";else if(c(x)||c(e.isRejected)||c(e.rejected))_="rejected";else if(p(e.status))_="approved";else if(c(e.status))_="rejected";else{var f=v.length>0&&v.every(function(e){return e.approved}),h=v.some(function(e){return e.rejected});f?_="approved":h&&(_="rejected")}return{level:e,assigneeStatuses:v,status:_}}),h=!1,j=_.map(function(s){var n="waiting",i=!0===s.level.isHidden;return"approved"===s.status?n="approved":"rejected"===s.status?(n="rejected",h=!0):s.level.isMandatory||i?h||(n="pending",h=!0):n="optional",e.__assign(e.__assign({},s),{extendedStatus:n,isFinalApproval:i})}),F=function(e){return e.filter(function(e){return"approved"===e.status}).length}(_),y=_.length;return s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:24}},{children:[s.jsxs("div",{children:[s.jsxs("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressHeader},{children:[s.jsx("span",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressTitle},{children:"Approval Progress"})),s.jsxs("span",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressCount},{children:[F," of ",y," level",1!==y?"s":""," complete"]}))]})),s.jsx("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressBarTrack},{children:j.map(function(n,i){var t,o="approved"===n.extendedStatus,r="rejected"===n.extendedStatus,a="optional"===n.extendedStatus,d=0===i,p=i===y-1;return!(null===(t=n.level)||void 0===t?void 0:t.assignees)||!Array.isArray(n.level.assignees)||n.level.assignees.length<1?null:s.jsx("div",{style:e.__assign(e.__assign({},l.DEFAULT_REVIEW_STATUS_STYLES.progressSegment),{backgroundColor:o?"#6366F1":r?"#EF4444":a?"#F1F5F9":"#E5E7EB",borderRadius:d&&p?"999px":d?"999px 0 0 999px":p?"0 999px 999px 0":"0",marginRight:p?0:3})},i)})})),s.jsx("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressLabels},{children:j.map(function(n,i){return s.jsx("span",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_REVIEW_STATUS_STYLES.progressLabel),{color:"approved"===n.extendedStatus?"#6366F1":"rejected"===n.extendedStatus?"#EF4444":"#9CA3AF",fontWeight:"approved"===n.extendedStatus||"rejected"===n.extendedStatus?600:400})},{children:n.level.assignees&&n.level.assignees.length>0?"".concat(n.level.headerName," - ").concat(n.level.title):""}),i)})}))]}),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:0}},{children:[s.jsx("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.sectionHeadingRow},{children:s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6}},{children:[s.jsx("span",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.sectionTitle},{children:"Approval Levels"})),s.jsx(i.Info,{size:15,color:"#9CA3AF"})]}))})),s.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",marginTop:12}},{children:j.map(function(n,i){var l,t,r=i===j.length-1,a=n.isFinalApproval,d=j[i+1],p=null==d?void 0:d.isFinalApproval,c=d&&!d.level.isMandatory&&!p;return a?s.jsxs(o.default.Fragment,{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",margin:"16px 0"}},{children:[s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),s.jsx("span",e.__assign({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:"then"})),s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]})),s.jsx("div",e.__assign({style:{marginBottom:"12px",fontSize:"15px",fontWeight:500,color:"#6B7280"}},{children:"Final Approval"})),s.jsx(x,{reviewLevel:n})]},i):s.jsxs(o.default.Fragment,{children:[s.jsx(g,{reviewLevel:n,levelIndex:i,nextLevel:null!==(l=null==d?void 0:d.level)&&void 0!==l?l:null,showApproveAndMoveToNextLevelButton:u,onApproveAndMoveToNextLevel:v}),!r&&!p&&d.level.assignees&&(null===(t=d.level.assignees)||void 0===t?void 0:t.length)>0&&s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",margin:"20px 0"}},{children:[s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),s.jsx("span",e.__assign({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:c?"optional":"then"})),s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]}))]},i)})}))]})),s.jsx(f,{levels:t})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),n=require("react"),i=require("lucide-react"),l=require("../styles/ReviewStatusStyles.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=t(n),r=function(e){var s=e.trim().split(/\s+/);return 1===s.length?s[0].slice(0,2).toUpperCase():(s[0][0]+s[s.length-1][0]).toUpperCase()},a=function(e){for(var s=[{bg:"#FEF9C3",fg:"#854D0E"},{bg:"#DCFCE7",fg:"#166534"},{bg:"#DBEAFE",fg:"#1E40AF"},{bg:"#F3E8FF",fg:"#6B21A8"},{bg:"#FFE4E6",fg:"#9F1239"},{bg:"#FEE2E2",fg:"#991B1B"},{bg:"#E0F2FE",fg:"#0369A1"}],n=0,i=0;i<e.length;i++)n=e.charCodeAt(i)+((n<<5)-n);return s[Math.abs(n)%s.length]},d=function(e){var s=(null==e?void 0:e.role)||(null==e?void 0:e.accessLevel);return"string"==typeof s&&s.trim()?s:"No role assigned"},p=function(e){return!0===e||("string"==typeof e?["approved","completed","complete","done","accepted"].includes(e.trim().toLowerCase()):!(!e||"object"!=typeof e)&&(p(e.approved)||p(e.status)||p(e.action)||p(e.value)))},c=function(e){return"string"==typeof e?["rejected","declined","denied"].includes(e.trim().toLowerCase()):!(!e||"object"!=typeof e)&&(c(e.rejected)||c(e.status)||c(e.action)||c(e.value))};function g(n){var l,t=n.reviewLevel,o=n.levelIndex,r=n.nextLevel,a=n.showApproveAndMoveToNextLevelButton,d=n.onApproveAndMoveToNextLevel,p=t.level,c=t.assigneeStatuses,g=t.extendedStatus,x=a&&"pending"===g&&!!d,_=null!==(l={approved:{bg:"#ECFDF5",color:"#059669",icon:s.jsx(i.Check,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:s.jsx(i.Hourglass,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(i.Hourglass,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:s.jsx(i.X,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:s.jsx(i.Info,{size:14}),text:"Optional"}}[g])&&void 0!==l?l:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(i.Hourglass,{size:14}),text:"Waiting"},f="approved"===g?"1px solid #D1FAE5":"rejected"===g?"1px solid #FCA5A5":"optional"===g?"1px dashed #CBD5E1":"1px solid #E5E7EB",h="approved"===g?"#F0FDF4":"rejected"===g?"#FEF2F2":"#F8FAFC";return!p.assignees||!Array.isArray(p.assignees)||p.assignees.length<1?null:s.jsxs("div",e.__assign({style:{backgroundColor:"#FFFFFF",border:f,borderRadius:"8px",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:h,borderBottom:f,padding:"12px 16px"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[s.jsx(v,{name:p.headerName}),s.jsx("span",e.__assign({style:{fontSize:15,fontWeight:500,color:"#374151"}},{children:p.title}))]})),s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"10px"}},{children:[x&&s.jsxs("button",e.__assign({type:"button",onClick:function(){return null==d?void 0:d({level:p,levelIndex:o,nextLevel:r})},style:{border:"1px solid #C7D2FE",backgroundColor:"#EEF2FF",color:"#4F46E5",borderRadius:"8px",padding:"6px 10px",fontSize:"12px",fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:"6px"}},{children:[s.jsx(i.Check,{size:13}),"Approve & Move to Next Level"]})),s.jsxs("div",e.__assign({style:{backgroundColor:_.bg,color:_.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[_.icon,_.text]}))]}))]})),s.jsx("div",e.__assign({style:{padding:"16px"}},{children:c.length>0?s.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:16}},{children:c.map(function(e,n){var i;return s.jsx(u,{assigneeStatus:e,extendedStatus:g},null!==(i=e.user.id)&&void 0!==i?i:n)})})):s.jsx("div",e.__assign({style:{fontSize:14,color:"#6B7280"}},{children:"No assignees added yet"}))}))]}))}function x(n){var l,t,o,p,c=n.reviewLevel,g=c.assigneeStatuses,x=c.extendedStatus,u=null!==(l={approved:{bg:"#ECFDF5",color:"#059669",icon:s.jsx(i.Check,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:s.jsx(i.Hourglass,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(i.Hourglass,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:s.jsx(i.X,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:s.jsx(i.Info,{size:14}),text:"Optional"}}[x])&&void 0!==l?l:{bg:"#F3F4F6",color:"#4B5563",icon:s.jsx(i.Hourglass,{size:14}),text:"Waiting"},v=null===(t=g[0])||void 0===t?void 0:t.user;null==v||v.email;var _=d(v);return s.jsxs("div",e.__assign({style:{backgroundColor:"#FFFFFF",border:"1px solid #E5E7EB",borderRadius:"8px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[v?s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[s.jsx("div",e.__assign({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:a(null!==(o=v.id)&&void 0!==o?o:v.name).bg,color:a(null!==(p=v.id)&&void 0!==p?p:v.name).fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:"14px"}},{children:r(v.name)})),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[s.jsx("span",e.__assign({style:{fontSize:"15px",fontWeight:400,color:"#374151"}},{children:v.name})),s.jsxs("span",e.__assign({style:{fontSize:"13px",color:"#475569",fontWeight:500}},{children:["Role: ",_]})),s.jsx("span",e.__assign({style:{fontSize:"13px",color:"#6B7280"}},{children:"Will be notified after all levels approve"}))]}))]})):s.jsx("span",e.__assign({style:{fontSize:14,color:"#6B7280"}},{children:"No owner assigned"})),s.jsxs("div",e.__assign({style:{backgroundColor:u.bg,color:u.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[u.icon,u.text]}))]}))}function u(n){var l,t=n.assigneeStatus,o=n.extendedStatus,p=t.user,c=t.approved||"approved"===p.action,g=t.rejected||"rejected"===p.action,x=r(p.name),u=a(null!==(l=p.id)&&void 0!==l?l:p.name),v=d(p);return s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[s.jsx("div",e.__assign({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:u.bg,color:u.fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:"13px"}},{children:x})),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[s.jsx("span",e.__assign({style:{fontSize:"14px",fontWeight:400,color:"#374151"}},{children:p.name})),s.jsx("span",e.__assign({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:v}))]})),s.jsx("span",e.__assign({style:{fontSize:"13px",color:"#6B7280"}},{children:p.email}))]}))]})),s.jsx("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:c?s.jsx(i.CircleCheck,{size:20,color:"#16A34A",strokeWidth:1.5}):g?s.jsx(i.X,{size:20,color:"#DC2626",strokeWidth:1.5}):"pending"===o?s.jsxs(s.Fragment,{children:[s.jsx("span",{style:{fontSize:"13px",color:"#4B5563"}}),s.jsx(i.MinusCircle,{size:20,color:"#9CA3AF",strokeWidth:1.5})]}):"optional"===o?s.jsx(i.MinusCircle,{size:20,color:"#CBD5E1",strokeWidth:1.5}):s.jsx(i.MinusCircle,{size:20,color:"#9CA3AF",strokeWidth:1.5})}))]}))}function v(n){var i=n.name,l=a(i);return s.jsx("span",e.__assign({style:{backgroundColor:l.bg,color:l.fg,borderRadius:12,padding:"3px 10px",fontSize:12,fontWeight:500}},{children:i}))}var _=function(e){switch(e){case 0:return s.jsx(i.LucidePen,{size:16,color:"#475569"});case 1:return s.jsx(i.FileCheck,{size:16,color:"#475569"});case 2:return s.jsx(i.User,{size:16,color:"#475569"});default:return s.jsx(i.CheckCircle,{size:16,color:"#475569"})}};function f(n){var t=n.levels.filter(function(e){var s,n;return(null!==(n=null===(s=e.assignees)||void 0===s?void 0:s.length)&&void 0!==n?n:0)>0});return s.jsxs("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.flowBox},{children:[s.jsx("span",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.flowTitle},{children:"Current Approval Flow"})),t.length>0?s.jsx("div",e.__assign({style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center",marginTop:6}},{children:t.map(function(n,r){var a,p=n.isHidden,c=!n.isMandatory&&!p,g=p?s.jsx(i.User,{size:16,color:"#475569"}):_(r);return s.jsxs(o.default.Fragment,{children:[s.jsxs("span",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_REVIEW_STATUS_STYLES.flowChip),{display:"flex",alignItems:"center",gap:"8px",border:c?"1px dashed #CBD5E1":void 0})},{children:[g,s.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"}},{children:[n.assignees.map(function(n,i){var l,t,r=d(n);return s.jsxs(o.default.Fragment,{children:[i>0&&s.jsx("span",e.__assign({style:{color:"#9CA3AF"}},{children:"/"})),s.jsxs("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[s.jsx("span",e.__assign({style:{fontSize:13,color:c?"#64748B":"#374151"}},{children:n.name})),s.jsx("span",e.__assign({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:r}))]}))]},null!==(t=null!==(l=n.id)&&void 0!==l?l:n.email)&&void 0!==t?t:i)}),c&&s.jsx("span",e.__assign({style:{fontSize:12,color:"#64748B"}},{children:"Optional"}))]}))]})),r<t.length-1&&s.jsx(i.ArrowRight,{size:16,color:"#9CA3AF"})]},null!==(a=n.id)&&void 0!==a?a:"".concat(n.headerName,"-").concat(r))})})):s.jsx("p",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.flowEmpty},{children:"No owners assigned yet."}))]}))}exports.default=function(n){var t=n.levels,r=n.reviewData,a=void 0===r?{}:r,d=n.showApproveAndMoveToNextLevelButton,u=void 0!==d&&d,v=n.onApproveAndMoveToNextLevel,_=t.map(function(e,s){return{level:e,originalLevelIndex:s}}).filter(function(e){return function(e){var s=null==e?void 0:e.assignees;return Array.isArray(s)&&s.length>0}(e.level)}).map(function(e,s){var n,i,l,t,o,r,d,g,x,u=e.level,v=e.originalLevelIndex,_=null!==(g=null!==(t=null!==(l=null!==(i=null!==(n=a[v])&&void 0!==n?n:a[s])&&void 0!==i?i:a[u.headerName])&&void 0!==l?l:a[u.title])&&void 0!==t?t:u.isHidden?null!==(d=null!==(r=null!==(o=a.final)&&void 0!==o?o:a.Final)&&void 0!==r?r:a.finalApproval)&&void 0!==d?d:a.final_approval:void 0)&&void 0!==g?g:{},f=_&&"object"==typeof _?_:{},h=(null!==(x=u.assignees)&&void 0!==x?x:[]).map(function(e){var s,n,i,l,t,o,r=null!==(n=null!==(s=f[String(e.id)])&&void 0!==s?s:f[String(e.email)])&&void 0!==n?n:u.isHidden?null!==(o=null!==(t=null!==(l=null!==(i=f.owner)&&void 0!==i?i:f.final)&&void 0!==l?l:f.finalApproval)&&void 0!==t?t:f.final_approval)&&void 0!==o?o:_:void 0;return{user:e,approved:p(r)||p(e.action)||p(e.status)||p(e.approved)||p(e.isApproved),rejected:c(r)||c(e.action)||c(e.status)||c(e.rejected)||c(e.isRejected)}}),j="not_started";if(p(_)||p(u.isApproved)||p(u.approved))j="approved";else if(c(_)||c(u.isRejected)||c(u.rejected))j="rejected";else if(p(u.status))j="approved";else if(c(u.status))j="rejected";else{var F=h.length>0&&h.every(function(e){return e.approved}),y=h.some(function(e){return e.rejected});F?j="approved":y&&(j="rejected")}return{level:u,assigneeStatuses:h,status:j,originalLevelIndex:v}}),h=!1,j=_.map(function(s){var n="waiting",i=!0===s.level.isHidden;return"approved"===s.status?n="approved":"rejected"===s.status?(n="rejected",h=!0):s.level.isMandatory||i?h||(n="pending",h=!0):n="optional",e.__assign(e.__assign({},s),{extendedStatus:n,isFinalApproval:i})}),F=function(e){return e.filter(function(e){return"approved"===e.status}).length}(_),y=_.length;return s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:24}},{children:[s.jsxs("div",{children:[s.jsxs("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressHeader},{children:[s.jsx("span",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressTitle},{children:"Approval Progress"})),s.jsxs("span",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressCount},{children:[F," of ",y," level",1!==y?"s":""," complete"]}))]})),s.jsx("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressBarTrack},{children:j.map(function(n,i){var t="approved"===n.extendedStatus,o="rejected"===n.extendedStatus,r="optional"===n.extendedStatus,a=0===i,d=i===y-1;return s.jsx("div",{style:e.__assign(e.__assign({},l.DEFAULT_REVIEW_STATUS_STYLES.progressSegment),{backgroundColor:t?"#6366F1":o?"#EF4444":r?"#F1F5F9":"#E5E7EB",borderRadius:a&&d?"999px":a?"999px 0 0 999px":d?"0 999px 999px 0":"0",marginRight:d?0:3})},i)})})),s.jsx("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.progressLabels},{children:j.map(function(n,i){return s.jsx("span",e.__assign({style:e.__assign(e.__assign({},l.DEFAULT_REVIEW_STATUS_STYLES.progressLabel),{color:"approved"===n.extendedStatus?"#6366F1":"rejected"===n.extendedStatus?"#EF4444":"#9CA3AF",fontWeight:"approved"===n.extendedStatus||"rejected"===n.extendedStatus?600:400})},{children:n.level.assignees&&n.level.assignees.length>0?"".concat(n.level.headerName," - ").concat(n.level.title):""}),i)})}))]}),s.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:0}},{children:[s.jsx("div",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.sectionHeadingRow},{children:s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6}},{children:[s.jsx("span",e.__assign({style:l.DEFAULT_REVIEW_STATUS_STYLES.sectionTitle},{children:"Approval Levels"})),s.jsx(i.Info,{size:15,color:"#9CA3AF"})]}))})),s.jsx("div",e.__assign({style:{display:"flex",flexDirection:"column",marginTop:12}},{children:j.map(function(n,i){var l,t,r=i===j.length-1,a=n.isFinalApproval,d=j[i+1],p=null==d?void 0:d.isFinalApproval,c=d&&!d.level.isMandatory&&!p;return a?s.jsxs(o.default.Fragment,{children:[s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",margin:"16px 0"}},{children:[s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),s.jsx("span",e.__assign({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:"then"})),s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]})),s.jsx("div",e.__assign({style:{marginBottom:"12px",fontSize:"15px",fontWeight:500,color:"#6B7280"}},{children:"Final Approval"})),s.jsx(x,{reviewLevel:n})]},i):s.jsxs(o.default.Fragment,{children:[s.jsx(g,{reviewLevel:n,levelIndex:n.originalLevelIndex,nextLevel:null!==(l=null==d?void 0:d.level)&&void 0!==l?l:null,showApproveAndMoveToNextLevelButton:u,onApproveAndMoveToNextLevel:v}),!r&&!p&&d.level.assignees&&(null===(t=d.level.assignees)||void 0===t?void 0:t.length)>0&&s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",margin:"20px 0"}},{children:[s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),s.jsx("span",e.__assign({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:c?"optional":"then"})),s.jsx("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]}))]},i)})}))]})),s.jsx(f,{levels:t})]}))};
2
2
  //# sourceMappingURL=ReviewStatus.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"../../../_virtual/_tslib.js";import{jsxs as l,jsx as n,Fragment as t}from"react/jsx-runtime";import i from"react";import{Info as o,Check as r,Hourglass as d,X as s,CircleCheck as a,MinusCircle as p,User as c,ArrowRight as v,CheckCircle as g,FileCheck as u,LucidePen as x}from"lucide-react";import{DEFAULT_REVIEW_STATUS_STYLES as f}from"../styles/ReviewStatusStyles.js";var h=function(e){var l=e.trim().split(/\s+/);return 1===l.length?l[0].slice(0,2).toUpperCase():(l[0][0]+l[l.length-1][0]).toUpperCase()},y=function(e){for(var l=[{bg:"#FEF9C3",fg:"#854D0E"},{bg:"#DCFCE7",fg:"#166534"},{bg:"#DBEAFE",fg:"#1E40AF"},{bg:"#F3E8FF",fg:"#6B21A8"},{bg:"#FFE4E6",fg:"#9F1239"},{bg:"#FEE2E2",fg:"#991B1B"},{bg:"#E0F2FE",fg:"#0369A1"}],n=0,t=0;t<e.length;t++)n=e.charCodeAt(t)+((n<<5)-n);return l[Math.abs(n)%l.length]},F=function(e){var l=(null==e?void 0:e.role)||(null==e?void 0:e.accessLevel);return"string"==typeof l&&l.trim()?l:"No role assigned"},m=function(e){return!0===e||("string"==typeof e?["approved","completed","complete","done","accepted"].includes(e.trim().toLowerCase()):!(!e||"object"!=typeof e)&&(m(e.approved)||m(e.status)||m(e.action)||m(e.value)))},b=function(e){return"string"==typeof e?["rejected","declined","denied"].includes(e.trim().toLowerCase()):!(!e||"object"!=typeof e)&&(b(e.rejected)||b(e.status)||b(e.action)||b(e.value))};function E(t){var r=t.levels,d=t.reviewData,s=void 0===d?{}:d,a=t.showApproveAndMoveToNextLevelButton,p=void 0!==a&&a,c=t.onApproveAndMoveToNextLevel,v=r.map(function(e,l){var n,t,i,o,r,d,a,p,c=null!==(a=null!==(i=null!==(t=null!==(n=s[l])&&void 0!==n?n:s[e.headerName])&&void 0!==t?t:s[e.title])&&void 0!==i?i:e.isHidden?null!==(d=null!==(r=null!==(o=s.final)&&void 0!==o?o:s.Final)&&void 0!==r?r:s.finalApproval)&&void 0!==d?d:s.final_approval:void 0)&&void 0!==a?a:{},v=c&&"object"==typeof c?c:{},g=(null!==(p=e.assignees)&&void 0!==p?p:[]).map(function(l){var n,t,i,o,r,d,s=null!==(t=null!==(n=v[String(l.id)])&&void 0!==n?n:v[String(l.email)])&&void 0!==t?t:e.isHidden?null!==(d=null!==(r=null!==(o=null!==(i=v.owner)&&void 0!==i?i:v.final)&&void 0!==o?o:v.finalApproval)&&void 0!==r?r:v.final_approval)&&void 0!==d?d:c:void 0;return{user:l,approved:m(s)||m(l.action)||m(l.status)||m(l.approved)||m(l.isApproved),rejected:b(s)||b(l.action)||b(l.status)||b(l.rejected)||b(l.isRejected)}}),u="not_started";if(m(c)||m(e.isApproved)||m(e.approved))u="approved";else if(b(c)||b(e.isRejected)||b(e.rejected))u="rejected";else if(m(e.status))u="approved";else if(b(e.status))u="rejected";else{var x=g.length>0&&g.every(function(e){return e.approved}),f=g.some(function(e){return e.rejected});x?u="approved":f&&(u="rejected")}return{level:e,assigneeStatuses:g,status:u}}),g=!1,u=v.map(function(l){var n="waiting",t=!0===l.level.isHidden;return"approved"===l.status?n="approved":"rejected"===l.status?(n="rejected",g=!0):l.level.isMandatory||t?g||(n="pending",g=!0):n="optional",e(e({},l),{extendedStatus:n,isFinalApproval:t})}),x=function(e){return e.filter(function(e){return"approved"===e.status}).length}(v),h=v.length;return l("div",e({style:{display:"flex",flexDirection:"column",gap:24}},{children:[l("div",{children:[l("div",e({style:f.progressHeader},{children:[n("span",e({style:f.progressTitle},{children:"Approval Progress"})),l("span",e({style:f.progressCount},{children:[x," of ",h," level",1!==h?"s":""," complete"]}))]})),n("div",e({style:f.progressBarTrack},{children:u.map(function(l,t){var i,o="approved"===l.extendedStatus,r="rejected"===l.extendedStatus,d="optional"===l.extendedStatus,s=0===t,a=t===h-1;return!(null===(i=l.level)||void 0===i?void 0:i.assignees)||!Array.isArray(l.level.assignees)||l.level.assignees.length<1?null:n("div",{style:e(e({},f.progressSegment),{backgroundColor:o?"#6366F1":r?"#EF4444":d?"#F1F5F9":"#E5E7EB",borderRadius:s&&a?"999px":s?"999px 0 0 999px":a?"0 999px 999px 0":"0",marginRight:a?0:3})},t)})})),n("div",e({style:f.progressLabels},{children:u.map(function(l,t){return n("span",e({style:e(e({},f.progressLabel),{color:"approved"===l.extendedStatus?"#6366F1":"rejected"===l.extendedStatus?"#EF4444":"#9CA3AF",fontWeight:"approved"===l.extendedStatus||"rejected"===l.extendedStatus?600:400})},{children:l.level.assignees&&l.level.assignees.length>0?"".concat(l.level.headerName," - ").concat(l.level.title):""}),t)})}))]}),l("div",e({style:{display:"flex",flexDirection:"column",gap:0}},{children:[n("div",e({style:f.sectionHeadingRow},{children:l("div",e({style:{display:"flex",alignItems:"center",gap:6}},{children:[n("span",e({style:f.sectionTitle},{children:"Approval Levels"})),n(o,{size:15,color:"#9CA3AF"})]}))})),n("div",e({style:{display:"flex",flexDirection:"column",marginTop:12}},{children:u.map(function(t,o){var r,d,s=o===u.length-1,a=t.isFinalApproval,v=u[o+1],g=null==v?void 0:v.isFinalApproval,x=v&&!v.level.isMandatory&&!g;return l(i.Fragment,a?{children:[l("div",e({style:{display:"flex",alignItems:"center",margin:"16px 0"}},{children:[n("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),n("span",e({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:"then"})),n("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]})),n("div",e({style:{marginBottom:"12px",fontSize:"15px",fontWeight:500,color:"#6B7280"}},{children:"Final Approval"})),n(A,{reviewLevel:t})]}:{children:[n(C,{reviewLevel:t,levelIndex:o,nextLevel:null!==(r=null==v?void 0:v.level)&&void 0!==r?r:null,showApproveAndMoveToNextLevelButton:p,onApproveAndMoveToNextLevel:c}),!s&&!g&&v.level.assignees&&(null===(d=v.level.assignees)||void 0===d?void 0:d.length)>0&&l("div",e({style:{display:"flex",alignItems:"center",margin:"20px 0"}},{children:[n("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),n("span",e({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:x?"optional":"then"})),n("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]}))]},o)})}))]})),n(j,{levels:r})]}))}function C(t){var i,a=t.reviewLevel,p=t.levelIndex,c=t.nextLevel,v=t.showApproveAndMoveToNextLevelButton,g=t.onApproveAndMoveToNextLevel,u=a.level,x=a.assigneeStatuses,f=a.extendedStatus,h=v&&"pending"===f&&!!g,y=null!==(i={approved:{bg:"#ECFDF5",color:"#059669",icon:n(r,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:n(d,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:n(d,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:n(s,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:n(o,{size:14}),text:"Optional"}}[f])&&void 0!==i?i:{bg:"#F3F4F6",color:"#4B5563",icon:n(d,{size:14}),text:"Waiting"},F="approved"===f?"1px solid #D1FAE5":"rejected"===f?"1px solid #FCA5A5":"optional"===f?"1px dashed #CBD5E1":"1px solid #E5E7EB",m="approved"===f?"#F0FDF4":"rejected"===f?"#FEF2F2":"#F8FAFC";return!u.assignees||!Array.isArray(u.assignees)||u.assignees.length<1?null:l("div",e({style:{backgroundColor:"#FFFFFF",border:F,borderRadius:"8px",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[l("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:m,borderBottom:F,padding:"12px 16px"}},{children:[l("div",e({style:{display:"flex",alignItems:"center",gap:10}},{children:[n(S,{name:u.headerName}),n("span",e({style:{fontSize:15,fontWeight:500,color:"#374151"}},{children:u.title}))]})),l("div",e({style:{display:"flex",alignItems:"center",gap:"10px"}},{children:[h&&l("button",e({type:"button",onClick:function(){return null==g?void 0:g({level:u,levelIndex:p,nextLevel:c})},style:{border:"1px solid #C7D2FE",backgroundColor:"#EEF2FF",color:"#4F46E5",borderRadius:"8px",padding:"6px 10px",fontSize:"12px",fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:"6px"}},{children:[n(r,{size:13}),"Approve & Move to Next Level"]})),l("div",e({style:{backgroundColor:y.bg,color:y.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[y.icon,y.text]}))]}))]})),n("div",e({style:{padding:"16px"}},{children:x.length>0?n("div",e({style:{display:"flex",flexDirection:"column",gap:16}},{children:x.map(function(e,l){var t;return n(z,{assigneeStatus:e,extendedStatus:f},null!==(t=e.user.id)&&void 0!==t?t:l)})})):n("div",e({style:{fontSize:14,color:"#6B7280"}},{children:"No assignees added yet"}))}))]}))}function A(t){var i,a,p,c,v=t.reviewLevel,g=v.assigneeStatuses,u=v.extendedStatus,x=null!==(i={approved:{bg:"#ECFDF5",color:"#059669",icon:n(r,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:n(d,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:n(d,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:n(s,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:n(o,{size:14}),text:"Optional"}}[u])&&void 0!==i?i:{bg:"#F3F4F6",color:"#4B5563",icon:n(d,{size:14}),text:"Waiting"},f=null===(a=g[0])||void 0===a?void 0:a.user;null==f||f.email;var m=F(f);return l("div",e({style:{backgroundColor:"#FFFFFF",border:"1px solid #E5E7EB",borderRadius:"8px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[f?l("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[n("div",e({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:y(null!==(p=f.id)&&void 0!==p?p:f.name).bg,color:y(null!==(c=f.id)&&void 0!==c?c:f.name).fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:"14px"}},{children:h(f.name)})),l("div",e({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[n("span",e({style:{fontSize:"15px",fontWeight:400,color:"#374151"}},{children:f.name})),l("span",e({style:{fontSize:"13px",color:"#475569",fontWeight:500}},{children:["Role: ",m]})),n("span",e({style:{fontSize:"13px",color:"#6B7280"}},{children:"Will be notified after all levels approve"}))]}))]})):n("span",e({style:{fontSize:14,color:"#6B7280"}},{children:"No owner assigned"})),l("div",e({style:{backgroundColor:x.bg,color:x.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[x.icon,x.text]}))]}))}function z(i){var o,r=i.assigneeStatus,d=i.extendedStatus,c=r.user,v=r.approved||"approved"===c.action,g=r.rejected||"rejected"===c.action,u=h(c.name),x=y(null!==(o=c.id)&&void 0!==o?o:c.name),f=F(c);return l("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[l("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[n("div",e({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:x.bg,color:x.fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:"13px"}},{children:u})),l("div",e({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[l("div",e({style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[n("span",e({style:{fontSize:"14px",fontWeight:400,color:"#374151"}},{children:c.name})),n("span",e({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:f}))]})),n("span",e({style:{fontSize:"13px",color:"#6B7280"}},{children:c.email}))]}))]})),n("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:v?n(a,{size:20,color:"#16A34A",strokeWidth:1.5}):g?n(s,{size:20,color:"#DC2626",strokeWidth:1.5}):"pending"===d?l(t,{children:[n("span",{style:{fontSize:"13px",color:"#4B5563"}}),n(p,{size:20,color:"#9CA3AF",strokeWidth:1.5})]}):n(p,"optional"===d?{size:20,color:"#CBD5E1",strokeWidth:1.5}:{size:20,color:"#9CA3AF",strokeWidth:1.5})}))]}))}function S(l){var t=l.name,i=y(t);return n("span",e({style:{backgroundColor:i.bg,color:i.fg,borderRadius:12,padding:"3px 10px",fontSize:12,fontWeight:500}},{children:t}))}var B=function(e){switch(e){case 0:return n(x,{size:16,color:"#475569"});case 1:return n(u,{size:16,color:"#475569"});case 2:return n(c,{size:16,color:"#475569"});default:return n(g,{size:16,color:"#475569"})}};function j(t){var o=t.levels.filter(function(e){var l,n;return(null!==(n=null===(l=e.assignees)||void 0===l?void 0:l.length)&&void 0!==n?n:0)>0});return l("div",e({style:f.flowBox},{children:[n("span",e({style:f.flowTitle},{children:"Current Approval Flow"})),o.length>0?n("div",e({style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center",marginTop:6}},{children:o.map(function(t,r){var d,s=t.isHidden,a=!t.isMandatory&&!s,p=s?n(c,{size:16,color:"#475569"}):B(r);return l(i.Fragment,{children:[l("span",e({style:e(e({},f.flowChip),{display:"flex",alignItems:"center",gap:"8px",border:a?"1px dashed #CBD5E1":void 0})},{children:[p,l("span",e({style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"}},{children:[t.assignees.map(function(t,o){var r,d,s=F(t);return l(i.Fragment,{children:[o>0&&n("span",e({style:{color:"#9CA3AF"}},{children:"/"})),l("span",e({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[n("span",e({style:{fontSize:13,color:a?"#64748B":"#374151"}},{children:t.name})),n("span",e({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:s}))]}))]},null!==(d=null!==(r=t.id)&&void 0!==r?r:t.email)&&void 0!==d?d:o)}),a&&n("span",e({style:{fontSize:12,color:"#64748B"}},{children:"Optional"}))]}))]})),r<o.length-1&&n(v,{size:16,color:"#9CA3AF"})]},null!==(d=t.id)&&void 0!==d?d:"".concat(t.headerName,"-").concat(r))})})):n("p",e({style:f.flowEmpty},{children:"No owners assigned yet."}))]}))}export{E as default};
1
+ import{__assign as e}from"../../../_virtual/_tslib.js";import{jsxs as n,jsx as l,Fragment as t}from"react/jsx-runtime";import i from"react";import{Info as o,Check as r,Hourglass as d,X as a,CircleCheck as s,MinusCircle as p,User as c,ArrowRight as v,CheckCircle as g,FileCheck as u,LucidePen as x}from"lucide-react";import{DEFAULT_REVIEW_STATUS_STYLES as f}from"../styles/ReviewStatusStyles.js";var h=function(e){var n=e.trim().split(/\s+/);return 1===n.length?n[0].slice(0,2).toUpperCase():(n[0][0]+n[n.length-1][0]).toUpperCase()},y=function(e){for(var n=[{bg:"#FEF9C3",fg:"#854D0E"},{bg:"#DCFCE7",fg:"#166534"},{bg:"#DBEAFE",fg:"#1E40AF"},{bg:"#F3E8FF",fg:"#6B21A8"},{bg:"#FFE4E6",fg:"#9F1239"},{bg:"#FEE2E2",fg:"#991B1B"},{bg:"#E0F2FE",fg:"#0369A1"}],l=0,t=0;t<e.length;t++)l=e.charCodeAt(t)+((l<<5)-l);return n[Math.abs(l)%n.length]},F=function(e){var n=(null==e?void 0:e.role)||(null==e?void 0:e.accessLevel);return"string"==typeof n&&n.trim()?n:"No role assigned"},m=function(e){return!0===e||("string"==typeof e?["approved","completed","complete","done","accepted"].includes(e.trim().toLowerCase()):!(!e||"object"!=typeof e)&&(m(e.approved)||m(e.status)||m(e.action)||m(e.value)))},b=function(e){return"string"==typeof e?["rejected","declined","denied"].includes(e.trim().toLowerCase()):!(!e||"object"!=typeof e)&&(b(e.rejected)||b(e.status)||b(e.action)||b(e.value))};function E(t){var r=t.levels,d=t.reviewData,a=void 0===d?{}:d,s=t.showApproveAndMoveToNextLevelButton,p=void 0!==s&&s,c=t.onApproveAndMoveToNextLevel,v=r.map(function(e,n){return{level:e,originalLevelIndex:n}}).filter(function(e){return function(e){var n=null==e?void 0:e.assignees;return Array.isArray(n)&&n.length>0}(e.level)}),g=v.map(function(e,n){var l,t,i,o,r,d,s,p,c,v=e.level,g=e.originalLevelIndex,u=null!==(p=null!==(o=null!==(i=null!==(t=null!==(l=a[g])&&void 0!==l?l:a[n])&&void 0!==t?t:a[v.headerName])&&void 0!==i?i:a[v.title])&&void 0!==o?o:v.isHidden?null!==(s=null!==(d=null!==(r=a.final)&&void 0!==r?r:a.Final)&&void 0!==d?d:a.finalApproval)&&void 0!==s?s:a.final_approval:void 0)&&void 0!==p?p:{},x=u&&"object"==typeof u?u:{},f=(null!==(c=v.assignees)&&void 0!==c?c:[]).map(function(e){var n,l,t,i,o,r,d=null!==(l=null!==(n=x[String(e.id)])&&void 0!==n?n:x[String(e.email)])&&void 0!==l?l:v.isHidden?null!==(r=null!==(o=null!==(i=null!==(t=x.owner)&&void 0!==t?t:x.final)&&void 0!==i?i:x.finalApproval)&&void 0!==o?o:x.final_approval)&&void 0!==r?r:u:void 0;return{user:e,approved:m(d)||m(e.action)||m(e.status)||m(e.approved)||m(e.isApproved),rejected:b(d)||b(e.action)||b(e.status)||b(e.rejected)||b(e.isRejected)}}),h="not_started";if(m(u)||m(v.isApproved)||m(v.approved))h="approved";else if(b(u)||b(v.isRejected)||b(v.rejected))h="rejected";else if(m(v.status))h="approved";else if(b(v.status))h="rejected";else{var y=f.length>0&&f.every(function(e){return e.approved}),F=f.some(function(e){return e.rejected});y?h="approved":F&&(h="rejected")}return{level:v,assigneeStatuses:f,status:h,originalLevelIndex:g}}),u=!1,x=g.map(function(n){var l="waiting",t=!0===n.level.isHidden;return"approved"===n.status?l="approved":"rejected"===n.status?(l="rejected",u=!0):n.level.isMandatory||t?u||(l="pending",u=!0):l="optional",e(e({},n),{extendedStatus:l,isFinalApproval:t})}),h=function(e){return e.filter(function(e){return"approved"===e.status}).length}(g),y=g.length;return n("div",e({style:{display:"flex",flexDirection:"column",gap:24}},{children:[n("div",{children:[n("div",e({style:f.progressHeader},{children:[l("span",e({style:f.progressTitle},{children:"Approval Progress"})),n("span",e({style:f.progressCount},{children:[h," of ",y," level",1!==y?"s":""," complete"]}))]})),l("div",e({style:f.progressBarTrack},{children:x.map(function(n,t){var i="approved"===n.extendedStatus,o="rejected"===n.extendedStatus,r="optional"===n.extendedStatus,d=0===t,a=t===y-1;return l("div",{style:e(e({},f.progressSegment),{backgroundColor:i?"#6366F1":o?"#EF4444":r?"#F1F5F9":"#E5E7EB",borderRadius:d&&a?"999px":d?"999px 0 0 999px":a?"0 999px 999px 0":"0",marginRight:a?0:3})},t)})})),l("div",e({style:f.progressLabels},{children:x.map(function(n,t){return l("span",e({style:e(e({},f.progressLabel),{color:"approved"===n.extendedStatus?"#6366F1":"rejected"===n.extendedStatus?"#EF4444":"#9CA3AF",fontWeight:"approved"===n.extendedStatus||"rejected"===n.extendedStatus?600:400})},{children:n.level.assignees&&n.level.assignees.length>0?"".concat(n.level.headerName," - ").concat(n.level.title):""}),t)})}))]}),n("div",e({style:{display:"flex",flexDirection:"column",gap:0}},{children:[l("div",e({style:f.sectionHeadingRow},{children:n("div",e({style:{display:"flex",alignItems:"center",gap:6}},{children:[l("span",e({style:f.sectionTitle},{children:"Approval Levels"})),l(o,{size:15,color:"#9CA3AF"})]}))})),l("div",e({style:{display:"flex",flexDirection:"column",marginTop:12}},{children:x.map(function(t,o){var r,d,a=o===x.length-1,s=t.isFinalApproval,v=x[o+1],g=null==v?void 0:v.isFinalApproval,u=v&&!v.level.isMandatory&&!g;return n(i.Fragment,s?{children:[n("div",e({style:{display:"flex",alignItems:"center",margin:"16px 0"}},{children:[l("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),l("span",e({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:"then"})),l("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]})),l("div",e({style:{marginBottom:"12px",fontSize:"15px",fontWeight:500,color:"#6B7280"}},{children:"Final Approval"})),l(A,{reviewLevel:t})]}:{children:[l(C,{reviewLevel:t,levelIndex:t.originalLevelIndex,nextLevel:null!==(r=null==v?void 0:v.level)&&void 0!==r?r:null,showApproveAndMoveToNextLevelButton:p,onApproveAndMoveToNextLevel:c}),!a&&!g&&v.level.assignees&&(null===(d=v.level.assignees)||void 0===d?void 0:d.length)>0&&n("div",e({style:{display:"flex",alignItems:"center",margin:"20px 0"}},{children:[l("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}}),l("span",e({style:{padding:"0 16px",fontSize:"14px",color:"#6B7280"}},{children:u?"optional":"then"})),l("div",{style:{flex:1,height:"1px",backgroundColor:"#E5E7EB"}})]}))]},o)})}))]})),l(j,{levels:r})]}))}function C(t){var i,s=t.reviewLevel,p=t.levelIndex,c=t.nextLevel,v=t.showApproveAndMoveToNextLevelButton,g=t.onApproveAndMoveToNextLevel,u=s.level,x=s.assigneeStatuses,f=s.extendedStatus,h=v&&"pending"===f&&!!g,y=null!==(i={approved:{bg:"#ECFDF5",color:"#059669",icon:l(r,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:l(d,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:l(d,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:l(a,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:l(o,{size:14}),text:"Optional"}}[f])&&void 0!==i?i:{bg:"#F3F4F6",color:"#4B5563",icon:l(d,{size:14}),text:"Waiting"},F="approved"===f?"1px solid #D1FAE5":"rejected"===f?"1px solid #FCA5A5":"optional"===f?"1px dashed #CBD5E1":"1px solid #E5E7EB",m="approved"===f?"#F0FDF4":"rejected"===f?"#FEF2F2":"#F8FAFC";return!u.assignees||!Array.isArray(u.assignees)||u.assignees.length<1?null:n("div",e({style:{backgroundColor:"#FFFFFF",border:F,borderRadius:"8px",display:"flex",flexDirection:"column",overflow:"hidden"}},{children:[n("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:m,borderBottom:F,padding:"12px 16px"}},{children:[n("div",e({style:{display:"flex",alignItems:"center",gap:10}},{children:[l(S,{name:u.headerName}),l("span",e({style:{fontSize:15,fontWeight:500,color:"#374151"}},{children:u.title}))]})),n("div",e({style:{display:"flex",alignItems:"center",gap:"10px"}},{children:[h&&n("button",e({type:"button",onClick:function(){return null==g?void 0:g({level:u,levelIndex:p,nextLevel:c})},style:{border:"1px solid #C7D2FE",backgroundColor:"#EEF2FF",color:"#4F46E5",borderRadius:"8px",padding:"6px 10px",fontSize:"12px",fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:"6px"}},{children:[l(r,{size:13}),"Approve & Move to Next Level"]})),n("div",e({style:{backgroundColor:y.bg,color:y.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[y.icon,y.text]}))]}))]})),l("div",e({style:{padding:"16px"}},{children:x.length>0?l("div",e({style:{display:"flex",flexDirection:"column",gap:16}},{children:x.map(function(e,n){var t;return l(z,{assigneeStatus:e,extendedStatus:f},null!==(t=e.user.id)&&void 0!==t?t:n)})})):l("div",e({style:{fontSize:14,color:"#6B7280"}},{children:"No assignees added yet"}))}))]}))}function A(t){var i,s,p,c,v=t.reviewLevel,g=v.assigneeStatuses,u=v.extendedStatus,x=null!==(i={approved:{bg:"#ECFDF5",color:"#059669",icon:l(r,{size:14}),text:"Approved"},pending:{bg:"#FFEDD5",color:"#C2410C",icon:l(d,{size:14}),text:"Pending"},waiting:{bg:"#F3F4F6",color:"#4B5563",icon:l(d,{size:14}),text:"Waiting"},rejected:{bg:"#FEF2F2",color:"#DC2626",icon:l(a,{size:14}),text:"Rejected"},optional:{bg:"#F8FAFC",color:"#64748B",icon:l(o,{size:14}),text:"Optional"}}[u])&&void 0!==i?i:{bg:"#F3F4F6",color:"#4B5563",icon:l(d,{size:14}),text:"Waiting"},f=null===(s=g[0])||void 0===s?void 0:s.user;null==f||f.email;var m=F(f);return n("div",e({style:{backgroundColor:"#FFFFFF",border:"1px solid #E5E7EB",borderRadius:"8px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[f?n("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[l("div",e({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:y(null!==(p=f.id)&&void 0!==p?p:f.name).bg,color:y(null!==(c=f.id)&&void 0!==c?c:f.name).fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:"14px"}},{children:h(f.name)})),n("div",e({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[l("span",e({style:{fontSize:"15px",fontWeight:400,color:"#374151"}},{children:f.name})),n("span",e({style:{fontSize:"13px",color:"#475569",fontWeight:500}},{children:["Role: ",m]})),l("span",e({style:{fontSize:"13px",color:"#6B7280"}},{children:"Will be notified after all levels approve"}))]}))]})):l("span",e({style:{fontSize:14,color:"#6B7280"}},{children:"No owner assigned"})),n("div",e({style:{backgroundColor:x.bg,color:x.color,padding:"4px 10px",borderRadius:"16px",fontSize:"12px",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"}},{children:[x.icon,x.text]}))]}))}function z(i){var o,r=i.assigneeStatus,d=i.extendedStatus,c=r.user,v=r.approved||"approved"===c.action,g=r.rejected||"rejected"===c.action,u=h(c.name),x=y(null!==(o=c.id)&&void 0!==o?o:c.name),f=F(c);return n("div",e({style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[n("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:[l("div",e({style:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:x.bg,color:x.fg,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:"13px"}},{children:u})),n("div",e({style:{display:"flex",flexDirection:"column",gap:"2px"}},{children:[n("div",e({style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}},{children:[l("span",e({style:{fontSize:"14px",fontWeight:400,color:"#374151"}},{children:c.name})),l("span",e({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:f}))]})),l("span",e({style:{fontSize:"13px",color:"#6B7280"}},{children:c.email}))]}))]})),l("div",e({style:{display:"flex",alignItems:"center",gap:"12px"}},{children:v?l(s,{size:20,color:"#16A34A",strokeWidth:1.5}):g?l(a,{size:20,color:"#DC2626",strokeWidth:1.5}):"pending"===d?n(t,{children:[l("span",{style:{fontSize:"13px",color:"#4B5563"}}),l(p,{size:20,color:"#9CA3AF",strokeWidth:1.5})]}):l(p,"optional"===d?{size:20,color:"#CBD5E1",strokeWidth:1.5}:{size:20,color:"#9CA3AF",strokeWidth:1.5})}))]}))}function S(n){var t=n.name,i=y(t);return l("span",e({style:{backgroundColor:i.bg,color:i.fg,borderRadius:12,padding:"3px 10px",fontSize:12,fontWeight:500}},{children:t}))}var B=function(e){switch(e){case 0:return l(x,{size:16,color:"#475569"});case 1:return l(u,{size:16,color:"#475569"});case 2:return l(c,{size:16,color:"#475569"});default:return l(g,{size:16,color:"#475569"})}};function j(t){var o=t.levels.filter(function(e){var n,l;return(null!==(l=null===(n=e.assignees)||void 0===n?void 0:n.length)&&void 0!==l?l:0)>0});return n("div",e({style:f.flowBox},{children:[l("span",e({style:f.flowTitle},{children:"Current Approval Flow"})),o.length>0?l("div",e({style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center",marginTop:6}},{children:o.map(function(t,r){var d,a=t.isHidden,s=!t.isMandatory&&!a,p=a?l(c,{size:16,color:"#475569"}):B(r);return n(i.Fragment,{children:[n("span",e({style:e(e({},f.flowChip),{display:"flex",alignItems:"center",gap:"8px",border:s?"1px dashed #CBD5E1":void 0})},{children:[p,n("span",e({style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"}},{children:[t.assignees.map(function(t,o){var r,d,a=F(t);return n(i.Fragment,{children:[o>0&&l("span",e({style:{color:"#9CA3AF"}},{children:"/"})),n("span",e({style:{display:"flex",alignItems:"center",gap:"6px"}},{children:[l("span",e({style:{fontSize:13,color:s?"#64748B":"#374151"}},{children:t.name})),l("span",e({style:{fontSize:"11px",fontWeight:500,color:"#475569",backgroundColor:"#F1F5F9",border:"1px solid #E2E8F0",borderRadius:"999px",padding:"2px 8px",lineHeight:"16px"}},{children:a}))]}))]},null!==(d=null!==(r=t.id)&&void 0!==r?r:t.email)&&void 0!==d?d:o)}),s&&l("span",e({style:{fontSize:12,color:"#64748B"}},{children:"Optional"}))]}))]})),r<o.length-1&&l(v,{size:16,color:"#9CA3AF"})]},null!==(d=t.id)&&void 0!==d?d:"".concat(t.headerName,"-").concat(r))})})):l("p",e({style:f.flowEmpty},{children:"No owners assigned yet."}))]}))}export{E as default};
2
2
  //# sourceMappingURL=ReviewStatus.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReviewStatus.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/components/ReviewStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,OAAO,EAIH,iBAAiB,EAEpB,MAAM,gBAAgB,CAAC;AAoFxB,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACjC,MAAM,EACN,UAAe,EACf,mCAA2C,EAC3C,2BAA2B,GAC9B,EAAE,iBAAiB,qBAuPnB"}
1
+ {"version":3,"file":"ReviewStatus.d.ts","sourceRoot":"","sources":["../../../../../src/components/AssignReminders/components/ReviewStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,OAAO,EAIH,iBAAiB,EAEpB,MAAM,gBAAgB,CAAC;AA0FxB,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACjC,MAAM,EACN,UAAe,EACf,mCAA2C,EAC3C,2BAA2B,GAC9B,EAAE,iBAAiB,qBAyPnB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viswa-test/creative-workspace-ui-component",
3
- "version": "0.0.69",
3
+ "version": "0.0.70",
4
4
  "author": "Viswa Koduru",
5
5
  "description": "",
6
6
  "license": "MIT",