@forgeroute/ui 0.5.0 → 0.5.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.
@@ -2138,7 +2138,276 @@ const UI_DEFAULT_LABELS = {
2138
2138
  "rangeFilter.filterByActive": "Filter by {{ label }}: {{ range }}",
2139
2139
  "rangeFilter.percent": "{{ value }}%",
2140
2140
  "rangeFilter.withUnit": "{{ value }} {{ unit }}",
2141
- "rangeFilter.badNumber": "Please enter a valid number"
2141
+ "rangeFilter.badNumber": "Please enter a valid number",
2142
+ "squarePayment.label": "Payment details",
2143
+ "squarePayment.loadErrorMessage": "Failed to load the payment form. Please try again.",
2144
+ "squarePayment.a11y.loading": "Loading payment form",
2145
+ "squarePayment.a11y.processing": "Processing payment",
2146
+ "squarePayment.a11y.tokenized": "Payment details accepted",
2147
+ "squarePayment.method.group": "Payment method",
2148
+ "squarePayment.method.card": "Card",
2149
+ "squarePayment.method.ach": "Bank account",
2150
+ "squarePayment.submit.pay": "Pay",
2151
+ "squarePayment.submit.payBank": "Pay with bank account",
2152
+ "squarePayment.submit.saveCard": "Save card",
2153
+ "squarePayment.submit.saveBank": "Save bank account",
2154
+ "squarePayment.holderLabel": "Account holder name",
2155
+ "squarePayment.holderPlaceholder": "Full name on the bank account",
2156
+ "squarePayment.holderRequired": "Enter the account holder name.",
2157
+ "squarePayment.achInfo": "Choose your bank in the secure window that opens next. Your bank login is never shared with us.",
2158
+ "squarePayment.achConsent": "By checking this box, I authorize the above business to initiate a one-time ACH debit entry to my bank account for the total shown (the payment amount plus any fees). I understand I may revoke this authorization at any time by contacting the business.",
2159
+ "squarePayment.achConsentSetup": "By checking this box, I authorize the above business to initiate ACH debit entries to my bank account for agreed-upon payments. I understand I may revoke this authorization at any time by contacting the business.",
2160
+ "squarePayment.consentRequired": "Accept the bank authorization to continue.",
2161
+ "squarePayment.msg.loadFailed": "Failed to load Square",
2162
+ "squarePayment.msg.configMissing": "The Square application and location are not set up.",
2163
+ "squarePayment.msg.notReady": "The payment form is not ready yet.",
2164
+ "squarePayment.msg.cardFormFailed": "Could not show the card form. Please refresh the page.",
2165
+ "squarePayment.msg.achInitFailed": "Could not start the bank account form. Please try again.",
2166
+ "squarePayment.msg.cancelled": "The bank authorization was cancelled.",
2167
+ "squarePayment.msg.tokenizeFailed": "We could not read your card details. Please check them and try again.",
2168
+ "squarePayment.msg.achFailed": "The bank account could not be authorized. Please try again.",
2169
+ "squarePayment.msg.verifyFailed": "We could not verify your identity with your bank. Please try again or use another card.",
2170
+ "squareErrors.defaultMessage": "Payment failed. Please try again.",
2171
+ "squareErrors.field.cardNumber": "The card number is not valid. Please check it and try again.",
2172
+ "squareErrors.field.expirationDate": "The expiration date is not valid. Please check it and try again.",
2173
+ "squareErrors.field.cvv": "The security code is not valid. Please check it and try again.",
2174
+ "squareErrors.field.postalCode": "The postal code is not valid. Please check it and try again.",
2175
+ "squareErrors.type.UNSUPPORTED_CARD_BRAND": "This card type is not accepted. Please use a different card.",
2176
+ "squareErrors.type.CONFIGURATION": "Card payments are not set up correctly. Please contact the business.",
2177
+ "squareErrors.type.PAYMENT_METHOD_NOT_SUPPORTED": "This payment method is not available in your browser. Please use a different one.",
2178
+ "squareErrors.code.GENERIC_DECLINE": "Your card was declined. Please contact your bank or try a different card.",
2179
+ "squareErrors.code.CARD_DECLINED": "Your card was declined. Please use a different card.",
2180
+ "squareErrors.code.CARD_DECLINED_CALL_ISSUER": "Your bank declined this payment. Please call your bank for more information.",
2181
+ "squareErrors.code.CARD_DECLINED_VERIFICATION_REQUIRED": "This card needs to be verified. Please try again and complete the verification step.",
2182
+ "squareErrors.code.INSUFFICIENT_FUNDS": "Your card has insufficient funds. Please use a different card.",
2183
+ "squareErrors.code.CVV_FAILURE": "The security code is incorrect. Please check it and try again.",
2184
+ "squareErrors.code.ADDRESS_VERIFICATION_FAILURE": "The postal code does not match the card. Please check it and try again.",
2185
+ "squareErrors.code.INVALID_EXPIRATION": "The expiration date is incorrect. Please check it and try again.",
2186
+ "squareErrors.code.CARD_EXPIRED": "Your card has expired. Please use a different card.",
2187
+ "squareErrors.code.INVALID_CARD": "The card number is incorrect. Please check it and try again.",
2188
+ "squareErrors.code.CARD_NOT_SUPPORTED": "This card does not support this type of payment. Please use a different card.",
2189
+ "squareErrors.code.INVALID_ACCOUNT": "This bank account could not be used. Please try a different account.",
2190
+ "squareErrors.code.PAYMENT_LIMIT_EXCEEDED": "This payment is over the allowed limit. Please contact the business.",
2191
+ "squareErrors.code.BUYER_REFUSED_PAYMENT": "The payment was not authorized. Please try again.",
2192
+ "squareErrors.code.CARDHOLDER_INSUFFICIENT_PERMISSIONS": "This card cannot be used for this payment. Please use a different card.",
2193
+ "squareErrors.code.IDEMPOTENCY_KEY_REUSED": "This payment was already submitted with different details. Please reload the page and try again.",
2194
+ "squareErrors.code.RATE_LIMITED": "Too many requests. Please wait a moment and try again.",
2195
+ "squareErrors.code.UNAUTHORIZED": "Card payments are not available right now. Please contact the business.",
2196
+ "squareConnect.title": "Square account",
2197
+ "squareConnect.startTitle": "Connect your Square account",
2198
+ "squareConnect.startText": "Collect your customers' payments online. You authorize access on Square, then come back here.",
2199
+ "squareConnect.startLabel": "Connect Square",
2200
+ "squareConnect.connected": "Square connected",
2201
+ "squareConnect.needsReconnect": "Reconnect needed",
2202
+ "squareConnect.reconnectText": "Square no longer accepts the saved authorization. Connect again to keep taking payments.",
2203
+ "squareConnect.reconnect": "Reconnect",
2204
+ "squareConnect.disconnect": "Disconnect",
2205
+ "squareConnect.disconnectTitle": "Disconnect Square",
2206
+ "squareConnect.disconnectMessage": "Customers can no longer pay with Square until you connect again.",
2207
+ "squareConnect.checkStatus": "Check Status",
2208
+ "squareConnect.checking": "Checking...",
2209
+ "squareConnect.connectedOn": "Connected {{ date }}",
2210
+ "squareConnect.opensInNewTabBusy": "{{ label }}, opens in a new tab, busy",
2211
+ "squareConnect.opensInNewTabSr": ", opens in a new tab",
2212
+ "squareConnect.live.none": "Square not connected.",
2213
+ "squareConnect.live.connected": "Square connected.",
2214
+ "squareConnect.live.reconnect": "Square needs to be reconnected.",
2215
+ "squareConnect.live.loading": "{{ text }} Loading.",
2216
+ "squareConnect.noticeConnected": "Square is connected.",
2217
+ "squareConnect.noticeReconnect": "Square needs to be reconnected. Please connect again.",
2218
+ "squareConnect.noticeNotConnected": "Square is not connected yet. Finish the authorization, then check again.",
2219
+ "squareConnect.noticeDisconnected": "Square disconnected.",
2220
+ "squareConnect.noticeLinkUnavailable": "Unable to open the Square authorization page. Please try again.",
2221
+ "squareConnect.failedStart": "Failed to start the Square connection",
2222
+ "squareConnect.failedCheck": "Failed to check the Square connection",
2223
+ "squareConnect.failedDisconnect": "Failed to disconnect Square",
2224
+ "squareConnect.merchantLine": "Merchant: {{ merchant }}",
2225
+ "squareConnect.locationLine": "Location: {{ location }}",
2226
+ "qboConnect.title": "QuickBooks Payments",
2227
+ "qboConnect.startTitle": "Connect your QuickBooks account",
2228
+ "qboConnect.startText": "Collect your customers' card and bank payments through QuickBooks Payments. You authorize access on Intuit, then come back here.",
2229
+ "qboConnect.startLabel": "Connect QuickBooks",
2230
+ "qboConnect.connected": "QuickBooks connected",
2231
+ "qboConnect.needsReconnect": "Reconnect needed",
2232
+ "qboConnect.reconnectText": "QuickBooks no longer accepts the saved authorization. Connect again to keep taking payments.",
2233
+ "qboConnect.reconnect": "Reconnect",
2234
+ "qboConnect.disconnect": "Disconnect",
2235
+ "qboConnect.disconnectTitle": "Disconnect QuickBooks",
2236
+ "qboConnect.disconnectMessage": "Customers can no longer pay with QuickBooks until you connect again.",
2237
+ "qboConnect.checkStatus": "Check Status",
2238
+ "qboConnect.checking": "Checking...",
2239
+ "qboConnect.connectedOn": "Connected {{ date }}",
2240
+ "qboConnect.opensInNewTabBusy": "{{ label }}, opens in a new tab, busy",
2241
+ "qboConnect.opensInNewTabSr": ", opens in a new tab",
2242
+ "qboConnect.live.none": "QuickBooks not connected.",
2243
+ "qboConnect.live.connected": "QuickBooks connected.",
2244
+ "qboConnect.live.reconnect": "QuickBooks needs to be reconnected.",
2245
+ "qboConnect.live.loading": "{{ text }} Loading.",
2246
+ "qboConnect.noticeConnected": "QuickBooks is connected.",
2247
+ "qboConnect.noticeReconnect": "QuickBooks needs to be reconnected. Please connect again.",
2248
+ "qboConnect.noticeNotConnected": "QuickBooks is not connected yet. Finish the authorization, then check again.",
2249
+ "qboConnect.noticeDisconnected": "QuickBooks disconnected.",
2250
+ "qboConnect.noticeLinkUnavailable": "Unable to open the QuickBooks authorization page. Please try again.",
2251
+ "qboConnect.failedStart": "Failed to start the QuickBooks connection",
2252
+ "qboConnect.failedCheck": "Failed to check the QuickBooks connection",
2253
+ "qboConnect.failedDisconnect": "Failed to disconnect QuickBooks",
2254
+ "qboConnect.companyLine": "Company: {{ company }}",
2255
+ "squarePaymentMethod.methodCard": "Card",
2256
+ "squarePaymentMethod.methodAch": "ACH / Bank Transfer",
2257
+ "squarePaymentMethod.amountNeeded": "Enter an amount to continue.",
2258
+ "squarePaymentMethod.notCompleted": "Payment was not completed. Please try again or choose another method.",
2259
+ "squarePaymentMethod.achTitle": "Bank Payment Submitted",
2260
+ "squarePaymentMethod.achMessage": "Your bank payment of {{ amount }} has been submitted for processing. ACH payments typically take 3–5 business days to complete.",
2261
+ "squarePaymentMethod.pendingTitle": "Payment Submitted",
2262
+ "squarePaymentMethod.pendingMessage": "Your payment of {{ amount }} has been submitted and is being processed.",
2263
+ "squarePaymentMethod.receiptNote": "A receipt is sent once the payment has been fully processed and settled.",
2264
+ "squarePaymentMethod.paymentDetails": "Payment details",
2265
+ "squarePaymentMethod.totalCharged": "Total charged",
2266
+ "squarePaymentMethod.amountPlusFees": "Payment amount plus fees",
2267
+ "squarePaymentMethod.paymentTotal": "Payment total",
2268
+ "squarePaymentMethod.paymentAmount": "Payment amount",
2269
+ "squarePaymentMethod.processingFee": "Processing fee",
2270
+ "squarePaymentMethod.platformFee": "Platform fee",
2271
+ "squarePaymentMethod.feesFailed": "Could not calculate the fees. Please try again.",
2272
+ "squarePaymentMethod.announceProcessing": "Processing payment",
2273
+ "squarePaymentMethod.pay": "Pay",
2274
+ "squarePaymentMethod.paymentFailed": "Payment failed. Please try again.",
2275
+ "squarePaymentMethod.unavailable": "Payments are not available right now.",
2276
+ "squarePaymentMethod.announceReady": "Payment form ready",
2277
+ "qboPaymentMethod.methodCard": "Card",
2278
+ "qboPaymentMethod.methodAch": "ACH / Bank Transfer",
2279
+ "qboPaymentMethod.amountNeeded": "Enter an amount to continue.",
2280
+ "qboPaymentMethod.notCompleted": "Payment was not completed. Please try again or choose another method.",
2281
+ "qboPaymentMethod.achTitle": "Bank Payment Submitted",
2282
+ "qboPaymentMethod.achMessage": "Your bank payment of {{ amount }} has been submitted for processing. ACH payments typically take 3–5 business days to complete.",
2283
+ "qboPaymentMethod.pendingTitle": "Payment Submitted",
2284
+ "qboPaymentMethod.pendingMessage": "Your payment of {{ amount }} has been submitted and is being processed.",
2285
+ "qboPaymentMethod.receiptNote": "A receipt is sent once the payment has been fully processed and settled.",
2286
+ "qboPaymentMethod.paymentDetails": "Payment details",
2287
+ "qboPaymentMethod.totalCharged": "Total charged",
2288
+ "qboPaymentMethod.amountPlusFees": "Payment amount plus fees",
2289
+ "qboPaymentMethod.paymentTotal": "Payment total",
2290
+ "qboPaymentMethod.paymentAmount": "Payment amount",
2291
+ "qboPaymentMethod.processingFee": "Processing fee",
2292
+ "qboPaymentMethod.platformFee": "Platform fee",
2293
+ "qboPaymentMethod.feesFailed": "Could not calculate the fees. Please try again.",
2294
+ "qboPaymentMethod.announceProcessing": "Processing payment",
2295
+ "qboPaymentMethod.pay": "Pay",
2296
+ "qboPaymentMethod.paymentFailed": "Payment failed. Please try again.",
2297
+ "qboPaymentMethod.unavailable": "Payments are not available right now.",
2298
+ "qboPayment.label": "Payment details",
2299
+ "qboPayment.a11y.processing": "Processing payment",
2300
+ "qboPayment.a11y.tokenized": "Payment details accepted",
2301
+ "qboPayment.method.group": "Payment method",
2302
+ "qboPayment.method.card": "Card",
2303
+ "qboPayment.method.ach": "Bank account",
2304
+ "qboPayment.submit.pay": "Pay",
2305
+ "qboPayment.submit.payBank": "Pay with bank account",
2306
+ "qboPayment.submit.saveCard": "Save card",
2307
+ "qboPayment.submit.saveBank": "Save bank account",
2308
+ "qboPayment.secureNote": "Your details are sent securely to QuickBooks Payments and are not stored on this page.",
2309
+ "qboPayment.card.number": "Card number",
2310
+ "qboPayment.card.name": "Name on card",
2311
+ "qboPayment.card.nameOptional": "Name on card (optional)",
2312
+ "qboPayment.card.expiry": "Expiration (MM/YY)",
2313
+ "qboPayment.card.expiryPlaceholder": "MM/YY",
2314
+ "qboPayment.card.cvc": "Security code",
2315
+ "qboPayment.card.postal": "Postal code",
2316
+ "qboPayment.card.postalOptional": "Postal code (optional)",
2317
+ "qboPayment.bank.info": "Enter the bank account details. The payment is sent as an ACH bank transfer.",
2318
+ "qboPayment.bank.holder": "Account holder name",
2319
+ "qboPayment.bank.routing": "Routing number",
2320
+ "qboPayment.bank.routingPlaceholder": "9 digits",
2321
+ "qboPayment.bank.account": "Account number",
2322
+ "qboPayment.bank.confirm": "Confirm account number",
2323
+ "qboPayment.bank.type": "Account type",
2324
+ "qboPayment.bank.type.PERSONAL_CHECKING": "Personal checking",
2325
+ "qboPayment.bank.type.PERSONAL_SAVINGS": "Personal savings",
2326
+ "qboPayment.bank.type.BUSINESS_CHECKING": "Business checking",
2327
+ "qboPayment.bank.type.BUSINESS_SAVINGS": "Business savings",
2328
+ "qboPayment.brand.visa": "Visa",
2329
+ "qboPayment.brand.mastercard": "Mastercard",
2330
+ "qboPayment.brand.amex": "American Express",
2331
+ "qboPayment.brand.discover": "Discover",
2332
+ "qboPayment.brand.diners": "Diners Club",
2333
+ "qboPayment.brand.jcb": "JCB",
2334
+ "qboPayment.achConsent": "By checking this box, I authorize the above business to initiate a one-time ACH debit entry to my bank account for the total shown (the payment amount plus any fees). I understand I may revoke this authorization at any time by contacting the business.",
2335
+ "qboPayment.achConsentSetup": "By checking this box, I authorize the above business to initiate ACH debit entries to my bank account for agreed-upon payments. I understand I may revoke this authorization at any time by contacting the business.",
2336
+ "qboPayment.consentRequired": "Accept the bank authorization to continue.",
2337
+ "qboPayment.err.required": "{{ field }} is required.",
2338
+ "qboPayment.err.numberLength": "Enter the full card number.",
2339
+ "qboPayment.err.numberLuhn": "This card number is not valid. Please check it.",
2340
+ "qboPayment.err.expiryFormat": "Use the format MM/YY.",
2341
+ "qboPayment.err.expiryMonth": "The month must be 01 to 12.",
2342
+ "qboPayment.err.expiryPast": "This card has expired.",
2343
+ "qboPayment.err.cvcLength": "The security code has {{ length }} digits.",
2344
+ "qboPayment.err.or": "or",
2345
+ "qboPayment.err.postalFormat": "Enter a ZIP code such as 94086 or 94086-1234.",
2346
+ "qboPayment.err.postalFormatCa": "Enter a valid postal code, such as A1A 1A1.",
2347
+ "qboPayment.err.routingLength": "The routing number has 9 digits.",
2348
+ "qboPayment.err.accountLength": "The account number has 4 to 17 digits.",
2349
+ "qboPayment.err.confirmMismatch": "The account numbers do not match.",
2350
+ "qboErrors.defaultMessage": "Payment failed. Please try again.",
2351
+ "qboErrors.field.cardNumber": "The card number was not accepted. Please check it and try again.",
2352
+ "qboErrors.field.expiry": "The expiration date was not accepted. Please check it and try again.",
2353
+ "qboErrors.field.cvc": "The security code was not accepted. Please check it and try again.",
2354
+ "qboErrors.field.postalCode": "The postal code was not accepted. Please check it and try again.",
2355
+ "qboErrors.field.routing": "The routing number was not accepted. Please check it and try again.",
2356
+ "qboErrors.field.account": "The account number was not accepted. Please check it and try again.",
2357
+ "qboErrors.field.accountType": "The account type was not accepted. Please check it and try again.",
2358
+ "qboErrors.field.holder": "The account holder name was not accepted. Please check it and try again.",
2359
+ "qboErrors.status.network": "We could not reach the payment service. Please check your connection and try again.",
2360
+ "qboErrors.status.invalid": "The payment details were not accepted. Please check them and try again.",
2361
+ "qboErrors.status.notAllowed": "This payment form cannot take payments right now. Please contact the business.",
2362
+ "qboErrors.status.rateLimited": "Too many requests. Please wait a moment and try again.",
2363
+ "qboErrors.status.unavailable": "The payment service is unavailable right now. Please try again in a few minutes.",
2364
+ "paymentAttempt.checking": "Checking your payment...",
2365
+ "paymentAttempt.checkingHelp": "Please wait and do not pay again. We are making sure your payment went through.",
2366
+ "paymentAttempt.stillUnknown": "We could not confirm your payment yet. Please check again in a moment and do not pay again.",
2367
+ "paymentAttempt.checkAgain": "Check again",
2368
+ "paymentAttempt.waiting": "Waiting for your payment to be confirmed...",
2369
+ "paymentAttempt.startOver": "Start over",
2370
+ "paymentAttempt.paid": "A payment for this was just received. If you need to make another payment, please wait a moment or contact support.",
2371
+ "paymentAttempt.queuedOffline": "You appear to be offline. Your payment was not confirmed. Please check your connection and try again.",
2372
+ "paymentAttempt.offline": "You are offline. Reconnect to the internet to pay: nothing was sent.",
2373
+ "paymentAttempt.timeout": "Your payment is taking longer than expected. We are checking whether it went through: do not pay again.",
2374
+ "paymentAttempt.offlineInFlight": "You went offline while your payment was being sent. We are checking whether it went through: do not pay again.",
2375
+ "paymentAttempt.succeededAfterCheck": "Your payment went through. Thank you.",
2376
+ "paymentAttempt.failedAfterCheck": "The earlier payment attempt did not go through. You can try again.",
2377
+ "paymentAttempt.authRequired": "Your bank needs to verify this payment. Complete the verification window and do not close it.",
2378
+ "paymentAttempt.authAbandoned": "The verification was not completed. We are checking whether the payment went through before you can try again.",
2379
+ "paymentAttempt.verifyRetry": "The card could not be verified. You can try again: the total stays {{ amount }}.",
2380
+ "paymentAttempt.duplicate": "We detected a possible duplicate payment. Please contact support before paying again.",
2381
+ "paymentReadiness.offline": "You are offline. Reconnect to the internet to pay: nothing was sent.",
2382
+ "paymentReadiness.slow_connection": "Your connection is too slow to pay safely. Please try again on a better connection.",
2383
+ "paymentReadiness.sdk_blocked": "The secure payment form could not be loaded. It may be blocked by an extension, a network filter or a weak connection. Retry loading it, or try another browser.",
2384
+ "paymentReadiness.service_unavailable": "Payments are temporarily unavailable. Please try again in a few minutes.",
2385
+ "paymentReadiness.merchant_not_ready": "This business cannot accept this kind of payment right now. Please contact the business.",
2386
+ "paymentReadiness.events_backlog": "Payments are paused for a moment while we catch up. Please try again shortly.",
2387
+ "paymentReadiness.payable_changed": "The amount due changed. Reload the page to see the current balance before you pay.",
2388
+ "paymentReadiness.already_paid": "This has already been paid.",
2389
+ "paymentReadiness.payment_in_flight": "A payment for this is already being processed. Please wait and check again shortly.",
2390
+ "paymentReadiness.unsupported_browser": "This browser cannot make payments safely. Please use a current version of Chrome, Edge, Firefox or Safari over a secure (https) connection.",
2391
+ "paymentReadiness.unknown_payment": "We are still checking an earlier payment. Please wait and do not pay again.",
2392
+ "paymentReadiness.checking": "Checking that payments are available...",
2393
+ "paymentReadiness.generic": "Payments are not available right now. Please try again shortly.",
2394
+ "paymentReadiness.retryLoad": "Retry loading the payment form",
2395
+ "paymentReadiness.storageWarning": "Your browser limits storage, so a page reload or a second tab during a payment cannot be recovered automatically. Please do not reload or open this page twice while paying.",
2396
+ "qboHostedPay.title": "Pay {{ amount }}",
2397
+ "qboHostedPay.titleNoAmount": "Secure payment",
2398
+ "qboHostedPay.pay": "Pay {{ amount }}",
2399
+ "qboHostedPay.loading": "Loading payment details",
2400
+ "qboHostedPay.expiredTitle": "Link expired",
2401
+ "qboHostedPay.expired": "This payment link has expired. Please contact the business for a new one.",
2402
+ "qboHostedPay.usedTitle": "Already paid",
2403
+ "qboHostedPay.used": "This payment link has already been used.",
2404
+ "qboHostedPay.successTitle": "Payment received",
2405
+ "qboHostedPay.success": "Thank you. Your payment of {{ amount }} was received.",
2406
+ "qboHostedPay.submittedTitle": "Payment submitted",
2407
+ "qboHostedPay.submitted": "Thank you. Your bank payment of {{ amount }} was submitted. Bank transfers (ACH) usually take 3–5 business days to complete.",
2408
+ "qboHostedPay.errorTitle": "Something went wrong",
2409
+ "qboHostedPay.footer": "Payments are processed securely by QuickBooks Payments.",
2410
+ "stripePayment.msg.tokenFailed": "The card details could not be checked. Please try again."
2142
2411
  };
