@adyen/adyen-platform-experience-web
Version:

1 lines • 11.4 kB
Source Map (JSON)
{"version":3,"file":"InputText-C55stM8O-CKH_l31R.cjs","sources":["../node_modules/.pnpm/@adyen+kyc-components@4.0.0-compact.9_react@19.2.0_typescript@5.8.3/node_modules/@adyen/kyc-components/dist/debugStore-BvbyN1Oi.js","../node_modules/.pnpm/@adyen+kyc-components@4.0.0-compact.9_react@19.2.0_typescript@5.8.3/node_modules/@adyen/kyc-components/dist/types-CQ2p58-6.js","../node_modules/.pnpm/@adyen+kyc-components@4.0.0-compact.9_react@19.2.0_typescript@5.8.3/node_modules/@adyen/kyc-components/dist/InputText-C55stM8O.js"],"sourcesContent":[";\n{\n try {\n let e = \"undefined\" != typeof window ? window : \"undefined\" != typeof global ? global : \"undefined\" != typeof globalThis ? globalThis : \"undefined\" != typeof self ? self : {}, n = new e.Error().stack;\n n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = \"73c7917c-5618-4937-9265-5998f2d50ce6\", e._sentryDebugIdIdentifier = \"sentry-dbid-73c7917c-5618-4937-9265-5998f2d50ce6\");\n } catch (e) {\n }\n}\n;\nimport { signal } from \"@preact/signals\";\nconst formDebugInfo = signal({});\nexport {\n formDebugInfo as f\n};\n",";\n{\n try {\n let e = \"undefined\" != typeof window ? window : \"undefined\" != typeof global ? global : \"undefined\" != typeof globalThis ? globalThis : \"undefined\" != typeof self ? self : {}, n = new e.Error().stack;\n n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = \"80171e8f-300c-4f9d-9068-4933244c160a\", e._sentryDebugIdIdentifier = \"sentry-dbid-80171e8f-300c-4f9d-9068-4933244c160a\");\n } catch (e) {\n }\n}\n;\nconst SettingNames = {\n AcceptedCountries: \"acceptedCountries\",\n AllowBankAccountFormatSelection: \"allowBankAccountFormatSelection\",\n AllowDebugUi: \"allowDebugUi\",\n AllowIntraRegionCrossBorderPayout: \"allowIntraRegionCrossBorderPayout\",\n AllowLegalEntityTypeChange: \"changeLegalEntityType\",\n AllowPrefilledCountryEdit: \"editPrefilledCountry\",\n RequirePciSignEcommerce: \"requirePciSignEcommerce\",\n RequirePciSignPos: \"requirePciSignPos\",\n RequirePciSignEcomMoto: \"requirePciSignEcomMoto\",\n RequirePciSignPosMoto: \"requirePciSignPosMoto\",\n HideOnboardingIntroductionIndividual: \"hideOnboardingIntroductionIndividual\",\n HideOnboardingIntroductionOrganization: \"hideOnboardingIntroductionOrganization\",\n HideOnboardingIntroductionTrust: \"hideOnboardingIntroductionTrust\",\n HideOnboardingIntroductionSoleProprietor: \"hideOnboardingIntroductionSoleProprietor\",\n TransferInstrumentLimit: \"transferInstrumentLimit\",\n ViewOnboardingGuidance: \"viewOnboardingGuidance\",\n InstantBankVerification: \"instantBankVerification\",\n ShowServiceAgreementsFirst: \"showServiceAgreementsFirst\",\n ShowBusinessFinancingFirst: \"showBusinessFinancingFirst\",\n EnforceLegalAge: \"enforceLegalAge\",\n MerchantType: \"merchantType\",\n AllowBusinessLines: \"allowBusinessLines\"\n};\nexport {\n SettingNames as S\n};\n",";\n{\n try {\n let e = \"undefined\" != typeof window ? window : \"undefined\" != typeof global ? global : \"undefined\" != typeof globalThis ? globalThis : \"undefined\" != typeof self ? self : {}, n = new e.Error().stack;\n n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = \"4f20d737-2dea-42ed-9fe4-584121c2c863\", e._sentryDebugIdIdentifier = \"sentry-dbid-4f20d737-2dea-42ed-9fe4-584121c2c863\");\n } catch (e) {\n }\n}\n;\nimport { jsx } from \"preact/jsx-runtime\";\nimport { forwardRef } from \"preact/compat\";\nimport { useRef, useState, useCallback, useLayoutEffect } from \"preact/hooks\";\nimport cx from \"classnames\";\nimport { z as useAnalyticsContext } from \"./StoreProvider-CBB99upB.js\";\nimport { d as debouncedInputEvent } from \"./debouncedInputEvent-Cv2S512Y.js\";\nconst InputBase = forwardRef((props, ref) => {\n const userEvents = useAnalyticsContext();\n const { enableTracking = false, ...passedProps } = props;\n const { isInvalid, isValid, type = \"text\", disabled, name } = props;\n const handleInput = (e) => {\n if (enableTracking) {\n debouncedInputEvent(userEvents, { actionType: \"input\", field: name });\n }\n props.onInput?.(e);\n };\n const handleBlur = (e) => {\n if (enableTracking) {\n userEvents.addFieldEvent(\"Interacted with form field\", {\n actionType: \"blur\",\n field: name\n });\n }\n props.onBlurHandler?.(e);\n if (props.trimOnBlur) {\n e.currentTarget.value = e.currentTarget.value.trim();\n }\n props.onBlur?.(e);\n };\n const handleFocus = (e) => {\n if (enableTracking) {\n userEvents.addFieldEvent(\"Interacted with form field\", {\n actionType: \"focus\",\n field: name\n });\n }\n props.onFocusHandler?.(e);\n };\n const inputClassNames = cx(\"adyen-kyc-input\", [`adyen-kyc-input--${type}`], props.className, {\n \"adyen-kyc-input--invalid\": isInvalid,\n \"adyen-kyc-field--valid\": isValid,\n \"adyen-kyc-input--disabled\": disabled\n });\n return /* @__PURE__ */ jsx(\n \"input\",\n {\n ...passedProps,\n name,\n \"aria-disabled\": disabled,\n \"aria-invalid\": !isValid,\n \"aria-required\": passedProps.required || passedProps[\"aria-required\"],\n className: inputClassNames,\n onBlur: handleBlur,\n onFocus: handleFocus,\n onInput: handleInput,\n ref,\n type\n }\n );\n});\nInputBase.displayName = \"InputBase\";\nconst useForwardedRef = (forwardedRef) => {\n const backupRef = useRef();\n return forwardedRef ?? backupRef;\n};\nconst InputText = forwardRef(\n ({ onInput, onBlur, transformInput, transformMode, ...props }, ref) => {\n const [cursorPosition, setCursorPosition] = useState(null);\n const localRef = useForwardedRef(ref);\n const inputHandler = useCallback(\n (event) => {\n const inputEl = event.currentTarget;\n if (transformInput && (!transformMode || transformMode === \"input\")) {\n setCursorPosition(inputEl.selectionStart);\n const transformedInput = transformInput(inputEl.value);\n const eventWithTransformedValue = {\n ...event,\n target: { ...event.target, value: transformedInput }\n };\n onInput(eventWithTransformedValue);\n } else {\n onInput(event);\n }\n },\n [transformInput, transformMode, onInput]\n );\n const blurHandler = useCallback(\n (event) => {\n const inputEl = event.currentTarget;\n if (transformInput && transformMode === \"blur\") {\n setCursorPosition(inputEl.selectionStart);\n const transformedInput = transformInput(inputEl.value);\n const eventWithTransformedValue = {\n ...event,\n target: { ...event.target, value: transformedInput }\n };\n onBlur?.(eventWithTransformedValue);\n } else {\n onBlur?.(event);\n }\n },\n [transformInput, transformMode, onBlur]\n );\n useLayoutEffect(() => {\n if (cursorPosition && localRef.current?.selectionStart !== cursorPosition) {\n localRef?.current?.setSelectionRange(cursorPosition, cursorPosition, \"none\");\n }\n }, [cursorPosition, localRef]);\n return /* @__PURE__ */ jsx(\n InputBase,\n {\n ...props,\n onInput: inputHandler,\n onBlur: blurHandler,\n ref: localRef,\n type: \"text\"\n }\n );\n }\n);\nexport {\n InputText as I,\n InputBase as a,\n useForwardedRef as u\n};\n"],"names":["formDebugInfo","signal","SettingNames","InputBase","forwardRef","props","ref","userEvents","useAnalyticsContext","enableTracking","passedProps","isInvalid","isValid","type","disabled","name","handleInput","e","debouncedInputEvent","handleBlur","handleFocus","inputClassNames","cx","jsx","useForwardedRef","forwardedRef","backupRef","useRef","InputText","onInput","onBlur","transformInput","transformMode","cursorPosition","setCursorPosition","useState","localRef","inputHandler","useCallback","event","inputEl","transformedInput","eventWithTransformedValue","blurHandler","useLayoutEffect"],"mappings":"0FAEE,GAAI,CACF,IAAI,EAAmB,OAAO,OAAtB,IAA+B,OAAwB,OAAO,OAAtB,IAA+B,OAAwB,OAAO,WAAtB,IAAmC,WAA4B,OAAO,KAAtB,IAA6B,KAAO,GAAI,EAAI,IAAI,EAAE,MAAK,EAAG,MAClM,IAAM,EAAE,gBAAkB,EAAE,iBAAmB,CAAA,EAAI,EAAE,gBAAgB,CAAC,EAAI,uCAAwC,EAAE,yBAA2B,mDACjJ,MAAY,CACZ,CAIG,MAACA,EAAgBC,EAAAA,IAAO,CAAA,CAAE,ECR7B,GAAI,CACF,IAAI,EAAmB,OAAO,OAAtB,IAA+B,OAAwB,OAAO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