@postnord/pn-marketweb-components 1.0.7 → 1.0.8

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 (81) hide show
  1. package/cjs/loader.cjs.js +1 -1
  2. package/cjs/pn-choice-button_2.cjs.entry.js +2 -2
  3. package/cjs/{pn-find-service-and-price-store-7ced0e29.js → pn-find-service-and-price-store-56d8b760.js} +3 -1
  4. package/cjs/pn-find-service-and-price.cjs.entry.js +37 -20
  5. package/cjs/pn-market-web-components.cjs.js +1 -1
  6. package/cjs/pn-product-pricelist-result.cjs.entry.js +13 -2
  7. package/cjs/{pn-product-pricelist-store-ffd73312.js → pn-product-pricelist-store-e4f8503b.js} +5 -1
  8. package/cjs/pn-product-pricelist.cjs.entry.js +114 -5
  9. package/cjs/pn-product-tile_3.cjs.entry.js +4 -4
  10. package/collection/components/widgets/pn-find-service-and-price/find-service-and-price.stories.js +1 -1
  11. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-result.js +4 -4
  12. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-store.js +3 -1
  13. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-translations.js +10 -0
  14. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price.css +5 -1
  15. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price.js +25 -18
  16. package/collection/components/widgets/pn-product-pricelist/data.js +17 -15
  17. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-result.js +22 -7
  18. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-store.js +5 -1
  19. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-translations.js +20 -0
  20. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.css +50 -1
  21. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.js +76 -2
  22. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.stories.js +1 -1
  23. package/collection/components/widgets/pn-product-tile/pn-product-tile-price.css +5 -3
  24. package/collection/components/widgets/pn-product-tile/pn-product-tile-price.js +6 -11
  25. package/collection/components/widgets/pn-product-tile/pn-product-tile.css +4 -4
  26. package/collection/components/widgets/pn-product-tile/pn-product-tile.js +3 -3
  27. package/custom-elements/index.js +184 -41
  28. package/esm/loader.js +1 -1
  29. package/esm/pn-choice-button_2.entry.js +2 -2
  30. package/esm/{pn-find-service-and-price-store-0c7083bd.js → pn-find-service-and-price-store-d02cbfe1.js} +3 -1
  31. package/esm/pn-find-service-and-price.entry.js +37 -20
  32. package/esm/pn-market-web-components.js +1 -1
  33. package/esm/pn-product-pricelist-result.entry.js +13 -2
  34. package/esm/{pn-product-pricelist-store-82211c4a.js → pn-product-pricelist-store-6259b354.js} +5 -1
  35. package/esm/pn-product-pricelist.entry.js +114 -5
  36. package/esm/pn-product-tile_3.entry.js +4 -4
  37. package/esm-es5/loader.js +1 -1
  38. package/esm-es5/pn-choice-button_2.entry.js +1 -1
  39. package/esm-es5/{pn-find-service-and-price-store-0c7083bd.js → pn-find-service-and-price-store-d02cbfe1.js} +1 -1
  40. package/esm-es5/pn-find-service-and-price.entry.js +1 -1
  41. package/esm-es5/pn-market-web-components.js +1 -1
  42. package/esm-es5/pn-product-pricelist-result.entry.js +1 -1
  43. package/esm-es5/pn-product-pricelist-store-6259b354.js +1 -0
  44. package/esm-es5/pn-product-pricelist.entry.js +1 -1
  45. package/esm-es5/pn-product-tile_3.entry.js +1 -1
  46. package/package.json +1 -1
  47. package/pn-market-web-components/p-3ae134bf.system.entry.js +1 -0
  48. package/pn-market-web-components/{p-d0e7e65c.system.js → p-43bb8707.system.js} +1 -1
  49. package/pn-market-web-components/p-4b4ee8d5.system.entry.js +1 -0
  50. package/pn-market-web-components/p-57a1db89.system.entry.js +1 -0
  51. package/pn-market-web-components/p-62700d6e.system.js +1 -1
  52. package/pn-market-web-components/{p-f37be6ee.system.entry.js → p-80fd4dd9.system.entry.js} +1 -1
  53. package/pn-market-web-components/p-926fc962.js +1 -0
  54. package/pn-market-web-components/p-a04d0ba4.entry.js +1 -0
  55. package/pn-market-web-components/{p-64a6c2fb.js → p-af861bb5.js} +1 -1
  56. package/pn-market-web-components/p-b129cc27.system.js +1 -0
  57. package/pn-market-web-components/p-b4904bdb.system.entry.js +1 -0
  58. package/pn-market-web-components/p-ba704cbf.entry.js +1 -0
  59. package/pn-market-web-components/p-ba8e9dfe.entry.js +1 -0
  60. package/pn-market-web-components/{p-dc5ff15f.entry.js → p-d3590589.entry.js} +1 -1
  61. package/pn-market-web-components/p-e377410f.entry.js +1 -0
  62. package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
  63. package/types/components/widgets/pn-find-service-and-price/pn-find-service-and-price-store.d.ts +4 -0
  64. package/types/components/widgets/pn-find-service-and-price/pn-find-service-and-price-translations.d.ts +10 -0
  65. package/types/components/widgets/pn-find-service-and-price/pn-find-service-and-price-types.d.ts +2 -0
  66. package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-result.d.ts +2 -0
  67. package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-store.d.ts +8 -0
  68. package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-translations.d.ts +20 -0
  69. package/types/components/widgets/pn-product-pricelist/pn-product-pricelist-types.d.ts +9 -0
  70. package/types/components/widgets/pn-product-pricelist/pn-product-pricelist.d.ts +4 -0
  71. package/esm-es5/pn-product-pricelist-store-82211c4a.js +0 -1
  72. package/pn-market-web-components/p-1905c548.entry.js +0 -1
  73. package/pn-market-web-components/p-1fe6de09.entry.js +0 -1
  74. package/pn-market-web-components/p-23743bec.system.entry.js +0 -1
  75. package/pn-market-web-components/p-23d34c82.system.entry.js +0 -1
  76. package/pn-market-web-components/p-2fa246f1.system.js +0 -1
  77. package/pn-market-web-components/p-44f74289.system.entry.js +0 -1
  78. package/pn-market-web-components/p-4f283190.js +0 -1
  79. package/pn-market-web-components/p-c06b37c7.entry.js +0 -1
  80. package/pn-market-web-components/p-c9af6ced.entry.js +0 -1
  81. package/pn-market-web-components/p-ea9afb95.system.entry.js +0 -1
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h } from './index-52dc19ca.js';
2
2
  import { c as convertFileFromStream } from './convert-b49a0857.js';
3
- import { s as state } from './pn-find-service-and-price-store-0c7083bd.js';
3
+ import { s as state } from './pn-find-service-and-price-store-d02cbfe1.js';
4
4
  import './index-7c277874.js';
5
5
 
