import{m as i,ku as d,gy as c}from"./shop-pay-FullScreenBackground.DlV2XN9a.js";const E={id:"4e99c51c5187daa6375cfd7696d3f3580e3ab58fd003c6f48fc55555907904f6",type:"mutation",name:"PaymentSession",source:"mutation PaymentSession($addressId:ID,$creditCardId:ID!,$checkoutSessionIdentifier:String!,$shopifyDomain:String!,$installmentsAgreements:InstallmentsAgreementsInput,$unvaultedShippingAddress:AddressInput,$checkoutClientSource:CheckoutClientSourceEnum,$batchCheckouts:[BatchCheckoutsInput!],$batchOnly:Boolean,$publicCvvSessionId:String){paymentSessionGenerate(addressId:$addressId creditCardId:$creditCardId checkoutIdentifier:$checkoutSessionIdentifier shopifyDomain:$shopifyDomain installmentsAgreements:$installmentsAgreements unvaultedShippingAddress:$unvaultedShippingAddress checkoutClientSource:$checkoutClientSource batchCheckouts:$batchCheckouts batchOnly:$batchOnly publicCvvSessionId:$publicCvvSessionId){userErrors{message field __typename}sessionId batchCheckoutSessionIds{sessionId shopId __typename}__typename}}"},l=["Session source not found","Invalid session token","Internal error. Looks like something went wrong on our end","server_unavailable"];function S(t){return l.some(n=>t.includes(n))}function I(t){if(!(!t||t.__typename==="PendingTerms"))return t.availableRedeemables.reduce((n,r)=>{const{balance:e,paymentMethod:s}=r;return s.__typename==="RedeemablePaymentMethod"&&n.push({paymentMethod:d(s),balance:i(e)}),n},[])}function u(t){return{paymentMethod:c(t.paymentMethod)}}function C(t){if(!(!t||t.length===0))return{availableRedeemables:t.map(u)}}const k=["Load failed","Failed to fetch","when attempting to fetch resource","SystemJS https://github.com/systemjs/systemjs/blob/main/docs/errors.md#3"],R=["TranslationNotStringError","MissingReplacementError","CardFieldsSetupError","CardFieldsLoadError","IFrameNotFoundError","CardFieldsFetchFailureError","CardFieldsOperationalError","PayPalAPIError","WalletProviderFailureError","AbortedSessionError","AbortError","GraphQLFetchNetworkError","MonorailRequestError","BreadcrumbsPluginFetchError","InsecurePageError","GraphQLFetchHttpBadRequestError","GraphQLFetchHttpStatusError","GraphQLFetchHttpContentTypeError","GraphQLFetchJsonParseError","SettingsCreateError","MerchantCommunicationError","PostPurchase::ClientJsonParseError","MissingAppContextError"],b="Permission denied to access property",y=["Failed to execute 'appendChild' on 'Node': Identifier 'CURRENCY_LIST' has already been declared","Identifier 'CURRENCY_LIST' has already been declared","Failed to execute 'appendChild' on 'Node': Identifier 'change_ua' has already been declared","Identifier 'change_ua' has already been declared"],f=["Skipped ViewTransition due to another transition starting","Skipped ViewTransition due to document being hidden"];class g{#t=new Map;#e;constructor(n){this.#e=n}checkRate(n){const r=Date.now();let e=this.#t.get(n);e||(e={tokens:this.#e.maxTokens,lastCheck:r},this.#t.set(n,e));const o=(r-e.lastCheck)/1e3*this.#e.refillRate;if(e.tokens=Math.min(this.#e.maxTokens,e.tokens+o),e.lastCheck=r,e.tokens<1){const a=(1-e.tokens)/this.#e.refillRate;return{allowed:!1,reason:this.#e.reason,retryAfterSeconds:Math.ceil(a)}}return e.tokens-=1,{allowed:!0,tokensRemaining:Math.floor(e.tokens)}}}export{g as T,R as U,C as a,I as b,f as c,b as d,k as e,y as f,u as g,S as i,E as s};
