@postnord/pn-marketweb-components 2.4.6 → 2.4.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.
Files changed (64) hide show
  1. package/cjs/loader.cjs.js +1 -1
  2. package/cjs/pn-market-web-components.cjs.js +1 -1
  3. package/cjs/pn-proxio-findprice-result.cjs.entry.js +41 -9
  4. package/cjs/pn-proxio-findprice.cjs.entry.js +58 -29
  5. package/cjs/pn-proxio-productcard_4.cjs.entry.js +1 -1
  6. package/cjs/pn-stats-info.cjs.entry.js +1 -1
  7. package/cjs/pn-teaser-card.cjs.entry.js +1 -1
  8. package/collection/components/cards/pn-teaser-card/pn-teaser-card.css +28 -0
  9. package/collection/components/data-visualization/pn-stats-info/pn-stats-info.css +69 -0
  10. package/collection/components/data-visualization/pn-stats-info/pn-stats-info.stories.js +1 -1
  11. package/collection/components/widgets/pn-proxio-findprice/find-price.stories.js +24 -0
  12. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice-result.css +10 -6
  13. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice-result.js +94 -8
  14. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice-store.js +2 -1
  15. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice-translations.js +15 -5
  16. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice.css +56 -0
  17. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice.js +78 -21
  18. package/collection/components/widgets/pn-proxio-productcard/pn-proxio-productcard.js +1 -1
  19. package/components/pn-proxio-findprice-result2.js +44 -9
  20. package/components/pn-proxio-findprice.js +61 -29
  21. package/components/pn-proxio-productcard2.js +1 -1
  22. package/components/pn-stats-info.js +1 -1
  23. package/components/pn-teaser-card.js +1 -1
  24. package/esm/loader.js +1 -1
  25. package/esm/pn-market-web-components.js +1 -1
  26. package/esm/pn-proxio-findprice-result.entry.js +41 -9
  27. package/esm/pn-proxio-findprice.entry.js +58 -29
  28. package/esm/pn-proxio-productcard_4.entry.js +1 -1
  29. package/esm/pn-stats-info.entry.js +1 -1
  30. package/esm/pn-teaser-card.entry.js +1 -1
  31. package/esm-es5/loader.js +1 -1
  32. package/esm-es5/pn-market-web-components.js +1 -1
  33. package/esm-es5/pn-proxio-findprice-result.entry.js +1 -1
  34. package/esm-es5/pn-proxio-findprice.entry.js +1 -1
  35. package/esm-es5/pn-proxio-productcard_4.entry.js +1 -1
  36. package/esm-es5/pn-stats-info.entry.js +1 -1
  37. package/esm-es5/pn-teaser-card.entry.js +1 -1
  38. package/package.json +1 -1
  39. package/pn-market-web-components/p-29d8270f.system.entry.js +1 -0
  40. package/pn-market-web-components/p-3afc3173.entry.js +1 -0
  41. package/pn-market-web-components/p-43942ff1.entry.js +1 -0
  42. package/pn-market-web-components/p-548b62a8.system.entry.js +1 -0
  43. package/pn-market-web-components/{p-530be6fe.entry.js → p-63737c63.entry.js} +1 -1
  44. package/pn-market-web-components/p-6b46c15c.entry.js +1 -0
  45. package/pn-market-web-components/{p-cccb53f2.system.entry.js → p-6eabccbc.system.entry.js} +1 -1
  46. package/pn-market-web-components/p-9271cf8e.entry.js +1 -0
  47. package/pn-market-web-components/{p-8805bc30.system.entry.js → p-98ea3580.system.entry.js} +1 -1
  48. package/pn-market-web-components/p-d295ef71.system.js +1 -1
  49. package/pn-market-web-components/p-de823bdb.system.entry.js +1 -0
  50. package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
  51. package/types/components/widgets/pn-proxio-findprice/pn-proxio-findprice-result.d.ts +5 -0
  52. package/types/components/widgets/pn-proxio-findprice/pn-proxio-findprice-store.d.ts +2 -0
  53. package/types/components/widgets/pn-proxio-findprice/pn-proxio-findprice-translations.d.ts +10 -0
  54. package/types/components/widgets/pn-proxio-findprice/pn-proxio-findprice-types.d.ts +10 -0
  55. package/types/components/widgets/pn-proxio-findprice/pn-proxio-findprice.d.ts +5 -0
  56. package/types/components/widgets/pn-proxio-pricegroup/types.d.ts +9 -0
  57. package/types/components.d.ts +10 -0
  58. package/pn-market-web-components/p-0ba1df3b.entry.js +0 -1
  59. package/pn-market-web-components/p-18abec91.entry.js +0 -1
  60. package/pn-market-web-components/p-1d9de480.system.entry.js +0 -1
  61. package/pn-market-web-components/p-59024d31.entry.js +0 -1
  62. package/pn-market-web-components/p-6a4ae9af.system.entry.js +0 -1
  63. package/pn-market-web-components/p-97564852.entry.js +0 -1
  64. package/pn-market-web-components/p-ea4ec1db.system.entry.js +0 -1
@@ -16,12 +16,15 @@ export class PnProxioFindPrice {
16
16
  this.language = "da";
17
17
  this.market = "dk";
18
18
  this.showMedium = false;
19
+ this.showInternational = false;
20
+ this.maxAbroadKg = 0;
19
21
  this.cache = false;
20
22
  this.filteredItems = [];
21
23
  this.weight = { value: 0, name: "" };
22
24
  this.weightvalue = 0;
25
+ this.countrycodevalue = "";
23
26
  this.sizecategory = { value: "", name: "", icon: "", unit: "" };
24
- this.data = { proxioProducts: [] };
27
+ this.data = { proxioProducts: [], shipmentCountries: [] };
25
28
  }
