straumur-web-component 2.0.0-alpha.2 → 2.0.0-alpha.4

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/straumur-checkout.tsx","#style-inject:#style-inject","../src/styles/main.css","../src/env.ts","../src/adapter/straumur-adapter.ts","../src/localizations/translations.ts","../src/services/straumur-service.ts","../src/localizations/locale.ts","../src/features/straumur-checkout-container.tsx","../src/features/card/card-component.tsx","../src/features/card/card-component.css","../src/components/payment-method-group/payment-method-group-context.tsx","../src/localizations/i18n-context.tsx","../src/assets/icons/card.tsx","../src/utils/renderBrandIcons.tsx","../src/assets/icons/mastercard.tsx","../src/assets/icons/visa.tsx","../src/assets/icons/maestro.tsx","../src/assets/icons/amex.tsx","../src/assets/icons/jcb.tsx","../src/assets/icons/diners.tsx","../src/assets/icons/discover.tsx","../src/assets/icons/cup.tsx","../src/components/tooltip/tooltip.tsx","../src/components/tooltip/tooltip.css","../src/utils/custom-hooks/use-media-query.ts","../src/components/card-form/card-form.tsx","../src/assets/icons/info.tsx","../src/assets/icons/loader.tsx","../src/assets/icons/checkmark.tsx","../src/components/render-dual-brand/render-dual-brand.tsx","../src/models/models.ts","../src/flows/payment-flow.ts","../src/components/shared/before-submit-click.ts","../src/components/shared/create-adyen-handlers.ts","../src/utils/custom-hooks/use-adyen-locale-reinit.ts","../src/utils/custom-hooks/use-focus-on-activate.ts","../src/utils/custom-hooks/use-resolved-theme.ts","../src/utils/adyen-field-styles.ts","../src/components/payment-method-item/payment-method-item.tsx","../src/components/payment-method-item/payment-method-item.css","../src/features/google-pay/google-pay-component.tsx","../src/features/google-pay/google-pay-component.css","../src/assets/icons/googlepay.tsx","../src/components/google-pay-button/google-pay-button.css","../src/components/google-pay-button/google-pay-button.tsx","../src/components/shared/wallet-button.tsx","../src/models/constants.ts","../src/features/apple-pay/apple-pay-component.tsx","../src/features/apple-pay/apple-pay-component.css","../src/assets/icons/applepay.tsx","../src/components/apple-pay-button/apple-pay-button.css","../src/components/apple-pay-button/apple-pay-button.tsx","../src/features/stored-card/stored-card-container-component.tsx","../src/features/stored-card/stored-card-component.tsx","../src/features/stored-card/stored-card-component.css","../src/assets/icons/warning.tsx","../src/components/payment-method-group/payment-method-group.tsx","../src/components/payment-method-group/payment-method-group.css","../src/features/result-component/result-component.tsx","../src/features/result-component/result-component.css","../src/assets/icons/success.tsx","../src/assets/icons/failure.tsx","../src/features/payment-methods-wrapper/payment-methods-wrapper.tsx","../src/features/instantPayments/instant-payments-component.tsx","../src/features/instantPayments/instant-payments-component.css","../src/localizations/i18n-service.ts","../src/components/shared/status-screen.tsx","../src/services/advanced-normalizer.ts","../src/config/build-checkout-configuration.ts"],"sourcesContent":["import { h, render } from \"preact\";\nimport \"./styles/main.css\";\nimport {\n ResultMessage,\n StraumurCheckoutConfiguration,\n StraumurCheckoutUpdateOptions,\n StraumurWebAdvancedConfiguration,\n StraumurWebConfiguration,\n} from \"./models/models\";\nimport { setupPaymentMethods } from \"./services/straumur-service\";\nimport { normalizeLocale, PublicLocale } from \"./localizations/locale\";\nimport StraumurCheckoutContainer from \"./features/straumur-checkout-container\";\nimport { PaymentMethodsResponse, SuccessResponse } from \"./services/models\";\nimport { AdyenCheckout } from \"@adyen/adyen-web\";\nimport { I18nProvider } from \"./localizations/i18n-context\";\nimport { I18nService } from \"./localizations/i18n-service\";\nimport { SubmitApi } from \"./components/payment-method-group/payment-method-group-context\";\nimport { createAdyenPaymentHandlers } from \"./components/shared/create-adyen-handlers\";\nimport { LoaderScreen, RootComponent, StatusScreen } from \"./components/shared/status-screen\";\nimport { buildCheckoutConfiguration } from \"./config/build-checkout-configuration\";\n\nclass StraumurCheckout {\n private configuration: StraumurCheckoutConfiguration;\n private advancedConfiguration: StraumurWebAdvancedConfiguration | null = null;\n private paymentMethods: SuccessResponse | null = null;\n private mountElement: HTMLElement | null = null;\n private i18n: I18nService;\n private submitApi: SubmitApi | null = null;\n private initializationFailed = false;\n\n // Public signature accepts the session configuration only. The advanced-mode configuration\n // (internal, used by Straumur Hosted Checkout via the IIFE bundle) is detected at runtime.\n constructor(publicConfig: StraumurWebConfiguration) {\n const initialization = buildCheckoutConfiguration(publicConfig);\n\n this.configuration = initialization.configuration;\n this.advancedConfiguration = initialization.advancedConfiguration;\n this.paymentMethods = initialization.paymentMethods;\n this.initializationFailed = initialization.initializationFailed;\n this.i18n = new I18nService(this.configuration.locale, this.configuration.customLocalizations);\n }\n\n async mount(selector: HTMLElement | string): Promise<void> {\n try {\n this.mountElement = typeof selector === \"string\" ? document.querySelector(selector) : selector;\n\n if (!this.mountElement) {\n return;\n }\n\n if (this.initializationFailed) {\n this.handleError({ key: \"error.failedToInitializeStraumurWebComponent\" });\n return;\n }\n\n if (this.configuration.mode === \"advanced\") {\n this.renderComponent();\n return;\n }\n\n render(<LoaderScreen theme={this.configuration.theme} />, this.mountElement);\n\n const response = await setupPaymentMethods(this.configuration.environment, this.configuration.sessionId!);\n\n if (response.resultCode === \"Error\") {\n this.handleError({ key: response.error });\n return;\n }\n\n this.paymentMethods = response;\n\n this.renderComponent();\n } catch (error) {\n // Never throw into the host page, but leave a trace for the merchant's console.\n console.error(\"[StraumurCheckout] mount() failed:\", error);\n }\n }\n\n private renderComponent(): void {\n if (!this.mountElement) return;\n\n render(\n <RootComponent theme={this.configuration.theme}>\n <I18nProvider\n i18nService={this.i18n}\n onLanguageChange={(language) => {\n this.configuration.locale = language;\n this.renderComponent();\n }}\n >\n <StraumurCheckoutContainer\n configuration={this.configuration}\n paymentMethods={this.paymentMethods!}\n onSubmitApiReady={(api) => {\n this.submitApi = api;\n }}\n />\n </I18nProvider>\n </RootComponent>,\n this.mountElement\n );\n }\n\n handleSuccess(message: ResultMessage) {\n if (!this.mountElement) return;\n\n render(\n <StatusScreen variant=\"success\" message={message} i18n={this.i18n} theme={this.configuration.theme} />,\n this.mountElement\n );\n }\n\n handleError(message: ResultMessage) {\n if (!this.mountElement) return;\n\n render(\n <StatusScreen variant=\"failure\" message={message} i18n={this.i18n} theme={this.configuration.theme} />,\n this.mountElement\n );\n }\n\n // Resolves what the redirect-return Adyen bootstrap needs per mode, rendering the\n // failure screen and returning null when the context cannot be established.\n private async resolveRedirectContext(): Promise<{\n clientKey: string;\n paymentMethods: PaymentMethodsResponse;\n } | null> {\n if (this.configuration.mode === \"advanced\") {\n if (this.initializationFailed || !this.advancedConfiguration) {\n this.handleError({ key: \"error.failedToInitializeStraumurWebComponent\" });\n return null;\n }\n\n return {\n clientKey: this.advancedConfiguration.clientKey,\n paymentMethods: this.advancedConfiguration.paymentMethods,\n };\n }\n\n const response = await setupPaymentMethods(this.configuration.environment, this.configuration.sessionId!);\n\n if (response.resultCode === \"Error\") {\n this.handleError({ key: response.error });\n return null;\n }\n\n return { clientKey: response.clientKey, paymentMethods: response.paymentMethods };\n }\n\n // selector lets a page that never called mount() (e.g. a 3DS redirect return) show the result screens\n async submitDetails(redirectResult: string, selector?: HTMLElement | string) {\n try {\n if (selector) {\n this.mountElement = typeof selector === \"string\" ? document.querySelector(selector) : selector;\n }\n\n const redirectContext = await this.resolveRedirectContext();\n\n if (!redirectContext) {\n return;\n }\n\n const { handleOnSubmitAdditionalData } = createAdyenPaymentHandlers({\n configuration: this.configuration,\n handleSuccess: (message) => this.handleSuccess(message),\n handleError: (message) => this.handleError(message),\n setThreeDSecureActive: () => {},\n dispatchResultFromAdditionalDetails: true,\n });\n\n // Deliberately no core-level onPaymentCompleted/onPaymentFailed here: the handler above\n // dispatches the final result itself, and wiring both would double-fire the merchant callbacks.\n const checkout = await AdyenCheckout({\n environment: this.configuration.environment,\n clientKey: redirectContext.clientKey,\n paymentMethodsResponse: redirectContext.paymentMethods,\n countryCode: this.configuration.countryCode,\n onAdditionalDetails: handleOnSubmitAdditionalData,\n });\n\n checkout.submitDetails({\n details: {\n redirectResult,\n },\n });\n } catch (error) {\n // Same no-throw philosophy as mount(): render the failure in-place, log for the console.\n console.error(\"[StraumurCheckout] submitDetails() failed:\", error);\n this.handleError({ key: \"error.failedToSubmitPaymentDetails\" });\n this.configuration.onPaymentFailed?.({ resultCode: \"Error\" });\n }\n }\n\n updateConfig(newConfig: StraumurCheckoutUpdateOptions): void {\n const { locale, ...rest } = newConfig;\n\n this.configuration = {\n ...this.configuration,\n ...rest,\n // The public vocabulary is short codes; normalizeLocale also tolerates legacy full tags at runtime.\n ...(locale ? { locale: normalizeLocale(locale) } : {}),\n };\n\n // Update i18n if locale or customLocalizations changed\n if (locale) {\n this.i18n.setLanguage(this.configuration.locale);\n }\n if (newConfig.customLocalizations) {\n this.i18n.updateCustomLocalizations(newConfig.customLocalizations);\n }\n\n // Re-render the component with new config\n if (this.mountElement) {\n this.renderComponent();\n }\n }\n\n setLanguage(locale: PublicLocale): void {\n this.updateConfig({\n locale: locale,\n });\n }\n\n destroy(): void {\n // Clean up resources\n if (this.mountElement) {\n render(null, this.mountElement);\n this.mountElement = null;\n }\n this.submitApi = null;\n }\n\n submitCard(): boolean {\n if (!this.mountElement) {\n console.warn(\"[StraumurCheckout] submitCard() called before the component was mounted.\");\n return false;\n }\n\n if (!this.submitApi) {\n console.warn(\"[StraumurCheckout] submitCard() called but the component is not ready yet.\");\n return false;\n }\n\n const triggered = this.submitApi.triggerSubmit();\n\n if (!triggered) {\n console.warn(\n \"[StraumurCheckout] submitCard() called but no card-type payment method is currently active and initialized.\"\n );\n }\n\n return triggered;\n }\n}\n\nexport default StraumurCheckout;\n","\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n ","import styleInject from '#style-inject';styleInject(\":root{--straumur__color-primary: #002649;--straumur__color-secondary: #72889d;--straumur__color-secondary-gamma: #eef0f2;--straumur__color-blue-beta: #bce6f3;--straumur__color-blue-gamma: #eff8fa;--straumur__color-neon-green-zeta: #88a64e;--straumur__color-red-beta: #d96666;--straumur__color-red-gamma: #fff8f5;--straumur__color-gray-epsilon: #e7e7e7;--straumur__color-cosmos-blue-delta: #cdd8e2;--straumur__color-cosmos-blue-gamma: #e6ebef;--straumur__color-white: #ffffff;--straumur__color-transparent: transparent;--straumur__color-text: #00112c;--straumur__color-border: #dbdee2;--straumur__color-warning-text: #775d00;--straumur__color-warning-bg: #fff7db;--straumur__color-danger-text: #d03e00;--straumur__border-radius-xxs: 4px;--straumur__border-radius-xs: 6px;--straumur__border-radius-s: 8px;--straumur__border-radius-md: 10px;--straumur__border-radius-lg: 12px;--straumur__border-radius-xlg: 14px;--straumur__border-radius-xxlg: 16px;--straumur__space-xxs: 4px;--straumur__space-xs: 6px;--straumur__space-s: 8px;--straumur__space-md: 10px;--straumur__space-lg: 12px;--straumur__space-xlg: 14px;--straumur__space-xxlg: 16px;--straumur__space-3xlg: 18px;--straumur__space-4xlg: 20px;--straumur__space-5xlg: 24px;--straumur__space-6xlg: 32px;--straumur__space-7xlg: 40px;--straumur__space-8xlg: 48px;--apple-pay-button-width: 100%;--apple-pay-button-height: 48px;--apple-pay-button-border-radius: var(--straumur__border-radius-s)}.straumur__root-component{font-family:AkzidenzGroteskPro,sans-serif;color:var(--straumur__color-text);max-width:676px;min-width:320px;container:straumur / inline-size}.straumur__root-component[data-theme=dark]{--straumur__color-primary: #e8edf2;--straumur__color-secondary: #9aa7b5;--straumur__color-secondary-gamma: #2a313b;--straumur__color-blue-beta: #24506b;--straumur__color-blue-gamma: #1b2733;--straumur__color-neon-green-zeta: #9cbf5e;--straumur__color-red-beta: #e08a8a;--straumur__color-red-gamma: #2e2020;--straumur__color-gray-epsilon: #3a424d;--straumur__color-cosmos-blue-delta: #3a424d;--straumur__color-cosmos-blue-gamma: #262d36;--straumur__color-white: #1e232b;--straumur__color-text: #e8edf2;--straumur__color-border: #3a424d;--straumur__color-warning-text: #e6c766;--straumur__color-warning-bg: #2f2a17;--straumur__color-danger-text: #f0895f}.straumur__component *{font-family:inherit}.straumur__render-brand-icons__overflow{color:var(--straumur__color-secondary)}.straumur__component{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;min-height:300px;background-color:var(--straumur__color-white);border-radius:var(--straumur__border-radius-xxlg)}.js-iframe{border:none;color-scheme:auto;height:100%;overflow:hidden;width:100%}.adyen-checkout__threeds2__challenge.adyen-checkout__threeds2__challenge--05{background-color:transparent;display:block;height:inherit;min-height:400px;overflow:hidden;position:relative;width:100%}\\n\")","const getEnv = (): Env => {\n return {\n STAGING_BASE_URL: \"https://checkout-api.staging.straumur.is/api/v1/embeddedcheckout\",\n PRODUCTION_BASE_URL: \"https://greidslugatt.straumur.is/api/v1/embeddedcheckout\",\n\n GET_PAYMENT_METHODS_URL: \"payment-methods\",\n POST_PAYMENT_URL: \"payment\",\n POST_DETAILS_URL: \"details\",\n POST_DISABLE_TOKEN_URL: \"disable-token\",\n };\n};\n\ninterface Env {\n STAGING_BASE_URL: string;\n PRODUCTION_BASE_URL: string;\n\n GET_PAYMENT_METHODS_URL: string;\n POST_PAYMENT_URL: string;\n POST_DETAILS_URL: string;\n POST_DISABLE_TOKEN_URL: string;\n}\n\nexport const env = getEnv();\n","import { ICreateDetailsBody, ICreatePaymentBody, IGetPaymentMethodsBody, IPostDisableTokenBody } from \"./models\";\nimport { env } from \"../env\";\n\nfunction getBaseUrl(environment: \"test\" | \"live\"): string {\n switch (environment) {\n case \"test\":\n return env.STAGING_BASE_URL;\n case \"live\":\n return env.PRODUCTION_BASE_URL;\n default:\n throw new Error(`Unknown environment: ${environment}`);\n }\n}\n\nexport function getPaymentMethods(environment: \"test\" | \"live\", body: IGetPaymentMethodsBody) {\n return fetch(`${getBaseUrl(environment)}/${env.GET_PAYMENT_METHODS_URL}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n });\n}\n\nexport function createPaymentRequest(environment: \"test\" | \"live\", body: ICreatePaymentBody) {\n return fetch(`${getBaseUrl(environment)}/${env.POST_PAYMENT_URL}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n });\n}\n\nexport function createDetailsRequest(environment: \"test\" | \"live\", body: ICreateDetailsBody) {\n return fetch(`${getBaseUrl(environment)}/${env.POST_DETAILS_URL}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n });\n}\n\nexport function postDisableTokenRequest(environment: \"test\" | \"live\", body: IPostDisableTokenBody) {\n return fetch(`${getBaseUrl(environment)}/${env.POST_DISABLE_TOKEN_URL}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n });\n}\n","export const translations = {\n \"en-US\": {\n \"cards.title\": \"Card payment\",\n \"cards.cardNumber\": \"Card number\",\n \"cards.expiryDate\": \"Expiry date\",\n \"cards.securityCode3Digits\": \"Security code\",\n \"cards.securityCode3DigitsOptional\": \"Security code (optional)\",\n \"cards.securityCode3DigitsInfo\": \"3-digit on the back of the card\",\n \"cards.securityCode4DigitsInfo\": \"4-digit on the back of the card\",\n \"cards.storePaymentMethod\": \"Store payment information\",\n \"cards.saveCardDetails\": \"Save card details\",\n \"googlePay.title\": \"Google Pay\",\n \"applePay.title\": \"Apple Pay\",\n \"stored-cards.expiryDate\": \"Expiry date\",\n \"stored-cards.securityCode3Digits\": \"Security code\",\n \"stored-cards.securityCode3DigitsOptional\": \"Security code (optional)\",\n \"stored-cards.securityCode3DigitsInfo\": \"3-digit on the back of the card\",\n \"stored-cards.securityCode4DigitsInfo\": \"4-digit on the back of the card\",\n \"stored-cards.removeStoredCard\": \"Remove\",\n \"stored-cards.removeStoredCardQuestion\": \"Remove stored payment method?\",\n \"stored-cards.removeStoredCardQuestionYesRemove\": \"Yes, remove\",\n \"stored-cards.removeStoredCardQuestionCancel\": \"Cancel\",\n \"stored-cards.saveCardDetails\": \"Save card details\",\n\n \"success.paymentAuthorized\": \"Payment authorized\",\n\n \"error.unknownError\": \"Unknown error occurred\",\n \"error.failedToInitializeStraumurWebComponent\": \"Failed to initialize Straumur Web component\",\n \"error.failedToInitializePaymentMethods\": \"Failed to initialize payment methods\",\n \"error.failedToSubmitPayment\": \"Failed to submit payment\",\n \"error.paymentFailed\": \"Payment failed\",\n \"error.paymentUnsuccessful\": \"Payment unsuccessful\",\n \"error.failedToSubmitPaymentDetails\": \"Failed to submit payment details\",\n \"error.paymentDetailsFailed\": \"Payment details failed\",\n \"error.googlePayNotAvailable\": \"Google Pay not available\",\n \"error.applePayNotAvailable\": \"Apple Pay not available\",\n \"error.failedToSubmitRemoveStoredPaymentCard\": \"Failed to remove stored payment card\",\n \"error.failedToRemoveStoredPaymentCard\": \"Stored payment card was not removed\",\n },\n \"is-IS\": {\n \"cards.title\": \"Greiða með korti\",\n \"cards.cardNumber\": \"Kortanúmer\",\n \"cards.expiryDate\": \"Gildisdagur\",\n \"cards.securityCode3Digits\": \"Öryggiskóði\",\n \"cards.securityCode3DigitsOptional\": \"Öryggiskóði (valkvætt)\",\n \"cards.securityCode3DigitsInfo\": \"3 tölustafir aftan á kortinu\",\n \"cards.securityCode4DigitsInfo\": \"4 tölustafir aftan á kortinu\",\n \"cards.storePaymentMethod\": \"Vista greiðsluupplýsingar\",\n \"cards.saveCardDetails\": \"Vista kortaupplýsingar\",\n \"googlePay.title\": \"Google Pay\",\n \"applePay.title\": \"Apple Pay\",\n \"stored-cards.expiryDate\": \"Gildisdagur\",\n \"stored-cards.securityCode3Digits\": \"Öryggiskóði\",\n \"stored-cards.securityCode3DigitsOptional\": \"Öryggiskóði (valkvætt)\",\n \"stored-cards.securityCode3DigitsInfo\": \"3 tölustafir aftan á kortinu\",\n \"stored-cards.securityCode4DigitsInfo\": \"4 tölustafir aftan á kortinu\",\n \"stored-cards.removeStoredCard\": \"Fjarlægja\",\n \"stored-cards.removeStoredCardQuestion\": \"Fjarlægja geymdan greiðslumáta?\",\n \"stored-cards.removeStoredCardQuestionYesRemove\": \"Já, fjarlægja\",\n \"stored-cards.removeStoredCardQuestionCancel\": \"Hætta við\",\n \"stored-cards.saveCardDetails\": \"Vista kortaupplýsingar\",\n\n \"success.paymentAuthorized\": \"Greiðsla samþykkt\",\n\n \"error.unknownError\": \"Óþekkt villa kom upp\",\n \"error.failedToInitializeStraumurWebComponent\": \"Mistókst að sækja Straumur Web hluta\",\n \"error.failedToInitializePaymentMethods\": \"Mistókst að sækja greiðslumáta\",\n \"error.failedToSubmitPayment\": \"Mistókst að senda greiðslu\",\n \"error.paymentFailed\": \"Greiðsla mistókst\",\n \"error.paymentUnsuccessful\": \"Greiðsla ekki tekin\",\n \"error.failedToSubmitPaymentDetails\": \"Mistókst að senda greiðsluupplýsingar\",\n \"error.paymentDetailsFailed\": \"Mistókst að sækja greiðsluupplýsingar\",\n \"error.googlePayNotAvailable\": \"Google Pay ekki í boði\",\n \"error.applePayNotAvailable\": \"Apple Pay ekki í boði\",\n \"error.failedToSubmitRemoveStoredPaymentCard\": \"Mistókst að fjarlægja geymdan greiðslumáta\",\n \"error.failedToRemoveStoredPaymentCard\": \"Geymdur greiðslumáti var ekki fjarlægður\",\n },\n};\n\nexport type Language = keyof typeof translations;\nexport type TranslationKey = keyof (typeof translations)[\"en-US\"] | keyof (typeof translations)[\"is-IS\"];\n\n/** Narrows an untrusted string (e.g. a server error code) to a known translation key. */\nexport function isTranslationKey(value: unknown): value is TranslationKey {\n return typeof value === \"string\" && (value in translations[\"en-US\"] || value in translations[\"is-IS\"]);\n}\n","import { getPaymentMethods } from \"../adapter/straumur-adapter\";\nimport { isTranslationKey, TranslationKey } from \"../localizations/translations\";\nimport { StraumurCheckoutPaymentMethods, StraumurCheckoutPaymentMethodsResponse } from \"./models\";\n\nexport async function setupPaymentMethods(\n environment: \"test\" | \"live\",\n sessionId: string\n): Promise<StraumurCheckoutPaymentMethodsResponse> {\n try {\n const fetchResponse = await getPaymentMethods(environment, {\n sessionId,\n });\n\n if (!fetchResponse.ok) {\n const contentType = fetchResponse.headers.get(\"content-type\");\n let errorMessage: TranslationKey = \"error.failedToInitializePaymentMethods\";\n if (contentType && contentType.includes(\"application/json\")) {\n // The server's errorMessage is untrusted input: only adopt it when it is a known\n // translation key, otherwise the raw string would be shown to the buyer verbatim.\n const serverErrorMessage: unknown = (await fetchResponse.json()).errorMessage;\n if (isTranslationKey(serverErrorMessage)) {\n errorMessage = serverErrorMessage;\n }\n }\n\n return {\n resultCode: \"Error\",\n error: errorMessage,\n };\n }\n\n const data: StraumurCheckoutPaymentMethods = await fetchResponse.json();\n\n return {\n resultCode: \"Success\",\n ...data,\n };\n } catch {\n return {\n resultCode: \"Error\",\n error: \"error.failedToInitializePaymentMethods\",\n };\n }\n}\n","import { Language } from \"./translations\";\n\n/** The locale vocabulary of the public API: short codes only. */\nexport type PublicLocale = \"is\" | \"en\";\n\n/**\n * Normalizes a public locale to the internal BCP-47 Language.\n *\n * Tolerates the legacy full tags (\"en-US\"/\"is-IS\") at runtime — 1.x accepted them in\n * setLanguage/updateConfig and IIFE consumers get no compile-time checking — while the\n * public types narrow to short codes. Anything unrecognized falls back to Icelandic,\n * matching the constructor's historical default.\n */\nexport function normalizeLocale(locale: PublicLocale | Language | undefined): Language {\n switch (locale) {\n case \"en\":\n case \"en-US\":\n return \"en-US\";\n default:\n return \"is-IS\";\n }\n}\n","import { h } from \"preact\";\nimport { StraumurCheckoutConfiguration } from \"../models/models\";\nimport { SuccessResponse } from \"../services/models\";\nimport CardComponent from \"./card/card-component\";\nimport GooglePayComponent from \"./google-pay/google-pay-component\";\nimport ApplePayComponent from \"./apple-pay/apple-pay-component\";\nimport StoredCardContainerComponent from \"./stored-card/stored-card-container-component\";\nimport PaymentMethodGroup from \"../components/payment-method-group/payment-method-group\";\nimport ResultComponent from \"./result-component/result-component\";\nimport PaymentMethodsWrapper from \"./payment-methods-wrapper/payment-methods-wrapper\";\nimport InstantPaymentsComponent from \"./instantPayments/instant-payments-component\";\nimport { PaymentMethod } from \"../models/constants\";\nimport { SubmitApi } from \"../components/payment-method-group/payment-method-group-context\";\n\ninterface StraumurCheckoutContainerProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n onSubmitApiReady?: (api: SubmitApi) => void;\n}\n\nexport function determineInitialState(\n hasCard: boolean,\n hasGooglePay: boolean,\n hasApplePay: boolean,\n storedCount: number,\n instantPayments: StraumurCheckoutConfiguration[\"instantPayments\"]\n): { initialPaymentMethod: PaymentMethod | null; isSolePaymentMethod: boolean } {\n const gpayInStandard = hasGooglePay && !instantPayments?.some((x) => x === \"googlepay\");\n const apayInStandard = hasApplePay && !instantPayments?.some((x) => x === \"applepay\");\n\n const totalOptions = storedCount + (hasCard ? 1 : 0) + (gpayInStandard ? 1 : 0) + (apayInStandard ? 1 : 0);\n\n if (totalOptions !== 1) {\n return { initialPaymentMethod: null, isSolePaymentMethod: false };\n }\n\n if (storedCount === 1) return { initialPaymentMethod: \"storedcard\", isSolePaymentMethod: true };\n if (hasCard) return { initialPaymentMethod: \"card\", isSolePaymentMethod: true };\n if (gpayInStandard) return { initialPaymentMethod: \"googlepay\", isSolePaymentMethod: true };\n if (apayInStandard) return { initialPaymentMethod: \"applepay\", isSolePaymentMethod: true };\n\n return { initialPaymentMethod: null, isSolePaymentMethod: false };\n}\n\nfunction StraumurCheckoutContainer({\n configuration,\n paymentMethods,\n onSubmitApiReady,\n}: StraumurCheckoutContainerProps): h.JSX.Element {\n const methods = paymentMethods.paymentMethods.paymentMethods ?? [];\n const stored = paymentMethods.paymentMethods.storedPaymentMethods ?? [];\n\n const isAllowed = (method: PaymentMethod): boolean =>\n !configuration.allowedPaymentMethods || configuration.allowedPaymentMethods.includes(method);\n\n const hasCard = methods.some((x) => x.type === \"scheme\") && isAllowed(\"card\");\n const hasGooglePay = methods.some((x) => x.type === \"googlepay\") && isAllowed(\"googlepay\");\n const hasApplePay = methods.some((x) => x.type === \"applepay\") && isAllowed(\"applepay\");\n const storedCount = isAllowed(\"storedcard\") ? stored.length : 0;\n const hasStoredPaymentMethods = storedCount > 0;\n\n const { initialPaymentMethod, isSolePaymentMethod } = determineInitialState(\n hasCard,\n hasGooglePay,\n hasApplePay,\n storedCount,\n configuration.instantPayments\n );\n\n return (\n <PaymentMethodGroup\n initialValue={initialPaymentMethod}\n isSolePaymentMethod={isSolePaymentMethod}\n hasCard={hasCard}\n hasGooglePay={hasGooglePay}\n hasApplePay={hasApplePay}\n hasStoredPaymentMethods={hasStoredPaymentMethods}\n onSubmitApiReady={onSubmitApiReady}\n >\n <PaymentMethodsWrapper>\n <InstantPaymentsComponent configuration={configuration} paymentMethods={paymentMethods} />\n <StoredCardContainerComponent configuration={configuration} paymentMethods={paymentMethods} />\n <CardComponent configuration={configuration} paymentMethods={paymentMethods} />\n <GooglePayComponent configuration={configuration} paymentMethods={paymentMethods} />\n <ApplePayComponent configuration={configuration} paymentMethods={paymentMethods} />\n </PaymentMethodsWrapper>\n\n <ResultComponent />\n </PaymentMethodGroup>\n );\n}\n\nexport default StraumurCheckoutContainer;\n","import { h } from \"preact\";\nimport { useState } from \"preact/hooks\";\nimport \"./card-component.css\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport CardIcon from \"../../assets/icons/card\";\nimport { BrandHidden, RenderBrandIcons } from \"../../utils/renderBrandIcons\";\nimport { CardComponentProps } from \"./models\";\nimport CardForm from \"../../components/card-form/card-form\";\nimport PaymentMethodItem from \"../../components/payment-method-item/payment-method-item\";\n\nfunction CardComponent({ configuration, paymentMethods }: CardComponentProps): h.JSX.Element | null {\n const { i18n } = useI18n();\n const [brandHidden, setBrandHidden] = useState<BrandHidden[]>([]);\n const { activePaymentMethod, setActivePaymentMethod, isObscuredByThreeDS, isSolePaymentMethod, hasCard } =\n usePaymentMethodGroup();\n\n if (!hasCard || isObscuredByThreeDS(\"card\")) {\n return null;\n }\n\n const schemeBrands = paymentMethods.paymentMethods.paymentMethods!.find((x) => x.type === \"scheme\")!.brands!;\n\n const brands = schemeBrands.map((x) => {\n return { brand: x, brandFullName: x };\n });\n\n return (\n <PaymentMethodItem\n icon={<CardIcon />}\n title={i18n.t(\"cards.title\")}\n isActive={activePaymentMethod === \"card\"}\n isSole={isSolePaymentMethod}\n onChange={() => setActivePaymentMethod(\"card\")}\n headerRight={\n <span className=\"straumur__card-component--brands\">\n <RenderBrandIcons brands={brands} brandHidden={brandHidden} />\n </span>\n }\n >\n <CardForm configuration={configuration} paymentMethods={paymentMethods} onBrandHidden={setBrandHidden} />\n </PaymentMethodItem>\n );\n}\n\nexport default CardComponent;\n","import styleInject from '#style-inject';styleInject(\".straumur__card-component--brands{display:flex;margin-left:auto;align-items:center;gap:var(--straumur__space-xxs)}.straumur__card-component__expandable{background:var(--straumur__color-white)}.straumur__card-component__loading-text{display:flex;justify-content:center}.straumur__card-component__form{display:flex;padding-top:var(--straumur__space-xxlg);flex-direction:column;gap:var(--straumur__space-5xlg)}.straumur__card-component__form--wrapper{display:flex;flex-direction:column;justify-items:start;position:relative;width:100%}.straumur__card-component__form--wrapper--error{color:var(--straumur__color-red-beta);font-size:12px}.straumur__card-component__form--wrapper--label{transform:translate(var(--straumur__space-md)) translateY(-50%);z-index:1;background:linear-gradient(to top,var(--straumur__color-secondary-gamma) 53%,var(--straumur__color-transparent) 50%);position:absolute;font-weight:500;font-size:14px;padding:0 var(--straumur__space-xxs)}.straumur__card-component__form--wrapper--label--error{color:var(--straumur__color-red-beta);background:linear-gradient(to top,var(--straumur__color-red-gamma) 53%,var(--straumur__color-transparent) 50%)}.straumur__card-component__form--wrapper--label--info{position:absolute;top:33%;right:var(--straumur__space-md)}.straumur__card-component__form--wrapper--input{background:var(--straumur__color-secondary-gamma);color:var(--straumur__color-text);display:block;font-family:inherit;border:1px solid var(--straumur__color-transparent);border-radius:var(--straumur__border-radius-s);font-size:16px;height:48px;outline:none;padding-left:var(--straumur__space-lg);transition:border .2s ease-out,box-shadow .2s ease-out}.straumur__card-component__form--wrapper--input:hover{border:1px solid var(--straumur__color-cosmos-blue-delta)}.straumur__card-component__form--wrapper--input--error{background:var(--straumur__color-red-gamma);border:1px solid var(--straumur__color-red-beta)}.straumur__card-component__form--wrapper--input--error:hover{border:1px solid var(--straumur__color-red-beta)}.straumur__card-component__form--field-wrapper{display:flex;width:100%;gap:var(--straumur__space-lg)}.straumur__card-component__submit-button{background:var(--straumur__color-primary);border:none;border-radius:var(--straumur__border-radius-s);color:var(--straumur__color-white);cursor:pointer;font-size:16px;height:40px;outline:none;padding:0 var(--straumur__space-xxlg);transition:background .2s ease-out;width:100%}.straumur__card-component__submit-button:hover{background:var(--straumur__color-primary);border:1px solid var(--straumur__color-border)}.straumur__card-component__submit-button:disabled{background:var(--straumur__color-secondary);border:1px solid var(--straumur__color-border);cursor:not-allowed}.straumur__card-component__form--wrapper--label-checkbox{height:38px;display:flex;align-items:center;padding:8px;gap:var(--straumur__space-s);border-radius:var(--straumur__border-radius-s);cursor:pointer;user-select:none;transition:background-color .25s ease-in-out}.straumur__card-component__form--wrapper--label-checkbox:hover{background-color:var(--straumur__color-blue-gamma)}.straumur__card-component__form--wrapper--label-checkbox:hover .straumur__card-component__form--wrapper--label-checkbox--checkmark{border:1px solid var(--straumur__color-cosmos-blue-delta)}.straumur__card-component__form--wrapper--label-checkbox--checkmark{height:var(--straumur__space-5xlg);width:var(--straumur__space-5xlg);background-color:var(--straumur__color-secondary-gamma);border-radius:var(--straumur__border-radius-xxs);flex-shrink:0;border:1px solid var(--straumur__color-transparent);transition:all .2s ease-in}.straumur__card-component__form--wrapper--label-checkbox:hover .straumur__card-component__form--wrapper--label-checkbox--checkmark.straumur__card-component__form--wrapper--label-checkbox--checkmark--checked{border:1px solid var(--straumur__color-transparent)}.straumur__card-component__form--wrapper--label-checkbox--checkmark--checked{background-color:var(--straumur__color-blue-beta)}.straumur__card-component__form--wrapper--label-checkbox--checkmark--icon{height:100%;display:flex;justify-content:center;align-items:center;font-size:9px;opacity:0;visibility:hidden;transition:all .2s ease-in}.straumur__card-component__form--wrapper--label-checkbox--checkmark--icon--checked{opacity:1;visibility:visible}.straumur__card-component__form--wrapper--label-checkbox--checkbox{display:none}.js-iframe{border:none;color-scheme:auto;height:100%;overflow:hidden;width:100%}.straumur__card-component__dual-branding{display:grid;grid-template-columns:1fr 1fr;gap:var(--straumur__space-lg)}.straumur__card-component__dual-branding--logo{display:flex;align-items:center;padding:var(--straumur__space-xs);border:1px solid var(--straumur__color-secondary-gamma);border-radius:var(--straumur__border-radius-s)}.straumur__card-component__dual-branding--logo--item{display:flex;pointer-events:none}.straumur__card-component__dual-branding--logo--selected{border:1px solid var(--straumur__color-cosmos-blue-delta);justify-content:space-between}\\n\")","import { h } from \"preact\";\nimport { createContext, ComponentChildren } from \"preact\";\nimport { useState, useContext, useCallback, useRef, useLayoutEffect } from \"preact/hooks\";\nimport { PaymentMethod } from \"../../models/constants\";\nimport { ResultMessage } from \"../../models/models\";\n\n/** A submit trigger registered by the active card-type component. May be async — see SubmitApi. */\nexport type SubmitHandler = () => void | Promise<void>;\n\nexport type SubmitApi = {\n /**\n * Invokes the active card form's submit handler. The boolean only says a handler existed\n * and was invoked — the submission itself runs asynchronously and reports its outcome\n * through onPaymentCompleted/onPaymentFailed.\n */\n triggerSubmit: () => boolean;\n};\n\ntype PaymentMethodContextType = {\n activePaymentMethod: PaymentMethod | null;\n setActivePaymentMethod: (value: PaymentMethod | null) => void;\n activeStoredPaymentMethodId: string | null;\n setActiveStoredPaymentMethodId: (value: string) => void;\n isPaymentMethodInitialized: Record<PaymentMethod, boolean>;\n updatePaymentMethodInitialization: (paymentMethod: PaymentMethod, isInitialized: boolean) => void;\n isStoredCardInitialized: Record<string, boolean>;\n updateStoredCardInitialization: (storedPaymentMethod: string, isInitialized: boolean) => void;\n handleSuccess: (success: ResultMessage) => void;\n success: ResultMessage | null;\n handleError: (error: ResultMessage) => void;\n error: ResultMessage | null;\n threeDSecureActive: boolean;\n setThreeDSecureActive: (value: boolean) => void;\n /**\n * True while a 3DS challenge run by ANOTHER payment method takes over the widget —\n * the asking component must render nothing. Components matching a specific stored card\n * additionally check their own card id (see stored-card-component).\n */\n isObscuredByThreeDS: (method: PaymentMethod) => boolean;\n isSolePaymentMethod: boolean;\n hasCard: boolean;\n hasGooglePay: boolean;\n hasApplePay: boolean;\n hasStoredPaymentMethods: boolean;\n registerSubmitHandler: (handler: SubmitHandler) => void;\n unregisterSubmitHandler: (handler: SubmitHandler) => void;\n};\n\nconst PaymentMethodContext = createContext<PaymentMethodContextType | undefined>(undefined);\n\nconst defaultIsInitialized: Record<PaymentMethod, boolean> = {\n card: false,\n storedcard: false,\n googlepay: false,\n applepay: false,\n};\n\nexport const PaymentMethodGroupContext = ({\n children,\n initialValue,\n isSolePaymentMethod,\n hasCard,\n hasGooglePay,\n hasApplePay,\n hasStoredPaymentMethods,\n onSubmitApiReady,\n}: {\n children: ComponentChildren;\n initialValue: PaymentMethod | null;\n isSolePaymentMethod: boolean;\n hasCard: boolean;\n hasGooglePay: boolean;\n hasApplePay: boolean;\n hasStoredPaymentMethods: boolean;\n onSubmitApiReady?: (api: SubmitApi) => void;\n}): h.JSX.Element => {\n const [activePaymentMethod, setActivePaymentMethod] = useState(initialValue);\n const activeSubmitHandlerRef = useRef<SubmitHandler | null>(null);\n\n const registerSubmitHandler = useCallback((handler: SubmitHandler): void => {\n activeSubmitHandlerRef.current = handler;\n }, []);\n\n const unregisterSubmitHandler = useCallback((handler: SubmitHandler): void => {\n // Identity check guards against effect-cleanup ordering races when switching\n // between card-type payment methods: an outgoing form's cleanup must not\n // clobber a handler an incoming form already registered.\n if (activeSubmitHandlerRef.current === handler) {\n activeSubmitHandlerRef.current = null;\n }\n }, []);\n\n const triggerSubmit = useCallback((): boolean => {\n const handler = activeSubmitHandlerRef.current;\n\n if (!handler) {\n return false;\n }\n\n handler();\n return true;\n }, []);\n\n useLayoutEffect(() => {\n onSubmitApiReady?.({ triggerSubmit });\n }, []);\n const [activeStoredPaymentMethodId, setActiveStoredPaymentMethodId] = useState<string | null>(null);\n const [threeDSecureActive, setThreeDSecureActive] = useState<boolean>(false);\n const [isPaymentMethodInitialized, setIsPaymentMethodInitialized] = useState(defaultIsInitialized);\n const [isStoredCardInitialized, setIsStoredCardInitialized] = useState<Record<string, boolean>>({});\n\n const [success, setSuccess] = useState<ResultMessage | null>(null);\n const [error, setError] = useState<ResultMessage | null>(null);\n\n const updatePaymentMethodInitialization = (paymentMethod: PaymentMethod, isInitialized: boolean) => {\n setIsPaymentMethodInitialized((prevState) => ({\n ...prevState,\n [paymentMethod]: isInitialized,\n }));\n };\n\n const updateStoredCardInitialization = (storedPaymentMethod: string, isInitialized: boolean) => {\n setIsStoredCardInitialized((prevState) => ({\n ...prevState,\n [storedPaymentMethod]: isInitialized,\n }));\n };\n\n const isObscuredByThreeDS = useCallback(\n (method: PaymentMethod): boolean => threeDSecureActive && activePaymentMethod !== method,\n [threeDSecureActive, activePaymentMethod]\n );\n\n const handleError = (error: ResultMessage) => {\n setError(error);\n };\n\n const handleSuccess = (success: ResultMessage) => {\n setSuccess(success);\n };\n\n return (\n <PaymentMethodContext.Provider\n value={{\n activePaymentMethod,\n setActivePaymentMethod,\n activeStoredPaymentMethodId,\n setActiveStoredPaymentMethodId,\n isPaymentMethodInitialized,\n updatePaymentMethodInitialization,\n isStoredCardInitialized,\n updateStoredCardInitialization,\n handleSuccess,\n success,\n handleError,\n error,\n threeDSecureActive,\n setThreeDSecureActive,\n isObscuredByThreeDS,\n isSolePaymentMethod,\n hasCard,\n hasGooglePay,\n hasApplePay,\n hasStoredPaymentMethods,\n registerSubmitHandler,\n unregisterSubmitHandler,\n }}\n >\n {children}\n </PaymentMethodContext.Provider>\n );\n};\n\nexport const usePaymentMethodGroup = (): PaymentMethodContextType => {\n const context = useContext(PaymentMethodContext);\n if (context === undefined) {\n throw new Error(\"usePaymentMethodGroup must be used within a PaymentMethodGroup\");\n }\n return context as PaymentMethodContextType;\n};\n","import { h } from \"preact\";\nimport { createContext, ComponentChildren } from \"preact\";\nimport { useContext } from \"preact/hooks\";\nimport { Language } from \"./translations\";\nimport { I18nService } from \"./i18n-service\";\n\ntype I18nContextType = {\n i18n: I18nService;\n changeLanguage: (language: Language) => void;\n};\n\nconst I18nContext = createContext<I18nContextType | undefined>(undefined);\n\nexport const I18nProvider = ({\n children,\n i18nService,\n onLanguageChange,\n}: {\n children: ComponentChildren;\n i18nService: I18nService; // Use existing instance from StraumurCheckout\n onLanguageChange?: (language: Language) => void;\n}): h.JSX.Element => {\n const changeLanguage = (newLanguage: Language) => {\n i18nService.setLanguage(newLanguage);\n onLanguageChange?.(newLanguage);\n };\n\n return <I18nContext.Provider value={{ i18n: i18nService, changeLanguage }}>{children}</I18nContext.Provider>;\n};\n\nexport const useI18n = (): I18nContextType => {\n const context = useContext(I18nContext);\n if (!context) {\n throw new Error(\"useI18n must be used within an I18nProvider\");\n }\n return context;\n};\n","import { h } from \"preact\";\n\nconst CardIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path d=\"M24 11H0V7H24V11Z\" fill=\"currentColor\" />\n <path\n opacity=\"0.4\"\n d=\"M21.3333 3C22.8042 3 24 4.19375 24 5.66667V7H0V5.66667C0 4.19375 1.19375 3 2.66667 3H21.3333ZM24 19C24 20.4708 22.8042 21.6667 21.3333 21.6667H2.66667C1.19375 21.6667 0 20.4708 0 19V11H24V19ZM4.66667 16.3333C4.3 16.3333 4 16.6333 4 17C4 17.3667 4.3 17.6667 4.66667 17.6667H7.33333C7.7 17.6667 8 17.3667 8 17C8 16.6333 7.7 16.3333 7.33333 16.3333H4.66667ZM10 17.6667H15.3333C15.7 17.6667 16 17.3667 16 17C16 16.6333 15.7 16.3333 15.3333 16.3333H10C9.63333 16.3333 9.33333 16.6333 9.33333 17C9.33333 17.3667 9.63333 17.6667 10 17.6667Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nexport default CardIcon;\n","import { Fragment, h } from \"preact\";\nimport MasterCardIcon from \"../assets/icons/mastercard\";\nimport VisaIcon from \"../assets/icons/visa\";\nimport MaestroIcon from \"../assets/icons/maestro\";\nimport AmexIcon from \"../assets/icons/amex\";\nimport JcbIcon from \"../assets/icons/jcb\";\nimport DinersIcon from \"../assets/icons/diners\";\nimport DiscoverIcon from \"../assets/icons/discover\";\nimport CupIcon from \"../assets/icons/cup\";\nimport { Tooltip } from \"../components/tooltip/tooltip\";\nimport { useMediaQuery } from \"./custom-hooks/use-media-query\";\n\ninterface BrandIcon {\n brand: string;\n brandFullName: string;\n}\n\nexport interface BrandHidden {\n brand: string;\n}\n\ninterface RenderBrandIconsProps {\n brands: BrandIcon[];\n brandHidden?: BrandHidden[];\n limit?: number;\n}\n\nexport function RenderBrandIcons({ brands, brandHidden = [], limit = 3 }: RenderBrandIconsProps): h.JSX.Element {\n const isWidth380 = useMediaQuery(\"(max-width: 380px)\");\n const isWidth335 = useMediaQuery(\"(max-width: 335px)\");\n const widthLimit = isWidth335 ? 1 : isWidth380 ? 2 : limit;\n\n const brandToShow = brands.filter((brand) => {\n const { brand: brandName } = brand;\n const hidden = brandHidden.some((x) => x.brand === brandName);\n\n return !hidden;\n });\n\n return (\n <Fragment>\n {brandToShow.map(({ brand }, index) => {\n if (index >= Math.min(limit, widthLimit)) {\n if (index === Math.min(limit, widthLimit)) {\n return (\n <Tooltip\n content={\n <span style={{ display: \"flex\", gap: \"4px\", overflow: \"visible\" }}>\n {brandToShow.slice(Math.min(limit, widthLimit)).map(({ brand }) => (\n <RenderBrandIcon key={brand} brand={brand} />\n ))}\n </span>\n }\n >\n <span key={brand} className=\"straumur__render-brand-icons__overflow\">\n +{brandToShow.length - Math.min(limit, widthLimit)}\n </span>\n </Tooltip>\n );\n }\n return null;\n }\n\n return <RenderBrandIcon key={brand} brand={brand} />;\n })}\n </Fragment>\n );\n}\n\nexport const RenderBrandIcon = ({\n brand,\n defaultToBrandName = true,\n}: {\n brand: string;\n defaultToBrandName?: boolean;\n}): h.JSX.Element => {\n switch (brand) {\n case \"visa\":\n return <VisaIcon />;\n case \"mc\":\n return <MasterCardIcon />;\n case \"maestro\":\n return <MaestroIcon />;\n case \"amex\":\n return <AmexIcon />;\n case \"jcb\":\n return <JcbIcon />;\n case \"diners\":\n return <DinersIcon />;\n case \"discover\":\n return <DiscoverIcon />;\n case \"cup\":\n return <CupIcon />;\n default:\n if (defaultToBrandName) {\n return <span>{brand}</span>;\n }\n return <Fragment></Fragment>;\n }\n};\n","import { h } from \"preact\";\n\ninterface MasterCardIconProps {\n opacity?: number;\n}\n\nconst MasterCardIcon = ({ opacity = 1 }: MasterCardIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" viewBox=\"0 0 40 26\" opacity={opacity}>\n <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />\n <path fill=\"#F06022\" d=\"M16.13 19.29h7.74V6.7h-7.74v12.58z\" />\n <path\n fill=\"#EA1D25\"\n d=\"M16.93 13A7.93 7.93 0 0 1 20 6.71a8.02 8.02 0 0 0-10.65.65 7.96 7.96 0 0 0 0 11.28 8.02 8.02 0 0 0 10.65.65A8.02 8.02 0 0 1 16.93 13\"\n />\n <path\n fill=\"#F79D1D\"\n d=\"M33 13c0 2.12-.84 4.15-2.34 5.65a8.1 8.1 0 0 1-10.66.64A8.05 8.05 0 0 0 23.07 13 7.96 7.96 0 0 0 20 6.71a8.02 8.02 0 0 1 10.66.64A7.93 7.93 0 0 1 33 13\"\n />\n </svg>\n);\n\nexport default MasterCardIcon;\n","import { h } from \"preact\";\n\ninterface VisaIconProps {\n opacity?: number;\n}\n\nconst VisaIcon = ({ opacity = 1 }: VisaIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" fill=\"none\" viewBox=\"0 0 40 26\" opacity={opacity}>\n <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />\n <path\n fill=\"#1434CB\"\n d=\"m15.9 7.7-4.43 10.6h-2.9l-2.2-8.47c-.13-.52-.25-.71-.65-.93C5.05 8.55 3.96 8.2 3 8l.07-.32h4.67c.6 0 1.13.4 1.27 1.09l1.15 6.14 2.86-7.23h2.89Zm11.39 7.15c0-2.8-3.88-2.96-3.85-4.21 0-.38.37-.79 1.16-.9a5.2 5.2 0 0 1 2.71.48l.48-2.25a7.4 7.4 0 0 0-2.57-.47c-2.71 0-4.62 1.44-4.64 3.51-.02 1.53 1.36 2.38 2.4 2.9 1.08.51 1.44.85 1.43 1.31 0 .71-.85 1.03-1.64 1.04-1.39.02-2.19-.37-2.82-.67l-.5 2.33c.64.29 1.82.55 3.05.56 2.89 0 4.78-1.42 4.79-3.63Zm7.17 3.46H37L34.78 7.7h-2.34c-.53 0-.98.3-1.17.78l-4.12 9.84h2.88l.57-1.58h3.53l.33 1.58Zm-3.07-3.76 1.45-3.99.83 4H31.4ZM19.83 7.7l-2.27 10.62h-2.74L17.09 7.7h2.74Z\"\n />\n </svg>\n);\n\nexport default VisaIcon;\n","import { h } from \"preact\";\n\ninterface MaestroIconProps {\n opacity?: number;\n}\n\nconst MaestroIcon = ({ opacity = 1 }: MaestroIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" fill=\"none\" viewBox=\"0 0 40 26\" opacity={opacity}>\n <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />\n <path fill=\"#7773B4\" d=\"M16.13 19.29h7.74V6.7h-7.74v12.58z\" />\n <path\n fill=\"#EA1D25\"\n d=\"M16.93 13A7.93 7.93 0 0 1 20 6.71a8.02 8.02 0 0 0-10.65.65 7.96 7.96 0 0 0 0 11.28 8.02 8.02 0 0 0 10.65.65A8.02 8.02 0 0 1 16.93 13\"\n />\n <path\n fill=\"#139FDA\"\n d=\"M33 13c0 2.12-.84 4.15-2.34 5.65a8.1 8.1 0 0 1-10.66.64A8.05 8.05 0 0 0 23.07 13 7.96 7.96 0 0 0 20 6.71a8.02 8.02 0 0 1 10.66.64A7.93 7.93 0 0 1 33 13\"\n />\n </svg>\n);\n\nexport default MaestroIcon;\n","import { h } from \"preact\";\n\ninterface AmexIconProps {\n opacity?: number;\n}\n\nconst AmexIcon = ({ opacity = 1 }: AmexIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 40 26\" width=\"40\" height=\"26\" opacity={opacity}>\n <path fill=\"#016FD0\" d=\"M0 26h40V0H0v26z\" />\n <path\n fill=\"#fff\"\n fill-rule=\"evenodd\"\n d=\"M30.69 13.63v1.64h-4.17v1.14h4.07v1.64h-4.07v1.12h4.17v1.66l3.38-3.6-3.38-3.6zm-1.1-6.14-1.4-3.19h-4l-4.1 9.32h3.33v8.27l10.28.01 1.61-1.8 1.63 1.8H40v-2.63l-1.92-2.06L40 15.16v-2.59l-1.93.01V7.6l-1.81 4.98H34.5l-1.86-5v5h-4.2l-.6-1.46h-3.3l-.6 1.46h-2.22l3.23-7.27V5.3h2.55l3.19 7.21V5.3l3.1.01 1.6 4.47 1.62-4.48H40v-1h-3.77l-.85 2.39-.85-2.39h-4.94v3.19zm-5.06 6.11v7.27h6.16v-.01h2.54l2.1-2.32 2.12 2.32H40v-.1l-3.34-3.53L40 13.65v-.05h-2.52l-2.1 2.3-2.08-2.3h-8.77zm.7-4.11.96-2.31.97 2.31h-1.93z\"\n />\n </svg>\n);\n\nexport default AmexIcon;\n","import { h } from \"preact\";\n\ninterface JcbIconProps {\n opacity?: number;\n}\n\nconst JcbIcon = ({ opacity = 1 }: JcbIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" fill=\"none\" viewBox=\"0 0 40 26\" opacity={opacity}>\n <g clip-path=\"url(#a)\">\n <path fill=\"#fff\" d=\"M0 0h40v26H0V0Z\" />\n <path fill=\"#fff\" d=\"M36.6 20.66a5.22 5.22 0 0 1-5.22 5.22H3V5.22A5.22 5.22 0 0 1 8.22 0H36.6v20.66Z\" />\n <path\n fill=\"url(#b)\"\n d=\"M27.36 15.36h2.15l.27-.02a.96.96 0 0 0 .76-.96 1 1 0 0 0-.76-.97c-.06-.02-.19-.02-.27-.02h-2.15v1.97Z\"\n />\n <path\n fill=\"url(#c)\"\n d=\"M29.27 1.75a3.74 3.74 0 0 0-3.74 3.73v3.89h5.28c.12 0 .26 0 .37.02 1.19.06 2.07.67 2.07 1.74 0 .84-.6 1.56-1.7 1.7v.05c1.2.08 2.13.76 2.13 1.8 0 1.13-1.03 1.87-2.38 1.87h-5.8v7.6H31a3.74 3.74 0 0 0 3.73-3.74V1.75h-5.46Z\"\n />\n <path\n fill=\"url(#d)\"\n d=\"M30.27 11.38c0-.5-.35-.82-.76-.89l-.2-.02h-1.95v1.81h1.95c.06 0 .18 0 .2-.02a.87.87 0 0 0 .76-.88Z\"\n />\n <path\n fill=\"url(#e)\"\n d=\"M8.6 1.75a3.74 3.74 0 0 0-3.73 3.73v9.22a7.4 7.4 0 0 0 3.22.85c1.3 0 2-.78 2-1.85V9.34h3.2v4.34c0 1.68-1.05 3.06-4.6 3.06-2.16 0-3.84-.47-3.84-.47v7.86h5.48a3.74 3.74 0 0 0 3.74-3.74V1.75H8.6Z\"\n />\n <path\n fill=\"url(#f)\"\n d=\"M18.94 1.75a3.74 3.74 0 0 0-3.74 3.73v4.9c.94-.8 2.59-1.32 5.24-1.2 1.41.06 2.93.45 2.93.45v1.58a7.1 7.1 0 0 0-2.83-.82c-2.01-.14-3.23.84-3.23 2.57 0 1.74 1.22 2.73 3.23 2.57a7.46 7.46 0 0 0 2.83-.82v1.58s-1.5.39-2.93.45c-2.65.12-4.3-.4-5.24-1.2v8.63h5.48a3.74 3.74 0 0 0 3.74-3.74V1.75h-5.48Z\"\n />\n </g>\n <defs>\n <linearGradient id=\"b\" x1=\"25.52\" x2=\"34.75\" y1=\"14.38\" y2=\"14.38\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#007940\" />\n <stop offset=\".23\" stop-color=\"#00873F\" />\n <stop offset=\".74\" stop-color=\"#40A737\" />\n <stop offset=\"1\" stop-color=\"#5CB531\" />\n </linearGradient>\n <linearGradient id=\"c\" x1=\"25.52\" x2=\"34.75\" y1=\"12.94\" y2=\"12.94\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#007940\" />\n <stop offset=\".23\" stop-color=\"#00873F\" />\n <stop offset=\".74\" stop-color=\"#40A737\" />\n <stop offset=\"1\" stop-color=\"#5CB531\" />\n </linearGradient>\n <linearGradient id=\"d\" x1=\"25.52\" x2=\"34.75\" y1=\"11.37\" y2=\"11.37\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#007940\" />\n <stop offset=\".23\" stop-color=\"#00873F\" />\n <stop offset=\".74\" stop-color=\"#40A737\" />\n <stop offset=\"1\" stop-color=\"#5CB531\" />\n </linearGradient>\n <linearGradient id=\"e\" x1=\"4.86\" x2=\"14.24\" y1=\"12.94\" y2=\"12.94\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#1F286F\" />\n <stop offset=\".48\" stop-color=\"#004E94\" />\n <stop offset=\".83\" stop-color=\"#0066B1\" />\n <stop offset=\"1\" stop-color=\"#006FBC\" />\n </linearGradient>\n <linearGradient id=\"f\" x1=\"15.15\" x2=\"24.25\" y1=\"12.94\" y2=\"12.94\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#6C2C2F\" />\n <stop offset=\".17\" stop-color=\"#882730\" />\n <stop offset=\".57\" stop-color=\"#BE1833\" />\n <stop offset=\".86\" stop-color=\"#DC0436\" />\n <stop offset=\"1\" stop-color=\"#E60039\" />\n </linearGradient>\n <clipPath id=\"a\">\n <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nexport default JcbIcon;\n","import { h } from \"preact\";\n\ninterface DinersIconProps {\n opacity?: number;\n}\n\nconst DinersIcon = ({ opacity = 1 }: DinersIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 40 26\" width=\"40\" height=\"26\" opacity={opacity}>\n <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />\n <g fill=\"#1a1918\">\n <path d=\"M5.96 15.58c0-.56-.3-.52-.58-.53v-.16H7.2a2.28 2.28 0 0 1 2.5 2.2c0 .61-.36 2.17-2.57 2.17H5.38v-.16c.38-.04.56-.05.58-.48zm.61 2.94c0 .49.35.54.65.54a1.75 1.75 0 0 0 1.8-1.95 1.88 1.88 0 0 0-1.96-2.02c-.26 0-.37.02-.49.02zm3.36.58h.12c.17 0 .3 0 .3-.2v-1.7c0-.28-.1-.32-.33-.44v-.1l.67-.23a.22.22 0 0 1 .11-.03c.03 0 .05.04.05.09v2.4c0 .21.13.21.3.21h.11v.16H9.93zm.67-3.67a.3.3 0 0 1 0-.61.3.3 0 0 1 .3.3.31.31 0 0 1-.3.31zm1.26 1.8c0-.23-.07-.3-.36-.41v-.12a8.44 8.44 0 0 0 .82-.3c.02 0 .04.01.04.06v.4a1.83 1.83 0 0 1 1.08-.46c.53 0 .72.39.72.88v1.61c0 .21.14.21.31.21h.12v.16h-1.34v-.16h.11c.18 0 .3 0 .3-.2v-1.63c0-.36-.22-.53-.57-.53a1.66 1.66 0 0 0-.73.3v1.85c0 .21.14.21.31.21h.12v.16h-1.34v-.16h.1c.18 0 .3 0 .3-.2v-1.67m3.21.3a1.55 1.55 0 0 0 0 .37 1.05 1.05 0 0 0 .92 1.08 1.2 1.2 0 0 0 .85-.42l.08.09a1.47 1.47 0 0 1-1.15.7 1.26 1.26 0 0 1-1.2-1.36c0-1.23.83-1.6 1.27-1.6a1 1 0 0 1 1.05 1 .74.74 0 0 1 0 .1l-.06.04zm1.11-.2c.16 0 .18-.08.18-.16a.53.53 0 0 0-.55-.57c-.38 0-.64.28-.72.73zm.86 1.77h.17c.17 0 .3 0 .3-.2v-1.77c0-.2-.23-.23-.33-.28v-.1c.46-.19.7-.35.77-.35.03 0 .05.02.05.08v.56H18c.16-.24.42-.64.8-.64a.34.34 0 0 1 .36.33.3.3 0 0 1-.3.32c-.19 0-.19-.15-.4-.15a.53.53 0 0 0-.46.52v1.47c0 .21.12.21.3.21h.35v.16h-.88a26 26 0 0 0-.74 0zm2.41-.7a.83.83 0 0 0 .78.76.44.44 0 0 0 .51-.45c0-.74-1.36-.5-1.36-1.5a.86.86 0 0 1 .97-.81 1.64 1.64 0 0 1 .71.18l.04.64h-.14a.64.64 0 0 0-.68-.62.44.44 0 0 0-.49.41c0 .74 1.45.51 1.45 1.5 0 .4-.33.85-1.07.85a1.64 1.64 0 0 1-.77-.22l-.07-.72.12-.03m7.44-2.37h-.15A1.2 1.2 0 0 0 25.39 15a1.79 1.79 0 0 0-1.77 2 2.04 2.04 0 0 0 1.87 2.17 1.27 1.27 0 0 0 1.25-1.09l.15.04-.15.91a3.5 3.5 0 0 1-1.38.34A2.23 2.23 0 0 1 22.97 17a2.3 2.3 0 0 1 2.37-2.2 4.5 4.5 0 0 1 1.48.33l.06.9m.22 3.07h.13c.17 0 .3 0 .3-.2v-3.5c0-.4-.1-.42-.34-.49v-.1a3.96 3.96 0 0 0 .65-.27.66.66 0 0 1 .14-.07c.03 0 .05.04.05.1v4.32c0 .21.13.21.3.21h.12v.16H27.1zm4.02-.18c0 .11.07.12.18.12h.25v.12a6.33 6.33 0 0 0-.9.2l-.03-.02v-.5a1.69 1.69 0 0 1-1.11.52.68.68 0 0 1-.69-.75v-1.6c0-.17-.02-.32-.37-.35v-.12l.8-.05c.07 0 .07.05.07.18v1.62c0 .19 0 .73.55.73a1.4 1.4 0 0 0 .75-.38v-1.7c0-.12-.3-.18-.52-.25v-.11c.56-.04.91-.09.97-.09.05 0 .05.05.05.11zm1.25-2.07a1.58 1.58 0 0 1 .93-.45 1.22 1.22 0 0 1 1.16 1.31 1.58 1.58 0 0 1-1.5 1.65 1.84 1.84 0 0 1-.86-.22l-.19.14-.13-.07a7.37 7.37 0 0 0 .09-1.11v-2.7c0-.4-.1-.42-.33-.49v-.1a3.93 3.93 0 0 0 .64-.27.67.67 0 0 1 .14-.07c.04 0 .05.04.05.1zm0 1.7a.67.67 0 0 0 .64.64c.67 0 .95-.65.95-1.21a1.2 1.2 0 0 0-1-1.24.96.96 0 0 0-.6.3v1.51zM5.38 22.91h.04c.13 0 .26-.02.26-.2v-1.78c0-.18-.13-.2-.26-.2h-.04v-.1l.5.01.54-.01v.1h-.05c-.12 0-.25.02-.25.2v1.79c0 .17.13.19.25.19h.05v.1L5.88 23l-.5.01z\" />\n <path d=\"M6.42 23.03 5.88 23l-.5.02h-.02v-.14h.06c.13 0 .24 0 .24-.17v-1.8c0-.16-.11-.17-.24-.17h-.06v-.13h1.07v.13h-.06c-.13 0-.24.01-.24.18v1.79c0 .16.11.17.24.17h.06v.14zM6.4 23v-.08h-.03c-.12 0-.27-.02-.27-.2v-1.8c0-.18.15-.2.27-.2h.03v-.07h-1v.07h.03c.13 0 .27.02.27.2v1.8c0 .18-.14.2-.27.2H5.4V23l.49-.02.52.02zm2.35-.66h.01v-1.29a.28.28 0 0 0-.3-.32H8.4v-.1l.48.01.42-.01v.1h-.06c-.14 0-.3.03-.3.44v1.55a2.27 2.27 0 0 0 .02.34h-.13L7.07 21.1v1.41c0 .3.06.4.32.4h.06v.1L7 23l-.47.01v-.1h.05c.24 0 .3-.16.3-.43v-1.44a.3.3 0 0 0-.3-.3h-.05v-.11l.4.01.3-.01 1.51 1.71\" />\n <path d=\"M8.95 23.08h-.14l-1.73-1.94v1.37c0 .3.05.38.3.38h.08v.14h-.01L7 23l-.47.02h-.01v-.14h.06c.23 0 .3-.14.3-.41v-1.44a.3.3 0 0 0-.3-.3h-.06v-.12h.72l1.5 1.69v-1.26c0-.27-.19-.3-.29-.3h-.09v-.13h.94v.13h-.07c-.14 0-.28.01-.28.42v1.55a2.27 2.27 0 0 0 .02.34v.02zm-.13-.03h.11a2.3 2.3 0 0 1-.01-.33v-1.55c0-.41.17-.45.31-.45h.04v-.07H8.4v.07h.06a.3.3 0 0 1 .32.33v1.3h-.02v.01l-1.52-1.71h-.68v.07h.03a.32.32 0 0 1 .32.32v1.44c0 .27-.07.44-.32.45h-.03V23l.45-.02.42.02v-.07H7.4c-.27 0-.34-.12-.34-.42v-1.44l1.77 1.98zm-.07-.71.01-.01v.01zm0 0v-.01zM9.8 20.8c-.26 0-.27.06-.32.31h-.1l.04-.29a2.04 2.04 0 0 0 .02-.29h.08c.03.1.11.1.2.1h1.76c.1 0 .18 0 .18-.1h.09l-.04.28v.28l-.11.04c0-.13-.02-.33-.25-.33h-.56v1.82c0 .26.12.29.28.29h.07v.1l-.56-.01-.57.01v-.1h.06c.19 0 .28-.02.28-.29V20.8z\" />\n <path d=\"m11.14 23.03-.56-.02-.57.02h-.02v-.14h.08c.19 0 .26 0 .27-.27v-1.8H9.8v-.03h.57v1.83c0 .28-.11.3-.3.3h-.05V23l.56-.02.54.02v-.07h-.05c-.16 0-.3-.05-.3-.31v-1.83h.58c.23 0 .26.2.26.32l.08-.03a3.96 3.96 0 0 1 .04-.53h-.05c-.02.1-.11.1-.2.1H9.71c-.08 0-.17 0-.2-.1h-.06a2.04 2.04 0 0 1-.02.27c0 .1-.02.19-.04.28h.08c.04-.24.07-.32.33-.31v.03c-.26 0-.25.04-.3.3h-.14v-.01l.04-.3a1.93 1.93 0 0 0 .02-.28v-.01h.11c.03.1.09.1.18.1h1.77c.1 0 .16 0 .17-.1v-.01h.02l.1.02-.01.01-.04.28v.28h-.01l-.12.05v-.02c-.01-.13-.03-.31-.24-.31h-.55v1.8c0 .25.11.27.27.27h.08v.14zm.71-.12h.05c.12 0 .25-.02.25-.2v-1.78c0-.18-.13-.2-.25-.2h-.05v-.1l.85.01.87-.01.01.52-.1.03c-.02-.22-.06-.4-.42-.4h-.47v.9h.4c.2 0 .25-.12.27-.3h.1v.78l-.1.02c-.02-.2-.03-.33-.26-.33h-.4v.79c0 .22.19.22.4.22.41 0 .6-.03.7-.41l.1.02a7.7 7.7 0 0 0-.12.54l-.92-.01-.9.01v-.1\" />\n <path d=\"m13.68 23.03-.92-.02-.9.02h-.02v-.14h.06c.13 0 .24 0 .24-.17v-1.8c0-.16-.11-.17-.24-.17h-.06v-.13h1.75v.01a4.18 4.18 0 0 0 0 .52v.01l-.13.04v-.02c-.02-.22-.05-.38-.4-.38h-.46v.86h.4c.2 0 .23-.1.25-.29v-.01h.13v.01a8.08 8.08 0 0 0 0 .8h-.01l-.12.03v-.02c-.02-.2-.03-.32-.25-.32h-.4v.78c0 .2.18.2.4.2.42 0 .58-.02.68-.4v-.01h.02l.1.03v.01a7.8 7.8 0 0 0-.11.54v.02zm-.02-.03.11-.52-.06-.02c-.1.39-.3.42-.7.42-.22 0-.43 0-.44-.24v-.8H13c.24-.01.26.13.28.33l.07-.02a7.25 7.25 0 0 1 0-.76h-.07c-.02.18-.08.3-.29.3h-.42v-.92h.5c.35 0 .4.18.42.4l.07-.03a5.76 5.76 0 0 1 0-.5l-.86.02-.83-.01v.07h.03c.12 0 .27.02.27.2v1.8c0 .18-.15.2-.27.2h-.03V23l.89-.02zm.59-2c0-.26-.14-.27-.24-.27h-.06v-.1l.53.01.54-.01c.43 0 .81.12.81.6a.64.64 0 0 1-.47.6l.58.87a.38.38 0 0 0 .33.21v.1l-.33-.01-.32.01a9.45 9.45 0 0 1-.7-1.1h-.23v.73c0 .26.12.27.28.27h.06v.1l-.59-.01-.5.01v-.1h.07c.13 0 .24-.06.24-.18v-1.74zm.44.78h.16c.34 0 .53-.13.53-.53a.47.47 0 0 0-.5-.5 1.65 1.65 0 0 0-.2.02v1.01z\" />\n <path d=\"m16.27 23.03-.33-.02c-.1 0-.21.02-.33.01a9.54 9.54 0 0 1-.7-1.1h-.2v.72c0 .25.1.25.26.25h.07v.14h-.01l-.59-.02-.5.02v-.14H14c.12 0 .22-.05.23-.16v-1.74c0-.24-.13-.24-.23-.24h-.08v-.13h1.09c.43 0 .83.11.83.61a.65.65 0 0 1-.47.6l.57.87a.37.37 0 0 0 .32.2h.02v.13zm-1.58-1.14h.23a10.55 10.55 0 0 0 .7 1.1h.64v-.07a.39.39 0 0 1-.33-.2l-.6-.9h.02a.63.63 0 0 0 .47-.59c0-.47-.37-.58-.8-.58h-1.06v.07h.05c.1 0 .26.02.26.27v1.74c0 .13-.13.2-.26.2h-.05V23l.48-.02.57.02v-.07h-.04c-.16 0-.3-.02-.3-.3v-.74zm0-.1h-.02v-1.04h.01a1.63 1.63 0 0 1 .2-.01.48.48 0 0 1 .51.51c0 .4-.2.55-.54.55zm.16-.02c.34 0 .51-.12.51-.52a.45.45 0 0 0-.48-.48 1.33 1.33 0 0 0-.18.01v.99zm3.73.57h.01v-1.29a.28.28 0 0 0-.3-.32h-.07v-.1l.48.01.42-.01v.1h-.06c-.14 0-.3.03-.3.44v1.55a2.27 2.27 0 0 0 .02.34h-.13L16.9 21.1v1.41c0 .3.06.4.32.4h.06v.1l-.44-.01-.47.01v-.1h.05c.24 0 .3-.16.3-.43v-1.44a.3.3 0 0 0-.3-.3h-.05v-.11l.4.01.3-.01z\" />\n <path d=\"M18.78 23.08h-.14l-1.73-1.94v1.37c0 .3.05.38.3.38h.08v.14h-.01l-.44-.02-.47.02h-.01v-.14h.06c.23 0 .3-.14.3-.41v-1.44a.3.3 0 0 0-.3-.3h-.06v-.12h.71l1.5 1.69v-1.26c0-.27-.18-.3-.28-.3h-.09v-.13h.93v.13h-.07c-.14 0-.28.01-.28.42v1.55a2.15 2.15 0 0 0 .02.34v.02zm-.13-.03h.11a2.34 2.34 0 0 1-.01-.33v-1.55c0-.41.17-.45.31-.45h.04v-.07h-.87v.07h.06a.3.3 0 0 1 .32.33v1.3h-.02v.01l-1.52-1.71h-.68v.07h.03a.32.32 0 0 1 .32.32v1.44c0 .27-.07.44-.32.45h-.03V23l.45-.02.42.02v-.07h-.04c-.27 0-.34-.12-.34-.42v-1.44zm-.07-.71.01-.01v.01zm0 0v-.01zm1.08.18a1.38 1.38 0 0 0-.07.27c0 .1.14.12.25.12h.04v.1a7.72 7.72 0 0 0-.78 0v-.1h.02a.3.3 0 0 0 .3-.22l.54-1.57a2.87 2.87 0 0 0 .13-.42 1.73 1.73 0 0 0 .3-.15.08.08 0 0 1 .04 0 .02.02 0 0 1 .02 0l.03.1.63 1.78.12.34a.22.22 0 0 0 .23.14h.02v.1a9.66 9.66 0 0 0-.98 0v-.1h.03c.08 0 .22-.01.22-.1a1.1 1.1 0 0 0-.07-.25l-.14-.4h-.77l-.1.36zm.5-1.5-.32.96h.63l-.31-.97z\" />\n <path d=\"M21.48 23.03 21 23l-.51.02h-.02v-.14h.05c.08 0 .2-.01.2-.08a1.1 1.1 0 0 0-.07-.24l-.13-.39h-.75l-.1.35a1.41 1.41 0 0 0-.08.26c0 .08.13.1.24.1h.06v.14h-.02l-.41-.02-.37.02h-.01v-.14h.03a.3.3 0 0 0 .28-.2l.55-1.57a4.05 4.05 0 0 0 .13-.44 1.75 1.75 0 0 0 .31-.14.09.09 0 0 1 .03-.01.04.04 0 0 1 .04.02l.03.09.63 1.78c.04.12.08.25.13.35a.2.2 0 0 0 .2.12h.04v.14h-.01zM20.5 23l.5-.02.45.02v-.07a.23.23 0 0 1-.24-.15c-.05-.1-.09-.23-.13-.35l-.62-1.78-.03-.09h-.02a.08.08 0 0 0-.01 0 1.26 1.26 0 0 1-.3.14 2.83 2.83 0 0 1-.13.43l-.55 1.56a.32.32 0 0 1-.3.24h-.01V23l.35-.02.4.02v-.07h-.03c-.1 0-.26-.02-.27-.14a1.35 1.35 0 0 1 .08-.27h.01-.01l.11-.36h.8l.13.4a1.04 1.04 0 0 1 .07.25c0 .1-.15.11-.23.12h-.02zm-.7-1 .33-1h.03l.32 1zm.05-.04h.6l-.3-.91zm.28-.94h.01zm1.5-.22c-.26 0-.27.06-.32.31h-.1l.04-.29a2.1 2.1 0 0 0 .02-.29h.08c.03.1.11.1.2.1h1.76c.1 0 .18 0 .19-.1h.08l-.04.28v.28l-.1.04c-.02-.13-.03-.33-.26-.33h-.56v1.82c0 .26.12.29.28.29h.07v.1L22.4 23l-.57.01v-.1h.06c.19 0 .29-.02.29-.29V20.8h-.56\" />\n <path d=\"M22.97 23.03 22.4 23l-.57.02h-.02v-.14h.08c.19 0 .27 0 .27-.27v-1.8h-.54v-.03h.57v1.83c0 .28-.11.3-.3.3h-.05V23l.56-.02.54.02v-.07h-.05c-.16 0-.3-.05-.3-.31v-1.83h.58c.23 0 .26.2.26.32l.08-.03v-.27l.04-.26h-.05c-.02.1-.11.1-.2.1h-1.77c-.08 0-.17 0-.2-.1h-.06a2 2 0 0 1-.02.27c0 .1-.02.19-.04.28h.08c.04-.24.07-.32.33-.31v.03c-.26 0-.25.04-.3.3h-.14v-.01l.04-.29a1.98 1.98 0 0 0 .02-.29v-.01h.11c.03.1.1.1.18.1h1.77c.1 0 .17 0 .17-.1v-.01h.02l.1.02v.01l-.05.28v.28h-.01l-.12.05v-.02c-.01-.13-.03-.31-.24-.31h-.54v1.8c0 .25.1.27.26.27h.08v.14h-.01m.74-.12h.05c.12 0 .25-.02.25-.2v-1.78c0-.18-.13-.2-.25-.2h-.05v-.1l.5.01.54-.01v.1h-.05c-.12 0-.25.02-.25.2v1.79c0 .17.13.19.25.19h.05v.1L24.2 23l-.5.01z\" />\n <path d=\"M24.74 23.03 24.2 23l-.5.02h-.01v-.14h.06c.12 0 .24 0 .24-.17v-1.8c0-.16-.12-.17-.24-.17h-.06v-.13h1.07v.13h-.07c-.12 0-.23.01-.23.18v1.79c0 .16.1.17.23.17h.07v.14zm-.01-.03v-.07h-.04c-.12 0-.26-.03-.26-.21v-1.8c0-.18.14-.2.26-.2h.04v-.07H23.7v.07h.04c.12 0 .27.02.27.2v1.8c0 .18-.15.2-.27.2h-.03V23l.48-.02.53.02zm1.37-2.42a1.2 1.2 0 0 1 1.3 1.18 1.25 1.25 0 0 1-1.28 1.3 1.2 1.2 0 0 1-1.28-1.22 1.24 1.24 0 0 1 1.26-1.26m.05 2.33c.66 0 .78-.58.78-1.08s-.27-1.1-.84-1.1c-.6 0-.77.53-.77.99 0 .6.28 1.2.83 1.2\" />\n <path d=\"M24.83 21.84a1.26 1.26 0 0 1 1.27-1.28v.03a1.23 1.23 0 0 0-1.24 1.25 1.19 1.19 0 0 0 1.26 1.2 1.24 1.24 0 0 0 1.27-1.28 1.18 1.18 0 0 0-1.3-1.17v-.03a1.21 1.21 0 0 1 1.33 1.2 1.27 1.27 0 0 1-1.3 1.32 1.22 1.22 0 0 1-1.3-1.24m.48-.12c0-.46.18-1 .8-1 .57 0 .84.61.84 1.11s-.12 1.1-.79 1.1v-.03c.65 0 .76-.57.76-1.07s-.26-1.08-.82-1.09c-.58 0-.75.52-.76.98 0 .6.28 1.18.82 1.18v.03c-.56 0-.84-.6-.85-1.21m4.4.62v-1.29a.28.28 0 0 0-.3-.32h-.07v-.1l.48.01.42-.01v.1h-.05c-.15 0-.3.03-.3.44v1.55a2.2 2.2 0 0 0 .01.34h-.12L28 21.1v1.41c0 .3.06.4.32.4h.06v.1l-.44-.01-.46.01v-.1h.05c.23 0 .3-.16.3-.43v-1.44a.3.3 0 0 0-.3-.3h-.05v-.11l.39.01.3-.01 1.52 1.71\" />\n <path d=\"M29.9 23.08h-.15l-1.72-1.94v1.37c0 .3.05.38.3.38h.07v.14h-.01l-.44-.02-.46.02h-.02v-.14h.07c.22 0 .28-.14.29-.41v-1.44a.3.3 0 0 0-.3-.3h-.06v-.12h.72l1.5 1.69v-1.26c0-.27-.18-.3-.28-.3h-.1v-.13h.94v.13h-.06c-.14 0-.29.01-.3.42v1.55a2.26 2.26 0 0 0 .03.34v.02zm-.13-.03h.1a2.42 2.42 0 0 1-.01-.33v-1.55c0-.41.17-.45.32-.45h.03v-.07h-.86v.07h.06a.3.3 0 0 1 .3.33v1.3l-.01.01-1.52-1.71h-.68v.07h.03a.32.32 0 0 1 .33.32v1.44c0 .27-.08.44-.32.45h-.04V23l.45-.02.43.02v-.07h-.05c-.27 0-.33-.12-.33-.42v-1.44zm-.07-.71v-.01zm-.01 0v-.01zm1.09.18a1.43 1.43 0 0 0-.08.27c0 .1.14.12.26.12h.03v.1a7.71 7.71 0 0 0-.78 0v-.1h.02a.3.3 0 0 0 .3-.22l.55-1.57a2.79 2.79 0 0 0 .12-.42 1.75 1.75 0 0 0 .31-.15.07.07 0 0 1 .03 0 .02.02 0 0 1 .02 0l.03.1.63 1.78c.04.11.08.24.13.34a.22.22 0 0 0 .22.14h.02v.1a9.66 9.66 0 0 0-.98 0v-.1h.04c.08 0 .2-.01.2-.1a1.1 1.1 0 0 0-.06-.25l-.13-.4h-.78zm.5-1.5h-.01l-.32.96h.64l-.32-.97z\" />\n <path d=\"m32.59 23.03-.47-.02-.5.02h-.02v-.14h.05c.08 0 .2-.01.2-.08a1.06 1.06 0 0 0-.07-.24l-.13-.39h-.76l-.1.35a1.44 1.44 0 0 0-.07.26c0 .08.12.1.24.1H31v.14h-.02l-.4-.02-.38.02h-.01v-.14h.03a.3.3 0 0 0 .29-.2l.54-1.57a4.27 4.27 0 0 0 .14-.44 1.85 1.85 0 0 0 .3-.14.08.08 0 0 1 .04 0 .04.04 0 0 1 .04.01l.03.09.62 1.78c.04.12.08.25.13.35a.2.2 0 0 0 .2.12h.04v.14h-.01zm-.97-.03.5-.02.46.02v-.08h-.01a.23.23 0 0 1-.24-.14l-.12-.35-.63-1.78a3.61 3.61 0 0 1-.03-.09h-.01a.06.06 0 0 0-.02 0 1.3 1.3 0 0 1-.3.14 2.94 2.94 0 0 1-.13.43l-.55 1.56a.32.32 0 0 1-.3.24h-.01V23l.35-.02.4.02v-.07h-.02c-.11 0-.27-.02-.27-.14a1.42 1.42 0 0 1 .07-.27h.02-.02l.11-.36h.8l.13.4a1.07 1.07 0 0 1 .07.25c0 .1-.15.11-.22.12h-.03zm-.7-1 .34-1h.02l.33 1zm.05-.04h.6l-.3-.91zm2.48.72c0 .13.1.18.2.19a2.47 2.47 0 0 0 .45 0 .48.48 0 0 0 .33-.2.78.78 0 0 0 .1-.24h.1l-.12.58-.9-.01-.9.01v-.1h.05c.12 0 .25-.02.25-.23v-1.75c0-.18-.13-.2-.25-.2h-.05v-.1l.54.01.51-.01v.1h-.08c-.13 0-.23 0-.23.19z\" />\n <path d=\"m34.5 23.03-.9-.02-.9.02v-.14h.06c.12 0 .24 0 .24-.2v-1.76c0-.17-.12-.18-.24-.18h-.07v-.13h1.09v.13h-.1c-.13 0-.21 0-.22.17v1.76c0 .13.09.16.2.17l.18.01a2.46 2.46 0 0 0 .26-.01.48.48 0 0 0 .32-.18.77.77 0 0 0 .1-.24v-.01h.13v.02l-.13.58zm0-.03.11-.55h-.07a.77.77 0 0 1-.1.24.5.5 0 0 1-.34.19 2.6 2.6 0 0 1-.26.01h-.19c-.11-.02-.22-.07-.22-.21v-1.76c0-.2.12-.2.25-.2h.07v-.07h-1.03v.07h.04c.12 0 .27.02.27.2v1.76c0 .22-.15.24-.27.24h-.04V23l.89-.02.88.02zm.1-2.47a.36.36 0 1 1-.37.36.35.35 0 0 1 .36-.36zm0 .66a.3.3 0 1 0-.3-.3.29.29 0 0 0 .3.3zm-.19-.1v-.02c.05-.01.05 0 .05-.04v-.26c0-.04 0-.05-.05-.05v-.02h.19c.06 0 .12.03.12.1a.11.11 0 0 1-.09.1l.06.09a.38.38 0 0 0 .08.08v.01h-.07c-.03 0-.06-.07-.13-.16h-.04v.12c0 .02.01.02.06.03v.01zm.12-.2h.05c.04 0 .06-.03.06-.09s-.03-.08-.07-.08h-.04z\" />\n </g>\n <path fill=\"#fff\" d=\"M13.33 8.58a5.77 5.77 0 1 1 5.76 5.78 5.77 5.77 0 0 1-5.76-5.78\" />\n <path\n fill=\"#154a78\"\n d=\"M22.58 8.47a3.48 3.48 0 0 0-2.23-3.24v6.48a3.48 3.48 0 0 0 2.23-3.24zm-4.7 3.24V5.23a3.47 3.47 0 0 0 0 6.48zM19.1 3a5.48 5.48 0 1 0 5.47 5.48A5.47 5.47 0 0 0 19.11 3zm0 11.48a5.99 5.99 0 0 1-6.03-5.94A5.9 5.9 0 0 1 19.1 2.5h1.55a6.1 6.1 0 0 1 6.24 6.03 6.22 6.22 0 0 1-6.24 5.94z\"\n />\n </svg>\n);\n\nexport default DinersIcon;\n","import { h } from \"preact\";\n\ninterface DiscoverIconProps {\n opacity?: number;\n}\n\nconst DiscoverIcon = ({ opacity = 1 }: DiscoverIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" fill=\"none\" viewBox=\"0 0 40 26\" opacity={opacity}>\n <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />\n <g clip-path=\"url(#a)\">\n <g clip-path=\"url(#b)\">\n <path\n fill=\"#000\"\n d=\"M3.5 19.56a1.6 1.6 0 0 1 1.54-1.6h.06a1.52 1.52 0 0 1 1.42.77l-.43.25a1.02 1.02 0 0 0-.99-.59 1.13 1.13 0 0 0-1.14 1.11v.03a1.05 1.05 0 0 0 .99 1.14h.1a.94.94 0 0 0 1.04-.83H5.01v-.43h1.51v1.66h-.46v-.49l.03-.12a1.08 1.08 0 0 1-1.08.64 1.49 1.49 0 0 1-1.51-1.48v-.06Zm3.58-1.79h.46v3.33h-.46v-3.33Zm.92 2.2a1.2 1.2 0 1 1 .74 1.11A1.19 1.19 0 0 1 8 19.96Zm1.91 0a.74.74 0 1 0-1.48.06.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm1.36.8v.33h-.46v-3.36h.46v1.4a.98.98 0 0 1 .77-.38 1.19 1.19 0 0 1 0 2.38.9.9 0 0 1-.77-.37Zm1.48-.8a.75.75 0 1 0-1.5-.04v.03a.76.76 0 1 0 1.5 0Zm.8.55c0-.46.28-.65.9-.74.43-.06.58-.1.58-.25s-.12-.37-.46-.37a.54.54 0 0 0-.58.43l-.44-.18a1.01 1.01 0 0 1 1.02-.65c.59 0 .96.3.96.86v1.48h-.43v-.33a.75.75 0 0 1-.74.4c-.5 0-.8-.28-.8-.65Zm1.33.06a.5.5 0 0 0 .19-.4v-.19c0 .1-.16.13-.5.16-.4.06-.55.15-.55.34 0 .15.15.28.37.28.18 0 .35-.07.49-.19Zm1.14-2.8h.46v3.32h-.46v-3.33Zm2.04.24h.5l1.53 2.34v-2.34h.47v3.12h-.47l-1.57-2.41v2.4h-.46v-3.11Zm2.96 1.94a1.18 1.18 0 0 1 1.17-1.2h.03a1.14 1.14 0 0 1 1.17 1.11v.25h-1.94a.77.77 0 0 0 .96.58c.2-.05.37-.17.49-.34l.37.22a1.18 1.18 0 0 1-1.05.56 1.15 1.15 0 0 1-1.2-1.11v-.07Zm.46-.21h1.45a.67.67 0 0 0-.7-.56.7.7 0 0 0-.75.56Zm2.56.61v-1.14h-.46v-.4h.46v-.5l.46-.3v.8h.62v.4h-.65v1.14c0 .25.13.37.31.37.12 0 .24-.03.34-.09v.43a.82.82 0 0 1-.37.1c-.46 0-.71-.25-.71-.8Zm1.36-1.54h.46l.52 1.67.62-1.67h.43l.62 1.67.55-1.67h.47l-.8 2.28h-.44l-.61-1.66-.65 1.7h-.46l-.71-2.32Zm3.88 1.14a1.2 1.2 0 1 1 .74 1.12 1.19 1.19 0 0 1-.74-1.12Zm1.92 0a.74.74 0 1 0-1.48.07.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm.89-1.14h.46v.4a.72.72 0 0 1 .65-.4h.19v.46h-.28c-.37 0-.56.16-.56.6v1.22h-.46v-2.28Zm2.59 1.24-.4.43v.58h-.46v-3.3h.46V20l1.08-1.17h.55l-.89.96.92 1.32h-.52l-.74-1.04ZM5.2 10.16H3.72v5.18H5.2c.66.03 1.32-.18 1.85-.59a2.56 2.56 0 0 0 .92-1.97c0-1.54-1.14-2.62-2.77-2.62Zm1.2 3.88c-.3.28-.74.4-1.39.4h-.28v-3.39h.28a1.88 1.88 0 0 1 1.39.43 1.73 1.73 0 0 1 .55 1.3c0 .48-.2.93-.55 1.26Zm2.03-3.88h1.02v5.18H8.43v-5.18Zm3.49 2c-.62-.22-.77-.37-.77-.65 0-.34.3-.58.74-.58a.97.97 0 0 1 .8.43l.53-.68a2.32 2.32 0 0 0-1.52-.59 1.52 1.52 0 0 0-1.6 1.42v.06c0 .71.34 1.08 1.26 1.42.25.08.49.18.71.31a.64.64 0 0 1 .31.53.75.75 0 0 1-.74.74h-.03a1.29 1.29 0 0 1-1.1-.68l-.66.61a2 2 0 0 0 1.8 1 1.68 1.68 0 0 0 1.78-1.7c-.03-.87-.37-1.24-1.51-1.64Zm1.82.59a2.66 2.66 0 0 0 2.65 2.68h.06c.44 0 .88-.1 1.27-.3v-1.18a1.54 1.54 0 0 1-1.2.55 1.69 1.69 0 0 1-1.73-1.63v-.15a1.72 1.72 0 0 1 1.66-1.8h.03a1.64 1.64 0 0 1 1.27.6v-1.15c-.38-.2-.8-.31-1.23-.3a2.69 2.69 0 0 0-2.78 2.68Zm11.97.9-1.4-3.5h-1.07l2.19 5.31h.52l2.25-5.3h-1.1l-1.4 3.48Zm2.96 1.69h2.83v-.87h-1.85v-1.41h1.8v-.87h-1.8v-1.14h1.85v-.9h-2.83v5.19Zm6.84-3.64c0-.96-.68-1.51-1.82-1.51h-1.48v5.18h1.02v-2.1h.12l1.4 2.07h1.23l-1.64-2.2a1.36 1.36 0 0 0 1.17-1.44Zm-2.03.86h-.31V11h.3c.62 0 .96.28.96.77.03.52-.3.8-.95.8Zm2.84-2.13c0-.09-.07-.15-.19-.15h-.15v.46h.12v-.15l.12.18h.13l-.13-.21c.06 0 .1-.06.1-.13Zm-.19.07-.03-.13h.03c.06 0 .1.03.1.06-.04.07-.07.07-.1.07Z\"\n />\n </g>\n <path\n fill=\"#000\"\n d=\"M36.16 10.13a.4.4 0 0 0-.4.4.4.4 0 1 0 .8 0 .4.4 0 0 0-.4-.4Zm0 .74a.32.32 0 0 1-.34-.31.32.32 0 0 1 .65-.03.34.34 0 0 1-.3.34Z\"\n />\n <path fill=\"url(#c)\" d=\"M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z\" />\n <path fill=\"url(#d)\" d=\"M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z\" />\n <mask id=\"e\" width=\"6\" height=\"6\" x=\"18\" y=\"10\" maskUnits=\"userSpaceOnUse\" style=\"mask-type:luminance\">\n <path fill=\"#fff\" d=\"M18.06 12.75a2.74 2.74 0 1 0 5.49 0 2.74 2.74 0 0 0-5.5 0Z\" />\n </mask>\n <g mask=\"url(#e)\">\n <path fill=\"url(#f)\" d=\"M17.75 12.87a3.36 3.36 0 1 0 6.72 0 3.36 3.36 0 0 0-6.72 0Z\" />\n </g>\n </g>\n <g clip-path=\"url(#g)\">\n <g clip-path=\"url(#h)\">\n <path\n fill=\"#000\"\n d=\"M3.5 19.56a1.6 1.6 0 0 1 1.54-1.6h.06a1.52 1.52 0 0 1 1.42.77l-.43.25a1.02 1.02 0 0 0-.99-.59 1.13 1.13 0 0 0-1.14 1.11v.03a1.05 1.05 0 0 0 .99 1.14h.1a.94.94 0 0 0 1.04-.83H5.01v-.43h1.51v1.66h-.46v-.49l.03-.12a1.08 1.08 0 0 1-1.08.64 1.49 1.49 0 0 1-1.51-1.48v-.06Zm3.58-1.79h.46v3.33h-.46v-3.33Zm.92 2.2a1.2 1.2 0 1 1 .74 1.11A1.19 1.19 0 0 1 8 19.96Zm1.91 0a.74.74 0 1 0-1.48.06.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm1.36.8v.33h-.46v-3.36h.46v1.4a.98.98 0 0 1 .77-.38 1.19 1.19 0 0 1 0 2.38.9.9 0 0 1-.77-.37Zm1.48-.8a.75.75 0 1 0-1.5-.04v.03a.76.76 0 1 0 1.5 0Zm.8.55c0-.46.28-.65.9-.74.43-.06.58-.1.58-.25s-.12-.37-.46-.37a.54.54 0 0 0-.58.43l-.44-.18a1.01 1.01 0 0 1 1.02-.65c.59 0 .96.3.96.86v1.48h-.43v-.33a.75.75 0 0 1-.74.4c-.5 0-.8-.28-.8-.65Zm1.33.06a.5.5 0 0 0 .19-.4v-.19c0 .1-.16.13-.5.16-.4.06-.55.15-.55.34 0 .15.15.28.37.28.18 0 .35-.07.49-.19Zm1.14-2.8h.46v3.32h-.46v-3.33Zm2.04.24h.5l1.53 2.34v-2.34h.47v3.12h-.47l-1.57-2.41v2.4h-.46v-3.11Zm2.96 1.94a1.18 1.18 0 0 1 1.17-1.2h.03a1.14 1.14 0 0 1 1.17 1.11v.25h-1.94a.77.77 0 0 0 .96.58c.2-.05.37-.17.49-.34l.37.22a1.18 1.18 0 0 1-1.05.56 1.15 1.15 0 0 1-1.2-1.11v-.07Zm.46-.21h1.45a.67.67 0 0 0-.7-.56.7.7 0 0 0-.75.56Zm2.56.61v-1.14h-.46v-.4h.46v-.5l.46-.3v.8h.62v.4h-.65v1.14c0 .25.13.37.31.37.12 0 .24-.03.34-.09v.43a.82.82 0 0 1-.37.1c-.46 0-.71-.25-.71-.8Zm1.36-1.54h.46l.52 1.67.62-1.67h.43l.62 1.67.55-1.67h.47l-.8 2.28h-.44l-.61-1.66-.65 1.7h-.46l-.71-2.32Zm3.88 1.14a1.2 1.2 0 1 1 .74 1.12 1.19 1.19 0 0 1-.74-1.12Zm1.92 0a.74.74 0 1 0-1.48.07.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm.89-1.14h.46v.4a.72.72 0 0 1 .65-.4h.19v.46h-.28c-.37 0-.56.16-.56.6v1.22h-.46v-2.28Zm2.59 1.24-.4.43v.58h-.46v-3.3h.46V20l1.08-1.17h.55l-.89.96.92 1.32h-.52l-.74-1.04ZM5.2 10.16H3.72v5.18H5.2c.66.03 1.32-.18 1.85-.59a2.56 2.56 0 0 0 .92-1.97c0-1.54-1.14-2.62-2.77-2.62Zm1.2 3.88c-.3.28-.74.4-1.39.4h-.28v-3.39h.28a1.88 1.88 0 0 1 1.39.43 1.73 1.73 0 0 1 .55 1.3c0 .48-.2.93-.55 1.26Zm2.03-3.88h1.02v5.18H8.43v-5.18Zm3.49 2c-.62-.22-.77-.37-.77-.65 0-.34.3-.58.74-.58a.97.97 0 0 1 .8.43l.53-.68a2.32 2.32 0 0 0-1.52-.59 1.52 1.52 0 0 0-1.6 1.42v.06c0 .71.34 1.08 1.26 1.42.25.08.49.18.71.31a.64.64 0 0 1 .31.53.75.75 0 0 1-.74.74h-.03a1.29 1.29 0 0 1-1.1-.68l-.66.61a2 2 0 0 0 1.8 1 1.68 1.68 0 0 0 1.78-1.7c-.03-.87-.37-1.24-1.51-1.64Zm1.82.59a2.66 2.66 0 0 0 2.65 2.68h.06c.44 0 .88-.1 1.27-.3v-1.18a1.54 1.54 0 0 1-1.2.55 1.69 1.69 0 0 1-1.73-1.63v-.15a1.72 1.72 0 0 1 1.66-1.8h.03a1.64 1.64 0 0 1 1.27.6v-1.15c-.38-.2-.8-.31-1.23-.3a2.69 2.69 0 0 0-2.78 2.68Zm11.97.9-1.4-3.5h-1.07l2.19 5.31h.52l2.25-5.3h-1.1l-1.4 3.48Zm2.96 1.69h2.83v-.87h-1.85v-1.41h1.8v-.87h-1.8v-1.14h1.85v-.9h-2.83v5.19Zm6.84-3.64c0-.96-.68-1.51-1.82-1.51h-1.48v5.18h1.02v-2.1h.12l1.4 2.07h1.23l-1.64-2.2a1.36 1.36 0 0 0 1.17-1.44Zm-2.03.86h-.31V11h.3c.62 0 .96.28.96.77.03.52-.3.8-.95.8Zm2.84-2.13c0-.09-.07-.15-.19-.15h-.15v.46h.12v-.15l.12.18h.13l-.13-.21c.06 0 .1-.06.1-.13Zm-.19.07-.03-.13h.03c.06 0 .1.03.1.06-.04.07-.07.07-.1.07Z\"\n />\n </g>\n <path\n fill=\"#000\"\n d=\"M36.16 10.13a.4.4 0 0 0-.4.4.4.4 0 1 0 .8 0 .4.4 0 0 0-.4-.4Zm0 .74a.32.32 0 0 1-.34-.31.32.32 0 0 1 .65-.03.34.34 0 0 1-.3.34Z\"\n />\n <path fill=\"url(#i)\" d=\"M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z\" />\n <path fill=\"url(#j)\" d=\"M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z\" />\n <mask id=\"k\" width=\"6\" height=\"6\" x=\"18\" y=\"10\" maskUnits=\"userSpaceOnUse\" style=\"mask-type:luminance\">\n <path fill=\"#fff\" d=\"M18.06 12.75a2.74 2.74 0 1 0 5.49 0 2.74 2.74 0 0 0-5.5 0Z\" />\n </mask>\n <g mask=\"url(#k)\">\n <path fill=\"url(#l)\" d=\"M17.75 12.87a3.36 3.36 0 1 0 6.72 0 3.36 3.36 0 0 0-6.72 0Z\" />\n </g>\n </g>\n <defs>\n <linearGradient id=\"c\" x1=\"22.25\" x2=\"19.35\" y1=\"15.06\" y2=\"10.42\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#F59F00\" />\n <stop offset=\".19\" stop-color=\"#F49B00\" />\n <stop offset=\".37\" stop-color=\"#F29101\" />\n <stop offset=\".5\" stop-color=\"#F08302\" />\n <stop offset=\".6\" stop-color=\"#EE7905\" />\n <stop offset=\".76\" stop-color=\"#EC7008\" />\n <stop offset=\"1\" stop-color=\"#EC6D09\" />\n </linearGradient>\n <linearGradient id=\"d\" x1=\"22.25\" x2=\"19.35\" y1=\"15.06\" y2=\"10.42\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#F3941E\" stop-opacity=\"0\" />\n <stop offset=\".04\" stop-color=\"#F48C1C\" stop-opacity=\".08\" />\n <stop offset=\".2\" stop-color=\"#F77314\" stop-opacity=\".32\" />\n <stop offset=\".35\" stop-color=\"#F95D0E\" stop-opacity=\".53\" />\n <stop offset=\".5\" stop-color=\"#FB4B09\" stop-opacity=\".7\" />\n <stop offset=\".64\" stop-color=\"#FD3D05\" stop-opacity=\".83\" />\n <stop offset=\".77\" stop-color=\"#FE3302\" stop-opacity=\".92\" />\n <stop offset=\".9\" stop-color=\"#FF2D01\" stop-opacity=\".98\" />\n <stop offset=\"1\" stop-color=\"#FF2B00\" />\n </linearGradient>\n <radialGradient\n id=\"f\"\n cx=\"0\"\n cy=\"0\"\n r=\"1\"\n gradientTransform=\"rotate(4.24 -167.26 291.02) scale(3.3208)\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stop-color=\"#F3941E\" stop-opacity=\"0\" />\n <stop offset=\".45\" stop-color=\"#EA8D1D\" stop-opacity=\".05\" />\n <stop offset=\".66\" stop-color=\"#CA7618\" stop-opacity=\".2\" />\n <stop offset=\".83\" stop-color=\"#924D10\" stop-opacity=\".48\" />\n <stop offset=\".96\" stop-color=\"#441304\" stop-opacity=\".87\" />\n <stop offset=\".99\" stop-color=\"#2F0401\" stop-opacity=\".97\" />\n </radialGradient>\n <linearGradient id=\"i\" x1=\"22.25\" x2=\"19.35\" y1=\"15.06\" y2=\"10.42\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#F59F00\" />\n <stop offset=\".19\" stop-color=\"#F49B00\" />\n <stop offset=\".37\" stop-color=\"#F29101\" />\n <stop offset=\".5\" stop-color=\"#F08302\" />\n <stop offset=\".6\" stop-color=\"#EE7905\" />\n <stop offset=\".76\" stop-color=\"#EC7008\" />\n <stop offset=\"1\" stop-color=\"#EC6D09\" />\n </linearGradient>\n <linearGradient id=\"j\" x1=\"22.25\" x2=\"19.35\" y1=\"15.06\" y2=\"10.42\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#F3941E\" stop-opacity=\"0\" />\n <stop offset=\".04\" stop-color=\"#F48C1C\" stop-opacity=\".08\" />\n <stop offset=\".2\" stop-color=\"#F77314\" stop-opacity=\".32\" />\n <stop offset=\".35\" stop-color=\"#F95D0E\" stop-opacity=\".53\" />\n <stop offset=\".5\" stop-color=\"#FB4B09\" stop-opacity=\".7\" />\n <stop offset=\".64\" stop-color=\"#FD3D05\" stop-opacity=\".83\" />\n <stop offset=\".77\" stop-color=\"#FE3302\" stop-opacity=\".92\" />\n <stop offset=\".9\" stop-color=\"#FF2D01\" stop-opacity=\".98\" />\n <stop offset=\"1\" stop-color=\"#FF2B00\" />\n </linearGradient>\n <radialGradient\n id=\"l\"\n cx=\"0\"\n cy=\"0\"\n r=\"1\"\n gradientTransform=\"rotate(4.24 -167.26 291.02) scale(3.3208)\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stop-color=\"#F3941E\" stop-opacity=\"0\" />\n <stop offset=\".45\" stop-color=\"#EA8D1D\" stop-opacity=\".05\" />\n <stop offset=\".66\" stop-color=\"#CA7618\" stop-opacity=\".2\" />\n <stop offset=\".83\" stop-color=\"#924D10\" stop-opacity=\".48\" />\n <stop offset=\".96\" stop-color=\"#441304\" stop-opacity=\".87\" />\n <stop offset=\".99\" stop-color=\"#2F0401\" stop-opacity=\".97\" />\n </radialGradient>\n <clipPath id=\"a\">\n <path fill=\"#fff\" d=\"M0 0h33v5.55H0z\" transform=\"translate(3.5 10)\" />\n </clipPath>\n <clipPath id=\"b\">\n <path fill=\"#fff\" d=\"M0 0h33v5.86H0z\" transform=\"translate(3.5 10)\" />\n </clipPath>\n <clipPath id=\"g\">\n <path fill=\"#fff\" d=\"M0 0h33v5.55H0z\" transform=\"translate(3.5 10)\" />\n </clipPath>\n <clipPath id=\"h\">\n <path fill=\"#fff\" d=\"M0 0h33v5.86H0z\" transform=\"translate(3.5 10)\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nexport default DiscoverIcon;\n","import { h } from \"preact\";\n\ninterface CupIconProps {\n opacity?: number;\n}\n\nconst CupIcon = ({ opacity = 1 }: CupIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 40 26\" width=\"40\" height=\"26\" opacity={opacity}>\n <rect width=\"45.3\" height=\"27\" x=\"-3.3\" y=\"-.79\" fill=\"#fff\" rx=\"2.82\" />\n <path\n fill=\"#01798a\"\n d=\"M27.27-.79a4.06 4.06 0 0 0-3.6 2.8l-4.96 23.42a2.14 2.14 0 0 0 2 2.8h18.35a2.81 2.81 0 0 0 2.8-2.82V1.15A2.25 2.25 0 0 0 40-.8\"\n />\n <rect width=\"20.38\" height=\"29.02\" x=\"-4\" y=\"-.79\" fill=\"#dc1f2b\" rx=\"2.82\" />\n <path\n fill=\"#1a4580\"\n d=\"M24.37 2.02a3.98 3.98 0 0 1 3.48-2.8H14.18a3.97 3.97 0 0 0-3.5 2.8l-4.85 23.4a2.13 2.13 0 0 0 1.94 2.81h13.7a2.13 2.13 0 0 1-1.94-2.8z\"\n />\n <path\n fill=\"#fff\"\n d=\"M16.63 15.04h.18a.32.32 0 0 0 .32-.17l.46-.7h1.24l-.26.47h1.49l-.2.7H18.1a.82.82 0 0 1-.75.44h-.92zm-.2 1h3.25l-.21.77h-1.3l-.2.74h1.27l-.21.77h-1.27l-.3 1.09c-.07.18.02.26.29.24h1.03l-.19.71H16.6q-.57 0-.39-.65l.38-1.4h-.81l.2-.76h.82l.2-.74h-.78l.2-.76zm5.19-1.87-.06.45a2.37 2.37 0 0 1 1.18-.47h2.05l-.78 2.88q-.1.5-.84.5h-2.34l-.54 2.01c-.03.11.01.17.13.17h.46l-.17.62h-1.17q-.67 0-.56-.4l1.54-5.76zm1.74.81h-1.84l-.22.78a1.52 1.52 0 0 1 .82-.23h1.1zm-.67 1.8c.14.02.22-.03.22-.16l.12-.4h-1.84l-.16.57zm-1.24.93h1.06l-.02.47h.29c.14 0 .2-.05.2-.14l.1-.3h.87l-.11.44a.76.76 0 0 1-.8.57h-.56v.8c-.01.12.1.18.33.18h.53l-.17.63H21.9c-.36.02-.53-.15-.53-.52zM8.6 10.34a2.62 2.62 0 0 1-1 1.64 3.24 3.24 0 0 1-1.98.58 2.16 2.16 0 0 1-1.68-.59 1.54 1.54 0 0 1-.37-1.06 2.86 2.86 0 0 1 .06-.57l.87-4.2h1.3l-.85 4.15a1.35 1.35 0 0 0-.04.32.82.82 0 0 0 .16.52.89.89 0 0 0 .75.3 1.56 1.56 0 0 0 1-.3 1.37 1.37 0 0 0 .5-.84l.84-4.15h1.3zm5.47-1.65h1.02l-.8 3.74h-1.02zm.32-1.37h1.03l-.2.91H14.2l.19-.9M16 12.15a1.39 1.39 0 0 1-.41-1.05 2.45 2.45 0 0 1 .01-.25l.04-.27a2.55 2.55 0 0 1 .78-1.45 2.07 2.07 0 0 1 1.43-.54 1.5 1.5 0 0 1 1.1.39 1.4 1.4 0 0 1 .4 1.06 2.59 2.59 0 0 1-.02.26l-.05.28a2.48 2.48 0 0 1-.77 1.42 2.08 2.08 0 0 1-1.43.53 1.5 1.5 0 0 1-1.09-.38m1.95-.74a1.84 1.84 0 0 0 .38-.9.58.58 0 0 0 .03-.19 1.74 1.74 0 0 0 .01-.17.76.76 0 0 0-.17-.54.64.64 0 0 0-.5-.2.89.89 0 0 0-.7.3 1.9 1.9 0 0 0-.38.92l-.03.18a1.36 1.36 0 0 0-.01.17.75.75 0 0 0 .17.54.64.64 0 0 0 .5.18.9.9 0 0 0 .7-.3m8.02 3.67.25-.87h1.24l-.05.32a3.1 3.1 0 0 1 1.09-.32h1.54l-.25.87h-.24l-1.16 4.12h.24l-.23.82h-.24l-.1.36h-1.2l.1-.36h-2.38l.23-.82h.24l1.16-4.12zm1.34 0L27 16.2a5.13 5.13 0 0 1 1-.27c.1-.4.24-.85.24-.85zm-.46 1.64-.32 1.17a3.44 3.44 0 0 1 1.01-.33l.24-.84zm.23 2.48.24-.84h-.93l-.24.84zm3.01-5.05h1.17l.05.44c0 .11.06.16.2.16h.2l-.2.74h-.87c-.32.02-.5-.1-.5-.38zm-.34 1.59h3.79l-.23.79h-1.2l-.2.74h1.2l-.23.79h-1.34l-.3.46h.65l.16.93c.01.09.1.13.23.13h.2l-.2.77h-.73c-.37.02-.57-.1-.58-.38l-.18-.85-.6.9a.65.65 0 0 1-.65.36h-1.1l.22-.77h.34a.46.46 0 0 0 .36-.19l.94-1.36h-1.2l.22-.8h1.3l.21-.73h-1.3l.22-.8zM9.8 8.69h.92l-.1.54.12-.16a1.43 1.43 0 0 1 1.1-.48 1 1 0 0 1 .83.34 1.15 1.15 0 0 1 .14.95l-.5 2.56h-.95l.46-2.32a.74.74 0 0 0-.04-.53.44.44 0 0 0-.4-.17.88.88 0 0 0-.62.23 1.14 1.14 0 0 0-.34.63L10 12.44h-.94zm10.55 0h.92l-.1.54.13-.16a1.43 1.43 0 0 1 1.08-.48.99.99 0 0 1 .85.34 1.14 1.14 0 0 1 .13.95l-.5 2.56h-.95l.46-2.32a.75.75 0 0 0-.04-.53.45.45 0 0 0-.4-.17.89.89 0 0 0-.62.23 1.12 1.12 0 0 0-.33.63l-.43 2.16h-.94zm4.55-2.33h2.67a1.8 1.8 0 0 1 1.19.35 1.25 1.25 0 0 1 .4 1v.02a3.77 3.77 0 0 1-.06.59 2.38 2.38 0 0 1-.81 1.4 2.29 2.29 0 0 1-1.5.52h-1.44l-.44 2.2h-1.24zm.67 2.82h1.19a1.14 1.14 0 0 0 .73-.21 1.14 1.14 0 0 0 .36-.67l.03-.15v-.13a.52.52 0 0 0-.22-.47 1.35 1.35 0 0 0-.72-.15h-1zm9.15 3.98a5.91 5.91 0 0 1-.98 1.56 1.99 1.99 0 0 1-1.7.71l.08-.64c.89-.27 1.36-1.51 1.64-2.06l-.33-4.03.68-.01h.58l.06 2.53 1.07-2.53h1.09zM31.68 9l-.43.3a1.35 1.35 0 0 0-1.66-.21c-1.08.5-1.98 4.4 1 3.11l.17.2 1.17.04.77-3.54zm-.66 1.92c-.2.56-.61.94-.94.83-.33-.1-.45-.64-.26-1.2.19-.57.61-.94.94-.83.33.1.45.64.26 1.2\"\n />\n </svg>\n);\n\nexport default CupIcon;\n","import { h, FunctionalComponent, ComponentChildren } from \"preact\";\nimport \"./tooltip.css\";\nimport { useRef, useState } from \"preact/hooks\";\n\ninterface TooltipProps {\n children: ComponentChildren;\n content: ComponentChildren;\n}\n\nexport const Tooltip: FunctionalComponent<TooltipProps> = ({ children, content }): h.JSX.Element | null => {\n const [isVisible, setIsVisible] = useState(false);\n const triggerRef = useRef<HTMLDivElement>(null);\n\n const handleMouseEnter = () => {\n setIsVisible(true);\n };\n\n const handleMouseLeave = () => {\n setIsVisible(false);\n };\n\n return (\n <div style={{ position: \"relative\" }}>\n <div ref={triggerRef} onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>\n {children}\n </div>\n {isVisible && triggerRef && <div className=\"straumur__tooltip__content\">{content}</div>}\n </div>\n );\n};\n","import styleInject from '#style-inject';styleInject(\".straumur__tooltip__content{position:absolute;z-index:50;padding:var(--straumur__space-s);border-radius:var(--straumur__border-radius-s);right:40%;top:100%;width:max-content;color:var(--straumur__color-white);background-color:var(--straumur__color-primary);box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d}\\n\")","import { useEffect, useState } from \"preact/hooks\";\n\n/**\n * Hook to listen for a CSS media query.\n * @param query - The media query string (e.g., '(min-width: 768px)')\n * @returns true if the query matches\n */\nexport function useMediaQuery(query: string): boolean {\n const getMatch = () => window.matchMedia(query).matches;\n\n const [matches, setMatches] = useState(getMatch);\n\n useEffect(() => {\n const mediaQueryList = window.matchMedia(query);\n const listener = (event: MediaQueryListEvent) => setMatches(event.matches);\n\n // Initial match check\n setMatches(mediaQueryList.matches);\n\n // Listen for changes\n mediaQueryList.addEventListener(\"change\", listener);\n\n return () => {\n mediaQueryList.removeEventListener(\"change\", listener);\n };\n }, [query]);\n\n return matches;\n}\n","import { Fragment, h } from \"preact\";\nimport { useRef, useState, useEffect, StateUpdater, Dispatch } from \"preact/hooks\";\nimport { usePaymentMethodGroup } from \"../payment-method-group/payment-method-group-context\";\nimport { AdyenCheckout, AdyenCheckoutError, CustomCard, ICore, UIElement, UIElementProps } from \"@adyen/adyen-web\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport { Tooltip } from \"../tooltip/tooltip\";\nimport InfoIcon from \"../../assets/icons/info\";\nimport { BrandHidden } from \"../../utils/renderBrandIcons\";\nimport LoaderIcon from \"../../assets/icons/loader\";\nimport CheckmarkIcon from \"../../assets/icons/checkmark\";\nimport { RenderDualBrandComponent, DualBrandConfiguration } from \"../render-dual-brand/render-dual-brand\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport { createAdyenPaymentHandlers } from \"../shared/create-adyen-handlers\";\nimport { submitCardWithGate } from \"../shared/before-submit-click\";\nimport { useAdyenLocaleReinit } from \"../../utils/custom-hooks/use-adyen-locale-reinit\";\nimport { useFocusOnActivate } from \"../../utils/custom-hooks/use-focus-on-activate\";\nimport { useResolvedTheme } from \"../../utils/custom-hooks/use-resolved-theme\";\nimport { getAdyenFieldStyles } from \"../../utils/adyen-field-styles\";\n\nexport interface CardFormProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n onBrandHidden: Dispatch<StateUpdater<BrandHidden[]>>;\n}\n\ntype CardFormError = {\n encryptedCardNumber: {\n visible: boolean;\n message?: string;\n };\n encryptedExpiryDate: {\n visible: boolean;\n message?: string;\n };\n encryptedSecurityCode: {\n visible: boolean;\n message?: string;\n };\n};\n\ntype CardFormErrorField = keyof CardFormError;\n\nfunction CardForm({ configuration, paymentMethods, onBrandHidden }: CardFormProps): h.JSX.Element | null {\n const cardElementRef = useRef<HTMLDivElement>(null);\n const adyenCheckoutRef = useRef<ICore>();\n const customCardRef = useRef<CustomCard>();\n const { i18n } = useI18n();\n const [payButtonDisabled, setPayButtonDisabled] = useState<boolean>(true);\n const [securityCodePolicy, setSecurityCodePolicy] = useState<\"hidden\" | \"optional\" | \"required\">(\"required\");\n const [storePaymentMethod, setStorePaymentMethod] = useState(false);\n const [isDualBrand, setIsDualBrand] = useState(false);\n const [dualBrandConfiguration, setDualBrandConfiguration] = useState<DualBrandConfiguration | null>(null);\n const [selectedBrand, setSelectedBrand] = useState<string | null>(null);\n const storePaymentMethodRef = useRef(false);\n const [formErrors, setFormErrors] = useState<CardFormError>({\n encryptedCardNumber: { visible: false },\n encryptedExpiryDate: { visible: false },\n encryptedSecurityCode: { visible: false },\n });\n\n const {\n activePaymentMethod,\n isPaymentMethodInitialized,\n updatePaymentMethodInitialization,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n threeDSecureActive,\n isObscuredByThreeDS,\n hasCard,\n registerSubmitHandler,\n unregisterSubmitHandler,\n } = usePaymentMethodGroup();\n\n // Adyen's card iframes can't read our CSS, so the field colors are passed in per theme.\n const resolvedTheme = useResolvedTheme(configuration.theme);\n\n async function handleSubmitClick(): Promise<void> {\n await submitCardWithGate(configuration.paymentFlow, () => customCardRef.current);\n }\n\n useEffect(() => {\n const isActive = activePaymentMethod === \"card\" && isPaymentMethodInitialized.card;\n if (!isActive) {\n // Nothing selected yet, or a different payment method is active - tell the\n // host explicitly so a custom submit button can default to disabled.\n configuration.onCardValidityChanged?.(false, false);\n return;\n }\n\n registerSubmitHandler(handleSubmitClick);\n return () => {\n unregisterSubmitHandler(handleSubmitClick);\n configuration.onCardValidityChanged?.(false, false);\n };\n }, [activePaymentMethod, isPaymentMethodInitialized.card, registerSubmitHandler, unregisterSubmitHandler]);\n\n // Computed defensively (optional chaining + fallback) because it runs on every render,\n // ahead of the render guards below. Keeping every hook unconditional satisfies the Rules\n // of Hooks; initializeAdyenComponent is only ever invoked while the card method is active.\n const schemeBrands = paymentMethods.paymentMethods?.paymentMethods?.find((x) => x.type === \"scheme\")?.brands ?? [];\n\n const { handleOnSubmit, handleOnSubmitAdditionalData, handlePaymentCompleted, handlePaymentFailed } =\n createAdyenPaymentHandlers({\n configuration,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n enrichSubmitData: (data) => ({\n ...data,\n storePaymentMethod: storePaymentMethodRef.current,\n }),\n });\n\n function handleOnError(_: AdyenCheckoutError, __?: UIElement<UIElementProps> | undefined): void {\n handleError({ key: \"error.unknownError\" });\n }\n\n const initializeAdyenComponent = async () => {\n // Fully tear down any previous instance before re-initializing (e.g. on locale change),\n // otherwise the old secure iframes leak and stack up on the same DOM node. Uses remove()\n // (destroy-style cleanup) to match the wallet components (google-pay/apple-pay buttons).\n customCardRef.current?.remove();\n\n adyenCheckoutRef.current = await AdyenCheckout({\n clientKey: paymentMethods.clientKey,\n environment: configuration.environment,\n locale: configuration.locale,\n countryCode: configuration.countryCode,\n paymentMethodsResponse: paymentMethods.paymentMethods,\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n onSubmit: handleOnSubmit,\n onAdditionalDetails: handleOnSubmitAdditionalData,\n onError: handleOnError,\n onPaymentCompleted: handlePaymentCompleted,\n onPaymentFailed: handlePaymentFailed,\n });\n\n customCardRef.current = new CustomCard(adyenCheckoutRef.current, {\n brands: schemeBrands,\n placeholders: configuration.placeholders,\n styles: getAdyenFieldStyles(resolvedTheme),\n challengeWindowSize: \"05\",\n onBinLookup: (event) => {\n if (event.supportedBrandsRaw && event.supportedBrandsRaw.length > 1) {\n setIsDualBrand(true);\n\n setDualBrandConfiguration({\n brand1: event.supportedBrandsRaw[0].brand,\n brand1Name: event.supportedBrandsRaw[0].localeBrand,\n brand1ImageUrl: event.supportedBrandsRaw[0].brandImageUrl,\n brand2: event.supportedBrandsRaw[1].brand,\n brand2Name: event.supportedBrandsRaw[1].localeBrand,\n brand2ImageUrl: event.supportedBrandsRaw[1].brandImageUrl,\n });\n }\n },\n onBrand: (event) => {\n setSecurityCodePolicy(event.cvcPolicy);\n if (event.brand === \"card\") {\n onBrandHidden([]);\n setSelectedBrand(null);\n return;\n }\n\n const selectedBrands = schemeBrands\n .filter((x) => x !== event.brand)\n .map((x) => {\n return {\n brand: x,\n };\n });\n\n onBrandHidden(selectedBrands);\n\n if (\n schemeBrands\n .filter((x) => x === event.brand)\n .map((x) => {\n return {\n brand: x,\n };\n }).length === 1\n ) {\n setSelectedBrand(event.brand);\n }\n },\n onConfigSuccess() {\n updatePaymentMethodInitialization(\"card\", true);\n },\n onValidationError: (event) => {\n const defaultErrors: CardFormError = {\n encryptedCardNumber: { visible: false, message: undefined },\n encryptedExpiryDate: { visible: false, message: undefined },\n encryptedSecurityCode: { visible: false, message: undefined },\n };\n\n event\n .filter((x) => x.error)\n .forEach((x) => {\n defaultErrors[x.fieldType as CardFormErrorField].visible = true;\n defaultErrors[x.fieldType as CardFormErrorField].message = x.errorI18n;\n });\n\n setFormErrors(defaultErrors);\n },\n onAllValid: (event) => {\n setPayButtonDisabled(!event.allValid);\n configuration.onCardValidityChanged?.(event.allValid, true);\n },\n });\n\n if (cardElementRef.current) {\n customCardRef.current.mount(cardElementRef.current);\n }\n };\n\n useEffect(() => {\n if (hasCard && activePaymentMethod === \"card\" && !isPaymentMethodInitialized.card) {\n initializeAdyenComponent();\n }\n }, [configuration, activePaymentMethod]);\n\n useAdyenLocaleReinit(\n configuration,\n () => Boolean(customCardRef.current && isPaymentMethodInitialized.card),\n () => {\n initializeAdyenComponent();\n setFormErrors({\n encryptedCardNumber: { visible: false, message: undefined },\n encryptedExpiryDate: { visible: false, message: undefined },\n encryptedSecurityCode: { visible: false, message: undefined },\n });\n }\n );\n\n useEffect(() => {\n storePaymentMethodRef.current = storePaymentMethod;\n }, [storePaymentMethod]);\n\n function dualBrandListener(e: h.JSX.TargetedMouseEvent<HTMLSpanElement>) {\n customCardRef.current!.dualBrandingChangeHandler(e);\n }\n\n function handleStorePaymentMethodChange(event: h.JSX.TargetedEvent<HTMLInputElement, Event>) {\n setStorePaymentMethod(event.currentTarget.checked);\n }\n\n // When the 3DS challenge replaces the card fields, move focus into the container.\n useFocusOnActivate(cardElementRef, threeDSecureActive && activePaymentMethod === \"card\");\n\n // Render guards live below all hooks so hook order is identical on every render.\n if (!hasCard || isObscuredByThreeDS(\"card\")) {\n return null;\n }\n\n if (paymentMethods.paymentMethods?.paymentMethods?.length === 0) {\n return null;\n }\n\n return (\n <div\n className=\"straumur__card-component__expandable\"\n ref={cardElementRef}\n tabIndex={-1}\n style={{\n height: threeDSecureActive ? \"600px\" : \"auto\",\n minWidth: threeDSecureActive ? \"350px\" : \"auto\",\n }}\n >\n {!isPaymentMethodInitialized.card && (\n <div className=\"straumur__card-component__loading-text\">\n <LoaderIcon />\n </div>\n )}\n\n <div\n className=\"straumur__card-component__form\"\n style={{\n opacity: isPaymentMethodInitialized.card && !threeDSecureActive ? 1 : 0,\n position: isPaymentMethodInitialized.card && !threeDSecureActive ? \"relative\" : \"absolute\",\n transition: \"opacity 0.3s ease-in-out\",\n }}\n >\n <div className=\"straumur__card-component__form--wrapper\">\n <label\n className={`${\"straumur__card-component__form--wrapper--label\"} ${\n formErrors.encryptedCardNumber.visible ? \"straumur__card-component__form--wrapper--label--error\" : \"\"\n }`}\n >\n {i18n.t(\"cards.cardNumber\")}\n </label>\n <span\n className={`${\"straumur__card-component__form--wrapper--input\"} ${\n formErrors.encryptedCardNumber.visible ? \"straumur__card-component__form--wrapper--input--error\" : \"\"\n }`}\n data-cse=\"encryptedCardNumber\"\n role=\"group\"\n aria-label={i18n.t(\"cards.cardNumber\")}\n />\n {formErrors.encryptedCardNumber.visible && (\n <span className=\"straumur__card-component__form--wrapper--error\">\n {formErrors.encryptedCardNumber.message}\n </span>\n )}\n </div>\n <div className=\"straumur__card-component__form--field-wrapper\">\n <div className=\"straumur__card-component__form--wrapper\">\n <label\n className={`${\"straumur__card-component__form--wrapper--label\"} ${\n formErrors.encryptedExpiryDate.visible ? \"straumur__card-component__form--wrapper--label--error\" : \"\"\n }`}\n >\n {i18n.t(\"cards.expiryDate\")}\n </label>\n <span\n className={`${\"straumur__card-component__form--wrapper--input\"} ${\n formErrors.encryptedExpiryDate.visible ? \"straumur__card-component__form--wrapper--input--error\" : \"\"\n }`}\n data-cse=\"encryptedExpiryDate\"\n role=\"group\"\n aria-label={i18n.t(\"cards.expiryDate\")}\n />\n {formErrors.encryptedExpiryDate.visible && (\n <span className=\"straumur__card-component__form--wrapper--error\">\n {formErrors.encryptedExpiryDate.message}\n </span>\n )}\n </div>\n\n <div className=\"straumur__card-component__form--wrapper\">\n {(securityCodePolicy === \"optional\" || securityCodePolicy === \"required\") && (\n <Fragment>\n <label\n className={`${\"straumur__card-component__form--wrapper--label\"} ${\n formErrors.encryptedSecurityCode.visible\n ? \"straumur__card-component__form--wrapper--label--error\"\n : \"\"\n }`}\n >\n {securityCodePolicy === \"optional\"\n ? i18n.t(\"cards.securityCode3DigitsOptional\")\n : i18n.t(\"cards.securityCode3Digits\")}\n </label>\n <span\n className={`${\"straumur__card-component__form--wrapper--input\"} ${\n formErrors.encryptedSecurityCode.visible\n ? \"straumur__card-component__form--wrapper--input--error\"\n : \"\"\n }`}\n data-cse=\"encryptedSecurityCode\"\n role=\"group\"\n aria-label={i18n.t(\"cards.securityCode3Digits\")}\n />\n {formErrors.encryptedSecurityCode.visible && (\n <span className=\"straumur__card-component__form--wrapper--error\">\n {formErrors.encryptedSecurityCode.message}\n </span>\n )}\n <div className=\"straumur__card-component__form--wrapper--label--info\">\n <Tooltip content={<span>{i18n.t(\"cards.securityCode3DigitsInfo\")}</span>}>\n <InfoIcon />\n </Tooltip>\n </div>\n </Fragment>\n )}\n </div>\n </div>\n\n {isDualBrand && dualBrandConfiguration && (\n <RenderDualBrandComponent\n dualBrandConfiguration={dualBrandConfiguration}\n selectedBrand={selectedBrand}\n onBrandClick={dualBrandListener}\n />\n )}\n\n {paymentMethods.enableStoreDetails === \"AskForConsent\" && (\n <label className=\"straumur__card-component__form--wrapper--label-checkbox\">\n <div\n className={`${\"straumur__card-component__form--wrapper--label-checkbox--checkmark\"} ${\n storePaymentMethod ? \"straumur__card-component__form--wrapper--label-checkbox--checkmark--checked\" : \"\"\n }`}\n >\n <div\n className={`${\"straumur__card-component__form--wrapper--label-checkbox--checkmark--icon\"} ${\n storePaymentMethod\n ? \"straumur__card-component__form--wrapper--label-checkbox--checkmark--icon--checked\"\n : \"\"\n }`}\n >\n <CheckmarkIcon />\n </div>\n </div>\n <input\n type=\"checkbox\"\n className=\"straumur__card-component__form--wrapper--label-checkbox--checkbox\"\n checked={storePaymentMethod}\n onChange={handleStorePaymentMethodChange}\n />\n {i18n.t(\"cards.storePaymentMethod\")}\n </label>\n )}\n\n {!configuration.hideSubmitButton && (\n <button\n className=\"straumur__card-component__submit-button\"\n disabled={payButtonDisabled}\n onClick={handleSubmitClick}\n >\n {paymentMethods.minorUnitsAmount === 0 ? i18n.t(\"cards.saveCardDetails\") : paymentMethods.formattedAmount}\n </button>\n )}\n </div>\n </div>\n );\n}\n\nexport default CardForm;\n","import { h } from \"preact\";\n\nconst InfoIcon = () => (\n <svg width=\"21\" height=\"20\" viewBox=\"0 0 21 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_10626_39119)\">\n <path\n d=\"M10.6641 7.5C11.3543 7.5 11.9141 6.94023 11.9141 6.25C11.9141 5.55977 11.3543 5 10.6641 5C9.97383 5 9.41406 5.55859 9.41406 6.25C9.41406 6.94141 9.97266 7.5 10.6641 7.5ZM12.2266 13.125H11.6016V9.6875C11.6016 9.17188 11.1836 8.75 10.6641 8.75H9.41406C8.89844 8.75 8.47656 9.17188 8.47656 9.6875C8.47656 10.2031 8.89844 10.625 9.41406 10.625H9.72656V13.125H9.10156C8.58594 13.125 8.16406 13.5469 8.16406 14.0625C8.16406 14.5781 8.58594 15 9.10156 15H12.2266C12.7441 15 13.1641 14.5801 13.1641 14.0625C13.1641 13.5449 12.7461 13.125 12.2266 13.125Z\"\n fill=\"currentColor\"\n />\n <path\n opacity=\"0.4\"\n d=\"M10.6641 0C5.14062 0 0.664062 4.47656 0.664062 10C0.664062 15.5234 5.14062 20 10.6641 20C16.1875 20 20.6641 15.5234 20.6641 10C20.6641 4.47656 16.1875 0 10.6641 0ZM10.6641 5C11.3543 5 11.9141 5.55977 11.9141 6.25C11.9141 6.94023 11.3543 7.5 10.6641 7.5C9.97383 7.5 9.41406 6.94141 9.41406 6.25C9.41406 5.55859 9.97266 5 10.6641 5ZM12.2266 15H9.10156C8.58594 15 8.16406 14.582 8.16406 14.0625C8.16406 13.543 8.58398 13.125 9.10156 13.125H9.72656V10.625H9.41406C8.89648 10.625 8.47656 10.2051 8.47656 9.6875C8.47656 9.16992 8.89844 8.75 9.41406 8.75H10.6641C11.1816 8.75 11.6016 9.16992 11.6016 9.6875V13.125H12.2266C12.7441 13.125 13.1641 13.5449 13.1641 14.0625C13.1641 14.5801 12.7461 15 12.2266 15Z\"\n fill=\"currentColor\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_10626_39119\">\n <rect width=\"20\" height=\"20\" fill=\"white\" transform=\"translate(0.664062)\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nexport default InfoIcon;\n","import { h } from \"preact\";\n\nconst LoaderIcon = () => (\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" xmlns=\"http://www.w3.org/2000/svg\" stroke=\"currentColor\">\n <g fill=\"none\" fill-rule=\"evenodd\">\n <g transform=\"translate(2 2)\" stroke-width=\"4\">\n <circle stroke-opacity=\".3\" cx=\"18\" cy=\"18\" r=\"18\" />\n <path d=\"M36 18c0-9.94-8.06-18-18-18\">\n <animateTransform\n attributeName=\"transform\"\n type=\"rotate\"\n from=\"0 18 18\"\n to=\"360 18 18\"\n dur=\"1s\"\n repeatCount=\"indefinite\"\n />\n </path>\n </g>\n </g>\n </svg>\n);\n\nexport default LoaderIcon;\n","import { h } from \"preact\";\n\nconst CheckmarkIcon = ({ color = \"var(--straumur__color-primary)\" }: { color?: string }) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"13\" viewBox=\"0 0 16 13\" fill=\"none\">\n <path d=\"M2 7L6 11L14 2\" stroke={color} stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n </svg>\n);\n\nexport default CheckmarkIcon;\n","import { h } from \"preact\";\nimport { RenderBrandIcon } from \"../../utils/renderBrandIcons\";\nimport CheckmarkIcon from \"../../assets/icons/checkmark\";\n\ntype DualBrandConfiguration = {\n brand1: string;\n brand1Name?: string;\n brand1ImageUrl?: string;\n brand2: string;\n brand2Name?: string;\n brand2ImageUrl?: string;\n};\n\ninterface RenderDualBrandComponentProps {\n dualBrandConfiguration: DualBrandConfiguration;\n selectedBrand: string | null;\n onBrandClick: (e: h.JSX.TargetedMouseEvent<HTMLSpanElement>) => void;\n}\n\ninterface BrandOptionProps {\n brand: string;\n brandName?: string;\n isSelected: boolean;\n onBrandClick: (e: h.JSX.TargetedMouseEvent<HTMLSpanElement>) => void;\n}\n\nfunction BrandOption({ brand, brandName, isSelected, onBrandClick }: BrandOptionProps): h.JSX.Element {\n // Enter/Space activate the option like a click. Synthesizing a real click (rather than calling\n // onBrandClick directly) keeps the currentTarget/data-value that Adyen's dualBrandingChangeHandler reads.\n const handleKeyDown = (e: h.JSX.TargetedKeyboardEvent<HTMLSpanElement>) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n e.currentTarget.click();\n }\n };\n\n return (\n <span\n className={\n `straumur__card-component__dual-branding--logo` +\n (isSelected ? \" straumur__card-component__dual-branding--logo--selected\" : \"\")\n }\n title={brand}\n data-value={brand}\n onClick={onBrandClick}\n onKeyDown={handleKeyDown}\n role=\"radio\"\n aria-checked={isSelected}\n aria-label={brandName ?? brand}\n tabIndex={0}\n >\n <div className=\"straumur__card-component__dual-branding--logo--item\">\n <RenderBrandIcon brand={brand} defaultToBrandName={false} />\n &nbsp;{brandName ?? \"\"}\n </div>\n {isSelected && <CheckmarkIcon color=\"var(--straumur__color-neon-green-zeta)\" />}\n </span>\n );\n}\n\nexport function RenderDualBrandComponent({\n dualBrandConfiguration,\n selectedBrand,\n onBrandClick,\n}: RenderDualBrandComponentProps): h.JSX.Element {\n return (\n <div className=\"straumur__card-component__dual-branding\" role=\"radiogroup\" aria-label=\"Card brand\">\n <BrandOption\n brand={dualBrandConfiguration.brand1}\n brandName={dualBrandConfiguration.brand1Name}\n isSelected={selectedBrand === dualBrandConfiguration.brand1}\n onBrandClick={onBrandClick}\n />\n <BrandOption\n brand={dualBrandConfiguration.brand2}\n brandName={dualBrandConfiguration.brand2Name}\n isSelected={selectedBrand === dualBrandConfiguration.brand2}\n onBrandClick={onBrandClick}\n />\n </div>\n );\n}\n\nexport type { DualBrandConfiguration };\n","import { Language, TranslationKey } from \"../localizations/translations\";\nimport { PublicLocale } from \"../localizations/locale\";\nimport { PaymentMethod } from \"./constants\";\nimport { ICreateDetailsBody, ICreatePaymentBody } from \"../adapter/models\";\nimport { PaymentMethodsResponse } from \"../services/models\";\n\n// configuration options shared by both session and advanced mode\ntype StraumurWebBaseConfiguration = {\n environment: \"test\" | \"live\";\n onPaymentCompleted?: (data: PaymentCompletedData) => void;\n onPaymentFailed?: (data: PaymentFailedData) => void;\n placeholders?: Placeholders;\n locale?: PublicLocale;\n localizations?: Partial<Record<Language, Partial<Record<TranslationKey, string>>>>;\n instantPayments?: UniqueInstantPayments;\n hideSubmitButton?: boolean;\n onCardValidityChanged?: (isValid: boolean, isActive: boolean) => void;\n allowedPaymentMethods?: PaymentMethod[];\n /**\n * Color theme for the widget. \"system\" follows the shopper's OS/browser preference\n * (`prefers-color-scheme`) and updates live if it changes. Defaults to \"light\".\n */\n theme?: Theme;\n};\n\nexport type Theme = \"light\" | \"dark\" | \"system\";\n\n/** The resolved theme actually applied to the DOM (\"system\" collapses to one of these). */\nexport type ResolvedTheme = \"light\" | \"dark\";\n\n// the public configuration (session mode): the component loads everything itself from the Straumur API using the sessionId\nexport type StraumurWebConfiguration = StraumurWebBaseConfiguration & {\n sessionId: string;\n};\n\n// INTERNAL — advanced mode: the host page provides the payment methods and controls all network calls\n// through onSubmit / onAdditionalDetails (and optionally onDisableToken).\n// Used only by Straumur's own Hosted Checkout page; not exported from the package entry point,\n// not documented for integrators, and not part of the supported public API.\nexport type StraumurWebAdvancedConfiguration = StraumurWebBaseConfiguration & {\n sessionId?: never;\n clientKey: string;\n countryCode: string;\n paymentMethods: PaymentMethodsResponse;\n /**\n * The amount of the transaction, in minor units. For example, value 1000 means 10.00.\n */\n amount: { value: number; currency: string };\n formattedAmount: string;\n merchantName: string;\n enableStoreDetails: \"Enabled\" | \"Disabled\" | \"AskForConsent\";\n onSubmit: (state: AdvancedSubmitState, actions: AdvancedPaymentActions) => void | Promise<void>;\n onAdditionalDetails: (state: AdvancedAdditionalDetailsState, actions: AdvancedPaymentActions) => void | Promise<void>;\n onDisableToken?: (data: DisableTokenData, actions: DisableTokenActions) => void | Promise<void>;\n /**\n * Called before a payment is submitted. Return false to abort the submission.\n * Keep it synchronous when Apple Pay is offered — the payment sheet must open within the user gesture.\n */\n onBeforeSubmit?: () => boolean | Promise<boolean>;\n};\n\n// INTERNAL — union the constructor actually accepts at runtime (public signature stays session-only)\nexport type StraumurWebInternalConfiguration = StraumurWebConfiguration | StraumurWebAdvancedConfiguration;\n\nconst RESULT_CODES = [\n \"AuthenticationFinished\",\n \"AuthenticationNotRequired\",\n \"Authorised\",\n \"Cancelled\",\n \"ChallengeShopper\",\n \"Error\",\n \"IdentifyShopper\",\n \"PartiallyAuthorised\",\n \"Pending\",\n \"PresentToShopper\",\n \"Received\",\n \"RedirectShopper\",\n \"Refused\",\n] as const;\n\nexport type ResultCode = (typeof RESULT_CODES)[number];\n\n/** Narrows a resultCode string from the Adyen boundary to our ResultCode union; unknown values map to \"Error\". */\nexport function toResultCode(value: string | undefined): ResultCode {\n return value && (RESULT_CODES as readonly string[]).includes(value) ? (value as ResultCode) : \"Error\";\n}\n\nexport type PaymentCompletedData = {\n resultCode: ResultCode;\n};\n\nexport type PaymentFailedData = {\n resultCode: ResultCode;\n};\n\nexport type AdvancedSubmitState = {\n data: Omit<ICreatePaymentBody, \"sessionId\">;\n};\n\nexport type AdvancedAdditionalDetailsState = {\n data: Omit<ICreateDetailsBody, \"sessionId\">;\n};\n\nexport type PaymentFlowResult = {\n resultCode: ResultCode;\n action?: unknown;\n /**\n * Optional buyer-friendly failure message shown on the built-in failure screen\n * instead of the generic localized one (advanced mode only).\n */\n errorMessage?: string;\n};\n\nexport type AdvancedPaymentActions = {\n resolve: (result: PaymentFlowResult) => void;\n reject: (errorMessage?: string) => void;\n};\n\nexport type DisableTokenData = {\n storedPaymentMethodId: string;\n};\n\nexport type DisableTokenActions = {\n resolve: () => void;\n reject: () => void;\n};\n\n// abstraction over how payments reach the backend: session mode calls the Straumur API itself,\n// advanced mode delegates to the host page's handlers\nexport interface PaymentFlow {\n submitPayment(data: AdvancedSubmitState[\"data\"]): Promise<PaymentFlowResult>;\n submitAdditionalDetails(data: AdvancedAdditionalDetailsState[\"data\"]): Promise<PaymentFlowResult>;\n disableToken?: (storedPaymentMethodId: string) => Promise<void>;\n beforeSubmit?: () => boolean | Promise<boolean>;\n}\n\n// message shown on the built-in result screens: either a translation key or raw text supplied by the host\nexport type ResultMessage = { key: TranslationKey } | { text: string };\n\ntype UniqueInstantPayments =\n | [Extract<PaymentMethod, \"googlepay\">]\n | [Extract<PaymentMethod, \"applepay\">]\n | [Extract<PaymentMethod, \"googlepay\">, Extract<PaymentMethod, \"applepay\">]\n | [Extract<PaymentMethod, \"applepay\">, Extract<PaymentMethod, \"googlepay\">];\n\n// this will be used for internal configuration of the checkout component\nexport type StraumurCheckoutConfiguration = {\n mode: \"session\" | \"advanced\";\n sessionId?: string;\n environment: \"test\" | \"live\";\n countryCode: string;\n paymentFlow: PaymentFlow;\n onPaymentCompleted?: (data: PaymentCompletedData) => void;\n onPaymentFailed?: (data: PaymentFailedData) => void;\n placeholders?: Placeholders;\n locale: Language;\n customLocalizations?: Partial<Record<Language, Partial<Record<TranslationKey, string>>>>;\n instantPayments?: UniqueInstantPayments;\n hideSubmitButton?: boolean;\n onCardValidityChanged?: (isValid: boolean, isActive: boolean) => void;\n allowedPaymentMethods?: PaymentMethod[];\n theme: Theme;\n};\n\n// What updateConfig() accepts: internal config fields minus the immutable ones,\n// with locale in the public short-code vocabulary.\nexport type StraumurCheckoutUpdateOptions = Partial<\n Omit<StraumurCheckoutConfiguration, \"mode\" | \"paymentFlow\" | \"locale\">\n> & {\n locale?: PublicLocale;\n};\n\ntype PlaceholderKeys =\n \"cardNumber\" | \"expiryDate\" | \"expiryMonth\" | \"expiryYear\" | \"securityCodeThreeDigits\" | \"securityCodeFourDigits\";\n\n// Partial makes all records optional so we can have a configuration without placeholders\n// Record creates a type with keys of type PlaceholderKeys and values of type string\nexport type Placeholders = Partial<Record<PlaceholderKeys, string>>;\n\nexport type ErrorCode = TranslationKey;\n","import { ICreateDetailsBody, ICreatePaymentBody, IPostDisableTokenBody } from \"../adapter/models\";\nimport { createDetailsRequest, createPaymentRequest, postDisableTokenRequest } from \"../adapter/straumur-adapter\";\nimport { PaymentFlow, PaymentFlowResult, ResultMessage, StraumurWebAdvancedConfiguration } from \"../models/models\";\nimport { TranslationKey } from \"../localizations/translations\";\n\nexport class PaymentFlowError extends Error {\n messageKey: TranslationKey;\n messageText?: string;\n\n constructor(messageKey: TranslationKey, messageText?: string) {\n super(messageText ?? messageKey);\n this.messageKey = messageKey;\n this.messageText = messageText;\n }\n}\n\nexport function toResultMessage(error: unknown, fallbackKey: TranslationKey): ResultMessage {\n if (error instanceof PaymentFlowError) {\n return error.messageText ? { text: error.messageText } : { key: error.messageKey };\n }\n\n return { key: fallbackKey };\n}\n\nexport function createSessionPaymentFlow(environment: \"test\" | \"live\", sessionId: string): PaymentFlow {\n return {\n async submitPayment(data) {\n const body: ICreatePaymentBody = { ...data, sessionId };\n\n const fetchResponse = await createPaymentRequest(environment, body);\n\n // We will always get 200 OK unless there is an error in our server code.\n // Payment unsuccessful still returns 200 OK, but with resultCode Refused.\n if (!fetchResponse.ok) {\n throw new PaymentFlowError(\"error.failedToSubmitPayment\");\n }\n\n const response = await fetchResponse.json();\n\n // ResultCode should never be empty.\n if (!response.resultCode) {\n throw new PaymentFlowError(\"error.paymentFailed\");\n }\n\n return { resultCode: response.resultCode, action: response.action };\n },\n async submitAdditionalDetails(data) {\n const body: ICreateDetailsBody = { ...data, sessionId };\n\n const fetchResponse = await createDetailsRequest(environment, body);\n\n // We will always get 200 OK unless there is an error in our server code.\n // Payment unsuccessful still returns 200 OK, but with resultCode Refused.\n if (!fetchResponse.ok) {\n throw new PaymentFlowError(\"error.failedToSubmitPaymentDetails\");\n }\n\n const response = await fetchResponse.json();\n\n // ResultCode should always be either Authorised or Refused or IdentifyShopper. Never empty.\n if (!response.resultCode) {\n throw new PaymentFlowError(\"error.paymentDetailsFailed\");\n }\n\n return { resultCode: response.resultCode, action: response.action };\n },\n async disableToken(storedPaymentMethodId) {\n const body: IPostDisableTokenBody = { storedPaymentMethodId, sessionId };\n\n const fetchResponse = await postDisableTokenRequest(environment, body);\n\n if (!fetchResponse.ok) {\n throw new PaymentFlowError(\"error.failedToSubmitRemoveStoredPaymentCard\");\n }\n\n const disableTokenResponse = await fetchResponse.json();\n\n if (!disableTokenResponse.success) {\n throw new PaymentFlowError(\"error.failedToRemoveStoredPaymentCard\");\n }\n },\n };\n}\n\nexport function createAdvancedPaymentFlow(configuration: StraumurWebAdvancedConfiguration): PaymentFlow {\n // Wraps whatever the host handler throws (synchronously or asynchronously) in a PaymentFlowError,\n // so callers can rely on a single error contract.\n function invokeHostHandler<T>(\n invoke: (resolve: (value: T) => void, reject: (error: PaymentFlowError) => void) => void | Promise<void>,\n resolve: (value: T) => void,\n reject: (error: unknown) => void,\n thrownErrorKey: TranslationKey\n ): void {\n const rejectWithFlowError = (error: unknown) =>\n reject(error instanceof PaymentFlowError ? error : new PaymentFlowError(thrownErrorKey));\n\n try {\n Promise.resolve(invoke(resolve, reject)).catch(rejectWithFlowError);\n } catch (error) {\n rejectWithFlowError(error);\n }\n }\n\n const flow: PaymentFlow = {\n submitPayment(data) {\n return new Promise<PaymentFlowResult>((resolve, reject) => {\n invokeHostHandler(\n (res, rej) =>\n configuration.onSubmit(\n { data },\n {\n resolve: res,\n reject: (errorMessage) => rej(new PaymentFlowError(\"error.failedToSubmitPayment\", errorMessage)),\n }\n ),\n resolve,\n reject,\n \"error.failedToSubmitPayment\"\n );\n });\n },\n submitAdditionalDetails(data) {\n return new Promise<PaymentFlowResult>((resolve, reject) => {\n invokeHostHandler(\n (res, rej) =>\n configuration.onAdditionalDetails(\n { data },\n {\n resolve: res,\n reject: (errorMessage) => rej(new PaymentFlowError(\"error.failedToSubmitPaymentDetails\", errorMessage)),\n }\n ),\n resolve,\n reject,\n \"error.failedToSubmitPaymentDetails\"\n );\n });\n },\n beforeSubmit: configuration.onBeforeSubmit,\n };\n\n const { onDisableToken } = configuration;\n\n if (onDisableToken) {\n flow.disableToken = (storedPaymentMethodId) =>\n new Promise<void>((resolve, reject) => {\n invokeHostHandler(\n (res, rej) =>\n onDisableToken(\n { storedPaymentMethodId },\n {\n resolve: () => res(),\n reject: () => rej(new PaymentFlowError(\"error.failedToRemoveStoredPaymentCard\")),\n }\n ),\n resolve,\n reject,\n \"error.failedToSubmitRemoveStoredPaymentCard\"\n );\n });\n }\n\n return flow;\n}\n","import { PaymentFlow } from \"../../models/models\";\n\n/** Runs the flow's optional beforeSubmit gate; resolves to whether submission may proceed. */\nexport async function runBeforeSubmit(paymentFlow: PaymentFlow): Promise<boolean> {\n const { beforeSubmit } = paymentFlow;\n\n return !beforeSubmit || (await beforeSubmit());\n}\n\n/**\n * Card submit-button behavior shared by card-form and stored-card: run the beforeSubmit gate,\n * then submit the Adyen element (re-read after the gate — it may have been torn down while awaiting).\n */\nexport async function submitCardWithGate(\n paymentFlow: PaymentFlow,\n getElement: () => { submit: () => void } | undefined | null\n): Promise<void> {\n if (!getElement()) {\n return;\n }\n\n if (!(await runBeforeSubmit(paymentFlow))) {\n return;\n }\n\n getElement()?.submit();\n}\n\n// Adyen wallet elements support onClick(resolve, reject) before opening the payment sheet.\n// Apple Pay requires resolve() within the user gesture, so keep beforeSubmit synchronous when Apple Pay is offered —\n// this handler must NOT be collapsed into the async runBeforeSubmit path.\nexport function createBeforeSubmitClickHandler(paymentFlow: PaymentFlow) {\n return (resolve: () => void, reject: () => void): void => {\n const { beforeSubmit } = paymentFlow;\n\n if (!beforeSubmit) {\n resolve();\n return;\n }\n\n const result = beforeSubmit();\n\n if (result instanceof Promise) {\n result.then((valid) => (valid ? resolve() : reject())).catch(() => reject());\n return;\n }\n\n if (result) {\n resolve();\n return;\n }\n\n reject();\n };\n}\n","import {\n AdditionalDetailsActions,\n AdditionalDetailsData,\n PaymentCompletedData,\n PaymentFailedData,\n SubmitActions,\n SubmitData,\n UIElement,\n UIElementProps,\n} from \"@adyen/adyen-web\";\nimport {\n AdvancedSubmitState,\n ResultCode,\n ResultMessage,\n StraumurCheckoutConfiguration,\n toResultCode,\n} from \"../../models/models\";\nimport { toResultMessage } from \"../../flows/payment-flow\";\nimport { runBeforeSubmit } from \"./before-submit-click\";\n\nexport interface AdyenPaymentHandlersOptions {\n configuration: StraumurCheckoutConfiguration;\n handleSuccess: (message: ResultMessage) => void;\n handleError: (message: ResultMessage) => void;\n setThreeDSecureActive: (value: boolean) => void;\n enrichSubmitData?: (data: SubmitData[\"data\"]) => AdvancedSubmitState[\"data\"];\n onSubmitStart?: () => void;\n /**\n * Redirect-return path only (submitDetails after a 3DS redirect): that Adyen bootstrap wires\n * no core-level onPaymentCompleted/onPaymentFailed, so the additional-details handler must\n * dispatch the final result itself. Leave unset for mounted components — Adyen invokes the\n * core-level callbacks there, and dispatching here too would double-fire the merchant callbacks.\n */\n dispatchResultFromAdditionalDetails?: boolean;\n}\n\nexport interface AdyenPaymentHandlers {\n handleOnSubmit: (state: SubmitData, element: UIElement<UIElementProps>, actions: SubmitActions) => Promise<void>;\n handleOnSubmitAdditionalData: (\n state: AdditionalDetailsData,\n element: UIElement<UIElementProps>,\n actions: AdditionalDetailsActions\n ) => Promise<void>;\n handlePaymentCompleted: (data: PaymentCompletedData, element?: UIElement<UIElementProps>) => void;\n handlePaymentFailed: (data?: PaymentFailedData, element?: UIElement<UIElementProps>) => void;\n}\n\n// Merchant callbacks follow Adyen Web 6 semantics: these resultCodes are failures.\nconst FAILED_RESULT_CODES: readonly ResultCode[] = [\"Refused\", \"Cancelled\", \"Error\"];\n\nexport function createAdyenPaymentHandlers(options: AdyenPaymentHandlersOptions): AdyenPaymentHandlers {\n const {\n configuration,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n enrichSubmitData,\n onSubmitStart,\n dispatchResultFromAdditionalDetails,\n } = options;\n\n // Buyer-friendly failure message from the host (advanced mode). Set on submit, shown when the payment fails.\n let failureMessage: string | undefined;\n\n function failureResultMessage(): ResultMessage {\n return failureMessage ? { text: failureMessage } : { key: \"error.paymentUnsuccessful\" };\n }\n\n function dispatchFinalResult(resultCode: ResultCode): void {\n // The built-in screens keep their own rule: the success screen only for Authorised.\n if (resultCode === \"Authorised\") {\n handleSuccess({ key: \"success.paymentAuthorized\" });\n } else {\n handleError(failureResultMessage());\n }\n\n if (FAILED_RESULT_CODES.includes(resultCode)) {\n configuration.onPaymentFailed?.({ resultCode });\n } else {\n configuration.onPaymentCompleted?.({ resultCode });\n }\n }\n\n async function handleOnSubmit(state: SubmitData, _: UIElement<UIElementProps>, actions: SubmitActions) {\n onSubmitStart?.();\n\n const { paymentFlow } = configuration;\n\n if (!(await runBeforeSubmit(paymentFlow))) {\n actions.reject();\n return;\n }\n\n try {\n const data = enrichSubmitData ? enrichSubmitData(state.data) : (state.data as AdvancedSubmitState[\"data\"]);\n\n const { resultCode, action, errorMessage } = await paymentFlow.submitPayment(data);\n\n failureMessage = errorMessage;\n\n if (resultCode === \"ChallengeShopper\" || resultCode === \"IdentifyShopper\") {\n setThreeDSecureActive(true);\n }\n\n // If the /payments request from your server is successful, you must call this to resolve whichever of the listed objects are available.\n // You must call this, even if the result of the payment is unsuccessful.\n actions.resolve({ resultCode, action } as Parameters<SubmitActions[\"resolve\"]>[0]);\n } catch (error) {\n actions.reject();\n handleError(toResultMessage(error, \"error.failedToSubmitPayment\"));\n }\n }\n\n async function handleOnSubmitAdditionalData(\n state: AdditionalDetailsData,\n _: UIElement<UIElementProps>,\n actions: AdditionalDetailsActions\n ) {\n try {\n const { resultCode, action, errorMessage } = await configuration.paymentFlow.submitAdditionalDetails(state.data);\n\n failureMessage = errorMessage;\n\n // If the /payments/details request from your server is successful, you must call this to resolve whichever of the listed objects are available.\n // You must call this, even if the result of the payment is unsuccessful.\n actions.resolve({ resultCode, action } as Parameters<AdditionalDetailsActions[\"resolve\"]>[0]);\n\n if (dispatchResultFromAdditionalDetails) {\n dispatchFinalResult(resultCode);\n }\n } catch (error) {\n actions.reject();\n handleError(toResultMessage(error, \"error.failedToSubmitPaymentDetails\"));\n\n if (dispatchResultFromAdditionalDetails) {\n configuration.onPaymentFailed?.({ resultCode: \"Error\" });\n }\n }\n }\n\n function handlePaymentCompleted(data: PaymentCompletedData, _?: UIElement<UIElementProps> | undefined): void {\n dispatchFinalResult(toResultCode(data.resultCode));\n }\n\n function handlePaymentFailed(data?: PaymentFailedData | undefined, _?: UIElement<UIElementProps> | undefined): void {\n // Adyen occasionally reports failure without a payload; synthesize one so the\n // merchant callback always receives a resultCode.\n dispatchFinalResult(data ? toResultCode(data.resultCode) : \"Error\");\n }\n\n return { handleOnSubmit, handleOnSubmitAdditionalData, handlePaymentCompleted, handlePaymentFailed };\n}\n","import { useEffect } from \"preact/hooks\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\n\n/**\n * Re-initializes an Adyen element when the checkout configuration changes.\n *\n * Adyen elements cannot change locale through `.update()` (Adyen issue #2407), so an\n * already-initialized component must be torn down and rebuilt. The configuration object's\n * identity is the trigger: `updateConfig`/`setLanguage` create a fresh object per change,\n * while re-renders reuse the same one.\n *\n * @param configuration the internal checkout configuration (identity-stable per config change)\n * @param isReady whether the Adyen element is currently initialized and safe to rebuild\n * @param reinitialize tears down (if needed) and rebuilds the Adyen element\n */\nexport function useAdyenLocaleReinit(\n configuration: StraumurCheckoutConfiguration,\n isReady: () => boolean,\n reinitialize: () => void\n): void {\n useEffect(() => {\n if (isReady()) {\n reinitialize();\n }\n // Deliberately keyed on configuration identity only: isReady/reinitialize are\n // fresh closures every render and must not re-trigger the rebuild.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [configuration]);\n}\n","import { useEffect } from \"preact/hooks\";\nimport { RefObject } from \"preact\";\n\n/**\n * Moves keyboard focus into `ref` when `active` transitions from false to true.\n *\n * Used when a 3-D Secure challenge takes over the widget: the content the shopper was\n * interacting with is replaced, so focus must follow into the challenge or a keyboard /\n * screen-reader user is stranded on a now-hidden control. The target needs `tabIndex={-1}`\n * to be programmatically focusable.\n *\n * The dependency array does the gating: the effect only runs when `active` changes, so a\n * re-render while it stays active will not steal focus back.\n */\nexport function useFocusOnActivate(ref: RefObject<HTMLElement>, active: boolean): void {\n useEffect(() => {\n if (active) {\n ref.current?.focus();\n }\n }, [active, ref]);\n}\n","import { useEffect, useState } from \"preact/hooks\";\nimport { ResolvedTheme, Theme } from \"../../models/models\";\n\nconst DARK_QUERY = \"(prefers-color-scheme: dark)\";\n\nfunction systemPrefersDark(): boolean {\n return typeof window !== \"undefined\" && typeof window.matchMedia === \"function\"\n ? window.matchMedia(DARK_QUERY).matches\n : false;\n}\n\n/**\n * Resolves a Theme to the concrete \"light\" | \"dark\" applied to the DOM.\n *\n * For \"system\" it reads `prefers-color-scheme` and subscribes to changes, so the widget\n * flips live when the shopper switches their OS/browser appearance. For explicit\n * \"light\"/\"dark\" it returns that value and attaches no listener.\n */\nexport function useResolvedTheme(theme: Theme): ResolvedTheme {\n const [systemDark, setSystemDark] = useState<boolean>(systemPrefersDark);\n\n useEffect(() => {\n if (theme !== \"system\" || typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n return;\n }\n\n const query = window.matchMedia(DARK_QUERY);\n const onChange = (event: MediaQueryListEvent) => setSystemDark(event.matches);\n\n // Re-sync in case the preference changed between mount and effect.\n setSystemDark(query.matches);\n query.addEventListener(\"change\", onChange);\n\n return () => query.removeEventListener(\"change\", onChange);\n }, [theme]);\n\n if (theme === \"system\") {\n return systemDark ? \"dark\" : \"light\";\n }\n\n return theme;\n}\n","import { ResolvedTheme } from \"../models/models\";\n\n/**\n * Color values for the Adyen secured-field iframes (card number / expiry / CVC).\n *\n * Those fields render inside cross-origin iframes our CSS cannot reach, so their text,\n * placeholder, and error colors must be passed to Adyen as literal values — they cannot use\n * the CSS custom properties in styles/main.css. Keep these in sync with the palette tokens\n * there (the light values mirror --straumur__color-text / -secondary / -red-beta, the dark\n * values mirror their [data-theme=\"dark\"] overrides).\n *\n * Structurally compatible with Adyen's StylesObject (which the SDK does not export).\n */\nexport function getAdyenFieldStyles(theme: ResolvedTheme) {\n if (theme === \"dark\") {\n return {\n base: { color: \"#e8edf2\" },\n placeholder: { color: \"#9aa7b5\" },\n error: { color: \"#e08a8a\" },\n };\n }\n\n return {\n base: { color: \"#00112c\" },\n placeholder: { color: \"#72889d\" },\n error: { color: \"#d96666\" },\n };\n}\n","import { h, ComponentChildren } from \"preact\";\nimport \"./payment-method-item.css\";\n\ninterface PaymentMethodItemProps {\n icon: h.JSX.Element;\n title: string;\n isActive: boolean;\n isSole: boolean;\n onChange: () => void;\n children: ComponentChildren;\n headerRight?: h.JSX.Element | null;\n confirmSection?: h.JSX.Element;\n}\n\nfunction PaymentMethodItem({\n icon,\n title,\n isActive,\n isSole,\n onChange,\n children,\n headerRight,\n confirmSection,\n}: PaymentMethodItemProps): h.JSX.Element {\n return (\n <label className={`straumur__payment-method-item${isSole ? \" straumur__payment-method-item--sole\" : \"\"}`}>\n {!isSole && (\n <input\n type=\"radio\"\n className=\"straumur__payment-method-item__radio-selector\"\n checked={isActive}\n onChange={onChange}\n />\n )}\n <span\n className={`straumur__payment-method-item__content${isSole ? \" straumur__payment-method-item__content--expanded\" : \"\"}`}\n >\n {!isSole && <span className=\"straumur__payment-method-item--circle\" />}\n {icon}\n <span className=\"straumur__payment-method-item--title\">{title}</span>\n {headerRight}\n </span>\n {confirmSection}\n <div\n className={`straumur__payment-method-item__expandable${isSole ? \" straumur__payment-method-item__expandable--visible\" : \"\"}`}\n >\n {children}\n </div>\n </label>\n );\n}\n\nexport default PaymentMethodItem;\n","import styleInject from '#style-inject';styleInject(\".straumur__payment-method-item{position:relative;cursor:pointer;background:var(--straumur__color-white);border-radius:var(--straumur__border-radius-lg);transition:all .3s ease;padding:var(--straumur__space-xxlg) var(--straumur__space-5xlg)}.straumur__payment-method-item--sole{cursor:default}.straumur__payment-method-item:has(.straumur__payment-method-item__radio-selector:checked){cursor:default}.straumur__payment-method-item__radio-selector{position:absolute;opacity:0;cursor:pointer}.straumur__payment-method-item__content{display:flex;align-items:center;gap:var(--straumur__space-lg);transition:background-color .3s ease}.straumur__payment-method-item__radio-selector:checked+.straumur__payment-method-item__content{padding-bottom:var(--straumur__space-xxlg)}.straumur__payment-method-item__content--expanded{padding-bottom:var(--straumur__space-xxlg)}.straumur__payment-method-item--circle{width:var(--straumur__space-5xlg);height:var(--straumur__space-5xlg);border:1px solid var(--straumur__color-cosmos-blue-gamma);background:var(--straumur__color-secondary-gamma);border-radius:50%;position:relative;transition:all .3s ease;flex-shrink:0}.straumur__payment-method-item__content:hover .straumur__payment-method-item--circle{border:1px solid var(--straumur__color-cosmos-blue-delta)}.straumur__payment-method-item--circle:after{content:\\\"\\\";position:absolute;width:100%;height:100%;border-radius:50%;top:50%;left:50%;transform:translate(-50%,-50%) scale(0);transition:transform .2s ease}.straumur__payment-method-item__radio-selector:checked+.straumur__payment-method-item__content .straumur__payment-method-item--circle{background:var(--straumur__color-blue-beta);border-color:var(--straumur__color-transparent)}.straumur__payment-method-item__radio-selector:checked+.straumur__payment-method-item__content .straumur__payment-method-item--circle:after{transform:translate(-50%,-50%) scale(1);background:var(--straumur__color-primary);height:var(--straumur__space-md);width:var(--straumur__space-md)}.straumur__payment-method-item--title{color:var(--straumur__color-text);font-size:16px;user-select:none}.straumur__payment-method-item__expandable{background:var(--straumur__color-white);max-height:0;overflow:hidden;transition:all .3s ease;opacity:0}.straumur__payment-method-item__radio-selector:checked~.straumur__payment-method-item__expandable{max-height:600px;opacity:1}.straumur__payment-method-item__expandable--visible{max-height:600px;opacity:1}\\n\")","import { h } from \"preact\";\nimport { useState } from \"preact/hooks\";\nimport \"./google-pay-component.css\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport GooglePayIcon from \"../../assets/icons/googlepay\";\nimport GooglePayButton from \"../../components/google-pay-button/google-pay-button\";\nimport PaymentMethodItem from \"../../components/payment-method-item/payment-method-item\";\n\ninterface GooglePayComponentProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n}\n\nfunction GooglePayComponent({ configuration, paymentMethods }: GooglePayComponentProps): h.JSX.Element | null {\n const { i18n } = useI18n();\n const { activePaymentMethod, setActivePaymentMethod, isObscuredByThreeDS, isSolePaymentMethod, hasGooglePay } =\n usePaymentMethodGroup();\n const [isUnavailable, setIsUnavailable] = useState(false);\n\n if (!hasGooglePay || isUnavailable) {\n return null;\n }\n\n if (configuration.instantPayments && configuration.instantPayments.some((x) => x === \"googlepay\")) {\n return null;\n }\n\n if (isObscuredByThreeDS(\"googlepay\")) {\n return null;\n }\n\n return (\n <PaymentMethodItem\n icon={<GooglePayIcon />}\n title={i18n.t(\"googlePay.title\")}\n isActive={activePaymentMethod === \"googlepay\"}\n isSole={isSolePaymentMethod}\n onChange={() => setActivePaymentMethod(\"googlepay\")}\n >\n <GooglePayButton\n configuration={configuration}\n paymentMethods={paymentMethods}\n isInstantPayment={false}\n onUnavailable={() => setIsUnavailable(true)}\n />\n </PaymentMethodItem>\n );\n}\n\nexport default GooglePayComponent;\n","import styleInject from '#style-inject';styleInject(\".adyen-checkout__paywithgoogle{height:var(--straumur__space-8xlg)}\\n\")","import { h } from \"preact\";\n\nconst GooglePayIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" fill=\"none\" viewBox=\"0 0 40 26\">\n <path\n fill=\"#fff\"\n d=\"M29.13 2.41H10.87C5.17 2.41.5 7.18.5 13.01a10.5 10.5 0 0 0 10.37 10.58h18.26c5.7 0 10.37-4.76 10.37-10.59 0-5.82-4.67-10.59-10.37-10.59Z\"\n />\n <path\n fill=\"#3C4043\"\n d=\"M29.13 3.27c1.28 0 2.52.26 3.7.77a9.6 9.6 0 0 1 5.08 5.19 9.78 9.78 0 0 1 0 7.55 9.83 9.83 0 0 1-5.08 5.18 9.26 9.26 0 0 1-3.7.77H10.87a9.24 9.24 0 0 1-3.7-.77 9.6 9.6 0 0 1-5.08-5.18 9.78 9.78 0 0 1 0-7.55 9.83 9.83 0 0 1 5.08-5.19 9.24 9.24 0 0 1 3.7-.77h18.26Zm0-.86H10.87C5.17 2.41.5 7.18.5 13.01a10.5 10.5 0 0 0 10.37 10.58h18.26c5.7 0 10.37-4.76 10.37-10.59 0-5.82-4.67-10.59-10.37-10.59Z\"\n />\n <path\n fill=\"#3C4043\"\n d=\"M19.1 13.75v3.2h-1v-7.9h2.64c.67 0 1.24.23 1.7.68.49.46.72 1.01.72 1.67a2.2 2.2 0 0 1-.71 1.68c-.46.45-1.03.67-1.7.67H19.1Zm0-3.73v2.76h1.66c.4 0 .73-.14.99-.4.26-.28.4-.6.4-.98 0-.36-.14-.68-.4-.95a1.28 1.28 0 0 0-.99-.42H19.1Zm6.67 1.35c.73 0 1.31.2 1.74.6.42.4.64.95.64 1.65v3.34h-.95v-.76h-.04a1.9 1.9 0 0 1-1.65.93 2.1 2.1 0 0 1-1.46-.53c-.4-.35-.6-.8-.6-1.32 0-.56.21-1 .63-1.34.41-.33.97-.5 1.66-.5.59 0 1.07.12 1.45.34v-.23c0-.36-.13-.65-.4-.9a1.4 1.4 0 0 0-.97-.37c-.56 0-1 .24-1.32.72l-.88-.56a2.42 2.42 0 0 1 2.15-1.07Zm-1.29 3.92c0 .27.11.5.33.67.22.17.48.26.78.26.42 0 .79-.16 1.12-.48.32-.31.49-.68.49-1.11a2.02 2.02 0 0 0-1.3-.38c-.4 0-.74.1-1.01.3a.9.9 0 0 0-.4.74Zm9.08-3.75-3.32 7.8h-1.02l1.23-2.73-2.19-5.07h1.09l1.57 3.89h.02l1.54-3.89h1.08Z\"\n />\n <path\n fill=\"#4285F4\"\n d=\"M15.14 13.1c0-.32-.03-.64-.09-.95h-4.17v1.75h2.4a2.1 2.1 0 0 1-.89 1.4v1.14h1.43a4.49 4.49 0 0 0 1.32-3.33Z\"\n />\n <path fill=\"#34A853\" d=\"M12.4 15.3a2.66 2.66 0 0 1-4-1.44H6.9v1.18a4.43 4.43 0 0 0 6.91 1.4l-1.43-1.13Z\" />\n <path\n fill=\"#FABB05\"\n d=\"M8.25 13c0-.3.05-.59.14-.86v-1.17H6.9a4.59 4.59 0 0 0 0 4.07l1.48-1.17a2.79 2.79 0 0 1-.14-.86Z\"\n />\n <path\n fill=\"#E94235\"\n d=\"M10.88 10.27c.66 0 1.24.23 1.7.68l1.27-1.3a4.22 4.22 0 0 0-2.97-1.18 4.44 4.44 0 0 0-3.97 2.5l1.48 1.17a2.66 2.66 0 0 1 2.5-1.87Z\"\n />\n </svg>\n);\n\nexport default GooglePayIcon;\n","import styleInject from '#style-inject';styleInject(\".straumur__google-pay-button__loading{display:flex;justify-content:center}\\n\")","import \"./google-pay-button.css\";\nimport { h } from \"preact\";\nimport WalletButton, { WalletButtonProps } from \"../shared/wallet-button\";\n\ntype GooglePayButtonProps = Omit<WalletButtonProps, \"method\">;\n\nfunction GooglePayButton(props: GooglePayButtonProps): h.JSX.Element | null {\n return <WalletButton method=\"googlepay\" {...props} />;\n}\n\nexport default GooglePayButton;\n","import { Fragment, h } from \"preact\";\nimport { useEffect, useRef } from \"preact/hooks\";\nimport {\n AdyenCheckout,\n AdyenCheckoutError,\n ApplePay,\n ApplePayConfiguration,\n GooglePay,\n GooglePayConfiguration,\n ICore,\n UIElement,\n UIElementProps,\n} from \"@adyen/adyen-web\";\nimport { usePaymentMethodGroup } from \"../payment-method-group/payment-method-group-context\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport { CANCEL } from \"../../models/constants\";\nimport LoaderIcon from \"../../assets/icons/loader\";\nimport { AdyenPaymentHandlers, createAdyenPaymentHandlers } from \"./create-adyen-handlers\";\nimport { createBeforeSubmitClickHandler } from \"./before-submit-click\";\nimport { useAdyenLocaleReinit } from \"../../utils/custom-hooks/use-adyen-locale-reinit\";\n\nexport type WalletMethod = \"applepay\" | \"googlepay\";\n\nexport interface WalletButtonProps {\n method: WalletMethod;\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n isInstantPayment: boolean;\n onUnavailable?: () => void;\n}\n\ntype WalletElement = ApplePay | GooglePay;\n\n/** Merchant identifiers Adyen requires inside the wallet element's configuration. */\ntype WalletMerchantConfig = { gatewayMerchantId: string; merchantId: string };\n\ninterface WalletContext {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n walletConfig: WalletMerchantConfig;\n handleOnSubmit: AdyenPaymentHandlers[\"handleOnSubmit\"];\n}\n\ninterface WalletDescriptor {\n loadingClassName: string;\n createElement(core: ICore, context: WalletContext): WalletElement;\n}\n\n// Everything the two wallets share lives in WalletButton below; per-wallet differences\n// (the Adyen element class and its configuration deltas) live in this descriptor map.\nconst WALLETS: Record<WalletMethod, WalletDescriptor> = {\n applepay: {\n loadingClassName: \"straumur__apple-pay-button__loading\",\n createElement(core, { configuration, paymentMethods, walletConfig, handleOnSubmit }) {\n const applePayConfiguration: ApplePayConfiguration = {\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n environment: configuration.environment,\n onSubmit: handleOnSubmit,\n onClick: createBeforeSubmitClickHandler(configuration.paymentFlow),\n configuration: {\n ...walletConfig,\n merchantName: paymentMethods.merchantName,\n },\n };\n\n return new ApplePay(core, applePayConfiguration);\n },\n },\n googlepay: {\n loadingClassName: \"straumur__google-pay-button__loading\",\n createElement(core, { configuration, paymentMethods, walletConfig, handleOnSubmit }) {\n const googlePayConfiguration: GooglePayConfiguration = {\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n challengeWindowSize: \"05\",\n countryCode: configuration.countryCode,\n environment: configuration.environment,\n onSubmit: handleOnSubmit,\n onClick: createBeforeSubmitClickHandler(configuration.paymentFlow),\n buttonSizeMode: \"fill\",\n configuration: {\n ...walletConfig,\n merchantName: paymentMethods.merchantName,\n },\n };\n\n return new GooglePay(core, googlePayConfiguration);\n },\n },\n};\n\nfunction WalletButton({\n method,\n configuration,\n paymentMethods,\n isInstantPayment,\n onUnavailable,\n}: WalletButtonProps): h.JSX.Element | null {\n const wallet = WALLETS[method];\n const walletElementRef = useRef<HTMLDivElement>(null);\n const adyenCheckoutRef = useRef<ICore>();\n const walletRef = useRef<WalletElement>();\n const {\n isPaymentMethodInitialized,\n updatePaymentMethodInitialization,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n threeDSecureActive,\n isObscuredByThreeDS,\n setActivePaymentMethod,\n activePaymentMethod,\n } = usePaymentMethodGroup();\n\n const { handleOnSubmit, handleOnSubmitAdditionalData, handlePaymentCompleted, handlePaymentFailed } =\n createAdyenPaymentHandlers({\n configuration,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n onSubmitStart: () => {\n if (isInstantPayment) {\n setActivePaymentMethod(method);\n }\n },\n });\n\n function handleOnError(data: AdyenCheckoutError, _?: UIElement<UIElementProps> | undefined): void {\n if (data.name !== CANCEL) {\n handleError({ key: \"error.unknownError\" });\n }\n }\n\n function markUnavailable(): void {\n // Initialized-but-unavailable: the loader must disappear and the method must not stay selected.\n updatePaymentMethodInitialization(method, true);\n if (activePaymentMethod === method) {\n setActivePaymentMethod(null);\n }\n onUnavailable?.();\n }\n\n const initializeAdyenComponent = async () => {\n adyenCheckoutRef.current = await AdyenCheckout({\n clientKey: paymentMethods.clientKey,\n environment: configuration.environment,\n locale: configuration.locale,\n countryCode: configuration.countryCode,\n paymentMethodsResponse: paymentMethods.paymentMethods,\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n onError: handleOnError,\n onAdditionalDetails: handleOnSubmitAdditionalData,\n onPaymentCompleted: handlePaymentCompleted,\n onPaymentFailed: handlePaymentFailed,\n });\n\n const walletPaymentMethod = paymentMethods.paymentMethods.paymentMethods?.find((x) => x.type === method);\n const walletConfig = walletPaymentMethod?.configuration as WalletMerchantConfig | undefined;\n\n if (!walletConfig) {\n // No usable wallet configuration in the response: treat it like an unavailable wallet instead of crashing.\n markUnavailable();\n return;\n }\n\n walletRef.current = wallet.createElement(adyenCheckoutRef.current, {\n configuration,\n paymentMethods,\n walletConfig,\n handleOnSubmit,\n });\n\n walletRef.current\n .isAvailable()\n .then(() => {\n walletRef.current!.mount(walletElementRef.current!);\n updatePaymentMethodInitialization(method, true);\n })\n .catch(() => {\n markUnavailable();\n });\n };\n\n useEffect(() => {\n if (!isPaymentMethodInitialized[method]) {\n initializeAdyenComponent();\n }\n }, [configuration]);\n\n useAdyenLocaleReinit(\n configuration,\n () => Boolean(walletRef.current && isPaymentMethodInitialized[method]),\n () => {\n walletRef.current!.remove();\n initializeAdyenComponent();\n }\n );\n\n if (isObscuredByThreeDS(method)) {\n return null;\n }\n\n return (\n <Fragment>\n {isPaymentMethodInitialized[method] === false && (\n <div className={wallet.loadingClassName}>\n <LoaderIcon />\n </div>\n )}\n <div\n ref={walletElementRef}\n style={{\n height: threeDSecureActive ? \"600px\" : \"auto\",\n minWidth: threeDSecureActive ? \"350px\" : \"auto\",\n position: isPaymentMethodInitialized[method] ? \"static\" : \"absolute\",\n }}\n />\n </Fragment>\n );\n}\n\nexport default WalletButton;\n","export type PaymentMethod = \"card\" | \"storedcard\" | \"googlepay\" | \"applepay\";\n\nexport const NETWORK_ERROR = \"NETWORK_ERROR\";\nexport const CANCEL = \"CANCEL\";\nexport const IMPLEMENTATION_ERROR = \"IMPLEMENTATION_ERROR\";\nexport const API_ERROR = \"API_ERROR\";\nexport const ERROR = \"ERROR\";\nexport const SCRIPT_ERROR = \"SCRIPT_ERROR\";\nexport const SDK_ERROR = \"SDK_ERROR\";\n","import { h } from \"preact\";\nimport { useState } from \"preact/hooks\";\nimport \"./apple-pay-component.css\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport ApplePayIcon from \"../../assets/icons/applepay\";\nimport ApplePayButton from \"../../components/apple-pay-button/apple-pay-button\";\nimport PaymentMethodItem from \"../../components/payment-method-item/payment-method-item\";\n\ninterface ApplePayComponentProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n}\n\nfunction ApplePayComponent({ configuration, paymentMethods }: ApplePayComponentProps): h.JSX.Element | null {\n const { i18n } = useI18n();\n const { activePaymentMethod, setActivePaymentMethod, isObscuredByThreeDS, isSolePaymentMethod, hasApplePay } =\n usePaymentMethodGroup();\n const [isUnavailable, setIsUnavailable] = useState(false);\n\n if (!hasApplePay || isUnavailable) {\n return null;\n }\n\n if (configuration.instantPayments && configuration.instantPayments.some((x) => x === \"applepay\")) {\n return null;\n }\n\n if (isObscuredByThreeDS(\"applepay\")) {\n return null;\n }\n\n return (\n <PaymentMethodItem\n icon={<ApplePayIcon />}\n title={i18n.t(\"applePay.title\")}\n isActive={activePaymentMethod === \"applepay\"}\n isSole={isSolePaymentMethod}\n onChange={() => setActivePaymentMethod(\"applepay\")}\n >\n <ApplePayButton\n configuration={configuration}\n paymentMethods={paymentMethods}\n isInstantPayment={false}\n onUnavailable={() => setIsUnavailable(true)}\n />\n </PaymentMethodItem>\n );\n}\n\nexport default ApplePayComponent;\n","import styleInject from '#style-inject';styleInject(\"\")","import { h } from \"preact\";\n\nconst ApplePayIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" fill=\"none\" viewBox=\"0 0 40 26\">\n <path\n fill=\"#000\"\n d=\"M36.42 0H3.58a69.25 69.25 0 0 0-.75 0c-.25.01-.5.03-.76.07a2.51 2.51 0 0 0-1.32.7A2.43 2.43 0 0 0 .07 2.1 5.14 5.14 0 0 0 0 3.22v19.91c.01.25.03.51.07.76a2.6 2.6 0 0 0 .68 1.35 2.39 2.39 0 0 0 1.32.69 4.98 4.98 0 0 0 1.1.07h34a5 5 0 0 0 .76-.07 2.5 2.5 0 0 0 1.32-.7 2.44 2.44 0 0 0 .68-1.34 5.13 5.13 0 0 0 .07-1.11V2.87a6.5 6.5 0 0 0-.07-.76 2.58 2.58 0 0 0-.68-1.35 2.4 2.4 0 0 0-1.32-.69 4.96 4.96 0 0 0-1.1-.07h-.41Z\"\n />\n <path\n fill=\"#fff\"\n d=\"M36.42.87h.73c.2 0 .42.02.62.06a1.67 1.67 0 0 1 .88.44 1.58 1.58 0 0 1 .44.89 4.38 4.38 0 0 1 .06.97v19.55a14.67 14.67 0 0 1-.06.96 1.7 1.7 0 0 1-.44.89 1.54 1.54 0 0 1-.87.44 4.27 4.27 0 0 1-.96.06H2.85a3.7 3.7 0 0 1-.63-.06 1.66 1.66 0 0 1-.87-.45 1.56 1.56 0 0 1-.44-.88 4.35 4.35 0 0 1-.06-.97V2.9c.01-.2.02-.42.06-.63.03-.18.08-.34.16-.49A1.56 1.56 0 0 1 2.22.93a4.2 4.2 0 0 1 .96-.06h33.24\"\n />\n <path\n fill=\"#000\"\n d=\"M10.92 8.61c.34-.43.57-1 .51-1.59a2.21 2.21 0 0 0-1.99 2.3c.56.04 1.12-.3 1.48-.7Zm.51.81c-.82-.05-1.52.46-1.9.46-.4 0-1-.43-1.64-.42-.84 0-1.62.48-2.05 1.24-.88 1.52-.23 3.76.62 5 .42.6.92 1.27 1.58 1.25.62-.02.86-.4 1.62-.4.75 0 .97.4 1.63.39.69-.01 1.11-.61 1.53-1.22.47-.7.67-1.37.68-1.4-.01-.02-1.32-.52-1.33-2.02-.01-1.26 1.03-1.85 1.07-1.9a2.34 2.34 0 0 0-1.81-.98Zm7.11-1.7a2.87 2.87 0 0 1 3.02 3c0 1.8-1.27 3.03-3.06 3.03h-1.97v3.12h-1.42V7.72h3.43Zm-2 4.83h1.62c1.24 0 1.94-.66 1.94-1.82 0-1.15-.7-1.81-1.93-1.81h-1.64v3.63Zm5.39 2.43c0-1.17.9-1.89 2.48-1.98l1.83-.1v-.52c0-.74-.5-1.18-1.34-1.18-.8 0-1.3.38-1.41.97h-1.3c.08-1.2 1.1-2.09 2.76-2.09 1.62 0 2.65.86 2.65 2.2v4.6h-1.31v-1.1h-.04a2.38 2.38 0 0 1-2.1 1.2c-1.3 0-2.22-.8-2.22-2Zm4.3-.6v-.53l-1.64.1c-.82.06-1.28.42-1.28.99 0 .58.48.96 1.22.96.96 0 1.7-.66 1.7-1.52Zm2.61 4.95v-1.11c.1.03.33.03.44.03.64 0 .98-.27 1.19-.96l.12-.4-2.41-6.69h1.48l1.7 5.43h.02l1.69-5.43h1.44l-2.5 7.02c-.57 1.62-1.23 2.14-2.61 2.14a5.3 5.3 0 0 1-.56-.03Z\"\n />\n </svg>\n);\n\nexport default ApplePayIcon;\n","import styleInject from '#style-inject';styleInject(\".straumur__apple-pay-button__loading{display:flex;justify-content:center}\\n\")","import \"./apple-pay-button.css\";\nimport { h } from \"preact\";\nimport WalletButton, { WalletButtonProps } from \"../shared/wallet-button\";\n\ntype ApplePayButtonProps = Omit<WalletButtonProps, \"method\">;\n\nfunction ApplePayButton(props: ApplePayButtonProps): h.JSX.Element | null {\n return <WalletButton method=\"applepay\" {...props} />;\n}\n\nexport default ApplePayButton;\n","import { Fragment, h } from \"preact\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { StoredPaymentMethod, SuccessResponse } from \"../../services/models\";\nimport StoredCardComponent from \"./stored-card-component\";\nimport { useState } from \"preact/hooks\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\n\ninterface StoredCardContainerComponentProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n}\n\nfunction StoredCardContainerComponent({\n configuration,\n paymentMethods,\n}: StoredCardContainerComponentProps): h.JSX.Element | null {\n const [storedPaymentMethods, setStoredPaymentMethods] = useState<StoredPaymentMethod[]>(\n paymentMethods.paymentMethods.storedPaymentMethods ?? []\n );\n const { isObscuredByThreeDS, hasStoredPaymentMethods } = usePaymentMethodGroup();\n\n if (!hasStoredPaymentMethods || isObscuredByThreeDS(\"storedcard\")) {\n return null;\n }\n\n function handleStoredCardRemoved(storedPaymentMethodId: string): void {\n setStoredPaymentMethods((prevStoredPaymentMethods) =>\n prevStoredPaymentMethods.filter((storedPaymentMethod) => storedPaymentMethod.id !== storedPaymentMethodId)\n );\n }\n\n return (\n <Fragment>\n {storedPaymentMethods?.map((storedPaymentMethod) => (\n <StoredCardComponent\n key={storedPaymentMethod.id}\n configuration={configuration}\n storedPaymentMethod={storedPaymentMethod}\n paymentMethods={paymentMethods}\n onStoredCardRemoved={handleStoredCardRemoved}\n />\n ))}\n </Fragment>\n );\n}\n\nexport default StoredCardContainerComponent;\n","import { Fragment, h } from \"preact\";\nimport { useEffect, useRef, useState } from \"preact/hooks\";\nimport \"./stored-card-component.css\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport { Tooltip } from \"../../components/tooltip/tooltip\";\nimport InfoIcon from \"../../assets/icons/info\";\nimport { AdyenCheckout, AdyenCheckoutError, CustomCard, ICore, UIElement, UIElementProps } from \"@adyen/adyen-web\";\nimport { RenderBrandIcons } from \"../../utils/renderBrandIcons\";\nimport LoaderIcon from \"../../assets/icons/loader\";\nimport { StoredCardComponentProps, StoredCardFormError, StoredCardFormErrorField } from \"./models\";\nimport WarningIcon from \"../../assets/icons/warning\";\nimport PaymentMethodItem from \"../../components/payment-method-item/payment-method-item\";\nimport { createAdyenPaymentHandlers } from \"../../components/shared/create-adyen-handlers\";\nimport { submitCardWithGate } from \"../../components/shared/before-submit-click\";\nimport { useAdyenLocaleReinit } from \"../../utils/custom-hooks/use-adyen-locale-reinit\";\nimport { useFocusOnActivate } from \"../../utils/custom-hooks/use-focus-on-activate\";\nimport { useResolvedTheme } from \"../../utils/custom-hooks/use-resolved-theme\";\nimport { getAdyenFieldStyles } from \"../../utils/adyen-field-styles\";\nimport { toResultMessage } from \"../../flows/payment-flow\";\n\nfunction StoredCardComponent({\n configuration,\n paymentMethods,\n storedPaymentMethod,\n onStoredCardRemoved,\n}: StoredCardComponentProps): h.JSX.Element | null {\n const storedCardElementRef = useRef<HTMLDivElement>(null);\n const adyenCheckoutRef = useRef<ICore>();\n const customCardRef = useRef<CustomCard>();\n const { i18n } = useI18n();\n const [payButtonDisabled, setPayButtonDisabled] = useState<boolean>(true);\n const [securityCodePolicy, setSecurityCodePolicy] = useState<\"hidden\" | \"optional\" | \"required\">(\"required\");\n const [askConfirmRemoveStoredCard, setAskConfirmRemoveStoredCard] = useState<boolean>(false);\n const [formErrors, setFormErrors] = useState<StoredCardFormError>({\n encryptedSecurityCode: { visible: false },\n });\n const {\n activePaymentMethod,\n setActivePaymentMethod,\n activeStoredPaymentMethodId,\n setActiveStoredPaymentMethodId,\n isStoredCardInitialized,\n updateStoredCardInitialization,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n threeDSecureActive,\n isSolePaymentMethod,\n registerSubmitHandler,\n unregisterSubmitHandler,\n } = usePaymentMethodGroup();\n\n // In sole mode there is only one stored card, so being the active payment method is enough.\n // In normal mode both the method and the specific card ID must match.\n const isActive = isSolePaymentMethod\n ? activePaymentMethod === \"storedcard\"\n : activePaymentMethod === \"storedcard\" && activeStoredPaymentMethodId === storedPaymentMethod.id;\n\n const resolvedTheme = useResolvedTheme(configuration.theme);\n\n async function handleSubmitClick(): Promise<void> {\n await submitCardWithGate(configuration.paymentFlow, () => customCardRef.current);\n }\n\n useEffect(() => {\n const ready = isActive && isStoredCardInitialized[storedPaymentMethod.id];\n if (!ready) {\n // Nothing selected yet, or a different payment method is active - tell the\n // host explicitly so a custom submit button can default to disabled.\n configuration.onCardValidityChanged?.(false, false);\n return;\n }\n\n registerSubmitHandler(handleSubmitClick);\n return () => {\n unregisterSubmitHandler(handleSubmitClick);\n configuration.onCardValidityChanged?.(false, false);\n };\n }, [isActive, isStoredCardInitialized[storedPaymentMethod.id], registerSubmitHandler, unregisterSubmitHandler]);\n\n const { handleOnSubmit, handleOnSubmitAdditionalData, handlePaymentCompleted, handlePaymentFailed } =\n createAdyenPaymentHandlers({\n configuration,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n enrichSubmitData: (data) => ({\n ...data,\n paymentMethod: {\n ...data.paymentMethod,\n storedPaymentMethodId: storedPaymentMethod.id,\n },\n }),\n });\n\n function handleOnError(_: AdyenCheckoutError, __?: UIElement<UIElementProps> | undefined) {\n handleError({ key: \"error.unknownError\" });\n }\n\n const initializeAdyenComponent = async () => {\n adyenCheckoutRef.current = await AdyenCheckout({\n clientKey: paymentMethods.clientKey,\n environment: configuration.environment,\n locale: configuration.locale,\n countryCode: configuration.countryCode,\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n paymentMethodsResponse: paymentMethods.paymentMethods,\n onError: handleOnError,\n onAdditionalDetails: handleOnSubmitAdditionalData,\n onPaymentCompleted: handlePaymentCompleted,\n onPaymentFailed: handlePaymentFailed,\n });\n\n customCardRef.current = new CustomCard(adyenCheckoutRef.current, {\n brands: [storedPaymentMethod.brand!],\n styles: getAdyenFieldStyles(resolvedTheme),\n onSubmit: handleOnSubmit,\n onConfigSuccess() {\n updateStoredCardInitialization(storedPaymentMethod.id, true);\n },\n onBrand: (event) => {\n setSecurityCodePolicy(event.cvcPolicy);\n },\n onValidationError: (event) => {\n const defaultErrors: StoredCardFormError = {\n encryptedSecurityCode: { visible: false, message: undefined },\n };\n\n event\n .filter((x) => x.error)\n .forEach((x) => {\n defaultErrors[x.fieldType as StoredCardFormErrorField].visible = true;\n defaultErrors[x.fieldType as StoredCardFormErrorField].message = x.errorI18n;\n });\n\n setFormErrors(defaultErrors);\n },\n onAllValid: (event) => {\n setPayButtonDisabled(!event.allValid);\n configuration.onCardValidityChanged?.(event.allValid, true);\n },\n placeholders: configuration.placeholders,\n // Adyen appears to ignore challengeWindowSize on CustomCard; kept for parity with the wallet configs.\n challengeWindowSize: \"05\",\n });\n\n if (storedCardElementRef.current) {\n customCardRef.current.mount(storedCardElementRef.current);\n }\n };\n\n useEffect(() => {\n if (isActive && !isStoredCardInitialized[storedPaymentMethod.id]) {\n initializeAdyenComponent();\n }\n }, [configuration, isActive]);\n\n useAdyenLocaleReinit(\n configuration,\n () => Boolean(customCardRef.current && isStoredCardInitialized[activeStoredPaymentMethodId!]),\n () => {\n initializeAdyenComponent();\n setFormErrors({ encryptedSecurityCode: { visible: false, message: undefined } });\n }\n );\n\n useEffect(() => {\n setAskConfirmRemoveStoredCard(false);\n }, [activePaymentMethod, activeStoredPaymentMethodId]);\n\n // When the 3DS challenge replaces the stored-card field, move focus into the container.\n useFocusOnActivate(storedCardElementRef, threeDSecureActive && isActive);\n\n // Keep this guard below every hook call: returning early above a hook violates the\n // rules of hooks and corrupts hook ordering across renders.\n // Deliberately NOT isObscuredByThreeDS(\"storedcard\"): several stored-card components can be\n // mounted at once, so the one running the 3DS challenge is matched by card id via isActive.\n if (threeDSecureActive && !isActive) {\n return null;\n }\n\n function handleBoxChange() {\n setActivePaymentMethod(\"storedcard\");\n setActiveStoredPaymentMethodId(storedPaymentMethod.id);\n }\n\n function handleAskToConfirmRemoveCard() {\n setAskConfirmRemoveStoredCard(true);\n }\n\n function handleCancelRemoveStoredCard() {\n setAskConfirmRemoveStoredCard(false);\n }\n\n async function handleConfirmRemoveStoredCard() {\n const { disableToken } = configuration.paymentFlow;\n\n if (!disableToken) return;\n\n try {\n await disableToken(storedPaymentMethod.id);\n onStoredCardRemoved(storedPaymentMethod.id);\n } catch (error) {\n handleError(toResultMessage(error, \"error.failedToSubmitRemoveStoredPaymentCard\"));\n }\n }\n\n const canRemoveStoredCard = configuration.paymentFlow.disableToken !== undefined;\n\n const headerRight =\n canRemoveStoredCard && isActive && isStoredCardInitialized[storedPaymentMethod.id] ? (\n <div className=\"straumur__stored-card-component__remove-stored-card-button\">\n <button\n onClick={handleAskToConfirmRemoveCard}\n className=\"straumur__stored-card-component__remove-stored-card-button--text\"\n disabled={askConfirmRemoveStoredCard}\n >\n {i18n.t(\"stored-cards.removeStoredCard\")}\n </button>\n </div>\n ) : null;\n\n const confirmSection = (\n <div\n className={`${\"straumur__stored-card-component__confirm-remove-stored-card\"} ${\n askConfirmRemoveStoredCard ? \"straumur__stored-card-component__confirm-remove-stored-card--expanded\" : \"\"\n }`}\n >\n <div className=\"straumur__stored-card-component__confirm-remove-stored-card--header\">\n <WarningIcon />\n <span className=\"straumur__stored-card-component__confirm-remove-stored-card--header--title\">\n {i18n.t(\"stored-cards.removeStoredCardQuestion\")}\n </span>\n </div>\n <div className=\"straumur__stored-card-component__confirm-remove-stored-card--actions\">\n <button\n className=\"straumur__stored-card-component__confirm-remove-stored-card--actions--button\"\n onClick={handleConfirmRemoveStoredCard}\n >\n {i18n.t(\"stored-cards.removeStoredCardQuestionYesRemove\")}\n </button>\n <button\n className=\"straumur__stored-card-component__confirm-remove-stored-card--actions--button\"\n onClick={handleCancelRemoveStoredCard}\n >\n {i18n.t(\"stored-cards.removeStoredCardQuestionCancel\")}\n </button>\n </div>\n </div>\n );\n\n return (\n <PaymentMethodItem\n icon={\n <RenderBrandIcons\n brands={[\n {\n brand: storedPaymentMethod.brand!,\n brandFullName: storedPaymentMethod.name,\n },\n ]}\n />\n }\n title={`•••• ${storedPaymentMethod.lastFour}`}\n isActive={isActive}\n isSole={isSolePaymentMethod}\n onChange={handleBoxChange}\n headerRight={headerRight}\n confirmSection={confirmSection}\n >\n <div\n ref={storedCardElementRef}\n tabIndex={-1}\n style={{\n height: threeDSecureActive ? \"600px\" : \"auto\",\n minWidth: threeDSecureActive ? \"350px\" : \"auto\",\n }}\n >\n {!isStoredCardInitialized[storedPaymentMethod.id] && (\n <div className=\"straumur__stored-card-component__loading-text\">\n <LoaderIcon />\n </div>\n )}\n\n <div\n className=\"straumur__stored-card-component__form\"\n style={{\n opacity: isStoredCardInitialized[storedPaymentMethod.id] && !threeDSecureActive ? 1 : 0,\n position: isStoredCardInitialized[storedPaymentMethod.id] && !threeDSecureActive ? \"relative\" : \"absolute\",\n transition: \"opacity 0.3s ease-in-out\",\n }}\n >\n <div className=\"straumur__stored-card-component__form--field-wrapper\">\n <div className=\"straumur__stored-card-component__form--wrapper\">\n <label className=\"straumur__stored-card-component__form--wrapper--label straumur__stored-card-component__form--wrapper--label--readonly\">\n {i18n.t(\"stored-cards.expiryDate\")}\n </label>\n <span className=\"straumur__stored-card-component__form--wrapper--input straumur__stored-card-component__form--wrapper--input--readonly\">\n {storedPaymentMethod.expiryMonth}/{storedPaymentMethod.expiryYear}\n </span>\n </div>\n\n <div className=\"straumur__stored-card-component__form--wrapper\">\n {(securityCodePolicy === \"optional\" || securityCodePolicy === \"required\") && (\n <Fragment>\n <label\n className={`${\"straumur__stored-card-component__form--wrapper--label\"} ${\n formErrors.encryptedSecurityCode.visible\n ? \"straumur__stored-card-component__form--wrapper--label--error\"\n : \"\"\n }`}\n >\n {securityCodePolicy === \"optional\"\n ? i18n.t(\"stored-cards.securityCode3DigitsOptional\")\n : i18n.t(\"stored-cards.securityCode3Digits\")}\n </label>\n <span\n className={`${\"straumur__stored-card-component__form--wrapper--input\"} ${\n formErrors.encryptedSecurityCode.visible\n ? \"straumur__stored-card-component__form--wrapper--input--error\"\n : \"\"\n }`}\n data-cse=\"encryptedSecurityCode\"\n role=\"group\"\n aria-label={i18n.t(\"stored-cards.securityCode3Digits\")}\n >\n <div className=\"straumur__stored-card-component__form--wrapper--label--info\">\n <Tooltip content={i18n.t(\"stored-cards.securityCode3DigitsInfo\")}>\n <InfoIcon />\n </Tooltip>\n </div>\n </span>\n </Fragment>\n )}\n {formErrors.encryptedSecurityCode.visible && (\n <span className=\"straumur__stored-card-component__form--wrapper--error\">\n {formErrors.encryptedSecurityCode.message}\n </span>\n )}\n </div>\n </div>\n\n {!configuration.hideSubmitButton && (\n <button\n className=\"straumur__stored-card-component__submit-button\"\n disabled={payButtonDisabled}\n onClick={handleSubmitClick}\n >\n {paymentMethods.minorUnitsAmount === 0\n ? i18n.t(\"stored-cards.saveCardDetails\")\n : paymentMethods.formattedAmount}\n </button>\n )}\n </div>\n </div>\n </PaymentMethodItem>\n );\n}\n\nexport default StoredCardComponent;\n","import styleInject from '#style-inject';styleInject(\".straumur__stored-card-component__remove-stored-card-button{margin-left:auto}.straumur__stored-card-component__remove-stored-card-button--text{color:var(--straumur__color-danger-text);text-decoration:none;background:none;border:none;cursor:pointer;transition:all .2s ease}.straumur__stored-card-component__remove-stored-card-button--text:disabled{cursor:not-allowed;color:var(--straumur__color-secondary)}.straumur__stored-card-component__confirm-remove-stored-card{background-color:var(--straumur__color-warning-bg);border-radius:var(--straumur__border-radius-s);max-height:0;overflow:hidden;transition:all .3s ease;opacity:0}.straumur__stored-card-component__confirm-remove-stored-card--expanded{padding:var(--straumur__space-xxlg);max-height:600px;opacity:1}.straumur__stored-card-component__confirm-remove-stored-card--header{display:flex;align-items:center;gap:var(--straumur__space-lg);color:var(--straumur__color-text);padding-bottom:var(--straumur__space-xxlg)}.straumur__stored-card-component__confirm-remove-stored-card--actions{display:flex;gap:var(--straumur__space-lg);justify-content:end}.straumur__stored-card-component__confirm-remove-stored-card--actions--button{color:var(--straumur__color-warning-text);background:none;border:none;cursor:pointer;text-decoration:none;font-weight:700}.straumur__stored-card-component__loading-text{display:flex;justify-content:center}.straumur__stored-card-component__form{display:flex;padding-top:var(--straumur__space-xxlg);flex-direction:column;gap:var(--straumur__space-5xlg)}.straumur__stored-card-component__form--wrapper{display:flex;flex-direction:column;justify-items:start;position:relative;width:100%}.straumur__stored-card-component__form--wrapper--error{color:var(--straumur__color-red-beta);font-size:12px}.straumur__stored-card-component__form--wrapper--label{transform:translate(10px) translateY(-50%);z-index:1;background:linear-gradient(to top,var(--straumur__color-secondary-gamma) 53%,var(--straumur__color-transparent) 50%);position:absolute;font-weight:500;font-size:14px;padding:0 var(--straumur__space-xxs)}.straumur__stored-card-component__form--wrapper--label--readonly{background:linear-gradient(to top,var(--straumur__color-gray-epsilon) 53%,var(--straumur__color-transparent) 50%)}.straumur__stored-card-component__form--wrapper--label--error{color:var(--straumur__color-red-beta);background:linear-gradient(to top,var(--straumur__color-red-gamma) 53%,var(--straumur__color-transparent) 50%);font-size:13px;font-weight:500}.straumur__stored-card-component__form--wrapper--label--info{position:absolute;top:33%;right:var(--straumur__space-md)}.straumur__stored-card-component__form--wrapper--input{background:var(--straumur__color-secondary-gamma);color:var(--straumur__color-text);display:flex;align-items:center;border:1px solid var(--straumur__color-transparent);border-radius:var(--straumur__border-radius-s);font-size:16px;height:48px;outline:none;padding-left:var(--straumur__space-lg);transition:border .2s ease-out,box-shadow .2s ease-out;position:relative}.straumur__stored-card-component__form--wrapper--input--readonly{background-color:var(--straumur__color-gray-epsilon)}.straumur__stored-card-component__form--wrapper--input:hover{border:1px solid var(--straumur__color-cosmos-blue-delta)}.straumur__stored-card-component__form--wrapper--input--readonly:hover{border:1px solid var(--straumur__color-transparent)}.straumur__stored-card-component__form--wrapper--input--error{background:var(--straumur__color-red-gamma);border:1px solid var(--straumur__color-red-beta)}.straumur__stored-card-component__form--wrapper--input--error:hover{border:1px solid var(--straumur__color-red-beta)}.straumur__stored-card-component__form--field-wrapper{display:flex;width:100%;gap:var(--straumur__space-lg)}.straumur__stored-card-component__submit-button{background:var(--straumur__color-primary);border:none;border-radius:var(--straumur__border-radius-s);color:var(--straumur__color-white);cursor:pointer;font-size:16px;height:40px;outline:none;padding:0 var(--straumur__space-xxlg);transition:background .2s ease-out;width:100%}.straumur__stored-card-component__submit-button:hover{background:var(--straumur__color-primary);border:1px solid var(--straumur__color-border)}.straumur__stored-card-component__submit-button:disabled{background:var(--straumur__color-secondary);border:1px solid var(--straumur__color-border);cursor:not-allowed}\\n\")","import { h } from \"preact\";\n\nconst WarningIcon = () => (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_10650_34968)\">\n <path\n d=\"M12.0011 15C12.6245 15 13.1261 14.4984 13.1261 13.875V7.875C13.1261 7.25391 12.6222 6.75 12.0433 6.75C11.4644 6.75 10.8761 7.25625 10.8761 7.875V13.875C10.8761 14.4984 11.3823 15 12.0011 15ZM12.0011 16.5516C11.1873 16.5516 10.5273 17.2116 10.5273 18.0253C10.5292 18.8391 11.1855 19.5 12.0011 19.5C12.8167 19.5 13.4748 18.84 13.4748 18.0262C13.473 17.2125 12.8167 16.5516 12.0011 16.5516Z\"\n fill=\"#DFAE00\"\n />\n <path\n opacity=\"0.4\"\n d=\"M23.7312 19.5469L13.7328 2.48438C12.9673 1.17188 11.0356 1.17188 10.2649 2.48438L0.271188 19.5469C-0.49803 20.8547 0.460048 22.5 2.00181 22.5H21.9987C23.5343 22.5 24.4953 20.8594 23.7312 19.5469ZM10.8734 7.875C10.8734 7.25391 11.3773 6.75 11.9984 6.75C12.6195 6.75 13.1234 7.25625 13.1234 7.875V13.875C13.1234 14.4961 12.6195 15 12.0406 15C11.4617 15 10.8734 14.4984 10.8734 13.875V7.875ZM11.9984 19.5C11.1846 19.5 10.5246 18.84 10.5246 18.0262C10.5246 17.2125 11.1842 16.5525 11.9984 16.5525C12.8126 16.5525 13.4721 17.2125 13.4721 18.0262C13.4703 18.8391 12.814 19.5 11.9984 19.5Z\"\n fill=\"#DFAE00\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_10650_34968\">\n <rect width=\"24\" height=\"24\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nexport default WarningIcon;\n","import { h, ComponentChildren } from \"preact\";\nimport { PaymentMethodGroupContext, SubmitApi } from \"./payment-method-group-context\";\nimport \"./payment-method-group.css\";\nimport { PaymentMethod } from \"../../models/constants\";\n\ninterface PaymentMethodGroupProps {\n children: ComponentChildren;\n initialValue: PaymentMethod | null;\n isSolePaymentMethod: boolean;\n hasCard: boolean;\n hasGooglePay: boolean;\n hasApplePay: boolean;\n hasStoredPaymentMethods: boolean;\n onSubmitApiReady?: (api: SubmitApi) => void;\n}\n\nfunction PaymentMethodGroup({\n children,\n initialValue,\n isSolePaymentMethod,\n hasCard,\n hasGooglePay,\n hasApplePay,\n hasStoredPaymentMethods,\n onSubmitApiReady,\n}: PaymentMethodGroupProps): h.JSX.Element | null {\n return (\n <PaymentMethodGroupContext\n initialValue={initialValue}\n isSolePaymentMethod={isSolePaymentMethod}\n hasCard={hasCard}\n hasGooglePay={hasGooglePay}\n hasApplePay={hasApplePay}\n hasStoredPaymentMethods={hasStoredPaymentMethods}\n onSubmitApiReady={onSubmitApiReady}\n >\n <div className=\"straumur__payment-method-group\">{children}</div>\n </PaymentMethodGroupContext>\n );\n}\n\nexport default PaymentMethodGroup;\n","import styleInject from '#style-inject';styleInject(\".straumur__payment-method-group{display:flex;flex-direction:column;gap:var(--straumur__space-xxlg);width:100%}\\n\")","import { Fragment, h } from \"preact\";\nimport \"./result-component.css\";\nimport SuccessIcon from \"../../assets/icons/success\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport FailureIcon from \"../../assets/icons/failure\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport { ResultMessage } from \"../../models/models\";\n\nfunction ResultComponent(): h.JSX.Element | null {\n const { error, success } = usePaymentMethodGroup();\n const { i18n } = useI18n();\n\n if (!error && !success) {\n return null;\n }\n\n const renderMessage = (message: ResultMessage) => (\"key\" in message ? i18n.t(message.key) : message.text);\n\n return (\n <div className=\"straumur__result-component\">\n {error && (\n <Fragment>\n <span aria-hidden=\"true\">\n <FailureIcon />\n </span>\n {/* role=\"alert\" announces the failure to screen readers assertively (a declined payment\n was previously silent). */}\n <p className=\"straumur__result-component__error--message\" role=\"alert\">\n {renderMessage(error)}\n </p>\n </Fragment>\n )}\n\n {success && (\n <Fragment>\n <span aria-hidden=\"true\">\n <SuccessIcon />\n </span>\n <p className=\"straumur__result-component__success--message\" role=\"status\">\n {renderMessage(success)}\n </p>\n </Fragment>\n )}\n </div>\n );\n}\n\nexport default ResultComponent;\n","import styleInject from '#style-inject';styleInject(\".straumur__result-component{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;min-height:300px;background-color:var(--straumur__color-white);border-radius:var(--straumur__border-radius-xxlg)}\\n\")","import { h } from \"preact\";\n\nconst SuccessIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"120\" height=\"120\" viewBox=\"0 0 120 120\">\n <circle\n cx=\"60\"\n cy=\"60\"\n r=\"50\"\n fill=\"none\"\n stroke=\"#5b8206\"\n stroke-width=\"5\"\n stroke-dasharray=\"314\"\n stroke-dashoffset=\"314\"\n >\n <animate attributeName=\"stroke-dashoffset\" from=\"314\" to=\"0\" dur=\"1s\" fill=\"freeze\" />\n </circle>\n\n <g transform=\"translate(60,60)\">\n <path\n d=\"M-25 5 L-5 25 L25 -15\"\n fill=\"none\"\n stroke=\"#5b8206\"\n stroke-width=\"6\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-dasharray=\"100\"\n stroke-dashoffset=\"100\"\n >\n <animate attributeName=\"stroke-dashoffset\" from=\"100\" to=\"0\" dur=\"0.5s\" begin=\"1s\" fill=\"freeze\" />\n <animateTransform\n attributeName=\"transform\"\n type=\"scale\"\n from=\"1 1\"\n to=\"1.2 1.2\"\n begin=\"1.5s\"\n dur=\"0.2s\"\n fill=\"freeze\"\n additive=\"sum\"\n />\n <animateTransform\n attributeName=\"transform\"\n type=\"scale\"\n from=\"1.2 1.2\"\n to=\"1 1\"\n begin=\"1.7s\"\n dur=\"0.2s\"\n fill=\"freeze\"\n additive=\"sum\"\n />\n </path>\n </g>\n </svg>\n);\n\nexport default SuccessIcon;\n","import { h } from \"preact\";\n\nconst FailureIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"120\" height=\"120\" viewBox=\"0 0 120 120\">\n <circle\n cx=\"60\"\n cy=\"60\"\n r=\"50\"\n fill=\"none\"\n stroke=\"#d03e00\"\n stroke-width=\"5\"\n stroke-dasharray=\"314\"\n stroke-dashoffset=\"314\"\n >\n <animate attributeName=\"stroke-dashoffset\" from=\"314\" to=\"0\" dur=\"1s\" fill=\"freeze\" />\n </circle>\n\n <g transform=\"translate(60,60)\">\n <g id=\"crossGroup\">\n <line\n x1=\"-20\"\n y1=\"-20\"\n x2=\"20\"\n y2=\"20\"\n stroke=\"#d03e00\"\n stroke-width=\"6\"\n stroke-linecap=\"round\"\n stroke-dasharray=\"57\"\n stroke-dashoffset=\"57\"\n >\n <animate attributeName=\"stroke-dashoffset\" from=\"57\" to=\"0\" dur=\"0.3s\" begin=\"1s\" fill=\"freeze\" />\n </line>\n\n <line\n x1=\"20\"\n y1=\"-20\"\n x2=\"-20\"\n y2=\"20\"\n stroke=\"#d03e00\"\n stroke-width=\"6\"\n stroke-linecap=\"round\"\n stroke-dasharray=\"57\"\n stroke-dashoffset=\"57\"\n >\n <animate attributeName=\"stroke-dashoffset\" from=\"57\" to=\"0\" dur=\"0.3s\" begin=\"1.3s\" fill=\"freeze\" />\n </line>\n </g>\n </g>\n </svg>\n);\n\nexport default FailureIcon;\n","import { Fragment, h, ComponentChildren } from \"preact\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\n\ninterface PaymentMethodsWrapperProps {\n children: ComponentChildren;\n}\n\nfunction PaymentMethodsWrapper({ children }: PaymentMethodsWrapperProps): h.JSX.Element | null {\n const { error, success } = usePaymentMethodGroup();\n\n if (error || success) {\n return null;\n }\n\n return <Fragment>{children}</Fragment>;\n}\n\nexport default PaymentMethodsWrapper;\n","import { h } from \"preact\";\nimport { useState } from \"preact/hooks\";\nimport \"./instant-payments-component.css\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport GooglePayButton from \"../../components/google-pay-button/google-pay-button\";\nimport ApplePayButton from \"../../components/apple-pay-button/apple-pay-button\";\nimport { PaymentMethod } from \"../../models/constants\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\n\ninterface InstantPaymentsComponentProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n}\n\nfunction InstantPaymentsComponent({\n configuration,\n paymentMethods,\n}: InstantPaymentsComponentProps): h.JSX.Element | null {\n const { hasGooglePay, hasApplePay } = usePaymentMethodGroup();\n const [unavailableMethods, setUnavailableMethods] = useState<Set<string>>(new Set());\n\n const handleUnavailable = (method: string) => {\n setUnavailableMethods((prev) => new Set(prev).add(method));\n };\n\n if (!configuration.instantPayments) {\n return null;\n }\n\n // safeguard: filter out any invalid payment methods, only allow applepay and googlepay\n const validInstantPayments: Extract<PaymentMethod, \"googlepay\" | \"applepay\">[] = [\"googlepay\", \"applepay\"];\n const availableInstantPayments = configuration.instantPayments.filter((payment) =>\n validInstantPayments.includes(payment)\n );\n\n // ensure the payment method is actually available from the paymentMethods response\n const finalAvailableInstantPayments = availableInstantPayments.filter((payment) =>\n payment === \"googlepay\" ? hasGooglePay : hasApplePay\n );\n\n const visibleInstantPayments = finalAvailableInstantPayments.filter((payment) => !unavailableMethods.has(payment));\n\n if (finalAvailableInstantPayments.length === 0) {\n return null;\n }\n\n return (\n // The unprefixed instant-payments classes predate the straumur__ convention and may be\n // targeted by host-page styles; keep them alongside the prefixed ones.\n <div\n className={`straumur__instant-payments instant-payments ${\n visibleInstantPayments.length > 1\n ? \"straumur__instant-payments--multiple instant-payments--multiple\"\n : \"straumur__instant-payments--single instant-payments--single\"\n }`}\n style={{ display: visibleInstantPayments.length === 0 ? \"none\" : undefined }}\n >\n {finalAvailableInstantPayments.map((paymentMethod) => {\n if (paymentMethod === \"googlepay\") {\n return (\n <GooglePayButton\n key={paymentMethod}\n configuration={configuration}\n paymentMethods={paymentMethods}\n isInstantPayment={true}\n onUnavailable={() => handleUnavailable(\"googlepay\")}\n />\n );\n }\n if (paymentMethod === \"applepay\") {\n return (\n <ApplePayButton\n key={paymentMethod}\n configuration={configuration}\n paymentMethods={paymentMethods}\n isInstantPayment={true}\n onUnavailable={() => handleUnavailable(\"applepay\")}\n />\n );\n }\n\n // this should never happen due to our filtering above, but typescript safeguard\n return null;\n })}\n </div>\n );\n}\n\nexport default InstantPaymentsComponent;\n","import styleInject from '#style-inject';styleInject(\".instant-payments{display:grid;gap:var(--straumur__space-lg);grid-template-columns:1fr 1fr}.instant-payments--single{grid-template-columns:1fr}@container straumur (max-width: 420px){.instant-payments{grid-template-columns:1fr}}\\n\")","import { Language, TranslationKey, translations } from \"./translations\";\n\nexport class I18nService {\n constructor(\n private language: Language,\n private customLocalizations?: Partial<Record<Language, Partial<Record<TranslationKey, string>>>>\n ) {}\n\n t(key: TranslationKey): string {\n const localizedString = this.customLocalizations?.[this.language]?.[key];\n return localizedString || translations[this.language][key] || key;\n }\n\n setLanguage(language: Language): void {\n this.language = language;\n }\n\n updateCustomLocalizations(\n customLocalizations: Partial<Record<Language, Partial<Record<TranslationKey, string>>>>\n ): void {\n this.customLocalizations = customLocalizations;\n }\n}\n","import { h, ComponentChildren } from \"preact\";\nimport SuccessIcon from \"../../assets/icons/success\";\nimport FailureIcon from \"../../assets/icons/failure\";\nimport LoaderIcon from \"../../assets/icons/loader\";\nimport { ResultMessage, Theme } from \"../../models/models\";\nimport { I18nService } from \"../../localizations/i18n-service\";\nimport { useResolvedTheme } from \"../../utils/custom-hooks/use-resolved-theme\";\n\n// The widget's outer wrapper. Carries data-theme so the dark palette is scoped to the\n// widget (never leaks to the host page); \"system\" resolves live via prefers-color-scheme.\nexport function RootComponent({ children, theme = \"light\" }: { children: ComponentChildren; theme?: Theme }) {\n const resolvedTheme = useResolvedTheme(theme);\n return (\n <div className=\"straumur__root-component\" data-theme={resolvedTheme}>\n {children}\n </div>\n );\n}\n\n/** Full-widget loader shown while session mode fetches its payment methods. */\nexport function LoaderScreen({ theme }: { theme?: Theme }) {\n return (\n <RootComponent theme={theme}>\n <div className=\"straumur__component\">\n <LoaderIcon />\n </div>\n </RootComponent>\n );\n}\n\n/** Full-widget success/failure screen rendered imperatively by the StraumurCheckout class. */\nexport function StatusScreen({\n variant,\n message,\n i18n,\n theme,\n}: {\n variant: \"success\" | \"failure\";\n message: ResultMessage;\n i18n: I18nService;\n theme?: Theme;\n}) {\n return (\n <RootComponent theme={theme}>\n <div className=\"straumur__component\">\n <span aria-hidden=\"true\">{variant === \"success\" ? <SuccessIcon /> : <FailureIcon />}</span>\n {/* Failure is announced assertively (role=\"alert\"); success politely (role=\"status\"). */}\n <p role={variant === \"success\" ? \"status\" : \"alert\"}>{\"key\" in message ? i18n.t(message.key) : message.text}</p>\n </div>\n </RootComponent>\n );\n}\n","import { Language } from \"../localizations/translations\";\nimport { StraumurWebAdvancedConfiguration } from \"../models/models\";\nimport { SuccessResponse } from \"./models\";\n\n// shapes the advanced-mode configuration into the same response object the session-mode\n// payment-methods call returns, so the component tree consumes both modes identically\nexport function normalizeAdvancedConfiguration(\n configuration: StraumurWebAdvancedConfiguration,\n locale: Language\n): SuccessResponse {\n return {\n resultCode: \"Success\",\n clientKey: configuration.clientKey,\n paymentMethods: configuration.paymentMethods,\n minorUnitsAmount: configuration.amount.value,\n currency: configuration.amount.currency,\n amount: configuration.amount.value / 100,\n formattedAmount: configuration.formattedAmount,\n merchantName: configuration.merchantName,\n enableStoreDetails: configuration.enableStoreDetails,\n locale,\n };\n}\n","import {\n StraumurCheckoutConfiguration,\n StraumurWebAdvancedConfiguration,\n StraumurWebConfiguration,\n StraumurWebInternalConfiguration,\n} from \"../models/models\";\nimport { createAdvancedPaymentFlow, createSessionPaymentFlow } from \"../flows/payment-flow\";\nimport { normalizeLocale } from \"../localizations/locale\";\nimport { normalizeAdvancedConfiguration } from \"../services/advanced-normalizer\";\nimport { SuccessResponse } from \"../services/models\";\n\n// Session mode has no countryCode input and the payment-methods response carries none,\n// so it is fixed to Iceland until the backend provides one.\nconst SESSION_COUNTRY_CODE = \"IS\";\n\nexport function isSessionConfiguration(config: StraumurWebInternalConfiguration): config is StraumurWebConfiguration {\n return typeof config.sessionId === \"string\" && config.sessionId.length > 0;\n}\n\n// the union only protects TypeScript consumers — IIFE consumers get no compile-time checking\nexport function isValidAdvancedConfiguration(config: StraumurWebAdvancedConfiguration): boolean {\n return (\n typeof config.clientKey === \"string\" &&\n config.clientKey.length > 0 &&\n typeof config.countryCode === \"string\" &&\n config.countryCode.length > 0 &&\n typeof config.paymentMethods === \"object\" &&\n config.paymentMethods !== null &&\n typeof config.amount === \"object\" &&\n config.amount !== null &&\n typeof config.amount.value === \"number\" &&\n typeof config.amount.currency === \"string\" &&\n typeof config.onSubmit === \"function\" &&\n typeof config.onAdditionalDetails === \"function\"\n );\n}\n\nexport interface CheckoutInitialization {\n configuration: StraumurCheckoutConfiguration;\n /** The raw advanced configuration when valid; null in session mode or when invalid. */\n advancedConfiguration: StraumurWebAdvancedConfiguration | null;\n /** Advanced mode only: the configuration normalized into a session-style Success response. */\n paymentMethods: SuccessResponse | null;\n initializationFailed: boolean;\n}\n\n/**\n * Maps the public constructor input (session, or the runtime-detected internal advanced\n * configuration) to the internal checkout state. Called exactly once per instance —\n * the returned configuration object's identity drives the components' reinit effects.\n */\nexport function buildCheckoutConfiguration(publicConfig: StraumurWebConfiguration): CheckoutInitialization {\n const config = publicConfig as StraumurWebInternalConfiguration;\n const locale = normalizeLocale(config.locale);\n const isSession = isSessionConfiguration(config);\n\n const configuration: StraumurCheckoutConfiguration = {\n mode: isSession ? \"session\" : \"advanced\",\n sessionId: config.sessionId,\n environment: config.environment,\n countryCode: isSession ? SESSION_COUNTRY_CODE : config.countryCode,\n paymentFlow: isSession\n ? createSessionPaymentFlow(config.environment, config.sessionId)\n : createAdvancedPaymentFlow(config),\n onPaymentCompleted: config.onPaymentCompleted,\n onPaymentFailed: config.onPaymentFailed,\n placeholders: config.placeholders,\n locale,\n customLocalizations: config.localizations,\n instantPayments: config.instantPayments,\n theme: config.theme ?? \"light\",\n };\n\n if (isSession) {\n return { configuration, advancedConfiguration: null, paymentMethods: null, initializationFailed: false };\n }\n\n if (!isValidAdvancedConfiguration(config)) {\n return { configuration, advancedConfiguration: null, paymentMethods: null, initializationFailed: true };\n }\n\n return {\n configuration,\n advancedConfiguration: config,\n paymentMethods: normalizeAdvancedConfiguration(config, locale),\n initializationFailed: false,\n };\n}\n"],"mappings":"AAAA,OAAS,KAAAA,GAAG,UAAAC,OAAc,SCCD,SAARC,EAA6BC,EAAK,CAAE,SAAAC,CAAS,EAAI,CAAC,EAAG,CAC1D,GAAI,CAACD,GAAO,OAAO,SAAa,IAAa,OAE7C,IAAME,EAAO,SAAS,MAAQ,SAAS,qBAAqB,MAAM,EAAE,CAAC,EAC/DC,EAAQ,SAAS,cAAc,OAAO,EAC5CA,EAAM,KAAO,WAETF,IAAa,OACXC,EAAK,WACPA,EAAK,aAAaC,EAAOD,EAAK,UAAU,EAK1CA,EAAK,YAAYC,CAAK,EAGpBA,EAAM,WACRA,EAAM,WAAW,QAAUH,EAE3BG,EAAM,YAAY,SAAS,eAAeH,CAAG,CAAC,CAElD,CCvB8BI,EAAY;AAAA,CAA82F,ECAl6F,IAAMC,GAAS,KACN,CACL,iBAAkB,mEAClB,oBAAqB,2DAErB,wBAAyB,kBACzB,iBAAkB,UAClB,iBAAkB,UAClB,uBAAwB,eAC1B,GAaWC,GAAMD,GAAO,ECnB1B,SAASE,GAAWC,EAAsC,CACxD,OAAQA,EAAa,CACnB,IAAK,OACH,OAAOC,GAAI,iBACb,IAAK,OACH,OAAOA,GAAI,oBACb,QACE,MAAM,IAAI,MAAM,wBAAwBD,CAAW,EAAE,CACzD,CACF,CAEO,SAASE,GAAkBF,EAA8BG,EAA8B,CAC5F,OAAO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AI,CAAC,KAAK,UACR,eAAQ,KAAK,4EAA4E,EAClF,GAGT,IAAMsB,EAAY,KAAK,UAAU,cAAc,EAE/C,OAAKA,GACH,QAAQ,KACN,6GACF,EAGKA,CACT,CACF,EAEOC,GAAQ7B","names":["h","render","styleInject","css","insertAt","head","style","styleInject","getEnv","env","getBaseUrl","environment","env","getPaymentMethods","body","createPaymentRequest","createDetailsRequest","postDisableTokenRequest","translations","isTranslationKey","value","setupPaymentMethods","environment","sessionId","fetchResponse","getPaymentMethods","contentType","errorMessage","serverErrorMessage","isTranslationKey","normalizeLocale","locale","h","h","useState","styleInject","h","createContext","useState","useContext","useCallback","useRef","useLayoutEffect","PaymentMethodContext","defaultIsInitialized","PaymentMethodGroupContext","children","initialValue","isSolePaymentMethod","hasCard","hasGooglePay","hasApplePay","hasStoredPaymentMethods","onSubmitApiReady","activePaymentMethod","setActivePaymentMethod","activeSubmitHandlerRef","registerSubmitHandler","handler","unregisterSubmitHandler","triggerSubmit","activeStoredPaymentMethodId","setActiveStoredPaymentMethodId","threeDSecureActive","setThreeDSecureActive","isPaymentMethodInitialized","setIsPaymentMethodInitialized","isStoredCardInitialized","setIsStoredCardInitialized","success","setSuccess","error","setError","updatePaymentMethodInitialization","paymentMethod","isInitialized","prevState","updateStoredCardInitialization","storedPaymentMethod","isObscuredByThreeDS","method","handleError","handleSuccess","usePaymentMethodGroup","context","h","createContext","useContext","I18nContext","I18nProvider","children","i18nService","onLanguageChange","changeLanguage","newLanguage","useI18n","context","h","CardIcon","card_default","Fragment","h","h","MasterCardIcon","opacity","mastercard_default","h","VisaIcon","opacity","visa_default","h","MaestroIcon","opacity","maestro_default","h","AmexIcon","opacity","amex_default","h","JcbIcon","opacity","jcb_default","h","DinersIcon","opacity","diners_default","h","DiscoverIcon","opacity","discover_default","h","CupIcon","opacity","cup_default","h","styleInject","useRef","useState","Tooltip","children","content","isVisible","setIsVisible","triggerRef","h","useEffect","useState","useMediaQuery","query","getMatch","matches","setMatches","mediaQueryList","listener","event","RenderBrandIcons","brands","brandHidden","limit","isWidth380","useMediaQuery","widthLimit","brandToShow","brand","brandName","x","h","Fragment","index","Tooltip","RenderBrandIcon","defaultToBrandName","visa_default","mastercard_default","maestro_default","amex_default","jcb_default","diners_default","discover_default","cup_default","Fragment","h","useRef","useState","useEffect","AdyenCheckout","CustomCard","h","InfoIcon","info_default","h","LoaderIcon","loader_default","h","CheckmarkIcon","color","checkmark_default","h","BrandOption","brand","brandName","isSelected","onBrandClick","handleKeyDown","e","h","RenderBrandIcon","checkmark_default","RenderDualBrandComponent","dualBrandConfiguration","selectedBrand","RESULT_CODES","toResultCode","value","PaymentFlowError","messageKey","messageText","toResultMessage","error","fallbackKey","createSessionPaymentFlow","environment","sessionId","data","body","fetchResponse","createPaymentRequest","response","createDetailsRequest","storedPaymentMethodId","postDisableTokenRequest","createAdvancedPaymentFlow","configuration","invokeHostHandler","invoke","resolve","reject","thrownErrorKey","rejectWithFlowError","flow","res","rej","errorMessage","onDisableToken","runBeforeSubmit","paymentFlow","beforeSubmit","submitCardWithGate","getElement","createBeforeSubmitClickHandler","resolve","reject","result","valid","FAILED_RESULT_CODES","createAdyenPaymentHandlers","options","configuration","handleSuccess","handleError","setThreeDSecureActive","enrichSubmitData","onSubmitStart","dispatchResultFromAdditionalDetails","failureMessage","failureResultMessage","dispatchFinalResult","resultCode","handleOnSubmit","state","_","actions","paymentFlow","runBeforeSubmit","data","action","errorMessage","error","toResultMessage","handleOnSubmitAdditionalData","handlePaymentCompleted","toResultCode","handlePaymentFailed","useEffect","useAdyenLocaleReinit","configuration","isReady","reinitialize","useEffect","useFocusOnActivate","ref","active","useEffect","useState","DARK_QUERY","systemPrefersDark","useResolvedTheme","theme","systemDark","setSystemDark","query","onChange","event","getAdyenFieldStyles","theme","CardForm","configuration","paymentMethods","onBrandHidden","cardElementRef","useRef","adyenCheckoutRef","customCardRef","i18n","useI18n","payButtonDisabled","setPayButtonDisabled","useState","securityCodePolicy","setSecurityCodePolicy","storePaymentMethod","setStorePaymentMethod","isDualBrand","setIsDualBrand","dualBrandConfiguration","setDualBrandConfiguration","selectedBrand","setSelectedBrand","storePaymentMethodRef","formErrors","setFormErrors","activePaymentMethod","isPaymentMethodInitialized","updatePaymentMethodInitialization","handleSuccess","handleError","setThreeDSecureActive","threeDSecureActive","isObscuredByThreeDS","hasCard","registerSubmitHandler","unregisterSubmitHandler","usePaymentMethodGroup","resolvedTheme","useResolvedTheme","handleSubmitClick","submitCardWithGate","useEffect","schemeBrands","x","handleOnSubmit","handleOnSubmitAdditionalData","handlePaymentCompleted","handlePaymentFailed","createAdyenPaymentHandlers","data","handleOnError","_","__","initializeAdyenComponent","AdyenCheckout","CustomCard","getAdyenFieldStyles","event","selectedBrands","defaultErrors","useAdyenLocaleReinit","dualBrandListener","e","handleStorePaymentMethodChange","useFocusOnActivate","h","loader_default","Fragment","Tooltip","info_default","RenderDualBrandComponent","checkmark_default","card_form_default","h","styleInject","PaymentMethodItem","icon","title","isActive","isSole","onChange","children","headerRight","confirmSection","h","payment_method_item_default","CardComponent","configuration","paymentMethods","i18n","useI18n","brandHidden","setBrandHidden","useState","activePaymentMethod","setActivePaymentMethod","isObscuredByThreeDS","isSolePaymentMethod","hasCard","usePaymentMethodGroup","brands","x","h","payment_method_item_default","card_default","RenderBrandIcons","card_form_default","card_component_default","h","useState","styleInject","h","GooglePayIcon","googlepay_default","styleInject","h","Fragment","h","useEffect","useRef","AdyenCheckout","ApplePay","GooglePay","CANCEL","WALLETS","core","configuration","paymentMethods","walletConfig","handleOnSubmit","applePayConfiguration","createBeforeSubmitClickHandler","ApplePay","googlePayConfiguration","GooglePay","WalletButton","method","isInstantPayment","onUnavailable","wallet","walletElementRef","useRef","adyenCheckoutRef","walletRef","isPaymentMethodInitialized","updatePaymentMethodInitialization","handleSuccess","handleError","setThreeDSecureActive","threeDSecureActive","isObscuredByThreeDS","setActivePaymentMethod","activePaymentMethod","usePaymentMethodGroup","handleOnSubmitAdditionalData","handlePaymentCompleted","handlePaymentFailed","createAdyenPaymentHandlers","handleOnError","data","_","CANCEL","markUnavailable","initializeAdyenComponent","AdyenCheckout","x","useEffect","useAdyenLocaleReinit","h","Fragment","loader_default","wallet_button_default","GooglePayButton","props","h","wallet_button_default","google_pay_button_default","GooglePayComponent","configuration","paymentMethods","i18n","useI18n","activePaymentMethod","setActivePaymentMethod","isObscuredByThreeDS","isSolePaymentMethod","hasGooglePay","usePaymentMethodGroup","isUnavailable","setIsUnavailable","useState","x","h","payment_method_item_default","googlepay_default","google_pay_button_default","google_pay_component_default","h","useState","styleInject","h","ApplePayIcon","applepay_default","styleInject","h","ApplePayButton","props","h","wallet_button_default","apple_pay_button_default","ApplePayComponent","configuration","paymentMethods","i18n","useI18n","activePaymentMethod","setActivePaymentMethod","isObscuredByThreeDS","isSolePaymentMethod","hasApplePay","usePaymentMethodGroup","isUnavailable","setIsUnavailable","useState","x","h","payment_method_item_default","applepay_default","apple_pay_button_default","apple_pay_component_default","Fragment","h","Fragment","h","useEffect","useRef","useState","styleInject","AdyenCheckout","CustomCard","h","WarningIcon","warning_default","StoredCardComponent","configuration","paymentMethods","storedPaymentMethod","onStoredCardRemoved","storedCardElementRef","useRef","adyenCheckoutRef","customCardRef","i18n","useI18n","payButtonDisabled","setPayButtonDisabled","useState","securityCodePolicy","setSecurityCodePolicy","askConfirmRemoveStoredCard","setAskConfirmRemoveStoredCard","formErrors","setFormErrors","activePaymentMethod","setActivePaymentMethod","activeStoredPaymentMethodId","setActiveStoredPaymentMethodId","isStoredCardInitialized","updateStoredCardInitialization","handleSuccess","handleError","setThreeDSecureActive","threeDSecureActive","isSolePaymentMethod","registerSubmitHandler","unregisterSubmitHandler","usePaymentMethodGroup","isActive","resolvedTheme","useResolvedTheme","handleSubmitClick","submitCardWithGate","useEffect","handleOnSubmit","handleOnSubmitAdditionalData","handlePaymentCompleted","handlePaymentFailed","createAdyenPaymentHandlers","data","handleOnError","_","__","initializeAdyenComponent","AdyenCheckout","CustomCard","getAdyenFieldStyles","event","defaultErrors","x","useAdyenLocaleReinit","useFocusOnActivate","handleBoxChange","handleAskToConfirmRemoveCard","handleCancelRemoveStoredCard","handleConfirmRemoveStoredCard","disableToken","error","toResultMessage","headerRight","h","confirmSection","warning_default","payment_method_item_default","RenderBrandIcons","loader_default","Fragment","Tooltip","info_default","stored_card_component_default","useState","StoredCardContainerComponent","configuration","paymentMethods","storedPaymentMethods","setStoredPaymentMethods","useState","isObscuredByThreeDS","hasStoredPaymentMethods","usePaymentMethodGroup","handleStoredCardRemoved","storedPaymentMethodId","prevStoredPaymentMethods","storedPaymentMethod","h","Fragment","stored_card_component_default","stored_card_container_component_default","h","styleInject","PaymentMethodGroup","children","initialValue","isSolePaymentMethod","hasCard","hasGooglePay","hasApplePay","hasStoredPaymentMethods","onSubmitApiReady","h","PaymentMethodGroupContext","payment_method_group_default","Fragment","h","styleInject","h","SuccessIcon","success_default","h","FailureIcon","failure_default","ResultComponent","error","success","usePaymentMethodGroup","i18n","useI18n","renderMessage","message","h","Fragment","failure_default","success_default","result_component_default","Fragment","h","PaymentMethodsWrapper","children","error","success","usePaymentMethodGroup","h","Fragment","payment_methods_wrapper_default","h","useState","styleInject","InstantPaymentsComponent","configuration","paymentMethods","hasGooglePay","hasApplePay","usePaymentMethodGroup","unavailableMethods","setUnavailableMethods","useState","handleUnavailable","method","prev","validInstantPayments","finalAvailableInstantPayments","payment","visibleInstantPayments","h","paymentMethod","google_pay_button_default","apple_pay_button_default","instant_payments_component_default","determineInitialState","hasCard","hasGooglePay","hasApplePay","storedCount","instantPayments","gpayInStandard","x","apayInStandard","StraumurCheckoutContainer","configuration","paymentMethods","onSubmitApiReady","methods","stored","isAllowed","method","hasStoredPaymentMethods","initialPaymentMethod","isSolePaymentMethod","h","payment_method_group_default","payment_methods_wrapper_default","instant_payments_component_default","stored_card_container_component_default","card_component_default","google_pay_component_default","apple_pay_component_default","result_component_default","straumur_checkout_container_default","AdyenCheckout","I18nService","language","customLocalizations","key","translations","h","RootComponent","children","theme","resolvedTheme","useResolvedTheme","h","LoaderScreen","loader_default","StatusScreen","variant","message","i18n","success_default","failure_default","normalizeAdvancedConfiguration","configuration","locale","SESSION_COUNTRY_CODE","isSessionConfiguration","config","isValidAdvancedConfiguration","buildCheckoutConfiguration","publicConfig","locale","normalizeLocale","isSession","configuration","createSessionPaymentFlow","createAdvancedPaymentFlow","normalizeAdvancedConfiguration","StraumurCheckout","publicConfig","initialization","buildCheckoutConfiguration","I18nService","selector","render","h","LoaderScreen","response","setupPaymentMethods","error","RootComponent","I18nProvider","language","straumur_checkout_container_default","api","message","StatusScreen","redirectResult","redirectContext","handleOnSubmitAdditionalData","createAdyenPaymentHandlers","AdyenCheckout","newConfig","locale","rest","normalizeLocale","triggered","straumur_checkout_default"]}
1
+ {"version":3,"sources":["../src/straumur-checkout.tsx","#style-inject:#style-inject","../src/styles/main.css","../src/env.ts","../src/adapter/straumur-adapter.ts","../src/localizations/translations.ts","../src/services/straumur-service.ts","../src/localizations/locale.ts","../src/features/straumur-checkout-container.tsx","../src/features/card/card-component.tsx","../src/features/card/card-component.css","../src/components/payment-method-group/payment-method-group-context.tsx","../src/localizations/i18n-context.tsx","../src/assets/icons/card.tsx","../src/utils/renderBrandIcons.tsx","../src/assets/icons/mastercard.tsx","../src/assets/icons/visa.tsx","../src/assets/icons/maestro.tsx","../src/assets/icons/amex.tsx","../src/assets/icons/jcb.tsx","../src/assets/icons/diners.tsx","../src/assets/icons/discover.tsx","../src/assets/icons/cup.tsx","../src/components/tooltip/tooltip.tsx","../src/components/tooltip/tooltip.css","../src/utils/custom-hooks/use-media-query.ts","../src/components/card-form/card-form.tsx","../src/assets/icons/info.tsx","../src/assets/icons/loader.tsx","../src/assets/icons/checkmark.tsx","../src/components/render-dual-brand/render-dual-brand.tsx","../src/models/models.ts","../src/flows/payment-flow.ts","../src/components/shared/before-submit-click.ts","../src/components/shared/create-adyen-handlers.ts","../src/utils/custom-hooks/use-adyen-locale-reinit.ts","../src/utils/custom-hooks/use-focus-on-activate.ts","../src/utils/custom-hooks/use-resolved-theme.ts","../src/utils/adyen-field-styles.ts","../src/components/payment-method-item/payment-method-item.tsx","../src/components/payment-method-item/payment-method-item.css","../src/features/google-pay/google-pay-component.tsx","../src/features/google-pay/google-pay-component.css","../src/assets/icons/googlepay.tsx","../src/components/google-pay-button/google-pay-button.css","../src/components/google-pay-button/google-pay-button.tsx","../src/components/shared/wallet-button.tsx","../src/models/constants.ts","../src/features/apple-pay/apple-pay-component.tsx","../src/features/apple-pay/apple-pay-component.css","../src/assets/icons/applepay.tsx","../src/components/apple-pay-button/apple-pay-button.css","../src/components/apple-pay-button/apple-pay-button.tsx","../src/features/stored-card/stored-card-container-component.tsx","../src/features/stored-card/stored-card-component.tsx","../src/features/stored-card/stored-card-component.css","../src/assets/icons/warning.tsx","../src/components/payment-method-group/payment-method-group.tsx","../src/components/payment-method-group/payment-method-group.css","../src/features/result-component/result-component.tsx","../src/features/result-component/result-component.css","../src/assets/icons/success.tsx","../src/assets/icons/failure.tsx","../src/features/payment-methods-wrapper/payment-methods-wrapper.tsx","../src/features/instantPayments/instant-payments-component.tsx","../src/features/instantPayments/instant-payments-component.css","../src/localizations/i18n-service.ts","../src/components/shared/status-screen.tsx","../src/services/advanced-normalizer.ts","../src/config/build-checkout-configuration.ts"],"sourcesContent":["import { h, render } from \"preact\";\nimport \"./styles/main.css\";\nimport {\n ResultMessage,\n StraumurCheckoutConfiguration,\n StraumurCheckoutUpdateOptions,\n StraumurWebAdvancedConfiguration,\n StraumurWebConfiguration,\n} from \"./models/models\";\nimport { setupPaymentMethods } from \"./services/straumur-service\";\nimport { normalizeLocale, PublicLocale } from \"./localizations/locale\";\nimport StraumurCheckoutContainer from \"./features/straumur-checkout-container\";\nimport { PaymentMethodsResponse, SuccessResponse } from \"./services/models\";\nimport { AdyenCheckout } from \"@adyen/adyen-web\";\nimport { I18nProvider } from \"./localizations/i18n-context\";\nimport { I18nService } from \"./localizations/i18n-service\";\nimport { SubmitApi } from \"./components/payment-method-group/payment-method-group-context\";\nimport { createAdyenPaymentHandlers } from \"./components/shared/create-adyen-handlers\";\nimport { LoaderScreen, RootComponent, StatusScreen } from \"./components/shared/status-screen\";\nimport { buildCheckoutConfiguration } from \"./config/build-checkout-configuration\";\n\nclass StraumurCheckout {\n private configuration: StraumurCheckoutConfiguration;\n private advancedConfiguration: StraumurWebAdvancedConfiguration | null = null;\n private paymentMethods: SuccessResponse | null = null;\n private mountElement: HTMLElement | null = null;\n private i18n: I18nService;\n private submitApi: SubmitApi | null = null;\n private initializationFailed = false;\n\n // Public signature accepts the session configuration only. The advanced-mode configuration\n // (internal, used by Straumur Hosted Checkout via the IIFE bundle) is detected at runtime.\n constructor(publicConfig: StraumurWebConfiguration) {\n const initialization = buildCheckoutConfiguration(publicConfig);\n\n this.configuration = initialization.configuration;\n this.advancedConfiguration = initialization.advancedConfiguration;\n this.paymentMethods = initialization.paymentMethods;\n this.initializationFailed = initialization.initializationFailed;\n this.i18n = new I18nService(this.configuration.locale, this.configuration.customLocalizations);\n }\n\n async mount(selector: HTMLElement | string): Promise<void> {\n try {\n this.mountElement = typeof selector === \"string\" ? document.querySelector(selector) : selector;\n\n if (!this.mountElement) {\n return;\n }\n\n if (this.initializationFailed) {\n this.handleError({ key: \"error.failedToInitializeStraumurWebComponent\" });\n return;\n }\n\n if (this.configuration.mode === \"advanced\") {\n this.renderComponent();\n return;\n }\n\n render(<LoaderScreen theme={this.configuration.theme} />, this.mountElement);\n\n const response = await setupPaymentMethods(this.configuration.environment, this.configuration.sessionId!);\n\n if (response.resultCode === \"Error\") {\n this.handleError({ key: response.error });\n return;\n }\n\n this.paymentMethods = response;\n\n this.renderComponent();\n } catch (error) {\n // Never throw into the host page, but leave a trace for the merchant's console.\n console.error(\"[StraumurCheckout] mount() failed:\", error);\n }\n }\n\n private renderComponent(): void {\n if (!this.mountElement) return;\n\n render(\n <RootComponent theme={this.configuration.theme}>\n <I18nProvider\n i18nService={this.i18n}\n onLanguageChange={(language) => {\n this.configuration.locale = language;\n this.renderComponent();\n }}\n >\n <StraumurCheckoutContainer\n configuration={this.configuration}\n paymentMethods={this.paymentMethods!}\n onSubmitApiReady={(api) => {\n this.submitApi = api;\n }}\n />\n </I18nProvider>\n </RootComponent>,\n this.mountElement\n );\n }\n\n handleSuccess(message: ResultMessage) {\n if (!this.mountElement) return;\n\n render(\n <StatusScreen variant=\"success\" message={message} i18n={this.i18n} theme={this.configuration.theme} />,\n this.mountElement\n );\n }\n\n handleError(message: ResultMessage) {\n if (!this.mountElement) return;\n\n render(\n <StatusScreen variant=\"failure\" message={message} i18n={this.i18n} theme={this.configuration.theme} />,\n this.mountElement\n );\n }\n\n // Resolves what the redirect-return Adyen bootstrap needs per mode, rendering the\n // failure screen and returning null when the context cannot be established.\n private async resolveRedirectContext(): Promise<{\n clientKey: string;\n paymentMethods: PaymentMethodsResponse;\n } | null> {\n if (this.configuration.mode === \"advanced\") {\n if (this.initializationFailed || !this.advancedConfiguration) {\n this.handleError({ key: \"error.failedToInitializeStraumurWebComponent\" });\n return null;\n }\n\n return {\n clientKey: this.advancedConfiguration.clientKey,\n paymentMethods: this.advancedConfiguration.paymentMethods,\n };\n }\n\n const response = await setupPaymentMethods(this.configuration.environment, this.configuration.sessionId!);\n\n if (response.resultCode === \"Error\") {\n this.handleError({ key: response.error });\n return null;\n }\n\n return { clientKey: response.clientKey, paymentMethods: response.paymentMethods };\n }\n\n // selector lets a page that never called mount() (e.g. a 3DS redirect return) show the result screens\n async submitDetails(redirectResult: string, selector?: HTMLElement | string) {\n try {\n if (selector) {\n this.mountElement = typeof selector === \"string\" ? document.querySelector(selector) : selector;\n }\n\n const redirectContext = await this.resolveRedirectContext();\n\n if (!redirectContext) {\n return;\n }\n\n const { handleOnSubmitAdditionalData } = createAdyenPaymentHandlers({\n configuration: this.configuration,\n handleSuccess: (message) => this.handleSuccess(message),\n handleError: (message) => this.handleError(message),\n setThreeDSecureActive: () => {},\n dispatchResultFromAdditionalDetails: true,\n });\n\n // Deliberately no core-level onPaymentCompleted/onPaymentFailed here: the handler above\n // dispatches the final result itself, and wiring both would double-fire the merchant callbacks.\n const checkout = await AdyenCheckout({\n environment: this.configuration.environment,\n clientKey: redirectContext.clientKey,\n paymentMethodsResponse: redirectContext.paymentMethods,\n countryCode: this.configuration.countryCode,\n onAdditionalDetails: handleOnSubmitAdditionalData,\n });\n\n checkout.submitDetails({\n details: {\n redirectResult,\n },\n });\n } catch (error) {\n // Same no-throw philosophy as mount(): render the failure in-place, log for the console.\n console.error(\"[StraumurCheckout] submitDetails() failed:\", error);\n this.handleError({ key: \"error.failedToSubmitPaymentDetails\" });\n this.configuration.onPaymentFailed?.({ resultCode: \"Error\" });\n }\n }\n\n updateConfig(newConfig: StraumurCheckoutUpdateOptions): void {\n const { locale, ...rest } = newConfig;\n\n this.configuration = {\n ...this.configuration,\n ...rest,\n // The public vocabulary is short codes; normalizeLocale also tolerates legacy full tags at runtime.\n ...(locale ? { locale: normalizeLocale(locale) } : {}),\n };\n\n // Update i18n if locale or customLocalizations changed\n if (locale) {\n this.i18n.setLanguage(this.configuration.locale);\n }\n if (newConfig.customLocalizations) {\n this.i18n.updateCustomLocalizations(newConfig.customLocalizations);\n }\n\n // Re-render the component with new config\n if (this.mountElement) {\n this.renderComponent();\n }\n }\n\n setLanguage(locale: PublicLocale): void {\n this.updateConfig({\n locale: locale,\n });\n }\n\n destroy(): void {\n // Clean up resources\n if (this.mountElement) {\n render(null, this.mountElement);\n this.mountElement = null;\n }\n this.submitApi = null;\n }\n\n submitCard(): boolean {\n if (!this.mountElement) {\n console.warn(\"[StraumurCheckout] submitCard() called before the component was mounted.\");\n return false;\n }\n\n if (!this.submitApi) {\n console.warn(\"[StraumurCheckout] submitCard() called but the component is not ready yet.\");\n return false;\n }\n\n const triggered = this.submitApi.triggerSubmit();\n\n if (!triggered) {\n console.warn(\n \"[StraumurCheckout] submitCard() called but no card-type payment method is currently active and initialized.\"\n );\n }\n\n return triggered;\n }\n}\n\nexport default StraumurCheckout;\n","\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n ","import styleInject from '#style-inject';styleInject(\":root{--straumur__color-primary: #002649;--straumur__color-secondary: #72889d;--straumur__color-secondary-gamma: #eef0f2;--straumur__color-blue-beta: #bce6f3;--straumur__color-blue-gamma: #eff8fa;--straumur__color-neon-green-zeta: #88a64e;--straumur__color-red-beta: #d96666;--straumur__color-red-gamma: #fff8f5;--straumur__color-gray-epsilon: #e7e7e7;--straumur__color-cosmos-blue-delta: #cdd8e2;--straumur__color-cosmos-blue-gamma: #e6ebef;--straumur__color-white: #ffffff;--straumur__color-transparent: transparent;--straumur__color-text: #00112c;--straumur__color-border: #dbdee2;--straumur__color-warning-text: #775d00;--straumur__color-warning-bg: #fff7db;--straumur__color-danger-text: #d03e00;--straumur__border-radius-xxs: 4px;--straumur__border-radius-xs: 6px;--straumur__border-radius-s: 8px;--straumur__border-radius-md: 10px;--straumur__border-radius-lg: 12px;--straumur__border-radius-xlg: 14px;--straumur__border-radius-xxlg: 16px;--straumur__space-xxs: 4px;--straumur__space-xs: 6px;--straumur__space-s: 8px;--straumur__space-md: 10px;--straumur__space-lg: 12px;--straumur__space-xlg: 14px;--straumur__space-xxlg: 16px;--straumur__space-3xlg: 18px;--straumur__space-4xlg: 20px;--straumur__space-5xlg: 24px;--straumur__space-6xlg: 32px;--straumur__space-7xlg: 40px;--straumur__space-8xlg: 48px;--apple-pay-button-width: 100%;--apple-pay-button-height: 48px;--apple-pay-button-border-radius: var(--straumur__border-radius-lg)}.straumur__root-component{font-family:AkzidenzGroteskPro,sans-serif;color:var(--straumur__color-text);max-width:676px;min-width:320px;container:straumur / inline-size}.straumur__root-component[data-theme=dark]{--straumur__color-primary: #e8edf2;--straumur__color-secondary: #9aa7b5;--straumur__color-secondary-gamma: #2a313b;--straumur__color-blue-beta: #24506b;--straumur__color-blue-gamma: #1b2733;--straumur__color-neon-green-zeta: #9cbf5e;--straumur__color-red-beta: #e08a8a;--straumur__color-red-gamma: #2e2020;--straumur__color-gray-epsilon: #3a424d;--straumur__color-cosmos-blue-delta: #3a424d;--straumur__color-cosmos-blue-gamma: #262d36;--straumur__color-white: #1e232b;--straumur__color-text: #e8edf2;--straumur__color-border: #3a424d;--straumur__color-warning-text: #e6c766;--straumur__color-warning-bg: #2f2a17;--straumur__color-danger-text: #f0895f}.straumur__component *{font-family:inherit}.straumur__render-brand-icons__overflow{color:var(--straumur__color-secondary)}.straumur__component{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;min-height:300px;background-color:var(--straumur__color-white);border-radius:var(--straumur__border-radius-xxlg)}.js-iframe{border:none;color-scheme:auto;height:100%;overflow:hidden;width:100%}.adyen-checkout__threeds2__challenge.adyen-checkout__threeds2__challenge--05{background-color:transparent;display:block;height:inherit;min-height:400px;overflow:hidden;position:relative;width:100%}\\n\")","const getEnv = (): Env => {\n return {\n STAGING_BASE_URL: \"https://checkout-api.staging.straumur.is/api/v1/embeddedcheckout\",\n PRODUCTION_BASE_URL: \"https://greidslugatt.straumur.is/api/v1/embeddedcheckout\",\n\n GET_PAYMENT_METHODS_URL: \"payment-methods\",\n POST_PAYMENT_URL: \"payment\",\n POST_DETAILS_URL: \"details\",\n POST_DISABLE_TOKEN_URL: \"disable-token\",\n };\n};\n\ninterface Env {\n STAGING_BASE_URL: string;\n PRODUCTION_BASE_URL: string;\n\n GET_PAYMENT_METHODS_URL: string;\n POST_PAYMENT_URL: string;\n POST_DETAILS_URL: string;\n POST_DISABLE_TOKEN_URL: string;\n}\n\nexport const env = getEnv();\n","import { ICreateDetailsBody, ICreatePaymentBody, IGetPaymentMethodsBody, IPostDisableTokenBody } from \"./models\";\nimport { env } from \"../env\";\n\nfunction getBaseUrl(environment: \"test\" | \"live\"): string {\n switch (environment) {\n case \"test\":\n return env.STAGING_BASE_URL;\n case \"live\":\n return env.PRODUCTION_BASE_URL;\n default:\n throw new Error(`Unknown environment: ${environment}`);\n }\n}\n\nexport function getPaymentMethods(environment: \"test\" | \"live\", body: IGetPaymentMethodsBody) {\n return fetch(`${getBaseUrl(environment)}/${env.GET_PAYMENT_METHODS_URL}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n });\n}\n\nexport function createPaymentRequest(environment: \"test\" | \"live\", body: ICreatePaymentBody) {\n return fetch(`${getBaseUrl(environment)}/${env.POST_PAYMENT_URL}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n });\n}\n\nexport function createDetailsRequest(environment: \"test\" | \"live\", body: ICreateDetailsBody) {\n return fetch(`${getBaseUrl(environment)}/${env.POST_DETAILS_URL}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n });\n}\n\nexport function postDisableTokenRequest(environment: \"test\" | \"live\", body: IPostDisableTokenBody) {\n return fetch(`${getBaseUrl(environment)}/${env.POST_DISABLE_TOKEN_URL}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(body),\n });\n}\n","export const translations = {\n \"en-US\": {\n \"cards.title\": \"Card payment\",\n \"cards.cardNumber\": \"Card number\",\n \"cards.expiryDate\": \"Expiry date\",\n \"cards.securityCode3Digits\": \"Security code\",\n \"cards.securityCode3DigitsOptional\": \"Security code (optional)\",\n \"cards.securityCode3DigitsInfo\": \"3-digit on the back of the card\",\n \"cards.securityCode4DigitsInfo\": \"4-digit on the back of the card\",\n \"cards.storePaymentMethod\": \"Store payment information\",\n \"cards.saveCardDetails\": \"Save card details\",\n \"googlePay.title\": \"Google Pay\",\n \"applePay.title\": \"Apple Pay\",\n \"stored-cards.expiryDate\": \"Expiry date\",\n \"stored-cards.securityCode3Digits\": \"Security code\",\n \"stored-cards.securityCode3DigitsOptional\": \"Security code (optional)\",\n \"stored-cards.securityCode3DigitsInfo\": \"3-digit on the back of the card\",\n \"stored-cards.securityCode4DigitsInfo\": \"4-digit on the back of the card\",\n \"stored-cards.removeStoredCard\": \"Remove\",\n \"stored-cards.removeStoredCardQuestion\": \"Remove stored payment method?\",\n \"stored-cards.removeStoredCardQuestionYesRemove\": \"Yes, remove\",\n \"stored-cards.removeStoredCardQuestionCancel\": \"Cancel\",\n \"stored-cards.saveCardDetails\": \"Save card details\",\n\n \"success.paymentAuthorized\": \"Payment authorized\",\n\n \"error.unknownError\": \"Unknown error occurred\",\n \"error.failedToInitializeStraumurWebComponent\": \"Failed to initialize Straumur Web component\",\n \"error.failedToInitializePaymentMethods\": \"Failed to initialize payment methods\",\n \"error.failedToSubmitPayment\": \"Failed to submit payment\",\n \"error.paymentFailed\": \"Payment failed\",\n \"error.paymentUnsuccessful\": \"Payment unsuccessful\",\n \"error.failedToSubmitPaymentDetails\": \"Failed to submit payment details\",\n \"error.paymentDetailsFailed\": \"Payment details failed\",\n \"error.googlePayNotAvailable\": \"Google Pay not available\",\n \"error.applePayNotAvailable\": \"Apple Pay not available\",\n \"error.failedToSubmitRemoveStoredPaymentCard\": \"Failed to remove stored payment card\",\n \"error.failedToRemoveStoredPaymentCard\": \"Stored payment card was not removed\",\n },\n \"is-IS\": {\n \"cards.title\": \"Greiða með korti\",\n \"cards.cardNumber\": \"Kortanúmer\",\n \"cards.expiryDate\": \"Gildisdagur\",\n \"cards.securityCode3Digits\": \"Öryggiskóði\",\n \"cards.securityCode3DigitsOptional\": \"Öryggiskóði (valkvætt)\",\n \"cards.securityCode3DigitsInfo\": \"3 tölustafir aftan á kortinu\",\n \"cards.securityCode4DigitsInfo\": \"4 tölustafir aftan á kortinu\",\n \"cards.storePaymentMethod\": \"Vista greiðsluupplýsingar\",\n \"cards.saveCardDetails\": \"Vista kortaupplýsingar\",\n \"googlePay.title\": \"Google Pay\",\n \"applePay.title\": \"Apple Pay\",\n \"stored-cards.expiryDate\": \"Gildisdagur\",\n \"stored-cards.securityCode3Digits\": \"Öryggiskóði\",\n \"stored-cards.securityCode3DigitsOptional\": \"Öryggiskóði (valkvætt)\",\n \"stored-cards.securityCode3DigitsInfo\": \"3 tölustafir aftan á kortinu\",\n \"stored-cards.securityCode4DigitsInfo\": \"4 tölustafir aftan á kortinu\",\n \"stored-cards.removeStoredCard\": \"Fjarlægja\",\n \"stored-cards.removeStoredCardQuestion\": \"Fjarlægja geymdan greiðslumáta?\",\n \"stored-cards.removeStoredCardQuestionYesRemove\": \"Já, fjarlægja\",\n \"stored-cards.removeStoredCardQuestionCancel\": \"Hætta við\",\n \"stored-cards.saveCardDetails\": \"Vista kortaupplýsingar\",\n\n \"success.paymentAuthorized\": \"Greiðsla samþykkt\",\n\n \"error.unknownError\": \"Óþekkt villa kom upp\",\n \"error.failedToInitializeStraumurWebComponent\": \"Mistókst að sækja Straumur Web hluta\",\n \"error.failedToInitializePaymentMethods\": \"Mistókst að sækja greiðslumáta\",\n \"error.failedToSubmitPayment\": \"Mistókst að senda greiðslu\",\n \"error.paymentFailed\": \"Greiðsla mistókst\",\n \"error.paymentUnsuccessful\": \"Greiðsla ekki tekin\",\n \"error.failedToSubmitPaymentDetails\": \"Mistókst að senda greiðsluupplýsingar\",\n \"error.paymentDetailsFailed\": \"Mistókst að sækja greiðsluupplýsingar\",\n \"error.googlePayNotAvailable\": \"Google Pay ekki í boði\",\n \"error.applePayNotAvailable\": \"Apple Pay ekki í boði\",\n \"error.failedToSubmitRemoveStoredPaymentCard\": \"Mistókst að fjarlægja geymdan greiðslumáta\",\n \"error.failedToRemoveStoredPaymentCard\": \"Geymdur greiðslumáti var ekki fjarlægður\",\n },\n};\n\nexport type Language = keyof typeof translations;\nexport type TranslationKey = keyof (typeof translations)[\"en-US\"] | keyof (typeof translations)[\"is-IS\"];\n\n/** Narrows an untrusted string (e.g. a server error code) to a known translation key. */\nexport function isTranslationKey(value: unknown): value is TranslationKey {\n return typeof value === \"string\" && (value in translations[\"en-US\"] || value in translations[\"is-IS\"]);\n}\n","import { getPaymentMethods } from \"../adapter/straumur-adapter\";\nimport { isTranslationKey, TranslationKey } from \"../localizations/translations\";\nimport { StraumurCheckoutPaymentMethods, StraumurCheckoutPaymentMethodsResponse } from \"./models\";\n\nexport async function setupPaymentMethods(\n environment: \"test\" | \"live\",\n sessionId: string\n): Promise<StraumurCheckoutPaymentMethodsResponse> {\n try {\n const fetchResponse = await getPaymentMethods(environment, {\n sessionId,\n });\n\n if (!fetchResponse.ok) {\n const contentType = fetchResponse.headers.get(\"content-type\");\n let errorMessage: TranslationKey = \"error.failedToInitializePaymentMethods\";\n if (contentType && contentType.includes(\"application/json\")) {\n // The server's errorMessage is untrusted input: only adopt it when it is a known\n // translation key, otherwise the raw string would be shown to the buyer verbatim.\n const serverErrorMessage: unknown = (await fetchResponse.json()).errorMessage;\n if (isTranslationKey(serverErrorMessage)) {\n errorMessage = serverErrorMessage;\n }\n }\n\n return {\n resultCode: \"Error\",\n error: errorMessage,\n };\n }\n\n const data: StraumurCheckoutPaymentMethods = await fetchResponse.json();\n\n return {\n resultCode: \"Success\",\n ...data,\n };\n } catch {\n return {\n resultCode: \"Error\",\n error: \"error.failedToInitializePaymentMethods\",\n };\n }\n}\n","import { Language } from \"./translations\";\n\n/** The locale vocabulary of the public API: short codes only. */\nexport type PublicLocale = \"is\" | \"en\";\n\n/**\n * Normalizes a public locale to the internal BCP-47 Language.\n *\n * Tolerates the legacy full tags (\"en-US\"/\"is-IS\") at runtime — 1.x accepted them in\n * setLanguage/updateConfig and IIFE consumers get no compile-time checking — while the\n * public types narrow to short codes. Anything unrecognized falls back to Icelandic,\n * matching the constructor's historical default.\n */\nexport function normalizeLocale(locale: PublicLocale | Language | undefined): Language {\n switch (locale) {\n case \"en\":\n case \"en-US\":\n return \"en-US\";\n default:\n return \"is-IS\";\n }\n}\n","import { h } from \"preact\";\nimport { StraumurCheckoutConfiguration } from \"../models/models\";\nimport { SuccessResponse } from \"../services/models\";\nimport CardComponent from \"./card/card-component\";\nimport GooglePayComponent from \"./google-pay/google-pay-component\";\nimport ApplePayComponent from \"./apple-pay/apple-pay-component\";\nimport StoredCardContainerComponent from \"./stored-card/stored-card-container-component\";\nimport PaymentMethodGroup from \"../components/payment-method-group/payment-method-group\";\nimport ResultComponent from \"./result-component/result-component\";\nimport PaymentMethodsWrapper from \"./payment-methods-wrapper/payment-methods-wrapper\";\nimport InstantPaymentsComponent from \"./instantPayments/instant-payments-component\";\nimport { PaymentMethod } from \"../models/constants\";\nimport { SubmitApi } from \"../components/payment-method-group/payment-method-group-context\";\n\ninterface StraumurCheckoutContainerProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n onSubmitApiReady?: (api: SubmitApi) => void;\n}\n\nexport function determineInitialState(\n hasCard: boolean,\n hasGooglePay: boolean,\n hasApplePay: boolean,\n storedCount: number,\n instantPayments: StraumurCheckoutConfiguration[\"instantPayments\"]\n): { initialPaymentMethod: PaymentMethod | null; isSolePaymentMethod: boolean } {\n const gpayInStandard = hasGooglePay && !instantPayments?.some((x) => x === \"googlepay\");\n const apayInStandard = hasApplePay && !instantPayments?.some((x) => x === \"applepay\");\n\n const totalOptions = storedCount + (hasCard ? 1 : 0) + (gpayInStandard ? 1 : 0) + (apayInStandard ? 1 : 0);\n\n if (totalOptions !== 1) {\n return { initialPaymentMethod: null, isSolePaymentMethod: false };\n }\n\n if (storedCount === 1) return { initialPaymentMethod: \"storedcard\", isSolePaymentMethod: true };\n if (hasCard) return { initialPaymentMethod: \"card\", isSolePaymentMethod: true };\n if (gpayInStandard) return { initialPaymentMethod: \"googlepay\", isSolePaymentMethod: true };\n if (apayInStandard) return { initialPaymentMethod: \"applepay\", isSolePaymentMethod: true };\n\n return { initialPaymentMethod: null, isSolePaymentMethod: false };\n}\n\nfunction StraumurCheckoutContainer({\n configuration,\n paymentMethods,\n onSubmitApiReady,\n}: StraumurCheckoutContainerProps): h.JSX.Element {\n const methods = paymentMethods.paymentMethods.paymentMethods ?? [];\n const stored = paymentMethods.paymentMethods.storedPaymentMethods ?? [];\n\n const isAllowed = (method: PaymentMethod): boolean =>\n !configuration.allowedPaymentMethods || configuration.allowedPaymentMethods.includes(method);\n\n const hasCard = methods.some((x) => x.type === \"scheme\") && isAllowed(\"card\");\n const hasGooglePay = methods.some((x) => x.type === \"googlepay\") && isAllowed(\"googlepay\");\n const hasApplePay = methods.some((x) => x.type === \"applepay\") && isAllowed(\"applepay\");\n const storedCount = isAllowed(\"storedcard\") ? stored.length : 0;\n const hasStoredPaymentMethods = storedCount > 0;\n\n const { initialPaymentMethod, isSolePaymentMethod } = determineInitialState(\n hasCard,\n hasGooglePay,\n hasApplePay,\n storedCount,\n configuration.instantPayments\n );\n\n return (\n <PaymentMethodGroup\n initialValue={initialPaymentMethod}\n isSolePaymentMethod={isSolePaymentMethod}\n hasCard={hasCard}\n hasGooglePay={hasGooglePay}\n hasApplePay={hasApplePay}\n hasStoredPaymentMethods={hasStoredPaymentMethods}\n onSubmitApiReady={onSubmitApiReady}\n >\n <PaymentMethodsWrapper>\n <InstantPaymentsComponent configuration={configuration} paymentMethods={paymentMethods} />\n <StoredCardContainerComponent configuration={configuration} paymentMethods={paymentMethods} />\n <CardComponent configuration={configuration} paymentMethods={paymentMethods} />\n <GooglePayComponent configuration={configuration} paymentMethods={paymentMethods} />\n <ApplePayComponent configuration={configuration} paymentMethods={paymentMethods} />\n </PaymentMethodsWrapper>\n\n <ResultComponent />\n </PaymentMethodGroup>\n );\n}\n\nexport default StraumurCheckoutContainer;\n","import { h } from \"preact\";\nimport { useState } from \"preact/hooks\";\nimport \"./card-component.css\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport CardIcon from \"../../assets/icons/card\";\nimport { BrandHidden, RenderBrandIcons } from \"../../utils/renderBrandIcons\";\nimport { CardComponentProps } from \"./models\";\nimport CardForm from \"../../components/card-form/card-form\";\nimport PaymentMethodItem from \"../../components/payment-method-item/payment-method-item\";\n\nfunction CardComponent({ configuration, paymentMethods }: CardComponentProps): h.JSX.Element | null {\n const { i18n } = useI18n();\n const [brandHidden, setBrandHidden] = useState<BrandHidden[]>([]);\n const { activePaymentMethod, setActivePaymentMethod, isObscuredByThreeDS, isSolePaymentMethod, hasCard } =\n usePaymentMethodGroup();\n\n if (!hasCard || isObscuredByThreeDS(\"card\")) {\n return null;\n }\n\n const schemeBrands = paymentMethods.paymentMethods.paymentMethods!.find((x) => x.type === \"scheme\")!.brands!;\n\n const brands = schemeBrands.map((x) => {\n return { brand: x, brandFullName: x };\n });\n\n return (\n <PaymentMethodItem\n icon={<CardIcon />}\n title={i18n.t(\"cards.title\")}\n isActive={activePaymentMethod === \"card\"}\n isSole={isSolePaymentMethod}\n onChange={() => setActivePaymentMethod(\"card\")}\n headerRight={\n <span className=\"straumur__card-component--brands\">\n <RenderBrandIcons brands={brands} brandHidden={brandHidden} />\n </span>\n }\n >\n <CardForm configuration={configuration} paymentMethods={paymentMethods} onBrandHidden={setBrandHidden} />\n </PaymentMethodItem>\n );\n}\n\nexport default CardComponent;\n","import styleInject from '#style-inject';styleInject(\".straumur__card-component--brands{display:flex;margin-left:auto;align-items:center;gap:var(--straumur__space-xxs)}.straumur__card-component__expandable{background:var(--straumur__color-white)}.straumur__card-component__loading-text{display:flex;justify-content:center}.straumur__card-component__form{display:flex;padding-top:var(--straumur__space-xxlg);flex-direction:column;gap:var(--straumur__space-5xlg)}.straumur__card-component__form--wrapper{display:flex;flex-direction:column;justify-items:start;position:relative;width:100%}.straumur__card-component__form--wrapper--error{color:var(--straumur__color-red-beta);font-size:12px}.straumur__card-component__form--wrapper--label{transform:translate(var(--straumur__space-md)) translateY(-50%);z-index:1;background:linear-gradient(to top,var(--straumur__color-secondary-gamma) 53%,var(--straumur__color-transparent) 50%);position:absolute;font-weight:500;font-size:14px;padding:0 var(--straumur__space-xxs)}.straumur__card-component__form--wrapper--label--error{color:var(--straumur__color-red-beta);background:linear-gradient(to top,var(--straumur__color-red-gamma) 53%,var(--straumur__color-transparent) 50%)}.straumur__card-component__form--wrapper--label--info{position:absolute;top:33%;right:var(--straumur__space-md)}.straumur__card-component__form--wrapper--input{background:var(--straumur__color-secondary-gamma);color:var(--straumur__color-text);display:block;font-family:inherit;border:1px solid var(--straumur__color-transparent);border-radius:var(--straumur__border-radius-s);font-size:16px;height:48px;outline:none;padding-left:var(--straumur__space-lg);transition:border .2s ease-out,box-shadow .2s ease-out}.straumur__card-component__form--wrapper--input:hover{border:1px solid var(--straumur__color-cosmos-blue-delta)}.straumur__card-component__form--wrapper--input--error{background:var(--straumur__color-red-gamma);border:1px solid var(--straumur__color-red-beta)}.straumur__card-component__form--wrapper--input--error:hover{border:1px solid var(--straumur__color-red-beta)}.straumur__card-component__form--field-wrapper{display:flex;width:100%;gap:var(--straumur__space-lg)}.straumur__card-component__submit-button{background:var(--straumur__color-primary);border:none;border-radius:var(--straumur__border-radius-s);color:var(--straumur__color-white);cursor:pointer;font-size:16px;height:40px;outline:none;padding:0 var(--straumur__space-xxlg);transition:background .2s ease-out;width:100%}.straumur__card-component__submit-button:hover{background:var(--straumur__color-primary);border:1px solid var(--straumur__color-border)}.straumur__card-component__submit-button:disabled{background:var(--straumur__color-secondary);border:1px solid var(--straumur__color-border);cursor:not-allowed}.straumur__card-component__form--wrapper--label-checkbox{height:38px;display:flex;align-items:center;padding:8px;gap:var(--straumur__space-s);border-radius:var(--straumur__border-radius-s);cursor:pointer;user-select:none;transition:background-color .25s ease-in-out}.straumur__card-component__form--wrapper--label-checkbox:hover{background-color:var(--straumur__color-blue-gamma)}.straumur__card-component__form--wrapper--label-checkbox:hover .straumur__card-component__form--wrapper--label-checkbox--checkmark{border:1px solid var(--straumur__color-cosmos-blue-delta)}.straumur__card-component__form--wrapper--label-checkbox--checkmark{height:var(--straumur__space-5xlg);width:var(--straumur__space-5xlg);background-color:var(--straumur__color-secondary-gamma);border-radius:var(--straumur__border-radius-xxs);flex-shrink:0;border:1px solid var(--straumur__color-transparent);transition:all .2s ease-in}.straumur__card-component__form--wrapper--label-checkbox:hover .straumur__card-component__form--wrapper--label-checkbox--checkmark.straumur__card-component__form--wrapper--label-checkbox--checkmark--checked{border:1px solid var(--straumur__color-transparent)}.straumur__card-component__form--wrapper--label-checkbox--checkmark--checked{background-color:var(--straumur__color-blue-beta)}.straumur__card-component__form--wrapper--label-checkbox--checkmark--icon{height:100%;display:flex;justify-content:center;align-items:center;font-size:9px;opacity:0;visibility:hidden;transition:all .2s ease-in}.straumur__card-component__form--wrapper--label-checkbox--checkmark--icon--checked{opacity:1;visibility:visible}.straumur__card-component__form--wrapper--label-checkbox--checkbox{display:none}.js-iframe{border:none;color-scheme:auto;height:100%;overflow:hidden;width:100%}.straumur__card-component__dual-branding{display:grid;grid-template-columns:1fr 1fr;gap:var(--straumur__space-lg)}.straumur__card-component__dual-branding--logo{display:flex;align-items:center;padding:var(--straumur__space-xs);border:1px solid var(--straumur__color-secondary-gamma);border-radius:var(--straumur__border-radius-s)}.straumur__card-component__dual-branding--logo--item{display:flex;pointer-events:none}.straumur__card-component__dual-branding--logo--selected{border:1px solid var(--straumur__color-cosmos-blue-delta);justify-content:space-between}\\n\")","import { h } from \"preact\";\nimport { createContext, ComponentChildren } from \"preact\";\nimport { useState, useContext, useCallback, useRef, useLayoutEffect } from \"preact/hooks\";\nimport { PaymentMethod } from \"../../models/constants\";\nimport { ResultMessage } from \"../../models/models\";\n\n/** A submit trigger registered by the active card-type component. May be async — see SubmitApi. */\nexport type SubmitHandler = () => void | Promise<void>;\n\nexport type SubmitApi = {\n /**\n * Invokes the active card form's submit handler. The boolean only says a handler existed\n * and was invoked — the submission itself runs asynchronously and reports its outcome\n * through onPaymentCompleted/onPaymentFailed.\n */\n triggerSubmit: () => boolean;\n};\n\ntype PaymentMethodContextType = {\n activePaymentMethod: PaymentMethod | null;\n setActivePaymentMethod: (value: PaymentMethod | null) => void;\n activeStoredPaymentMethodId: string | null;\n setActiveStoredPaymentMethodId: (value: string) => void;\n isPaymentMethodInitialized: Record<PaymentMethod, boolean>;\n updatePaymentMethodInitialization: (paymentMethod: PaymentMethod, isInitialized: boolean) => void;\n isStoredCardInitialized: Record<string, boolean>;\n updateStoredCardInitialization: (storedPaymentMethod: string, isInitialized: boolean) => void;\n handleSuccess: (success: ResultMessage) => void;\n success: ResultMessage | null;\n handleError: (error: ResultMessage) => void;\n error: ResultMessage | null;\n threeDSecureActive: boolean;\n setThreeDSecureActive: (value: boolean) => void;\n /**\n * True while a 3DS challenge run by ANOTHER payment method takes over the widget —\n * the asking component must render nothing. Components matching a specific stored card\n * additionally check their own card id (see stored-card-component).\n */\n isObscuredByThreeDS: (method: PaymentMethod) => boolean;\n isSolePaymentMethod: boolean;\n hasCard: boolean;\n hasGooglePay: boolean;\n hasApplePay: boolean;\n hasStoredPaymentMethods: boolean;\n registerSubmitHandler: (handler: SubmitHandler) => void;\n unregisterSubmitHandler: (handler: SubmitHandler) => void;\n};\n\nconst PaymentMethodContext = createContext<PaymentMethodContextType | undefined>(undefined);\n\nconst defaultIsInitialized: Record<PaymentMethod, boolean> = {\n card: false,\n storedcard: false,\n googlepay: false,\n applepay: false,\n};\n\nexport const PaymentMethodGroupContext = ({\n children,\n initialValue,\n isSolePaymentMethod,\n hasCard,\n hasGooglePay,\n hasApplePay,\n hasStoredPaymentMethods,\n onSubmitApiReady,\n}: {\n children: ComponentChildren;\n initialValue: PaymentMethod | null;\n isSolePaymentMethod: boolean;\n hasCard: boolean;\n hasGooglePay: boolean;\n hasApplePay: boolean;\n hasStoredPaymentMethods: boolean;\n onSubmitApiReady?: (api: SubmitApi) => void;\n}): h.JSX.Element => {\n const [activePaymentMethod, setActivePaymentMethod] = useState(initialValue);\n const activeSubmitHandlerRef = useRef<SubmitHandler | null>(null);\n\n const registerSubmitHandler = useCallback((handler: SubmitHandler): void => {\n activeSubmitHandlerRef.current = handler;\n }, []);\n\n const unregisterSubmitHandler = useCallback((handler: SubmitHandler): void => {\n // Identity check guards against effect-cleanup ordering races when switching\n // between card-type payment methods: an outgoing form's cleanup must not\n // clobber a handler an incoming form already registered.\n if (activeSubmitHandlerRef.current === handler) {\n activeSubmitHandlerRef.current = null;\n }\n }, []);\n\n const triggerSubmit = useCallback((): boolean => {\n const handler = activeSubmitHandlerRef.current;\n\n if (!handler) {\n return false;\n }\n\n handler();\n return true;\n }, []);\n\n useLayoutEffect(() => {\n onSubmitApiReady?.({ triggerSubmit });\n }, []);\n const [activeStoredPaymentMethodId, setActiveStoredPaymentMethodId] = useState<string | null>(null);\n const [threeDSecureActive, setThreeDSecureActive] = useState<boolean>(false);\n const [isPaymentMethodInitialized, setIsPaymentMethodInitialized] = useState(defaultIsInitialized);\n const [isStoredCardInitialized, setIsStoredCardInitialized] = useState<Record<string, boolean>>({});\n\n const [success, setSuccess] = useState<ResultMessage | null>(null);\n const [error, setError] = useState<ResultMessage | null>(null);\n\n const updatePaymentMethodInitialization = (paymentMethod: PaymentMethod, isInitialized: boolean) => {\n setIsPaymentMethodInitialized((prevState) => ({\n ...prevState,\n [paymentMethod]: isInitialized,\n }));\n };\n\n const updateStoredCardInitialization = (storedPaymentMethod: string, isInitialized: boolean) => {\n setIsStoredCardInitialized((prevState) => ({\n ...prevState,\n [storedPaymentMethod]: isInitialized,\n }));\n };\n\n const isObscuredByThreeDS = useCallback(\n (method: PaymentMethod): boolean => threeDSecureActive && activePaymentMethod !== method,\n [threeDSecureActive, activePaymentMethod]\n );\n\n const handleError = (error: ResultMessage) => {\n setError(error);\n };\n\n const handleSuccess = (success: ResultMessage) => {\n setSuccess(success);\n };\n\n return (\n <PaymentMethodContext.Provider\n value={{\n activePaymentMethod,\n setActivePaymentMethod,\n activeStoredPaymentMethodId,\n setActiveStoredPaymentMethodId,\n isPaymentMethodInitialized,\n updatePaymentMethodInitialization,\n isStoredCardInitialized,\n updateStoredCardInitialization,\n handleSuccess,\n success,\n handleError,\n error,\n threeDSecureActive,\n setThreeDSecureActive,\n isObscuredByThreeDS,\n isSolePaymentMethod,\n hasCard,\n hasGooglePay,\n hasApplePay,\n hasStoredPaymentMethods,\n registerSubmitHandler,\n unregisterSubmitHandler,\n }}\n >\n {children}\n </PaymentMethodContext.Provider>\n );\n};\n\nexport const usePaymentMethodGroup = (): PaymentMethodContextType => {\n const context = useContext(PaymentMethodContext);\n if (context === undefined) {\n throw new Error(\"usePaymentMethodGroup must be used within a PaymentMethodGroup\");\n }\n return context as PaymentMethodContextType;\n};\n","import { h } from \"preact\";\nimport { createContext, ComponentChildren } from \"preact\";\nimport { useContext } from \"preact/hooks\";\nimport { Language } from \"./translations\";\nimport { I18nService } from \"./i18n-service\";\n\ntype I18nContextType = {\n i18n: I18nService;\n changeLanguage: (language: Language) => void;\n};\n\nconst I18nContext = createContext<I18nContextType | undefined>(undefined);\n\nexport const I18nProvider = ({\n children,\n i18nService,\n onLanguageChange,\n}: {\n children: ComponentChildren;\n i18nService: I18nService; // Use existing instance from StraumurCheckout\n onLanguageChange?: (language: Language) => void;\n}): h.JSX.Element => {\n const changeLanguage = (newLanguage: Language) => {\n i18nService.setLanguage(newLanguage);\n onLanguageChange?.(newLanguage);\n };\n\n return <I18nContext.Provider value={{ i18n: i18nService, changeLanguage }}>{children}</I18nContext.Provider>;\n};\n\nexport const useI18n = (): I18nContextType => {\n const context = useContext(I18nContext);\n if (!context) {\n throw new Error(\"useI18n must be used within an I18nProvider\");\n }\n return context;\n};\n","import { h } from \"preact\";\n\nconst CardIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path d=\"M24 11H0V7H24V11Z\" fill=\"currentColor\" />\n <path\n opacity=\"0.4\"\n d=\"M21.3333 3C22.8042 3 24 4.19375 24 5.66667V7H0V5.66667C0 4.19375 1.19375 3 2.66667 3H21.3333ZM24 19C24 20.4708 22.8042 21.6667 21.3333 21.6667H2.66667C1.19375 21.6667 0 20.4708 0 19V11H24V19ZM4.66667 16.3333C4.3 16.3333 4 16.6333 4 17C4 17.3667 4.3 17.6667 4.66667 17.6667H7.33333C7.7 17.6667 8 17.3667 8 17C8 16.6333 7.7 16.3333 7.33333 16.3333H4.66667ZM10 17.6667H15.3333C15.7 17.6667 16 17.3667 16 17C16 16.6333 15.7 16.3333 15.3333 16.3333H10C9.63333 16.3333 9.33333 16.6333 9.33333 17C9.33333 17.3667 9.63333 17.6667 10 17.6667Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\nexport default CardIcon;\n","import { Fragment, h } from \"preact\";\nimport MasterCardIcon from \"../assets/icons/mastercard\";\nimport VisaIcon from \"../assets/icons/visa\";\nimport MaestroIcon from \"../assets/icons/maestro\";\nimport AmexIcon from \"../assets/icons/amex\";\nimport JcbIcon from \"../assets/icons/jcb\";\nimport DinersIcon from \"../assets/icons/diners\";\nimport DiscoverIcon from \"../assets/icons/discover\";\nimport CupIcon from \"../assets/icons/cup\";\nimport { Tooltip } from \"../components/tooltip/tooltip\";\nimport { useMediaQuery } from \"./custom-hooks/use-media-query\";\n\ninterface BrandIcon {\n brand: string;\n brandFullName: string;\n}\n\nexport interface BrandHidden {\n brand: string;\n}\n\ninterface RenderBrandIconsProps {\n brands: BrandIcon[];\n brandHidden?: BrandHidden[];\n limit?: number;\n}\n\nexport function RenderBrandIcons({ brands, brandHidden = [], limit = 3 }: RenderBrandIconsProps): h.JSX.Element {\n const isWidth380 = useMediaQuery(\"(max-width: 380px)\");\n const isWidth335 = useMediaQuery(\"(max-width: 335px)\");\n const widthLimit = isWidth335 ? 1 : isWidth380 ? 2 : limit;\n\n const brandToShow = brands.filter((brand) => {\n const { brand: brandName } = brand;\n const hidden = brandHidden.some((x) => x.brand === brandName);\n\n return !hidden;\n });\n\n return (\n <Fragment>\n {brandToShow.map(({ brand }, index) => {\n if (index >= Math.min(limit, widthLimit)) {\n if (index === Math.min(limit, widthLimit)) {\n return (\n <Tooltip\n content={\n <span style={{ display: \"flex\", gap: \"4px\", overflow: \"visible\" }}>\n {brandToShow.slice(Math.min(limit, widthLimit)).map(({ brand }) => (\n <RenderBrandIcon key={brand} brand={brand} />\n ))}\n </span>\n }\n >\n <span key={brand} className=\"straumur__render-brand-icons__overflow\">\n +{brandToShow.length - Math.min(limit, widthLimit)}\n </span>\n </Tooltip>\n );\n }\n return null;\n }\n\n return <RenderBrandIcon key={brand} brand={brand} />;\n })}\n </Fragment>\n );\n}\n\nexport const RenderBrandIcon = ({\n brand,\n defaultToBrandName = true,\n}: {\n brand: string;\n defaultToBrandName?: boolean;\n}): h.JSX.Element => {\n switch (brand) {\n case \"visa\":\n return <VisaIcon />;\n case \"mc\":\n return <MasterCardIcon />;\n case \"maestro\":\n return <MaestroIcon />;\n case \"amex\":\n return <AmexIcon />;\n case \"jcb\":\n return <JcbIcon />;\n case \"diners\":\n return <DinersIcon />;\n case \"discover\":\n return <DiscoverIcon />;\n case \"cup\":\n return <CupIcon />;\n default:\n if (defaultToBrandName) {\n return <span>{brand}</span>;\n }\n return <Fragment></Fragment>;\n }\n};\n","import { h } from \"preact\";\n\ninterface MasterCardIconProps {\n opacity?: number;\n}\n\nconst MasterCardIcon = ({ opacity = 1 }: MasterCardIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" viewBox=\"0 0 40 26\" opacity={opacity}>\n <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />\n <path fill=\"#F06022\" d=\"M16.13 19.29h7.74V6.7h-7.74v12.58z\" />\n <path\n fill=\"#EA1D25\"\n d=\"M16.93 13A7.93 7.93 0 0 1 20 6.71a8.02 8.02 0 0 0-10.65.65 7.96 7.96 0 0 0 0 11.28 8.02 8.02 0 0 0 10.65.65A8.02 8.02 0 0 1 16.93 13\"\n />\n <path\n fill=\"#F79D1D\"\n d=\"M33 13c0 2.12-.84 4.15-2.34 5.65a8.1 8.1 0 0 1-10.66.64A8.05 8.05 0 0 0 23.07 13 7.96 7.96 0 0 0 20 6.71a8.02 8.02 0 0 1 10.66.64A7.93 7.93 0 0 1 33 13\"\n />\n </svg>\n);\n\nexport default MasterCardIcon;\n","import { h } from \"preact\";\n\ninterface VisaIconProps {\n opacity?: number;\n}\n\nconst VisaIcon = ({ opacity = 1 }: VisaIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" fill=\"none\" viewBox=\"0 0 40 26\" opacity={opacity}>\n <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />\n <path\n fill=\"#1434CB\"\n d=\"m15.9 7.7-4.43 10.6h-2.9l-2.2-8.47c-.13-.52-.25-.71-.65-.93C5.05 8.55 3.96 8.2 3 8l.07-.32h4.67c.6 0 1.13.4 1.27 1.09l1.15 6.14 2.86-7.23h2.89Zm11.39 7.15c0-2.8-3.88-2.96-3.85-4.21 0-.38.37-.79 1.16-.9a5.2 5.2 0 0 1 2.71.48l.48-2.25a7.4 7.4 0 0 0-2.57-.47c-2.71 0-4.62 1.44-4.64 3.51-.02 1.53 1.36 2.38 2.4 2.9 1.08.51 1.44.85 1.43 1.31 0 .71-.85 1.03-1.64 1.04-1.39.02-2.19-.37-2.82-.67l-.5 2.33c.64.29 1.82.55 3.05.56 2.89 0 4.78-1.42 4.79-3.63Zm7.17 3.46H37L34.78 7.7h-2.34c-.53 0-.98.3-1.17.78l-4.12 9.84h2.88l.57-1.58h3.53l.33 1.58Zm-3.07-3.76 1.45-3.99.83 4H31.4ZM19.83 7.7l-2.27 10.62h-2.74L17.09 7.7h2.74Z\"\n />\n </svg>\n);\n\nexport default VisaIcon;\n","import { h } from \"preact\";\n\ninterface MaestroIconProps {\n opacity?: number;\n}\n\nconst MaestroIcon = ({ opacity = 1 }: MaestroIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" fill=\"none\" viewBox=\"0 0 40 26\" opacity={opacity}>\n <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />\n <path fill=\"#7773B4\" d=\"M16.13 19.29h7.74V6.7h-7.74v12.58z\" />\n <path\n fill=\"#EA1D25\"\n d=\"M16.93 13A7.93 7.93 0 0 1 20 6.71a8.02 8.02 0 0 0-10.65.65 7.96 7.96 0 0 0 0 11.28 8.02 8.02 0 0 0 10.65.65A8.02 8.02 0 0 1 16.93 13\"\n />\n <path\n fill=\"#139FDA\"\n d=\"M33 13c0 2.12-.84 4.15-2.34 5.65a8.1 8.1 0 0 1-10.66.64A8.05 8.05 0 0 0 23.07 13 7.96 7.96 0 0 0 20 6.71a8.02 8.02 0 0 1 10.66.64A7.93 7.93 0 0 1 33 13\"\n />\n </svg>\n);\n\nexport default MaestroIcon;\n","import { h } from \"preact\";\n\ninterface AmexIconProps {\n opacity?: number;\n}\n\nconst AmexIcon = ({ opacity = 1 }: AmexIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 40 26\" width=\"40\" height=\"26\" opacity={opacity}>\n <path fill=\"#016FD0\" d=\"M0 26h40V0H0v26z\" />\n <path\n fill=\"#fff\"\n fill-rule=\"evenodd\"\n d=\"M30.69 13.63v1.64h-4.17v1.14h4.07v1.64h-4.07v1.12h4.17v1.66l3.38-3.6-3.38-3.6zm-1.1-6.14-1.4-3.19h-4l-4.1 9.32h3.33v8.27l10.28.01 1.61-1.8 1.63 1.8H40v-2.63l-1.92-2.06L40 15.16v-2.59l-1.93.01V7.6l-1.81 4.98H34.5l-1.86-5v5h-4.2l-.6-1.46h-3.3l-.6 1.46h-2.22l3.23-7.27V5.3h2.55l3.19 7.21V5.3l3.1.01 1.6 4.47 1.62-4.48H40v-1h-3.77l-.85 2.39-.85-2.39h-4.94v3.19zm-5.06 6.11v7.27h6.16v-.01h2.54l2.1-2.32 2.12 2.32H40v-.1l-3.34-3.53L40 13.65v-.05h-2.52l-2.1 2.3-2.08-2.3h-8.77zm.7-4.11.96-2.31.97 2.31h-1.93z\"\n />\n </svg>\n);\n\nexport default AmexIcon;\n","import { h } from \"preact\";\n\ninterface JcbIconProps {\n opacity?: number;\n}\n\nconst JcbIcon = ({ opacity = 1 }: JcbIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" fill=\"none\" viewBox=\"0 0 40 26\" opacity={opacity}>\n <g clip-path=\"url(#a)\">\n <path fill=\"#fff\" d=\"M0 0h40v26H0V0Z\" />\n <path fill=\"#fff\" d=\"M36.6 20.66a5.22 5.22 0 0 1-5.22 5.22H3V5.22A5.22 5.22 0 0 1 8.22 0H36.6v20.66Z\" />\n <path\n fill=\"url(#b)\"\n d=\"M27.36 15.36h2.15l.27-.02a.96.96 0 0 0 .76-.96 1 1 0 0 0-.76-.97c-.06-.02-.19-.02-.27-.02h-2.15v1.97Z\"\n />\n <path\n fill=\"url(#c)\"\n d=\"M29.27 1.75a3.74 3.74 0 0 0-3.74 3.73v3.89h5.28c.12 0 .26 0 .37.02 1.19.06 2.07.67 2.07 1.74 0 .84-.6 1.56-1.7 1.7v.05c1.2.08 2.13.76 2.13 1.8 0 1.13-1.03 1.87-2.38 1.87h-5.8v7.6H31a3.74 3.74 0 0 0 3.73-3.74V1.75h-5.46Z\"\n />\n <path\n fill=\"url(#d)\"\n d=\"M30.27 11.38c0-.5-.35-.82-.76-.89l-.2-.02h-1.95v1.81h1.95c.06 0 .18 0 .2-.02a.87.87 0 0 0 .76-.88Z\"\n />\n <path\n fill=\"url(#e)\"\n d=\"M8.6 1.75a3.74 3.74 0 0 0-3.73 3.73v9.22a7.4 7.4 0 0 0 3.22.85c1.3 0 2-.78 2-1.85V9.34h3.2v4.34c0 1.68-1.05 3.06-4.6 3.06-2.16 0-3.84-.47-3.84-.47v7.86h5.48a3.74 3.74 0 0 0 3.74-3.74V1.75H8.6Z\"\n />\n <path\n fill=\"url(#f)\"\n d=\"M18.94 1.75a3.74 3.74 0 0 0-3.74 3.73v4.9c.94-.8 2.59-1.32 5.24-1.2 1.41.06 2.93.45 2.93.45v1.58a7.1 7.1 0 0 0-2.83-.82c-2.01-.14-3.23.84-3.23 2.57 0 1.74 1.22 2.73 3.23 2.57a7.46 7.46 0 0 0 2.83-.82v1.58s-1.5.39-2.93.45c-2.65.12-4.3-.4-5.24-1.2v8.63h5.48a3.74 3.74 0 0 0 3.74-3.74V1.75h-5.48Z\"\n />\n </g>\n <defs>\n <linearGradient id=\"b\" x1=\"25.52\" x2=\"34.75\" y1=\"14.38\" y2=\"14.38\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#007940\" />\n <stop offset=\".23\" stop-color=\"#00873F\" />\n <stop offset=\".74\" stop-color=\"#40A737\" />\n <stop offset=\"1\" stop-color=\"#5CB531\" />\n </linearGradient>\n <linearGradient id=\"c\" x1=\"25.52\" x2=\"34.75\" y1=\"12.94\" y2=\"12.94\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#007940\" />\n <stop offset=\".23\" stop-color=\"#00873F\" />\n <stop offset=\".74\" stop-color=\"#40A737\" />\n <stop offset=\"1\" stop-color=\"#5CB531\" />\n </linearGradient>\n <linearGradient id=\"d\" x1=\"25.52\" x2=\"34.75\" y1=\"11.37\" y2=\"11.37\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#007940\" />\n <stop offset=\".23\" stop-color=\"#00873F\" />\n <stop offset=\".74\" stop-color=\"#40A737\" />\n <stop offset=\"1\" stop-color=\"#5CB531\" />\n </linearGradient>\n <linearGradient id=\"e\" x1=\"4.86\" x2=\"14.24\" y1=\"12.94\" y2=\"12.94\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#1F286F\" />\n <stop offset=\".48\" stop-color=\"#004E94\" />\n <stop offset=\".83\" stop-color=\"#0066B1\" />\n <stop offset=\"1\" stop-color=\"#006FBC\" />\n </linearGradient>\n <linearGradient id=\"f\" x1=\"15.15\" x2=\"24.25\" y1=\"12.94\" y2=\"12.94\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#6C2C2F\" />\n <stop offset=\".17\" stop-color=\"#882730\" />\n <stop offset=\".57\" stop-color=\"#BE1833\" />\n <stop offset=\".86\" stop-color=\"#DC0436\" />\n <stop offset=\"1\" stop-color=\"#E60039\" />\n </linearGradient>\n <clipPath id=\"a\">\n <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nexport default JcbIcon;\n","import { h } from \"preact\";\n\ninterface DinersIconProps {\n opacity?: number;\n}\n\nconst DinersIcon = ({ opacity = 1 }: DinersIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 40 26\" width=\"40\" height=\"26\" opacity={opacity}>\n <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />\n <g fill=\"#1a1918\">\n <path d=\"M5.96 15.58c0-.56-.3-.52-.58-.53v-.16H7.2a2.28 2.28 0 0 1 2.5 2.2c0 .61-.36 2.17-2.57 2.17H5.38v-.16c.38-.04.56-.05.58-.48zm.61 2.94c0 .49.35.54.65.54a1.75 1.75 0 0 0 1.8-1.95 1.88 1.88 0 0 0-1.96-2.02c-.26 0-.37.02-.49.02zm3.36.58h.12c.17 0 .3 0 .3-.2v-1.7c0-.28-.1-.32-.33-.44v-.1l.67-.23a.22.22 0 0 1 .11-.03c.03 0 .05.04.05.09v2.4c0 .21.13.21.3.21h.11v.16H9.93zm.67-3.67a.3.3 0 0 1 0-.61.3.3 0 0 1 .3.3.31.31 0 0 1-.3.31zm1.26 1.8c0-.23-.07-.3-.36-.41v-.12a8.44 8.44 0 0 0 .82-.3c.02 0 .04.01.04.06v.4a1.83 1.83 0 0 1 1.08-.46c.53 0 .72.39.72.88v1.61c0 .21.14.21.31.21h.12v.16h-1.34v-.16h.11c.18 0 .3 0 .3-.2v-1.63c0-.36-.22-.53-.57-.53a1.66 1.66 0 0 0-.73.3v1.85c0 .21.14.21.31.21h.12v.16h-1.34v-.16h.1c.18 0 .3 0 .3-.2v-1.67m3.21.3a1.55 1.55 0 0 0 0 .37 1.05 1.05 0 0 0 .92 1.08 1.2 1.2 0 0 0 .85-.42l.08.09a1.47 1.47 0 0 1-1.15.7 1.26 1.26 0 0 1-1.2-1.36c0-1.23.83-1.6 1.27-1.6a1 1 0 0 1 1.05 1 .74.74 0 0 1 0 .1l-.06.04zm1.11-.2c.16 0 .18-.08.18-.16a.53.53 0 0 0-.55-.57c-.38 0-.64.28-.72.73zm.86 1.77h.17c.17 0 .3 0 .3-.2v-1.77c0-.2-.23-.23-.33-.28v-.1c.46-.19.7-.35.77-.35.03 0 .05.02.05.08v.56H18c.16-.24.42-.64.8-.64a.34.34 0 0 1 .36.33.3.3 0 0 1-.3.32c-.19 0-.19-.15-.4-.15a.53.53 0 0 0-.46.52v1.47c0 .21.12.21.3.21h.35v.16h-.88a26 26 0 0 0-.74 0zm2.41-.7a.83.83 0 0 0 .78.76.44.44 0 0 0 .51-.45c0-.74-1.36-.5-1.36-1.5a.86.86 0 0 1 .97-.81 1.64 1.64 0 0 1 .71.18l.04.64h-.14a.64.64 0 0 0-.68-.62.44.44 0 0 0-.49.41c0 .74 1.45.51 1.45 1.5 0 .4-.33.85-1.07.85a1.64 1.64 0 0 1-.77-.22l-.07-.72.12-.03m7.44-2.37h-.15A1.2 1.2 0 0 0 25.39 15a1.79 1.79 0 0 0-1.77 2 2.04 2.04 0 0 0 1.87 2.17 1.27 1.27 0 0 0 1.25-1.09l.15.04-.15.91a3.5 3.5 0 0 1-1.38.34A2.23 2.23 0 0 1 22.97 17a2.3 2.3 0 0 1 2.37-2.2 4.5 4.5 0 0 1 1.48.33l.06.9m.22 3.07h.13c.17 0 .3 0 .3-.2v-3.5c0-.4-.1-.42-.34-.49v-.1a3.96 3.96 0 0 0 .65-.27.66.66 0 0 1 .14-.07c.03 0 .05.04.05.1v4.32c0 .21.13.21.3.21h.12v.16H27.1zm4.02-.18c0 .11.07.12.18.12h.25v.12a6.33 6.33 0 0 0-.9.2l-.03-.02v-.5a1.69 1.69 0 0 1-1.11.52.68.68 0 0 1-.69-.75v-1.6c0-.17-.02-.32-.37-.35v-.12l.8-.05c.07 0 .07.05.07.18v1.62c0 .19 0 .73.55.73a1.4 1.4 0 0 0 .75-.38v-1.7c0-.12-.3-.18-.52-.25v-.11c.56-.04.91-.09.97-.09.05 0 .05.05.05.11zm1.25-2.07a1.58 1.58 0 0 1 .93-.45 1.22 1.22 0 0 1 1.16 1.31 1.58 1.58 0 0 1-1.5 1.65 1.84 1.84 0 0 1-.86-.22l-.19.14-.13-.07a7.37 7.37 0 0 0 .09-1.11v-2.7c0-.4-.1-.42-.33-.49v-.1a3.93 3.93 0 0 0 .64-.27.67.67 0 0 1 .14-.07c.04 0 .05.04.05.1zm0 1.7a.67.67 0 0 0 .64.64c.67 0 .95-.65.95-1.21a1.2 1.2 0 0 0-1-1.24.96.96 0 0 0-.6.3v1.51zM5.38 22.91h.04c.13 0 .26-.02.26-.2v-1.78c0-.18-.13-.2-.26-.2h-.04v-.1l.5.01.54-.01v.1h-.05c-.12 0-.25.02-.25.2v1.79c0 .17.13.19.25.19h.05v.1L5.88 23l-.5.01z\" />\n <path d=\"M6.42 23.03 5.88 23l-.5.02h-.02v-.14h.06c.13 0 .24 0 .24-.17v-1.8c0-.16-.11-.17-.24-.17h-.06v-.13h1.07v.13h-.06c-.13 0-.24.01-.24.18v1.79c0 .16.11.17.24.17h.06v.14zM6.4 23v-.08h-.03c-.12 0-.27-.02-.27-.2v-1.8c0-.18.15-.2.27-.2h.03v-.07h-1v.07h.03c.13 0 .27.02.27.2v1.8c0 .18-.14.2-.27.2H5.4V23l.49-.02.52.02zm2.35-.66h.01v-1.29a.28.28 0 0 0-.3-.32H8.4v-.1l.48.01.42-.01v.1h-.06c-.14 0-.3.03-.3.44v1.55a2.27 2.27 0 0 0 .02.34h-.13L7.07 21.1v1.41c0 .3.06.4.32.4h.06v.1L7 23l-.47.01v-.1h.05c.24 0 .3-.16.3-.43v-1.44a.3.3 0 0 0-.3-.3h-.05v-.11l.4.01.3-.01 1.51 1.71\" />\n <path d=\"M8.95 23.08h-.14l-1.73-1.94v1.37c0 .3.05.38.3.38h.08v.14h-.01L7 23l-.47.02h-.01v-.14h.06c.23 0 .3-.14.3-.41v-1.44a.3.3 0 0 0-.3-.3h-.06v-.12h.72l1.5 1.69v-1.26c0-.27-.19-.3-.29-.3h-.09v-.13h.94v.13h-.07c-.14 0-.28.01-.28.42v1.55a2.27 2.27 0 0 0 .02.34v.02zm-.13-.03h.11a2.3 2.3 0 0 1-.01-.33v-1.55c0-.41.17-.45.31-.45h.04v-.07H8.4v.07h.06a.3.3 0 0 1 .32.33v1.3h-.02v.01l-1.52-1.71h-.68v.07h.03a.32.32 0 0 1 .32.32v1.44c0 .27-.07.44-.32.45h-.03V23l.45-.02.42.02v-.07H7.4c-.27 0-.34-.12-.34-.42v-1.44l1.77 1.98zm-.07-.71.01-.01v.01zm0 0v-.01zM9.8 20.8c-.26 0-.27.06-.32.31h-.1l.04-.29a2.04 2.04 0 0 0 .02-.29h.08c.03.1.11.1.2.1h1.76c.1 0 .18 0 .18-.1h.09l-.04.28v.28l-.11.04c0-.13-.02-.33-.25-.33h-.56v1.82c0 .26.12.29.28.29h.07v.1l-.56-.01-.57.01v-.1h.06c.19 0 .28-.02.28-.29V20.8z\" />\n <path d=\"m11.14 23.03-.56-.02-.57.02h-.02v-.14h.08c.19 0 .26 0 .27-.27v-1.8H9.8v-.03h.57v1.83c0 .28-.11.3-.3.3h-.05V23l.56-.02.54.02v-.07h-.05c-.16 0-.3-.05-.3-.31v-1.83h.58c.23 0 .26.2.26.32l.08-.03a3.96 3.96 0 0 1 .04-.53h-.05c-.02.1-.11.1-.2.1H9.71c-.08 0-.17 0-.2-.1h-.06a2.04 2.04 0 0 1-.02.27c0 .1-.02.19-.04.28h.08c.04-.24.07-.32.33-.31v.03c-.26 0-.25.04-.3.3h-.14v-.01l.04-.3a1.93 1.93 0 0 0 .02-.28v-.01h.11c.03.1.09.1.18.1h1.77c.1 0 .16 0 .17-.1v-.01h.02l.1.02-.01.01-.04.28v.28h-.01l-.12.05v-.02c-.01-.13-.03-.31-.24-.31h-.55v1.8c0 .25.11.27.27.27h.08v.14zm.71-.12h.05c.12 0 .25-.02.25-.2v-1.78c0-.18-.13-.2-.25-.2h-.05v-.1l.85.01.87-.01.01.52-.1.03c-.02-.22-.06-.4-.42-.4h-.47v.9h.4c.2 0 .25-.12.27-.3h.1v.78l-.1.02c-.02-.2-.03-.33-.26-.33h-.4v.79c0 .22.19.22.4.22.41 0 .6-.03.7-.41l.1.02a7.7 7.7 0 0 0-.12.54l-.92-.01-.9.01v-.1\" />\n <path d=\"m13.68 23.03-.92-.02-.9.02h-.02v-.14h.06c.13 0 .24 0 .24-.17v-1.8c0-.16-.11-.17-.24-.17h-.06v-.13h1.75v.01a4.18 4.18 0 0 0 0 .52v.01l-.13.04v-.02c-.02-.22-.05-.38-.4-.38h-.46v.86h.4c.2 0 .23-.1.25-.29v-.01h.13v.01a8.08 8.08 0 0 0 0 .8h-.01l-.12.03v-.02c-.02-.2-.03-.32-.25-.32h-.4v.78c0 .2.18.2.4.2.42 0 .58-.02.68-.4v-.01h.02l.1.03v.01a7.8 7.8 0 0 0-.11.54v.02zm-.02-.03.11-.52-.06-.02c-.1.39-.3.42-.7.42-.22 0-.43 0-.44-.24v-.8H13c.24-.01.26.13.28.33l.07-.02a7.25 7.25 0 0 1 0-.76h-.07c-.02.18-.08.3-.29.3h-.42v-.92h.5c.35 0 .4.18.42.4l.07-.03a5.76 5.76 0 0 1 0-.5l-.86.02-.83-.01v.07h.03c.12 0 .27.02.27.2v1.8c0 .18-.15.2-.27.2h-.03V23l.89-.02zm.59-2c0-.26-.14-.27-.24-.27h-.06v-.1l.53.01.54-.01c.43 0 .81.12.81.6a.64.64 0 0 1-.47.6l.58.87a.38.38 0 0 0 .33.21v.1l-.33-.01-.32.01a9.45 9.45 0 0 1-.7-1.1h-.23v.73c0 .26.12.27.28.27h.06v.1l-.59-.01-.5.01v-.1h.07c.13 0 .24-.06.24-.18v-1.74zm.44.78h.16c.34 0 .53-.13.53-.53a.47.47 0 0 0-.5-.5 1.65 1.65 0 0 0-.2.02v1.01z\" />\n <path d=\"m16.27 23.03-.33-.02c-.1 0-.21.02-.33.01a9.54 9.54 0 0 1-.7-1.1h-.2v.72c0 .25.1.25.26.25h.07v.14h-.01l-.59-.02-.5.02v-.14H14c.12 0 .22-.05.23-.16v-1.74c0-.24-.13-.24-.23-.24h-.08v-.13h1.09c.43 0 .83.11.83.61a.65.65 0 0 1-.47.6l.57.87a.37.37 0 0 0 .32.2h.02v.13zm-1.58-1.14h.23a10.55 10.55 0 0 0 .7 1.1h.64v-.07a.39.39 0 0 1-.33-.2l-.6-.9h.02a.63.63 0 0 0 .47-.59c0-.47-.37-.58-.8-.58h-1.06v.07h.05c.1 0 .26.02.26.27v1.74c0 .13-.13.2-.26.2h-.05V23l.48-.02.57.02v-.07h-.04c-.16 0-.3-.02-.3-.3v-.74zm0-.1h-.02v-1.04h.01a1.63 1.63 0 0 1 .2-.01.48.48 0 0 1 .51.51c0 .4-.2.55-.54.55zm.16-.02c.34 0 .51-.12.51-.52a.45.45 0 0 0-.48-.48 1.33 1.33 0 0 0-.18.01v.99zm3.73.57h.01v-1.29a.28.28 0 0 0-.3-.32h-.07v-.1l.48.01.42-.01v.1h-.06c-.14 0-.3.03-.3.44v1.55a2.27 2.27 0 0 0 .02.34h-.13L16.9 21.1v1.41c0 .3.06.4.32.4h.06v.1l-.44-.01-.47.01v-.1h.05c.24 0 .3-.16.3-.43v-1.44a.3.3 0 0 0-.3-.3h-.05v-.11l.4.01.3-.01z\" />\n <path d=\"M18.78 23.08h-.14l-1.73-1.94v1.37c0 .3.05.38.3.38h.08v.14h-.01l-.44-.02-.47.02h-.01v-.14h.06c.23 0 .3-.14.3-.41v-1.44a.3.3 0 0 0-.3-.3h-.06v-.12h.71l1.5 1.69v-1.26c0-.27-.18-.3-.28-.3h-.09v-.13h.93v.13h-.07c-.14 0-.28.01-.28.42v1.55a2.15 2.15 0 0 0 .02.34v.02zm-.13-.03h.11a2.34 2.34 0 0 1-.01-.33v-1.55c0-.41.17-.45.31-.45h.04v-.07h-.87v.07h.06a.3.3 0 0 1 .32.33v1.3h-.02v.01l-1.52-1.71h-.68v.07h.03a.32.32 0 0 1 .32.32v1.44c0 .27-.07.44-.32.45h-.03V23l.45-.02.42.02v-.07h-.04c-.27 0-.34-.12-.34-.42v-1.44zm-.07-.71.01-.01v.01zm0 0v-.01zm1.08.18a1.38 1.38 0 0 0-.07.27c0 .1.14.12.25.12h.04v.1a7.72 7.72 0 0 0-.78 0v-.1h.02a.3.3 0 0 0 .3-.22l.54-1.57a2.87 2.87 0 0 0 .13-.42 1.73 1.73 0 0 0 .3-.15.08.08 0 0 1 .04 0 .02.02 0 0 1 .02 0l.03.1.63 1.78.12.34a.22.22 0 0 0 .23.14h.02v.1a9.66 9.66 0 0 0-.98 0v-.1h.03c.08 0 .22-.01.22-.1a1.1 1.1 0 0 0-.07-.25l-.14-.4h-.77l-.1.36zm.5-1.5-.32.96h.63l-.31-.97z\" />\n <path d=\"M21.48 23.03 21 23l-.51.02h-.02v-.14h.05c.08 0 .2-.01.2-.08a1.1 1.1 0 0 0-.07-.24l-.13-.39h-.75l-.1.35a1.41 1.41 0 0 0-.08.26c0 .08.13.1.24.1h.06v.14h-.02l-.41-.02-.37.02h-.01v-.14h.03a.3.3 0 0 0 .28-.2l.55-1.57a4.05 4.05 0 0 0 .13-.44 1.75 1.75 0 0 0 .31-.14.09.09 0 0 1 .03-.01.04.04 0 0 1 .04.02l.03.09.63 1.78c.04.12.08.25.13.35a.2.2 0 0 0 .2.12h.04v.14h-.01zM20.5 23l.5-.02.45.02v-.07a.23.23 0 0 1-.24-.15c-.05-.1-.09-.23-.13-.35l-.62-1.78-.03-.09h-.02a.08.08 0 0 0-.01 0 1.26 1.26 0 0 1-.3.14 2.83 2.83 0 0 1-.13.43l-.55 1.56a.32.32 0 0 1-.3.24h-.01V23l.35-.02.4.02v-.07h-.03c-.1 0-.26-.02-.27-.14a1.35 1.35 0 0 1 .08-.27h.01-.01l.11-.36h.8l.13.4a1.04 1.04 0 0 1 .07.25c0 .1-.15.11-.23.12h-.02zm-.7-1 .33-1h.03l.32 1zm.05-.04h.6l-.3-.91zm.28-.94h.01zm1.5-.22c-.26 0-.27.06-.32.31h-.1l.04-.29a2.1 2.1 0 0 0 .02-.29h.08c.03.1.11.1.2.1h1.76c.1 0 .18 0 .19-.1h.08l-.04.28v.28l-.1.04c-.02-.13-.03-.33-.26-.33h-.56v1.82c0 .26.12.29.28.29h.07v.1L22.4 23l-.57.01v-.1h.06c.19 0 .29-.02.29-.29V20.8h-.56\" />\n <path d=\"M22.97 23.03 22.4 23l-.57.02h-.02v-.14h.08c.19 0 .27 0 .27-.27v-1.8h-.54v-.03h.57v1.83c0 .28-.11.3-.3.3h-.05V23l.56-.02.54.02v-.07h-.05c-.16 0-.3-.05-.3-.31v-1.83h.58c.23 0 .26.2.26.32l.08-.03v-.27l.04-.26h-.05c-.02.1-.11.1-.2.1h-1.77c-.08 0-.17 0-.2-.1h-.06a2 2 0 0 1-.02.27c0 .1-.02.19-.04.28h.08c.04-.24.07-.32.33-.31v.03c-.26 0-.25.04-.3.3h-.14v-.01l.04-.29a1.98 1.98 0 0 0 .02-.29v-.01h.11c.03.1.1.1.18.1h1.77c.1 0 .17 0 .17-.1v-.01h.02l.1.02v.01l-.05.28v.28h-.01l-.12.05v-.02c-.01-.13-.03-.31-.24-.31h-.54v1.8c0 .25.1.27.26.27h.08v.14h-.01m.74-.12h.05c.12 0 .25-.02.25-.2v-1.78c0-.18-.13-.2-.25-.2h-.05v-.1l.5.01.54-.01v.1h-.05c-.12 0-.25.02-.25.2v1.79c0 .17.13.19.25.19h.05v.1L24.2 23l-.5.01z\" />\n <path d=\"M24.74 23.03 24.2 23l-.5.02h-.01v-.14h.06c.12 0 .24 0 .24-.17v-1.8c0-.16-.12-.17-.24-.17h-.06v-.13h1.07v.13h-.07c-.12 0-.23.01-.23.18v1.79c0 .16.1.17.23.17h.07v.14zm-.01-.03v-.07h-.04c-.12 0-.26-.03-.26-.21v-1.8c0-.18.14-.2.26-.2h.04v-.07H23.7v.07h.04c.12 0 .27.02.27.2v1.8c0 .18-.15.2-.27.2h-.03V23l.48-.02.53.02zm1.37-2.42a1.2 1.2 0 0 1 1.3 1.18 1.25 1.25 0 0 1-1.28 1.3 1.2 1.2 0 0 1-1.28-1.22 1.24 1.24 0 0 1 1.26-1.26m.05 2.33c.66 0 .78-.58.78-1.08s-.27-1.1-.84-1.1c-.6 0-.77.53-.77.99 0 .6.28 1.2.83 1.2\" />\n <path d=\"M24.83 21.84a1.26 1.26 0 0 1 1.27-1.28v.03a1.23 1.23 0 0 0-1.24 1.25 1.19 1.19 0 0 0 1.26 1.2 1.24 1.24 0 0 0 1.27-1.28 1.18 1.18 0 0 0-1.3-1.17v-.03a1.21 1.21 0 0 1 1.33 1.2 1.27 1.27 0 0 1-1.3 1.32 1.22 1.22 0 0 1-1.3-1.24m.48-.12c0-.46.18-1 .8-1 .57 0 .84.61.84 1.11s-.12 1.1-.79 1.1v-.03c.65 0 .76-.57.76-1.07s-.26-1.08-.82-1.09c-.58 0-.75.52-.76.98 0 .6.28 1.18.82 1.18v.03c-.56 0-.84-.6-.85-1.21m4.4.62v-1.29a.28.28 0 0 0-.3-.32h-.07v-.1l.48.01.42-.01v.1h-.05c-.15 0-.3.03-.3.44v1.55a2.2 2.2 0 0 0 .01.34h-.12L28 21.1v1.41c0 .3.06.4.32.4h.06v.1l-.44-.01-.46.01v-.1h.05c.23 0 .3-.16.3-.43v-1.44a.3.3 0 0 0-.3-.3h-.05v-.11l.39.01.3-.01 1.52 1.71\" />\n <path d=\"M29.9 23.08h-.15l-1.72-1.94v1.37c0 .3.05.38.3.38h.07v.14h-.01l-.44-.02-.46.02h-.02v-.14h.07c.22 0 .28-.14.29-.41v-1.44a.3.3 0 0 0-.3-.3h-.06v-.12h.72l1.5 1.69v-1.26c0-.27-.18-.3-.28-.3h-.1v-.13h.94v.13h-.06c-.14 0-.29.01-.3.42v1.55a2.26 2.26 0 0 0 .03.34v.02zm-.13-.03h.1a2.42 2.42 0 0 1-.01-.33v-1.55c0-.41.17-.45.32-.45h.03v-.07h-.86v.07h.06a.3.3 0 0 1 .3.33v1.3l-.01.01-1.52-1.71h-.68v.07h.03a.32.32 0 0 1 .33.32v1.44c0 .27-.08.44-.32.45h-.04V23l.45-.02.43.02v-.07h-.05c-.27 0-.33-.12-.33-.42v-1.44zm-.07-.71v-.01zm-.01 0v-.01zm1.09.18a1.43 1.43 0 0 0-.08.27c0 .1.14.12.26.12h.03v.1a7.71 7.71 0 0 0-.78 0v-.1h.02a.3.3 0 0 0 .3-.22l.55-1.57a2.79 2.79 0 0 0 .12-.42 1.75 1.75 0 0 0 .31-.15.07.07 0 0 1 .03 0 .02.02 0 0 1 .02 0l.03.1.63 1.78c.04.11.08.24.13.34a.22.22 0 0 0 .22.14h.02v.1a9.66 9.66 0 0 0-.98 0v-.1h.04c.08 0 .2-.01.2-.1a1.1 1.1 0 0 0-.06-.25l-.13-.4h-.78zm.5-1.5h-.01l-.32.96h.64l-.32-.97z\" />\n <path d=\"m32.59 23.03-.47-.02-.5.02h-.02v-.14h.05c.08 0 .2-.01.2-.08a1.06 1.06 0 0 0-.07-.24l-.13-.39h-.76l-.1.35a1.44 1.44 0 0 0-.07.26c0 .08.12.1.24.1H31v.14h-.02l-.4-.02-.38.02h-.01v-.14h.03a.3.3 0 0 0 .29-.2l.54-1.57a4.27 4.27 0 0 0 .14-.44 1.85 1.85 0 0 0 .3-.14.08.08 0 0 1 .04 0 .04.04 0 0 1 .04.01l.03.09.62 1.78c.04.12.08.25.13.35a.2.2 0 0 0 .2.12h.04v.14h-.01zm-.97-.03.5-.02.46.02v-.08h-.01a.23.23 0 0 1-.24-.14l-.12-.35-.63-1.78a3.61 3.61 0 0 1-.03-.09h-.01a.06.06 0 0 0-.02 0 1.3 1.3 0 0 1-.3.14 2.94 2.94 0 0 1-.13.43l-.55 1.56a.32.32 0 0 1-.3.24h-.01V23l.35-.02.4.02v-.07h-.02c-.11 0-.27-.02-.27-.14a1.42 1.42 0 0 1 .07-.27h.02-.02l.11-.36h.8l.13.4a1.07 1.07 0 0 1 .07.25c0 .1-.15.11-.22.12h-.03zm-.7-1 .34-1h.02l.33 1zm.05-.04h.6l-.3-.91zm2.48.72c0 .13.1.18.2.19a2.47 2.47 0 0 0 .45 0 .48.48 0 0 0 .33-.2.78.78 0 0 0 .1-.24h.1l-.12.58-.9-.01-.9.01v-.1h.05c.12 0 .25-.02.25-.23v-1.75c0-.18-.13-.2-.25-.2h-.05v-.1l.54.01.51-.01v.1h-.08c-.13 0-.23 0-.23.19z\" />\n <path d=\"m34.5 23.03-.9-.02-.9.02v-.14h.06c.12 0 .24 0 .24-.2v-1.76c0-.17-.12-.18-.24-.18h-.07v-.13h1.09v.13h-.1c-.13 0-.21 0-.22.17v1.76c0 .13.09.16.2.17l.18.01a2.46 2.46 0 0 0 .26-.01.48.48 0 0 0 .32-.18.77.77 0 0 0 .1-.24v-.01h.13v.02l-.13.58zm0-.03.11-.55h-.07a.77.77 0 0 1-.1.24.5.5 0 0 1-.34.19 2.6 2.6 0 0 1-.26.01h-.19c-.11-.02-.22-.07-.22-.21v-1.76c0-.2.12-.2.25-.2h.07v-.07h-1.03v.07h.04c.12 0 .27.02.27.2v1.76c0 .22-.15.24-.27.24h-.04V23l.89-.02.88.02zm.1-2.47a.36.36 0 1 1-.37.36.35.35 0 0 1 .36-.36zm0 .66a.3.3 0 1 0-.3-.3.29.29 0 0 0 .3.3zm-.19-.1v-.02c.05-.01.05 0 .05-.04v-.26c0-.04 0-.05-.05-.05v-.02h.19c.06 0 .12.03.12.1a.11.11 0 0 1-.09.1l.06.09a.38.38 0 0 0 .08.08v.01h-.07c-.03 0-.06-.07-.13-.16h-.04v.12c0 .02.01.02.06.03v.01zm.12-.2h.05c.04 0 .06-.03.06-.09s-.03-.08-.07-.08h-.04z\" />\n </g>\n <path fill=\"#fff\" d=\"M13.33 8.58a5.77 5.77 0 1 1 5.76 5.78 5.77 5.77 0 0 1-5.76-5.78\" />\n <path\n fill=\"#154a78\"\n d=\"M22.58 8.47a3.48 3.48 0 0 0-2.23-3.24v6.48a3.48 3.48 0 0 0 2.23-3.24zm-4.7 3.24V5.23a3.47 3.47 0 0 0 0 6.48zM19.1 3a5.48 5.48 0 1 0 5.47 5.48A5.47 5.47 0 0 0 19.11 3zm0 11.48a5.99 5.99 0 0 1-6.03-5.94A5.9 5.9 0 0 1 19.1 2.5h1.55a6.1 6.1 0 0 1 6.24 6.03 6.22 6.22 0 0 1-6.24 5.94z\"\n />\n </svg>\n);\n\nexport default DinersIcon;\n","import { h } from \"preact\";\n\ninterface DiscoverIconProps {\n opacity?: number;\n}\n\nconst DiscoverIcon = ({ opacity = 1 }: DiscoverIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" fill=\"none\" viewBox=\"0 0 40 26\" opacity={opacity}>\n <path fill=\"#fff\" d=\"M0 0h40v26H0z\" />\n <g clip-path=\"url(#a)\">\n <g clip-path=\"url(#b)\">\n <path\n fill=\"#000\"\n d=\"M3.5 19.56a1.6 1.6 0 0 1 1.54-1.6h.06a1.52 1.52 0 0 1 1.42.77l-.43.25a1.02 1.02 0 0 0-.99-.59 1.13 1.13 0 0 0-1.14 1.11v.03a1.05 1.05 0 0 0 .99 1.14h.1a.94.94 0 0 0 1.04-.83H5.01v-.43h1.51v1.66h-.46v-.49l.03-.12a1.08 1.08 0 0 1-1.08.64 1.49 1.49 0 0 1-1.51-1.48v-.06Zm3.58-1.79h.46v3.33h-.46v-3.33Zm.92 2.2a1.2 1.2 0 1 1 .74 1.11A1.19 1.19 0 0 1 8 19.96Zm1.91 0a.74.74 0 1 0-1.48.06.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm1.36.8v.33h-.46v-3.36h.46v1.4a.98.98 0 0 1 .77-.38 1.19 1.19 0 0 1 0 2.38.9.9 0 0 1-.77-.37Zm1.48-.8a.75.75 0 1 0-1.5-.04v.03a.76.76 0 1 0 1.5 0Zm.8.55c0-.46.28-.65.9-.74.43-.06.58-.1.58-.25s-.12-.37-.46-.37a.54.54 0 0 0-.58.43l-.44-.18a1.01 1.01 0 0 1 1.02-.65c.59 0 .96.3.96.86v1.48h-.43v-.33a.75.75 0 0 1-.74.4c-.5 0-.8-.28-.8-.65Zm1.33.06a.5.5 0 0 0 .19-.4v-.19c0 .1-.16.13-.5.16-.4.06-.55.15-.55.34 0 .15.15.28.37.28.18 0 .35-.07.49-.19Zm1.14-2.8h.46v3.32h-.46v-3.33Zm2.04.24h.5l1.53 2.34v-2.34h.47v3.12h-.47l-1.57-2.41v2.4h-.46v-3.11Zm2.96 1.94a1.18 1.18 0 0 1 1.17-1.2h.03a1.14 1.14 0 0 1 1.17 1.11v.25h-1.94a.77.77 0 0 0 .96.58c.2-.05.37-.17.49-.34l.37.22a1.18 1.18 0 0 1-1.05.56 1.15 1.15 0 0 1-1.2-1.11v-.07Zm.46-.21h1.45a.67.67 0 0 0-.7-.56.7.7 0 0 0-.75.56Zm2.56.61v-1.14h-.46v-.4h.46v-.5l.46-.3v.8h.62v.4h-.65v1.14c0 .25.13.37.31.37.12 0 .24-.03.34-.09v.43a.82.82 0 0 1-.37.1c-.46 0-.71-.25-.71-.8Zm1.36-1.54h.46l.52 1.67.62-1.67h.43l.62 1.67.55-1.67h.47l-.8 2.28h-.44l-.61-1.66-.65 1.7h-.46l-.71-2.32Zm3.88 1.14a1.2 1.2 0 1 1 .74 1.12 1.19 1.19 0 0 1-.74-1.12Zm1.92 0a.74.74 0 1 0-1.48.07.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm.89-1.14h.46v.4a.72.72 0 0 1 .65-.4h.19v.46h-.28c-.37 0-.56.16-.56.6v1.22h-.46v-2.28Zm2.59 1.24-.4.43v.58h-.46v-3.3h.46V20l1.08-1.17h.55l-.89.96.92 1.32h-.52l-.74-1.04ZM5.2 10.16H3.72v5.18H5.2c.66.03 1.32-.18 1.85-.59a2.56 2.56 0 0 0 .92-1.97c0-1.54-1.14-2.62-2.77-2.62Zm1.2 3.88c-.3.28-.74.4-1.39.4h-.28v-3.39h.28a1.88 1.88 0 0 1 1.39.43 1.73 1.73 0 0 1 .55 1.3c0 .48-.2.93-.55 1.26Zm2.03-3.88h1.02v5.18H8.43v-5.18Zm3.49 2c-.62-.22-.77-.37-.77-.65 0-.34.3-.58.74-.58a.97.97 0 0 1 .8.43l.53-.68a2.32 2.32 0 0 0-1.52-.59 1.52 1.52 0 0 0-1.6 1.42v.06c0 .71.34 1.08 1.26 1.42.25.08.49.18.71.31a.64.64 0 0 1 .31.53.75.75 0 0 1-.74.74h-.03a1.29 1.29 0 0 1-1.1-.68l-.66.61a2 2 0 0 0 1.8 1 1.68 1.68 0 0 0 1.78-1.7c-.03-.87-.37-1.24-1.51-1.64Zm1.82.59a2.66 2.66 0 0 0 2.65 2.68h.06c.44 0 .88-.1 1.27-.3v-1.18a1.54 1.54 0 0 1-1.2.55 1.69 1.69 0 0 1-1.73-1.63v-.15a1.72 1.72 0 0 1 1.66-1.8h.03a1.64 1.64 0 0 1 1.27.6v-1.15c-.38-.2-.8-.31-1.23-.3a2.69 2.69 0 0 0-2.78 2.68Zm11.97.9-1.4-3.5h-1.07l2.19 5.31h.52l2.25-5.3h-1.1l-1.4 3.48Zm2.96 1.69h2.83v-.87h-1.85v-1.41h1.8v-.87h-1.8v-1.14h1.85v-.9h-2.83v5.19Zm6.84-3.64c0-.96-.68-1.51-1.82-1.51h-1.48v5.18h1.02v-2.1h.12l1.4 2.07h1.23l-1.64-2.2a1.36 1.36 0 0 0 1.17-1.44Zm-2.03.86h-.31V11h.3c.62 0 .96.28.96.77.03.52-.3.8-.95.8Zm2.84-2.13c0-.09-.07-.15-.19-.15h-.15v.46h.12v-.15l.12.18h.13l-.13-.21c.06 0 .1-.06.1-.13Zm-.19.07-.03-.13h.03c.06 0 .1.03.1.06-.04.07-.07.07-.1.07Z\"\n />\n </g>\n <path\n fill=\"#000\"\n d=\"M36.16 10.13a.4.4 0 0 0-.4.4.4.4 0 1 0 .8 0 .4.4 0 0 0-.4-.4Zm0 .74a.32.32 0 0 1-.34-.31.32.32 0 0 1 .65-.03.34.34 0 0 1-.3.34Z\"\n />\n <path fill=\"url(#c)\" d=\"M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z\" />\n <path fill=\"url(#d)\" d=\"M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z\" />\n <mask id=\"e\" width=\"6\" height=\"6\" x=\"18\" y=\"10\" maskUnits=\"userSpaceOnUse\" style=\"mask-type:luminance\">\n <path fill=\"#fff\" d=\"M18.06 12.75a2.74 2.74 0 1 0 5.49 0 2.74 2.74 0 0 0-5.5 0Z\" />\n </mask>\n <g mask=\"url(#e)\">\n <path fill=\"url(#f)\" d=\"M17.75 12.87a3.36 3.36 0 1 0 6.72 0 3.36 3.36 0 0 0-6.72 0Z\" />\n </g>\n </g>\n <g clip-path=\"url(#g)\">\n <g clip-path=\"url(#h)\">\n <path\n fill=\"#000\"\n d=\"M3.5 19.56a1.6 1.6 0 0 1 1.54-1.6h.06a1.52 1.52 0 0 1 1.42.77l-.43.25a1.02 1.02 0 0 0-.99-.59 1.13 1.13 0 0 0-1.14 1.11v.03a1.05 1.05 0 0 0 .99 1.14h.1a.94.94 0 0 0 1.04-.83H5.01v-.43h1.51v1.66h-.46v-.49l.03-.12a1.08 1.08 0 0 1-1.08.64 1.49 1.49 0 0 1-1.51-1.48v-.06Zm3.58-1.79h.46v3.33h-.46v-3.33Zm.92 2.2a1.2 1.2 0 1 1 .74 1.11A1.19 1.19 0 0 1 8 19.96Zm1.91 0a.74.74 0 1 0-1.48.06.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm1.36.8v.33h-.46v-3.36h.46v1.4a.98.98 0 0 1 .77-.38 1.19 1.19 0 0 1 0 2.38.9.9 0 0 1-.77-.37Zm1.48-.8a.75.75 0 1 0-1.5-.04v.03a.76.76 0 1 0 1.5 0Zm.8.55c0-.46.28-.65.9-.74.43-.06.58-.1.58-.25s-.12-.37-.46-.37a.54.54 0 0 0-.58.43l-.44-.18a1.01 1.01 0 0 1 1.02-.65c.59 0 .96.3.96.86v1.48h-.43v-.33a.75.75 0 0 1-.74.4c-.5 0-.8-.28-.8-.65Zm1.33.06a.5.5 0 0 0 .19-.4v-.19c0 .1-.16.13-.5.16-.4.06-.55.15-.55.34 0 .15.15.28.37.28.18 0 .35-.07.49-.19Zm1.14-2.8h.46v3.32h-.46v-3.33Zm2.04.24h.5l1.53 2.34v-2.34h.47v3.12h-.47l-1.57-2.41v2.4h-.46v-3.11Zm2.96 1.94a1.18 1.18 0 0 1 1.17-1.2h.03a1.14 1.14 0 0 1 1.17 1.11v.25h-1.94a.77.77 0 0 0 .96.58c.2-.05.37-.17.49-.34l.37.22a1.18 1.18 0 0 1-1.05.56 1.15 1.15 0 0 1-1.2-1.11v-.07Zm.46-.21h1.45a.67.67 0 0 0-.7-.56.7.7 0 0 0-.75.56Zm2.56.61v-1.14h-.46v-.4h.46v-.5l.46-.3v.8h.62v.4h-.65v1.14c0 .25.13.37.31.37.12 0 .24-.03.34-.09v.43a.82.82 0 0 1-.37.1c-.46 0-.71-.25-.71-.8Zm1.36-1.54h.46l.52 1.67.62-1.67h.43l.62 1.67.55-1.67h.47l-.8 2.28h-.44l-.61-1.66-.65 1.7h-.46l-.71-2.32Zm3.88 1.14a1.2 1.2 0 1 1 .74 1.12 1.19 1.19 0 0 1-.74-1.12Zm1.92 0a.74.74 0 1 0-1.48.07.72.72 0 0 0 .74.7.74.74 0 0 0 .74-.77Zm.89-1.14h.46v.4a.72.72 0 0 1 .65-.4h.19v.46h-.28c-.37 0-.56.16-.56.6v1.22h-.46v-2.28Zm2.59 1.24-.4.43v.58h-.46v-3.3h.46V20l1.08-1.17h.55l-.89.96.92 1.32h-.52l-.74-1.04ZM5.2 10.16H3.72v5.18H5.2c.66.03 1.32-.18 1.85-.59a2.56 2.56 0 0 0 .92-1.97c0-1.54-1.14-2.62-2.77-2.62Zm1.2 3.88c-.3.28-.74.4-1.39.4h-.28v-3.39h.28a1.88 1.88 0 0 1 1.39.43 1.73 1.73 0 0 1 .55 1.3c0 .48-.2.93-.55 1.26Zm2.03-3.88h1.02v5.18H8.43v-5.18Zm3.49 2c-.62-.22-.77-.37-.77-.65 0-.34.3-.58.74-.58a.97.97 0 0 1 .8.43l.53-.68a2.32 2.32 0 0 0-1.52-.59 1.52 1.52 0 0 0-1.6 1.42v.06c0 .71.34 1.08 1.26 1.42.25.08.49.18.71.31a.64.64 0 0 1 .31.53.75.75 0 0 1-.74.74h-.03a1.29 1.29 0 0 1-1.1-.68l-.66.61a2 2 0 0 0 1.8 1 1.68 1.68 0 0 0 1.78-1.7c-.03-.87-.37-1.24-1.51-1.64Zm1.82.59a2.66 2.66 0 0 0 2.65 2.68h.06c.44 0 .88-.1 1.27-.3v-1.18a1.54 1.54 0 0 1-1.2.55 1.69 1.69 0 0 1-1.73-1.63v-.15a1.72 1.72 0 0 1 1.66-1.8h.03a1.64 1.64 0 0 1 1.27.6v-1.15c-.38-.2-.8-.31-1.23-.3a2.69 2.69 0 0 0-2.78 2.68Zm11.97.9-1.4-3.5h-1.07l2.19 5.31h.52l2.25-5.3h-1.1l-1.4 3.48Zm2.96 1.69h2.83v-.87h-1.85v-1.41h1.8v-.87h-1.8v-1.14h1.85v-.9h-2.83v5.19Zm6.84-3.64c0-.96-.68-1.51-1.82-1.51h-1.48v5.18h1.02v-2.1h.12l1.4 2.07h1.23l-1.64-2.2a1.36 1.36 0 0 0 1.17-1.44Zm-2.03.86h-.31V11h.3c.62 0 .96.28.96.77.03.52-.3.8-.95.8Zm2.84-2.13c0-.09-.07-.15-.19-.15h-.15v.46h.12v-.15l.12.18h.13l-.13-.21c.06 0 .1-.06.1-.13Zm-.19.07-.03-.13h.03c.06 0 .1.03.1.06-.04.07-.07.07-.1.07Z\"\n />\n </g>\n <path\n fill=\"#000\"\n d=\"M36.16 10.13a.4.4 0 0 0-.4.4.4.4 0 1 0 .8 0 .4.4 0 0 0-.4-.4Zm0 .74a.32.32 0 0 1-.34-.31.32.32 0 0 1 .65-.03.34.34 0 0 1-.3.34Z\"\n />\n <path fill=\"url(#i)\" d=\"M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z\" />\n <path fill=\"url(#j)\" d=\"M18.06 12.75a2.75 2.75 0 1 0 5.49 0 2.75 2.75 0 0 0-5.5 0Z\" />\n <mask id=\"k\" width=\"6\" height=\"6\" x=\"18\" y=\"10\" maskUnits=\"userSpaceOnUse\" style=\"mask-type:luminance\">\n <path fill=\"#fff\" d=\"M18.06 12.75a2.74 2.74 0 1 0 5.49 0 2.74 2.74 0 0 0-5.5 0Z\" />\n </mask>\n <g mask=\"url(#k)\">\n <path fill=\"url(#l)\" d=\"M17.75 12.87a3.36 3.36 0 1 0 6.72 0 3.36 3.36 0 0 0-6.72 0Z\" />\n </g>\n </g>\n <defs>\n <linearGradient id=\"c\" x1=\"22.25\" x2=\"19.35\" y1=\"15.06\" y2=\"10.42\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#F59F00\" />\n <stop offset=\".19\" stop-color=\"#F49B00\" />\n <stop offset=\".37\" stop-color=\"#F29101\" />\n <stop offset=\".5\" stop-color=\"#F08302\" />\n <stop offset=\".6\" stop-color=\"#EE7905\" />\n <stop offset=\".76\" stop-color=\"#EC7008\" />\n <stop offset=\"1\" stop-color=\"#EC6D09\" />\n </linearGradient>\n <linearGradient id=\"d\" x1=\"22.25\" x2=\"19.35\" y1=\"15.06\" y2=\"10.42\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#F3941E\" stop-opacity=\"0\" />\n <stop offset=\".04\" stop-color=\"#F48C1C\" stop-opacity=\".08\" />\n <stop offset=\".2\" stop-color=\"#F77314\" stop-opacity=\".32\" />\n <stop offset=\".35\" stop-color=\"#F95D0E\" stop-opacity=\".53\" />\n <stop offset=\".5\" stop-color=\"#FB4B09\" stop-opacity=\".7\" />\n <stop offset=\".64\" stop-color=\"#FD3D05\" stop-opacity=\".83\" />\n <stop offset=\".77\" stop-color=\"#FE3302\" stop-opacity=\".92\" />\n <stop offset=\".9\" stop-color=\"#FF2D01\" stop-opacity=\".98\" />\n <stop offset=\"1\" stop-color=\"#FF2B00\" />\n </linearGradient>\n <radialGradient\n id=\"f\"\n cx=\"0\"\n cy=\"0\"\n r=\"1\"\n gradientTransform=\"rotate(4.24 -167.26 291.02) scale(3.3208)\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stop-color=\"#F3941E\" stop-opacity=\"0\" />\n <stop offset=\".45\" stop-color=\"#EA8D1D\" stop-opacity=\".05\" />\n <stop offset=\".66\" stop-color=\"#CA7618\" stop-opacity=\".2\" />\n <stop offset=\".83\" stop-color=\"#924D10\" stop-opacity=\".48\" />\n <stop offset=\".96\" stop-color=\"#441304\" stop-opacity=\".87\" />\n <stop offset=\".99\" stop-color=\"#2F0401\" stop-opacity=\".97\" />\n </radialGradient>\n <linearGradient id=\"i\" x1=\"22.25\" x2=\"19.35\" y1=\"15.06\" y2=\"10.42\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#F59F00\" />\n <stop offset=\".19\" stop-color=\"#F49B00\" />\n <stop offset=\".37\" stop-color=\"#F29101\" />\n <stop offset=\".5\" stop-color=\"#F08302\" />\n <stop offset=\".6\" stop-color=\"#EE7905\" />\n <stop offset=\".76\" stop-color=\"#EC7008\" />\n <stop offset=\"1\" stop-color=\"#EC6D09\" />\n </linearGradient>\n <linearGradient id=\"j\" x1=\"22.25\" x2=\"19.35\" y1=\"15.06\" y2=\"10.42\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0\" stop-color=\"#F3941E\" stop-opacity=\"0\" />\n <stop offset=\".04\" stop-color=\"#F48C1C\" stop-opacity=\".08\" />\n <stop offset=\".2\" stop-color=\"#F77314\" stop-opacity=\".32\" />\n <stop offset=\".35\" stop-color=\"#F95D0E\" stop-opacity=\".53\" />\n <stop offset=\".5\" stop-color=\"#FB4B09\" stop-opacity=\".7\" />\n <stop offset=\".64\" stop-color=\"#FD3D05\" stop-opacity=\".83\" />\n <stop offset=\".77\" stop-color=\"#FE3302\" stop-opacity=\".92\" />\n <stop offset=\".9\" stop-color=\"#FF2D01\" stop-opacity=\".98\" />\n <stop offset=\"1\" stop-color=\"#FF2B00\" />\n </linearGradient>\n <radialGradient\n id=\"l\"\n cx=\"0\"\n cy=\"0\"\n r=\"1\"\n gradientTransform=\"rotate(4.24 -167.26 291.02) scale(3.3208)\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0\" stop-color=\"#F3941E\" stop-opacity=\"0\" />\n <stop offset=\".45\" stop-color=\"#EA8D1D\" stop-opacity=\".05\" />\n <stop offset=\".66\" stop-color=\"#CA7618\" stop-opacity=\".2\" />\n <stop offset=\".83\" stop-color=\"#924D10\" stop-opacity=\".48\" />\n <stop offset=\".96\" stop-color=\"#441304\" stop-opacity=\".87\" />\n <stop offset=\".99\" stop-color=\"#2F0401\" stop-opacity=\".97\" />\n </radialGradient>\n <clipPath id=\"a\">\n <path fill=\"#fff\" d=\"M0 0h33v5.55H0z\" transform=\"translate(3.5 10)\" />\n </clipPath>\n <clipPath id=\"b\">\n <path fill=\"#fff\" d=\"M0 0h33v5.86H0z\" transform=\"translate(3.5 10)\" />\n </clipPath>\n <clipPath id=\"g\">\n <path fill=\"#fff\" d=\"M0 0h33v5.55H0z\" transform=\"translate(3.5 10)\" />\n </clipPath>\n <clipPath id=\"h\">\n <path fill=\"#fff\" d=\"M0 0h33v5.86H0z\" transform=\"translate(3.5 10)\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nexport default DiscoverIcon;\n","import { h } from \"preact\";\n\ninterface CupIconProps {\n opacity?: number;\n}\n\nconst CupIcon = ({ opacity = 1 }: CupIconProps) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 40 26\" width=\"40\" height=\"26\" opacity={opacity}>\n <rect width=\"45.3\" height=\"27\" x=\"-3.3\" y=\"-.79\" fill=\"#fff\" rx=\"2.82\" />\n <path\n fill=\"#01798a\"\n d=\"M27.27-.79a4.06 4.06 0 0 0-3.6 2.8l-4.96 23.42a2.14 2.14 0 0 0 2 2.8h18.35a2.81 2.81 0 0 0 2.8-2.82V1.15A2.25 2.25 0 0 0 40-.8\"\n />\n <rect width=\"20.38\" height=\"29.02\" x=\"-4\" y=\"-.79\" fill=\"#dc1f2b\" rx=\"2.82\" />\n <path\n fill=\"#1a4580\"\n d=\"M24.37 2.02a3.98 3.98 0 0 1 3.48-2.8H14.18a3.97 3.97 0 0 0-3.5 2.8l-4.85 23.4a2.13 2.13 0 0 0 1.94 2.81h13.7a2.13 2.13 0 0 1-1.94-2.8z\"\n />\n <path\n fill=\"#fff\"\n d=\"M16.63 15.04h.18a.32.32 0 0 0 .32-.17l.46-.7h1.24l-.26.47h1.49l-.2.7H18.1a.82.82 0 0 1-.75.44h-.92zm-.2 1h3.25l-.21.77h-1.3l-.2.74h1.27l-.21.77h-1.27l-.3 1.09c-.07.18.02.26.29.24h1.03l-.19.71H16.6q-.57 0-.39-.65l.38-1.4h-.81l.2-.76h.82l.2-.74h-.78l.2-.76zm5.19-1.87-.06.45a2.37 2.37 0 0 1 1.18-.47h2.05l-.78 2.88q-.1.5-.84.5h-2.34l-.54 2.01c-.03.11.01.17.13.17h.46l-.17.62h-1.17q-.67 0-.56-.4l1.54-5.76zm1.74.81h-1.84l-.22.78a1.52 1.52 0 0 1 .82-.23h1.1zm-.67 1.8c.14.02.22-.03.22-.16l.12-.4h-1.84l-.16.57zm-1.24.93h1.06l-.02.47h.29c.14 0 .2-.05.2-.14l.1-.3h.87l-.11.44a.76.76 0 0 1-.8.57h-.56v.8c-.01.12.1.18.33.18h.53l-.17.63H21.9c-.36.02-.53-.15-.53-.52zM8.6 10.34a2.62 2.62 0 0 1-1 1.64 3.24 3.24 0 0 1-1.98.58 2.16 2.16 0 0 1-1.68-.59 1.54 1.54 0 0 1-.37-1.06 2.86 2.86 0 0 1 .06-.57l.87-4.2h1.3l-.85 4.15a1.35 1.35 0 0 0-.04.32.82.82 0 0 0 .16.52.89.89 0 0 0 .75.3 1.56 1.56 0 0 0 1-.3 1.37 1.37 0 0 0 .5-.84l.84-4.15h1.3zm5.47-1.65h1.02l-.8 3.74h-1.02zm.32-1.37h1.03l-.2.91H14.2l.19-.9M16 12.15a1.39 1.39 0 0 1-.41-1.05 2.45 2.45 0 0 1 .01-.25l.04-.27a2.55 2.55 0 0 1 .78-1.45 2.07 2.07 0 0 1 1.43-.54 1.5 1.5 0 0 1 1.1.39 1.4 1.4 0 0 1 .4 1.06 2.59 2.59 0 0 1-.02.26l-.05.28a2.48 2.48 0 0 1-.77 1.42 2.08 2.08 0 0 1-1.43.53 1.5 1.5 0 0 1-1.09-.38m1.95-.74a1.84 1.84 0 0 0 .38-.9.58.58 0 0 0 .03-.19 1.74 1.74 0 0 0 .01-.17.76.76 0 0 0-.17-.54.64.64 0 0 0-.5-.2.89.89 0 0 0-.7.3 1.9 1.9 0 0 0-.38.92l-.03.18a1.36 1.36 0 0 0-.01.17.75.75 0 0 0 .17.54.64.64 0 0 0 .5.18.9.9 0 0 0 .7-.3m8.02 3.67.25-.87h1.24l-.05.32a3.1 3.1 0 0 1 1.09-.32h1.54l-.25.87h-.24l-1.16 4.12h.24l-.23.82h-.24l-.1.36h-1.2l.1-.36h-2.38l.23-.82h.24l1.16-4.12zm1.34 0L27 16.2a5.13 5.13 0 0 1 1-.27c.1-.4.24-.85.24-.85zm-.46 1.64-.32 1.17a3.44 3.44 0 0 1 1.01-.33l.24-.84zm.23 2.48.24-.84h-.93l-.24.84zm3.01-5.05h1.17l.05.44c0 .11.06.16.2.16h.2l-.2.74h-.87c-.32.02-.5-.1-.5-.38zm-.34 1.59h3.79l-.23.79h-1.2l-.2.74h1.2l-.23.79h-1.34l-.3.46h.65l.16.93c.01.09.1.13.23.13h.2l-.2.77h-.73c-.37.02-.57-.1-.58-.38l-.18-.85-.6.9a.65.65 0 0 1-.65.36h-1.1l.22-.77h.34a.46.46 0 0 0 .36-.19l.94-1.36h-1.2l.22-.8h1.3l.21-.73h-1.3l.22-.8zM9.8 8.69h.92l-.1.54.12-.16a1.43 1.43 0 0 1 1.1-.48 1 1 0 0 1 .83.34 1.15 1.15 0 0 1 .14.95l-.5 2.56h-.95l.46-2.32a.74.74 0 0 0-.04-.53.44.44 0 0 0-.4-.17.88.88 0 0 0-.62.23 1.14 1.14 0 0 0-.34.63L10 12.44h-.94zm10.55 0h.92l-.1.54.13-.16a1.43 1.43 0 0 1 1.08-.48.99.99 0 0 1 .85.34 1.14 1.14 0 0 1 .13.95l-.5 2.56h-.95l.46-2.32a.75.75 0 0 0-.04-.53.45.45 0 0 0-.4-.17.89.89 0 0 0-.62.23 1.12 1.12 0 0 0-.33.63l-.43 2.16h-.94zm4.55-2.33h2.67a1.8 1.8 0 0 1 1.19.35 1.25 1.25 0 0 1 .4 1v.02a3.77 3.77 0 0 1-.06.59 2.38 2.38 0 0 1-.81 1.4 2.29 2.29 0 0 1-1.5.52h-1.44l-.44 2.2h-1.24zm.67 2.82h1.19a1.14 1.14 0 0 0 .73-.21 1.14 1.14 0 0 0 .36-.67l.03-.15v-.13a.52.52 0 0 0-.22-.47 1.35 1.35 0 0 0-.72-.15h-1zm9.15 3.98a5.91 5.91 0 0 1-.98 1.56 1.99 1.99 0 0 1-1.7.71l.08-.64c.89-.27 1.36-1.51 1.64-2.06l-.33-4.03.68-.01h.58l.06 2.53 1.07-2.53h1.09zM31.68 9l-.43.3a1.35 1.35 0 0 0-1.66-.21c-1.08.5-1.98 4.4 1 3.11l.17.2 1.17.04.77-3.54zm-.66 1.92c-.2.56-.61.94-.94.83-.33-.1-.45-.64-.26-1.2.19-.57.61-.94.94-.83.33.1.45.64.26 1.2\"\n />\n </svg>\n);\n\nexport default CupIcon;\n","import { h, FunctionalComponent, ComponentChildren } from \"preact\";\nimport \"./tooltip.css\";\nimport { useRef, useState } from \"preact/hooks\";\n\ninterface TooltipProps {\n children: ComponentChildren;\n content: ComponentChildren;\n}\n\nexport const Tooltip: FunctionalComponent<TooltipProps> = ({ children, content }): h.JSX.Element | null => {\n const [isVisible, setIsVisible] = useState(false);\n const triggerRef = useRef<HTMLDivElement>(null);\n\n const handleMouseEnter = () => {\n setIsVisible(true);\n };\n\n const handleMouseLeave = () => {\n setIsVisible(false);\n };\n\n return (\n <div style={{ position: \"relative\" }}>\n <div ref={triggerRef} onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>\n {children}\n </div>\n {isVisible && triggerRef && <div className=\"straumur__tooltip__content\">{content}</div>}\n </div>\n );\n};\n","import styleInject from '#style-inject';styleInject(\".straumur__tooltip__content{position:absolute;z-index:50;padding:var(--straumur__space-s);border-radius:var(--straumur__border-radius-s);right:40%;top:100%;width:max-content;color:var(--straumur__color-white);background-color:var(--straumur__color-primary);box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d}\\n\")","import { useEffect, useState } from \"preact/hooks\";\n\n/**\n * Hook to listen for a CSS media query.\n * @param query - The media query string (e.g., '(min-width: 768px)')\n * @returns true if the query matches\n */\nexport function useMediaQuery(query: string): boolean {\n const getMatch = () => window.matchMedia(query).matches;\n\n const [matches, setMatches] = useState(getMatch);\n\n useEffect(() => {\n const mediaQueryList = window.matchMedia(query);\n const listener = (event: MediaQueryListEvent) => setMatches(event.matches);\n\n // Initial match check\n setMatches(mediaQueryList.matches);\n\n // Listen for changes\n mediaQueryList.addEventListener(\"change\", listener);\n\n return () => {\n mediaQueryList.removeEventListener(\"change\", listener);\n };\n }, [query]);\n\n return matches;\n}\n","import { Fragment, h } from \"preact\";\nimport { useRef, useState, useEffect, StateUpdater, Dispatch } from \"preact/hooks\";\nimport { usePaymentMethodGroup } from \"../payment-method-group/payment-method-group-context\";\nimport { AdyenCheckout, AdyenCheckoutError, CustomCard, ICore, UIElement, UIElementProps } from \"@adyen/adyen-web\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport { Tooltip } from \"../tooltip/tooltip\";\nimport InfoIcon from \"../../assets/icons/info\";\nimport { BrandHidden } from \"../../utils/renderBrandIcons\";\nimport LoaderIcon from \"../../assets/icons/loader\";\nimport CheckmarkIcon from \"../../assets/icons/checkmark\";\nimport { RenderDualBrandComponent, DualBrandConfiguration } from \"../render-dual-brand/render-dual-brand\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport { createAdyenPaymentHandlers } from \"../shared/create-adyen-handlers\";\nimport { submitCardWithGate } from \"../shared/before-submit-click\";\nimport { useAdyenLocaleReinit } from \"../../utils/custom-hooks/use-adyen-locale-reinit\";\nimport { useFocusOnActivate } from \"../../utils/custom-hooks/use-focus-on-activate\";\nimport { useResolvedTheme } from \"../../utils/custom-hooks/use-resolved-theme\";\nimport { getAdyenFieldStyles } from \"../../utils/adyen-field-styles\";\n\nexport interface CardFormProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n onBrandHidden: Dispatch<StateUpdater<BrandHidden[]>>;\n}\n\ntype CardFormError = {\n encryptedCardNumber: {\n visible: boolean;\n message?: string;\n };\n encryptedExpiryDate: {\n visible: boolean;\n message?: string;\n };\n encryptedSecurityCode: {\n visible: boolean;\n message?: string;\n };\n};\n\ntype CardFormErrorField = keyof CardFormError;\n\nfunction CardForm({ configuration, paymentMethods, onBrandHidden }: CardFormProps): h.JSX.Element | null {\n const cardElementRef = useRef<HTMLDivElement>(null);\n const adyenCheckoutRef = useRef<ICore>();\n const customCardRef = useRef<CustomCard>();\n const { i18n } = useI18n();\n const [payButtonDisabled, setPayButtonDisabled] = useState<boolean>(true);\n const [securityCodePolicy, setSecurityCodePolicy] = useState<\"hidden\" | \"optional\" | \"required\">(\"required\");\n const [storePaymentMethod, setStorePaymentMethod] = useState(false);\n const [isDualBrand, setIsDualBrand] = useState(false);\n const [dualBrandConfiguration, setDualBrandConfiguration] = useState<DualBrandConfiguration | null>(null);\n const [selectedBrand, setSelectedBrand] = useState<string | null>(null);\n const storePaymentMethodRef = useRef(false);\n const [formErrors, setFormErrors] = useState<CardFormError>({\n encryptedCardNumber: { visible: false },\n encryptedExpiryDate: { visible: false },\n encryptedSecurityCode: { visible: false },\n });\n\n const {\n activePaymentMethod,\n isPaymentMethodInitialized,\n updatePaymentMethodInitialization,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n threeDSecureActive,\n isObscuredByThreeDS,\n hasCard,\n registerSubmitHandler,\n unregisterSubmitHandler,\n } = usePaymentMethodGroup();\n\n // Adyen's card iframes can't read our CSS, so the field colors are passed in per theme.\n const resolvedTheme = useResolvedTheme(configuration.theme);\n\n async function handleSubmitClick(): Promise<void> {\n await submitCardWithGate(configuration.paymentFlow, () => customCardRef.current);\n }\n\n useEffect(() => {\n const isActive = activePaymentMethod === \"card\" && isPaymentMethodInitialized.card;\n if (!isActive) {\n // Nothing selected yet, or a different payment method is active - tell the\n // host explicitly so a custom submit button can default to disabled.\n configuration.onCardValidityChanged?.(false, false);\n return;\n }\n\n registerSubmitHandler(handleSubmitClick);\n return () => {\n unregisterSubmitHandler(handleSubmitClick);\n configuration.onCardValidityChanged?.(false, false);\n };\n }, [activePaymentMethod, isPaymentMethodInitialized.card, registerSubmitHandler, unregisterSubmitHandler]);\n\n // Computed defensively (optional chaining + fallback) because it runs on every render,\n // ahead of the render guards below. Keeping every hook unconditional satisfies the Rules\n // of Hooks; initializeAdyenComponent is only ever invoked while the card method is active.\n const schemeBrands = paymentMethods.paymentMethods?.paymentMethods?.find((x) => x.type === \"scheme\")?.brands ?? [];\n\n const { handleOnSubmit, handleOnSubmitAdditionalData, handlePaymentCompleted, handlePaymentFailed } =\n createAdyenPaymentHandlers({\n configuration,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n enrichSubmitData: (data) => ({\n ...data,\n storePaymentMethod: storePaymentMethodRef.current,\n }),\n });\n\n function handleOnError(_: AdyenCheckoutError, __?: UIElement<UIElementProps> | undefined): void {\n handleError({ key: \"error.unknownError\" });\n }\n\n const initializeAdyenComponent = async () => {\n // Fully tear down any previous instance before re-initializing (e.g. on locale change),\n // otherwise the old secure iframes leak and stack up on the same DOM node. Uses remove()\n // (destroy-style cleanup) to match the wallet components (google-pay/apple-pay buttons).\n customCardRef.current?.remove();\n\n adyenCheckoutRef.current = await AdyenCheckout({\n clientKey: paymentMethods.clientKey,\n environment: configuration.environment,\n locale: configuration.locale,\n countryCode: configuration.countryCode,\n paymentMethodsResponse: paymentMethods.paymentMethods,\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n onSubmit: handleOnSubmit,\n onAdditionalDetails: handleOnSubmitAdditionalData,\n onError: handleOnError,\n onPaymentCompleted: handlePaymentCompleted,\n onPaymentFailed: handlePaymentFailed,\n });\n\n customCardRef.current = new CustomCard(adyenCheckoutRef.current, {\n brands: schemeBrands,\n placeholders: configuration.placeholders,\n styles: getAdyenFieldStyles(resolvedTheme),\n challengeWindowSize: \"05\",\n onBinLookup: (event) => {\n if (event.supportedBrandsRaw && event.supportedBrandsRaw.length > 1) {\n setIsDualBrand(true);\n\n setDualBrandConfiguration({\n brand1: event.supportedBrandsRaw[0].brand,\n brand1Name: event.supportedBrandsRaw[0].localeBrand,\n brand1ImageUrl: event.supportedBrandsRaw[0].brandImageUrl,\n brand2: event.supportedBrandsRaw[1].brand,\n brand2Name: event.supportedBrandsRaw[1].localeBrand,\n brand2ImageUrl: event.supportedBrandsRaw[1].brandImageUrl,\n });\n }\n },\n onBrand: (event) => {\n setSecurityCodePolicy(event.cvcPolicy);\n if (event.brand === \"card\") {\n onBrandHidden([]);\n setSelectedBrand(null);\n return;\n }\n\n const selectedBrands = schemeBrands\n .filter((x) => x !== event.brand)\n .map((x) => {\n return {\n brand: x,\n };\n });\n\n onBrandHidden(selectedBrands);\n\n if (\n schemeBrands\n .filter((x) => x === event.brand)\n .map((x) => {\n return {\n brand: x,\n };\n }).length === 1\n ) {\n setSelectedBrand(event.brand);\n }\n },\n onConfigSuccess() {\n updatePaymentMethodInitialization(\"card\", true);\n },\n onValidationError: (event) => {\n const defaultErrors: CardFormError = {\n encryptedCardNumber: { visible: false, message: undefined },\n encryptedExpiryDate: { visible: false, message: undefined },\n encryptedSecurityCode: { visible: false, message: undefined },\n };\n\n event\n .filter((x) => x.error)\n .forEach((x) => {\n defaultErrors[x.fieldType as CardFormErrorField].visible = true;\n defaultErrors[x.fieldType as CardFormErrorField].message = x.errorI18n;\n });\n\n setFormErrors(defaultErrors);\n },\n onAllValid: (event) => {\n setPayButtonDisabled(!event.allValid);\n configuration.onCardValidityChanged?.(event.allValid, true);\n },\n });\n\n if (cardElementRef.current) {\n customCardRef.current.mount(cardElementRef.current);\n }\n };\n\n useEffect(() => {\n if (hasCard && activePaymentMethod === \"card\" && !isPaymentMethodInitialized.card) {\n initializeAdyenComponent();\n }\n }, [configuration, activePaymentMethod]);\n\n useAdyenLocaleReinit(\n configuration,\n () => Boolean(customCardRef.current && isPaymentMethodInitialized.card),\n () => {\n initializeAdyenComponent();\n setFormErrors({\n encryptedCardNumber: { visible: false, message: undefined },\n encryptedExpiryDate: { visible: false, message: undefined },\n encryptedSecurityCode: { visible: false, message: undefined },\n });\n }\n );\n\n useEffect(() => {\n storePaymentMethodRef.current = storePaymentMethod;\n }, [storePaymentMethod]);\n\n function dualBrandListener(e: h.JSX.TargetedMouseEvent<HTMLSpanElement>) {\n customCardRef.current!.dualBrandingChangeHandler(e);\n }\n\n function handleStorePaymentMethodChange(event: h.JSX.TargetedEvent<HTMLInputElement, Event>) {\n setStorePaymentMethod(event.currentTarget.checked);\n }\n\n // When the 3DS challenge replaces the card fields, move focus into the container.\n useFocusOnActivate(cardElementRef, threeDSecureActive && activePaymentMethod === \"card\");\n\n // Render guards live below all hooks so hook order is identical on every render.\n if (!hasCard || isObscuredByThreeDS(\"card\")) {\n return null;\n }\n\n if (paymentMethods.paymentMethods?.paymentMethods?.length === 0) {\n return null;\n }\n\n return (\n <div\n className=\"straumur__card-component__expandable\"\n ref={cardElementRef}\n tabIndex={-1}\n style={{\n height: threeDSecureActive ? \"600px\" : \"auto\",\n minWidth: threeDSecureActive ? \"350px\" : \"auto\",\n }}\n >\n {!isPaymentMethodInitialized.card && (\n <div className=\"straumur__card-component__loading-text\">\n <LoaderIcon />\n </div>\n )}\n\n <div\n className=\"straumur__card-component__form\"\n style={{\n opacity: isPaymentMethodInitialized.card && !threeDSecureActive ? 1 : 0,\n position: isPaymentMethodInitialized.card && !threeDSecureActive ? \"relative\" : \"absolute\",\n transition: \"opacity 0.3s ease-in-out\",\n }}\n >\n <div className=\"straumur__card-component__form--wrapper\">\n <label\n className={`${\"straumur__card-component__form--wrapper--label\"} ${\n formErrors.encryptedCardNumber.visible ? \"straumur__card-component__form--wrapper--label--error\" : \"\"\n }`}\n >\n {i18n.t(\"cards.cardNumber\")}\n </label>\n <span\n className={`${\"straumur__card-component__form--wrapper--input\"} ${\n formErrors.encryptedCardNumber.visible ? \"straumur__card-component__form--wrapper--input--error\" : \"\"\n }`}\n data-cse=\"encryptedCardNumber\"\n role=\"group\"\n aria-label={i18n.t(\"cards.cardNumber\")}\n />\n {formErrors.encryptedCardNumber.visible && (\n <span className=\"straumur__card-component__form--wrapper--error\">\n {formErrors.encryptedCardNumber.message}\n </span>\n )}\n </div>\n <div className=\"straumur__card-component__form--field-wrapper\">\n <div className=\"straumur__card-component__form--wrapper\">\n <label\n className={`${\"straumur__card-component__form--wrapper--label\"} ${\n formErrors.encryptedExpiryDate.visible ? \"straumur__card-component__form--wrapper--label--error\" : \"\"\n }`}\n >\n {i18n.t(\"cards.expiryDate\")}\n </label>\n <span\n className={`${\"straumur__card-component__form--wrapper--input\"} ${\n formErrors.encryptedExpiryDate.visible ? \"straumur__card-component__form--wrapper--input--error\" : \"\"\n }`}\n data-cse=\"encryptedExpiryDate\"\n role=\"group\"\n aria-label={i18n.t(\"cards.expiryDate\")}\n />\n {formErrors.encryptedExpiryDate.visible && (\n <span className=\"straumur__card-component__form--wrapper--error\">\n {formErrors.encryptedExpiryDate.message}\n </span>\n )}\n </div>\n\n <div className=\"straumur__card-component__form--wrapper\">\n {(securityCodePolicy === \"optional\" || securityCodePolicy === \"required\") && (\n <Fragment>\n <label\n className={`${\"straumur__card-component__form--wrapper--label\"} ${\n formErrors.encryptedSecurityCode.visible\n ? \"straumur__card-component__form--wrapper--label--error\"\n : \"\"\n }`}\n >\n {securityCodePolicy === \"optional\"\n ? i18n.t(\"cards.securityCode3DigitsOptional\")\n : i18n.t(\"cards.securityCode3Digits\")}\n </label>\n <span\n className={`${\"straumur__card-component__form--wrapper--input\"} ${\n formErrors.encryptedSecurityCode.visible\n ? \"straumur__card-component__form--wrapper--input--error\"\n : \"\"\n }`}\n data-cse=\"encryptedSecurityCode\"\n role=\"group\"\n aria-label={i18n.t(\"cards.securityCode3Digits\")}\n />\n {formErrors.encryptedSecurityCode.visible && (\n <span className=\"straumur__card-component__form--wrapper--error\">\n {formErrors.encryptedSecurityCode.message}\n </span>\n )}\n <div className=\"straumur__card-component__form--wrapper--label--info\">\n <Tooltip content={<span>{i18n.t(\"cards.securityCode3DigitsInfo\")}</span>}>\n <InfoIcon />\n </Tooltip>\n </div>\n </Fragment>\n )}\n </div>\n </div>\n\n {isDualBrand && dualBrandConfiguration && (\n <RenderDualBrandComponent\n dualBrandConfiguration={dualBrandConfiguration}\n selectedBrand={selectedBrand}\n onBrandClick={dualBrandListener}\n />\n )}\n\n {paymentMethods.enableStoreDetails === \"AskForConsent\" && (\n <label className=\"straumur__card-component__form--wrapper--label-checkbox\">\n <div\n className={`${\"straumur__card-component__form--wrapper--label-checkbox--checkmark\"} ${\n storePaymentMethod ? \"straumur__card-component__form--wrapper--label-checkbox--checkmark--checked\" : \"\"\n }`}\n >\n <div\n className={`${\"straumur__card-component__form--wrapper--label-checkbox--checkmark--icon\"} ${\n storePaymentMethod\n ? \"straumur__card-component__form--wrapper--label-checkbox--checkmark--icon--checked\"\n : \"\"\n }`}\n >\n <CheckmarkIcon />\n </div>\n </div>\n <input\n type=\"checkbox\"\n className=\"straumur__card-component__form--wrapper--label-checkbox--checkbox\"\n checked={storePaymentMethod}\n onChange={handleStorePaymentMethodChange}\n />\n {i18n.t(\"cards.storePaymentMethod\")}\n </label>\n )}\n\n {!configuration.hideSubmitButton && (\n <button\n className=\"straumur__card-component__submit-button\"\n disabled={payButtonDisabled}\n onClick={handleSubmitClick}\n >\n {paymentMethods.minorUnitsAmount === 0 ? i18n.t(\"cards.saveCardDetails\") : paymentMethods.formattedAmount}\n </button>\n )}\n </div>\n </div>\n );\n}\n\nexport default CardForm;\n","import { h } from \"preact\";\n\nconst InfoIcon = () => (\n <svg width=\"21\" height=\"20\" viewBox=\"0 0 21 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_10626_39119)\">\n <path\n d=\"M10.6641 7.5C11.3543 7.5 11.9141 6.94023 11.9141 6.25C11.9141 5.55977 11.3543 5 10.6641 5C9.97383 5 9.41406 5.55859 9.41406 6.25C9.41406 6.94141 9.97266 7.5 10.6641 7.5ZM12.2266 13.125H11.6016V9.6875C11.6016 9.17188 11.1836 8.75 10.6641 8.75H9.41406C8.89844 8.75 8.47656 9.17188 8.47656 9.6875C8.47656 10.2031 8.89844 10.625 9.41406 10.625H9.72656V13.125H9.10156C8.58594 13.125 8.16406 13.5469 8.16406 14.0625C8.16406 14.5781 8.58594 15 9.10156 15H12.2266C12.7441 15 13.1641 14.5801 13.1641 14.0625C13.1641 13.5449 12.7461 13.125 12.2266 13.125Z\"\n fill=\"currentColor\"\n />\n <path\n opacity=\"0.4\"\n d=\"M10.6641 0C5.14062 0 0.664062 4.47656 0.664062 10C0.664062 15.5234 5.14062 20 10.6641 20C16.1875 20 20.6641 15.5234 20.6641 10C20.6641 4.47656 16.1875 0 10.6641 0ZM10.6641 5C11.3543 5 11.9141 5.55977 11.9141 6.25C11.9141 6.94023 11.3543 7.5 10.6641 7.5C9.97383 7.5 9.41406 6.94141 9.41406 6.25C9.41406 5.55859 9.97266 5 10.6641 5ZM12.2266 15H9.10156C8.58594 15 8.16406 14.582 8.16406 14.0625C8.16406 13.543 8.58398 13.125 9.10156 13.125H9.72656V10.625H9.41406C8.89648 10.625 8.47656 10.2051 8.47656 9.6875C8.47656 9.16992 8.89844 8.75 9.41406 8.75H10.6641C11.1816 8.75 11.6016 9.16992 11.6016 9.6875V13.125H12.2266C12.7441 13.125 13.1641 13.5449 13.1641 14.0625C13.1641 14.5801 12.7461 15 12.2266 15Z\"\n fill=\"currentColor\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_10626_39119\">\n <rect width=\"20\" height=\"20\" fill=\"white\" transform=\"translate(0.664062)\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nexport default InfoIcon;\n","import { h } from \"preact\";\n\nconst LoaderIcon = () => (\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" xmlns=\"http://www.w3.org/2000/svg\" stroke=\"currentColor\">\n <g fill=\"none\" fill-rule=\"evenodd\">\n <g transform=\"translate(2 2)\" stroke-width=\"4\">\n <circle stroke-opacity=\".3\" cx=\"18\" cy=\"18\" r=\"18\" />\n <path d=\"M36 18c0-9.94-8.06-18-18-18\">\n <animateTransform\n attributeName=\"transform\"\n type=\"rotate\"\n from=\"0 18 18\"\n to=\"360 18 18\"\n dur=\"1s\"\n repeatCount=\"indefinite\"\n />\n </path>\n </g>\n </g>\n </svg>\n);\n\nexport default LoaderIcon;\n","import { h } from \"preact\";\n\nconst CheckmarkIcon = ({ color = \"var(--straumur__color-primary)\" }: { color?: string }) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"13\" viewBox=\"0 0 16 13\" fill=\"none\">\n <path d=\"M2 7L6 11L14 2\" stroke={color} stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n </svg>\n);\n\nexport default CheckmarkIcon;\n","import { h } from \"preact\";\nimport { RenderBrandIcon } from \"../../utils/renderBrandIcons\";\nimport CheckmarkIcon from \"../../assets/icons/checkmark\";\n\ntype DualBrandConfiguration = {\n brand1: string;\n brand1Name?: string;\n brand1ImageUrl?: string;\n brand2: string;\n brand2Name?: string;\n brand2ImageUrl?: string;\n};\n\ninterface RenderDualBrandComponentProps {\n dualBrandConfiguration: DualBrandConfiguration;\n selectedBrand: string | null;\n onBrandClick: (e: h.JSX.TargetedMouseEvent<HTMLSpanElement>) => void;\n}\n\ninterface BrandOptionProps {\n brand: string;\n brandName?: string;\n isSelected: boolean;\n onBrandClick: (e: h.JSX.TargetedMouseEvent<HTMLSpanElement>) => void;\n}\n\nfunction BrandOption({ brand, brandName, isSelected, onBrandClick }: BrandOptionProps): h.JSX.Element {\n // Enter/Space activate the option like a click. Synthesizing a real click (rather than calling\n // onBrandClick directly) keeps the currentTarget/data-value that Adyen's dualBrandingChangeHandler reads.\n const handleKeyDown = (e: h.JSX.TargetedKeyboardEvent<HTMLSpanElement>) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n e.currentTarget.click();\n }\n };\n\n return (\n <span\n className={\n `straumur__card-component__dual-branding--logo` +\n (isSelected ? \" straumur__card-component__dual-branding--logo--selected\" : \"\")\n }\n title={brand}\n data-value={brand}\n onClick={onBrandClick}\n onKeyDown={handleKeyDown}\n role=\"radio\"\n aria-checked={isSelected}\n aria-label={brandName ?? brand}\n tabIndex={0}\n >\n <div className=\"straumur__card-component__dual-branding--logo--item\">\n <RenderBrandIcon brand={brand} defaultToBrandName={false} />\n &nbsp;{brandName ?? \"\"}\n </div>\n {isSelected && <CheckmarkIcon color=\"var(--straumur__color-neon-green-zeta)\" />}\n </span>\n );\n}\n\nexport function RenderDualBrandComponent({\n dualBrandConfiguration,\n selectedBrand,\n onBrandClick,\n}: RenderDualBrandComponentProps): h.JSX.Element {\n return (\n <div className=\"straumur__card-component__dual-branding\" role=\"radiogroup\" aria-label=\"Card brand\">\n <BrandOption\n brand={dualBrandConfiguration.brand1}\n brandName={dualBrandConfiguration.brand1Name}\n isSelected={selectedBrand === dualBrandConfiguration.brand1}\n onBrandClick={onBrandClick}\n />\n <BrandOption\n brand={dualBrandConfiguration.brand2}\n brandName={dualBrandConfiguration.brand2Name}\n isSelected={selectedBrand === dualBrandConfiguration.brand2}\n onBrandClick={onBrandClick}\n />\n </div>\n );\n}\n\nexport type { DualBrandConfiguration };\n","import { Language, TranslationKey } from \"../localizations/translations\";\nimport { PublicLocale } from \"../localizations/locale\";\nimport { PaymentMethod } from \"./constants\";\nimport { ICreateDetailsBody, ICreatePaymentBody } from \"../adapter/models\";\nimport { PaymentMethodsResponse } from \"../services/models\";\n\n// configuration options shared by both session and advanced mode\ntype StraumurWebBaseConfiguration = {\n environment: \"test\" | \"live\";\n onPaymentCompleted?: (data: PaymentCompletedData) => void;\n onPaymentFailed?: (data: PaymentFailedData) => void;\n placeholders?: Placeholders;\n locale?: PublicLocale;\n localizations?: Partial<Record<Language, Partial<Record<TranslationKey, string>>>>;\n instantPayments?: UniqueInstantPayments;\n hideSubmitButton?: boolean;\n onCardValidityChanged?: (isValid: boolean, isActive: boolean) => void;\n allowedPaymentMethods?: PaymentMethod[];\n /**\n * Color theme for the widget. \"system\" follows the shopper's OS/browser preference\n * (`prefers-color-scheme`) and updates live if it changes. Defaults to \"light\".\n */\n theme?: Theme;\n};\n\nexport type Theme = \"light\" | \"dark\" | \"system\";\n\n/** The resolved theme actually applied to the DOM (\"system\" collapses to one of these). */\nexport type ResolvedTheme = \"light\" | \"dark\";\n\n// the public configuration (session mode): the component loads everything itself from the Straumur API using the sessionId\nexport type StraumurWebConfiguration = StraumurWebBaseConfiguration & {\n sessionId: string;\n};\n\n// INTERNAL — advanced mode: the host page provides the payment methods and controls all network calls\n// through onSubmit / onAdditionalDetails (and optionally onDisableToken).\n// Used only by Straumur's own Hosted Checkout page; not exported from the package entry point,\n// not documented for integrators, and not part of the supported public API.\nexport type StraumurWebAdvancedConfiguration = StraumurWebBaseConfiguration & {\n sessionId?: never;\n clientKey: string;\n countryCode: string;\n paymentMethods: PaymentMethodsResponse;\n /**\n * The amount of the transaction, in minor units. For example, value 1000 means 10.00.\n */\n amount: { value: number; currency: string };\n formattedAmount: string;\n merchantName: string;\n enableStoreDetails: \"Enabled\" | \"Disabled\" | \"AskForConsent\";\n onSubmit: (state: AdvancedSubmitState, actions: AdvancedPaymentActions) => void | Promise<void>;\n onAdditionalDetails: (state: AdvancedAdditionalDetailsState, actions: AdvancedPaymentActions) => void | Promise<void>;\n onDisableToken?: (data: DisableTokenData, actions: DisableTokenActions) => void | Promise<void>;\n /**\n * Called before a payment is submitted. Return false to abort the submission.\n * Keep it synchronous when Apple Pay is offered — the payment sheet must open within the user gesture.\n */\n onBeforeSubmit?: () => boolean | Promise<boolean>;\n};\n\n// INTERNAL — union the constructor actually accepts at runtime (public signature stays session-only)\nexport type StraumurWebInternalConfiguration = StraumurWebConfiguration | StraumurWebAdvancedConfiguration;\n\nconst RESULT_CODES = [\n \"AuthenticationFinished\",\n \"AuthenticationNotRequired\",\n \"Authorised\",\n \"Cancelled\",\n \"ChallengeShopper\",\n \"Error\",\n \"IdentifyShopper\",\n \"PartiallyAuthorised\",\n \"Pending\",\n \"PresentToShopper\",\n \"Received\",\n \"RedirectShopper\",\n \"Refused\",\n] as const;\n\nexport type ResultCode = (typeof RESULT_CODES)[number];\n\n/** Narrows a resultCode string from the Adyen boundary to our ResultCode union; unknown values map to \"Error\". */\nexport function toResultCode(value: string | undefined): ResultCode {\n return value && (RESULT_CODES as readonly string[]).includes(value) ? (value as ResultCode) : \"Error\";\n}\n\nexport type PaymentCompletedData = {\n resultCode: ResultCode;\n};\n\nexport type PaymentFailedData = {\n resultCode: ResultCode;\n};\n\nexport type AdvancedSubmitState = {\n data: Omit<ICreatePaymentBody, \"sessionId\">;\n};\n\nexport type AdvancedAdditionalDetailsState = {\n data: Omit<ICreateDetailsBody, \"sessionId\">;\n};\n\nexport type PaymentFlowResult = {\n resultCode: ResultCode;\n action?: unknown;\n /**\n * Optional buyer-friendly failure message shown on the built-in failure screen\n * instead of the generic localized one (advanced mode only).\n */\n errorMessage?: string;\n};\n\nexport type AdvancedPaymentActions = {\n resolve: (result: PaymentFlowResult) => void;\n reject: (errorMessage?: string) => void;\n};\n\nexport type DisableTokenData = {\n storedPaymentMethodId: string;\n};\n\nexport type DisableTokenActions = {\n resolve: () => void;\n reject: () => void;\n};\n\n// abstraction over how payments reach the backend: session mode calls the Straumur API itself,\n// advanced mode delegates to the host page's handlers\nexport interface PaymentFlow {\n submitPayment(data: AdvancedSubmitState[\"data\"]): Promise<PaymentFlowResult>;\n submitAdditionalDetails(data: AdvancedAdditionalDetailsState[\"data\"]): Promise<PaymentFlowResult>;\n disableToken?: (storedPaymentMethodId: string) => Promise<void>;\n beforeSubmit?: () => boolean | Promise<boolean>;\n}\n\n// message shown on the built-in result screens: either a translation key or raw text supplied by the host\nexport type ResultMessage = { key: TranslationKey } | { text: string };\n\ntype UniqueInstantPayments =\n | [Extract<PaymentMethod, \"googlepay\">]\n | [Extract<PaymentMethod, \"applepay\">]\n | [Extract<PaymentMethod, \"googlepay\">, Extract<PaymentMethod, \"applepay\">]\n | [Extract<PaymentMethod, \"applepay\">, Extract<PaymentMethod, \"googlepay\">];\n\n// this will be used for internal configuration of the checkout component\nexport type StraumurCheckoutConfiguration = {\n mode: \"session\" | \"advanced\";\n sessionId?: string;\n environment: \"test\" | \"live\";\n countryCode: string;\n paymentFlow: PaymentFlow;\n onPaymentCompleted?: (data: PaymentCompletedData) => void;\n onPaymentFailed?: (data: PaymentFailedData) => void;\n placeholders?: Placeholders;\n locale: Language;\n customLocalizations?: Partial<Record<Language, Partial<Record<TranslationKey, string>>>>;\n instantPayments?: UniqueInstantPayments;\n hideSubmitButton?: boolean;\n onCardValidityChanged?: (isValid: boolean, isActive: boolean) => void;\n allowedPaymentMethods?: PaymentMethod[];\n theme: Theme;\n};\n\n// What updateConfig() accepts: internal config fields minus the immutable ones,\n// with locale in the public short-code vocabulary.\nexport type StraumurCheckoutUpdateOptions = Partial<\n Omit<StraumurCheckoutConfiguration, \"mode\" | \"paymentFlow\" | \"locale\">\n> & {\n locale?: PublicLocale;\n};\n\ntype PlaceholderKeys =\n \"cardNumber\" | \"expiryDate\" | \"expiryMonth\" | \"expiryYear\" | \"securityCodeThreeDigits\" | \"securityCodeFourDigits\";\n\n// Partial makes all records optional so we can have a configuration without placeholders\n// Record creates a type with keys of type PlaceholderKeys and values of type string\nexport type Placeholders = Partial<Record<PlaceholderKeys, string>>;\n\nexport type ErrorCode = TranslationKey;\n","import { ICreateDetailsBody, ICreatePaymentBody, IPostDisableTokenBody } from \"../adapter/models\";\nimport { createDetailsRequest, createPaymentRequest, postDisableTokenRequest } from \"../adapter/straumur-adapter\";\nimport { PaymentFlow, PaymentFlowResult, ResultMessage, StraumurWebAdvancedConfiguration } from \"../models/models\";\nimport { TranslationKey } from \"../localizations/translations\";\n\nexport class PaymentFlowError extends Error {\n messageKey: TranslationKey;\n messageText?: string;\n\n constructor(messageKey: TranslationKey, messageText?: string) {\n super(messageText ?? messageKey);\n this.messageKey = messageKey;\n this.messageText = messageText;\n }\n}\n\nexport function toResultMessage(error: unknown, fallbackKey: TranslationKey): ResultMessage {\n if (error instanceof PaymentFlowError) {\n return error.messageText ? { text: error.messageText } : { key: error.messageKey };\n }\n\n return { key: fallbackKey };\n}\n\nexport function createSessionPaymentFlow(environment: \"test\" | \"live\", sessionId: string): PaymentFlow {\n return {\n async submitPayment(data) {\n const body: ICreatePaymentBody = { ...data, sessionId };\n\n const fetchResponse = await createPaymentRequest(environment, body);\n\n // We will always get 200 OK unless there is an error in our server code.\n // Payment unsuccessful still returns 200 OK, but with resultCode Refused.\n if (!fetchResponse.ok) {\n throw new PaymentFlowError(\"error.failedToSubmitPayment\");\n }\n\n const response = await fetchResponse.json();\n\n // ResultCode should never be empty.\n if (!response.resultCode) {\n throw new PaymentFlowError(\"error.paymentFailed\");\n }\n\n return { resultCode: response.resultCode, action: response.action };\n },\n async submitAdditionalDetails(data) {\n const body: ICreateDetailsBody = { ...data, sessionId };\n\n const fetchResponse = await createDetailsRequest(environment, body);\n\n // We will always get 200 OK unless there is an error in our server code.\n // Payment unsuccessful still returns 200 OK, but with resultCode Refused.\n if (!fetchResponse.ok) {\n throw new PaymentFlowError(\"error.failedToSubmitPaymentDetails\");\n }\n\n const response = await fetchResponse.json();\n\n // ResultCode should always be either Authorised or Refused or IdentifyShopper. Never empty.\n if (!response.resultCode) {\n throw new PaymentFlowError(\"error.paymentDetailsFailed\");\n }\n\n return { resultCode: response.resultCode, action: response.action };\n },\n async disableToken(storedPaymentMethodId) {\n const body: IPostDisableTokenBody = { storedPaymentMethodId, sessionId };\n\n const fetchResponse = await postDisableTokenRequest(environment, body);\n\n if (!fetchResponse.ok) {\n throw new PaymentFlowError(\"error.failedToSubmitRemoveStoredPaymentCard\");\n }\n\n const disableTokenResponse = await fetchResponse.json();\n\n if (!disableTokenResponse.success) {\n throw new PaymentFlowError(\"error.failedToRemoveStoredPaymentCard\");\n }\n },\n };\n}\n\nexport function createAdvancedPaymentFlow(configuration: StraumurWebAdvancedConfiguration): PaymentFlow {\n // Wraps whatever the host handler throws (synchronously or asynchronously) in a PaymentFlowError,\n // so callers can rely on a single error contract.\n function invokeHostHandler<T>(\n invoke: (resolve: (value: T) => void, reject: (error: PaymentFlowError) => void) => void | Promise<void>,\n resolve: (value: T) => void,\n reject: (error: unknown) => void,\n thrownErrorKey: TranslationKey\n ): void {\n const rejectWithFlowError = (error: unknown) =>\n reject(error instanceof PaymentFlowError ? error : new PaymentFlowError(thrownErrorKey));\n\n try {\n Promise.resolve(invoke(resolve, reject)).catch(rejectWithFlowError);\n } catch (error) {\n rejectWithFlowError(error);\n }\n }\n\n const flow: PaymentFlow = {\n submitPayment(data) {\n return new Promise<PaymentFlowResult>((resolve, reject) => {\n invokeHostHandler(\n (res, rej) =>\n configuration.onSubmit(\n { data },\n {\n resolve: res,\n reject: (errorMessage) => rej(new PaymentFlowError(\"error.failedToSubmitPayment\", errorMessage)),\n }\n ),\n resolve,\n reject,\n \"error.failedToSubmitPayment\"\n );\n });\n },\n submitAdditionalDetails(data) {\n return new Promise<PaymentFlowResult>((resolve, reject) => {\n invokeHostHandler(\n (res, rej) =>\n configuration.onAdditionalDetails(\n { data },\n {\n resolve: res,\n reject: (errorMessage) => rej(new PaymentFlowError(\"error.failedToSubmitPaymentDetails\", errorMessage)),\n }\n ),\n resolve,\n reject,\n \"error.failedToSubmitPaymentDetails\"\n );\n });\n },\n beforeSubmit: configuration.onBeforeSubmit,\n };\n\n const { onDisableToken } = configuration;\n\n if (onDisableToken) {\n flow.disableToken = (storedPaymentMethodId) =>\n new Promise<void>((resolve, reject) => {\n invokeHostHandler(\n (res, rej) =>\n onDisableToken(\n { storedPaymentMethodId },\n {\n resolve: () => res(),\n reject: () => rej(new PaymentFlowError(\"error.failedToRemoveStoredPaymentCard\")),\n }\n ),\n resolve,\n reject,\n \"error.failedToSubmitRemoveStoredPaymentCard\"\n );\n });\n }\n\n return flow;\n}\n","import { PaymentFlow } from \"../../models/models\";\n\n/** Runs the flow's optional beforeSubmit gate; resolves to whether submission may proceed. */\nexport async function runBeforeSubmit(paymentFlow: PaymentFlow): Promise<boolean> {\n const { beforeSubmit } = paymentFlow;\n\n return !beforeSubmit || (await beforeSubmit());\n}\n\n/**\n * Card submit-button behavior shared by card-form and stored-card: run the beforeSubmit gate,\n * then submit the Adyen element (re-read after the gate — it may have been torn down while awaiting).\n */\nexport async function submitCardWithGate(\n paymentFlow: PaymentFlow,\n getElement: () => { submit: () => void } | undefined | null\n): Promise<void> {\n if (!getElement()) {\n return;\n }\n\n if (!(await runBeforeSubmit(paymentFlow))) {\n return;\n }\n\n getElement()?.submit();\n}\n\n// Adyen wallet elements support onClick(resolve, reject) before opening the payment sheet.\n// Apple Pay requires resolve() within the user gesture, so keep beforeSubmit synchronous when Apple Pay is offered —\n// this handler must NOT be collapsed into the async runBeforeSubmit path.\nexport function createBeforeSubmitClickHandler(paymentFlow: PaymentFlow) {\n return (resolve: () => void, reject: () => void): void => {\n const { beforeSubmit } = paymentFlow;\n\n if (!beforeSubmit) {\n resolve();\n return;\n }\n\n const result = beforeSubmit();\n\n if (result instanceof Promise) {\n result.then((valid) => (valid ? resolve() : reject())).catch(() => reject());\n return;\n }\n\n if (result) {\n resolve();\n return;\n }\n\n reject();\n };\n}\n","import {\n AdditionalDetailsActions,\n AdditionalDetailsData,\n PaymentCompletedData,\n PaymentFailedData,\n SubmitActions,\n SubmitData,\n UIElement,\n UIElementProps,\n} from \"@adyen/adyen-web\";\nimport {\n AdvancedSubmitState,\n ResultCode,\n ResultMessage,\n StraumurCheckoutConfiguration,\n toResultCode,\n} from \"../../models/models\";\nimport { toResultMessage } from \"../../flows/payment-flow\";\nimport { runBeforeSubmit } from \"./before-submit-click\";\n\nexport interface AdyenPaymentHandlersOptions {\n configuration: StraumurCheckoutConfiguration;\n handleSuccess: (message: ResultMessage) => void;\n handleError: (message: ResultMessage) => void;\n setThreeDSecureActive: (value: boolean) => void;\n enrichSubmitData?: (data: SubmitData[\"data\"]) => AdvancedSubmitState[\"data\"];\n onSubmitStart?: () => void;\n /**\n * Redirect-return path only (submitDetails after a 3DS redirect): that Adyen bootstrap wires\n * no core-level onPaymentCompleted/onPaymentFailed, so the additional-details handler must\n * dispatch the final result itself. Leave unset for mounted components — Adyen invokes the\n * core-level callbacks there, and dispatching here too would double-fire the merchant callbacks.\n */\n dispatchResultFromAdditionalDetails?: boolean;\n}\n\nexport interface AdyenPaymentHandlers {\n handleOnSubmit: (state: SubmitData, element: UIElement<UIElementProps>, actions: SubmitActions) => Promise<void>;\n handleOnSubmitAdditionalData: (\n state: AdditionalDetailsData,\n element: UIElement<UIElementProps>,\n actions: AdditionalDetailsActions\n ) => Promise<void>;\n handlePaymentCompleted: (data: PaymentCompletedData, element?: UIElement<UIElementProps>) => void;\n handlePaymentFailed: (data?: PaymentFailedData, element?: UIElement<UIElementProps>) => void;\n}\n\n// Merchant callbacks follow Adyen Web 6 semantics: these resultCodes are failures.\nconst FAILED_RESULT_CODES: readonly ResultCode[] = [\"Refused\", \"Cancelled\", \"Error\"];\n\nexport function createAdyenPaymentHandlers(options: AdyenPaymentHandlersOptions): AdyenPaymentHandlers {\n const {\n configuration,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n enrichSubmitData,\n onSubmitStart,\n dispatchResultFromAdditionalDetails,\n } = options;\n\n // Buyer-friendly failure message from the host (advanced mode). Set on submit, shown when the payment fails.\n let failureMessage: string | undefined;\n\n function failureResultMessage(): ResultMessage {\n return failureMessage ? { text: failureMessage } : { key: \"error.paymentUnsuccessful\" };\n }\n\n function dispatchFinalResult(resultCode: ResultCode): void {\n // The built-in screens keep their own rule: the success screen only for Authorised.\n if (resultCode === \"Authorised\") {\n handleSuccess({ key: \"success.paymentAuthorized\" });\n } else {\n handleError(failureResultMessage());\n }\n\n if (FAILED_RESULT_CODES.includes(resultCode)) {\n configuration.onPaymentFailed?.({ resultCode });\n } else {\n configuration.onPaymentCompleted?.({ resultCode });\n }\n }\n\n async function handleOnSubmit(state: SubmitData, _: UIElement<UIElementProps>, actions: SubmitActions) {\n onSubmitStart?.();\n\n const { paymentFlow } = configuration;\n\n if (!(await runBeforeSubmit(paymentFlow))) {\n actions.reject();\n return;\n }\n\n try {\n const data = enrichSubmitData ? enrichSubmitData(state.data) : (state.data as AdvancedSubmitState[\"data\"]);\n\n const { resultCode, action, errorMessage } = await paymentFlow.submitPayment(data);\n\n failureMessage = errorMessage;\n\n if (resultCode === \"ChallengeShopper\" || resultCode === \"IdentifyShopper\") {\n setThreeDSecureActive(true);\n }\n\n // If the /payments request from your server is successful, you must call this to resolve whichever of the listed objects are available.\n // You must call this, even if the result of the payment is unsuccessful.\n actions.resolve({ resultCode, action } as Parameters<SubmitActions[\"resolve\"]>[0]);\n } catch (error) {\n actions.reject();\n handleError(toResultMessage(error, \"error.failedToSubmitPayment\"));\n }\n }\n\n async function handleOnSubmitAdditionalData(\n state: AdditionalDetailsData,\n _: UIElement<UIElementProps>,\n actions: AdditionalDetailsActions\n ) {\n try {\n const { resultCode, action, errorMessage } = await configuration.paymentFlow.submitAdditionalDetails(state.data);\n\n failureMessage = errorMessage;\n\n // If the /payments/details request from your server is successful, you must call this to resolve whichever of the listed objects are available.\n // You must call this, even if the result of the payment is unsuccessful.\n actions.resolve({ resultCode, action } as Parameters<AdditionalDetailsActions[\"resolve\"]>[0]);\n\n if (dispatchResultFromAdditionalDetails) {\n dispatchFinalResult(resultCode);\n }\n } catch (error) {\n actions.reject();\n handleError(toResultMessage(error, \"error.failedToSubmitPaymentDetails\"));\n\n if (dispatchResultFromAdditionalDetails) {\n configuration.onPaymentFailed?.({ resultCode: \"Error\" });\n }\n }\n }\n\n function handlePaymentCompleted(data: PaymentCompletedData, _?: UIElement<UIElementProps> | undefined): void {\n dispatchFinalResult(toResultCode(data.resultCode));\n }\n\n function handlePaymentFailed(data?: PaymentFailedData | undefined, _?: UIElement<UIElementProps> | undefined): void {\n // Adyen occasionally reports failure without a payload; synthesize one so the\n // merchant callback always receives a resultCode.\n dispatchFinalResult(data ? toResultCode(data.resultCode) : \"Error\");\n }\n\n return { handleOnSubmit, handleOnSubmitAdditionalData, handlePaymentCompleted, handlePaymentFailed };\n}\n","import { useEffect } from \"preact/hooks\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\n\n/**\n * Re-initializes an Adyen element when the checkout configuration changes.\n *\n * Adyen elements cannot change locale through `.update()` (Adyen issue #2407), so an\n * already-initialized component must be torn down and rebuilt. The configuration object's\n * identity is the trigger: `updateConfig`/`setLanguage` create a fresh object per change,\n * while re-renders reuse the same one.\n *\n * @param configuration the internal checkout configuration (identity-stable per config change)\n * @param isReady whether the Adyen element is currently initialized and safe to rebuild\n * @param reinitialize tears down (if needed) and rebuilds the Adyen element\n */\nexport function useAdyenLocaleReinit(\n configuration: StraumurCheckoutConfiguration,\n isReady: () => boolean,\n reinitialize: () => void\n): void {\n useEffect(() => {\n if (isReady()) {\n reinitialize();\n }\n // Deliberately keyed on configuration identity only: isReady/reinitialize are\n // fresh closures every render and must not re-trigger the rebuild.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [configuration]);\n}\n","import { useEffect } from \"preact/hooks\";\nimport { RefObject } from \"preact\";\n\n/**\n * Moves keyboard focus into `ref` when `active` transitions from false to true.\n *\n * Used when a 3-D Secure challenge takes over the widget: the content the shopper was\n * interacting with is replaced, so focus must follow into the challenge or a keyboard /\n * screen-reader user is stranded on a now-hidden control. The target needs `tabIndex={-1}`\n * to be programmatically focusable.\n *\n * The dependency array does the gating: the effect only runs when `active` changes, so a\n * re-render while it stays active will not steal focus back.\n */\nexport function useFocusOnActivate(ref: RefObject<HTMLElement>, active: boolean): void {\n useEffect(() => {\n if (active) {\n ref.current?.focus();\n }\n }, [active, ref]);\n}\n","import { useEffect, useState } from \"preact/hooks\";\nimport { ResolvedTheme, Theme } from \"../../models/models\";\n\nconst DARK_QUERY = \"(prefers-color-scheme: dark)\";\n\nfunction systemPrefersDark(): boolean {\n return typeof window !== \"undefined\" && typeof window.matchMedia === \"function\"\n ? window.matchMedia(DARK_QUERY).matches\n : false;\n}\n\n/**\n * Resolves a Theme to the concrete \"light\" | \"dark\" applied to the DOM.\n *\n * For \"system\" it reads `prefers-color-scheme` and subscribes to changes, so the widget\n * flips live when the shopper switches their OS/browser appearance. For explicit\n * \"light\"/\"dark\" it returns that value and attaches no listener.\n */\nexport function useResolvedTheme(theme: Theme): ResolvedTheme {\n const [systemDark, setSystemDark] = useState<boolean>(systemPrefersDark);\n\n useEffect(() => {\n if (theme !== \"system\" || typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n return;\n }\n\n const query = window.matchMedia(DARK_QUERY);\n const onChange = (event: MediaQueryListEvent) => setSystemDark(event.matches);\n\n // Re-sync in case the preference changed between mount and effect.\n setSystemDark(query.matches);\n query.addEventListener(\"change\", onChange);\n\n return () => query.removeEventListener(\"change\", onChange);\n }, [theme]);\n\n if (theme === \"system\") {\n return systemDark ? \"dark\" : \"light\";\n }\n\n return theme;\n}\n","import { ResolvedTheme } from \"../models/models\";\n\n/**\n * Color values for the Adyen secured-field iframes (card number / expiry / CVC).\n *\n * Those fields render inside cross-origin iframes our CSS cannot reach, so their text,\n * placeholder, and error colors must be passed to Adyen as literal values — they cannot use\n * the CSS custom properties in styles/main.css. Keep these in sync with the palette tokens\n * there (the light values mirror --straumur__color-text / -secondary / -red-beta, the dark\n * values mirror their [data-theme=\"dark\"] overrides).\n *\n * Structurally compatible with Adyen's StylesObject (which the SDK does not export).\n */\nexport function getAdyenFieldStyles(theme: ResolvedTheme) {\n if (theme === \"dark\") {\n return {\n base: { color: \"#e8edf2\" },\n placeholder: { color: \"#9aa7b5\" },\n error: { color: \"#e08a8a\" },\n };\n }\n\n return {\n base: { color: \"#00112c\" },\n placeholder: { color: \"#72889d\" },\n error: { color: \"#d96666\" },\n };\n}\n","import { h, ComponentChildren } from \"preact\";\nimport \"./payment-method-item.css\";\n\ninterface PaymentMethodItemProps {\n icon: h.JSX.Element;\n title: string;\n isActive: boolean;\n isSole: boolean;\n onChange: () => void;\n children: ComponentChildren;\n headerRight?: h.JSX.Element | null;\n confirmSection?: h.JSX.Element;\n}\n\nfunction PaymentMethodItem({\n icon,\n title,\n isActive,\n isSole,\n onChange,\n children,\n headerRight,\n confirmSection,\n}: PaymentMethodItemProps): h.JSX.Element {\n return (\n <label className={`straumur__payment-method-item${isSole ? \" straumur__payment-method-item--sole\" : \"\"}`}>\n {!isSole && (\n <input\n type=\"radio\"\n className=\"straumur__payment-method-item__radio-selector\"\n checked={isActive}\n onChange={onChange}\n />\n )}\n <span\n className={`straumur__payment-method-item__content${isSole ? \" straumur__payment-method-item__content--expanded\" : \"\"}`}\n >\n {!isSole && <span className=\"straumur__payment-method-item--circle\" />}\n {icon}\n <span className=\"straumur__payment-method-item--title\">{title}</span>\n {headerRight}\n </span>\n {confirmSection}\n <div\n className={`straumur__payment-method-item__expandable${isSole ? \" straumur__payment-method-item__expandable--visible\" : \"\"}`}\n >\n {children}\n </div>\n </label>\n );\n}\n\nexport default PaymentMethodItem;\n","import styleInject from '#style-inject';styleInject(\".straumur__payment-method-item{position:relative;cursor:pointer;background:var(--straumur__color-white);border-radius:var(--straumur__border-radius-lg);transition:all .3s ease;padding:var(--straumur__space-xxlg) var(--straumur__space-5xlg)}.straumur__payment-method-item--sole{cursor:default}.straumur__payment-method-item:has(.straumur__payment-method-item__radio-selector:checked){cursor:default}.straumur__payment-method-item__radio-selector{position:absolute;opacity:0;cursor:pointer}.straumur__payment-method-item__content{display:flex;align-items:center;gap:var(--straumur__space-lg);transition:background-color .3s ease}.straumur__payment-method-item__radio-selector:checked+.straumur__payment-method-item__content{padding-bottom:var(--straumur__space-xxlg)}.straumur__payment-method-item__content--expanded{padding-bottom:var(--straumur__space-xxlg)}.straumur__payment-method-item--circle{width:var(--straumur__space-5xlg);height:var(--straumur__space-5xlg);border:1px solid var(--straumur__color-cosmos-blue-gamma);background:var(--straumur__color-secondary-gamma);border-radius:50%;position:relative;transition:all .3s ease;flex-shrink:0}.straumur__payment-method-item__content:hover .straumur__payment-method-item--circle{border:1px solid var(--straumur__color-cosmos-blue-delta)}.straumur__payment-method-item--circle:after{content:\\\"\\\";position:absolute;width:100%;height:100%;border-radius:50%;top:50%;left:50%;transform:translate(-50%,-50%) scale(0);transition:transform .2s ease}.straumur__payment-method-item__radio-selector:checked+.straumur__payment-method-item__content .straumur__payment-method-item--circle{background:var(--straumur__color-blue-beta);border-color:var(--straumur__color-transparent)}.straumur__payment-method-item__radio-selector:checked+.straumur__payment-method-item__content .straumur__payment-method-item--circle:after{transform:translate(-50%,-50%) scale(1);background:var(--straumur__color-primary);height:var(--straumur__space-md);width:var(--straumur__space-md)}.straumur__payment-method-item--title{color:var(--straumur__color-text);font-size:16px;user-select:none}.straumur__payment-method-item__expandable{background:var(--straumur__color-white);max-height:0;overflow:hidden;transition:all .3s ease;opacity:0}.straumur__payment-method-item__radio-selector:checked~.straumur__payment-method-item__expandable{max-height:600px;opacity:1}.straumur__payment-method-item__expandable--visible{max-height:600px;opacity:1}\\n\")","import { h } from \"preact\";\nimport { useState } from \"preact/hooks\";\nimport \"./google-pay-component.css\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport GooglePayIcon from \"../../assets/icons/googlepay\";\nimport GooglePayButton from \"../../components/google-pay-button/google-pay-button\";\nimport PaymentMethodItem from \"../../components/payment-method-item/payment-method-item\";\n\ninterface GooglePayComponentProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n}\n\nfunction GooglePayComponent({ configuration, paymentMethods }: GooglePayComponentProps): h.JSX.Element | null {\n const { i18n } = useI18n();\n const { activePaymentMethod, setActivePaymentMethod, isObscuredByThreeDS, isSolePaymentMethod, hasGooglePay } =\n usePaymentMethodGroup();\n const [isUnavailable, setIsUnavailable] = useState(false);\n\n if (!hasGooglePay || isUnavailable) {\n return null;\n }\n\n if (configuration.instantPayments && configuration.instantPayments.some((x) => x === \"googlepay\")) {\n return null;\n }\n\n if (isObscuredByThreeDS(\"googlepay\")) {\n return null;\n }\n\n return (\n <PaymentMethodItem\n icon={<GooglePayIcon />}\n title={i18n.t(\"googlePay.title\")}\n isActive={activePaymentMethod === \"googlepay\"}\n isSole={isSolePaymentMethod}\n onChange={() => setActivePaymentMethod(\"googlepay\")}\n >\n <GooglePayButton\n configuration={configuration}\n paymentMethods={paymentMethods}\n isInstantPayment={false}\n onUnavailable={() => setIsUnavailable(true)}\n />\n </PaymentMethodItem>\n );\n}\n\nexport default GooglePayComponent;\n","import styleInject from '#style-inject';styleInject(\".adyen-checkout__paywithgoogle{height:var(--straumur__space-8xlg)}\\n\")","import { h } from \"preact\";\n\nconst GooglePayIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" fill=\"none\" viewBox=\"0 0 40 26\">\n <path\n fill=\"#fff\"\n d=\"M29.13 2.41H10.87C5.17 2.41.5 7.18.5 13.01a10.5 10.5 0 0 0 10.37 10.58h18.26c5.7 0 10.37-4.76 10.37-10.59 0-5.82-4.67-10.59-10.37-10.59Z\"\n />\n <path\n fill=\"#3C4043\"\n d=\"M29.13 3.27c1.28 0 2.52.26 3.7.77a9.6 9.6 0 0 1 5.08 5.19 9.78 9.78 0 0 1 0 7.55 9.83 9.83 0 0 1-5.08 5.18 9.26 9.26 0 0 1-3.7.77H10.87a9.24 9.24 0 0 1-3.7-.77 9.6 9.6 0 0 1-5.08-5.18 9.78 9.78 0 0 1 0-7.55 9.83 9.83 0 0 1 5.08-5.19 9.24 9.24 0 0 1 3.7-.77h18.26Zm0-.86H10.87C5.17 2.41.5 7.18.5 13.01a10.5 10.5 0 0 0 10.37 10.58h18.26c5.7 0 10.37-4.76 10.37-10.59 0-5.82-4.67-10.59-10.37-10.59Z\"\n />\n <path\n fill=\"#3C4043\"\n d=\"M19.1 13.75v3.2h-1v-7.9h2.64c.67 0 1.24.23 1.7.68.49.46.72 1.01.72 1.67a2.2 2.2 0 0 1-.71 1.68c-.46.45-1.03.67-1.7.67H19.1Zm0-3.73v2.76h1.66c.4 0 .73-.14.99-.4.26-.28.4-.6.4-.98 0-.36-.14-.68-.4-.95a1.28 1.28 0 0 0-.99-.42H19.1Zm6.67 1.35c.73 0 1.31.2 1.74.6.42.4.64.95.64 1.65v3.34h-.95v-.76h-.04a1.9 1.9 0 0 1-1.65.93 2.1 2.1 0 0 1-1.46-.53c-.4-.35-.6-.8-.6-1.32 0-.56.21-1 .63-1.34.41-.33.97-.5 1.66-.5.59 0 1.07.12 1.45.34v-.23c0-.36-.13-.65-.4-.9a1.4 1.4 0 0 0-.97-.37c-.56 0-1 .24-1.32.72l-.88-.56a2.42 2.42 0 0 1 2.15-1.07Zm-1.29 3.92c0 .27.11.5.33.67.22.17.48.26.78.26.42 0 .79-.16 1.12-.48.32-.31.49-.68.49-1.11a2.02 2.02 0 0 0-1.3-.38c-.4 0-.74.1-1.01.3a.9.9 0 0 0-.4.74Zm9.08-3.75-3.32 7.8h-1.02l1.23-2.73-2.19-5.07h1.09l1.57 3.89h.02l1.54-3.89h1.08Z\"\n />\n <path\n fill=\"#4285F4\"\n d=\"M15.14 13.1c0-.32-.03-.64-.09-.95h-4.17v1.75h2.4a2.1 2.1 0 0 1-.89 1.4v1.14h1.43a4.49 4.49 0 0 0 1.32-3.33Z\"\n />\n <path fill=\"#34A853\" d=\"M12.4 15.3a2.66 2.66 0 0 1-4-1.44H6.9v1.18a4.43 4.43 0 0 0 6.91 1.4l-1.43-1.13Z\" />\n <path\n fill=\"#FABB05\"\n d=\"M8.25 13c0-.3.05-.59.14-.86v-1.17H6.9a4.59 4.59 0 0 0 0 4.07l1.48-1.17a2.79 2.79 0 0 1-.14-.86Z\"\n />\n <path\n fill=\"#E94235\"\n d=\"M10.88 10.27c.66 0 1.24.23 1.7.68l1.27-1.3a4.22 4.22 0 0 0-2.97-1.18 4.44 4.44 0 0 0-3.97 2.5l1.48 1.17a2.66 2.66 0 0 1 2.5-1.87Z\"\n />\n </svg>\n);\n\nexport default GooglePayIcon;\n","import styleInject from '#style-inject';styleInject(\".straumur__google-pay-button__loading{display:flex;justify-content:center}\\n\")","import \"./google-pay-button.css\";\nimport { h } from \"preact\";\nimport WalletButton, { WalletButtonProps } from \"../shared/wallet-button\";\n\ntype GooglePayButtonProps = Omit<WalletButtonProps, \"method\">;\n\nfunction GooglePayButton(props: GooglePayButtonProps): h.JSX.Element | null {\n return <WalletButton method=\"googlepay\" {...props} />;\n}\n\nexport default GooglePayButton;\n","import { Fragment, h } from \"preact\";\nimport { useEffect, useRef } from \"preact/hooks\";\nimport {\n AdyenCheckout,\n AdyenCheckoutError,\n ApplePay,\n ApplePayConfiguration,\n GooglePay,\n GooglePayConfiguration,\n ICore,\n UIElement,\n UIElementProps,\n} from \"@adyen/adyen-web\";\nimport { usePaymentMethodGroup } from \"../payment-method-group/payment-method-group-context\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport { CANCEL } from \"../../models/constants\";\nimport LoaderIcon from \"../../assets/icons/loader\";\nimport { AdyenPaymentHandlers, createAdyenPaymentHandlers } from \"./create-adyen-handlers\";\nimport { createBeforeSubmitClickHandler } from \"./before-submit-click\";\nimport { useAdyenLocaleReinit } from \"../../utils/custom-hooks/use-adyen-locale-reinit\";\n\nexport type WalletMethod = \"applepay\" | \"googlepay\";\n\nexport interface WalletButtonProps {\n method: WalletMethod;\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n isInstantPayment: boolean;\n onUnavailable?: () => void;\n}\n\ntype WalletElement = ApplePay | GooglePay;\n\n/** Merchant identifiers Adyen requires inside the wallet element's configuration. */\ntype WalletMerchantConfig = { gatewayMerchantId: string; merchantId: string };\n\ninterface WalletContext {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n walletConfig: WalletMerchantConfig;\n handleOnSubmit: AdyenPaymentHandlers[\"handleOnSubmit\"];\n}\n\ninterface WalletDescriptor {\n loadingClassName: string;\n createElement(core: ICore, context: WalletContext): WalletElement;\n}\n\n// Everything the two wallets share lives in WalletButton below; per-wallet differences\n// (the Adyen element class and its configuration deltas) live in this descriptor map.\nconst WALLETS: Record<WalletMethod, WalletDescriptor> = {\n applepay: {\n loadingClassName: \"straumur__apple-pay-button__loading\",\n createElement(core, { configuration, paymentMethods, walletConfig, handleOnSubmit }) {\n const applePayConfiguration: ApplePayConfiguration = {\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n environment: configuration.environment,\n onSubmit: handleOnSubmit,\n onClick: createBeforeSubmitClickHandler(configuration.paymentFlow),\n configuration: {\n ...walletConfig,\n merchantName: paymentMethods.merchantName,\n },\n };\n\n return new ApplePay(core, applePayConfiguration);\n },\n },\n googlepay: {\n loadingClassName: \"straumur__google-pay-button__loading\",\n createElement(core, { configuration, paymentMethods, walletConfig, handleOnSubmit }) {\n const googlePayConfiguration: GooglePayConfiguration = {\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n challengeWindowSize: \"05\",\n countryCode: configuration.countryCode,\n environment: configuration.environment,\n onSubmit: handleOnSubmit,\n onClick: createBeforeSubmitClickHandler(configuration.paymentFlow),\n buttonSizeMode: \"fill\",\n // px — Adyen draws the Google Pay button, so its radius can't come from CSS. Keep this in\n // sync with --straumur__border-radius-lg (12px), matching the payment-method \"card box\"\n // and the Apple Pay button (--apple-pay-button-border-radius), since the express wallet\n // buttons sit as tiles alongside that box.\n buttonRadius: 12,\n configuration: {\n ...walletConfig,\n merchantName: paymentMethods.merchantName,\n },\n };\n\n return new GooglePay(core, googlePayConfiguration);\n },\n },\n};\n\nfunction WalletButton({\n method,\n configuration,\n paymentMethods,\n isInstantPayment,\n onUnavailable,\n}: WalletButtonProps): h.JSX.Element | null {\n const wallet = WALLETS[method];\n const walletElementRef = useRef<HTMLDivElement>(null);\n const adyenCheckoutRef = useRef<ICore>();\n const walletRef = useRef<WalletElement>();\n const {\n isPaymentMethodInitialized,\n updatePaymentMethodInitialization,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n threeDSecureActive,\n isObscuredByThreeDS,\n setActivePaymentMethod,\n activePaymentMethod,\n } = usePaymentMethodGroup();\n\n const { handleOnSubmit, handleOnSubmitAdditionalData, handlePaymentCompleted, handlePaymentFailed } =\n createAdyenPaymentHandlers({\n configuration,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n onSubmitStart: () => {\n if (isInstantPayment) {\n setActivePaymentMethod(method);\n }\n },\n });\n\n function handleOnError(data: AdyenCheckoutError, _?: UIElement<UIElementProps> | undefined): void {\n if (data.name !== CANCEL) {\n handleError({ key: \"error.unknownError\" });\n }\n }\n\n function markUnavailable(): void {\n // Initialized-but-unavailable: the loader must disappear and the method must not stay selected.\n updatePaymentMethodInitialization(method, true);\n if (activePaymentMethod === method) {\n setActivePaymentMethod(null);\n }\n onUnavailable?.();\n }\n\n const initializeAdyenComponent = async () => {\n adyenCheckoutRef.current = await AdyenCheckout({\n clientKey: paymentMethods.clientKey,\n environment: configuration.environment,\n locale: configuration.locale,\n countryCode: configuration.countryCode,\n paymentMethodsResponse: paymentMethods.paymentMethods,\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n onError: handleOnError,\n onAdditionalDetails: handleOnSubmitAdditionalData,\n onPaymentCompleted: handlePaymentCompleted,\n onPaymentFailed: handlePaymentFailed,\n });\n\n const walletPaymentMethod = paymentMethods.paymentMethods.paymentMethods?.find((x) => x.type === method);\n const walletConfig = walletPaymentMethod?.configuration as WalletMerchantConfig | undefined;\n\n if (!walletConfig) {\n // No usable wallet configuration in the response: treat it like an unavailable wallet instead of crashing.\n markUnavailable();\n return;\n }\n\n walletRef.current = wallet.createElement(adyenCheckoutRef.current, {\n configuration,\n paymentMethods,\n walletConfig,\n handleOnSubmit,\n });\n\n walletRef.current\n .isAvailable()\n .then(() => {\n walletRef.current!.mount(walletElementRef.current!);\n updatePaymentMethodInitialization(method, true);\n })\n .catch(() => {\n markUnavailable();\n });\n };\n\n useEffect(() => {\n if (!isPaymentMethodInitialized[method]) {\n initializeAdyenComponent();\n }\n }, [configuration]);\n\n useAdyenLocaleReinit(\n configuration,\n () => Boolean(walletRef.current && isPaymentMethodInitialized[method]),\n () => {\n walletRef.current!.remove();\n initializeAdyenComponent();\n }\n );\n\n if (isObscuredByThreeDS(method)) {\n return null;\n }\n\n return (\n <Fragment>\n {isPaymentMethodInitialized[method] === false && (\n <div className={wallet.loadingClassName}>\n <LoaderIcon />\n </div>\n )}\n <div\n ref={walletElementRef}\n style={{\n height: threeDSecureActive ? \"600px\" : \"auto\",\n minWidth: threeDSecureActive ? \"350px\" : \"auto\",\n position: isPaymentMethodInitialized[method] ? \"static\" : \"absolute\",\n }}\n />\n </Fragment>\n );\n}\n\nexport default WalletButton;\n","export type PaymentMethod = \"card\" | \"storedcard\" | \"googlepay\" | \"applepay\";\n\nexport const NETWORK_ERROR = \"NETWORK_ERROR\";\nexport const CANCEL = \"CANCEL\";\nexport const IMPLEMENTATION_ERROR = \"IMPLEMENTATION_ERROR\";\nexport const API_ERROR = \"API_ERROR\";\nexport const ERROR = \"ERROR\";\nexport const SCRIPT_ERROR = \"SCRIPT_ERROR\";\nexport const SDK_ERROR = \"SDK_ERROR\";\n","import { h } from \"preact\";\nimport { useState } from \"preact/hooks\";\nimport \"./apple-pay-component.css\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport ApplePayIcon from \"../../assets/icons/applepay\";\nimport ApplePayButton from \"../../components/apple-pay-button/apple-pay-button\";\nimport PaymentMethodItem from \"../../components/payment-method-item/payment-method-item\";\n\ninterface ApplePayComponentProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n}\n\nfunction ApplePayComponent({ configuration, paymentMethods }: ApplePayComponentProps): h.JSX.Element | null {\n const { i18n } = useI18n();\n const { activePaymentMethod, setActivePaymentMethod, isObscuredByThreeDS, isSolePaymentMethod, hasApplePay } =\n usePaymentMethodGroup();\n const [isUnavailable, setIsUnavailable] = useState(false);\n\n if (!hasApplePay || isUnavailable) {\n return null;\n }\n\n if (configuration.instantPayments && configuration.instantPayments.some((x) => x === \"applepay\")) {\n return null;\n }\n\n if (isObscuredByThreeDS(\"applepay\")) {\n return null;\n }\n\n return (\n <PaymentMethodItem\n icon={<ApplePayIcon />}\n title={i18n.t(\"applePay.title\")}\n isActive={activePaymentMethod === \"applepay\"}\n isSole={isSolePaymentMethod}\n onChange={() => setActivePaymentMethod(\"applepay\")}\n >\n <ApplePayButton\n configuration={configuration}\n paymentMethods={paymentMethods}\n isInstantPayment={false}\n onUnavailable={() => setIsUnavailable(true)}\n />\n </PaymentMethodItem>\n );\n}\n\nexport default ApplePayComponent;\n","import styleInject from '#style-inject';styleInject(\"\")","import { h } from \"preact\";\n\nconst ApplePayIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"26\" fill=\"none\" viewBox=\"0 0 40 26\">\n <path\n fill=\"#000\"\n d=\"M36.42 0H3.58a69.25 69.25 0 0 0-.75 0c-.25.01-.5.03-.76.07a2.51 2.51 0 0 0-1.32.7A2.43 2.43 0 0 0 .07 2.1 5.14 5.14 0 0 0 0 3.22v19.91c.01.25.03.51.07.76a2.6 2.6 0 0 0 .68 1.35 2.39 2.39 0 0 0 1.32.69 4.98 4.98 0 0 0 1.1.07h34a5 5 0 0 0 .76-.07 2.5 2.5 0 0 0 1.32-.7 2.44 2.44 0 0 0 .68-1.34 5.13 5.13 0 0 0 .07-1.11V2.87a6.5 6.5 0 0 0-.07-.76 2.58 2.58 0 0 0-.68-1.35 2.4 2.4 0 0 0-1.32-.69 4.96 4.96 0 0 0-1.1-.07h-.41Z\"\n />\n <path\n fill=\"#fff\"\n d=\"M36.42.87h.73c.2 0 .42.02.62.06a1.67 1.67 0 0 1 .88.44 1.58 1.58 0 0 1 .44.89 4.38 4.38 0 0 1 .06.97v19.55a14.67 14.67 0 0 1-.06.96 1.7 1.7 0 0 1-.44.89 1.54 1.54 0 0 1-.87.44 4.27 4.27 0 0 1-.96.06H2.85a3.7 3.7 0 0 1-.63-.06 1.66 1.66 0 0 1-.87-.45 1.56 1.56 0 0 1-.44-.88 4.35 4.35 0 0 1-.06-.97V2.9c.01-.2.02-.42.06-.63.03-.18.08-.34.16-.49A1.56 1.56 0 0 1 2.22.93a4.2 4.2 0 0 1 .96-.06h33.24\"\n />\n <path\n fill=\"#000\"\n d=\"M10.92 8.61c.34-.43.57-1 .51-1.59a2.21 2.21 0 0 0-1.99 2.3c.56.04 1.12-.3 1.48-.7Zm.51.81c-.82-.05-1.52.46-1.9.46-.4 0-1-.43-1.64-.42-.84 0-1.62.48-2.05 1.24-.88 1.52-.23 3.76.62 5 .42.6.92 1.27 1.58 1.25.62-.02.86-.4 1.62-.4.75 0 .97.4 1.63.39.69-.01 1.11-.61 1.53-1.22.47-.7.67-1.37.68-1.4-.01-.02-1.32-.52-1.33-2.02-.01-1.26 1.03-1.85 1.07-1.9a2.34 2.34 0 0 0-1.81-.98Zm7.11-1.7a2.87 2.87 0 0 1 3.02 3c0 1.8-1.27 3.03-3.06 3.03h-1.97v3.12h-1.42V7.72h3.43Zm-2 4.83h1.62c1.24 0 1.94-.66 1.94-1.82 0-1.15-.7-1.81-1.93-1.81h-1.64v3.63Zm5.39 2.43c0-1.17.9-1.89 2.48-1.98l1.83-.1v-.52c0-.74-.5-1.18-1.34-1.18-.8 0-1.3.38-1.41.97h-1.3c.08-1.2 1.1-2.09 2.76-2.09 1.62 0 2.65.86 2.65 2.2v4.6h-1.31v-1.1h-.04a2.38 2.38 0 0 1-2.1 1.2c-1.3 0-2.22-.8-2.22-2Zm4.3-.6v-.53l-1.64.1c-.82.06-1.28.42-1.28.99 0 .58.48.96 1.22.96.96 0 1.7-.66 1.7-1.52Zm2.61 4.95v-1.11c.1.03.33.03.44.03.64 0 .98-.27 1.19-.96l.12-.4-2.41-6.69h1.48l1.7 5.43h.02l1.69-5.43h1.44l-2.5 7.02c-.57 1.62-1.23 2.14-2.61 2.14a5.3 5.3 0 0 1-.56-.03Z\"\n />\n </svg>\n);\n\nexport default ApplePayIcon;\n","import styleInject from '#style-inject';styleInject(\".straumur__apple-pay-button__loading{display:flex;justify-content:center}\\n\")","import \"./apple-pay-button.css\";\nimport { h } from \"preact\";\nimport WalletButton, { WalletButtonProps } from \"../shared/wallet-button\";\n\ntype ApplePayButtonProps = Omit<WalletButtonProps, \"method\">;\n\nfunction ApplePayButton(props: ApplePayButtonProps): h.JSX.Element | null {\n return <WalletButton method=\"applepay\" {...props} />;\n}\n\nexport default ApplePayButton;\n","import { Fragment, h } from \"preact\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { StoredPaymentMethod, SuccessResponse } from \"../../services/models\";\nimport StoredCardComponent from \"./stored-card-component\";\nimport { useState } from \"preact/hooks\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\n\ninterface StoredCardContainerComponentProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n}\n\nfunction StoredCardContainerComponent({\n configuration,\n paymentMethods,\n}: StoredCardContainerComponentProps): h.JSX.Element | null {\n const [storedPaymentMethods, setStoredPaymentMethods] = useState<StoredPaymentMethod[]>(\n paymentMethods.paymentMethods.storedPaymentMethods ?? []\n );\n const { isObscuredByThreeDS, hasStoredPaymentMethods } = usePaymentMethodGroup();\n\n if (!hasStoredPaymentMethods || isObscuredByThreeDS(\"storedcard\")) {\n return null;\n }\n\n function handleStoredCardRemoved(storedPaymentMethodId: string): void {\n setStoredPaymentMethods((prevStoredPaymentMethods) =>\n prevStoredPaymentMethods.filter((storedPaymentMethod) => storedPaymentMethod.id !== storedPaymentMethodId)\n );\n }\n\n return (\n <Fragment>\n {storedPaymentMethods?.map((storedPaymentMethod) => (\n <StoredCardComponent\n key={storedPaymentMethod.id}\n configuration={configuration}\n storedPaymentMethod={storedPaymentMethod}\n paymentMethods={paymentMethods}\n onStoredCardRemoved={handleStoredCardRemoved}\n />\n ))}\n </Fragment>\n );\n}\n\nexport default StoredCardContainerComponent;\n","import { Fragment, h } from \"preact\";\nimport { useEffect, useRef, useState } from \"preact/hooks\";\nimport \"./stored-card-component.css\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport { Tooltip } from \"../../components/tooltip/tooltip\";\nimport InfoIcon from \"../../assets/icons/info\";\nimport { AdyenCheckout, AdyenCheckoutError, CustomCard, ICore, UIElement, UIElementProps } from \"@adyen/adyen-web\";\nimport { RenderBrandIcons } from \"../../utils/renderBrandIcons\";\nimport LoaderIcon from \"../../assets/icons/loader\";\nimport { StoredCardComponentProps, StoredCardFormError, StoredCardFormErrorField } from \"./models\";\nimport WarningIcon from \"../../assets/icons/warning\";\nimport PaymentMethodItem from \"../../components/payment-method-item/payment-method-item\";\nimport { createAdyenPaymentHandlers } from \"../../components/shared/create-adyen-handlers\";\nimport { submitCardWithGate } from \"../../components/shared/before-submit-click\";\nimport { useAdyenLocaleReinit } from \"../../utils/custom-hooks/use-adyen-locale-reinit\";\nimport { useFocusOnActivate } from \"../../utils/custom-hooks/use-focus-on-activate\";\nimport { useResolvedTheme } from \"../../utils/custom-hooks/use-resolved-theme\";\nimport { getAdyenFieldStyles } from \"../../utils/adyen-field-styles\";\nimport { toResultMessage } from \"../../flows/payment-flow\";\n\nfunction StoredCardComponent({\n configuration,\n paymentMethods,\n storedPaymentMethod,\n onStoredCardRemoved,\n}: StoredCardComponentProps): h.JSX.Element | null {\n const storedCardElementRef = useRef<HTMLDivElement>(null);\n const adyenCheckoutRef = useRef<ICore>();\n const customCardRef = useRef<CustomCard>();\n const { i18n } = useI18n();\n const [payButtonDisabled, setPayButtonDisabled] = useState<boolean>(true);\n const [securityCodePolicy, setSecurityCodePolicy] = useState<\"hidden\" | \"optional\" | \"required\">(\"required\");\n const [askConfirmRemoveStoredCard, setAskConfirmRemoveStoredCard] = useState<boolean>(false);\n const [formErrors, setFormErrors] = useState<StoredCardFormError>({\n encryptedSecurityCode: { visible: false },\n });\n const {\n activePaymentMethod,\n setActivePaymentMethod,\n activeStoredPaymentMethodId,\n setActiveStoredPaymentMethodId,\n isStoredCardInitialized,\n updateStoredCardInitialization,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n threeDSecureActive,\n isSolePaymentMethod,\n registerSubmitHandler,\n unregisterSubmitHandler,\n } = usePaymentMethodGroup();\n\n // In sole mode there is only one stored card, so being the active payment method is enough.\n // In normal mode both the method and the specific card ID must match.\n const isActive = isSolePaymentMethod\n ? activePaymentMethod === \"storedcard\"\n : activePaymentMethod === \"storedcard\" && activeStoredPaymentMethodId === storedPaymentMethod.id;\n\n const resolvedTheme = useResolvedTheme(configuration.theme);\n\n async function handleSubmitClick(): Promise<void> {\n await submitCardWithGate(configuration.paymentFlow, () => customCardRef.current);\n }\n\n useEffect(() => {\n const ready = isActive && isStoredCardInitialized[storedPaymentMethod.id];\n if (!ready) {\n // Nothing selected yet, or a different payment method is active - tell the\n // host explicitly so a custom submit button can default to disabled.\n configuration.onCardValidityChanged?.(false, false);\n return;\n }\n\n registerSubmitHandler(handleSubmitClick);\n return () => {\n unregisterSubmitHandler(handleSubmitClick);\n configuration.onCardValidityChanged?.(false, false);\n };\n }, [isActive, isStoredCardInitialized[storedPaymentMethod.id], registerSubmitHandler, unregisterSubmitHandler]);\n\n const { handleOnSubmit, handleOnSubmitAdditionalData, handlePaymentCompleted, handlePaymentFailed } =\n createAdyenPaymentHandlers({\n configuration,\n handleSuccess,\n handleError,\n setThreeDSecureActive,\n enrichSubmitData: (data) => ({\n ...data,\n paymentMethod: {\n ...data.paymentMethod,\n storedPaymentMethodId: storedPaymentMethod.id,\n },\n }),\n });\n\n function handleOnError(_: AdyenCheckoutError, __?: UIElement<UIElementProps> | undefined) {\n handleError({ key: \"error.unknownError\" });\n }\n\n const initializeAdyenComponent = async () => {\n adyenCheckoutRef.current = await AdyenCheckout({\n clientKey: paymentMethods.clientKey,\n environment: configuration.environment,\n locale: configuration.locale,\n countryCode: configuration.countryCode,\n amount: {\n value: paymentMethods.minorUnitsAmount,\n currency: paymentMethods.currency,\n },\n paymentMethodsResponse: paymentMethods.paymentMethods,\n onError: handleOnError,\n onAdditionalDetails: handleOnSubmitAdditionalData,\n onPaymentCompleted: handlePaymentCompleted,\n onPaymentFailed: handlePaymentFailed,\n });\n\n customCardRef.current = new CustomCard(adyenCheckoutRef.current, {\n brands: [storedPaymentMethod.brand!],\n styles: getAdyenFieldStyles(resolvedTheme),\n onSubmit: handleOnSubmit,\n onConfigSuccess() {\n updateStoredCardInitialization(storedPaymentMethod.id, true);\n },\n onBrand: (event) => {\n setSecurityCodePolicy(event.cvcPolicy);\n },\n onValidationError: (event) => {\n const defaultErrors: StoredCardFormError = {\n encryptedSecurityCode: { visible: false, message: undefined },\n };\n\n event\n .filter((x) => x.error)\n .forEach((x) => {\n defaultErrors[x.fieldType as StoredCardFormErrorField].visible = true;\n defaultErrors[x.fieldType as StoredCardFormErrorField].message = x.errorI18n;\n });\n\n setFormErrors(defaultErrors);\n },\n onAllValid: (event) => {\n setPayButtonDisabled(!event.allValid);\n configuration.onCardValidityChanged?.(event.allValid, true);\n },\n placeholders: configuration.placeholders,\n // Adyen appears to ignore challengeWindowSize on CustomCard; kept for parity with the wallet configs.\n challengeWindowSize: \"05\",\n });\n\n if (storedCardElementRef.current) {\n customCardRef.current.mount(storedCardElementRef.current);\n }\n };\n\n useEffect(() => {\n if (isActive && !isStoredCardInitialized[storedPaymentMethod.id]) {\n initializeAdyenComponent();\n }\n }, [configuration, isActive]);\n\n useAdyenLocaleReinit(\n configuration,\n () => Boolean(customCardRef.current && isStoredCardInitialized[activeStoredPaymentMethodId!]),\n () => {\n initializeAdyenComponent();\n setFormErrors({ encryptedSecurityCode: { visible: false, message: undefined } });\n }\n );\n\n useEffect(() => {\n setAskConfirmRemoveStoredCard(false);\n }, [activePaymentMethod, activeStoredPaymentMethodId]);\n\n // When the 3DS challenge replaces the stored-card field, move focus into the container.\n useFocusOnActivate(storedCardElementRef, threeDSecureActive && isActive);\n\n // Keep this guard below every hook call: returning early above a hook violates the\n // rules of hooks and corrupts hook ordering across renders.\n // Deliberately NOT isObscuredByThreeDS(\"storedcard\"): several stored-card components can be\n // mounted at once, so the one running the 3DS challenge is matched by card id via isActive.\n if (threeDSecureActive && !isActive) {\n return null;\n }\n\n function handleBoxChange() {\n setActivePaymentMethod(\"storedcard\");\n setActiveStoredPaymentMethodId(storedPaymentMethod.id);\n }\n\n function handleAskToConfirmRemoveCard() {\n setAskConfirmRemoveStoredCard(true);\n }\n\n function handleCancelRemoveStoredCard() {\n setAskConfirmRemoveStoredCard(false);\n }\n\n async function handleConfirmRemoveStoredCard() {\n const { disableToken } = configuration.paymentFlow;\n\n if (!disableToken) return;\n\n try {\n await disableToken(storedPaymentMethod.id);\n onStoredCardRemoved(storedPaymentMethod.id);\n } catch (error) {\n handleError(toResultMessage(error, \"error.failedToSubmitRemoveStoredPaymentCard\"));\n }\n }\n\n const canRemoveStoredCard = configuration.paymentFlow.disableToken !== undefined;\n\n const headerRight =\n canRemoveStoredCard && isActive && isStoredCardInitialized[storedPaymentMethod.id] ? (\n <div className=\"straumur__stored-card-component__remove-stored-card-button\">\n <button\n onClick={handleAskToConfirmRemoveCard}\n className=\"straumur__stored-card-component__remove-stored-card-button--text\"\n disabled={askConfirmRemoveStoredCard}\n >\n {i18n.t(\"stored-cards.removeStoredCard\")}\n </button>\n </div>\n ) : null;\n\n const confirmSection = (\n <div\n className={`${\"straumur__stored-card-component__confirm-remove-stored-card\"} ${\n askConfirmRemoveStoredCard ? \"straumur__stored-card-component__confirm-remove-stored-card--expanded\" : \"\"\n }`}\n >\n <div className=\"straumur__stored-card-component__confirm-remove-stored-card--header\">\n <WarningIcon />\n <span className=\"straumur__stored-card-component__confirm-remove-stored-card--header--title\">\n {i18n.t(\"stored-cards.removeStoredCardQuestion\")}\n </span>\n </div>\n <div className=\"straumur__stored-card-component__confirm-remove-stored-card--actions\">\n <button\n className=\"straumur__stored-card-component__confirm-remove-stored-card--actions--button\"\n onClick={handleConfirmRemoveStoredCard}\n >\n {i18n.t(\"stored-cards.removeStoredCardQuestionYesRemove\")}\n </button>\n <button\n className=\"straumur__stored-card-component__confirm-remove-stored-card--actions--button\"\n onClick={handleCancelRemoveStoredCard}\n >\n {i18n.t(\"stored-cards.removeStoredCardQuestionCancel\")}\n </button>\n </div>\n </div>\n );\n\n return (\n <PaymentMethodItem\n icon={\n <RenderBrandIcons\n brands={[\n {\n brand: storedPaymentMethod.brand!,\n brandFullName: storedPaymentMethod.name,\n },\n ]}\n />\n }\n title={`•••• ${storedPaymentMethod.lastFour}`}\n isActive={isActive}\n isSole={isSolePaymentMethod}\n onChange={handleBoxChange}\n headerRight={headerRight}\n confirmSection={confirmSection}\n >\n <div\n ref={storedCardElementRef}\n tabIndex={-1}\n style={{\n height: threeDSecureActive ? \"600px\" : \"auto\",\n minWidth: threeDSecureActive ? \"350px\" : \"auto\",\n }}\n >\n {!isStoredCardInitialized[storedPaymentMethod.id] && (\n <div className=\"straumur__stored-card-component__loading-text\">\n <LoaderIcon />\n </div>\n )}\n\n <div\n className=\"straumur__stored-card-component__form\"\n style={{\n opacity: isStoredCardInitialized[storedPaymentMethod.id] && !threeDSecureActive ? 1 : 0,\n position: isStoredCardInitialized[storedPaymentMethod.id] && !threeDSecureActive ? \"relative\" : \"absolute\",\n transition: \"opacity 0.3s ease-in-out\",\n }}\n >\n <div className=\"straumur__stored-card-component__form--field-wrapper\">\n <div className=\"straumur__stored-card-component__form--wrapper\">\n <label className=\"straumur__stored-card-component__form--wrapper--label straumur__stored-card-component__form--wrapper--label--readonly\">\n {i18n.t(\"stored-cards.expiryDate\")}\n </label>\n <span className=\"straumur__stored-card-component__form--wrapper--input straumur__stored-card-component__form--wrapper--input--readonly\">\n {storedPaymentMethod.expiryMonth}/{storedPaymentMethod.expiryYear}\n </span>\n </div>\n\n <div className=\"straumur__stored-card-component__form--wrapper\">\n {(securityCodePolicy === \"optional\" || securityCodePolicy === \"required\") && (\n <Fragment>\n <label\n className={`${\"straumur__stored-card-component__form--wrapper--label\"} ${\n formErrors.encryptedSecurityCode.visible\n ? \"straumur__stored-card-component__form--wrapper--label--error\"\n : \"\"\n }`}\n >\n {securityCodePolicy === \"optional\"\n ? i18n.t(\"stored-cards.securityCode3DigitsOptional\")\n : i18n.t(\"stored-cards.securityCode3Digits\")}\n </label>\n <span\n className={`${\"straumur__stored-card-component__form--wrapper--input\"} ${\n formErrors.encryptedSecurityCode.visible\n ? \"straumur__stored-card-component__form--wrapper--input--error\"\n : \"\"\n }`}\n data-cse=\"encryptedSecurityCode\"\n role=\"group\"\n aria-label={i18n.t(\"stored-cards.securityCode3Digits\")}\n >\n <div className=\"straumur__stored-card-component__form--wrapper--label--info\">\n <Tooltip content={i18n.t(\"stored-cards.securityCode3DigitsInfo\")}>\n <InfoIcon />\n </Tooltip>\n </div>\n </span>\n </Fragment>\n )}\n {formErrors.encryptedSecurityCode.visible && (\n <span className=\"straumur__stored-card-component__form--wrapper--error\">\n {formErrors.encryptedSecurityCode.message}\n </span>\n )}\n </div>\n </div>\n\n {!configuration.hideSubmitButton && (\n <button\n className=\"straumur__stored-card-component__submit-button\"\n disabled={payButtonDisabled}\n onClick={handleSubmitClick}\n >\n {paymentMethods.minorUnitsAmount === 0\n ? i18n.t(\"stored-cards.saveCardDetails\")\n : paymentMethods.formattedAmount}\n </button>\n )}\n </div>\n </div>\n </PaymentMethodItem>\n );\n}\n\nexport default StoredCardComponent;\n","import styleInject from '#style-inject';styleInject(\".straumur__stored-card-component__remove-stored-card-button{margin-left:auto}.straumur__stored-card-component__remove-stored-card-button--text{color:var(--straumur__color-danger-text);text-decoration:none;background:none;border:none;cursor:pointer;transition:all .2s ease}.straumur__stored-card-component__remove-stored-card-button--text:disabled{cursor:not-allowed;color:var(--straumur__color-secondary)}.straumur__stored-card-component__confirm-remove-stored-card{background-color:var(--straumur__color-warning-bg);border-radius:var(--straumur__border-radius-s);max-height:0;overflow:hidden;transition:all .3s ease;opacity:0}.straumur__stored-card-component__confirm-remove-stored-card--expanded{padding:var(--straumur__space-xxlg);max-height:600px;opacity:1}.straumur__stored-card-component__confirm-remove-stored-card--header{display:flex;align-items:center;gap:var(--straumur__space-lg);color:var(--straumur__color-text);padding-bottom:var(--straumur__space-xxlg)}.straumur__stored-card-component__confirm-remove-stored-card--actions{display:flex;gap:var(--straumur__space-lg);justify-content:end}.straumur__stored-card-component__confirm-remove-stored-card--actions--button{color:var(--straumur__color-warning-text);background:none;border:none;cursor:pointer;text-decoration:none;font-weight:700}.straumur__stored-card-component__loading-text{display:flex;justify-content:center}.straumur__stored-card-component__form{display:flex;padding-top:var(--straumur__space-xxlg);flex-direction:column;gap:var(--straumur__space-5xlg)}.straumur__stored-card-component__form--wrapper{display:flex;flex-direction:column;justify-items:start;position:relative;width:100%}.straumur__stored-card-component__form--wrapper--error{color:var(--straumur__color-red-beta);font-size:12px}.straumur__stored-card-component__form--wrapper--label{transform:translate(10px) translateY(-50%);z-index:1;background:linear-gradient(to top,var(--straumur__color-secondary-gamma) 53%,var(--straumur__color-transparent) 50%);position:absolute;font-weight:500;font-size:14px;padding:0 var(--straumur__space-xxs)}.straumur__stored-card-component__form--wrapper--label--readonly{background:linear-gradient(to top,var(--straumur__color-gray-epsilon) 53%,var(--straumur__color-transparent) 50%)}.straumur__stored-card-component__form--wrapper--label--error{color:var(--straumur__color-red-beta);background:linear-gradient(to top,var(--straumur__color-red-gamma) 53%,var(--straumur__color-transparent) 50%);font-size:13px;font-weight:500}.straumur__stored-card-component__form--wrapper--label--info{position:absolute;top:33%;right:var(--straumur__space-md)}.straumur__stored-card-component__form--wrapper--input{background:var(--straumur__color-secondary-gamma);color:var(--straumur__color-text);display:flex;align-items:center;border:1px solid var(--straumur__color-transparent);border-radius:var(--straumur__border-radius-s);font-size:16px;height:48px;outline:none;padding-left:var(--straumur__space-lg);transition:border .2s ease-out,box-shadow .2s ease-out;position:relative}.straumur__stored-card-component__form--wrapper--input--readonly{background-color:var(--straumur__color-gray-epsilon)}.straumur__stored-card-component__form--wrapper--input:hover{border:1px solid var(--straumur__color-cosmos-blue-delta)}.straumur__stored-card-component__form--wrapper--input--readonly:hover{border:1px solid var(--straumur__color-transparent)}.straumur__stored-card-component__form--wrapper--input--error{background:var(--straumur__color-red-gamma);border:1px solid var(--straumur__color-red-beta)}.straumur__stored-card-component__form--wrapper--input--error:hover{border:1px solid var(--straumur__color-red-beta)}.straumur__stored-card-component__form--field-wrapper{display:flex;width:100%;gap:var(--straumur__space-lg)}.straumur__stored-card-component__submit-button{background:var(--straumur__color-primary);border:none;border-radius:var(--straumur__border-radius-s);color:var(--straumur__color-white);cursor:pointer;font-size:16px;height:40px;outline:none;padding:0 var(--straumur__space-xxlg);transition:background .2s ease-out;width:100%}.straumur__stored-card-component__submit-button:hover{background:var(--straumur__color-primary);border:1px solid var(--straumur__color-border)}.straumur__stored-card-component__submit-button:disabled{background:var(--straumur__color-secondary);border:1px solid var(--straumur__color-border);cursor:not-allowed}\\n\")","import { h } from \"preact\";\n\nconst WarningIcon = () => (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_10650_34968)\">\n <path\n d=\"M12.0011 15C12.6245 15 13.1261 14.4984 13.1261 13.875V7.875C13.1261 7.25391 12.6222 6.75 12.0433 6.75C11.4644 6.75 10.8761 7.25625 10.8761 7.875V13.875C10.8761 14.4984 11.3823 15 12.0011 15ZM12.0011 16.5516C11.1873 16.5516 10.5273 17.2116 10.5273 18.0253C10.5292 18.8391 11.1855 19.5 12.0011 19.5C12.8167 19.5 13.4748 18.84 13.4748 18.0262C13.473 17.2125 12.8167 16.5516 12.0011 16.5516Z\"\n fill=\"#DFAE00\"\n />\n <path\n opacity=\"0.4\"\n d=\"M23.7312 19.5469L13.7328 2.48438C12.9673 1.17188 11.0356 1.17188 10.2649 2.48438L0.271188 19.5469C-0.49803 20.8547 0.460048 22.5 2.00181 22.5H21.9987C23.5343 22.5 24.4953 20.8594 23.7312 19.5469ZM10.8734 7.875C10.8734 7.25391 11.3773 6.75 11.9984 6.75C12.6195 6.75 13.1234 7.25625 13.1234 7.875V13.875C13.1234 14.4961 12.6195 15 12.0406 15C11.4617 15 10.8734 14.4984 10.8734 13.875V7.875ZM11.9984 19.5C11.1846 19.5 10.5246 18.84 10.5246 18.0262C10.5246 17.2125 11.1842 16.5525 11.9984 16.5525C12.8126 16.5525 13.4721 17.2125 13.4721 18.0262C13.4703 18.8391 12.814 19.5 11.9984 19.5Z\"\n fill=\"#DFAE00\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_10650_34968\">\n <rect width=\"24\" height=\"24\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nexport default WarningIcon;\n","import { h, ComponentChildren } from \"preact\";\nimport { PaymentMethodGroupContext, SubmitApi } from \"./payment-method-group-context\";\nimport \"./payment-method-group.css\";\nimport { PaymentMethod } from \"../../models/constants\";\n\ninterface PaymentMethodGroupProps {\n children: ComponentChildren;\n initialValue: PaymentMethod | null;\n isSolePaymentMethod: boolean;\n hasCard: boolean;\n hasGooglePay: boolean;\n hasApplePay: boolean;\n hasStoredPaymentMethods: boolean;\n onSubmitApiReady?: (api: SubmitApi) => void;\n}\n\nfunction PaymentMethodGroup({\n children,\n initialValue,\n isSolePaymentMethod,\n hasCard,\n hasGooglePay,\n hasApplePay,\n hasStoredPaymentMethods,\n onSubmitApiReady,\n}: PaymentMethodGroupProps): h.JSX.Element | null {\n return (\n <PaymentMethodGroupContext\n initialValue={initialValue}\n isSolePaymentMethod={isSolePaymentMethod}\n hasCard={hasCard}\n hasGooglePay={hasGooglePay}\n hasApplePay={hasApplePay}\n hasStoredPaymentMethods={hasStoredPaymentMethods}\n onSubmitApiReady={onSubmitApiReady}\n >\n <div className=\"straumur__payment-method-group\">{children}</div>\n </PaymentMethodGroupContext>\n );\n}\n\nexport default PaymentMethodGroup;\n","import styleInject from '#style-inject';styleInject(\".straumur__payment-method-group{display:flex;flex-direction:column;gap:var(--straumur__space-xxlg);width:100%}\\n\")","import { Fragment, h } from \"preact\";\nimport \"./result-component.css\";\nimport SuccessIcon from \"../../assets/icons/success\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\nimport FailureIcon from \"../../assets/icons/failure\";\nimport { useI18n } from \"../../localizations/i18n-context\";\nimport { ResultMessage } from \"../../models/models\";\n\nfunction ResultComponent(): h.JSX.Element | null {\n const { error, success } = usePaymentMethodGroup();\n const { i18n } = useI18n();\n\n if (!error && !success) {\n return null;\n }\n\n const renderMessage = (message: ResultMessage) => (\"key\" in message ? i18n.t(message.key) : message.text);\n\n return (\n <div className=\"straumur__result-component\">\n {error && (\n <Fragment>\n <span aria-hidden=\"true\">\n <FailureIcon />\n </span>\n {/* role=\"alert\" announces the failure to screen readers assertively (a declined payment\n was previously silent). */}\n <p className=\"straumur__result-component__error--message\" role=\"alert\">\n {renderMessage(error)}\n </p>\n </Fragment>\n )}\n\n {success && (\n <Fragment>\n <span aria-hidden=\"true\">\n <SuccessIcon />\n </span>\n <p className=\"straumur__result-component__success--message\" role=\"status\">\n {renderMessage(success)}\n </p>\n </Fragment>\n )}\n </div>\n );\n}\n\nexport default ResultComponent;\n","import styleInject from '#style-inject';styleInject(\".straumur__result-component{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;min-height:300px;background-color:var(--straumur__color-white);border-radius:var(--straumur__border-radius-xxlg)}\\n\")","import { h } from \"preact\";\n\nconst SuccessIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"120\" height=\"120\" viewBox=\"0 0 120 120\">\n <circle\n cx=\"60\"\n cy=\"60\"\n r=\"50\"\n fill=\"none\"\n stroke=\"#5b8206\"\n stroke-width=\"5\"\n stroke-dasharray=\"314\"\n stroke-dashoffset=\"314\"\n >\n <animate attributeName=\"stroke-dashoffset\" from=\"314\" to=\"0\" dur=\"1s\" fill=\"freeze\" />\n </circle>\n\n <g transform=\"translate(60,60)\">\n <path\n d=\"M-25 5 L-5 25 L25 -15\"\n fill=\"none\"\n stroke=\"#5b8206\"\n stroke-width=\"6\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-dasharray=\"100\"\n stroke-dashoffset=\"100\"\n >\n <animate attributeName=\"stroke-dashoffset\" from=\"100\" to=\"0\" dur=\"0.5s\" begin=\"1s\" fill=\"freeze\" />\n <animateTransform\n attributeName=\"transform\"\n type=\"scale\"\n from=\"1 1\"\n to=\"1.2 1.2\"\n begin=\"1.5s\"\n dur=\"0.2s\"\n fill=\"freeze\"\n additive=\"sum\"\n />\n <animateTransform\n attributeName=\"transform\"\n type=\"scale\"\n from=\"1.2 1.2\"\n to=\"1 1\"\n begin=\"1.7s\"\n dur=\"0.2s\"\n fill=\"freeze\"\n additive=\"sum\"\n />\n </path>\n </g>\n </svg>\n);\n\nexport default SuccessIcon;\n","import { h } from \"preact\";\n\nconst FailureIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"120\" height=\"120\" viewBox=\"0 0 120 120\">\n <circle\n cx=\"60\"\n cy=\"60\"\n r=\"50\"\n fill=\"none\"\n stroke=\"#d03e00\"\n stroke-width=\"5\"\n stroke-dasharray=\"314\"\n stroke-dashoffset=\"314\"\n >\n <animate attributeName=\"stroke-dashoffset\" from=\"314\" to=\"0\" dur=\"1s\" fill=\"freeze\" />\n </circle>\n\n <g transform=\"translate(60,60)\">\n <g id=\"crossGroup\">\n <line\n x1=\"-20\"\n y1=\"-20\"\n x2=\"20\"\n y2=\"20\"\n stroke=\"#d03e00\"\n stroke-width=\"6\"\n stroke-linecap=\"round\"\n stroke-dasharray=\"57\"\n stroke-dashoffset=\"57\"\n >\n <animate attributeName=\"stroke-dashoffset\" from=\"57\" to=\"0\" dur=\"0.3s\" begin=\"1s\" fill=\"freeze\" />\n </line>\n\n <line\n x1=\"20\"\n y1=\"-20\"\n x2=\"-20\"\n y2=\"20\"\n stroke=\"#d03e00\"\n stroke-width=\"6\"\n stroke-linecap=\"round\"\n stroke-dasharray=\"57\"\n stroke-dashoffset=\"57\"\n >\n <animate attributeName=\"stroke-dashoffset\" from=\"57\" to=\"0\" dur=\"0.3s\" begin=\"1.3s\" fill=\"freeze\" />\n </line>\n </g>\n </g>\n </svg>\n);\n\nexport default FailureIcon;\n","import { Fragment, h, ComponentChildren } from \"preact\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\n\ninterface PaymentMethodsWrapperProps {\n children: ComponentChildren;\n}\n\nfunction PaymentMethodsWrapper({ children }: PaymentMethodsWrapperProps): h.JSX.Element | null {\n const { error, success } = usePaymentMethodGroup();\n\n if (error || success) {\n return null;\n }\n\n return <Fragment>{children}</Fragment>;\n}\n\nexport default PaymentMethodsWrapper;\n","import { h } from \"preact\";\nimport { useState } from \"preact/hooks\";\nimport \"./instant-payments-component.css\";\nimport { StraumurCheckoutConfiguration } from \"../../models/models\";\nimport { SuccessResponse } from \"../../services/models\";\nimport GooglePayButton from \"../../components/google-pay-button/google-pay-button\";\nimport ApplePayButton from \"../../components/apple-pay-button/apple-pay-button\";\nimport { PaymentMethod } from \"../../models/constants\";\nimport { usePaymentMethodGroup } from \"../../components/payment-method-group/payment-method-group-context\";\n\ninterface InstantPaymentsComponentProps {\n configuration: StraumurCheckoutConfiguration;\n paymentMethods: SuccessResponse;\n}\n\nfunction InstantPaymentsComponent({\n configuration,\n paymentMethods,\n}: InstantPaymentsComponentProps): h.JSX.Element | null {\n const { hasGooglePay, hasApplePay } = usePaymentMethodGroup();\n const [unavailableMethods, setUnavailableMethods] = useState<Set<string>>(new Set());\n\n const handleUnavailable = (method: string) => {\n setUnavailableMethods((prev) => new Set(prev).add(method));\n };\n\n if (!configuration.instantPayments) {\n return null;\n }\n\n // safeguard: filter out any invalid payment methods, only allow applepay and googlepay\n const validInstantPayments: Extract<PaymentMethod, \"googlepay\" | \"applepay\">[] = [\"googlepay\", \"applepay\"];\n const availableInstantPayments = configuration.instantPayments.filter((payment) =>\n validInstantPayments.includes(payment)\n );\n\n // ensure the payment method is actually available from the paymentMethods response\n const finalAvailableInstantPayments = availableInstantPayments.filter((payment) =>\n payment === \"googlepay\" ? hasGooglePay : hasApplePay\n );\n\n const visibleInstantPayments = finalAvailableInstantPayments.filter((payment) => !unavailableMethods.has(payment));\n\n if (finalAvailableInstantPayments.length === 0) {\n return null;\n }\n\n return (\n // The unprefixed instant-payments classes predate the straumur__ convention and may be\n // targeted by host-page styles; keep them alongside the prefixed ones.\n <div\n className={`straumur__instant-payments instant-payments ${\n visibleInstantPayments.length > 1\n ? \"straumur__instant-payments--multiple instant-payments--multiple\"\n : \"straumur__instant-payments--single instant-payments--single\"\n }`}\n style={{ display: visibleInstantPayments.length === 0 ? \"none\" : undefined }}\n >\n {finalAvailableInstantPayments.map((paymentMethod) => {\n if (paymentMethod === \"googlepay\") {\n return (\n <GooglePayButton\n key={paymentMethod}\n configuration={configuration}\n paymentMethods={paymentMethods}\n isInstantPayment={true}\n onUnavailable={() => handleUnavailable(\"googlepay\")}\n />\n );\n }\n if (paymentMethod === \"applepay\") {\n return (\n <ApplePayButton\n key={paymentMethod}\n configuration={configuration}\n paymentMethods={paymentMethods}\n isInstantPayment={true}\n onUnavailable={() => handleUnavailable(\"applepay\")}\n />\n );\n }\n\n // this should never happen due to our filtering above, but typescript safeguard\n return null;\n })}\n </div>\n );\n}\n\nexport default InstantPaymentsComponent;\n","import styleInject from '#style-inject';styleInject(\".instant-payments{display:grid;gap:var(--straumur__space-lg);grid-template-columns:1fr 1fr}.instant-payments--single{grid-template-columns:1fr}@container straumur (max-width: 420px){.instant-payments{grid-template-columns:1fr}}\\n\")","import { Language, TranslationKey, translations } from \"./translations\";\n\nexport class I18nService {\n constructor(\n private language: Language,\n private customLocalizations?: Partial<Record<Language, Partial<Record<TranslationKey, string>>>>\n ) {}\n\n t(key: TranslationKey): string {\n const localizedString = this.customLocalizations?.[this.language]?.[key];\n return localizedString || translations[this.language][key] || key;\n }\n\n setLanguage(language: Language): void {\n this.language = language;\n }\n\n updateCustomLocalizations(\n customLocalizations: Partial<Record<Language, Partial<Record<TranslationKey, string>>>>\n ): void {\n this.customLocalizations = customLocalizations;\n }\n}\n","import { h, ComponentChildren } from \"preact\";\nimport SuccessIcon from \"../../assets/icons/success\";\nimport FailureIcon from \"../../assets/icons/failure\";\nimport LoaderIcon from \"../../assets/icons/loader\";\nimport { ResultMessage, Theme } from \"../../models/models\";\nimport { I18nService } from \"../../localizations/i18n-service\";\nimport { useResolvedTheme } from \"../../utils/custom-hooks/use-resolved-theme\";\n\n// The widget's outer wrapper. Carries data-theme so the dark palette is scoped to the\n// widget (never leaks to the host page); \"system\" resolves live via prefers-color-scheme.\nexport function RootComponent({ children, theme = \"light\" }: { children: ComponentChildren; theme?: Theme }) {\n const resolvedTheme = useResolvedTheme(theme);\n return (\n <div className=\"straumur__root-component\" data-theme={resolvedTheme}>\n {children}\n </div>\n );\n}\n\n/** Full-widget loader shown while session mode fetches its payment methods. */\nexport function LoaderScreen({ theme }: { theme?: Theme }) {\n return (\n <RootComponent theme={theme}>\n <div className=\"straumur__component\">\n <LoaderIcon />\n </div>\n </RootComponent>\n );\n}\n\n/** Full-widget success/failure screen rendered imperatively by the StraumurCheckout class. */\nexport function StatusScreen({\n variant,\n message,\n i18n,\n theme,\n}: {\n variant: \"success\" | \"failure\";\n message: ResultMessage;\n i18n: I18nService;\n theme?: Theme;\n}) {\n return (\n <RootComponent theme={theme}>\n <div className=\"straumur__component\">\n <span aria-hidden=\"true\">{variant === \"success\" ? <SuccessIcon /> : <FailureIcon />}</span>\n {/* Failure is announced assertively (role=\"alert\"); success politely (role=\"status\"). */}\n <p role={variant === \"success\" ? \"status\" : \"alert\"}>{\"key\" in message ? i18n.t(message.key) : message.text}</p>\n </div>\n </RootComponent>\n );\n}\n","import { Language } from \"../localizations/translations\";\nimport { StraumurWebAdvancedConfiguration } from \"../models/models\";\nimport { SuccessResponse } from \"./models\";\n\n// shapes the advanced-mode configuration into the same response object the session-mode\n// payment-methods call returns, so the component tree consumes both modes identically\nexport function normalizeAdvancedConfiguration(\n configuration: StraumurWebAdvancedConfiguration,\n locale: Language\n): SuccessResponse {\n return {\n resultCode: \"Success\",\n clientKey: configuration.clientKey,\n paymentMethods: configuration.paymentMethods,\n minorUnitsAmount: configuration.amount.value,\n currency: configuration.amount.currency,\n amount: configuration.amount.value / 100,\n formattedAmount: configuration.formattedAmount,\n merchantName: configuration.merchantName,\n enableStoreDetails: configuration.enableStoreDetails,\n locale,\n };\n}\n","import {\n StraumurCheckoutConfiguration,\n StraumurWebAdvancedConfiguration,\n StraumurWebConfiguration,\n StraumurWebInternalConfiguration,\n} from \"../models/models\";\nimport { createAdvancedPaymentFlow, createSessionPaymentFlow } from \"../flows/payment-flow\";\nimport { normalizeLocale } from \"../localizations/locale\";\nimport { normalizeAdvancedConfiguration } from \"../services/advanced-normalizer\";\nimport { SuccessResponse } from \"../services/models\";\n\n// Session mode has no countryCode input and the payment-methods response carries none,\n// so it is fixed to Iceland until the backend provides one.\nconst SESSION_COUNTRY_CODE = \"IS\";\n\nexport function isSessionConfiguration(config: StraumurWebInternalConfiguration): config is StraumurWebConfiguration {\n return typeof config.sessionId === \"string\" && config.sessionId.length > 0;\n}\n\n// the union only protects TypeScript consumers — IIFE consumers get no compile-time checking\nexport function isValidAdvancedConfiguration(config: StraumurWebAdvancedConfiguration): boolean {\n return (\n typeof config.clientKey === \"string\" &&\n config.clientKey.length > 0 &&\n typeof config.countryCode === \"string\" &&\n config.countryCode.length > 0 &&\n typeof config.paymentMethods === \"object\" &&\n config.paymentMethods !== null &&\n typeof config.amount === \"object\" &&\n config.amount !== null &&\n typeof config.amount.value === \"number\" &&\n typeof config.amount.currency === \"string\" &&\n typeof config.onSubmit === \"function\" &&\n typeof config.onAdditionalDetails === \"function\"\n );\n}\n\nexport interface CheckoutInitialization {\n configuration: StraumurCheckoutConfiguration;\n /** The raw advanced configuration when valid; null in session mode or when invalid. */\n advancedConfiguration: StraumurWebAdvancedConfiguration | null;\n /** Advanced mode only: the configuration normalized into a session-style Success response. */\n paymentMethods: SuccessResponse | null;\n initializationFailed: boolean;\n}\n\n/**\n * Maps the public constructor input (session, or the runtime-detected internal advanced\n * configuration) to the internal checkout state. Called exactly once per instance —\n * the returned configuration object's identity drives the components' reinit effects.\n */\nexport function buildCheckoutConfiguration(publicConfig: StraumurWebConfiguration): CheckoutInitialization {\n const config = publicConfig as StraumurWebInternalConfiguration;\n const locale = normalizeLocale(config.locale);\n const isSession = isSessionConfiguration(config);\n\n const configuration: StraumurCheckoutConfiguration = {\n mode: isSession ? \"session\" : \"advanced\",\n sessionId: config.sessionId,\n environment: config.environment,\n countryCode: isSession ? SESSION_COUNTRY_CODE : config.countryCode,\n paymentFlow: isSession\n ? createSessionPaymentFlow(config.environment, config.sessionId)\n : createAdvancedPaymentFlow(config),\n onPaymentCompleted: config.onPaymentCompleted,\n onPaymentFailed: config.onPaymentFailed,\n placeholders: config.placeholders,\n locale,\n customLocalizations: config.localizations,\n instantPayments: config.instantPayments,\n hideSubmitButton: config.hideSubmitButton,\n onCardValidityChanged: config.onCardValidityChanged,\n allowedPaymentMethods: config.allowedPaymentMethods,\n theme: config.theme ?? \"light\",\n };\n\n if (isSession) {\n return { configuration, advancedConfiguration: null, paymentMethods: null, initializationFailed: false };\n }\n\n if (!isValidAdvancedConfiguration(config)) {\n return { configuration, advancedConfiguration: null, paymentMethods: null, initializationFailed: true };\n }\n\n return {\n configuration,\n advancedConfiguration: config,\n paymentMethods: normalizeAdvancedConfiguration(config, locale),\n initializationFailed: false,\n };\n}\n"],"mappings":"AAAA,OAAS,KAAAA,GAAG,UAAAC,OAAc,SCCD,SAARC,EAA6BC,EAAK,CAAE,SAAAC,CAAS,EAAI,CAAC,EAAG,CAC1D,GAAI,CAACD,GAAO,OAAO,SAAa,IAAa,OAE7C,IAAME,EAAO,SAAS,MAAQ,SAAS,qBAAqB,MAAM,EAAE,CAAC,EAC/DC,EAAQ,SAAS,cAAc,OAAO,EAC5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AAK,oCAAqC,CAAC,EAC9D,KAAK,cAAc,kBAAkB,CAAE,WAAY,OAAQ,CAAC,CAC9D,CACF,CAEA,aAAaa,EAAgD,CAC3D,GAAM,CAAE,OAAAC,EAAQ,GAAGC,CAAK,EAAIF,EAE5B,KAAK,cAAgB,CACnB,GAAG,KAAK,cACR,GAAGE,EAEH,GAAID,EAAS,CAAE,OAAQE,GAAgBF,CAAM,CAAE,EAAI,CAAC,CACtD,EAGIA,GACF,KAAK,KAAK,YAAY,KAAK,cAAc,MAAM,EAE7CD,EAAU,qBACZ,KAAK,KAAK,0BAA0BA,EAAU,mBAAmB,EAI/D,KAAK,cACP,KAAK,gBAAgB,CAEzB,CAEA,YAAYC,EAA4B,CACtC,KAAK,aAAa,CAChB,OAAQA,CACV,CAAC,CACH,CAEA,SAAgB,CAEV,KAAK,eACPnB,GAAO,KAAM,KAAK,YAAY,EAC9B,KAAK,aAAe,MAEtB,KAAK,UAAY,IACnB,CAEA,YAAsB,CACpB,GAAI,CAAC,KAAK,aACR,eAAQ,KAAK,0EAA0E,EAChF,GAGT,GAAI,CAAC,KAAK,UACR,eAAQ,KAAK,4EAA4E,EAClF,GAGT,IAAMsB,EAAY,KAAK,UAAU,cAAc,EAE/C,OAAKA,GACH,QAAQ,KACN,6GACF,EAGKA,CACT,CACF,EAEOC,GAAQ7B","names":["h","render","styleInject","css","insertAt","head","style","styleInject","getEnv","env","getBaseUrl","environment","env","getPaymentMethods","body","createPaymentRequest","createDetailsRequest","postDisableTokenRequest","translations","isTranslationKey","value","setupPaymentMethods","environment","sessionId","fetchResponse","getPaymentMethods","contentType","errorMessage","serverErrorMessage","isTranslationKey","normalizeLocale","locale","h","h","useState","styleInject","h","createContext","useState","useContext","useCallback","useRef","useLayoutEffect","PaymentMethodContext","defaultIsInitialized","PaymentMethodGroupContext","children","initialValue","isSolePaymentMethod","hasCard","hasGooglePay","hasApplePay","hasStoredPaymentMethods","onSubmitApiReady","activePaymentMethod","setActivePaymentMethod","activeSubmitHandlerRef","registerSubmitHandler","handler","unregisterSubmitHandler","triggerSubmit","activeStoredPaymentMethodId","setActiveStoredPaymentMethodId","threeDSecureActive","setThreeDSecureActive","isPaymentMethodInitialized","setIsPaymentMethodInitialized","isStoredCardInitialized","setIsStoredCardInitialized","success","setSuccess","error","setError","updatePaymentMethodInitialization","paymentMethod","isInitialized","prevState","updateStoredCardInitialization","storedPaymentMethod","isObscuredByThreeDS","method","handleError","handleSuccess","usePaymentMethodGroup","context","h","createContext","useContext","I18nContext","I18nProvider","children","i18nService","onLanguageChange","changeLanguage","newLanguage","useI18n","context","h","CardIcon","card_default","Fragment","h","h","MasterCardIcon","opacity","mastercard_default","h","VisaIcon","opacity","visa_default","h","MaestroIcon","opacity","maestro_default","h","AmexIcon","opacity","amex_default","h","JcbIcon","opacity","jcb_default","h","DinersIcon","opacity","diners_default","h","DiscoverIcon","opacity","discover_default","h","CupIcon","opacity","cup_default","h","styleInject","useRef","useState","Tooltip","children","content","isVisible","setIsVisible","triggerRef","h","useEffect","useState","useMediaQuery","query","getMatch","matches","setMatches","mediaQueryList","listener","event","RenderBrandIcons","brands","brandHidden","limit","isWidth380","useMediaQuery","widthLimit","brandToShow","brand","brandName","x","h","Fragment","index","Tooltip","RenderBrandIcon","defaultToBrandName","visa_default","mastercard_default","maestro_default","amex_default","jcb_default","diners_default","discover_default","cup_default","Fragment","h","useRef","useState","useEffect","AdyenCheckout","CustomCard","h","InfoIcon","info_default","h","LoaderIcon","loader_default","h","CheckmarkIcon","color","checkmark_default","h","BrandOption","brand","brandName","isSelected","onBrandClick","handleKeyDown","e","h","RenderBrandIcon","checkmark_default","RenderDualBrandComponent","dualBrandConfiguration","selectedBrand","RESULT_CODES","toResultCode","value","PaymentFlowError","messageKey","messageText","toResultMessage","error","fallbackKey","createSessionPaymentFlow","environment","sessionId","data","body","fetchResponse","createPaymentRequest","response","createDetailsRequest","storedPaymentMethodId","postDisableTokenRequest","createAdvancedPaymentFlow","configuration","invokeHostHandler","invoke","resolve","reject","thrownErrorKey","rejectWithFlowError","flow","res","rej","errorMessage","onDisableToken","runBeforeSubmit","paymentFlow","beforeSubmit","submitCardWithGate","getElement","createBeforeSubmitClickHandler","resolve","reject","result","valid","FAILED_RESULT_CODES","createAdyenPaymentHandlers","options","configuration","handleSuccess","handleError","setThreeDSecureActive","enrichSubmitData","onSubmitStart","dispatchResultFromAdditionalDetails","failureMessage","failureResultMessage","dispatchFinalResult","resultCode","handleOnSubmit","state","_","actions","paymentFlow","runBeforeSubmit","data","action","errorMessage","error","toResultMessage","handleOnSubmitAdditionalData","handlePaymentCompleted","toResultCode","handlePaymentFailed","useEffect","useAdyenLocaleReinit","configuration","isReady","reinitialize","useEffect","useFocusOnActivate","ref","active","useEffect","useState","DARK_QUERY","systemPrefersDark","useResolvedTheme","theme","systemDark","setSystemDark","query","onChange","event","getAdyenFieldStyles","theme","CardForm","configuration","paymentMethods","onBrandHidden","cardElementRef","useRef","adyenCheckoutRef","customCardRef","i18n","useI18n","payButtonDisabled","setPayButtonDisabled","useState","securityCodePolicy","setSecurityCodePolicy","storePaymentMethod","setStorePaymentMethod","isDualBrand","setIsDualBrand","dualBrandConfiguration","setDualBrandConfiguration","selectedBrand","setSelectedBrand","storePaymentMethodRef","formErrors","setFormErrors","activePaymentMethod","isPaymentMethodInitialized","updatePaymentMethodInitialization","handleSuccess","handleError","setThreeDSecureActive","threeDSecureActive","isObscuredByThreeDS","hasCard","registerSubmitHandler","unregisterSubmitHandler","usePaymentMethodGroup","resolvedTheme","useResolvedTheme","handleSubmitClick","submitCardWithGate","useEffect","schemeBrands","x","handleOnSubmit","handleOnSubmitAdditionalData","handlePaymentCompleted","handlePaymentFailed","createAdyenPaymentHandlers","data","handleOnError","_","__","initializeAdyenComponent","AdyenCheckout","CustomCard","getAdyenFieldStyles","event","selectedBrands","defaultErrors","useAdyenLocaleReinit","dualBrandListener","e","handleStorePaymentMethodChange","useFocusOnActivate","h","loader_default","Fragment","Tooltip","info_default","RenderDualBrandComponent","checkmark_default","card_form_default","h","styleInject","PaymentMethodItem","icon","title","isActive","isSole","onChange","children","headerRight","confirmSection","h","payment_method_item_default","CardComponent","configuration","paymentMethods","i18n","useI18n","brandHidden","setBrandHidden","useState","activePaymentMethod","setActivePaymentMethod","isObscuredByThreeDS","isSolePaymentMethod","hasCard","usePaymentMethodGroup","brands","x","h","payment_method_item_default","card_default","RenderBrandIcons","card_form_default","card_component_default","h","useState","styleInject","h","GooglePayIcon","googlepay_default","styleInject","h","Fragment","h","useEffect","useRef","AdyenCheckout","ApplePay","GooglePay","CANCEL","WALLETS","core","configuration","paymentMethods","walletConfig","handleOnSubmit","applePayConfiguration","createBeforeSubmitClickHandler","ApplePay","googlePayConfiguration","GooglePay","WalletButton","method","isInstantPayment","onUnavailable","wallet","walletElementRef","useRef","adyenCheckoutRef","walletRef","isPaymentMethodInitialized","updatePaymentMethodInitialization","handleSuccess","handleError","setThreeDSecureActive","threeDSecureActive","isObscuredByThreeDS","setActivePaymentMethod","activePaymentMethod","usePaymentMethodGroup","handleOnSubmitAdditionalData","handlePaymentCompleted","handlePaymentFailed","createAdyenPaymentHandlers","handleOnError","data","_","CANCEL","markUnavailable","initializeAdyenComponent","AdyenCheckout","x","useEffect","useAdyenLocaleReinit","h","Fragment","loader_default","wallet_button_default","GooglePayButton","props","h","wallet_button_default","google_pay_button_default","GooglePayComponent","configuration","paymentMethods","i18n","useI18n","activePaymentMethod","setActivePaymentMethod","isObscuredByThreeDS","isSolePaymentMethod","hasGooglePay","usePaymentMethodGroup","isUnavailable","setIsUnavailable","useState","x","h","payment_method_item_default","googlepay_default","google_pay_button_default","google_pay_component_default","h","useState","styleInject","h","ApplePayIcon","applepay_default","styleInject","h","ApplePayButton","props","h","wallet_button_default","apple_pay_button_default","ApplePayComponent","configuration","paymentMethods","i18n","useI18n","activePaymentMethod","setActivePaymentMethod","isObscuredByThreeDS","isSolePaymentMethod","hasApplePay","usePaymentMethodGroup","isUnavailable","setIsUnavailable","useState","x","h","payment_method_item_default","applepay_default","apple_pay_button_default","apple_pay_component_default","Fragment","h","Fragment","h","useEffect","useRef","useState","styleInject","AdyenCheckout","CustomCard","h","WarningIcon","warning_default","StoredCardComponent","configuration","paymentMethods","storedPaymentMethod","onStoredCardRemoved","storedCardElementRef","useRef","adyenCheckoutRef","customCardRef","i18n","useI18n","payButtonDisabled","setPayButtonDisabled","useState","securityCodePolicy","setSecurityCodePolicy","askConfirmRemoveStoredCard","setAskConfirmRemoveStoredCard","formErrors","setFormErrors","activePaymentMethod","setActivePaymentMethod","activeStoredPaymentMethodId","setActiveStoredPaymentMethodId","isStoredCardInitialized","updateStoredCardInitialization","handleSuccess","handleError","setThreeDSecureActive","threeDSecureActive","isSolePaymentMethod","registerSubmitHandler","unregisterSubmitHandler","usePaymentMethodGroup","isActive","resolvedTheme","useResolvedTheme","handleSubmitClick","submitCardWithGate","useEffect","handleOnSubmit","handleOnSubmitAdditionalData","handlePaymentCompleted","handlePaymentFailed","createAdyenPaymentHandlers","data","handleOnError","_","__","initializeAdyenComponent","AdyenCheckout","CustomCard","getAdyenFieldStyles","event","defaultErrors","x","useAdyenLocaleReinit","useFocusOnActivate","handleBoxChange","handleAskToConfirmRemoveCard","handleCancelRemoveStoredCard","handleConfirmRemoveStoredCard","disableToken","error","toResultMessage","headerRight","h","confirmSection","warning_default","payment_method_item_default","RenderBrandIcons","loader_default","Fragment","Tooltip","info_default","stored_card_component_default","useState","StoredCardContainerComponent","configuration","paymentMethods","storedPaymentMethods","setStoredPaymentMethods","useState","isObscuredByThreeDS","hasStoredPaymentMethods","usePaymentMethodGroup","handleStoredCardRemoved","storedPaymentMethodId","prevStoredPaymentMethods","storedPaymentMethod","h","Fragment","stored_card_component_default","stored_card_container_component_default","h","styleInject","PaymentMethodGroup","children","initialValue","isSolePaymentMethod","hasCard","hasGooglePay","hasApplePay","hasStoredPaymentMethods","onSubmitApiReady","h","PaymentMethodGroupContext","payment_method_group_default","Fragment","h","styleInject","h","SuccessIcon","success_default","h","FailureIcon","failure_default","ResultComponent","error","success","usePaymentMethodGroup","i18n","useI18n","renderMessage","message","h","Fragment","failure_default","success_default","result_component_default","Fragment","h","PaymentMethodsWrapper","children","error","success","usePaymentMethodGroup","h","Fragment","payment_methods_wrapper_default","h","useState","styleInject","InstantPaymentsComponent","configuration","paymentMethods","hasGooglePay","hasApplePay","usePaymentMethodGroup","unavailableMethods","setUnavailableMethods","useState","handleUnavailable","method","prev","validInstantPayments","finalAvailableInstantPayments","payment","visibleInstantPayments","h","paymentMethod","google_pay_button_default","apple_pay_button_default","instant_payments_component_default","determineInitialState","hasCard","hasGooglePay","hasApplePay","storedCount","instantPayments","gpayInStandard","x","apayInStandard","StraumurCheckoutContainer","configuration","paymentMethods","onSubmitApiReady","methods","stored","isAllowed","method","hasStoredPaymentMethods","initialPaymentMethod","isSolePaymentMethod","h","payment_method_group_default","payment_methods_wrapper_default","instant_payments_component_default","stored_card_container_component_default","card_component_default","google_pay_component_default","apple_pay_component_default","result_component_default","straumur_checkout_container_default","AdyenCheckout","I18nService","language","customLocalizations","key","translations","h","RootComponent","children","theme","resolvedTheme","useResolvedTheme","h","LoaderScreen","loader_default","StatusScreen","variant","message","i18n","success_default","failure_default","normalizeAdvancedConfiguration","configuration","locale","SESSION_COUNTRY_CODE","isSessionConfiguration","config","isValidAdvancedConfiguration","buildCheckoutConfiguration","publicConfig","locale","normalizeLocale","isSession","configuration","createSessionPaymentFlow","createAdvancedPaymentFlow","normalizeAdvancedConfiguration","StraumurCheckout","publicConfig","initialization","buildCheckoutConfiguration","I18nService","selector","render","h","LoaderScreen","response","setupPaymentMethods","error","RootComponent","I18nProvider","language","straumur_checkout_container_default","api","message","StatusScreen","redirectResult","redirectContext","handleOnSubmitAdditionalData","createAdyenPaymentHandlers","AdyenCheckout","newConfig","locale","rest","normalizeLocale","triggered","straumur_checkout_default"]}