1import{F as h,d as y,j as e,aD as o,u as n,a as x,B as m,L as f,e as g,aC as P}from"./index-o8q0k3to.js";import{D as v}from"./Delimiter-C3bjY6Ti.js";import{o as b,P as w,g as C,a as D,b as u,B as N,G as I,c as k}from"./PaymentError-f9DPoFYN.js";import{A as B}from"./skinHelper-BYxx7oY7.js";import{S as E}from"./SkeletonImage-DMmBlEAb.js";function X(){const{id:t}=h(),{data:r,isPending:a,isError:s}=y({...b.byId(t),refetchInterval:c=>{const p=c.state.data?.state;return p===o.WaitPay||p===o.WaitDelivery?1500:!1}});return a?e.jsx(O,{}):s?e.jsx(S,{}):r?r.state===o.Delivered&&r.payed?e.jsx(T,{order:r}):r.payed?e.jsx(F,{order:r}):r.state===o.WaitPay||r.state===o.WaitDelivery?e.jsx(_,{order:r}):e.jsx(A,{order:r}):e.jsx(R,{})}function l({order:t,children:r}){const a=t?.createdAt?new Date(t.createdAt).toLocaleDateString():null;return e.jsx("div",{className:"content flex-1 w-full flex items-center justify-center py-6 md:py-10",children:e.jsx(x,{color:"background",borderType:"full",className:"w-full max-w-3xl",children:e.jsxs("div",{className:"p-5 sm:p-8 flex flex-col gap-6",children:[r,t&&e.jsxs("p",{className:"text-xs text-neutral-gray-450 text-center break-all",children:["ID: ",t.id,a&&e.jsxs(e.Fragment,{children:[" | ",a]})]})]})})})}function i({icon:t,title:r,description:a,color:s="orange"}){return e.jsxs("header",{className:"flex flex-col items-center text-center gap-3",children:[e.jsx(x,{color:s,borderType:"full",className:"w-16 h-16 flex items-center justify-center",children:e.jsx(P,{className:"w-6 h-6"})}),e.jsx("h1",{className:"font-start uppercase text-3xl sm:text-4xl leading-tight",children:r}),a&&e.jsx("p",{className:"text-base sm:text-xl text-neutral-gray-450 max-w-2xl",children:a})]})}function O(){return e.jsx(l,{children:e.jsx("div",{className:"flex justify-center py-8",children:e.jsx("span",{className:"loading-spinner"})})})}function R(){const{t}=n();return e.jsxs(l,{children:[e.jsx(i,{icon:"pi-times",color:"red",title:t("orderProduct.notFound")}),e.jsx(j,{})]})}function S(){const{t}=n();return e.jsx(l,{children:e.jsx(i,{icon:"pi-exclamation-triangle",color:"red",title:t("error.unexpected")})})}function _({order:t}){const{t:r}=n();return e.jsxs(l,{order:t,children:[e.jsx(i,{icon:"pi-clock",title:r("orderProduct.wait")}),e.jsx("div",{className:"flex justify-center",children:e.jsx("span",{className:"loading-spinner !w-10 !h-10 !border-4"})})]})}function F({order:t}){const{t:r}=n();return e.jsxs(l,{order:t,children:[e.jsx(i,{icon:"pi-exclamation-triangle",color:"red",title:r("orderProduct.deliveryError"),description:r("orderProduct.contactSupport")}),e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx(g,{compact:!0,className:"flex-wrap justify-center"}),e.jsx(m,{as:"a",href:"mailto:[email protected]",color:"blue",borderType:"full",children:"[email protected]"})]})]})}function A({order:t}){const{t:r}=n();return e.jsxs(l,{order:t,children:[e.jsx(i,{icon:"pi-times",color:"red",title:r("orderProduct.failed")}),(t.state===o.ExternalError||t.externalErrorMeta)&&e.jsx(w,{error:C(t)}),e.jsx(j,{})]})}function T({order:t}){const{t:r}=n(),a=t.content?.filter(s=>s.__typename==="PrimeDeliveredProductContent"?s.success:s.__typename==="BattlePassTrackDeliveredProductContent"?!s.alreadyActive:!0)??[];return e.jsxs(l,{order:t,children:[e.jsx(i,{icon:"pi-check",color:"green",title:r("paymentCallback.success"),description:r("paymentCallback.successMessage")}),a.length>0&&e.jsx(x,{color:"neutral-gray-800",borderType:"full",children:e.jsxs("div",{className:"p-4 sm:p-5 flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end sm:justify-between gap-1",children:[e.jsx("p",{className:"font-semibold text-xl",children:r("paymentCallback.received")}),t.product?.title&&e.jsx("p",{className:"text-sm text-neutral-gray-450",children:t.product.title})]}),e.jsx(v,{}),e.jsx("div",{className:"grid sm:grid-cols-2 gap-4",children:a.map((s,c)=>e.jsx(L,{content:s,productTitle:t.product?.title},`${s.__typename}-${c}`))})]})}),e.jsx(m,{as:f,to:"/inventory",color:"blue",borderType:"full",className:"w-full sm:w-auto
1sm:min-w-56 self-center",children:r("navbar.inventory")})]})}function L({content:t,productTitle:r}){const{t:a}=n();switch(t.__typename){case"BalanceDeliveredProductContent":case"RandomBalanceDeliveredProductContent":return e.jsx(k,{amount:t.amount});case"GameItemVariationDeliveredProductContent":case"RandomItemDeliveredProductContent":return t.accountItemIds.length?e.jsx(e.Fragment,{children:t.accountItemIds.map(s=>{const c=s.gameItemVariation?.id;return c?e.jsx(I,{gameItemVariationId:c,count:1},s.id):e.jsx(d,{productTitle:r},s.id)})}):e.jsx(d,{productTitle:r});case"BattlePassTrackDeliveredProductContent":return e.jsx(u,{titleContent:r??a("checkout.battlepassTrack"),description:a("checkout.battlepassTrack"),imageComponent:e.jsx(E,{className:"w-full disable-blur p-1",src:B+"/textures/medal/wild_fire_gold.png",alt:"BattlepassMedal"})});case"BattlePassXpDeliveredProductContent":return e.jsx(N,{amount:t.amount});case"ChallengeDeliveredProductContent":return e.jsx(u,{titleContent:t.accountChallenge?.challengeDefinition.name??r??a("paymentCallback.received"),description:r});case"PrimeDeliveredProductContent":return e.jsx(D,{});case"SetAccountVariableDeliveredProductContent":return e.jsx(d,{productTitle:r});default:return e.jsx(d,{productTitle:r})}}function d({productTitle:t}){const{t:r}=n();return e.jsx(u,{titleContent:t??r("paymentCallback.received")})}function j(){const{t}=n();return e.jsx(m,{as:f,to:"/shop",color:"blue",borderType:"full",className:"w-full sm:w-auto sm:min-w-56 self-center",children:t("navbar.shop")})}export{X 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.