26
29
  componentWillLoad() {
27
30
  this.setInitialValues().then(() => {
@@ -39,6 +42,9 @@ export class PnProxioFindPrice {
39
42
  if (!this.endpoint) {
40
43
  this.endpoint = "";
41
44
  }
45
+ if (this.countrycodevalue === "") {
46
+ this.countrycodevalue = this.market.toLowerCase();
47
+ }
42
48
  }
43
49
  init() {
44
50
  this.setState();
@@ -66,7 +72,8 @@ export class PnProxioFindPrice {
66
72
  'mode': 'cors',
67
73
  }, false, this.onFetchData.bind(this));
68
74
  if (data) {
69
- this.data.proxioProducts = data;
75
+ this.data = data;
76
+ this.data.proxioProducts = data.proxioProducts;
70
77
  }
71
78
  this.filterItems();
72
79
  }
@@ -83,16 +90,6 @@ export class PnProxioFindPrice {
83
90
  }
84
91
  }
85
92
  filterItems() {
86
- var _a;
87
- if (!this.data || !this.data.proxioProducts) {
88
- console.log('Data has not yet been loaded, fetching again');
89
- this.fetchData().then(() => {
90
- if (!this.data) {
91
- console.log('Data could not be loaded');
92
- return;
93
- }
94
- });
95
- }
96
93
  const sizeItemData = this.data.proxioProducts.filter(item => {
97
94
  return item.proxioProduct.productWeightGroupList.some(weightGroup => {
98
95
  return weightGroup.item3.includes(this.sizecategory.value);
@@ -102,18 +99,31 @@ export class PnProxioFindPrice {
102
99
  return;
103
100
  }
104
101
  const comparisonWeight = this.weight.value;
105
- let weightFilteredData = sizeItemData.filter(item => {
102
+ let weightFilteredData = sizeItemData === null || sizeItemData === void 0 ? void 0 : sizeItemData.filter(item => {
106
103
  return item.proxioProduct.productWeightGroupList.some(weightGroup => {
107
104
  return weightGroup.item1 === comparisonWeight;
108
105
  });
109
106
  });
110
107
  if (weightFilteredData.length === 0 && this.weightvalue !== 0) {
111
- weightFilteredData = sizeItemData.filter(item => {
108
+ weightFilteredData = sizeItemData === null || sizeItemData === void 0 ? void 0 : sizeItemData.filter(item => {
112
109
  return item.proxioProduct.productWeightGroupList.some(weightGroup => {
113
110
  return weightGroup.item1 === comparisonWeight;
114
111
  });
115
112
  });
116
113
  }
114
+ if (this.showInternational && this.countrycodevalue) {
115
+ weightFilteredData = weightFilteredData === null || weightFilteredData === void 0 ? void 0 : weightFilteredData.filter(item => item.proxioProduct.weightPriceCountryList.some(countryItem => countryItem.item3.includes(this.countrycodevalue.toUpperCase())));
116
+ }
117
+ weightFilteredData = this.sortWeightItems(weightFilteredData);
118
+ this.filteredItems = weightFilteredData;
119
+ }
120
+ parseFloatFromString(text) {
121
+ var _a;
122
+ return parseFloat((_a = text === null || text === void 0 ? void 0 : text.replace(/[^\d\.\,]*/g, '')) !== null && _a !== void 0 ? _a : 100000);
123
+ }
124
+ sortWeightItems(weightFilteredData) {
125
+ var _a;
126
+ const comparisonWeight = this.weight.value;
117
127
  (_a = weightFilteredData === null || weightFilteredData === void 0 ? void 0 : weightFilteredData.sort((a, b) => {
118
128
  var _a, _b, _c, _d, _e, _f, _g, _h;
119
129
  let aIndex = a.proxioProduct.productWeightGroupList.findIndex(weightGroup => weightGroup.item1 === comparisonWeight);
@@ -137,23 +147,30 @@ export class PnProxioFindPrice {
137
147
  }
138
148
  return 0;
139
149
  })) !== null && _a !== void 0 ? _a : [];
140
- this.filteredItems = weightFilteredData;
141
- }
142
- parseFloatFromString(text) {
143
- var _a;
144
- return parseFloat((_a = text === null || text === void 0 ? void 0 : text.replace(/[^\d\.\,]*/g, '')) !== null && _a !== void 0 ? _a : 100000);
150
+ return weightFilteredData;
145
151
  }
146
152
  resetFilters() {
153
+ var _a, _b, _c;
147
154
  this.weight = { value: 0, name: "" };
148
155
  this.sizecategory = sizeCategories.filter(x => x.value === "S")[0];
149
156
  this.weightvalue = 0;
157
+ this.countrycodevalue = (_c = (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.shipmentCountries[0]) === null || _b === void 0 ? void 0 : _b.countryCode) !== null && _c !== void 0 ? _c : this.market;
150
158
  }
151
159
  getWeights() {
152
160
  var _a;
153
161
  let marketWeightsArray = (_a = weights[this.market]) !== null && _a !== void 0 ? _a : { "S": [], "M": [], "L": [] };
154
- return marketWeightsArray[this.sizecategory.unit];
162
+ let marketWeights = marketWeightsArray[this.sizecategory.unit];
163
+ let isInternationalWeights = this.maxAbroadKg != 0 && this.countrycodevalue.toLowerCase() !== this.market.toLowerCase();
164
+ marketWeights = isInternationalWeights ? marketWeights.filter(number => (number.value / 1000) <= this.maxAbroadKg) : marketWeights;
165
+ return marketWeights;
166
+ }
167
+ handleDropdownChange(event) {
168
+ const target = event.target;
169
+ const countryCode = target.value;
170
+ this.countrycodevalue = countryCode;
155
171
  }
156
172
  render() {
173
+ var _a, _b;
157
174
  return (h("div", { class: "findprice-form" }, h("div", { class: "findprice-form-wrapper" }, h("h4", { class: "findprice__heading" }, state.i18n.sizeheading), h("div", { class: "sizecategory" }, h("table", { class: "sizeTable" }, h("img", { id: "clouds", src: clouds }), h("tr", null, h("td", null, h("img", { class: "firstCell", src: person })), h("td", null, h("img", { src: S })), this.showMedium ? h("td", null, h("img", { src: M })) : null, h("td", null, h("img", { src: L }))), h("tr", null, h("td", null), sizeCategories.map((sizeCategory) => (!this.showMedium && sizeCategory.value === "M" ? null : (h("td", null, h("pn-radio-button", { id: 'findpricecategory-' + sizeCategory.value, radioid: sizeCategory.value, value: sizeCategory.value, name: "sizecategory", checked: sizeCategory.value === this.sizecategory.value, onChange: () => {
158
175
  this.sizecategory = sizeCategories.filter(x => x.value === sizeCategory.value)[0];
159
176
  this.weight = { value: 0, name: "" };
@@ -161,7 +178,7 @@ export class PnProxioFindPrice {
161
178
  } })))))))), h("h4", { class: "findprice__heading findprice__subheading" }, state.i18n.weightheading), (this.sizecategory.value && this.getWeights()) ? (h("div", { class: "weightoption" }, h("div", { class: "weightoption-content" }, this.getWeights().map((wght) => (h("pn-choice-button", { id: 'findpriceweight-' + wght.value, choiceid: this.sizecategory.value + wght.value, name: "weight", type: "radio", value: (!this.weight.value) ? 0 : this.getWeights().findIndex((x) => x.value === this.weightvalue), checked: wght.value === this.weight.value, onChange: () => {
162
179
  this.weight = this.getWeights().filter(x => x.value === wght.value)[0];
163
180
  this.weightvalue = this.weight.value;
164
- } }, wght.name)))))) : null, h("div", { class: 'findprice__clear-all-filters', role: 'button' }, h("div", { class: 'findprice__clear-all-filters__btn', onClick: () => this.resetFilters() }, h("pn-icon", { symbol: "trash-can", color: "blue700" }), h("span", { class: 'clear-all-filters__text' }, state.i18n.clearFilterButton)))), (this.filteredItems && this.filteredItems.length > 0) ? (h("div", { class: "resultlist" }, (state.i18n.resultlistheading) ? (h("div", { class: "resultHeading" }, state.i18n.resultlistheading)) : null, this.filteredItems.map((item) => (h("div", null, h("pn-proxio-findprice-result", { activeweight: this.weight.value, item: item, language: this.language })))))) : ((this.weightvalue !== 0) ? (h("h4", { class: "resultHeading" }, state.i18n.noResultMessage)) : null)));
181
+ } }, wght.name)))))) : null, this.showInternational && ((_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.shipmentCountries) !== null && _b !== void 0 ? _b : false) ? (h("div", { class: "shipmentcountry" }, h("h4", { class: "shipmentcountry-header" }, state.i18n.countryToSendTo), h("div", { class: "shipmentcountry-select-container" }, h("svg", { class: "arrow", width: "18", height: "10", viewBox: "0 0 18 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M9.70711 9.70711C9.31658 10.0976 8.68342 10.0976 8.29289 9.70711L0.292892 1.70711C-0.0976315 1.31658 -0.0976315 0.683417 0.292892 0.292893C0.683418 -0.0976315 1.31658 -0.0976315 1.70711 0.292893L9 7.58579L16.2929 0.292893C16.6834 -0.0976315 17.3166 -0.0976315 17.7071 0.292893C18.0976 0.683417 18.0976 1.31658 17.7071 1.70711L9.70711 9.70711Z" })), h("select", { name: "shipmentCountry-select", id: "proxio-shipmentcountry", onChange: this.handleDropdownChange.bind(this) }, this.data.shipmentCountries.map((item) => (h("option", { selected: item.countryCode.toLowerCase() === this.countrycodevalue.toLowerCase(), value: item.countryCode }, item.countryName))))))) : (null), h("div", { class: 'findprice__clear-all-filters', role: 'button' }, h("div", { class: 'findprice__clear-all-filters__btn', onClick: () => this.resetFilters() }, h("pn-icon", { symbol: "trash-can", color: "blue700" }), h("span", { class: 'clear-all-filters__text' }, state.i18n.clearFilterButton)))), (this.filteredItems && this.filteredItems.length > 0) ? (h("div", { class: "resultlist" }, (state.i18n.resultlistheading) ? (h("div", { class: "resultHeading" }, state.i18n.resultlistheading)) : null, this.filteredItems.map((item) => (h("div", null, h("pn-proxio-findprice-result", { activeweight: this.weight.value, item: item, language: this.language, "selected-countrycode": this.countrycodevalue, "show-international": this.showInternational, market: this.market })))))) : ((this.weightvalue !== 0) ? (h("h4", { class: "resultHeading" }, state.i18n.noResultMessage)) : null)));
165
182
  }
