1import{E as J,F as Q,G as W,d as $,e as H,h as j,i as Y}from"./chunk-COBNBFGF.js";import"./chunk-P52SAZ7N.js";import{d as K}from"./chunk-G3PWCLSY.js";import"./chunk-372BPJQ3.js";import"./chunk-AFVSMPBC.js";import{a as G}from"./chunk-PCQZQ3U4.js";import{a as X}from"./chunk-2PXMVGFY.js";import"./chunk-JUAHV2TC.js";import{a as z}from"./chunk-RMFEZUNF.js";import"./chunk-BXOGPMZZ.js";import"./chunk-NRC4EHFH.js";import"./chunk-S2LG7ZZI.js";import"./chunk-FRZHUY6N.js";import"./chunk-32B64V2R.js";import"./chunk-3XLVKQRY.js";import"./chunk-DJ5AJG3T.js";import"./chunk-SLPC3Y4V.js";import"./chunk-XIRWNEM2.js";import"./chunk-AAORKXGN.js";import"./chunk-KDGXQRVY.js";import"./chunk-Q2KKZV5J.js";import"./chunk-JICM7NVH.js";import"./chunk-AB6CKZTE.js";import{c as V,d as L,e as q}from"./chunk-DIGPPQJE.js";import{o as F,r as B,x as U}from"./chunk-EU6HCBUP.js";import"./chunk-KAJMKXZ6.js";import{D}from"./chunk-ZAQTNZYS.js";import{c as N}from"./chunk-SRTXE2HR.js";import{Ba as O,Fa as R,Ib as I,Jb as w,Lb as S,Lc as y,Na as k,Rb as C,Ub as T,Uc as l,Vb as A,Vc as p,Wb as o,Wc as M,Xb as r,Yb as _,ac as v,da as g,db as i,gc as h,hc as m,la as u,ma as f,sb as E,uc as c,vc as P,wc as d,yb as x}from"./chunk-NTTV6FWH.js";import{g as b}from"./chunk-W7GRJBO5.js";var te=e=>({date:e}),ne=e=>({count:e}),ie=e=>({code:e}),oe=(e,n)=>n.id;function re(e,n){e&1&&(o(0,"span",3),_(1,"i",4),r(),o(2,"h1"),c(3),l(4,"translate"),r()),e&2&&(i(3),P(p(4,1,"APP.ORDER_CONFIRM.CHECKING")))}function ae(e,n){e&1&&(o(0,"span",5),_(1,"i",6),r(),o(2,"h1",7),c(3),l(4,"translate"),r(),o(5,"p",8),c(6),l(7,"translate"),r(),o(8,"p",9),c(9),l(10,"translate"),r()),e&2&&(i(3),d(" ",p(4,3,"APP.ORDER_CONFIRM.TITLE_OK")," "),i(3),d(" ",p(7,5,"APP.ORDER_CONFIRM.MSG_OK")," "),i(3),d(" ",p(10,7,"APP.ORDER_CONFIRM.THANKS")," "))}function ce(e,n){e&1&&(o(0,"span",3),_(1,"i",10),r(),o(2,"h1",7),c(3),l(4,"translate"),r(),o(5,"p",8),c(6),l(7,"translate"),r()),e&2&&(i(3),d(" ",p(4,2,"APP.ORDER_CONFIRM.TITLE_PROCESSING")," "),i(3),d(" ",p(7,4,"APP.ORDER_CONFIRM.MSG_PROCESSING")," "))}function le(e,n){e&1&&(o(0,"span",11),_(1,"i",12),r(),o(2,"h1",7),c(3),l(4,"translate"),r(),o(5,"p",8),c(6),l(7,"translate"),r()),e&2&&(i(3),d(" ",p(4,2,"APP.ORDER_CONFIRM.TITLE_FAILED")," "),i(3),d(" ",p(7,4,"APP.ORDER_CONFIRM.MSG_FAILED")," "))}function de(e,n){e&1&&(o(0,"p",13),_(1,"i",14),c(2),l(3,"translate"),r()),e&2&&(i(2),d(" ",p(3,1,"APP.ORDER_CONFIRM.OPEN_CART_SHIPPED")," "))}function pe(e,n){if(e&1&&(c(0),l(1,"translate")),e&2){let t=m(3);d(" ",M(1,1,"APP.ORDER_CONFIRM.OPEN_CART_MSG_DATE",y(4,te,t.openUntilLabel()))," ")}}function se(e,n){e&1&&(c(0),l(1,"translate")),e&2&&d(" ",p(1,1,"APP.ORDER_CONFIRM.OPEN_CART_MSG")," ")}function _e(e,n){e&1&&(o(0,"p",20),_(1,"i",21),o(2,"span"),c(3),l(4,"translate"),r()()),e&2&&(i(3),P(p(4,1,"APP.ORDER_CONFIRM.OPEN_CART_ERROR")))}function me(e,n){if(e&1){let t=v();o(0,"p",15),_(1,"i",16),c(2),l(3,"translate"),r(),o(4,"p",17),x(5,pe,2,6)(6,se,2,3),r(),o(7,"button",18),h("click",function(){u(t);let s=m(2);return f(s.requestShipment())}),_(8,"i",19),c(9),l(10,"translate"),r(),x(11,_e,5,3,"p",20)}if(e&2){let t=m(2);i(2),d(" ",p(3,11,"APP.ORDER_CONFIRM.OPEN_CART_TITLE")," "),i(3),C(t.openUntil?5:6),i(2),w("disabled",t.closing()),i(),S("pi-spin",t.closing())("pi-spinner",t.closing())("pi-truck",!t.closing()),i(),d(" ",p(10,13,"APP.ORDER_CONFIRM.OPEN_CART_SHIP")," "),i(2),C(t.closeError()?11:-1)}}function ge(e,n){if(e&1&&(o(0,"div",1),x(1,de,4,3,"p",13)(2,me,12,15),r()),e&2){let t=m();i(),C(t.shipmentRequested()?1:2)}}function Ce(e,n){if(e&1&&(o(0,"b"),c(1),r()),e&2){let t=m().$implicit,a=m(2);i(),P(a.price(t.totalCents,t.currency))}}function ue(e,n){if(e&1){let t=v();o(0,"li")(1,"button",23),h("click",function(){let s=u(t).$implicit,ee=m(2);return f(ee.openOrder(s.id))}),o(2,"span",24)(3,"strong"),c(4),r(),o(5,"small"),c(6),l(7,"translate"),r()(),x(8,Ce,2,1,"b"),_(9,"i",25),r()()}if(e&2){let t=n.$implicit;i(4),P(t.shop||t.code),i(2),P(M(7,3,"APP.ORDER_CONFIRM.ORDER_NUMBER",y(6,ie,t.code))),i(2),C(t.totalCents!==null?8:-1)}}function fe(e,n){if(e&1&&(o(0,"div",2)(1,"p",15),_(2,"i",22),c(3),l(4,"translate"),r(),o(5,"ul"),T(6,ue,10,8,"li",null,oe),r()()),e&2){let t=m();i(3),d(" ",M(4,1,"APP.ORDER_CONFIRM.ORDERS_COUNT",y(4,ne,t.orderIds.length))," "),i(3),A(t.orders())}}function xe(e,n){if(e&1){let t=v();o(0,"button",27),h("click",function(){u(t);let s=m(2);return f(s.retry())}),_(1,"i",28),c(2),l(3,"translate"),r(),o(4,"button",29),h("click",function(){u(t);let s=m(2);return f(s.backToCart())}),_(5,"i",30),c(6),l(7,"translate"),r()}e&2&&(i(2),d(" ",p(3,2,"APP.ORDER_CONFIRM.RETRY")," "),i(4),d(" ",p(7,4,"APP.ORDER_CONFIRM.BACK_TO_CART")," "))}function he(e,n){if(e&1){let t=v();o(0,"button",31),h("click",function(){u(t);let s=m(2);return f(s.continueShopping())}),c(1),l(2,"translate"),r(),o(3,"button",32),h("click",function(){u(t);let s=m(2);return f(s.viewOrders())}),c(4),l(5,"translate"),r()}e&2&&(i(),d(" ",p(2,2,"APP.ORDER_CONFIRM.CONTINUE")," "),i(3),d(" ",p(5,4,"APP.ORDER_CONFIRM.ORDERS")," "))}function Oe(e,n){if(e&1&&(o(0,"div",26),x(1,xe,8,6)(2,he,6,6),r(),_(3,"app-legal-links")),e&2){let t=m();i(),C(t.outcome()==="failed"?1:2)}}var Z=class e{route=g(F);router=g(B);platformId=g(R);translate=g(V);cart=g(K);cartUi=g($);shop=g(G);seo=g(z);loadStripe=g(X);outcome=O("checking");orderId;workspaceId;orderIds;marketplaceOrderId;openCartId;openUntil;clientSecret;redirectStatus;orders=O([]);closing=O(!1);shipmentRequested=O(!1);closeError=O(!1);
1constructor(){let n=this.route.snapshot.queryParamMap;this.orderId=n.get("order")||"",this.workspaceId=n.get("ws")||"",this.orderIds=(n.get("orders")||"").split(",").map(t=>t.trim()).filter(Boolean),this.marketplaceOrderId=n.get("mkt"),this.openCartId=n.get("openCart"),this.openUntil=n.get("openUntil"),this.clientSecret=n.get("payment_intent_client_secret"),this.redirectStatus=n.get("redirect_status"),this.seo.disableFollow(),k(()=>void this.resolveOutcome())}get isMulti(){return!!this.marketplaceOrderId}resolveOutcome(){return b(this,null,function*(){if(!N(this.platformId))return;let n=null;if(this.clientSecret)try{let a=yield this.loadStripe();n=(a?yield a.retrievePaymentIntent(this.clientSecret):null)?.paymentIntent?.status??null}catch{n=null}!n&&this.redirectStatus&&(n=this.redirectStatus);let t=n?j(n):"processing";this.outcome.set(t),t!=="failed"&&(this.isMulti?this.cart.completeAll():this.workspaceId&&this.cart.completeGroup(this.workspaceId),this.isMulti&&this.loadOrders())})}loadOrders(){return b(this,null,function*(){let n=yield Promise.all(this.orderIds.map(t=>b(this,null,function*(){try{let a=yield this.shop.getPurchase(t);return{id:t,shop:a.sellerInfo?.displayName||"",code:a.shortCode||t.slice(0,8).toUpperCase(),totalCents:a.totalCents??null,currency:a.currency||"EUR"}}catch{return{id:t,shop:"",code:t.slice(0,8).toUpperCase(),totalCents:null,currency:"EUR"}}})));this.orders.set(n)})}price(n,t){return J(n,t,this.translate.currentLang)}openOrder(n){this.router.navigateByUrl(`/a/order/${encodeURIComponent(n)}`)}openUntilLabel(){return Q(this.openUntil,this.translate.currentLang)}continueShopping(){this.router.navigateByUrl("/a/marketplace")}viewOrders(){this.router.navigateByUrl(this.orderId&&!this.isMulti?`/a/order/${encodeURIComponent(this.orderId)}`:"/a/orders")}retry(){this.router.navigate(["/a/checkout",this.isMulti?Y:this.workspaceId])}backToCart(){this.cartUi.open()}requestShipment(){return b(this,null,function*(){if(!(!this.openCartId||this.closing())){this.closing.set(!0),this.closeError.set(!1);try{yield this.shop.closePurchaseCart(this.openCartId),this.shipmentRequested.set(!0)}catch{this.closeError.set(!0)}finally{this.closing.set(!1)}}})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=E({type:e,selectors:[["app-order-confirmation-page"]],decls:9,vars:5,consts:[["data-testid","order-confirm","aria-live","polite",1,"oc"],[1,"oc__opencart"],["data-testid","order-confirm-orders-list",1,"oc__orders"],["aria-hidden","true",1,"oc__ic","oc__ic--wait"],[1,"pi","pi-spin","pi-spinner"],["aria-hidden","true",1,"oc__ic","oc__ic--ok"],[1,"pi","pi-check"],["data-testid","order-confirm-title"],[1,"oc__msg"],[1,"oc__thanks"],[1,"pi","pi-hourglass"],["aria-hidden","true",1,"oc__ic","oc__ic--ko"],[1,"pi","pi-times"],[1,"oc__row"],["aria-hidden","true",1,"pi","pi-check-circle"],[1,"oc__row","oc__row--title"],["aria-hidden","true",1,"pi","pi-box"],[1,"oc__muted"],["type","button",1,"cbtn","cbtn--secondary","cbtn--block",3,"click","disabled"],["aria-hidden","true",1,"pi"],["role","alert",1,"notice","notice--error"],["aria-hidden","true",1,"pi","pi-exclamation-triangle"],["aria-hidden","true",1,"pi","pi-list"],["type","button","data-testid","order-confirm-order",1,"oc__order",3,"click"],[1,"oc__order-who"],["aria-hidden","true",1,"pi","pi-angle-right"],[1,"oc__actions"],["type","button","data-testid","order-confirm-retry",1,"cbtn","cbtn--primary","cbtn--block",3,"click"],["aria-hidden","true",1,"pi","pi-refresh"],["type","button",1,"cbtn","cbtn--secondary","cbtn--block",3,"click"],["aria-hidden","true",1,"pi","pi-shopping-cart"],["type","button","data-testid","order-confirm-continue",1,"cbtn","cbtn--primary","cbtn--block",3,"click"],["type","button","data-testid","order-confirm-orders",1,"cbtn","cbtn--ghost",3,"click"]],template:function(t,a){if(t&1&&(o(0,"app-shell")(1,"section",0),x(2,re,5,3)(3,ae,11,9)(4,ce,8,6)(5,le,8,6)(6,ge,3,1,"div",1)(7,fe,8,6,"div",2)(8,Oe,4,1),r()()),t&2){let s;i(),I("data-status",a.outcome()),i(),C((s=a.outcome())==="checking"?2:s==="succeeded"?3:s==="processing"?4:s==="failed"?5:-1),i(4),C(a.outcome()!=="checking"&&a.outcome()!=="failed"&&a.openCartId?6:-1),i(),C(a.isMulti&&a.outcome()!=="checking"&&a.outcome()!=="failed"?7:-1),i(),C(a.outcome()!=="checking"?8:-1)}},dependencies:[D,U,q,L,W,H],styles:["[_nghost-%COMP%]{--paper: #0a0a14;--surface: #12121e;--surface-2: #1a1a2e;--ink: #ffffff;--ink-soft: rgba(255, 255, 255, .66);--ink-muted: rgba(255, 255, 255, .45);--accent: #2f8eef;--accent-bright: #54a6f6;--live: #ff3b30;--error: #ef4444;--border: rgba(255, 255, 255, .1);--border-soft: rgba(255, 255, 255, .06);--topbar: 64px;--story-ring-a: #ffc83a;--story-ring-b: #ff7a1a;--story-ring-seen: rgba(255, 255, 255, .22);display:block;background:var(--paper);color:var(--ink);font-family:Inter,system-ui,sans-serif;-webkit-font-smoothing:antialiased}.cbtn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:0 20px;border:1px solid transparent;border-radius:999px;font:inherit;font-size:15px;font-weight:700;cursor:pointer;text-decoration:none;transition:background .15s ease,opacity .15s ease}.cbtn--primary[_ngcontent-%COMP%]{background:var(--accent);color:#fff}.cbtn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--accent-bright)}.cbtn--secondary[_ngcontent-%COMP%]{background:var(--surface-2);border-color:var(--border);color:var(--ink)}.cbtn--secondary[_ngcontent-%COMP%]:hover:not(:disabled){background:#ffffff14}.cbtn--ghost[_ngcontent-%COMP%]{background:transparent;color:var(--accent-bright);text-decoration:underline;text-underline-offset:3px}.cbtn--block[_ngcontent-%COMP%]{width:100%}.cbtn[_ngcontent-%COMP%]:disabled{opacity:.55;cursor:not-allowed}.qty[_ngcontent-%COMP%]{display:inline-flex;align-items:center;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}.qty[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:36px;height:36px;border:0;background:none;color:var(--ink);cursor:pointer;display:grid;place-items:center}.qty[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled{color:var(--ink-muted);cursor:not-allowed}.qty__n[_ngcontent-%COMP%]{min-width:26px;text-align:center;font-weight:700}.notice[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:10px;margin:0;padding:12px 14px;border-radius:12px;border:1px solid var(--border);background:var(--surface-2);color:var(--ink-soft);font-size:13.5px;line-height:1.45}.notice[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{margin-top:2px;font-size:16px}.notice[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--ink)}.notice--error[_ngcontent-%COMP%]{border-style:dashed;border-color:#ef44448c}.notice--error[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{color:var(--error)}.notice--warn[_ngcontent-%COMP%]{border-color:#ffc83a73}.notice--warn[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{color:var(--story-ring-a)}.notice--ok[_ngcontent-%COMP%] .pi[_ngcontent-%COMP%]{color:var(--accent-bright)}.sr-only[_ngcontent-%COMP%]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.oc[_ngcontent-%COMP%]{max-width:480px;margin:0 auto;padding:8vh 20px 40px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px}.oc[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:18px 0 0;font-size:24px;font-weight:800}.oc__msg[_ngcontent-%COMP%]{margin:0;font-size:16px;color:var(--ink-soft);line-height:1.5}.oc__thanks[_ngcontent-%COMP%]{margin:0;font-size:14px;color:var(--ink-muted)}.oc__muted[_ngcontent-%COMP%]{margin:0;font-size:13px;color:var(--ink-soft);line-height:1.45;text-align:left}.oc__ic[_ngcontent-%COMP%]{width:100px;height:100px;border-radius:50%;display:grid;place-items:center;font-size:44px}.oc__ic--ok[_ngcontent-%COMP%]{background:linear-gradient(135deg,var(--accent),var(--accent-bright));color:#fff;box-shadow:0 0 28px #2f8eef59;animation:_ngcontent-%COMP%_ocPop .6s cubic-bezier(.34,1.56,.64,1) both}.oc__ic--wait[_ngcontent-%COMP%]{background:var(--surface-2);border:2px solid var(--border);color:var(--story-ring-a)}.oc__ic--ko[_ngcontent-%COMP%]{background:var(--surface-2);border:3px dashed var(--error);color:var(--error)}.oc__opencart[_ngcontent-%COMP%]{width:100%;margin-top:14px;padding:16px;border-radius:14px;border:1px solid rgba(84,166,246,.35);background:var(--surface);display:flex;flex-direction:column;gap:10px}.oc__row[_ngcontent-%COMP%]{margin:0;display:flex;align-items:center;gap:8px;font-size:14px}.oc__row--title[_ngcontent-%COMP%]{font-weight:700;color:var(--accent-bright)}
1.oc__row[_ngcontent-%COMP%] .pi-check-circle[_ngcontent-%COMP%]{color:var(--accent-bright)}.oc__orders[_ngcontent-%COMP%]{width:100%;margin-top:14px;text-align:left}.oc__orders[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:8px}.oc__order[_ngcontent-%COMP%]{width:100%;display:flex;align-items:center;gap:10px;padding:12px;border-radius:12px;border:1px solid var(--border);background:var(--surface);color:var(--ink);font:inherit;text-align:left;cursor:pointer}.oc__order[_ngcontent-%COMP%]:hover{border-color:var(--accent)}.oc__order-who[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column}.oc__order-who[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.oc__order-who[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{color:var(--ink-muted);font-size:12.5px}.oc__actions[_ngcontent-%COMP%]{width:100%;margin-top:22px;display:flex;flex-direction:column;align-items:center;gap:10px}app-legal-links[_ngcontent-%COMP%]{width:100%;margin-top:18px;text-align:left}@keyframes _ngcontent-%COMP%_ocPop{0%{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}"]})};export{Z as OrderConfirmationPageComponent};
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.