@expofp/floorplan 3.11.12 → 3.12.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 (198) hide show
  1. package/dist/browser/{Button-CdChKHNd.js → Button-CxYYwdV3.js} +6 -6
  2. package/dist/browser/CookieConsent-Cltod-AQ.js +38 -0
  3. package/dist/browser/{Debug-BQJRkSVw.js → Debug-DnZLaoNY.js} +14 -14
  4. package/dist/browser/{Demo-Dh5hQ00u.js → Demo-CbuT3wW6.js} +14 -14
  5. package/dist/browser/{Free-Be0wdt8h.js → Free-CVEJPdaI.js} +16 -16
  6. package/dist/browser/{Gallery-DsC-3InH.js → Gallery-D2dTKIqn.js} +24 -24
  7. package/dist/browser/{GpsLoader-l-DhiN5_.js → GpsLoader-Bpn0jys4.js} +51 -50
  8. package/dist/browser/{KioskStore-hBGigttj.js → KioskStore-Bf3tKr77.js} +31 -31
  9. package/dist/browser/{MaplibreAdapter-B2PgQxAb.js → MaplibreAdapter-D6Fqdelu.js} +2360 -2331
  10. package/dist/browser/{ModalContainer-DngQzOVE.js → ModalContainer-C7E4QKwY.js} +13 -13
  11. package/dist/browser/{PermissionNotice-Bstp1Ig2.js → PermissionNotice-CTckXfzd.js} +7 -7
  12. package/dist/browser/{SetKioskMode-BXTIENxU.js → SetKioskMode-BPvChiTX.js} +9 -9
  13. package/dist/browser/ShowKiosk-97iuNiDq.js +33 -0
  14. package/dist/browser/{TouchHand-CZ4-CE4e.js → TouchHand-BEPM0Ix6.js} +5 -5
  15. package/dist/browser/{ViewerMenuPanel-Dc7XYnXW.js → ViewerMenuPanel-CTDMmojE.js} +25 -25
  16. package/dist/browser/{add-debug-secret-listener-DOVFjqJo.js → add-debug-secret-listener-rtzwkssg.js} +1 -1
  17. package/dist/browser/{boolean-editor-B-S4WhPP.js → boolean-editor-Buj1Gh2Q.js} +10 -10
  18. package/dist/browser/{bootIntercom-D41iCVYM.js → bootIntercom-CLXK1aCU.js} +3 -3
  19. package/dist/browser/{booth-by-xy-S_lLb4ur.js → booth-by-xy-DYsVPBrO.js} +292 -295
  20. package/dist/browser/bundle.json +78 -63
  21. package/dist/browser/{classnames-BeH2kA4o.js → classnames-C7JqIDkz.js} +2 -2
  22. package/dist/browser/{client-Be_UxAZT.js → client-DRCaFfyq.js} +5 -5
  23. package/dist/browser/{components-RZNETvKi.js → components-CoSFc4pe.js} +1369 -1316
  24. package/dist/browser/{debug-overlay-DjwfpG69.js → debug-overlay-l2O5ATYR.js} +415 -415
  25. package/dist/browser/{debug-ui-D_afzMrh.js → debug-ui-fkLeLMTN.js} +7 -7
  26. package/dist/browser/{dist-B-m8ZFBo.js → dist-B8Jegpa2.js} +4 -4
  27. package/dist/browser/{dist-CZz9piI4.js → dist-Br0u22MB.js} +6 -6
  28. package/dist/browser/{dist-DKu24Nie.js → dist-DQ04vk8X.js} +7 -7
  29. package/dist/browser/{browser-pQxW93uF.js → efp-debug-init-DolwvXvu.js} +61 -14
  30. package/dist/browser/enum-editor-BRlr42ZG.js +34 -0
  31. package/dist/browser/{es5-DPnfG3EX.js → es5-hugWWUki.js} +2 -2
  32. package/dist/browser/{event-not-found-CE2zhFPJ.js → event-not-found-DrCgFYgQ.js} +1 -1
  33. package/dist/browser/{exports-BtXbxSeU.js → exports-DY1Pe4xZ.js} +1 -1
  34. package/dist/browser/{favicon-B7xwIKyS.js → favicon-v6HqMJRd.js} +1 -1
  35. package/dist/browser/{fetch-retry.umd-BiAebF_i.js → fetch-retry.umd-CtpzesBT.js} +2 -2
  36. package/dist/browser/{flex-DGirEfRz.js → flex-5lvsJlaO.js} +6 -6
  37. package/dist/browser/{floorplan.loader-DSx2rwZS.js → floorplan.loader-D4AZdgsy.js} +890 -902
  38. package/dist/browser/floorplan.ready-BnsAv7j1.js +1326 -0
  39. package/dist/browser/{fuse-BuZwVNBr.js → fuse-BWnB1Pgo.js} +2 -2
  40. package/dist/browser/i18n-wZml67KB.js +8659 -0
  41. package/dist/browser/index.js +49 -117
  42. package/dist/browser/{index.module-BktNOlw2.js → index.module-GNnIO9vr.js} +23 -23
  43. package/dist/browser/integrateKiosk-uxqH2FgD.js +28 -0
  44. package/dist/browser/{is-webview-DxtfBbGj.js → is-webview-BlxQlyaS.js} +1 -1
  45. package/dist/browser/{jsx-runtime-DftMjMlZ.js → jsx-runtime-xVcN9g8F.js} +2 -2
  46. package/dist/browser/{lib-_QD5dt19.js → lib-CIYjsvFB.js} +5 -5
  47. package/dist/browser/loadImage-DZxHBSrL.js +58 -0
  48. package/dist/browser/{logDeviceInfo-CiCKGxKy.js → logDeviceInfo-BQn3HG5l.js} +9 -9
  49. package/dist/browser/{main-C6h73Uc5.js → main-DKRaY1QU.js} +1 -1
  50. package/dist/browser/mobx-rpWRRJB9.js +24 -0
  51. package/dist/browser/optional-boolean-editor-fWgfIGvs.js +20 -0
  52. package/dist/browser/optional-enum-editor-CQ8-ut60.js +34 -0
  53. package/dist/browser/optional-string-editor-BP4b7LsR.js +30 -0
  54. package/dist/browser/{particles.min-CiLQfUCo.js → particles.min-D-VdW4Qr.js} +2 -2
  55. package/dist/browser/{prop-types-8E5fCOgQ.js → prop-types-CE7JeEE-.js} +2 -2
  56. package/dist/browser/{react-B9lmaQYI.js → react-DxSEhu-j.js} +2 -2
  57. package/dist/browser/{react-dom-CPWfZdj5.js → react-dom-CqQZIZ5q.js} +4 -4
  58. package/dist/browser/reset-all-settings--GzHxj4F.js +190 -0
  59. package/dist/browser/{rolldown-runtime-CJax_ib9.js → rolldown-runtime-Ik1ocWLm.js} +1 -1
  60. package/dist/browser/{enum-editor-BtYkUhft.js → select-DQmL3TsB.js} +261 -283
  61. package/dist/browser/{settings-BufKqYwI.js → settings-BndqjdZx.js} +3 -3
  62. package/dist/browser/{settings-item-D3AzjjoO.js → settings-item-5zzAH3FT.js} +7 -7
  63. package/dist/browser/{store-DGdGzsa_.js → store-CgXKlx2n.js} +7328 -7646
  64. package/dist/browser/string-editor-Bxbp0JHl.js +30 -0
  65. package/dist/browser/text-field-ySWl7XqC.js +88 -0
  66. package/dist/browser/{theme-DvIMSzdB.js → theme-ByGstXaJ.js} +9 -9
  67. package/dist/browser/ui-LJGsaayP.js +43 -0
  68. package/dist/browser/{useRenderTarget-hqd7cVeW.js → useRenderTarget-DaUlOis9.js} +5 -5
  69. package/dist/esm/components/Booth/Booth.js +1 -1
  70. package/dist/esm/components/EntityListRow.js +1 -1
  71. package/dist/esm/components/Exhibitor.js +1 -1
  72. package/dist/esm/components/Kiosk/ShowKiosk.js +1 -1
  73. package/dist/esm/components/LanguageRowContainer.d.ts +1 -0
  74. package/dist/esm/components/Layout.d.ts +2 -1
  75. package/dist/esm/components/Layout.js +1 -1
  76. package/dist/esm/components/LogoOverlay.js +1 -1
  77. package/dist/esm/components/Map/Map.js +1 -1
  78. package/dist/esm/components/Map/drawing/config/config-bg.d.ts +1 -1
  79. package/dist/esm/components/Map/drawing/config/config-booth-badge.js +1 -1
  80. package/dist/esm/components/Map/drawing/config/config-booth-bg.d.ts +1 -1
  81. package/dist/esm/components/Map/drawing/config/config-booth-bg.js +1 -1
  82. package/dist/esm/components/Map/drawing/config/config-booth-bookmark.js +1 -1
  83. package/dist/esm/components/Map/drawing/config/config-booth-labels-special.js +2 -2
  84. package/dist/esm/components/Map/drawing/config/config-booth-labels.js +1 -1
  85. package/dist/esm/components/Map/drawing/config/config-load-layer.js +1 -1
  86. package/dist/esm/components/Map/drawing/config/loadBoothsImages.js +1 -1
  87. package/dist/esm/components/Maplibre/MaplibreAdapter.js +1 -1
  88. package/dist/esm/components/Maplibre/MaplibreWrapper.js +1 -1
  89. package/dist/esm/components/Maplibre/utils/resolve-map-style.d.ts +15 -0
  90. package/dist/esm/components/Maplibre/utils/resolve-map-style.js +1 -0
  91. package/dist/esm/components/Menu.d.ts +3 -2
  92. package/dist/esm/components/Menu.js +1 -1
  93. package/dist/esm/components/OverlayContainer.d.ts +2 -1
  94. package/dist/esm/components/OverlayContainer.js +1 -1
  95. package/dist/esm/components/Ws.js +1 -1
  96. package/dist/esm/constants.d.ts +7 -13
  97. package/dist/esm/constants.js +1 -1
  98. package/dist/esm/data/fp-payloads.d.ts +27 -0
  99. package/dist/esm/data/fp-payloads.js +1 -0
  100. package/dist/esm/data/fpGeo.js +1 -1
  101. package/dist/esm/data/index.d.ts +8 -2
  102. package/dist/esm/data/index.js +1 -1
  103. package/dist/esm/data/svg.d.ts +4 -1
  104. package/dist/esm/data/svg.js +1 -1
  105. package/dist/esm/floorplan.loader.d.ts +13 -4
  106. package/dist/esm/floorplan.loader.js +1 -1
  107. package/dist/esm/floorplan.ready.d.ts +8 -0
  108. package/dist/esm/floorplan.ready.js +1 -1
  109. package/dist/esm/index.d.ts +0 -1
  110. package/dist/esm/index.js +1 -1
  111. package/dist/esm/intercom/shouldLoad.d.ts +2 -2
  112. package/dist/esm/intercom/shouldLoad.js +1 -1
  113. package/dist/esm/load-dev.d.ts +44 -0
  114. package/dist/esm/load-dev.js +1 -0
  115. package/dist/esm/load.d.ts +3 -3
  116. package/dist/esm/load.js +3 -3
  117. package/dist/esm/renderer/engine-core/fonts.js +1 -1
  118. package/dist/esm/services/URLFilterManager.d.ts +15 -0
  119. package/dist/esm/services/URLFilterManager.js +1 -1
  120. package/dist/esm/services/multi-slug.d.ts +20 -0
  121. package/dist/esm/services/multi-slug.js +1 -0
  122. package/dist/esm/services/url-dispatch.d.ts +24 -0
  123. package/dist/esm/services/url-dispatch.js +1 -0
  124. package/dist/esm/services/url-sync.d.ts +36 -0
  125. package/dist/esm/services/url-sync.js +1 -0
  126. package/dist/esm/store/BoothStore.d.ts +2 -1
  127. package/dist/esm/store/ExhibitorStore.d.ts +3 -2
  128. package/dist/esm/store/ExhibitorStore.js +1 -1
  129. package/dist/esm/store/LayerStore.js +1 -1
  130. package/dist/esm/store/MaplibreStore.js +1 -1
  131. package/dist/esm/store/PoiTypeStore.d.ts +1 -1
  132. package/dist/esm/store/SearchStore.js +1 -1
  133. package/dist/esm/store/UIState.d.ts +1 -5
  134. package/dist/esm/store/UIState.js +1 -1
  135. package/dist/esm/store/init/init-bookmarks.d.ts +2 -0
  136. package/dist/esm/store/init/init-booths.js +1 -1
  137. package/dist/esm/store/init/init-categories.js +1 -1
  138. package/dist/esm/store/init/init-events.js +1 -1
  139. package/dist/esm/store/init/init-exhibitors.js +1 -1
  140. package/dist/esm/store/init/init-layers.js +1 -1
  141. package/dist/esm/store/types.d.ts +2 -1
  142. package/dist/esm/tools/event-not-found.d.ts +4 -3
  143. package/dist/esm/tools/gtag.d.ts +3 -2
  144. package/dist/esm/tools/gtag.js +1 -1
  145. package/dist/esm/tools/handleDebugMode.d.ts +17 -0
  146. package/dist/esm/tools/handleDebugMode.js +1 -1
  147. package/dist/esm/tools/loaders.d.ts +0 -2
  148. package/dist/esm/tools/loaders.js +1 -1
  149. package/dist/esm/tools/rebookingUrl.js +1 -1
  150. package/dist/esm/tools/reset.js +1 -1
  151. package/dist/esm/tools/settings.js +1 -1
  152. package/dist/esm/tools/track-event.js +1 -1
  153. package/dist/esm/types/drawing.types.d.ts +18 -0
  154. package/dist/esm/types.d.ts +52 -38
  155. package/dist/esm/utils/areLayersEnabled.js +1 -1
  156. package/dist/esm/utils/camera-map-settings.d.ts +20 -0
  157. package/dist/esm/utils/camera-map-settings.js +1 -0
  158. package/dist/esm/utils/customCommands.js +1 -1
  159. package/dist/esm/utils/getLogoUrl.d.ts +8 -1
  160. package/dist/esm/utils/getLogoUrl.js +1 -1
  161. package/dist/esm/utils/heatmap-enabled.d.ts +13 -0
  162. package/dist/esm/utils/heatmap-enabled.js +1 -0
  163. package/dist/esm/utils/i18n.js +1 -1
  164. package/dist/esm/utils/imageloader.js +1 -1
  165. package/dist/esm/utils/is-debug.d.ts +0 -8
  166. package/dist/esm/utils/is-debug.js +1 -1
  167. package/dist/esm/utils/legacy-storage-keys.d.ts +16 -0
  168. package/dist/esm/utils/legacy-storage-keys.js +1 -0
  169. package/dist/esm/utils/loadCustomCss.d.ts +2 -2
  170. package/dist/esm/utils/mapEntity.d.ts +1 -0
  171. package/dist/esm/utils/preview-exhibitor.d.ts +1 -1
  172. package/dist/esm/wayfinding/adapters/graphDataSource.d.ts +1 -1
  173. package/dist/esm/wayfinding/adapters/graphDataSource.js +1 -1
  174. package/package.json +8 -5
  175. package/dist/browser/CookieConsent-DmWcbyRQ.js +0 -38
  176. package/dist/browser/ShowKiosk-CpIQKRDF.js +0 -28
  177. package/dist/browser/efp-debug-init-B-EZE_S2.js +0 -42
  178. package/dist/browser/floorplan.ready-CX4L0Qyc.js +0 -1406
  179. package/dist/browser/i18n-BqlnpLSm.js +0 -3942
  180. package/dist/browser/loadImage-CvnSDOL0.js +0 -121
  181. package/dist/browser/mobx-71cpvuRe.js +0 -24
  182. package/dist/browser/reset-all-settings-CAVnp-HU.js +0 -141
  183. package/dist/browser/string-editor-BEBEF1X7.js +0 -108
  184. package/dist/browser/ui-DIQ3vheI.js +0 -43
  185. package/dist/esm/_NEW_types.d.ts +0 -6
  186. package/dist/esm/_NEW_types.js +0 -1
  187. package/dist/esm/_misc_to_move/manifest.d.ts +0 -14
  188. package/dist/esm/_misc_to_move/ref.d.ts +0 -6
  189. package/dist/esm/_misc_to_move/ref.js +0 -1
  190. package/dist/esm/data/Flags.d.ts +0 -23
  191. package/dist/esm/data/Flags.js +0 -1
  192. package/dist/esm/data/validate-data.d.ts +0 -3
  193. package/dist/esm/data/validate-data.js +0 -1
  194. package/dist/esm/services/routing.d.ts +0 -7
  195. package/dist/esm/services/routing.js +0 -1
  196. package/dist/esm/utils/mergeExhibitors.d.ts +0 -3
  197. package/dist/esm/utils/mergeExhibitors.js +0 -1
  198. /package/dist/esm/{_misc_to_move/manifest.js → types/drawing.types.js} +0 -0
