@geotrekce/geotrek-rando-widget 0.8.0 → 0.8.1

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 (115) hide show
  1. package/dist/cjs/grw-common-button_21.cjs.entry.js +59 -50
  2. package/dist/cjs/grw-common-button_21.cjs.entry.js.br +0 -0
  3. package/dist/cjs/grw-common-button_21.cjs.entry.js.gz +0 -0
  4. package/dist/cjs/grw-common-button_21.cjs.entry.js.map +1 -1
  5. package/dist/cjs/grw-information-desk_6.cjs.entry.js +1 -1
  6. package/dist/cjs/grw-information-desk_6.cjs.entry.js.br +0 -0
  7. package/dist/cjs/grw-information-desk_6.cjs.entry.js.gz +0 -0
  8. package/dist/cjs/{pagination-528069db.js → pagination-4342f656.js} +9 -1
  9. package/dist/cjs/pagination-4342f656.js.br +0 -0
  10. package/dist/cjs/pagination-4342f656.js.gz +0 -0
  11. package/dist/cjs/pagination-4342f656.js.map +1 -0
  12. package/dist/collection/components/grw-switch/grw-switch.js +2 -1
  13. package/dist/collection/components/grw-switch/grw-switch.js.br +0 -0
  14. package/dist/collection/components/grw-switch/grw-switch.js.gz +0 -0
  15. package/dist/collection/components/grw-switch/grw-switch.js.map +1 -1
  16. package/dist/collection/components/grw-trek-card/grw-trek-card.js +1 -1
  17. package/dist/collection/components/grw-trek-card/grw-trek-card.js.br +0 -0
  18. package/dist/collection/components/grw-trek-card/grw-trek-card.js.gz +0 -0
  19. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +38 -23
  20. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js.br +0 -0
  21. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js.gz +0 -0
  22. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js.map +1 -1
  23. package/dist/collection/services/treks.service.js +6 -0
  24. package/dist/collection/services/treks.service.js.br +0 -0
  25. package/dist/collection/services/treks.service.js.gz +0 -0
  26. package/dist/collection/services/treks.service.js.map +1 -1
  27. package/dist/collection/store/grw-trek-provider.js +22 -28
  28. package/dist/collection/store/grw-trek-provider.js.br +0 -0
  29. package/dist/collection/store/grw-trek-provider.js.gz +0 -0
  30. package/dist/collection/store/grw-trek-provider.js.map +1 -1
  31. package/dist/collection/types/types.js.map +1 -1
  32. package/dist/esm/grw-common-button_21.entry.js +59 -50
  33. package/dist/esm/grw-common-button_21.entry.js.br +0 -0
  34. package/dist/esm/grw-common-button_21.entry.js.gz +0 -0
  35. package/dist/esm/grw-common-button_21.entry.js.map +1 -1
  36. package/dist/esm/grw-information-desk_6.entry.js +1 -1
  37. package/dist/esm/grw-information-desk_6.entry.js.br +0 -0
  38. package/dist/esm/grw-information-desk_6.entry.js.gz +0 -0
  39. package/dist/esm/{pagination-3428bda5.js → pagination-6a17b295.js} +8 -2
  40. package/dist/esm/pagination-6a17b295.js.br +0 -0
  41. package/dist/esm/pagination-6a17b295.js.gz +0 -0
  42. package/dist/esm/pagination-6a17b295.js.map +1 -0
  43. package/dist/esm-es5/grw-common-button_21.entry.js +3 -3
  44. package/dist/esm-es5/grw-common-button_21.entry.js.br +0 -0
  45. package/dist/esm-es5/grw-common-button_21.entry.js.gz +0 -0
  46. package/dist/esm-es5/grw-common-button_21.entry.js.map +1 -1
  47. package/dist/esm-es5/grw-information-desk_6.entry.js +1 -1
  48. package/dist/esm-es5/grw-information-desk_6.entry.js.br +0 -0
  49. package/dist/esm-es5/grw-information-desk_6.entry.js.gz +0 -0
  50. package/dist/esm-es5/pagination-6a17b295.js +2 -0
  51. package/dist/esm-es5/pagination-6a17b295.js.br +0 -0
  52. package/dist/esm-es5/pagination-6a17b295.js.gz +0 -0
  53. package/dist/esm-es5/pagination-6a17b295.js.map +1 -0
  54. package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
  55. package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js.br +0 -0
  56. package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js.gz +0 -0
  57. package/dist/geotrek-rando-widget/p-4dfdc6d3.js +2 -0
  58. package/dist/geotrek-rando-widget/p-4dfdc6d3.js.br +0 -0
  59. package/dist/geotrek-rando-widget/p-4dfdc6d3.js.gz +0 -0
  60. package/dist/geotrek-rando-widget/p-4dfdc6d3.js.map +1 -0
  61. package/dist/geotrek-rando-widget/{p-40e69a46.entry.js → p-59922286.entry.js} +4 -4
  62. package/dist/geotrek-rando-widget/p-59922286.entry.js.br +0 -0
  63. package/dist/geotrek-rando-widget/p-59922286.entry.js.gz +0 -0
  64. package/dist/geotrek-rando-widget/p-59922286.entry.js.map +1 -0
  65. package/dist/geotrek-rando-widget/p-607c095f.system.js +2 -0
  66. package/dist/geotrek-rando-widget/p-607c095f.system.js.br +0 -0
  67. package/dist/geotrek-rando-widget/p-607c095f.system.js.gz +0 -0
  68. package/dist/geotrek-rando-widget/p-607c095f.system.js.map +1 -0
  69. package/dist/geotrek-rando-widget/{p-4c85680a.system.entry.js → p-6967c491.system.entry.js} +2 -2
  70. package/dist/geotrek-rando-widget/p-6967c491.system.entry.js.br +0 -0
  71. package/dist/geotrek-rando-widget/p-6967c491.system.entry.js.gz +0 -0
  72. package/dist/geotrek-rando-widget/{p-ae129a99.entry.js → p-7a381813.entry.js} +2 -2
  73. package/dist/geotrek-rando-widget/p-7a381813.entry.js.br +0 -0
  74. package/dist/geotrek-rando-widget/p-7a381813.entry.js.gz +0 -0
  75. package/dist/geotrek-rando-widget/p-96d7dd37.system.entry.js +11 -0
  76. package/dist/geotrek-rando-widget/p-96d7dd37.system.entry.js.br +0 -0
  77. package/dist/geotrek-rando-widget/p-96d7dd37.system.entry.js.gz +0 -0
  78. package/dist/geotrek-rando-widget/p-96d7dd37.system.entry.js.map +1 -0
  79. package/dist/geotrek-rando-widget/p-b02ae30d.system.js +1 -1
  80. package/dist/geotrek-rando-widget/p-b02ae30d.system.js.br +0 -0
  81. package/dist/geotrek-rando-widget/p-b02ae30d.system.js.gz +0 -0
  82. package/dist/types/services/treks.service.d.ts +2 -0
  83. package/dist/types/types/types.d.ts +5 -1
  84. package/package.json +1 -1
  85. package/dist/cjs/pagination-528069db.js.br +0 -0
  86. package/dist/cjs/pagination-528069db.js.gz +0 -0
  87. package/dist/cjs/pagination-528069db.js.map +0 -1
  88. package/dist/esm/pagination-3428bda5.js.br +0 -0
  89. package/dist/esm/pagination-3428bda5.js.gz +0 -0
  90. package/dist/esm/pagination-3428bda5.js.map +0 -1
  91. package/dist/esm-es5/pagination-3428bda5.js +0 -2
  92. package/dist/esm-es5/pagination-3428bda5.js.br +0 -0
  93. package/dist/esm-es5/pagination-3428bda5.js.gz +0 -0
  94. package/dist/esm-es5/pagination-3428bda5.js.map +0 -1
  95. package/dist/geotrek-rando-widget/p-40e69a46.entry.js.br +0 -0
  96. package/dist/geotrek-rando-widget/p-40e69a46.entry.js.gz +0 -0
  97. package/dist/geotrek-rando-widget/p-40e69a46.entry.js.map +0 -1
  98. package/dist/geotrek-rando-widget/p-4c85680a.system.entry.js.br +0 -0
  99. package/dist/geotrek-rando-widget/p-4c85680a.system.entry.js.gz +0 -0
  100. package/dist/geotrek-rando-widget/p-ae129a99.entry.js.br +0 -0
  101. package/dist/geotrek-rando-widget/p-ae129a99.entry.js.gz +0 -0
  102. package/dist/geotrek-rando-widget/p-b1f344f9.js +0 -2
  103. package/dist/geotrek-rando-widget/p-b1f344f9.js.br +0 -0
  104. package/dist/geotrek-rando-widget/p-b1f344f9.js.gz +0 -0
  105. package/dist/geotrek-rando-widget/p-b1f344f9.js.map +0 -1
  106. package/dist/geotrek-rando-widget/p-dfd293bb.system.entry.js +0 -11
  107. package/dist/geotrek-rando-widget/p-dfd293bb.system.entry.js.br +0 -0
  108. package/dist/geotrek-rando-widget/p-dfd293bb.system.entry.js.gz +0 -0
  109. package/dist/geotrek-rando-widget/p-dfd293bb.system.entry.js.map +0 -1
  110. package/dist/geotrek-rando-widget/p-ff433eba.system.js +0 -2
  111. package/dist/geotrek-rando-widget/p-ff433eba.system.js.br +0 -0
  112. package/dist/geotrek-rando-widget/p-ff433eba.system.js.gz +0 -0
  113. package/dist/geotrek-rando-widget/p-ff433eba.system.js.map +0 -1
  114. /package/dist/geotrek-rando-widget/{p-4c85680a.system.entry.js.map → p-6967c491.system.entry.js.map} +0 -0
  115. /package/dist/geotrek-rando-widget/{p-ae129a99.entry.js.map → p-7a381813.entry.js.map} +0 -0
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-e9166f30.js');
6
6
  const i18n = require('./i18n-c8d45caf.js');
