import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{$ as t}from"./vendor-charts-iXlq6Rne.js";import{l as n}from"./vendor-react-Dzc9WstK.js";import{t as r}from"./createLucideIcon-CPi6oOk3.js";import{t as i}from"./info-CKXMLsCK.js";import{_ as a}from"./vendor-flow-IzlrcDx6.js";import{rn as o}from"./index-HkVQGc9M.js";import{o as s}from"./mastersRtkApi-BlaMikAe.js";var c=r(`columns-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),l=e(t(),1);function u(){let{data:e=[],isLoading:t}=s();return{columns:(0,l.useMemo)(()=>e.filter(e=>e.maintains_pricebook).slice().sort((e,t)=>e.sort_order-t.sort_order||e.name.localeCompare(t.name)).map(e=>({id:e.id,name:e.name,code:e.code})),[e]),isLoading:t,total:e.length}}var d=a(),f=`/admin/masters/customer-types`;function p({priced:e,total:t,compact:r}){if(!t)return null;let a=e===0,s=e===t;if(r&&!a&&!s)return null;let l=o(`flex flex-shrink-0 items-start gap-2 text-[12px]`,r?`border-b border-[var(--color-border-light)] px-4 py-1.5 lg:px-6`:`mb-3 rounded-lg px-3 py-2.5`,a?`border-[var(--color-warning)]/30 bg-[var(--color-warning-bg)] text-[var(--color-warning)]`:`text-[var(--color-text-muted)]`,!r&&a&&`border`);return a?(0,d.jsxs)(`p`,{className:l,children:[(0,d.jsx)(i,{className:`mt-0.5 h-3.5 w-3.5 flex-shrink-0`}),(0,d.jsxs)(`span`,{children:[`No customer type keeps a price list, so there is nowhere to enter a selling price. Tick`,` `,(0,d.jsx)(`strong`,{children:`Maintains a pricebook`}),` on the channels you price, under`,` `,(0,d.jsx)(n,{to:f,className:`underline underline-offset-2`,children:`Customer Types`}),`.`]})]}):s?(0,d.jsxs)(`p`,{className:l,children:[(0,d.jsx)(c,{className:`mt-0.5 h-3.5 w-3.5 flex-shrink-0`}),(0,d.jsxs)(`span`,{children:[`A price column for all `,t,` customer types. Most businesses price a handful — untick`,` `,(0,d.jsx)(`strong`,{children:`Maintains a pricebook`}),` on the rest under`,` `,(0,d.jsx)(n,{to:f,className:`underline underline-offset-2`,children:`Customer Types`}),` to narrow this grid.`]})]}):(0,d.jsxs)(`p`,{className:l,children:[(0,d.jsx)(c,{className:`mt-0.5 h-3.5 w-3.5 flex-shrink-0`}),(0,d.jsxs)(`span`,{children:[`Pricing `,e,` of `,t,` customer types. The rest have no price list, so their customers pay the product's own selling price. Change that under`,` `,(0,d.jsx)(n,{to:f,className:`underline underline-offset-2`,children:`Customer Types`}),`.`]})]})}export{u as n,p as t};