2143
2412
  function interpolate$1(text, params) {
2144
2413
  if (!params) return text;
@@ -67676,7 +67945,9 @@ var PaymentSidePanelComponent = class PaymentSidePanelComponent {
67676
67945
  method,
67677
67946
  code,
67678
67947
  ...extra?.result ? { result: extra.result } : {},
67679
- ...extra?.message ? { message: extra.message } : {}
67948
+ ...extra?.message ? { message: extra.message } : {},
67949
+ ...extra?.attemptKey ? { attemptKey: extra.attemptKey } : {},
67950
+ ...extra?.paid ? { paid: extra.paid } : {}
67680
67951
  }),
67681
67952
  announce: (text) => this.announcement.set(text)
67682
67953
  };
@@ -67689,7 +67960,8 @@ var PaymentSidePanelComponent = class PaymentSidePanelComponent {
67689
67960
  const result = {
67690
67961
  type: partial?.type ?? "manual",
67691
67962
  paymentMethod: partial?.paymentMethod ?? method,
67692
- amount: partial?.amount ?? snapshotAmount ?? 0
67963
+ amount: partial?.amount ?? snapshotAmount ?? 0,
67964
+ ...partial?.processor ? { processor: partial.processor } : {}
67693
67965
  };
67694
67966
  this.announcement.set(this.labels.t("paymentSidePanel.announceRecorded"));
67695
67967
  this.outcome.emit({
@@ -69117,6 +69389,1569 @@ i0.ɵɵngDeclareClassMetadata({
69117
69389
  }]
69118
69390
  }
69119
69391
  });