@@ -1 +1 @@
1
- import{jsx as g,Fragment as C,jsxs as T}from"react/jsx-runtime";import{Box as S}from"@expofp/geometry";import{optimizeWaypointOrder as M}from"@expofp/wayfinding";import{ErrorBoundary as I}from"@sentry/react";import R from"debug";import{reaction as V}from"mobx";import{createRoot as $}from"react-dom/client";import{install as z}from"resize-observer";import j from"./components/Layout";import{LANG_KEY as G,MAX_ROUTE_WAYPOINTS as m,PATHWAY_KEY as q}from"./constants";import{fpGeo as x}from"./data/fpGeo";import N from"./floorplan.loader";import{shouldLoadIntercom as O}from"./intercom";import{BoundsSchema as _,POISelectorsSchema as E,ZoomToOptionsSchema as w}from"./schemas/sdk.schemas";import{applyParameters as Y,destroyHistory as H,initRouting as U}from"./services/routing";import r from"./store";import{destroyUiHandlers as D}from"./store/init/init-ui";import{findBooth as P,Route as v,separateExternalIds as B}from"./store/RouteStore";import{destroyGtag as K,GaEventActions as F,sendEventToGa as A,setConsentSettings as W}from"./tools/gtag";import X from"./tools/report-error";import{resetGlobalVariables as Q}from"./tools/reset";import Z from"./tools/track-event";import{getStorage as k}from"./utils/entity-storage";import{convertLocalToGps as J,isValidPointCoords as y}from"./utils/gps";import{getLocales as ee,hasLocale as te}from"./utils/i18n";import{mapEntity as p}from"./utils/mapEntity";const b=R("efp:api");z();export default class re extends N{root;init(){this.ignoreQuery||U(this.offHistory),Z("load"),r.fp=this,W(this.allowConsent),A(F.Load,""),this.root=$(this.renderTarget),this.root.render(g(I,{children:g(j,{offHistory:this.offHistory,allowConsent:this.allowConsent})})),A(F.Rendered,""),V(()=>r.layerStore.layersLoaded,()=>{this.resolveReady(),r.initialized||this.onInit?.(this),r.initialized=!0});const e=O(window.__data);e&&import("./intercom/bootIntercom").then(({bootIntercom:t})=>t(e)).catch(()=>{})}selectBooth(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectBooth","Parameter must be a string or an array of strings.","EFP000000");return}const t=r.boothStore.booths.filter(i=>typeof e=="string"?i.name===e||i.externalId===e:e.includes(i.name)||e.includes(i.externalId));r.selectBooth(t)}selectExhibitor(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectExhibitor","Parameter must be a string or an array of strings.","EFP000100");return}if(!e?.length){r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null;return}const t=r.exhibitorStore.exhibitors.filter(o=>typeof e=="string"?o.name===e||o.externalId===e:e.includes(o.name)||e.includes(o.externalId));if(!t?.length)return;if(typeof e=="string"){r.selectExhibitor(t[0]),r.moveToList([t[0]]);return}const i=t.flatMap(o=>o.booths.map(s=>s.layer)),{description:n}=i.reduce((o,s)=>(o.freq[s.description]=(o.freq[s.description]||0)+1,o.freq[s.description]>o.maxCount&&(o.maxCount=o.freq[s.description],o.mostFrequent=s),o),{freq:{},mostFrequent:i[0],maxCount:0}).mostFrequent;r.layerStore.updateVisibility(n,!0),r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null,r.uiState.list={type:"filter",items:t,query:{key:"exhibitors",value:t.map(o=>o.externalId).join(",")}},r.moveToList()}highlightExhibitors(e){Array.isArray(e)||a("highlightExhibitors","Parameter must be an array of strings.","EFP000200"),r.boothStore.highlightedByExternalIds=[],r.exhibitorStore.highlightedByExternalIds=[...e]}highlightBooths(e){Array.isArray(e)||a("highlightBooths","Parameter must be an array of strings.","EFP000300"),r.exhibitorStore.highlightedByExternalIds=[],r.boothStore.highlightedByExternalIds=[...e]}highlightEntities(e){Array.isArray(e)||a("highlightEntities","Parameter must be an array of strings.","EFP000400");const{boothExternalIds:t,exhibitorExternalIds:i}=B(e);r.boothStore.highlightedByExternalIds=[...t],r.exhibitorStore.highlightedByExternalIds=[...i]}selectRoute(e,t){if(Array.isArray(e)){let i=[...e];const n=i.shift(),o=i.pop();if(i.length>m)throw new Error(`The maximum number of waypoints is ${m}.`);if(!n||!o){a("selectRoute","Invalid route format: When providing an array, it must include at least two points: a start and a destination.","EFP000401");return}r.routeStore.selectRoute(new v(d(n),d(o),i.map(d)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),r.routeStore.selectRoute(new v(d(e),d(t)))}getOptimizedRoutes(e){if(!Array.isArray(e))return a("getOptimizedRoutes","Parameter must be an array.","EFP000500"),[];if(e.length>m)throw new Error(`The maximum number of waypoints is ${m}.`);const t=e.map(d).filter(n=>!!n);if(!t.length)throw new Error("No booths found for the provided waypoints.");const i=new Map;for(const n of t){const o=n.layer?.name??"",s=i.get(o);s?s.push(n):i.set(o,[n])}return Array.from(i.values()).map(n=>({waypoints:M(n.map(o=>[o.name,{x:o.rect.center.x,y:o.rect.center.y}]))}))}selectCurrentPosition(e,t,i){const n=y(e.x)&&y(e.y),o=y(e.lng)&&y(e.lat);!n&&!o&&a("selectCurrentPosition","A point must be passed. Either (x,y) or (lat,lng) are required.","EFP000600"),r.routeStore.selectCurrentPosition(e,t,i),this.onCurrentPositionChanged?.(e)}setBookmarks(e){(!Array.isArray(e)||!e.length)&&a("setBookmarks","Parameter must be an array.","EFP000700"),e.forEach(t=>{const i=r.exhibitorStore.exhibitors.find(n=>n.name===t.name||n.externalId===t.externalId);i&&(i.bookmarked=t.bookmarked)})}setEntitiesBookmarks(e){if(!Array.isArray(e)||!e.length){a("setEntitiesBookmarks","Parameter must be an array.","EFP000701");return}const t=["exhibitor","event","speaker","booth"],i=e.find(s=>!s.type||!t.includes(s.type));if(i){a("setEntitiesBookmarks",`Invalid entity type: ${i.type}. Must be one of: ${t.join(", ")}.`,"EFP000702");return}const n=k("bookmarked"),o={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:s=>r.exhibitorStore.findExhibitor(s),replacer:s=>r.exhibitorStore.replaceBookmarked(s)},event:{existingIds:new Set(n.events||[]),finder:s=>r.eventStore.findByNameOrSlug(s),replacer:s=>r.eventStore.replaceBookmarked(s)},speaker:{existingIds:new Set(n.speakers||[]),finder:s=>r.speakerStore.speakers.find(h=>h.name===s||h.externalId===s||h.slug===s),replacer:s=>r.speakerStore.replaceBookmarked(s)},booth:{existingIds:new Set(n.booths||[]),finder:s=>{const h=r.boothStore.findBooth(s);return h?.exhibitors.length===0?h:void 0},replacer:s=>r.boothStore.replaceBookmarked(s)}};e.forEach(s=>{const h=o[s.type],c=s.name||s.externalId||"",u=h.finder(c);u?s.bookmarked?h.existingIds.add(u.id):h.existingIds.delete(u.id):console.warn(`Entity not found: ${s.type} with query "${c}"`)}),Object.values(o).forEach(s=>{s.replacer(Array.from(s.existingIds))})}setEntitiesVisited(e){if(!Array.isArray(e)||!e.length){a("setEntitiesVisited","Parameter must be an array.","EFP000703");return}const t=["exhibitor","event"],i=e.find(s=>!s.type||!t.includes(s.type));if(i){a("setEntitiesVisited",`Invalid entity type: ${i.type}. Must be one of: ${t.join(", ")}.`,"EFP000704");return}const n=k("visited"),o={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:s=>r.exhibitorStore.findExhibitor(s),replacer:s=>r.exhibitorStore.replaceVisited(s)},event:{existingIds:new Set(n.events||[]),finder:s=>r.eventStore.findByNameOrSlug(s),replacer:s=>r.eventStore.replaceVisited(s)}};e.forEach(s=>{const h=o[s.type],c=s.name||s.externalId||"",u=h.finder(c);u?s.visited?h.existingIds.add(u.id):h.existingIds.delete(u.id):console.warn(`Entity not found: ${s.type} with query "${c}"`)}),Object.values(o).forEach(s=>{s.replacer(Array.from(s.existingIds))})}setMarkers(e){if(!e||!Array.isArray(e.icons)||!Array.isArray(e.markers)){a("setMarkers","Invalid input.","EFP000800");return}r.routeStore.setMarkers(e)}selectMarker(e,t=!0){return typeof e!="string"&&a("selectMarker","The identifier must be passed.","EFP000900"),r.routeStore.selectMarker(e,t)}drawCircles(e){Array.isArray(e)||a("drawCircles","Invalid input.","EFP000A00"),r.uiState.debugCircles=e}checkRoutes(){r.routeStore.checkRoutes()}updateLayerVisibility(e,t){typeof e!="string"&&a("updateLayerVisibility","The layer name (string) must be passed.","EFP000B00"),t||a("updateLayerVisibility","Passing a false value to visible will have no effect.","EFP000B01"),r.layerStore.updateVisibility(e,t)}getCenterCoordinates(){return r.fp.getCenterCoordinates()}exhibitorsList(){return r.exhibitorStore.exhibitors.map(e=>p(e))}boothsList(){return r.boothStore.booths.map(e=>p(e))}categoriesList(){return r.categoryStore.categories.map(e=>p(e))}selectCategory(e){if(e==null||typeof e!="string"){r.searchStore.selectSearch();return}const t=e?.toLowerCase(),i=r.categoryStore.categories.find(({name:n,slug:o})=>n?.toLowerCase()===t||o?.toLowerCase()===t);if(!i){a("selectCategory",`Category ${e} not found.`,"EFP000C01");return}r.selectCategory(i)}applyParameters(e){typeof e!="string"&&a("applyParameters","A query string must be passed.","EFP000D00"),Y(e)}getVisibility(){return r.uiState.visibility}setVisibility(e){(typeof e!="object"||!Object.keys(e).length)&&a("setVisibility","The parameter must be passed.","EFP000E00"),r.uiState.setVisibility(e)}findLocation(){r.routeStore.findLocation()}zoomIn(){r.uiState.zoomIn()}zoomOut(){r.uiState.zoomOut()}switchView(){r.maplibreStore.activateMaplibre()}zoomTo(e,t){b("zoomTo called with selectors=%O options=%O",e,t);const i=E.safeParse(e);if(!i.success){a("zoomTo",i.error.message,"EFP001600");return}const n=w.safeParse(t);if(!n.success){a("zoomTo",n.error.message,"EFP001601");return}const o=this.getBounds(e);o&&this.fitBounds(o,t)}getBounds(e){b("getBounds called with selectors=%O",e);const t=E.safeParse(e);if(!t.success){a("getBounds",t.error.message,"EFP001400");return}const i=[];if(e.booths?.forEach(o=>{let s;o.externalId?s=r.boothStore.boothByExternalId.get(o.externalId):o.name&&(s=r.boothStore.boothByName.get(o.name.toLowerCase())),s?.rect&&i.push(s.rect)}),e.exhibitors?.forEach(o=>{let s;o.externalId?s=r.exhibitorStore.exhibitorByExternalId.get(o.externalId):o.name&&(s=r.exhibitorStore.exhibitorByName.get(o.name.toLowerCase())),s?.booths?.forEach(h=>{h.rect&&i.push(h.rect)})}),i.length===0)return;const n=S.fromUnion(...i);return{leftTop:{x:n.min.x,y:n.min.y},rightBottom:{x:n.max.x,y:n.max.y}}}fitBounds(e,t){if(b("fitBounds called with bounds=%O options=%O",e,t),!e){r.uiState.fitBounds();return}const i=_.safeParse(e);if(!i.success){a("fitBounds",i.error.message,"EFP001500");return}const n=w.safeParse(t);if(!n.success){a("fitBounds",n.error.message,"EFP001501");return}const o=S.fromMinMax({x:e.leftTop.x,y:e.leftTop.y},{x:e.rightBottom.x,y:e.rightBottom.y});r.uiState.moveToRect=t?.padding?o.expand(t.padding):o}getBoothRect(e){typeof e!="string"&&a("getBoothRect","A booth name must be passed.","EFP000F00");const t=P(e)?.rect;return t?l.fromBox(t):void 0}convertToGeo(e,t){if(!x?.properties?.config){a("convertToGeo","The coordinates cannot be converted because the GPS configuration is not defined.","EFP001000");return}if(!e||!t){a("convertToGeo","Both coordinates must be passed.","EFP001001");return}return J(e,t,x.properties.config)}getGeoConfig(){const e=x?.properties?.config;return e?{bearing:e.bearing??0,p0:e.p0,p1:e.p1,p2:e.p2}:null}unstable_destroy(){let e=window.__efpElement.firstChild;Q(),window.removeEventListener("__efpStyleLoad",this.efpStyleLoadHandler),window.removeEventListener("error",X),r.maplibreStore.dispose(),H(),D(),K(),[...document.getElementsByTagName("script")].filter(i=>i.src.indexOf("/fp.svg")>-1||i.src.indexOf("/wf.data.js")>-1||i.src.indexOf("/data.js")>-1).forEach(i=>i.remove()),this.root.unmount(),e.remove()}search(e){return typeof e!="string"&&a("search","A search string must be passed.","EFP001100"),r.fuzzySearchEngineStore.loadEngine().then(()=>(r.searchStore.selectSearch(e),r.uiState.fuzzySearchItems.map(t=>({item:p(t.item),score:t.score}))))}getFloors(){return r.layerStore.floors.map(e=>({name:e.name,shortName:e.shortName,description:e.description,active:e.active,disabled:e.disabled,index:e.index}))}activateFloor(e){if(!e?.name&&e?.index==null){a("activateFloor","Invalid floorId. It must contain either a name or an index.","EFP001200");return}const t=this.getFloors();if(e.name){const i=t.find(n=>n.name===e.name||n.shortName===e.name);if(!i){a("activateFloor",`Floor with name "${e.name}" not found.`,"EFP001201");return}if(i.active)return;this.updateLayerVisibility(i.name,!0);return}if(e.index!==null){const i=t.find(o=>o.index===e.index),n=i?.name;if(!n){a("activateFloor",`Floor at index ${e.index} does not exist.`,"EFP001203");return}if(i.active)return;this.updateLayerVisibility(n,!0);return}}showPathway(e,t){const i=new URLSearchParams;if(i.set(q,e),t?.length){const{boothExternalIds:n,exhibitorExternalIds:o}=B(t);n.length>0&&i.set("booths",n.join(",")),o.length>0&&i.set("exhibitors",o.join(","))}this.applyParameters(i.toString())}showPathwayOnly(e,t){this.activateFloor({name:t}),r.layerStore.showPathWay(e),r.uiState.setPathwayOnlyMode(!0);const i=r.layerStore.findLayer(e),n=r.layerStore.findLayer(t),o=i?.rect||i?.viewbox?i:n;if(o?.rect||o?.viewbox){const s=o.viewbox??o.rect;r.uiState.moveToRect=s.clone()}}hidePathways(){this.highlightBooths([]),r.layerStore.hidePathways(),r.uiState.setPathwayOnlyMode(!1)}showSearch(){r.selectSearch("")}changeLanguage(e){const t=e?.toLowerCase?.();if(!te(t)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${ee().map(n=>n.id).join(",")}`,"EFP001300");return}const i=new URLSearchParams;i.set(G,t),this.applyParameters(i.toString())}isGpsTrackingEnabled(){return r.routeStore.gpsEnabled}setGpsTrackingEnabled(e){r.routeStore.setGpsTrackingEnabled(e)}deselectCurrentPosition(){r.routeStore.selectCurrentPosition(null,!1)}deselectRoute(){r.routeStore.selectRoute(null),r.routeStore.setOnlyAccessible(!1)}reset(){this.selectBooth(""),this.selectExhibitor(""),this.selectCategory(),this.deselectCurrentPosition(),this.deselectRoute(),this.highlightEntities([]),r.uiState.kioskData&&r.resetCameraFn?r.resetCameraFn?.():this.fitBounds()}selectAccessibleRoute(e){r.routeStore.setOnlyAccessible(!0),this.selectRoute(e)}}function d(f){return typeof f=="string"?P(f):r.routeStore.getNearestBooth(f)}let L=0;function a(f,e,t){const i=`Error calling "${f}" SDK method.`,n=`${e.endsWith(".")?e:e+"."} More information at`;let o="https://js-sdk.expofp.com/api/packages";if(t&&(o+=`#error-${t}`),console.error(`${i} ${n} ${o}`),r.fp.disableRuntimeAlerts)return;r.uiState.setGlobalErrorMessage({title:i,body:T(C,{children:[n," ",g("a",{href:o,target:"_blank",rel:"noreferrer",children:o})]})}),clearTimeout(L);const s=8e3;L=window.setTimeout(()=>{const h=async()=>{r.uiState.globalErrorMessages.length>0&&(r.uiState.popGlobalErrorMessage(),await new Promise(c=>setTimeout(c,s/2)),h())};h()},s)}class l{x1;y1;x2;y2;get h(){return Math.abs(this.y2-this.y1)}get w(){return Math.abs(this.x2-this.x1)}get cx(){return(this.x1+this.x2)/2}get cy(){return(this.y1+this.y2)/2}constructor(e,t,i,n){if(e>i){const o=e;e=i,i=o}if(t>n){const o=t;t=n,n=o}this.x1=e,this.y1=t,this.x2=i,this.y2=n}static fromBox(e){return new l(e.min.x,e.min.y,e.max.x,e.max.y)}static fromCxcywh(e,t,i,n){return new l(e-i/2,t-n/2,e+i/2,t+n/2)}contains(e){return e.x1>=this.x1&&e.x2<=this.x2&&e.y1>=this.y1&&e.y2<=this.y2}intersects(e){const t=Math.max(this.x1,e.x1),i=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),o=Math.min(this.y2,e.y2);return i>=t&&o>=n}getIntersection(e){const t=Math.max(this.x1,e.x1),i=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),o=Math.min(this.y2,e.y2);return i>=t&&o>=n?new l(t,n,i,o):new l(0,0,0,0)}getRotated90(){return l.fromCxcywh(this.cx,this.cy,this.h,this.w)}normalize(e,t){return new l(this.x1/e,this.y1/t,this.x2/e,this.y2/t)}withPadding(e,t=e){return this.w<e*2||this.h<t*2?this:l.fromCxcywh(this.cx,this.cy,this.w-e*2,this.h-t*2)}scale(e){return new l(this.x1*e,this.y1*e,this.x2*e,this.y2*e)}getArea(){return this.w*this.h}clone(){return new l(this.x1,this.y1,this.x2,this.y2)}translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this}equals(e){return e.x1===this.x1&&e.x2===this.x2&&e.y1===this.y1&&e.y2===this.y2}toString(){return this.x1+","+this.y1+","+this.w+","+this.h}containsPoint(e,t){return e>=this.x1&&e<=this.x2&&t>=this.y1&&t<=this.y2}}
1
+ import{jsx as x,Fragment as A,jsxs as T}from"react/jsx-runtime";import{Box as E}from"@expofp/geometry";import{CameraSchema as I}from"@expofp/schema";import{optimizeWaypointOrder as M}from"@expofp/wayfinding";import{ErrorBoundary as R}from"@sentry/react";import $ from"debug";import{reaction as V}from"mobx";import{createRoot as z}from"react-dom/client";import{install as j}from"resize-observer";import G from"./components/Layout";import{MAX_ROUTE_WAYPOINTS as d}from"./constants";import q from"./data";import{fpGeo as b}from"./data/fpGeo";import N from"./floorplan.loader";import{shouldLoadIntercom as O}from"./intercom";import{BoundsSchema as U,POISelectorsSchema as w,ZoomToOptionsSchema as P}from"./schemas/sdk.schemas";import{applyDeclarativeConfig as H,applyParameters as Y,applyPathway as _,initUrlRouting as D}from"./services/url-dispatch";import{destroyUrlSync as W}from"./services/url-sync";import r from"./store";import{destroyUiHandlers as X}from"./store/init/init-ui";import{findBooth as S,Route as v,separateExternalIds as B}from"./store/RouteStore";import{destroyGtag as K,GaEventActions as k,sendEventToGa as F,setConsentSettings as Q}from"./tools/gtag";import Z from"./tools/report-error";import{resetGlobalVariables as J}from"./tools/reset";import ee from"./tools/track-event";import{cameraToMapSettings as te,mapSettingsToCamera as re}from"./utils/camera-map-settings";import{getStorage as C}from"./utils/entity-storage";import{convertLocalToGps as oe,isValidPointCoords as y}from"./utils/gps";import{getLocales as ie,hasLocale as se,setLocale as ne}from"./utils/i18n";import{mapEntity as g}from"./utils/mapEntity";const p=$("efp:api");j();export default class ae extends N{root;init(){H(),this.ignoreQuery||D(this.offHistory),ee("load"),r.fp=this,Q(this.consent),F(k.Load,""),this.root=z(this.renderTarget),this.root.render(x(R,{children:x(G,{offHistory:this.offHistory,consent:this.consent})})),F(k.Rendered,""),V(()=>r.layerStore.layersLoaded,()=>{this.resolveReady(),r.initialized||this.onInit?.(this),r.initialized=!0});const e=O(q);e&&import("./intercom/bootIntercom").then(({bootIntercom:t})=>t(e)).catch(()=>{})}selectBooth(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectBooth","Parameter must be a string or an array of strings.","EFP000000");return}const t=r.boothStore.booths.filter(o=>typeof e=="string"?o.name===e||o.externalId===e:e.includes(o.name)||e.includes(o.externalId));r.selectBooth(t)}selectExhibitor(e){if(typeof e!="string"&&!Array.isArray(e)){a("selectExhibitor","Parameter must be a string or an array of strings.","EFP000100");return}if(!e?.length){r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null;return}const t=r.exhibitorStore.exhibitors.filter(i=>typeof e=="string"?i.name===e||i.externalId===e:e.includes(i.name)||e.includes(i.externalId));if(!t?.length)return;if(typeof e=="string"){r.selectExhibitor(t[0]),r.moveToList([t[0]]);return}const o=t.flatMap(i=>i.booths.map(s=>s.layer)),{description:n}=o.reduce((i,s)=>(i.freq[s.description]=(i.freq[s.description]||0)+1,i.freq[s.description]>i.maxCount&&(i.maxCount=i.freq[s.description],i.mostFrequent=s),i),{freq:{},mostFrequent:o[0],maxCount:0}).mostFrequent;r.layerStore.updateVisibility(n,!0),r.uiState.menu=!1,r.searchStore.resetSearchBox(),r.uiState.details=null,r.uiState.list={type:"filter",items:t,query:{key:"exhibitors",value:t.map(i=>i.externalId).join(",")}},r.moveToList()}highlightExhibitors(e){Array.isArray(e)||a("highlightExhibitors","Parameter must be an array of strings.","EFP000200"),r.boothStore.highlightedByExternalIds=[],r.exhibitorStore.highlightedByExternalIds=[...e]}highlightBooths(e){Array.isArray(e)||a("highlightBooths","Parameter must be an array of strings.","EFP000300"),r.exhibitorStore.highlightedByExternalIds=[],r.boothStore.highlightedByExternalIds=[...e]}highlightEntities(e){Array.isArray(e)||a("highlightEntities","Parameter must be an array of strings.","EFP000400");const{boothExternalIds:t,exhibitorExternalIds:o}=B(e);r.boothStore.highlightedByExternalIds=[...t],r.exhibitorStore.highlightedByExternalIds=[...o]}selectRoute(e,t){if(Array.isArray(e)){let o=[...e];const n=o.shift(),i=o.pop();if(o.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);if(!n||!i){a("selectRoute","Invalid route format: When providing an array, it must include at least two points: a start and a destination.","EFP000401");return}r.routeStore.selectRoute(new v(m(n),m(i),o.map(m)));return}e||a("selectRoute","At a minimum, the starting point must be passed.","EFP000402"),r.routeStore.selectRoute(new v(m(e),m(t)))}getOptimizedRoutes(e){if(!Array.isArray(e))return a("getOptimizedRoutes","Parameter must be an array.","EFP000500"),[];if(e.length>d)throw new Error(`The maximum number of waypoints is ${d}.`);const t=e.map(m).filter(n=>!!n);if(!t.length)throw new Error("No booths found for the provided waypoints.");const o=new Map;for(const n of t){const i=n.layer?.name??"",s=o.get(i);s?s.push(n):o.set(i,[n])}return Array.from(o.values()).map(n=>({waypoints:M(n.map(i=>[i.name,{x:i.rect.center.x,y:i.rect.center.y}]))}))}selectCurrentPosition(e,t,o){const n=y(e.x)&&y(e.y),i=y(e.lng)&&y(e.lat);!n&&!i&&a("selectCurrentPosition","A point must be passed. Either (x,y) or (lat,lng) are required.","EFP000600"),r.routeStore.selectCurrentPosition(e,t,o),this.onCurrentPositionChanged?.(e)}setBookmarks(e){(!Array.isArray(e)||!e.length)&&a("setBookmarks","Parameter must be an array.","EFP000700"),e.forEach(t=>{const o=r.exhibitorStore.exhibitors.find(n=>n.name===t.name||n.externalId===t.externalId);o&&(o.bookmarked=t.bookmarked)})}setEntitiesBookmarks(e){if(!Array.isArray(e)||!e.length){a("setEntitiesBookmarks","Parameter must be an array.","EFP000701");return}const t=["exhibitor","event","speaker","booth"],o=e.find(s=>!s.type||!t.includes(s.type));if(o){a("setEntitiesBookmarks",`Invalid entity type: ${o.type}. Must be one of: ${t.join(", ")}.`,"EFP000702");return}const n=C("bookmarked"),i={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:s=>r.exhibitorStore.findExhibitor(s),replacer:s=>r.exhibitorStore.replaceBookmarked(s)},event:{existingIds:new Set(n.events||[]),finder:s=>r.eventStore.findByNameOrSlug(s),replacer:s=>r.eventStore.replaceBookmarked(s)},speaker:{existingIds:new Set(n.speakers||[]),finder:s=>r.speakerStore.speakers.find(h=>h.name===s||h.externalId===s||h.slug===s),replacer:s=>r.speakerStore.replaceBookmarked(s)},booth:{existingIds:new Set(n.booths||[]),finder:s=>{const h=r.boothStore.findBooth(s);return h?.exhibitors.length===0?h:void 0},replacer:s=>r.boothStore.replaceBookmarked(s)}};e.forEach(s=>{const h=i[s.type],c=s.name||s.externalId||"",l=h.finder(c);l?s.bookmarked?h.existingIds.add(l.id):h.existingIds.delete(l.id):console.warn(`Entity not found: ${s.type} with query "${c}"`)}),Object.values(i).forEach(s=>{s.replacer(Array.from(s.existingIds))})}setEntitiesVisited(e){if(!Array.isArray(e)||!e.length){a("setEntitiesVisited","Parameter must be an array.","EFP000703");return}const t=["exhibitor","event"],o=e.find(s=>!s.type||!t.includes(s.type));if(o){a("setEntitiesVisited",`Invalid entity type: ${o.type}. Must be one of: ${t.join(", ")}.`,"EFP000704");return}const n=C("visited"),i={exhibitor:{existingIds:new Set(n.exhibitors||[]),finder:s=>r.exhibitorStore.findExhibitor(s),replacer:s=>r.exhibitorStore.replaceVisited(s)},event:{existingIds:new Set(n.events||[]),finder:s=>r.eventStore.findByNameOrSlug(s),replacer:s=>r.eventStore.replaceVisited(s)}};e.forEach(s=>{const h=i[s.type],c=s.name||s.externalId||"",l=h.finder(c);l?s.visited?h.existingIds.add(l.id):h.existingIds.delete(l.id):console.warn(`Entity not found: ${s.type} with query "${c}"`)}),Object.values(i).forEach(s=>{s.replacer(Array.from(s.existingIds))})}setMarkers(e){if(!e||!Array.isArray(e.icons)||!Array.isArray(e.markers)){a("setMarkers","Invalid input.","EFP000800");return}r.routeStore.setMarkers(e)}selectMarker(e,t=!0){return typeof e!="string"&&a("selectMarker","The identifier must be passed.","EFP000900"),r.routeStore.selectMarker(e,t)}drawCircles(e){Array.isArray(e)||a("drawCircles","Invalid input.","EFP000A00"),r.uiState.debugCircles=e}checkRoutes(){r.routeStore.checkRoutes()}updateLayerVisibility(e,t){typeof e!="string"&&a("updateLayerVisibility","The layer name (string) must be passed.","EFP000B00"),t||a("updateLayerVisibility","Passing a false value to visible will have no effect.","EFP000B01"),r.layerStore.updateVisibility(e,t)}getCenterCoordinates(){return r.fp.getCenterCoordinates()}exhibitorsList(){return r.exhibitorStore.exhibitors.map(e=>g(e))}boothsList(){return r.boothStore.booths.map(e=>g(e))}categoriesList(){return r.categoryStore.categories.map(e=>g(e))}selectCategory(e){if(e==null||typeof e!="string"){r.searchStore.selectSearch();return}const t=e?.toLowerCase(),o=r.categoryStore.categories.find(({name:n,slug:i})=>n?.toLowerCase()===t||i?.toLowerCase()===t);if(!o){a("selectCategory",`Category ${e} not found.`,"EFP000C01");return}r.selectCategory(o)}select(e){if(typeof e!="string"){a("select","Parameter must be a string.","EFP001700");return}const t=e,o=t?.toLowerCase(),n=r.boothStore.booths.find(l=>l.slug?.toLowerCase()===o||l.externalId?.toLowerCase()===o||l.externalId?.toLowerCase()?.replace(/\s+/g,"")===o);if(n){setTimeout(()=>r.selectBooth(n),250);return}const i=r.eventStore.eventItems.find(l=>l.slug?.toLowerCase()===o||l.externalId?.toLowerCase()===o);if(i){r.selectEventItem(i,!0);return}const s=r.exhibitorStore.exhibitors.find(l=>l.slug?.toLowerCase()===o||l.externalId?.toLowerCase()===o);if(s){setTimeout(()=>r.clickExhibitor(s),250);return}const h=r.categoryStore.categories.find(l=>l.slug===t);if(h){r.selectCategory(h);return}const c=r.speakerStore.findBySlug(t);if(c){r.selectSpeaker(c,!0);return}t.includes("heatmap=true")||r.searchStore.selectSearch(t)}showList(e){const t={bookmarks:()=>r.selectBookmarks(),visited:()=>r.selectVisited(),sessions:()=>r.selectSessions(),exhibitors:()=>r.selectExhibitors(),speakers:()=>r.selectSpeakers(),tours:()=>r.selectTours(),language:()=>r.selectLanguage()},o=t[e];if(!o){a("showList",`Unknown list "${e}". Must be one of: ${Object.keys(t).join(", ")}.`,"EFP001800");return}o()}selectTour(e){if(typeof e!="string"||!e){a("selectTour","A tour id must be passed.","EFP001900");return}const t=r.toursStore.getTourById(e);t?r.toursStore.launchTour(t,t.name,t.description):(console.warn(`Route with id "${e}" not found`),r.selectTours())}openPlanner(e={}){if(typeof e!="object"||e===null){a("openPlanner","An options object must be passed.","EFP001A00");return}const t=e.from?S(e.from):null;e.fromBookmarks?r.routePlannerStore.launchFromBookmarks(t??void 0):r.routePlannerStore.launchFromSlugs(e.items??[],t??void 0)}startBuildRoute(){r.uiState.startBuildRoute()}applyParameters(e){typeof e!="string"&&a("applyParameters","A query string must be passed.","EFP000D00"),Y(e)}getVisibility(){return r.uiState.visibility}setVisibility(e){(typeof e!="object"||!Object.keys(e).length)&&a("setVisibility","The parameter must be passed.","EFP000E00"),r.uiState.setVisibility(e)}findLocation(){r.routeStore.findLocation()}zoomIn(){r.uiState.zoomIn()}zoomOut(){r.uiState.zoomOut()}switchView(){r.maplibreStore.activateMaplibre()}setCamera(e){p("setCamera called with camera=%O",e);const t=I.safeParse(e);if(!t.success){a("setCamera",t.error.message,"EFP001B00");return}r.uiState.setMapSettings(te(t.data))}getCamera(){return re(r.uiState.mapSettings)}zoomTo(e,t){p("zoomTo called with selectors=%O options=%O",e,t);const o=w.safeParse(e);if(!o.success){a("zoomTo",o.error.message,"EFP001600");return}const n=P.safeParse(t);if(!n.success){a("zoomTo",n.error.message,"EFP001601");return}const i=this.getBounds(e);i&&this.fitBounds(i,t)}getBounds(e){p("getBounds called with selectors=%O",e);const t=w.safeParse(e);if(!t.success){a("getBounds",t.error.message,"EFP001400");return}const o=[];if(e.booths?.forEach(i=>{let s;i.externalId?s=r.boothStore.boothByExternalId.get(i.externalId):i.name&&(s=r.boothStore.boothByName.get(i.name.toLowerCase())),s?.rect&&o.push(s.rect)}),e.exhibitors?.forEach(i=>{let s;i.externalId?s=r.exhibitorStore.exhibitorByExternalId.get(i.externalId):i.name&&(s=r.exhibitorStore.exhibitorByName.get(i.name.toLowerCase())),s?.booths?.forEach(h=>{h.rect&&o.push(h.rect)})}),o.length===0)return;const n=E.fromUnion(...o);return{leftTop:{x:n.min.x,y:n.min.y},rightBottom:{x:n.max.x,y:n.max.y}}}fitBounds(e,t){if(p("fitBounds called with bounds=%O options=%O",e,t),!e){r.uiState.fitBounds();return}const o=U.safeParse(e);if(!o.success){a("fitBounds",o.error.message,"EFP001500");return}const n=P.safeParse(t);if(!n.success){a("fitBounds",n.error.message,"EFP001501");return}const i=E.fromMinMax({x:e.leftTop.x,y:e.leftTop.y},{x:e.rightBottom.x,y:e.rightBottom.y});r.uiState.moveToRect=t?.padding?i.expand(t.padding):i}getBoothRect(e){typeof e!="string"&&a("getBoothRect","A booth name must be passed.","EFP000F00");const t=S(e)?.rect;return t?u.fromBox(t):void 0}convertToGeo(e,t){if(!b?.properties?.config){a("convertToGeo","The coordinates cannot be converted because the GPS configuration is not defined.","EFP001000");return}if(!e||!t){a("convertToGeo","Both coordinates must be passed.","EFP001001");return}return oe(e,t,b.properties.config)}getGeoConfig(){const e=b?.properties?.config;return e?{bearing:e.bearing??0,p0:e.p0,p1:e.p1,p2:e.p2}:null}unstable_destroy(){let e=window.__efpElement.firstChild;J(),window.removeEventListener("__efpStyleLoad",this.efpStyleLoadHandler),window.removeEventListener("error",Z),r.maplibreStore.dispose(),W(),X(),K(),this.root.unmount(),e.remove()}search(e){return typeof e!="string"&&a("search","A search string must be passed.","EFP001100"),r.fuzzySearchEngineStore.loadEngine().then(()=>(r.searchStore.selectSearch(e),r.uiState.fuzzySearchItems.map(t=>({item:g(t.item),score:t.score}))))}getFloors(){return r.layerStore.floors.map(e=>({name:e.name,shortName:e.shortName,description:e.description,active:e.active,disabled:e.disabled,index:e.index}))}activateFloor(e){if(!e?.name&&e?.index==null){a("activateFloor","Invalid floorId. It must contain either a name or an index.","EFP001200");return}const t=this.getFloors();if(e.name){const o=t.find(n=>n.name===e.name||n.shortName===e.name);if(!o){a("activateFloor",`Floor with name "${e.name}" not found.`,"EFP001201");return}if(o.active)return;this.updateLayerVisibility(o.name,!0);return}if(e.index!==null){const o=t.find(i=>i.index===e.index),n=o?.name;if(!n){a("activateFloor",`Floor at index ${e.index} does not exist.`,"EFP001203");return}if(o.active)return;this.updateLayerVisibility(n,!0);return}}showPathway(e,t){const{boothExternalIds:o,exhibitorExternalIds:n}=t?.length?B(t):{boothExternalIds:[],exhibitorExternalIds:[]};_({pathwayId:e,boothIds:o,exhibitorIds:n})}showPathwayOnly(e,t){this.activateFloor({name:t}),r.layerStore.showPathWay(e),r.uiState.setPathwayOnlyMode(!0);const o=r.layerStore.findLayer(e),n=r.layerStore.findLayer(t),i=o?.rect||o?.viewbox?o:n;if(i?.rect||i?.viewbox){const s=i.viewbox??i.rect;r.uiState.moveToRect=s.clone()}}hidePathways(){this.highlightBooths([]),r.layerStore.hidePathways(),r.uiState.setPathwayOnlyMode(!1)}showSearch(){r.selectSearch("")}changeLanguage(e){const t=e?.toLowerCase?.();if(!se(t)){a("changeLanguage",`Language "${e}" was not found. Available languages: ${ie().map(o=>o.id).join(",")}`,"EFP001300");return}ne(t)}isGpsTrackingEnabled(){return r.routeStore.gpsEnabled}setGpsTrackingEnabled(e){r.routeStore.setGpsTrackingEnabled(e)}deselectCurrentPosition(){r.routeStore.selectCurrentPosition(null,!1)}deselectRoute(){r.routeStore.selectRoute(null),r.routeStore.setOnlyAccessible(!1)}reset(){this.selectBooth(""),this.selectExhibitor(""),this.selectCategory(),this.deselectCurrentPosition(),this.deselectRoute(),this.highlightEntities([]),r.uiState.kioskData&&r.resetCameraFn?r.resetCameraFn?.():this.fitBounds()}selectAccessibleRoute(e){r.routeStore.setOnlyAccessible(!0),this.selectRoute(e)}}function m(f){return typeof f=="string"?S(f):r.routeStore.getNearestBooth(f)}let L=0;function a(f,e,t){const o=`Error calling "${f}" SDK method.`,n=`${e.endsWith(".")?e:e+"."} More information at`;let i="https://js-sdk.expofp.com/api/packages";if(t&&(i+=`#error-${t}`),console.error(`${o} ${n} ${i}`),r.fp.disableRuntimeAlerts)return;r.uiState.setGlobalErrorMessage({title:o,body:T(A,{children:[n," ",x("a",{href:i,target:"_blank",rel:"noreferrer",children:i})]})}),clearTimeout(L);const s=8e3;L=window.setTimeout(()=>{const h=async()=>{r.uiState.globalErrorMessages.length>0&&(r.uiState.popGlobalErrorMessage(),await new Promise(c=>setTimeout(c,s/2)),h())};h()},s)}class u{x1;y1;x2;y2;get h(){return Math.abs(this.y2-this.y1)}get w(){return Math.abs(this.x2-this.x1)}get cx(){return(this.x1+this.x2)/2}get cy(){return(this.y1+this.y2)/2}constructor(e,t,o,n){if(e>o){const i=e;e=o,o=i}if(t>n){const i=t;t=n,n=i}this.x1=e,this.y1=t,this.x2=o,this.y2=n}static fromBox(e){return new u(e.min.x,e.min.y,e.max.x,e.max.y)}static fromCxcywh(e,t,o,n){return new u(e-o/2,t-n/2,e+o/2,t+n/2)}contains(e){return e.x1>=this.x1&&e.x2<=this.x2&&e.y1>=this.y1&&e.y2<=this.y2}intersects(e){const t=Math.max(this.x1,e.x1),o=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),i=Math.min(this.y2,e.y2);return o>=t&&i>=n}getIntersection(e){const t=Math.max(this.x1,e.x1),o=Math.min(this.x2,e.x2),n=Math.max(this.y1,e.y1),i=Math.min(this.y2,e.y2);return o>=t&&i>=n?new u(t,n,o,i):new u(0,0,0,0)}getRotated90(){return u.fromCxcywh(this.cx,this.cy,this.h,this.w)}normalize(e,t){return new u(this.x1/e,this.y1/t,this.x2/e,this.y2/t)}withPadding(e,t=e){return this.w<e*2||this.h<t*2?this:u.fromCxcywh(this.cx,this.cy,this.w-e*2,this.h-t*2)}scale(e){return new u(this.x1*e,this.y1*e,this.x2*e,this.y2*e)}getArea(){return this.w*this.h}clone(){return new u(this.x1,this.y1,this.x2,this.y2)}translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this}equals(e){return e.x1===this.x1&&e.x2===this.x2&&e.y1===this.y1&&e.y2===this.y2}toString(){return this.x1+","+this.y1+","+this.w+","+this.h}containsPoint(e,t){return e>=this.x1&&e<=this.x2&&t>=this.y1&&t<=this.y2}}
@@ -1,4 +1,3 @@
1
- import '@expofp/debug';
2
1
  export { load } from './load';
3
2
  export type * from './types';
4
3
  //# sourceMappingURL=index.d.ts.map
package/dist/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"@expofp/debug";import r from"./tools/report-error";window.addEventListener("error",r),window.__efpStyleElements=[];export{load}from"./load";
1
+ import{toDebugSettings as r}from"@expofp/config";import{registerSettings as o}from"@expofp/debug";import{LocalStorageConfigSchema as e}from"@expofp/schema";import t from"./tools/report-error";window.addEventListener("error",t),window.__efpStyleElements=[],o(r(e));export{load}from"./load";
@@ -1,4 +1,4 @@
1
- import { type Data } from '../data/Data';
1
+ import { type Config } from '@expofp/config';
2
2
  import { type IntercomContext } from './types';
3
- export declare function shouldLoadIntercom(data: Data): IntercomContext | null;
3
+ export declare function shouldLoadIntercom(data: Config): IntercomContext | null;
4
4
  //# sourceMappingURL=shouldLoad.d.ts.map
@@ -1 +1 @@
1
- import{getSavedKiosk as u}from"../components/Kiosk/SetKiosk/storage";import{KIOSK_ENABLE_KEY as e}from"../constants";import{isLocalStorageAvailable as o}from"../utils/localStorage";function c(){const t=new URLSearchParams(window.location.search).get(e),n=o?window.localStorage.getItem(e):null,r=t??n;return r!=null?r==="1":o&&u()!=null}function s(){const t=window.location.hostname.split(".");return t.length>=3&&t[t.length-2]==="expofp"&&t[t.length-1]==="com"}function l(){return s()?window.location.hostname.split(".")[0]:"main"}function p(t){if(t?.free===!0)return"Free";const n=t?.trialExpiresAt;if(n){const r=new Date(n).getTime();if(!Number.isNaN(r))return Date.now()<r?"Trial Active":"Trial Expired"}return"Active"}function m(){if(process.env.NODE_ENV==="production")return!1;const t=new URLSearchParams(window.location.search);return!t.has("__intercom_subdomain")&&!t.has("__intercom_status")}function f(t){if(process.env.NODE_ENV==="production")return t;const n=new URLSearchParams(window.location.search),r=n.get("__intercom_subdomain"),i=n.get("__intercom_status"),a=i&&["Active","Trial Active","Trial Expired","Free"].includes(i)?i:t.subscriptionStatus;return{subDomain:r??t.subDomain,subscriptionStatus:a}}export function shouldLoadIntercom(t){if(m()||process.env.NODE_ENV==="production"&&!s()||c()||!window.navigator.onLine)return null;const n=f({subDomain:l(),subscriptionStatus:p(t)});return n.subDomain!=="demo"&&n.subscriptionStatus!=="Free"&&n.subscriptionStatus!=="Trial Expired"?null:n}
1
+ import{getSavedKiosk as u}from"../components/Kiosk/SetKiosk/storage";import{KIOSK_ENABLE_KEY as r}from"../constants";import{isLocalStorageAvailable as o}from"../utils/localStorage";function c(t){const n=new URLSearchParams(window.location.search).get(r),e=o?window.localStorage.getItem(r):null,i=n??e;return i!=null?i==="1":o&&u()!=null||Object.keys(t.kiosk??{}).length>0}function s(){const t=window.location.hostname.split(".");return t.length>=3&&t[t.length-2]==="expofp"&&t[t.length-1]==="com"}function l(){return s()?window.location.hostname.split(".")[0]:"main"}function p(t){if(t?.free===!0)return"Free";const n=t?.trialExpiresAt;if(n){const e=new Date(n).getTime();if(!Number.isNaN(e))return Date.now()<e?"Trial Active":"Trial Expired"}return"Active"}function m(){if(process.env.NODE_ENV==="production")return!1;const t=new URLSearchParams(window.location.search);return!t.has("__intercom_subdomain")&&!t.has("__intercom_status")}function f(t){if(process.env.NODE_ENV==="production")return t;const n=new URLSearchParams(window.location.search),e=n.get("__intercom_subdomain"),i=n.get("__intercom_status"),a=i&&["Active","Trial Active","Trial Expired","Free"].includes(i)?i:t.subscriptionStatus;return{subDomain:e??t.subDomain,subscriptionStatus:a}}export function shouldLoadIntercom(t){if(m()||process.env.NODE_ENV==="production"&&!s()||c(t)||!window.navigator.onLine)return null;const n=f({subDomain:l(),subscriptionStatus:p(t)});return n.subDomain!=="demo"&&n.subscriptionStatus!=="Free"&&n.subscriptionStatus!=="Trial Expired"?null:n}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * TEMPORARY dev logging + console playground — DELETE this file together with
3
+ * its import in `load.ts`.
4
+ *
5
+ * Logs the effective config and the eagerly-loaded `fp.svg.js` payload while
6
+ * `pnpm dev:floorplan` runs. The lazy parts (layer `$ref`s — js evaluated to
7
+ * json by `@expofp/resolve` — and other data files) load only when called from
8
+ * the console. None of this feeds the app: `resolve()` evaluates scripts into
9
+ * a sandbox, so `window.__fp*` and the script-tag loader stay untouched.
10
+ *
11
+ * Play with it from the console:
12
+ *
13
+ * __efpDev.config // frozen effective config
14
+ * __efpDev.fpSvgJs // evaluated fp.svg.js payload
15
+ * __efpDev.refs // layer name -> { $ref }
16
+ * __efpDev.layers // resolved payloads so far
17
+ * await __efpDev.loadLayer('Venue') // resolve one layer by name
18
+ * await __efpDev.loadLayers() // resolve every layer ref
19
+ * await __efpDev.loadDataFile('wf.data.js') // any file next to fp.svg.js
20
+ * await __efpDev.loadDataFile('booths.json')
21
+ * await __efpDev.resolve({ $ref: 'https://…/fp.svg.js' }) // raw resolve, js or json
22
+ */
23
+ import { type Config } from '@expofp/config';
24
+ import { type FpSvgJs, type FpSvgLayerJs, type FpSvgLayerJsRef } from '@expofp/schema';
25
+ import { resolve } from '@expofp/resolve';
26
+ interface EfpDevPlayground {
27
+ config: Config;
28
+ fpSvgJs: FpSvgJs;
29
+ refs: Record<string, FpSvgLayerJsRef>;
30
+ layers: Record<string, FpSvgLayerJs>;
31
+ loadLayer: (name: string) => Promise<FpSvgLayerJs | undefined>;
32
+ loadLayers: () => Promise<Record<string, FpSvgLayerJs>>;
33
+ loadDataFile: <T = unknown>(fileName: string) => Promise<T>;
34
+ resolve: typeof resolve;
35
+ }
36
+ declare global {
37
+ interface Window {
38
+ /** @deprecated temporary dev playground, see `load-dev.ts` */
39
+ __efpDev?: EfpDevPlayground;
40
+ }
41
+ }
42
+ export declare function initLoadDev(config: Config): void;
43
+ export {};
44
+ //# sourceMappingURL=load-dev.d.ts.map
@@ -0,0 +1 @@
1
+ import{getResolved as $,resolve as c}from"@expofp/resolve";const a="[efp-dev]";export function initLoadDev(o){const{fpSvgLayerJsRefs:s}=o,n=o.fpSvgJsRef?$(o.fpSvgJsRef):{};console.group(`${a} config loaded`),console.log("config:",o),console.log("fp.svg.js (eager):",_(n),n);const i=(n.__fpLayers??[]).map(e=>({name:e.name,description:e.description,mode:e.mode,floorIndex:e.floorIndex,hasViewbox:e.viewbox!=null,default:e.name===n.__fpDefaultLayer,$ref:s[e.name]?.$ref??"(inline in fp.svg.js)"}));i.length&&console.table(i),console.log("layersMode:",n.__fpLayersMode,"defaultLayer:",n.__fpDefaultLayer),console.groupEnd();const p={},d=async e=>{const t=s[e];if(!t){console.warn(`${a} no $ref for layer "${e}" \u2014 known:`,Object.keys(s));return}const f=performance.now(),r=await c(t),l=Math.round(performance.now()-f);return p[e]=r,console.log(`${a} layer "${e}" \u2190 ${t.$ref} (${l}ms)`,_(r),r),r},g=async()=>(await Promise.all(Object.keys(s).map(d)),p),u=async e=>{const f=`${o.fpSvgJsRef?o.fpSvgJsRef.$ref.split(/[?#]/)[0].replace(/[^/]*$/,""):""}${e}`,r=performance.now(),l=await c({$ref:f});return console.log(`${a} ${e} \u2190 ${f} (${Math.round(performance.now()-r)}ms)`,l),l};window.__efpDev={config:o,fpSvgJs:n,refs:s,layers:p,loadLayer:d,loadLayers:g,loadDataFile:u,resolve:c},console.log(`${a} playground ready \u2014 nothing loads until you ask; try:`,"await __efpDev.loadLayers()",`| await __efpDev.loadLayer('${Object.keys(s)[0]??"name"}')`,"| await __efpDev.loadDataFile('wf.data.js')")}function _(o){return{svgChars:o.__fp?.length??0,paths:o.__fpPaths?.length??0,fpVersion:o.__fpVersion,fpVer:o.__fpSettings?.fpVer,bearing:o.__fpGeo?.properties?.config?.bearing,keys:Object.keys(o).join(", ")}}
@@ -1,8 +1,8 @@
1
1
  import './utils/silence-mobx-react-lite-warning';
2
- import { type Manifest } from './_misc_to_move/manifest';
3
- import { type Ref } from './_misc_to_move/ref';
2
+ import { type Manifest, type Options } from '@expofp/config';
3
+ import { type Ref } from '@expofp/resolve';
4
4
  import { type FloorPlan, type FloorPlanOptions } from './types';
5
- export declare function load(manifestRef: Manifest | Ref<Manifest>, options?: FloorPlanOptions): Promise<FloorPlan>;
5
+ export declare function load(manifestRef: Manifest | Ref<Manifest>, options?: Options & FloorPlanOptions): Promise<FloorPlan>;
6
6
  declare global {
7
7
  interface Window {
8
8
  /** @deprecated */
package/dist/esm/load.js CHANGED
@@ -1,4 +1,4 @@
1
- import"./utils/silence-mobx-react-lite-warning";import{resolve as d}from"@expofp/resolve";import c from"debug";import{initHtmlHead as p}from"./_misc_to_move/initHtmlHead";import{logBuildInfo as u}from"./_misc_to_move/logBuildInfo";import y from"./floorplan.loader";const f=c("efp:load");export async function load(r,e){p(),u(),c("efp:device").enabled&&import("./_misc_to_move/logDeviceInfo").then(o=>o.logDeviceInfo()).catch(()=>{});const n={...await d(r),...e},a=n.element;let t;if(typeof a=="string"){const o=document.querySelector(a);if(!o)throw new Error(`Element not found for selector: ${a}`);t=o}else a?t=a:(t=document.getElementById("floorplan"),t||(t=document.createElement("div"),v(t),document.body.appendChild(t)));h(),t.setAttribute("data-efp-floorplan-defaults",""),document.documentElement.style.overscrollBehavior||="none",document.body.style.overscrollBehavior||="none",requestAnimationFrame(()=>{t.style.backgroundColor="#ebebeb"});const m=n.legacyDataUrlBase;if(f("legacyDataUrlBase",m),n.legacyDataVersion)try{const{version:o}=await d(n.legacyDataVersion);globalThis.__fpDataVersion=o}catch{f("Could not resolve version")}const s=new y({...n,element:t}),l=window.___fpResolve;return window.___fp=s,l&&(s.ready.then(()=>l(s)),delete window.___fpResolve),s.ready.then(()=>{const o=new CustomEvent("expofp:ready",{detail:{floorplan:s}});window.__expofpReady=o,window.dispatchEvent(o)}),s}function h(){const r="efp-floorplan-defaults";if(document.getElementById(r))return;const e=document.createElement("style");e.id=r,e.textContent=`
1
+ import"./utils/silence-mobx-react-lite-warning";import{applyIntents as c,loadConfig as p,setConfig as m}from"@expofp/config";import{safeLocalStorage as u}from"@expofp/utils";import l from"debug";import{initHtmlHead as y}from"./_misc_to_move/initHtmlHead";import{logBuildInfo as h}from"./_misc_to_move/logBuildInfo";import g from"./floorplan.loader";import{migrateLegacyStorageKeys as v}from"./utils/legacy-storage-keys";const d=l("efp:load");export async function load(r,e={}){y(),h(),l("efp:device").enabled&&import("./_misc_to_move/logDeviceInfo").then(o=>o.logDeviceInfo()).catch(()=>{});const a=e.element;let t;if(typeof a=="string"){const o=document.querySelector(a);if(!o)throw new Error(`Element not found for selector: ${a}`);t=o}else a?t=a:(t=document.getElementById("floorplan"),t||(t=document.createElement("div"),S(t),document.body.appendChild(t)));w(),t.setAttribute("data-efp-floorplan-defaults",""),document.documentElement.style.overscrollBehavior||="none",document.body.style.overscrollBehavior||="none",requestAnimationFrame(()=>{t.style.backgroundColor="#ebebeb"}),v();let i;try{if(i=await p(r,e,window.location.search,u()??void 0),!i.fpSvgJsRef)throw new Error("No floor plan drawing: the manifest must set `legacyDataUrlBase` (live event) or `fpSvgJsRef` (offline copy)")}catch(o){const{showEventNotFound:f}=await import("./tools/event-not-found");throw f(t),o}d("config",i),m(i);const n=new g(e,t),s=window.___fpResolve;return window.___fp=n,s&&(n.ready.then(()=>s(n)),delete window.___fpResolve),n.ready.then(()=>{const o=new CustomEvent("expofp:ready",{detail:{floorplan:n}});window.__expofpReady=o,window.dispatchEvent(o)}),n.ready.then(()=>c(n,i.intents)).catch(o=>d("config intents skipped:",o)),n}function w(){const r="efp-floorplan-defaults";if(document.getElementById(r))return;const e=document.createElement("style");e.id=r,e.textContent=`
2
2
  [data-efp-floorplan-defaults] {
3
3
  position: fixed;
4
4
  top: 0;
@@ -10,7 +10,7 @@ import"./utils/silence-mobx-react-lite-warning";import{resolve as d}from"@expofp
10
10
  overscroll-behavior: none;
11
11
  background: #fff;
12
12
  transition: background-color 2s ease;
13
- }`,document.head.prepend(e)}function v(r){if(!document.adoptedStyleSheets)return;const e="efp-runtime-loader-spinner",i=`
13
+ }`,document.head.prepend(e)}function S(r){if(!document.adoptedStyleSheets)return;const e="efp-runtime-loader-spinner",a=`
14
14
  .${e} {
15
15
  position: fixed;
16
16
  top: 50%;
@@ -61,7 +61,7 @@ import"./utils/silence-mobx-react-lite-warning";import{resolve as d}from"@expofp
61
61
  100% {
62
62
  stroke-dashoffset: -125px;
63
63
  }
64
- }`,n=new CSSStyleSheet;n.replaceSync(i),document.adoptedStyleSheets=[...document.adoptedStyleSheets,n],r.innerHTML=`<div class="${e}">
64
+ }`,t=new CSSStyleSheet;t.replaceSync(a),document.adoptedStyleSheets=[...document.adoptedStyleSheets,t],r.innerHTML=`<div class="${e}">
65
65
  <svg viewBox="25 25 50 50">
66
66
  <circle r="20" cy="50" cx="50"></circle>
67
67
  </svg>
@@ -1 +1 @@
1
- import o from"../../tools/base-runtime-url";export const DEFAULT_FONT_URL=`${o}fonts/oswald-v17-cyrillic_latin-500.woff`,DEFAULT_FONT_LIGHT_URL=`${o}fonts/oswald-v17-cyrillic_latin-300.woff`;export function loadCustomFontsUrls(){const t=window.__data;return t&&t.customCssFonts?.length?t.customCssFonts:[]}
1
+ import{getConfig as s}from"@expofp/config";import t from"../../tools/base-runtime-url";export const DEFAULT_FONT_URL=`${t}fonts/oswald-v17-cyrillic_latin-500.woff`,DEFAULT_FONT_LIGHT_URL=`${t}fonts/oswald-v17-cyrillic_latin-300.woff`;export function loadCustomFontsUrls(){const o=s();return o.customCssFonts?.length?o.customCssFonts:[]}
@@ -7,7 +7,22 @@ export declare class URLFilterManager {
7
7
  constructor(rootStore: RootStore);
8
8
  initialize(): void;
9
9
  private parseURLFilters;
10
+ /**
11
+ * The raw filter values, before catalog validation. The canonical
12
+ * `config.filters` node wins when present (`?filters[categories][0]=food` or
13
+ * any config layer; values are plain names, no custom decoding).
14
+ */
15
+ private readRawFilters;
10
16
  private applyFiltersToStore;
17
+ /**
18
+ * The active filters' contribution to `location.search` — `''` when no
19
+ * filter is active, else `'?<legacy filter keys>'`, byte-identical to what
20
+ * `updateURLFromFilters` writes. Also read by the URL autorun (url-dispatch):
21
+ * when nothing else claims the URL, the filter query IS the selection. Both
22
+ * writers must emit the same string — emitting different ones made their
23
+ * MobX ordering decide the final address bar (the poiType-clearing race).
24
+ */
25
+ filterSearch(): string;
11
26
  updateURLFromFilters(): void;
12
27
  setCategories(categoryNames: string[]): void;
13
28
  setPoiType(poiTypeName: string | null): void;
@@ -1 +1 @@
1
- import{__esDecorate as l,__runInitializers as y}from"tslib";import{action as h,observable as A,reaction as F}from"mobx";import{PREFIXES as $}from"../store/search-buttons/constants";import a from"../tools/logger";import{decodeString as X,decodeStringArray as M,encodeString as G,encodeStringArray as N,toLowerCaseArray as m,toLowerCaseString as k}from"../utils/urlEncoding";const d={CATEGORIES:"categories",POI_TYPE:"poiType",POI_TYPES:"poiTypes",EXHIBITORS:"exhibitors"};let H=(()=>{let n=[],f,T=[],S=[],P,L=[],I=[],C,_,R,b,w,O,U,x,E,z;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;f=[A],P=[A],C=[h],_=[h],R=[h],b=[h],w=[h],O=[h],U=[h],x=[h],E=[h],z=[h],l(this,null,C,{kind:"method",name:"initialize",static:!1,private:!1,access:{has:e=>"initialize"in e,get:e=>e.initialize},metadata:t},null,n),l(this,null,_,{kind:"method",name:"parseURLFilters",static:!1,private:!1,access:{has:e=>"parseURLFilters"in e,get:e=>e.parseURLFilters},metadata:t},null,n),l(this,null,R,{kind:"method",name:"applyFiltersToStore",static:!1,private:!1,access:{has:e=>"applyFiltersToStore"in e,get:e=>e.applyFiltersToStore},metadata:t},null,n),l(this,null,b,{kind:"method",name:"updateURLFromFilters",static:!1,private:!1,access:{has:e=>"updateURLFromFilters"in e,get:e=>e.updateURLFromFilters},metadata:t},null,n),l(this,null,w,{kind:"method",name:"setCategories",static:!1,private:!1,access:{has:e=>"setCategories"in e,get:e=>e.setCategories},metadata:t},null,n),l(this,null,O,{kind:"method",name:"setPoiType",static:!1,private:!1,access:{has:e=>"setPoiType"in e,get:e=>e.setPoiType},metadata:t},null,n),l(this,null,U,{kind:"method",name:"setPoiTypes",static:!1,private:!1,access:{has:e=>"setPoiTypes"in e,get:e=>e.setPoiTypes},metadata:t},null,n),l(this,null,x,{kind:"method",name:"clearAllFilters",static:!1,private:!1,access:{has:e=>"clearAllFilters"in e,get:e=>e.clearAllFilters},metadata:t},null,n),l(this,null,E,{kind:"method",name:"focusOnFilteredBooths",static:!1,private:!1,access:{has:e=>"focusOnFilteredBooths"in e,get:e=>e.focusOnFilteredBooths},metadata:t},null,n),l(this,null,z,{kind:"method",name:"openExhibitorsList",static:!1,private:!1,access:{has:e=>"openExhibitorsList"in e,get:e=>e.openExhibitorsList},metadata:t},null,n),l(null,null,f,{kind:"field",name:"currentFilters",static:!1,private:!1,access:{has:e=>"currentFilters"in e,get:e=>e.currentFilters,set:(e,r)=>{e.currentFilters=r}},metadata:t},T,S),l(null,null,P,{kind:"field",name:"isInitialized",static:!1,private:!1,access:{has:e=>"isInitialized"in e,get:e=>e.isInitialized,set:(e,r)=>{e.isInitialized=r}},metadata:t},L,I),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=y(this,n);currentFilters=y(this,T,{categories:[],poiType:null,poiTypes:[],exhibitors:!1});isInitialized=(y(this,S),y(this,L,!1));constructor(t){y(this,I),this.rootStore=t,this.setupReactions()}initialize(){this.parseURLFilters(),this.applyFiltersToStore(),this.isInitialized=!0,a.log("URLFilterManager initialized with filters:",this.currentFilters)}parseURLFilters(){const t=new URLSearchParams(window.location.search),e=t.get(d.CATEGORIES),r=e?M(e):[],i=t.get(d.POI_TYPE),s=i?X(i):null,o=t.get(d.POI_TYPES),c=o?M(o):[],p=t.get(d.EXHIBITORS),u=p==="true"||p==="",v=c.filter(g=>{if(!g)return!1;const B=this.rootStore.poiTypeStore.poiTypes.some(Y=>Y.name.toLowerCase()===g.toLowerCase());return B||a.warn(`POI type not found in data: ${g}`),B});r.length>0&&(s||v.length>0)?(a.warn("URL contains both categories and POI types. Clearing POI types."),this.currentFilters={categories:r,poiType:null,poiTypes:[],exhibitors:u}):this.currentFilters={categories:r,poiType:s,poiTypes:v,exhibitors:u},a.log("URLFilterManager parsed filters:",{categories:r,poiType:s,poiTypes:c,exhibitors:u}),this.validateFilters(this.currentFilters)}applyFiltersToStore(){const{uiState:t,categoryFilterStore:e,searchButtonsStore:r}=this.rootStore;if(this.currentFilters.categories.length>0){const i=this.currentFilters.categories.map(s=>this.rootStore.categoryStore.categories.find(o=>o.name.toLowerCase()===s.toLowerCase())).filter(s=>s!==void 0);i.length>0?(t.selectedCategoryFilters=i,e.state.selectedItems=i.map(s=>({id:s.id,name:s.name})),t.categoryFilterOpen=!0,a.log("URLFilterManager applied categories:",i.map(s=>s.name)),setTimeout(()=>{this.focusOnFilteredBooths(),this.rootStore.searchStore.setFocused(!0)},100)):a.warn("URLFilterManager: no categories found for names:",this.currentFilters.categories)}if(this.currentFilters.poiType){const i=this.rootStore.poiTypeStore.poiTypes.find(s=>s.name.toLowerCase()===this.currentFilters.poiType.toLowerCase());i?(t.selectedPoiTypeFilters=[i],r.setPoiFilterId(`${$.POI_TYPE}${i.id}`),a.log("URLFilterManager applied POI type:",i.name),setTimeout(()=>{this.focusOnFilteredBooths(),this.rootStore.searchStore.setFocused(!0)},100)):a.warn("URLFilterManager: no POI type found for name:",this.currentFilters.poiType)}if(this.currentFilters.poiTypes.length>0){const i=this.currentFilters.poiTypes.map(s=>s?this.rootStore.poiTypeStore.poiTypes.find(o=>o.name.toLowerCase()===s.toLowerCase()):null).filter(s=>s!=null);i.length>0?(t.selectedPoiTypeFilters=i,a.log("URLFilterManager applied POI types:",i.map(s=>s.name)),setTimeout(()=>{this.focusOnFilteredBooths(),this.rootStore.searchStore.setFocused(!0)},100)):(a.warn("URLFilterManager: no POI types found for names:",this.currentFilters.poiTypes),this.currentFilters.poiTypes=[])}this.currentFilters.exhibitors&&this.openExhibitorsList()}updateURLFromFilters(){const{uiState:t}=this.rootStore,e=new URLSearchParams;if(t.selectedCategoryFilters.length>0){const i=t.selectedCategoryFilters.map(o=>o.name.toLowerCase()),s=N(i);s&&e.set(d.CATEGORIES,s)}if(t.selectedPoiTypeFilters.length>0&&t.selectedCategoryFilters.length===0)if(t.selectedPoiTypeFilters.length===1){const i=t.selectedPoiTypeFilters[0].name.toLowerCase();if(i){const s=G(i);s&&e.set(d.POI_TYPE,s)}}else{const i=t.selectedPoiTypeFilters.map(o=>o.name.toLowerCase()),s=N(i);s&&e.set(d.POI_TYPES,s)}this.currentFilters.exhibitors&&t.selectedCategoryFilters.length===0&&t.selectedPoiTypeFilters.length===0&&e.set(d.EXHIBITORS,"true");const r=window.location.pathname+(e.toString()?`?${e.toString()}`:"");window.history.replaceState({},"",r),this.currentFilters={categories:t.selectedCategoryFilters.length>0?t.selectedCategoryFilters.map(i=>i.name):[],poiType:t.selectedPoiTypeFilters.length===1&&t.selectedCategoryFilters.length===0?t.selectedPoiTypeFilters[0].name:null,poiTypes:t.selectedPoiTypeFilters.length>1&&t.selectedCategoryFilters.length===0?t.selectedPoiTypeFilters.map(i=>i.name):[],exhibitors:this.currentFilters.exhibitors}}setCategories(t){this.currentFilters.categories=m(t),this.currentFilters.poiType=null,this.isInitialized&&this.updateURLFromFilters()}setPoiType(t){this.currentFilters.poiType=k(t),this.currentFilters.poiTypes=[],this.currentFilters.categories=[],this.isInitialized&&this.updateURLFromFilters()}setPoiTypes(t){this.currentFilters.poiTypes=m(t),this.currentFilters.poiType=null,this.currentFilters.categories=[],this.isInitialized&&this.updateURLFromFilters()}clearAllFilters(){this.currentFilters={categories:[],poiType:null,poiTypes:[],exhibitors:!1};const{uiState:t}=this.rootStore;t.categoryFilterOpen=!1,this.updateURLFromFilters()}getCurrentFilters(){return{...this.currentFilters}}setupReactions(){F(()=>this.rootStore.uiState.selectedCategoryFilters,t=>{if(this.isInitialized&&t.length>0){const e=m(t.map(r=>r.name));this.setCategories(e)}}),F(()=>this.rootStore.uiState.selectedPoiTypeFilters,t=>{if(this.isInitialized&&t.length>0)if(t.length===1){const e=k(t[0].name);e&&this.setPoiType(e)}else{const e=m(t.map(r=>r.name));this.setPoiTypes(e)}})}validateFilters(t){if(t.categories.length>0&&(t.poiType||t.poiTypes.length>0))return a.warn("Categories and POI types cannot be active simultaneously"),!1;if(t.poiType&&t.poiTypes.length>0)return a.warn("Both single POI type and multiple POI types cannot be active simultaneously"),!1;for(const e of t.categories)if(!this.getCategoryIdByName(e))return a.warn(`Category not found: ${e}`),!1;if(t.poiType&&!this.getPoiTypeIdByName(t.poiType))return a.warn(`POI type not found: ${t.poiType}`),!1;for(const e of t.poiTypes)if(!this.getPoiTypeIdByName(e))return a.warn(`POI type not found: ${e}`),!1;return!0}getCategoryIdByName(t){const e=this.rootStore.categoryStore.categories.find(r=>r.name.toLowerCase()===t.toLowerCase());return e?e.id:null}getPoiTypeIdByName(t){const e=this.rootStore.poiTypeStore.poiTypes.find(r=>r.name.toLowerCase()===t.toLowerCase());return e?e.id:null}focusOnFilteredBooths(){if(!this.rootStore.layerStore.layersLoaded){F(()=>this.rootStore.layerStore.layersLoaded,()=>{this.focusOnFilteredBooths()},{fireImmediately:!1});return}const{uiState:t,exhibitorStore:e,boothStore:r}=this.rootStore;let i=[];if(t.selectedCategoryFilters.length>0){const o=e.exhibitors.filter(c=>t.selectedCategoryFilters.some(p=>c.categories.some(u=>u.id===p.id)));i=r.booths.filter(c=>o.some(p=>p.id===c.exhibitors[0]?.id))}if(t.selectedPoiTypeFilters.length>0){const o=r.booths.filter(c=>t.selectedPoiTypeFilters.some(p=>c.poiTypeId===p.id));i.length>0?i=i.filter(c=>o.some(p=>p.id===c.id)):i=o}const s=i.filter(o=>o.visible);s.length>0?(t.moveToBooths=s,this.rootStore.moveToList(s)):i.length>0&&(this.rootStore.showMap(),this.rootStore.moveToList(i))}openExhibitorsList(){const{uiState:t}=this.rootStore;t.list={type:"exhibitors",text:"",focused:!1},setTimeout(()=>{this.rootStore.searchStore.setFocused(!0)},100),a.log("URLFilterManager opened exhibitors list")}}})();export{H as URLFilterManager};
1
+ import{__esDecorate as n,__runInitializers as u}from"tslib";import{getConfig as A}from"@expofp/config";import{action as h,observable as z,reaction as m}from"mobx";import{PREFIXES as M}from"../store/search-buttons/constants";import a from"../tools/logger";import{decodeString as N,decodeStringArray as v,encodeString as Y,encodeStringArray as B,toLowerCaseArray as g,toLowerCaseString as k}from"../utils/urlEncoding";import{replaceQuery as $}from"./url-sync";const d={CATEGORIES:"categories",POI_TYPE:"poiType",POI_TYPES:"poiTypes",EXHIBITORS:"exhibitors"};let X=(()=>{let c=[],F,f=[],T=[],S,P=[],L=[],I,C,_,b,R,O,w,x,U,E;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;F=[z],S=[z],I=[h],C=[h],_=[h],b=[h],R=[h],O=[h],w=[h],x=[h],U=[h],E=[h],n(this,null,I,{kind:"method",name:"initialize",static:!1,private:!1,access:{has:e=>"initialize"in e,get:e=>e.initialize},metadata:t},null,c),n(this,null,C,{kind:"method",name:"parseURLFilters",static:!1,private:!1,access:{has:e=>"parseURLFilters"in e,get:e=>e.parseURLFilters},metadata:t},null,c),n(this,null,_,{kind:"method",name:"applyFiltersToStore",static:!1,private:!1,access:{has:e=>"applyFiltersToStore"in e,get:e=>e.applyFiltersToStore},metadata:t},null,c),n(this,null,b,{kind:"method",name:"updateURLFromFilters",static:!1,private:!1,access:{has:e=>"updateURLFromFilters"in e,get:e=>e.updateURLFromFilters},metadata:t},null,c),n(this,null,R,{kind:"method",name:"setCategories",static:!1,private:!1,access:{has:e=>"setCategories"in e,get:e=>e.setCategories},metadata:t},null,c),n(this,null,O,{kind:"method",name:"setPoiType",static:!1,private:!1,access:{has:e=>"setPoiType"in e,get:e=>e.setPoiType},metadata:t},null,c),n(this,null,w,{kind:"method",name:"setPoiTypes",static:!1,private:!1,access:{has:e=>"setPoiTypes"in e,get:e=>e.setPoiTypes},metadata:t},null,c),n(this,null,x,{kind:"method",name:"clearAllFilters",static:!1,private:!1,access:{has:e=>"clearAllFilters"in e,get:e=>e.clearAllFilters},metadata:t},null,c),n(this,null,U,{kind:"method",name:"focusOnFilteredBooths",static:!1,private:!1,access:{has:e=>"focusOnFilteredBooths"in e,get:e=>e.focusOnFilteredBooths},metadata:t},null,c),n(this,null,E,{kind:"method",name:"openExhibitorsList",static:!1,private:!1,access:{has:e=>"openExhibitorsList"in e,get:e=>e.openExhibitorsList},metadata:t},null,c),n(null,null,F,{kind:"field",name:"currentFilters",static:!1,private:!1,access:{has:e=>"currentFilters"in e,get:e=>e.currentFilters,set:(e,r)=>{e.currentFilters=r}},metadata:t},f,T),n(null,null,S,{kind:"field",name:"isInitialized",static:!1,private:!1,access:{has:e=>"isInitialized"in e,get:e=>e.isInitialized,set:(e,r)=>{e.isInitialized=r}},metadata:t},P,L),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=u(this,c);currentFilters=u(this,f,{categories:[],poiType:null,poiTypes:[],exhibitors:!1});isInitialized=(u(this,T),u(this,P,!1));constructor(t){u(this,L),this.rootStore=t,this.setupReactions()}initialize(){this.parseURLFilters(),this.applyFiltersToStore(),this.isInitialized=!0,a.log("URLFilterManager initialized with filters:",this.currentFilters)}parseURLFilters(){const{categories:t,poiType:e,poiTypes:r,exhibitors:i}=this.readRawFilters(),s=r.filter(o=>{if(!o)return!1;const l=this.rootStore.poiTypeStore.poiTypes.some(p=>p.name.toLowerCase()===o.toLowerCase());return l||a.warn(`POI type not found in data: ${o}`),l});t.length>0&&(e||s.length>0)?(a.warn("URL contains both categories and POI types. Clearing POI types."),this.currentFilters={categories:t,poiType:null,poiTypes:[],exhibitors:i}):this.currentFilters={categories:t,poiType:e,poiTypes:s,exhibitors:i},a.log("URLFilterManager parsed filters:",{categories:t,poiType:e,poiTypes:r,exhibitors:i}),this.validateFilters(this.currentFilters)}readRawFilters(){const t=A().filters;if(Object.keys(t).length>0)return{categories:[...t.categories??[]],poiType:t.poiType??null,poiTypes:[...t.poiTypes??[]],exhibitors:t.exhibitors??!1};const e=new URLSearchParams(window.location.search),r=e.get(d.CATEGORIES),i=r?v(r):[],s=e.get(d.POI_TYPE),o=s?N(s):null,l=e.get(d.POI_TYPES),p=l?v(l):[],y=e.get(d.EXHIBITORS);return{categories:i,poiType:o,poiTypes:p,exhibitors:y==="true"||y===""}}applyFiltersToStore(){const{uiState:t,categoryFilterStore:e,searchButtonsStore:r}=this.rootStore;if(this.currentFilters.categories.length>0){const i=this.currentFilters.categories.map(s=>this.rootStore.categoryStore.categories.find(o=>o.name.toLowerCase()===s.toLowerCase())).filter(s=>s!==void 0);i.length>0?(t.selectedCategoryFilters=i,e.state.selectedItems=i.map(s=>({id:s.id,name:s.name})),t.categoryFilterOpen=!0,a.log("URLFilterManager applied categories:",i.map(s=>s.name)),setTimeout(()=>{this.focusOnFilteredBooths(),this.rootStore.searchStore.setFocused(!0)},100)):a.warn("URLFilterManager: no categories found for names:",this.currentFilters.categories)}if(this.currentFilters.poiType){const i=this.rootStore.poiTypeStore.poiTypes.find(s=>s.name.toLowerCase()===this.currentFilters.poiType.toLowerCase());i?(t.selectedPoiTypeFilters=[i],r.setPoiFilterId(`${M.POI_TYPE}${i.id}`),a.log("URLFilterManager applied POI type:",i.name),setTimeout(()=>{this.focusOnFilteredBooths(),this.rootStore.searchStore.setFocused(!0)},100)):a.warn("URLFilterManager: no POI type found for name:",this.currentFilters.poiType)}if(this.currentFilters.poiTypes.length>0){const i=this.currentFilters.poiTypes.map(s=>s?this.rootStore.poiTypeStore.poiTypes.find(o=>o.name.toLowerCase()===s.toLowerCase()):null).filter(s=>s!=null);i.length>0?(t.selectedPoiTypeFilters=i,a.log("URLFilterManager applied POI types:",i.map(s=>s.name)),setTimeout(()=>{this.focusOnFilteredBooths(),this.rootStore.searchStore.setFocused(!0)},100)):(a.warn("URLFilterManager: no POI types found for names:",this.currentFilters.poiTypes),this.currentFilters.poiTypes=[])}this.currentFilters.exhibitors&&this.openExhibitorsList()}filterSearch(){const{uiState:t}=this.rootStore,e=new URLSearchParams;if(t.selectedCategoryFilters.length>0){const r=t.selectedCategoryFilters.map(s=>s.name.toLowerCase()),i=B(r);i&&e.set(d.CATEGORIES,i)}if(t.selectedPoiTypeFilters.length>0&&t.selectedCategoryFilters.length===0)if(t.selectedPoiTypeFilters.length===1){const r=t.selectedPoiTypeFilters[0].name.toLowerCase();if(r){const i=Y(r);i&&e.set(d.POI_TYPE,i)}}else{const r=t.selectedPoiTypeFilters.map(s=>s.name.toLowerCase()),i=B(r);i&&e.set(d.POI_TYPES,i)}return this.currentFilters.exhibitors&&t.selectedCategoryFilters.length===0&&t.selectedPoiTypeFilters.length===0&&e.set(d.EXHIBITORS,"true"),e.toString()?`?${e.toString()}`:""}updateURLFromFilters(){const{uiState:t}=this.rootStore;$(this.filterSearch()),this.currentFilters={categories:t.selectedCategoryFilters.length>0?t.selectedCategoryFilters.map(e=>e.name):[],poiType:t.selectedPoiTypeFilters.length===1&&t.selectedCategoryFilters.length===0?t.selectedPoiTypeFilters[0].name:null,poiTypes:t.selectedPoiTypeFilters.length>1&&t.selectedCategoryFilters.length===0?t.selectedPoiTypeFilters.map(e=>e.name):[],exhibitors:this.currentFilters.exhibitors}}setCategories(t){this.currentFilters.categories=g(t),this.currentFilters.poiType=null,this.isInitialized&&this.updateURLFromFilters()}setPoiType(t){this.currentFilters.poiType=k(t),this.currentFilters.poiTypes=[],this.currentFilters.categories=[],this.isInitialized&&this.updateURLFromFilters()}setPoiTypes(t){this.currentFilters.poiTypes=g(t),this.currentFilters.poiType=null,this.currentFilters.categories=[],this.isInitialized&&this.updateURLFromFilters()}clearAllFilters(){this.currentFilters={categories:[],poiType:null,poiTypes:[],exhibitors:!1};const{uiState:t}=this.rootStore;t.categoryFilterOpen=!1,this.updateURLFromFilters()}getCurrentFilters(){return{...this.currentFilters}}setupReactions(){m(()=>this.rootStore.uiState.selectedCategoryFilters,t=>{if(this.isInitialized&&t.length>0){const e=g(t.map(r=>r.name));this.setCategories(e)}}),m(()=>this.rootStore.uiState.selectedPoiTypeFilters,t=>{if(this.isInitialized&&t.length>0)if(t.length===1){const e=k(t[0].name);e&&this.setPoiType(e)}else{const e=g(t.map(r=>r.name));this.setPoiTypes(e)}})}validateFilters(t){if(t.categories.length>0&&(t.poiType||t.poiTypes.length>0))return a.warn("Categories and POI types cannot be active simultaneously"),!1;if(t.poiType&&t.poiTypes.length>0)return a.warn("Both single POI type and multiple POI types cannot be active simultaneously"),!1;for(const e of t.categories)if(!this.getCategoryIdByName(e))return a.warn(`Category not found: ${e}`),!1;if(t.poiType&&!this.getPoiTypeIdByName(t.poiType))return a.warn(`POI type not found: ${t.poiType}`),!1;for(const e of t.poiTypes)if(!this.getPoiTypeIdByName(e))return a.warn(`POI type not found: ${e}`),!1;return!0}getCategoryIdByName(t){const e=this.rootStore.categoryStore.categories.find(r=>r.name.toLowerCase()===t.toLowerCase());return e?e.id:null}getPoiTypeIdByName(t){const e=this.rootStore.poiTypeStore.poiTypes.find(r=>r.name.toLowerCase()===t.toLowerCase());return e?e.id:null}focusOnFilteredBooths(){if(!this.rootStore.layerStore.layersLoaded){m(()=>this.rootStore.layerStore.layersLoaded,()=>{this.focusOnFilteredBooths()},{fireImmediately:!1});return}const{uiState:t,exhibitorStore:e,boothStore:r}=this.rootStore;let i=[];if(t.selectedCategoryFilters.length>0){const o=e.exhibitors.filter(l=>t.selectedCategoryFilters.some(p=>l.categories.some(y=>y.id===p.id)));i=r.booths.filter(l=>o.some(p=>p.id===l.exhibitors[0]?.id))}if(t.selectedPoiTypeFilters.length>0){const o=r.booths.filter(l=>t.selectedPoiTypeFilters.some(p=>l.poiTypeId===p.id));i.length>0?i=i.filter(l=>o.some(p=>p.id===l.id)):i=o}const s=i.filter(o=>o.visible);s.length>0?(t.moveToBooths=s,this.rootStore.moveToList(s)):i.length>0&&(this.rootStore.showMap(),this.rootStore.moveToList(i))}openExhibitorsList(){const{uiState:t}=this.rootStore;t.list={type:"exhibitors",text:"",focused:!1},setTimeout(()=>{this.rootStore.searchStore.setFocused(!0)},100),a.log("URLFilterManager opened exhibitors list")}}})();export{X as URLFilterManager};
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The multi-slug share-link rewrite rule, pure for testing (`url-dispatch`'s
3
+ * `rewriteMultiSlug` binds it to the exhibitor catalog).
4
+ *
5
+ * Legacy share links may join several exhibitor slugs with `&` (or with `%26`
6
+ * when the payload was encoded as one unit). Such a query never selects — the
7
+ * dispatch falls back to search text — so each part `resolveName` recognizes
8
+ * is rewritten to the exhibitor's display name, keeping that text readable.
9
+ *
10
+ * Only slug-shaped parts count and only they are rewritten: a `key=value`
11
+ * part (config key, intent shortcut, one-shot — `=` travels as `%3D` in the
12
+ * encoded form) is never a slug. A lone slug riding with such params
13
+ * (`?slug&allowConsent=false`) is NOT a multi-slug link — left alone, it
14
+ * flows through the parser's config-stripping to a clean single-slug select.
15
+ *
16
+ * Returns the rewritten search (delimiter normalized to `&`), or `null` when
17
+ * the query is not a multi-slug link.
18
+ */
19
+ export declare function rewriteMultiSlugQuery(search: string, resolveName: (slugOrId: string) => string | undefined): string | null;
20
+ //# sourceMappingURL=multi-slug.d.ts.map
@@ -0,0 +1 @@
1
+ import{safeDecode as s}from"@expofp/utils";export function rewriteMultiSlugQuery(t,u){if(!t.includes("&")&&!t.includes("%26"))return null;const n=t.startsWith("?")?t.slice(1):t,r=n.includes("&")?"&":"%26",e=n.split(r),l=i=>!!i&&!s(i).includes("=");return e.filter(l).length<2?null:"?"+e.map(i=>l(i)&&u(i)||i).join("&")}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Apply the declarative config nodes onto the runtime state — the presentation
3
+ * flags and heatmap engagement now, camera and visibility on first layers
4
+ * load. Runs in EVERY mode, before `initUrlRouting`: `ignoreQuery` isolates
5
+ * the floor plan from the page URL (`loadConfig` already left the URL slice
6
+ * out of the effective config), not from its own manifest/options config.
7
+ */
8
+ export declare function applyDeclarativeConfig(): void;
9
+ export declare function initUrlRouting(offHistory: boolean): void;
10
+ /** The public `FloorPlan.applyParameters` — replay a legacy query at runtime. */
11
+ export declare function applyParameters(queryRaw?: string): void;
12
+ /**
13
+ * The pathway deep link: activate the busiest floor, highlight the listed
14
+ * entities, draw the pathway, zoom to the booths — plus the multi-point-tour
15
+ * list header when a tour rides along. Also the body of `FloorPlan.showPathway`
16
+ * (which passes no tour).
17
+ */
18
+ export declare function applyPathway(options: {
19
+ pathwayId: string;
20
+ boothIds: string[];
21
+ exhibitorIds: string[];
22
+ tourId?: string;
23
+ }): void;
24
+ //# sourceMappingURL=url-dispatch.d.ts.map
@@ -0,0 +1 @@
1
+ import{applyIntents as Y,getConfig as g,parseFromUrlTolerant as D,parseIntentsFromUrl as K,parseLegacyQuery as v,serializeSelection as W}from"@expofp/config";import{Box as z}from"@expofp/geometry";import{UrlConfigSchema as Q}from"@expofp/schema";import{safeDecode as d}from"@expofp/utils";import{autorun as x,runInAction as w,when as p}from"mobx";import{recoverKioskFromUrlPrams as H}from"../components/Kiosk/recoverKioskFromUrlPrams";import{LEGACY_PREVIEW_MODE_STORAGE_KEY as j,LEGACY_VIEWER_MODE_STORAGE_KEY as N,MAP_SETTINGS_KEY as $,PREVIEW_MODE_STORAGE_KEY as M,VIEWER_MODE_STORAGE_KEY as P}from"../constants";import b from"../data";import o,{uiState as r}from"../store";import{BoothBase as B}from"../store/BoothStore";import{CurrentPosition as q,extractRoute as J}from"../store/RouteStore";import{setConsentSettings as X}from"../tools/gtag";import L from"../tools/logger";import{areLayersEnabled as Z}from"../utils/areLayersEnabled";import{cameraToMapSettings as S}from"../utils/camera-map-settings";import{handleCustomCommand as ee}from"../utils/customCommands";import{getMostFrequent as te}from"../utils/getMostFrequent";import{heatmapEnabled as oe}from"../utils/heatmap-enabled";import{hasLocale as re,setLocale as ie}from"../utils/i18n";import{isLocalStorageAvailable as T}from"../utils/localStorage";import{stripTrackingParams as se}from"../utils/trackingParams";import{rewriteMultiSlugQuery as ae}from"./multi-slug";import{currentSearch as m,disableUrlWrites as ne,initUrlSync as le,pushQuery as ce,replaceQuery as f}from"./url-sync";let k=!1;export function applyDeclarativeConfig(){U(g()),p(()=>o.layerStore.layersLoaded,()=>{const e=g().camera;Object.keys(e).length&&h(S(e));const t=g().visibility;Object.keys(t).length&&r.setVisibility(t)})}export function initUrlRouting(e){le({offHistory:e,onNavigate:E}),R(),I(),p(()=>o.layerStore.layersLoaded,()=>{o.urlFilterManager&&!o.urlFilterManager.isInitialized&&o.urlFilterManager.initialize(),E(),x(V),x(G),r.viewerMode&&(r.menu=!0)})}export function applyParameters(e=""){f("?"+d(e.toString())),o.layerStore.layersLoaded?F(e):(I(),p(()=>o.layerStore.layersLoaded,()=>F(e)))}function F(e){const t="?"+d(e),s=de(t);U(s),s.consent&&X(s.consent),s.camera&&Object.keys(s.camera).length&&h(S(s.camera)),s.visibility&&Object.keys(s.visibility).length&&r.setVisibility(s.visibility),R(),E();const i=[...s.intents??[],...K(t).intents];i.length&&Y(o.fp,i)}function I(){const e=m(),t=e.length>1?d(e.substring(1)):"";return ee(t)}function E(){k=!0;try{const e=new URLSearchParams(d(window.location.search));H(e);const{primary:t,oneShots:s}=v(m()),i=s.find(l=>l.type==="camera");if(i){const l=i.roll;h({...S(i.camera),roll:l})}else new Set(e.keys()).size||he();const c=t.type==="select"&&(!t.slug||/^t=[^&]*$/.test(t.slug))&&(r.heatmap||r.heatmapYah);!I()&&!c&&ue(t)}finally{k=!1}G(),V()}function ue(e){const t=o.fp;switch(e.type){case"kiosk":e.enabled===!0?r.kiosk=!0:e.enabled===!1&&(r.kiosk=!1,r.resetUIScale());return;case"list":t.showList(e.list);return;case"tour":t.selectTour(e.tourId);return;case"planner":t.openPlanner({items:e.items,from:e.from,fromBookmarks:e.fromBookmarks});return;case"route":{o.routeStore.setOnlyAccessible(e.accessible),o.routeStore.selectRoute(J(e.from??"",e.to??"",e.waypoints)),o.uiState.setIsMultiPointRoute(e.waypoints.length>0),e.title&&o.uiState.setRouteTitle(e.title);return}case"language":re(e.langId)&&ie(e.langId);return;case"printPdf":o.uiState.printingPdf=!0;return;case"visibility":o.uiState.setVisibility(e.hidden.reduce((s,i)=>({...s,[i]:!1}),{}));return;case"buildRoute":t.startBuildRoute();return;case"pathway":applyPathway(e);return;case"selectExhibitors":setTimeout(()=>t.selectExhibitor(e.values),250);return;case"ownedByFilters":L.log("Skipping filter parameters in dispatchFromUrl (owned by URLFilterManager)");return;case"ownedByConfig":return;case"select":t.select(e.slug);return}}export function applyPathway(e){const{pathwayId:t,boothIds:s,exhibitorIds:i,tourId:c}=e;if(c){const a=o.toursStore.getTourById(c);a&&w(()=>{o.uiState.setTourTitle(a.name),o.uiState.setTourDescription(a.description??""),o.uiState.setIsMultiPointTour(!0),o.uiState.setMultiPointTourList(a.id)})}const l=o.boothStore.booths.filter(a=>s.includes(a.externalId)),u=o.exhibitorStore.exhibitors.filter(a=>i.includes(a.externalId)).flatMap(a=>a.booths),n=[...l,...u];if(Z()){const a=te(n.map(y=>y.layer.name));a&&o.fp.activateFloor({name:a})}(s.length>0||i.length>0)&&o.fp.highlightEntities([...s,...i]),o.layerStore.showPathWay(t),n.length>0&&w(()=>{o.uiState.moveToRect=z.fromUnion(...n.map(a=>a.rect).filter(Boolean)),o.uiState.rollReset=!0})}function R(){const e=m(),{oneShots:t}=v(e);for(const i of t)fe(i);e.startsWith("?preview=")&&f("?"),m().includes("copy_exh")&&f("?");const s=se(m());s!==null&&f("?"+s),r.previewExhibitor&&f("?"+r.previewExhibitor.slug),me()}function fe(e){switch(e.type){case"heatmap":O(e.yah);return;case"blueDot":{const t=new q(e.x,e.y,o.layerStore.findLayer(e.layer??"")?.name,void 0,e.lat,e.lng);p(()=>o.layerStore.layersLoaded,()=>o.routeStore.selectCurrentPosition(t,!0,1));return}case"viewerMode":T&&(e.enabled?localStorage.setItem(P,"true"):(localStorage.removeItem(P),localStorage.removeItem(N)));return;case"previewMode":T&&(e.enabled?localStorage.setItem(M,"true"):(localStorage.removeItem(M),localStorage.removeItem(j)));return;case"uiScale":e.scale!==null?o.uiState.setUIScale(e.scale,!0):L.warn(`Invalid ui-scale parameter: ${e.raw}. Must be a number between 0.8 and 1.4.`);return;case"resetUiScale":o.uiState.resetUIScale();return;case"legacyBookmarks":{const t=e.appendExhibitorId===null?void 0:o.exhibitorStore.exhibitorById.get(e.appendExhibitorId);f(t?"?"+t.slug:"?bookmarks");return}}}function O(e){ne(),e?(r.heatmapYah=!0,r.monochrome=!0,r.hideLogoInBooth=!0,r.hideHeaderLogo=!0,r.disableBookmarked=!0):r.heatmap=!0}function me(){const e=ae(m(),t=>o.exhibitorStore.exhibitors.find(i=>i.slug===t||i.externalId===t)?.name);e!==null&&f(e)}function U(e){e.noOverlay!==void 0&&(r.hideOverlay=e.noOverlay),e.monochrome&&(r.monochrome=!0),e.hideHeaderLogo&&(r.hideHeaderLogo=!0),e.hideLogoInBooth&&(r.hideLogoInBooth=!0),e.disableFeatured&&o.exhibitorStore.exhibitors.forEach(t=>t.featured=!1),e.disableBookmarked&&(r.disableBookmarked=!0),e.disableGps&&o.routeStore.setGpsTrackingEnabled(!1),e.heatmap&&oe(e.heatmap)&&O(e.heatmap.variant==="yah")}function de(e){return D(Q,e).value}let C=null,_=null,A=null;function G(){const{selection:e,exhibitor:t,booth:s,eventItem:i}=pe(),c=o.urlFilterManager.filterSearch();if(k)return;const l=W(e)||c;m()!==l&&(t!==C||s!==_||i!==A?ce(l):f(l),C=t,_=s,A=i)}function pe(){const e=r.selectedExhibitor,t=r.selectedBooth,s=r.selectedEventItem,i=r.selectedRoute,c=r.selectedSpeaker,l=r.setKioskModeEnabled,u=r.list;let n;if(u.type==="route-planner"&&!e&&!t&&!s){const a=o.routePlannerStore;n={type:"planner",fromBookmarks:a.source==="bookmarks",items:a.items.map(y=>y.entity.slug).filter(Boolean),from:a.startPoint?.slug||void 0}}else if(i&&!r.isMultiPointRoute)n={type:"route",to:i.to instanceof B?i.to.slug:void 0,from:i.from instanceof B?i.from.slug:void 0,accessible:o.routeStore.onlyAccessible,waypoints:i.waypoints?.map(a=>a.slug)};else if(e)n={type:"slug",slug:e.slug};else if(t)n={type:"slug",slug:t.slug};else if(s)n={type:"slug",slug:s.slug};else if(c)n={type:"slug",slug:c.slug};else if(l)n={type:"none"};else switch(u.type){case"bookmarks":case"visited":case"sessions":case"exhibitors":case"speakers":case"tours":case"language":n={type:"list",list:u.type};break;case"category":n={type:"slug",slug:r.selectedCategory?.slug??""};break;case"search":n={type:"slug",slug:u.text||""};break;case"filter":n={type:"filter",key:u.query.key,value:u.query.value};break;case"multi-point-tour":n={type:"tour",tourId:u.tourId};break;default:throw new Error("Unkown list.type")}return{selection:n,exhibitor:e,booth:t,eventItem:s}}function V(){const e=r.selectedExhibitor,t=r.selectedEventItem,s=r.selectedSpeaker;let i="";e?i=e.name:t?i=t.name:s?i=s.name:r.list.type==="search"&&r.list.text?i="`"+(r.list.text||"")+"`":r.list.type==="multi-point-tour"&&r.tourTitle&&(i=r.tourTitle),i.length&&(i+=" \u2013 "),i+=b.title,b.subtitle&&(i+=" \u2013 "+b.subtitle),i+=" \u2013 Expo Floor Plan by ExpoFP",document.title=i}function h(e){try{if(r.setMapSettings(e),e.z){const t=o.layerStore.layers.find(s=>s.name===e.z);t&&o.layerStore.updateVisibility(t,!0)}}catch(t){console.error("Failed to process or save map settings.",t)}}function he(){try{const e=sessionStorage.getItem($);e&&h(JSON.parse(e))}catch(e){console.error("Failed to process or save map settings.",e)}}
@@ -0,0 +1,36 @@
1
+ /** The visited-URL trail (pathname + search per entry) — analytics referrer feed. */
2
+ export declare function getLocationHistory(): string[];
3
+ /** The current search string as the history sees it (`''` or `'?…'`). */
4
+ export declare function currentSearch(): string;
5
+ export declare function pushQuery(search: string): void;
6
+ /**
7
+ * Returns whether the write actually happened — `false` under frozen writes,
8
+ * for callers whose follow-up only makes sense after a real URL change (the
9
+ * debug-mode scrub reloads only on `true`, else `?debug=` would reload forever).
10
+ */
11
+ export declare function replaceQuery(search: string): boolean;
12
+ /** Stop writing to the history for the rest of the session (heatmap mode). */
13
+ export declare function disableUrlWrites(): void;
14
+ /**
15
+ * Start listening to the browser history. `onNavigate` fires on every POP
16
+ * (browser back/forward) so the dispatch side can replay the URL into state.
17
+ */
18
+ export declare function initUrlSync(options: {
19
+ offHistory: boolean;
20
+ onNavigate: () => void;
21
+ }): void;
22
+ export declare function destroyUrlSync(): void;
23
+ /**
24
+ * The UI back button — a real browser back. The POP it produces flows through
25
+ * the listener above, so the state replay (`onNavigate`) and the trail
26
+ * recording happen exactly as for the browser's own back button. Note the
27
+ * replay is therefore asynchronous (it lands with the POP event), and on a
28
+ * history with no in-app pushes yet the browser may leave the page — both
29
+ * identical to pressing the browser's back button.
30
+ *
31
+ * Writes are frozen until that POP lands (see `backPending`); the timer lifts
32
+ * the freeze when no POP will ever come — a back with nowhere to go (empty
33
+ * back stack, e.g. a deep link opened in a fresh tab) is a silent no-op.
34
+ */
35
+ export declare function goBack(): void;
36
+ //# sourceMappingURL=url-sync.d.ts.map
@@ -0,0 +1 @@
1
+ import{createBrowserHistory as h}from"history";import d from"../tools/logger";const t=h(),l=window.location.pathname,i=[];let r=!1,o=!1,c=0,f=()=>{},p;export function getLocationHistory(){return i}function n(e){return l+e}export function currentSearch(){return t.location.search}export function pushQuery(e){!r&&!o&&t.push(n(e))}export function replaceQuery(e){return r||o?!1:(t.replace(n(e)),!0)}export function disableUrlWrites(){r=!0}export function initUrlSync(e){r||=e.offHistory,f=e.onNavigate,!r&&n(t.location.search)===l&&i.push(n(t.location.search)),p=t.listen((u,s)=>{a(),!r&&(i.push(n(u.search)),d.log("history",s,u),s==="POP"&&f())})}export function destroyUrlSync(){r=!1,a(),p?.()}function a(){o=!1,window.clearTimeout(c)}export function goBack(){o=!0,window.clearTimeout(c),c=window.setTimeout(a,1e3),t.goBack()}
@@ -1,6 +1,7 @@
1
+ import { RawPoiType, RawRegularBooth } from '@expofp/schema';
1
2
  import { Box } from '@expofp/geometry';
2
3
  import { ImageDef } from '@expofp/renderer';
3
- import { PathInfo, RawPoiType, RawRegularBooth, ShapeBgDef } from '../data/Data';
4
+ import { PathInfo, ShapeBgDef } from '../types/drawing.types';
4
5
  import { EventItem } from './EventStore';
5
6
  import { Exhibitor } from './ExhibitorStore';
6
7
  import { Layer } from './LayerStore';
@@ -1,4 +1,4 @@
1
- import { MarketMaterial, RawExhibitor } from '../data/Data';
1
+ import { Logo, MarketMaterial, RawExhibitor } from '@expofp/schema';
2
2
  import { Booth } from './BoothStore';
3
3
  import { Category } from './CategoryStore';
4
4
  import { EventItem } from './EventStore';
@@ -64,7 +64,8 @@ export declare class Exhibitor implements Omit<RawExhibitor, 'categories' | 'boo
64
64
  readonly leadingImageLinkUrl: string;
65
65
  readonly videoUrl: string;
66
66
  readonly order: number;
67
- readonly logo: string;
67
+ /** Always the object form — `normalizeLegacyData` converts legacy string logos. */
68
+ readonly logo?: Logo;
68
69
  readonly logoInBooth: boolean;
69
70
  readonly gallery: string[];
70
71
  readonly marketMaterials: MarketMaterial[];
@@ -1 +1 @@
1
- import{__esDecorate as o,__runInitializers as s}from"tslib";import{action as R,computed as g,observable as h}from"mobx";import{buildRebookingUrl as C,getRebookingToken as U}from"../tools/rebookingUrl";import w from"../tools/settings";import q from"../utils/is-debug";export var RebookingState;(function(a){a[a.Unasked=0]="Unasked",a[a.Accepted=1]="Accepted",a[a.Rejected=2]="Rejected",a[a.Undecided=3]="Undecided"})(RebookingState||(RebookingState={}));let A=(()=>{let a=[],c,u=[],b=[],k,m=[],f=[],_,v=[],p=[],x,S,y,B,I,z,d,i,l,N;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;c=[h],k=[h],_=[h],x=[g({keepAlive:!0})],S=[g({keepAlive:!0})],y=[g({keepAlive:!0})],B=[g({keepAlive:!0})],I=[g],z=[g],d=[g({keepAlive:!0})],i=[R],l=[R],N=[R],o(this,null,x,{kind:"getter",name:"exhibitorById",static:!1,private:!1,access:{has:e=>"exhibitorById"in e,get:e=>e.exhibitorById},metadata:t},null,a),o(this,null,S,{kind:"getter",name:"exhibitorByExternalId",static:!1,private:!1,access:{has:e=>"exhibitorByExternalId"in e,get:e=>e.exhibitorByExternalId},metadata:t},null,a),o(this,null,y,{kind:"getter",name:"exhibitorByName",static:!1,private:!1,access:{has:e=>"exhibitorByName"in e,get:e=>e.exhibitorByName},metadata:t},null,a),o(this,null,B,{kind:"getter",name:"exhibitorBySlug",static:!1,private:!1,access:{has:e=>"exhibitorBySlug"in e,get:e=>e.exhibitorBySlug},metadata:t},null,a),o(this,null,I,{kind:"getter",name:"bookmarked",static:!1,private:!1,access:{has:e=>"bookmarked"in e,get:e=>e.bookmarked},metadata:t},null,a),o(this,null,z,{kind:"getter",name:"visited",static:!1,private:!1,access:{has:e=>"visited"in e,get:e=>e.visited},metadata:t},null,a),o(this,null,d,{kind:"getter",name:"advertised",static:!1,private:!1,access:{has:e=>"advertised"in e,get:e=>e.advertised},metadata:t},null,a),o(this,null,i,{kind:"method",name:"replaceBookmarked",static:!1,private:!1,access:{has:e=>"replaceBookmarked"in e,get:e=>e.replaceBookmarked},metadata:t},null,a),o(this,null,l,{kind:"method",name:"replaceVisited",static:!1,private:!1,access:{has:e=>"replaceVisited"in e,get:e=>e.replaceVisited},metadata:t},null,a),o(this,null,N,{kind:"method",name:"setRebookingState",static:!1,private:!1,access:{has:e=>"setRebookingState"in e,get:e=>e.setRebookingState},metadata:t},null,a),o(null,null,c,{kind:"field",name:"highlightedByExternalIds",static:!1,private:!1,access:{has:e=>"highlightedByExternalIds"in e,get:e=>e.highlightedByExternalIds,set:(e,n)=>{e.highlightedByExternalIds=n}},metadata:t},u,b),o(null,null,k,{kind:"field",name:"rebookingStateChangeRequested",static:!1,private:!1,access:{has:e=>"rebookingStateChangeRequested"in e,get:e=>e.rebookingStateChangeRequested,set:(e,n)=>{e.rebookingStateChangeRequested=n}},metadata:t},m,f),o(null,null,_,{kind:"field",name:"rebookingStateSaved",static:!1,private:!1,access:{has:e=>"rebookingStateSaved"in e,get:e=>e.rebookingStateSaved,set:(e,n)=>{e.rebookingStateSaved=n}},metadata:t},v,p),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=s(this,a);exhibitors=[];timeout;constructor(t){s(this,p),this.rootStore=t}highlightedByExternalIds=s(this,u,[]);rebookingStateChangeRequested=(s(this,b),s(this,m,!1));rebookingStateSaved=(s(this,f),s(this,v,!1));get exhibitorById(){return new Map(this.exhibitors.map(t=>[t.id,t]))}get exhibitorByExternalId(){return new Map(this.exhibitors.map(t=>[t.externalId,t]))}get exhibitorByName(){return new Map(this.exhibitors.map(t=>[t.name.toLowerCase(),t]))}get exhibitorBySlug(){return new Map(this.exhibitors.map(t=>[t.slug,t]))}get bookmarked(){return this.exhibitors.filter(t=>t.bookmarked)}get visited(){return this.exhibitors.filter(t=>t.visited)}get advertised(){return this.exhibitors.filter(t=>t.advertise&&t.logo)}replaceBookmarked(t){if(!Array.isArray(t))return;const e=(t||[]).map(r=>this.exhibitorById.get(r)).filter(r=>r),n=new Set(e),E=this.bookmarked.filter(r=>!n.has(r));for(const r of E)r.bookmarked=!1;for(const r of e)r.bookmarked=!0}replaceVisited(t){if(!Array.isArray(t))return;const e=(t||[]).map(r=>this.exhibitorById.get(r)).filter(r=>r),n=new Set(e),E=this.visited.filter(r=>!n.has(r));for(const r of E)r.visited=!1;for(const r of e)r.visited=!0}setRebookingState(t,e,n){clearTimeout(this.timeout),this.rebookingStateChangeRequested=!1,t.rebookingState=e,t.rebookingNote=n;const E=C("api/v1/set-rebooking-state",{rt:U(),expoKey:this.rootStore.fp.eventId});fetch(E,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expoKey:w.EXPO,exhibitorId:t.id,rebookingState:e,rebookingNote:n})}).then(r=>{r.ok&&(this.rebookingStateSaved=!0),!r.ok&&!q&&(t.rebookingState=RebookingState.Unasked,this.rebookingStateSaved=!1)}).catch(()=>{t.rebookingState=RebookingState.Unasked,this.rebookingStateSaved=!1}).finally(()=>{this.rebookingStateChangeRequested=!0,this.timeout=setTimeout(()=>{this.rebookingStateChangeRequested=!1},5e3)})}findExhibitor(t){return this.exhibitorByExternalId.get(t)||this.exhibitorByName.get(t.toLowerCase())||this.exhibitorBySlug.get(t)}}})();export default A;let T=(()=>{let a,c=[],u=[],b,k=[],m=[],f,_=[],v=[],p,x=[],S=[],y,B=[],I=[];return class{static{const d=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;a=[h],b=[h],f=[h],p=[h],y=[h],o(null,null,a,{kind:"field",name:"featured",static:!1,private:!1,access:{has:i=>"featured"in i,get:i=>i.featured,set:(i,l)=>{i.featured=l}},metadata:d},c,u),o(null,null,b,{kind:"field",name:"bookmarked",static:!1,private:!1,access:{has:i=>"bookmarked"in i,get:i=>i.bookmarked,set:(i,l)=>{i.bookmarked=l}},metadata:d},k,m),o(null,null,f,{kind:"field",name:"visited",static:!1,private:!1,access:{has:i=>"visited"in i,get:i=>i.visited,set:(i,l)=>{i.visited=l}},metadata:d},_,v),o(null,null,p,{kind:"field",name:"rebookingState",static:!1,private:!1,access:{has:i=>"rebookingState"in i,get:i=>i.rebookingState,set:(i,l)=>{i.rebookingState=l}},metadata:d},x,S),o(null,null,y,{kind:"field",name:"rebookingNote",static:!1,private:!1,access:{has:i=>"rebookingNote"in i,get:i=>i.rebookingNote,set:(i,l)=>{i.rebookingNote=l}},metadata:d},B,I),d&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:d})}store;id;name;externalId;featured=s(this,c,void 0);advertise=s(this,u);description;address;address2;city;state;zip;country;phone1;website;facebook;instagram;linkedin;twitter;googlePlus;xing;youtube;email;privateEmail;customButtonTitle;customButtonUrl;customButton2Title;customButton2Url;customButton3Title;customButton3Url;leadingImageUrl;leadingImageLinkUrl;videoUrl;order;logo;logoInBooth;gallery;marketMaterials;slug;bookmarked=s(this,k,void 0);visited=(s(this,m),s(this,_,void 0));rebookingState=(s(this,v),s(this,x,void 0));rebookingNote=(s(this,S),s(this,B,void 0));booths=s(this,I);categories;schedule;entity={type:"exhibitor"}}})();export{T as Exhibitor};
1
+ import{__esDecorate as o,__runInitializers as s}from"tslib";import{action as R,computed as g,observable as h}from"mobx";import{buildRebookingUrl as C,getRebookingToken as U}from"../tools/rebookingUrl";import w from"../tools/settings";import q from"../utils/is-debug";export var RebookingState;(function(a){a[a.Unasked=0]="Unasked",a[a.Accepted=1]="Accepted",a[a.Rejected=2]="Rejected",a[a.Undecided=3]="Undecided"})(RebookingState||(RebookingState={}));let A=(()=>{let a=[],c,u=[],b=[],k,m=[],f=[],_,v=[],p=[],x,S,y,B,I,z,d,i,l,N;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;c=[h],k=[h],_=[h],x=[g({keepAlive:!0})],S=[g({keepAlive:!0})],y=[g({keepAlive:!0})],B=[g({keepAlive:!0})],I=[g],z=[g],d=[g({keepAlive:!0})],i=[R],l=[R],N=[R],o(this,null,x,{kind:"getter",name:"exhibitorById",static:!1,private:!1,access:{has:e=>"exhibitorById"in e,get:e=>e.exhibitorById},metadata:t},null,a),o(this,null,S,{kind:"getter",name:"exhibitorByExternalId",static:!1,private:!1,access:{has:e=>"exhibitorByExternalId"in e,get:e=>e.exhibitorByExternalId},metadata:t},null,a),o(this,null,y,{kind:"getter",name:"exhibitorByName",static:!1,private:!1,access:{has:e=>"exhibitorByName"in e,get:e=>e.exhibitorByName},metadata:t},null,a),o(this,null,B,{kind:"getter",name:"exhibitorBySlug",static:!1,private:!1,access:{has:e=>"exhibitorBySlug"in e,get:e=>e.exhibitorBySlug},metadata:t},null,a),o(this,null,I,{kind:"getter",name:"bookmarked",static:!1,private:!1,access:{has:e=>"bookmarked"in e,get:e=>e.bookmarked},metadata:t},null,a),o(this,null,z,{kind:"getter",name:"visited",static:!1,private:!1,access:{has:e=>"visited"in e,get:e=>e.visited},metadata:t},null,a),o(this,null,d,{kind:"getter",name:"advertised",static:!1,private:!1,access:{has:e=>"advertised"in e,get:e=>e.advertised},metadata:t},null,a),o(this,null,i,{kind:"method",name:"replaceBookmarked",static:!1,private:!1,access:{has:e=>"replaceBookmarked"in e,get:e=>e.replaceBookmarked},metadata:t},null,a),o(this,null,l,{kind:"method",name:"replaceVisited",static:!1,private:!1,access:{has:e=>"replaceVisited"in e,get:e=>e.replaceVisited},metadata:t},null,a),o(this,null,N,{kind:"method",name:"setRebookingState",static:!1,private:!1,access:{has:e=>"setRebookingState"in e,get:e=>e.setRebookingState},metadata:t},null,a),o(null,null,c,{kind:"field",name:"highlightedByExternalIds",static:!1,private:!1,access:{has:e=>"highlightedByExternalIds"in e,get:e=>e.highlightedByExternalIds,set:(e,n)=>{e.highlightedByExternalIds=n}},metadata:t},u,b),o(null,null,k,{kind:"field",name:"rebookingStateChangeRequested",static:!1,private:!1,access:{has:e=>"rebookingStateChangeRequested"in e,get:e=>e.rebookingStateChangeRequested,set:(e,n)=>{e.rebookingStateChangeRequested=n}},metadata:t},m,f),o(null,null,_,{kind:"field",name:"rebookingStateSaved",static:!1,private:!1,access:{has:e=>"rebookingStateSaved"in e,get:e=>e.rebookingStateSaved,set:(e,n)=>{e.rebookingStateSaved=n}},metadata:t},v,p),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=s(this,a);exhibitors=[];timeout;constructor(t){s(this,p),this.rootStore=t}highlightedByExternalIds=s(this,u,[]);rebookingStateChangeRequested=(s(this,b),s(this,m,!1));rebookingStateSaved=(s(this,f),s(this,v,!1));get exhibitorById(){return new Map(this.exhibitors.map(t=>[t.id,t]))}get exhibitorByExternalId(){return new Map(this.exhibitors.map(t=>[t.externalId,t]))}get exhibitorByName(){return new Map(this.exhibitors.map(t=>[t.name.toLowerCase(),t]))}get exhibitorBySlug(){return new Map(this.exhibitors.map(t=>[t.slug,t]))}get bookmarked(){return this.exhibitors.filter(t=>t.bookmarked)}get visited(){return this.exhibitors.filter(t=>t.visited)}get advertised(){return this.exhibitors.filter(t=>t.advertise&&t.logo?.url)}replaceBookmarked(t){if(!Array.isArray(t))return;const e=(t||[]).map(r=>this.exhibitorById.get(r)).filter(r=>r),n=new Set(e),E=this.bookmarked.filter(r=>!n.has(r));for(const r of E)r.bookmarked=!1;for(const r of e)r.bookmarked=!0}replaceVisited(t){if(!Array.isArray(t))return;const e=(t||[]).map(r=>this.exhibitorById.get(r)).filter(r=>r),n=new Set(e),E=this.visited.filter(r=>!n.has(r));for(const r of E)r.visited=!1;for(const r of e)r.visited=!0}setRebookingState(t,e,n){clearTimeout(this.timeout),this.rebookingStateChangeRequested=!1,t.rebookingState=e,t.rebookingNote=n;const E=C("api/v1/set-rebooking-state",{rt:U(),expoKey:this.rootStore.fp.eventId});fetch(E,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expoKey:w.EXPO,exhibitorId:t.id,rebookingState:e,rebookingNote:n})}).then(r=>{r.ok&&(this.rebookingStateSaved=!0),!r.ok&&!q&&(t.rebookingState=RebookingState.Unasked,this.rebookingStateSaved=!1)}).catch(()=>{t.rebookingState=RebookingState.Unasked,this.rebookingStateSaved=!1}).finally(()=>{this.rebookingStateChangeRequested=!0,this.timeout=setTimeout(()=>{this.rebookingStateChangeRequested=!1},5e3)})}findExhibitor(t){return this.exhibitorByExternalId.get(t)||this.exhibitorByName.get(t.toLowerCase())||this.exhibitorBySlug.get(t)}}})();export default A;let T=(()=>{let a,c=[],u=[],b,k=[],m=[],f,_=[],v=[],p,x=[],S=[],y,B=[],I=[];return class{static{const d=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;a=[h],b=[h],f=[h],p=[h],y=[h],o(null,null,a,{kind:"field",name:"featured",static:!1,private:!1,access:{has:i=>"featured"in i,get:i=>i.featured,set:(i,l)=>{i.featured=l}},metadata:d},c,u),o(null,null,b,{kind:"field",name:"bookmarked",static:!1,private:!1,access:{has:i=>"bookmarked"in i,get:i=>i.bookmarked,set:(i,l)=>{i.bookmarked=l}},metadata:d},k,m),o(null,null,f,{kind:"field",name:"visited",static:!1,private:!1,access:{has:i=>"visited"in i,get:i=>i.visited,set:(i,l)=>{i.visited=l}},metadata:d},_,v),o(null,null,p,{kind:"field",name:"rebookingState",static:!1,private:!1,access:{has:i=>"rebookingState"in i,get:i=>i.rebookingState,set:(i,l)=>{i.rebookingState=l}},metadata:d},x,S),o(null,null,y,{kind:"field",name:"rebookingNote",static:!1,private:!1,access:{has:i=>"rebookingNote"in i,get:i=>i.rebookingNote,set:(i,l)=>{i.rebookingNote=l}},metadata:d},B,I),d&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:d})}store;id;name;externalId;featured=s(this,c,void 0);advertise=s(this,u);description;address;address2;city;state;zip;country;phone1;website;facebook;instagram;linkedin;twitter;googlePlus;xing;youtube;email;privateEmail;customButtonTitle;customButtonUrl;customButton2Title;customButton2Url;customButton3Title;customButton3Url;leadingImageUrl;leadingImageLinkUrl;videoUrl;order;logo;logoInBooth;gallery;marketMaterials;slug;bookmarked=s(this,k,void 0);visited=(s(this,m),s(this,_,void 0));rebookingState=(s(this,v),s(this,x,void 0));rebookingNote=(s(this,S),s(this,B,void 0));booths=s(this,I);categories;schedule;entity={type:"exhibitor"}}})();export{T as Exhibitor};
@@ -1 +1 @@
1
- import{__esDecorate as l,__runInitializers as d}from"tslib";import{Box as W}from"@expofp/geometry";import{action as g,computed as h,observable as m,runInAction as j}from"mobx";import B from"../components/Map/drawing/config/config-load-layer";import D from"../tools/settings";import{areLayersEnabled as N}from"../utils/areLayersEnabled";import{shortenName as U}from"../utils/shortenName";import s from".";const H=["money2020usa","rodion2","possible2025","2025virtuosotravelweek","zscalerskofy26","gamescom2025"];export var LayersMode;(function(i){i[i.Default=0]="Default",i[i.Separated=1]="Separated",i[i.Radio=2]="Radio",i[i.CheckBox=3]="CheckBox"})(LayersMode||(LayersMode={}));export var LayerMode;(function(i){i[i.Unset=0]="Unset",i[i.AlwaysVisible=1]="AlwaysVisible",i[i.AlwaysHidden=2]="AlwaysHidden",i[i.TurnedOn=3]="TurnedOn",i[i.TurnedOff=4]="TurnedOff"})(LayerMode||(LayerMode={}));let C=(()=>{let i,y=[],p=[],v,b=[],_=[];return class{static{const c=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;i=[m],v=[m],l(null,null,i,{kind:"field",name:"loaded",static:!1,private:!1,access:{has:n=>"loaded"in n,get:n=>n.loaded,set:(n,u)=>{n.loaded=u}},metadata:c},y,p),l(null,null,v,{kind:"field",name:"visible",static:!1,private:!1,access:{has:n=>"visible"in n,get:n=>n.visible,set:(n,u)=>{n.visible=u}},metadata:c},b,_),c&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c})}basePriority;name;description;frozen;rect=null;viewbox=null;configured;childLayers=[];rootParent=null;mode;children=[];pathway;floorIndex;loaded=d(this,y,void 0);visible=(d(this,p),d(this,b,void 0));get shortName(){return U(this.description)}constructor(){d(this,_)}}})();export{C as Layer};let X=(()=>{let i=[],y,p=[],v=[],b,_=[],w=[],c,n=[],u=[],L,x=[],S=[],k,P,T,R,V,I,z,A,E,O;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;y=[m],b=[m],c=[m],L=[m],k=[h({keepAlive:!0})],P=[h({keepAlive:!0})],T=[h({keepAlive:!0})],R=[h({keepAlive:!0})],V=[h],I=[h],z=[g],A=[g],E=[g],O=[g],l(this,null,k,{kind:"getter",name:"visible",static:!1,private:!1,access:{has:e=>"visible"in e,get:e=>e.visible},metadata:t},null,i),l(this,null,P,{kind:"getter",name:"loaded",static:!1,private:!1,access:{has:e=>"loaded"in e,get:e=>e.loaded},metadata:t},null,i),l(this,null,T,{kind:"getter",name:"rectangle",static:!1,private:!1,access:{has:e=>"rectangle"in e,get:e=>e.rectangle},metadata:t},null,i),l(this,null,R,{kind:"getter",name:"viewboxRectangle",static:!1,private:!1,access:{has:e=>"viewboxRectangle"in e,get:e=>e.viewboxRectangle},metadata:t},null,i),l(this,null,V,{kind:"getter",name:"pathwayLayers",static:!1,private:!1,access:{has:e=>"pathwayLayers"in e,get:e=>e.pathwayLayers},metadata:t},null,i),l(this,null,I,{kind:"getter",name:"floors",static:!1,private:!1,access:{has:e=>"floors"in e,get:e=>e.floors},metadata:t},null,i),l(this,null,z,{kind:"method",name:"selectFloor",static:!1,private:!1,access:{has:e=>"selectFloor"in e,get:e=>e.selectFloor},metadata:t},null,i),l(this,null,A,{kind:"method",name:"updateVisibility",static:!1,private:!1,access:{has:e=>"updateVisibility"in e,get:e=>e.updateVisibility},metadata:t},null,i),l(this,null,E,{kind:"method",name:"showPathWay",static:!1,private:!1,access:{has:e=>"showPathWay"in e,get:e=>e.showPathWay},metadata:t},null,i),l(this,null,O,{kind:"method",name:"hidePathways",static:!1,private:!1,access:{has:e=>"hidePathways"in e,get:e=>e.hidePathways},metadata:t},null,i),l(null,null,y,{kind:"field",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers,set:(e,a)=>{e.layers=a}},metadata:t},p,v),l(null,null,b,{kind:"field",name:"defaultLayer",static:!1,private:!1,access:{has:e=>"defaultLayer"in e,get:e=>e.defaultLayer,set:(e,a)=>{e.defaultLayer=a}},metadata:t},_,w),l(null,null,c,{kind:"field",name:"mode",static:!1,private:!1,access:{has:e=>"mode"in e,get:e=>e.mode,set:(e,a)=>{e.mode=a}},metadata:t},n,u),l(null,null,L,{kind:"field",name:"layersLoaded",static:!1,private:!1,access:{has:e=>"layersLoaded"in e,get:e=>e.layersLoaded,set:(e,a)=>{e.layersLoaded=a}},metadata:t},x,S),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}layers=(d(this,i),d(this,p,[]));defaultLayer=(d(this,v),d(this,_,void 0));mode=(d(this,w),d(this,n,void 0));layersLoaded=(d(this,u),d(this,x,!1));updateVisibilityTimeout=(d(this,S),0);selectFloorTimeout=0;get visible(){return this.layers.filter(t=>t.frozen||t.visible)}get loaded(){return this.layers.filter(t=>t.loaded)}get rectangle(){var t=this.visible.filter(e=>!e.frozen).map(e=>e.viewbox??e.rect);return this.mode!==LayersMode.Radio||!t.length?null:W.fromUnion(...t)||null}get viewboxRectangle(){var t=this.visible.filter(e=>!e.frozen&&e.viewbox).map(e=>e.viewbox);return t.length&&W.fromUnion(...t)||null}get pathwayLayers(){return this.layers.filter(t=>t.pathway)}get floors(){if(!N())return[];const t=new Set(this.layers.filter(a=>a&&!a.frozen&&!a.rootParent&&!a.pathway).concat(s.routeStore.layers.filter(a=>a&&a.mode!==LayerMode.AlwaysHidden&&a.mode!==LayerMode.AlwaysVisible))),e=Array.from(t).reverse();return e.map((a,r)=>{const o=s.routeStore.layers.length>0&&s.routeStore.layers.indexOf(a)===-1,f=s.toursStore.tourLayers.length>0&&s.toursStore.tourLayers.indexOf(a)===-1;return{layer:a,name:a.name,shortName:a.shortName,description:a.description,active:a.visible,disabled:!!(o||f),index:a.floorIndex??e.length-r-1}})}selectFloor(t){if(this.selectFloorTimeout)return;this.selectFloorTimeout=setTimeout(()=>this.selectFloorTimeout=0,500);const e=this.layers.find(r=>r.description===t.description);if(!e)return;if(this.mode===LayersMode.Radio){if(this.updateVisibility(e,!0),s.maplibreStore.showMaplibre)return;if(!!window.__fpSettings?.fpVer||H.includes(D.EXPO)){const o=e.viewbox??e.rect;s.uiState.moveToRect=o}else{const o=this.layers.indexOf(this.layers.filter(F=>!F.frozen&&F.visible)[0]),f=this.layers.indexOf(e);if(o===f)return;s.uiState.zoomBy=f<o?.95:1.05}}else this.updateVisibility(e,!e.visible);const a=s.toursStore.getTourLayerInfo(e.name)||s.toursStore.getTourLayerInfo(e.description);if(a){this.showPathWay(a.id);return}s.toursStore.stopTour()}updateVisibility(t,e){if(this.mode===LayersMode.Radio&&!e)return;const a=t instanceof C?t:this.findLayer(t);if(!a||a.visible===e){a&&s.routeStore.currentRouteLayer!==a&&(s.routeStore.currentRouteLayer=a);return}B(a,s.rendererService).then(()=>{this.mode===LayersMode.Radio&&this.layers.filter(r=>!r.pathway).forEach(r=>{r.name!==a.name&&!r.frozen&&r.visible&&(r.visible=!1,r.childLayers.forEach(o=>{o.visible=!1}))}),a&&(a.visible=e,a.childLayers.forEach(r=>{r.visible=e}),e&&(s.routeStore.currentRouteLayer=a),typeof s.fp.onFloorActivated=="function"&&(clearTimeout(this.updateVisibilityTimeout),this.updateVisibilityTimeout=setTimeout(()=>{const r=s.fp.getFloors();s.fp.onFloorActivated(r.find(o=>o.name===a.name))})))})}findLayer(t){if(t==null)return null;const e=this.layers.filter(r=>!r.rootParent);if(typeof t=="number"&&(a=e.filter(r=>!r.frozen)[t],a))return a;t=t.toString().toLowerCase();var a=e.find(r=>{const o=(r.name.match(/(-?[0-9]+)/)||"")[0];return t===r?.name.toLowerCase()||t===r?.description.toLowerCase()||t===r?.shortName.toLowerCase()||t===o});return!a&&!/\D/.test(t)&&(a=e.filter(r=>!r.frozen)[parseInt(t)]),a}getPathwayList(){return this.layers.filter(t=>t.pathway)}async showPathWay(t){try{const e=this.findLayer(t);if(!e)throw new Error(`There is no pathway with this name. ${t}`);await B(e,s.rendererService);const a=this.getPathwayList();j(()=>{a.forEach(r=>{const o=r.name===t;r.visible=o,r.childLayers.forEach(f=>{f.visible=o})})})}catch(e){console.error("showPathWay",e)}}hidePathways(){this.getPathwayList().forEach(e=>{e.visible=!1,e.childLayers.forEach(a=>{a.visible=!1})})}}})();export default X;
1
+ import{__esDecorate as l,__runInitializers as d}from"tslib";import{getFpSvgJs as j}from"../data/fp-payloads";import{Box as W}from"@expofp/geometry";import{action as g,computed as h,observable as m,runInAction as D}from"mobx";import B from"../components/Map/drawing/config/config-load-layer";import N from"../tools/settings";import{areLayersEnabled as U}from"../utils/areLayersEnabled";import{shortenName as H}from"../utils/shortenName";import s from".";const X=["money2020usa","rodion2","possible2025","2025virtuosotravelweek","zscalerskofy26","gamescom2025"];export var LayersMode;(function(i){i[i.Default=0]="Default",i[i.Separated=1]="Separated",i[i.Radio=2]="Radio",i[i.CheckBox=3]="CheckBox"})(LayersMode||(LayersMode={}));export var LayerMode;(function(i){i[i.Unset=0]="Unset",i[i.AlwaysVisible=1]="AlwaysVisible",i[i.AlwaysHidden=2]="AlwaysHidden",i[i.TurnedOn=3]="TurnedOn",i[i.TurnedOff=4]="TurnedOff"})(LayerMode||(LayerMode={}));let C=(()=>{let i,y=[],p=[],v,b=[],_=[];return class{static{const c=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;i=[m],v=[m],l(null,null,i,{kind:"field",name:"loaded",static:!1,private:!1,access:{has:n=>"loaded"in n,get:n=>n.loaded,set:(n,u)=>{n.loaded=u}},metadata:c},y,p),l(null,null,v,{kind:"field",name:"visible",static:!1,private:!1,access:{has:n=>"visible"in n,get:n=>n.visible,set:(n,u)=>{n.visible=u}},metadata:c},b,_),c&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:c})}basePriority;name;description;frozen;rect=null;viewbox=null;configured;childLayers=[];rootParent=null;mode;children=[];pathway;floorIndex;loaded=d(this,y,void 0);visible=(d(this,p),d(this,b,void 0));get shortName(){return H(this.description)}constructor(){d(this,_)}}})();export{C as Layer};let q=(()=>{let i=[],y,p=[],v=[],b,_=[],w=[],c,n=[],u=[],L,x=[],S=[],k,P,T,R,V,I,z,A,E,F;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;y=[m],b=[m],c=[m],L=[m],k=[h({keepAlive:!0})],P=[h({keepAlive:!0})],T=[h({keepAlive:!0})],R=[h({keepAlive:!0})],V=[h],I=[h],z=[g],A=[g],E=[g],F=[g],l(this,null,k,{kind:"getter",name:"visible",static:!1,private:!1,access:{has:e=>"visible"in e,get:e=>e.visible},metadata:t},null,i),l(this,null,P,{kind:"getter",name:"loaded",static:!1,private:!1,access:{has:e=>"loaded"in e,get:e=>e.loaded},metadata:t},null,i),l(this,null,T,{kind:"getter",name:"rectangle",static:!1,private:!1,access:{has:e=>"rectangle"in e,get:e=>e.rectangle},metadata:t},null,i),l(this,null,R,{kind:"getter",name:"viewboxRectangle",static:!1,private:!1,access:{has:e=>"viewboxRectangle"in e,get:e=>e.viewboxRectangle},metadata:t},null,i),l(this,null,V,{kind:"getter",name:"pathwayLayers",static:!1,private:!1,access:{has:e=>"pathwayLayers"in e,get:e=>e.pathwayLayers},metadata:t},null,i),l(this,null,I,{kind:"getter",name:"floors",static:!1,private:!1,access:{has:e=>"floors"in e,get:e=>e.floors},metadata:t},null,i),l(this,null,z,{kind:"method",name:"selectFloor",static:!1,private:!1,access:{has:e=>"selectFloor"in e,get:e=>e.selectFloor},metadata:t},null,i),l(this,null,A,{kind:"method",name:"updateVisibility",static:!1,private:!1,access:{has:e=>"updateVisibility"in e,get:e=>e.updateVisibility},metadata:t},null,i),l(this,null,E,{kind:"method",name:"showPathWay",static:!1,private:!1,access:{has:e=>"showPathWay"in e,get:e=>e.showPathWay},metadata:t},null,i),l(this,null,F,{kind:"method",name:"hidePathways",static:!1,private:!1,access:{has:e=>"hidePathways"in e,get:e=>e.hidePathways},metadata:t},null,i),l(null,null,y,{kind:"field",name:"layers",static:!1,private:!1,access:{has:e=>"layers"in e,get:e=>e.layers,set:(e,a)=>{e.layers=a}},metadata:t},p,v),l(null,null,b,{kind:"field",name:"defaultLayer",static:!1,private:!1,access:{has:e=>"defaultLayer"in e,get:e=>e.defaultLayer,set:(e,a)=>{e.defaultLayer=a}},metadata:t},_,w),l(null,null,c,{kind:"field",name:"mode",static:!1,private:!1,access:{has:e=>"mode"in e,get:e=>e.mode,set:(e,a)=>{e.mode=a}},metadata:t},n,u),l(null,null,L,{kind:"field",name:"layersLoaded",static:!1,private:!1,access:{has:e=>"layersLoaded"in e,get:e=>e.layersLoaded,set:(e,a)=>{e.layersLoaded=a}},metadata:t},x,S),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}layers=(d(this,i),d(this,p,[]));defaultLayer=(d(this,v),d(this,_,void 0));mode=(d(this,w),d(this,n,void 0));layersLoaded=(d(this,u),d(this,x,!1));updateVisibilityTimeout=(d(this,S),0);selectFloorTimeout=0;get visible(){return this.layers.filter(t=>t.frozen||t.visible)}get loaded(){return this.layers.filter(t=>t.loaded)}get rectangle(){var t=this.visible.filter(e=>!e.frozen).map(e=>e.viewbox??e.rect);return this.mode!==LayersMode.Radio||!t.length?null:W.fromUnion(...t)||null}get viewboxRectangle(){var t=this.visible.filter(e=>!e.frozen&&e.viewbox).map(e=>e.viewbox);return t.length&&W.fromUnion(...t)||null}get pathwayLayers(){return this.layers.filter(t=>t.pathway)}get floors(){if(!U())return[];const t=new Set(this.layers.filter(a=>a&&!a.frozen&&!a.rootParent&&!a.pathway).concat(s.routeStore.layers.filter(a=>a&&a.mode!==LayerMode.AlwaysHidden&&a.mode!==LayerMode.AlwaysVisible))),e=Array.from(t).reverse();return e.map((a,r)=>{const o=s.routeStore.layers.length>0&&s.routeStore.layers.indexOf(a)===-1,f=s.toursStore.tourLayers.length>0&&s.toursStore.tourLayers.indexOf(a)===-1;return{layer:a,name:a.name,shortName:a.shortName,description:a.description,active:a.visible,disabled:!!(o||f),index:a.floorIndex??e.length-r-1}})}selectFloor(t){if(this.selectFloorTimeout)return;this.selectFloorTimeout=setTimeout(()=>this.selectFloorTimeout=0,500);const e=this.layers.find(r=>r.description===t.description);if(!e)return;if(this.mode===LayersMode.Radio){if(this.updateVisibility(e,!0),s.maplibreStore.showMaplibre)return;if(!!j().__fpSettings?.fpVer||X.includes(N.EXPO)){const o=e.viewbox??e.rect;s.uiState.moveToRect=o}else{const o=this.layers.indexOf(this.layers.filter(O=>!O.frozen&&O.visible)[0]),f=this.layers.indexOf(e);if(o===f)return;s.uiState.zoomBy=f<o?.95:1.05}}else this.updateVisibility(e,!e.visible);const a=s.toursStore.getTourLayerInfo(e.name)||s.toursStore.getTourLayerInfo(e.description);if(a){this.showPathWay(a.id);return}s.toursStore.stopTour()}updateVisibility(t,e){if(this.mode===LayersMode.Radio&&!e)return;const a=t instanceof C?t:this.findLayer(t);if(!a||a.visible===e){a&&s.routeStore.currentRouteLayer!==a&&(s.routeStore.currentRouteLayer=a);return}B(a,s.rendererService).then(()=>{this.mode===LayersMode.Radio&&this.layers.filter(r=>!r.pathway).forEach(r=>{r.name!==a.name&&!r.frozen&&r.visible&&(r.visible=!1,r.childLayers.forEach(o=>{o.visible=!1}))}),a&&(a.visible=e,a.childLayers.forEach(r=>{r.visible=e}),e&&(s.routeStore.currentRouteLayer=a),typeof s.fp.onFloorActivated=="function"&&(clearTimeout(this.updateVisibilityTimeout),this.updateVisibilityTimeout=setTimeout(()=>{const r=s.fp.getFloors();s.fp.onFloorActivated(r.find(o=>o.name===a.name))})))})}findLayer(t){if(t==null)return null;const e=this.layers.filter(r=>!r.rootParent);if(typeof t=="number"&&(a=e.filter(r=>!r.frozen)[t],a))return a;t=t.toString().toLowerCase();var a=e.find(r=>{const o=(r.name.match(/(-?[0-9]+)/)||"")[0];return t===r?.name.toLowerCase()||t===r?.description.toLowerCase()||t===r?.shortName.toLowerCase()||t===o});return!a&&!/\D/.test(t)&&(a=e.filter(r=>!r.frozen)[parseInt(t)]),a}getPathwayList(){return this.layers.filter(t=>t.pathway)}async showPathWay(t){try{const e=this.findLayer(t);if(!e)throw new Error(`There is no pathway with this name. ${t}`);await B(e,s.rendererService);const a=this.getPathwayList();D(()=>{a.forEach(r=>{const o=r.name===t;r.visible=o,r.childLayers.forEach(f=>{f.visible=o})})})}catch(e){console.error("showPathWay",e)}}hidePathways(){this.getPathwayList().forEach(e=>{e.visible=!1,e.childLayers.forEach(a=>{a.visible=!1})})}}})();export default q;
@@ -1 +1 @@
1
- import{__esDecorate as i,__runInitializers as l}from"tslib";import{registerEnumSetting as I}from"@expofp/debug";import{action as o,computed as r,observable as d}from"mobx";import n from"../data";import{fpGeo as z}from"../data/fpGeo";const A=import.meta.env?.VITE_EXPOFP_USE_MAPLIBRE_MAP==="true",B=import.meta.env?.VITE_EXPOFP_DISABLE_3D_TOGGLE!=="false";function L(){return typeof window>"u"||window.navigator.onLine}let x=(()=>{let a=[],p,m=[],c=[],f,h=[],u=[],b,M=[],_=[],w,v,g,O,S,E,V,k;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;p=[d],f=[d],b=[d],w=[o],v=[o],g=[o],O=[r({keepAlive:!0})],S=[r({keepAlive:!0})],E=[r({keepAlive:!0})],V=[r({keepAlive:!0})],k=[r({keepAlive:!0})],i(this,null,w,{kind:"method",name:"setOnline",static:!1,private:!1,access:{has:e=>"setOnline"in e,get:e=>e.setOnline},metadata:t},null,a),i(this,null,v,{kind:"method",name:"activateMaplibre",static:!1,private:!1,access:{has:e=>"activateMaplibre"in e,get:e=>e.activateMaplibre},metadata:t},null,a),i(this,null,g,{kind:"method",name:"deactivateMaplibre",static:!1,private:!1,access:{has:e=>"deactivateMaplibre"in e,get:e=>e.deactivateMaplibre},metadata:t},null,a),i(this,null,O,{kind:"getter",name:"hideModeSwitchButton",static:!1,private:!1,access:{has:e=>"hideModeSwitchButton"in e,get:e=>e.hideModeSwitchButton},metadata:t},null,a),i(this,null,S,{kind:"getter",name:"maplibreEnabled",static:!1,private:!1,access:{has:e=>"maplibreEnabled"in e,get:e=>e.maplibreEnabled},metadata:t},null,a),i(this,null,E,{kind:"getter",name:"useMaplibreMap",static:!1,private:!1,access:{has:e=>"useMaplibreMap"in e,get:e=>e.useMaplibreMap},metadata:t},null,a),i(this,null,V,{kind:"getter",name:"showMaplibre",static:!1,private:!1,access:{has:e=>"showMaplibre"in e,get:e=>e.showMaplibre},metadata:t},null,a),i(this,null,k,{kind:"getter",name:"isMap3d",static:!1,private:!1,access:{has:e=>"isMap3d"in e,get:e=>e.isMap3d},metadata:t},null,a),i(null,null,p,{kind:"field",name:"mapViewMode",static:!1,private:!1,access:{has:e=>"mapViewMode"in e,get:e=>e.mapViewMode,set:(e,s)=>{e.mapViewMode=s}},metadata:t},m,c),i(null,null,f,{kind:"field",name:"maplibreSelected",static:!1,private:!1,access:{has:e=>"maplibreSelected"in e,get:e=>e.maplibreSelected,set:(e,s)=>{e.maplibreSelected=s}},metadata:t},h,u),i(null,null,b,{kind:"field",name:"isOnline",static:!1,private:!1,access:{has:e=>"isOnline"in e,get:e=>e.isOnline,set:(e,s)=>{e.isOnline=s}},metadata:t},M,_),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=l(this,a);mapViewMode=l(this,m,"floorplan");maplibreSelected=(l(this,c),l(this,h,!1));isOnline=(l(this,u),l(this,M,L()));handleOnline=(l(this,_),()=>this.setOnline(!0));handleOffline=()=>this.setOnline(!1);constructor(t){this.rootStore=t,this.mapViewMode=this.getInitialViewMode(),this.maplibreSelected=this.mapViewMode!=="floorplan",typeof window<"u"&&(window.addEventListener("online",this.handleOnline),window.addEventListener("offline",this.handleOffline))}dispose(){typeof window>"u"||(window.removeEventListener("online",this.handleOnline),window.removeEventListener("offline",this.handleOffline))}setOnline(t){this.isOnline=t}activateMaplibre(){this.maplibreEnabled&&(this.mapViewMode=n.allow3dView&&this.mapViewMode!=="map3d"?"map3d":"map2d",this.maplibreSelected=!0)}deactivateMaplibre(){this.mapViewMode="floorplan",this.maplibreSelected=!1}get hideModeSwitchButton(){return!this.maplibreEnabled||!n.allow3dView||B||n.hideModeSwitchButton}get maplibreEnabled(){const t=this.rootStore.fp?.maplibre??window.__efpMaplibre,e=!!t?.offline&&(!!t.style||!!t.styleUrl);return this.useMaplibreMap&&!!z?.properties?.config&&!this.rootStore.uiState.kiosk&&(this.isOnline||e)}get useMaplibreMap(){if(y.get()==="on")return!0;if(y.get()==="off")return!1;const t=n.flags?.enableExperimentalMaplibre;return typeof t=="boolean"?t:A}get showMaplibre(){return this.maplibreEnabled&&(this.mapViewMode==="map2d"||this.mapViewMode==="map3d")}get isMap3d(){return this.maplibreEnabled&&this.mapViewMode==="map3d"}getInitialViewMode(){return this.maplibreEnabled?n.allow3dView&&!n.hide3dMapDefault?"map3d":"map2d":"floorplan"}}})();export default x;const y=I({key:"efp:maplibre:override",values:["default","on","off"],default:"default"});
1
+ import{__esDecorate as i,__runInitializers as l}from"tslib";import{action as d,computed as r,observable as o}from"mobx";import n from"../data";import{fpGeo as y}from"../data/fpGeo";const I=import.meta.env?.VITE_EXPOFP_DISABLE_3D_TOGGLE!=="false";function z(){return typeof window>"u"||window.navigator.onLine}let B=(()=>{let a=[],p,m=[],c=[],h,f=[],u=[],b,M=[],w=[],_,v,g,O,S,V,E,k;return class{static{const t=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;p=[o],h=[o],b=[o],_=[d],v=[d],g=[d],O=[r({keepAlive:!0})],S=[r({keepAlive:!0})],V=[r({keepAlive:!0})],E=[r({keepAlive:!0})],k=[r({keepAlive:!0})],i(this,null,_,{kind:"method",name:"setOnline",static:!1,private:!1,access:{has:e=>"setOnline"in e,get:e=>e.setOnline},metadata:t},null,a),i(this,null,v,{kind:"method",name:"activateMaplibre",static:!1,private:!1,access:{has:e=>"activateMaplibre"in e,get:e=>e.activateMaplibre},metadata:t},null,a),i(this,null,g,{kind:"method",name:"deactivateMaplibre",static:!1,private:!1,access:{has:e=>"deactivateMaplibre"in e,get:e=>e.deactivateMaplibre},metadata:t},null,a),i(this,null,O,{kind:"getter",name:"hideModeSwitchButton",static:!1,private:!1,access:{has:e=>"hideModeSwitchButton"in e,get:e=>e.hideModeSwitchButton},metadata:t},null,a),i(this,null,S,{kind:"getter",name:"maplibreEnabled",static:!1,private:!1,access:{has:e=>"maplibreEnabled"in e,get:e=>e.maplibreEnabled},metadata:t},null,a),i(this,null,V,{kind:"getter",name:"useMaplibreMap",static:!1,private:!1,access:{has:e=>"useMaplibreMap"in e,get:e=>e.useMaplibreMap},metadata:t},null,a),i(this,null,E,{kind:"getter",name:"showMaplibre",static:!1,private:!1,access:{has:e=>"showMaplibre"in e,get:e=>e.showMaplibre},metadata:t},null,a),i(this,null,k,{kind:"getter",name:"isMap3d",static:!1,private:!1,access:{has:e=>"isMap3d"in e,get:e=>e.isMap3d},metadata:t},null,a),i(null,null,p,{kind:"field",name:"mapViewMode",static:!1,private:!1,access:{has:e=>"mapViewMode"in e,get:e=>e.mapViewMode,set:(e,s)=>{e.mapViewMode=s}},metadata:t},m,c),i(null,null,h,{kind:"field",name:"maplibreSelected",static:!1,private:!1,access:{has:e=>"maplibreSelected"in e,get:e=>e.maplibreSelected,set:(e,s)=>{e.maplibreSelected=s}},metadata:t},f,u),i(null,null,b,{kind:"field",name:"isOnline",static:!1,private:!1,access:{has:e=>"isOnline"in e,get:e=>e.isOnline,set:(e,s)=>{e.isOnline=s}},metadata:t},M,w),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}rootStore=l(this,a);mapViewMode=l(this,m,"floorplan");maplibreSelected=(l(this,c),l(this,f,!1));isOnline=(l(this,u),l(this,M,z()));handleOnline=(l(this,w),()=>this.setOnline(!0));handleOffline=()=>this.setOnline(!1);constructor(t){this.rootStore=t,this.mapViewMode=this.getInitialViewMode(),this.maplibreSelected=this.mapViewMode!=="floorplan",typeof window<"u"&&(window.addEventListener("online",this.handleOnline),window.addEventListener("offline",this.handleOffline))}dispose(){typeof window>"u"||(window.removeEventListener("online",this.handleOnline),window.removeEventListener("offline",this.handleOffline))}setOnline(t){this.isOnline=t}activateMaplibre(){this.maplibreEnabled&&(this.mapViewMode=n.allow3dView&&this.mapViewMode!=="map3d"?"map3d":"map2d",this.maplibreSelected=!0)}deactivateMaplibre(){this.mapViewMode="floorplan",this.maplibreSelected=!1}get hideModeSwitchButton(){return!this.maplibreEnabled||!n.allow3dView||I||n.hideModeSwitchButton}get maplibreEnabled(){const t=this.rootStore.fp?.maplibre??window.__efpMaplibre,e=!!t?.offline&&(!!t.style||!!t.styleUrl);return this.useMaplibreMap&&!!y?.properties?.config&&!this.rootStore.uiState.kiosk&&(this.isOnline||e)}get useMaplibreMap(){return!!n.enableExperimentalMaplibre}get showMaplibre(){return this.maplibreEnabled&&(this.mapViewMode==="map2d"||this.mapViewMode==="map3d")}get isMap3d(){return this.maplibreEnabled&&this.mapViewMode==="map3d"}getInitialViewMode(){return this.maplibreEnabled?n.allow3dView&&!n.hide3dMapDefault?"map3d":"map2d":"floorplan"}}})();export default B;
@@ -1,4 +1,4 @@
1
- import { RawPoiType } from '../data/Data';
1
+ import { RawPoiType } from '@expofp/schema';
2
2
  import RootStore from './RootStore';
3
3
  export default class PoiTypeStore {
4
4
  private readonly rootStore;