6
6
  const translations = {
@@ -12,6 +12,8 @@ const translations = {
12
12
  'weightlabel': 'Vikt',
13
13
  'maxweightlabel': 'Maxvikt',
14
14
  'maxmeasurementlabel': 'Maxvolym',
15
+ 'senddirectcta': 'Köp frakt via Skicka Direkt',
16
+ 'stampshopcta': 'Köp frimärken via vår webshop',
15
17
  },
16
18
  'en': {
17
19
  'componentheading': 'What do you want to send?',
@@ -21,6 +23,8 @@ const translations = {
21
23
  'weightlabel': 'Weight',
22
24
  'maxweightlabel': 'Max weight',
23
25
  'maxmeasurementlabel': 'Maximum measurement',
26
+ 'senddirectcta': 'Buy shipping in Send Direct',
27
+ 'stampshopcta': 'Order home stamps from the webshop',
24
28
  },
25
29
  'da': {
26
30
  'componentheading': 'Vad vill du skicka?',
@@ -30,6 +34,8 @@ const translations = {
30
34
  'weightlabel': 'Vægt',
31
35
  'maxweightlabel': 'Max vægt',
32
36
  'maxmeasurementlabel': 'Maks. Volumen',
37
+ 'senddirectcta': 'Buy shipping in Send Direct',
38
+ 'stampshopcta': 'Order home stamps from the webshop',
33
39
  },
34
40
  'no': {
35
41
  'componentheading': 'Vad vill du skicka?',
@@ -39,6 +45,8 @@ const translations = {
39
45
  'weightlabel': 'Vekt',
40
46
  'maxweightlabel': 'Maks vekt',
41
47
  'maxmeasurementlabel': 'Maks volum',
48
+ 'senddirectcta': 'Buy shipping in Send Direct',
49
+ 'stampshopcta': 'Order home stamps from the webshop',
42
50
  },
43
51
  'fi': {
44
52
  'componentheading': 'Vad vill du skicka?',
@@ -48,6 +56,8 @@ const translations = {
48
56
  'weightlabel': 'Paino',
49
57
  'maxweightlabel': 'Max paino',
50
58
  'maxmeasurementlabel': 'Max äänenvoimakkuus',
59
+ 'senddirectcta': 'Buy shipping in Send Direct',
60
+ 'stampshopcta': 'Order home stamps from the webshop',
51
61
  }
52
62
  };
53
63
  const markets = {
@@ -115,7 +125,7 @@ const weights = {
115
125
  ]
116
126
  };
117
127
 
118
- const pnFindServiceAndPriceCss = "pn-find-service-and-price h2,pn-find-service-and-price .heading{text-align:center;font-size:1.5em;line-height:1.1;font-weight:bold;margin-bottom:1rem}pn-find-service-and-price .postagetypes,pn-find-service-and-price .deliveryscope{text-align:center;margin-bottom:3rem}pn-find-service-and-price .weightoption{display:-ms-flexbox;display:flex;gap:1em}pn-find-service-and-price .weightoption-input{width:5em;position:relative}pn-find-service-and-price .weightoption-input input::-webkit-outer-spin-button,pn-find-service-and-price .weightoption-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}pn-find-service-and-price .weightoption-input-abbreviation{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);right:1.2em;margin-top:0.75em;font-weight:500}pn-find-service-and-price .weightoption-range{-ms-flex-positive:1;flex-grow:1;-ms-flex-item-align:end;align-self:flex-end;position:relative;top:0.5em}pn-find-service-and-price .weightoption-range input{width:calc(100% - 1.5em)}pn-find-service-and-price .weightoption-range datalist{width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:0.75em}pn-find-service-and-price .resultlist{margin:3em 0}";
128
+ const pnFindServiceAndPriceCss = "pn-find-service-and-price .findprice-form{max-width:50em;margin:0 auto}pn-find-service-and-price h2,pn-find-service-and-price .heading{text-align:center;font-size:1.5em;line-height:1.1;font-weight:bold;margin-bottom:1rem}pn-find-service-and-price .postagetypes,pn-find-service-and-price .deliveryscope{text-align:center;margin-bottom:3rem}pn-find-service-and-price .weightoption{display:-ms-flexbox;display:flex;gap:1em}pn-find-service-and-price .weightoption-input{width:5em;position:relative}pn-find-service-and-price .weightoption-input input::-webkit-outer-spin-button,pn-find-service-and-price .weightoption-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}pn-find-service-and-price .weightoption-input-abbreviation{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);right:1.2em;margin-top:1.55rem;font-weight:500}pn-find-service-and-price .weightoption-range{-ms-flex-positive:1;flex-grow:1;-ms-flex-item-align:end;align-self:flex-end;position:relative;top:0.5em}pn-find-service-and-price .weightoption-range input{width:calc(100% - 1.5em)}pn-find-service-and-price .weightoption-range datalist{width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:0.75em}pn-find-service-and-price .resultlist{margin:3em 0}";
119
129
 
120
130
  const PnfindServiceAndPrice = class {
121
131
  constructor(hostRef) {
@@ -133,20 +143,21 @@ const PnfindServiceAndPrice = class {
133
143
  componentWillLoad() {
134
144
  this.setState();
135
145
  this.getDataSource();
136
- window.setTimeout(() => {
137
- this.postagetype = postagetypes[1];
138
- this.deliveryscope = deliveryscopes[this.postagetype.value][0];
139
- this.weight = weights[this.postagetype.value][0];
140
- this.weightvalue = this.weight.value;
141
- }, 500);
142
- // this.filterItems();
146
+ // window.setTimeout(() => {
147
+ // this.postagetype = postagetypes[0];
148
+ // this.deliveryscope = deliveryscopes[this.postagetype.value][0];
149
+ // this.weight = weights[this.postagetype.value][0];
150
+ // this.weightvalue = this.weight.value;
151
+ // }, 500)
143
152
  }
144
153
  async getDataSource() {
145
- const req = await fetch(this.source);
154
+ const cacheBusting = `?cache=${Math.floor(Math.random() * (10000 - 1) + 1)}`;
155
+ const req = await fetch(this.source + cacheBusting);
146
156
  const reqbody = await req.blob();
147
157
  try {
148
158
  const convertedData = await convertFileFromStream(reqbody);
149
159
  this.sourceData = convertedData;
160
+ this.filterItems();
150
161
  }
151
162
  catch (e) {
152
163
  console.log('Unable to parse data');
@@ -180,27 +191,33 @@ const PnfindServiceAndPrice = class {
180
191
  }
181
192
  // For letters we use grams. Otherwise we use KG
182
193
  const comparisonWeight = (this.weight.abbreviation.toLocaleLowerCase() === "kg" && this.postagetype.value === 'letter') ? this.weight.value * 1000 : this.weight.value;
183
- let weightData = deliveryScopeData.filter(x => x.maxweight === comparisonWeight);
194
+ let weightFilteredData = deliveryScopeData.filter(x => x.maxweight === comparisonWeight);
184
195
  // In parcels the maxwidths don't necessarily start at 1kg so we fetch any type below the user selected value
185
- if (weightData.length === 0) {
186
- weightData = deliveryScopeData.filter(x => x.maxweight >= comparisonWeight);
187
- if (weightData.length > 0) {
196
+ if (weightFilteredData.length === 0) {
197
+ weightFilteredData = deliveryScopeData.filter(x => x.maxweight >= comparisonWeight);
198
+ if (weightFilteredData.length > 0) {
188
199
  // We reverse the result array since the map will take the last unique item instead of the first
189
- const uniqueWeightOptions = [...new Map(weightData.reverse().map(item => [item["id"], item])).values()];
200
+ const uniqueWeightOptions = [...new Map(weightFilteredData.reverse().map(item => [item["id"], item])).values()];
190
201
  if (uniqueWeightOptions.length > 0) {
191
- weightData = uniqueWeightOptions;
202
+ weightFilteredData = uniqueWeightOptions;
192
203
  }
193
204
  }
194
205
  }
195
- this.filteredItems = weightData;
206
+ console.log('weightFilteredData', weightFilteredData);
207
+ this.filteredItems = weightFilteredData;
196
208
  }
197
209
  render() {
198
- return (h("div", null, h("div", { class: "form" }, (state.i18n.componentheading) ? (h("h2", null, state.i18n.componentheading)) : null, h("div", { class: "postagetypes" }, postagetypes.map((postagetype) => (h("pn-choice-button", { choiceid: postagetype.value, value: postagetype.value, name: "postagetype", type: "radio", checked: postagetype.value === this.postagetype.value, onChange: () => {
210
+ return (h("div", null, h("div", { class: "findprice-form" }, (state.i18n.componentheading) ? (h("h2", null, state.i18n.componentheading)) : null, h("div", { class: "postagetypes" }, postagetypes.map((postagetype) => (h("pn-choice-button", { choiceid: postagetype.value, value: postagetype.value, name: "postagetype", type: "radio", checked: postagetype.value === this.postagetype.value, onChange: () => {
199
211
  this.postagetype = postagetypes.filter(x => x.value === postagetype.value)[0];
200
- this.weight = weights[this.postagetype.value][0];
212
+ this.deliveryscope = { value: "", name: "", icon: "" };
213
+ this.weight = { value: 0, name: "" };
201
214
  this.weightvalue = this.weight.value;
202
215
  } }, h("pn-illustration", { illustration: postagetype.illustration }), " ", postagetype.name)))), this.postagetype.value && deliveryscopes[this.postagetype.value] ? (h("div", null, (state.i18n.deliveryscopeheading) ? (h("div", { class: "heading" }, state.i18n.deliveryscopeheading)) : null, h("div", { class: "deliveryscope" }, deliveryscopes[this.postagetype.value].map((deliveryscope) => (h("pn-choice-button", { choiceid: this.postagetype.value + deliveryscope.value, value: deliveryscope.value, name: "deliveryscope", type: "radio", checked: deliveryscope.value === this.deliveryscope.value, onChange: () => {
203
216
  this.deliveryscope = deliveryscopes[this.postagetype.value].filter(x => x.value === deliveryscope.value)[0];
217
+ if (this.weight.value === 0) {
218
+ this.weight = weights[this.postagetype.value][0];
219
+ this.weightvalue = this.weight.value;
220
+ }
204
221
  } }, h("pn-illustration", { illustration: deliveryscope.illustration }), " ", deliveryscope.name)))))) : null, (this.postagetype.value && weights[this.postagetype.value] && this.deliveryscope.value) ? (h("div", null, (state.i18n.sizeheading) ? (h("div", { class: "heading" }, state.i18n.sizeheading)) : null, h("div", { class: "weightoption" }, h("div", { class: "weightoption-input" }, h("pn-input", { inputid: "weightvalue", name: "weightvalue", type: "number", label: state.i18n.weightlabel, value: this.weightvalue, onChange: (e) => {
205
222
  if (e && e.target && e.target.value) {
206
223
  const weightNum = parseInt(e.target.value, 10);
@@ -227,7 +244,7 @@ const PnfindServiceAndPrice = class {
227
244
  labelText = (weightindex % 5 === 0 || weightindex === 0 || weightindex === weights[this.postagetype.value].length - 1) ? weight.name : '';
228
245
  }
229
246
  return (h("option", Object.assign({ value: weightindex }, (labelText ? { label: labelText } : {}))));
230
- })))))) : null), (this.filteredItems) ? (h("div", { class: "resultlist" }, (state.i18n.resultlistheading) ? (h("div", { class: "heading" }, state.i18n.resultlistheading)) : null, this.filteredItems.map((item) => (h("div", null, h("pn-find-service-and-price-result", { item: item })))))) : null));
247
+ })))))) : null), (this.filteredItems && this.filteredItems.length > 0) ? (h("div", { class: "resultlist" }, (state.i18n.resultlistheading) ? (h("div", { class: "heading" }, state.i18n.resultlistheading)) : null, this.filteredItems.map((item) => (h("div", null, h("pn-find-service-and-price-result", { item: item })))))) : null));
231
248
  }
232
249
  static get watchers() { return {
233
250
  "market": ["setState"],
@@ -53,5 +53,5 @@ const patchCloneNodeFix = (HTMLElementPrototype) => {
53
53
  };
54
54
 
55
55
  patchBrowser().then(options => {
56
- return bootstrapLazy([["pn-marketweb-siteheader",[[4,"pn-marketweb-siteheader",{"market":[1],"language":[1],"endpoint":[1],"hideSiteSelector":[1028,"hide-site-selector"],"hideLanguageSelector":[1028,"hide-language-selector"],"hideSearch":[1028,"hide-search"],"hideLogin":[1028,"hide-login"],"i18n":[32],"gotData":[32],"fetchingData":[32],"menuItems":[32],"siteDefinition":[32],"search":[32],"siteSelector":[32],"languageSelector":[32],"loginDialog":[32],"minimizeSearch":[32]},[[9,"resize","handleResize"]]]]],["pn-find-service-and-price",[[0,"pn-find-service-and-price",{"source":[1],"language":[1025],"market":[1025],"filteredItems":[32],"postagetype":[32],"weight":[32],"weightvalue":[32],"deliveryscope":[32],"sourceData":[32]}]]],["pn-product-pricelist",[[4,"pn-product-pricelist",{"source":[1],"language":[1025],"market":[1025],"productid":[1],"filteredItems":[32],"sourceData":[32],"gotData":[32],"loading":[32]}]]],["pn-site-footer_2",[[4,"pn-site-footer",{"url":[1]}],[4,"pn-site-footer-col"]]],["pn-marketweb-sitefooter",[[0,"pn-marketweb-sitefooter",{"market":[1],"language":[1],"endpoint":[1],"siteDefinition":[32],"footerContent":[32],"i18n":[32],"gotData":[32],"fetchingData":[32]}]]],["pn-product-pricelist-result",[[0,"pn-product-pricelist-result",{"item":[16],"shownitems":[16]}]]],["pn-choice-button_2",[[0,"pn-find-service-and-price-result",{"item":[1040],"shownitems":[16],"weightText":[32]}],[4,"pn-choice-button",{"value":[520],"name":[1],"choiceid":[1],"type":[1],"disabled":[4],"checked":[4],"indeterminate":[1028]},[[0,"change","handlechange"]]]]],["pn-mainnav-link",[[4,"pn-mainnav-link",{"name":[1],"href":[1],"target":[1],"linkid":[1],"levelId":[32],"open":[32],"hasChildren":[32]}]]],["pn-language-selector_9",[[4,"pn-mainnav-level",{"level":[32],"levelId":[32],"isOpen":[32],"parentName":[32],"parentHref":[32],"parentLinkId":[32],"listCount":[32],"alignment":[32]}],[4,"pn-language-selector",{"value":[1537],"selectedLanguageName":[32],"options":[32],"i18n":[32]}],[0,"pn-language-selector-option",{"name":[1],"code":[1],"url":[1],"selected":[4],"currentLanguage":[1,"current-language"]}],[4,"pn-mainnav",{"market":[1],"language":[1],"navigationId":[1,"navigation-id"],"openMenu":[1028,"open-menu"]},[[0,"language","setLanguage"],[0,"market","setMarket"],[0,"menuLanguageChange","onLanguageChange"],[0,"setmenuopen","setOpenMenu"],[0,"openMenuLevelChange","onOpenMenuLevelChange"]]],[4,"pn-mainnav-list",{"heading":[1],"linkCount":[32]}],[0,"pn-marketweb-siteheader-login",{"endpoint":[1],"i18n":[8,"i-1-8n"],"loginDialog":[1040],"loginManager":[32],"loggedIn":[32],"toggleButtonText":[32]}],[0,"pn-marketweb-siteheader-search",{"i18n":[8,"i-1-8n"],"showOnlyLink":[1028,"show-only-link"],"hideSearch":[1028,"hide-search"],"search":[1040]}],[4,"pn-site-selector",{"buttontext":[1],"heading":[1],"language":[1],"i18n":[32]}],[0,"pn-site-selector-item",{"url":[1],"heading":[1],"description":[1],"newwindow":[4]}]]],["pn-product-tile_3",[[4,"pn-product-tile"],[0,"pn-product-tile-info",{"label":[1],"text":[1],"icon":[1]}],[0,"pn-product-tile-price",{"label":[1],"amount":[1],"currency":[1],"url":[1]}]]]], options);
56
+ return bootstrapLazy([["pn-marketweb-siteheader",[[4,"pn-marketweb-siteheader",{"market":[1],"language":[1],"endpoint":[1],"hideSiteSelector":[1028,"hide-site-selector"],"hideLanguageSelector":[1028,"hide-language-selector"],"hideSearch":[1028,"hide-search"],"hideLogin":[1028,"hide-login"],"i18n":[32],"gotData":[32],"fetchingData":[32],"menuItems":[32],"siteDefinition":[32],"search":[32],"siteSelector":[32],"languageSelector":[32],"loginDialog":[32],"minimizeSearch":[32]},[[9,"resize","handleResize"]]]]],["pn-find-service-and-price",[[0,"pn-find-service-and-price",{"source":[1],"language":[1025],"market":[1025],"filteredItems":[32],"postagetype":[32],"weight":[32],"weightvalue":[32],"deliveryscope":[32],"sourceData":[32]}]]],["pn-product-pricelist",[[4,"pn-product-pricelist",{"source":[1],"language":[1025],"market":[1025],"productid":[1],"filteredItems":[32],"sourceData":[32],"gotData":[32],"loading":[32],"postagetype":[32],"weight":[32],"weightvalue":[32]}]]],["pn-site-footer_2",[[4,"pn-site-footer",{"url":[1]}],[4,"pn-site-footer-col"]]],["pn-marketweb-sitefooter",[[0,"pn-marketweb-sitefooter",{"market":[1],"language":[1],"endpoint":[1],"siteDefinition":[32],"footerContent":[32],"i18n":[32],"gotData":[32],"fetchingData":[32]}]]],["pn-product-pricelist-result",[[0,"pn-product-pricelist-result",{"item":[1040],"shownitems":[16],"weightText":[32]}]]],["pn-choice-button_2",[[0,"pn-find-service-and-price-result",{"item":[1040],"shownitems":[16],"weightText":[32]}],[4,"pn-choice-button",{"value":[520],"name":[1],"choiceid":[1],"type":[1],"disabled":[4],"checked":[4],"indeterminate":[1028]},[[0,"change","handlechange"]]]]],["pn-mainnav-link",[[4,"pn-mainnav-link",{"name":[1],"href":[1],"target":[1],"linkid":[1],"levelId":[32],"open":[32],"hasChildren":[32]}]]],["pn-language-selector_9",[[4,"pn-mainnav-level",{"level":[32],"levelId":[32],"isOpen":[32],"parentName":[32],"parentHref":[32],"parentLinkId":[32],"listCount":[32],"alignment":[32]}],[4,"pn-language-selector",{"value":[1537],"selectedLanguageName":[32],"options":[32],"i18n":[32]}],[0,"pn-language-selector-option",{"name":[1],"code":[1],"url":[1],"selected":[4],"currentLanguage":[1,"current-language"]}],[4,"pn-mainnav",{"market":[1],"language":[1],"navigationId":[1,"navigation-id"],"openMenu":[1028,"open-menu"]},[[0,"language","setLanguage"],[0,"market","setMarket"],[0,"menuLanguageChange","onLanguageChange"],[0,"setmenuopen","setOpenMenu"],[0,"openMenuLevelChange","onOpenMenuLevelChange"]]],[4,"pn-mainnav-list",{"heading":[1],"linkCount":[32]}],[0,"pn-marketweb-siteheader-login",{"endpoint":[1],"i18n":[8,"i-1-8n"],"loginDialog":[1040],"loginManager":[32],"loggedIn":[32],"toggleButtonText":[32]}],[0,"pn-marketweb-siteheader-search",{"i18n":[8,"i-1-8n"],"showOnlyLink":[1028,"show-only-link"],"hideSearch":[1028,"hide-search"],"search":[1040]}],[4,"pn-site-selector",{"buttontext":[1],"heading":[1],"language":[1],"i18n":[32]}],[0,"pn-site-selector-item",{"url":[1],"heading":[1],"description":[1],"newwindow":[4]}]]],["pn-product-tile_3",[[4,"pn-product-tile"],[0,"pn-product-tile-info",{"label":[1],"text":[1],"icon":[1]}],[0,"pn-product-tile-price",{"label":[1],"amount":[1],"currency":[1],"url":[1]}]]]], options);
57
57
  });
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, a as Host } from './index-52dc19ca.js';
2
- import { s as state } from './pn-product-pricelist-store-82211c4a.js';
2
+ import { s as state } from './pn-product-pricelist-store-6259b354.js';
3
3
  import './index-7c277874.js';
4
4
 
5
5
  const pnProductPricelistResultCss = "";
@@ -9,8 +9,13 @@ const PnFindProductPricelistResult = class {
9
9
  registerInstance(this, hostRef);
10
10
  this.item = null;
11
11
  this.shownitems = [];
12
+ this.weightText = "";
12
13
  }
13
14
  componentWillLoad() {
15
+ this.composeItems();
16
+ }
17
+ composeItems() {
18
+ this.shownitems = [];
14
19
  if (this.item.pricestamps) {
15
20
  this.shownitems.push(Object.assign(Object.assign({}, this.item), { priceagent: null, pricesenddirect: null }));
16
21
  }
@@ -20,10 +25,16 @@ const PnFindProductPricelistResult = class {
20
25
  if (this.item.pricesenddirect) {
21
26
  this.shownitems.push(Object.assign(Object.assign({}, this.item), { pricestamps: null, priceagent: null }));
22
27
  }
28
+ // Parcels are always in KG. Letter KG must be converted from grams
29
+ this.weightText = (this.item.what === "parcel") ? this.item.maxweight + 'kg' :
30
+ (this.item.what === "letter" && this.item.maxweight > 999) ? Math.round(this.item.maxweight / 1000) + " kg" : this.item.maxweight + " g";
23
31
  }
24
32
  render() {
25
- return (h(Host, null, this.shownitems.map((item) => (h("pn-product-tile", null, h("pn-illustration", { slot: "illustration", illustration: item.illustration }), h("div", { slot: "content" }, h("div", { class: "content" }, h("h3", null, item.name), (item.description) ? (h("div", { class: "description" }, item.description)) : null, (item.info) ? (h("div", { class: "description" }, item.info)) : null)), item.maxweight ? (h("pn-product-tile-info", { label: state.i18n.maxweightlabel, text: item.maxweight + '' })) : null, item.maximummeasurements ? (h("pn-product-tile-info", { label: state.i18n.maxmeasurementlabel, text: item.maximummeasurements })) : null, item.pricestamps ? (h("pn-product-tile-price", { slot: "price", label: "With stamps", amount: item.pricestamps + '', currency: state.market.currency })) : null, item.priceagent ? (h("pn-product-tile-price", { slot: "price", label: "Service point", amount: item.priceagent + '', currency: state.market.currency, url: "https://shop.postnord.se/ebutik/default.aspx" })) : null, item.pricesenddirect ? (h("pn-product-tile-price", { slot: "price", label: "Send direct", amount: item.pricesenddirect + '', currency: state.market.currency, url: "https://portal.postnord.com/skickadirekt/" })) : null, item.info ? (h("small", { slot: "note" }, h("p", null, item.note))) : null)))));
33
+ return (h(Host, null, this.shownitems.map((item) => (h("pn-product-tile", null, h("pn-illustration", { slot: "illustration", illustration: item.illustration }), h("div", { slot: "content" }, h("div", { class: "content" }, h("h3", null, item.name), (item.description) ? (h("div", { class: "description" }, item.description)) : null, (item.info) ? (h("div", { class: "description" }, item.info)) : null)), item.maxweight ? (h("pn-product-tile-info", { label: state.i18n.maxweightlabel, text: this.weightText })) : null, item.maximummeasurements ? (h("pn-product-tile-info", { label: state.i18n.maxmeasurementlabel, text: item.maximummeasurements })) : null, item.pricestamps ? (h("pn-product-tile-price", { slot: "price", label: state.i18n.stampshopcta, amount: item.pricestamps + '', currency: state.market.currency })) : null, item.priceagent ? (h("pn-product-tile-price", { slot: "price", label: "", amount: item.priceagent + '', currency: state.market.currency, url: "https://shop.postnord.se/ebutik/default.aspx" })) : null, item.pricesenddirect ? (h("pn-product-tile-price", { slot: "price", label: state.i18n.senddirectcta, amount: item.pricesenddirect + '', currency: state.market.currency, url: "https://portal.postnord.com/skickadirekt/" })) : null, item.note ? (h("small", { slot: "note" }, h("p", null, item.note))) : null)))));
26
34
  }
35
+ static get watchers() { return {
36
+ "item": ["composeItems"]
37
+ }; }
27
38
  };
28
39
  PnFindProductPricelistResult.style = pnProductPricelistResultCss;
29
40
 
@@ -4,7 +4,11 @@ import { c as createStore } from './index-7c277874.js';
4
4
  const { state, onChange } = createStore({
5
5
  i18n: {
6
6
  maxweightlabel: '',
7
- maxmeasurementlabel: ''
7
+ weightlabel: '',
8
+ maxmeasurementlabel: '',
9
+ sizeheading: '',
10
+ senddirectcta: '',
11
+ stampshopcta: '',
8
12
  },
9
13
  market: {
10
14
  currency: ""
@@ -1,28 +1,48 @@
1
1
  import { r as registerInstance, h, a as Host } from './index-52dc19ca.js';
2
2
  import { c as convertFileFromStream } from './convert-b49a0857.js';
3
- import { s as state } from './pn-product-pricelist-store-82211c4a.js';
3
+ import { s as state } from './pn-product-pricelist-store-6259b354.js';
4
4
  import './index-7c277874.js';
5
5
 
6
6
  const translations = {
7
7
  'sv': {
8
8
  'maxweightlabel': 'Maxvikt',
9
+ 'weightlabel': 'Vikt',
9
10
  'maxmeasurementlabel': 'Maxvolym',
11
+ 'sizeheading': 'Hur mycket väger det?',
12
+ 'senddirectcta': 'Köp frakt via Skicka Direkt',
13
+ 'stampshopcta': 'Köp frimärken via vår webshop',
10
14
  },
11
15
  'en': {
12
16
  'maxweightlabel': 'Max weight',
17
+ 'weightlabel': 'Weight',
13
18
  'maxmeasurementlabel': 'Maximum measurement',
19
+ 'sizeheading': 'How much does it weigh?',
20
+ 'senddirectcta': 'Buy shipping in Send Direct',
21
+ 'stampshopcta': 'Order home stamps from the webshop',
14
22
  },
15
23
  'da': {
16
24
  'maxweightlabel': 'Max vægt',
25
+ 'weightlabel': 'Vægt',
17
26
  'maxmeasurementlabel': 'Maks. Volumen',
27
+ 'sizeheading': 'How much does it weigh?',
28
+ 'senddirectcta': 'Buy shipping in Send Direct',
29
+ 'stampshopcta': 'Order home stamps from the webshop',
18
30
  },
19
31
  'no': {
20
32
  'maxweightlabel': 'Maks vekt',
33
+ 'weightlabel': 'Vekt',
21
34
  'maxmeasurementlabel': 'Maks volum',
35
+ 'sizeheading': 'How much does it weigh?',
36
+ 'senddirectcta': 'Buy shipping in Send Direct',
37
+ 'stampshopcta': 'Order home stamps from the webshop',
22
38
  },
23
39
  'fi': {
24
40
  'maxweightlabel': 'Max paino',
41
+ 'weightlabel': 'Piano',
25
42
  'maxmeasurementlabel': 'Max äänenvoimakkuus',
43
+ 'sizeheading': 'How much does it weigh?',
44
+ 'senddirectcta': 'Buy shipping in Send Direct',
45
+ 'stampshopcta': 'Order home stamps from the webshop',
26
46
  }
27
47
  };
28
48
  const markets = {
@@ -40,7 +60,39 @@ const markets = {
40
60
  }
41
61
  };
42
62
 
43
- const pnProductPricelistCss = "pn-product-pricelist pn-spinner{margin:1em auto}pn-product-pricelist .resultlist:not([data-list-count=\"0\"]){margin-top:1.5em}";
63
+ const weights = {
64
+ "letter": [
65
+ { name: "50g", abbreviation: 'g', value: 50 },
66
+ { name: "100g", abbreviation: 'g', value: 100 },
67
+ { name: "250g", abbreviation: 'g', value: 250 },
68
+ { name: "500g", abbreviation: 'g', value: 500 },
69
+ { name: "1kg", abbreviation: 'kg', value: 1 },
70
+ { name: "2kg", abbreviation: 'kg', value: 2 },
71
+ ],
72
+ "parcel": [
73
+ { name: "1kg", abbreviation: 'kg', value: 1 },
74
+ { name: "2kg", abbreviation: 'kg', value: 2 },
75
+ { name: "3kg", abbreviation: 'kg', value: 3 },
76
+ { name: "4kg", abbreviation: 'kg', value: 4 },
77
+ { name: "5kg", abbreviation: 'kg', value: 5 },
78
+ { name: "6kg", abbreviation: 'kg', value: 6 },
79
+ { name: "7Kg", abbreviation: 'kg', value: 7 },
80
+ { name: "8kg", abbreviation: 'kg', value: 8 },
81
+ { name: "9kg", abbreviation: 'kg', value: 9 },
82
+ { name: "10kg", abbreviation: 'kg', value: 10 },
83
+ { name: "11kg", abbreviation: 'kg', value: 11 },
84
+ { name: "12kg", abbreviation: 'kg', value: 12 },
85
+ { name: "13kg", abbreviation: 'kg', value: 13 },
86
+ { name: "14kg", abbreviation: 'kg', value: 14 },
87
+ { name: "15kg", abbreviation: 'kg', value: 15 },
88
+ { name: "16kg", abbreviation: 'kg', value: 16 },
89
+ { name: "17kg", abbreviation: 'kg', value: 17 },
90
+ { name: "18kg", abbreviation: 'kg', value: 18 },
91
+ { name: "20kg", abbreviation: 'kg', value: 20 },
92
+ ]
93
+ };
94
+
95
+ const pnProductPricelistCss = "pn-product-pricelist pn-spinner{margin:1em auto}pn-product-pricelist h2,pn-product-pricelist .heading{text-align:center;font-size:1.5em;line-height:1.1;font-weight:bold;margin-bottom:1rem}pn-product-pricelist .content,pn-product-pricelist .weightselection{max-width:50em;margin:0 auto 1em}pn-product-pricelist .weightoption{display:-ms-flexbox;display:flex;gap:1em}pn-product-pricelist .weightoption-input{width:5em;position:relative}pn-product-pricelist .weightoption-input input::-webkit-outer-spin-button,pn-product-pricelist .weightoption-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}pn-product-pricelist .weightoption-input-abbreviation{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);right:1.2em;margin-top:1.55rem;font-weight:500}pn-product-pricelist .weightoption-range{-ms-flex-positive:1;flex-grow:1;-ms-flex-item-align:end;align-self:flex-end;position:relative;top:0.5em}pn-product-pricelist .weightoption-range input{width:calc(100% - 1.5em)}pn-product-pricelist .weightoption-range datalist{width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:0.75em}pn-product-pricelist .resultlist:not([data-list-count=\"0\"]){margin-top:2em}";
44
96
 
45
97
  const PnFindProductPricelist = class {
46
98
  constructor(hostRef) {
@@ -53,6 +105,9 @@ const PnFindProductPricelist = class {
53
105
  this.sourceData = { types: [], data: [] };
54
106
  this.gotData = false;
55
107
  this.loading = false;
108
+ this.postagetype = { value: "" };
109
+ this.weight = { value: 0, name: "" };
110
+ this.weightvalue = 0;
56
111
  }
57
112
  componentWillLoad() {
58
113
  this.setState();
@@ -90,15 +145,69 @@ const PnFindProductPricelist = class {
90
145
  return;
91
146
  }
92
147
  this.loading = false;
93
- this.filteredItems = this.sourceData.data.filter(x => x.id === this.productid);
148
+ const productIdItems = this.sourceData.data.filter(x => x.id === this.productid);
149
+ if (productIdItems.length === 0) {
150
+ return;
151
+ }
152
+ this.postagetype.value = productIdItems[0].what;
153
+ if (!weights[this.postagetype.value] || weights[this.postagetype.value].length === 0) {
154
+ return;
155
+ }
156
+ if (this.weightvalue === 0) {
157
+ this.weight = weights[this.postagetype.value][0];
158
+ this.weightvalue = this.weight.value;
159
+ }
160
+ // For letters we use grams. Otherwise we use KG
161
+ const comparisonWeight = (this.weight.abbreviation.toLocaleLowerCase() === "kg" && this.postagetype.value === 'letter') ? this.weight.value * 1000 : this.weight.value;
162
+ let weightFilteredData = productIdItems.filter(x => x.maxweight === comparisonWeight);
163
+ // In parcels the maxwidths don't necessarily start at 1kg so we fetch any type below the user selected value
164
+ if (weightFilteredData.length === 0) {
165
+ weightFilteredData = productIdItems.filter(x => x.maxweight >= comparisonWeight);
166
+ if (weightFilteredData.length > 0) {
167
+ // We reverse the result array since the map will take the last unique item instead of the first
168
+ const uniqueWeightOptions = [...new Map(weightFilteredData.reverse().map(item => [item["id"], item])).values()];
169
+ if (uniqueWeightOptions.length > 0) {
170
+ weightFilteredData = uniqueWeightOptions;
171
+ }
172
+ }
173
+ }
174
+ this.filteredItems = weightFilteredData;
94
175
  this.gotData = this.filteredItems.length > 0;
95
176
  }
96
177
  render() {
97
- return (h(Host, null, h("div", { class: "content" }, h("slot", null)), this.loading ? (h("pn-spinner", null)) : null, h("div", { class: "resultlist", "data-list-count": this.filteredItems.length }, this.filteredItems.map((item) => (h("div", null, h("pn-product-pricelist-result", { item: item })))))));
178
+ return (h(Host, null, h("div", { class: "content" }, h("slot", null)), this.loading ? (h("pn-spinner", null)) : null, (this.postagetype.value && weights[this.postagetype.value]) ? (h("div", { class: "weightselection" }, (state.i18n.sizeheading) ? (h("div", { class: "heading" }, state.i18n.sizeheading)) : null, h("div", { class: "weightoption" }, h("div", { class: "weightoption-input" }, h("pn-input", { inputid: "weightvalue", name: "weightvalue", type: "number", label: state.i18n.weightlabel, value: this.weightvalue, onChange: (e) => {
179
+ if (e && e.target && e.target.value) {
180
+ const weightNum = parseInt(e.target.value, 10);
181
+ if (!isNaN(weightNum)) {
182
+ let matchingWeights = weights[this.postagetype.value].filter((x) => {
183
+ let weightInGrams = (x.abbreviation === "kg") ? x.value * 1000 : x.value;
184
+ return weightInGrams >= weightNum;
185
+ });
186
+ if (matchingWeights && matchingWeights.length > 0) {
187
+ this.weight = matchingWeights[0];
188
+ this.weightvalue = this.weight.value;
189
+ }
190
+ }
191
+ }
192
+ } }), h("span", { class: "weightoption-input-abbreviation" }, this.weight.abbreviation)), h("div", { class: "weightoption-range" }, h("input", { type: "range", id: "weightrange", name: "weightrange", list: "weightlist", value: (!this.weight.value) ? 0 : weights[this.postagetype.value].findIndex((x) => x.value === this.weightvalue), onChange: (e) => {
193
+ const value = e.target.value;
194
+ this.weight = weights[this.postagetype.value][value];
195
+ this.weightvalue = this.weight.value;
196
+ }, min: "0",
197
+ // max={ weights[this.postagetype.value][weights[this.postagetype.value].length - 1].value }
198
+ max: weights[this.postagetype.value].length - 1 }), h("datalist", { id: "weightlist" }, weights[this.postagetype.value].map((weight, weightindex) => {
199
+ let labelText = weight.name;
200
+ if (weights[this.postagetype.value].length > 6) {
201
+ labelText = (weightindex % 5 === 0 || weightindex === 0 || weightindex === weights[this.postagetype.value].length - 1) ? weight.name : '';
202
+ }
203
+ return (h("option", Object.assign({ value: weightindex }, (labelText ? { label: labelText } : {}))));
204
+ })))))) : null, h("div", { class: "resultlist", "data-list-count": this.filteredItems.length }, this.filteredItems.map((item) => (h("div", null, h("pn-product-pricelist-result", { item: item })))))));
98
205
  }
99
206
  static get watchers() { return {
100
207
  "market": ["setState"],
101
- "language": ["setState"]
208
+ "language": ["setState"],
209
+ "postagetype": ["filterItems"],
210
+ "weightvalue": ["filterItems"]
102
211
  }; }
103
212
  };
104
213
  PnFindProductPricelist.style = pnProductPricelistCss;
@@ -1,13 +1,13 @@
1
1
  import { r as registerInstance, h, a as Host } from './index-52dc19ca.js';
2
2
 
3
- const pnProductTileCss = "pn-product-tile{margin-bottom:1em;border:0.1rem solid #D3CECB;outline:none;background:white;-webkit-box-shadow:0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13);box-shadow:0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13);display:-ms-flexbox;display:flex;padding:1.5em;word-break:break-word;text-decoration:none;border-radius:0.8rem}pn-product-tile [slot=content] h3{display:-ms-flexbox;display:flex;width:100%;-ms-flex-pack:justify;justify-content:space-between;margin-bottom:0.5em}pn-product-tile>pn-illustration{min-width:8rem;width:8rem;height:8rem;margin-right:3rem;-ms-flex-item-align:center;align-self:center}pn-product-tile .tilecontent{-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center}pn-product-tile .details{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;width:100%;-ms-flex-align:center;align-items:center}pn-product-tile .info{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-positive:1;flex-grow:1;max-width:calc((100% / 3) * 2);-ms-flex-flow:wrap;flex-flow:wrap}pn-product-tile .info>*{min-width:6em;margin:0.2em 1em 0.2em 0}";
3
+ const pnProductTileCss = "pn-product-tile{margin-bottom:1em;border:0.1rem solid #D3CECB;outline:none;background:white;-webkit-box-shadow:0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13);box-shadow:0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13);display:-ms-flexbox;display:flex;padding:1.5em;word-break:break-word;text-decoration:none;border-radius:0.8rem}pn-product-tile [slot=content] h3{display:-ms-flexbox;display:flex;width:100%;-ms-flex-pack:justify;justify-content:space-between;margin-bottom:0.5em}pn-product-tile>pn-illustration{min-width:8rem;width:8rem;height:8rem;margin-right:3rem;-ms-flex-item-align:center;align-self:center}pn-product-tile .tilecontent{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center;-ms-flex-positive:1;flex-grow:1}pn-product-tile .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;width:100%}pn-product-tile .info{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-positive:1;flex-grow:1;max-width:calc((100% / 3) * 2);-ms-flex-flow:wrap;flex-flow:wrap}pn-product-tile .info>*{min-width:6em;margin:0.2em 1em 0.2em 0}";
4
4
 
5
5
  const PnProductTile = class {
6
6
  constructor(hostRef) {
7
7
  registerInstance(this, hostRef);
8
8
  }
9
9
  render() {
10
- return (h(Host, null, h("slot", { name: "illustration" }), h("div", { class: "tilecontent" }, h("slot", { name: "content" }), h("div", { class: "details" }, h("div", { class: "info" }, h("slot", null)), h("slot", { name: "price" })), h("slot", { name: "note" }))));
10
+ return (h(Host, null, h("slot", { name: "illustration" }), h("div", { class: "tilecontent" }, h("div", { class: "details" }, h("slot", { name: "content" }), h("div", { class: "info" }, h("slot", null)), h("slot", { name: "note" })), h("slot", { name: "price" }))));
11
11
  }
12
12
  };
13
13
  PnProductTile.style = pnProductTileCss;
@@ -25,7 +25,7 @@ const PnProductTileInfo = class {
25
25
  h("pn-icon", { symbol: "align-center", small: "false", color: "black" });
26
26
  PnProductTileInfo.style = pnProductTileInfoCss;
27
27
 
28
- const pnProductTilePriceCss = "pn-product-tile-price span:last-child{display:inline-block;margin-left:0.2em}pn-product-tile-price+pn-product-tile-price{margin-left:1.5em}pn-product-tile-price small{display:-ms-flexbox;display:flex}pn-product-tile-price pn-icon{display:inline-block;-ms-flex-item-align:center;align-self:center}pn-product-tile-price a{text-decoration:none;color:#005D92}pn-product-tile-price a h3{text-decoration:underline}";
28
+ const pnProductTilePriceCss = "pn-product-tile-price{margin-top:1em;white-space:nowrap;text-align:right}pn-product-tile-price span:last-child{display:inline-block;margin-left:0.2em}pn-product-tile-price+pn-product-tile-price{margin-left:1.5em}pn-product-tile-price pn-icon{display:inline-block;-ms-flex-item-align:center;align-self:center}pn-product-tile-price a{text-decoration:none;color:#005D92}pn-product-tile-price a h3{text-decoration:underline}";
29
29
 
30
30
  const PnProductTilePrice = class {
31
31
  constructor(hostRef) {
@@ -35,7 +35,7 @@ const PnProductTilePrice = class {
35
35
  if (!this.amount) {
36
36
  return;
37
37
  }
38
- return (this.url) ? (h(Host, null, h("a", { href: this.url }, (this.label) ? (h("p", null, h("small", null, this.label, h("pn-icon", { symbol: "open-in-new", small: "true", color: "blue700" })))) : null, h("h3", null, (this.amount) ? (h("span", { class: "pn-2xl" }, this.amount)) : null, (this.currency) ? (h("span", null, this.currency)) : null)))) : (h(Host, null, (this.label) ? (h("p", null, h("small", null, this.label))) : null, h("h3", null, (this.amount) ? (h("span", { class: "pn-2xl" }, this.amount)) : null, (this.currency) ? (h("span", null, this.currency)) : null)));
38
+ return (this.url) ? (h(Host, null, h("h3", null, (this.amount) ? (h("span", { class: "pn-2xl" }, this.amount)) : null, (this.currency) ? (h("span", { class: "pn-2xl" }, this.currency)) : null), (this.label) ? (h("a", { href: this.url }, h("pn-button", { small: "true", icon: "arrow-right" }, this.label))) : null)) : (h(Host, null, h("h3", null, (this.amount) ? (h("span", { class: "pn-2xl" }, this.amount)) : null, (this.currency) ? (h("span", { class: "pn-2xl" }, this.currency)) : null)));
39
39
  }
40
40
  };
41
41
  PnProductTilePrice.style = pnProductTilePriceCss;
package/esm-es5/loader.js CHANGED
@@ -1 +1 @@
1
- import{p as promiseResolve,b as bootstrapLazy}from"./index-52dc19ca.js";var patchEsm=function(){return promiseResolve()};var defineCustomElements=function(e,n){if(typeof window==="undefined")return Promise.resolve();return patchEsm().then((function(){return bootstrapLazy([["pn-marketweb-siteheader",[[4,"pn-marketweb-siteheader",{market:[1],language:[1],endpoint:[1],hideSiteSelector:[1028,"hide-site-selector"],hideLanguageSelector:[1028,"hide-language-selector"],hideSearch:[1028,"hide-search"],hideLogin:[1028,"hide-login"],i18n:[32],gotData:[32],fetchingData:[32],menuItems:[32],siteDefinition:[32],search:[32],siteSelector:[32],languageSelector:[32],loginDialog:[32],minimizeSearch:[32]},[[9,"resize","handleResize"]]]]],["pn-find-service-and-price",[[0,"pn-find-service-and-price",{source:[1],language:[1025],market:[1025],filteredItems:[32],postagetype:[32],weight:[32],weightvalue:[32],deliveryscope:[32],sourceData:[32]}]]],["pn-product-pricelist",[[4,"pn-product-pricelist",{source:[1],language:[1025],market:[1025],productid:[1],filteredItems:[32],sourceData:[32],gotData:[32],loading:[32]}]]],["pn-site-footer_2",[[4,"pn-site-footer",{url:[1]}],[4,"pn-site-footer-col"]]],["pn-marketweb-sitefooter",[[0,"pn-marketweb-sitefooter",{market:[1],language:[1],endpoint:[1],siteDefinition:[32],footerContent:[32],i18n:[32],gotData:[32],fetchingData:[32]}]]],["pn-product-pricelist-result",[[0,"pn-product-pricelist-result",{item:[16],shownitems:[16]}]]],["pn-choice-button_2",[[0,"pn-find-service-and-price-result",{item:[1040],shownitems:[16],weightText:[32]}],[4,"pn-choice-button",{value:[520],name:[1],choiceid:[1],type:[1],disabled:[4],checked:[4],indeterminate:[1028]},[[0,"change","handlechange"]]]]],["pn-mainnav-link",[[4,"pn-mainnav-link",{name:[1],href:[1],target:[1],linkid:[1],levelId:[32],open:[32],hasChildren:[32]}]]],["pn-language-selector_9",[[4,"pn-mainnav-level",{level:[32],levelId:[32],isOpen:[32],parentName:[32],parentHref:[32],parentLinkId:[32],listCount:[32],alignment:[32]}],[4,"pn-language-selector",{value:[1537],selectedLanguageName:[32],options:[32],i18n:[32]}],[0,"pn-language-selector-option",{name:[1],code:[1],url:[1],selected:[4],currentLanguage:[1,"current-language"]}],[4,"pn-mainnav",{market:[1],language:[1],navigationId:[1,"navigation-id"],openMenu:[1028,"open-menu"]},[[0,"language","setLanguage"],[0,"market","setMarket"],[0,"menuLanguageChange","onLanguageChange"],[0,"setmenuopen","setOpenMenu"],[0,"openMenuLevelChange","onOpenMenuLevelChange"]]],[4,"pn-mainnav-list",{heading:[1],linkCount:[32]}],[0,"pn-marketweb-siteheader-login",{endpoint:[1],i18n:[8,"i-1-8n"],loginDialog:[1040],loginManager:[32],loggedIn:[32],toggleButtonText:[32]}],[0,"pn-marketweb-siteheader-search",{i18n:[8,"i-1-8n"],showOnlyLink:[1028,"show-only-link"],hideSearch:[1028,"hide-search"],search:[1040]}],[4,"pn-site-selector",{buttontext:[1],heading:[1],language:[1],i18n:[32]}],[0,"pn-site-selector-item",{url:[1],heading:[1],description:[1],newwindow:[4]}]]],["pn-product-tile_3",[[4,"pn-product-tile"],[0,"pn-product-tile-info",{label:[1],text:[1],icon:[1]}],[0,"pn-product-tile-price",{label:[1],amount:[1],currency:[1],url:[1]}]]]],n)}))};export{defineCustomElements};
1
+ import{p as promiseResolve,b as bootstrapLazy}from"./index-52dc19ca.js";var patchEsm=function(){return promiseResolve()};var defineCustomElements=function(e,n){if(typeof window==="undefined")return Promise.resolve();return patchEsm().then((function(){return bootstrapLazy([["pn-marketweb-siteheader",[[4,"pn-marketweb-siteheader",{market:[1],language:[1],endpoint:[1],hideSiteSelector:[1028,"hide-site-selector"],hideLanguageSelector:[1028,"hide-language-selector"],hideSearch:[1028,"hide-search"],hideLogin:[1028,"hide-login"],i18n:[32],gotData:[32],fetchingData:[32],menuItems:[32],siteDefinition:[32],search:[32],siteSelector:[32],languageSelector:[32],loginDialog:[32],minimizeSearch:[32]},[[9,"resize","handleResize"]]]]],["pn-find-service-and-price",[[0,"pn-find-service-and-price",{source:[1],language:[1025],market:[1025],filteredItems:[32],postagetype:[32],weight:[32],weightvalue:[32],deliveryscope:[32],sourceData:[32]}]]],["pn-product-pricelist",[[4,"pn-product-pricelist",{source:[1],language:[1025],market:[1025],productid:[1],filteredItems:[32],sourceData:[32],gotData:[32],loading:[32],postagetype:[32],weight:[32],weightvalue:[32]}]]],["pn-site-footer_2",[[4,"pn-site-footer",{url:[1]}],[4,"pn-site-footer-col"]]],["pn-marketweb-sitefooter",[[0,"pn-marketweb-sitefooter",{market:[1],language:[1],endpoint:[1],siteDefinition:[32],footerContent:[32],i18n:[32],gotData:[32],fetchingData:[32]}]]],["pn-product-pricelist-result",[[0,"pn-product-pricelist-result",{item:[1040],shownitems:[16],weightText:[32]}]]],["pn-choice-button_2",[[0,"pn-find-service-and-price-result",{item:[1040],shownitems:[16],weightText:[32]}],[4,"pn-choice-button",{value:[520],name:[1],choiceid:[1],type:[1],disabled:[4],checked:[4],indeterminate:[1028]},[[0,"change","handlechange"]]]]],["pn-mainnav-link",[[4,"pn-mainnav-link",{name:[1],href:[1],target:[1],linkid:[1],levelId:[32],open:[32],hasChildren:[32]}]]],["pn-language-selector_9",[[4,"pn-mainnav-level",{level:[32],levelId:[32],isOpen:[32],parentName:[32],parentHref:[32],parentLinkId:[32],listCount:[32],alignment:[32]}],[4,"pn-language-selector",{value:[1537],selectedLanguageName:[32],options:[32],i18n:[32]}],[0,"pn-language-selector-option",{name:[1],code:[1],url:[1],selected:[4],currentLanguage:[1,"current-language"]}],[4,"pn-mainnav",{market:[1],language:[1],navigationId:[1,"navigation-id"],openMenu:[1028,"open-menu"]},[[0,"language","setLanguage"],[0,"market","setMarket"],[0,"menuLanguageChange","onLanguageChange"],[0,"setmenuopen","setOpenMenu"],[0,"openMenuLevelChange","onOpenMenuLevelChange"]]],[4,"pn-mainnav-list",{heading:[1],linkCount:[32]}],[0,"pn-marketweb-siteheader-login",{endpoint:[1],i18n:[8,"i-1-8n"],loginDialog:[1040],loginManager:[32],loggedIn:[32],toggleButtonText:[32]}],[0,"pn-marketweb-siteheader-search",{i18n:[8,"i-1-8n"],showOnlyLink:[1028,"show-only-link"],hideSearch:[1028,"hide-search"],search:[1040]}],[4,"pn-site-selector",{buttontext:[1],heading:[1],language:[1],i18n:[32]}],[0,"pn-site-selector-item",{url:[1],heading:[1],description:[1],newwindow:[4]}]]],["pn-product-tile_3",[[4,"pn-product-tile"],[0,"pn-product-tile-info",{label:[1],text:[1],icon:[1]}],[0,"pn-product-tile-price",{label:[1],amount:[1],currency:[1],url:[1]}]]]],n)}))};export{defineCustomElements};
@@ -1 +1 @@
1
- import{r as registerInstance,h,a as Host,c as getElement}from"./index-52dc19ca.js";import{s as state}from"./pn-find-service-and-price-store-0c7083bd.js";import"./index-7c277874.js";var pnChoiceButtonCss="pn-choice-button{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:none;display:inline-block;background:#fff;position:relative;margin:0.2em 0.4em}pn-choice-button input{opacity:0;position:absolute;top:0;left:0;pointer-events:none;margin:0;width:100%;height:100%}pn-choice-button label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0.4rem 0.8rem;border:0.1rem solid #D3CECB;color:#005D92;font-weight:500;border-radius:0.8rem;text-align:center;cursor:pointer;-webkit-transition:background 0.2s, -webkit-box-shadow 0.1s;transition:background 0.2s, -webkit-box-shadow 0.1s;transition:box-shadow 0.1s, background 0.2s;transition:box-shadow 0.1s, background 0.2s, -webkit-box-shadow 0.1s}pn-choice-button label pn-illustration{display:inline-block;width:3rem;height:3rem;margin-right:0.9rem}pn-choice-button>input:checked+label.pn-choice-button{background:#E0F8FF;color:#005D92;border-color:#005D92;-webkit-box-shadow:0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13);box-shadow:0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13)}pn-choice-button>input:indeterminate+label.pn-choice-button{background:#FFFFFF;color:#005D92}pn-choice-button>input:hover+label.pn-choice-button{background:#E0F8FF}pn-choice-button>input:focus+label.pn-choice-button,pn-choice-button>input:active+label.pn-choice-button{-webkit-box-shadow:0 0 0 0.2rem #fff, 0 0 0 0.4rem #005D92;box-shadow:0 0 0 0.2rem #fff, 0 0 0 0.4rem #005D92}pn-choice-button>input:active+label.pn-choice-button{background:#8EDDF9}pn-choice-button>input:disabled+label.pn-choice-button{background-color:#D3CECB}pn-choice-button>input:checked+label.pn-choice-button:hover{background:#8EDDF9}pn-choice-button>input:checked+label.pn-choice-button:active{background:#8EDDF9;border:0.1rem solid #00A0D6}";var PnChoiceButton=function(){function e(e){registerInstance(this,e);this.type="checkbox";this.disabled=false;this.checked=false;this.indeterminate=false}e.prototype.handlechange=function(){this.indeterminate=false};e.prototype.componentDidLoad=function(){this.checkAndSetIndeterminateState()};e.prototype.componentDidUpdate=function(){this.checkAndSetIndeterminateState()};e.prototype.checkAndSetIndeterminateState=function(){var e=this.hostElement.querySelector("#"+this.choiceid);if(e){e.indeterminate=this.indeterminate}};e.prototype.render=function(){return h(Host,null,h("input",{type:this.type,id:this.choiceid,value:this.value,name:this.name||this.choiceid,disabled:this.disabled,checked:this.checked}),h("label",{htmlFor:this.choiceid,class:"pn-choice-button"},h("slot",null)))};Object.defineProperty(e.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();PnChoiceButton.style=pnChoiceButtonCss;var pnFindServiceAndPriceResultCss="";var PnfindServiceAndPriceResult=function(){function e(e){registerInstance(this,e);this.item=null;this.shownitems=[];this.weightText=""}e.prototype.componentWillLoad=function(){this.composeItems()};e.prototype.composeItems=function(){this.shownitems=[];if(this.item.pricestamps){this.shownitems.push(Object.assign(Object.assign({},this.item),{priceagent:null,pricesenddirect:null}))}if(this.item.priceagent){this.shownitems.push(Object.assign(Object.assign({},this.item),{pricestamps:null,pricesenddirect:null}))}if(this.item.pricesenddirect){this.shownitems.push(Object.assign(Object.assign({},this.item),{pricestamps:null,priceagent:null}))}this.weightText=this.item.what==="parcel"?this.item.maxweight+"kg":this.item.what==="letter"&&this.item.maxweight>999?Math.round(this.item.maxweight/1e3)+" kg":this.item.maxweight+" g"};e.prototype.render=function(){var e=this;return h(Host,null,this.shownitems.map((function(t){return h("pn-product-tile",null,h("pn-illustration",{slot:"illustration",illustration:t.illustration}),h("div",{slot:"content"},h("div",{class:"content"},h("h3",null,t.name),t.description?h("div",{class:"description"},t.description):null,t.info?h("div",{class:"description"},t.info):null)),t.maxweight?h("pn-product-tile-info",{label:state.i18n.maxweightlabel,text:e.weightText}):null,t.maximummeasurements?h("pn-product-tile-info",{label:state.i18n.maxmeasurementlabel,text:t.maximummeasurements}):null,t.pricestamps?h("pn-product-tile-price",{slot:"price",label:"With stamps",amount:t.pricestamps+"",currency:state.market.currency}):null,t.priceagent?h("pn-product-tile-price",{slot:"price",label:"Service point",amount:t.priceagent+"",currency:state.market.currency,url:"https://shop.postnord.se/ebutik/default.aspx"}):null,t.pricesenddirect?h("pn-product-tile-price",{slot:"price",label:"Send direct",amount:t.pricesenddirect+"",currency:state.market.currency,url:"https://portal.postnord.com/skickadirekt/"}):null,t.info?h("small",{slot:"note"},h("p",null,t.note)):null)})))};Object.defineProperty(e,"watchers",{get:function(){return{item:["composeItems"]}},enumerable:false,configurable:true});return e}();PnfindServiceAndPriceResult.style=pnFindServiceAndPriceResultCss;export{PnChoiceButton as pn_choice_button,PnfindServiceAndPriceResult as pn_find_service_and_price_result};
1
+ import{r as registerInstance,h,a as Host,c as getElement}from"./index-52dc19ca.js";import{s as state}from"./pn-find-service-and-price-store-d02cbfe1.js";import"./index-7c277874.js";var pnChoiceButtonCss="pn-choice-button{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:none;display:inline-block;background:#fff;position:relative;margin:0.2em 0.4em}pn-choice-button input{opacity:0;position:absolute;top:0;left:0;pointer-events:none;margin:0;width:100%;height:100%}pn-choice-button label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0.4rem 0.8rem;border:0.1rem solid #D3CECB;color:#005D92;font-weight:500;border-radius:0.8rem;text-align:center;cursor:pointer;-webkit-transition:background 0.2s, -webkit-box-shadow 0.1s;transition:background 0.2s, -webkit-box-shadow 0.1s;transition:box-shadow 0.1s, background 0.2s;transition:box-shadow 0.1s, background 0.2s, -webkit-box-shadow 0.1s}pn-choice-button label pn-illustration{display:inline-block;width:3rem;height:3rem;margin-right:0.9rem}pn-choice-button>input:checked+label.pn-choice-button{background:#E0F8FF;color:#005D92;border-color:#005D92;-webkit-box-shadow:0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13);box-shadow:0px 0.6px 1.8px rgba(0, 0, 0, 0.1), 0px 3.2px 7.2px rgba(0, 0, 0, 0.13)}pn-choice-button>input:indeterminate+label.pn-choice-button{background:#FFFFFF;color:#005D92}pn-choice-button>input:hover+label.pn-choice-button{background:#E0F8FF}pn-choice-button>input:focus+label.pn-choice-button,pn-choice-button>input:active+label.pn-choice-button{-webkit-box-shadow:0 0 0 0.2rem #fff, 0 0 0 0.4rem #005D92;box-shadow:0 0 0 0.2rem #fff, 0 0 0 0.4rem #005D92}pn-choice-button>input:active+label.pn-choice-button{background:#8EDDF9}pn-choice-button>input:disabled+label.pn-choice-button{background-color:#D3CECB}pn-choice-button>input:checked+label.pn-choice-button:hover{background:#8EDDF9}pn-choice-button>input:checked+label.pn-choice-button:active{background:#8EDDF9;border:0.1rem solid #00A0D6}";var PnChoiceButton=function(){function e(e){registerInstance(this,e);this.type="checkbox";this.disabled=false;this.checked=false;this.indeterminate=false}e.prototype.handlechange=function(){this.indeterminate=false};e.prototype.componentDidLoad=function(){this.checkAndSetIndeterminateState()};e.prototype.componentDidUpdate=function(){this.checkAndSetIndeterminateState()};e.prototype.checkAndSetIndeterminateState=function(){var e=this.hostElement.querySelector("#"+this.choiceid);if(e){e.indeterminate=this.indeterminate}};e.prototype.render=function(){return h(Host,null,h("input",{type:this.type,id:this.choiceid,value:this.value,name:this.name||this.choiceid,disabled:this.disabled,checked:this.checked}),h("label",{htmlFor:this.choiceid,class:"pn-choice-button"},h("slot",null)))};Object.defineProperty(e.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();PnChoiceButton.style=pnChoiceButtonCss;var pnFindServiceAndPriceResultCss="";var PnfindServiceAndPriceResult=function(){function e(e){registerInstance(this,e);this.item=null;this.shownitems=[];this.weightText=""}e.prototype.componentWillLoad=function(){this.composeItems()};e.prototype.composeItems=function(){this.shownitems=[];if(this.item.pricestamps){this.shownitems.push(Object.assign(Object.assign({},this.item),{priceagent:null,pricesenddirect:null}))}if(this.item.priceagent){this.shownitems.push(Object.assign(Object.assign({},this.item),{pricestamps:null,pricesenddirect:null}))}if(this.item.pricesenddirect){this.shownitems.push(Object.assign(Object.assign({},this.item),{pricestamps:null,priceagent:null}))}this.weightText=this.item.what==="parcel"?this.item.maxweight+"kg":this.item.what==="letter"&&this.item.maxweight>999?Math.round(this.item.maxweight/1e3)+" kg":this.item.maxweight+" g"};e.prototype.render=function(){var e=this;return h(Host,null,this.shownitems.map((function(t){return h("pn-product-tile",null,h("pn-illustration",{slot:"illustration",illustration:t.illustration}),h("div",{slot:"content"},h("div",{class:"content"},h("h3",null,t.name),t.description?h("div",{class:"description"},t.description):null,t.info?h("div",{class:"description"},t.info):null)),t.maxweight?h("pn-product-tile-info",{label:state.i18n.maxweightlabel,text:e.weightText}):null,t.maximummeasurements?h("pn-product-tile-info",{label:state.i18n.maxmeasurementlabel,text:t.maximummeasurements}):null,t.pricestamps?h("pn-product-tile-price",{slot:"price",label:state.i18n.stampshopcta,amount:t.pricestamps+"",currency:state.market.currency}):null,t.priceagent?h("pn-product-tile-price",{slot:"price",label:"",amount:t.priceagent+"",currency:state.market.currency,url:"https://shop.postnord.se/ebutik/default.aspx"}):null,t.pricesenddirect?h("pn-product-tile-price",{slot:"price",label:state.i18n.senddirectcta,amount:t.pricesenddirect+"",currency:state.market.currency,url:"https://portal.postnord.com/skickadirekt/"}):null,t.note?h("small",{slot:"note"},h("p",null,t.note)):null)})))};Object.defineProperty(e,"watchers",{get:function(){return{item:["composeItems"]}},enumerable:false,configurable:true});return e}();PnfindServiceAndPriceResult.style=pnFindServiceAndPriceResultCss;export{PnChoiceButton as pn_choice_button,PnfindServiceAndPriceResult as pn_find_service_and_price_result};
@@ -1 +1 @@
1
- import{c as createStore}from"./index-7c277874.js";var _a=createStore({i18n:{componentheading:"",deliveryscopeheading:"",sizeheading:"",resultlistheading:"",weightlabel:"",maxweightlabel:"",maxmeasurementlabel:""},market:{currency:""}}),state=_a.state,onChange=_a.onChange;export{state as s};
1
+ import{c as createStore}from"./index-7c277874.js";var _a=createStore({i18n:{componentheading:"",deliveryscopeheading:"",sizeheading:"",resultlistheading:"",weightlabel:"",maxweightlabel:"",maxmeasurementlabel:"",senddirectcta:"",stampshopcta:""},market:{currency:""}}),state=_a.state,onChange=_a.onChange;export{state as s};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,i,a){function n(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,r){function l(e){try{o(a.next(e))}catch(t){r(t)}}function s(e){try{o(a["throw"](e))}catch(t){r(t)}}function o(e){e.done?i(e.value):n(e.value).then(l,s)}o((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},a,n,r,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(e){return function(t){return o([e,t])}}function o(l){if(a)throw new TypeError("Generator is already executing.");while(i)try{if(a=1,n&&(r=l[0]&2?n["return"]:l[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,l[1])).done)return r;if(n=0,r)l=[l[0]&2,r.value];switch(l[0]){case 0:case 1:r=l;break;case 4:i.label++;return{value:l[1],done:false};case 5:i.label++;n=l[1];l=[0];continue;case 7:l=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(l[0]===6&&i.label<r[1]){i.label=r[1];r=l;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(l);break}if(r[2])i.ops.pop();i.trys.pop();continue}l=t.call(e,i)}catch(s){l=[6,s];n=0}finally{a=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t){for(var i=0,a=t.length,n=e.length;i<a;i++,n++)e[n]=t[i];return e};import{r as registerInstance,h}from"./index-52dc19ca.js";import{c as convertFileFromStream}from"./convert-b49a0857.js";import{s as state}from"./pn-find-service-and-price-store-0c7083bd.js";import"./index-7c277874.js";var translations={sv:{componentheading:"Vad vill du skicka?",deliveryscopeheading:"Hit eller dit?",sizeheading:"Hur mycket väger det?",resultlistheading:"Några utvalda val",weightlabel:"Vikt",maxweightlabel:"Maxvikt",maxmeasurementlabel:"Maxvolym"},en:{componentheading:"What do you want to send?",deliveryscopeheading:"Here or there?",sizeheading:"How much does it weigh?",resultlistheading:"Some suitable options for you",weightlabel:"Weight",maxweightlabel:"Max weight",maxmeasurementlabel:"Maximum measurement"},da:{componentheading:"Vad vill du skicka?",deliveryscopeheading:"Here or there?",sizeheading:"How much does it weigh?",resultlistheading:"Some suitable options for you",weightlabel:"Vægt",maxweightlabel:"Max vægt",maxmeasurementlabel:"Maks. Volumen"},no:{componentheading:"Vad vill du skicka?",deliveryscopeheading:"Here or there?",sizeheading:"How much does it weigh?",resultlistheading:"Some suitable options for you",weightlabel:"Vekt",maxweightlabel:"Maks vekt",maxmeasurementlabel:"Maks volum"},fi:{componentheading:"Vad vill du skicka?",deliveryscopeheading:"Here or there?",sizeheading:"How much does it weigh?",resultlistheading:"Some suitable options for you",weightlabel:"Paino",maxweightlabel:"Max paino",maxmeasurementlabel:"Max äänenvoimakkuus"}};var markets={se:{currency:"kr"},dk:{currency:"dk"},fi:{currency:" €"},no:{currency:"kr"}};var postagetypes=[{name:"Brev",value:"letter",illustration:"letterbox-reply-letter-plants"},{name:"Paket",value:"parcel",illustration:"tracking"}];var deliveryscopes={letter:[{name:"Sweden",value:"sweden",illustration:"letterboxes"},{name:"Abroad",value:"abroad",illustration:"character-box-letters-globe"}],parcel:[{name:"Sweden",value:"sweden",illustration:"letterboxes"},{name:"Within Europe",value:"withineurope",illustration:"character-box-letters-globe"},{name:"Outside Europe",value:"outsideeurope",illustration:"discover"}]};var weights={letter:[{name:"50g",abbreviation:"g",value:50},{name:"100g",abbreviation:"g",value:100},{name:"250g",abbreviation:"g",value:250},{name:"500g",abbreviation:"g",value:500},{name:"1kg",abbreviation:"kg",value:1},{name:"2kg",abbreviation:"kg",value:2}],parcel:[{name:"1kg",abbreviation:"kg",value:1},{name:"2kg",abbreviation:"kg",value:2},{name:"3kg",abbreviation:"kg",value:3},{name:"4kg",abbreviation:"kg",value:4},{name:"5kg",abbreviation:"kg",value:5},{name:"6kg",abbreviation:"kg",value:6},{name:"7Kg",abbreviation:"kg",value:7},{name:"8kg",abbreviation:"kg",value:8},{name:"9kg",abbreviation:"kg",value:9},{name:"10kg",abbreviation:"kg",value:10},{name:"11kg",abbreviation:"kg",value:11},{name:"12kg",abbreviation:"kg",value:12},{name:"13kg",abbreviation:"kg",value:13},{name:"14kg",abbreviation:"kg",value:14},{name:"15kg",abbreviation:"kg",value:15},{name:"16kg",abbreviation:"kg",value:16},{name:"17kg",abbreviation:"kg",value:17},{name:"18kg",abbreviation:"kg",value:18},{name:"20kg",abbreviation:"kg",value:20}]};var pnFindServiceAndPriceCss="pn-find-service-and-price h2,pn-find-service-and-price .heading{text-align:center;font-size:1.5em;line-height:1.1;font-weight:bold;margin-bottom:1rem}pn-find-service-and-price .postagetypes,pn-find-service-and-price .deliveryscope{text-align:center;margin-bottom:3rem}pn-find-service-and-price .weightoption{display:-ms-flexbox;display:flex;gap:1em}pn-find-service-and-price .weightoption-input{width:5em;position:relative}pn-find-service-and-price .weightoption-input input::-webkit-outer-spin-button,pn-find-service-and-price .weightoption-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}pn-find-service-and-price .weightoption-input-abbreviation{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);right:1.2em;margin-top:0.75em;font-weight:500}pn-find-service-and-price .weightoption-range{-ms-flex-positive:1;flex-grow:1;-ms-flex-item-align:end;align-self:flex-end;position:relative;top:0.5em}pn-find-service-and-price .weightoption-range input{width:calc(100% - 1.5em)}pn-find-service-and-price .weightoption-range datalist{width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:0.75em}pn-find-service-and-price .resultlist{margin:3em 0}";var PnfindServiceAndPrice=function(){function e(e){registerInstance(this,e);this.source="https://com-integration.postnord.com/globalassets/global/prices/sv-se-findprice.xlsx";this.language="sv";this.market="se";this.filteredItems=[];this.postagetype={value:"",name:"",icon:""};this.weight={value:0,name:""};this.weightvalue=0;this.deliveryscope={value:"",name:"",icon:""};this.sourceData={types:[],data:[]}}e.prototype.componentWillLoad=function(){var e=this;this.setState();this.getDataSource();window.setTimeout((function(){e.postagetype=postagetypes[1];e.deliveryscope=deliveryscopes[e.postagetype.value][0];e.weight=weights[e.postagetype.value][0];e.weightvalue=e.weight.value}),500)};e.prototype.getDataSource=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,a;return __generator(this,(function(n){switch(n.label){case 0:return[4,fetch(this.source)];case 1:e=n.sent();return[4,e.blob()];case 2:t=n.sent();n.label=3;case 3:n.trys.push([3,5,,6]);return[4,convertFileFromStream(t)];case 4:i=n.sent();this.sourceData=i;return[3,6];case 5:a=n.sent();console.log("Unable to parse data");return[3,6];case 6:return[2]}}))}))};e.prototype.setState=function(){if(this.market){state.market=markets[this.market]}if(this.language&&translations[this.language]){state.i18n=translations[this.language]}};e.prototype.filterItems=function(){var e=this;var t;if(!((t=this.sourceData)===null||t===void 0?void 0:t.data)){console.log("Data has not yet been loaded");return}if(!this.postagetype){return}var i=this.sourceData.data.filter((function(t){return t.what===e.postagetype.value}));if(!this.deliveryscope){return}var a=i.filter((function(t){return t.deliveryscope===e.deliveryscope.value}));if(!this.weight||!this.weight.value){return}var n=this.weight.abbreviation.toLocaleLowerCase()==="kg"&&this.postagetype.value==="letter"?this.weight.value*1e3:this.weight.value;var r=a.filter((function(e){return e.maxweight===n}));if(r.length===0){r=a.filter((function(e){return e.maxweight>=n}));if(r.length>0){var l=__spreadArray([],new Map(r.reverse().map((function(e){return[e["id"],e]}))).values());if(l.length>0){r=l}}}this.filteredItems=r};e.prototype.render=function(){var e=this;return h("div",null,h("div",{class:"form"},state.i18n.componentheading?h("h2",null,state.i18n.componentheading):null,h("div",{class:"postagetypes"},postagetypes.map((function(t){return h("pn-choice-button",{choiceid:t.value,value:t.value,name:"postagetype",type:"radio",checked:t.value===e.postagetype.value,onChange:function(){e.postagetype=postagetypes.filter((function(e){return e.value===t.value}))[0];e.weight=weights[e.postagetype.value][0];e.weightvalue=e.weight.value}},h("pn-illustration",{illustration:t.illustration})," ",t.name)}))),this.postagetype.value&&deliveryscopes[this.postagetype.value]?h("div",null,state.i18n.deliveryscopeheading?h("div",{class:"heading"},state.i18n.deliveryscopeheading):null,h("div",{class:"deliveryscope"},deliveryscopes[this.postagetype.value].map((function(t){return h("pn-choice-button",{choiceid:e.postagetype.value+t.value,value:t.value,name:"deliveryscope",type:"radio",checked:t.value===e.deliveryscope.value,onChange:function(){e.deliveryscope=deliveryscopes[e.postagetype.value].filter((function(e){return e.value===t.value}))[0]}},h("pn-illustration",{illustration:t.illustration})," ",t.name)})))):null,this.postagetype.value&&weights[this.postagetype.value]&&this.deliveryscope.value?h("div",null,state.i18n.sizeheading?h("div",{class:"heading"},state.i18n.sizeheading):null,h("div",{class:"weightoption"},h("div",{class:"weightoption-input"},h("pn-input",{inputid:"weightvalue",name:"weightvalue",type:"number",label:state.i18n.weightlabel,value:this.weightvalue,onChange:function(t){if(t&&t.target&&t.target.value){var i=parseInt(t.target.value,10);if(!isNaN(i)){var a=weights[e.postagetype.value].filter((function(e){var t=e.abbreviation==="kg"?e.value*1e3:e.value;return t>=i}));if(a&&a.length>0){e.weight=a[0];e.weightvalue=e.weight.value}}}}}),h("span",{class:"weightoption-input-abbreviation"},this.weight.abbreviation)),h("div",{class:"weightoption-range"},h("input",{type:"range",id:"weightrange",name:"weightrange",list:"weightlist",value:!this.weight.value?0:weights[this.postagetype.value].findIndex((function(t){return t.value===e.weightvalue})),onChange:function(t){var i=t.target.value;e.weight=weights[e.postagetype.value][i];e.weightvalue=e.weight.value},min:"0",max:weights[this.postagetype.value].length-1}),h("datalist",{id:"weightlist"},weights[this.postagetype.value].map((function(t,i){var a=t.name;if(weights[e.postagetype.value].length>6){a=i%5===0||i===0||i===weights[e.postagetype.value].length-1?t.name:""}return h("option",Object.assign({value:i},a?{label:a}:{}))})))))):null),this.filteredItems?h("div",{class:"resultlist"},state.i18n.resultlistheading?h("div",{class:"heading"},state.i18n.resultlistheading):null,this.filteredItems.map((function(e){return h("div",null,h("pn-find-service-and-price-result",{item:e}))}))):null)};Object.defineProperty(e,"watchers",{get:function(){return{market:["setState"],language:["setState"],postagetype:["filterItems"],deliveryscope:["filterItems"],weightvalue:["filterItems"]}},enumerable:false,configurable:true});return e}();PnfindServiceAndPrice.style=pnFindServiceAndPriceCss;export{PnfindServiceAndPrice as pn_find_service_and_price};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,i,a){function n(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,r){function s(e){try{o(a.next(e))}catch(t){r(t)}}function l(e){try{o(a["throw"](e))}catch(t){r(t)}}function o(e){e.done?i(e.value):n(e.value).then(s,l)}o((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},a,n,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(e){return function(t){return o([e,t])}}function o(s){if(a)throw new TypeError("Generator is already executing.");while(i)try{if(a=1,n&&(r=s[0]&2?n["return"]:s[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;if(n=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;n=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(s[0]===6&&i.label<r[1]){i.label=r[1];r=s;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(s);break}if(r[2])i.ops.pop();i.trys.pop();continue}s=t.call(e,i)}catch(l){s=[6,l];n=0}finally{a=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t){for(var i=0,a=t.length,n=e.length;i<a;i++,n++)e[n]=t[i];return e};import{r as registerInstance,h}from"./index-52dc19ca.js";import{c as convertFileFromStream}from"./convert-b49a0857.js";import{s as state}from"./pn-find-service-and-price-store-d02cbfe1.js";import"./index-7c277874.js";var translations={sv:{componentheading:"Vad vill du skicka?",deliveryscopeheading:"Hit eller dit?",sizeheading:"Hur mycket väger det?",resultlistheading:"Några utvalda val",weightlabel:"Vikt",maxweightlabel:"Maxvikt",maxmeasurementlabel:"Maxvolym",senddirectcta:"Köp frakt via Skicka Direkt",stampshopcta:"Köp frimärken via vår webshop"},en:{componentheading:"What do you want to send?",deliveryscopeheading:"Here or there?",sizeheading:"How much does it weigh?",resultlistheading:"Some suitable options for you",weightlabel:"Weight",maxweightlabel:"Max weight",maxmeasurementlabel:"Maximum measurement",senddirectcta:"Buy shipping in Send Direct",stampshopcta:"Order home stamps from the webshop"},da:{componentheading:"Vad vill du skicka?",deliveryscopeheading:"Here or there?",sizeheading:"How much does it weigh?",resultlistheading:"Some suitable options for you",weightlabel:"Vægt",maxweightlabel:"Max vægt",maxmeasurementlabel:"Maks. Volumen",senddirectcta:"Buy shipping in Send Direct",stampshopcta:"Order home stamps from the webshop"},no:{componentheading:"Vad vill du skicka?",deliveryscopeheading:"Here or there?",sizeheading:"How much does it weigh?",resultlistheading:"Some suitable options for you",weightlabel:"Vekt",maxweightlabel:"Maks vekt",maxmeasurementlabel:"Maks volum",senddirectcta:"Buy shipping in Send Direct",stampshopcta:"Order home stamps from the webshop"},fi:{componentheading:"Vad vill du skicka?",deliveryscopeheading:"Here or there?",sizeheading:"How much does it weigh?",resultlistheading:"Some suitable options for you",weightlabel:"Paino",maxweightlabel:"Max paino",maxmeasurementlabel:"Max äänenvoimakkuus",senddirectcta:"Buy shipping in Send Direct",stampshopcta:"Order home stamps from the webshop"}};var markets={se:{currency:"kr"},dk:{currency:"dk"},fi:{currency:" €"},no:{currency:"kr"}};var postagetypes=[{name:"Brev",value:"letter",illustration:"letterbox-reply-letter-plants"},{name:"Paket",value:"parcel",illustration:"tracking"}];var deliveryscopes={letter:[{name:"Sweden",value:"sweden",illustration:"letterboxes"},{name:"Abroad",value:"abroad",illustration:"character-box-letters-globe"}],parcel:[{name:"Sweden",value:"sweden",illustration:"letterboxes"},{name:"Within Europe",value:"withineurope",illustration:"character-box-letters-globe"},{name:"Outside Europe",value:"outsideeurope",illustration:"discover"}]};var weights={letter:[{name:"50g",abbreviation:"g",value:50},{name:"100g",abbreviation:"g",value:100},{name:"250g",abbreviation:"g",value:250},{name:"500g",abbreviation:"g",value:500},{name:"1kg",abbreviation:"kg",value:1},{name:"2kg",abbreviation:"kg",value:2}],parcel:[{name:"1kg",abbreviation:"kg",value:1},{name:"2kg",abbreviation:"kg",value:2},{name:"3kg",abbreviation:"kg",value:3},{name:"4kg",abbreviation:"kg",value:4},{name:"5kg",abbreviation:"kg",value:5},{name:"6kg",abbreviation:"kg",value:6},{name:"7Kg",abbreviation:"kg",value:7},{name:"8kg",abbreviation:"kg",value:8},{name:"9kg",abbreviation:"kg",value:9},{name:"10kg",abbreviation:"kg",value:10},{name:"11kg",abbreviation:"kg",value:11},{name:"12kg",abbreviation:"kg",value:12},{name:"13kg",abbreviation:"kg",value:13},{name:"14kg",abbreviation:"kg",value:14},{name:"15kg",abbreviation:"kg",value:15},{name:"16kg",abbreviation:"kg",value:16},{name:"17kg",abbreviation:"kg",value:17},{name:"18kg",abbreviation:"kg",value:18},{name:"20kg",abbreviation:"kg",value:20}]};var pnFindServiceAndPriceCss="pn-find-service-and-price .findprice-form{max-width:50em;margin:0 auto}pn-find-service-and-price h2,pn-find-service-and-price .heading{text-align:center;font-size:1.5em;line-height:1.1;font-weight:bold;margin-bottom:1rem}pn-find-service-and-price .postagetypes,pn-find-service-and-price .deliveryscope{text-align:center;margin-bottom:3rem}pn-find-service-and-price .weightoption{display:-ms-flexbox;display:flex;gap:1em}pn-find-service-and-price .weightoption-input{width:5em;position:relative}pn-find-service-and-price .weightoption-input input::-webkit-outer-spin-button,pn-find-service-and-price .weightoption-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}pn-find-service-and-price .weightoption-input-abbreviation{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);right:1.2em;margin-top:1.55rem;font-weight:500}pn-find-service-and-price .weightoption-range{-ms-flex-positive:1;flex-grow:1;-ms-flex-item-align:end;align-self:flex-end;position:relative;top:0.5em}pn-find-service-and-price .weightoption-range input{width:calc(100% - 1.5em)}pn-find-service-and-price .weightoption-range datalist{width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:0.75em}pn-find-service-and-price .resultlist{margin:3em 0}";var PnfindServiceAndPrice=function(){function e(e){registerInstance(this,e);this.source="https://com-integration.postnord.com/globalassets/global/prices/sv-se-findprice.xlsx";this.language="sv";this.market="se";this.filteredItems=[];this.postagetype={value:"",name:"",icon:""};this.weight={value:0,name:""};this.weightvalue=0;this.deliveryscope={value:"",name:"",icon:""};this.sourceData={types:[],data:[]}}e.prototype.componentWillLoad=function(){this.setState();this.getDataSource()};e.prototype.getDataSource=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,a,n;return __generator(this,(function(r){switch(r.label){case 0:e="?cache="+Math.floor(Math.random()*(1e4-1)+1);return[4,fetch(this.source+e)];case 1:t=r.sent();return[4,t.blob()];case 2:i=r.sent();r.label=3;case 3:r.trys.push([3,5,,6]);return[4,convertFileFromStream(i)];case 4:a=r.sent();this.sourceData=a;this.filterItems();return[3,6];case 5:n=r.sent();console.log("Unable to parse data");return[3,6];case 6:return[2]}}))}))};e.prototype.setState=function(){if(this.market){state.market=markets[this.market]}if(this.language&&translations[this.language]){state.i18n=translations[this.language]}};e.prototype.filterItems=function(){var e=this;var t;if(!((t=this.sourceData)===null||t===void 0?void 0:t.data)){console.log("Data has not yet been loaded");return}if(!this.postagetype){return}var i=this.sourceData.data.filter((function(t){return t.what===e.postagetype.value}));if(!this.deliveryscope){return}var a=i.filter((function(t){return t.deliveryscope===e.deliveryscope.value}));if(!this.weight||!this.weight.value){return}var n=this.weight.abbreviation.toLocaleLowerCase()==="kg"&&this.postagetype.value==="letter"?this.weight.value*1e3:this.weight.value;var r=a.filter((function(e){return e.maxweight===n}));if(r.length===0){r=a.filter((function(e){return e.maxweight>=n}));if(r.length>0){var s=__spreadArray([],new Map(r.reverse().map((function(e){return[e["id"],e]}))).values());if(s.length>0){r=s}}}console.log("weightFilteredData",r);this.filteredItems=r};e.prototype.render=function(){var e=this;return h("div",null,h("div",{class:"findprice-form"},state.i18n.componentheading?h("h2",null,state.i18n.componentheading):null,h("div",{class:"postagetypes"},postagetypes.map((function(t){return h("pn-choice-button",{choiceid:t.value,value:t.value,name:"postagetype",type:"radio",checked:t.value===e.postagetype.value,onChange:function(){e.postagetype=postagetypes.filter((function(e){return e.value===t.value}))[0];e.deliveryscope={value:"",name:"",icon:""};e.weight={value:0,name:""};e.weightvalue=e.weight.value}},h("pn-illustration",{illustration:t.illustration})," ",t.name)}))),this.postagetype.value&&deliveryscopes[this.postagetype.value]?h("div",null,state.i18n.deliveryscopeheading?h("div",{class:"heading"},state.i18n.deliveryscopeheading):null,h("div",{class:"deliveryscope"},deliveryscopes[this.postagetype.value].map((function(t){return h("pn-choice-button",{choiceid:e.postagetype.value+t.value,value:t.value,name:"deliveryscope",type:"radio",checked:t.value===e.deliveryscope.value,onChange:function(){e.deliveryscope=deliveryscopes[e.postagetype.value].filter((function(e){return e.value===t.value}))[0];if(e.weight.value===0){e.weight=weights[e.postagetype.value][0];e.weightvalue=e.weight.value}}},h("pn-illustration",{illustration:t.illustration})," ",t.name)})))):null,this.postagetype.value&&weights[this.postagetype.value]&&this.deliveryscope.value?h("div",null,state.i18n.sizeheading?h("div",{class:"heading"},state.i18n.sizeheading):null,h("div",{class:"weightoption"},h("div",{class:"weightoption-input"},h("pn-input",{inputid:"weightvalue",name:"weightvalue",type:"number",label:state.i18n.weightlabel,value:this.weightvalue,onChange:function(t){if(t&&t.target&&t.target.value){var i=parseInt(t.target.value,10);if(!isNaN(i)){var a=weights[e.postagetype.value].filter((function(e){var t=e.abbreviation==="kg"?e.value*1e3:e.value;return t>=i}));if(a&&a.length>0){e.weight=a[0];e.weightvalue=e.weight.value}}}}}),h("span",{class:"weightoption-input-abbreviation"},this.weight.abbreviation)),h("div",{class:"weightoption-range"},h("input",{type:"range",id:"weightrange",name:"weightrange",list:"weightlist",value:!this.weight.value?0:weights[this.postagetype.value].findIndex((function(t){return t.value===e.weightvalue})),onChange:function(t){var i=t.target.value;e.weight=weights[e.postagetype.value][i];e.weightvalue=e.weight.value},min:"0",max:weights[this.postagetype.value].length-1}),h("datalist",{id:"weightlist"},weights[this.postagetype.value].map((function(t,i){var a=t.name;if(weights[e.postagetype.value].length>6){a=i%5===0||i===0||i===weights[e.postagetype.value].length-1?t.name:""}return h("option",Object.assign({value:i},a?{label:a}:{}))})))))):null),this.filteredItems&&this.filteredItems.length>0?h("div",{class:"resultlist"},state.i18n.resultlistheading?h("div",{class:"heading"},state.i18n.resultlistheading):null,this.filteredItems.map((function(e){return h("div",null,h("pn-find-service-and-price-result",{item:e}))}))):null)};Object.defineProperty(e,"watchers",{get:function(){return{market:["setState"],language:["setState"],postagetype:["filterItems"],deliveryscope:["filterItems"],weightvalue:["filterItems"]}},enumerable:false,configurable:true});return e}();PnfindServiceAndPrice.style=pnFindServiceAndPriceCss;export{PnfindServiceAndPrice as pn_find_service_and_price};
@@ -1 +1 @@
1
- import{d as doc,N as NAMESPACE,w as win,p as promiseResolve,H,b as bootstrapLazy}from"./index-52dc19ca.js";var patchBrowser=function(){{patchCloneNodeFix(H.prototype)}var e=Array.from(doc.querySelectorAll("script")).find((function(e){return new RegExp("/"+NAMESPACE+"(\\.esm)?\\.js($|\\?|#)").test(e.src)||e.getAttribute("data-stencil-namespace")===NAMESPACE}));var n={};if("onbeforeload"in e&&!history.scrollRestoration){return{then:function(){}}}{n.resourcesUrl=new URL(".",new URL(e.getAttribute("data-resources-url")||e.src,win.location.href)).href}return promiseResolve(n)};var patchCloneNodeFix=function(e){var n=e.cloneNode;e.cloneNode=function(e){if(this.nodeName==="TEMPLATE"){return n.call(this,e)}var t=n.call(this,false);var a=this.childNodes;if(e){for(var i=0;i<a.length;i++){if(a[i].nodeType!==2){t.appendChild(a[i].cloneNode(true))}}}return t}};patchBrowser().then((function(e){return bootstrapLazy([["pn-marketweb-siteheader",[[4,"pn-marketweb-siteheader",{market:[1],language:[1],endpoint:[1],hideSiteSelector:[1028,"hide-site-selector"],hideLanguageSelector:[1028,"hide-language-selector"],hideSearch:[1028,"hide-search"],hideLogin:[1028,"hide-login"],i18n:[32],gotData:[32],fetchingData:[32],menuItems:[32],siteDefinition:[32],search:[32],siteSelector:[32],languageSelector:[32],loginDialog:[32],minimizeSearch:[32]},[[9,"resize","handleResize"]]]]],["pn-find-service-and-price",[[0,"pn-find-service-and-price",{source:[1],language:[1025],market:[1025],filteredItems:[32],postagetype:[32],weight:[32],weightvalue:[32],deliveryscope:[32],sourceData:[32]}]]],["pn-product-pricelist",[[4,"pn-product-pricelist",{source:[1],language:[1025],market:[1025],productid:[1],filteredItems:[32],sourceData:[32],gotData:[32],loading:[32]}]]],["pn-site-footer_2",[[4,"pn-site-footer",{url:[1]}],[4,"pn-site-footer-col"]]],["pn-marketweb-sitefooter",[[0,"pn-marketweb-sitefooter",{market:[1],language:[1],endpoint:[1],siteDefinition:[32],footerContent:[32],i18n:[32],gotData:[32],fetchingData:[32]}]]],["pn-product-pricelist-result",[[0,"pn-product-pricelist-result",{item:[16],shownitems:[16]}]]],["pn-choice-button_2",[[0,"pn-find-service-and-price-result",{item:[1040],shownitems:[16],weightText:[32]}],[4,"pn-choice-button",{value:[520],name:[1],choiceid:[1],type:[1],disabled:[4],checked:[4],indeterminate:[1028]},[[0,"change","handlechange"]]]]],["pn-mainnav-link",[[4,"pn-mainnav-link",{name:[1],href:[1],target:[1],linkid:[1],levelId:[32],open:[32],hasChildren:[32]}]]],["pn-language-selector_9",[[4,"pn-mainnav-level",{level:[32],levelId:[32],isOpen:[32],parentName:[32],parentHref:[32],parentLinkId:[32],listCount:[32],alignment:[32]}],[4,"pn-language-selector",{value:[1537],selectedLanguageName:[32],options:[32],i18n:[32]}],[0,"pn-language-selector-option",{name:[1],code:[1],url:[1],selected:[4],currentLanguage:[1,"current-language"]}],[4,"pn-mainnav",{market:[1],language:[1],navigationId:[1,"navigation-id"],openMenu:[1028,"open-menu"]},[[0,"language","setLanguage"],[0,"market","setMarket"],[0,"menuLanguageChange","onLanguageChange"],[0,"setmenuopen","setOpenMenu"],[0,"openMenuLevelChange","onOpenMenuLevelChange"]]],[4,"pn-mainnav-list",{heading:[1],linkCount:[32]}],[0,"pn-marketweb-siteheader-login",{endpoint:[1],i18n:[8,"i-1-8n"],loginDialog:[1040],loginManager:[32],loggedIn:[32],toggleButtonText:[32]}],[0,"pn-marketweb-siteheader-search",{i18n:[8,"i-1-8n"],showOnlyLink:[1028,"show-only-link"],hideSearch:[1028,"hide-search"],search:[1040]}],[4,"pn-site-selector",{buttontext:[1],heading:[1],language:[1],i18n:[32]}],[0,"pn-site-selector-item",{url:[1],heading:[1],description:[1],newwindow:[4]}]]],["pn-product-tile_3",[[4,"pn-product-tile"],[0,"pn-product-tile-info",{label:[1],text:[1],icon:[1]}],[0,"pn-product-tile-price",{label:[1],amount:[1],currency:[1],url:[1]}]]]],e)}));
1
+ import{d as doc,N as NAMESPACE,w as win,p as promiseResolve,H,b as bootstrapLazy}from"./index-52dc19ca.js";var patchBrowser=function(){{patchCloneNodeFix(H.prototype)}var e=Array.from(doc.querySelectorAll("script")).find((function(e){return new RegExp("/"+NAMESPACE+"(\\.esm)?\\.js($|\\?|#)").test(e.src)||e.getAttribute("data-stencil-namespace")===NAMESPACE}));var n={};if("onbeforeload"in e&&!history.scrollRestoration){return{then:function(){}}}{n.resourcesUrl=new URL(".",new URL(e.getAttribute("data-resources-url")||e.src,win.location.href)).href}return promiseResolve(n)};var patchCloneNodeFix=function(e){var n=e.cloneNode;e.cloneNode=function(e){if(this.nodeName==="TEMPLATE"){return n.call(this,e)}var t=n.call(this,false);var a=this.childNodes;if(e){for(var i=0;i<a.length;i++){if(a[i].nodeType!==2){t.appendChild(a[i].cloneNode(true))}}}return t}};patchBrowser().then((function(e){return bootstrapLazy([["pn-marketweb-siteheader",[[4,"pn-marketweb-siteheader",{market:[1],language:[1],endpoint:[1],hideSiteSelector:[1028,"hide-site-selector"],hideLanguageSelector:[1028,"hide-language-selector"],hideSearch:[1028,"hide-search"],hideLogin:[1028,"hide-login"],i18n:[32],gotData:[32],fetchingData:[32],menuItems:[32],siteDefinition:[32],search:[32],siteSelector:[32],languageSelector:[32],loginDialog:[32],minimizeSearch:[32]},[[9,"resize","handleResize"]]]]],["pn-find-service-and-price",[[0,"pn-find-service-and-price",{source:[1],language:[1025],market:[1025],filteredItems:[32],postagetype:[32],weight:[32],weightvalue:[32],deliveryscope:[32],sourceData:[32]}]]],["pn-product-pricelist",[[4,"pn-product-pricelist",{source:[1],language:[1025],market:[1025],productid:[1],filteredItems:[32],sourceData:[32],gotData:[32],loading:[32],postagetype:[32],weight:[32],weightvalue:[32]}]]],["pn-site-footer_2",[[4,"pn-site-footer",{url:[1]}],[4,"pn-site-footer-col"]]],["pn-marketweb-sitefooter",[[0,"pn-marketweb-sitefooter",{market:[1],language:[1],endpoint:[1],siteDefinition:[32],footerContent:[32],i18n:[32],gotData:[32],fetchingData:[32]}]]],["pn-product-pricelist-result",[[0,"pn-product-pricelist-result",{item:[1040],shownitems:[16],weightText:[32]}]]],["pn-choice-button_2",[[0,"pn-find-service-and-price-result",{item:[1040],shownitems:[16],weightText:[32]}],[4,"pn-choice-button",{value:[520],name:[1],choiceid:[1],type:[1],disabled:[4],checked:[4],indeterminate:[1028]},[[0,"change","handlechange"]]]]],["pn-mainnav-link",[[4,"pn-mainnav-link",{name:[1],href:[1],target:[1],linkid:[1],levelId:[32],open:[32],hasChildren:[32]}]]],["pn-language-selector_9",[[4,"pn-mainnav-level",{level:[32],levelId:[32],isOpen:[32],parentName:[32],parentHref:[32],parentLinkId:[32],listCount:[32],alignment:[32]}],[4,"pn-language-selector",{value:[1537],selectedLanguageName:[32],options:[32],i18n:[32]}],[0,"pn-language-selector-option",{name:[1],code:[1],url:[1],selected:[4],currentLanguage:[1,"current-language"]}],[4,"pn-mainnav",{market:[1],language:[1],navigationId:[1,"navigation-id"],openMenu:[1028,"open-menu"]},[[0,"language","setLanguage"],[0,"market","setMarket"],[0,"menuLanguageChange","onLanguageChange"],[0,"setmenuopen","setOpenMenu"],[0,"openMenuLevelChange","onOpenMenuLevelChange"]]],[4,"pn-mainnav-list",{heading:[1],linkCount:[32]}],[0,"pn-marketweb-siteheader-login",{endpoint:[1],i18n:[8,"i-1-8n"],loginDialog:[1040],loginManager:[32],loggedIn:[32],toggleButtonText:[32]}],[0,"pn-marketweb-siteheader-search",{i18n:[8,"i-1-8n"],showOnlyLink:[1028,"show-only-link"],hideSearch:[1028,"hide-search"],search:[1040]}],[4,"pn-site-selector",{buttontext:[1],heading:[1],language:[1],i18n:[32]}],[0,"pn-site-selector-item",{url:[1],heading:[1],description:[1],newwindow:[4]}]]],["pn-product-tile_3",[[4,"pn-product-tile"],[0,"pn-product-tile-info",{label:[1],text:[1],icon:[1]}],[0,"pn-product-tile-price",{label:[1],amount:[1],currency:[1],url:[1]}]]]],e)}));