166
183
  static get is() { return "pn-proxio-findprice"; }
167
184
  static get originalStyleUrls() {
@@ -248,6 +265,42 @@ export class PnProxioFindPrice {
248
265
  "reflect": false,
249
266
  "defaultValue": "false"
250
267
  },
268
+ "showInternational": {
269
+ "type": "boolean",
270
+ "mutable": false,
271
+ "complexType": {
272
+ "original": "boolean",
273
+ "resolved": "boolean",
274
+ "references": {}
275
+ },
276
+ "required": false,
277
+ "optional": false,
278
+ "docs": {
279
+ "tags": [],
280
+ "text": ""
281
+ },
282
+ "attribute": "show-international",
283
+ "reflect": false,
284
+ "defaultValue": "false"
285
+ },
286
+ "maxAbroadKg": {
287
+ "type": "number",
288
+ "mutable": false,
289
+ "complexType": {
290
+ "original": "number",
291
+ "resolved": "number",
292
+ "references": {}
293
+ },
294
+ "required": false,
295
+ "optional": false,
296
+ "docs": {
297
+ "tags": [],
298
+ "text": ""
299
+ },
300
+ "attribute": "max-abroad-kg",
301
+ "reflect": false,
302
+ "defaultValue": "0"
303
+ },
251
304
  "cache": {
252
305
  "type": "boolean",
253
306
  "mutable": false,
@@ -273,6 +326,7 @@ export class PnProxioFindPrice {
273
326
  "filteredItems": {},
274
327
  "weight": {},
275
328
  "weightvalue": {},
329
+ "countrycodevalue": {},
276
330
  "sizecategory": {},
277
331
  "data": {}
278
332
  };
@@ -290,6 +344,9 @@ export class PnProxioFindPrice {
290
344
  }, {
291
345
  "propName": "weightvalue",
292
346
  "methodName": "filterItems"
347
+ }, {
348
+ "propName": "countrycodevalue",
349
+ "methodName": "filterItems"
293
350
  }];
294
351
  }
295
352
  }
