1import{G as Ue,y as Fe,l as Oe,u as ze,w as _,o as qe,b as i,d as V,A as h,s as f,f as a,q as d,n as N,t as s,c as p,F as Re,p as He,g as F,e as c,I as ne,C as A,B as E,h as n,j as g}from"./index-DRp_EfMJ.js";import{_ as Ze,f as Ge}from"./AdminLayout-CoiDXqCv.js";import{_ as Qe}from"./PageBreadcrumb-CfgsVIZG.js";import{_ as Je}from"./PageCard-CjUIZ7rS.js";import{_ as Ke}from"./DataTable-JbcYUtPn.js";import{_ as O}from"./Modal-B64nDpQW.js";import{u as ue,r as G}from"./validators-D1b18-y1.js";import{_ as ie}from"./FormInput-BglC1B46.js";import{_ as M}from"./FormSelect-C0cgWT17.js";import"./logo-dark-CgxNiwWY.js";import"./LanguageSwitcher-vtaIfEeV.js";import"./SkeletonTable-DQQHitd1.js";const Xe={class:"relative"},Ye=["value"],et=["value"],tt=["onClick"],at=["onClick","title"],lt={class:"no-scrollbar relative w-full max-w-175 overflow-y-auto rounded-3xl bg-white p-4 dark:bg-gray-900 lg:p-11"},ot={class:"px-2 pr-14"},st={class:"mb-2 text-2xl font-semibold text-gray-800 dark:text-white/90"},rt={key:0,class:"py-3 my-3 px-3 rounded text-white bg-red-400"},nt={class:"custom-scrollbar overflow-y-auto p-2"},ut={class:"grid grid-cols-1 gap-x-6 gap-y-5 lg:grid-cols-2"},it={class:"col-span-2 lg:col-span-1"},dt={class:"col-span-2 lg:col-span-1"},vt={key:0,class:"col-span-2 lg:col-span-1"},ct={class:"col-span-2"},gt={class:"flex items-center gap-3 px-2 mt-6 lg:justify-end"},pt=["disabled"],mt={key:0,class:"w-5 h-5 mr-2 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},ht={class:"no-scrollbar relative w-full max-w-175 overflow-y-auto rounded-3xl bg-white p-4 dark:bg-gray-900 lg:p-11"},ft={class:"px-2 pr-14"},yt={class:"mb-2 text-2xl font-semibold text-gray-800 dark:text-white/90"},wt={key:0,class:"py-3 my-3 px-3 rounded text-white bg-red-400"},bt={class:"custom-scrollbar overflow-y-auto p-2"},xt={class:"grid grid-cols-1 gap-x-6 gap-y-5 lg:grid-cols-2"},kt={key:0,class:"col-span-2 lg:col-span-1"},Ct={class:"col-span-2"},_t={class:"flex items-center gap-3 px-2 mt-6 lg:justify-end"},Mt=["disabled"],Lt={key:0,class:"w-5 h-5 mr-2 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},St={class:"no-scrollbar relative w-full max-w-150 overflow-y-auto rounded-3xl bg-white p-4 dark:bg-gray-900 lg:p-11"},Bt={class:"pr-14"},Vt={class:"mb-6 text-2xl font-semibold text-gray-800 dark:text-white/90"},Nt={key:0,class:"py-3 my-3 px-3 rounded text-white bg-red-400"},At={class:"text-sm leading-6 text-gray-500 dark:text-gray-400"},Et={class:"font-semibold text-error-600"},$t={class:"flex items-center gap-3 px-2 mt-6 lg:justify-end"},Pt=["disabled"],jt={key:0,class:"w-5 h-5 mr-2 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},Dt={class:"no-scrollbar relative w-full max-w-150 overflow-y-auto rounded-3xl bg-white p-4 dark:bg-gray-900 lg:p-11"},Tt={class:"pr-14"},It={class:"mb-6 text-2xl font-semibold text-gray-800 dark:text-white/90"},Wt={key:0,class:"py-3 my-3 px-3 rounded text-white bg-red-400"},Ut={class:"text-sm leading-6 text-gray-500 dark:text-gray-400"},Ft={class:"mt-3 text-sm font-medium text-error-600"},Ot={class:"flex items-center gap-3 px-2 mt-6 lg:justify-end"},zt=["disabled"],qt={key:0,class:"w-5 h-5 mr-2 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},oa={__name:"CountsView",setup(Rt){const L=Ue(),u=Fe(),z=Oe(),Q=g(()=>u.getPermissions()),J=ze(),l=g(()=>J.language),m=g(()=>!u.useWarehouses),K=t=>m.value?null:G()(t),de=g(()=>l.value.inventoryCounts||"Inventory Counts"),ve=g(()=>{const t={number:l.value.countNumber||"Count #",modeName:l.value.countMode||"Mode",type:l.value.countType||"Type",locationName:l.value.location||"Location",warehouseName:l.value.warehouse||"Warehouse",createdByName:l.value.createdBy||"Created by",listsCount:l.value.listsCount||"# "+(l.value.countLists||"Lists"),note:l.value.note||"Note",createdAt:l.value.dateCreate||"Created",status:l.value.status||"Status"};return m.value&&delete t.locationName,t}),S=n([]),q=n([]),ce=n([]),X=n([]),B=n([]),R=n(!1),y=n({page:1,per_page:20,search:"",sort_by:"id",sort_direction:"desc"}),Y=n(null),$=n(""),ee=n(""),ge=g(()=>{if(m.value)return B.value;const t=r.value.location_id;return t?B.value.filter(e=>e.location_id==t):[]}),pe=g(()=>{if(m.value)return B.value;const t=v.value.location_id;return t?B.value.filter(e=>e.location_id==t):[]}),w=async()=>{R.value=!0;const t={...y.value};$.value&&(t.status=$.value),ee.value&&(t.type=ee.value);const e=await A.get(E.COUNTS,{params:t});e.status&&(q.value=e.meta?.statuses||[],ce.value=e.meta?.types||[],X.value=e.meta?.locations||[],B.value=e.meta?.warehouses||[],Y.value=e.meta?.pagination||null,te.value=e.meta?.can_delete_all??!1,S.value=Ne(e.data)),R.value=!1},te=n(!1),x=n(!1),P=n("");_(x,t=>{t||(P.value="")}
1);const me=async()=>{u.loadingButton=!0;const t=await A.delete(E.COUNTS_DELETE_ALL);u.loadingButton=!1,t.status?(await w(),x.value=!1,L.success(t.message)):P.value=t.message},he=t=>{y.value.page=t,w()},fe=t=>{y.value.per_page=t,y.value.page=1,w()},ye=t=>{y.value.search=t,y.value.page=1,w()},we=({column:t,direction:e})=>{y.value.sort_by=t,y.value.sort_direction=e,y.value.page=1,w()},be=t=>{$.value=t,y.value.page=1,w()};_(()=>J.currentLanguage,()=>{w()}),qe(()=>{w()});const b=n(!1);_(b,t=>{t||(D(),ae(),j.value="")});const j=n(""),r=n({type:"",mode:"",location_id:"",warehouse_id:"",note:""}),ae=()=>{r.value.type="",r.value.mode="complete",r.value.location_id="",r.value.warehouse_id="",r.value.note=""};ae(),_(()=>r.value.location_id,()=>{r.value.warehouse_id=""});const xe=async()=>{if(!ke())return;const t={type:r.value.type,mode:r.value.mode,warehouse_id:r.value.warehouse_id||null,note:r.value.note||null};m.value||(t.location_id=r.value.location_id),u.loadingButton=!0;const e=await A.post(E.COUNTS,t);if(u.loadingButton=!1,e.status){b.value=!1,L.success(e.message);const o=e.data;o?.id?z.push(`/counts/${o.id}`):S.value.unshift(Z(o))}else j.value=e.message},{errors:H,validate:ke,clearError:D}=ue(r.value,{type:[G()],mode:[G()],location_id:[K]}),k=n(!1);_(k,t=>{t||(le(),T.value="")}
1);const T=n(""),v=n({id:"",location_id:"",warehouse_id:"",note:""}),Ce=t=>{if(t.listsCount>0){L.error(l.value.countCannotEditWithLists||"Cannot edit a count that has lists");return}v.value.id=t.id,v.value.location_id=t.rawLocationId||"",v.value.warehouse_id=t.rawWarehouseId||"",v.value.note=t.rawNote||"",k.value=!0};_(()=>v.value.location_id,()=>{v.value.warehouse_id=""});const _e=async()=>{if(!Le())return;const t={warehouse_id:v.value.warehouse_id||null,note:v.value.note||null};m.value||(t.location_id=v.value.location_id),u.loadingButton=!0;const e=await A.put(E.COUNTS+"/"+v.value.id,t);if(u.loadingButton=!1,e.status){const o=e.data,U=S.value.findIndex(We=>We.id===o.id);U!==-1&&(S.value[U]=Z(o)),k.value=!1,L.success(e.message)}else T.value=e.message},{errors:Me,validate:Le,clearError:le}=ue(v.value,{location_id:[K]}),C=n(!1);_(C,t=>{t||(I.value="")});const I=n(""),W=n({id:"",number:""}),Se=t=>{W.value.id=t.id,W.value.number=t.number,C.value=!0},Be=async()=>{u.loadingButton=!0;const t=await A.delete(E.COUNTS+"/"+W.value.id);u.loadingButton=!1,t.status?(await w(),C.value=!1,L.success(t.message)):I.value=t.message},Ve=g(()=>u.user?.isMainUser||!1),Z=t=>({id:t.id,number:t.number,type:t.type,mode:t.mode,modeName:t.mode==="partial"?l.value.modePartial||"Partial":l.value.modeComplete||"Complete",locationName:t.location?.name||"",warehouseName:t.warehouse?.name||l.value.allWarehouses||"All",createdByName:t.created_by_name||"",listsCount:t.lists_count||0,note:t.note||"",createdAt:t.created_at?Ge(t.created_at):"",status:t.status,statusInfo:q.value.find(e=>e.value===t.status)||null,rawLocationId:t.location?.id||"",rawWarehouseId:t.warehouse?.id||"",rawNote:t.note||"",_noEdit:(t.lists_count||0)>0,_noDelete:!Ve.value&&t.status!=="draft"}),Ne=t=>t.map(Z),oe=g(()=>u.user?.packageType||"both"),Ae=g(()=>{const t=[{value:"goods",name:l.value.goods||"Goods"},{value:"assets",name:l.value.assets||"Assets"}];return oe.value==="goods"?t.filter(e=>e.value==="goods"):oe.value==="assets"?t.filter(e=>e.value==="assets"):t}),Ee=g(()=>[{value:"complete",name:l.value.modeComplete||"Complete"},{value:"partial",name:l.value.modePartial||"Partial"}]),se=g(()=>X.value.map(t=>({value:t.value,name:t.name}))),$e=g(()=>{const t=[{value:"",name:l.value.allWarehouses||"All"}];return ge.value.forEach(e=>{t.push({value:e.value,name:e.name})}),t}),Pe=g(()=>{const t=[{value:"",name:l.value.allWarehouses||"All"}];return pe.value.forEach(e=>{t.push({value:e.value,name:e.name})}),t}),je=g(()=>{const t=[{value:"",name:l.value.all||"All"}];return q.value.forEach(e=>{t.push({value:e.value,name:re(e.value)})}),t}),De=t=>t==="goods"?"bg-success-50 text-success-700 dark:bg-success-500/15 dark:text-success-500":t==="assets"?"bg-warning-50 text-warning-700 dark:bg-warning-500/15 dark:text-warning-500":"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",Te=t=>t==="draft"?"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300":t==="in_progress"?"bg-blue-50 text-blue-700 dark:bg-blue-500/15 dark:text-blue-400":t==="completed"?"bg-success-50 text-success-700 dark:bg-success-500/15 dark:text-success-500":"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",Ie=t=>t==="goods"?l.value.goods||"Goods":t==="assets"?l.value.assets||"Assets":t,re=t=>t==="draft"?l.value.draft||"Draft":t==="in_progress"?l.value.inProgress||"In Progress":t==="completed"?l.value.completed||"Completed":t;return(t,e)=>(i(),V(Ze,null,{default:h(()=>[f(Qe,{pageTitle:de.value},null,8,["pageTitle"]),f(Je,{title:l.value.countView||"Inventory Counts"},{"header-actions":h(()=>[a("div",Xe,[a("select",{class:"h-11 w-full appearance-none rounded-lg border border-gray-300 bg-transparent py-2.5 pl-4 pr-10 text-sm text-gray-800 shadow-theme-xs focus:border-brand-300 focus:outline-hidden focus:ring-3 focus:ring-brand-500/10 dark:border-gray-700 dark:bg-gray-900 dark:text-white/90 dark:focus:border-brand-800",value:$.value,onChange:e[0]||(e[0]=o=>be(o.target.value))},[(i(!0),p(Re,null,He(je.value,o=>(i(),p("option",{key:o.value,value:o.value},s(o.name),9,et))),128))],40,Ye),e[28]||(e[28]=a("span",{class:"absolute z-30 text-gray-500 -translate-y-1/2 pointer-events-none right-3 top-1/2 dark:text-gray-400"},[a("svg",{class:"stroke-current",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a("path",{d:"M3.8335 5.9165L8.00016 10.0832L12.1668 5.9165",stroke:"","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"})])],-1))]),te.value?(i(),p("button",{key:0,class:"border border-error-300 bg-white text-error-600 hover:bg-error-50 dark:border-error-700 dark:bg-transparent dark:text-error-400 dark:hover:bg-error-500/10 inline-flex items-center justify-center gap-2 rounded-lg px-4 py-3 text-sm font-medium transition",onClick:e[1]||(e[1]=o=>x.value=!0)},[e[29]||(e[29]=a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},[a("path",{d:"M2.5 5h15M8.333 9.167v5M11.667 9.167v5M3.333 5l.833 11.667c0 .92.747 1.666 1.667 1.666h8.333c.92
10 1.667-.746 1.667-1.666L16.667 5M7.5 5V3.333A1.667 1.667 0 019.167 1.667h1.666A1.667 1.667 0 0112.5 3.333V5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),F(" "+s(l.value.deleteAll||"Delete all"),1)])):c("",!0),Q.value.canAdd?(i(),p("button",{key:1,class:"bg-brand-500 hover:bg-brand-600 inline-flex items-center justify-center gap-2 rounded-lg px-4 py-3 text-sm font-medium text-white transition",onClick:e[2]||(e[2]=o=>b.value=!0)},[e[30]||(e[30]=a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},[a("path",{d:"M5 10.0002H15.0006M10.0002 5V15.0006",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),F(" "+s(l.value.countNew||"New Count"),1)])):c("",!0)]),default:h(()=>[f(Ke,{data:S.value,userPermissions:Q.value,labels:ve.value,loading:R.value,serverSide:!0,pagination:Y.value,onAddModal:e[3]||(e[3]=o=>b.value=!0),onEditModal:Ce,onDeleteModal:Se,onPageChange:he,onPerPageChange:fe,onSearch:ye,onSort:we},{"column-number":h(({item:o})=>[a("button",{onClick:U=>d(z).push("/counts/"+o.id),class:"text-gray-800 dark:text-white/90 font-medium text-theme-sm underline-offset-2 hover:underline"},s(o.number),9,tt)]),"column-modeName":h(({item:o})=>[a("span",{class:N(["inline-flex whitespace-nowrap rounded-full px-2 py-0.5 text-xs font-medium",o.mode==="partial"?"bg-warning-50 text-warning-700 dark:bg-warning-500/10 dark:text-warning-400":"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400"])},s(o.modeName),3)]),"column-type":h(({item:o})=>[a("span",{class:N(["inline-flex whitespace-nowrap rounded-full px-2 py-0.5 text-xs font-medium",De(o.type)])},s(Ie(o.type)),3)]),"column-status":h(({item:o})=>[a("span",{class:N(["inline-flex whitespace-nowrap rounded-full px-2 py-0.5 text-xs font-medium",Te(o.status)])},s(re(o.status)),3)]),actions:h(({item:o})=>[a("button",{onClick:U=>d(z).push("/counts/"+o.id),class:"text-gray-500 hover:text-brand-500 dark:text-gray-400 dark:hover:text-brand-500",title:l.value.show||"View"},[...e[31]||(e[31]=[a("svg",{width:"21",height:"21",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[a("path",{d:"M9 18l6-6-6-6"})],-1)])],8,at)]),_:1},8,["data","userPermissions","labels","loading","pagination"])]),_:1},8,["title"]),b.value?(i(),V(O,{key:0,onClose:e[14]||(e[14]=o=>b.value=!1)},{body:h(()=>[a("div",lt,[a("button",{onClick:e[4]||(e[4]=o=>b.value=!1),class:"transition-color absolute right-5 top-5 z-999 flex h-11 w-11 items-center justify-center rounded-full bg-gray-100 text-gray-400 hover:bg-gray-200 hover:text-gray-600 dark:bg-gray-700 dark:text-gray-400 dark:hover:bg-white/[0.07] dark:hover:text-gray-300"},[...e[32]||(e[32]=[a("svg",{class:"fill-current",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.04289 16.5418C5.65237 16.9323 5.65237 17.5655 6.04289 17.956C6.43342 18.3465 7.06658 18.3465 7.45711 17.956L11.9987 13.4144L16.5408 17.9565C16.9313 18.347 17.5645 18.347 17.955 17.9565C18.3455 17.566 18.3455 16.9328 17.955 16.5423L13.4129 12.0002L17.955 7.45808C18.3455 7.06756 18.3455 6.43439 17.955 6.04387C17.5645 5.65335 16.9313 5.65335 16.5408 6.04387L11.9987 10.586L7.45711 6.04439C7.06658 5.65386 6.43342 5.65386 6.04289 6.04439C5.65237 6.43491 5.65237 7.06808 6.04289 7.4586L10.5845 12.0002L6.04289 16.5418Z",fill:""})],-1)])]),a("div",ot,[a("h4",st,s(l.value.countNew||"New Count"),1)]),j.value?(i(),p("div",rt,s(j.value),1)):c("",!0),a("form",{novalidate:"",onSubmit:ne(xe,["prevent"]),class:"flex flex-col"},[a("div",nt,[a("div",ut,[a("div",it,[f(M,{modelValue:r.value.type,"onUpdate:modelValue":e[5]||(e[5]=o=>r.value.type=o),label:l.value.countType||"Type",placeholder:l.value.select||"Select",fgRequired:!0,options:Ae.value,error:d(H).type?.[0],onClearError:e[6]||(e[6]=o=>d(D)("type"))},null,8,["modelValue","label","placeholder","options","error"])]),a("div",dt,[f(M,{modelValue:r.value.mode,"onUpdate:modelValue":e[7]||
1(e[7]=o=>r.value.mode=o),label:l.value.countMode||"Mode",placeholder:l.value.select||"Select",fgRequired:!0,options:Ee.value,error:d(H).mode?.[0],onClearError:e[8]||(e[8]=o=>d(D)("mode"))},null,8,["modelValue","label","placeholder","options","error"])]),m.value?c("",!0):(i(),p("div",vt,[f(M,{modelValue:r.value.location_id,"onUpdate:modelValue":e[9]||(e[9]=o=>r.value.location_id=o),label:l.value.location||"Location",placeholder:l.value.select||"Select",fgRequired:!0,options:se.value,searchable:"",searchPlaceholder:l.value.search||"Search",error:d(H).location_id?.[0],onClearError:e[10]||(e[10]=o=>d(D)("location_id"))},null,8,["modelValue","label","placeholder","options","searchPlaceholder","error"])])),a("div",{class:N(m.value?"col-span-2":"col-span-2 lg:col-span-1")},[f(M,{modelValue:r.value.warehouse_id,"onUpdate:modelValue":e[11]||(e[11]=o=>r.value.warehouse_id=o),label:m.value?l.value.locationWarehouse||"Location / Warehouse":l.value.warehouse||"Warehouse",placeholder:l.value.select||"Select",options:$e.value,searchable:"",searchPlaceholder:l.value.search||"Search"},null,8,["modelValue","label","placeholder","options","searchPlaceholder"])],2),a("div",ct,[f(ie,{modelValue:r.value.note,"onUpdate:modelValue":e[12]||(e[12]=o=>r.value.note=o),label:l.value.note||"Note",placeholder:l.value.note||"Note"},null,8,["modelValue","label","placeholder"])])])]),a("div",gt,[a("button",{onClick:e[13]||(e[13]=o=>b.value=!1),type:"button",class:"flex w-full justify-center rounded-lg border border-gray-300 bg-white px-4 py-2.5 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-white/3 sm:w-auto"},s(l.value.close||"Close"),1),a("button",{type:"submit",disabled:d(u).loadingButton,class:"flex w-full justify-center rounded-lg bg-brand-500 px-4 py-2.5 text-sm font-medium text-white hover:bg-brand-600 sm:w-auto"},[d(u).loadingButton?(i(),p("svg",mt,[...e[33]||(e[33]=[a("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),a("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):c("",!0),a("span",null,s(l.value.add||"Add"),1)],8,pt)])],32)])]),_:1})):c("",!0),k.value?(i(),V(O,{key:1,onClose:e[21]||(e[21]=o=>k.value=!1)},{body:h(()=>[a("div",ht,[a("button",{onClick:e[15]||(e[15]=o=>k.value=!1),class:"transition-color absolute right-5 top-5 z-999 flex h-11 w-11 items-center justify-center rounded-full bg-gray-100 text-gray-400 hover:bg-gray-200 hover:text-gray-600 dark:bg-gray-700 dark:text-gray-400 dark:hover:bg-white/[0.07] dark:hover:text-gray-300"},[...e[34]||(e[34]=[a("svg",{class:"fill-current",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.04289 16.5418C5.65237 16.9323 5.65237 17.5655 6.04289 17.956C6.43342 18.3465 7.06658 18.3465 7.45711 17.956L11.9987 13.4144L16.5408 17.9565C16.9313 18.347 17.5645 18.347 17.955 17.9565C18.3455 17.566 18.3455 16.9328 17.955 16.5423L13.4129 12.0002L17.955 7.45808C18.3455 7.06756 18.3455 6.43439 17.955 6.04387C17.5645 5.65335 16.9313 5.65335 16.5408 6.04387L11.9987 10.586L7.45711 6.04439C7.06658 5.65386 6.43342 5.65386 6.04289 6.04439C5.65237 6.43491 5.65237 7.06808 6.04289 7.4586L10.5845 12.0002L6.04289 16.5418Z",fill:""})],-1)])]),a("div",ft,[a("h4",yt,s(l.value.countEdit||"Edit Count"),1)]),T.value?(i(),p("div",wt,s(T.value),1)):c("",!0),a("form",{onSubmit:ne(_e,["prevent"]),class:"flex flex-col"},[a("div",bt,[a("div",xt,[m.value?c("",!0):(i(),p("div",kt,[f(M,{modelValue:v.value.location_id,"onUpdate:modelValue":e[16]||(e[16]=o=>v.value.location_id=o),label:l.value.location||"Location",placeholder:l.value.select||"Select",fgRequired:!0,options:se.value,searchable:"",searchPlaceholder:l.value.search||"Search",error:d(Me).location_id?.[0],onClearError:e[17]||(e[17]=o=>d(le)("location_id"))},null,8,["modelValue","label","placeholder","options","searchPlaceholder","error"])])),a("div",{class:N(m.value?"col-span-2":"col-span-2 lg:col-span-1")},[f(M,{modelValue:v.value.warehouse_id,"onUpdate:modelValue":e[18]||(e[18]=o=>v.value.warehouse_id=o),label:m.value?l.value.locationWarehouse||"Location / Warehouse":l.value.warehouse||"Warehouse",placeholder:l.value.select||"Select",options:Pe.value,searchable:"",searchPlaceholder:l.value.search||"Search"},null,8,["modelValue","label","placeholder","options","searchPlaceholder"])],2),a("div",Ct,[f(ie,{modelValue:v.value.note,"onUpdate:modelValue":e[19]||(e[19]=o=>v.value.note=o),label:l.value.note||"Note",placeholder:l.value.note||"Note"},null,8,["modelValue","label","placeholder"])])])]),a("div",_t,[a("button",{onClick:e[20]||(e[20]=o=>k.value=!1),type:"button",class:"flex w-full justify-center rounded-lg border border-gray-300 bg-white px-4 py-2.5 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-white/3 sm:w-auto"},s(l.value.close||"Close"),1),a("button",{type:"submit",disabled:d(u).loadingButton,class:"flex w-full justify-center rounded-lg bg-success-500 px-4 py-2.5 text-sm font-medium text-white hover:bg-success-600 sm:w-auto"},[d(u).loadingButton?(i(),p("svg",Lt,[...e[35]||(e[35]=[a("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),a("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):c("",!0),a("span",null,s(d(u).loadingButton?l.value.saving||"Saving...":l.value.edit||"Edit"),1)],8,Mt)])],32)])]),_:1}
1)):c("",!0),C.value?(i(),V(O,{key:2,onClose:e[24]||(e[24]=o=>C.value=!1)},{body:h(()=>[a("div",St,[a("button",{onClick:e[22]||(e[22]=o=>C.value=!1),class:"transition-color absolute right-5 top-5 z-999 flex h-11 w-11 items-center justify-center rounded-full bg-gray-100 text-gray-400 hover:bg-gray-200 hover:text-gray-600 dark:bg-gray-700 dark:text-gray-400 dark:hover:bg-white/[0.07] dark:hover:text-gray-300"},[...e[36]||(e[36]=[a("svg",{class:"fill-current",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.04289 16.5418C5.65237 16.9323 5.65237 17.5655 6.04289 17.956C6.43342 18.3465 7.06658 18.3465 7.45711 17.956L11.9987 13.4144L16.5408 17.9565C16.9313 18.347 17.5645 18.347 17.955 17.9565C18.3455 17.566 18.3455 16.9328 17.955 16.5423L13.4129 12.0002L17.955 7.45808C18.3455 7.06756 18.3455 6.43439 17.955 6.04387C17.5645 5.65335 16.9313 5.65335 16.5408 6.04387L11.9987 10.586L7.45711 6.04439C7.06658 5.65386 6.43342 5.65386 6.04289 6.04439C5.65237 6.43491 5.65237 7.06808 6.04289 7.4586L10.5845 12.0002L6.04289 16.5418Z",fill:""})],-1)])]),a("div",Bt,[a("h4",Vt,s(l.value.countDelete||"Delete Count"),1)]),I.value?(i(),p("div",Nt,s(I.value),1)):c("",!0),a("p",At,[F(s(l.value.countDeleteQuestion||"Are you sure you want to delete this count?")+" ",1),a("span",Et," #"+s(W.value.number),1),e[37]||(e[37]=F("? ",-1))]),a("div",$t,[a("button",{onClick:e[23]||(e[23]=o=>C.value=!1),type:"button",class:"flex w-full justify-center rounded-lg border border-gray-300 bg-white px-4 py-2.5 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-white/3 sm:w-auto"},s(l.value.close||"Close"),1),a("button",{onClick:Be,disabled:d(u).loadingButton,class:"flex w-full justify-center rounded-lg bg-error-500 px-4 py-2.5 text-sm font-medium text-white hover:bg-error-600 sm:w-auto"},[d(u).loadingButton?(i(),p("svg",jt,[...e[38]||(e[38]=[a("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),a("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):c("",!0),a("span",null,s(l.value.delete||"Delete"),1)],8,Pt)])])]),_:1})):c("",!0),x.value?(i(),V(O,{key:3,onClose:e[27]||(e[27]=o=>x.value=!1)},{body:h(()=>[a("div",Dt,[a("button",{onClick:e[25]||(e[25]=o=>x.value=!1),class:"transition-color absolute right-5 top-5 z-999 flex h-11 w-11 items-center justify-center rounded-full bg-gray-100 text-gray-400 hover:bg-gray-200 hover:text-gray-600 dark:bg-gray-700 dark:text-gray-400 dark:hover:bg-white/[0.07] dark:hover:text-gray-300"},[...e[39]||(e[39]=[a("svg",{class:"fill-current",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M6.04289 16.5418C5.65237 16.9323 5.65237 17.5655 6.04289 17.956C6.43342 18.3465 7.06658 18.3465 7.45711 17.956L11.9987 13.4144L16.5408 17.9565C16.9313 18.347 17.5645 18.347 17.955 17.9565C18.3455 17.566 18.3455 16.9328 17.955 16.5423L13.4129 12.0002L17.955 7.45808C18.3455 7.06756 18.3455 6.43439 17.955 6.04387C17.5645 5.65335 16.9313 5.65335 16.5408 6.04387L11.9987 10.586L7.45711 6.04439C7.06658 5.65386 6.43342 5.65386 6.04289 6.04439C5.65237 6.43491 5.65237 7.06808 6.04289 7.4586L10.5845 12.0002L6.04289 16.5418Z",fill:""})],-1)])]),a("div",Tt,[a("h4",It,s(l.value.deleteAll||"Delete all"),1)]),P.value?(i(),p("div",Wt,s(P.value),1)):c("",!0),a("p",Ut,s(l.value.deleteAllCountsQuestion||"This will permanently delete every count, count list and item for your company. This action cannot be undone."),1),a("p",Ft,s(l.value.deleteAllCountsConfirm||"Are you sure you want to continue?"),1),a("div",Ot,[a("button",{onClick:e[26]||(e[26]=o=>x.value=!1),type:"button",class:"flex w-full justify-center rounded-lg border border-gray-300 bg-white px-4 py-2.5 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-white/3 sm:w-auto"},s(l.value.close),1),a("button",{onClick:me,disabled:d(u).loadingButton,class:"flex w-full justify-center rounded-lg bg-error-500 px-4 py-2.5 text-sm font-medium text-white hover:bg-error-600 sm:w-auto disabled:opacity-50 disabled:cursor-not-allowed"},[d(u).loadingButton?(i(),p("svg",qt,[...e[40]||(e[40]=[a("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),a("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):c("",!0),a("span",null,s(l.value.deleteAll||"Delete all"),1)],8,zt)])])]),_:1})):c("",!0)]),_:1}))}};export{oa 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.