1import{a3 as e,l as a,s,a5 as t,a6 as r,m as o}from"./2c1ab0fe.GMbxnz74.js";import{cg as c,bm as n,bj as u,S as i,fD as d,W as p,cf as l,T as h}from"./4c290a1e.DMQ9xOwP.js";import{c as m}from"./24fcbaf6.OQPWDlzZ.js";import{c as P}from"./ca5e9c49.DIuWAPOX.js";import{fj as f}from"./164ad2e3.B4L1MRYB.js";function y({extensionId:e,sourceId:a}){const s=`v1-${e}-Checkout::PostPurchase`,t=`${s}-${a}`;return Object.keys(localStorage).forEach(e=>{e!==t&&e.startsWith(s)&&c(e)}),{read:()=>u(t),async write(e){n(t,e)},async delete(){c(t)}}}const b={id:"6e80fbaa48c55e585de6accb0c4efcf5389f92340be06a6c32f0e5ce451de978",type:"query",name:"PostPurchaseData",source:""},k={app:()=>({has:()=>!1})};function v(e,a){return m({extensionsPublicPath:e.assets.postPurchaseExtensionsBase,isPostPurchase:!0,appSandboxPermissions:k,observability:a})(()=>{},{allowNetworkAccess:!0},void 0)}new Proxy({},{get:(e,a)=>Promise.reject(new Error(`Called ${String(a)} on dummyWorker. Methods are not executable in dummyWorker.`))});const D=e("/cdn/shopifycloud/checkout-web/assets/c1/sandbox.D6S3aSTC.worker.js");class S extends Error{constructor(){super(...arguments),this.name="PostPurchaseEmptyDataError"}}const _=Object.freeze(Object.defineProperty({__proto__:null,default:function(){const{client:e,i18n:{locale:c},source:n,observability:u,graphql:{coreGraphql:m}}=i(),k=d(),{postPurchaseInquiryStatus:_}=p(),w=l(),{developmentOptions:g,developmentMode:j}=P(),x=h().shippingAddress,I=a(null),T=s(async()=>{try{_.value="timeout";const{sessionInput:a,queueToken:s,changesetTokens:o,checkpointData:i,...d}=await k(),{data:p,error:l}=await m.staticQuery(b,{cache:!1,variables:{input:{forShouldRender:{purchaseProposal:d,sessionToken:a.sessionToken,developmentOptions:g}}}});if(l)throw l;if("PostPurchaseDataSuccess"!==p?.postPurchaseData.__typename)return void(_.value="failed");const h=p.postPurchaseData.inputData;if(!h)throw new S("The post-purchase inputData is empty");const P=JSON.parse(h),w=y({extensionId:p.postPurchaseData.appId,sourceId:n.sourceId}),x=f();async function T(){try{if("PostPurchaseDataSuccess"!==p?.postPurchaseData.__typename)return;x.mark("start");const a=D({createMessenger:v(e,u)});I.current=a,await a.load(p.postPurchaseData.scriptUrl),x.mark("loaded");const s=await a.run("Checkout::PostPurchase::ShouldRender",{locale:c,inputData:P,version:"unstable",extensionPoint:"Checkout::PostPurchase::ShouldRender",storage:{initialData:{},update:w.write}});x.mark("completed"),_.value=s.render?"success":"declined",x.marks.start&&x.marks.loaded&&u.histogram({name:"PostPurchase_inquiry_sandbox_duration",value:x.marks.loaded-x.marks.start,attributes:{app:p.postPurchaseData.appId}}),x.marks.completed&&x.marks.loaded&&u.histogram({name:"PostPurchase_inquiry_duration",value:x.marks.completed-x.marks.loaded,attributes:{should_render:s.render,app:p.postPurchaseData.appId}}),t(a,{async reload(){"PostPurchaseDataSuccess"===p.postPurchaseData.__typename&&j&&(r(a),T())}})}catch{_.value="error"}}T()}catch{_.value="error"}},[e,g,k,m,c,u,_,n.sourceId,j]);return o(()=>(T(),()=>{r(I.current)}),[T,w.value?.amount,w.value?.currencyCode,x.value?.countryCode]),null}},Symbol.toStringTag,{value:"Module"}));export{_ as P,v as a,y as b,D as c,b as p};
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.