@zippypay/checkout 1.1.11 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -108,7 +108,7 @@ Load from a public npm CDN:
108
108
  </script>
109
109
  ```
110
110
 
111
- Pin the version in production (e.g. `@1.1.0` instead of `@1`).
111
+ Pin the version in production (e.g. `@1.2.0` instead of `@1`).
112
112
 
113
113
  ---
114
114
 
@@ -134,9 +134,12 @@ type ZippyPayConfig = {
134
134
  mode?: 'inline' | 'modal';
135
135
  container?: HTMLElement | string; // required for inline
136
136
  theme?: ZippyTheme;
137
- /** Restrict checkout methods. Omit for full chooser (QR + manual). */
137
+ /** Restrict web checkout methods. Omit for full chooser (QR + manual). */
138
138
  checkoutPolicy?: 'QR' | 'MANUAL';
139
- /** Phone-only app handoff. Ignored on desktop. */
139
+ /**
140
+ * Phone-only app handoff. Ignored on desktop.
141
+ * Default policy: `enforce` (SDK 1.2.0+). Pass `{ policy: 'off' }` for web-only on phone.
142
+ */
140
143
  mobileApp?: { policy?: 'off' | 'option' | 'enforce' };
141
144
  redirectOnComplete?: boolean;
142
145
  redirectOnFailure?: boolean;
@@ -165,17 +168,52 @@ Control which payment methods customers can use:
165
168
 
166
169
  ### Mobile app (phone)
167
170
 
171
+ On **phone**, customers can pay in the Zippy app via **Pay with Zippy**. On **desktop**, mobile app settings are ignored — customers use QR and/or manual per `checkoutPolicy`.
172
+
168
173
  | `mobileApp.policy` | Phone behavior |
169
174
  |---|---|
170
- | `off` *(default)* | Web checkout only (QR / manual per policy) |
171
- | `option` | “Pay with Zippy” on the chooser; opens the app on tap |
172
- | `enforce` | Auto-starts app handoff; QR/manual hidden unless handoff fails |
175
+ | `enforce` *(default)* | Auto-starts Pay with Zippy; QR/manual hidden until app handoff fails |
176
+ | `option` | Full chooser plus a “Pay with Zippy” button |
177
+ | `off` | Web checkout only (QR / manual per `checkoutPolicy`) |
178
+
179
+ Omitting `mobileApp` (or `policy`) is the same as `enforce` (SDK **1.2.0+**). To keep web-only checkout on phone (behavior before 1.2.0):
180
+
181
+ ```typescript
182
+ mobileApp: { policy: 'off' }
183
+ ```
184
+
185
+ #### Pay with Zippy flow
186
+
187
+ 1. Customer taps **Pay with Zippy** (or checkout auto-starts it when `enforce`).
188
+ 2. The button becomes disabled and shows **Opening Zippy…** for up to **8 seconds**.
189
+ 3. The SDK opens the app from that tap — checkout **stays on your page**:
190
+ - **iOS:** `zippy://merchant-payment/{sessionId}`
191
+ - **Android:** intent URL targeting `com.zippy.pay`
192
+ 4. If the app opens → *Complete your payment in the Zippy app.*
193
+ 5. If the app does not open → failed handoff UI:
194
+ - **Try again**
195
+ - **Or pay another way** (QR and/or manual per `checkoutPolicy`)
196
+ - **Install Zippy** (bottom) — opens the native store; **not** opened automatically
173
197
 
174
- On **Pay with Zippy** (iPhone and Android), checkout shows “Opening Zippy…”, tries the app in a hidden iframe so the browser stays on checkout, and waits 5 seconds. If Safari, Chrome, or any other browser is still in front, it opens the App Store (`itms-apps://`) or the Play Store listing (`https://play.google.com/store/apps/details?id=com.zippy.pay`).
198
+ **Install Zippy store links** (fixed by Zippy, not merchant-configurable):
175
199
 