69392
+ let queuedPaymentWarned = false;
69393
+ function warnQueuedPayment() {
69394
+ if (!isDevMode() || queuedPaymentWarned) return;
69395
+ queuedPaymentWarned = true;
69396
+ console.error("A payment request was QUEUED by the offline layer and may be replayed after reconnecting: list your payment routes in blockOffline with blockPaymentsOffline().");
69397
+ }
69398
+ const FAILED_REPLAY_CODE = "attempt_failed_use_new_key";
69399
+ const PAYMENT_NO_CHARGE_CODES = [
69400
+ "events_backlog",
69401
+ "exceeds_amount_due",
69402
+ "already_charged_today",
69403
+ "merchant_not_ready",
69404
+ "reconnect_required",
69405
+ "processor_account_changed"
69406
+ ];
69407
+ const AMBIGUOUS_HOST_CODES = /* @__PURE__ */ new Set([
69408
+ "payment_in_flight",
69409
+ "request_in_progress",
69410
+ "duplicate_suspected",
69411
+ "idempotency_in_progress",
69412
+ "idempotency_key_reused",
69413
+ "idempotency_error",
69414
+ "payment_intent_unexpected_state"
69415
+ ]);
69416
+ const NO_CHARGE_HOST_CODES = new Set(PAYMENT_NO_CHARGE_CODES);
69417
+ function isAttemptFailedReplay(error) {
69418
+ const e = error;
69419
+ return [e?.code, e?.error?.code].some((c) => typeof c === "string" && c.toLowerCase() === FAILED_REPLAY_CODE);
69420
+ }
69421
+ function classifyHostError(error) {
69422
+ const e = error;
69423
+ if (e && (e.offlineBlocked === true || e.name === "OfflineBlockedError")) return "not_sent";
69424
+ if (e && e.unknown === true) return "unknown";
69425
+ const codes = [e?.code, e?.error?.code].filter((c) => typeof c === "string").map((c) => c.toLowerCase());
69426
+ if (codes.includes(FAILED_REPLAY_CODE)) return "failure";
69427
+ if (codes.some((c) => NO_CHARGE_HOST_CODES.has(c))) return "not_sent";
69428
+ if (codes.some((c) => AMBIGUOUS_HOST_CODES.has(c))) return "unknown";
69429
+ const status = typeof e?.status === "number" ? e.status : typeof e?.response?.status === "number" ? e.response.status : null;
69430
+ if (status !== null) return status === 0 || status === 408 || status === 409 || status === 425 || status === 429 || status >= 500 ? "unknown" : "failure";
69431
+ return "unknown";
69432
+ }
69433
+ function wasQueuedOffline(result) {
69434
+ const r = result;
69435
+ if (!r || typeof r !== "object") return false;
69436
+ return r._offline === true || !!r.body && typeof r.body === "object" && r.body._offline === true;
69437
+ }
69438
+ const PAYMENT_STATUS_POLL_MS = 3e3;
69439
+ const PAYMENT_STATUS_POLL_MAX_MS = 9e4;
69440
+ const PAYMENT_REQUEST_TIMEOUT_MS = 6e4;
69441
+ const PAYMENT_STATUS_CHECK_TIMEOUT_MS = 1e4;
69442
+ const PAYMENT_STATUS_FAIL_GRACE_MS = 6e4;
69443
+ const PAYMENT_STATUS_HARD_MAX_MS = 18e4;
69444
+ const PAYMENT_AUTH_TIMEOUT_MS = 3e5;
69445
+ const PAYMENT_HOST_SILENCE_MS = 12e4;
69446
+ const PAYMENT_ATTEMPT_MARKER_TTL_MS = 18e5;
69447
+ const PAYMENT_ATTEMPT_TOMBSTONE_TTL_MS = 12e4;
69448
+ const PAYMENT_ATTEMPT_PAID_RECORD_TTL_MS = 864e5;
69449
+ const PAYMENT_ATTEMPT_STORAGE = new InjectionToken("PAYMENT_ATTEMPT_STORAGE", {
69450
+ providedIn: "root",
69451
+ factory: () => () => {
69452
+ try {
69453
+ if (typeof localStorage !== "undefined") return localStorage;
69454
+ } catch {}
69455
+ try {
69456
+ return typeof sessionStorage === "undefined" ? null : sessionStorage;
69457
+ } catch {
69458
+ return null;
69459
+ }
69460
+ }
69461
+ });
69462
+ const PAYMENT_ATTEMPT_STORAGE_PREFIX = "ui-payment-attempt:";
69463
+ const newKey = () => {
69464
+ const c = typeof crypto !== "undefined" ? crypto : void 0;
69465
+ return c && "randomUUID" in c ? c.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`;
69466
+ };
69467
+ const keyPart = (value) => value.replace(/[^A-Za-z0-9-]/g, (c) => `_${c.charCodeAt(0).toString(16)}_`);
69468
+ var PaymentAttempt = class {
69469
+ constructor(o) {
69470
+ this.o = o;
69471
+ this.inFlight = signal(false, ...ngDevMode ? [{ debugName: "inFlight" }] : /* istanbul ignore next */ []);
69472
+ this.unknown = signal(false, ...ngDevMode ? [{ debugName: "unknown" }] : /* istanbul ignore next */ []);
69473
+ this.checking = signal(false, ...ngDevMode ? [{ debugName: "checking" }] : /* istanbul ignore next */ []);
69474
+ this.pollExpired = signal(false, ...ngDevMode ? [{ debugName: "pollExpired" }] : /* istanbul ignore next */ []);
69475
+ this.succeeded = signal(false, ...ngDevMode ? [{ debugName: "succeeded" }] : /* istanbul ignore next */ []);
69476
+ this.waitingForHost = signal(false, ...ngDevMode ? [{ debugName: "waitingForHost" }] : /* istanbul ignore next */ []);
69477
+ this.markerWriteFailed = signal(false, ...ngDevMode ? [{ debugName: "markerWriteFailed" }] : /* istanbul ignore next */ []);
69478
+ this.offline = signal(typeof navigator !== "undefined" && navigator.onLine === false, ...ngDevMode ? [{ debugName: "offline" }] : /* istanbul ignore next */ []);
69479
+ this.blockedOffline = computed(() => this.offline() && !this.o.offlineOverride?.(), ...ngDevMode ? [{ debugName: "blockedOffline" }] : /* istanbul ignore next */ []);
69480
+ this.paidLocked = computed(() => this.o.paid() || this.succeeded(), ...ngDevMode ? [{ debugName: "paidLocked" }] : /* istanbul ignore next */ []);
69481
+ this.locked = computed(() => this.inFlight() || this.unknown() || this.paidLocked(), ...ngDevMode ? [{ debugName: "locked" }] : /* istanbul ignore next */ []);
69482
+ this.canCheck = computed(() => !!this.o.checkStatus(), ...ngDevMode ? [{ debugName: "canCheck" }] : /* istanbul ignore next */ []);
69483
+ this.pinned = signal(null, ...ngDevMode ? [{ debugName: "pinned" }] : /* istanbul ignore next */ []);
69484
+ this.pinnedAmount = computed(() => this.pinned()?.amount ?? null, ...ngDevMode ? [{ debugName: "pinnedAmount" }] : /* istanbul ignore next */ []);
69485
+ this.pinnedMethod = computed(() => this.pinned()?.method ?? null, ...ngDevMode ? [{ debugName: "pinnedMethod" }] : /* istanbul ignore next */ []);
69486
+ this.pinnedRef = computed(() => this.pinned()?.ref ?? null, ...ngDevMode ? [{ debugName: "pinnedRef" }] : /* istanbul ignore next */ []);
69487
+ this.epoch = signal(0, ...ngDevMode ? [{ debugName: "epoch" }] : /* istanbul ignore next */ []);
69488
+ this.renewTick = signal(0, ...ngDevMode ? [{ debugName: "renewTick" }] : /* istanbul ignore next */ []);
69489
+ this.key = computed(() => {
69490
+ this.renewTick();
69491
+ return this.pinned()?.key ?? this.resolveKey();
69492
+ }, ...ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []);
69493
+ this.id = newKey();
69494
+ this.memKeys = /* @__PURE__ */ new Map();
69495
+ this.destroyed = false;
69496
+ this.unknownReason = null;
69497
+ this.unknownSince = 0;
69498
+ this.liveRun = null;
69499
+ this.runSeq = 0;
69500
+ this.watchKey = null;
69501
+ this.paidKey = null;
69502
+ this.duplicates = /* @__PURE__ */ new Set();
69503
+ this.requestMs = PAYMENT_REQUEST_TIMEOUT_MS;
69504
+ this.pollTimer = null;
69505
+ this.silenceTimer = null;
69506
+ this.pollElapsed = 0;
69507
+ this.pollGen = 0;
69508
+ this.checkRun = 0;
69509
+ this.hostWasPending = false;
69510
+ this.lastRef = void 0;
69511
+ this.win = typeof window !== "undefined" ? window : null;
69512
+ this.onOffline = () => {
69513
+ this.offline.set(true);
69514
+ if (this.inFlight() && this.o.offlineMidFlight !== false) this.markUnknown("offline");
69515
+ };
69516
+ this.onOnline = () => {
69517
+ this.offline.set(false);
69518
+ if (this.unknown()) this.checkNow();
69519
+ };
69520
+ this.onStorage = (e) => {
69521
+ const ref = this.o.payableRef();
69522
+ if (!ref || this.destroyed) return;
69523
+ if (e.key === this.epochName(ref)) {
69524
+ this.readEpoch(ref);
69525
+ return;
69526
+ }
69527
+ if (e.key !== "ui-payment-attempt:" + ref) return;
69528
+ this.react(this.parseStored(e.newValue));
69529
+ };
69530
+ this.onResync = () => {
69531
+ const ref = this.o.payableRef();
69532
+ if (!ref || this.destroyed) return;
69533
+ this.readEpoch(ref);
69534
+ this.react(this.readStored(ref));
69535
+ };
69536
+ this.onVisible = () => {
69537
+ if (typeof document !== "undefined" && document.visibilityState === "hidden") return;
69538
+ this.onResync();
69539
+ };
69540
+ this.win?.addEventListener("offline", this.onOffline);
69541
+ this.win?.addEventListener("online", this.onOnline);
69542
+ this.win?.addEventListener("storage", this.onStorage);
69543
+ this.win?.addEventListener("pageshow", this.onResync);
69544
+ if (typeof document !== "undefined") document.addEventListener("visibilitychange", this.onVisible);
69545
+ o.destroyRef.onDestroy(() => {
69546
+ this.destroyed = true;
69547
+ this.stopPolling();
69548
+ this.clearSilence();
69549
+ this.win?.removeEventListener("offline", this.onOffline);
69550
+ this.win?.removeEventListener("online", this.onOnline);
69551
+ this.win?.removeEventListener("storage", this.onStorage);
69552
+ this.win?.removeEventListener("pageshow", this.onResync);
69553
+ if (typeof document !== "undefined") document.removeEventListener("visibilitychange", this.onVisible);
69554
+ });
69555
+ try {
69556
+ untracked(() => this.readEpoch(o.payableRef()));
69557
+ } catch {}
69558
+ effect(() => {
69559
+ const key = this.key();
69560
+ untracked(() => this.o.onKeyChange?.(key));
69561
+ });
69562
+ effect(() => {
69563
+ const pending = this.o.hostPending?.() ?? false;
69564
+ untracked(() => {
69565
+ if (pending) {
69566
+ this.hostWasPending = true;
69567
+ this.markUnknown("host");
69568
+ return;
69569
+ }
69570
+ if (this.hostWasPending && this.unknown() && this.unknownReason === "host" && !this.o.checkStatus()) this.endUnknown();
69571
+ this.hostWasPending = false;
69572
+ });
69573
+ });
69574
+ effect(() => {
69575
+ const ref = this.o.payableRef();
69576
+ untracked(() => this.onPayableChange(ref));
69577
+ });
69578
+ effect(() => {
69579
+ const check = this.o.checkStatus();
69580
+ untracked(() => {
69581
+ if (check && this.unknown() && !this.pollTimer && !this.checking() && !this.pollExpired()) this.startPolling();
69582
+ });
69583
+ });
69584
+ effect(() => {
69585
+ if (this.o.paid()) untracked(() => {
69586
+ this.stopPolling();
69587
+ const pin = this.pinned();
69588
+ if (pin) this.removeMarker(pin.ref, pin.key);
69589
+ });
69590
+ });
69591
+ }
69592
+ storageScope() {
69593
+ const store = this.store();
69594
+ if (!store) return "none";
69595
+ try {
69596
+ return typeof sessionStorage !== "undefined" && store === sessionStorage ? "tab" : "shared";
69597
+ } catch {
69598
+ return "shared";
69599
+ }
69600
+ }
69601
+ begin() {
69602
+ if (this.destroyed) return {
69603
+ ok: false,
69604
+ reason: "locked"
69605
+ };
69606
+ if (this.paidLocked()) return this.refuse("paid");
69607
+ if (this.unknown()) return this.refuse("unknown");
69608
+ if (this.inFlight()) return {
69609
+ ok: false,
69610
+ reason: "locked"
69611
+ };
69612
+ if (this.blockedOffline()) return this.refuse("offline");
69613
+ const ref = this.o.payableRef();
69614
+ this.readEpoch(ref);
69615
+ this.sweepStale();
69616
+ const stored = this.readStored(ref);
69617
+ if (stored && stored.type === "tombstone" && stored.value.state === "succeeded") {
69618
+ this.lateSuccess(stored.value.key, "other_tab", stored.value.amount ?? null, stored.value.method);
69619
+ return this.refuse("paid");
69620
+ }
69621
+ if (this.checkPaidRecord(ref)) return this.refuse("paid");
69622
+ const foreign = this.foreignMarker();
69623
+ if (foreign) {
69624
+ this.adopt(foreign, "other_tab");
69625
+ return this.refuse("unknown");
69626
+ }
69627
+ this.setInFlight(true);
69628
+ const pin = this.newPin();
69629
+ this.pinned.set(pin);
69630
+ this.writeMarker("inflight");
69631
+ const raced = this.foreignMarker();
69632
+ if (raced) {
69633
+ this.setInFlight(false);
69634
+ this.pinned.set(null);
69635
+ this.adopt(raced, "other_tab");
69636
+ return this.refuse("unknown");
69637
+ }
69638
+ return {
69639
+ ok: true,
69640
+ key: pin.key
69641
+ };
69642
+ }
69643
+ release() {
69644
+ if (this.destroyed) {
69645
+ this.abandon();
69646
+ return;
69647
+ }
69648
+ if (this.succeeded() && this.pinned()) {
69649
+ this.settleWatched(false);
69650
+ return;
69651
+ }
69652
+ this.setInFlight(false);
69653
+ this.clearSilence();
69654
+ this.waitingForHost.set(false);
69655
+ if (this.unknown() && this.unknownReason !== "host" && this.unknownReason !== "reload" && this.unknownReason !== "other_tab") this.leaveUnknown();
69656
+ if (!this.unknown()) {
69657
+ this.endMarker("released");
69658
+ this.pinned.set(null);
69659
+ }
69660
+ }
69661
+ abandon() {
69662
+ const pin = this.pinned();
69663
+ if (!pin) return;
69664
+ this.clearSilence();
69665
+ this.writeTombstone(pin.ref, "released", pin.key);
69666
+ }
69667
+ markNotCharged() {
69668
+ if (this.destroyed || this.paidLocked()) return;
69669
+ this.stopPolling();
69670
+ this.setInFlight(false);
69671
+ this.clearSilence();
69672
+ this.waitingForHost.set(false);
69673
+ this.leaveUnknown();
69674
+ this.endMarker("released");
69675
+ this.pinned.set(null);
69676
+ }
69677
+ succeed(reason) {
69678
+ if (this.destroyed) return;
69679
+ if (this.succeeded()) {
69680
+ this.settleWatched(true);
69681
+ return;
69682
+ }
69683
+ const key = this.key();
69684
+ const pin = this.pinned();
69685
+ const ref = pin?.ref ?? this.o.payableRef();
69686
+ const amount = pin ? pin.amount : this.o.amount();
69687
+ const method = pin?.method ?? this.o.method();
69688
+ this.stopPolling();
69689
+ this.clearSilence();
69690
+ this.waitingForHost.set(false);
69691
+ this.setInFlight(false);
69692
+ this.leaveUnknown();
69693
+ this.succeeded.set(true);
69694
+ this.paidKey = key;
69695
+ this.renew(key, null);
69696
+ this.endMarker("succeeded");
69697
+ this.writePaidRecord(ref, key, amount, method);
69698
+ this.pinned.set(null);
69699
+ this.emit({
69700
+ kind: "succeeded",
69701
+ attemptKey: key,
69702
+ ...reason ? { reason } : {},
69703
+ ...reason === "other_tab" ? {
69704
+ amount,
69705
+ method
69706
+ } : {}
69707
+ });
69708
+ }
69709
+ resetPaid() {
69710
+ if (this.destroyed || this.inFlight() || this.unknown()) return;
69711
+ const ref = this.o.payableRef();
69712
+ this.succeeded.set(false);
69713
+ this.paidKey = null;
69714
+ this.watchKey = null;
69715
+ this.duplicates.clear();
69716
+ this.memKeys.clear();
69717
+ if (ref) {
69718
+ this.removePaidRecord(ref);
69719
+ const stored = this.readStored(ref);
69720
+ const name = this.markerKey(ref);
69721
+ if (name && stored && stored.type === "tombstone" && stored.value.state === "succeeded") try {
69722
+ this.store()?.removeItem(name);
69723
+ } catch {}
69724
+ this.bumpEpoch(ref);
69725
+ }
69726
+ this.renewTick.update((n) => n + 1);
69727
+ }
69728
+ fail(reason, external = false) {
69729
+ if (this.destroyed) return;
69730
+ if (this.succeeded()) {
69731
+ this.settleWatched(false);
69732
+ return;
69733
+ }
69734
+ const key = this.key();
69735
+ const ref = this.pinned()?.ref ?? this.o.payableRef();
69736
+ this.stopPolling();
69737
+ this.clearSilence();
69738
+ this.waitingForHost.set(false);
69739
+ this.setInFlight(false);
69740
+ this.leaveUnknown();
69741
+ this.renew(key, external ? null : ref);
69742
+ this.endMarker("failed");
69743
+ this.pinned.set(null);
69744
+ this.emit({
69745
+ kind: "failed",
69746
+ attemptKey: key,
69747
+ ...reason ? { reason } : {}
69748
+ });
69749
+ }
69750
+ startOver() {
69751
+ if (this.destroyed || !this.unknown()) return;
69752
+ this.fail("start_over");
69753
+ }
69754
+ markUnknown(reason) {
69755
+ if (this.destroyed) return;
69756
+ if (this.paidLocked()) {
69757
+ if (this.succeeded()) this.settleWatched(false);
69758
+ return;
69759
+ }
69760
+ this.setInFlight(false);
69761
+ this.clearSilence();
69762
+ this.waitingForHost.set(false);
69763
+ if (this.unknown()) return;
69764
+ const pending = this.pinned();
69765
+ const done = this.readStored(pending?.ref ?? this.o.payableRef());
69766
+ if (done && done.type === "tombstone" && done.value.state === "succeeded" && done.value.owner !== this.id && done.value.key === (pending?.key ?? this.key())) {
69767
+ this.succeed("other_tab");
69768
+ return;
69769
+ }
69770
+ if (!this.pinned()) this.pinned.set(this.newPin());
69771
+ this.unknown.set(true);
69772
+ this.unknownReason = reason;
69773
+ this.unknownSince = this.now();
69774
+ this.pollExpired.set(false);
69775
+ this.writeMarker("unknown");
69776
+ this.emit({
69777
+ kind: "unknown",
69778
+ attemptKey: this.key(),
69779
+ reason
69780
+ });
69781
+ this.startPolling();
69782
+ }
69783
+ markPending(reason) {
69784
+ if (this.destroyed || this.paidLocked() || this.unknown()) return;
69785
+ if (reason === "token") {
69786
+ this.waitingForHost.set(true);
69787
+ this.clearSilence();
69788
+ this.silenceTimer = setTimeout(() => {
69789
+ this.silenceTimer = null;
69790
+ if (this.waitingForHost()) this.markUnknown("host_silent");
69791
+ }, this.o.hostSilenceMs?.() ?? 12e4);
69792
+ } else if (reason === "auth_required" || reason === "bank_window") {
69793
+ const ms = this.o.authTimeoutMs?.() ?? 3e5;
69794
+ if (!this.extendRunTimeout(ms) && this.inFlight()) {
69795
+ this.clearSilence();
69796
+ this.silenceTimer = setTimeout(() => {
69797
+ this.silenceTimer = null;
69798
+ if (this.inFlight()) this.markUnknown("host_silent");
69799
+ }, ms);
69800
+ }
69801
+ }
69802
+ this.emit({
69803
+ kind: "pending",
69804
+ attemptKey: this.key(),
69805
+ ...reason ? { reason } : {}
69806
+ });
69807
+ }
69808
+ async checkNow() {
69809
+ const check = this.o.checkStatus();
69810
+ if (!check || this.destroyed || !this.unknown()) return;
69811
+ const mine = ++this.checkRun;
69812
+ const key = this.key();
69813
+ const asked = this.pinned();
69814
+ const askedRef = asked?.ref ?? this.o.payableRef();
69815
+ this.checking.set(true);
69816
+ let answer = "unknown";
69817
+ let timer = null;
69818
+ try {
69819
+ const timeout = new Promise((resolve) => {
69820
+ timer = setTimeout(() => resolve("timeout"), this.o.statusTimeoutMs?.() ?? 1e4);
69821
+ });
69822
+ const result = await Promise.race([callHost(() => check(key)), timeout]);
69823
+ answer = result === "timeout" ? "unknown" : result ?? "unknown";
69824
+ } catch {
69825
+ answer = "unknown";
69826
+ } finally {
69827
+ if (timer) clearTimeout(timer);
69828
+ }
69829
+ if (this.destroyed || mine !== this.checkRun) return;
69830
+ this.checking.set(false);
69831
+ if (!this.unknown()) {
69832
+ if (answer === "succeeded" && askedRef === this.o.payableRef()) this.lateSuccess(key, "status_check", asked ? asked.amount : this.o.amount(), asked?.method ?? this.o.method());
69833
+ return;
69834
+ }
69835
+ if (answer === "succeeded") this.succeed("status_check");
69836
+ else if (answer === "failed" || answer === "not_found") {
69837
+ if (this.mustWait(answer)) return;
69838
+ this.fail(answer === "failed" ? "status_check" : "not_found");
69839
+ }
69840
+ }
69841
+ checkAgain() {
69842
+ if (this.destroyed || !this.unknown()) return;
69843
+ this.pollExpired.set(false);
69844
+ this.startPolling();
69845
+ }
69846
+ async run(op, options = {}) {
69847
+ const begun = this.begin();
69848
+ if (!begun.ok) return { refused: begun.reason };
69849
+ const pin = this.pinned();
69850
+ const info = {
69851
+ id: ++this.runSeq,
69852
+ key: begun.key,
69853
+ ref: pin?.ref ?? null,
69854
+ amount: pin?.amount ?? null,
69855
+ method: pin?.method ?? this.o.method(),
69856
+ settled: false,
69857
+ fire: null,
69858
+ timer: null
69859
+ };
69860
+ this.liveRun = info;
69861
+ this.requestMs = options.timeoutMs ?? 6e4;
69862
+ const timeout = new Promise((resolve) => {
69863
+ info.fire = () => resolve("timeout");
69864
+ info.timer = setTimeout(info.fire, this.requestMs);
69865
+ });
69866
+ let running;
69867
+ try {
69868
+ running = op(begun.key);
69869
+ } catch (error) {
69870
+ running = Promise.reject(error);
69871
+ }
69872
+ const settled = () => {
69873
+ info.settled = true;
69874
+ };
69875
+ running.then(settled, settled);
69876
+ let result;
69877
+ try {
69878
+ result = await Promise.race([running, timeout]);
69879
+ } catch {
69880
+ result = {
69881
+ kind: "unknown",
69882
+ reason: "error"
69883
+ };
69884
+ } finally {
69885
+ if (info.timer) {
69886
+ clearTimeout(info.timer);
69887
+ info.timer = null;
69888
+ }
69889
+ }
69890
+ if (result === "timeout") {
69891
+ if (this.isCurrent(info)) {
69892
+ if (info.ref !== this.o.payableRef()) this.settleOtherPayable(info, {
69893
+ kind: "unknown",
69894
+ reason: "timeout"
69895
+ });
69896
+ else this.markUnknown("timeout");
69897
+ }
69898
+ running.then((late) => {
69899
+ this.applyRun(info, late);
69900
+ options.onLate?.(late);
69901
+ }, () => void 0);
69902
+ return {
69903
+ kind: "unknown",
69904
+ reason: "timeout"
69905
+ };
69906
+ }
69907
+ this.applyRun(info, result);
69908
+ return result;
69909
+ }
69910
+ isLive(key) {
69911
+ return !this.destroyed && this.liveRun?.key === key && this.pinned()?.key === key;
69912
+ }
69913
+ apply(result) {
69914
+ if (this.destroyed) {
69915
+ if (result.kind === "released") this.abandon();
69916
+ return;
69917
+ }
69918
+ switch (result.kind) {
69919
+ case "success":
69920
+ this.succeed(result.reason);
69921
+ break;
69922
+ case "failure":
69923
+ this.fail(result.reason);
69924
+ break;
69925
+ case "released":
69926
+ this.release();
69927
+ break;
69928
+ case "pending":
69929
+ this.markPending(result.reason);
69930
+ break;
69931
+ default: this.markUnknown(result.reason ?? "unknown");
69932
+ }
69933
+ }
69934
+ now() {
69935
+ return this.o.now ? this.o.now() : Date.now();
69936
+ }
69937
+ isCurrent(info) {
69938
+ return this.liveRun === info && this.pinned()?.key === info.key;
69939
+ }
69940
+ applyRun(info, result) {
69941
+ if (this.destroyed) {
69942
+ this.settleDestroyed(info, result.kind);
69943
+ return;
69944
+ }
69945
+ if (info.ref !== this.o.payableRef()) {
69946
+ this.settleOtherPayable(info, result);
69947
+ return;
69948
+ }
69949
+ if (this.isCurrent(info)) {
69950
+ this.apply(result);
69951
+ return;
69952
+ }
69953
+ if (result.kind === "success") this.lateSuccess(info.key, result.reason, info.amount, info.method);
69954
+ }
69955
+ settleDestroyed(info, kind) {
69956
+ if (kind === "released") {
69957
+ this.abandon();
69958
+ return;
69959
+ }
69960
+ if (kind !== "success" && kind !== "failure") return;
69961
+ if (kind === "success") {
69962
+ this.writeTombstone(info.ref, "succeeded", info.key, {
69963
+ amount: info.amount,
69964
+ method: info.method
69965
+ });
69966
+ this.writePaidRecord(info.ref, info.key, info.amount, info.method);
69967
+ if (isDevMode()) console.warn("A payment answered after its form was destroyed: it is recorded for the next form of the payable (reconcile it by its attemptKey on your backend).");
69968
+ } else {
69969
+ if (info.ref) this.bumpEpoch(info.ref);
69970
+ this.writeTombstone(info.ref, "failed", info.key);
69971
+ }
69972
+ }
69973
+ settleOtherPayable(info, result) {
69974
+ const pin = this.pinned();
69975
+ const mine = !!pin && pin.key === info.key && pin.ref === info.ref;
69976
+ switch (result.kind) {
69977
+ case "success":
69978
+ this.writeTombstone(info.ref, "succeeded", info.key, {
69979
+ amount: info.amount,
69980
+ method: info.method
69981
+ });
69982
+ this.writePaidRecord(info.ref, info.key, info.amount, info.method);
69983
+ break;
69984
+ case "failure":
69985
+ if (info.ref) this.bumpEpoch(info.ref);
69986
+ this.writeTombstone(info.ref, "failed", info.key);
69987
+ break;
69988
+ case "released":
69989
+ this.writeTombstone(info.ref, "released", info.key);
69990
+ break;
69991
+ case "unknown":
69992
+ if (mine) this.writeMarker("unknown");
69993
+ break;
69994
+ default: return;
69995
+ }
69996
+ if (mine) {
69997
+ this.clearSilence();
69998
+ this.waitingForHost.set(false);
69999
+ this.setInFlight(false);
70000
+ this.pinned.set(null);
70001
+ }
70002
+ }
70003
+ lateSuccess(key, reason, amount, method) {
70004
+ if (this.succeeded()) {
70005
+ if (this.paidKey && key !== this.paidKey && !this.duplicates.has(key)) {
70006
+ this.duplicates.add(key);
70007
+ this.emit({
70008
+ kind: "unknown",
70009
+ attemptKey: key,
70010
+ reason: "duplicate_suspected"
70011
+ });
70012
+ }
70013
+ return;
70014
+ }
70015
+ const pin = this.pinned();
70016
+ this.succeeded.set(true);
70017
+ this.paidKey = key;
70018
+ this.stopPolling();
70019
+ if (pin && pin.key !== key) this.watchKey = pin.key;
70020
+ if (reason !== "other_tab") this.writePaidRecord(pin?.ref ?? this.o.payableRef(), key, amount ?? null, method ?? this.o.method());
70021
+ this.emit({
70022
+ kind: "succeeded",
70023
+ attemptKey: key,
70024
+ ...reason ? { reason } : {},
70025
+ ...method !== void 0 ? {
70026
+ amount: amount ?? null,
70027
+ method
70028
+ } : {}
70029
+ });
70030
+ }
70031
+ settleWatched(success) {
70032
+ const pin = this.pinned();
70033
+ if (!pin) return;
70034
+ const watched = this.watchKey !== null && pin.key === this.watchKey;
70035
+ if (watched) this.watchKey = null;
70036
+ this.stopPolling();
70037
+ this.clearSilence();
70038
+ this.waitingForHost.set(false);
70039
+ this.setInFlight(false);
70040
+ this.leaveUnknown();
70041
+ if (success || pin.key === this.paidKey) this.endMarker("succeeded");
70042
+ else this.removeMarker(pin.ref, pin.key);
70043
+ this.pinned.set(null);
70044
+ if (success && watched && !this.duplicates.has(pin.key)) {
70045
+ this.duplicates.add(pin.key);
70046
+ this.emit({
70047
+ kind: "unknown",
70048
+ attemptKey: pin.key,
70049
+ reason: "duplicate_suspected"
70050
+ });
70051
+ }
70052
+ }
70053
+ currentRunUnsettled() {
70054
+ const run = this.liveRun;
70055
+ return !!run && !run.settled && run.key === this.pinned()?.key;
70056
+ }
70057
+ mustWait(answer) {
70058
+ const now = this.now();
70059
+ const grace = this.o.failGraceMs?.() ?? 6e4;
70060
+ if (this.currentRunUnsettled()) return now - this.unknownSince < (this.o.statusHardMaxMs?.() ?? 18e4);
70061
+ if (this.unknownReason === "host_silent" || this.unknownReason === "host") return now - this.unknownSince < this.requestMs + grace;
70062
+ if (this.unknownReason === "reload" || this.unknownReason === "other_tab" || answer === "not_found") return now - (this.pinned()?.at ?? this.unknownSince) < this.requestMs + grace;
70063
+ return false;
70064
+ }
70065
+ extendRunTimeout(ms) {
70066
+ const run = this.liveRun;
70067
+ if (!run || run.settled || !run.fire || !run.timer) return false;
70068
+ clearTimeout(run.timer);
70069
+ run.timer = setTimeout(run.fire, ms);
70070
+ return true;
70071
+ }
70072
+ clearSilence() {
70073
+ if (this.silenceTimer) {
70074
+ clearTimeout(this.silenceTimer);
70075
+ this.silenceTimer = null;
70076
+ }
70077
+ }
70078
+ refuse(reason) {
70079
+ this.emit({
70080
+ kind: "refused",
70081
+ attemptKey: this.key(),
70082
+ reason
70083
+ });
70084
+ return {
70085
+ ok: false,
70086
+ reason
70087
+ };
70088
+ }
70089
+ emit(outcome) {
70090
+ if (!this.destroyed) this.o.onOutcome?.(outcome);
70091
+ }
70092
+ newPin() {
70093
+ return {
70094
+ key: this.resolveKey(),
70095
+ amount: this.o.amount(),
70096
+ method: this.o.method(),
70097
+ at: this.now(),
70098
+ owner: this.id,
70099
+ ref: this.o.payableRef()
70100
+ };
70101
+ }
70102
+ setInFlight(value) {
70103
+ if (this.inFlight() === value) return;
70104
+ this.inFlight.set(value);
70105
+ this.o.onInFlightChange?.(value);
70106
+ }
70107
+ leaveUnknown() {
70108
+ this.unknown.set(false);
70109
+ this.unknownReason = null;
70110
+ this.pollExpired.set(false);
70111
+ }
70112
+ endUnknown() {
70113
+ this.stopPolling();
70114
+ this.leaveUnknown();
70115
+ const pin = this.pinned();
70116
+ if (pin) this.removeMarker(pin.ref, pin.key);
70117
+ this.pinned.set(null);
70118
+ }
70119
+ startPolling() {
70120
+ this.stopPolling();
70121
+ if (!this.o.checkStatus()) return;
70122
+ this.pollElapsed = 0;
70123
+ this.pollOnce(this.pollGen);
70124
+ }
70125
+ async pollOnce(gen) {
70126
+ await this.checkNow();
70127
+ if (this.destroyed || gen !== this.pollGen || !this.unknown()) return;
70128
+ const every = Math.max(1, this.o.pollMs?.() ?? 3e3);
70129
+ this.pollElapsed += every;
70130
+ if (this.pollElapsed >= (this.o.pollMaxMs?.() ?? 9e4)) {
70131
+ this.pollExpired.set(true);
70132
+ return;
70133
+ }
70134
+ this.pollTimer = setTimeout(() => {
70135
+ this.pollTimer = null;
70136
+ this.pollOnce(gen);
70137
+ }, every);
70138
+ }
70139
+ stopPolling() {
70140
+ this.pollGen++;
70141
+ if (this.pollTimer) {
70142
+ clearTimeout(this.pollTimer);
70143
+ this.pollTimer = null;
70144
+ }
70145
+ }
70146
+ amountPart() {
70147
+ const amount = this.o.amount();
70148
+ return amount == null || !Number.isFinite(amount) ? "na" : String(Math.round(amount * 100));
70149
+ }
70150
+ tupleId() {
70151
+ return `${this.amountPart()}|${this.o.method()}`;
70152
+ }
70153
+ resolveKey() {
70154
+ const host = this.o.attemptKey();
70155
+ if (host) return host;
70156
+ const ref = this.o.payableRef();
70157
+ if (ref) return `pa_${keyPart(ref)}_${this.amountPart()}_${keyPart(this.o.method())}_e${this.epoch()}`;
70158
+ const id = this.tupleId();
70159
+ let key = this.memKeys.get(id);
70160
+ if (!key) {
70161
+ key = newKey();
70162
+ this.memKeys.set(id, key);
70163
+ }
70164
+ return key;
70165
+ }
70166
+ renew(finished, bumpRef) {
70167
+ if (this.o.attemptKey()) return;
70168
+ for (const [tuple, key] of this.memKeys) if (key === finished) this.memKeys.delete(tuple);
70169
+ if (bumpRef) this.bumpEpoch(bumpRef);
70170
+ this.renewTick.update((n) => n + 1);
70171
+ }
70172
+ store() {
70173
+ try {
70174
+ return this.o.storage?.() ?? null;
70175
+ } catch {
70176
+ return null;
70177
+ }
70178
+ }
70179
+ markerKey(ref) {
70180
+ return ref ? PAYMENT_ATTEMPT_STORAGE_PREFIX + ref : null;
70181
+ }
70182
+ epochName(ref) {
70183
+ return ref ? `${PAYMENT_ATTEMPT_STORAGE_PREFIX}${ref}#epoch` : null;
70184
+ }
70185
+ storedEpoch(name) {
70186
+ if (!name) return 0;
70187
+ try {
70188
+ const n = Number(this.store()?.getItem(name));
70189
+ return Number.isInteger(n) && n > 0 ? n : 0;
70190
+ } catch {
70191
+ return 0;
70192
+ }
70193
+ }
70194
+ readEpoch(ref) {
70195
+ const value = this.storedEpoch(this.epochName(ref));
70196
+ if (value !== this.epoch()) this.epoch.set(value);
70197
+ }
70198
+ bumpEpoch(ref) {
70199
+ const name = this.epochName(ref);
70200
+ const current = ref === this.o.payableRef();
70201
+ const next = Math.max(current ? this.epoch() : 0, this.storedEpoch(name)) + 1;
70202
+ if (current) this.epoch.set(next);
70203
+ if (name) try {
70204
+ this.store()?.setItem(name, String(next));
70205
+ } catch {}
70206
+ }
70207
+ parseStored(raw) {
70208
+ if (!raw) return null;
70209
+ try {
70210
+ const m = JSON.parse(raw);
70211
+ if (!m || typeof m !== "object" || typeof m["key"] !== "string" || !m["key"] || typeof m["owner"] !== "string") return null;
70212
+ const now = this.now();
70213
+ if ((m["state"] === "released" || m["state"] === "failed" || m["state"] === "succeeded") && typeof m["at"] === "number") {
70214
+ if (now - m["at"] > 12e4) return null;
70215
+ return {
70216
+ type: "tombstone",
70217
+ value: {
70218
+ state: m["state"],
70219
+ key: m["key"],
70220
+ at: m["at"],
70221
+ owner: m["owner"],
70222
+ ...typeof m["method"] === "string" ? {
70223
+ amount: typeof m["amount"] === "number" ? m["amount"] : null,
70224
+ method: m["method"]
70225
+ } : {}
70226
+ }
70227
+ };
70228
+ }
70229
+ if (typeof m["startedAt"] !== "number" || m["state"] !== "inflight" && m["state"] !== "unknown") return null;
70230
+ if (now - m["startedAt"] > 18e5) return null;
70231
+ return {
70232
+ type: "marker",
70233
+ value: {
70234
+ key: m["key"],
70235
+ startedAt: m["startedAt"],
70236
+ state: m["state"],
70237
+ owner: m["owner"],
70238
+ amount: typeof m["amount"] === "number" ? m["amount"] : null,
70239
+ method: typeof m["method"] === "string" ? m["method"] : ""
70240
+ }
70241
+ };
70242
+ } catch {
70243
+ return null;
70244
+ }
70245
+ }
70246
+ readStored(ref) {
70247
+ const name = this.markerKey(ref);
70248
+ if (!name) return null;
70249
+ try {
70250
+ return this.parseStored(this.store()?.getItem(name));
70251
+ } catch {
70252
+ return null;
70253
+ }
70254
+ }
70255
+ foreignMarker() {
70256
+ const stored = this.readStored(this.o.payableRef());
70257
+ return stored && stored.type === "marker" && stored.value.owner !== this.id ? stored.value : null;
70258
+ }
70259
+ storedOfOther(ref, key, markerOnly) {
70260
+ const stored = this.readStored(ref);
70261
+ return !!stored && stored.value.key !== key && (!markerOnly || stored.type === "marker");
70262
+ }
70263
+ writeMarker(state) {
70264
+ const pin = this.pinned();
70265
+ const name = this.markerKey(pin?.ref ?? null);
70266
+ if (!name || !pin) return;
70267
+ if (this.storedOfOther(pin.ref, pin.key, true)) return;
70268
+ const marker = {
70269
+ key: pin.key,
70270
+ state,
70271
+ owner: pin.owner,
70272
+ startedAt: pin.at,
70273
+ amount: pin.amount,
70274
+ method: pin.method
70275
+ };
70276
+ const raw = JSON.stringify(marker);
70277
+ let ok = false;
70278
+ try {
70279
+ const store = this.store();
70280
+ store?.setItem(name, raw);
70281
+ ok = !!store && store.getItem(name) !== null;
70282
+ } catch {
70283
+ ok = false;
70284
+ }
70285
+ this.markerWriteFailed.set(!ok);
70286
+ }
70287
+ writeTombstone(ref, state, key, paid) {
70288
+ const name = this.markerKey(ref);
70289
+ if (!name || this.storedOfOther(ref, key, false)) return;
70290
+ const tombstone = {
70291
+ state,
70292
+ key,
70293
+ at: this.now(),
70294
+ owner: this.id,
70295
+ ...state === "succeeded" && paid ? {
70296
+ amount: paid.amount,
70297
+ method: paid.method
70298
+ } : {}
70299
+ };
70300
+ try {
70301
+ this.store()?.setItem(name, JSON.stringify(tombstone));
70302
+ } catch {}
70303
+ }
70304
+ endMarker(state) {
70305
+ const pin = this.pinned();
70306
+ if (!pin) return;
70307
+ this.writeTombstone(pin.ref, state, pin.key, {
70308
+ amount: pin.amount,
70309
+ method: pin.method
70310
+ });
70311
+ }
70312
+ removeMarker(ref, key) {
70313
+ const name = this.markerKey(ref);
70314
+ if (!name || this.storedOfOther(ref, key, false)) return;
70315
+ try {
70316
+ this.store()?.removeItem(name);
70317
+ } catch {}
70318
+ }
70319
+ paidName(ref) {
70320
+ return ref ? `${PAYMENT_ATTEMPT_STORAGE_PREFIX}${ref}#paid` : null;
70321
+ }
70322
+ readPaidRecord(ref) {
70323
+ const name = this.paidName(ref);
70324
+ if (!name) return null;
70325
+ try {
70326
+ const m = JSON.parse(this.store()?.getItem(name) ?? "null");
70327
+ if (!m || typeof m !== "object" || typeof m["key"] !== "string" || !m["key"] || typeof m["at"] !== "number" || typeof m["owner"] !== "string") return null;
70328
+ if (this.now() - m["at"] > 864e5) return null;
70329
+ return {
70330
+ key: m["key"],
70331
+ at: m["at"],
70332
+ owner: m["owner"],
70333
+ amount: typeof m["amount"] === "number" ? m["amount"] : null,
70334
+ method: typeof m["method"] === "string" ? m["method"] : ""
70335
+ };
70336
+ } catch {
70337
+ return null;
70338
+ }
70339
+ }
70340
+ writePaidRecord(ref, key, amount, method) {
70341
+ const name = this.paidName(ref);
70342
+ if (!name) return;
70343
+ const record = {
70344
+ key,
70345
+ amount,
70346
+ method,
70347
+ at: this.now(),
70348
+ owner: this.id
70349
+ };
70350
+ try {
70351
+ this.store()?.setItem(name, JSON.stringify(record));
70352
+ } catch {}
70353
+ }
70354
+ removePaidRecord(ref) {
70355
+ const name = this.paidName(ref);
70356
+ if (!name) return;
70357
+ try {
70358
+ this.store()?.removeItem(name);
70359
+ } catch {}
70360
+ }
70361
+ checkPaidRecord(ref) {
70362
+ if (!ref || this.o.paid() || this.succeeded()) return false;
70363
+ const record = this.readPaidRecord(ref);
70364
+ if (!record) return false;
70365
+ this.lateSuccess(record.key, "other_tab", record.amount, record.method);
70366
+ return true;
70367
+ }
70368
+ sweepStale() {
70369
+ const store = this.store();
70370
+ if (!store) return;
70371
+ try {
70372
+ const now = this.now();
70373
+ const drop = [];
70374
+ let seen = 0;
70375
+ const total = Math.min(store.length, 5e3);
70376
+ for (let i = 0; i < total && seen < 200; i++) {
70377
+ const name = store.key(i);
70378
+ if (!name || !name.startsWith("ui-payment-attempt:") || name.endsWith("#epoch")) continue;
70379
+ seen++;
70380
+ let m = null;
70381
+ try {
70382
+ m = JSON.parse(store.getItem(name) ?? "null");
70383
+ } catch {
70384
+ m = null;
70385
+ }
70386
+ if (!m || typeof m !== "object") continue;
70387
+ if (name.endsWith("#paid")) {
70388
+ if (typeof m["at"] === "number" && now - m["at"] > 864e5) drop.push(name);
70389
+ } else if (typeof m["at"] === "number" && now - m["at"] > 12e4) drop.push(name);
70390
+ else if (typeof m["startedAt"] === "number" && now - m["startedAt"] > 18e5) drop.push(name);
70391
+ }
70392
+ for (const name of drop) store.removeItem(name);
70393
+ } catch {}
70394
+ }
70395
+ react(stored) {
70396
+ if (!stored) {
70397
+ if (this.unknown() && (this.unknownReason === "other_tab" || this.unknownReason === "reload") && this.o.checkStatus()) this.checkNow();
70398
+ return;
70399
+ }
70400
+ if (stored.type === "tombstone") {
70401
+ this.onTombstone(stored.value);
70402
+ return;
70403
+ }
70404
+ const marker = stored.value;
70405
+ if (marker.owner === this.id) return;
70406
+ if (this.inFlight()) this.markUnknown("other_tab");
70407
+ else if (!this.unknown() && !this.paidLocked()) this.adopt(marker, "other_tab");
70408
+ }
70409
+ onTombstone(t) {
70410
+ if (t.owner === this.id) return;
70411
+ const pin = this.pinned();
70412
+ if (t.state === "succeeded") {
70413
+ if (!this.succeeded() && pin?.key === t.key) {
70414
+ if (this.unknown()) this.succeed("other_tab");
70415
+ return;
70416
+ }
70417
+ this.lateSuccess(t.key, "other_tab", t.amount ?? null, t.method);
70418
+ return;
70419
+ }
70420
+ if (!this.unknown() || !pin || pin.key !== t.key || this.unknownReason !== "other_tab" && this.unknownReason !== "reload") return;
70421
+ if (t.state === "failed") this.fail("other_tab", true);
70422
+ else {
70423
+ this.stopPolling();
70424
+ this.leaveUnknown();
70425
+ this.pinned.set(null);
70426
+ }
70427
+ }
70428
+ adopt(marker, reason) {
70429
+ if (this.destroyed || this.unknown() || this.paidLocked()) return;
70430
+ this.pinned.set({
70431
+ key: marker.key,
70432
+ amount: marker.amount,
70433
+ method: marker.method,
70434
+ at: marker.startedAt,
70435
+ owner: marker.owner,
70436
+ ref: this.o.payableRef()
70437
+ });
70438
+ this.markUnknown(reason);
70439
+ }
70440
+ onPayableChange(ref) {
70441
+ if (this.destroyed) return;
70442
+ if (this.lastRef !== void 0 && ref !== this.lastRef) {
70443
+ this.succeeded.set(false);
70444
+ this.paidKey = null;
70445
+ this.watchKey = null;
70446
+ this.duplicates.clear();
70447
+ if (this.unknown()) {
70448
+ this.stopPolling();
70449
+ this.clearSilence();
70450
+ this.waitingForHost.set(false);
70451
+ this.leaveUnknown();
70452
+ }
70453
+ if (!this.inFlight()) this.pinned.set(null);
70454
+ }
70455
+ this.lastRef = ref;
70456
+ this.readEpoch(ref);
70457
+ if (this.inFlight() || this.unknown() || this.paidLocked()) return;
70458
+ const stored = this.readStored(ref);
70459
+ if (stored) {
70460
+ if (stored.type === "marker") {
70461
+ if (stored.value.owner !== this.id) {
70462
+ this.adopt(stored.value, "reload");
70463
+ return;
70464
+ }
70465
+ } else if (stored.value.state === "succeeded") {
70466
+ this.lateSuccess(stored.value.key, "other_tab", stored.value.amount ?? null, stored.value.method);
70467
+ return;
70468
+ }
70469
+ }
70470
+ this.checkPaidRecord(ref);
70471
+ }
70472
+ };
70473
+ const PAYMENT_READINESS_REASONS = [
70474
+ "offline",
70475
+ "slow_connection",
70476
+ "sdk_blocked",
70477
+ "service_unavailable",
70478
+ "merchant_not_ready",
70479
+ "events_backlog",
70480
+ "payable_changed",
70481
+ "already_paid",
70482
+ "payment_in_flight",
70483
+ "unsupported_browser",
70484
+ "unknown_payment",
70485
+ "checking"
70486
+ ];
70487
+ const PAYMENT_READINESS_TIMEOUT_MS = 4e3;
70488
+ const PAYMENT_READINESS_EVERY_MS = 1e4;
70489
+ const PAYMENT_READINESS_SLOW_RTT_MS = 2e3;
70490
+ function refusalLabelKey(reason) {
70491
+ if (reason === "paid") return "paymentAttempt.paid";
70492
+ if (reason === "unknown") return "paymentAttempt.checking";
70493
+ return PAYMENT_READINESS_REASONS.includes(reason) ? `paymentReadiness.${reason}` : "paymentReadiness.generic";
70494
+ }
70495
+ const sameList = (a, b) => a.length === b.length && a.every((v, i) => v === b[i]);
70496
+ function builtInReadinessReasons(ignoreOffline = false) {
70497
+ const reasons = [];
70498
+ if (!ignoreOffline && typeof navigator !== "undefined" && navigator.onLine === false) reasons.push("offline");
70499
+ const connection = typeof navigator !== "undefined" ? navigator.connection : void 0;
70500
+ if (connection && (connection.effectiveType === "slow-2g" || connection.effectiveType === "2g" || typeof connection.rtt === "number" && connection.rtt > 2e3)) reasons.push("slow_connection");
70501
+ const secure = typeof window === "undefined" || window.isSecureContext !== false;
70502
+ const randomValues = typeof crypto !== "undefined" && typeof crypto.getRandomValues === "function";
70503
+ if (!secure || !randomValues) reasons.push("unsupported_browser");
70504
+ return reasons;
70505
+ }
70506
+ var PaymentReadiness = class {
70507
+ builtIn() {
70508
+ return builtInReadinessReasons(!!this.o.offlineOverride?.());
70509
+ }
70510
+ constructor(o) {
70511
+ this.o = o;
70512
+ this.hostReasons = signal([], {
70513
+ ...ngDevMode ? { debugName: "hostReasons" } : /* istanbul ignore next */ {},
70514
+ equal: sameList
70515
+ });
70516
+ this.answeredFor = signal(null, ...ngDevMode ? [{ debugName: "answeredFor" }] : /* istanbul ignore next */ []);
70517
+ this.evaluated = computed(() => {
70518
+ const check = this.o.check();
70519
+ return !check || this.answeredFor() === check;
70520
+ }, ...ngDevMode ? [{ debugName: "evaluated" }] : /* istanbul ignore next */ []);
70521
+ this.builtIns = signal(builtInReadinessReasons(), {
70522
+ ...ngDevMode ? { debugName: "builtIns" } : /* istanbul ignore next */ {},
70523
+ equal: sameList
70524
+ });
70525
+ this.reasons = computed(() => {
70526
+ if (this.o.enabled && !this.o.enabled()) return [];
70527
+ const out = [...this.builtIns()];
70528
+ const add = (reason) => {
70529
+ if (!out.includes(reason)) out.push(reason);
70530
+ };
70531
+ if (this.o.sdk() === "blocked") add("sdk_blocked");
70532
+ for (const reason of this.hostReasons()) add(reason);
70533
+ if (this.o.unknownPending()) add("unknown_payment");
70534
+ if (!this.evaluated()) add("checking");
70535
+ return out;
70536
+ }, {
70537
+ ...ngDevMode ? { debugName: "reasons" } : /* istanbul ignore next */ {},
70538
+ equal: sameList
70539
+ });
70540
+ this.ready = computed(() => this.reasons().length === 0, ...ngDevMode ? [{ debugName: "ready" }] : /* istanbul ignore next */ []);
70541
+ this.storageWarning = computed(() => this.o.storageAvailable ? !this.o.storageAvailable() : false, ...ngDevMode ? [{ debugName: "storageWarning" }] : /* istanbul ignore next */ []);
70542
+ this.destroyed = false;
70543
+ this.timer = null;
70544
+ this.win = typeof window !== "undefined" ? window : null;
70545
+ this.doc = typeof document !== "undefined" ? document : null;
70546
+ this.run = 0;
70547
+ this.loop = 0;
70548
+ this.onEvent = () => {
70549
+ this.evaluate();
70550
+ };
70551
+ if (o.offlineOverride?.()) this.builtIns.set(this.builtIn());
70552
+ this.win?.addEventListener("online", this.onEvent);
70553
+ this.win?.addEventListener("offline", this.onEvent);
70554
+ this.doc?.addEventListener("visibilitychange", this.onEvent);
70555
+ o.destroyRef.onDestroy(() => {
70556
+ this.destroyed = true;
70557
+ if (this.timer) clearTimeout(this.timer);
70558
+ this.win?.removeEventListener("online", this.onEvent);
70559
+ this.win?.removeEventListener("offline", this.onEvent);
70560
+ this.doc?.removeEventListener("visibilitychange", this.onEvent);
70561
+ });
70562
+ effect(() => {
70563
+ const ready = this.ready();
70564
+ const reasons = this.reasons();
70565
+ untracked(() => this.o.onChange?.({
70566
+ ready,
70567
+ reasons
70568
+ }));
70569
+ });
70570
+ effect(() => {
70571
+ const check = this.o.check();
70572
+ untracked(() => {
70573
+ this.evaluate();
70574
+ this.loop++;
70575
+ if (this.timer) {
70576
+ clearTimeout(this.timer);
70577
+ this.timer = null;
70578
+ }
70579
+ if (check) this.schedule();
70580
+ });
70581
+ });
70582
+ }
70583
+ passSync() {
70584
+ if (this.destroyed) return false;
70585
+ this.builtIns.set(this.builtIn());
70586
+ const ready = this.ready();
70587
+ if (this.o.check()) this.evaluate();
70588
+ return ready;
70589
+ }
70590
+ async evaluate() {
70591
+ if (this.destroyed) return;
70592
+ this.builtIns.set(this.builtIn());
70593
+ const check = this.o.check();
70594
+ if (!check) {
70595
+ this.hostReasons.set([]);
70596
+ return;
70597
+ }
70598
+ const mine = ++this.run;
70599
+ let answer;
70600
+ let timer = null;
70601
+ try {
70602
+ const timeout = new Promise((resolve) => {
70603
+ timer = setTimeout(() => resolve("timeout"), this.o.timeoutMs());
70604
+ });
70605
+ const result = await Promise.race([callHost(() => check()), timeout]);
70606
+ if (result === "timeout") answer = {
70607
+ ready: false,
70608
+ reasons: ["slow_connection"]
70609
+ };
70610
+ else if (!result || typeof result !== "object") answer = {
70611
+ ready: false,
70612
+ reasons: ["service_unavailable"]
70613
+ };
70614
+ else answer = {
70615
+ ready: result.ready === true && !result.reasons?.length,
70616
+ reasons: Array.isArray(result.reasons) ? result.reasons.filter((r) => typeof r === "string" && !!r) : []
70617
+ };
70618
+ if (!answer.ready && answer.reasons.length === 0) answer.reasons = ["service_unavailable"];
70619
+ } catch {
70620
+ answer = {
70621
+ ready: false,
70622
+ reasons: [typeof navigator !== "undefined" && navigator.onLine === false && !this.o.offlineOverride?.() ? "offline" : "slow_connection"]
70623
+ };
70624
+ } finally {
70625
+ if (timer) clearTimeout(timer);
70626
+ }
70627
+ if (this.destroyed || mine !== this.run) return;
70628
+ this.hostReasons.set(answer.reasons);
70629
+ this.answeredFor.set(check);
70630
+ }
70631
+ schedule() {
70632
+ if (this.destroyed) return;
70633
+ if (this.timer) {
70634
+ clearTimeout(this.timer);
70635
+ this.timer = null;
70636
+ }
70637
+ const token = ++this.loop;
70638
+ this.timer = setTimeout(async () => {
70639
+ this.timer = null;
70640
+ if (token !== this.loop) return;
70641
+ await this.evaluate();
70642
+ if (token === this.loop && this.o.check()) this.schedule();
70643
+ }, Math.max(1, this.o.everyMs?.() ?? 1e4));
70644
+ }
70645
+ };
70646
+ function createPaymentProtection(inputs, options) {
70647
+ const destroyRef = inject(DestroyRef);
70648
+ const storage = inject(PAYMENT_ATTEMPT_STORAGE);
70649
+ const enabled = options.enabled ?? (() => true);
70650
+ const attempt = new PaymentAttempt({
70651
+ destroyRef,
70652
+ payableRef: () => enabled() ? inputs.payableRef() : null,
70653
+ amount: options.amount,
70654
+ method: options.method,
70655
+ attemptKey: inputs.attemptKey,
70656
+ checkStatus: () => enabled() ? inputs.checkStatus() : null,
70657
+ paid: () => enabled() && inputs.paid(),
70658
+ hostPending: () => enabled() && inputs.hostPending(),
70659
+ offlineMidFlight: options.offlineMidFlight,
70660
+ pollMs: inputs.statusPollMs,
70661
+ pollMaxMs: inputs.statusPollMaxMs,
70662
+ statusTimeoutMs: inputs.statusCheckTimeoutMs,
70663
+ failGraceMs: inputs.statusFailGraceMs,
70664
+ authTimeoutMs: inputs.authTimeoutMs,
70665
+ hostSilenceMs: inputs.hostSilenceMs,
70666
+ offlineOverride: inputs.offlineOverride,
70667
+ storage,
70668
+ onOutcome: options.onOutcome,
70669
+ onInFlightChange: options.onInFlightChange,
70670
+ onKeyChange: options.onKeyChange
70671
+ });
70672
+ return {
70673
+ attempt,
70674
+ readiness: new PaymentReadiness({
70675
+ destroyRef,
70676
+ check: () => enabled() ? inputs.readinessCheck() : null,
70677
+ timeoutMs: inputs.readinessTimeoutMs,
70678
+ everyMs: inputs.readinessEveryMs,
70679
+ sdk: options.sdk ?? (() => "ok"),
70680
+ unknownPending: () => enabled() && attempt.unknown(),
70681
+ enabled,
70682
+ storageAvailable: () => !(enabled() && inputs.payableRef()) || attempt.storageScope() === "shared" && !attempt.markerWriteFailed(),
70683
+ offlineOverride: () => !!inputs.offlineOverride?.(),
70684
+ onChange: options.onReadinessChange
70685
+ })
70686
+ };
70687
+ }
70688
+ var PaymentAttemptStatusComponent = class PaymentAttemptStatusComponent {
70689
+ constructor() {
70690
+ this.labels = inject(UiLabelsService);
70691
+ this.attempt = input.required(...ngDevMode ? [{ debugName: "attempt" }] : /* istanbul ignore next */ []);
70692
+ this.showPaid = input(true, ...ngDevMode ? [{ debugName: "showPaid" }] : /* istanbul ignore next */ []);
70693
+ this.allowStartOver = input(false, ...ngDevMode ? [{ debugName: "allowStartOver" }] : /* istanbul ignore next */ []);
70694
+ this.readiness = input(null, ...ngDevMode ? [{ debugName: "readiness" }] : /* istanbul ignore next */ []);
70695
+ this.retryLoad = output();
70696
+ this.firstReason = computed(() => this.readiness()?.reasons()[0] ?? "", ...ngDevMode ? [{ debugName: "firstReason" }] : /* istanbul ignore next */ []);
70697
+ this.readinessText = computed(() => this.labels.t(refusalLabelKey(this.firstReason())), ...ngDevMode ? [{ debugName: "readinessText" }] : /* istanbul ignore next */ []);
70698
+ this.announcement = computed(() => {
70699
+ const attempt = this.attempt();
70700
+ if (attempt.paidLocked() && this.showPaid()) return this.labels.t("paymentAttempt.paid");
70701
+ if (attempt.unknown()) return this.labels.t(attempt.canCheck() && attempt.pollExpired() ? "paymentAttempt.stillUnknown" : "paymentAttempt.checking");
70702
+ if (attempt.waitingForHost()) return this.labels.t("paymentAttempt.waiting");
70703
+ if (this.readiness() && !this.readiness().ready()) return this.readinessText();
70704
+ if (attempt.blockedOffline()) return this.labels.t("paymentAttempt.offline");
70705
+ if (this.readiness()?.storageWarning()) return this.labels.t("paymentReadiness.storageWarning");
70706
+ return "";
70707
+ }, ...ngDevMode ? [{ debugName: "announcement" }] : /* istanbul ignore next */ []);
70708
+ }
70709
+ static {
70710
+ this.ɵfac = i0.ɵɵngDeclareFactory({
70711
+ minVersion: "12.0.0",
70712
+ version: "22.2.2",
70713
+ ngImport: i0,
70714
+ type: PaymentAttemptStatusComponent,
70715
+ deps: [],
70716
+ target: i0.ɵɵFactoryTarget.Component
70717
+ });
70718
+ }
70719
+ static {
70720
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
70721
+ minVersion: "17.0.0",
70722
+ version: "22.2.2",
70723
+ type: PaymentAttemptStatusComponent,
70724
+ isStandalone: true,
70725
+ selector: "ui-payment-attempt-status",
70726
+ inputs: {
70727
+ attempt: {
70728
+ classPropertyName: "attempt",
70729
+ publicName: "attempt",
70730
+ isSignal: true,
70731
+ isRequired: true,
70732
+ transformFunction: null
70733
+ },
70734
+ showPaid: {
70735
+ classPropertyName: "showPaid",
70736
+ publicName: "showPaid",
70737
+ isSignal: true,
70738
+ isRequired: false,
70739
+ transformFunction: null
70740
+ },
70741
+ allowStartOver: {
70742
+ classPropertyName: "allowStartOver",
70743
+ publicName: "allowStartOver",
70744
+ isSignal: true,
70745
+ isRequired: false,
70746
+ transformFunction: null
70747
+ },
70748
+ readiness: {
70749
+ classPropertyName: "readiness",
70750
+ publicName: "readiness",
70751
+ isSignal: true,
70752
+ isRequired: false,
70753
+ transformFunction: null
70754
+ }
70755
+ },
70756
+ outputs: { retryLoad: "retryLoad" },
70757
+ ngImport: i0,
70758
+ template: `
70759
+ <ui-live-region data-testid="pa-live" [message]="announcement()" />
70760
+ @if (attempt().paidLocked() && showPaid()) {
70761
+ <ui-alert variant="success" [quiet]="true" data-testid="pa-paid">{{ labels.t('paymentAttempt.paid') }}</ui-alert>
70762
+ } @else if (attempt().unknown()) {
70763
+ <ui-alert variant="warning" [quiet]="true" data-testid="pa-checking">
70764
+ <p class="pa-line" data-testid="pa-checking-title">{{ labels.t('paymentAttempt.checking') }}</p>
70765
+ <p class="pa-line" data-testid="pa-checking-help">{{ labels.t(attempt().canCheck() && attempt().pollExpired() ? 'paymentAttempt.stillUnknown' : 'paymentAttempt.checkingHelp') }}</p>
70766
+ @if (attempt().canCheck() && attempt().pollExpired()) {
70767
+ <ui-button variant="secondary" size="sm" data-testid="pa-check-again" [loading]="attempt().checking()" (click)="attempt().checkAgain()">{{ labels.t('paymentAttempt.checkAgain') }}</ui-button>
70768
+ @if (allowStartOver()) {
70769
+ <ui-button variant="ghost" size="sm" data-testid="pa-start-over" (click)="attempt().startOver()">{{ labels.t('paymentAttempt.startOver') }}</ui-button>
70770
+ }
70771
+ }
70772
+ </ui-alert>
70773
+ } @else if (attempt().waitingForHost()) {
70774
+ <ui-alert variant="info" [quiet]="true" data-testid="pa-waiting">{{ labels.t('paymentAttempt.waiting') }}</ui-alert>
70775
+ } @else if (readiness() && !readiness()!.ready()) {
70776
+ <ui-alert variant="warning" [quiet]="true" data-testid="pa-not-ready" [attr.data-reason]="firstReason()">
70777
+ <p class="pa-line" data-testid="pa-not-ready-text">{{ readinessText() }}</p>
70778
+ @if (firstReason() === 'sdk_blocked') {
70779
+ <ui-button variant="secondary" size="sm" data-testid="pa-retry-load" (click)="retryLoad.emit()">{{ labels.t('paymentReadiness.retryLoad') }}</ui-button>
70780
+ }
70781
+ </ui-alert>
70782
+ } @else if (attempt().blockedOffline()) {
70783
+ <ui-alert variant="warning" [quiet]="true" data-testid="pa-offline">{{ labels.t('paymentAttempt.offline') }}</ui-alert>
70784
+ }
70785
+ @if (readiness()?.storageWarning()) {
70786
+ <ui-alert variant="info" [quiet]="true" data-testid="pa-storage-warning">{{ labels.t('paymentReadiness.storageWarning') }}</ui-alert>
70787
+ }
70788
+ `,
70789
+ isInline: true,
70790
+ styles: ["ui-payment-attempt-status{display:block;min-width:0}ui-payment-attempt-status .pa-line{margin:0 0 6px}\n"],
70791
+ dependencies: [
70792
+ {
70793
+ kind: "component",
70794
+ type: AlertComponent,
70795
+ selector: "ui-alert",
70796
+ inputs: [
70797
+ "variant",
70798
+ "title",
70799
+ "dismissible",
70800
+ "dismissAriaLabel",
70801
+ "quiet",
70802
+ "compact",
70803
+ "inline",
70804
+ "fill"
70805
+ ],
70806
+ outputs: ["dismissed"]
70807
+ },
70808
+ {
70809
+ kind: "component",
70810
+ type: ButtonComponent,
70811
+ selector: "ui-button",
70812
+ inputs: [
70813
+ "variant",
70814
+ "routerLink",
70815
+ "queryParams",
70816
+ "fragment",
70817
+ "state",
70818
+ "href",
70819
+ "target",
70820
+ "rel",
70821
+ "shortLabel",
70822
+ "shortBelow",
70823
+ "color",
70824
+ "active",
70825
+ "size",
70826
+ "type",
70827
+ "disabled",
70828
+ "loading",
70829
+ "fullWidth",
70830
+ "ariaLabel",
70831
+ "ariaExpanded",
70832
+ "ariaPressed",
70833
+ "ariaDescribedBy",
70834
+ "modal-footer-left",
70835
+ "modal-footer-right"
70836
+ ]
70837
+ },
70838
+ {
70839
+ kind: "component",
70840
+ type: LiveRegionComponent,
70841
+ selector: "ui-live-region",
70842
+ inputs: [
70843
+ "message",
70844
+ "politeness",
70845
+ "atomic",
70846
+ "visible"
70847
+ ]
70848
+ }
70849
+ ],
70850
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
70851
+ encapsulation: i0.ViewEncapsulation.None
70852
+ });
70853
+ }
70854
+ };
70855
+ i0.ɵɵngDeclareClassMetadata({
70856
+ minVersion: "12.0.0",
70857
+ version: "22.2.2",
70858
+ ngImport: i0,
70859
+ type: PaymentAttemptStatusComponent,
70860
+ decorators: [{
70861
+ type: Component,
70862
+ args: [{
70863
+ selector: "ui-payment-attempt-status",
70864
+ standalone: true,
70865
+ changeDetection: ChangeDetectionStrategy.OnPush,
70866
+ imports: [
70867
+ AlertComponent,
70868
+ ButtonComponent,
70869
+ LiveRegionComponent
70870
+ ],
70871
+ template: `
70872
+ <ui-live-region data-testid="pa-live" [message]="announcement()" />
70873
+ @if (attempt().paidLocked() && showPaid()) {
70874
+ <ui-alert variant="success" [quiet]="true" data-testid="pa-paid">{{ labels.t('paymentAttempt.paid') }}</ui-alert>
70875
+ } @else if (attempt().unknown()) {
70876
+ <ui-alert variant="warning" [quiet]="true" data-testid="pa-checking">
70877
+ <p class="pa-line" data-testid="pa-checking-title">{{ labels.t('paymentAttempt.checking') }}</p>
70878
+ <p class="pa-line" data-testid="pa-checking-help">{{ labels.t(attempt().canCheck() && attempt().pollExpired() ? 'paymentAttempt.stillUnknown' : 'paymentAttempt.checkingHelp') }}</p>
70879
+ @if (attempt().canCheck() && attempt().pollExpired()) {
70880
+ <ui-button variant="secondary" size="sm" data-testid="pa-check-again" [loading]="attempt().checking()" (click)="attempt().checkAgain()">{{ labels.t('paymentAttempt.checkAgain') }}</ui-button>
70881
+ @if (allowStartOver()) {
70882
+ <ui-button variant="ghost" size="sm" data-testid="pa-start-over" (click)="attempt().startOver()">{{ labels.t('paymentAttempt.startOver') }}</ui-button>
70883
+ }
70884
+ }
70885
+ </ui-alert>
70886
+ } @else if (attempt().waitingForHost()) {
70887
+ <ui-alert variant="info" [quiet]="true" data-testid="pa-waiting">{{ labels.t('paymentAttempt.waiting') }}</ui-alert>
70888
+ } @else if (readiness() && !readiness()!.ready()) {
70889
+ <ui-alert variant="warning" [quiet]="true" data-testid="pa-not-ready" [attr.data-reason]="firstReason()">
70890
+ <p class="pa-line" data-testid="pa-not-ready-text">{{ readinessText() }}</p>
70891
+ @if (firstReason() === 'sdk_blocked') {
70892
+ <ui-button variant="secondary" size="sm" data-testid="pa-retry-load" (click)="retryLoad.emit()">{{ labels.t('paymentReadiness.retryLoad') }}</ui-button>
70893
+ }
70894
+ </ui-alert>
70895
+ } @else if (attempt().blockedOffline()) {
70896
+ <ui-alert variant="warning" [quiet]="true" data-testid="pa-offline">{{ labels.t('paymentAttempt.offline') }}</ui-alert>
70897
+ }
70898
+ @if (readiness()?.storageWarning()) {
70899
+ <ui-alert variant="info" [quiet]="true" data-testid="pa-storage-warning">{{ labels.t('paymentReadiness.storageWarning') }}</ui-alert>
70900
+ }
70901
+ `,
70902
+ encapsulation: ViewEncapsulation.None,
70903
+ styles: ["ui-payment-attempt-status{display:block;min-width:0}ui-payment-attempt-status .pa-line{margin:0 0 6px}\n"]
70904
+ }]
70905
+ }],
70906
+ propDecorators: {
70907
+ attempt: [{
70908
+ type: i0.Input,
70909
+ args: [{
70910
+ isSignal: true,
70911
+ alias: "attempt",
70912
+ required: true
70913
+ }]
70914
+ }],
70915
+ showPaid: [{
70916
+ type: i0.Input,
70917
+ args: [{
70918
+ isSignal: true,
70919
+ alias: "showPaid",
70920
+ required: false
70921
+ }]
70922
+ }],
70923
+ allowStartOver: [{
70924
+ type: i0.Input,
70925
+ args: [{
70926
+ isSignal: true,
70927
+ alias: "allowStartOver",
70928
+ required: false
70929
+ }]
70930
+ }],
70931
+ readiness: [{
70932
+ type: i0.Input,
70933
+ args: [{
70934
+ isSignal: true,
70935
+ alias: "readiness",
70936
+ required: false
70937
+ }]
70938
+ }],
70939
+ retryLoad: [{
70940
+ type: i0.Output,
70941
+ args: ["retryLoad"]
70942
+ }]
70943
+ }
70944
+ });
70945
+ function isDarkPage(doc) {
70946
+ const forced = doc.documentElement.getAttribute("data-theme");
70947
+ if (forced === "dark") return true;
70948
+ if (forced === "light") return false;
70949
+ try {
70950
+ return !!doc.defaultView?.matchMedia?.("(prefers-color-scheme: dark)").matches;
70951
+ } catch {
70952
+ return false;
70953
+ }
70954
+ }
69120
70955
  const UI_LANGUAGE_AUTO = "auto";