7
7
  const utils = require('./utils-84828f7f.js');
8
- const pagination = require('./pagination-528069db.js');
8
+ const pagination = require('./pagination-4342f656.js');
9
9
 
10
10
  const grwCommonButtonCss = ".material-symbols{font-family:\"Material Symbols Outlined\"}.material-symbols-outlined{font-variation-settings:\"FILL\" 0, \"wght\" 400, \"GRAD\" 0, \"opsz\" 48}.common-button{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;-webkit-tap-highlight-color:transparent;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;color:var(--color-on-primary-container);background-color:var(--color-primary-container);padding:12px 24px;border-radius:var(--border-radius, 20px);-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;gap:8px;white-space:nowrap;line-height:20px;letter-spacing:0.1px;font-family:var(--font-family);font-size:14px;font-weight:500;-webkit-box-shadow:var(--elevation-1);box-shadow:var(--elevation-1);-webkit-transition:-webkit-box-shadow 0.2s ease-in-out 0s;transition:-webkit-box-shadow 0.2s ease-in-out 0s;transition:box-shadow 0.2s ease-in-out 0s;transition:box-shadow 0.2s ease-in-out 0s, -webkit-box-shadow 0.2s ease-in-out 0s}.common-button .common-button-icon{font-size:18px}";
11
11
 
