1import{a as V,e as q,b as J,j as r,c as n,F as A,P as E}from"./componentLoader.jsx-2026.09.09-3cefc4ce.js";import{r as D}from"./logger-3e1e3eff.js";import{B as z}from"./Button-ad9712a3.js";import{E as K}from"./EmptyState-53c9c04c.js";import{E as c}from"./Link-0005ddf4.js";import{P as Q,a as X}from"./Page-4b335602.js";import{T as v}from"./TableCell-183a8630.js";import{T as Y}from"./TextStyle-014c4a6a.js";import{T as Z}from"./Title-bc4116fa.js";import{G as w}from"./Grid-63374a37.js";import{P as ee}from"./Products-9cf42cda.js";import{A as L}from"./Add-563a4607.js";import{D as B}from"./DropdownFilter-07117f30.js";import{D as $}from"./DropdownMultiFilter-625b8f13.js";import{F as te}from"./FilterRow-94afa8e2.js";import{i as re}from"./inventoryTabs-f1b029f1.js";import{P as ie}from"./PagedTable-618bdccf.js";import{R as oe}from"./ReportSecondaryActions-11398b26.js";import{S as ae}from"./SearchFilter-e579441a.js";import{u as l}from"./filterParamsToQueryString-45819f69.js";import"./index-e642497c.js";import"./_Uint8Array-4a201bc7.js";import"./_equalByTag-f809a93d.js";import{bh as u,S as R,bi as se,bn as le}from"./constants-9e5fc5e0.js";import{c as y}from"./commonReportColumns-d2159f73.js";import{C as f}from"./CurrencyLabel-c23ac7bc.js";import{C as ne}from"./ClearButton-f8a65327.js";import{b as me}from"./react-router-dom-6e2566f9.js";import"./vendor-21ae10b1.js";import"./brand-387037d2.js";import"./universe.js-2026.09.09-3cefc4ce.js";import"./index-213dd4d3.js";import"./DropDown2-ecd6eae7.js";import"./flatten-a652afe7.js";import"./_getAllKeys-a79fe303.js";import"./_isIndex-1f105582.js";import"./orderBy-697545e4.js";import"./_baseOrderBy-8b0fc0ae.js";import"./toString-4b4600cf.js";import"./isSymbol-34885b27.js";import"./_baseIteratee-2da5a91f.js";import"./_baseIsEqual-8f542891.js";import"./_baseMap-d2567cee.js";import"./_baseEach-5996395c.js";import"./debounce-a96a8bf6.js";import"./toNumber-8f88376b.js";import"./Tooltip-a5f55937.js";import"./Columns-7dbee6ce.js";import"./hooks-f60b45da.js";import"./isEqual-8f2d02ec.js";import"./tokens-95b521bf.js";import"./customColumns-1c693f03.js";import"./Tabs-3f2a715b.js";import"./index-2506ba77.js";import"./Checkbox-bd46d4a0.js";import"./Table-d34d9412.js";import"./Text-393329c6.js";import"./index-33a30c39.js";import"./Download-b378aa08.js";import"./Upload-0892eabe.js";import"./HelpButton-171db7a3.js";import"./HelpCircle-0303da15.js";import"./index-6a18cc6d.js";import"./Image-61a89831.js";import"./MessageCard-a3ebcdc7.js";import"./usePaywall-28cf01a3.js";import"./Icon-a1844e0f.js";import"./Search-22bd302e.js";import"./TextFieldDebounced-9d207915.js";import"./TextField-3930079d.js";import"./Cross-eb4df075.js";import"./eq-9168d086.js";import"./TableHeader-4f2098a5.js";import"./StatusDot-e7dbbec9.js";import"./dates-c5bd0e78.js";import"./CurrencyField-9c2f59bc.js";import"./customerside.js-2026.09.09-3cefc4ce.js";import"./hoist-non-react-statics.cjs-3f8ebaa8.js";import"./objectWithoutPropertiesLoose-4f48578a.js";function ce(o,p){let a="";if(o.type==="Gift Certificate")return"Gift Certificate";if(o.product_group_type=="P"){const e=`Parent (${o.product_group_children.split(":").length-1})`;a=p.canEditInventory?r("a",{href:`/inventory/item/wizard/?item_id=${o.item_id}#packages`,children:e}):e}else o.product_group_type=="C"&&(a="Child");if(o.alias_id>0){const e=p.canEditInventory?r("a",{href:`/inventory/item/wizard/?item_id=${o.alias_id}`,children:"Alias"}):"Alias";a=a?n("div",{children:[a," ",e]}):e}else o.product_group_type!="P"&&!a&&(a="Item");return a}const T="https://www.checkfront.com/support/docs/inventory/items-inventory-builder";pe.propTypes={categories:E.array,tags:E.array,customColumns:E.array};function pe({categories:o,tags:p,customColumns:a}){const e=V(),m=q(),s=J(),j=me(),[G,O]=D.useState({cachedRows:[],tally:{},count:-1}),[h,N]=D.useState(a),[b,g]=l("category_id",[]),[W,de]=l("item_id",[]),[_,I]=l("tag_id",[]),[C,x]=l("filters",u),[S,P]=l("type",""),[F,H]=l("rsearch",""),U=h.filter(t=>t.selected),k=[{Header:e.name,label:e.name,id:"name",accessor:"name",Cell:({original:t})=>s.canEditInventory?r(c,{url:`/inventory/item/wizard/?item_id=${t.item_id}`,children:t.name}):r(Y,{strong:!0,children:t.name})},{Header:e.category,label:e.category,id:"category",accessor:"category",Cell:({original:t})=>r(v,{customClass:"font-weight-semibold",onClick:()=>{g([t.category_id.toString()])},children:r("span",{style:{cursor:"pointer"},children:t.category})})},{Header:e.type,label:e.type,id:"type",accessor:"type",Cell:({original:t})=>ce(t,s)},{Header:e.default_status,label:e.default_status,id:"default_status",accessor:"default_status",Cell:({original:t})=>{const i=t.status==="DELETED"||t.enabled<=0?"font-color-black":t.status==="A"?"font-color-green-500":"font-color-red-500";return r("span",{className:i,children:t.default_status})}},y({id:"commission_amount",accessor:"commission_amount",Cell:({value:t,original:i})=>t?i.commission_type==="A"?r(f,{amount:t}):t:""}),y({id:"price",accessor:"price",Header:e.price,Cell:({value:t,original:i})=>{if(!t&&!i.price_max)return"";const d=i.price_max?n(A,{children:[r(f,{amount:t})," -"," ",r(f,{amount:i.price_max})]}):r(f,{amount:t});return s.canEditInventory?r(v,{children:r(c,{url:`/inventory/item/wizard/?item_id=${i.item_id}#pricing`,children:d})}):d}}),y({id:"stock",accessor:"stock",Header:e.stock,Cell:({value:t,original:i})=>s.canEditInventory?r(v,{children:r(c,{url:`/inventory/item/wizard/?item_id=${i.item_id}#attributes`,children:t})}):t}),y({id:"bookings",accessor:"bookings",Header:e.bookings,Cell:({value:t,original:i})=>t?r(c,{url:`/booking/index/?date_src=created&date=B*&item_id=${i.item_id}`,children:t}):""})],M=U.map(t=>{const i=k.findIndex(d=>t.id==d.id);return i>-1?{...k[i]}:{Header:t.label,label:t.label,id:t.id,accessor:t.id}});return n(Q,{width:"fluid",pageHeader:r(X.PageHeader,{content:n(w.Row,{noGutters:!0,justify:"between",spacingTop:"md",spacingBottom:m.rmEnabled?"none":"sm",children:[r(w.Col,{col:"auto",alignSelf:"start",className:"display-flex",children:r(Z,{size:"lg",weight:"bolder",children:e.heading})}),s.canEditInventory&&r(w.Col,{col:"auto",children:r(z,{primary:!0,icon:r(L,{}),url:"/inventory/item/wizard/",children:e.newItem})})]}),tabs:m.rmEnabled&&re({translations:e,location:j,featureFlags:m}),secondaryActions:r(oe,{helpUrl:T,importUrl:s.canEditInventory&&"/inventory/import/"})}),children:[n(te,{customColumnId:"items",customColumns:h,setCustomColumns:N,children:[r($,{id:"category",options:o,selected:b,setSelected:g,emptyPlaceholder:e.categoryFilter}),m.itemTags&&r($,{id:"tags",options:p,selected:_,setSelected:I,emptyPlaceholder:e.tagFilter}),r(B,{id:"enabledFilter",placeholder:e.enabledFilter,options:[{value:R,label:e.all},{value:u,label:e.enabled},{value:se,label:e.disabled},{value:le,label:e.archived}],selected:C,setSelected:x}),r(B,{id:"typeFilter",placeholder:e.typeFilter,options:[{value:R,label:e.all},{value:"parent",label:e.parent},{value:"child",label:e.child},{value:"package",label:e.package},{value:"simple",label:e.simple}],selected:S,setSelected:P}),r(ae,{id:"search",search:F,setSearch:H,placeholder:e.searchItems}),r(ne,{show:b.length||_.length||C!==u||S||F,onClick:()=>{g([]),I([]),x(u),P(""),H("")}})]}),r(ie,{url:"/inventory/",helpUrl:T,filters:{category_id:b,item_id:W,tag_id:_,filters:C,type:S,rsearch:F},tableData:G,setTableData:O,columns:M,customColumns:h,defaultPageSize:50,emptyState:r(K,{illustration:r(ee,{}),title:e.itemsESTitle,actions:s.canEditInventory&&n(A,{children:[r(z,{className:"display-block margin-bottom-2",url:"/inventory/item/wizard/",icon:r(L,{}),primary:!0,children:e.itemsESAction}),!m.isHighlander&&r(c,{external:!0,url:T,children:e.esHelpText})]}),children:e.itemsESDescription})})]})}export{pe as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.