176
- On **desktop**, the app option is never shown — customers use QR or manual as allowed by `checkoutPolicy`.
200
+ | Platform | Web / QR | Install button (native) |
201
+ |---|---|---|
202
+ | iOS | [App Store](https://apps.apple.com/in/app/zippypay/id6806799311) | `itms-apps://apps.apple.com/in/app/zippypay/id6806799311` |
203
+ | Android | [Google Play](https://play.google.com/store/apps/details?id=com.zippy.pay) | `market://details?id=com.zippy.pay` |
204
+
205
+ Deep links and QR payloads use **`sessionId` only** — never include `clientToken`.
206
+
207
+ #### Switching from mobile app to QR or manual
208
+
209
+ If checkout started as **MOBILE_APP** and the customer has **not** yet claimed payment in the app, they may switch from the **failed handoff** screen:
210
+
211
+ | Customer picks | SDK behavior |
212
+ |---|---|
213
+ | **QR code** | Starts QR checkout (pay timer is not reset) |
214
+ | **Zippy account (manual)** | Opens manual entry; backend switches to `MANUAL` when the payer is verified and attached |
177
215
 
178
- Web component attributes: `checkout-policy="QR"`, `mobile-app-policy="enforce"`.
216
+ After payment is claimed in the app or a payer is attached on manual, method switching is no longer available.
179
217
 
180
218
  ### Theming
181
219
 
@@ -206,13 +244,14 @@ The SDK guides customers through payment and keeps your page updated until the s
206
244
  |---|---|
207
245
  | **QR** | Scan a QR code in the Zippy app, then confirm payment in the app |
208
246
  | **Manual** | Enter a Zippy ID, verify identity, then confirm payment in the app |
209
- | **Mobile app** | Open the Zippy app on this phone; fallback to QR/manual if the app cannot open |
247
+ | **Mobile app (phone)** | Tap **Pay with Zippy** → pay in the app; fallback to QR/manual if the app cannot open |
210
248
 
211
- After a method is chosen, the customer generally cannot switch to another method.
249
+ After QR or manual checkout is committed, customers generally cannot switch methods. **Exception:** **MOBILE_APP → QR/MANUAL** is allowed **before claim**, via the failed handoff fallbacks.
212
250
 
213
251
  ### Timers and amount
214
252
 
215
- - A **pay timer** appears once checkout is in progress.
253
+ - A **bottom pay progress bar** shows during the pay window (including idle **Pay with Zippy**).
254
+ - The **inline countdown timer** is hidden on idle and **Opening Zippy…**; it appears after the app opens, on failed handoff, and while awaiting payment.
216
255
  - Display the **amount from the session** passed to your callbacks (`onReady`, `onSessionUpdate`, `onComplete`) — do not rely on amount props from your own page markup alone.
217
256
  - Sessions also have idle and absolute expiry boundaries handled by the SDK UI.
218
257
 
@@ -228,7 +267,7 @@ After a method is chosen, the customer generally cannot switch to another method
228
267
  | `session-id` | Session UUID |
229
268
  | `mode` | `inline`, `modal` |
230
269
  | `checkout-policy` | `QR`, `MANUAL` |
231
- | `mobile-app-policy` | `option`, `enforce` |
270
+ | `mobile-app-policy` | `off`, `option`, `enforce` *(default: enforce when omitted)* |
232
271
  | `theme-*` | See theming table above |
233
272
 
234
273
  Set `clientToken` via the **property** (not an HTML attribute).
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var Y=["COMPLETED","EXPIRED","CANCELLED","FAILED"],xe=["CREATED","AWAITING_PAYMENT"],I=class extends Error{constructor(e){let t=e.detail??e.title??"An unexpected error occurred";super(t),this.name="ZippyPayError",this.code=e.code??"unknown",this.status=e.status??500,this.detail=t,this.correlationId=e.correlationId;}};var le={production:"https://api.zippypay.io",staging:"https://staging.api.zippypay.io",development:""},we="/api/v1";function Je(n){return n in le}function Pe(n){return le[n].replace(/\/+$/,"")}function j(n){let e=n.trim().toLowerCase();if(!Je(e))throw new Error(`Zippy Pay: invalid environment "${n}". Expected one of: ${Object.keys(le).join(", ")}.`);return e}var ke=/^(?=.{3,20}$)[a-z0-9]+(?:\.[a-z0-9]+)?$/,et=/^\+[1-9]\d{7,14}$/,tt=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function V(n){return n.trim().toLowerCase()}function $(n){let e=n.trim();return e.includes("@")?e.toLowerCase():e.startsWith("+")?e:e.toLowerCase()}function Rt(n){return ke.test(V(n))}function ze(n){let e=n.trim();return e.length<3||e.length>100||/\s/.test(e)||/[\x00-\x1f\x7f]/.test(e)?false:e.includes("@")?tt.test(e):e.startsWith("+")?et.test(e):ke.test(e.toLowerCase())}function Ht(){return "Enter 3\u201320 lowercase letters or digits, with at most one dot (e.g. john.doe12)."}function Ee(){return "Enter a Zippy ID, email, or phone number in E.164 format (e.g. +15551234567)."}function it(n){return /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(n)}var Ut={USD:"en-US"};function Ce(n,e){let t=Number.parseFloat(n);if(Number.isNaN(t))return `${n} ${e}`;let i=Ut[e]??"en-US";return new Intl.NumberFormat(i,{style:"currency",currency:e,minimumFractionDigits:2,maximumFractionDigits:2}).format(t)}var Ae=7;function nt(n,e,t="success"){return n==="redirect"?t==="failure"?"You will be redirected shortly in":"You will be redirected in":e==="modal"?"This window will close automatically in":"This checkout will close automatically in"}function rt(n){switch(n){case "success":return {kind:"success",title:"Payment complete",detail:"Your payment was successful."};case "expired":return {kind:"failure",title:"Payment timed out",detail:"The time to complete this payment has ended. Return to the merchant and try again."};case "failed":return {kind:"failure",title:"Payment failed",detail:"Your payment could not be completed. Please try again or contact the merchant."};case "cancelled":return {kind:"failure",title:"Payment cancelled",detail:"This payment was cancelled."};case "declined":return {kind:"failure",title:"Payment declined",detail:"Your payment was declined. Please try again or contact the merchant."};case "invalid-session":return {kind:"failure",title:"Checkout unavailable",detail:"This checkout link is no longer valid. Please ask the merchant for a new one."};default:return {kind:"failure",title:"Something went wrong",detail:"Please try again or contact the merchant."}}}function Me(n){let e=Math.max(0,Math.ceil(n/1e3)),t=Math.floor(e/60),i=e%60;if(t>=60){let r=Math.floor(t/60),a=t%60;return a>0?`${r}h ${a}m`:`${r}h`}return t>0?`${t}m ${i.toString().padStart(2,"0")}s`:`${i}s`}function Se(n){let e=Math.max(0,Math.ceil(n/1e3)),t=Math.floor(e/60),i=e%60;if(t>=60){let r=Math.floor(t/60),a=t%60,o=[`${r} hour${r===1?"":"s"}`];return a>0&&o.push(`${a} minute${a===1?"":"s"}`),o.join(" ")}return t>0?i>0?`${t} minute${t===1?"":"s"} ${i} second${i===1?"":"s"}`:`${t} minute${t===1?"":"s"}`:`${i} second${i===1?"":"s"}`}function ot(n){let e=n.trim().split(/\s+/).filter(Boolean);return e.length===0?"?":e.length===1?e[0].charAt(0).toUpperCase():`${e[0].charAt(0)}${e[e.length-1].charAt(0)}`.toUpperCase()}function at(n){if(typeof n!="string")return n;let e=document.querySelector(n);if(!e)throw new Error(`Zippy Pay: container not found: ${n}`);return e}function st(n){return n.replace(/\/+$/,"")}function Te(n,e){let t=/^https?:\/\//i.test(n),i=typeof window<"u"?window.location.href:"https://localhost/",r=new URL(n,i);for(let[a,o]of Object.entries(e))o!=null&&o!==""&&r.searchParams.set(a,o);return t?r.toString():`${r.pathname}${r.search}${r.hash}`}var G=class{constructor(e){this.baseUrl=st(e.baseUrl),this.sessionId=e.sessionId,this.clientToken=e.clientToken;}async getSession(){return this.request("GET",this.sessionPath())}async bindCheckoutPolicy(e){return this.request("POST",`${this.sessionPath()}/checkout/bind-policy`,e)}async verifyPayer(e){return this.request("POST",`${this.sessionPath()}/payer/verify`,{query:$(e)})}async attachPayer(e){return this.request("POST",`${this.sessionPath()}/payer`,{paymentId:V(e)})}async startCheckout(e,t){let i={method:e,surface:t};return this.request("POST",`${this.sessionPath()}/checkout/start`,i)}startQrCheckout(e){return this.startCheckout("QR",e)}startMobileAppCheckout(e){return this.startCheckout("MOBILE_APP",e)}startManualCheckout(e){return this.startCheckout("MANUAL",e)}sessionPath(){return `${we}/payment-sessions/${this.sessionId}`}headers(){return {Accept:"application/json","Content-Type":"application/json","X-Payment-Session-Token":this.clientToken}}async request(e,t,i){let r=await fetch(`${this.baseUrl}${t}`,{method:e,headers:this.headers(),body:i===void 0?void 0:JSON.stringify(i)});if(r.ok)return await r.json();throw await this.parseError(r)}async parseError(e){if((e.headers.get("content-type")??"").includes("application/problem+json")){let i=await e.json();return new I({...i,status:i.status??e.status})}return new I({status:e.status,code:"unknown",title:"Request failed",detail:e.statusText||"Request failed"})}};async function Le(n,e){try{return await n.attachPayer(e)}catch(t){if(!(t instanceof I)||t.code!=="payment-session.payer-attached")throw t;let i=await n.getSession();if(i.payer?.paymentId===V(e))return i;throw t}}var pt={primary:"#3f63f3",primaryForeground:"#ffffff",primaryGradientEnd:"#6b84ff",primaryHover:"#2f4fd1",primarySoft:"#eef2ff",background:"#ffffff",surface:"#ffffff",surfaceMuted:"#f6f8fb",text:"#0f172a",textMuted:"#64748b",border:"#e2e8f0",error:"#dc2626",success:"#059669",borderRadius:"20px",radiusButton:"24px",radiusInput:"12px",radiusCard:"20px",fontFamily:"'DM Sans', system-ui, -apple-system, sans-serif",mode:"light"},Dt={background:"#0f172a",surface:"#1e293b",text:"#f8fafc",textMuted:"#94a3b8",border:"#334155"};function lt(n){let e={...pt,...n},t=typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches,i=e.mode==="auto"?t?"dark":"light":e.mode??"light";return i==="dark"?{...e,...Dt,mode:i}:{...e,mode:i}}function Ie(n,e){let t=lt(e);n.style.setProperty("--zippy-primary",t.primary),n.style.setProperty("--zippy-primary-foreground",t.primaryForeground),n.style.setProperty("--zippy-primary-gradient-end",t.primaryGradientEnd),n.style.setProperty("--zippy-primary-hover",t.primaryHover),n.style.setProperty("--zippy-primary-soft",t.primarySoft),n.style.setProperty("--zippy-background",t.background),n.style.setProperty("--zippy-surface",t.surface),n.style.setProperty("--zippy-surface-muted",t.surfaceMuted),n.style.setProperty("--zippy-text",t.text),n.style.setProperty("--zippy-text-muted",t.textMuted),n.style.setProperty("--zippy-border",t.border),n.style.setProperty("--zippy-error",t.error),n.style.setProperty("--zippy-success",t.success),n.style.setProperty("--zippy-radius",t.borderRadius),n.style.setProperty("--zippy-radius-button",t.radiusButton),n.style.setProperty("--zippy-radius-input",t.radiusInput),n.style.setProperty("--zippy-radius-card",t.radiusCard),n.style.setProperty("--zippy-font-family",t.fontFamily);}var Ft="@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&display=swap');",ct=`
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var Y=["COMPLETED","EXPIRED","CANCELLED","FAILED"],ve=["CREATED","AWAITING_PAYMENT"],I=class extends Error{constructor(e){let t=e.detail??e.title??"An unexpected error occurred";super(t),this.name="ZippyPayError",this.code=e.code??"unknown",this.status=e.status??500,this.detail=t,this.correlationId=e.correlationId;}};var le={production:"https://api.zippypay.io",staging:"https://staging.api.zippypay.io",development:""},we="/api/v1";function Je(n){return n in le}function Pe(n){return le[n].replace(/\/+$/,"")}function j(n){let e=n.trim().toLowerCase();if(!Je(e))throw new Error(`Zippy Pay: invalid environment "${n}". Expected one of: ${Object.keys(le).join(", ")}.`);return e}var ke=/^(?=.{3,20}$)[a-z0-9]+(?:\.[a-z0-9]+)?$/,et=/^\+[1-9]\d{7,14}$/,tt=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function V(n){return n.trim().toLowerCase()}function $(n){let e=n.trim();return e.includes("@")?e.toLowerCase():e.startsWith("+")?e:e.toLowerCase()}function Rt(n){return ke.test(V(n))}function ze(n){let e=n.trim();return e.length<3||e.length>100||/\s/.test(e)||/[\x00-\x1f\x7f]/.test(e)?false:e.includes("@")?tt.test(e):e.startsWith("+")?et.test(e):ke.test(e.toLowerCase())}function Ht(){return "Enter 3\u201320 lowercase letters or digits, with at most one dot (e.g. john.doe12)."}function Ee(){return "Enter a Zippy ID, email, or phone number in E.164 format (e.g. +15551234567)."}function it(n){return /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(n)}var Ut={USD:"en-US"};function Ce(n,e){let t=Number.parseFloat(n);if(Number.isNaN(t))return `${n} ${e}`;let i=Ut[e]??"en-US";return new Intl.NumberFormat(i,{style:"currency",currency:e,minimumFractionDigits:2,maximumFractionDigits:2}).format(t)}var Ae=7;function nt(n,e,t="success"){return n==="redirect"?t==="failure"?"You will be redirected shortly in":"You will be redirected in":e==="modal"?"This window will close automatically in":"This checkout will close automatically in"}function rt(n){switch(n){case "success":return {kind:"success",title:"Payment complete",detail:"Your payment was successful."};case "expired":return {kind:"failure",title:"Payment timed out",detail:"The time to complete this payment has ended. Return to the merchant and try again."};case "failed":return {kind:"failure",title:"Payment failed",detail:"Your payment could not be completed. Please try again or contact the merchant."};case "cancelled":return {kind:"failure",title:"Payment cancelled",detail:"This payment was cancelled."};case "declined":return {kind:"failure",title:"Payment declined",detail:"Your payment was declined. Please try again or contact the merchant."};case "invalid-session":return {kind:"failure",title:"Checkout unavailable",detail:"This checkout link is no longer valid. Please ask the merchant for a new one."};default:return {kind:"failure",title:"Something went wrong",detail:"Please try again or contact the merchant."}}}function Me(n){let e=Math.max(0,Math.ceil(n/1e3)),t=Math.floor(e/60),i=e%60;if(t>=60){let r=Math.floor(t/60),a=t%60;return a>0?`${r}h ${a}m`:`${r}h`}return t>0?`${t}m ${i.toString().padStart(2,"0")}s`:`${i}s`}function Se(n){let e=Math.max(0,Math.ceil(n/1e3)),t=Math.floor(e/60),i=e%60;if(t>=60){let r=Math.floor(t/60),a=t%60,o=[`${r} hour${r===1?"":"s"}`];return a>0&&o.push(`${a} minute${a===1?"":"s"}`),o.join(" ")}return t>0?i>0?`${t} minute${t===1?"":"s"} ${i} second${i===1?"":"s"}`:`${t} minute${t===1?"":"s"}`:`${i} second${i===1?"":"s"}`}function ot(n){let e=n.trim().split(/\s+/).filter(Boolean);return e.length===0?"?":e.length===1?e[0].charAt(0).toUpperCase():`${e[0].charAt(0)}${e[e.length-1].charAt(0)}`.toUpperCase()}function at(n){if(typeof n!="string")return n;let e=document.querySelector(n);if(!e)throw new Error(`Zippy Pay: container not found: ${n}`);return e}function st(n){return n.replace(/\/+$/,"")}function Te(n,e){let t=/^https?:\/\//i.test(n),i=typeof window<"u"?window.location.href:"https://localhost/",r=new URL(n,i);for(let[a,o]of Object.entries(e))o!=null&&o!==""&&r.searchParams.set(a,o);return t?r.toString():`${r.pathname}${r.search}${r.hash}`}var G=class{constructor(e){this.baseUrl=st(e.baseUrl),this.sessionId=e.sessionId,this.clientToken=e.clientToken;}async getSession(){return this.request("GET",this.sessionPath())}async bindCheckoutPolicy(e){return this.request("POST",`${this.sessionPath()}/checkout/bind-policy`,e)}async verifyPayer(e){return this.request("POST",`${this.sessionPath()}/payer/verify`,{query:$(e)})}async attachPayer(e){return this.request("POST",`${this.sessionPath()}/payer`,{paymentId:V(e)})}async startCheckout(e,t){let i={method:e,surface:t};return this.request("POST",`${this.sessionPath()}/checkout/start`,i)}startQrCheckout(e){return this.startCheckout("QR",e)}startMobileAppCheckout(e){return this.startCheckout("MOBILE_APP",e)}startManualCheckout(e){return this.startCheckout("MANUAL",e)}sessionPath(){return `${we}/payment-sessions/${this.sessionId}`}headers(){return {Accept:"application/json","Content-Type":"application/json","X-Payment-Session-Token":this.clientToken}}async request(e,t,i){let r=await fetch(`${this.baseUrl}${t}`,{method:e,headers:this.headers(),body:i===void 0?void 0:JSON.stringify(i)});if(r.ok)return await r.json();throw await this.parseError(r)}async parseError(e){if((e.headers.get("content-type")??"").includes("application/problem+json")){let i=await e.json();return new I({...i,status:i.status??e.status})}return new I({status:e.status,code:"unknown",title:"Request failed",detail:e.statusText||"Request failed"})}};async function Le(n,e){try{return await n.attachPayer(e)}catch(t){if(!(t instanceof I)||t.code!=="payment-session.payer-attached")throw t;let i=await n.getSession();if(i.payer?.paymentId===V(e))return i;throw t}}var pt={primary:"#3f63f3",primaryForeground:"#ffffff",primaryGradientEnd:"#6b84ff",primaryHover:"#2f4fd1",primarySoft:"#eef2ff",background:"#ffffff",surface:"#ffffff",surfaceMuted:"#f6f8fb",text:"#0f172a",textMuted:"#64748b",border:"#e2e8f0",error:"#dc2626",success:"#059669",borderRadius:"20px",radiusButton:"24px",radiusInput:"12px",radiusCard:"20px",fontFamily:"'DM Sans', system-ui, -apple-system, sans-serif",mode:"light"},Dt={background:"#0f172a",surface:"#1e293b",text:"#f8fafc",textMuted:"#94a3b8",border:"#334155"};function lt(n){let e={...pt,...n},t=typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches,i=e.mode==="auto"?t?"dark":"light":e.mode??"light";return i==="dark"?{...e,...Dt,mode:i}:{...e,mode:i}}function Ie(n,e){let t=lt(e);n.style.setProperty("--zippy-primary",t.primary),n.style.setProperty("--zippy-primary-foreground",t.primaryForeground),n.style.setProperty("--zippy-primary-gradient-end",t.primaryGradientEnd),n.style.setProperty("--zippy-primary-hover",t.primaryHover),n.style.setProperty("--zippy-primary-soft",t.primarySoft),n.style.setProperty("--zippy-background",t.background),n.style.setProperty("--zippy-surface",t.surface),n.style.setProperty("--zippy-surface-muted",t.surfaceMuted),n.style.setProperty("--zippy-text",t.text),n.style.setProperty("--zippy-text-muted",t.textMuted),n.style.setProperty("--zippy-border",t.border),n.style.setProperty("--zippy-error",t.error),n.style.setProperty("--zippy-success",t.success),n.style.setProperty("--zippy-radius",t.borderRadius),n.style.setProperty("--zippy-radius-button",t.radiusButton),n.style.setProperty("--zippy-radius-input",t.radiusInput),n.style.setProperty("--zippy-radius-card",t.radiusCard),n.style.setProperty("--zippy-font-family",t.fontFamily);}var Ft="@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&display=swap');",ct=`
2
2
  ${Ft}
3
3
 
4
4
  :host {
@@ -1730,8 +1730,8 @@ input {
1730
1730
  transform: translateY(0) scale(1);
1731
1731
  }
1732
1732
  }
1733
- `;function ut(n){if((n.mode??"inline")==="modal")return Zt(n);if(!n.container)throw new Error('Zippy Pay: `container` is required when mode is "inline".');let t=at(n.container);t.innerHTML="";let i=document.createElement("div");return i.className="zippy-inline-host",t.appendChild(i),{host:i,overlay:null,escapeHandler:null,destroy:()=>{i.remove();}}}function Zt(n){let e=document.createElement("div");e.className="zippy-overlay",e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-label","Zippy Pay checkout"),e.style.display="none";let t=document.createElement("style");t.textContent=dt,e.appendChild(t);let i=document.createElement("div");i.className="zippy-modal-panel";let r=document.createElement("div");r.className="zippy-modal-host",i.appendChild(r),e.appendChild(i),document.body.appendChild(e),(n.closeOnBackdropClick??false)&&e.addEventListener("click",s=>{s.target===e&&n.onClose?.();});let o={host:r,overlay:e,escapeHandler:null,destroy:()=>{o.escapeHandler&&document.removeEventListener("keydown",o.escapeHandler),e.remove(),document.body.style.overflow="";}};return o}function ht(n,e,t){if(!n.overlay)return;n.overlay.style.display="flex",document.body.style.overflow="hidden",(e.closeOnEscape??false)&&!n.escapeHandler&&(n.escapeHandler=a=>{a.key==="Escape"&&t();},document.addEventListener("keydown",n.escapeHandler)),n.host.querySelector("input, button")?.focus();}function mt(n){n.overlay&&(n.overlay.style.display="none",document.body.style.overflow="",n.escapeHandler&&(document.removeEventListener("keydown",n.escapeHandler),n.escapeHandler=null));}var K=class{constructor(e,t){this.fetchSession=e;this.options=t;this.timer=null;this.running=false;this.stopped=false;}start(e){if(!this.running){if(this.running=true,this.stopped=false,e&&(this.options.onUpdate(e),!this.shouldContinue(e))){this.stop();return}this.tick();}}stop(){this.stopped=true,this.running=false,this.timer!==null&&(clearTimeout(this.timer),this.timer=null);}shouldContinue(e){return this.options.shouldPoll?this.options.shouldPoll(e):xe.includes(e.status)}intervalMs(){let e=this.options.intervalMs??3e3,t=this.options.hiddenIntervalMs??1e4;return typeof document<"u"&&document.hidden?t:e}scheduleNext(){this.stopped||(this.timer=setTimeout(()=>{this.tick();},this.intervalMs()));}async tick(){if(!this.stopped){try{let e=await this.fetchSession();if(this.options.onUpdate(e),!this.shouldContinue(e)){this.stop();return}}catch(e){this.options.onError?.(e);}this.scheduleNext();}}};function ce(n){return Y.includes(n)}function qt(n){switch(n){case "CREATED":return "choose-method";case "AWAITING_PAYMENT":return "awaiting";case "COMPLETED":return "success";case "EXPIRED":return "expired";case "CANCELLED":return "cancelled";case "FAILED":return "failed";default:return "error"}}function yt(n){return n.phase==="PAYING"&&n.paymentExpiryAt?n.paymentExpiryAt:null}var $t=["qr-active","mobile-app-active","awaiting","manual-confirm"],Qt=["loading","choose-method","manual-entry","manual-picker","success","expired","cancelled","declined","failed","invalid-session","error"];function Ne(n,e){return !n?.paymentExpiryAt||Qt.includes(e)||Y.includes(n.status)||_(n.paymentExpiryAt)<=0?false:yt(n)?true:$t.includes(e)}function X(n){if(!n.paymentExpiryAt)return null;let e=n.paymentExpiryAt,t=new Date(e).getTime(),i=n.paymentStartAt?new Date(n.paymentStartAt).getTime():t-300*1e3,r=t-i;return r<=0?0:Math.min(1,Math.max(0,_(e)/r))}function Wt(n){return n.phase==="IDLE"&&n.expiresAt?n.expiresAt:null}function _(n){return Math.max(0,new Date(n).getTime()-Date.now())}function Yt(){return B()==="phone"}function ft(){if(typeof navigator>"u")return "android";let n=navigator.userAgent??"";return /iPad|iPhone|iPod/.test(n)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1?"ios":"android"}function Be(){return typeof navigator>"u"?false:/Android/i.test(navigator.userAgent??"")}function B(){if(typeof window>"u")return "desktop";let n=window.matchMedia("(max-width: 520px)").matches,e=window.matchMedia("(pointer: coarse)").matches;return n&&e?"phone":"desktop"}function Oe(n){if(typeof window>"u")return ()=>{};let e=[window.matchMedia("(max-width: 520px)"),window.matchMedia("(pointer: coarse)")],t=()=>{n(B());};for(let i of e)i.addEventListener("change",t);return window.addEventListener("orientationchange",t),window.addEventListener("resize",t),()=>{for(let i of e)i.removeEventListener("change",t);window.removeEventListener("orientationchange",t),window.removeEventListener("resize",t);}}function q(n){return n.checkoutPolicy!=null||n.mobileAppPolicy!=null}function jt(n){return n==null}function de(n){return n==null||n==="QR"}function _e(n){return n==null||n==="MANUAL"}function ue(n,e){return e==="ENFORCE"&&(n==null||n==="QR"||n==="MANUAL")}function gt(n){return n?.policy==="enforce"?"ENFORCE":n?.policy==="option"?"OPTION":"OFF"}function he(n){let e={};(n.checkoutPolicy==="QR"||n.checkoutPolicy==="MANUAL")&&(e.checkoutPolicy=n.checkoutPolicy);let t=gt(n.mobileApp);return t!=="OFF"&&(e.mobileAppPolicy=t),e}function bt(n){return {qr:de(n),manual:_e(n)}}function vt(n,e,t){if(t==="desktop")return {qr:de(n),manual:_e(n),mobileApp:false};let i=ue(n,e);return {qr:de(n)&&!i,manual:_e(n)&&!i,mobileApp:i||e==="OPTION"&&(n==null||n==="QR"||n==="MANUAL")}}function ee(n,e,t){return t==="desktop"?n==="MANUAL"?"auto-manual":n==="QR"?"auto-qr":"chooser":ue(n,e)?"enforce-mobile-app":n==="MANUAL"&&e==="OFF"?"auto-manual":n==="QR"&&e==="OFF"?"auto-qr":"chooser"}function J(n,e,t,i){return i==="MOBILE_APP"?t==="desktop"||e==="OFF"?false:ue(n,e)?true:e==="OPTION"?n==null||n==="QR"||n==="MANUAL":false:!(!de(n)||t==="phone"&&ue(n,e))}function Re(n,e,t){let i=ee(n,e,t);return i==="enforce-mobile-app"?J(n,e,t,"MOBILE_APP")?"MOBILE_APP":null:i==="auto-qr"&&J(n,e,t,"QR")?"QR":null}function te(n,e,t=B()){return {checkoutPolicy:n,mobileAppPolicy:e,surface:t,methodAvailability:vt(n,e,t),allowManualBack:n==null}}function He(n,e=B()){if(!q(n))throw new Error("Checkout policy is not bound on the payment session.");return te(n.checkoutPolicy,n.mobileAppPolicy??"OFF",e)}function Ue(n,e,t=B()){let i=he({checkoutPolicy:n,mobileApp:e});return te(i.checkoutPolicy??null,i.mobileAppPolicy??"OFF",t)}var ie="com.zippy.pay",xt="https://apps.apple.com/in/app/zippypay/id6806799311",ne={ios:xt,android:`https://play.google.com/store/apps/details?id=${ie}`},wt=`itms-apps://${xt.replace(/^https:\/\//,"")}`,Pt=`market://details?id=${ie}`;function Vt(n){return ne[n]}function De(n){return n==="ios"?wt:Pt}function Fe(n="zippy-app-link-icon"){return `<svg class="${n}" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M16.823 12.345c-.027-2.702 2.208-3.997 2.307-4.059-1.255-1.836-3.211-2.088-3.905-2.118-1.663-.169-3.246.98-4.089.98-.844 0-2.147-.955-3.531-.929-1.818.027-3.493 1.056-4.429 2.683-1.888 3.276-.483 8.131 1.356 10.791.899 1.299 1.968 2.759 3.374 2.707 1.355-.054 1.866-.877 3.504-.877 1.637 0 2.099.877 3.527.85 1.457-.027 2.381-1.32 3.276-2.622.99-1.449 1.396-2.851 1.419-2.922-.031-.014-2.724-1.045-2.751-4.146zM14.303 4.772c.747-.907 1.249-2.164 1.111-3.422-1.075.043-2.375.717-3.147 1.623-.693.802-1.299 2.095-1.136 3.333 1.201.093 2.432-.61 3.172-1.534z"/></svg>`}function Ze(n="zippy-app-link-icon"){return `<svg class="${n} zippy-app-link-icon--play" viewBox="0 0 256 283" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path fill="#EA4335" d="M119.553 134.916 1.06 259.061c2.696 9.556 9.658 17.33 18.861 21.059 9.202 3.73 19.612 2.996 28.201-1.987l133.327-75.935-61.896-67.282z"/><path fill="#FBBC04" d="M239.371 113.814 181.714 80.791 116.816 137.742l65.162 64.279 57.216-32.669c10.332-5.409 16.806-16.107 16.806-27.769 0-11.662-6.474-22.36-16.806-27.769h.177z"/><path fill="#4285F4" d="M1.06 23.487C.344 26.135-.013 28.867 0 31.61v219.327c.008 2.742.364 5.472 1.06 8.124L123.615 138.095 1.06 23.487z"/><path fill="#34A853" d="M120.436 141.274 181.714 80.791 48.563 4.503C43.554 1.569 37.857.016 32.052 0 17.644-.028 4.978 9.534 1.06 23.399l119.376 117.875z"/></svg>`}function kt(){return Fe("zippy-app-link-icon")}function zt(){return Ze("zippy-app-link-icon")}var Q=function(n,e){let r=n,a=re[e],o=null,s=0,p=null,d=[],g={},f=function(c,y){s=r*4+17,o=(function(l){let h=new Array(l);for(let u=0;u<l;u+=1){h[u]=new Array(l);for(let b=0;b<l;b+=1)h[u][b]=null;}return h})(s),m(0,0),m(s-7,0),m(0,s-7),P(),S(),N(c,y),r>=7&&z(c),p==null&&(p=W(r,a,d)),T(p,y);},m=function(c,y){for(let l=-1;l<=7;l+=1)if(!(c+l<=-1||s<=c+l))for(let h=-1;h<=7;h+=1)y+h<=-1||s<=y+h||(0<=l&&l<=6&&(h==0||h==6)||0<=h&&h<=6&&(l==0||l==6)||2<=l&&l<=4&&2<=h&&h<=4?o[c+l][y+h]=true:o[c+l][y+h]=false);},w=function(){let c=0,y=0;for(let l=0;l<8;l+=1){f(true,l);let h=U.getLostPoint(g);(l==0||c>h)&&(c=h,y=l);}return y},S=function(){for(let c=8;c<s-8;c+=1)o[c][6]==null&&(o[c][6]=c%2==0);for(let c=8;c<s-8;c+=1)o[6][c]==null&&(o[6][c]=c%2==0);},P=function(){let c=U.getPatternPosition(r);for(let y=0;y<c.length;y+=1)for(let l=0;l<c.length;l+=1){let h=c[y],u=c[l];if(o[h][u]==null)for(let b=-2;b<=2;b+=1)for(let v=-2;v<=2;v+=1)b==-2||b==2||v==-2||v==2||b==0&&v==0?o[h+b][u+v]=true:o[h+b][u+v]=false;}},z=function(c){let y=U.getBCHTypeNumber(r);for(let l=0;l<18;l+=1){let h=!c&&(y>>l&1)==1;o[Math.floor(l/3)][l%3+s-8-3]=h;}for(let l=0;l<18;l+=1){let h=!c&&(y>>l&1)==1;o[l%3+s-8-3][Math.floor(l/3)]=h;}},N=function(c,y){let l=a<<3|y,h=U.getBCHTypeInfo(l);for(let u=0;u<15;u+=1){let b=!c&&(h>>u&1)==1;u<6?o[u][8]=b:u<8?o[u+1][8]=b:o[s-15+u][8]=b;}for(let u=0;u<15;u+=1){let b=!c&&(h>>u&1)==1;u<8?o[8][s-u-1]=b:u<9?o[8][15-u-1+1]=b:o[8][15-u-1]=b;}o[s-8][8]=!c;},T=function(c,y){let l=-1,h=s-1,u=7,b=0,v=U.getMaskFunction(y);for(let k=s-1;k>0;k-=2)for(k==6&&(k-=1);;){for(let E=0;E<2;E+=1)if(o[h][k-E]==null){let A=false;b<c.length&&(A=(c[b]>>>u&1)==1),v(h,k-E)&&(A=!A),o[h][k-E]=A,u-=1,u==-1&&(b+=1,u=7);}if(h+=l,h<0||s<=h){h-=l,l=-l;break}}},M=function(c,y){let l=0,h=0,u=0,b=new Array(y.length),v=new Array(y.length);for(let x=0;x<y.length;x+=1){let C=y[x].dataCount,O=y[x].totalCount-C;h=Math.max(h,C),u=Math.max(u,O),b[x]=new Array(C);for(let R=0;R<b[x].length;R+=1)b[x][R]=255&c.getBuffer()[R+l];l+=C;let ve=U.getErrorCorrectPolynomial(O),Ke=oe(b[x],ve.getLength()-1).mod(ve);v[x]=new Array(ve.getLength()-1);for(let R=0;R<v[x].length;R+=1){let Xe=R+Ke.getLength()-v[x].length;v[x][R]=Xe>=0?Ke.getAt(Xe):0;}}let k=0;for(let x=0;x<y.length;x+=1)k+=y[x].totalCount;let E=new Array(k),A=0;for(let x=0;x<h;x+=1)for(let C=0;C<y.length;C+=1)x<b[C].length&&(E[A]=b[C][x],A+=1);for(let x=0;x<u;x+=1)for(let C=0;C<y.length;C+=1)x<v[C].length&&(E[A]=v[C][x],A+=1);return E},W=function(c,y,l){let h=Et.getRSBlocks(c,y),u=Ct();for(let v=0;v<l.length;v+=1){let k=l[v];u.put(k.getMode(),4),u.put(k.getLength(),U.getLengthInBits(k.getMode(),c)),k.write(u);}let b=0;for(let v=0;v<h.length;v+=1)b+=h[v].dataCount;if(u.getLengthInBits()>b*8)throw "code length overflow. ("+u.getLengthInBits()+">"+b*8+")";for(u.getLengthInBits()+4<=b*8&&u.put(0,4);u.getLengthInBits()%8!=0;)u.putBit(false);for(;!(u.getLengthInBits()>=b*8||(u.put(236,8),u.getLengthInBits()>=b*8));)u.put(17,8);return M(u,h)};g.addData=function(c,y){y=y||"Byte";let l=null;switch(y){case "Numeric":l=Gt(c);break;case "Alphanumeric":l=Kt(c);break;case "Byte":l=Xt(c);break;case "Kanji":l=Jt(c);break;default:throw "mode:"+y}d.push(l),p=null;},g.isDark=function(c,y){if(c<0||s<=c||y<0||s<=y)throw c+","+y;return o[c][y]},g.getModuleCount=function(){return s},g.make=function(){if(r<1){let c=1;for(;c<40;c++){let y=Et.getRSBlocks(c,a),l=Ct();for(let u=0;u<d.length;u++){let b=d[u];l.put(b.getMode(),4),l.put(b.getLength(),U.getLengthInBits(b.getMode(),c)),b.write(l);}let h=0;for(let u=0;u<y.length;u++)h+=y[u].dataCount;if(l.getLengthInBits()<=h*8)break}r=c;}f(false,w());},g.createTableTag=function(c,y){c=c||2,y=typeof y>"u"?c*4:y;let l="";l+='<table style="',l+=" border-width: 0px; border-style: none;",l+=" border-collapse: collapse;",l+=" padding: 0px; margin: "+y+"px;",l+='">',l+="<tbody>";for(let h=0;h<g.getModuleCount();h+=1){l+="<tr>";for(let u=0;u<g.getModuleCount();u+=1)l+='<td style="',l+=" border-width: 0px; border-style: none;",l+=" border-collapse: collapse;",l+=" padding: 0px; margin: 0px;",l+=" width: "+c+"px;",l+=" height: "+c+"px;",l+=" background-color: ",l+=g.isDark(h,u)?"#000000":"#ffffff",l+=";",l+='"/>';l+="</tr>";}return l+="</tbody>",l+="</table>",l},g.createSvgTag=function(c,y,l,h){let u={};typeof arguments[0]=="object"&&(u=arguments[0],c=u.cellSize,y=u.margin,l=u.alt,h=u.title),c=c||2,y=typeof y>"u"?c*4:y,l=typeof l=="string"?{text:l}:l||{},l.text=l.text||null,l.id=l.text?l.id||"qrcode-description":null,h=typeof h=="string"?{text:h}:h||{},h.text=h.text||null,h.id=h.text?h.id||"qrcode-title":null;let b=g.getModuleCount()*c+y*2,v,k,E,A,x="",C;for(C="l"+c+",0 0,"+c+" -"+c+",0 0,-"+c+"z ",x+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',x+=u.scalable?"":' width="'+b+'px" height="'+b+'px"',x+=' viewBox="0 0 '+b+" "+b+'" ',x+=' preserveAspectRatio="xMinYMin meet"',x+=h.text||l.text?' role="img" aria-labelledby="'+F([h.id,l.id].join(" ").trim())+'"':"",x+=">",x+=h.text?'<title id="'+F(h.id)+'">'+F(h.text)+"</title>":"",x+=l.text?'<description id="'+F(l.id)+'">'+F(l.text)+"</description>":"",x+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',x+='<path d="',E=0;E<g.getModuleCount();E+=1)for(A=E*c+y,v=0;v<g.getModuleCount();v+=1)g.isDark(E,v)&&(k=v*c+y,x+="M"+k+","+A+C);return x+='" stroke="transparent" fill="black"/>',x+="</svg>",x},g.createDataURL=function(c,y){c=c||2,y=typeof y>"u"?c*4:y;let l=g.getModuleCount()*c+y*2,h=y,u=l-y;return ni(l,l,function(b,v){if(h<=b&&b<u&&h<=v&&v<u){let k=Math.floor((b-h)/c),E=Math.floor((v-h)/c);return g.isDark(E,k)?0:1}else return 1})},g.createImgTag=function(c,y,l){c=c||2,y=typeof y>"u"?c*4:y;let h=g.getModuleCount()*c+y*2,u="";return u+="<img",u+=' src="',u+=g.createDataURL(c,y),u+='"',u+=' width="',u+=h,u+='"',u+=' height="',u+=h,u+='"',l&&(u+=' alt="',u+=F(l),u+='"'),u+="/>",u};let F=function(c){let y="";for(let l=0;l<c.length;l+=1){let h=c.charAt(l);switch(h){case "<":y+="&lt;";break;case ">":y+="&gt;";break;case "&":y+="&amp;";break;case '"':y+="&quot;";break;default:y+=h;break}}return y},Z=function(c){c=typeof c>"u"?2:c;let l=g.getModuleCount()*1+c*2,h=c,u=l-c,b,v,k,E,A,x={"\u2588\u2588":"\u2588","\u2588 ":"\u2580"," \u2588":"\u2584"," ":" "},C={"\u2588\u2588":"\u2580","\u2588 ":"\u2580"," \u2588":" "," ":" "},O="";for(b=0;b<l;b+=2){for(k=Math.floor((b-h)/1),E=Math.floor((b+1-h)/1),v=0;v<l;v+=1)A="\u2588",h<=v&&v<u&&h<=b&&b<u&&g.isDark(k,Math.floor((v-h)/1))&&(A=" "),h<=v&&v<u&&h<=b+1&&b+1<u&&g.isDark(E,Math.floor((v-h)/1))?A+=" ":A+="\u2588",O+=c<1&&b+1>=u?C[A]:x[A];O+=`
1734
- `;}return l%2&&c>0?O.substring(0,O.length-l-1)+Array(l+1).join("\u2580"):O.substring(0,O.length-1)};return g.createASCII=function(c,y){if(c=c||1,c<2)return Z(y);c-=1,y=typeof y>"u"?c*2:y;let l=g.getModuleCount()*c+y*2,h=y,u=l-y,b,v,k,E,A=Array(c+1).join("\u2588\u2588"),x=Array(c+1).join(" "),C="",O="";for(b=0;b<l;b+=1){for(k=Math.floor((b-h)/c),O="",v=0;v<l;v+=1)E=1,h<=v&&v<u&&h<=b&&b<u&&g.isDark(k,Math.floor((v-h)/c))&&(E=0),O+=E?A:x;for(k=0;k<c;k+=1)C+=O+`
1733
+ `;function ut(n){if((n.mode??"inline")==="modal")return Zt(n);if(!n.container)throw new Error('Zippy Pay: `container` is required when mode is "inline".');let t=at(n.container);t.innerHTML="";let i=document.createElement("div");return i.className="zippy-inline-host",t.appendChild(i),{host:i,overlay:null,escapeHandler:null,destroy:()=>{i.remove();}}}function Zt(n){let e=document.createElement("div");e.className="zippy-overlay",e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-label","Zippy Pay checkout"),e.style.display="none";let t=document.createElement("style");t.textContent=dt,e.appendChild(t);let i=document.createElement("div");i.className="zippy-modal-panel";let r=document.createElement("div");r.className="zippy-modal-host",i.appendChild(r),e.appendChild(i),document.body.appendChild(e),(n.closeOnBackdropClick??false)&&e.addEventListener("click",s=>{s.target===e&&n.onClose?.();});let o={host:r,overlay:e,escapeHandler:null,destroy:()=>{o.escapeHandler&&document.removeEventListener("keydown",o.escapeHandler),e.remove(),document.body.style.overflow="";}};return o}function ht(n,e,t){if(!n.overlay)return;n.overlay.style.display="flex",document.body.style.overflow="hidden",(e.closeOnEscape??false)&&!n.escapeHandler&&(n.escapeHandler=a=>{a.key==="Escape"&&t();},document.addEventListener("keydown",n.escapeHandler)),n.host.querySelector("input, button")?.focus();}function mt(n){n.overlay&&(n.overlay.style.display="none",document.body.style.overflow="",n.escapeHandler&&(document.removeEventListener("keydown",n.escapeHandler),n.escapeHandler=null));}var K=class{constructor(e,t){this.fetchSession=e;this.options=t;this.timer=null;this.running=false;this.stopped=false;}start(e){if(!this.running){if(this.running=true,this.stopped=false,e&&(this.options.onUpdate(e),!this.shouldContinue(e))){this.stop();return}this.tick();}}stop(){this.stopped=true,this.running=false,this.timer!==null&&(clearTimeout(this.timer),this.timer=null);}shouldContinue(e){return this.options.shouldPoll?this.options.shouldPoll(e):ve.includes(e.status)}intervalMs(){let e=this.options.intervalMs??3e3,t=this.options.hiddenIntervalMs??1e4;return typeof document<"u"&&document.hidden?t:e}scheduleNext(){this.stopped||(this.timer=setTimeout(()=>{this.tick();},this.intervalMs()));}async tick(){if(!this.stopped){try{let e=await this.fetchSession();if(this.options.onUpdate(e),!this.shouldContinue(e)){this.stop();return}}catch(e){this.options.onError?.(e);}this.scheduleNext();}}};function ce(n){return Y.includes(n)}function qt(n){switch(n){case "CREATED":return "choose-method";case "AWAITING_PAYMENT":return "awaiting";case "COMPLETED":return "success";case "EXPIRED":return "expired";case "CANCELLED":return "cancelled";case "FAILED":return "failed";default:return "error"}}function yt(n){return n.phase==="PAYING"&&n.paymentExpiryAt?n.paymentExpiryAt:null}var $t=["qr-active","mobile-app-active","awaiting","manual-confirm"],Qt=["loading","choose-method","manual-entry","manual-picker","success","expired","cancelled","declined","failed","invalid-session","error"];function Ne(n,e){return !n?.paymentExpiryAt||Qt.includes(e)||Y.includes(n.status)||_(n.paymentExpiryAt)<=0?false:yt(n)?true:$t.includes(e)}function X(n){if(!n.paymentExpiryAt)return null;let e=n.paymentExpiryAt,t=new Date(e).getTime(),i=n.paymentStartAt?new Date(n.paymentStartAt).getTime():t-300*1e3,r=t-i;return r<=0?0:Math.min(1,Math.max(0,_(e)/r))}function Wt(n){return n.phase==="IDLE"&&n.expiresAt?n.expiresAt:null}function _(n){return Math.max(0,new Date(n).getTime()-Date.now())}function Yt(){return B()==="phone"}function ft(){if(typeof navigator>"u")return "android";let n=navigator.userAgent??"";return /iPad|iPhone|iPod/.test(n)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1?"ios":"android"}function Be(){return typeof navigator>"u"?false:/Android/i.test(navigator.userAgent??"")}function B(){if(typeof window>"u")return "desktop";let n=window.matchMedia("(max-width: 520px)").matches,e=window.matchMedia("(pointer: coarse)").matches;return n&&e?"phone":"desktop"}function Oe(n){if(typeof window>"u")return ()=>{};let e=[window.matchMedia("(max-width: 520px)"),window.matchMedia("(pointer: coarse)")],t=()=>{n(B());};for(let i of e)i.addEventListener("change",t);return window.addEventListener("orientationchange",t),window.addEventListener("resize",t),()=>{for(let i of e)i.removeEventListener("change",t);window.removeEventListener("orientationchange",t),window.removeEventListener("resize",t);}}function q(n){return n.checkoutPolicy!=null||n.mobileAppPolicy!=null}function jt(n){return n==null}function de(n){return n==null||n==="QR"}function _e(n){return n==null||n==="MANUAL"}function ue(n,e){return e==="ENFORCE"&&(n==null||n==="QR"||n==="MANUAL")}function gt(n){return n?.policy==="off"?"OFF":n?.policy==="option"?"OPTION":(n?.policy==="enforce","ENFORCE")}function he(n){let e={};(n.checkoutPolicy==="QR"||n.checkoutPolicy==="MANUAL")&&(e.checkoutPolicy=n.checkoutPolicy);let t=gt(n.mobileApp);return t!=="OFF"&&(e.mobileAppPolicy=t),e}function bt(n){return {qr:de(n),manual:_e(n)}}function xt(n,e,t){if(t==="desktop")return {qr:de(n),manual:_e(n),mobileApp:false};let i=ue(n,e);return {qr:de(n)&&!i,manual:_e(n)&&!i,mobileApp:i||e==="OPTION"&&(n==null||n==="QR"||n==="MANUAL")}}function ee(n,e,t){return t==="desktop"?n==="MANUAL"?"auto-manual":n==="QR"?"auto-qr":"chooser":ue(n,e)?"enforce-mobile-app":n==="MANUAL"&&e==="OFF"?"auto-manual":n==="QR"&&e==="OFF"?"auto-qr":"chooser"}function J(n,e,t,i){return i==="MOBILE_APP"?t==="desktop"||e==="OFF"?false:ue(n,e)?true:e==="OPTION"?n==null||n==="QR"||n==="MANUAL":false:!(!de(n)||t==="phone"&&ue(n,e))}function Re(n,e,t){let i=ee(n,e,t);return i==="enforce-mobile-app"?J(n,e,t,"MOBILE_APP")?"MOBILE_APP":null:i==="auto-qr"&&J(n,e,t,"QR")?"QR":null}function te(n,e,t=B()){return {checkoutPolicy:n,mobileAppPolicy:e,surface:t,methodAvailability:xt(n,e,t),allowManualBack:n==null}}function He(n,e=B()){if(!q(n))throw new Error("Checkout policy is not bound on the payment session.");return te(n.checkoutPolicy,n.mobileAppPolicy??"OFF",e)}function Ue(n,e,t=B()){let i=he({checkoutPolicy:n,mobileApp:e});return te(i.checkoutPolicy??null,i.mobileAppPolicy??"OFF",t)}var ie="com.zippy.pay",vt="https://apps.apple.com/in/app/zippypay/id6806799311",ne={ios:vt,android:`https://play.google.com/store/apps/details?id=${ie}`},wt=`itms-apps://${vt.replace(/^https:\/\//,"")}`,Pt=`market://details?id=${ie}`;function Vt(n){return ne[n]}function De(n){return n==="ios"?wt:Pt}function Fe(n="zippy-app-link-icon"){return `<svg class="${n}" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M16.823 12.345c-.027-2.702 2.208-3.997 2.307-4.059-1.255-1.836-3.211-2.088-3.905-2.118-1.663-.169-3.246.98-4.089.98-.844 0-2.147-.955-3.531-.929-1.818.027-3.493 1.056-4.429 2.683-1.888 3.276-.483 8.131 1.356 10.791.899 1.299 1.968 2.759 3.374 2.707 1.355-.054 1.866-.877 3.504-.877 1.637 0 2.099.877 3.527.85 1.457-.027 2.381-1.32 3.276-2.622.99-1.449 1.396-2.851 1.419-2.922-.031-.014-2.724-1.045-2.751-4.146zM14.303 4.772c.747-.907 1.249-2.164 1.111-3.422-1.075.043-2.375.717-3.147 1.623-.693.802-1.299 2.095-1.136 3.333 1.201.093 2.432-.61 3.172-1.534z"/></svg>`}function Ze(n="zippy-app-link-icon"){return `<svg class="${n} zippy-app-link-icon--play" viewBox="0 0 256 283" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path fill="#EA4335" d="M119.553 134.916 1.06 259.061c2.696 9.556 9.658 17.33 18.861 21.059 9.202 3.73 19.612 2.996 28.201-1.987l133.327-75.935-61.896-67.282z"/><path fill="#FBBC04" d="M239.371 113.814 181.714 80.791 116.816 137.742l65.162 64.279 57.216-32.669c10.332-5.409 16.806-16.107 16.806-27.769 0-11.662-6.474-22.36-16.806-27.769h.177z"/><path fill="#4285F4" d="M1.06 23.487C.344 26.135-.013 28.867 0 31.61v219.327c.008 2.742.364 5.472 1.06 8.124L123.615 138.095 1.06 23.487z"/><path fill="#34A853" d="M120.436 141.274 181.714 80.791 48.563 4.503C43.554 1.569 37.857.016 32.052 0 17.644-.028 4.978 9.534 1.06 23.399l119.376 117.875z"/></svg>`}function kt(){return Fe("zippy-app-link-icon")}function zt(){return Ze("zippy-app-link-icon")}var Q=function(n,e){let r=n,a=re[e],o=null,s=0,p=null,d=[],g={},f=function(c,y){s=r*4+17,o=(function(l){let h=new Array(l);for(let u=0;u<l;u+=1){h[u]=new Array(l);for(let b=0;b<l;b+=1)h[u][b]=null;}return h})(s),m(0,0),m(s-7,0),m(0,s-7),P(),S(),N(c,y),r>=7&&z(c),p==null&&(p=W(r,a,d)),T(p,y);},m=function(c,y){for(let l=-1;l<=7;l+=1)if(!(c+l<=-1||s<=c+l))for(let h=-1;h<=7;h+=1)y+h<=-1||s<=y+h||(0<=l&&l<=6&&(h==0||h==6)||0<=h&&h<=6&&(l==0||l==6)||2<=l&&l<=4&&2<=h&&h<=4?o[c+l][y+h]=true:o[c+l][y+h]=false);},w=function(){let c=0,y=0;for(let l=0;l<8;l+=1){f(true,l);let h=U.getLostPoint(g);(l==0||c>h)&&(c=h,y=l);}return y},S=function(){for(let c=8;c<s-8;c+=1)o[c][6]==null&&(o[c][6]=c%2==0);for(let c=8;c<s-8;c+=1)o[6][c]==null&&(o[6][c]=c%2==0);},P=function(){let c=U.getPatternPosition(r);for(let y=0;y<c.length;y+=1)for(let l=0;l<c.length;l+=1){let h=c[y],u=c[l];if(o[h][u]==null)for(let b=-2;b<=2;b+=1)for(let x=-2;x<=2;x+=1)b==-2||b==2||x==-2||x==2||b==0&&x==0?o[h+b][u+x]=true:o[h+b][u+x]=false;}},z=function(c){let y=U.getBCHTypeNumber(r);for(let l=0;l<18;l+=1){let h=!c&&(y>>l&1)==1;o[Math.floor(l/3)][l%3+s-8-3]=h;}for(let l=0;l<18;l+=1){let h=!c&&(y>>l&1)==1;o[l%3+s-8-3][Math.floor(l/3)]=h;}},N=function(c,y){let l=a<<3|y,h=U.getBCHTypeInfo(l);for(let u=0;u<15;u+=1){let b=!c&&(h>>u&1)==1;u<6?o[u][8]=b:u<8?o[u+1][8]=b:o[s-15+u][8]=b;}for(let u=0;u<15;u+=1){let b=!c&&(h>>u&1)==1;u<8?o[8][s-u-1]=b:u<9?o[8][15-u-1+1]=b:o[8][15-u-1]=b;}o[s-8][8]=!c;},T=function(c,y){let l=-1,h=s-1,u=7,b=0,x=U.getMaskFunction(y);for(let k=s-1;k>0;k-=2)for(k==6&&(k-=1);;){for(let E=0;E<2;E+=1)if(o[h][k-E]==null){let A=false;b<c.length&&(A=(c[b]>>>u&1)==1),x(h,k-E)&&(A=!A),o[h][k-E]=A,u-=1,u==-1&&(b+=1,u=7);}if(h+=l,h<0||s<=h){h-=l,l=-l;break}}},M=function(c,y){let l=0,h=0,u=0,b=new Array(y.length),x=new Array(y.length);for(let v=0;v<y.length;v+=1){let C=y[v].dataCount,O=y[v].totalCount-C;h=Math.max(h,C),u=Math.max(u,O),b[v]=new Array(C);for(let R=0;R<b[v].length;R+=1)b[v][R]=255&c.getBuffer()[R+l];l+=C;let xe=U.getErrorCorrectPolynomial(O),Ke=oe(b[v],xe.getLength()-1).mod(xe);x[v]=new Array(xe.getLength()-1);for(let R=0;R<x[v].length;R+=1){let Xe=R+Ke.getLength()-x[v].length;x[v][R]=Xe>=0?Ke.getAt(Xe):0;}}let k=0;for(let v=0;v<y.length;v+=1)k+=y[v].totalCount;let E=new Array(k),A=0;for(let v=0;v<h;v+=1)for(let C=0;C<y.length;C+=1)v<b[C].length&&(E[A]=b[C][v],A+=1);for(let v=0;v<u;v+=1)for(let C=0;C<y.length;C+=1)v<x[C].length&&(E[A]=x[C][v],A+=1);return E},W=function(c,y,l){let h=Et.getRSBlocks(c,y),u=Ct();for(let x=0;x<l.length;x+=1){let k=l[x];u.put(k.getMode(),4),u.put(k.getLength(),U.getLengthInBits(k.getMode(),c)),k.write(u);}let b=0;for(let x=0;x<h.length;x+=1)b+=h[x].dataCount;if(u.getLengthInBits()>b*8)throw "code length overflow. ("+u.getLengthInBits()+">"+b*8+")";for(u.getLengthInBits()+4<=b*8&&u.put(0,4);u.getLengthInBits()%8!=0;)u.putBit(false);for(;!(u.getLengthInBits()>=b*8||(u.put(236,8),u.getLengthInBits()>=b*8));)u.put(17,8);return M(u,h)};g.addData=function(c,y){y=y||"Byte";let l=null;switch(y){case "Numeric":l=Gt(c);break;case "Alphanumeric":l=Kt(c);break;case "Byte":l=Xt(c);break;case "Kanji":l=Jt(c);break;default:throw "mode:"+y}d.push(l),p=null;},g.isDark=function(c,y){if(c<0||s<=c||y<0||s<=y)throw c+","+y;return o[c][y]},g.getModuleCount=function(){return s},g.make=function(){if(r<1){let c=1;for(;c<40;c++){let y=Et.getRSBlocks(c,a),l=Ct();for(let u=0;u<d.length;u++){let b=d[u];l.put(b.getMode(),4),l.put(b.getLength(),U.getLengthInBits(b.getMode(),c)),b.write(l);}let h=0;for(let u=0;u<y.length;u++)h+=y[u].dataCount;if(l.getLengthInBits()<=h*8)break}r=c;}f(false,w());},g.createTableTag=function(c,y){c=c||2,y=typeof y>"u"?c*4:y;let l="";l+='<table style="',l+=" border-width: 0px; border-style: none;",l+=" border-collapse: collapse;",l+=" padding: 0px; margin: "+y+"px;",l+='">',l+="<tbody>";for(let h=0;h<g.getModuleCount();h+=1){l+="<tr>";for(let u=0;u<g.getModuleCount();u+=1)l+='<td style="',l+=" border-width: 0px; border-style: none;",l+=" border-collapse: collapse;",l+=" padding: 0px; margin: 0px;",l+=" width: "+c+"px;",l+=" height: "+c+"px;",l+=" background-color: ",l+=g.isDark(h,u)?"#000000":"#ffffff",l+=";",l+='"/>';l+="</tr>";}return l+="</tbody>",l+="</table>",l},g.createSvgTag=function(c,y,l,h){let u={};typeof arguments[0]=="object"&&(u=arguments[0],c=u.cellSize,y=u.margin,l=u.alt,h=u.title),c=c||2,y=typeof y>"u"?c*4:y,l=typeof l=="string"?{text:l}:l||{},l.text=l.text||null,l.id=l.text?l.id||"qrcode-description":null,h=typeof h=="string"?{text:h}:h||{},h.text=h.text||null,h.id=h.text?h.id||"qrcode-title":null;let b=g.getModuleCount()*c+y*2,x,k,E,A,v="",C;for(C="l"+c+",0 0,"+c+" -"+c+",0 0,-"+c+"z ",v+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',v+=u.scalable?"":' width="'+b+'px" height="'+b+'px"',v+=' viewBox="0 0 '+b+" "+b+'" ',v+=' preserveAspectRatio="xMinYMin meet"',v+=h.text||l.text?' role="img" aria-labelledby="'+F([h.id,l.id].join(" ").trim())+'"':"",v+=">",v+=h.text?'<title id="'+F(h.id)+'">'+F(h.text)+"</title>":"",v+=l.text?'<description id="'+F(l.id)+'">'+F(l.text)+"</description>":"",v+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',v+='<path d="',E=0;E<g.getModuleCount();E+=1)for(A=E*c+y,x=0;x<g.getModuleCount();x+=1)g.isDark(E,x)&&(k=x*c+y,v+="M"+k+","+A+C);return v+='" stroke="transparent" fill="black"/>',v+="</svg>",v},g.createDataURL=function(c,y){c=c||2,y=typeof y>"u"?c*4:y;let l=g.getModuleCount()*c+y*2,h=y,u=l-y;return ni(l,l,function(b,x){if(h<=b&&b<u&&h<=x&&x<u){let k=Math.floor((b-h)/c),E=Math.floor((x-h)/c);return g.isDark(E,k)?0:1}else return 1})},g.createImgTag=function(c,y,l){c=c||2,y=typeof y>"u"?c*4:y;let h=g.getModuleCount()*c+y*2,u="";return u+="<img",u+=' src="',u+=g.createDataURL(c,y),u+='"',u+=' width="',u+=h,u+='"',u+=' height="',u+=h,u+='"',l&&(u+=' alt="',u+=F(l),u+='"'),u+="/>",u};let F=function(c){let y="";for(let l=0;l<c.length;l+=1){let h=c.charAt(l);switch(h){case "<":y+="&lt;";break;case ">":y+="&gt;";break;case "&":y+="&amp;";break;case '"':y+="&quot;";break;default:y+=h;break}}return y},Z=function(c){c=typeof c>"u"?2:c;let l=g.getModuleCount()*1+c*2,h=c,u=l-c,b,x,k,E,A,v={"\u2588\u2588":"\u2588","\u2588 ":"\u2580"," \u2588":"\u2584"," ":" "},C={"\u2588\u2588":"\u2580","\u2588 ":"\u2580"," \u2588":" "," ":" "},O="";for(b=0;b<l;b+=2){for(k=Math.floor((b-h)/1),E=Math.floor((b+1-h)/1),x=0;x<l;x+=1)A="\u2588",h<=x&&x<u&&h<=b&&b<u&&g.isDark(k,Math.floor((x-h)/1))&&(A=" "),h<=x&&x<u&&h<=b+1&&b+1<u&&g.isDark(E,Math.floor((x-h)/1))?A+=" ":A+="\u2588",O+=c<1&&b+1>=u?C[A]:v[A];O+=`
1734
+ `;}return l%2&&c>0?O.substring(0,O.length-l-1)+Array(l+1).join("\u2580"):O.substring(0,O.length-1)};return g.createASCII=function(c,y){if(c=c||1,c<2)return Z(y);c-=1,y=typeof y>"u"?c*2:y;let l=g.getModuleCount()*c+y*2,h=y,u=l-y,b,x,k,E,A=Array(c+1).join("\u2588\u2588"),v=Array(c+1).join(" "),C="",O="";for(b=0;b<l;b+=1){for(k=Math.floor((b-h)/c),O="",x=0;x<l;x+=1)E=1,h<=x&&x<u&&h<=b&&b<u&&g.isDark(k,Math.floor((x-h)/c))&&(E=0),O+=E?A:v;for(k=0;k<c;k+=1)C+=O+`
1735
1735
  `;}return C.substring(0,C.length-1)},g.renderTo2dContext=function(c,y){y=y||2;let l=g.getModuleCount();for(let h=0;h<l;h++)for(let u=0;u<l;u++)c.fillStyle=g.isDark(h,u)?"black":"white",c.fillRect(u*y,h*y,y,y);},g};Q.stringToBytes=function(n){let e=[];for(let t=0;t<n.length;t+=1){let i=n.charCodeAt(t);e.push(i&255);}return e};Q.createStringToBytes=function(n,e){let t=(function(){let r=ti(n),a=function(){let p=r.read();if(p==-1)throw "eof";return p},o=0,s={};for(;;){let p=r.read();if(p==-1)break;let d=a(),g=a(),f=a(),m=String.fromCharCode(p<<8|d),w=g<<8|f;s[m]=w,o+=1;}if(o!=e)throw o+" != "+e;return s})(),i=63;return function(r){let a=[];for(let o=0;o<r.length;o+=1){let s=r.charCodeAt(o);if(s<128)a.push(s);else {let p=t[r.charAt(o)];typeof p=="number"?(p&255)==p?a.push(p):(a.push(p>>>8),a.push(p&255)):a.push(i);}}return a}};var L={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},re={L:1,M:0,Q:3,H:2},H={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},U=(function(){let n=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],e=1335,t=7973,i=21522,r={},a=function(o){let s=0;for(;o!=0;)s+=1,o>>>=1;return s};return r.getBCHTypeInfo=function(o){let s=o<<10;for(;a(s)-a(e)>=0;)s^=e<<a(s)-a(e);return (o<<10|s)^i},r.getBCHTypeNumber=function(o){let s=o<<12;for(;a(s)-a(t)>=0;)s^=t<<a(s)-a(t);return o<<12|s},r.getPatternPosition=function(o){return n[o-1]},r.getMaskFunction=function(o){switch(o){case H.PATTERN000:return function(s,p){return (s+p)%2==0};case H.PATTERN001:return function(s,p){return s%2==0};case H.PATTERN010:return function(s,p){return p%3==0};case H.PATTERN011:return function(s,p){return (s+p)%3==0};case H.PATTERN100:return function(s,p){return (Math.floor(s/2)+Math.floor(p/3))%2==0};case H.PATTERN101:return function(s,p){return s*p%2+s*p%3==0};case H.PATTERN110:return function(s,p){return (s*p%2+s*p%3)%2==0};case H.PATTERN111:return function(s,p){return (s*p%3+(s+p)%2)%2==0};default:throw "bad maskPattern:"+o}},r.getErrorCorrectPolynomial=function(o){let s=oe([1],0);for(let p=0;p<o;p+=1)s=s.multiply(oe([1,D.gexp(p)],0));return s},r.getLengthInBits=function(o,s){if(1<=s&&s<10)switch(o){case L.MODE_NUMBER:return 10;case L.MODE_ALPHA_NUM:return 9;case L.MODE_8BIT_BYTE:return 8;case L.MODE_KANJI:return 8;default:throw "mode:"+o}else if(s<27)switch(o){case L.MODE_NUMBER:return 12;case L.MODE_ALPHA_NUM:return 11;case L.MODE_8BIT_BYTE:return 16;case L.MODE_KANJI:return 10;default:throw "mode:"+o}else if(s<41)switch(o){case L.MODE_NUMBER:return 14;case L.MODE_ALPHA_NUM:return 13;case L.MODE_8BIT_BYTE:return 16;case L.MODE_KANJI:return 12;default:throw "mode:"+o}else throw "type:"+s},r.getLostPoint=function(o){let s=o.getModuleCount(),p=0;for(let f=0;f<s;f+=1)for(let m=0;m<s;m+=1){let w=0,S=o.isDark(f,m);for(let P=-1;P<=1;P+=1)if(!(f+P<0||s<=f+P))for(let z=-1;z<=1;z+=1)m+z<0||s<=m+z||P==0&&z==0||S==o.isDark(f+P,m+z)&&(w+=1);w>5&&(p+=3+w-5);}for(let f=0;f<s-1;f+=1)for(let m=0;m<s-1;m+=1){let w=0;o.isDark(f,m)&&(w+=1),o.isDark(f+1,m)&&(w+=1),o.isDark(f,m+1)&&(w+=1),o.isDark(f+1,m+1)&&(w+=1),(w==0||w==4)&&(p+=3);}for(let f=0;f<s;f+=1)for(let m=0;m<s-6;m+=1)o.isDark(f,m)&&!o.isDark(f,m+1)&&o.isDark(f,m+2)&&o.isDark(f,m+3)&&o.isDark(f,m+4)&&!o.isDark(f,m+5)&&o.isDark(f,m+6)&&(p+=40);for(let f=0;f<s;f+=1)for(let m=0;m<s-6;m+=1)o.isDark(m,f)&&!o.isDark(m+1,f)&&o.isDark(m+2,f)&&o.isDark(m+3,f)&&o.isDark(m+4,f)&&!o.isDark(m+5,f)&&o.isDark(m+6,f)&&(p+=40);let d=0;for(let f=0;f<s;f+=1)for(let m=0;m<s;m+=1)o.isDark(m,f)&&(d+=1);let g=Math.abs(100*d/s/s-50)/5;return p+=g*10,p},r})(),D=(function(){let n=new Array(256),e=new Array(256);for(let i=0;i<8;i+=1)n[i]=1<<i;for(let i=8;i<256;i+=1)n[i]=n[i-4]^n[i-5]^n[i-6]^n[i-8];for(let i=0;i<255;i+=1)e[n[i]]=i;let t={};return t.glog=function(i){if(i<1)throw "glog("+i+")";return e[i]},t.gexp=function(i){for(;i<0;)i+=255;for(;i>=256;)i-=255;return n[i]},t})(),oe=function(n,e){if(typeof n.length>"u")throw n.length+"/"+e;let t=(function(){let r=0;for(;r<n.length&&n[r]==0;)r+=1;let a=new Array(n.length-r+e);for(let o=0;o<n.length-r;o+=1)a[o]=n[o+r];return a})(),i={};return i.getAt=function(r){return t[r]},i.getLength=function(){return t.length},i.multiply=function(r){let a=new Array(i.getLength()+r.getLength()-1);for(let o=0;o<i.getLength();o+=1)for(let s=0;s<r.getLength();s+=1)a[o+s]^=D.gexp(D.glog(i.getAt(o))+D.glog(r.getAt(s)));return oe(a,0)},i.mod=function(r){if(i.getLength()-r.getLength()<0)return i;let a=D.glog(i.getAt(0))-D.glog(r.getAt(0)),o=new Array(i.getLength());for(let s=0;s<i.getLength();s+=1)o[s]=i.getAt(s);for(let s=0;s<r.getLength();s+=1)o[s]^=D.gexp(D.glog(r.getAt(s))+a);return oe(o,0).mod(r)},i},Et=(function(){let n=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e=function(r,a){let o={};return o.totalCount=r,o.dataCount=a,o},t={},i=function(r,a){switch(a){case re.L:return n[(r-1)*4+0];case re.M:return n[(r-1)*4+1];case re.Q:return n[(r-1)*4+2];case re.H:return n[(r-1)*4+3];default:return}};return t.getRSBlocks=function(r,a){let o=i(r,a);if(typeof o>"u")throw "bad rs block @ typeNumber:"+r+"/errorCorrectionLevel:"+a;let s=o.length/3,p=[];for(let d=0;d<s;d+=1){let g=o[d*3+0],f=o[d*3+1],m=o[d*3+2];for(let w=0;w<g;w+=1)p.push(e(f,m));}return p},t})(),Ct=function(){let n=[],e=0,t={};return t.getBuffer=function(){return n},t.getAt=function(i){let r=Math.floor(i/8);return (n[r]>>>7-i%8&1)==1},t.put=function(i,r){for(let a=0;a<r;a+=1)t.putBit((i>>>r-a-1&1)==1);},t.getLengthInBits=function(){return e},t.putBit=function(i){let r=Math.floor(e/8);n.length<=r&&n.push(0),i&&(n[r]|=128>>>e%8),e+=1;},t},Gt=function(n){let e=L.MODE_NUMBER,t=n,i={};i.getMode=function(){return e},i.getLength=function(o){return t.length},i.write=function(o){let s=t,p=0;for(;p+2<s.length;)o.put(r(s.substring(p,p+3)),10),p+=3;p<s.length&&(s.length-p==1?o.put(r(s.substring(p,p+1)),4):s.length-p==2&&o.put(r(s.substring(p,p+2)),7));};let r=function(o){let s=0;for(let p=0;p<o.length;p+=1)s=s*10+a(o.charAt(p));return s},a=function(o){if("0"<=o&&o<="9")return o.charCodeAt(0)-48;throw "illegal char :"+o};return i},Kt=function(n){let e=L.MODE_ALPHA_NUM,t=n,i={};i.getMode=function(){return e},i.getLength=function(a){return t.length},i.write=function(a){let o=t,s=0;for(;s+1<o.length;)a.put(r(o.charAt(s))*45+r(o.charAt(s+1)),11),s+=2;s<o.length&&a.put(r(o.charAt(s)),6);};let r=function(a){if("0"<=a&&a<="9")return a.charCodeAt(0)-48;if("A"<=a&&a<="Z")return a.charCodeAt(0)-65+10;switch(a){case " ":return 36;case "$":return 37;case "%":return 38;case "*":return 39;case "+":return 40;case "-":return 41;case ".":return 42;case "/":return 43;case ":":return 44;default:throw "illegal char :"+a}};return i},Xt=function(n){let e=L.MODE_8BIT_BYTE,i=Q.stringToBytes(n),r={};return r.getMode=function(){return e},r.getLength=function(a){return i.length},r.write=function(a){for(let o=0;o<i.length;o+=1)a.put(i[o],8);},r},Jt=function(n){let e=L.MODE_KANJI,i=Q.stringToBytes;(function(o,s){let p=i(o);if(p.length!=2||(p[0]<<8|p[1])!=s)throw "sjis not supported."})("\u53CB",38726);let r=i(n),a={};return a.getMode=function(){return e},a.getLength=function(o){return ~~(r.length/2)},a.write=function(o){let s=r,p=0;for(;p+1<s.length;){let d=(255&s[p])<<8|255&s[p+1];if(33088<=d&&d<=40956)d-=33088;else if(57408<=d&&d<=60351)d-=49472;else throw "illegal char at "+(p+1)+"/"+d;d=(d>>>8&255)*192+(d&255),o.put(d,13),p+=2;}if(p<s.length)throw "illegal char at "+(p+1)},a},At=function(){let n=[],e={};return e.writeByte=function(t){n.push(t&255);},e.writeShort=function(t){e.writeByte(t),e.writeByte(t>>>8);},e.writeBytes=function(t,i,r){i=i||0,r=r||t.length;for(let a=0;a<r;a+=1)e.writeByte(t[a+i]);},e.writeString=function(t){for(let i=0;i<t.length;i+=1)e.writeByte(t.charCodeAt(i));},e.toByteArray=function(){return n},e.toString=function(){let t="";t+="[";for(let i=0;i<n.length;i+=1)i>0&&(t+=","),t+=n[i];return t+="]",t},e},ei=function(){let n=0,e=0,t=0,i="",r={},a=function(s){i+=String.fromCharCode(o(s&63));},o=function(s){if(s<0)throw "n:"+s;if(s<26)return 65+s;if(s<52)return 97+(s-26);if(s<62)return 48+(s-52);if(s==62)return 43;if(s==63)return 47;throw "n:"+s};return r.writeByte=function(s){for(n=n<<8|s&255,e+=8,t+=1;e>=6;)a(n>>>e-6),e-=6;},r.flush=function(){if(e>0&&(a(n<<6-e),n=0,e=0),t%3!=0){let s=3-t%3;for(let p=0;p<s;p+=1)i+="=";}},r.toString=function(){return i},r},ti=function(n){let e=n,t=0,i=0,r=0,a={};a.read=function(){for(;r<8;){if(t>=e.length){if(r==0)return -1;throw "unexpected end of file./"+r}let p=e.charAt(t);if(t+=1,p=="=")return r=0,-1;if(p.match(/^\s$/))continue;i=i<<6|o(p.charCodeAt(0)),r+=6;}let s=i>>>r-8&255;return r-=8,s};let o=function(s){if(65<=s&&s<=90)return s-65;if(97<=s&&s<=122)return s-97+26;if(48<=s&&s<=57)return s-48+52;if(s==43)return 62;if(s==47)return 63;throw "c:"+s};return a},ii=function(n,e){let t=n,i=e,r=new Array(n*e),a={};a.setPixel=function(d,g,f){r[g*t+d]=f;},a.write=function(d){d.writeString("GIF87a"),d.writeShort(t),d.writeShort(i),d.writeByte(128),d.writeByte(0),d.writeByte(0),d.writeByte(0),d.writeByte(0),d.writeByte(0),d.writeByte(255),d.writeByte(255),d.writeByte(255),d.writeString(","),d.writeShort(0),d.writeShort(0),d.writeShort(t),d.writeShort(i),d.writeByte(0);let g=2,f=s(g);d.writeByte(g);let m=0;for(;f.length-m>255;)d.writeByte(255),d.writeBytes(f,m,255),m+=255;d.writeByte(f.length-m),d.writeBytes(f,m,f.length-m),d.writeByte(0),d.writeString(";");};let o=function(d){let g=d,f=0,m=0,w={};return w.write=function(S,P){if(S>>>P)throw "length over";for(;f+P>=8;)g.writeByte(255&(S<<f|m)),P-=8-f,S>>>=8-f,m=0,f=0;m=S<<f|m,f=f+P;},w.flush=function(){f>0&&g.writeByte(m);},w},s=function(d){let g=1<<d,f=(1<<d)+1,m=d+1,w=p();for(let T=0;T<g;T+=1)w.add(String.fromCharCode(T));w.add(String.fromCharCode(g)),w.add(String.fromCharCode(f));let S=At(),P=o(S);P.write(g,m);let z=0,N=String.fromCharCode(r[z]);for(z+=1;z<r.length;){let T=String.fromCharCode(r[z]);z+=1,w.contains(N+T)?N=N+T:(P.write(w.indexOf(N),m),w.size()<4095&&(w.size()==1<<m&&(m+=1),w.add(N+T)),N=T);}return P.write(w.indexOf(N),m),P.write(f,m),P.flush(),S.toByteArray()},p=function(){let d={},g=0,f={};return f.add=function(m){if(f.contains(m))throw "dup key:"+m;d[m]=g,g+=1;},f.size=function(){return g},f.indexOf=function(m){return d[m]},f.contains=function(m){return typeof d[m]<"u"},f};return a},ni=function(n,e,t){let i=ii(n,e);for(let s=0;s<e;s+=1)for(let p=0;p<n;p+=1)i.setPixel(p,s,t(p,s));let r=At();i.write(r);let a=ei(),o=r.toByteArray();for(let s=0;s<o.length;s+=1)a.writeByte(o[s]);return a.flush(),"data:image/gif;base64,"+a},Mt=Q;Q.stringToBytes;var ri="#476CEB",oi="-1 20.86 60 60",ai="M16.8831 21.5476C16.3856 21.5476 15.9085 21.7452 15.5567 22.097L0.549704 37.104C0.0132083 37.6405 -0.147283 38.4474 0.143066 39.1483C0.433416 39.8493 1.11743 40.3063 1.87615 40.3063H26.5982L2.74743 64.1571C0.0649471 66.8395 -0.737512 70.8738 0.714236 74.3786C2.16598 77.8834 5.58604 80.1686 9.37964 80.1686H41.7385C42.236 80.1686 42.7131 79.971 43.0649 79.6192L58.0719 64.6122C58.6084 64.0757 58.7689 63.2689 58.4785 62.5679C58.1882 61.867 57.5042 61.4099 56.7455 61.4099H32.0234L55.8742 37.5592C58.5567 34.8767 59.3591 30.8425 57.9074 27.3376C56.4556 23.8328 53.0356 21.5476 49.242 21.5476H16.8831ZM5.11632 64.1759L28.3783 40.3812H30.6653L5.11632 64.1759ZM30.1464 61.4059L53.4083 37.6111L27.8594 61.4059H30.1464Z";function si(n){let e=/viewBox="0 0 ([\d.]+) [\d.]+"/.exec(n);return e?Number(e[1]):null}function pi(n){let e=n*.24,t=(n-e)/2,i=e*1.18,r=(n-i)/2,a=e*.16;return ['<g shape-rendering="geometricPrecision">',`<rect x="${r}" y="${r}" width="${i}" height="${i}" rx="${i*.22}" fill="#ffffff"/>`,`<svg x="${t+a}" y="${t+a}" width="${e-a*2}" height="${e-a*2}" viewBox="${oi}">`,`<path d="${ai}" fill="${ri}"/>`,"</svg>","</g>"].join("")}function St(n){let e=si(n);return e?n.replace("</svg>",`${pi(e)}</svg>`):n}function Tt(){return '<svg class="zippy-brand-lock" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M7 10V8a5 5 0 0 1 10 0v2" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><rect x="5" y="10" width="14" height="11" rx="2.5" stroke="currentColor" stroke-width="1.75"/><circle cx="12" cy="15.5" r="1.25" fill="currentColor"/></svg>'}var qe="merchant-payment";function me(n){return `zippy://${qe}/${n}`}function $e(n,e=4,t="H",i=2){let r=Mt(0,t);return r.addData(n),r.make(),r.createSvgTag(e,i)}function Lt(n,e=4,t="H"){return $e(me(n),e,t)}function It(n,e=4){return St(Lt(n,e,"H"))}function Qe(n,e=4){return `<div class="zippy-qr-stack">${It(n,e)}</div>`}function We(n,e=4){return `<div class="zippy-qr-stack zippy-qr-stack--plain">${$e(n,e,"M")}</div>`}function Nt(n){return `intent://${qe}/${n}#Intent;scheme=zippy;package=${ie};end`}function Bt(n,e){return e==="android"||e==null&&Be()?Nt(n):me(n)}function ae(n){if(typeof window>"u")return;let e=n??ft();window.location.assign(De(e));}function Ye(n){typeof window>"u"||typeof document>"u"||li(Bt(n));}function li(n){let e=document.createElement("a");e.href=n,e.style.display="none",e.setAttribute("aria-hidden","true"),document.body.appendChild(e),e.click(),e.remove();}var ci={ios:{title:"Download Zippy for iPhone",lead:"Scan the code with your iPhone camera, or open the App Store directly on this device.",qrHint:"Scan to open the App Store",ctaLabel:"Open App Store",dialogLabel:"Download Zippy on the App Store",icon:Fe("zippy-app-modal-platform-icon")},android:{title:"Download Zippy for Android",lead:"Scan the code with your Android phone, or open Google Play directly on this device.",qrHint:"Scan to open Google Play",ctaLabel:"Open Google Play",dialogLabel:"Get Zippy on Google Play",icon:Ze("zippy-app-modal-platform-icon zippy-app-modal-platform-icon--play")}};function di(){return typeof window>"u"?false:window.matchMedia("(max-width: 520px), (pointer: coarse)").matches}var ye=class{constructor(e){this.shadow=e;this.overlay=null;this.escapeHandler=null;this.focusTrapHandler=null;this.trigger=null;}open(e,t,i){this.close(),this.trigger=i;let r=ci[e],a=di(),o=document.createElement("div");o.className=`zippy-app-modal-overlay${a?" zippy-app-modal-overlay--mobile":""}`,o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label",r.dialogLabel),o.innerHTML=`
1736
1736
  <div class="zippy-app-modal-panel">
1737
1737
  <button type="button" class="zippy-app-modal-close" aria-label="Close download dialog"><svg class="zippy-app-modal-close-icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M7 7l10 10M17 7 7 17" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>
@@ -1762,5 +1762,5 @@ input {
1762
1762
  </svg>`}idIconSvg(){return `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
1763
1763
  <circle cx="12" cy="9" r="3.5" stroke="currentColor" stroke-width="1.6"/>
1764
1764
  <path d="M5 20c0-3.87 3.13-7 7-7s7 3.13 7 7" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/>
1765
- </svg>`}};function Ot(n){let e=n.timeoutMs??8e3,t=false,i=[],r=()=>{for(let p of i)p();i.length=0;},a=p=>{t||(t=true,r(),p==="opened"?n.onOpened():n.onFailed());},o=()=>{document.hidden&&a("opened");};document.addEventListener("visibilitychange",o),i.push(()=>{document.removeEventListener("visibilitychange",o);});let s=setTimeout(()=>{document.hidden?a("opened"):a("failed");},e);return i.push(()=>{clearTimeout(s);}),r}var se=class se{constructor(e){this.ui=null;this.session=null;this.paymentId="";this.verifiedPayer=null;this.verifyMatches=null;this.lastVerifiedQuery=null;this.committedMethod=null;this.phase="loading";this.errorMessage=null;this.loading=true;this.destroyed=false;this.modalOpen=false;this.exitMode=null;this.terminalFailureReason=null;this.appHandoffStatus="idle";this.clearAppHandoffWatch=null;this.methodSwitchInProgress=false;this.entryRoutingDone=false;this.payWindowExpiryTimer=null;this.unsubscribeSurface=null;if(this.config={mode:"inline",closeOnBackdropClick:false,closeOnEscape:false,...e},!it(this.config.sessionId))throw new Error("Zippy Pay: sessionId must be a UUID v4.");j(this.config.environment),this.uiOptions=Ue(this.config.checkoutPolicy,this.config.mobileApp,B()),this.client=new G({baseUrl:Pe(this.config.environment),sessionId:this.config.sessionId,clientToken:this.config.clientToken}),this.embed=ut(this.config),Ie(this.embed.host,this.config.theme),this.poller=new K(()=>this.client.getSession(),{onUpdate:t=>this.handleSessionUpdate(t),onError:t=>this.handlePollError(t)}),this.ui=new fe(this.embed.host,this.snapshotUiState(),{onChooseMethod:t=>{this.chooseMethod(t);},onVerify:t=>this.verify(t),onPay:t=>this.attach(t),onSelectPayer:t=>this.selectPayer(t),onBackToChooseMethod:()=>this.backToChooseMethod(),onBackToManualEntry:()=>this.backToManualEntry(),onBackToMobileAppFallback:()=>this.backToMobileAppFallback(),onOpenMobileApp:()=>this.beginMobileAppHandoff(),onInstallZippy:()=>this.installZippy(),onRetryMobileApp:()=>this.beginMobileAppHandoff(),onPaymentIdChange:t=>{let i=$(t),r=false;(this.verifiedPayer||this.verifyMatches)&&this.lastVerifiedQuery!==null&&i!==this.lastVerifiedQuery&&(this.verifiedPayer=null,this.verifyMatches=null,this.lastVerifiedQuery=null,(this.phase==="manual-confirm"||this.phase==="manual-picker")&&(this.phase="manual-entry"),r=true),this.errorMessage&&(this.errorMessage=null,r=true),this.paymentId=t,r&&this.syncUi();},onTerminalExit:()=>this.executeTerminalExit()},this.uiOptions),this.bootstrap(),this.unsubscribeSurface=Oe(t=>{this.handleSurfaceChange(t);}),this.config.mode==="inline"&&(this.modalOpen=true);}open(){this.config.mode!=="modal"||this.modalOpen||(this.modalOpen=true,ht(this.embed,this.config,()=>this.close()));}close(){this.config.mode==="modal"&&(this.modalOpen=false,mt(this.embed),this.config.onClose?.());}destroy(){this.destroyed||(this.destroyed=true,this.unsubscribeSurface?.(),this.unsubscribeSurface=null,this.poller.stop(),this.clearAppHandoffWatch?.(),this.clearAppHandoffWatch=null,this.clearPayWindowExpiryWatch(),this.ui?.destroy(),this.embed.destroy(),this.ui=null);}snapshotUiState(){return {phase:this.phase,session:this.session,sessionId:this.config.sessionId,committedMethod:this.committedMethod,paymentId:this.paymentId,verifiedPayer:this.verifiedPayer,verifyMatches:this.verifyMatches,errorMessage:this.errorMessage,loading:this.loading,mode:this.config.mode??"inline",exitMode:this.exitMode,appHandoffStatus:this.appHandoffStatus,mobileAppManualFallback:this.isMobileAppManualFallbackActive()}}syncUi(e){this.destroyed||(e&&"errorMessage"in e&&(this.errorMessage=e.errorMessage??null),e&&"loading"in e&&(this.loading=e.loading??false),e&&"exitMode"in e&&(this.exitMode=e.exitMode??null),this.ui?.update(this.snapshotUiState()));}async bootstrap(){try{let e=await this.bindPolicy();if(this.destroyed||(this.applyBoundUiOptions(e),this.applySession(e),this.destroyed))return;this.config.onReady?.(e),ce(e.status)?this.destroyed||this.syncUi({loading:!1}):(await this.routeIdleEntry(),this.destroyed||(this.syncUi({loading:!1}),this.poller.start(e)));}catch(e){this.handleBootstrapError(e);}}async bindPolicy(){let e=he({checkoutPolicy:this.config.checkoutPolicy,mobileApp:this.config.mobileApp});try{return await this.client.bindCheckoutPolicy(e)}catch(t){if(t instanceof I&&t.code==="payment-session.checkout-policy-conflict"){let i=await this.client.getSession();if(q(i))return i}throw t}}applyBoundUiOptions(e,t=B()){this.uiOptions=He(e,t),this.ui?.updateUiOptions(this.uiOptions);}handleSurfaceChange(e){if(this.destroyed||this.committedMethod)return;let t=this.session;!t||!q(t)||this.uiOptions.surface!==e&&(this.uiOptions=te(t.checkoutPolicy,t.mobileAppPolicy??"OFF",e),this.ui?.updateUiOptions(this.uiOptions),(this.phase==="choose-method"||this.phase==="loading")&&this.syncUi());}applySession(e,t){if(this.session=e,this.config.onSessionUpdate?.(e),e.transactionStatus==="DECLINED"&&e.status!=="COMPLETED"){this.methodSwitchInProgress=false,this.handleFailure({reason:"declined",session:e});return}if(e.status==="COMPLETED"){this.methodSwitchInProgress=false,this.handleSuccess(e);return}if(e.status==="EXPIRED"){this.methodSwitchInProgress=false,this.handleFailure({reason:"expired",session:e});return}if(e.status==="FAILED"){this.methodSwitchInProgress=false,this.handleFailure({reason:"failed",session:e});return}if(e.status==="CANCELLED"){this.methodSwitchInProgress=false,this.handleFailure({reason:"cancelled",session:e});return}if(this.isMobileAppManualFallbackActive()&&!t?.fromMethodSwitch){this.schedulePayWindowExpiryWatch(),this.syncUi();return}this.committedMethod=mi(e.checkoutMethod)??this.committedMethod,this.phase=this.resolveActivePhase(e),this.schedulePayWindowExpiryWatch(),this.syncUi();}schedulePayWindowExpiryWatch(){this.clearPayWindowExpiryWatch();let e=this.session;if(!e?.paymentExpiryAt||!se.PAY_WINDOW_PHASES.includes(this.phase))return;let t=_(e.paymentExpiryAt);if(t<=0){this.handlePayWindowExpired();return}this.payWindowExpiryTimer=setTimeout(()=>{this.handlePayWindowExpired();},t+250);}clearPayWindowExpiryWatch(){this.payWindowExpiryTimer!==null&&(clearTimeout(this.payWindowExpiryTimer),this.payWindowExpiryTimer=null);}async handlePayWindowExpired(){if(!(this.destroyed||!this.session?.paymentExpiryAt)){if(_(this.session.paymentExpiryAt)>0){this.schedulePayWindowExpiryWatch();return}if(se.PAY_WINDOW_PHASES.includes(this.phase))try{let e=await this.client.getSession();if(this.destroyed)return;this.applySession(e);}catch{this.destroyed||this.handleFailure({reason:"expired",session:this.session});}}}resolveActivePhase(e){return e.status==="AWAITING_PAYMENT"?e.checkoutMethod==="MOBILE_APP"||this.committedMethod==="mobileApp"?"mobile-app-active":e.checkoutMethod==="QR"||this.committedMethod==="qr"?"qr-active":"awaiting":e.phase==="PAYING"&&e.checkoutMethod==="MOBILE_APP"?"mobile-app-active":e.phase==="PAYING"&&e.checkoutMethod==="QR"?"qr-active":e.phase==="PAYING"&&e.checkoutMethod==="MANUAL"?this.phase==="manual-confirm"&&this.verifiedPayer?"manual-confirm":"manual-entry":e.phase==="IDLE"?this.phase==="manual-confirm"&&this.verifiedPayer?"manual-confirm":this.phase==="manual-picker"&&this.verifyMatches?"manual-picker":this.phase==="manual-entry"?"manual-entry":this.phase==="choose-method"?"choose-method":this.phase==="qr-active"&&this.committedMethod==="qr"?"qr-active":this.phase==="mobile-app-active"&&this.committedMethod==="mobileApp"?"mobile-app-active":!e.checkoutMethod&&ee(this.uiOptions.checkoutPolicy,this.uiOptions.mobileAppPolicy,this.uiOptions.surface)!=="chooser"?"loading":"choose-method":this.phase}handleSessionUpdate(e){this.destroyed||this.applySession(e);}handleFailure(e){if(this.destroyed)return;this.poller.stop(),this.clearPayWindowExpiryWatch(),this.loading=false;let t=e.session??this.session;if(e.reason==="expired")t&&this.config.onExpired?.(t);else {let i=e.error??(e.reason==="failed"||e.reason==="cancelled"||e.reason==="declined"?hi(e.reason):void 0);i&&this.config.onError?.(i);}this.terminalFailureReason=e.reason,this.phase=this.failurePhaseFromReason(e.reason),this.exitMode=this.resolveExitMode("failure",t),this.syncUi();}handleSuccess(e){this.destroyed||(this.poller.stop(),this.clearPayWindowExpiryWatch(),this.loading=false,this.config.onComplete?.(e),this.terminalFailureReason=null,this.phase="success",this.exitMode=this.resolveExitMode("success",e),this.syncUi());}executeTerminalExit(){if(this.destroyed)return;let e=this.session;if(this.phase==="success"&&e){if(this.config.redirectOnComplete&&e.successUrl){window.location.assign(Te(e.successUrl,{sessionId:e.sessionId,status:e.status,transactionId:e.transactionId}));return}}else if(this.phase==="expired"||this.phase==="failed"||this.phase==="cancelled"||this.phase==="declined"||this.phase==="invalid-session"){let t=e?.failureUrl??null;if(this.config.redirectOnFailure&&t){let i=this.terminalFailureReason==="expired"?Te(t,{sessionId:e?.sessionId??this.config.sessionId,status:e?.status??"EXPIRED"}):t;window.location.assign(i);return}}this.teardownView();}resolveExitMode(e,t){return e==="success"?this.config.redirectOnComplete&&t?.successUrl?"redirect":"close":this.config.redirectOnFailure&&t?.failureUrl?"redirect":"close"}failurePhaseFromReason(e){switch(e){case "expired":return "expired";case "failed":return "failed";case "cancelled":return "cancelled";case "declined":return "declined";case "invalid-session":return "invalid-session"}}teardownView(){this.config.mode==="modal"&&this.modalOpen&&this.close(),this.destroy();}handleBootstrapError(e){if(e instanceof I&&e.status===401){this.handleFailure({reason:"invalid-session",error:e,session:this.session});return}this.handleError(e);}handlePollError(e){let t=je(e);if(t.status===401){this.poller.stop(),this.handleFailure({reason:"invalid-session",error:t,session:this.session});return}if(t.code==="payment-session.not-attachable"){this.poller.stop(),this.handleFailure({reason:"expired",session:this.session});return}}handleError(e){let t=je(e);if(t.status===401){this.handleFailure({reason:"invalid-session",error:t,session:this.session});return}if(t.code==="payment-session.not-attachable"){this.handleFailure({reason:"expired",session:this.session});return}if(t.code==="payment-session.checkout-policy-not-bound"){(this.phase==="loading"||this.phase==="choose-method")&&(this.phase="error"),this.syncUi({errorMessage:t.detail||"Checkout is not ready yet. Please refresh and try again.",loading:false}),this.config.onError?.(t),this.poller.stop();return}(this.phase==="loading"||this.phase==="choose-method")&&(this.phase="error"),this.syncUi({errorMessage:t.detail,loading:false}),this.config.onError?.(t),this.poller.stop();}async routeIdleEntry(){if(this.destroyed||this.entryRoutingDone)return;let e=this.session;if(!e||ce(e.status))return;if(e.checkoutMethod){this.entryRoutingDone=true;return}if(e.phase!=="IDLE")return;let t=B(),{checkoutPolicy:i,mobileAppPolicy:r}=this.uiOptions,a=Re(i,r,t);a==="MOBILE_APP"?await this.startMobileAppFlow(false):a==="QR"?await this.chooseMethod("qr"):ee(i,r,t)==="auto-manual"?(this.phase="manual-entry",this.syncUi({loading:false})):(this.phase="choose-method",this.syncUi({loading:false})),this.entryRoutingDone=true;}openMobileApp(){Ye(this.config.sessionId);}beginMobileAppHandoff(){this.destroyed||(this.clearAppHandoffWatch?.(),this.clearAppHandoffWatch=null,this.appHandoffStatus="opening",this.syncUi(),this.openMobileApp(),this.clearAppHandoffWatch=Ot({onOpened:()=>{this.destroyed||(this.appHandoffStatus="opened",this.syncUi());},onFailed:()=>{this.destroyed||(this.appHandoffStatus="failed",this.syncUi());}}));}installZippy(){ae();}async startMobileAppFlow(e){if(this.session?.checkoutMethod==="MOBILE_APP"){this.committedMethod="mobileApp",this.phase="mobile-app-active",e&&this.beginMobileAppHandoff(),this.syncUi({loading:false});return}if(this.committedMethod&&this.committedMethod!=="mobileApp")return;let t=B();if(this.canStartAppClaim("MOBILE_APP",t)){e?(this.committedMethod="mobileApp",this.phase="mobile-app-active",this.beginMobileAppHandoff()):this.syncUi({errorMessage:null,loading:true});try{let i=await this.client.startMobileAppCheckout(t);if(this.committedMethod="mobileApp",this.applySession(i),this.destroyed)return;this.phase="mobile-app-active",this.syncUi({loading:!1});}catch(i){this.handleFlowError(i,"choose-method");}}}canStartAppClaim(e,t){if(!this.session||!q(this.session))return this.syncUi({errorMessage:"Checkout is not ready yet. Please refresh and try again.",loading:false}),false;let i=this.session.checkoutPolicy,r=this.session.mobileAppPolicy??"OFF";return J(i,r,t,e)?true:(this.syncUi({errorMessage:"This payment option is not available on your device.",loading:false}),false)}async chooseMethod(e){if(!this.methodSwitchInProgress&&!(this.committedMethod&&!(this.appHandoffStatus==="failed"&&this.committedMethod==="mobileApp"&&e!=="mobileApp"))){if(this.appHandoffStatus==="failed"&&this.committedMethod==="mobileApp"&&(e==="qr"||e==="manual")){await this.chooseFallbackMethod(e);return}if(e==="mobileApp"){await this.startMobileAppFlow(true);return}this.verifiedPayer=null,this.syncUi({errorMessage:null,loading:e==="qr"});try{if(e==="qr"){let t=B();if(!this.canStartAppClaim("QR",t))return;let i=await this.client.startQrCheckout(t);if(this.committedMethod="qr",this.applySession(i),this.destroyed)return;this.syncUi({loading:!1});}else this.phase="manual-entry",this.syncUi({loading:!1});}catch(t){this.handleFlowError(t,"choose-method");}}}async chooseFallbackMethod(e){if(!(this.appHandoffStatus!=="failed"||this.committedMethod!=="mobileApp"||this.methodSwitchInProgress)){if(this.clearAppHandoffWatch?.(),this.clearAppHandoffWatch=null,e==="manual"){this.methodSwitchInProgress=true,this.appHandoffStatus="idle",this.verifiedPayer=null,this.verifyMatches=null,this.lastVerifiedQuery=null,this.paymentId="",this.phase="manual-entry",this.syncUi({errorMessage:null,loading:false});return}this.methodSwitchInProgress=true,this.verifiedPayer=null,this.syncUi({errorMessage:null,loading:true});try{let t=B(),i=await this.client.startQrCheckout(t);if(this.destroyed)return;this.methodSwitchInProgress=!1,this.appHandoffStatus="idle",this.loading=!1,this.applySession(i,{fromMethodSwitch:!0});}catch(t){this.methodSwitchInProgress=false,this.handleFlowError(t,"mobile-app-active");}}}backToChooseMethod(){this.uiOptions.allowManualBack&&(this.committedMethod||this.loading&&this.verifiedPayer||(this.phase="choose-method",this.paymentId="",this.verifiedPayer=null,this.verifyMatches=null,this.lastVerifiedQuery=null,this.errorMessage=null,this.loading=false,this.syncUi({errorMessage:null,loading:false})));}backToManualEntry(){this.loading&&this.verifiedPayer||(this.phase="manual-entry",this.verifiedPayer=null,this.verifyMatches=null,this.lastVerifiedQuery=null,this.errorMessage=null,this.loading=false,this.syncUi({errorMessage:null,loading:false}));}backToMobileAppFallback(){this.loading&&this.verifiedPayer||this.isMobileAppManualFallbackActive()&&(this.methodSwitchInProgress=false,this.appHandoffStatus="failed",this.phase="mobile-app-active",this.paymentId="",this.verifiedPayer=null,this.verifyMatches=null,this.lastVerifiedQuery=null,this.errorMessage=null,this.loading=false,this.syncUi({errorMessage:null,loading:false}));}isMobileAppManualFallbackActive(){return this.committedMethod!=="mobileApp"?false:this.methodSwitchInProgress?true:this.session?.checkoutMethod==="MOBILE_APP"&&(this.phase==="manual-entry"||this.phase==="manual-picker"||this.phase==="manual-confirm")}selectPayer(e){this.loading||this.phase!=="manual-picker"||(this.verifiedPayer=e,this.phase="manual-confirm",this.errorMessage=null,this.syncUi({errorMessage:null,loading:false}));}async verify(e){if(this.paymentId=e,!ze(e)){this.syncUi({errorMessage:Ee(),loading:false});return}let t=$(e);this.syncUi({errorMessage:null,loading:true});try{let{items:i}=await this.client.verifyPayer(e);if(this.phase!=="manual-entry")return;this.lastVerifiedQuery=t,this.verifyMatches=null,i.length===1?(this.verifiedPayer=i[0],this.phase="manual-confirm"):(this.verifiedPayer=null,this.verifyMatches=i,this.phase="manual-picker"),this.syncUi({loading:!1});}catch(i){this.handleFlowError(i,"manual-entry");}}async attach(e){if(!this.verifiedPayer){this.syncUi({errorMessage:"Find your account before proceeding to pay.",loading:false});return}this.syncUi({errorMessage:null,loading:true});try{let t=await Le(this.client,this.verifiedPayer.paymentId);if(this.methodSwitchInProgress=!1,this.committedMethod="manual",this.applySession(t),this.destroyed)return;t.status==="AWAITING_PAYMENT"&&this.poller.start(t),this.syncUi({loading:!1});}catch(t){this.handleFlowError(t,"manual-confirm");}}handleFlowError(e,t){let i=je(e),r=yi(i,t);if(i.code==="payment-session.not-attachable"){this.handleFailure({reason:"expired",session:this.session});return}else if(i.code==="payment-session.checkout-method-conflict"){this.refreshAfterConflict(),this.syncUi({errorMessage:r,loading:false}),this.config.onError?.(i);return}else if(i.code==="payment-session.checkout-policy-not-bound"){this.syncUi({errorMessage:r,loading:false}),this.config.onError?.(i);return}else if(i.code==="payment-session.checkout-policy-denied"||i.code==="payment-session.checkout-policy-conflict"){this.refreshAfterConflict(),this.syncUi({errorMessage:r,loading:false}),this.config.onError?.(i);return}else this.phase=t;this.syncUi({errorMessage:r,loading:false}),this.config.onError?.(i);}async refreshAfterConflict(){try{let e=await this.client.getSession();q(e)&&this.applyBoundUiOptions(e),this.applySession(e);}catch{}}};se.PAY_WINDOW_PHASES=["qr-active","mobile-app-active","awaiting","manual-confirm"];var ge=se;function hi(n){return n==="failed"?new I({code:"payment-session.failed",status:400,title:"Payment failed",detail:"Something went wrong with this payment."}):n==="declined"?new I({code:"payment-session.declined",status:400,title:"Payment declined",detail:"Your payment was declined."}):new I({code:"payment-session.cancelled",status:400,title:"Payment cancelled",detail:"This payment was cancelled."})}function mi(n){return n==="QR"?"qr":n==="MANUAL"?"manual":n==="MOBILE_APP"?"mobileApp":null}function yi(n,e){return e==="manual-entry"&&(n.status===404||n.code.includes("not-found")||n.code.includes("payer-not-found")||n.code==="payer.not-found")?"No Zippy account found":n.detail?.trim()||"Something went wrong. Please try again."}function je(n){return n instanceof I?n:new I({code:"unknown",status:500,title:"Unexpected error",detail:n instanceof Error?n.message:"An unexpected error occurred"})}function pe(n){return new ge(n)}var Ve="zippy-pay-checkout",_t={"theme-primary":"primary","theme-primary-foreground":"primaryForeground","theme-background":"background","theme-surface":"surface","theme-text":"text","theme-text-muted":"textMuted","theme-border":"border","theme-error":"error","theme-success":"success","theme-border-radius":"borderRadius","theme-font-family":"fontFamily","theme-mode":"mode"},be=class extends HTMLElement{constructor(){super(...arguments);this.instance=null;}static get observedAttributes(){return ["mode","session-id","environment","checkout-policy","mobile-app-policy",...Object.keys(_t)]}connectedCallback(){this.mount();}disconnectedCallback(){this.unmount();}attributeChangedCallback(){this.isConnected&&(this.unmount(),this.mount());}set clientToken(t){this.dataset.clientToken=t,this.isConnected&&(this.unmount(),this.mount());}get clientToken(){return this.dataset.clientToken??this.getAttribute("client-token")??""}mount(){let t=this.readConfig();if(!t)return;this.innerHTML="";let i=t.mode??"inline",r;if(i==="inline"){let a=document.createElement("div");this.appendChild(a),r=a;}this.instance=pe({...t,container:r,mode:i,onReady:a=>this.dispatch("zippy-ready",a),onSessionUpdate:a=>this.dispatch("zippy-session-update",a),onComplete:a=>this.dispatch("zippy-complete",a),onExpired:a=>this.dispatch("zippy-expired",a),onError:a=>this.dispatch("zippy-error",a),onClose:()=>this.dispatch("zippy-close",null)}),t.mode==="modal"&&this.instance.open();}unmount(){this.instance?.destroy(),this.instance=null,this.innerHTML="";}readConfig(){let t=this.getAttribute("environment")??"production",i=this.getAttribute("session-id")??"",r=this.clientToken,a=this.getAttribute("mode")??"inline";if(!i||!r)return null;let o;try{o=j(t);}catch{return null}let s={};for(let[p,d]of Object.entries(_t)){let g=this.getAttribute(p);g&&(d==="mode"?s.mode=g:s[d]=g);}return {environment:o,sessionId:i,clientToken:r,mode:a,theme:s,checkoutPolicy:fi(this.getAttribute("checkout-policy")),mobileApp:gi(this.getAttribute("mobile-app-policy"))}}dispatch(t,i){this.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:true,composed:true}));}open(){this.instance?.open();}close(){this.instance?.close();}destroy(){this.instance?.destroy(),this.instance=null;}};function fi(n){if(n==="QR"||n==="MANUAL")return n}function gi(n){if(n==="option"||n==="enforce")return {policy:n}}function Ge(){typeof customElements>"u"||customElements.get(Ve)||customElements.define(Ve,be);}var bi={create(n){let e=pe(n);return (n.mode??"inline")==="modal"&&e.open(),e}};Ge();var Ln=bi;exports.ANDROID_APP_PACKAGE=ie;exports.ANDROID_PLAY_STORE_NATIVE_URL=Pt;exports.APP_STORE_LINKS=ne;exports.CheckoutController=ge;exports.DEFAULT_THEME=pt;exports.E164_PHONE_PATTERN=et;exports.ELEMENT_TAG=Ve;exports.EMAIL_PATTERN=tt;exports.IOS_APP_STORE_NATIVE_URL=wt;exports.PAYMENT_ID_PATTERN=ke;exports.POLLABLE_STATUSES=xe;exports.PaymentSessionClient=G;exports.SessionPoller=K;exports.TERMINAL_STATUSES=Y;exports.ZIPPY_API_BASE_URLS=le;exports.ZIPPY_API_PATH_PREFIX=we;exports.ZippyPay=bi;exports.ZippyPayCheckoutElement=be;exports.ZippyPayError=I;exports.applyThemeToHost=Ie;exports.attachPayerWithRetry=Le;exports.buildAndroidPaymentIntentUrl=Nt;exports.buildBindPolicyRequest=he;exports.buildPaymentDeepLinkOpenUrl=Bt;exports.buildPaymentQrPayload=me;exports.createCheckout=pe;exports.default=Ln;exports.defineZippyPayCheckoutElement=Ge;exports.detectCheckoutSurface=B;exports.formatAmount=Ce;exports.getCountdownTarget=yt;exports.getPayWindowRemainingRatio=X;exports.getSoftIdleHint=Wt;exports.isAndroidDevice=Be;exports.isCheckoutPolicyBound=q;exports.isCheckoutStartAllowed=J;exports.isFullChooserPolicy=jt;exports.isPhoneDevice=Yt;exports.isTerminalStatus=ce;exports.isValidPayerQuery=ze;exports.isValidPaymentId=Rt;exports.isZippyEnvironment=Je;exports.msUntil=_;exports.normalizePayerQuery=$;exports.normalizePaymentId=V;exports.openAppStore=ae;exports.openPaymentDeepLink=Ye;exports.parseZippyEnvironment=j;exports.payerQueryValidationMessage=Ee;exports.paymentIdValidationMessage=Ht;exports.phaseFromSession=qt;exports.renderBrandedPaymentQrSvg=It;exports.renderPaymentQrMarkup=Qe;exports.renderPaymentQrSvg=Lt;exports.renderQrSvg=$e;exports.renderUrlQrMarkup=We;exports.resolveApiBaseUrl=Pe;exports.resolveAppStoreOpenUrl=De;exports.resolveAppStoreUrl=Vt;exports.resolveAutoStartMethod=Re;exports.resolveCheckoutUiOptions=Ue;exports.resolveCheckoutUiOptionsFromBound=te;exports.resolveCheckoutUiOptionsFromSession=He;exports.resolveEntryRouting=ee;exports.resolveMethodAvailability=vt;exports.resolveMobileAppPolicy=gt;exports.resolveTheme=lt;exports.shouldShowPayProgress=Ne;exports.subscribeCheckoutSurface=Oe;//# sourceMappingURL=index.cjs.map
1765
+ </svg>`}};function Ot(n){let e=n.timeoutMs??8e3,t=false,i=[],r=()=>{for(let p of i)p();i.length=0;},a=p=>{t||(t=true,r(),p==="opened"?n.onOpened():n.onFailed());},o=()=>{document.hidden&&a("opened");};document.addEventListener("visibilitychange",o),i.push(()=>{document.removeEventListener("visibilitychange",o);});let s=setTimeout(()=>{document.hidden?a("opened"):a("failed");},e);return i.push(()=>{clearTimeout(s);}),r}var se=class se{constructor(e){this.ui=null;this.session=null;this.paymentId="";this.verifiedPayer=null;this.verifyMatches=null;this.lastVerifiedQuery=null;this.committedMethod=null;this.phase="loading";this.errorMessage=null;this.loading=true;this.destroyed=false;this.modalOpen=false;this.exitMode=null;this.terminalFailureReason=null;this.appHandoffStatus="idle";this.clearAppHandoffWatch=null;this.methodSwitchInProgress=false;this.entryRoutingDone=false;this.payWindowExpiryTimer=null;this.unsubscribeSurface=null;if(this.config={mode:"inline",closeOnBackdropClick:false,closeOnEscape:false,...e},!it(this.config.sessionId))throw new Error("Zippy Pay: sessionId must be a UUID v4.");j(this.config.environment),this.uiOptions=Ue(this.config.checkoutPolicy,this.config.mobileApp,B()),this.client=new G({baseUrl:Pe(this.config.environment),sessionId:this.config.sessionId,clientToken:this.config.clientToken}),this.embed=ut(this.config),Ie(this.embed.host,this.config.theme),this.poller=new K(()=>this.client.getSession(),{onUpdate:t=>this.handleSessionUpdate(t),onError:t=>this.handlePollError(t)}),this.ui=new fe(this.embed.host,this.snapshotUiState(),{onChooseMethod:t=>{this.chooseMethod(t);},onVerify:t=>this.verify(t),onPay:t=>this.attach(t),onSelectPayer:t=>this.selectPayer(t),onBackToChooseMethod:()=>this.backToChooseMethod(),onBackToManualEntry:()=>this.backToManualEntry(),onBackToMobileAppFallback:()=>this.backToMobileAppFallback(),onOpenMobileApp:()=>this.beginMobileAppHandoff(),onInstallZippy:()=>this.installZippy(),onRetryMobileApp:()=>this.beginMobileAppHandoff(),onPaymentIdChange:t=>{let i=$(t),r=false;(this.verifiedPayer||this.verifyMatches)&&this.lastVerifiedQuery!==null&&i!==this.lastVerifiedQuery&&(this.verifiedPayer=null,this.verifyMatches=null,this.lastVerifiedQuery=null,(this.phase==="manual-confirm"||this.phase==="manual-picker")&&(this.phase="manual-entry"),r=true),this.errorMessage&&(this.errorMessage=null,r=true),this.paymentId=t,r&&this.syncUi();},onTerminalExit:()=>this.executeTerminalExit()},this.uiOptions),this.bootstrap(),this.unsubscribeSurface=Oe(t=>{this.handleSurfaceChange(t);}),this.config.mode==="inline"&&(this.modalOpen=true);}open(){this.config.mode!=="modal"||this.modalOpen||(this.modalOpen=true,ht(this.embed,this.config,()=>this.close()));}close(){this.config.mode==="modal"&&(this.modalOpen=false,mt(this.embed),this.config.onClose?.());}destroy(){this.destroyed||(this.destroyed=true,this.unsubscribeSurface?.(),this.unsubscribeSurface=null,this.poller.stop(),this.clearAppHandoffWatch?.(),this.clearAppHandoffWatch=null,this.clearPayWindowExpiryWatch(),this.ui?.destroy(),this.embed.destroy(),this.ui=null);}snapshotUiState(){return {phase:this.phase,session:this.session,sessionId:this.config.sessionId,committedMethod:this.committedMethod,paymentId:this.paymentId,verifiedPayer:this.verifiedPayer,verifyMatches:this.verifyMatches,errorMessage:this.errorMessage,loading:this.loading,mode:this.config.mode??"inline",exitMode:this.exitMode,appHandoffStatus:this.appHandoffStatus,mobileAppManualFallback:this.isMobileAppManualFallbackActive()}}syncUi(e){this.destroyed||(e&&"errorMessage"in e&&(this.errorMessage=e.errorMessage??null),e&&"loading"in e&&(this.loading=e.loading??false),e&&"exitMode"in e&&(this.exitMode=e.exitMode??null),this.ui?.update(this.snapshotUiState()));}async bootstrap(){try{let e=await this.bindPolicy();if(this.destroyed||(this.applyBoundUiOptions(e),this.applySession(e),this.destroyed))return;this.config.onReady?.(e),ce(e.status)?this.destroyed||this.syncUi({loading:!1}):(await this.routeIdleEntry(),this.destroyed||(this.syncUi({loading:!1}),this.poller.start(e)));}catch(e){this.handleBootstrapError(e);}}async bindPolicy(){let e=he({checkoutPolicy:this.config.checkoutPolicy,mobileApp:this.config.mobileApp});try{return await this.client.bindCheckoutPolicy(e)}catch(t){if(t instanceof I&&t.code==="payment-session.checkout-policy-conflict"){let i=await this.client.getSession();if(q(i))return i}throw t}}applyBoundUiOptions(e,t=B()){this.uiOptions=He(e,t),this.ui?.updateUiOptions(this.uiOptions);}handleSurfaceChange(e){if(this.destroyed||this.committedMethod)return;let t=this.session;!t||!q(t)||this.uiOptions.surface!==e&&(this.uiOptions=te(t.checkoutPolicy,t.mobileAppPolicy??"OFF",e),this.ui?.updateUiOptions(this.uiOptions),(this.phase==="choose-method"||this.phase==="loading")&&this.syncUi());}applySession(e,t){if(this.session=e,this.config.onSessionUpdate?.(e),e.transactionStatus==="DECLINED"&&e.status!=="COMPLETED"){this.methodSwitchInProgress=false,this.handleFailure({reason:"declined",session:e});return}if(e.status==="COMPLETED"){this.methodSwitchInProgress=false,this.handleSuccess(e);return}if(e.status==="EXPIRED"){this.methodSwitchInProgress=false,this.handleFailure({reason:"expired",session:e});return}if(e.status==="FAILED"){this.methodSwitchInProgress=false,this.handleFailure({reason:"failed",session:e});return}if(e.status==="CANCELLED"){this.methodSwitchInProgress=false,this.handleFailure({reason:"cancelled",session:e});return}if(this.isMobileAppManualFallbackActive()&&!t?.fromMethodSwitch){this.schedulePayWindowExpiryWatch(),this.syncUi();return}this.committedMethod=mi(e.checkoutMethod)??this.committedMethod,this.phase=this.resolveActivePhase(e),this.schedulePayWindowExpiryWatch(),this.syncUi();}schedulePayWindowExpiryWatch(){this.clearPayWindowExpiryWatch();let e=this.session;if(!e?.paymentExpiryAt||!se.PAY_WINDOW_PHASES.includes(this.phase))return;let t=_(e.paymentExpiryAt);if(t<=0){this.handlePayWindowExpired();return}this.payWindowExpiryTimer=setTimeout(()=>{this.handlePayWindowExpired();},t+250);}clearPayWindowExpiryWatch(){this.payWindowExpiryTimer!==null&&(clearTimeout(this.payWindowExpiryTimer),this.payWindowExpiryTimer=null);}async handlePayWindowExpired(){if(!(this.destroyed||!this.session?.paymentExpiryAt)){if(_(this.session.paymentExpiryAt)>0){this.schedulePayWindowExpiryWatch();return}if(se.PAY_WINDOW_PHASES.includes(this.phase))try{let e=await this.client.getSession();if(this.destroyed)return;this.applySession(e);}catch{this.destroyed||this.handleFailure({reason:"expired",session:this.session});}}}resolveActivePhase(e){return e.status==="AWAITING_PAYMENT"?e.checkoutMethod==="MOBILE_APP"||this.committedMethod==="mobileApp"?"mobile-app-active":e.checkoutMethod==="QR"||this.committedMethod==="qr"?"qr-active":"awaiting":e.phase==="PAYING"&&e.checkoutMethod==="MOBILE_APP"?"mobile-app-active":e.phase==="PAYING"&&e.checkoutMethod==="QR"?"qr-active":e.phase==="PAYING"&&e.checkoutMethod==="MANUAL"?this.phase==="manual-confirm"&&this.verifiedPayer?"manual-confirm":"manual-entry":e.phase==="IDLE"?this.phase==="manual-confirm"&&this.verifiedPayer?"manual-confirm":this.phase==="manual-picker"&&this.verifyMatches?"manual-picker":this.phase==="manual-entry"?"manual-entry":this.phase==="choose-method"?"choose-method":this.phase==="qr-active"&&this.committedMethod==="qr"?"qr-active":this.phase==="mobile-app-active"&&this.committedMethod==="mobileApp"?"mobile-app-active":!e.checkoutMethod&&ee(this.uiOptions.checkoutPolicy,this.uiOptions.mobileAppPolicy,this.uiOptions.surface)!=="chooser"?"loading":"choose-method":this.phase}handleSessionUpdate(e){this.destroyed||this.applySession(e);}handleFailure(e){if(this.destroyed)return;this.poller.stop(),this.clearPayWindowExpiryWatch(),this.loading=false;let t=e.session??this.session;if(e.reason==="expired")t&&this.config.onExpired?.(t);else {let i=e.error??(e.reason==="failed"||e.reason==="cancelled"||e.reason==="declined"?hi(e.reason):void 0);i&&this.config.onError?.(i);}this.terminalFailureReason=e.reason,this.phase=this.failurePhaseFromReason(e.reason),this.exitMode=this.resolveExitMode("failure",t),this.syncUi();}handleSuccess(e){this.destroyed||(this.poller.stop(),this.clearPayWindowExpiryWatch(),this.loading=false,this.config.onComplete?.(e),this.terminalFailureReason=null,this.phase="success",this.exitMode=this.resolveExitMode("success",e),this.syncUi());}executeTerminalExit(){if(this.destroyed)return;let e=this.session;if(this.phase==="success"&&e){if(this.config.redirectOnComplete&&e.successUrl){window.location.assign(Te(e.successUrl,{sessionId:e.sessionId,status:e.status,transactionId:e.transactionId}));return}}else if(this.phase==="expired"||this.phase==="failed"||this.phase==="cancelled"||this.phase==="declined"||this.phase==="invalid-session"){let t=e?.failureUrl??null;if(this.config.redirectOnFailure&&t){let i=this.terminalFailureReason==="expired"?Te(t,{sessionId:e?.sessionId??this.config.sessionId,status:e?.status??"EXPIRED"}):t;window.location.assign(i);return}}this.teardownView();}resolveExitMode(e,t){return e==="success"?this.config.redirectOnComplete&&t?.successUrl?"redirect":"close":this.config.redirectOnFailure&&t?.failureUrl?"redirect":"close"}failurePhaseFromReason(e){switch(e){case "expired":return "expired";case "failed":return "failed";case "cancelled":return "cancelled";case "declined":return "declined";case "invalid-session":return "invalid-session"}}teardownView(){this.config.mode==="modal"&&this.modalOpen&&this.close(),this.destroy();}handleBootstrapError(e){if(e instanceof I&&e.status===401){this.handleFailure({reason:"invalid-session",error:e,session:this.session});return}this.handleError(e);}handlePollError(e){let t=je(e);if(t.status===401){this.poller.stop(),this.handleFailure({reason:"invalid-session",error:t,session:this.session});return}if(t.code==="payment-session.not-attachable"){this.poller.stop(),this.handleFailure({reason:"expired",session:this.session});return}}handleError(e){let t=je(e);if(t.status===401){this.handleFailure({reason:"invalid-session",error:t,session:this.session});return}if(t.code==="payment-session.not-attachable"){this.handleFailure({reason:"expired",session:this.session});return}if(t.code==="payment-session.checkout-policy-not-bound"){(this.phase==="loading"||this.phase==="choose-method")&&(this.phase="error"),this.syncUi({errorMessage:t.detail||"Checkout is not ready yet. Please refresh and try again.",loading:false}),this.config.onError?.(t),this.poller.stop();return}(this.phase==="loading"||this.phase==="choose-method")&&(this.phase="error"),this.syncUi({errorMessage:t.detail,loading:false}),this.config.onError?.(t),this.poller.stop();}async routeIdleEntry(){if(this.destroyed||this.entryRoutingDone)return;let e=this.session;if(!e||ce(e.status))return;if(e.checkoutMethod){this.entryRoutingDone=true;return}if(e.phase!=="IDLE")return;let t=B(),{checkoutPolicy:i,mobileAppPolicy:r}=this.uiOptions,a=Re(i,r,t);a==="MOBILE_APP"?await this.startMobileAppFlow(false):a==="QR"?await this.chooseMethod("qr"):ee(i,r,t)==="auto-manual"?(this.phase="manual-entry",this.syncUi({loading:false})):(this.phase="choose-method",this.syncUi({loading:false})),this.entryRoutingDone=true;}openMobileApp(){Ye(this.config.sessionId);}beginMobileAppHandoff(){this.destroyed||(this.clearAppHandoffWatch?.(),this.clearAppHandoffWatch=null,this.appHandoffStatus="opening",this.syncUi(),this.openMobileApp(),this.clearAppHandoffWatch=Ot({onOpened:()=>{this.destroyed||(this.appHandoffStatus="opened",this.syncUi());},onFailed:()=>{this.destroyed||(this.appHandoffStatus="failed",this.syncUi());}}));}installZippy(){ae();}async startMobileAppFlow(e){if(this.session?.checkoutMethod==="MOBILE_APP"){this.committedMethod="mobileApp",this.phase="mobile-app-active",e&&this.beginMobileAppHandoff(),this.syncUi({loading:false});return}if(this.committedMethod&&this.committedMethod!=="mobileApp")return;let t=B();if(this.canStartAppClaim("MOBILE_APP",t)){e?(this.committedMethod="mobileApp",this.phase="mobile-app-active",this.beginMobileAppHandoff()):this.syncUi({errorMessage:null,loading:true});try{let i=await this.client.startMobileAppCheckout(t);if(this.committedMethod="mobileApp",this.applySession(i),this.destroyed)return;this.phase="mobile-app-active",this.syncUi({loading:!1});}catch(i){this.handleFlowError(i,"choose-method");}}}canStartAppClaim(e,t){if(!this.session||!q(this.session))return this.syncUi({errorMessage:"Checkout is not ready yet. Please refresh and try again.",loading:false}),false;let i=this.session.checkoutPolicy,r=this.session.mobileAppPolicy??"OFF";return J(i,r,t,e)?true:(this.syncUi({errorMessage:"This payment option is not available on your device.",loading:false}),false)}async chooseMethod(e){if(!this.methodSwitchInProgress&&!(this.committedMethod&&!(this.appHandoffStatus==="failed"&&this.committedMethod==="mobileApp"&&e!=="mobileApp"))){if(this.appHandoffStatus==="failed"&&this.committedMethod==="mobileApp"&&(e==="qr"||e==="manual")){await this.chooseFallbackMethod(e);return}if(e==="mobileApp"){await this.startMobileAppFlow(true);return}this.verifiedPayer=null,this.syncUi({errorMessage:null,loading:e==="qr"});try{if(e==="qr"){let t=B();if(!this.canStartAppClaim("QR",t))return;let i=await this.client.startQrCheckout(t);if(this.committedMethod="qr",this.applySession(i),this.destroyed)return;this.syncUi({loading:!1});}else this.phase="manual-entry",this.syncUi({loading:!1});}catch(t){this.handleFlowError(t,"choose-method");}}}async chooseFallbackMethod(e){if(!(this.appHandoffStatus!=="failed"||this.committedMethod!=="mobileApp"||this.methodSwitchInProgress)){if(this.clearAppHandoffWatch?.(),this.clearAppHandoffWatch=null,e==="manual"){this.methodSwitchInProgress=true,this.appHandoffStatus="idle",this.verifiedPayer=null,this.verifyMatches=null,this.lastVerifiedQuery=null,this.paymentId="",this.phase="manual-entry",this.syncUi({errorMessage:null,loading:false});return}this.methodSwitchInProgress=true,this.verifiedPayer=null,this.syncUi({errorMessage:null,loading:true});try{let t=B(),i=await this.client.startQrCheckout(t);if(this.destroyed)return;this.methodSwitchInProgress=!1,this.appHandoffStatus="idle",this.loading=!1,this.applySession(i,{fromMethodSwitch:!0});}catch(t){this.methodSwitchInProgress=false,this.handleFlowError(t,"mobile-app-active");}}}backToChooseMethod(){this.uiOptions.allowManualBack&&(this.committedMethod||this.loading&&this.verifiedPayer||(this.phase="choose-method",this.paymentId="",this.verifiedPayer=null,this.verifyMatches=null,this.lastVerifiedQuery=null,this.errorMessage=null,this.loading=false,this.syncUi({errorMessage:null,loading:false})));}backToManualEntry(){this.loading&&this.verifiedPayer||(this.phase="manual-entry",this.verifiedPayer=null,this.verifyMatches=null,this.lastVerifiedQuery=null,this.errorMessage=null,this.loading=false,this.syncUi({errorMessage:null,loading:false}));}backToMobileAppFallback(){this.loading&&this.verifiedPayer||this.isMobileAppManualFallbackActive()&&(this.methodSwitchInProgress=false,this.appHandoffStatus="failed",this.phase="mobile-app-active",this.paymentId="",this.verifiedPayer=null,this.verifyMatches=null,this.lastVerifiedQuery=null,this.errorMessage=null,this.loading=false,this.syncUi({errorMessage:null,loading:false}));}isMobileAppManualFallbackActive(){return this.committedMethod!=="mobileApp"?false:this.methodSwitchInProgress?true:this.session?.checkoutMethod==="MOBILE_APP"&&(this.phase==="manual-entry"||this.phase==="manual-picker"||this.phase==="manual-confirm")}selectPayer(e){this.loading||this.phase!=="manual-picker"||(this.verifiedPayer=e,this.phase="manual-confirm",this.errorMessage=null,this.syncUi({errorMessage:null,loading:false}));}async verify(e){if(this.paymentId=e,!ze(e)){this.syncUi({errorMessage:Ee(),loading:false});return}let t=$(e);this.syncUi({errorMessage:null,loading:true});try{let{items:i}=await this.client.verifyPayer(e);if(this.phase!=="manual-entry")return;this.lastVerifiedQuery=t,this.verifyMatches=null,i.length===1?(this.verifiedPayer=i[0],this.phase="manual-confirm"):(this.verifiedPayer=null,this.verifyMatches=i,this.phase="manual-picker"),this.syncUi({loading:!1});}catch(i){this.handleFlowError(i,"manual-entry");}}async attach(e){if(!this.verifiedPayer){this.syncUi({errorMessage:"Find your account before proceeding to pay.",loading:false});return}this.syncUi({errorMessage:null,loading:true});try{let t=await Le(this.client,this.verifiedPayer.paymentId);if(this.methodSwitchInProgress=!1,this.committedMethod="manual",this.applySession(t),this.destroyed)return;t.status==="AWAITING_PAYMENT"&&this.poller.start(t),this.syncUi({loading:!1});}catch(t){this.handleFlowError(t,"manual-confirm");}}handleFlowError(e,t){let i=je(e),r=yi(i,t);if(i.code==="payment-session.not-attachable"){this.handleFailure({reason:"expired",session:this.session});return}else if(i.code==="payment-session.checkout-method-conflict"){this.refreshAfterConflict(),this.syncUi({errorMessage:r,loading:false}),this.config.onError?.(i);return}else if(i.code==="payment-session.checkout-policy-not-bound"){this.syncUi({errorMessage:r,loading:false}),this.config.onError?.(i);return}else if(i.code==="payment-session.checkout-policy-denied"||i.code==="payment-session.checkout-policy-conflict"){this.refreshAfterConflict(),this.syncUi({errorMessage:r,loading:false}),this.config.onError?.(i);return}else this.phase=t;this.syncUi({errorMessage:r,loading:false}),this.config.onError?.(i);}async refreshAfterConflict(){try{let e=await this.client.getSession();q(e)&&this.applyBoundUiOptions(e),this.applySession(e);}catch{}}};se.PAY_WINDOW_PHASES=["qr-active","mobile-app-active","awaiting","manual-confirm"];var ge=se;function hi(n){return n==="failed"?new I({code:"payment-session.failed",status:400,title:"Payment failed",detail:"Something went wrong with this payment."}):n==="declined"?new I({code:"payment-session.declined",status:400,title:"Payment declined",detail:"Your payment was declined."}):new I({code:"payment-session.cancelled",status:400,title:"Payment cancelled",detail:"This payment was cancelled."})}function mi(n){return n==="QR"?"qr":n==="MANUAL"?"manual":n==="MOBILE_APP"?"mobileApp":null}function yi(n,e){return e==="manual-entry"&&(n.status===404||n.code.includes("not-found")||n.code.includes("payer-not-found")||n.code==="payer.not-found")?"No Zippy account found":n.detail?.trim()||"Something went wrong. Please try again."}function je(n){return n instanceof I?n:new I({code:"unknown",status:500,title:"Unexpected error",detail:n instanceof Error?n.message:"An unexpected error occurred"})}function pe(n){return new ge(n)}var Ve="zippy-pay-checkout",_t={"theme-primary":"primary","theme-primary-foreground":"primaryForeground","theme-background":"background","theme-surface":"surface","theme-text":"text","theme-text-muted":"textMuted","theme-border":"border","theme-error":"error","theme-success":"success","theme-border-radius":"borderRadius","theme-font-family":"fontFamily","theme-mode":"mode"},be=class extends HTMLElement{constructor(){super(...arguments);this.instance=null;}static get observedAttributes(){return ["mode","session-id","environment","checkout-policy","mobile-app-policy",...Object.keys(_t)]}connectedCallback(){this.mount();}disconnectedCallback(){this.unmount();}attributeChangedCallback(){this.isConnected&&(this.unmount(),this.mount());}set clientToken(t){this.dataset.clientToken=t,this.isConnected&&(this.unmount(),this.mount());}get clientToken(){return this.dataset.clientToken??this.getAttribute("client-token")??""}mount(){let t=this.readConfig();if(!t)return;this.innerHTML="";let i=t.mode??"inline",r;if(i==="inline"){let a=document.createElement("div");this.appendChild(a),r=a;}this.instance=pe({...t,container:r,mode:i,onReady:a=>this.dispatch("zippy-ready",a),onSessionUpdate:a=>this.dispatch("zippy-session-update",a),onComplete:a=>this.dispatch("zippy-complete",a),onExpired:a=>this.dispatch("zippy-expired",a),onError:a=>this.dispatch("zippy-error",a),onClose:()=>this.dispatch("zippy-close",null)}),t.mode==="modal"&&this.instance.open();}unmount(){this.instance?.destroy(),this.instance=null,this.innerHTML="";}readConfig(){let t=this.getAttribute("environment")??"production",i=this.getAttribute("session-id")??"",r=this.clientToken,a=this.getAttribute("mode")??"inline";if(!i||!r)return null;let o;try{o=j(t);}catch{return null}let s={};for(let[p,d]of Object.entries(_t)){let g=this.getAttribute(p);g&&(d==="mode"?s.mode=g:s[d]=g);}return {environment:o,sessionId:i,clientToken:r,mode:a,theme:s,checkoutPolicy:fi(this.getAttribute("checkout-policy")),mobileApp:gi(this.getAttribute("mobile-app-policy"))}}dispatch(t,i){this.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:true,composed:true}));}open(){this.instance?.open();}close(){this.instance?.close();}destroy(){this.instance?.destroy(),this.instance=null;}};function fi(n){if(n==="QR"||n==="MANUAL")return n}function gi(n){if(n==="off"||n==="option"||n==="enforce")return {policy:n}}function Ge(){typeof customElements>"u"||customElements.get(Ve)||customElements.define(Ve,be);}var bi={create(n){let e=pe(n);return (n.mode??"inline")==="modal"&&e.open(),e}};Ge();var Ln=bi;exports.ANDROID_APP_PACKAGE=ie;exports.ANDROID_PLAY_STORE_NATIVE_URL=Pt;exports.APP_STORE_LINKS=ne;exports.CheckoutController=ge;exports.DEFAULT_THEME=pt;exports.E164_PHONE_PATTERN=et;exports.ELEMENT_TAG=Ve;exports.EMAIL_PATTERN=tt;exports.IOS_APP_STORE_NATIVE_URL=wt;exports.PAYMENT_ID_PATTERN=ke;exports.POLLABLE_STATUSES=ve;exports.PaymentSessionClient=G;exports.SessionPoller=K;exports.TERMINAL_STATUSES=Y;exports.ZIPPY_API_BASE_URLS=le;exports.ZIPPY_API_PATH_PREFIX=we;exports.ZippyPay=bi;exports.ZippyPayCheckoutElement=be;exports.ZippyPayError=I;exports.applyThemeToHost=Ie;exports.attachPayerWithRetry=Le;exports.buildAndroidPaymentIntentUrl=Nt;exports.buildBindPolicyRequest=he;exports.buildPaymentDeepLinkOpenUrl=Bt;exports.buildPaymentQrPayload=me;exports.createCheckout=pe;exports.default=Ln;exports.defineZippyPayCheckoutElement=Ge;exports.detectCheckoutSurface=B;exports.formatAmount=Ce;exports.getCountdownTarget=yt;exports.getPayWindowRemainingRatio=X;exports.getSoftIdleHint=Wt;exports.isAndroidDevice=Be;exports.isCheckoutPolicyBound=q;exports.isCheckoutStartAllowed=J;exports.isFullChooserPolicy=jt;exports.isPhoneDevice=Yt;exports.isTerminalStatus=ce;exports.isValidPayerQuery=ze;exports.isValidPaymentId=Rt;exports.isZippyEnvironment=Je;exports.msUntil=_;exports.normalizePayerQuery=$;exports.normalizePaymentId=V;exports.openAppStore=ae;exports.openPaymentDeepLink=Ye;exports.parseZippyEnvironment=j;exports.payerQueryValidationMessage=Ee;exports.paymentIdValidationMessage=Ht;exports.phaseFromSession=qt;exports.renderBrandedPaymentQrSvg=It;exports.renderPaymentQrMarkup=Qe;exports.renderPaymentQrSvg=Lt;exports.renderQrSvg=$e;exports.renderUrlQrMarkup=We;exports.resolveApiBaseUrl=Pe;exports.resolveAppStoreOpenUrl=De;exports.resolveAppStoreUrl=Vt;exports.resolveAutoStartMethod=Re;exports.resolveCheckoutUiOptions=Ue;exports.resolveCheckoutUiOptionsFromBound=te;exports.resolveCheckoutUiOptionsFromSession=He;exports.resolveEntryRouting=ee;exports.resolveMethodAvailability=xt;exports.resolveMobileAppPolicy=gt;exports.resolveTheme=lt;exports.shouldShowPayProgress=Ne;exports.subscribeCheckoutSurface=Oe;//# sourceMappingURL=index.cjs.map
1766
1766
  //# sourceMappingURL=index.cjs.map