1import{u as m,e as p,G as u,I as x,j as e,B as i,L as o}from"./index-DtaB38fA.js";import{P as h,a as j,b as f,c as g,S as y}from"./DashboardShell-mVLi01w_.js";import{l as b}from"./downloads.functions-BaSo1T2Y.js";import{f as N,a as l}from"./panel-format-CPz5hvFb.js";import{R as v}from"./receipt-C173tuxA.js";import{C as w}from"./chevron-down-BKW1tGcC.js";import"./sheet-CNN4ADvf.js";import"./chevron-right-BwWPmZnF.js";import"./layout-dashboard-C4kAu8sa.js";import"./heart-Tn0BUkpk.js";import"./users-BcTa05ms.js";import"./life-buoy-CDrPBbnB.js";import"./gift-CANcO2Go.js";import"./package-Dy9de6vJ.js";import"./tag-D0iyfigS.js";function G(){const{t:s}=m(),{user:d}=p(),c=u(b),t=x({queryKey:["my-purchases"],queryFn:()=>c(),enabled:!!d});return e.jsxs(e.Fragment,{children:[e.jsx(h,{title:s("panel.orders.title"),description:s("panel.orders.subtitle")}),t.isLoading?e.jsx(j,{}):t.isError?e.jsx(f,{onRetry:()=>t.refetch()}):!t.data||t.data.orders.length===0?e.jsx(g,{icon:v,title:s("panel.orders.empty"),description:s("panel.orders.empty_desc"),action:e.jsx(i,{asChild:!0,variant:"outline",children:e.jsx(o,{to:"/products",children:s("panel.overview.browse")})})}):e.jsx("ul",{className:"space-y-3",children:t.data.orders.map(r=>{const n=r.order_items??[];return e.jsx("li",{children:e.jsxs("details",{className:"sb-card group",children:[e.jsxs("summary",{className:"flex cursor-pointer list-none flex-wrap items-center gap-x-4 gap-y-2 p-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",children:[e.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["#",r.id.slice(0,8).toUpperCase()]}),e.jsxs("span",{className:"min-w-0 flex-1 truncate font-medium",children:[n[0]?.products?.title??"â",n.length>1&&e.jsxs("span",{className:"text-muted-foreground",children:[" ",s("panel.orders.more",{count:n.length-1})]})]}),e.jsx("span",{className:"text-sm text-muted-foreground",children:N(r.created_at)}),e.jsx("span",{className:"font-semibold tabular-nums",children:l(r.total_cents,r.currency)}),e.jsx(y,{tone:"success",children:s("panel.orders.status_paid")}),e.jsx(w,{className:"size-4 text-muted-foreground transition-transform group-open:rotate-180 motion-reduce:transition-none","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:s("panel.orders.toggle")})]}),e.jsxs("div",{className:"border-t border-border px-4 py-3",children:[e.jsx("ul",{className:"divide-y divide-border",children:n.map(a=>e.jsxs("li",{className:"flex items-center justify-between gap-3 py-2 text-sm",children:[a.products?.slug?e.jsx(o,{to:"/products/$slug",params:{slug:a.products.slug},className:"min-w-0 truncate hover:text-primary",children:a.products.title}):e.jsx("span",{className:"min-w-0 truncate",children:a.products?.title??"â"}),e.jsx("span",{className:"tabular-nums text-muted-foreground",children:l(a.unit_price_cents,r.currency)})]},a.product_id))}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsx(i,{asChild:!0,size:"sm",children:e.jsx(o,{to:"/dashboard/downloads",children:s("panel.overview.download")})}),e.jsx(i,{asChild:!0,size:"sm",variant:"outline",children:e.jsx(o,{to:"/dashboard/support/new",children:s("panel.orders.get_help")})})]})]})]})},r.id)})})]})}export{G as component};
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.