1import{d as Le,g as b,e as Ce,i as r,r as Ee,t as m,a as u,k as Ie,m as X}from"./web-Bf5s-bfW.js";import{e as N,n as ge,f as ke,h as Te,b as t,q as Oe,r as Ae,S as h,p as xe,k as De,M as Q}from"./solid-CxN7oBiC.js";import{u as Be}from"./repo_context-BlsUr76K.js";import{u as Re,c as Pe}from"./icons-DaD63GyN.js";import{u as fe}from"./commodity_context-BmA0KCQD.js";import{u as ee,H as Ne}from"./gc_sdk_partner_config-CZZotJWC.js";import{u as te}from"./index-BcLIwR4t.js";import{B as He}from"./border_gradient_telescope-CAJg9e6D.js";import{ab as Me}from"./intercom-Bja0o_BM.js";import{H as Ue,n as $e,m as J,o as Ve}from"./debounce-vNSi-bT1.js";import{a as I,d as re,g as Ye}from"./number-B_BhWxZ7.js";import{R as be,O as Fe}from"./order_details_card-BZTRE-p1.js";import{bk as qe}from"./common-B0Jw61e1.js";import{o as Ge,h as je}from"./routing-DiG4O4UF.js";import"./snackbar-B3Kyxyn3.js";import"./etc-C4njaG5h.js";import"./icons-CCbAo7Bs.js";import"./events-BeaGbsfN.js";import"./job-B03zVIpe.js";import"./trigger_app_events-CsxL6GyX.js";import"./local_storage-DFxxYqIm.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"6f733099e5334164e635d861caf3350518bfeb4d"}}catch{}})();try{(function(){var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="7275fd3b-824f-45e4-9292-32f05340aa03",e._sentryDebugIdIdentifier="sentry-dbid-7275fd3b-824f-45e4-9292-32f05340aa03")})()}catch{}const We=5e3,Ze=3,se=["SUCCESS","FAILED","RECONCILIATION_REQUIRED"],ze=["FAILED","RECONCILIATION_REQUIRED"];function Ke(e){const l=Be(),n=Re(),{fetchHoldings:i,fetchConfig:a}=fe(),[s,c]=N();let o,d=!1,_=!1;const g=()=>{o&&(clearInterval(o),o=void 0)},x=async()=>{const $=await l.getCommodityOrderById(e.orderId);c($)},p=async()=>{try{await x()}catch(y){console.error("Initial commodity order fetch error:",y)}let $=0;o=setInterval(async()=>{try{await x(),$=0}catch(y){console.error("Commodity order polling error:",y),$++,$>=Ze&&g()}},We)};return ge(async()=>{n.logEvent("commodity_order_view_opened",{orderId:e.orderId,from:e.from}),await p()}),ke(()=>{g()}),Te(()=>{const $=s();if(!$)return;const y=$.order.status;se.includes(y)&&(g(),d||(d=!0,n.logEvent("commodity_order_view_terminal_state",{orderId:e.orderId,orderType:$.order.type,isSip:$.sipInfo!=null,status:y})),y==="SUCCESS"&&!_&&(_=!0,Promise.all([i(),a()]).catch(v=>console.error("Failed to refresh data:",v))))}),{enrichedOrder:s,isPolling:()=>{const $=s();return $?!se.includes($.order.status):!0},isFailed:()=>{const $=s();return $?ze.includes($.order.status):!1},kind:()=>{const $=s();if($)return $.sipInfo?"SIP":$.order.type},from:e.from,showBackButton:e.showBackButton??!0}}const me=Ae();function k(){const e=Oe(me);if(!e)throw new Error("useViewContext must be used within ViewProvider");return e}function Qe(e){return t(me.Provider,{get value(){return e.value},get children(){return e.children}})}var Xe=m('<div class="flex items-center justify-start"><button class="flex items-center justify-center rounded-full border border-stroke-1 p-2 text-text-normal-primary">'),Je=m('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 viewBox="0 0 20 20"fill=none><path d="M9.99962 8.82147L14.1246 4.69647L15.303 5.87481L11.178 9.99981L15.303 14.1248L14.1246 15.3031L9.99962 11.1781L5.87462 15.3031L4.69629 14.1248L8.82129 9.99981L4.69629 5.87481L5.87462 4.69647L9.99962 8.82147Z"fill=currentColor>');function et(){const{showBackButton:e}=k(),{goBackOrExit:l}=ee();return t(h,{when:e!==!1,get children(){var n=b(Xe),i=n.firstChild;return Ce(i,"click",l,!0),r(i,t(tt,{})),Ee(),n}})}const tt=()=>b(Je);Le(["click"]);var rt=m('<div class="flex flex-col items-center gap-5 px-2 pt-[30vh]"><!$><!/><!$><!/>'),lt=m('<div class="flex w-full flex-col items-center gap-1 text-center"><p class="text-caption-semi-bold uppercase tracking-[0.4px] text-text-normal-secondary"></p><p class="text-title-3-semi-bold text-text-normal-primary"></p><p class="text-label-regular text-text-normal-secondary">');const nt={BUY:{eyebrow:"PROCESSING PAYMENT",title:"Buying gold",subtitle:"Confirming your order"},SELL:{eyebrow:"INITIATING TRANSFER",title:"Selling gold",subtitle:"Confirming your order"},SIP:{eyebrow:"SETTING UP AUTOPAY",title:"Setting up your SIP",subtitle:"Confirming with your bank"}};function it(){const{kind:e}=k(),{components:l}=te(),n=()=>{const i=e();return i?nt[i]:void 0};return(()=>{var i=b(rt),a=i.firstChild,[s,c]=u(a.nextSibling),o=s.nextSibling,[d,_]=u(o.nextSibling);return r(i,t(l.CircularLoader,{size:48}),s,c),r(i,t(h,{get when(){return n()},children:g=>(()=>{var x=b(lt),p=x.firstChild,f=p.nextSibling,w=f.nextSibling;return r(p,()=>g().eyebrow),r(f,()=>g().title),r(w,()=>g().subtitle),x})()}),d,_),i})()}var at=m('<p class="text-label-regular text-text-normal-secondary">'),ot=m('<div class="flex flex-col items-center gap-5"><!$><!/><div class="flex w-full flex-col items-center gap-1 text-center"><p class="text-caption-semi-bold uppercase tracking-[0.4px]"></p><p class="text-title-3-semi-bold text-text-normal-primary"></p><!$><!/>'),st=m('<svg xmlns=http://www.w3.org/2000/svg width=48 height=48 viewB
1ox="0 0 48 48"fill=none><rect width=48 height=48 rx=24 fill=#FFEBEC></rect><path d="M24 14C18.48 14 14 18.48 14 24C14 29.52 18.48 34 24 34C29.52 34 34 29.52 34 24C34 18.48 29.52 14 24 14ZM25 29H23V27H25V29ZM25 25H23V19H25V25Z"fill=#FB3748>');function _e(e){return(()=>{var l=b(ot),n=l.firstChild,[i,a]=u(n.nextSibling),s=i.nextSibling,c=s.firstChild,o=c.nextSibling,d=o.nextSibling,[_,g]=u(d.nextSibling);return r(l,t(h,{get when(){return e.variant==="success"},get fallback(){return t(ct,{})},get children(){return t(Pe,{})}}),i,a),r(c,()=>e.eyebrow),r(o,()=>e.title),r(s,t(h,{get when(){return e.subtitle},get children(){var x=b(at);return r(x,()=>e.subtitle),x}}),_,g),xe(x=>Ie(c,{[e.eyebrowClass??"text-text-normal-secondary"]:e.variant==="success","text-error-base":e.variant==="failed"},x)),l})()}function ct(){return b(st)}var ut=m('<div class="flex items-center justify-center rounded-lg mx-2 bg-info-lighter px-4 py-3"><p class="text-center text-title-6-medium text-info-dark">');function pe(e){return(()=>{var l=b(ut),n=l.firstChild;return r(n,()=>e.message),l})()}var dt=m('<p class="-mb-3 text-caption-medium uppercase tracking-[0.4px] text-text-normal-secondary">'),gt=m('<div class="flex w-full flex-col items-center gap-4 roun
1ded-xl bg-background-normal-primary p-3"><div class="relative flex w-full flex-col items-center justify-center gap-3 overflow-clip rounded-xl bg-away-base px-6 pb-8 pt-7"><div class="absolute -top-[28.93px] left-1/2 h-20 w-[260px] -translate-x-1/2 rounded-[260px] bg-white opacity-60 blur-[50px]"></div><div class="relative flex size-20 items-center justify-center overflow-clip rounded-full border border-white/[0.24]"></div><div class="relative z-10 flex w-full flex-col items-center gap-1 text-static-black"><p class="text-caption-medium uppercase tracking-[0.4px]"></p><p class=text-title-2-semi-bold></p></div></div><!$><!/><p class="bg-clip-text text-title-3-medium text-transparent"style="background-image:linear-gradient(111.76deg, #171717 3.5%, #f6b51e 107.04%)"></p><div class="h-px w-full bg-stroke-1"></div><p class="text-label-medium text-text-normal-primary">');function he(e){return t(He,{get children(){var l=b(gt),n=l.firstChild,i=n.firstChild,a=i.nextSibling,s=a.nextSibling,c=s.firstChild,o=c.nextSibling,d=n.nextSibling,[_,g]=u(d.nextSibling),x=_.nextSibling,p=x.nextSibling,f=p.nextSibling;return r(a,t(Ue,{src:Me,alt:"",class:"h-full w-full"})),r(c,()=>e.label),r(o,()=>e.amount),r(l,t(h,{get when(){return e.quantityEyebrow},get children(){var w=b(dt);return r(w,()=>e.quantityEyebrow),w}}),_,g),r(x,()=>e.quantityText),r(f,()=>e.rateLabel),l}})}var xt=m('<p class="text-label-regular text-text-normal-secondary">via <!$><!/>'),ft=m('<div class="flex w-full flex-col px-2">
1<div class="flex flex-col gap-4 rounded-t-2xl bg-background-normal-secondary p-4"><p class="text-caption-semi-bold uppercase tracking-[0.4px] text-text-normal-secondary">Receipt</p><div class="h-px w-full bg-stroke-1"></div><!$><!/><!$><!/><div class="h-px w-full bg-stroke-1"></div><div class="flex items-start justify-between gap-3"><div class="flex flex-col gap-0.5"><p class="text-title-6-medium text-text-normal-primary">You paid</p><!$><!/></div><p class="text-para-2-semi-bold text-text-normal-primary"></p></div><!$><!/></div><!$><!/>'),$t=m('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 viewBox="0 0 20 20"fill=currentColor><path d="M13.3362 7.845L6.16368 15.0175L4.98535 13.8392L12.157 6.66667H5.83619V5H15.0029V14.1667H13.3362V7.845V7.845Z"fill=fill-inherit stroke=none>'),bt=m('<p class="text-label-regular text-text-normal-secondary">'),mt=m('<div class="flex items-start justify-between gap-3"><div class="flex flex-1 flex-col gap-0.5"><p class="text-title-6-medium text-text-normal-primary"></p><!$><!/></div><p class="text-title-6-semi-bold text-text-normal-primary">');function ve(){const{enrichedOrder:e}=k(),{components:l}=te(),{urlLauncher:n}=ee();return t(h,{get when(){return e()},children:i=>{const a=()=>i().order,s=()=>i().payments?.vpa??null,c=()=>a().preTaxAmount??a().amount,o=()=>a().taxAmount??0,d=()=>a().rate,_=()=>a().quantity,g=()=>{const p=c(),f=o();return!p||!f?null:Math.round(f/p*100)},x=()=>{if(d())return`${_()}g à ${I(d())}/g`};return(()=>{var p=b(ft),f=p.firstChild,w=f.firstChild,E=w.nextSibling,$=E.nextSibling,[y,v]=u($.nextSibling),S=y.nextSibling,[L,A]=u(S.nextSibling),T=L.nextSibling,O=T.nextSibling,D=O.firstChild,R=D.firstChild,H=R.nextSibling,[M,P]=u(H.nextSibling),U=D.nextSibling,V=O.nextSibling,[B,j]=u(V.nextSibling),W=f.nextSibling,[F,Z]=u(W.nextSibling);return r(f,t(ce,{label:"Gold price",get subtitle(){return x()},get value(){return I(Math.round(c()))}}),y,v),r(f,t(ce,{label:"GST",get subtitle(){return X(()=>g()!=null)()?`${g()}%`:void 0},get value(){return I(Math.round(o()))}}),L,A),r(D,t(h,{get when(){return s()},get children(){var Y=b(xt),z=Y.firstChild,K=z.nextSibling,[C,q]=u(K.nextSibling);return r(Y,s,C,q),Y}}),M,P),r(U,()=>I(Math.round(a().amount))),r(f,t(h,{get when(){return a().invoiceLink},get children(){return t(l.Button,{text:"View invoice",onClick:()=>{n.openExternalUrl(a().invoiceLink,{target:"_blank"})},variant:"secondary",style:"neutral",size:44,expanded:!0,TrailIcon:()=>b($t)})}}),B,j),r(p,t(be,{}),F,Z),p})()}})}function ce(e){return(()=>{var l=b(mt),n=l.firstChild,i=n.firstChild,a=i.nextSibling,[s,c]=u(a.nextSibling),o=n.nextSibling;return r(i,()=>e.label),r(n,t(h,{get when(){return e.subtitle},get children(){var d=b(bt);return r(d,()=>e.subtitle),d}}),s,c),r(o,()=>e.value),l})()}var Se=m('<p class="text-label-regular text-text-normal-secondary">'),_t=m('<div class="flex w-full px-2 flex-col">
1<div class="flex flex-col gap-4 rounded-t-2xl bg-background-normal-secondary p-4"><p class="text-caption-semi-bold uppercase tracking-[0.4px] text-text-normal-secondary">Payment details</p><div class="h-px w-full bg-stroke-1"></div><!$><!/><div class="h-px w-full bg-stroke-1"></div><div class="flex items-start justify-between gap-3"><div class="flex flex-col gap-0.5"><p class="text-title-6-medium text-text-normal-primary">Credited to</p><!$><!/></div><p class="text-para-2-semi-bold text-text-normal-primary"></p></div><!$><!/></div><!$><!/>'),pt=m('<svg xmlns=http://www.w3.org/2000/svg width=20 height=20 viewBox="0 0 20 20"fill=currentColor><path d="M13.3362 7.845L6.16368 15.0175L4.98535 13.8392L12.157 6.66667H5.83619V5H15.0029V14.1667H13.3362V7.845V7.845Z"fill=fill-inherit stroke=none>'),ht=m('<div class="flex items-start justify-between gap-3"><div class="flex flex-1 flex-col gap-0.5"><p class="text-title-6-medium text-text-normal-primary"></p><!$><!/></div><p class="text-title-6-semi-bold text-text-normal-primary">');function ye(){const{enrichedOrder:e}=k(),{components:l}=te(),{urlLauncher:n}=ee();return t(h,{get when(){return e()},children:i=>{const a=()=>i().order,s=()=>i().payments?.vpa??null,c=()=>a().preTaxAmount??a().amount,o=()=>a().rate,d=()=>a().quantity,_=()=>{if(o())return`${re(d())}g à ${I(o())}/g`};return(()=>{var g=b(_t),x=g.firstChild,p=x.firstChild,f=p.nextSibling,w=f.nextSibling,[E,$]=u(w.nextSibling),y=E.nextSibling,v=y.nextSibling,S=v.firstChild,L=S.firstChild,A=L.nextSibling,[T,O]=u(A.nextSibling),D=S.nextSibling,R=v.nextSibling,[H,M]=u(R.nextSibling),P=x.nextSibling,[U,V]=u(P.nextSibling);return r(x,t(vt,{label:"Total amount",get subtitle(){return _()},get value(){return I(Math.round(c()))}}),E,$),r(S,t(h,{get when(){return s()},get children(){var B=b(Se);return r(B,s),B}}),T,O),r(D,()=>I(Math.round(a().amount))),r(x,t(h,{get when(){return a().invoiceLink},get children(){return t(l.Button,{text:"View invoice",onClick:()=>{n.openExternalUrl(a().invoiceLink,{target:"_blank"})},variant:"secondary",style:"neutral",size:44,expanded:!0,TrailIcon:()=>b(pt)})}}),H,M),r(g,t(be,{}),U,V),g})()}})}function vt(e){return(()=>{var l=b(ht),n=l.firstChild,i=n.firstChild,a=i.nextSibling,[s,c]=u(a.nextSibling),o=n.nextSibling;return r(i,()=>e.label),r(n,t(h,{get when(){return e.subtitle},get children(){var d=b(Se);return r(d,()=>e.subtitle),d}}),s,c),r(o,()=>e.value),l})()}var St=m('<div class="flex w-full px-2 flex-col">
1<div class="flex w-full flex-col items-start gap-4 rounded-2xl bg-background-normal-secondary p-4"><p class="text-caption-semi-bold uppercase tracking-[0.4px] text-text-normal-secondary">Order details</p><div class="h-px w-full bg-stroke-1"></div><div class="flex w-full flex-col gap-4">');function we(){const{enrichedOrder:e}=k(),[l,n]=N(!1),[i,a]=N(!1),s=async()=>{const c=e()?.order.orderId;c&&(await qe({text:c}),n(!0),setTimeout(()=>n(!1),2e3))};return t(h,{get when(){return e()},children:c=>(()=>{var o=b(St),d=o.firstChild,_=d.firstChild,g=_.nextSibling,x=g.nextSibling;return r(x,t(Fe,{label:"Order ID",get value(){return c().order.orderId},showCopyIcon:!0,onCopy:s,get copied(){return l()},truncateValue:!0})),o})()})}var yt=m('<div class="flex flex-col gap-6"><!$><!/><!$><!/><!$><!/><div class="flex w-full flex-col gap-6"><!$><!/><!$><!/>');const ue={BUY:{eyebrow:"PAYMENT FAILED",title:"Gold purchase failed"},SELL:{eyebrow:"TRANSFER FAILED",title:"Gold sale failed"},SIP:{eyebrow:"AUTOPAY FAILED",title:"SIP setup failed"}},wt={BUY:"GOLD WORTH",SELL:"AMOUNT",SIP:"GOLD WORTH"},Lt="If any amount is deducted, it will be refunded to your source account within 3â5 days of transaction date";function Ct(){const{enrichedOrder:e,kind:l}=k();return t(h,{get when(){return e()},children:n=>{const i=()=>n().order,a=()=>l()??"BUY",s=()=>{const o=i().transactedAt;return o?$e(new Date(o)):void 0},c=()=>{const o=i().rate;return o?`${a()==="SELL"?"Sell":"Buy"} price ${I(o)}/g`:""};return(()=>{var o=b(yt),d=o.firstChild,[_,g]=u(d.nextSibling),x=_.nextSibling,[p,f]=u(x.nextSibling),w=p.nextSibling,[E,$]=u(w.nextSibling),y=E.nextSibling,v=y.firstChild,[S,L]=u(v.nextSibling),A=S.nextSibling,[T,O]=u(A.nextSibling);return r(o,t(_e,{variant:"failed",get eyebrow(){return ue[a()].eyebrow},get title(){return ue[a()].title},get subtitle(){return s()}}),_,g),r(o,t(pe,{message:Lt}),p,f),r(o,t(he,{get label(){return wt[a()]},get amount(){return I(Math.round(i().amount))},get quantityText(){return`${re(i().quantity)}g`},get rateLabel(){return c()},get quantityEyebrow(){return a()==="SELL"?"AGAINST":void 0}}),E,$),r(y,t(h,{get when(){return a()==="SELL"},get fallback(){return t(ve,{})},get children(){return t(ye,{})}}),S,L),r(y,t(we,{}),T,O),o})()}})}var Et=m(`<div class="flex w-full px-2 flex-col"><div class="relative aspect-[343/160] w-full overflow-hidden rounded-xl bg-[#171717] bg-cover bg-center"style="background-image:url('https://assets.myhubble.money/web-assets/vault_card_image.webp')"><p class="absolute left-4 top-4 text-title-6-regular text-[#a3a3a3]">Total gold you own</p><div class="absolute bottom-4 left-4 flex flex-col gap-1"><p class="bg-clip-text text-title-2-medium text-transparent"style="background-image:linear-gradient(90deg, #ebebeb 0%, #f6b51e 100%)"></p><p class="bg-clip-text text-title-6-medium text-transparent"style="background-image:linear-gradient(90deg, #ebebeb 0%, #f6b51e 100%)"><!$><!/> <!$><!/>`);function It(){const{from:e}=k(),{goldHolding:l}=fe(),n=()=>e==="fresh_order"?l():null;return t(h,{get when(){return n()},children:i=>(()=>{var a=b(Et),s=a.firstChild,c=s.firstChild,o=c.nextSibling,d=o.firstChild,_=d.nextSibling,g=_.firstChild,[x,p]=u(g.nextSibling),f=x.nextSibling,w=f.nextSibling,[E,$]=u(w.nextSibling);return r(d,()=>I(Math.round(i().currentValue))),r(_,()=>re(i().quantity),x,p),r(_,()=>Ye(i().quantity),E,$),a})()})}var kt=m('<div class="flex w-full px-2 flex-col">
1<div class="flex w-full flex-col gap-4 rounded-2xl bg-background-normal-secondary p-4"><p class="text-caption-semi-bold uppercase tracking-[0.4px] text-text-normal-secondary">SIP Details</p><div class="h-px w-full bg-stroke-1"></div><!$><!/><!$><!/><!$><!/><!$><!/>'),Tt=m('<p class="text-label-regular text-text-normal-secondary">'),Ot=m('<div class="flex items-start justify-between gap-3"><p class="text-title-6-medium text-text-normal-primary"></p><div class="flex flex-col items-end gap-0.5 text-right"><p class="text-title-6-semi-bold text-text-normal-primary"></p><!$><!/>');function At(e){switch(e){case"DAILY":return"Daily";case"WEEKLY":return"Weekly";case"MONTHLY":return"Monthly";default:return"-"}}function de(e){if(!e)return null;const l=new Date(e);return Number.isNaN(l.getTime())?null:l}function Dt(e,l){return l?e==="MONTHLY"?`${Ve(l)} of every month`:e==="WEEKLY"?l.toLocaleDateString("en-US",{weekday:"long"}):e==="DAILY"?"Every day":J(l):"-"}function Bt(){const{enrichedOrder:e}=k(),l=()=>e()?.sipInfo??void 0;return t(h,{get when(){return l()},children:n=>{const i=()=>de(n().firstSipDate),a=()=>de(n().nextSipDate);return(()=>{var s=b(kt),c=s.firstChild,o=c.firstChild,d=o.nextSibling,_=d.nextSibling,[g,x]=u(_.nextSibling),p=g.nextSibling,[f,w]=u(p.nextSibling),E=f.nextSibling,[$,y]=u(E.nextSibling),v=$.nextSibling,[S,L]=u(v.nextSibling);return r(c,t(G,{label:"Started",get value(){return X(()=>!!i())()?J(i()):"-"}}),g,x),r(c,t(G,{label:"Frequency",get value(){return At(n().frequency)}}),f,w),r(c,t(G,{label:"SIP date",get value(){return Dt(n().frequency,i())},get subValue(){return X(()=>!!a())()?`Next installment on ${J(a())}`:void 0}}),$,y),r(c,t(G,{label:"Installment",get value(){return I(n().amount)}}),S,L),s})()}})}function G(e){return(()=>{var l=b(Ot),n=l.firstChild,i=n.nextSibling,a=i.firstChild,s=a.nextSibling,[c,o]=u(s.nextSibling);return r(n,()=>e.label),r(a,()=>e.value),r(i,t(h,{get when(){return e.subValue},get children(){var d=b(Tt);return r(d,()=>e.subValue),d}}),c,o),l})()}var Rt=m('<div class="flex flex-col gap-6"><div class="transition-all duration-300 ease-out"></div><div class="flex flex-col gap-6 transition-opacity duration-300"><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/>');const Pt={BUY:"GOLD WORTH",SELL:"AMOUNT CREDITED",SIP:"GOLD WORTH"},Nt="It may take up to 48 hrs for the amount to reflect in your bank account";function Ht(e){switch(e){case"DAILY":return"Daily";case"WEEKLY":return"Weekly";case"MONTHLY":return"Monthly";default:return""}}function Mt(){const{enrichedOrder:e,kind:l,from:n}=k(),[i,a]=N(!1),[s,c]=N(!1),[o,d]=N(!1);ge(async()=>{await new Promise(g=>setTimeout(g,100)),a(!0),await new Promise(g=>setTimeout(g,1e3)),c(!0),await new Promise(g=>setTimeout(g,500)),d(!0)});const _=n==="fresh_order";return t(h,{get when(){return e()},children:g=>{const x=()=>g().order,p=()=>g().sipInfo,f=()=>l()??"BUY",w=()=>{switch(f()){case"BUY":return{eyebrow:"PAYMENT SUCCESSFUL",title:"Gold purchased"};case"SELL":return{eyebrow:"BANK TRANSFER INITIATED",title:"Gold sold"};case"SIP":return{eyebrow:"AUTOPAY SUCCESSFUL",title:`${Ht(p()?.frequency)} SIP Enabled`.trim()}}},E=()=>{const v=x().transactedAt;if(!v)return;const S=$e(new Date(v));return f()==="SELL"?`on ${S}`:S},$=()=>{const v=x().rate;return v?`${f()==="SELL"?"Sell":"Buy"} price ${I(v)}/g`:""},y=()=>{const v=x().quantity;return f()==="SELL"?`${v}g gold`:`${v}g`};return(()=>{var v=b(Rt),S=v.firstChild,L=S.nextSibling,A=L.firstChild,[T,O]=u(A.nextSibling),D=T.nextSibling,[R,H]=u(D.nextSibling),M=R.nextSibling,[P,U]=u(M.nextSibling),V=P.nextSibling,[B,j]=u(V.nextSibling),W=B.nextSibling,[F,Z]=u(W.nextSibling),Y=F.nextSibling,[z,K]=u(Y.nextSibling);return r(S,t(_e,{variant:"success",get eyebrow(){return w().eyebrow},get title(){return w().title},get subtitle(){return E()},get eyebrowClass(){return f()==="SELL"&&s()?"text-success-dark":"text-text-normal-secondary"}})),r(L,t(h,{get when(){return f()==="SELL"},get children(){return t(pe,{message:Nt})}}),T,O),r(L,t(he,{get label(){return Pt[f()]},get amount(){return I(Math.round(x().amount))},get quantityText(){return y()},get rateLabel(){return $()},get quantityEyebrow(){return f()==="SELL"?"AGAINST":void 0}}),R,H),r(L,t(h,{when:_,get children(){return t(It,{})}}),P,U),r(L,t(h,{get when(){return f()==="SIP"},get children(){return t(Bt,{})}}),B,j),r(L,t(h,{get when(){return f()==="SELL"},get fallback(){return t(ve,{})},get children(){return t(ye,{})}}),F,Z),r(L,t(we,{}),z,K),xe(C=>{var q=!!s(),le=!s(),ne=!!i(),ie=!i(),ae=!!o(),oe=!o();return q!==C.e&&S.classList.toggle("translate-y-0",C.e=q),le!==C.t&&S.classList.toggle("translate-y-[30vh]",C.t=le),ne!==C.a&&S.classList.toggle("opacity-100",C.a=ne),ie!==C.o&&S.classList.toggle("opacity-0",C.o=ie),ae!==C.i&&L.classList.toggle("opacity-100",C.i=ae),oe!==C.n&&L.classList.toggle("opacity-0",C.n=oe),C},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),v})()}})}var Ut=m('<div class="flex w-full flex-col items-center bg-background-normal-primary">'),Vt=m('<div class="flex min-h-dvh w-full flex-col px-2 py-4 sm:max-w-[375px]"><!$><!/><!$><!/>');function Yt(e){return(()=>{var l=b(Ut);return r(l,t(Ne,{headerTitle:"",class:"min-h-dvh",get children(){return t(Ft,{get orderId(){return e.orderId},get from(){return e.from},get showBack(){return e.showBack}})}})),l})()}function Ft(e){const l=Ke({orderId:e.orderId,from:e.from,showBackButton:e.showBack});return t(Qe,{value:l,get children(){var n=b(Vt),i=n.firstChild,[a,s]=u(i.nextSibling),c=a.nextSibling,[o,d]=u(c.nextSibling);return r(n,t(et,{}),a,s),r(n,t(De,{get children(){return[t(Q,{get when(){return l.isFailed()},get children(){return t(Ct,{})}}),t(Q,{get when(){return l.isPolling()},get children(){return t(it,{})}}),t(Q,{get when(){return l.enrichedOrder()},get children(){return t(Mt,{})}})]}}),o,d),n}})}function dr(){const{id:e}=Ge(),[l]=je(),n=l.from==="fresh_order"?"fresh_order":"transactions";return t(Yt,{orderId:e,from:n})}export{dr as default}; 2//# sourceMappingURL=_id_-XPd5wXxi.js.map
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.