@simpleapps-com/augur-utils 2.0.7 → 2.0.9

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/dist/index.d.cts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { cn } from './web.cjs';
2
+ import * as v from 'valibot';
2
3
  import 'clsx';
3
4
 
4
5
  type TCartLine = {
@@ -1114,4 +1115,270 @@ declare function buildImageLoader(config: ImageConfig, transforms?: ImageTransfo
1114
1115
  */
1115
1116
  declare function sanitizeHtmlImages(config: ImageConfig, html: string, transforms?: ImageTransforms): string;
1116
1117
 
1117
- export { BLUR_DATA_URL, type BreadcrumbJsonLdItem, CACHE_CONFIG, type CacheTier, type CheckoutInput, type CustomerDocument, type DerivePriceInput, type DerivedPrice, type ImageConfig, type ImageTransforms, type ImageUrlOptions, type MenuItem, type OeHdr, type OeLine, type OrderHeader, type OrderLine, type OrderNote, type OrderPayment, type PaymentStatus, type PaymentStatusInvoice, type ResolveStockInput, type ResolvedStock, type SafeActionResult, type SchemaAvailability, type ShipToAddress, type TAccountQuery, type TApiResponse, type TAttribute, type TAttributeValue, type TBillingUpdate, type TCardInfo, type TCartHdrUid, type TCartLine, type TCartLookUp, type TCategory, type TCategoryChild, type TCategoryItemsResult, type TCheckoutResult, type TInvMast, type TInvMastDoc, type TInventorySupplier, type TItemAccessory, type TItemAttribute, type TItemAttributes, type TItemCategory, type TItemDetails, type TItemRelatedProduct, type TItemUom, type TItemsFilters, type TJoomlaContent, type TJoomlaContentFilters, type TLibraryPriceBreak, type TLibraryPriceData, type TLtlRatesResponse, type TLtlShipmentData, type TMenu, type TMenuFilters, type TMetaTags, type TOrderCartLine, type TPasswordVerification, type TPaymentValidation, type TPriceData, type TProductCategory, type TProductItem, type TProductStockData, type TProfileValues, type TRelatedProduct, type TSearchSuggestion, type TSearchSuggestionsResponse, type TShippingMethod, type TSmartyStreets, type TStock, type TStockData, type TSurcharge, type TTax, type TTaxItem, type TTransactionSetup, type TUserProfile, type TWebDesc, type UserAddress, buildCheckoutPayload, buildImageLoader, createImageConfig, derivePrice, formatPrice, generateBreadcrumbJsonLd, getDefaultImageUrl, getImageSrcSet, getImageUrl, getPaymentStatus, getSchemaAvailability, isAddressDifferent, normalizePath, resolveStock, sanitizeHtmlImages, serializeTransforms, transformShipToAddress, unwrap, unwrapOr };
1118
+ /**
1119
+ * Common regex patterns used for form validation across augur-hosted sites.
1120
+ */
1121
+ declare const VALIDATION_PATTERNS: {
1122
+ /** Phone number format: (123) 456-7890 or 123-456-7890 or 123.456.7890 */
1123
+ readonly phoneNumber: RegExp;
1124
+ /** Name format: Must start with non-hyphen/space, allow word chars, spaces, hyphens */
1125
+ readonly nameFormat: RegExp;
1126
+ /** Name must not contain numbers */
1127
+ readonly nameNoNumbers: RegExp;
1128
+ /** Address format: Allow word chars, spaces, hyphens, slashes, periods, hash, commas */
1129
+ readonly addressFormat: RegExp;
1130
+ /** No PO Box pattern - prevents PO Box addresses */
1131
+ readonly noPOBox: RegExp;
1132
+ /** Zip code: Exactly 5 digits */
1133
+ readonly zipCode: RegExp;
1134
+ /** City: Letters, spaces, periods, hyphens, apostrophes only */
1135
+ readonly cityFormat: RegExp;
1136
+ /** Address must contain at least one number */
1137
+ readonly hasNumber: RegExp;
1138
+ };
1139
+
1140
+ /**
1141
+ * Valibot schema for shipping address validation.
1142
+ * Enforces no PO Box, requires street number, formats phone number.
1143
+ */
1144
+ declare const ShippingAddressSchema: v.ObjectSchema<{
1145
+ readonly companyName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1146
+ readonly firstName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "First name is required">, v.RegexAction<string, "Invalid first name">, v.RegexAction<string, "Invalid first name">]>;
1147
+ readonly lastName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Last name is required">, v.RegexAction<string, "Invalid last name">, v.RegexAction<string, "Invalid last name">]>;
1148
+ readonly address1: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Address 1 is required">, v.RegexAction<string, "Invalid address">, v.RegexAction<string, "PO Box addresses are not allowed for shipping">, v.RegexAction<string, "Address must contain at least one number">]>;
1149
+ readonly address2: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid address format">, v.CheckAction<string, "PO Box addresses are not allowed for shipping">]>, undefined>;
1150
+ readonly postalCode: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Zip code is required">, v.RegexAction<string, "Zip code must be exactly 5 digits">]>;
1151
+ readonly city: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 2, "City is required">, v.RegexAction<string, "City must contain only letters, spaces, periods, hyphens, or apostrophes">]>;
1152
+ readonly state: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "State is required">, v.PicklistSchema<[string, ...string[]], "Please select a valid US state">]>;
1153
+ readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Country is required">]>;
1154
+ readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Email is required">, v.EmailAction<string, "Invalid email">]>;
1155
+ readonly phoneNumber: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Phone number is required">, v.RegexAction<string, "Invalid phone number">, v.TransformAction<string, string>]>;
1156
+ readonly notes: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1157
+ readonly plus4Code: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1158
+ }, undefined>;
1159
+ /**
1160
+ * Valibot schema for billing address validation.
1161
+ * Less strict than shipping: allows PO Box, no email/phone required.
1162
+ */
1163
+ declare const BillingAddressSchema: v.ObjectSchema<{
1164
+ readonly poNumber: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1165
+ readonly firstName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "First name is required">, v.RegexAction<string, "Invalid first name">, v.RegexAction<string, "Invalid first name">]>;
1166
+ readonly lastName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Last name is required">, v.RegexAction<string, "Invalid last name">, v.RegexAction<string, "Invalid last name">]>;
1167
+ readonly address1: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Address 1 is required">, v.RegexAction<string, "Invalid address">]>;
1168
+ readonly address2: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1169
+ readonly postalCode: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Zip code is required">]>;
1170
+ readonly city: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "City is required">]>;
1171
+ readonly state: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "State is required">]>;
1172
+ readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Country is required">]>;
1173
+ readonly plus4Code: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1174
+ }, undefined>;
1175
+ /**
1176
+ * Valibot schema for billing address with required PO number (invoice payments).
1177
+ */
1178
+ declare const BillingAddressInvoiceSchema: v.ObjectSchema<{
1179
+ readonly poNumber: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 2, "PO number is required">]>;
1180
+ }, undefined>;
1181
+ type ShippingAddress = v.InferOutput<typeof ShippingAddressSchema>;
1182
+ type BillingAddress = v.InferOutput<typeof BillingAddressSchema>;
1183
+
1184
+ /**
1185
+ * US states and territories for address validation.
1186
+ */
1187
+ declare const US_STATES: readonly [{
1188
+ readonly code: "AL";
1189
+ readonly name: "Alabama";
1190
+ }, {
1191
+ readonly code: "AZ";
1192
+ readonly name: "Arizona";
1193
+ }, {
1194
+ readonly code: "AR";
1195
+ readonly name: "Arkansas";
1196
+ }, {
1197
+ readonly code: "CA";
1198
+ readonly name: "California";
1199
+ }, {
1200
+ readonly code: "CO";
1201
+ readonly name: "Colorado";
1202
+ }, {
1203
+ readonly code: "CT";
1204
+ readonly name: "Connecticut";
1205
+ }, {
1206
+ readonly code: "DC";
1207
+ readonly name: "District of Columbia";
1208
+ }, {
1209
+ readonly code: "DE";
1210
+ readonly name: "Delaware";
1211
+ }, {
1212
+ readonly code: "FL";
1213
+ readonly name: "Florida";
1214
+ }, {
1215
+ readonly code: "GA";
1216
+ readonly name: "Georgia";
1217
+ }, {
1218
+ readonly code: "ID";
1219
+ readonly name: "Idaho";
1220
+ }, {
1221
+ readonly code: "IL";
1222
+ readonly name: "Illinois";
1223
+ }, {
1224
+ readonly code: "IN";
1225
+ readonly name: "Indiana";
1226
+ }, {
1227
+ readonly code: "IA";
1228
+ readonly name: "Iowa";
1229
+ }, {
1230
+ readonly code: "KS";
1231
+ readonly name: "Kansas";
1232
+ }, {
1233
+ readonly code: "KY";
1234
+ readonly name: "Kentucky";
1235
+ }, {
1236
+ readonly code: "LA";
1237
+ readonly name: "Louisiana";
1238
+ }, {
1239
+ readonly code: "ME";
1240
+ readonly name: "Maine";
1241
+ }, {
1242
+ readonly code: "MD";
1243
+ readonly name: "Maryland";
1244
+ }, {
1245
+ readonly code: "MA";
1246
+ readonly name: "Massachusetts";
1247
+ }, {
1248
+ readonly code: "MI";
1249
+ readonly name: "Michigan";
1250
+ }, {
1251
+ readonly code: "MN";
1252
+ readonly name: "Minnesota";
1253
+ }, {
1254
+ readonly code: "MS";
1255
+ readonly name: "Mississippi";
1256
+ }, {
1257
+ readonly code: "MO";
1258
+ readonly name: "Missouri";
1259
+ }, {
1260
+ readonly code: "MT";
1261
+ readonly name: "Montana";
1262
+ }, {
1263
+ readonly code: "NE";
1264
+ readonly name: "Nebraska";
1265
+ }, {
1266
+ readonly code: "NV";
1267
+ readonly name: "Nevada";
1268
+ }, {
1269
+ readonly code: "NH";
1270
+ readonly name: "New Hampshire";
1271
+ }, {
1272
+ readonly code: "NJ";
1273
+ readonly name: "New Jersey";
1274
+ }, {
1275
+ readonly code: "NM";
1276
+ readonly name: "New Mexico";
1277
+ }, {
1278
+ readonly code: "NY";
1279
+ readonly name: "New York";
1280
+ }, {
1281
+ readonly code: "NC";
1282
+ readonly name: "North Carolina";
1283
+ }, {
1284
+ readonly code: "ND";
1285
+ readonly name: "North Dakota";
1286
+ }, {
1287
+ readonly code: "OH";
1288
+ readonly name: "Ohio";
1289
+ }, {
1290
+ readonly code: "OK";
1291
+ readonly name: "Oklahoma";
1292
+ }, {
1293
+ readonly code: "OR";
1294
+ readonly name: "Oregon";
1295
+ }, {
1296
+ readonly code: "PA";
1297
+ readonly name: "Pennsylvania";
1298
+ }, {
1299
+ readonly code: "RI";
1300
+ readonly name: "Rhode Island";
1301
+ }, {
1302
+ readonly code: "SC";
1303
+ readonly name: "South Carolina";
1304
+ }, {
1305
+ readonly code: "SD";
1306
+ readonly name: "South Dakota";
1307
+ }, {
1308
+ readonly code: "TN";
1309
+ readonly name: "Tennessee";
1310
+ }, {
1311
+ readonly code: "TX";
1312
+ readonly name: "Texas";
1313
+ }, {
1314
+ readonly code: "UT";
1315
+ readonly name: "Utah";
1316
+ }, {
1317
+ readonly code: "VT";
1318
+ readonly name: "Vermont";
1319
+ }, {
1320
+ readonly code: "VA";
1321
+ readonly name: "Virginia";
1322
+ }, {
1323
+ readonly code: "WA";
1324
+ readonly name: "Washington";
1325
+ }, {
1326
+ readonly code: "WV";
1327
+ readonly name: "West Virginia";
1328
+ }, {
1329
+ readonly code: "WI";
1330
+ readonly name: "Wisconsin";
1331
+ }, {
1332
+ readonly code: "WY";
1333
+ readonly name: "Wyoming";
1334
+ }];
1335
+ type USStateCode = (typeof US_STATES)[number]["code"];
1336
+
1337
+ /**
1338
+ * Date utility functions for shipping calculations.
1339
+ */
1340
+ /**
1341
+ * Get the Nth business day from today (skipping weekends).
1342
+ * @param businessDaysFromNow - Number of business days to add
1343
+ * @returns Formatted date string
1344
+ */
1345
+ declare function getBusinessDay(businessDaysFromNow: number): string;
1346
+ /**
1347
+ * Get shipping lead date estimate based on days string.
1348
+ * @param days - Shipping days string (e.g., "1-2", "2-3", "3")
1349
+ * @returns Formatted date range or single date
1350
+ */
1351
+ declare function getShippingLeadDate(days: string): string;
1352
+
1353
+ /**
1354
+ * Analytics utility functions for tracking ecommerce events via Google Analytics.
1355
+ */
1356
+ declare global {
1357
+ interface Window {
1358
+ dataLayer?: Record<string, unknown>[];
1359
+ gtag?: (...args: unknown[]) => void;
1360
+ }
1361
+ }
1362
+ interface AddToCartEventParams {
1363
+ itemId: string;
1364
+ itemName: string;
1365
+ price: number;
1366
+ quantity: number;
1367
+ estimatedCost: number;
1368
+ }
1369
+ /**
1370
+ * Track add_to_cart event to Google Analytics dataLayer.
1371
+ */
1372
+ declare function trackAddToCart({ itemId, itemName, price, quantity, estimatedCost, }: AddToCartEventParams): void;
1373
+ interface ViewItemEventParams {
1374
+ itemId: string;
1375
+ itemName: string;
1376
+ price: number;
1377
+ category?: string;
1378
+ }
1379
+ /**
1380
+ * Track view_item event to Google Analytics dataLayer.
1381
+ */
1382
+ declare function trackViewItem({ itemId, itemName, price, category, }: ViewItemEventParams): void;
1383
+
1384
+ export { type AddToCartEventParams, BLUR_DATA_URL, type BillingAddress, BillingAddressInvoiceSchema, BillingAddressSchema, type BreadcrumbJsonLdItem, CACHE_CONFIG, type CacheTier, type CheckoutInput, type CustomerDocument, type DerivePriceInput, type DerivedPrice, type ImageConfig, type ImageTransforms, type ImageUrlOptions, type MenuItem, type OeHdr, type OeLine, type OrderHeader, type OrderLine, type OrderNote, type OrderPayment, type PaymentStatus, type PaymentStatusInvoice, type ResolveStockInput, type ResolvedStock, type SafeActionResult, type SchemaAvailability, type ShipToAddress, type ShippingAddress, ShippingAddressSchema, type TAccountQuery, type TApiResponse, type TAttribute, type TAttributeValue, type TBillingUpdate, type TCardInfo, type TCartHdrUid, type TCartLine, type TCartLookUp, type TCategory, type TCategoryChild, type TCategoryItemsResult, type TCheckoutResult, type TInvMast, type TInvMastDoc, type TInventorySupplier, type TItemAccessory, type TItemAttribute, type TItemAttributes, type TItemCategory, type TItemDetails, type TItemRelatedProduct, type TItemUom, type TItemsFilters, type TJoomlaContent, type TJoomlaContentFilters, type TLibraryPriceBreak, type TLibraryPriceData, type TLtlRatesResponse, type TLtlShipmentData, type TMenu, type TMenuFilters, type TMetaTags, type TOrderCartLine, type TPasswordVerification, type TPaymentValidation, type TPriceData, type TProductCategory, type TProductItem, type TProductStockData, type TProfileValues, type TRelatedProduct, type TSearchSuggestion, type TSearchSuggestionsResponse, type TShippingMethod, type TSmartyStreets, type TStock, type TStockData, type TSurcharge, type TTax, type TTaxItem, type TTransactionSetup, type TUserProfile, type TWebDesc, type USStateCode, US_STATES, type UserAddress, VALIDATION_PATTERNS, type ViewItemEventParams, buildCheckoutPayload, buildImageLoader, createImageConfig, derivePrice, formatPrice, generateBreadcrumbJsonLd, getBusinessDay, getDefaultImageUrl, getImageSrcSet, getImageUrl, getPaymentStatus, getSchemaAvailability, getShippingLeadDate, isAddressDifferent, normalizePath, resolveStock, sanitizeHtmlImages, serializeTransforms, trackAddToCart, trackViewItem, transformShipToAddress, unwrap, unwrapOr };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { cn } from './web.js';
2
+ import * as v from 'valibot';
2
3
  import 'clsx';
