import { jsx as m } from "../../../../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { useWizardFormContext as p } from "../../../../../../../../hooks/form/wizard/WizardFormContext.js";
import { useCallback as f } from "../../../../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
import { FormTextInput as u } from "../../../../../../../internal/FormWrappers/FormTextInput.js";
import { PAYMENT_LINK_CREATION_FIELD_LENGTHS as C } from "../../../../../constants.js";
import c from "../../../../../../../../core/Context/preact/useCoreContext.js";
const _ = ({
  isSameAddress: e,
  isAddressFieldRequired: i,
  showBillingFirst: o = !1,
  isSameAddressCopyEnabled: l = !1
}) => {
  const { i18n: r } = c(), { setValue: t, fieldsConfig: s } = p(), a = f(
    (n) => {
      o && l && e && t("deliveryAddress.postalCode", n.currentTarget.value);
    },
    [e, t, o, l]
  ), d = s["billingAddress.postalCode"]?.required || i("billingAddress.postalCode");
  return /* @__PURE__ */ m(
    u,
    {
      maxLength: C.billingAddress.postalCode.max,
      fieldName: "billingAddress.postalCode",
      label: r.get("payByLink.creation.fields.billingAddress.postalCode.label"),
      onInput: a,
      className: "adyen-pe-payment-link-creation-form__billing-address-field--small",
      hideOptionalLabel: !0,
      isRequired: d
    }
  );
};
export {
  _ as BillingPostalCodeField
};
