import{j as n,Y as o,Q as g,bk as m,ej as d,h as a,i as p,e as x,fj as C}from"./app-BgLa5dit.js";function f(e){return typeof e=="number"?!1:e==null||e===""?!0:Array.isArray(e)?e.length===0:!1}function T(e){return typeof e=="string"?e:typeof e=="boolean"||typeof e=="number"?e.toString():e.name}function l(e){if(f(e.data))return n.jsx(o,{className:`text-decoration-none w-100 px-3 py-2 d-flex align-items-center clamp-${e.clampLevel} ${e.readonly?"text-dark":"text-success"}`,appLink:e.appLink,disabled:e.readonly,children:e.appLink?n.jsxs(n.Fragment,{children:[n.jsx(g,{svg:m,className:"svg-container me-1"}),"Add"]}):n.jsx(n.Fragment,{children:"-"})});const t=T(Array.isArray(e.data)?e.data[0]:e.data);return e.readonly?n.jsx("div",{className:"w-100 d-flex align-items-center",children:n.jsx("div",{className:`text-decoration-none px-3 py-2 d-inline-flex w-100 clamp-${e.clampLevel} text-dark`,children:n.jsx("span",{className:`clamp-${e.clampLevel}`,title:t,children:t})})}):n.jsx("div",{className:"w-100 d-flex align-items-center",children:n.jsx(o,{className:`text-decoration-none px-3 py-2 d-inline-flex w-100 clamp-${e.clampLevel} text-info`,appLink:e.appLink,children:n.jsx("span",{className:`clamp-${e.clampLevel}`,title:t,children:t})})})}const c=d(),A={name:()=>c.accessor(e=>e,{id:"name",header:()=>n.jsx(l,{data:"Name",readonly:!0,appLink:null}),cell:e=>{const t=e.getValue();return n.jsx(l,{data:t.name,clampLevel:2,appLink:{application:p.MARKETING_APP,action:a.Marketing.VIEW_CATALOG,args:[s.getRegion(t.region),t.name]}})}}),description:()=>c.accessor(e=>e,{id:"description",header:()=>n.jsx(l,{data:"Description",readonly:!0,appLink:null}),cell:e=>{const t=e.getValue();return n.jsx(l,{data:t.description,clampLevel:2,readonly:!0})}}),region:()=>c.accessor(e=>e,{id:"region",header:()=>n.jsx(l,{data:"Region",readonly:!0,appLink:null}),cell:e=>{const t=e.getValue();return n.jsx(l,{data:s.getRegion(t.region).toUpperCase(),clampLevel:2,readonly:!0})}})},s={getColumnDefByObjectType(e){switch(e){case"index":return Object.values(A);default:return[]}},renderInPortal(e){return C.renderInPortalIfExists(e,document.getElementById(this.getPortalId()))},getPortalId(){return x.getPortalId()},getRegion(e){switch(e){case"cv-ap-southeast-1":return"us";case"cv-eu-west-1":return"eu"}},getInstanceRegionByCode(e){switch(e){case"us":return"cv-ap-southeast-1";case"eu":return"cv-eu-west-1"}},getAllRegions(){return[{value:"us",label:"AU / NZ / US / CA"},{value:"eu",label:"UK"}]},getRegionLabel(e){var t;return((t=s.getAllRegions().find(i=>i.value===e))==null?void 0:t.label)??e.toUpperCase()},getColumns(e){return[...Object.values(s.getColumnDefByObjectType(e)).map(r=>r()).filter(r=>!0)].sort((r,u)=>r.id==="actions"?1:u.id==="actions"?-1:0)},getLeftNavItems(e,t){const i=new Set([a.Marketing.CONTACT_IMPORT,a.Marketing.CONTACT_IMPORT_UPLOAD,a.Marketing.CONTACT_IMPORT_ORIGIN_TYPE,a.Marketing.CONTACT_IMPORT_DESTINATION,a.Marketing.CONTACT_IMPORT_IMPORT_OPTIONS,a.Marketing.CONTACT_IMPORT_ADVANCED_OPTIONS,a.Marketing.CONTACT_IMPORT_REVIEW]),r=[{action:a.Marketing.CONTACT_IMPORT,text:"Contact Import",isActive:i.has(t)}];return e&&(r.push({action:a.Marketing.INDEX,text:"Catalogs",isActive:t===a.Marketing.INDEX}),r.reverse()),r}};export{s as M,l as a};
//# sourceMappingURL=DJkz-8BP.chunk.js.map
