@azzas/azzas-tracker-web 2.0.0-preview.2 → 2.0.0-preview.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.
- package/dist/mod.cjs +14 -9
- package/dist/mod.cjs.map +1 -1
- package/dist/mod.d.cts +446 -0
- package/dist/mod.d.ts +446 -0
- package/dist/mod.global.js +14 -9
- package/dist/mod.global.js.map +1 -1
- package/dist/mod.js +14 -9
- package/dist/mod.js.map +1 -1
- package/dist/mod.vtex.global.js +15 -8
- package/package.json +1 -1
package/dist/mod.d.ts
CHANGED
|
@@ -952,6 +952,449 @@ type ProductType_Minicart = {
|
|
|
952
952
|
offerings: OfferingItem[];
|
|
953
953
|
};
|
|
954
954
|
|
|
955
|
+
interface MarketingData {
|
|
956
|
+
utmSource: string | undefined;
|
|
957
|
+
utmMedium: string | undefined;
|
|
958
|
+
utmCampaign: string | undefined;
|
|
959
|
+
utmiPage: string | undefined;
|
|
960
|
+
utmiPart: string | undefined;
|
|
961
|
+
utmiCampaign: string | undefined;
|
|
962
|
+
coupon: string | undefined;
|
|
963
|
+
marketingTags: string[] | undefined;
|
|
964
|
+
}
|
|
965
|
+
interface Installment {
|
|
966
|
+
Value: number;
|
|
967
|
+
InterestRate: number;
|
|
968
|
+
TotalValuePlusInterestRate: number;
|
|
969
|
+
NumberOfInstallments: number;
|
|
970
|
+
PaymentSystemName: string;
|
|
971
|
+
PaymentSystemGroupName: string;
|
|
972
|
+
Name: string;
|
|
973
|
+
}
|
|
974
|
+
interface ClientProfileData {
|
|
975
|
+
email: string;
|
|
976
|
+
firstName: null;
|
|
977
|
+
lastName: null;
|
|
978
|
+
document: null;
|
|
979
|
+
documentType: null;
|
|
980
|
+
phone: null;
|
|
981
|
+
corporateName: null;
|
|
982
|
+
tradeName: null;
|
|
983
|
+
corporateDocument: null;
|
|
984
|
+
stateInscription: null;
|
|
985
|
+
corporatePhone: null;
|
|
986
|
+
isCorporate: boolean;
|
|
987
|
+
profileCompleteOnLoading: boolean;
|
|
988
|
+
profileErrorOnLoading: boolean;
|
|
989
|
+
customerClass: null;
|
|
990
|
+
}
|
|
991
|
+
interface Address {
|
|
992
|
+
addressType?: string;
|
|
993
|
+
receiverName: string | null;
|
|
994
|
+
addressId: string;
|
|
995
|
+
isDisposable?: boolean;
|
|
996
|
+
postalCode?: string;
|
|
997
|
+
city?: string;
|
|
998
|
+
state?: string;
|
|
999
|
+
country?: string;
|
|
1000
|
+
street?: string;
|
|
1001
|
+
number?: string;
|
|
1002
|
+
neighborhood?: string;
|
|
1003
|
+
addressName?: string;
|
|
1004
|
+
complement: string | null;
|
|
1005
|
+
reference?: string;
|
|
1006
|
+
geoCoordinates?: number[];
|
|
1007
|
+
name?: string;
|
|
1008
|
+
}
|
|
1009
|
+
interface Offering {
|
|
1010
|
+
type: string;
|
|
1011
|
+
id: string;
|
|
1012
|
+
name: string;
|
|
1013
|
+
allowGiftMessage: boolean;
|
|
1014
|
+
attachmentOfferings: unknown[];
|
|
1015
|
+
price: number;
|
|
1016
|
+
}
|
|
1017
|
+
interface Ean {
|
|
1018
|
+
maximumNumberOfCharacters: number;
|
|
1019
|
+
domain: unknown[];
|
|
1020
|
+
}
|
|
1021
|
+
interface Schema {
|
|
1022
|
+
Sku: Ean;
|
|
1023
|
+
Price: Ean;
|
|
1024
|
+
Qtde?: Ean;
|
|
1025
|
+
EAN: Ean;
|
|
1026
|
+
Measuremt_unit: Ean;
|
|
1027
|
+
Unit_multiplier: Ean;
|
|
1028
|
+
Quantity: Ean;
|
|
1029
|
+
}
|
|
1030
|
+
declare enum Name {
|
|
1031
|
+
AlternativeSubstitute = "ALTERNATIVE_SUBSTITUTE",
|
|
1032
|
+
Substituto = "Substituto"
|
|
1033
|
+
}
|
|
1034
|
+
interface AttachmentOffering {
|
|
1035
|
+
name: Name;
|
|
1036
|
+
required: boolean;
|
|
1037
|
+
schema: Schema;
|
|
1038
|
+
}
|
|
1039
|
+
interface SellingPrice {
|
|
1040
|
+
value: number;
|
|
1041
|
+
quantity: number;
|
|
1042
|
+
}
|
|
1043
|
+
interface PriceDefinition {
|
|
1044
|
+
calculatedSellingPrice: number;
|
|
1045
|
+
total: number;
|
|
1046
|
+
sellingPrices: SellingPrice[];
|
|
1047
|
+
}
|
|
1048
|
+
interface PriceTag {
|
|
1049
|
+
name: string;
|
|
1050
|
+
value: number;
|
|
1051
|
+
rawValue: number;
|
|
1052
|
+
isPercentual: boolean;
|
|
1053
|
+
identifier: string;
|
|
1054
|
+
owner: string;
|
|
1055
|
+
}
|
|
1056
|
+
type AvailableAssociations = Record<string, string>;
|
|
1057
|
+
interface Component {
|
|
1058
|
+
uniqueId: string;
|
|
1059
|
+
id: string;
|
|
1060
|
+
productId: null;
|
|
1061
|
+
productRefId: null;
|
|
1062
|
+
refId: string;
|
|
1063
|
+
ean: string;
|
|
1064
|
+
name: string;
|
|
1065
|
+
skuName: null;
|
|
1066
|
+
modalType: null;
|
|
1067
|
+
parentItemIndex: null;
|
|
1068
|
+
parentAssemblyBinding: null;
|
|
1069
|
+
assemblies: unknown[];
|
|
1070
|
+
priceValidUntil: null;
|
|
1071
|
+
tax: number;
|
|
1072
|
+
price: number;
|
|
1073
|
+
listPrice: null;
|
|
1074
|
+
manualPrice: null;
|
|
1075
|
+
manualPriceAppliedBy: null;
|
|
1076
|
+
sellingPrice: number;
|
|
1077
|
+
rewardValue: number;
|
|
1078
|
+
isGift: boolean;
|
|
1079
|
+
additionalInfo: AdditionalInfo;
|
|
1080
|
+
preSaleDate: null;
|
|
1081
|
+
productCategoryIds: null;
|
|
1082
|
+
productCategories: AvailableAssociations;
|
|
1083
|
+
quantity: number;
|
|
1084
|
+
seller: null;
|
|
1085
|
+
sellerChain: null[];
|
|
1086
|
+
imageUrl: null;
|
|
1087
|
+
detailUrl: null;
|
|
1088
|
+
components: unknown[];
|
|
1089
|
+
bundleItems: unknown[];
|
|
1090
|
+
attachments: unknown[];
|
|
1091
|
+
attachmentOfferings: unknown[];
|
|
1092
|
+
offerings: unknown[];
|
|
1093
|
+
priceTags: PriceTag[];
|
|
1094
|
+
availability: null;
|
|
1095
|
+
measurementUnit: string;
|
|
1096
|
+
unitMultiplier: number;
|
|
1097
|
+
manufacturerCode: null;
|
|
1098
|
+
priceDefinition: PriceDefinition;
|
|
1099
|
+
}
|
|
1100
|
+
interface AdditionalInfo {
|
|
1101
|
+
dimension: null;
|
|
1102
|
+
brandName: null | string;
|
|
1103
|
+
brandId: null | string;
|
|
1104
|
+
offeringInfo: null;
|
|
1105
|
+
offeringType: null;
|
|
1106
|
+
offeringTypeId: null;
|
|
1107
|
+
}
|
|
1108
|
+
interface OrderFormItem {
|
|
1109
|
+
uniqueId: string;
|
|
1110
|
+
id: string;
|
|
1111
|
+
productId: string;
|
|
1112
|
+
productRefId: string;
|
|
1113
|
+
refId: string;
|
|
1114
|
+
ean: null | string;
|
|
1115
|
+
name: string;
|
|
1116
|
+
skuName: string;
|
|
1117
|
+
modalType: null | string;
|
|
1118
|
+
parentItemIndex: null;
|
|
1119
|
+
parentAssemblyBinding: null;
|
|
1120
|
+
assemblies: unknown[];
|
|
1121
|
+
priceValidUntil: Date;
|
|
1122
|
+
tax: number;
|
|
1123
|
+
price: number;
|
|
1124
|
+
listPrice: number;
|
|
1125
|
+
manualPrice: null;
|
|
1126
|
+
manualPriceAppliedBy: null;
|
|
1127
|
+
sellingPrice: number;
|
|
1128
|
+
rewardValue: number;
|
|
1129
|
+
isGift: boolean;
|
|
1130
|
+
additionalInfo: AdditionalInfo;
|
|
1131
|
+
preSaleDate: null;
|
|
1132
|
+
productCategoryIds: string;
|
|
1133
|
+
productCategories: {
|
|
1134
|
+
[key: string]: string;
|
|
1135
|
+
};
|
|
1136
|
+
quantity: number;
|
|
1137
|
+
seller: string;
|
|
1138
|
+
sellerChain: string[];
|
|
1139
|
+
imageUrl: string;
|
|
1140
|
+
detailUrl: string;
|
|
1141
|
+
components: Component[];
|
|
1142
|
+
bundleItems: unknown[];
|
|
1143
|
+
attachments: unknown[];
|
|
1144
|
+
attachmentOfferings: AttachmentOffering[];
|
|
1145
|
+
offerings: Offering[];
|
|
1146
|
+
priceTags: PriceTag[];
|
|
1147
|
+
availability: string;
|
|
1148
|
+
measurementUnit: string;
|
|
1149
|
+
unitMultiplier: number;
|
|
1150
|
+
manufacturerCode: null;
|
|
1151
|
+
priceDefinition: PriceDefinition;
|
|
1152
|
+
}
|
|
1153
|
+
interface Fields {
|
|
1154
|
+
ean?: string;
|
|
1155
|
+
itemIndex?: string;
|
|
1156
|
+
skuName?: string;
|
|
1157
|
+
}
|
|
1158
|
+
interface Message {
|
|
1159
|
+
code: null | string;
|
|
1160
|
+
text: string;
|
|
1161
|
+
status: string;
|
|
1162
|
+
fields: Fields;
|
|
1163
|
+
}
|
|
1164
|
+
interface Totalizer {
|
|
1165
|
+
id: string;
|
|
1166
|
+
name: string;
|
|
1167
|
+
value: number;
|
|
1168
|
+
alternativeTotals?: Totalizer[];
|
|
1169
|
+
}
|
|
1170
|
+
declare enum SelectedSla {
|
|
1171
|
+
ClickRetireRJS = "Click & Retire (RJS)",
|
|
1172
|
+
Normal = "Normal"
|
|
1173
|
+
}
|
|
1174
|
+
declare enum SelectedDeliveryChannel {
|
|
1175
|
+
Delivery = "delivery",
|
|
1176
|
+
PickupInPoint = "pickup-in-point"
|
|
1177
|
+
}
|
|
1178
|
+
interface DeliveryID {
|
|
1179
|
+
courierId: string;
|
|
1180
|
+
warehouseId: string;
|
|
1181
|
+
dockId: string;
|
|
1182
|
+
courierName: string;
|
|
1183
|
+
quantity: number;
|
|
1184
|
+
kitItemDetails: unknown[];
|
|
1185
|
+
}
|
|
1186
|
+
interface AvailableDeliveryWindow {
|
|
1187
|
+
startDateUtc: Date;
|
|
1188
|
+
endDateUtc: Date;
|
|
1189
|
+
price: number;
|
|
1190
|
+
lisPrice: number;
|
|
1191
|
+
tax: number;
|
|
1192
|
+
}
|
|
1193
|
+
interface PickupStoreInfo {
|
|
1194
|
+
isPickupStore: boolean;
|
|
1195
|
+
friendlyName: null | string;
|
|
1196
|
+
address: Address | null;
|
|
1197
|
+
additionalInfo: null | string;
|
|
1198
|
+
dockId: null;
|
|
1199
|
+
}
|
|
1200
|
+
interface Sla {
|
|
1201
|
+
id: SelectedSla;
|
|
1202
|
+
deliveryChannel: SelectedDeliveryChannel;
|
|
1203
|
+
name: SelectedSla;
|
|
1204
|
+
deliveryIds: DeliveryID[];
|
|
1205
|
+
shippingEstimate: string;
|
|
1206
|
+
shippingEstimateDate: null;
|
|
1207
|
+
lockTTL: null;
|
|
1208
|
+
availableDeliveryWindows: AvailableDeliveryWindow[];
|
|
1209
|
+
deliveryWindow: null;
|
|
1210
|
+
price: number;
|
|
1211
|
+
listPrice: number;
|
|
1212
|
+
tax: number;
|
|
1213
|
+
pickupStoreInfo: PickupStoreInfo;
|
|
1214
|
+
pickupPointId: null | string;
|
|
1215
|
+
pickupDistance: number | null;
|
|
1216
|
+
polygonName: string;
|
|
1217
|
+
transitTime: string;
|
|
1218
|
+
}
|
|
1219
|
+
interface LogisticsInfo {
|
|
1220
|
+
itemIndex: number;
|
|
1221
|
+
selectedSla: SelectedSla | null;
|
|
1222
|
+
selectedDeliveryChannel: SelectedDeliveryChannel;
|
|
1223
|
+
addressId: string;
|
|
1224
|
+
slas: Sla[];
|
|
1225
|
+
shipsTo: string[];
|
|
1226
|
+
itemId: string;
|
|
1227
|
+
deliveryChannels: DeliveryChannel[];
|
|
1228
|
+
}
|
|
1229
|
+
interface DeliveryChannel {
|
|
1230
|
+
id: SelectedDeliveryChannel;
|
|
1231
|
+
}
|
|
1232
|
+
interface PickupHolidays {
|
|
1233
|
+
date?: string;
|
|
1234
|
+
hourBegin?: string;
|
|
1235
|
+
hourEnd?: string;
|
|
1236
|
+
}
|
|
1237
|
+
interface BusinessHour {
|
|
1238
|
+
DayOfWeek: number;
|
|
1239
|
+
OpeningTime: string;
|
|
1240
|
+
ClosingTime: string;
|
|
1241
|
+
}
|
|
1242
|
+
interface PickupPoint {
|
|
1243
|
+
friendlyName: string;
|
|
1244
|
+
address: Address;
|
|
1245
|
+
additionalInfo: string;
|
|
1246
|
+
id: string;
|
|
1247
|
+
businessHours: BusinessHour[];
|
|
1248
|
+
pickupHolidays?: PickupHolidays[];
|
|
1249
|
+
}
|
|
1250
|
+
interface ShippingData {
|
|
1251
|
+
address: Address;
|
|
1252
|
+
logisticsInfo: LogisticsInfo[];
|
|
1253
|
+
selectedAddresses: Address[];
|
|
1254
|
+
availableAddresses: Address[];
|
|
1255
|
+
pickupPoints: PickupPoint[];
|
|
1256
|
+
}
|
|
1257
|
+
interface CartInstallment {
|
|
1258
|
+
count: number;
|
|
1259
|
+
hasInterestRate: boolean;
|
|
1260
|
+
interestRate: number;
|
|
1261
|
+
value: number;
|
|
1262
|
+
total: number;
|
|
1263
|
+
sellerMerchantInstallments?: Installment[];
|
|
1264
|
+
id?: string;
|
|
1265
|
+
}
|
|
1266
|
+
interface InstallmentOption {
|
|
1267
|
+
paymentSystem: string;
|
|
1268
|
+
bin: null;
|
|
1269
|
+
paymentName: null;
|
|
1270
|
+
paymentGroupName: null;
|
|
1271
|
+
value: number;
|
|
1272
|
+
installments: CartInstallment[];
|
|
1273
|
+
}
|
|
1274
|
+
declare enum CardCodeRegex {
|
|
1275
|
+
The093$ = "^[0-9]{3}$",
|
|
1276
|
+
The094$ = "^[0-9]{4}$"
|
|
1277
|
+
}
|
|
1278
|
+
interface Validator {
|
|
1279
|
+
regex: null | string;
|
|
1280
|
+
mask: null | string;
|
|
1281
|
+
cardCodeRegex: CardCodeRegex | null;
|
|
1282
|
+
cardCodeMask: null | string;
|
|
1283
|
+
weights: number[] | null;
|
|
1284
|
+
useCvv: boolean;
|
|
1285
|
+
useExpirationDate: boolean;
|
|
1286
|
+
useCardHolderName: boolean;
|
|
1287
|
+
useBillingAddress: boolean;
|
|
1288
|
+
}
|
|
1289
|
+
interface PaymentSystem {
|
|
1290
|
+
id: number;
|
|
1291
|
+
name: string;
|
|
1292
|
+
groupName: string;
|
|
1293
|
+
validator: Validator;
|
|
1294
|
+
stringId: string;
|
|
1295
|
+
template: string;
|
|
1296
|
+
requiresDocument: boolean;
|
|
1297
|
+
displayDocument: boolean;
|
|
1298
|
+
isCustom: boolean;
|
|
1299
|
+
description: null | string;
|
|
1300
|
+
requiresAuthentication: boolean;
|
|
1301
|
+
dueDate: Date;
|
|
1302
|
+
availablePayments: null;
|
|
1303
|
+
}
|
|
1304
|
+
interface PaymentData {
|
|
1305
|
+
updateStatus: string;
|
|
1306
|
+
installmentOptions: InstallmentOption[];
|
|
1307
|
+
paymentSystems: PaymentSystem[];
|
|
1308
|
+
payments: unknown[];
|
|
1309
|
+
giftCards: unknown[];
|
|
1310
|
+
giftCardMessages: unknown[];
|
|
1311
|
+
availableAccounts: unknown[];
|
|
1312
|
+
availableTokens: unknown[];
|
|
1313
|
+
availableAssociations: AvailableAssociations;
|
|
1314
|
+
}
|
|
1315
|
+
interface Seller {
|
|
1316
|
+
id: string;
|
|
1317
|
+
name: string;
|
|
1318
|
+
logo: string;
|
|
1319
|
+
}
|
|
1320
|
+
interface ClientPreferencesData {
|
|
1321
|
+
locale: string;
|
|
1322
|
+
optinNewsLetter: null;
|
|
1323
|
+
}
|
|
1324
|
+
interface CurrencyFormatInfo {
|
|
1325
|
+
currencyDecimalDigits: number;
|
|
1326
|
+
currencyDecimalSeparator: string;
|
|
1327
|
+
currencyGroupSeparator: string;
|
|
1328
|
+
currencyGroupSize: number;
|
|
1329
|
+
startsWithCurrencySymbol: boolean;
|
|
1330
|
+
}
|
|
1331
|
+
interface StorePreferencesData {
|
|
1332
|
+
countryCode: string;
|
|
1333
|
+
saveUserData: boolean;
|
|
1334
|
+
timeZone: string;
|
|
1335
|
+
currencyCode: string;
|
|
1336
|
+
currencyLocale: number;
|
|
1337
|
+
currencySymbol: string;
|
|
1338
|
+
currencyFormatInfo: CurrencyFormatInfo;
|
|
1339
|
+
}
|
|
1340
|
+
interface MatchedParameters {
|
|
1341
|
+
"Seller@CatalogSystem": string;
|
|
1342
|
+
"productCluster@CatalogSystem"?: string;
|
|
1343
|
+
"zipCode@Shipping"?: string;
|
|
1344
|
+
slaIds?: string;
|
|
1345
|
+
}
|
|
1346
|
+
interface RateAndBenefitsIdentifier {
|
|
1347
|
+
id: string;
|
|
1348
|
+
name: string;
|
|
1349
|
+
featured: boolean;
|
|
1350
|
+
description: string;
|
|
1351
|
+
matchedParameters: MatchedParameters;
|
|
1352
|
+
additionalInfo: null;
|
|
1353
|
+
}
|
|
1354
|
+
interface RatesAndBenefitsData {
|
|
1355
|
+
rateAndBenefitsIdentifiers: RateAndBenefitsIdentifier[];
|
|
1356
|
+
teaser: unknown[];
|
|
1357
|
+
}
|
|
1358
|
+
interface OrderForm {
|
|
1359
|
+
selected?: string;
|
|
1360
|
+
index?: number;
|
|
1361
|
+
item_list_name: string;
|
|
1362
|
+
zipcode?: string;
|
|
1363
|
+
orderFormId: string;
|
|
1364
|
+
salesChannel: string;
|
|
1365
|
+
loggedIn: boolean;
|
|
1366
|
+
isCheckedIn: boolean;
|
|
1367
|
+
storeId: null;
|
|
1368
|
+
checkedInPickupPointId: null;
|
|
1369
|
+
allowManualPrice: boolean;
|
|
1370
|
+
canEditData: boolean;
|
|
1371
|
+
userProfileId: null;
|
|
1372
|
+
userType: null;
|
|
1373
|
+
ignoreProfileData: boolean;
|
|
1374
|
+
value: number;
|
|
1375
|
+
messages: Message[];
|
|
1376
|
+
items: OrderFormItem[];
|
|
1377
|
+
selectableGifts: unknown[];
|
|
1378
|
+
totalizers: Totalizer[];
|
|
1379
|
+
shippingData: ShippingData;
|
|
1380
|
+
clientProfileData: ClientProfileData | null;
|
|
1381
|
+
paymentData: PaymentData;
|
|
1382
|
+
marketingData: MarketingData;
|
|
1383
|
+
sellers: Seller[];
|
|
1384
|
+
clientPreferencesData: ClientPreferencesData;
|
|
1385
|
+
commercialConditionData: null;
|
|
1386
|
+
storePreferencesData: StorePreferencesData;
|
|
1387
|
+
giftRegistryData: null;
|
|
1388
|
+
openTextField: null;
|
|
1389
|
+
invoiceData: null;
|
|
1390
|
+
customData: null;
|
|
1391
|
+
hooksData: null;
|
|
1392
|
+
ratesAndBenefitsData: RatesAndBenefitsData;
|
|
1393
|
+
subscriptionData: null;
|
|
1394
|
+
merchantContextData: null;
|
|
1395
|
+
itemsOrdination: null;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
955
1398
|
declare global {
|
|
956
1399
|
interface Window {
|
|
957
1400
|
dataLayer: any[];
|
|
@@ -977,6 +1420,9 @@ type AdapterPayload = {
|
|
|
977
1420
|
} | {
|
|
978
1421
|
adapter: 'DECO';
|
|
979
1422
|
products: (Product & ProductMeta)[];
|
|
1423
|
+
} | {
|
|
1424
|
+
adapter: 'ORDERFORM';
|
|
1425
|
+
orderForm: (OrderForm & ProductMeta)[];
|
|
980
1426
|
};
|
|
981
1427
|
interface TrackMeta {
|
|
982
1428
|
region?: string;
|
package/dist/mod.global.js
CHANGED
|
@@ -1439,9 +1439,6 @@ var AzzasTracker = (() => {
|
|
|
1439
1439
|
const deepest = (_d = validHierarchy[validHierarchy.length - 1]) != null ? _d : "";
|
|
1440
1440
|
return capitalize(deepest);
|
|
1441
1441
|
};
|
|
1442
|
-
function getItemShippingTier2() {
|
|
1443
|
-
return null;
|
|
1444
|
-
}
|
|
1445
1442
|
|
|
1446
1443
|
// src/params/adapters/deco/index.ts
|
|
1447
1444
|
var IN_STOCK_SCHEMA = "https://schema.org/InStock";
|
|
@@ -1469,7 +1466,7 @@ var AzzasTracker = (() => {
|
|
|
1469
1466
|
// cor
|
|
1470
1467
|
item_variant2: (_o = (_n = item == null ? void 0 : item.name) == null ? void 0 : _n.split(" - ")[1]) != null ? _o : null,
|
|
1471
1468
|
// tamanho
|
|
1472
|
-
item_shipping_tier:
|
|
1469
|
+
item_shipping_tier: "",
|
|
1473
1470
|
item_ref: (_s = (_r = (_q = (_p = item.additionalProperty) == null ? void 0 : _p.find((i) => i.name === "RefId")) == null ? void 0 : _q.value) == null ? void 0 : _r.replace(/_\d+$/, "")) != null ? _s : null,
|
|
1474
1471
|
item_category: (_t = getItemCategory3(item)) != null ? _t : null,
|
|
1475
1472
|
item_category2: (_u = getItemCategory22(item)) != null ? _u : null,
|
|
@@ -1549,6 +1546,14 @@ var AzzasTracker = (() => {
|
|
|
1549
1546
|
const deepest = (_b = validHierarchy[validHierarchy.length - 1]) != null ? _b : "";
|
|
1550
1547
|
return capitalize(deepest);
|
|
1551
1548
|
};
|
|
1549
|
+
function getItemShippingTier2(orderForm, item) {
|
|
1550
|
+
var _a, _b, _c, _d;
|
|
1551
|
+
const info = (_b = (_a = orderForm == null ? void 0 : orderForm.shippingData) == null ? void 0 : _a.logisticsInfo) == null ? void 0 : _b.find(
|
|
1552
|
+
(li) => li.itemId === item.id
|
|
1553
|
+
);
|
|
1554
|
+
const selectedSla = (_c = info == null ? void 0 : info.slas) == null ? void 0 : _c.find((sla) => sla.id === info.selectedSla);
|
|
1555
|
+
return ((_d = selectedSla == null ? void 0 : selectedSla.pickupStoreInfo) == null ? void 0 : _d.friendlyName) ? `retirada em loja: ${selectedSla.pickupStoreInfo.friendlyName}` : (selectedSla == null ? void 0 : selectedSla.name) ? `Receba em casa: ${selectedSla.name}` : null;
|
|
1556
|
+
}
|
|
1552
1557
|
var getOrderFormItems = (orderForm) => {
|
|
1553
1558
|
const idSelected = orderForm == null ? void 0 : orderForm.selected;
|
|
1554
1559
|
return idSelected ? orderForm.items.filter((item) => item.id === idSelected) : orderForm.items;
|
|
@@ -1571,7 +1576,7 @@ var AzzasTracker = (() => {
|
|
|
1571
1576
|
discount: ((item == null ? void 0 : item.listPrice) - (item == null ? void 0 : item.sellingPrice)) / 100,
|
|
1572
1577
|
item_variant: (_k = (_j = (_i = (_h = item == null ? void 0 : item.skuName) == null ? void 0 : _h.split(" - ")[0]) == null ? void 0 : _i.split("_").pop()) == null ? void 0 : _j.trim()) != null ? _k : null,
|
|
1573
1578
|
item_variant2: (_n = (_m = (_l = item == null ? void 0 : item.skuName) == null ? void 0 : _l.split(" - ")[1]) == null ? void 0 : _m.trim()) != null ? _n : null,
|
|
1574
|
-
item_shipping_tier:
|
|
1579
|
+
item_shipping_tier: getItemShippingTier2(context.orderForm, item),
|
|
1575
1580
|
item_ref: (item == null ? void 0 : item.productRefId) || (item == null ? void 0 : item.refId.replace(/_\d+$/, "")) || null,
|
|
1576
1581
|
item_category: (_o = getItemCategory5(item)) != null ? _o : null,
|
|
1577
1582
|
item_category2: (_p = getItemCategory23(item)) != null ? _p : null,
|
|
@@ -1608,10 +1613,10 @@ var AzzasTracker = (() => {
|
|
|
1608
1613
|
payment_type: getPaymentType,
|
|
1609
1614
|
total_discount: (context) => {
|
|
1610
1615
|
var _a, _b;
|
|
1611
|
-
if (context == null ? void 0 : context.
|
|
1612
|
-
|
|
1613
|
-
const
|
|
1614
|
-
const totalDiscount =
|
|
1616
|
+
if (context == null ? void 0 : context.total_discount) return context.total_discount;
|
|
1617
|
+
if (!((_a = context == null ? void 0 : context.orderForm) == null ? void 0 : _a.items)) return null;
|
|
1618
|
+
const totalsList = ((_b = context.orderForm) == null ? void 0 : _b.totalizers) || [];
|
|
1619
|
+
const totalDiscount = getOrderFormItems(context.orderForm).reduce((acc, item) => {
|
|
1615
1620
|
const unitDiscount = Math.max(0, item.listPrice - item.sellingPrice);
|
|
1616
1621
|
return acc + unitDiscount * item.quantity;
|
|
1617
1622
|
}, 0);
|