@reblu/site-blocks 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +55 -0
- package/README.md +85 -0
- package/dist/index.cjs +343 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +145 -9
- package/dist/index.d.ts +145 -9
- package/dist/index.js +335 -29
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -46,7 +46,11 @@ var DEFAULT_SHOP_ERROR_MESSAGES = {
|
|
|
46
46
|
INVALID_INPUT: "Revisa los datos introducidos.",
|
|
47
47
|
STORE_DISABLED: "La tienda no est\xE1 disponible en este momento.",
|
|
48
48
|
PAYMENT_PROVIDER_ERROR: "No hemos podido conectar con la pasarela de pago. Int\xE9ntalo de nuevo.",
|
|
49
|
-
INTERNAL_ERROR: "Ha ocurrido un error inesperado. Int\xE9ntalo de nuevo en unos minutos."
|
|
49
|
+
INTERNAL_ERROR: "Ha ocurrido un error inesperado. Int\xE9ntalo de nuevo en unos minutos.",
|
|
50
|
+
// REB-73 — checkout refusals before any payment.
|
|
51
|
+
BILLING_DATA_REQUIRED: "Para emitir tu factura necesitamos tu NIF/NIE o un documento de identificaci\xF3n, tu nombre y tu direcci\xF3n de facturaci\xF3n.",
|
|
52
|
+
INVOICING_NOT_READY: "No se puede completar la compra en este momento. Int\xE9ntalo m\xE1s tarde.",
|
|
53
|
+
FULL_INVOICE_UNAVAILABLE: "Esta tienda no emite facturas completas: contin\xFAa sin solicitarla."
|
|
50
54
|
};
|
|
51
55
|
var DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE = "No se ha podido completar la operaci\xF3n. Int\xE9ntalo de nuevo.";
|
|
52
56
|
function getShopErrorMessage(code, overrides, fallback = DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE) {
|
|
@@ -14727,9 +14731,34 @@ function CheckoutForm({
|
|
|
14727
14731
|
}
|
|
14728
14732
|
|
|
14729
14733
|
// src/components/order-confirmation.tsx
|
|
14734
|
+
import { cn as cn18 } from "@reblu/site-ui/utils";
|
|
14735
|
+
|
|
14736
|
+
// src/components/order-invoice-link.tsx
|
|
14730
14737
|
import { cn as cn17 } from "@reblu/site-ui/utils";
|
|
14731
14738
|
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
14732
14739
|
var DEFAULT_LABELS7 = {
|
|
14740
|
+
linkLabel: "Descargar la factura {number}",
|
|
14741
|
+
signInHint: "Te pediremos que inicies sesi\xF3n para abrirla."
|
|
14742
|
+
};
|
|
14743
|
+
function OrderInvoiceLink({ invoice, labels, className }) {
|
|
14744
|
+
if (!invoice) return null;
|
|
14745
|
+
const t = { ...DEFAULT_LABELS7, ...labels };
|
|
14746
|
+
return /* @__PURE__ */ jsxs16("div", { className: cn17("space-y-1 text-sm", className), "data-slot": "order-invoice-link", children: [
|
|
14747
|
+
/* @__PURE__ */ jsx18(
|
|
14748
|
+
"a",
|
|
14749
|
+
{
|
|
14750
|
+
href: invoice.url,
|
|
14751
|
+
className: "font-semibold text-primary underline-offset-2 hover:underline",
|
|
14752
|
+
children: t.linkLabel.replace("{number}", invoice.number)
|
|
14753
|
+
}
|
|
14754
|
+
),
|
|
14755
|
+
/* @__PURE__ */ jsx18("p", { className: "text-muted-foreground", children: t.signInHint })
|
|
14756
|
+
] });
|
|
14757
|
+
}
|
|
14758
|
+
|
|
14759
|
+
// src/components/order-confirmation.tsx
|
|
14760
|
+
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
14761
|
+
var DEFAULT_LABELS8 = {
|
|
14733
14762
|
pollingTitle: "Confirmando tu pedido\u2026",
|
|
14734
14763
|
pollingDescription: "Estamos procesando el pago, un momento\u2026",
|
|
14735
14764
|
foundTitle: "\xA1Pedido confirmado!",
|
|
@@ -14755,7 +14784,9 @@ var DEFAULT_LABELS7 = {
|
|
|
14755
14784
|
notFoundDescription: "Comprueba el enlace o contacta con nosotros si el problema persiste.",
|
|
14756
14785
|
errorTitle: "Ha ocurrido un error",
|
|
14757
14786
|
errorDescription: "No hemos podido comprobar el estado de tu pedido.",
|
|
14758
|
-
orderReferenceLabel: "Referencia del pedido"
|
|
14787
|
+
orderReferenceLabel: "Referencia del pedido",
|
|
14788
|
+
invoiceLinkLabel: "Descargar la factura {number}",
|
|
14789
|
+
invoiceSignInHint: "Te pediremos que inicies sesi\xF3n para abrirla."
|
|
14759
14790
|
};
|
|
14760
14791
|
function OrderConfirmation({
|
|
14761
14792
|
status,
|
|
@@ -14768,7 +14799,7 @@ function OrderConfirmation({
|
|
|
14768
14799
|
locale,
|
|
14769
14800
|
className
|
|
14770
14801
|
}) {
|
|
14771
|
-
const t = { ...
|
|
14802
|
+
const t = { ...DEFAULT_LABELS8, ...labels };
|
|
14772
14803
|
const isPolling = status === "polling" || status === "loading";
|
|
14773
14804
|
const isFound = status === "found" || status === "paid";
|
|
14774
14805
|
const { title, description } = (() => {
|
|
@@ -14790,48 +14821,55 @@ function OrderConfirmation({
|
|
|
14790
14821
|
const showOrderReference = Boolean(order) && !showFullOrderSummary && (status === "refunded" || status === "partially_refunded" || status === "pending_timeout");
|
|
14791
14822
|
const showSessionReference = !order && sessionId && (status === "timeout" || status === "not_found" || status === "pending_timeout");
|
|
14792
14823
|
const showRecheck = (status === "pending_timeout" || status === "error") && onRecheck;
|
|
14793
|
-
return /* @__PURE__ */
|
|
14794
|
-
/* @__PURE__ */
|
|
14795
|
-
/* @__PURE__ */
|
|
14796
|
-
showFullOrderSummary && order && /* @__PURE__ */
|
|
14797
|
-
/* @__PURE__ */
|
|
14798
|
-
/* @__PURE__ */
|
|
14799
|
-
/* @__PURE__ */
|
|
14824
|
+
return /* @__PURE__ */ jsxs17("div", { className: cn18("space-y-6 text-center", className), "data-slot": "order-confirmation", children: [
|
|
14825
|
+
/* @__PURE__ */ jsx19("h1", { className: "text-3xl font-bold", children: title }),
|
|
14826
|
+
/* @__PURE__ */ jsx19("p", { className: "text-lg text-muted-foreground", children: description }),
|
|
14827
|
+
showFullOrderSummary && order && /* @__PURE__ */ jsxs17("div", { className: "space-y-6", children: [
|
|
14828
|
+
/* @__PURE__ */ jsxs17("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
14829
|
+
/* @__PURE__ */ jsx19("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderNumberLabel }),
|
|
14830
|
+
/* @__PURE__ */ jsx19("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
14800
14831
|
] }),
|
|
14801
|
-
/* @__PURE__ */
|
|
14802
|
-
order.items.map((item, idx) => /* @__PURE__ */
|
|
14832
|
+
/* @__PURE__ */ jsxs17("div", { className: "mx-auto max-w-sm space-y-3 rounded-xl border border-border bg-card p-5 text-left", children: [
|
|
14833
|
+
order.items.map((item, idx) => /* @__PURE__ */ jsxs17(
|
|
14803
14834
|
"div",
|
|
14804
14835
|
{
|
|
14805
14836
|
className: "flex justify-between gap-4 text-sm",
|
|
14806
14837
|
children: [
|
|
14807
|
-
/* @__PURE__ */
|
|
14838
|
+
/* @__PURE__ */ jsxs17("span", { className: "max-w-[60%] truncate text-muted-foreground", children: [
|
|
14808
14839
|
item.product.name,
|
|
14809
14840
|
item.variant ? ` (${item.variant.name})` : "",
|
|
14810
14841
|
" x",
|
|
14811
14842
|
item.quantity
|
|
14812
14843
|
] }),
|
|
14813
|
-
/* @__PURE__ */
|
|
14844
|
+
/* @__PURE__ */ jsx19("span", { children: formatPrice(item.total, currencyCode, locale) })
|
|
14814
14845
|
]
|
|
14815
14846
|
},
|
|
14816
14847
|
idx
|
|
14817
14848
|
)),
|
|
14818
|
-
/* @__PURE__ */
|
|
14819
|
-
/* @__PURE__ */
|
|
14820
|
-
/* @__PURE__ */
|
|
14849
|
+
/* @__PURE__ */ jsx19("div", { className: "space-y-1 border-t border-border pt-3 text-sm", children: /* @__PURE__ */ jsxs17("div", { className: "flex justify-between pt-1 text-base font-bold", children: [
|
|
14850
|
+
/* @__PURE__ */ jsx19("span", { children: t.totalLabel }),
|
|
14851
|
+
/* @__PURE__ */ jsx19("span", { children: formatPrice(order.total, currencyCode, locale) })
|
|
14821
14852
|
] }) })
|
|
14822
14853
|
] }),
|
|
14823
|
-
/* @__PURE__ */
|
|
14854
|
+
/* @__PURE__ */ jsxs17("p", { className: "mx-auto max-w-sm text-sm text-muted-foreground", children: [
|
|
14824
14855
|
t.confirmationEmailPrefix,
|
|
14825
14856
|
" ",
|
|
14826
|
-
/* @__PURE__ */
|
|
14857
|
+
/* @__PURE__ */ jsx19("span", { className: "font-medium text-foreground", children: order.customerEmail }),
|
|
14827
14858
|
"."
|
|
14828
|
-
] })
|
|
14859
|
+
] }),
|
|
14860
|
+
/* @__PURE__ */ jsx19(
|
|
14861
|
+
OrderInvoiceLink,
|
|
14862
|
+
{
|
|
14863
|
+
invoice: order.invoice,
|
|
14864
|
+
labels: { linkLabel: t.invoiceLinkLabel, signInHint: t.invoiceSignInHint }
|
|
14865
|
+
}
|
|
14866
|
+
)
|
|
14829
14867
|
] }),
|
|
14830
|
-
showOrderReference && order && /* @__PURE__ */
|
|
14831
|
-
/* @__PURE__ */
|
|
14832
|
-
/* @__PURE__ */
|
|
14868
|
+
showOrderReference && order && /* @__PURE__ */ jsxs17("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
14869
|
+
/* @__PURE__ */ jsx19("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderReferenceLabel }),
|
|
14870
|
+
/* @__PURE__ */ jsx19("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
14833
14871
|
] }),
|
|
14834
|
-
status === "failed" && cartHref && /* @__PURE__ */
|
|
14872
|
+
status === "failed" && cartHref && /* @__PURE__ */ jsx19(
|
|
14835
14873
|
"a",
|
|
14836
14874
|
{
|
|
14837
14875
|
href: cartHref,
|
|
@@ -14839,7 +14877,7 @@ function OrderConfirmation({
|
|
|
14839
14877
|
children: t.backToCartLabel
|
|
14840
14878
|
}
|
|
14841
14879
|
),
|
|
14842
|
-
showRecheck && /* @__PURE__ */
|
|
14880
|
+
showRecheck && /* @__PURE__ */ jsx19(
|
|
14843
14881
|
"button",
|
|
14844
14882
|
{
|
|
14845
14883
|
type: "button",
|
|
@@ -14848,9 +14886,270 @@ function OrderConfirmation({
|
|
|
14848
14886
|
children: t.recheckLabel
|
|
14849
14887
|
}
|
|
14850
14888
|
),
|
|
14851
|
-
showSessionReference && /* @__PURE__ */
|
|
14852
|
-
/* @__PURE__ */
|
|
14853
|
-
/* @__PURE__ */
|
|
14889
|
+
showSessionReference && /* @__PURE__ */ jsxs17("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
14890
|
+
/* @__PURE__ */ jsx19("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.sessionReferenceLabel }),
|
|
14891
|
+
/* @__PURE__ */ jsx19("p", { className: "break-all font-mono text-sm font-semibold", children: sessionId })
|
|
14892
|
+
] })
|
|
14893
|
+
] });
|
|
14894
|
+
}
|
|
14895
|
+
|
|
14896
|
+
// src/components/full-invoice-fields.tsx
|
|
14897
|
+
import { cn as cn19 } from "@reblu/site-ui/utils";
|
|
14898
|
+
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
14899
|
+
var EMPTY_FULL_INVOICE_VALUE = {
|
|
14900
|
+
wantsFullInvoice: false,
|
|
14901
|
+
billingIdType: "NIF",
|
|
14902
|
+
billingIdCountry: "",
|
|
14903
|
+
billingNif: "",
|
|
14904
|
+
billingName: "",
|
|
14905
|
+
street: "",
|
|
14906
|
+
postalCode: "",
|
|
14907
|
+
city: "",
|
|
14908
|
+
country: "ES"
|
|
14909
|
+
};
|
|
14910
|
+
var DEFAULT_LABELS9 = {
|
|
14911
|
+
toggle: "\xBFQuieres factura completa?",
|
|
14912
|
+
underCapNotice: "Para una factura completa necesitas tu NIF/NIE o un documento de identificaci\xF3n. Si no, recibir\xE1s una factura simplificada.",
|
|
14913
|
+
overCapNotice: "El importe del pedido supera el m\xE1ximo de la factura simplificada: para completar la compra, indica tu NIF/NIE o un documento de identificaci\xF3n, tu nombre y tu direcci\xF3n de facturaci\xF3n.",
|
|
14914
|
+
idType: "Tipo de documento",
|
|
14915
|
+
idCountry: "Pa\xEDs que expidi\xF3 el documento",
|
|
14916
|
+
chooseCountry: "Elige un pa\xEDs",
|
|
14917
|
+
spanishNif: "NIF / NIE / CIF",
|
|
14918
|
+
documentNumber: "N\xFAmero de documento",
|
|
14919
|
+
name: "Nombre o raz\xF3n social",
|
|
14920
|
+
street: "Direcci\xF3n",
|
|
14921
|
+
postalCode: "C\xF3digo postal",
|
|
14922
|
+
city: "Ciudad",
|
|
14923
|
+
country: "Pa\xEDs",
|
|
14924
|
+
idTypeOptions: {
|
|
14925
|
+
NIF: "NIF / NIE / CIF (Espa\xF1a)",
|
|
14926
|
+
"02": "NIF-IVA intracomunitario (otro pa\xEDs de la UE)",
|
|
14927
|
+
"03": "Pasaporte",
|
|
14928
|
+
"04": "Documento oficial de identidad de tu pa\xEDs de residencia",
|
|
14929
|
+
"05": "Certificado de residencia",
|
|
14930
|
+
"06": "Otro documento acreditativo"
|
|
14931
|
+
}
|
|
14932
|
+
};
|
|
14933
|
+
var ID_TYPES = ["NIF", "02", "03", "04", "05", "06"];
|
|
14934
|
+
var DEFAULT_INVOICE_COUNTRIES = [
|
|
14935
|
+
{ code: "ES", name: "Espa\xF1a" },
|
|
14936
|
+
{ code: "DE", name: "Alemania" },
|
|
14937
|
+
{ code: "AD", name: "Andorra" },
|
|
14938
|
+
{ code: "AR", name: "Argentina" },
|
|
14939
|
+
{ code: "AT", name: "Austria" },
|
|
14940
|
+
{ code: "BE", name: "B\xE9lgica" },
|
|
14941
|
+
{ code: "BG", name: "Bulgaria" },
|
|
14942
|
+
{ code: "CY", name: "Chipre" },
|
|
14943
|
+
{ code: "CO", name: "Colombia" },
|
|
14944
|
+
{ code: "HR", name: "Croacia" },
|
|
14945
|
+
{ code: "DK", name: "Dinamarca" },
|
|
14946
|
+
{ code: "SK", name: "Eslovaquia" },
|
|
14947
|
+
{ code: "SI", name: "Eslovenia" },
|
|
14948
|
+
{ code: "US", name: "Estados Unidos" },
|
|
14949
|
+
{ code: "EE", name: "Estonia" },
|
|
14950
|
+
{ code: "FI", name: "Finlandia" },
|
|
14951
|
+
{ code: "FR", name: "Francia" },
|
|
14952
|
+
{ code: "GR", name: "Grecia" },
|
|
14953
|
+
{ code: "HU", name: "Hungr\xEDa" },
|
|
14954
|
+
{ code: "IE", name: "Irlanda" },
|
|
14955
|
+
{ code: "IT", name: "Italia" },
|
|
14956
|
+
{ code: "LV", name: "Letonia" },
|
|
14957
|
+
{ code: "LT", name: "Lituania" },
|
|
14958
|
+
{ code: "LU", name: "Luxemburgo" },
|
|
14959
|
+
{ code: "MT", name: "Malta" },
|
|
14960
|
+
{ code: "MA", name: "Marruecos" },
|
|
14961
|
+
{ code: "MX", name: "M\xE9xico" },
|
|
14962
|
+
{ code: "NL", name: "Pa\xEDses Bajos" },
|
|
14963
|
+
{ code: "PL", name: "Polonia" },
|
|
14964
|
+
{ code: "PT", name: "Portugal" },
|
|
14965
|
+
{ code: "GB", name: "Reino Unido" },
|
|
14966
|
+
{ code: "CZ", name: "Rep\xFAblica Checa" },
|
|
14967
|
+
{ code: "RO", name: "Ruman\xEDa" },
|
|
14968
|
+
{ code: "SE", name: "Suecia" },
|
|
14969
|
+
{ code: "CH", name: "Suiza" },
|
|
14970
|
+
{ code: "VE", name: "Venezuela" }
|
|
14971
|
+
];
|
|
14972
|
+
function shopIssuesInvoices(config) {
|
|
14973
|
+
return config.simplifiedInvoiceCapCents != null;
|
|
14974
|
+
}
|
|
14975
|
+
function isOverSimplifiedInvoiceCap(totalCents, capCents) {
|
|
14976
|
+
return capCents != null && totalCents > capCents;
|
|
14977
|
+
}
|
|
14978
|
+
function toCheckoutInvoiceFields(value, overCap, issuesInvoices = true) {
|
|
14979
|
+
if (!issuesInvoices) return {};
|
|
14980
|
+
if (!value.wantsFullInvoice && !overCap) return {};
|
|
14981
|
+
const name = value.billingName.trim();
|
|
14982
|
+
const [first = "", ...rest] = name.split(/\s+/);
|
|
14983
|
+
const billing = {
|
|
14984
|
+
billingName: name,
|
|
14985
|
+
billingNif: value.billingNif.trim(),
|
|
14986
|
+
billingIdType: value.billingIdType,
|
|
14987
|
+
...value.billingIdType === "NIF" ? {} : { billingIdCountry: value.billingIdCountry },
|
|
14988
|
+
billingAddress: {
|
|
14989
|
+
firstName: first,
|
|
14990
|
+
lastName: rest.join(" ") || first,
|
|
14991
|
+
street: value.street.trim(),
|
|
14992
|
+
city: value.city.trim(),
|
|
14993
|
+
postalCode: value.postalCode.trim(),
|
|
14994
|
+
country: value.country
|
|
14995
|
+
}
|
|
14996
|
+
};
|
|
14997
|
+
return { ...value.wantsFullInvoice ? { wantsFullInvoice: true } : {}, billing };
|
|
14998
|
+
}
|
|
14999
|
+
var FIELD_CLASS = "w-full rounded-lg border border-border bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20";
|
|
15000
|
+
function FullInvoiceFields({
|
|
15001
|
+
value,
|
|
15002
|
+
onChange,
|
|
15003
|
+
overCap,
|
|
15004
|
+
issuesInvoices = true,
|
|
15005
|
+
errors = {},
|
|
15006
|
+
countries = DEFAULT_INVOICE_COUNTRIES,
|
|
15007
|
+
labels,
|
|
15008
|
+
className
|
|
15009
|
+
}) {
|
|
15010
|
+
if (!issuesInvoices) return null;
|
|
15011
|
+
const t = { ...DEFAULT_LABELS9, ...labels };
|
|
15012
|
+
const showFields = value.wantsFullInvoice || overCap;
|
|
15013
|
+
const isSpanishNif = value.billingIdType === "NIF";
|
|
15014
|
+
const set = (key2, next2) => onChange({ ...value, [key2]: next2 });
|
|
15015
|
+
const error = (key2) => errors[key2] ? /* @__PURE__ */ jsx20("p", { id: `full-invoice-${key2}-error`, className: "text-sm text-destructive", children: errors[key2] }) : null;
|
|
15016
|
+
const invalid2 = (key2) => errors[key2] ? { "aria-invalid": true, "aria-describedby": `full-invoice-${key2}-error` } : {};
|
|
15017
|
+
return /* @__PURE__ */ jsxs18("section", { className: cn19("space-y-4", className), "data-slot": "full-invoice-fields", children: [
|
|
15018
|
+
overCap ? /* @__PURE__ */ jsx20("p", { role: "note", className: "rounded-lg border border-border p-4 text-sm", children: t.overCapNotice }) : /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
|
|
15019
|
+
/* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
15020
|
+
/* @__PURE__ */ jsx20(
|
|
15021
|
+
"input",
|
|
15022
|
+
{
|
|
15023
|
+
type: "checkbox",
|
|
15024
|
+
checked: value.wantsFullInvoice,
|
|
15025
|
+
onChange: (e) => set("wantsFullInvoice", e.target.checked)
|
|
15026
|
+
}
|
|
15027
|
+
),
|
|
15028
|
+
t.toggle
|
|
15029
|
+
] }),
|
|
15030
|
+
/* @__PURE__ */ jsx20("p", { className: "text-sm text-muted-foreground", children: t.underCapNotice })
|
|
15031
|
+
] }),
|
|
15032
|
+
showFields && /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
15033
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
|
|
15034
|
+
/* @__PURE__ */ jsx20("label", { htmlFor: "full-invoice-id-type", className: "text-sm font-medium", children: t.idType }),
|
|
15035
|
+
/* @__PURE__ */ jsx20(
|
|
15036
|
+
"select",
|
|
15037
|
+
{
|
|
15038
|
+
id: "full-invoice-id-type",
|
|
15039
|
+
className: FIELD_CLASS,
|
|
15040
|
+
required: true,
|
|
15041
|
+
value: value.billingIdType,
|
|
15042
|
+
onChange: (e) => set("billingIdType", e.target.value),
|
|
15043
|
+
...invalid2("billingIdType"),
|
|
15044
|
+
children: ID_TYPES.map((type) => /* @__PURE__ */ jsx20("option", { value: type, children: t.idTypeOptions[type] }, type))
|
|
15045
|
+
}
|
|
15046
|
+
),
|
|
15047
|
+
error("billingIdType")
|
|
15048
|
+
] }),
|
|
15049
|
+
!isSpanishNif && /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
|
|
15050
|
+
/* @__PURE__ */ jsx20("label", { htmlFor: "full-invoice-id-country", className: "text-sm font-medium", children: t.idCountry }),
|
|
15051
|
+
/* @__PURE__ */ jsxs18(
|
|
15052
|
+
"select",
|
|
15053
|
+
{
|
|
15054
|
+
id: "full-invoice-id-country",
|
|
15055
|
+
className: FIELD_CLASS,
|
|
15056
|
+
required: true,
|
|
15057
|
+
value: value.billingIdCountry,
|
|
15058
|
+
onChange: (e) => set("billingIdCountry", e.target.value),
|
|
15059
|
+
...invalid2("billingIdCountry"),
|
|
15060
|
+
children: [
|
|
15061
|
+
/* @__PURE__ */ jsx20("option", { value: "", disabled: true, children: t.chooseCountry }),
|
|
15062
|
+
countries.map((c) => /* @__PURE__ */ jsx20("option", { value: c.code, children: c.name }, c.code))
|
|
15063
|
+
]
|
|
15064
|
+
}
|
|
15065
|
+
),
|
|
15066
|
+
error("billingIdCountry")
|
|
15067
|
+
] }),
|
|
15068
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
|
|
15069
|
+
/* @__PURE__ */ jsx20("label", { htmlFor: "full-invoice-nif", className: "text-sm font-medium", children: isSpanishNif ? t.spanishNif : t.documentNumber }),
|
|
15070
|
+
/* @__PURE__ */ jsx20(
|
|
15071
|
+
"input",
|
|
15072
|
+
{
|
|
15073
|
+
id: "full-invoice-nif",
|
|
15074
|
+
className: FIELD_CLASS,
|
|
15075
|
+
required: true,
|
|
15076
|
+
value: value.billingNif,
|
|
15077
|
+
onChange: (e) => set("billingNif", e.target.value),
|
|
15078
|
+
...invalid2("billingNif")
|
|
15079
|
+
}
|
|
15080
|
+
),
|
|
15081
|
+
error("billingNif")
|
|
15082
|
+
] }),
|
|
15083
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
|
|
15084
|
+
/* @__PURE__ */ jsx20("label", { htmlFor: "full-invoice-name", className: "text-sm font-medium", children: t.name }),
|
|
15085
|
+
/* @__PURE__ */ jsx20(
|
|
15086
|
+
"input",
|
|
15087
|
+
{
|
|
15088
|
+
id: "full-invoice-name",
|
|
15089
|
+
className: FIELD_CLASS,
|
|
15090
|
+
required: true,
|
|
15091
|
+
value: value.billingName,
|
|
15092
|
+
onChange: (e) => set("billingName", e.target.value),
|
|
15093
|
+
...invalid2("billingName")
|
|
15094
|
+
}
|
|
15095
|
+
),
|
|
15096
|
+
error("billingName")
|
|
15097
|
+
] }),
|
|
15098
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-1 sm:col-span-2", children: [
|
|
15099
|
+
/* @__PURE__ */ jsx20("label", { htmlFor: "full-invoice-street", className: "text-sm font-medium", children: t.street }),
|
|
15100
|
+
/* @__PURE__ */ jsx20(
|
|
15101
|
+
"input",
|
|
15102
|
+
{
|
|
15103
|
+
id: "full-invoice-street",
|
|
15104
|
+
className: FIELD_CLASS,
|
|
15105
|
+
required: true,
|
|
15106
|
+
value: value.street,
|
|
15107
|
+
onChange: (e) => set("street", e.target.value),
|
|
15108
|
+
...invalid2("address")
|
|
15109
|
+
}
|
|
15110
|
+
)
|
|
15111
|
+
] }),
|
|
15112
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
|
|
15113
|
+
/* @__PURE__ */ jsx20("label", { htmlFor: "full-invoice-postal-code", className: "text-sm font-medium", children: t.postalCode }),
|
|
15114
|
+
/* @__PURE__ */ jsx20(
|
|
15115
|
+
"input",
|
|
15116
|
+
{
|
|
15117
|
+
id: "full-invoice-postal-code",
|
|
15118
|
+
className: FIELD_CLASS,
|
|
15119
|
+
required: true,
|
|
15120
|
+
value: value.postalCode,
|
|
15121
|
+
onChange: (e) => set("postalCode", e.target.value)
|
|
15122
|
+
}
|
|
15123
|
+
)
|
|
15124
|
+
] }),
|
|
15125
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
|
|
15126
|
+
/* @__PURE__ */ jsx20("label", { htmlFor: "full-invoice-city", className: "text-sm font-medium", children: t.city }),
|
|
15127
|
+
/* @__PURE__ */ jsx20(
|
|
15128
|
+
"input",
|
|
15129
|
+
{
|
|
15130
|
+
id: "full-invoice-city",
|
|
15131
|
+
className: FIELD_CLASS,
|
|
15132
|
+
required: true,
|
|
15133
|
+
value: value.city,
|
|
15134
|
+
onChange: (e) => set("city", e.target.value)
|
|
15135
|
+
}
|
|
15136
|
+
)
|
|
15137
|
+
] }),
|
|
15138
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
|
|
15139
|
+
/* @__PURE__ */ jsx20("label", { htmlFor: "full-invoice-country", className: "text-sm font-medium", children: t.country }),
|
|
15140
|
+
/* @__PURE__ */ jsx20(
|
|
15141
|
+
"select",
|
|
15142
|
+
{
|
|
15143
|
+
id: "full-invoice-country",
|
|
15144
|
+
className: FIELD_CLASS,
|
|
15145
|
+
required: true,
|
|
15146
|
+
value: value.country,
|
|
15147
|
+
onChange: (e) => set("country", e.target.value),
|
|
15148
|
+
children: countries.map((c) => /* @__PURE__ */ jsx20("option", { value: c.code, children: c.name }, c.code))
|
|
15149
|
+
}
|
|
15150
|
+
)
|
|
15151
|
+
] }),
|
|
15152
|
+
/* @__PURE__ */ jsx20("div", { className: "sm:col-span-2", children: error("address") })
|
|
14854
15153
|
] })
|
|
14855
15154
|
] });
|
|
14856
15155
|
}
|
|
@@ -14861,13 +15160,17 @@ export {
|
|
|
14861
15160
|
CartSummary,
|
|
14862
15161
|
CheckoutForm,
|
|
14863
15162
|
CheckoutLoginPrompt,
|
|
15163
|
+
DEFAULT_INVOICE_COUNTRIES,
|
|
14864
15164
|
DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE,
|
|
14865
15165
|
DEFAULT_SHOP_ERROR_MESSAGES,
|
|
14866
15166
|
DEFAULT_SHOP_PRICE_BANDS,
|
|
14867
15167
|
DEFAULT_TRUST_ICONS,
|
|
15168
|
+
EMPTY_FULL_INVOICE_VALUE,
|
|
14868
15169
|
FaqAccordion,
|
|
15170
|
+
FullInvoiceFields,
|
|
14869
15171
|
MarkdownRenderer,
|
|
14870
15172
|
OrderConfirmation,
|
|
15173
|
+
OrderInvoiceLink,
|
|
14871
15174
|
PageBlocks,
|
|
14872
15175
|
PageCardGrid,
|
|
14873
15176
|
ParentPage,
|
|
@@ -14884,10 +15187,13 @@ export {
|
|
|
14884
15187
|
formatPrice,
|
|
14885
15188
|
getShopErrorMessage,
|
|
14886
15189
|
isAllowedYouTubeHost,
|
|
15190
|
+
isOverSimplifiedInvoiceCap,
|
|
14887
15191
|
markdownToSafeHtml,
|
|
14888
15192
|
readingTime,
|
|
14889
15193
|
sanitizeHtml,
|
|
14890
|
-
|
|
15194
|
+
shopIssuesInvoices,
|
|
15195
|
+
shouldRenderShopFilters,
|
|
15196
|
+
toCheckoutInvoiceFields
|
|
14891
15197
|
};
|
|
14892
15198
|
/*! Bundled license information:
|
|
14893
15199
|
|