1import{b}from"./chunk-3GS3Q5E4.js";import"./chunk-DGYAOZST.js";import"./chunk-A7RTFQ6P.js";import"./chunk-HYSYIELK.js";import"./chunk-3XG6I6U4.js";import{F as y,G as I,Na as A,i as l,z as C}from"./chunk-2VGNZEH2.js";import"./chunk-J5ICZ3TA.js";import"./chunk-SQD3RUGW.js";import"./chunk-NOYRBUTD.js";import"./chunk-WW4O2JMH.js";import{b as k}from"./chunk-YSVEDFMQ.js";import"./chunk-ZKBCLAHF.js";import"./chunk-P6FJ6JGQ.js";import"./chunk-MLQV6SRH.js";import{d as S}from"./chunk-4RY4FV36.js";import"./chunk-4U4UT3U4.js";import"./chunk-V3VYF6YM.js";import"./chunk-KFTJEMUX.js";import{b as v}from"./chunk-HMKG6TZB.js";import{d as n}from"./chunk-TCTYWEWV.js";import"./chunk-5QWZ7DHK.js";import{a as w}from"./chunk-ZORRURSK.js";import"./chunk-3JG4UUPT.js";import"./chunk-MYWRHX3Q.js";import{e as h,m as g}from"./chunk-R4MRYEGU.js";import"./chunk-V3UQ2PP6.js";import"./chunk-EBNYX2GG.js";import{Ha as c,W as r,hd as m,ia as s,jb as p,ld as f,qc as a,rc as u}from"./chunk-RPJ2AAQC.js";import"./chunk-BNMGCKBV.js";var G=(()=>{let o=class o{constructor(){this.checkoutService=r(b),this.stateService=r(g),this.router=r(f),this.discountService=r(C),this.bwAppStore=r(A),this.activatedRoute=r(m),this.params=n(this.activatedRoute.paramMap),this.orderId=u(()=>this.params()?.get("orderId")??void 0),this.shippingCountry=n(r(v).forShipping$,{requireSync:!0}),s(()=>{let i=this.orderId();i!==void 0&&a(()=>this.redirectToCheckout(Number(i)))})}async redirectToCheckout(i){try{this.checkoutService.order.set(void 0);let e=await this.bwAppStore.getOrder(i,!0),t=new y;if(t.id=e.id,t.product=new S(e.productId),t.address=new l,t.duration=1,t.frequency=0,t.setType(I.OneOff),t.purchaseId=e.purchaseId,e.discountCode!==void 0){let O=await this.discountService.check(new w(e.discountCode),this.shippingCountry(),void 0,void 0,this.bwAppStore.getUser());this.bwAppStore.setPreValidatedDiscount(O),t.discount=await this.bwAppStore.getActiveDiscountCode()}this.stateService.go("checkout.giftOptions",{order:t,orderId:t.id,productCardModalUsed:!1,productId:e.productId,isEditingOrder:!1,data:{giftingOptionsEnabled:!0}},{skipLocationChange:!0})}catch(e){console.error(e),this.router.navigate(["/",h.checkoutBase])}}};o.\u0275fac=function(e){return new(e||o)},o.\u0275cmp=c({type:o,selectors:[["ng-component"]],decls:1,vars:0,template:function(e,t){e&1&&p(0,"bw-loading-spinner")},dependencies:[k],encapsulation:2});let d=o;return d})();export{G as CheckoutMainComponent}; 2/**i18n:352122eed024c06272889ebc3a7095f5ebe05e454f4056b3b24862db51891279*/
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.