1import{an as T,ao as $,_ as R}from"./BL4KeA3L.js";import{j as U,k as A,c as I,b as j}from"./By3faoiX.js";import{bP as z,bQ as E}from"./DYMUdE-w.js";import{u as Q}from"./B1WRAil_.js";import{bh as S,b1 as Y,bI as G,ac as m,ah as a,bL as l,bB as s,aa as f,ab as F,bk as b,a7 as O,ba as o,a9 as d,aL as C,ag as V,bu as i,aY as H,o as J,bi as K}from"./C_nuoD-v.js";import"./CYWtwfwm.js";const W={class:"flex items-center gap-3"},X={key:0,class:"py-8 text-center text-gray-400"},Z={key:1,class:"py-8 text-center text-gray-400"},ee={key:0,class:"text-xs text-indigo-500 mt-0.5"},te={class:"text-sm font-medium"},ae={class:"text-xs text-gray-400"},se={class:"flex flex-col gap-0.5"},le={class:"text-sm font-medium"},oe={class:"text-xs text-gray-500"},me={__name:"index",setup(re){const c=T(),D=$(),p=Q(),r=S(c.query.status??null),n=S(c.query.type??null),h=O(()=>p.getList?.data??null),x=O(()=>p.getList?.meta?.total??0),L=[{label:"Draft",value:"draft"},{label:"Placed",value:"placed"},{label:"Partially shipped",value:"partially_shipped"},{label:"Shipped",value:"shipped"},{label:"Delivered",value:"delivered"},{label:"Closed",value:"closed"},{label:"Cancelled",value:"cancelled"},{label:"Unfulfilled",value:"unfulfilled"}],M=[{label:"Simple orders",value:"simple"},{label:"Full marketplace",value:"full"}],y=()=>{const t={};return r.value&&(t.status=r.value),n.value==="simple"&&(t.is_simple_order=!0),n.value==="full"&&(t.is_simple_order=!1),t},g=async()=>{const t={page:1};r.value&&(t.status=r.value),n.value&&(t.type=n.value),await D.push({query:t}),await p.fetchOrders(1,y())};return Y(async()=>{await p.fetchOrders(c.query.page??1,y())}),G(()=>c.query.page,async t=>{await p.fetchOrders(t??1,y()),window.scrollTo(0,0)}),(t,_)=>{const k=b("pv-select"),B=b("dashboard-header"),w=R,u=E,P=b("v-action-dropdown-menu"),q=z,N=b("v-paginator");return o(),m("div",null,[a(B,{title:"Marketplace â Orders"},{default:l(()=>[d("div",W,[a(k,{modelValue:s(r),"onUpdate:modelValue":_[0]||(_[0]=e=>C(r)?r.value=e:null),options:L,"option-label":"label","option-value":"value",placeholder:"All statuses","show-clear":"",class:"w-52",onChange:g},null,8,["modelValue"]),a(k,{modelValue:s(n),"onUpdate:modelValue":_[1]||(_[1]=e=>C(n)?n.value=e:null),options:M,"option-label":"label","option-value":"value",placeholder:"All types","show-clear":"",class:"w-44",onChange:g},null,8,["modelValue"])])]),_:1}),s(h)===null?(o(),m("div",X,"Loading...")):s(h).length===0?(o(),m("div",Z,"No orders found.")):(o(),f(q,{key:2,value:s(h),tableStyle:"min-width: 60rem"},{default:l(()=>[a(u,{style:{width:"140px"},header:"Order ID"},{body:l(({data:e})=>[a(w,{to:`/dashboard/marketplace/orders/${e.id}`,class:"font-mono text-sm text-blue-600 hover:underline"},{default:l(()=>[V(i(e.public_id),1)]),_:2},1032,["to"]),e.is_simple_order?(o(),m("p",ee,"Simple order")):F("",!0)]),_:1}),a(u,{header:"Status",style:{width:"160px"}},{body:l(({data:e})=>[d("span",{class:H(["text-xs px-2 py-1 rounded font-medium",("useOrderStatusClass"in t?t.useOrderStatusClass:s(U))(e.status)])},i(("useOrderStatusLabel"in t?t.useOrderStatusLabel:s(A))(e.status)),3)]),_:1}),a(u,{header:"Buyer"},{body:l(({data:e})=>[d("p",te,i(e.buyer?.name??"â"),1),d("p",ae,i(e.buyer?.email),1)]),_:1}),a(u,{header:"Stores"},{body:l(({data:e})=>[d("div",se,[(o(!0),m(J,null,K(e.stores,v=>(o(),f(w,{key:v.id,to:`/dashboard/marketplace/stores/${v.url}`,class:"text-xs text-blue-500 hover:underline"},{default:l(()=>[V(i(v.title),1)]),_:2},1032,["to"]))),128))])]),_:1}),a(u,{header:"Total",style:{width:"120px"}},{body:l(({data:e})=>[d("span",le,i(("useFormatMarketPrice"in t?t.useFormatMarketPrice:s(I))(e.grand_total,e.currency)),1)]),_:1}),a(u,{header:"Placed at",style:{width:"140px"}},{body:l(({data:e})=>[d("span",oe,i(e.placed_at?("useFormatMarketDate"in t?t.useFormatMarketDate:s(j))(e.placed_at):"â"),1)]),_:1}),a(u,{style:{width:"60px"}},{body:l(({data:e})=>[a(P,{data:e,actions:[{label:"View",route:`/dashboard/marketplace/orders/${e.id}`}]},null,8,["data","actions"])]),_:1})]),_:1},8,["value"])),s(x)>25?(o(),f(N,{key:3,total:s(x),"per-page":25,"current-page":s(c).query.page??1,class:"my-8",url:"/dashboard/marketplace/orders"},null,8,["total","current-page"])):F("",!0)])}}};export{me 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.