69121
70956
  const UI_LANGUAGE_CONFIG = new InjectionToken("UI_LANGUAGE_CONFIG");
69122
70957
  const EMBEDDING_PARENT = new InjectionToken("EMBEDDING_PARENT", {
@@ -69142,7 +70977,7 @@ const BUILT_IN_ENDONYMS = {
69142
70977
  ko: "한국어",
69143
70978
  ru: "Русский"
69144
70979
  };
69145
- const BUILT_IN_LOADERS = /* @__PURE__ */ new Map([["es", () => import("./forgeroute-ui-ui-labels.es-Bdh64Ql6.mjs").then((m) => m.UI_LABELS_ES)]]);
70980
+ const BUILT_IN_LOADERS = /* @__PURE__ */ new Map([["es", () => import("./forgeroute-ui-ui-labels.es-C1Meg25h.mjs").then((m) => m.UI_LABELS_ES)]]);
69146
70981
  const normalizeTag = (tag) => tag.trim().toLowerCase().replace(/_/g, "-");
69147
70982
  const baseOf = (tag) => normalizeTag(tag).split("-")[0];
69148
70983
  const builtInLoader = (lang) => BUILT_IN_LOADERS.get(normalizeTag(lang)) ?? BUILT_IN_LOADERS.get(baseOf(lang));
@@ -72919,6 +74754,6 @@ i0.ɵɵngDeclareClassMetadata({
72919
74754
  }]
72920
74755
  }
72921
74756
  });