@@ -1,7 +1,7 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  export class PnProxioProductcard {
3
3
  render() {
4
- return (h(Host, null, h("div", { class: "cardcontent" }, h("div", { class: "carddetails" }, h("slot", { name: "illustrationmobile" }), h("div", { class: "heading" }, h("slot", { name: "title" }), h("slot", { name: "uppertags" })), h("slot", { name: "description" }), h("slot", { name: "information" }), h("slot", { name: "bottomtags" })), h("div", { class: "cardcalltoactions" }, h("slot", { name: "illustration" }), h("slot", { name: "pricelink" })))));
4
+ return (h(Host, null, h("div", { class: "cardcontent" }, h("div", { class: "carddetails" }, h("slot", { name: "illustrationmobile" }), h("div", { class: "heading" }, h("slot", { name: "title" }), h("slot", { name: "uppertags" })), h("slot", { name: "description" }), h("slot", { name: "information" }), h("slot", { name: "bottomtags" })), h("div", { class: "cardcalltoactions" }, h("slot", { name: "illustration" }), h("slot", { name: "pricelink" }), h("slot", { name: "insurance" })))));
5
5
  }
6
6
  static get is() { return "pn-proxio-productcard"; }
7
7
  static get originalStyleUrls() {
@@ -6,7 +6,7 @@ import { d as defineCustomElement$3 } from './pn-proxio-productcard-information2
6
6
  import { d as defineCustomElement$2 } from './pn-proxio-productcard-pricelink2.js';
7
7
  import { d as defineCustomElement$1 } from './pn-titletag2.js';
8
8
 
9
- const pnProxioFindpriceResultCss = "pn-proxio-find-price-result .test{margin:3em 0}.resultcontent{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-positive:1;flex-grow:1}";
9
+ const pnProxioFindpriceResultCss = "pn-proxio-findprice-result [slot=insurance]{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}pn-proxio-findprice-result .insurance-box{padding:0.4rem 0.8rem;border-radius:0.8rem;background-color:#8EDDF9;text-align:center;font-size:1.2rem;font-weight:400;margin-bottom:2.4rem}";
10
10
 
11
11
  const PnProxioFindPriceResult = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
12
12
  constructor() {
@@ -20,6 +20,9 @@ const PnProxioFindPriceResult = /*@__PURE__*/ proxyCustomElement(class extends H
20
20
  this.Usp3 = undefined;
21
21
  this.description = [];
22
22
  this.showMeasurement = false;
23
+ this.showInternational = false;
24
+ this.selectedCountrycode = "";
25
+ this.market = "";
23
26
  this.language = "sv";
24
27
  this.weightText = "";
25
28
  this.linkId = '';
@@ -35,13 +38,20 @@ const PnProxioFindPriceResult = /*@__PURE__*/ proxyCustomElement(class extends H
35
38
  this.shownitems = [this.item];
36
39
  }
37
40
  getPriceString(product) {
38
- var _a;
39
- if (product.productWeightGroupList) {
40
- const activeIndex = product.productWeightGroupList.findIndex((item) => item.item1 === this.activeweight);
41
- let price = product.weightAndPriceList ? (_a = product === null || product === void 0 ? void 0 : product.weightAndPriceList[activeIndex]) === null || _a === void 0 ? void 0 : _a.item2 : '';
42
- return price ? this.i18n.from + price : '';
41
+ var _a, _b;
42
+ if (!product.productWeightGroupList) {
43
+ return null;
43
44
  }
44
- return null;
45
+ const activeIndex = product.productWeightGroupList.findIndex((item) => item.item1 === this.activeweight);
46
+ let price = '';
47
+ if (this.showInternational && this.selectedCountrycode && this.selectedCountrycode !== this.market && product.weightPriceCountryList) {
48
+ let weightPriceCountryList = product.weightPriceCountryList.filter(item => item.item3.includes(this.selectedCountrycode.toUpperCase()));
49
+ price = weightPriceCountryList ? (_a = weightPriceCountryList[activeIndex]) === null || _a === void 0 ? void 0 : _a.item2 : '';
50
+ }
51
+ else {
52
+ price = product.weightAndPriceList ? (_b = product === null || product === void 0 ? void 0 : product.weightAndPriceList[activeIndex]) === null || _b === void 0 ? void 0 : _b.item2 : '';
53
+ }
54
+ return price ? this.i18n.from + price : '';
45
55
  }
46
56
  getProductLink(product, productWeightGroupList) {
47
57
  var _a;
@@ -53,11 +63,33 @@ const PnProxioFindPriceResult = /*@__PURE__*/ proxyCustomElement(class extends H
53
63
  }
54
64
  return null;
55
65
  }
66
+ getDeliveryInformation(product) {
67
+ var _a, _b;
68
+ if (!this.showInternational || !product.deliveryDateInternationalInformation) {
69
+ return product.deliveryDateInformation;
70
+ }
71
+ const internationalShipment = (_a = product === null || product === void 0 ? void 0 : product.deliveryDateInternationalInformation) === null || _a === void 0 ? void 0 : _a.find(info => info.item1.toLowerCase() === this.selectedCountrycode.toLowerCase());
72
+ if ((_b = !(internationalShipment === null || internationalShipment === void 0 ? void 0 : internationalShipment.item2)) !== null && _b !== void 0 ? _b : true) {
73
+ return product.deliveryDateInformation;
74
+ }
75
+ return internationalShipment.item2;
76
+ }
77
+ getInsuranceAmountText(product) {
78
+ var _a, _b;
79
+ if (!product.insuranceAmounts) {
80
+ return '';
81
+ }
82
+ const insuranceAmount = (_a = product === null || product === void 0 ? void 0 : product.insuranceAmounts) === null || _a === void 0 ? void 0 : _a.find(info => info.item1.toLowerCase() === this.selectedCountrycode.toLowerCase());
83
+ if ((_b = !(insuranceAmount === null || insuranceAmount === void 0 ? void 0 : insuranceAmount.item2)) !== null && _b !== void 0 ? _b : true) {
84
+ return '';
85
+ }
86
+ return insuranceAmount.item2;
87
+ }
56
88
  render() {
57
- return (h(Host, null, h("pn-proxio-productcard", null, h("pn-illustration", { slot: "illustrationmobile", illustration: this.item.proxioProduct.productIcon }), h("h2", { slot: "title" }, this.item.proxioProduct.productTitle), h("pn-proxio-productcard-description", { slot: "description", heading: this.item.proxioProduct.productPreamble, highlight: this.item.proxioProduct.deliveryDateInformation, list: this.item.proxioProduct.productDescriptionBulletListItems }), h("div", { slot: "information" }, h("pn-proxio-productcard-information", { label: this.i18n.labelMaxDimensions, information: this.item.proxioProduct.productPackageDimensionsList }), h("pn-proxio-productcard-information", { label: this.i18n.labelMaxDimensionsRoll, information: this.item.proxioProduct.productRollDimensionsList })), h("div", { slot: "bottomtags" }, this.item.proxioProduct.usp1 ?
89
+ return (h(Host, null, h("pn-proxio-productcard", null, h("pn-illustration", { slot: "illustrationmobile", illustration: this.item.proxioProduct.productIcon }), h("h2", { slot: "title" }, this.item.proxioProduct.productTitle), h("pn-proxio-productcard-description", { slot: "description", heading: this.item.proxioProduct.productPreamble, highlight: this.getDeliveryInformation(this.item.proxioProduct), list: this.item.proxioProduct.productDescriptionBulletListItems }), h("div", { slot: "information" }, h("pn-proxio-productcard-information", { label: this.i18n.labelMaxDimensions, information: this.item.proxioProduct.productPackageDimensionsList }), h("pn-proxio-productcard-information", { label: this.i18n.labelMaxDimensionsRoll, information: this.item.proxioProduct.productRollDimensionsList })), h("div", { slot: "bottomtags" }, this.item.proxioProduct.usp1 ?
58
90
  (h("pn-titletag", { color: "gray50" }, this.item.proxioProduct.usp1)) : (null), this.item.proxioProduct.usp2 ?
59
91
  (h("pn-titletag", { color: "gray50" }, this.item.proxioProduct.usp2)) : (null), this.item.proxioProduct.usp3 ?
60
- (h("pn-titletag", { color: "gray50" }, this.item.proxioProduct.usp3)) : (null)), h("pn-illustration", { slot: "illustration", illustration: this.item.proxioProduct.productIcon }), h("div", { slot: "pricelink" }, h("pn-proxio-productcard-pricelink", { price: this.getPriceString(this.item.proxioProduct), link: this.getProductLink(this.item.proxioProduct, this.item.proxioProduct.productWeightGroupList), linktext: this.item.proxioProduct.productLinkText }), this.item.relatedProxioProducts ? (this.item.relatedProxioProducts.map((product) => (h("pn-proxio-productcard-pricelink", { price: this.getPriceString(product), link: product.productLink, linktext: product.productLinkText })))) : (null)))));
92
+ (h("pn-titletag", { color: "gray50" }, this.item.proxioProduct.usp3)) : (null)), h("pn-illustration", { slot: "illustration", illustration: this.item.proxioProduct.productIcon }), h("div", { slot: "pricelink" }, h("pn-proxio-productcard-pricelink", { price: this.getPriceString(this.item.proxioProduct), link: this.getProductLink(this.item.proxioProduct, this.item.proxioProduct.productWeightGroupList), linktext: this.item.proxioProduct.productLinkText }), this.item.relatedProxioProducts ? (this.item.relatedProxioProducts.map((product) => (h("pn-proxio-productcard-pricelink", { price: this.getPriceString(product), link: product.productLink, linktext: product.productLinkText })))) : (null)), this.getInsuranceAmountText(this.item.proxioProduct) ? (h("div", { slot: "insurance" }, h("div", { class: "insurance-box" }, this.getInsuranceAmountText(this.item.proxioProduct)))) : (null))));
61
93
  }
62
94
  static get watchers() { return {
63
95
  "item": ["composeItems"],
@@ -73,6 +105,9 @@ const PnProxioFindPriceResult = /*@__PURE__*/ proxyCustomElement(class extends H
73
105
  "Usp3": [1, "usp-3"],
74
106
  "description": [16],
75
107
  "showMeasurement": [4, "show-measurement"],
108
+ "showInternational": [4, "show-international"],
109
+ "selectedCountrycode": [1, "selected-countrycode"],
110
+ "market": [1],
76
111
  "language": [1025],
77
112
  "weightText": [32],
78
113
  "linkId": [32],
@@ -31,7 +31,9 @@ const translations = {
31
31
  "labelMaxDimensionsRoll": "Rulle",
32
32
  "labelMaxDimensions": "Maxmått",
33
33
  'noResultMessage': 'Inga produkter matchar dina kriterier',
34
- 'clearFilterButton': 'Rensa alla filter'
34
+ 'clearFilterButton': 'Rensa alla filter',
35
+ 'compensateUpTo': 'Kompenserad upp till',
36
+ 'countryToSendTo': 'Vilket land vill du skicka till?'
35
37
  },
36
38
  'en': {
37
39
  'componentheading': 'Our prices and terms and conditions for domestic shipments for you as a direct paying customer',
@@ -54,7 +56,9 @@ const translations = {
54
56
  "labelMaxDimensionsRoll": "Roll",
55
57
  "labelMaxDimensions": "Maximum dimensions",
56
58
  'noResultMessage': 'No products match your criterias',
57
- 'clearFilterButton': 'Clear all filters'
59
+ 'clearFilterButton': 'Clear all filters',
60
+ 'compensateUpTo': 'Compensated up to',
61
+ 'countryToSendTo': 'To which country do you want to send?'
58
62
  },
59
63
  'da': {
60
64
  'componentheading': 'Vad vill du skicka?',
@@ -76,7 +80,9 @@ const translations = {
76
80
  "labelMaxDimensionsRoll": "Rulle",
77
81
  "labelMaxDimensions": "Maks. mål og vægt",
78
82
  'noResultMessage': 'Ingen produkter matcher dine kriterier',
79
- 'clearFilterButton': 'Ryd alle filtre'
83
+ 'clearFilterButton': 'Ryd alle filtre',
84
+ 'compensateUpTo': 'Erstattet op til',
85
+ 'countryToSendTo': 'Hvilket land vil du sende til?'
80
86
  },
81
87
  'no': {
82
88
  'componentheading': 'Vad vill du skicka?',
@@ -88,7 +94,9 @@ const translations = {
88
94
  'senddirectcta': 'Buy shipping in Send Direct',
89
95
  'stampshopcta': 'Order home stamps from the webshop',
90
96
  'noResultMessage': 'No products match your criterias',
91
- 'clearFilterButton': 'Clear all filters'
97
+ 'clearFilterButton': 'Clear all filters',
98
+ 'compensateUpTo': 'Kompensert inntil',
99
+ 'countryToSendTo': 'Hvilket land vil du sende til?'
92
100
  },
93
101
  'fi': {
94
102
  'componentheading': 'Vad vill du skicka?',
@@ -100,7 +108,9 @@ const translations = {
100
108
  'senddirectcta': 'Buy shipping in Send Direct',
101
109
  'stampshopcta': 'Order home stamps from the webshop',
102
110
  'noResultMessage': 'No products match your criterias',
103
- 'clearFilterButton': 'Clear all filters'
111
+ 'clearFilterButton': 'Clear all filters',
112
+ 'compensateUpTo': 'Korvaus asti',
113
+ 'countryToSendTo': 'Mihin maahan haluaisit lähettää?'
104
114
  }
105
115
  };
106
116
  const markets = {
@@ -202,7 +212,8 @@ const { state, onChange } = createStore({
202
212
  realPostcardMobile: '',
203
213
  ombudHeader: '',
204
214
  noResultMessage: '',
205
- clearFilterButton: ''
215
+ clearFilterButton: '',
216
+ countryToSendTo: ''
206
217
  },
207
218
  market: {
208
219
  currency: "",
@@ -221,7 +232,7 @@ const postnordPerson2Svg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTcxIiBoZW
221
232
 
222
233
  const cloudsSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjc4IiBoZWlnaHQ9IjU1IiB2aWV3Qm94PSIwIDAgMjc4IDU1IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjQ3LjM1NSA0OS42ODE1QzI0Ny42OTQgNTIuNDc5IDI0OS43MjIgNTQuNjI2MSAyNTIuMTgxIDU0LjYyNjFIMjcyLjkyNkMyNzUuNjIgNTQuNjI2MSAyNzcuNzk4IDUyLjA1MjIgMjc3Ljc5OCA0OC44Njg2VjQ4LjgwMDhDMjc3Ljc5OCA0NS42MTczIDI3NS42MiA0My4wNDMzIDI3Mi45MjYgNDMuMDQzM0gyNzAuNTM3QzI2OS42MDggMzkuMjQzOSAyNjYuODQ2IDM2LjQ3MyAyNjMuNTg1IDM2LjQ3M0gyNTkuNzE3QzI1OS4zNzMgMzEuODQxIDI1Ni4xMDEgMjguMjA5MiAyNTIuMTI0IDI4LjIwOTJDMjQ4LjE0NiAyOC4yMDkyIDI0NC44OCAzMS44NDEgMjQ0LjUzIDM2LjQ3M0gyNDIuMDk1QzIzOC4wODMgMzYuNDczIDIzNC44MTYgNDAuNjcyNiAyMzQuODE2IDQ1LjgyMDVWNDkuNjgxNUgyNDcuMzU1WiIgZmlsbD0iI0UwRjhGRiIvPgo8cGF0aCBkPSJNMTIuMDM5MSA0Ni4xMDIyQzEyLjMxNzYgNDguNTU2OSAxNC4wODY3IDUwLjQzNzMgMTYuMjQyMSA1MC40MzczSDM0LjU4MDdDMzYuOTMwNCA1MC40MzczIDM4LjgyMTYgNDguMjAyIDM4LjgyMTYgNDUuNDI0OFY0NS4zNTcxQzM4LjgyMTYgNDIuNTc5OSAzNi45MzA0IDQwLjM0NDYgMzQuNTgwNyA0MC4zNDQ2SDMyLjQ2ODRDMzEuNjY3OCAzNy4wMjA5IDI5LjIyNyAzNC41ODcyIDI2LjMyODMgMzQuNTg3MkgyMi45MTc5QzIyLjYwMDQgMzAuNTU5NyAxOS43MzI3IDI3LjQwNzEgMTYuMjQyMSAyNy40MDcxQzEyLjc1MTQgMjcuNDA3MSA5Ljg4MzcxIDMwLjU1OTcgOS41NjYyMiAzNC41ODcySDcuNDE2NThDMy44NjM0NiAzNC41ODcyIDAuOTk4MDQ3IDM4LjI0NDggMC45OTgwNDcgNDIuNzE1NFY0Ni4xMDIySDEyLjAzOTFaIiBmaWxsPSIjRTBGOEZGIi8+CjxwYXRoIGQ9Ik0xMzEuMDU2IDI2LjU4NjRDMTMxLjQ0OSAzMC4wNDIzIDEzMy45NDggMzIuNjg5NSAxMzYuOTkxIDMyLjY4OTVIMTYyLjg5MUMxNjYuMjA5IDMyLjY4OTUgMTY4Ljg4IDI5LjU0MjYgMTY4Ljg4IDI1LjYzMjhWMjUuNTM3NUMxNjguODggMjEuNjI3NyAxNjYuMjA5IDE4LjQ4MDggMTYyLjg5MSAxOC40ODA4SDE1OS45MDdDMTU4Ljc3NyAxMy44MDE1IDE1NS4zMyAxMC4zNzUzIDE1MS4yMzYgMTAuMzc1M0gxNDYuNDJDMTQ1Ljk3MSA0LjcwNTMzIDE0MS45MjEgMC4yNjcwOSAxMzYuOTkxIDAuMjY3MDlDMTMyLjA2MiAwLjI2NzA5IDEyOC4wMTIgNC43MDUzMyAxMjcuNTYzIDEwLjM3NTNIMTI0LjUyOEMxMTkuNTEgMTAuMzc1MyAxMTUuNDYzIDE1LjUyNDcgMTE1LjQ2MyAyMS44MTg0VjI2LjU4NjRIMTMxLjA1NloiIGZpbGw9IiNFMEY4RkYiLz4KPC9zdmc+Cg==';
223
234
 
224
- const pnProxioFindpriceCss = "@charset \"UTF-8\";pn-proxio-findprice .findprice-form{margin:0em auto 3em auto}pn-proxio-findprice .findprice-form-wrapper{background-color:#EFFBFF;padding:3.2rem}pn-proxio-findprice .sizeTable{border-style:none !important;border:0 !important;position:relative}pn-proxio-findprice .sizeTable>tr td{margin-bottom:1em;text-align:center;vertical-align:bottom;padding-right:1em;padding-top:1em;position:relative;z-index:1}pn-proxio-findprice .sizeTable #clouds{position:absolute;top:3rem;width:100%}pn-proxio-findprice .firstCell{margin-right:0;margin-left:auto}pn-proxio-findprice [slot=title]{margin-bottom:1rem}pn-proxio-findprice h2{text-align:center}pn-proxio-findprice .findprice__heading{text-align:center;line-height:1.1;font-weight:bold;color:#000000;font-size:3.2rem;font-weight:700}pn-proxio-findprice .findprice__subheading{font-size:2.4rem;margin-bottom:2.4rem}pn-proxio-findprice .resultHeading{text-align:center;font-size:1.5em;line-height:1.1;font-weight:bold;margin-bottom:2em}pn-proxio-findprice .findprice__clear-all-filters{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:2.4rem;color:#005D92}pn-proxio-findprice .findprice__clear-all-filters .findprice__clear-all-filters__btn{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;cursor:pointer}pn-proxio-findprice .sizecategory{margin-top:1em;margin-bottom:3rem;font-size:0.9em;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}pn-proxio-findprice .weightoption{font-size:0.9em;margin:0 auto}pn-proxio-findprice .findprice-form-wrapper .weightoption .weightoption-content{text-align:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:row;flex-direction:row}pn-proxio-findprice .findprice-form-wrapper .weightoption .weightoption-content pn-choice-button{width:7em;line-height:3.3em;font-size:0.9em;vertical-align:bottom;background:#FFFFFF;border-radius:1rem}pn-proxio-findprice .findprice-form-wrapper .weightoption .weightoption-content pn-choice-button>label{-ms-flex-line-pack:center;align-content:center;-ms-flex-pack:center;justify-content:center;color:#000000;margin-bottom:0}pn-proxio-findprice .findprice-form-wrapper .weightoption .weightoption-content pn-choice-button ::before{content:\"Max  \";font-weight:lighter;color:#5E554A}pn-proxio-findprice .resultlist{max-width:60em;margin:3.2rem auto 3.2rem auto}pn-proxio-findprice .servicePoint{text-align:center}pn-proxio-findprice .servicePoint pn-illustration{display:block;max-width:5em;max-height:5em;margin:1.5em auto 0 auto}pn-proxio-findprice .servicePoint h3{margin-top:0.8em;margin-bottom:0.9em}pn-proxio-findprice .servicePoint a{color:#005D92;text-decoration:none}pn-proxio-findprice .servicePoint a:hover{color:#0D234B;text-decoration:underline}";
235
+ const pnProxioFindpriceCss = "@charset \"UTF-8\";pn-proxio-findprice .findprice-form{margin:0em auto 3em auto}pn-proxio-findprice .findprice-form-wrapper{background-color:#EFFBFF;padding:3.2rem}pn-proxio-findprice .sizeTable{border-style:none !important;border:0 !important;position:relative}pn-proxio-findprice .sizeTable>tr td{margin-bottom:1em;text-align:center;vertical-align:bottom;padding-right:1em;padding-top:1em;position:relative;z-index:1}pn-proxio-findprice .sizeTable #clouds{position:absolute;top:3rem;width:100%}pn-proxio-findprice .firstCell{margin-right:0;margin-left:auto}pn-proxio-findprice [slot=title]{margin-bottom:1rem}pn-proxio-findprice h2{text-align:center}pn-proxio-findprice .findprice__heading{text-align:center;line-height:1.1;font-weight:bold;color:#000000;font-size:3.2rem;font-weight:700}pn-proxio-findprice .findprice__subheading{font-size:2.4rem;margin-bottom:2.4rem}pn-proxio-findprice .resultHeading{text-align:center;font-size:1.5em;line-height:1.1;font-weight:bold;margin-bottom:2em}pn-proxio-findprice .findprice__clear-all-filters{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:2.4rem;color:#005D92}pn-proxio-findprice .findprice__clear-all-filters .findprice__clear-all-filters__btn{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;cursor:pointer}pn-proxio-findprice .sizecategory{margin-top:1em;margin-bottom:3rem;font-size:0.9em;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}pn-proxio-findprice .weightoption{font-size:0.9em;margin:0 auto}pn-proxio-findprice .shipmentcountry{margin-top:3rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}pn-proxio-findprice .shipmentcountry .shipmentcountry-header{text-align:center;font-size:2rem;font-weight:700;line-height:2.2rem}pn-proxio-findprice .shipmentcountry select{color:#005D92;font-size:1.6rem;font-weight:500;border-radius:0.8rem;cursor:pointer;outline:none;position:relative;display:-ms-flexbox;display:flex;padding:0.6em 1em;z-index:0;-webkit-transition:z-index 0s 0.5s;transition:z-index 0s 0.5s;-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%}@media screen and (min-width: 500px){pn-proxio-findprice .shipmentcountry select{min-width:47.3rem;width:inherit}}pn-proxio-findprice .shipmentcountry .shipmentcountry-select-container{max-width:inherit;position:relative;margin-top:1.2rem;width:100%}@media screen and (min-width: 500px){pn-proxio-findprice .shipmentcountry .shipmentcountry-select-container{margin:0 auto;margin-top:1.2rem;width:inherit}}pn-proxio-findprice .shipmentcountry .shipmentcountry-select-container svg{position:absolute;z-index:1;right:1rem;top:1.5rem}pn-proxio-findprice .shipmentcountry .shipmentcountry-select-container svg path{fill:#005D92}pn-proxio-findprice .findprice-form-wrapper .weightoption .weightoption-content{text-align:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:row;flex-direction:row}pn-proxio-findprice .findprice-form-wrapper .weightoption .weightoption-content pn-choice-button{width:7em;line-height:3.3em;font-size:0.9em;vertical-align:bottom;background:#FFFFFF;border-radius:1rem}pn-proxio-findprice .findprice-form-wrapper .weightoption .weightoption-content pn-choice-button>label{-ms-flex-line-pack:center;align-content:center;-ms-flex-pack:center;justify-content:center;color:#000000;margin-bottom:0}pn-proxio-findprice .findprice-form-wrapper .weightoption .weightoption-content pn-choice-button ::before{content:\"Max  \";font-weight:lighter;color:#5E554A}pn-proxio-findprice .resultlist{max-width:60em;margin:3.2rem auto 3.2rem auto}pn-proxio-findprice .servicePoint{text-align:center}pn-proxio-findprice .servicePoint pn-illustration{display:block;max-width:5em;max-height:5em;margin:1.5em auto 0 auto}pn-proxio-findprice .servicePoint h3{margin-top:0.8em;margin-bottom:0.9em}pn-proxio-findprice .servicePoint a{color:#005D92;text-decoration:none}pn-proxio-findprice .servicePoint a:hover{color:#0D234B;text-decoration:underline}";
225
236
 
226
237
  const PnProxioFindPrice = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
227
238
  constructor() {
@@ -232,12 +243,15 @@ const PnProxioFindPrice = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
232
243
  this.language = "da";
233
244
  this.market = "dk";
234
245
  this.showMedium = false;
246
+ this.showInternational = false;
247
+ this.maxAbroadKg = 0;
235
248
  this.cache = false;
236
249
  this.filteredItems = [];
237
250
  this.weight = { value: 0, name: "" };
238
251
  this.weightvalue = 0;
252
+ this.countrycodevalue = "";
239
253
  this.sizecategory = { value: "", name: "", icon: "", unit: "" };
240
- this.data = { proxioProducts: [] };
254
+ this.data = { proxioProducts: [], shipmentCountries: [] };
241
255
  }
242
256
  componentWillLoad() {
243
257
  this.setInitialValues().then(() => {
@@ -255,6 +269,9 @@ const PnProxioFindPrice = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
255
269
  if (!this.endpoint) {
256
270
  this.endpoint = "";
257
271
  }
272
+ if (this.countrycodevalue === "") {
273
+ this.countrycodevalue = this.market.toLowerCase();
274
+ }
258
275
  }
259
276
  init() {
260
277
  this.setState();
@@ -282,7 +299,8 @@ const PnProxioFindPrice = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
282
299
  'mode': 'cors',
283
300
  }, false, this.onFetchData.bind(this));
284
301
  if (data) {
285
- this.data.proxioProducts = data;
302
+ this.data = data;
303
+ this.data.proxioProducts = data.proxioProducts;
286
304
  }
287
305
  this.filterItems();
288
306
  }
@@ -299,16 +317,6 @@ const PnProxioFindPrice = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
299
317
  }
300
318
  }
301
319
  filterItems() {
302
- var _a;
303
- if (!this.data || !this.data.proxioProducts) {
304
- console.log('Data has not yet been loaded, fetching again');
305
- this.fetchData().then(() => {
306
- if (!this.data) {
307
- console.log('Data could not be loaded');
308
- return;
309
- }
310
- });
311
- }
312
320
  const sizeItemData = this.data.proxioProducts.filter(item => {
313
321
  return item.proxioProduct.productWeightGroupList.some(weightGroup => {
314
322
  return weightGroup.item3.includes(this.sizecategory.value);
@@ -318,18 +326,31 @@ const PnProxioFindPrice = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
318
326
  return;
319
327
  }
320
328
  const comparisonWeight = this.weight.value;
321
- let weightFilteredData = sizeItemData.filter(item => {
329
+ let weightFilteredData = sizeItemData === null || sizeItemData === void 0 ? void 0 : sizeItemData.filter(item => {
322
330
  return item.proxioProduct.productWeightGroupList.some(weightGroup => {
323
331
  return weightGroup.item1 === comparisonWeight;
324
332
  });
325
333
  });
326
334
  if (weightFilteredData.length === 0 && this.weightvalue !== 0) {
327
- weightFilteredData = sizeItemData.filter(item => {
335
+ weightFilteredData = sizeItemData === null || sizeItemData === void 0 ? void 0 : sizeItemData.filter(item => {
328
336
  return item.proxioProduct.productWeightGroupList.some(weightGroup => {
329
337
  return weightGroup.item1 === comparisonWeight;
330
338
  });
331
339
  });
332
340
  }
341
+ if (this.showInternational && this.countrycodevalue) {
342
+ weightFilteredData = weightFilteredData === null || weightFilteredData === void 0 ? void 0 : weightFilteredData.filter(item => item.proxioProduct.weightPriceCountryList.some(countryItem => countryItem.item3.includes(this.countrycodevalue.toUpperCase())));
343
+ }
344
+ weightFilteredData = this.sortWeightItems(weightFilteredData);
345
+ this.filteredItems = weightFilteredData;
346
+ }
347
+ parseFloatFromString(text) {
348
+ var _a;
349
+ return parseFloat((_a = text === null || text === void 0 ? void 0 : text.replace(/[^\d\.\,]*/g, '')) !== null && _a !== void 0 ? _a : 100000);
350
+ }
351
+ sortWeightItems(weightFilteredData) {
352
+ var _a;
353
+ const comparisonWeight = this.weight.value;
333
354
  (_a = weightFilteredData === null || weightFilteredData === void 0 ? void 0 : weightFilteredData.sort((a, b) => {
334
355
  var _a, _b, _c, _d, _e, _f, _g, _h;
335
356
  let aIndex = a.proxioProduct.productWeightGroupList.findIndex(weightGroup => weightGroup.item1 === comparisonWeight);
@@ -353,23 +374,30 @@ const PnProxioFindPrice = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
353
374
  }
354
375
  return 0;
355
376
  })) !== null && _a !== void 0 ? _a : [];
356
- this.filteredItems = weightFilteredData;
357
- }
358
- parseFloatFromString(text) {
359
- var _a;
360
- return parseFloat((_a = text === null || text === void 0 ? void 0 : text.replace(/[^\d\.\,]*/g, '')) !== null && _a !== void 0 ? _a : 100000);
377
+ return weightFilteredData;
361
378
  }
362
379
  resetFilters() {
380
+ var _a, _b, _c;
363
381
  this.weight = { value: 0, name: "" };
364
382
  this.sizecategory = sizeCategories.filter(x => x.value === "S")[0];
365
383
  this.weightvalue = 0;
384
+ this.countrycodevalue = (_c = (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.shipmentCountries[0]) === null || _b === void 0 ? void 0 : _b.countryCode) !== null && _c !== void 0 ? _c : this.market;
366
385
  }
367
386
  getWeights() {
368
387
  var _a;
369
388
  let marketWeightsArray = (_a = weights[this.market]) !== null && _a !== void 0 ? _a : { "S": [], "M": [], "L": [] };
370
- return marketWeightsArray[this.sizecategory.unit];
389
+ let marketWeights = marketWeightsArray[this.sizecategory.unit];
390
+ let isInternationalWeights = this.maxAbroadKg != 0 && this.countrycodevalue.toLowerCase() !== this.market.toLowerCase();
391
+ marketWeights = isInternationalWeights ? marketWeights.filter(number => (number.value / 1000) <= this.maxAbroadKg) : marketWeights;
392
+ return marketWeights;
393
+ }
394
+ handleDropdownChange(event) {
395
+ const target = event.target;
396
+ const countryCode = target.value;
397
+ this.countrycodevalue = countryCode;
371
398
  }
372
399
  render() {
400
+ var _a, _b;
373
401
  return (h("div", { class: "findprice-form" }, h("div", { class: "findprice-form-wrapper" }, h("h4", { class: "findprice__heading" }, state.i18n.sizeheading), h("div", { class: "sizecategory" }, h("table", { class: "sizeTable" }, h("img", { id: "clouds", src: cloudsSvg }), h("tr", null, h("td", null, h("img", { class: "firstCell", src: postnordPerson2Svg })), h("td", null, h("img", { src: smallPackageSvg })), this.showMedium ? h("td", null, h("img", { src: mediumPackageSvg })) : null, h("td", null, h("img", { src: largePackageSvg }))), h("tr", null, h("td", null), sizeCategories.map((sizeCategory) => (!this.showMedium && sizeCategory.value === "M" ? null : (h("td", null, h("pn-radio-button", { id: 'findpricecategory-' + sizeCategory.value, radioid: sizeCategory.value, value: sizeCategory.value, name: "sizecategory", checked: sizeCategory.value === this.sizecategory.value, onChange: () => {
374
402
  this.sizecategory = sizeCategories.filter(x => x.value === sizeCategory.value)[0];
375
403
  this.weight = { value: 0, name: "" };
@@ -377,13 +405,14 @@ const PnProxioFindPrice = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
377
405
  } })))))))), h("h4", { class: "findprice__heading findprice__subheading" }, state.i18n.weightheading), (this.sizecategory.value && this.getWeights()) ? (h("div", { class: "weightoption" }, h("div", { class: "weightoption-content" }, this.getWeights().map((wght) => (h("pn-choice-button", { id: 'findpriceweight-' + wght.value, choiceid: this.sizecategory.value + wght.value, name: "weight", type: "radio", value: (!this.weight.value) ? 0 : this.getWeights().findIndex((x) => x.value === this.weightvalue), checked: wght.value === this.weight.value, onChange: () => {
378
406
  this.weight = this.getWeights().filter(x => x.value === wght.value)[0];
379
407
  this.weightvalue = this.weight.value;
380
- } }, wght.name)))))) : null, h("div", { class: 'findprice__clear-all-filters', role: 'button' }, h("div", { class: 'findprice__clear-all-filters__btn', onClick: () => this.resetFilters() }, h("pn-icon", { symbol: "trash-can", color: "blue700" }), h("span", { class: 'clear-all-filters__text' }, state.i18n.clearFilterButton)))), (this.filteredItems && this.filteredItems.length > 0) ? (h("div", { class: "resultlist" }, (state.i18n.resultlistheading) ? (h("div", { class: "resultHeading" }, state.i18n.resultlistheading)) : null, this.filteredItems.map((item) => (h("div", null, h("pn-proxio-findprice-result", { activeweight: this.weight.value, item: item, language: this.language })))))) : ((this.weightvalue !== 0) ? (h("h4", { class: "resultHeading" }, state.i18n.noResultMessage)) : null)));
408
+ } }, wght.name)))))) : null, this.showInternational && ((_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.shipmentCountries) !== null && _b !== void 0 ? _b : false) ? (h("div", { class: "shipmentcountry" }, h("h4", { class: "shipmentcountry-header" }, state.i18n.countryToSendTo), h("div", { class: "shipmentcountry-select-container" }, h("svg", { class: "arrow", width: "18", height: "10", viewBox: "0 0 18 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M9.70711 9.70711C9.31658 10.0976 8.68342 10.0976 8.29289 9.70711L0.292892 1.70711C-0.0976315 1.31658 -0.0976315 0.683417 0.292892 0.292893C0.683418 -0.0976315 1.31658 -0.0976315 1.70711 0.292893L9 7.58579L16.2929 0.292893C16.6834 -0.0976315 17.3166 -0.0976315 17.7071 0.292893C18.0976 0.683417 18.0976 1.31658 17.7071 1.70711L9.70711 9.70711Z" })), h("select", { name: "shipmentCountry-select", id: "proxio-shipmentcountry", onChange: this.handleDropdownChange.bind(this) }, this.data.shipmentCountries.map((item) => (h("option", { selected: item.countryCode.toLowerCase() === this.countrycodevalue.toLowerCase(), value: item.countryCode }, item.countryName))))))) : (null), h("div", { class: 'findprice__clear-all-filters', role: 'button' }, h("div", { class: 'findprice__clear-all-filters__btn', onClick: () => this.resetFilters() }, h("pn-icon", { symbol: "trash-can", color: "blue700" }), h("span", { class: 'clear-all-filters__text' }, state.i18n.clearFilterButton)))), (this.filteredItems && this.filteredItems.length > 0) ? (h("div", { class: "resultlist" }, (state.i18n.resultlistheading) ? (h("div", { class: "resultHeading" }, state.i18n.resultlistheading)) : null, this.filteredItems.map((item) => (h("div", null, h("pn-proxio-findprice-result", { activeweight: this.weight.value, item: item, language: this.language, "selected-countrycode": this.countrycodevalue, "show-international": this.showInternational, market: this.market })))))) : ((this.weightvalue !== 0) ? (h("h4", { class: "resultHeading" }, state.i18n.noResultMessage)) : null)));
381
409
  }
382
410
  static get watchers() { return {
383
411
  "market": ["setState"],
384
412
  "language": ["setState"],
385
413
  "sizecategory": ["filterItems"],
386
- "weightvalue": ["filterItems"]
414
+ "weightvalue": ["filterItems"],
415
+ "countrycodevalue": ["filterItems"]
387
416
  }; }
388
417
  static get style() { return pnProxioFindpriceCss; }
389
418
  }, [0, "pn-proxio-findprice", {
@@ -391,10 +420,13 @@ const PnProxioFindPrice = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
391
420
  "language": [1025],
392
421
  "market": [1025],
393
422
  "showMedium": [4, "show-medium"],
423
+ "showInternational": [4, "show-international"],
424
+ "maxAbroadKg": [2, "max-abroad-kg"],
394
425
  "cache": [4],
395
426
  "filteredItems": [32],
396
427
  "weight": [32],
397
428
  "weightvalue": [32],
429
+ "countrycodevalue": [32],
398
430
  "sizecategory": [32],
399
431
  "data": [32]
400
432
  }]);
@@ -8,7 +8,7 @@ const PnProxioProductcard = /*@__PURE__*/ proxyCustomElement(class extends HTMLE
8
8
  this.__registerHost();
9
9
  }
10
10
  render() {
11
- return (h(Host, null, h("div", { class: "cardcontent" }, h("div", { class: "carddetails" }, h("slot", { name: "illustrationmobile" }), h("div", { class: "heading" }, h("slot", { name: "title" }), h("slot", { name: "uppertags" })), h("slot", { name: "description" }), h("slot", { name: "information" }), h("slot", { name: "bottomtags" })), h("div", { class: "cardcalltoactions" }, h("slot", { name: "illustration" }), h("slot", { name: "pricelink" })))));
11
+ return (h(Host, null, h("div", { class: "cardcontent" }, h("div", { class: "carddetails" }, h("slot", { name: "illustrationmobile" }), h("div", { class: "heading" }, h("slot", { name: "title" }), h("slot", { name: "uppertags" })), h("slot", { name: "description" }), h("slot", { name: "information" }), h("slot", { name: "bottomtags" })), h("div", { class: "cardcalltoactions" }, h("slot", { name: "illustration" }), h("slot", { name: "pricelink" }), h("slot", { name: "insurance" })))));
12
12
  }
13
13
  static get style() { return pnProxioProductcardCss; }
14
14
  }, [4, "pn-proxio-productcard"]);