3
4
 
4
5
  type TCartLine = {
@@ -1114,4 +1115,270 @@ declare function buildImageLoader(config: ImageConfig, transforms?: ImageTransfo
1114
1115
  */
1115
1116
  declare function sanitizeHtmlImages(config: ImageConfig, html: string, transforms?: ImageTransforms): string;
1116
1117
 
1117
- export { BLUR_DATA_URL, type BreadcrumbJsonLdItem, CACHE_CONFIG, type CacheTier, type CheckoutInput, type CustomerDocument, type DerivePriceInput, type DerivedPrice, type ImageConfig, type ImageTransforms, type ImageUrlOptions, type MenuItem, type OeHdr, type OeLine, type OrderHeader, type OrderLine, type OrderNote, type OrderPayment, type PaymentStatus, type PaymentStatusInvoice, type ResolveStockInput, type ResolvedStock, type SafeActionResult, type SchemaAvailability, type ShipToAddress, type TAccountQuery, type TApiResponse, type TAttribute, type TAttributeValue, type TBillingUpdate, type TCardInfo, type TCartHdrUid, type TCartLine, type TCartLookUp, type TCategory, type TCategoryChild, type TCategoryItemsResult, type TCheckoutResult, type TInvMast, type TInvMastDoc, type TInventorySupplier, type TItemAccessory, type TItemAttribute, type TItemAttributes, type TItemCategory, type TItemDetails, type TItemRelatedProduct, type TItemUom, type TItemsFilters, type TJoomlaContent, type TJoomlaContentFilters, type TLibraryPriceBreak, type TLibraryPriceData, type TLtlRatesResponse, type TLtlShipmentData, type TMenu, type TMenuFilters, type TMetaTags, type TOrderCartLine, type TPasswordVerification, type TPaymentValidation, type TPriceData, type TProductCategory, type TProductItem, type TProductStockData, type TProfileValues, type TRelatedProduct, type TSearchSuggestion, type TSearchSuggestionsResponse, type TShippingMethod, type TSmartyStreets, type TStock, type TStockData, type TSurcharge, type TTax, type TTaxItem, type TTransactionSetup, type TUserProfile, type TWebDesc, type UserAddress, buildCheckoutPayload, buildImageLoader, createImageConfig, derivePrice, formatPrice, generateBreadcrumbJsonLd, getDefaultImageUrl, getImageSrcSet, getImageUrl, getPaymentStatus, getSchemaAvailability, isAddressDifferent, normalizePath, resolveStock, sanitizeHtmlImages, serializeTransforms, transformShipToAddress, unwrap, unwrapOr };
1118
+ /**
1119
+ * Common regex patterns used for form validation across augur-hosted sites.
1120
+ */
1121
+ declare const VALIDATION_PATTERNS: {
1122
+ /** Phone number format: (123) 456-7890 or 123-456-7890 or 123.456.7890 */
1123
+ readonly phoneNumber: RegExp;
1124
+ /** Name format: Must start with non-hyphen/space, allow word chars, spaces, hyphens */
1125
+ readonly nameFormat: RegExp;
1126
+ /** Name must not contain numbers */
1127
+ readonly nameNoNumbers: RegExp;
1128
+ /** Address format: Allow word chars, spaces, hyphens, slashes, periods, hash, commas */
1129
+ readonly addressFormat: RegExp;
1130
+ /** No PO Box pattern - prevents PO Box addresses */
1131
+ readonly noPOBox: RegExp;
1132
+ /** Zip code: Exactly 5 digits */
1133
+ readonly zipCode: RegExp;
1134
+ /** City: Letters, spaces, periods, hyphens, apostrophes only */
1135
+ readonly cityFormat: RegExp;
1136
+ /** Address must contain at least one number */
1137
+ readonly hasNumber: RegExp;
1138
+ };
1139
+
1140
+ /**
1141
+ * Valibot schema for shipping address validation.
1142
+ * Enforces no PO Box, requires street number, formats phone number.
1143
+ */
1144
+ declare const ShippingAddressSchema: v.ObjectSchema<{
1145
+ readonly companyName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1146
+ readonly firstName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "First name is required">, v.RegexAction<string, "Invalid first name">, v.RegexAction<string, "Invalid first name">]>;
1147
+ readonly lastName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Last name is required">, v.RegexAction<string, "Invalid last name">, v.RegexAction<string, "Invalid last name">]>;
1148
+ readonly address1: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Address 1 is required">, v.RegexAction<string, "Invalid address">, v.RegexAction<string, "PO Box addresses are not allowed for shipping">, v.RegexAction<string, "Address must contain at least one number">]>;
1149
+ readonly address2: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid address format">, v.CheckAction<string, "PO Box addresses are not allowed for shipping">]>, undefined>;
1150
+ readonly postalCode: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Zip code is required">, v.RegexAction<string, "Zip code must be exactly 5 digits">]>;
1151
+ readonly city: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 2, "City is required">, v.RegexAction<string, "City must contain only letters, spaces, periods, hyphens, or apostrophes">]>;
1152
+ readonly state: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "State is required">, v.PicklistSchema<[string, ...string[]], "Please select a valid US state">]>;
1153
+ readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Country is required">]>;
1154
+ readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Email is required">, v.EmailAction<string, "Invalid email">]>;
1155
+ readonly phoneNumber: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Phone number is required">, v.RegexAction<string, "Invalid phone number">, v.TransformAction<string, string>]>;
1156
+ readonly notes: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1157
+ readonly plus4Code: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1158
+ }, undefined>;
1159
+ /**
1160
+ * Valibot schema for billing address validation.
1161
+ * Less strict than shipping: allows PO Box, no email/phone required.
1162
+ */
1163
+ declare const BillingAddressSchema: v.ObjectSchema<{
1164
+ readonly poNumber: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1165
+ readonly firstName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "First name is required">, v.RegexAction<string, "Invalid first name">, v.RegexAction<string, "Invalid first name">]>;
1166
+ readonly lastName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Last name is required">, v.RegexAction<string, "Invalid last name">, v.RegexAction<string, "Invalid last name">]>;
1167
+ readonly address1: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Address 1 is required">, v.RegexAction<string, "Invalid address">]>;
1168
+ readonly address2: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1169
+ readonly postalCode: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Zip code is required">]>;
1170
+ readonly city: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "City is required">]>;
1171
+ readonly state: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "State is required">]>;
1172
+ readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Country is required">]>;
1173
+ readonly plus4Code: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1174
+ }, undefined>;
1175
+ /**
1176
+ * Valibot schema for billing address with required PO number (invoice payments).
1177
+ */
1178
+ declare const BillingAddressInvoiceSchema: v.ObjectSchema<{
1179
+ readonly poNumber: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 2, "PO number is required">]>;
1180
+ }, undefined>;
1181
+ type ShippingAddress = v.InferOutput<typeof ShippingAddressSchema>;
1182
+ type BillingAddress = v.InferOutput<typeof BillingAddressSchema>;
1183
+
1184
+ /**
1185
+ * US states and territories for address validation.
1186
+ */
1187
+ declare const US_STATES: readonly [{
1188
+ readonly code: "AL";
1189
+ readonly name: "Alabama";
1190
+ }, {
1191
+ readonly code: "AZ";
1192
+ readonly name: "Arizona";
1193
+ }, {
1194
+ readonly code: "AR";
1195
+ readonly name: "Arkansas";
1196
+ }, {
1197
+ readonly code: "CA";
1198
+ readonly name: "California";
1199
+ }, {
1200
+ readonly code: "CO";
1201
+ readonly name: "Colorado";
1202
+ }, {
1203
+ readonly code: "CT";
1204
+ readonly name: "Connecticut";
1205
+ }, {
1206
+ readonly code: "DC";
1207
+ readonly name: "District of Columbia";
1208
+ }, {
1209
+ readonly code: "DE";
1210
+ readonly name: "Delaware";
1211
+ }, {
1212
+ readonly code: "FL";
1213
+ readonly name: "Florida";
1214
+ }, {
1215
+ readonly code: "GA";
1216
+ readonly name: "Georgia";
1217
+ }, {
1218
+ readonly code: "ID";
1219
+ readonly name: "Idaho";
1220
+ }, {
1221
+ readonly code: "IL";
1222
+ readonly name: "Illinois";
1223
+ }, {
1224
+ readonly code: "IN";
1225
+ readonly name: "Indiana";
1226
+ }, {
1227
+ readonly code: "IA";
1228
+ readonly name: "Iowa";
1229
+ }, {
1230
+ readonly code: "KS";
1231
+ readonly name: "Kansas";
1232
+ }, {
1233
+ readonly code: "KY";
1234
+ readonly name: "Kentucky";
1235
+ }, {
1236
+ readonly code: "LA";
1237
+ readonly name: "Louisiana";
1238
+ }, {
1239
+ readonly code: "ME";
1240
+ readonly name: "Maine";
1241
+ }, {
1242
+ readonly code: "MD";
1243
+ readonly name: "Maryland";
1244
+ }, {
1245
+ readonly code: "MA";
1246
+ readonly name: "Massachusetts";
1247
+ }, {
1248
+ readonly code: "MI";
1249
+ readonly name: "Michigan";
1250
+ }, {
1251
+ readonly code: "MN";
1252
+ readonly name: "Minnesota";
1253
+ }, {
1254
+ readonly code: "MS";
1255
+ readonly name: "Mississippi";
1256
+ }, {
1257
+ readonly code: "MO";
1258
+ readonly name: "Missouri";
1259
+ }, {
1260
+ readonly code: "MT";
1261
+ readonly name: "Montana";
1262
+ }, {
1263
+ readonly code: "NE";
1264
+ readonly name: "Nebraska";
1265
+ }, {
1266
+ readonly code: "NV";
1267
+ readonly name: "Nevada";
1268
+ }, {
1269
+ readonly code: "NH";
1270
+ readonly name: "New Hampshire";
1271
+ }, {
1272
+ readonly code: "NJ";
1273
+ readonly name: "New Jersey";
1274
+ }, {
1275
+ readonly code: "NM";
1276
+ readonly name: "New Mexico";
1277
+ }, {
1278
+ readonly code: "NY";
1279
+ readonly name: "New York";
1280
+ }, {
1281
+ readonly code: "NC";
1282
+ readonly name: "North Carolina";
1283
+ }, {
1284
+ readonly code: "ND";
1285
+ readonly name: "North Dakota";
1286
+ }, {
1287
+ readonly code: "OH";
1288
+ readonly name: "Ohio";
1289
+ }, {
1290
+ readonly code: "OK";
1291
+ readonly name: "Oklahoma";
1292
+ }, {
1293
+ readonly code: "OR";
1294
+ readonly name: "Oregon";
1295
+ }, {
1296
+ readonly code: "PA";
1297
+ readonly name: "Pennsylvania";
1298
+ }, {
1299
+ readonly code: "RI";
1300
+ readonly name: "Rhode Island";
1301
+ }, {
1302
+ readonly code: "SC";
1303
+ readonly name: "South Carolina";
1304
+ }, {
1305
+ readonly code: "SD";
1306
+ readonly name: "South Dakota";
1307
+ }, {
1308
+ readonly code: "TN";
1309
+ readonly name: "Tennessee";
1310
+ }, {
1311
+ readonly code: "TX";
1312
+ readonly name: "Texas";
1313
+ }, {
1314
+ readonly code: "UT";
1315
+ readonly name: "Utah";
1316
+ }, {
1317
+ readonly code: "VT";
1318
+ readonly name: "Vermont";
1319
+ }, {
1320
+ readonly code: "VA";
1321
+ readonly name: "Virginia";
1322
+ }, {
1323
+ readonly code: "WA";
1324
+ readonly name: "Washington";
1325
+ }, {
1326
+ readonly code: "WV";
1327
+ readonly name: "West Virginia";
1328
+ }, {
1329
+ readonly code: "WI";
1330
+ readonly name: "Wisconsin";
1331
+ }, {
1332
+ readonly code: "WY";
1333
+ readonly name: "Wyoming";
1334
+ }];
1335
+ type USStateCode = (typeof US_STATES)[number]["code"];
1336
+
1337
+ /**
1338
+ * Date utility functions for shipping calculations.
1339
+ */
1340
+ /**
1341
+ * Get the Nth business day from today (skipping weekends).
1342
+ * @param businessDaysFromNow - Number of business days to add
1343
+ * @returns Formatted date string
1344
+ */
1345
+ declare function getBusinessDay(businessDaysFromNow: number): string;
1346
+ /**
1347
+ * Get shipping lead date estimate based on days string.
1348
+ * @param days - Shipping days string (e.g., "1-2", "2-3", "3")
1349
+ * @returns Formatted date range or single date
1350
+ */
1351
+ declare function getShippingLeadDate(days: string): string;
1352
+
1353
+ /**
1354
+ * Analytics utility functions for tracking ecommerce events via Google Analytics.
1355
+ */
1356
+ declare global {
1357
+ interface Window {
1358
+ dataLayer?: Record<string, unknown>[];
1359
+ gtag?: (...args: unknown[]) => void;
1360
+ }
1361
+ }
1362
+ interface AddToCartEventParams {
1363
+ itemId: string;
1364
+ itemName: string;
1365
+ price: number;
1366
+ quantity: number;
1367
+ estimatedCost: number;
1368
+ }
1369
+ /**
1370
+ * Track add_to_cart event to Google Analytics dataLayer.
1371
+ */
1372
+ declare function trackAddToCart({ itemId, itemName, price, quantity, estimatedCost, }: AddToCartEventParams): void;
1373
+ interface ViewItemEventParams {
1374
+ itemId: string;
1375
+ itemName: string;
1376
+ price: number;
1377
+ category?: string;
1378
+ }
1379
+ /**
1380
+ * Track view_item event to Google Analytics dataLayer.
1381
+ */
1382
+ declare function trackViewItem({ itemId, itemName, price, category, }: ViewItemEventParams): void;
1383
+
1384
+ export { type AddToCartEventParams, BLUR_DATA_URL, type BillingAddress, BillingAddressInvoiceSchema, BillingAddressSchema, type BreadcrumbJsonLdItem, CACHE_CONFIG, type CacheTier, type CheckoutInput, type CustomerDocument, type DerivePriceInput, type DerivedPrice, type ImageConfig, type ImageTransforms, type ImageUrlOptions, type MenuItem, type OeHdr, type OeLine, type OrderHeader, type OrderLine, type OrderNote, type OrderPayment, type PaymentStatus, type PaymentStatusInvoice, type ResolveStockInput, type ResolvedStock, type SafeActionResult, type SchemaAvailability, type ShipToAddress, type ShippingAddress, ShippingAddressSchema, type TAccountQuery, type TApiResponse, type TAttribute, type TAttributeValue, type TBillingUpdate, type TCardInfo, type TCartHdrUid, type TCartLine, type TCartLookUp, type TCategory, type TCategoryChild, type TCategoryItemsResult, type TCheckoutResult, type TInvMast, type TInvMastDoc, type TInventorySupplier, type TItemAccessory, type TItemAttribute, type TItemAttributes, type TItemCategory, type TItemDetails, type TItemRelatedProduct, type TItemUom, type TItemsFilters, type TJoomlaContent, type TJoomlaContentFilters, type TLibraryPriceBreak, type TLibraryPriceData, type TLtlRatesResponse, type TLtlShipmentData, type TMenu, type TMenuFilters, type TMetaTags, type TOrderCartLine, type TPasswordVerification, type TPaymentValidation, type TPriceData, type TProductCategory, type TProductItem, type TProductStockData, type TProfileValues, type TRelatedProduct, type TSearchSuggestion, type TSearchSuggestionsResponse, type TShippingMethod, type TSmartyStreets, type TStock, type TStockData, type TSurcharge, type TTax, type TTaxItem, type TTransactionSetup, type TUserProfile, type TWebDesc, type USStateCode, US_STATES, type UserAddress, VALIDATION_PATTERNS, type ViewItemEventParams, buildCheckoutPayload, buildImageLoader, createImageConfig, derivePrice, formatPrice, generateBreadcrumbJsonLd, getBusinessDay, getDefaultImageUrl, getImageSrcSet, getImageUrl, getPaymentStatus, getSchemaAvailability, getShippingLeadDate, isAddressDifferent, normalizePath, resolveStock, sanitizeHtmlImages, serializeTransforms, trackAddToCart, trackViewItem, transformShipToAddress, unwrap, unwrapOr };