@@ -2904,7 +2904,7 @@ const GrwSwitch = class {
2904
2904
  render() {
2905
2905
  return (index.h(index.Host, { style: {
2906
2906
  '--font-family': this.fontFamily,
2907
- } }, index.h("label", { class: "md3 switch" }, index.h("input", { onChange: () => this.action(), type: "checkbox", id: "darkmode", name: "darkmode" }), index.h("span", { class: "slider" }, index.h("span", { translate: false, part: "icon", class: "material-symbols material-symbols-outlined icon" }, "done")))));
2907
+ } }, index.h("label", { class: "md3 switch" }, index.h("input", { checked: utils.state.offlineTreks, onChange: () => this.action(), type: "checkbox", id: "darkmode", name: "darkmode" }), index.h("span", { class: "slider" }, index.h("span", { translate: false, part: "icon", class: "material-symbols material-symbols-outlined icon" }, "done")))));
2908
2908
  }
2909
2909
  };
2910
2910
  GrwSwitch.style = grwSwitchCss;
@@ -4960,9 +4960,9 @@ const GrwTrekDetail = class {
4960
4960
  await utils.writeOrUpdateDataInStore('treks', treks);
4961
4961
  await utils.writeOrUpdateDataInStore('districts', utils.state.districts);
4962
4962
  // download global tiles
4963
- // await this.downloadGlobalTiles(this.defaultBackgroundLayerUrl, this.defaultBackgroundLayerAttribution);
4963
+ await this.downloadGlobalTiles(this.defaultBackgroundLayerUrl, this.defaultBackgroundLayerAttribution);
4964
4964
  // download trek tiles
4965
- // await this.downloadTrekTiles(this.defaultBackgroundLayerUrl, this.defaultBackgroundLayerAttribution);
4965
+ await this.downloadTrekTiles(this.defaultBackgroundLayerUrl, this.defaultBackgroundLayerAttribution);
4966
4966
  // download global medias
4967
4967
  await utils.writeOrUpdateFilesInStore(utils.state.difficulties, utils.imagesRegExp);
4968
4968
  await utils.writeOrUpdateFilesInStore(utils.state.routes, utils.imagesRegExp);
@@ -4993,13 +4993,14 @@ const GrwTrekDetail = class {
4993
4993
  await utils.writeOrUpdateDataInStore('sources', utils.state.sources);
4994
4994
  await utils.writeOrUpdateDataInStore('accessibilitiesLevel', utils.state.accessibilitiesLevel);
4995
4995
  await utils.writeOrUpdateDataInStore('touristicContentCategories', utils.state.touristicContentCategories);
4996
- await utils.writeOrUpdateDataInStore('touristicEvents', utils.state.trekTouristicEvents);
4997
4996
  await utils.writeOrUpdateDataInStore('touristicEventTypes', utils.state.touristicEventTypes);
4998
4997
  await utils.writeOrUpdateDataInStore('networks', utils.state.networks);
4999
4998
  await utils.writeOrUpdateDataInStore('pois', utils.state.currentPois);
5000
4999
  await utils.writeOrUpdateDataInStore('poiTypes', utils.state.poiTypes);
5001
5000
  await utils.writeOrUpdateDataInStore('informationDesks', utils.state.currentInformationDesks);
5002
- await utils.writeOrUpdateDataInStore('treks', [Object.assign(Object.assign({}, this.currentTrek), { offline: true })]);
5001
+ await utils.writeOrUpdateDataInStore('treks', [
5002
+ Object.assign(Object.assign({}, this.currentTrek), { offline: true, pois: utils.state.currentPois.map(poi => poi.id), touristicContents: utils.state.trekTouristicContents.map(trekTouristicContent => trekTouristicContent.id), touristicEvents: utils.state.trekTouristicEvents.map(trekTouristicEvent => trekTouristicEvent.id), sensitiveAreas: utils.state.currentSensitiveAreas ? utils.state.currentSensitiveAreas.map(currentSensitiveArea => currentSensitiveArea.id) : [] }),
5003
+ ]);
5003
5004
  await utils.writeOrUpdateFilesInStore(utils.state.currentPois, utils.imagesRegExp, true);
5004
5005
  await utils.writeOrUpdateFilesInStore(utils.state.currentInformationDesks, utils.imagesRegExp, true);
5005
5006
  // download items data
@@ -5021,35 +5022,45 @@ const GrwTrekDetail = class {
5021
5022
  const stepRequests = [];
5022
5023
  const stepsTouristicContentsRequests = [];
5023
5024
  const stepsTouristicEventsRequests = [];
5025
+ const stepsPoisRequests = [];
5026
+ const stepsSensitiveAreasRequests = [];
5024
5027
  steps.forEach(stepId => {
5025
5028
  stepRequests.push(pagination.getTrek(utils.state.api, utils.state.language, stepId, init));
5026
5029
  stepsTouristicContentsRequests.push(getTouristicContentsNearTrek(utils.state.api, utils.state.language, stepId, init));
5027
5030
  stepsTouristicEventsRequests.push(getTouristicEventsNearTrek(utils.state.api, utils.state.language, stepId, init));
5031
+ stepsPoisRequests.push(pagination.getPoisNearTrek(utils.state.api, utils.state.language, stepId, init));
5032
+ stepsSensitiveAreasRequests.push(pagination.getSensitiveAreasNearTrek(utils.state.api, utils.state.language, stepId, init));
5028
5033
  });
5029
5034
  const trekSteps = await Promise.all([...stepRequests]).then(responses => Promise.all(responses.map(response => response.json())));
5030
5035
  const stepsTouristicContentsResponses = await Promise.all([...stepsTouristicContentsRequests]).then(responses => Promise.all(responses.map(response => response.json())));
5031
5036
  const stepsTouristicEventsResponses = await Promise.all([...stepsTouristicEventsRequests]).then(responses => Promise.all(responses.map(response => response.json())));
5037
+ const stepsPoisResponses = await Promise.all([...stepsPoisRequests]).then(responses => Promise.all(responses.map(response => response.json())));
5038
+ const stepsSensitiveAreasResponses = await Promise.all([...stepsSensitiveAreasRequests]).then(responses => Promise.all(responses.map(response => response.json())));
5032
5039
  for (let index = 0; index < trekSteps.length; index++) {
5033
5040
  trekSteps[index].offline = true;
5041
+ trekSteps[index].pois = stepsPoisResponses[index].results.map(poi => poi.id);
5042
+ trekSteps[index].touristicContents = stepsTouristicContentsResponses[index].results.map(trekTouristicContent => trekTouristicContent.id);
5043
+ trekSteps[index].touristicEvents = stepsTouristicEventsResponses[index].results.map(trekTouristicEvent => trekTouristicEvent.id);
5044
+ trekSteps[index].sensitiveAreas = stepsSensitiveAreasResponses[index].results.map(currentSensitiveArea => currentSensitiveArea.id);
5034
5045
  await utils.writeOrUpdateDataInStore('treks', [trekSteps[index]]);
5035
5046
  await utils.writeOrUpdateFilesInStore(trekSteps[index], utils.imagesRegExp, true);
5036
5047
  }
5037
- for (let index = 0; index < stepsTouristicContentsResponses.length; index++) {
5038
- const stepsTouristicContentsResponse = stepsTouristicContentsResponses[index];
5039
- for (let index = 0; index < stepsTouristicContentsResponse.results.length; index++) {
5040
- stepsTouristicContentsResponse.results[index].offline = true;
5041
- await utils.writeOrUpdateDataInStore('touristicContents', [stepsTouristicContentsResponse.results[index]]);
5042
- await utils.writeOrUpdateFilesInStore(stepsTouristicContentsResponse.results[index], utils.imagesRegExp, true);
5043
- }
5044
- }
5045
- for (let index = 0; index < stepsTouristicEventsResponses.length; index++) {
5046
- const stepsTouristicEventsResponse = stepsTouristicEventsResponses[index];
5047
- for (let index = 0; index < stepsTouristicEventsResponse.results.length; index++) {
5048
- stepsTouristicEventsResponse[index].offline = true;
5049
- await utils.writeOrUpdateDataInStore('touristicEvents', [stepsTouristicEventsResponse[index]]);
5050
- await utils.writeOrUpdateFilesInStore(stepsTouristicEventsResponse[index], utils.imagesRegExp, true);
5051
- }
5052
- }
5048
+ // for (let index = 0; index < stepsTouristicContentsResponses.length; index++) {
5049
+ // const stepsTouristicContentsResponse = stepsTouristicContentsResponses[index];
5050
+ // for (let index = 0; index < stepsTouristicContentsResponse.results.length; index++) {
5051
+ // stepsTouristicContentsResponse.results[index].offline = true;
5052
+ // await writeOrUpdateDataInStore('touristicContents', [stepsTouristicContentsResponse.results[index]]);
5053
+ // await writeOrUpdateFilesInStore(stepsTouristicContentsResponse.results[index], imagesRegExp, true);
5054
+ // }
5055
+ // }
5056
+ // for (let index = 0; index < stepsTouristicEventsResponses.length; index++) {
5057
+ // const stepsTouristicEventsResponse = stepsTouristicEventsResponses[index];
5058
+ // for (let index = 0; index < stepsTouristicEventsResponse.results.length; index++) {
5059
+ // stepsTouristicEventsResponse[index].offline = true;
5060
+ // await writeOrUpdateDataInStore('touristicEvents', [stepsTouristicEventsResponse[index]]);
5061
+ // await writeOrUpdateFilesInStore(stepsTouristicEventsResponse[index], imagesRegExp, true);
5062
+ // }
5063
+ // }
5053
5064
  }
5054
5065
  utils.state.treks.find(trek => trek.id === this.currentTrek.id).offline = true;
5055
5066
  if (!utils.state.currentTreks) {
@@ -5133,7 +5144,11 @@ const GrwTrekDetail = class {
5133
5144
  delete trekInStore.networks;
5134
5145
  delete trekInStore.web_links;
5135
5146
  delete trekInStore.update_datetime;
5136
- delete trekInStore.offline;
5147
+ delete trekInStore.information_desks;
5148
+ delete trekInStore.pois;
5149
+ delete trekInStore.touristicContents;
5150
+ delete trekInStore.touristicEvents;
5151
+ delete trekInStore.sensitiveAreas;
5137
5152
  }
5138
5153
  render() {
5139
5154
  var _a, _b, _c, _d, _e;
@@ -5310,10 +5325,6 @@ const GrwTrekProvider = class {
5310
5325
  if (!utils.state.ratingsScale) {
5311
5326
  utils.state.ratingsScale = await utils.getAllDataInStore('ratingsScale');
5312
5327
  }
5313
- if (!utils.state.currentSensitiveAreas) {
5314
- // filter trek items
5315
- utils.state.currentSensitiveAreas = await utils.getAllDataInStore('sensitiveAreas');
5316
- }
5317
5328
  if (!utils.state.labels) {
5318
5329
  utils.state.labels = await utils.getAllDataInStore('labels');
5319
5330
  }
@@ -5323,39 +5334,37 @@ const GrwTrekProvider = class {
5323
5334
  if (!utils.state.accessibilitiesLevel) {
5324
5335
  utils.state.accessibilitiesLevel = await utils.getAllDataInStore('accessibilitiesLevel');
5325
5336
  }
5326
- if (!utils.state.trekTouristicContents) {
5327
- // filter trek items
5328
- const touristicContents = await utils.getAllDataInStore('touristicContents');
5329
- utils.setFilesFromStore(touristicContents, utils.imagesRegExp);
5330
- utils.state.trekTouristicContents = touristicContents;
5331
- }
5332
5337
  if (!utils.state.touristicContentCategories) {
5333
5338
  utils.state.touristicContentCategories = await utils.getAllDataInStore('touristicContentCategories');
5334
5339
  }
5335
- if (!utils.state.trekTouristicEvents) {
5336
- // filter trek items
5337
- utils.state.trekTouristicEvents = await utils.getAllDataInStore('touristicEvents');
5338
- }
5339
5340
  if (!utils.state.touristicEventTypes) {
5340
5341
  utils.state.touristicEventTypes = await utils.getAllDataInStore('touristicEventTypes');
5341
5342
  }
5342
5343
  if (!utils.state.networks) {
5343
5344
  utils.state.networks = await utils.getAllDataInStore('networks');
5344
5345
  }
5345
- if (!utils.state.currentPois) {
5346
- // filter trek items
5347
- const pois = await utils.getAllDataInStore('pois');
5348
- utils.setFilesFromStore(pois, utils.imagesRegExp);
5349
- utils.state.currentPois = pois;
5350
- }
5351
5346
  if (!utils.state.poiTypes) {
5352
5347
  utils.state.poiTypes = await utils.getAllDataInStore('poiTypes');
5353
5348
  }
5354
- if (!utils.state.currentInformationDesks) {
5355
- // filter trek items
5356
- utils.state.currentInformationDesks = await utils.getAllDataInStore('informationDesks');
5357
- }
5358
- // handle images
5349
+ const informationDesksInStore = await utils.getAllDataInStore('informationDesks');
5350
+ const informationDesks = informationDesksInStore.filter(informationDeskInStore => trek.information_desks.some(information_desk => information_desk === informationDeskInStore.id));
5351
+ utils.setFilesFromStore(informationDesks, utils.imagesRegExp);
5352
+ utils.state.currentInformationDesks = informationDesks;
5353
+ const poisInStore = await utils.getAllDataInStore('pois');
5354
+ const pois = poisInStore.filter(poiInStore => trek.pois.some(trekPoi => trekPoi === poiInStore.id));
5355
+ utils.setFilesFromStore(pois, utils.imagesRegExp);
5356
+ utils.state.currentPois = pois;
5357
+ const touristicContentsInStore = await utils.getAllDataInStore('touristicContents');
5358
+ const touristicContents = touristicContentsInStore.filter(touristicContentInStore => trek.touristicContents.some(trekTouristicContent => trekTouristicContent === touristicContentInStore.id));
5359
+ utils.setFilesFromStore(touristicContents, utils.imagesRegExp);
5360
+ utils.state.trekTouristicContents = touristicContents;
5361
+ const touristicEventsInStore = await utils.getAllDataInStore('touristicEvents');
5362
+ const touristicEvents = touristicEventsInStore.filter(touristicEventInStore => trek.touristicEvents.some(trekTouristicEvent => trekTouristicEvent === touristicEventInStore.id));
5363
+ utils.setFilesFromStore(touristicEvents, utils.imagesRegExp);
5364
+ utils.state.trekTouristicEvents = await utils.getAllDataInStore('touristicEvents');
5365
+ const sensitiveAreasInStore = await utils.getAllDataInStore('sensitiveAreas');
5366
+ const sensitiveAreas = sensitiveAreasInStore.filter(sensitiveAreaInStore => trek.sensitiveAreas.some(trekSensitiveArea => trekSensitiveArea === sensitiveAreaInStore.id));
5367
+ utils.state.currentSensitiveAreas = sensitiveAreas;
5359
5368
  utils.setFilesFromStore(trek, utils.imagesRegExp);
5360
5369
  utils.state.currentTrek = trek;
5361
5370
  }
@@ -5384,7 +5393,7 @@ const GrwTrekProvider = class {
5384
5393
  try {
5385
5394
  Promise.all([
5386
5395
  ...requests,
5387
- fetch(`${this.api}sensitivearea/?language=${utils.state.language}&published=true&trek=${this.trekId}&period=ignore&fields=id,geometry,name,description,contact,info_url,period,practices`, this.init)
5396
+ pagination.getSensitiveAreasNearTrek(utils.state.api, utils.state.language, this.trekId, this.init)
5388
5397
  .then(response => {
5389
5398
  if (response.ok) {
5390
5399
  return response;
@@ -5399,7 +5408,7 @@ const GrwTrekProvider = class {
5399
5408
  fetch(`${utils.state.api}label/?language=${utils.state.language}&fields=id,name,advice,pictogram`, this.init),
5400
5409
  fetch(`${utils.state.api}source/?language=${utils.state.language}&fields=id,name,website,pictogram`, this.init),
5401
5410
  fetch(`${utils.state.api}trek_accessibility_level/?language=${utils.state.language}&fields=id,name`, this.init).catch(() => new Response('null')),
5402
- fetch(`${utils.state.api}poi/?language=${utils.state.language}&trek=${this.trekId}&published=true&fields=id,name,description,attachments,type,geometry&page_size=999`, this.init),
5411
+ pagination.getPoisNearTrek(utils.state.api, utils.state.language, this.trekId, this.init),
5403
5412
  fetch(`${utils.state.api}poi_type/?language=${utils.state.language}&fields=id,pictogram`, this.init),
5404
5413
  fetch(`${utils.state.api}informationdesk/?language=${utils.state.language}&fields=id,name,description,type,phone,email,website,municipality,postal_code,street,photo_url,latitude,longitude&page_size=999`, this.init),
5405
5414
  getTouristicContentsNearTrek(utils.state.api, utils.state.language, this.trekId, this.init),