72922
- export { ALLOCATION_CUSTOM, ASCII_SPECIAL_PASSWORD_RULES, ActionBarComponent, AddressInputComponent, AlertComponent, AppShellComponent, AudioPlayerComponent, AvatarComponent, BADGE_VARIANT_STYLES, BadgeComponent, BankAccountFormComponent, BarRowComponent, BoardCardDirective, BoardComponent, BulkMessagePanelComponent, BusinessHoursComponent, ButtonComponent, COMMON_DETAIL_GROUP_STYLES, CalendarComponent, CardListItemComponent, ChargeFormComponent, CheckboxComponent, CheckboxTrailingDirective, ChipComponent, ChipGroupComponent, ColorInputComponent, ColumnFilterComponent, ColumnsComponent, ComboboxComponent, ConfirmAfterCheckService, ConfirmOutletComponent, ConfirmService, ContactPickerComponent, ConversationRichBodyComponent, ConversationsComponent, CopyFieldComponent, DEFAULT_ALLOCATION_MODES, DEFAULT_BANK_ACCOUNT_TYPE_OPTIONS, DEFAULT_BANK_HOLDER_TYPE_OPTIONS, DEFAULT_BANK_MANDATE_TEXT, DEFAULT_EMAIL_TEMPLATE_BLOCK_GROUPS, DEFAULT_EMAIL_TEMPLATE_VARIABLE_GROUPS, DEFAULT_PASSWORD_RULES, DEFAULT_PAYMENT_METHODS, DEFAULT_REFUND_REASONS, DETAIL_CARD_HEADER_BG, DETAIL_GROUP_HEADER_BG, DROPDOWN_GROUP, DataTableComponent, DateInputComponent, DateRangePickerComponent, DatetimeInputComponent, DetailCardComponent, DiscountSelectorComponent, DividerComponent, DropdownComponent, EMAIL_BLOCK_DRAG_TYPE, EMAIL_TEMPLATE_MAX_BODY, EMAIL_TEMPLATE_MAX_TEXT, EMAIL_TEMPLATE_START_TEXT, EMBEDDING_PARENT, EmailTemplateEditorComponent, EmptyStateComponent, ErrorComponent, ErrorStateComponent, FORGEROUTE_CONFIG, FadeComponent, FileInputComponent, FillViewportDirective, FixedFooterComponent, FormColSpanDirective, FormComponent, FormRowComponent, FormSectionComponent, HintComponent, ICON_NAMES, IDX_BEHAVIOR_SIGNALS, IDX_BEHAVIOR_SIGNALS_ES, INTEGRATION_CATALOG, INTEGRATION_FIELD_DEFS, INTEGRATION_FIELD_TEXTS_ES, INTEGRATION_GROUP_LABELS_ES, INTEGRATION_GROUP_ORDER, INTEGRATION_OPTION_DEFS, INTEGRATION_OPTION_TEXTS_ES, INTEGRATION_TEXTS_ES, IconComponent, IconPickerComponent, ImageComponent, ImageGalleryComponent, ImageGalleryDialogComponent, ImagePreviewComponent, ImageRepositionComponent, ImportExportComponent, ImportSourceGridComponent, InspectionTemplatePrintService, KanbanBoardComponent, KanbanCardDirective, KeypadComponent, KpiCardComponent, LAYOUT_GAP_PX, LISTED_SPECIAL_PASSWORD_RULES, ListComponent, ListItemComponent, LiveRegionComponent, MAX_EMAIL_ADDRESS_LENGTH, MAX_PAYMENT_AMOUNT, MIN_PAYMENT_AMOUNT, ModalComponent, ModuleLabelsRegistry, MoreMenuComponent, MultiSelectComponent, NOTES_MAX_LENGTH, NotesComponent, NotificationBellComponent, OfflineBannerComponent, OptionCardComponent, PASSWORD_MAX_BYTES, PASSWORD_MAX_LENGTH, PAYMENT_METHOD, PAYMENT_METHOD_PLUGIN, PHONE_NUMBER_AREA_CODE_LENGTH, PHONE_NUMBER_ZIP_LENGTH, PageComponent, PaginationComponent, PanelInfoListComponent, PasswordRequirementsComponent, PaymentCustomMethodComponent, PaymentMethodPlugin, PaymentSidePanelComponent, PdfHotspotComponent, PhoneNumberPickerComponent, PillTabPanelDirective, PillTabsComponent, PrintService, ProgressBarComponent, ProgressRingComponent, QrCodeComponent, QuickFilterTabsComponent, RICH_TEXT_OPTIONS, RadioComponent, RadioGroupComponent, RadioMatrixComponent, RadioOptionContentDirective, ReadonlyFieldsetComponent, RefundPanelComponent, ReminderAlertsComponent, RichTextEditorComponent, SEMANTIC_BADGE_MAP, SEMANTIC_BADGE_MAP_ES, SETUP_DONE_KEY, SETUP_INTEGRATIONS, SearchInputComponent, SectionHeaderComponent, SelectComponent, SetupWizardComponent, SetupWizardStepDirective, SetupWizardStepHeaderDirective, ShareMenuComponent, ShowComponent, SidePanelComponent, SidebarLayoutComponent, SignaturePadComponent, SkeletonComponent, SkipLinkComponent, SnackbarComponent, SnackbarService, StackComponent, StackedBarComponent, StackingPlanComponent, StarComponent, StarRatingComponent, StepperComponent, SwatchPickerComponent, TableToolbarComponent, TextComponent, TextInputComponent, TextTemplatePickerComponent, TextareaInputComponent, TimeInputComponent, TimelineComponent, ToastComponent, ToastService, ToggleBadgeComponent, ToggleComponent, TooltipDirective, TourComponent, UI_DEFAULT_LABELS, UI_FIELD_REVEAL_HOST, UI_LANGUAGE_AUTO, UI_LANGUAGE_CONFIG, UI_NOTES_QUEUE, UI_READ_ONLY_MODE, US_LOCATIONS, US_STATES, US_STATE_OPTIONS, US_ZIP_PATTERN, UiFieldValidity, UiLabelsService, UiLanguageService, UiLanguageSwitcherComponent, acceptLabel, appShellGroupsStorageKey, assertModuleLabelParity, autoVariant, blockHasContent, buildDefaultSchedule, buildInspectionTemplateHtml, buildMapsEmbedUrl, buildMapsUrl, buildPreviewDocument, buildVideoBlockHtml, builtInActionIcon, businessTimeOptions, callHost, conversationDateLabel, conversationHtmlToText, conversationInitial, conversationMessageStatusLabel, conversationMessageStatusMark, createFieldReveal, createModuleLabels, createPasswordPolicyValidator, csvCell, csvSafeText, decodeFilterValues, defaultChargeAmount, defaultLabel, digitsOnly, downloadBlob, downloadCsv, emailShareUrl, emptyAddress, encodeFilterValue, encodeFilterValues, errorContextInterceptor, escapeHtml, facebookShareUrl, fileMatchesAccept, fileNameFromContentDisposition, formatAddress, formatAddressValue, formatAddressValueOneLine, formatAttachmentSize, formatCategoryLabel, formatConversationPhone, formatConversationTime, formatCurrency, formatDuration, formatEnum, formatFileSize, formatIsoDate, formatIsoDateTime, formatMessageTime, formatPhone, formatPhoneDisplay, formatShortDate, formatTime, formatTimeAgo, formatVideoDuration, getEligibleIds, getEligibleOptions, getErrorMessage, getInitials, gmailShareUrl, groupMessagesByDay, hostErrorMessage, humanReadableMessage, iconPath, injectModuleLabels, injectReadOnlyMode, insideEditorBlock, inspectionTemplateStatusLabel, integrationGroupLabel, integrationPlainText, integrationsForApp, integrationsOnlyFor, isBlockDrag, isEmptyAddress, isValidAmount, isValidEmailAddress, isValidZip, isWebUrl, isoKey, issueToErrors, last4Error, linkedInShareUrl, loadUiLabels, localizeIntegration, localizeIntegrationFields, localizeIntegrationOptions, localizedAllocationModes, localizedDetailGroupStyle, localizedEmailBlockGroups, localizedEmailVariableGroups, localizedIdxBehaviorSignals, localizedIntegrationDescription, localizedIntegrationTitle, localizedPaymentMethods, maxLengthIssue, mergeDescribedBy, moduleLabelsTesting, normalizeAddress, normalizeHexColor, orderBulkOptions, outlookShareUrl, parseAddressOneLine, parseAddressValue, parseBizHours, parseIso, parseTime, passwordByteLength, passwordMeetsRules, passwordTooLongMessage, passwordWithinLimits, periodGroup, pillTabDescriptionId, pillTabId, pillTabPanelId, pillTabTitleId, pluralize, provideForgerouteToast, provideModuleLabelOverrides, provideReadOnlyMode, provideUiLanguage, reorderItems, requiredIssue, resolveLayoutGap, resolvePreset, safeLocale, semanticBadgeVariant, serializeBizHours, serializedTextLength, setupIntegrations, splitIntro, terminalTimeoutText, terminalVerdict, timelineItemsFromEvents, toCsv, todayInTimezone, truncateConversationText, uiCurrencyFormatter, uiFormatClock, uiFormatCurrency, uiFormatDate, uiFormatHour, uiFormatNumber, uiLocale, uiMonthName, uiText, uiWeekdayName, usStateName, usStateSelectOptions, usdCurrencyDisplay, xShareUrl };
74757
+ export { ALLOCATION_CUSTOM, ASCII_SPECIAL_PASSWORD_RULES, ActionBarComponent, AddressInputComponent, AlertComponent, AppShellComponent, AudioPlayerComponent, AvatarComponent, BADGE_VARIANT_STYLES, BadgeComponent, BankAccountFormComponent, BarRowComponent, BoardCardDirective, BoardComponent, BulkMessagePanelComponent, BusinessHoursComponent, ButtonComponent, COMMON_DETAIL_GROUP_STYLES, CalendarComponent, CardListItemComponent, ChargeFormComponent, CheckboxComponent, CheckboxTrailingDirective, ChipComponent, ChipGroupComponent, ColorInputComponent, ColumnFilterComponent, ColumnsComponent, ComboboxComponent, ConfirmAfterCheckService, ConfirmOutletComponent, ConfirmService, ContactPickerComponent, ConversationRichBodyComponent, ConversationsComponent, CopyFieldComponent, DEFAULT_ALLOCATION_MODES, DEFAULT_BANK_ACCOUNT_TYPE_OPTIONS, DEFAULT_BANK_HOLDER_TYPE_OPTIONS, DEFAULT_BANK_MANDATE_TEXT, DEFAULT_EMAIL_TEMPLATE_BLOCK_GROUPS, DEFAULT_EMAIL_TEMPLATE_VARIABLE_GROUPS, DEFAULT_PASSWORD_RULES, DEFAULT_PAYMENT_METHODS, DEFAULT_REFUND_REASONS, DETAIL_CARD_HEADER_BG, DETAIL_GROUP_HEADER_BG, DROPDOWN_GROUP, DataTableComponent, DateInputComponent, DateRangePickerComponent, DatetimeInputComponent, DetailCardComponent, DiscountSelectorComponent, DividerComponent, DropdownComponent, EMAIL_BLOCK_DRAG_TYPE, EMAIL_TEMPLATE_MAX_BODY, EMAIL_TEMPLATE_MAX_TEXT, EMAIL_TEMPLATE_START_TEXT, EMBEDDING_PARENT, EmailTemplateEditorComponent, EmptyStateComponent, ErrorComponent, ErrorStateComponent, FORGEROUTE_CONFIG, FadeComponent, FileInputComponent, FillViewportDirective, FixedFooterComponent, FormColSpanDirective, FormComponent, FormRowComponent, FormSectionComponent, HintComponent, ICON_NAMES, IDX_BEHAVIOR_SIGNALS, IDX_BEHAVIOR_SIGNALS_ES, INTEGRATION_CATALOG, INTEGRATION_FIELD_DEFS, INTEGRATION_FIELD_TEXTS_ES, INTEGRATION_GROUP_LABELS_ES, INTEGRATION_GROUP_ORDER, INTEGRATION_OPTION_DEFS, INTEGRATION_OPTION_TEXTS_ES, INTEGRATION_TEXTS_ES, IconComponent, IconPickerComponent, ImageComponent, ImageGalleryComponent, ImageGalleryDialogComponent, ImagePreviewComponent, ImageRepositionComponent, ImportExportComponent, ImportSourceGridComponent, InspectionTemplatePrintService, KanbanBoardComponent, KanbanCardDirective, KeypadComponent, KpiCardComponent, LAYOUT_GAP_PX, LISTED_SPECIAL_PASSWORD_RULES, ListComponent, ListItemComponent, LiveRegionComponent, MAX_EMAIL_ADDRESS_LENGTH, MAX_PAYMENT_AMOUNT, MIN_PAYMENT_AMOUNT, ModalComponent, ModuleLabelsRegistry, MoreMenuComponent, MultiSelectComponent, NOTES_MAX_LENGTH, NotesComponent, NotificationBellComponent, OfflineBannerComponent, OptionCardComponent, PASSWORD_MAX_BYTES, PASSWORD_MAX_LENGTH, PAYMENT_ATTEMPT_MARKER_TTL_MS, PAYMENT_ATTEMPT_PAID_RECORD_TTL_MS, PAYMENT_ATTEMPT_STORAGE, PAYMENT_ATTEMPT_STORAGE_PREFIX, PAYMENT_ATTEMPT_TOMBSTONE_TTL_MS, PAYMENT_AUTH_TIMEOUT_MS, PAYMENT_HOST_SILENCE_MS, PAYMENT_METHOD, PAYMENT_METHOD_PLUGIN, PAYMENT_NO_CHARGE_CODES, PAYMENT_READINESS_EVERY_MS, PAYMENT_READINESS_REASONS, PAYMENT_READINESS_SLOW_RTT_MS, PAYMENT_READINESS_TIMEOUT_MS, PAYMENT_REQUEST_TIMEOUT_MS, PAYMENT_STATUS_CHECK_TIMEOUT_MS, PAYMENT_STATUS_FAIL_GRACE_MS, PAYMENT_STATUS_HARD_MAX_MS, PAYMENT_STATUS_POLL_MAX_MS, PAYMENT_STATUS_POLL_MS, PHONE_NUMBER_AREA_CODE_LENGTH, PHONE_NUMBER_ZIP_LENGTH, PageComponent, PaginationComponent, PanelInfoListComponent, PasswordRequirementsComponent, PaymentAttempt, PaymentAttemptStatusComponent, PaymentCustomMethodComponent, PaymentMethodPlugin, PaymentReadiness, PaymentSidePanelComponent, PdfHotspotComponent, PhoneNumberPickerComponent, PillTabPanelDirective, PillTabsComponent, PrintService, ProgressBarComponent, ProgressRingComponent, QrCodeComponent, QuickFilterTabsComponent, RICH_TEXT_OPTIONS, RadioComponent, RadioGroupComponent, RadioMatrixComponent, RadioOptionContentDirective, ReadonlyFieldsetComponent, RefundPanelComponent, ReminderAlertsComponent, RichTextEditorComponent, SEMANTIC_BADGE_MAP, SEMANTIC_BADGE_MAP_ES, SETUP_DONE_KEY, SETUP_INTEGRATIONS, SearchInputComponent, SectionHeaderComponent, SelectComponent, SetupWizardComponent, SetupWizardStepDirective, SetupWizardStepHeaderDirective, ShareMenuComponent, ShowComponent, SidePanelComponent, SidebarLayoutComponent, SignaturePadComponent, SkeletonComponent, SkipLinkComponent, SnackbarComponent, SnackbarService, StackComponent, StackedBarComponent, StackingPlanComponent, StarComponent, StarRatingComponent, StepperComponent, SwatchPickerComponent, TableToolbarComponent, TextComponent, TextInputComponent, TextTemplatePickerComponent, TextareaInputComponent, TimeInputComponent, TimelineComponent, ToastComponent, ToastService, ToggleBadgeComponent, ToggleComponent, TooltipDirective, TourComponent, UI_DEFAULT_LABELS, UI_FIELD_REVEAL_HOST, UI_LANGUAGE_AUTO, UI_LANGUAGE_CONFIG, UI_NOTES_QUEUE, UI_READ_ONLY_MODE, US_LOCATIONS, US_STATES, US_STATE_OPTIONS, US_ZIP_PATTERN, UiFieldValidity, UiLabelsService, UiLanguageService, UiLanguageSwitcherComponent, acceptLabel, appShellGroupsStorageKey, assertModuleLabelParity, autoVariant, blockHasContent, buildDefaultSchedule, buildInspectionTemplateHtml, buildMapsEmbedUrl, buildMapsUrl, buildPreviewDocument, buildVideoBlockHtml, builtInActionIcon, builtInReadinessReasons, businessTimeOptions, callHost, classifyHostError, conversationDateLabel, conversationHtmlToText, conversationInitial, conversationMessageStatusLabel, conversationMessageStatusMark, createFieldReveal, createModuleLabels, createPasswordPolicyValidator, createPaymentProtection, csvCell, csvSafeText, decodeFilterValues, defaultChargeAmount, defaultLabel, digitsOnly, downloadBlob, downloadCsv, emailShareUrl, emptyAddress, encodeFilterValue, encodeFilterValues, errorContextInterceptor, escapeHtml, facebookShareUrl, fileMatchesAccept, fileNameFromContentDisposition, formatAddress, formatAddressValue, formatAddressValueOneLine, formatAttachmentSize, formatCategoryLabel, formatConversationPhone, formatConversationTime, formatCurrency, formatDuration, formatEnum, formatFileSize, formatIsoDate, formatIsoDateTime, formatMessageTime, formatPhone, formatPhoneDisplay, formatShortDate, formatTime, formatTimeAgo, formatVideoDuration, getEligibleIds, getEligibleOptions, getErrorMessage, getInitials, gmailShareUrl, groupMessagesByDay, hostErrorMessage, humanReadableMessage, iconPath, injectModuleLabels, injectReadOnlyMode, insideEditorBlock, inspectionTemplateStatusLabel, integrationGroupLabel, integrationPlainText, integrationsForApp, integrationsOnlyFor, isAttemptFailedReplay, isBlockDrag, isDarkPage, isEmptyAddress, isValidAmount, isValidEmailAddress, isValidZip, isWebUrl, isoKey, issueToErrors, last4Error, linkedInShareUrl, loadUiLabels, localizeIntegration, localizeIntegrationFields, localizeIntegrationOptions, localizedAllocationModes, localizedDetailGroupStyle, localizedEmailBlockGroups, localizedEmailVariableGroups, localizedIdxBehaviorSignals, localizedIntegrationDescription, localizedIntegrationTitle, localizedPaymentMethods, maxLengthIssue, mergeDescribedBy, moduleLabelsTesting, normalizeAddress, normalizeHexColor, orderBulkOptions, outlookShareUrl, parseAddressOneLine, parseAddressValue, parseBizHours, parseIso, parseTime, passwordByteLength, passwordMeetsRules, passwordTooLongMessage, passwordWithinLimits, periodGroup, pillTabDescriptionId, pillTabId, pillTabPanelId, pillTabTitleId, pluralize, provideForgerouteToast, provideModuleLabelOverrides, provideReadOnlyMode, provideUiLanguage, refusalLabelKey, reorderItems, requiredIssue, resolveLayoutGap, resolvePreset, safeLocale, semanticBadgeVariant, serializeBizHours, serializedTextLength, setupIntegrations, splitIntro, terminalTimeoutText, terminalVerdict, timelineItemsFromEvents, toCsv, todayInTimezone, truncateConversationText, uiCurrencyFormatter, uiFormatClock, uiFormatCurrency, uiFormatDate, uiFormatHour, uiFormatNumber, uiLocale, uiMonthName, uiText, uiWeekdayName, usStateName, usStateSelectOptions, usdCurrencyDisplay, warnQueuedPayment, wasQueuedOffline, xShareUrl };
72923
74758
 
72924
74759
  //# sourceMappingURL=forgeroute-ui.mjs.map