import{_ as g}from"./SmartDataTable-2Nc3Ohem.js";import{d as p,C as m,h as o,y as c,x,G as I,H as T,s as B,I as C,r as l,f as R,v as w}from"./index-C5GbdPxY.js";import"./VAvatar-RkAR0u0e.js";import"./VImg-BlqLjeEy.js";import"./VSelect-vtfYszIh.js";import"./VTextField-DxEUpn3-.js";import"./index-XcTykuv2.js";import"./forwardRefs-CB8NoG9r.js";import"./VList-C3dIUnee.js";import"./VMenu-CT0Fri-T.js";import"./VOverlay-DlJb3QlW.js";import"./getScrollParent-DE35ecf2.js";import"./VVirtualScroll-BUlcGoHW.js";import"./VChip-CsS_5IS6.js";import"./confirmDialog-CDDTmj30.js";import"./VCard-DptrO3GI.js";import"./VDialog-Dr29crN8.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./lodash-kem28dbC.js";import"./_commonjsHelpers-_d1bhYXs.js";import"./VForm-BZc3SavJ.js";import"./VCheckbox-rNAD_QU_.js";import"./VDatePicker-DHBX-k2T.js";import"./VSpacer-79sITyKz.js";import"./VBadge-DZHesqMo.js";import"./VTooltip-DPhSY2Qe.js";import"./TableAgent.vue_vue_type_script_setup_true_lang-XA6R7TPe.js";import"./TableEnum.vue_vue_type_script_setup_true_lang-5ITYgflT.js";import"./TableStatus.vue_vue_type_script_setup_true_lang-BRbfAU0T.js";import"./RoleBadge.vue_vue_type_script_setup_true_lang-Ctl8Qye7.js";import"./VDataTable-BFiF8jPV.js";import"./VTable-M43pjJD_.js";import"./filter-DERJvhSS.js";const N={class:"text-h6 font-weight-bold"},$=p({__name:"TableName",props:{item:{}},setup(d){return(e,r)=>(o(),m("span",N,c(e.item.name),1))}}),D={class:"d-flex align-center gap-2"},F={class:"text-h6"},S={key:0,class:"text-body-2 text-grey-darken-1 text-decoration-line-through"},V=p({__name:"TablePrice",props:{item:{}},setup(d){return(e,r)=>(o(),m("div",D,[x("span",F,c(e.item.selling_price.formatted),1),e.item.has_special_price?(o(),m("span",S,c(e.item.price.formatted),1)):I("",!0)]))}}),_e=p({__name:"Index",setup(d){var u;const{t:e}=T(),r=B(),a=C(),i=l(null),n=l((u=r.params)==null?void 0:u.menuId),_=async t=>{var s;await(n.value?a.push({name:"admin.menus.products.edit",params:{id:t.id,menuId:(s=i.value)==null?void 0:s.defaultFilters.menu_id}}):a.push({name:"admin.products.edit",params:{id:t.id}}))},f=async()=>{var t;await(n.value?a.push({name:"admin.menus.products.create",params:{menuId:(t=i.value)==null?void 0:t.defaultFilters.menu_id}}):a.push({name:"admin.products.create"}))},b=[{title:e("product::products.table.thumbnail"),value:"thumbnail",sortable:!1},{title:e("product::products.table.name"),value:"name",sortable:!0},{title:e("product::products.table.price"),value:"price",sortable:!0},{title:e("admin::admin.table.activation"),value:"is_active",sortable:!0},{title:e("admin::admin.table.created_at"),value:"created_at",sortable:!0},{title:e("admin::admin.table.updated_at"),value:"updated_at",sortable:!0}],h=[{key:"edit",onClick:_},{key:"destroy",confirm:{message:e("admin::admin.delete.confirmation_message"),confirmButtonText:e("admin::admin.delete.confirm_button_text")}}],v=[{key:"destroy",confirm:{message:e("admin::admin.delete.confirmation_message"),confirmButtonText:e("admin::admin.delete.confirm_button_text")}}],k={name:{component:$},price:{component:V}};return(t,s)=>{const y=g;return o(),R(y,{ref_key:"smartTableRef",ref:i,actions:h,"api-uri":"/v1/products","bulk-actions":v,"cell-components":k,"default-filters":{menu_id:w(n)},"header-actions":[{key:"create",onClick:f}],headers:b,module:"product",name:"product",resource:"products"},null,8,["default-filters","header-actions"])}}});export{_e as default};
